Skip to content

Commit

Permalink
Finalize release tasks, add documentation for 1.1.0, fix 1.0.5 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Aug 15, 2018
1 parent faa8cd8 commit 3828d70
Show file tree
Hide file tree
Showing 498 changed files with 131,159 additions and 98,544 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ matrix:
rvm: 2.5.1
script:
- bundle install --with documentation
- bundle exec rake spec:docs_uptodate
- bundle exec rake yard:master:uptodate

- name: MRI 2.4.4
rvm: 2.4.4
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

concurrent-ruby:

* [Promises](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Promises.html)
* [Promises](http://ruby-concurrency.github.io/concurrent-ruby/1.1.0/Concurrent/Promises.html)
are moved from `concurrent-ruby-edge` to `concurrent-ruby`
* Add support for TruffleRuby
* (#734) Fix Array/Hash/Set construction broken on TruffleRuby
Expand Down
21 changes: 0 additions & 21 deletions LICENSE.txt

This file was deleted.

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

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

### Edge Features

Expand Down
155 changes: 109 additions & 46 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ end

require 'rake_compiler_dock'
namespace :repackage do
desc '- with Windows fat distributions'
desc '* with Windows fat distributions'
task :all do
Dir.chdir(__dir__) do
sh 'bundle package'
# needed only if the jar is built outside of docker
Rake::Task['lib/concurrent/concurrent_ruby.jar'].invoke
RakeCompilerDock.exec 'support/cross_building.sh'
end
end
Expand Down Expand Up @@ -60,19 +62,19 @@ begin
--tag ~notravis ]

namespace :spec do
desc '- Configured for ci'
desc '* Configured for ci'
RSpec::Core::RakeTask.new(:ci) do |t|
t.rspec_opts = [*options].join(' ')
end

desc '- test packaged and installed gems instead of local files'
task :installed => :repackage do
desc '* test packaged and installed gems instead of local files'
task :installed do
Dir.chdir(__dir__) do
sh 'gem install pkg/concurrent-ruby-1.1.0.pre1.gem'
sh 'gem install pkg/concurrent-ruby-ext-1.1.0.pre1.gem' if Concurrent.on_cruby?
sh 'gem install pkg/concurrent-ruby-edge-0.4.0.pre1.gem'
ENV['NO_PATH'] = 'true'
sh 'bundle install'
sh 'bundle update'
sh 'bundle exec rake spec:ci'
end
end
Expand All @@ -86,6 +88,8 @@ rescue LoadError => e
puts 'RSpec is not installed, skipping test task definitions: ' + e.message
end

current_yard_version_name = Concurrent::VERSION.split('.')[0..2].join('.')

begin
require 'yard'
require 'md_ruby_eval'
Expand All @@ -99,79 +103,122 @@ begin
'--title', 'Concurrent Ruby',
'--template', 'default',
'--template-path', 'yard-template',
'--default-return', 'undocumented',]
'--default-return', 'undocumented']

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

namespace :yard do

desc '- eval markdown files'
desc '* eval markdown files'
task :eval_md do
Dir.chdir File.join(__dir__, 'docs-source') do
sh 'bundle exec md-ruby-eval --auto'
end
end

task :update_readme do
Dir.chdir __dir__ do
content = File.read(File.join('README.md')).
gsub(/\[([\w ]+)\]\(http:\/\/ruby-concurrency\.github\.io\/concurrent-ruby\/master\/.*\)/) do |_|
case $1
when 'LockFreeLinkedSet'
"{Concurrent::Edge::#{$1} #{$1}}"
when '.dataflow'
'{Concurrent.dataflow Concurrent.dataflow}'
when 'thread pool'
'{file:thread_pools.md thread pool}'
else
"{Concurrent::#{$1} #{$1}}"
end
end
File.write 'tmp/README.md', content
end
end

define_yard_task = -> name do
desc "- of #{name} into subdir #{name}"
desc "* of #{name} into subdir #{name}"
YARD::Rake::YardocTask.new(name) do |yard|
yard.options.push(
'--output-dir', "docs/#{name}",
'--main', 'tmp/README.md',
*common_yard_options)
yard.files = ['./lib/**/*.rb',
'./lib-edge/**/*.rb',
'./ext/concurrent_ruby_ext/**/*.c',
'-',
'docs-source/thread_pools.md',
'docs-source/promises.out.md',
'README.md',
'LICENSE.txt',
'LICENSE.md',
'CHANGELOG.md']
end
Rake::Task[name].prerequisites.push 'yard:eval_md'
Rake::Task[name].prerequisites.push 'yard:eval_md', 'yard:update_readme'
end

define_yard_task.call(Concurrent::VERSION.split('.')[0..2].join('.'))
define_yard_task.call('master')
define_yard_task.call current_yard_version_name
define_yard_task.call 'master'

desc "- signpost for versions"
desc "* signpost for versions"
YARD::Rake::YardocTask.new(:signpost) do |yard|
yard.options.push(
'--output-dir', 'docs',
'--main', 'docs-source/signpost.md',
*common_yard_options)
yard.files = ['no-lib']
end
end

namespace :spec do
desc '- ensure that generated documentation is matching the source code'
task :docs_uptodate do
Dir.chdir(__dir__) do
begin
FileUtils.cp_r 'docs', 'docs-copy', verbose: true
Rake::Task[:yard].invoke
sh 'diff -r docs/ docs-copy/'
ensure
FileUtils.rm_rf 'docs-copy', verbose: true
define_uptodate_task = -> name do
namespace name do
desc "** ensure that #{name} generated documentation is matching the source code"
task :uptodate do
Dir.chdir(__dir__) do
begin
FileUtils.cp_r 'docs', 'docs-copy', verbose: true
Rake::Task["yard:#{name}"].invoke
sh 'diff -r docs/ docs-copy/'
ensure
FileUtils.rm_rf 'docs-copy', verbose: true
end
end
end
end
end

define_uptodate_task.call current_yard_version_name
define_uptodate_task.call 'master'
end

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

desc 'build, test, and publish the gem'
task :release => ['release:checks', 'release:build', 'release:test', 'release:publish']

namespace :release do
# Depends on environment of @pitr-ch

mri_version = '2.4.3'
mri_version = '2.5.1'
jruby_version = 'jruby-9.1.17.0'

task :checks => "yard:#{current_yard_version_name}:uptodate" do
Dir.chdir(__dir__) do
begin
STDOUT.puts "Is this a final release build? (Do git checks?) (y/n)"
input = STDIN.gets.strip.downcase
end until %w(y n).include?(input)
if input == 'y'
sh 'test -z "$(git status --porcelain)"'
sh 'git fetch'
sh 'test $(git show-ref --verify --hash refs/heads/master) = $(git show-ref --verify --hash refs/remotes/github/master)'
end
end
end

desc '* build all *.gem files necessary for release'
task :build => 'repackage:all'

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

task :push do
Dir.chdir(__dir__) do
sh 'git fetch'
sh 'test $(git show-ref --verify --hash refs/heads/master) = $(git show-ref --verify --hash refs/remotes/github/master)'

sh "git tag v#{Concurrent::VERSION}"
sh "git tag edge-v#{Concurrent::EDGE_VERSION}"
sh "git push github v#{Concurrent::VERSION} edge-v#{Concurrent::EDGE_VERSION}"

sh "gem push pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x64-mingw32.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x86-mingw32.gem"
desc '* do all nested steps'
task :publish => ['publish:ask', 'publish:tag', 'publish:rubygems', 'publish:post_steps']

namespace :publish do
task :ask do
begin
STDOUT.puts "Do you want to publish? (y/n)"
input = STDIN.gets.strip.downcase
end until %w(y n).include?(input)
raise 'reconsidered' if input == 'n'
end
end

task :notify do
puts 'Manually: create a release on GitHub with relevant changelog part'
puts 'Manually: send email same as release with relevant changelog part'
puts 'Manually: update documentation'
puts ' $ bundle exec rake yard:push'
desc '** tag HEAD with current version and push to github'
task :tag do
Dir.chdir(__dir__) do
sh "git tag v#{Concurrent::VERSION}"
sh "git tag edge-v#{Concurrent::EDGE_VERSION}"
sh "git push github v#{Concurrent::VERSION} edge-v#{Concurrent::EDGE_VERSION}"
end
end

desc '** push all *.gem files to rubygems'
task :rubygems do
Dir.chdir(__dir__) do
sh "gem push pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x64-mingw32.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x86-mingw32.gem"
end
end

desc '** print post release steps'
task :post_steps do
puts 'Manually: create a release on GitHub with relevant changelog part'
puts 'Manually: send email same as release with relevant changelog part'
puts 'Manually: tweet'
end
end
end
2 changes: 1 addition & 1 deletion docs-source/dataflow.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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.
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.

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.

Expand Down
1 change: 1 addition & 0 deletions docs-source/signpost.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
Pick a version:

* [master](./master/index.html)
* [1.1.0.pre1](./1.1.0/index.html)
* [1.0.5](./1.0.5/index.html)
Loading

0 comments on commit 3828d70

Please sign in to comment.