Skip to content

Commit 3828d70

Browse files
committed
Finalize release tasks, add documentation for 1.1.0, fix 1.0.5 docs
1 parent faa8cd8 commit 3828d70

File tree

498 files changed

+131159
-98544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

498 files changed

+131159
-98544
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ matrix:
2424
rvm: 2.5.1
2525
script:
2626
- bundle install --with documentation
27-
- bundle exec rake spec:docs_uptodate
27+
- bundle exec rake yard:master:uptodate
2828

2929
- name: MRI 2.4.4
3030
rvm: 2.4.4

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
concurrent-ruby:
44

5-
* [Promises](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Promises.html)
5+
* [Promises](http://ruby-concurrency.github.io/concurrent-ruby/1.1.0/Concurrent/Promises.html)
66
are moved from `concurrent-ruby-edge` to `concurrent-ruby`
77
* Add support for TruffleRuby
88
* (#734) Fix Array/Hash/Set construction broken on TruffleRuby

LICENSE.txt

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

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ We also have a [IRC (gitter)](https://gitter.im/ruby-concurrency/concurrent-ruby
9393
Like a Future scheduled for a specific future time.
9494
* [TimerTask](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/TimerTask.html):
9595
A Thread that periodically wakes up to perform work at regular intervals.
96-
* [Promises Framework](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html):
96+
* [Promises](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html):
9797
Unified implementation of futures and promises which combines features of previous `Future`,
9898
`Promise`, `IVar`, `Event`, `dataflow`, `Delay`, and (partially) `TimerTask` into a single
9999
framework. It extensively uses the new synchronization layer to make all the features
@@ -186,21 +186,21 @@ Deprecated features are still available and bugs are being fixed, but new featur
186186

187187
* ~~[Future](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Future.html):
188188
An asynchronous operation that produces a value.~~ Replaced by
189-
[Promises Framework](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
190-
* ~~[Dataflow](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent.html#dataflow-class_method):
189+
[Promises](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
190+
* ~~[.dataflow](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent.html#dataflow-class_method):
191191
Built on Futures, Dataflow allows you to create a task that will be scheduled when all of
192192
its data dependencies are available.~~ Replaced by
193-
[Promises Framework](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
193+
[Promises](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
194194
* ~~[Promise](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promise.html): Similar
195195
to Futures, with more features.~~ Replaced by
196-
[Promises Framework](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
196+
[Promises](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
197197
* ~~[Delay](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Delay.html) Lazy evaluation
198198
of a block yielding an immutable result. Based on Clojure's
199199
[delay](https://clojuredocs.org/clojure.core/delay).~~ Replaced by
200-
[Promises Framework](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
200+
[Promises](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
201201
* ~~[IVar](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/IVar.html) Similar to a
202202
"future" but can be manually assigned once, after which it becomes immutable.~~ Replaced by
203-
[Promises Framework](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
203+
[Promises](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises.html).
204204

205205
### Edge Features
206206

Rakefile

Lines changed: 109 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ end
2929

3030
require 'rake_compiler_dock'
3131
namespace :repackage do
32-
desc '- with Windows fat distributions'
32+
desc '* with Windows fat distributions'
3333
task :all do
3434
Dir.chdir(__dir__) do
3535
sh 'bundle package'
36+
# needed only if the jar is built outside of docker
37+
Rake::Task['lib/concurrent/concurrent_ruby.jar'].invoke
3638
RakeCompilerDock.exec 'support/cross_building.sh'
3739
end
3840
end
@@ -60,19 +62,19 @@ begin
6062
--tag ~notravis ]
6163

6264
namespace :spec do
63-
desc '- Configured for ci'
65+
desc '* Configured for ci'
6466
RSpec::Core::RakeTask.new(:ci) do |t|
6567
t.rspec_opts = [*options].join(' ')
6668
end
6769

68-
desc '- test packaged and installed gems instead of local files'
69-
task :installed => :repackage do
70+
desc '* test packaged and installed gems instead of local files'
71+
task :installed do
7072
Dir.chdir(__dir__) do
7173
sh 'gem install pkg/concurrent-ruby-1.1.0.pre1.gem'
7274
sh 'gem install pkg/concurrent-ruby-ext-1.1.0.pre1.gem' if Concurrent.on_cruby?
7375
sh 'gem install pkg/concurrent-ruby-edge-0.4.0.pre1.gem'
7476
ENV['NO_PATH'] = 'true'
75-
sh 'bundle install'
77+
sh 'bundle update'
7678
sh 'bundle exec rake spec:ci'
7779
end
7880
end
@@ -86,6 +88,8 @@ rescue LoadError => e
8688
puts 'RSpec is not installed, skipping test task definitions: ' + e.message
8789
end
8890

91+
current_yard_version_name = Concurrent::VERSION.split('.')[0..2].join('.')
92+
8993
begin
9094
require 'yard'
9195
require 'md_ruby_eval'
@@ -99,79 +103,122 @@ begin
99103
'--title', 'Concurrent Ruby',
100104
'--template', 'default',
101105
'--template-path', 'yard-template',
102-
'--default-return', 'undocumented',]
106+
'--default-return', 'undocumented']
103107

104108
desc 'Generate YARD Documentation (signpost, master)'
105109
task :yard => ['yard:signpost', 'yard:master']
106110

107111
namespace :yard do
108112

109-
desc '- eval markdown files'
113+
desc '* eval markdown files'
110114
task :eval_md do
111115
Dir.chdir File.join(__dir__, 'docs-source') do
112116
sh 'bundle exec md-ruby-eval --auto'
113117
end
114118
end
115119

120+
task :update_readme do
121+
Dir.chdir __dir__ do
122+
content = File.read(File.join('README.md')).
123+
gsub(/\[([\w ]+)\]\(http:\/\/ruby-concurrency\.github\.io\/concurrent-ruby\/master\/.*\)/) do |_|
124+
case $1
125+
when 'LockFreeLinkedSet'
126+
"{Concurrent::Edge::#{$1} #{$1}}"
127+
when '.dataflow'
128+
'{Concurrent.dataflow Concurrent.dataflow}'
129+
when 'thread pool'
130+
'{file:thread_pools.md thread pool}'
131+
else
132+
"{Concurrent::#{$1} #{$1}}"
133+
end
134+
end
135+
File.write 'tmp/README.md', content
136+
end
137+
end
138+
116139
define_yard_task = -> name do
117-
desc "- of #{name} into subdir #{name}"
140+
desc "* of #{name} into subdir #{name}"
118141
YARD::Rake::YardocTask.new(name) do |yard|
119142
yard.options.push(
120143
'--output-dir', "docs/#{name}",
144+
'--main', 'tmp/README.md',
121145
*common_yard_options)
122146
yard.files = ['./lib/**/*.rb',
123147
'./lib-edge/**/*.rb',
124148
'./ext/concurrent_ruby_ext/**/*.c',
125149
'-',
126150
'docs-source/thread_pools.md',
127151
'docs-source/promises.out.md',
128-
'README.md',
129-
'LICENSE.txt',
152+
'LICENSE.md',
130153
'CHANGELOG.md']
131154
end
132-
Rake::Task[name].prerequisites.push 'yard:eval_md'
155+
Rake::Task[name].prerequisites.push 'yard:eval_md', 'yard:update_readme'
133156
end
134157

135-
define_yard_task.call(Concurrent::VERSION.split('.')[0..2].join('.'))
136-
define_yard_task.call('master')
158+
define_yard_task.call current_yard_version_name
159+
define_yard_task.call 'master'
137160

138-
desc "- signpost for versions"
161+
desc "* signpost for versions"
139162
YARD::Rake::YardocTask.new(:signpost) do |yard|
140163
yard.options.push(
141164
'--output-dir', 'docs',
142165
'--main', 'docs-source/signpost.md',
143166
*common_yard_options)
144167
yard.files = ['no-lib']
145168
end
146-
end
147169

148-
namespace :spec do
149-
desc '- ensure that generated documentation is matching the source code'
150-
task :docs_uptodate do
151-
Dir.chdir(__dir__) do
152-
begin
153-
FileUtils.cp_r 'docs', 'docs-copy', verbose: true
154-
Rake::Task[:yard].invoke
155-
sh 'diff -r docs/ docs-copy/'
156-
ensure
157-
FileUtils.rm_rf 'docs-copy', verbose: true
170+
define_uptodate_task = -> name do
171+
namespace name do
172+
desc "** ensure that #{name} generated documentation is matching the source code"
173+
task :uptodate do
174+
Dir.chdir(__dir__) do
175+
begin
176+
FileUtils.cp_r 'docs', 'docs-copy', verbose: true
177+
Rake::Task["yard:#{name}"].invoke
178+
sh 'diff -r docs/ docs-copy/'
179+
ensure
180+
FileUtils.rm_rf 'docs-copy', verbose: true
181+
end
182+
end
158183
end
159184
end
160185
end
186+
187+
define_uptodate_task.call current_yard_version_name
188+
define_uptodate_task.call 'master'
161189
end
162190

163191
rescue LoadError => e
164192
puts 'YARD is not installed, skipping documentation task definitions: ' + e.message
165193
end
166194

195+
desc 'build, test, and publish the gem'
196+
task :release => ['release:checks', 'release:build', 'release:test', 'release:publish']
197+
167198
namespace :release do
168199
# Depends on environment of @pitr-ch
169200

170-
mri_version = '2.4.3'
201+
mri_version = '2.5.1'
171202
jruby_version = 'jruby-9.1.17.0'
172203

204+
task :checks => "yard:#{current_yard_version_name}:uptodate" do
205+
Dir.chdir(__dir__) do
206+
begin
207+
STDOUT.puts "Is this a final release build? (Do git checks?) (y/n)"
208+
input = STDIN.gets.strip.downcase
209+
end until %w(y n).include?(input)
210+
if input == 'y'
211+
sh 'test -z "$(git status --porcelain)"'
212+
sh 'git fetch'
213+
sh 'test $(git show-ref --verify --hash refs/heads/master) = $(git show-ref --verify --hash refs/remotes/github/master)'
214+
end
215+
end
216+
end
217+
218+
desc '* build all *.gem files necessary for release'
173219
task :build => 'repackage:all'
174220

221+
desc '* test actual installed gems instead of cloned repository on MRI and JRuby'
175222
task :test do
176223
Dir.chdir(__dir__) do
177224
old = ENV['RBENV_VERSION']
@@ -190,27 +237,43 @@ namespace :release do
190237
end
191238
end
192239

193-
task :push do
194-
Dir.chdir(__dir__) do
195-
sh 'git fetch'
196-
sh 'test $(git show-ref --verify --hash refs/heads/master) = $(git show-ref --verify --hash refs/remotes/github/master)'
197-
198-
sh "git tag v#{Concurrent::VERSION}"
199-
sh "git tag edge-v#{Concurrent::EDGE_VERSION}"
200-
sh "git push github v#{Concurrent::VERSION} edge-v#{Concurrent::EDGE_VERSION}"
201-
202-
sh "gem push pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
203-
sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
204-
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem"
205-
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x64-mingw32.gem"
206-
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x86-mingw32.gem"
240+
desc '* do all nested steps'
241+
task :publish => ['publish:ask', 'publish:tag', 'publish:rubygems', 'publish:post_steps']
242+
243+
namespace :publish do
244+
task :ask do
245+
begin
246+
STDOUT.puts "Do you want to publish? (y/n)"
247+
input = STDIN.gets.strip.downcase
248+
end until %w(y n).include?(input)
249+
raise 'reconsidered' if input == 'n'
207250
end
208-
end
209251

210-
task :notify do
211-
puts 'Manually: create a release on GitHub with relevant changelog part'
212-
puts 'Manually: send email same as release with relevant changelog part'
213-
puts 'Manually: update documentation'
214-
puts ' $ bundle exec rake yard:push'
252+
desc '** tag HEAD with current version and push to github'
253+
task :tag do
254+
Dir.chdir(__dir__) do
255+
sh "git tag v#{Concurrent::VERSION}"
256+
sh "git tag edge-v#{Concurrent::EDGE_VERSION}"
257+
sh "git push github v#{Concurrent::VERSION} edge-v#{Concurrent::EDGE_VERSION}"
258+
end
259+
end
260+
261+
desc '** push all *.gem files to rubygems'
262+
task :rubygems do
263+
Dir.chdir(__dir__) do
264+
sh "gem push pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
265+
sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
266+
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem"
267+
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x64-mingw32.gem"
268+
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x86-mingw32.gem"
269+
end
270+
end
271+
272+
desc '** print post release steps'
273+
task :post_steps do
274+
puts 'Manually: create a release on GitHub with relevant changelog part'
275+
puts 'Manually: send email same as release with relevant changelog part'
276+
puts 'Manually: tweet'
277+
end
215278
end
216279
end

docs-source/dataflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. Data dependencies are `Future` values. The dataflow task itself is also a `Future` value, so you can build up a graph of these tasks, each of which is run when all the data and other tasks it depends on are available or completed.
1+
Data dependencies are `Future` values. The dataflow task itself is also a `Future` value, so you can build up a graph of these tasks, each of which is run when all the data and other tasks it depends on are available or completed.
22

33
Our syntax is somewhat related to that of Akka's `flow` and Habanero Java's `DataDrivenFuture`. However unlike Akka we don't schedule a task at all until it is ready to run, and unlike Habanero Java we pass the data values into the task instead of dereferencing them again in the task.
44

docs-source/signpost.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
Pick a version:
44

55
* [master](./master/index.html)
6+
* [1.1.0.pre1](./1.1.0/index.html)
67
* [1.0.5](./1.0.5/index.html)

0 commit comments

Comments
 (0)