This repository was archived by the owner on Mar 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +91
-19
lines changed Expand file tree Collapse file tree 3 files changed +91
-19
lines changed Original file line number Diff line number Diff line change
1
+ Gemfile.lock
2
+ .rspec-local
1
3
* .gem
2
- * .rbc
3
- .rbx /*
4
- .bundle
5
- .config
6
- /.idea
4
+ lib /1.8
5
+ lib /1.9
6
+ lib /2.0
7
+ .rvmrc
8
+ .ruby-version
9
+ .ruby-gemset
10
+ .bundle /*
7
11
.yardoc /*
8
12
yardoc /*
9
- Gemfile.lock
10
- InstalledFiles
11
- _yardoc
13
+ tmp /*
14
+ man /*
15
+ * .tmproj
16
+ rdoc /*
17
+ * .orig
18
+ * .BACKUP. *
19
+ * .BASE. *
20
+ * .LOCAL. *
21
+ * .REMOTE. *
22
+ git_pull.txt
12
23
coverage
13
- doc /
14
- lib /bundler /man
15
- lib /thread_safe /jruby_cache_backend.jar
16
- pkg
17
- rdoc
18
- spec /reports
19
- test /tmp
20
- test /version_tmp
21
- tmp
24
+ critic
22
25
.DS_Store
23
- * .swp
24
- test /package.jar
26
+ TAGS
27
+ tmtags
28
+ * .sw ?
29
+ .idea
30
+ .rbx /*
31
+ lib /** /* .bundle
32
+ lib /** /* .so
33
+ lib /** /* .jar
34
+ ext /** /* .bundle
35
+ ext /** /* .so
36
+ ext /** /* .jar
37
+ pkg
38
+ * .gem
Original file line number Diff line number Diff line change 1
1
require "bundler/gem_tasks"
2
2
require "rake/testtask"
3
3
4
+ ## safely load all the rake tasks in the `tasks` directory
5
+ def safe_load ( file )
6
+ begin
7
+ load file
8
+ rescue LoadError => ex
9
+ puts "Error loading rake tasks from '#{ file } ' but will continue..."
10
+ puts ex . message
11
+ end
12
+ end
13
+ Dir . glob ( 'tasks/**/*.rake' ) . each do |rakefile |
14
+ safe_load rakefile
15
+ end
16
+
4
17
task :default => :test
5
18
6
19
if defined? ( JRUBY_VERSION )
Original file line number Diff line number Diff line change
1
+ require 'yard'
2
+ YARD ::Rake ::YardocTask . new
3
+
4
+ root = File . expand_path File . join ( File . dirname ( __FILE__ ) , '..' )
5
+
6
+ namespace :yard do
7
+
8
+ cmd = lambda do |command |
9
+ puts ">> executing: #{ command } "
10
+ system command or raise "#{ command } failed"
11
+ end
12
+
13
+ desc 'Pushes generated documentation to github pages: http://ruby-concurrency.github.io/thread_safe/'
14
+ task :push => [ :setup , :yard ] do
15
+
16
+ message = Dir . chdir ( root ) do
17
+ `git log -n 1 --oneline` . strip
18
+ end
19
+ puts "Generating commit: #{ message } "
20
+
21
+ Dir . chdir "#{ root } /yardoc" do
22
+ cmd . call "git add -A"
23
+ cmd . call "git commit -m '#{ message } '"
24
+ cmd . call 'git push origin gh-pages'
25
+ end
26
+
27
+ end
28
+
29
+ desc 'Setups second clone in ./yardoc dir for pushing doc to github'
30
+ task :setup do
31
+
32
+ unless File . exist? "#{ root } /yardoc/.git"
33
+ cmd . call "rm -rf #{ root } /yardoc" if File . exist? ( "#{ root } /yardoc" )
34
+ Dir . chdir "#{ root } " do
35
+ cmd . call 'git clone --single-branch --branch gh-pages [email protected] :ruby-concurrency/thread_safe.git ./yardoc'
36
+ end
37
+ end
38
+ Dir . chdir "#{ root } /yardoc" do
39
+ cmd . call 'git fetch origin'
40
+ cmd . call 'git reset --hard origin/gh-pages'
41
+ end
42
+
43
+ end
44
+
45
+ end
You can’t perform that action at this time.
0 commit comments