Skip to content

Commit 8c1f18f

Browse files
committed
Update yardoc
* move to docs and add generated documentation * include previous documentation versions * Test doc did not change
1 parent b09dfa1 commit 8c1f18f

File tree

564 files changed

+386600
-234
lines changed

Some content is hidden

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

564 files changed

+386600
-234
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
# Yard documentation
99
/.yardoc
10-
/yardoc
1110

1211
# IDEs' files
1312
*.iml

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ matrix:
1515
- name: TruffleRuby Latest
1616
rvm: system
1717
install:
18-
- export TRUFFLERUBY_VERSION=1.0.0-rc3
18+
- export TRUFFLERUBY_VERSION=1.0.0-rc5
1919
- curl -L https://github.com/oracle/truffleruby/releases/download/vm-$TRUFFLERUBY_VERSION/truffleruby-$TRUFFLERUBY_VERSION-linux-amd64.tar.gz | tar xz
2020
- export PATH="$PWD/truffleruby-$TRUFFLERUBY_VERSION-linux-amd64/bin:$PATH"
2121
- gem install bundler
2222
- bundle install
23+
- name: YARD uptodate in docs
24+
rvm: 2.5.1
25+
script:
26+
- bundle install --with documentation
27+
- bundle exec rake spec:docs_uptodate
2328

2429
- name: MRI 2.4.4
2530
rvm: 2.4.4
@@ -52,15 +57,15 @@ matrix:
5257

5358
- name: Coverage on MRI 2.3.7
5459
rvm: 2.3.7
55-
jdk: oraclejdk8
5660
env: COVERAGE=1
5761

5862
allow_failures:
63+
- rvm: 2.6.0-preview2
5964
- rvm: ruby-head
6065
- rvm: jruby-head
6166
- rvm: rbx-3
62-
- rvm: ruby-2.6.0-preview2
6367
- name: TruffleRuby Latest
68+
- name: YARD uptodate in docs
6469

6570
env:
6671
global:

.yardopts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
--no-private
2-
--embed-mixins
3-
--output-dir ./yardoc
4-
--markup markdown
5-
--title=Concurrent Ruby
6-
--template default
7-
--template-path ./yard-template
8-
--default-return undocumented
9-
10-
./lib/**/*.rb
11-
./lib-edge/**/*.rb
12-
./ext/concurrent_ruby_ext/**/*.c
1+
--use-bundle-exec-rake-yard-instead
2+
--output-dir tmp
3+
--
4+
no-lib
135
-
14-
doc/thread_pools.md
15-
doc/promises.out.md
16-
README.md
17-
LICENSE.txt
18-
CHANGELOG.md

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ end
1919
group :documentation, optional: true do
2020
gem 'yard', '~> 0.9.0', :require => false
2121
gem 'redcarpet', '~> 3.0', platforms: :mri # understands github markdown
22-
gem 'md-ruby-eval'
22+
gem 'md-ruby-eval', '~> 0.2'
2323
end
2424

2525
group :testing do

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Modern concurrency tools for Ruby. Inspired by
1616
[Java](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/package-summary.html),
1717
and classic concurrency patterns.
1818

19-
<img src="https://raw.githubusercontent.com/ruby-concurrency/concurrent-ruby/master/doc/logo/concurrent-ruby-logo-300x300.png" align="right" style="margin-left: 20px;" />
19+
<img src="https://raw.githubusercontent.com/ruby-concurrency/concurrent-ruby/master/doc-source/logo/concurrent-ruby-logo-300x300.png" align="right" style="margin-left: 20px;" />
2020

2121
The design goals of this gem are:
2222

@@ -58,7 +58,7 @@ other Ruby library, many of which support the mantra of
5858
Concurrent Ruby is also the only Ruby library which provides a full suite of thread safe and
5959
immutable variable types and data structures.
6060

61-
We've also initiated discussion to document [memory model](doc/synchronization.md) of Ruby which
61+
We've also initiated discussion to document [memory model](docs-source/synchronization.md) of Ruby which
6262
would provide consistent behaviour and guarantees on all three of the main Ruby interpreters
6363
(MRI/CRuby, JRuby, Rubinius, TruffleRuby).
6464

Rakefile

Lines changed: 92 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ require 'rake_compiler_dock'
3131
namespace :repackage do
3232
desc '- with Windows fat distributions'
3333
task :all do
34-
sh 'bundle package'
35-
RakeCompilerDock.exec 'support/cross_building.sh'
34+
Dir.chdir(__dir__) do
35+
sh 'bundle package'
36+
RakeCompilerDock.exec 'support/cross_building.sh'
37+
end
3638
end
3739
end
3840

@@ -65,12 +67,14 @@ begin
6567

6668
desc '- test packaged and installed gems instead of local files'
6769
task :installed => :repackage do
68-
sh 'gem install pkg/concurrent-ruby-1.1.0.pre1.gem'
69-
sh 'gem install pkg/concurrent-ruby-ext-1.1.0.pre1.gem' if Concurrent.on_cruby?
70-
sh 'gem install pkg/concurrent-ruby-edge-0.4.0.pre1.gem'
71-
ENV['NO_PATH'] = 'true'
72-
sh 'bundle install'
73-
sh 'bundle exec rake spec:ci'
70+
Dir.chdir(__dir__) do
71+
sh 'gem install pkg/concurrent-ruby-1.1.0.pre1.gem'
72+
sh 'gem install pkg/concurrent-ruby-ext-1.1.0.pre1.gem' if Concurrent.on_cruby?
73+
sh 'gem install pkg/concurrent-ruby-edge-0.4.0.pre1.gem'
74+
ENV['NO_PATH'] = 'true'
75+
sh 'bundle install'
76+
sh 'bundle exec rake spec:ci'
77+
end
7478
end
7579
end
7680

@@ -87,56 +91,75 @@ begin
8791
require 'md_ruby_eval'
8892
require_relative 'support/yard_full_types'
8993

90-
root = File.expand_path File.dirname(__FILE__)
94+
common_yard_options = ['--no-yardopts',
95+
'--no-document',
96+
'--no-private',
97+
'--embed-mixins',
98+
'--markup', 'markdown',
99+
'--title', 'Concurrent Ruby',
100+
'--template', 'default',
101+
'--template-path', 'yard-template',
102+
'--default-return', 'undocumented',]
91103

92-
cmd = lambda do |command|
93-
puts ">> executing: #{command}"
94-
puts ">> in: #{Dir.pwd}"
95-
system command or raise "#{command} failed"
96-
end
97-
98-
yard_doc = YARD::Rake::YardocTask.new(:yard)
99-
yard_doc.before = -> do
100-
Dir.chdir File.join(root, 'doc') do
101-
cmd.call 'bundle exec md-ruby-eval --auto'
102-
end
103-
end
104+
desc 'Generate YARD Documentation (signpost, master)'
105+
task :yard => ['yard:signpost', 'yard:master']
104106

105107
namespace :yard do
106108

107-
desc 'Pushes generated documentation to github pages: http://ruby-concurrency.github.io/concurrent-ruby/'
108-
task :push => [:setup, :yard] do
109-
110-
message = Dir.chdir(root) do
111-
`git log -n 1 --oneline`.strip
109+
desc '- eval markdown files'
110+
task :eval_md do
111+
Dir.chdir File.join(__dir__, 'docs-source') do
112+
sh 'bundle exec md-ruby-eval --auto'
112113
end
113-
puts "Generating commit: #{message}"
114+
end
114115

115-
Dir.chdir "#{root}/yardoc" do
116-
cmd.call "git add -A"
117-
cmd.call "git commit -m '#{message}'"
118-
cmd.call 'git push origin gh-pages'
116+
define_yard_task = -> name do
117+
desc "- of #{name} into subdir #{name}"
118+
YARD::Rake::YardocTask.new(name) do |yard|
119+
yard.options.push(
120+
'--output-dir', "docs/#{name}",
121+
*common_yard_options)
122+
yard.files = ['./lib/**/*.rb',
123+
'./lib-edge/**/*.rb',
124+
'./ext/concurrent_ruby_ext/**/*.c',
125+
'-',
126+
'docs-source/thread_pools.md',
127+
'docs-source/promises.out.md',
128+
'README.md',
129+
'LICENSE.txt',
130+
'CHANGELOG.md']
119131
end
120-
132+
Rake::Task[name].prerequisites.push 'yard:eval_md'
121133
end
122134

123-
desc 'Setups second clone in ./yardoc dir for pushing doc to github'
124-
task :setup do
135+
define_yard_task.call(Concurrent::VERSION.split('.')[0..2].join('.'))
136+
define_yard_task.call('master')
125137

126-
unless File.exist? "#{root}/yardoc/.git"
127-
cmd.call "rm -rf #{root}/yardoc" if File.exist?("#{root}/yardoc")
128-
Dir.chdir "#{root}" do
129-
cmd.call 'git clone --single-branch --branch gh-pages [email protected]:ruby-concurrency/concurrent-ruby.git ./yardoc'
138+
desc "- signpost for versions"
139+
YARD::Rake::YardocTask.new(:signpost) do |yard|
140+
yard.options.push(
141+
'--output-dir', 'docs',
142+
'--main', 'docs-source/signpost.md',
143+
*common_yard_options)
144+
yard.files = ['no-lib']
145+
end
146+
end
147+
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
130158
end
131159
end
132-
Dir.chdir "#{root}/yardoc" do
133-
cmd.call 'git fetch origin'
134-
cmd.call 'git reset --hard origin/gh-pages'
135-
end
136-
137160
end
138-
139161
end
162+
140163
rescue LoadError => e
141164
puts 'YARD is not installed, skipping documentation task definitions: ' + e.message
142165
end
@@ -150,34 +173,38 @@ namespace :release do
150173
task :build => 'repackage:all'
151174

152175
task :test do
153-
old = ENV['RBENV_VERSION']
176+
Dir.chdir(__dir__) do
177+
old = ENV['RBENV_VERSION']
154178

155-
ENV['RBENV_VERSION'] = mri_version
156-
sh 'rbenv version'
157-
sh 'bundle exec rake spec:installed'
179+
ENV['RBENV_VERSION'] = mri_version
180+
sh 'rbenv version'
181+
sh 'bundle exec rake spec:installed'
158182

159-
ENV['RBENV_VERSION'] = jruby_version
160-
sh 'rbenv version'
161-
sh 'bundle exec rake spec:installed'
183+
ENV['RBENV_VERSION'] = jruby_version
184+
sh 'rbenv version'
185+
sh 'bundle exec rake spec:installed'
162186

163-
puts 'Windows build is untested'
187+
puts 'Windows build is untested'
164188

165-
ENV['RBENV_VERSION'] = old
189+
ENV['RBENV_VERSION'] = old
190+
end
166191
end
167192

168193
task :push do
169-
sh 'git fetch'
170-
sh 'test $(git show-ref --verify --hash refs/heads/master) = $(git show-ref --verify --hash refs/remotes/github/master)'
171-
172-
sh "git tag v#{Concurrent::VERSION}"
173-
sh "git tag edge-v#{Concurrent::EDGE_VERSION}"
174-
sh "git push github v#{Concurrent::VERSION} edge-v#{Concurrent::EDGE_VERSION}"
175-
176-
sh "gem push pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
177-
sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
178-
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem"
179-
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x64-mingw32.gem"
180-
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x86-mingw32.gem"
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"
207+
end
181208
end
182209

183210
task :notify do
-110 KB
Binary file not shown.
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)