Skip to content

Commit 22e00b7

Browse files
committed
Simplify moving features between gems
1 parent 29d2958 commit 22e00b7

File tree

7 files changed

+60
-47
lines changed

7 files changed

+60
-47
lines changed

concurrent-ruby-edge.gemspec

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
11
$:.push File.join(File.dirname(__FILE__), 'lib')
22

33
require 'concurrent/version'
4-
require 'concurrent/edge/version'
4+
require 'concurrent/file_map'
55

66
Gem::Specification.new do |s|
7-
s.name = 'concurrent-ruby-edge'
8-
s.version = Concurrent::Edge::VERSION
9-
s.platform = Gem::Platform::RUBY
10-
s.authors = ["Jerry D'Antonio", 'The Ruby Concurrency Team']
11-
12-
s.homepage = 'http://www.concurrent-ruby.com'
13-
s.summary = <<-TXT
14-
Edge features and additions to the concurrent-ruby gem.
15-
7+
git_files = `git ls-files`.split("\n")
8+
9+
s.name = 'concurrent-ruby-edge'
10+
s.version = Concurrent::EDGE_VERSION
11+
s.platform = Gem::Platform::RUBY
12+
s.authors = ["Jerry D'Antonio", 'The Ruby Concurrency Team']
13+
14+
s.homepage = 'http://www.concurrent-ruby.com'
15+
s.summary = 'Edge features and additions to the concurrent-ruby gem.'
16+
s.license = 'MIT'
17+
s.date = Time.now.strftime('%Y-%m-%d')
18+
s.files = Concurrent::FILE_MAP.fetch :edge
19+
s.extra_rdoc_files = Dir['README*', 'LICENSE*']
20+
s.require_paths = ['lib']
21+
s.description = <<-TXT
1622
These features are under active development and may change frequently. They are expected not to
1723
keep backward compatibility (there may also lack tests and documentation). Semantic versions will
1824
be obeyed though. Features developed in `concurrent-ruby-edge` are expected to move to `concurrent-ruby` when final.
25+
Please see http://concurrent-ruby.com for more information.
1926
TXT
2027

21-
s.license = 'MIT'
22-
s.date = Time.now.strftime('%Y-%m-%d')
23-
24-
s.description = <<-EOF
25-
Experimental features and additions to the concurrent-ruby gem.
26-
Minimally tested and documented.
27-
Please see http://concurrent-ruby.com for more information.
28-
EOF
29-
30-
s.files = Dir['lib/concurrent/edge.rb', 'lib/concurrent/edge/**/*.rb']
31-
s.files += Dir['lib/concurrent/actor.rb', 'lib/concurrent/actor/**/*.rb']
32-
s.files += Dir['lib/concurrent/channel.rb', 'lib/concurrent/channel/**/*.rb']
33-
s.extra_rdoc_files = Dir['README*', 'LICENSE*']
34-
s.require_paths = ['lib']
35-
3628
s.required_ruby_version = '>= 1.9.3'
3729

3830
s.add_runtime_dependency 'concurrent-ruby', "~> #{Concurrent::VERSION}"

concurrent-ruby.gemspec

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
$:.push File.join(File.dirname(__FILE__), 'lib')
22

33
require 'concurrent/version'
4+
require 'concurrent/file_map'
45

56
Gem::Specification.new do |s|
6-
s.name = 'concurrent-ruby'
7-
s.version = Concurrent::VERSION
8-
s.platform = Gem::Platform::RUBY
9-
s.author = "Jerry D'Antonio"
10-
s.email = '[email protected]'
11-
s.homepage = 'http://www.concurrent-ruby.com'
12-
s.summary = 'Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell, F#, C#, Java, and classic concurrency patterns.'
13-
s.license = 'MIT'
14-
s.date = Time.now.strftime('%Y-%m-%d')
7+
git_files = `git ls-files`.split("\n")
158

16-
s.description = <<-EOF
17-
Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
18-
Inspired by Erlang, Clojure, Go, JavaScript, actors, and classic concurrency patterns.
19-
EOF
20-
21-
s.files = Dir['lib/**/*.rb'].delete_if{|path| path =~ /actor|channel|edge/}
9+
s.name = 'concurrent-ruby'
10+
s.version = Concurrent::VERSION
11+
s.platform = Gem::Platform::RUBY
12+
s.authors = ["Jerry D'Antonio", 'The Ruby Concurrency Team']
13+
14+
s.homepage = 'http://www.concurrent-ruby.com'
15+
s.summary = 'Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell, F#, C#, Java, and classic concurrency patterns.'
16+
s.license = 'MIT'
17+
s.date = Time.now.strftime('%Y-%m-%d')
18+
s.files = Concurrent::FILE_MAP.fetch :core
2219
s.extra_rdoc_files = Dir['README*', 'LICENSE*', 'CHANGELOG*']
2320
s.require_paths = ['lib']
21+
s.description = <<-EOF
22+
Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
23+
Inspired by Erlang, Clojure, Go, JavaScript, actors, and classic concurrency patterns.
24+
EOF
2425

2526
if defined?(JRUBY_VERSION)
26-
s.files += Dir['lib/**/*.jar']
27+
s.files += Dir['lib/**/*.jar']
2728
s.platform = 'java'
2829
else
2930
s.add_runtime_dependency 'ref', '~> 1.0', '>= 1.0.5'

lib/concurrent-edge.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'concurrent'
2+
require 'concurrent-edge/version'
3+
4+
require 'concurrent-edge/actor'
5+
require 'concurrent-edge/channel'
6+
7+

lib/concurrent/edge/version.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/concurrent/file_map.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module Concurrent
2+
3+
git_files = `git ls-files`.split("\n")
4+
all_lib_files = Dir['lib/concurrent/**/*.rb'] & git_files
5+
edge_lib_files = Dir['lib/concurrent/actor.rb',
6+
'lib/concurrent/actor/**/*.rb',
7+
'lib/concurrent/channel.rb',
8+
'lib/concurrent/channel/**/*.rb'] & git_files
9+
core_lib_files = all_lib_files - edge_lib_files
10+
11+
FILE_MAP = {
12+
core: core_lib_files + %w(lib/concurrent.rb lib/concurrent_ruby.rb),
13+
edge: edge_lib_files + %w(lib/concurrent-edge.rb)
14+
}
15+
end
16+

lib/concurrent/version.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module Concurrent
2-
VERSION = '0.8.0'
2+
VERSION = '0.8.0'
3+
EDGE_VERSION = '0.1.0'
34
end

lib/concurrent_ruby.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
warn "'[DEPRECATED] use `require 'concurrent'` instead of `require 'concurrent_ruby'`"
12
require 'concurrent'

0 commit comments

Comments
 (0)