rake 0.9.2 → 13.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.rdoc +43 -0
  3. data/Gemfile +10 -0
  4. data/History.rdoc +2386 -0
  5. data/MIT-LICENSE +1 -1
  6. data/README.rdoc +64 -109
  7. data/Rakefile +22 -386
  8. data/bin/bundle +105 -0
  9. data/bin/console +7 -0
  10. data/bin/rake +20 -23
  11. data/bin/rdoc +29 -0
  12. data/bin/rubocop +29 -0
  13. data/bin/setup +6 -0
  14. data/doc/command_line_usage.rdoc +65 -21
  15. data/doc/glossary.rdoc +40 -49
  16. data/doc/jamis.rb +1 -0
  17. data/doc/rake.1 +156 -0
  18. data/doc/rakefile.rdoc +127 -62
  19. data/exe/rake +27 -0
  20. data/lib/rake.rb +37 -31
  21. data/lib/rake/application.rb +507 -272
  22. data/lib/rake/backtrace.rb +24 -0
  23. data/lib/rake/clean.rb +55 -8
  24. data/lib/rake/cloneable.rb +11 -19
  25. data/lib/rake/cpu_counter.rb +107 -0
  26. data/lib/rake/default_loader.rb +5 -0
  27. data/lib/rake/dsl_definition.rb +74 -46
  28. data/lib/rake/early_time.rb +5 -1
  29. data/lib/rake/ext/core.rb +5 -6
  30. data/lib/rake/ext/string.rb +61 -52
  31. data/lib/rake/file_creation_task.rb +4 -3
  32. data/lib/rake/file_list.rb +81 -49
  33. data/lib/rake/file_task.rb +15 -8
  34. data/lib/rake/file_utils.rb +69 -47
  35. data/lib/rake/file_utils_ext.rb +18 -26
  36. data/lib/rake/invocation_chain.rb +25 -19
  37. data/lib/rake/invocation_exception_mixin.rb +1 -0
  38. data/lib/rake/late_time.rb +18 -0
  39. data/lib/rake/linked_list.rb +112 -0
  40. data/lib/rake/loaders/makefile.rb +23 -9
  41. data/lib/rake/multi_task.rb +4 -6
  42. data/lib/rake/name_space.rb +36 -23
  43. data/lib/rake/packagetask.rb +71 -34
  44. data/lib/rake/phony.rb +16 -0
  45. data/lib/rake/private_reader.rb +21 -0
  46. data/lib/rake/promise.rb +100 -0
  47. data/lib/rake/pseudo_status.rb +8 -2
  48. data/lib/rake/rake_module.rb +41 -3
  49. data/lib/rake/rake_test_loader.rb +21 -7
  50. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  51. data/lib/rake/scope.rb +43 -0
  52. data/lib/rake/task.rb +186 -79
  53. data/lib/rake/task_argument_error.rb +1 -0
  54. data/lib/rake/task_arguments.rb +50 -15
  55. data/lib/rake/task_manager.rb +89 -65
  56. data/lib/rake/tasklib.rb +2 -12
  57. data/lib/rake/testtask.rb +61 -63
  58. data/lib/rake/thread_history_display.rb +49 -0
  59. data/lib/rake/thread_pool.rb +163 -0
  60. data/lib/rake/trace_output.rb +23 -0
  61. data/lib/rake/version.rb +7 -7
  62. data/lib/rake/win32.rb +14 -18
  63. data/rake.gemspec +43 -0
  64. metadata +82 -221
  65. data/.gemtest +0 -0
  66. data/CHANGES +0 -509
  67. data/RRR +0 -9
  68. data/TODO +0 -20
  69. data/doc/rake.1.gz +0 -0
  70. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  71. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  72. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  73. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  74. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  75. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  76. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  77. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  78. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  79. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  80. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  81. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  82. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  83. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  84. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  85. data/doc/release_notes/rake-0.8.6.rdoc +0 -55
  86. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  87. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  88. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  89. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  90. data/install.rb +0 -90
  91. data/lib/rake/alt_system.rb +0 -109
  92. data/lib/rake/classic_namespace.rb +0 -9
  93. data/lib/rake/contrib/compositepublisher.rb +0 -21
  94. data/lib/rake/contrib/ftptools.rb +0 -150
  95. data/lib/rake/contrib/publisher.rb +0 -69
  96. data/lib/rake/contrib/rubyforgepublisher.rb +0 -16
  97. data/lib/rake/contrib/sshpublisher.rb +0 -45
  98. data/lib/rake/contrib/sys.rb +0 -191
  99. data/lib/rake/ext/module.rb +0 -39
  100. data/lib/rake/ext/time.rb +0 -14
  101. data/lib/rake/gempackagetask.rb +0 -13
  102. data/lib/rake/pathmap.rb +0 -1
  103. data/lib/rake/rdoctask.rb +0 -230
  104. data/lib/rake/ruby182_test_unit_fix.rb +0 -25
  105. data/lib/rake/runtest.rb +0 -21
  106. data/test/check_expansion.rb +0 -5
  107. data/test/check_no_expansion.rb +0 -5
  108. data/test/data/access/Rakefile +0 -35
  109. data/test/data/chains/Rakefile +0 -15
  110. data/test/data/comments/Rakefile +0 -18
  111. data/test/data/default/Rakefile +0 -17
  112. data/test/data/deprecated_import/Rakefile +0 -1
  113. data/test/data/dryrun/Rakefile +0 -22
  114. data/test/data/extra/Rakefile +0 -1
  115. data/test/data/file_creation_task/Rakefile +0 -31
  116. data/test/data/imports/Rakefile +0 -19
  117. data/test/data/imports/deps.mf +0 -1
  118. data/test/data/multidesc/Rakefile +0 -15
  119. data/test/data/namespace/Rakefile +0 -64
  120. data/test/data/rakelib/test1.rb +0 -4
  121. data/test/data/rbext/rakefile.rb +0 -3
  122. data/test/data/sample.mf +0 -14
  123. data/test/data/statusreturn/Rakefile +0 -6
  124. data/test/data/unittest/Rakefile +0 -1
  125. data/test/data/verbose/Rakefile +0 -34
  126. data/test/file_creation.rb +0 -34
  127. data/test/helper.rb +0 -44
  128. data/test/in_environment.rb +0 -35
  129. data/test/reqfile.rb +0 -3
  130. data/test/reqfile2.rb +0 -3
  131. data/test/shellcommand.rb +0 -3
  132. data/test/test_rake.rb +0 -38
  133. data/test/test_rake_application.rb +0 -364
  134. data/test/test_rake_application_options.rb +0 -382
  135. data/test/test_rake_clean.rb +0 -12
  136. data/test/test_rake_definitions.rb +0 -80
  137. data/test/test_rake_directory_task.rb +0 -55
  138. data/test/test_rake_dsl.rb +0 -73
  139. data/test/test_rake_early_time.rb +0 -31
  140. data/test/test_rake_extension.rb +0 -59
  141. data/test/test_rake_file_creation_task.rb +0 -62
  142. data/test/test_rake_file_list.rb +0 -633
  143. data/test/test_rake_file_list_path_map.rb +0 -8
  144. data/test/test_rake_file_task.rb +0 -104
  145. data/test/test_rake_file_utils.rb +0 -252
  146. data/test/test_rake_ftp_file.rb +0 -59
  147. data/test/test_rake_functional.rb +0 -468
  148. data/test/test_rake_invocation_chain.rb +0 -52
  149. data/test/test_rake_makefile_loader.rb +0 -23
  150. data/test/test_rake_multi_task.rb +0 -51
  151. data/test/test_rake_name_space.rb +0 -43
  152. data/test/test_rake_package_task.rb +0 -78
  153. data/test/test_rake_path_map.rb +0 -157
  154. data/test/test_rake_path_map_explode.rb +0 -31
  155. data/test/test_rake_path_map_partial.rb +0 -18
  156. data/test/test_rake_pseudo_status.rb +0 -20
  157. data/test/test_rake_rdoc_task.rb +0 -81
  158. data/test/test_rake_require.rb +0 -35
  159. data/test/test_rake_rules.rb +0 -346
  160. data/test/test_rake_task.rb +0 -271
  161. data/test/test_rake_task_argument_parsing.rb +0 -116
  162. data/test/test_rake_task_arguments.rb +0 -86
  163. data/test/test_rake_task_lib.rb +0 -9
  164. data/test/test_rake_task_manager.rb +0 -145
  165. data/test/test_rake_task_manager_argument_resolution.rb +0 -36
  166. data/test/test_rake_task_with_arguments.rb +0 -162
  167. data/test/test_rake_test_task.rb +0 -122
  168. data/test/test_rake_top_level_functions.rb +0 -76
  169. data/test/test_rake_win32.rb +0 -83
  170. data/test/test_sys.rb +0 -20
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2003, 2004 Jim Weirich
1
+ Copyright (c) Jim Weirich
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,9 +1,13 @@
1
1
  = RAKE -- Ruby Make
2
2
 
3
- Supporting Rake version: 0.8.7.
3
+ home :: https://github.com/ruby/rake
4
+ bugs :: https://github.com/ruby/rake/issues
5
+ docs :: https://ruby.github.io/rake
4
6
 
5
- This package contains Rake, a simple ruby build program with
6
- capabilities similar to make.
7
+ == Description
8
+
9
+ Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
10
+ specified in standard Ruby syntax.
7
11
 
8
12
  Rake has the following features:
9
13
 
@@ -19,30 +23,19 @@ Rake has the following features:
19
23
  file names and paths.
20
24
 
21
25
  * A library of prepackaged tasks to make building rakefiles easier. For example,
22
- tasks for building tarballs, gems and RDoc output are provided.
26
+ tasks for building tarballs. (Formerly
27
+ tasks for building RDoc, Gems, and publishing to FTP were included in rake but they're now
28
+ available in RDoc, RubyGems, and rake-contrib respectively.)
23
29
 
24
30
  * Supports parallel execution of tasks.
25
31
 
26
-
27
32
  == Installation
28
33
 
29
34
  === Gem Installation
30
35
 
31
- Download and install rake with the following.
32
-
33
- gem install rake
34
-
35
- === Normal Installation
36
-
37
- You can download the source tarball of the latest version of Rake from
36
+ Download and install rake with the following.
38
37
 
39
- * http://rubyforge.org/project/showfiles.php?group_id=50
40
-
41
- Extract the tarball and run
42
-
43
- % ruby install.rb
44
-
45
- from its distribution directory.
38
+ gem install rake
46
39
 
47
40
  == Usage
48
41
 
@@ -51,7 +44,7 @@ from its distribution directory.
51
44
  First, you must write a "Rakefile" file which contains the build rules. Here's
52
45
  a simple example:
53
46
 
54
- task :default => [:test]
47
+ task default: %w[test]
55
48
 
56
49
  task :test do
57
50
  ruby "test/unittest.rb"
@@ -59,8 +52,8 @@ a simple example:
59
52
 
60
53
  This Rakefile has two tasks:
61
54
 
62
- * A task named "test", which - upon invocation - will run a unit test file in
63
- Ruby.
55
+ * A task named "test", which -- upon invocation -- will run a unit test file
56
+ in Ruby.
64
57
  * A task named "default". This task does nothing by itself, but it has exactly
65
58
  one dependency, namely the "test" task. Invoking the "default" task will
66
59
  cause Rake to invoke the "test" task as well.
@@ -77,124 +70,86 @@ Running the "rake" command without any options will cause it to run the
77
70
 
78
71
  Type "rake --help" for all available options.
79
72
 
73
+ == Resources
80
74
 
81
- === More Information
82
-
83
- * For details on Rake's command-line invocation, read
84
- doc/command_line_usage.rdoc[http://rake.rubyforge.org/files/doc/command_line_usage_rdoc.html]
85
- * For details on writing Rakefiles, see
86
- doc/rakefile.rdoc[http://rake.rubyforge.org/files/doc/rakefile_rdoc.html].
87
- * For the original announcement of Rake, see
88
- doc/rational.rdoc[http://rake.rubyforge.org/files/doc/rational_rdoc.html].
89
- * For a glossary of terms, see
90
- doc/glossary.rdoc[http://rake.rubyforge.org/files/doc/glossary_rdoc.html].
91
-
92
- == Development
93
-
94
- === Source Repository
95
-
96
- Rake is currently hosted at github. The github web page is
97
- http://github.com/jimweirich/rake. The public git clone URL is
98
-
99
- * git://github.com/jimweirich/rake.git
100
-
101
- === Running the Rake Test Suite
102
-
103
- If you wish to run the unit and functional tests that come with Rake:
104
-
105
- * Install the 'flexmock' gem
106
- * Install the 'session' gem in order to run the functional tests.
107
- * CD into the top project directory of rake.
108
- * Type one of the following:
109
-
110
- rake # If you have a version of rake installed
111
- ruby -Ilib bin/rake # If you do not have a version of rake installed.
112
-
113
- === Issues and Bug Reports
114
-
115
- Feature requests and bug reports can be made here
75
+ === Rake Information
116
76
 
117
- * http://onestepback.org/cgi-bin/bugs.cgi?project=rake
118
-
119
- No account is needed for posting requests. Or you can send me an
120
- email (at jim dot weirich at gmail dot com)
121
-
122
- Issues and bug reports can be tracked here:
123
-
124
- * http://www.pivotaltracker.com/projects/28469
125
-
126
- == Online Resources
127
-
128
- === Rake References
129
-
130
- * Rake Documentation Home: http://docs.rubyrake.org
131
- * Rake Project Page: http://rubyforge.org/projects/rake
132
- * Rake API Documents: http://rake.rubyforge.org
133
- * Rake Source Code Repo: http://github.com/jimweirich/rake
134
- * Rake Git Repo Clone URL: git://github.com/jimweirich/rake.git
135
- * Rake Issue Tracking: http://www.pivotaltracker.com/projects/28469
136
- * Rake Bug Reports: http://onestepback.org/cgi-bin/bugs.cgi?project=rake
77
+ * {Rake command-line}[link:doc/command_line_usage.rdoc]
78
+ * {Writing Rakefiles}[link:doc/rakefile.rdoc]
79
+ * The original {Rake announcement}[link:doc/rational.rdoc]
80
+ * Rake {glossary}[link:doc/glossary.rdoc]
137
81
 
138
82
  === Presentations and Articles about Rake
139
83
 
140
- * Jim Weirich's 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/
141
- * Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html
84
+ * Avdi Grimm's rake series:
85
+ 1. {Rake Basics}[https://avdi.codes/rake-part-1-basics/]
86
+ 2. {Rake File Lists}[https://avdi.codes/rake-part-2-file-lists-2/]
87
+ 3. {Rake Rules}[https://avdi.codes/rake-part-3-rules/]
88
+ 4. {Rake Pathmap}[https://avdi.codes/rake-part-4-pathmap/]
89
+ 5. {File Operations}[https://avdi.codes/rake-part-5-file-operations/]
90
+ 6. {Clean and Clobber}[https://avdi.codes/rake-part-6-clean-and-clobber/]
91
+ 7. {MultiTask}[https://avdi.codes/rake-part-7-multitask/]
92
+ * {Jim Weirich's 2003 RubyConf presentation}[https://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/]
93
+ * Martin Fowler's article on Rake: https://martinfowler.com/articles/rake.html
142
94
 
143
- == Other Make Reinvisionings ...
95
+ == Other Make Re-envisionings ...
144
96
 
145
97
  Rake is a late entry in the make replacement field. Here are links to
146
98
  other projects with similar (and not so similar) goals.
147
99
 
148
- * http://directory.fsf.org/bras.html -- Bras, one of earliest
100
+ * https://directory.fsf.org/wiki/Bras -- Bras, one of earliest
149
101
  implementations of "make in a scripting language".
150
102
  * http://www.a-a-p.org -- Make in Python
151
- * http://www.aromatic.com/tools/jam.txt -- JAM, Java Automated Make
152
- * http://ant.apache.org -- The Ant project
153
- * http://ppt.perl.org/commands/make/index.html -- Make from the Perl
154
- Power Tools implementation.
155
- * http://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
156
- * http://make.rubyforge.org -- Rant, another Ruby make tool.
103
+ * https://ant.apache.org -- The Ant project
104
+ * https://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
105
+ * https://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool.
157
106
 
158
107
  == Credits
159
108
 
109
+ [<b>Jim Weirich</b>] Who originally created Rake.
110
+
160
111
  [<b>Ryan Dlugosz</b>] For the initial conversation that sparked Rake.
161
112
 
162
- [<b>nobu.nokada@softhome.net</b>] For the initial patch for rule support.
113
+ [<b>Nobuyoshi Nakada <nobu@ruby-lang.org></b>] For the initial patch for rule support.
163
114
 
164
115
  [<b>Tilman Sauerbeck <tilman@code-monkey.de></b>] For the recursive rule patch.
165
116
 
117
+ [<b>Eric Hodel</b>] For aid in maintaining rake.
118
+
119
+ [<b>Hiroshi SHIBATA</b>] Maintainer of Rake 10.X and Rake 11.X
120
+
166
121
  == License
167
122
 
168
123
  Rake is available under an MIT-style license.
169
124
 
170
125
  :include: MIT-LICENSE
171
126
 
172
- == Support
173
-
174
- The Rake homepage is http://rake.rubyforge.org. You can find the Rake
175
- RubyForge page at http://rubyforge.org/projects/rake.
176
-
177
- Feel free to submit commits or feature requests. If you send a patch,
178
- remember to update the corresponding unit tests. In fact, I prefer
179
- new feature to be submitted in the form of new unit tests.
180
-
181
- For other information, feel free to ask on the ruby-talk mailing list
182
- (which is mirrored to comp.lang.ruby) or contact
183
- jim dot weirich at gmail.com.
184
-
185
127
  ---
186
128
 
187
129
  = Other stuff
188
130
 
189
131
  Author:: Jim Weirich <jim.weirich@gmail.com>
190
- Requires:: Ruby 1.8.0 or later
191
- License:: Copyright 2003-2008 by Jim Weirich.
192
- Released under an MIT-style license. See the LICENSE file
193
- included in the distribution.
132
+ Requires:: Ruby 2.0.0 or later
133
+ License:: Copyright Jim Weirich.
134
+ Released under an MIT-style license. See the MIT-LICENSE
135
+ file included in the distribution.
194
136
 
195
137
  == Warranty
196
138
 
197
- This software is provided "as is" and without any express or
198
- implied warranties, including, without limitation, the implied
199
- warranties of merchantibility and fitness for a particular
200
- purpose.
139
+ This software is provided "as is" and without any express or implied
140
+ warranties, including, without limitation, the implied warranties of
141
+ merchantability and fitness for a particular purpose.
142
+
143
+ == Historical
144
+
145
+ Rake was originally created by Jim Weirich, who unfortunately passed away in
146
+ February 2014. This repository was originally hosted at
147
+ {github.com/jimweirich/rake}[https://github.com/jimweirich/rake/], however
148
+ with his passing, has been moved to {ruby/rake}[https://github.com/ruby/rake].
149
+
150
+ You can view Jim's last commit here:
151
+ https://github.com/jimweirich/rake/tree/336559f28f55bce418e2ebcc0a57548dcbac4025
152
+
153
+ You can {read more about Jim}[https://en.wikipedia.org/wiki/Jim_Weirich] at Wikipedia.
154
+
155
+ Thank you for this great tool, Jim. We'll remember you.
data/Rakefile CHANGED
@@ -6,400 +6,36 @@
6
6
  # This file may be distributed under an MIT style license. See
7
7
  # MIT-LICENSE for details.
8
8
 
9
- require 'rbconfig'
10
- require 'rubygems'
11
-
12
- system_rake = File.join RbConfig::CONFIG['rubylibdir'], 'rake.rb'
13
-
14
- # Use our rake, not the installed rake from system
15
- if $".include? system_rake then
16
- exec Gem.ruby, '-Ilib', 'bin/rake', *ARGV
17
- end
18
-
19
- require 'rubygems/package_task'
20
-
21
- require 'rake/clean'
22
- require 'rake/testtask'
23
-
24
- begin
25
- gem 'rdoc'
26
- require 'rdoc/task'
27
- rescue Gem::LoadError
28
- end
29
-
30
- CLEAN.include('**/*.o', '*.dot', '**/*.rbc')
31
- CLOBBER.include('doc/example/main', 'testdata')
32
- CLOBBER.include('test/data/**/temp_*')
33
- CLOBBER.include('test/data/chains/play.*')
34
- CLOBBER.include('test/data/file_creation_task/build')
35
- CLOBBER.include('test/data/file_creation_task/src')
36
- CLOBBER.include('TAGS')
37
- CLOBBER.include('coverage', 'rcov_aggregate')
38
-
39
- # Prevent OS X from including extended attribute junk in the tar output
40
- ENV['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true'
41
-
42
- def announce(msg='')
43
- STDERR.puts msg
44
- end
45
-
46
- # Determine the current version of the software
47
-
48
- if `ruby -Ilib ./bin/rake --version` =~ /rake, version ([0-9a-z.]+)$/
49
- CURRENT_VERSION = $1
50
- else
51
- CURRENT_VERSION = "0.0.0"
52
- end
53
-
54
- $package_version = CURRENT_VERSION
55
-
56
- SRC_RB = FileList['lib/**/*.rb']
57
-
58
- # The default task is run if rake is given no explicit arguments.
59
-
60
- desc "Default Task"
61
- task :default => :test
62
-
63
- # Test Tasks ---------------------------------------------------------
64
-
65
- Rake::TestTask.new do |t|
66
- files = FileList['test/helper.rb', 'test/test_*.rb']
67
- t.test_files = files
68
- t.libs << "."
69
- t.warning = true
70
- end
9
+ lib = File.expand_path("../lib", __FILE__)
10
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
71
11
 
72
12
  begin
73
- require 'rcov/rcovtask'
74
- IGNORE_COVERAGE_IN = FileList[
75
- 'lib/rake/rdoctask.rb',
76
- 'lib/rake/testtask.rb',
77
- 'lib/rake/packagetask.rb',
78
- 'lib/rake/clean.rb',
79
- ]
80
-
81
- unless File::ALT_SEPARATOR
82
- IGNORE_COVERAGE_IN.include(
83
- 'lib/rake/alt_system.rb',
84
- 'lib/rake/win32.rb')
85
- end
86
-
87
- Rcov::RcovTask.new do |t|
88
- t.libs << "test"
89
- t.rcov_opts = [
90
- '-xRakefile', '-xrakefile', '-xpublish.rf',
91
- '-xlib/rake/contrib', '-x/Library', '-x.rvm',
92
- '--text-report',
93
- '--sort coverage'
94
- ] + FileList['rakelib/*.rake'].pathmap("-x%p") +
95
- IGNORE_COVERAGE_IN.map { |fn| "-x#{fn}" }
96
- t.test_files = FileList[
97
- 'test/lib/*_test.rb',
98
- 'test/contrib/*_test.rb',
99
- 'test/functional/*_test.rb'
100
- ]
101
- t.output_dir = 'coverage'
102
- t.verbose = true
103
- end
13
+ require "bundler/gem_tasks"
104
14
  rescue LoadError
105
- task :rcov do
106
- puts "RCov is not available"
107
- end
108
- end
109
-
110
- directory 'testdata'
111
- task :test => ['testdata']
112
-
113
- # CVS Tasks ----------------------------------------------------------
114
-
115
- # Install rake using the standard install.rb script.
116
-
117
- desc "Install the application"
118
- task :install do
119
- ruby "install.rb"
120
- end
121
-
122
- # Create a task to build the RDOC documentation tree.
123
-
124
- BASE_RDOC_OPTIONS = [
125
- '--line-numbers', '--show-hash',
126
- '--main', 'README.rdoc',
127
- '--title', 'Rake -- Ruby Make'
128
- ]
129
-
130
- if defined?(RDoc::Task) then
131
- RDoc::Task.new do |rdoc|
132
- rdoc.rdoc_dir = 'html'
133
- rdoc.title = "Rake -- Ruby Make"
134
- rdoc.options = BASE_RDOC_OPTIONS.dup
135
-
136
- rdoc.rdoc_files.include('README.rdoc', 'MIT-LICENSE', 'TODO', 'CHANGES')
137
- rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
138
- rdoc.rdoc_files.exclude(/\bcontrib\b/)
139
- end
140
- else
141
- warn "RDoc 2.4.2+ is required to build documentation"
142
- end
143
-
144
- # ====================================================================
145
- # Create a task that will package the Rake software into distributable
146
- # tar, zip and gem files.
147
-
148
- PKG_FILES = FileList[
149
- '.gemtest',
150
- 'install.rb',
151
- '[A-Z]*',
152
- 'bin/**/*',
153
- 'lib/**/*.rb',
154
- 'test/**/*.rb',
155
- 'test/**/*.rf',
156
- 'test/**/*.mf',
157
- 'test/**/Rakefile',
158
- 'test/**/subdir',
159
- 'doc/**/*'
160
- ]
161
- PKG_FILES.exclude('doc/example/*.o')
162
- PKG_FILES.exclude('TAGS')
163
- PKG_FILES.exclude(%r{doc/example/main$})
164
-
165
- if ! defined?(Gem)
166
- puts "Package Target requires RubyGEMs"
167
- else
168
- SPEC = Gem::Specification.new do |s|
169
-
170
- #### Basic information.
171
-
172
- s.name = 'rake'
173
- s.version = $package_version
174
- s.summary = "Ruby based make-like utility."
175
- s.description = <<-EOF
176
- Rake is a Make-like program implemented in Ruby. Tasks
177
- and dependencies are specified in standard Ruby syntax.
178
- EOF
179
-
180
- #### Dependencies and requirements.
181
-
182
- s.required_rubygems_version = '>= 1.3.2'
183
- s.add_development_dependency 'minitest', '~> 2.1'
184
- s.add_development_dependency 'session', '~> 2.4'
185
- s.add_development_dependency 'flexmock', '~> 0.8.11'
186
-
187
- #### Which files are to be included in this gem? Everything! (Except CVS directories.)
188
-
189
- s.files = PKG_FILES.to_a
190
-
191
- #### C code extensions.
192
-
193
- #s.extensions << "ext/rmagic/extconf.rb"
194
-
195
- #### Load-time details: library and application (you will need one or both).
196
-
197
- s.require_path = 'lib' # Use these for libraries.
198
-
199
- s.bindir = "bin" # Use these for applications.
200
- s.executables = ["rake"]
201
-
202
- #### Documentation and testing.
203
-
204
- s.extra_rdoc_files = FileList[
205
- 'README.rdoc',
206
- 'MIT-LICENSE',
207
- 'TODO',
208
- 'CHANGES',
209
- 'doc/**/*.rdoc'
210
- ]
211
-
212
- s.rdoc_options = BASE_RDOC_OPTIONS
213
-
214
- #### Author and project details.
215
-
216
- s.author = "Jim Weirich"
217
- s.email = "jim@weirichhouse.org"
218
- s.homepage = "http://rake.rubyforge.org"
219
- s.rubyforge_project = "rake"
220
- # if ENV['CERT_DIR']
221
- # s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem')
222
- # s.cert_chain = [File.join(ENV['CERT_DIR'], 'gem-public_cert.pem')]
223
- # end
224
- end
225
-
226
- Gem::PackageTask.new(SPEC) do |pkg|
227
- pkg.need_zip = true
228
- pkg.need_tar = true
229
- end
230
-
231
- file "rake.gemspec" => ["Rakefile", "lib/rake.rb"] do |t|
232
- require 'yaml'
233
- open(t.name, "w") { |f| f.puts SPEC.to_yaml }
234
- end
235
-
236
- desc "Create a stand-alone gemspec"
237
- task :gemspec => "rake.gemspec"
238
15
  end
239
16
 
240
- # Misc tasks =========================================================
241
-
242
- def count_lines(filename)
243
- lines = 0
244
- codelines = 0
245
- open(filename) { |f|
246
- f.each do |line|
247
- lines += 1
248
- next if line =~ /^\s*$/
249
- next if line =~ /^\s*#/
250
- codelines += 1
251
- end
252
- }
253
- [lines, codelines]
17
+ require "rake/testtask"
18
+ Rake::TestTask.new(:test) do |t|
19
+ t.libs << "test"
20
+ t.verbose = true
21
+ t.test_files = FileList["test/**/test_*.rb"]
254
22
  end
255
23
 
256
- def show_line(msg, lines, loc)
257
- printf "%6s %6s %s\n", lines.to_s, loc.to_s, msg
24
+ require "rdoc/task"
25
+ RDoc::Task.new do |doc|
26
+ doc.main = "README.rdoc"
27
+ doc.title = "Rake -- Ruby Make"
28
+ doc.rdoc_files = FileList.new %w[lib MIT-LICENSE doc/**/*.rdoc *.rdoc]
29
+ doc.rdoc_dir = "html"
258
30
  end
259
31
 
260
- desc "Count lines in the main rake file"
261
- task :lines do
262
- total_lines = 0
263
- total_code = 0
264
- show_line("File Name", "LINES", "LOC")
265
- SRC_RB.each do |fn|
266
- lines, codelines = count_lines(fn)
267
- show_line(fn, lines, codelines)
268
- total_lines += lines
269
- total_code += codelines
270
- end
271
- show_line("TOTAL", total_lines, total_code)
32
+ task ghpages: :rdoc do
33
+ %x[git checkout gh-pages]
34
+ require "fileutils"
35
+ FileUtils.rm_rf "/tmp/html"
36
+ FileUtils.mv "html", "/tmp"
37
+ FileUtils.rm_rf "*"
38
+ FileUtils.cp_r Dir.glob("/tmp/html/*"), "."
272
39
  end
273
40
 
274
- # Define an optional publish target in an external file. If the
275
- # publish.rf file is not found, the publish targets won't be defined.
276
-
277
- load "publish.rf" if File.exist? "publish.rf"
278
-
279
- # Support Tasks ------------------------------------------------------
280
-
281
- RUBY_FILES = FileList['**/*.rb'].exclude('pkg')
282
-
283
- desc "Look for TODO and FIXME tags in the code"
284
- task :todo do
285
- RUBY_FILES.egrep(/#.*(FIXME|TODO|TBD)/)
286
- end
287
-
288
- desc "List all ruby files"
289
- task :rubyfiles do
290
- puts RUBY_FILES
291
- puts FileList['bin/*'].exclude('bin/*.rb')
292
- end
293
- task :rf => :rubyfiles
294
-
295
- # --------------------------------------------------------------------
296
- # Creating a release
297
-
298
- def plugin(plugin_name)
299
- require "rake/plugins/#{plugin_name}"
300
- end
301
-
302
- task :noop
303
- #plugin "release_manager"
304
-
305
- desc "Make a new release"
306
- task :release, [:rel, :reuse, :reltest] => [
307
- :prerelease,
308
- :clobber,
309
- :test,
310
- :update_version,
311
- :package,
312
- :tag
313
- ] do
314
- announce
315
- announce "**************************************************************"
316
- announce "* Release #{$package_version} Complete."
317
- announce "* Packages ready to upload."
318
- announce "**************************************************************"
319
- announce
320
- end
321
-
322
- # Validate that everything is ready to go for a release.
323
- task :prerelease, :rel, :reuse, :reltest do |t, args|
324
- $package_version = args.rel
325
- announce
326
- announce "**************************************************************"
327
- announce "* Making RubyGem Release #{$package_version}"
328
- announce "* (current version #{CURRENT_VERSION})"
329
- announce "**************************************************************"
330
- announce
331
-
332
- # Is a release number supplied?
333
- unless args.rel
334
- fail "Usage: rake release[X.Y.Z] [REUSE=tag_suffix]"
335
- end
336
-
337
- # Is the release different than the current release.
338
- # (or is REUSE set?)
339
- if $package_version == CURRENT_VERSION && ! args.reuse
340
- fail "Current version is #{$package_version}, must specify REUSE=tag_suffix to reuse version"
341
- end
342
-
343
- # Are all source files checked in?
344
- if args.reltest
345
- announce "Release Task Testing, skipping checked-in file test"
346
- else
347
- announce "Checking for unchecked-in files..."
348
- data = `svn st`
349
- unless data =~ /^$/
350
- abort "svn status is not clean ... do you have unchecked-in files?"
351
- end
352
- announce "No outstanding checkins found ... OK"
353
- end
354
- end
355
-
356
- task :update_version, [:rel, :reuse, :reltest] => [:prerelease] do |t, args|
357
- if args.rel == CURRENT_VERSION
358
- announce "No version change ... skipping version update"
359
- else
360
- announce "Updating Rake version to #{args.rel}"
361
- open("lib/rake.rb") do |rakein|
362
- open("lib/rake.rb.new", "w") do |rakeout|
363
- rakein.each do |line|
364
- if line =~ /^RAKEVERSION\s*=\s*/
365
- rakeout.puts "RAKEVERSION = '#{args.rel}'"
366
- else
367
- rakeout.puts line
368
- end
369
- end
370
- end
371
- end
372
- mv "lib/rake.rb.new", "lib/rake.rb"
373
- if args.reltest
374
- announce "Release Task Testing, skipping commiting of new version"
375
- else
376
- sh %{svn commit -m "Updated to version #{args.rel}" lib/rake.rb} # "
377
- end
378
- end
379
- end
380
-
381
- desc "Tag all the CVS files with the latest release number (REL=x.y.z)"
382
- task :tag, [:rel, :reuse, :reltest] => [:prerelease] do |t, args|
383
- reltag = "REL_#{args.rel.gsub(/\./, '_')}"
384
- reltag << args.reuse.gsub(/\./, '_') if args.reuse
385
- announce "Tagging Repository with [#{reltag}]"
386
- if args.reltest
387
- announce "Release Task Testing, skipping CVS tagging"
388
- else
389
- sh %{svn copy svn+ssh://rubyforge.org/var/svn/rake/trunk svn+ssh://rubyforge.org/var/svn/rake/tags/#{reltag} -m 'Commiting release #{reltag}'} ###'
390
- end
391
- end
392
-
393
- # Require experimental XForge/Metaproject support.
394
-
395
- load 'xforge.rf' if File.exist?('xforge.rf')
396
-
397
- desc "Where is the current directory. This task displays\nthe current rake directory"
398
- task :where_am_i do
399
- puts Rake.original_dir
400
- end
401
-
402
- task :failure => :really_fail
403
- task :really_fail do
404
- fail "oops"
405
- end
41
+ task default: :test