diff --git a/.autotest b/.autotest deleted file mode 100644 index 0988b12a8..000000000 --- a/.autotest +++ /dev/null @@ -1,7 +0,0 @@ -require 'autotest/restart' - -Autotest.add_hook :initialize do |at| - at.testlib = '' - at.add_exception '.git' -end - diff --git a/.rubocop.yml b/.rubocop.yml index 6d2bfcdbd..385e49289 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,15 +1,6 @@ StringLiterals: Enabled: false -MultilineBlocks: - Enabled: false - -SingleLineBlocks: - Enabled: false - -NewLambdaLiteral: - Enabled: false - SpaceAroundEqualsInParameterDefault: Enabled: false diff --git a/.togglerc b/.togglerc deleted file mode 100644 index c8c5a0a97..000000000 --- a/.togglerc +++ /dev/null @@ -1,7 +0,0 @@ -(add-to-list - 'toggle-mapping-styles - '(rake . ( - ("test/test_rake_\\1.rb" . "lib/rake/\\1.rb") - ) )) - -(buffer-toggle-style 'rake) diff --git a/.travis.yml b/.travis.yml index df1c39760..477e55fc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,28 @@ ---- -after_script: -- ruby -Ilib bin/rake travis:after -t -before_script: -- gem install hoe-travis --no-document -- gem install minitest -v '~> 5.0' --no-document -- ruby -Ilib bin/rake travis:before -t -- unset JRUBY_OPTS language: ruby sudo: false -notifications: - email: - - drbrain@segment7.net rvm: - 1.9.3 - 2.0.0 - - 2.1.8 - - 2.2.4 - - 2.3.0 + - 2.1.10 + - 2.2.5 + - 2.3.1 - ruby-head - jruby-1.7.20 - jruby-9.0.5.0 + - jruby-9.1.0.0 - jruby-head - rbx-2 -script: ruby -Ilib bin/rake + - rbx +before_install: + - gem update bundler --no-document +before_script: + - unset JRUBY_OPTS +script: ruby -Ilib exe/rake +matrix: + allow_failures: + - rvm: jruby-head + - rvm: rbx +notifications: + email: + - hsbt@ruby-lang.org + - drbrain@segment7.net diff --git a/CONTRIBUTING.rdoc b/CONTRIBUTING.rdoc index 7eed5fb99..d68e8c525 100644 --- a/CONTRIBUTING.rdoc +++ b/CONTRIBUTING.rdoc @@ -1,7 +1,7 @@ = Source Repository Rake is currently hosted at github. The github web page is -http://github.com/ruby/rake . The public git clone URL is +https://github.com/ruby/rake . The public git clone URL is git://github.com/ruby/rake.git @@ -10,13 +10,12 @@ http://github.com/ruby/rake . The public git clone URL is If you wish to run the unit and functional tests that come with Rake: * +cd+ into the top project directory of rake. -* Install the +hoe+ gem dependency: +* Install gem dependency using bundler: - gem install hoe # Unless the hoe gem is already installed + bundle install # Install bundler, minitest and rdoc * Type one of the following: - rake newb # If you have never run rake's tests rake # If you have run rake's tests = Issues and Bug Reports @@ -35,4 +34,3 @@ When submitting pull requests please check the rake Travis-CI page for test failures: https://travis-ci.org/ruby/rake - diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..fa75df156 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gemspec diff --git a/History.rdoc b/History.rdoc index a0be0546b..0ea9241d3 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,23 @@ +=== 11.2.0 / 2016-06-11 + +Bug fixes: + +* Fix unexpected cut-out behavior on task description using triple dots + and exclamation. Report #106 from Stephan Kämper and Pull request #134 by Lee +* Fix empty argument assignment with `with_defaults` option. Pull request #135 + by bakunyo +* Ignore to use `hwprefs` on Darwin platform. Use sysctl now. Report #128 + +Enhancements: + +* Spawn options for sh Pull equest #138 by Eric Hodel. +* Allow to specify dependencies(prerequisites) for Rake::TestTask + Pull request #117 by Tim Maslyuchenko +* Use Bundler task instead of hoe for gem release. +* Remove explicitly load to rubygems for Ruby 1.8. +* Unify to declare `Rake::VERSION`. +* Support xz format for PackageTask. + === 11.1.2 / 2016-03-28 Bug fixes: @@ -16,7 +36,7 @@ Bug fixes: Compatibility Changes: -* Revert to remove `last_comment`. It will remove Rake 12. +* Revert to remove `last\_comment`. It will remove Rake 12. === 11.0.1 / 2016-03-09 @@ -52,7 +72,7 @@ Compatibility Changes: * Removed constant named `RAKEVERSION` * Removed Rake::AltSystem * Removed Rake::RubyForgePublisher -* Removed Rake::TaskManager#last_comment. Use last_description. +* Removed Rake::TaskManager#last\_comment. Use last\_description. * Removed Rake::TaskLib#paste * Removed Top-level SshDirPublisher, SshFreshDirPublisher, SshFilePublisher and CompositePublisher from lib/rake/contrib/publisher.rb @@ -186,7 +206,7 @@ Bug fixes: * Clarified `rake -f` usage message. Pull request #252 by Marco Pfatschbacher. * Fixed a test failure on windows. Pull request #231 by Hiroshi Shirosaki. * Fixed corrupted rake.1.gz. Pull request #225 by Michel Boaventura. -* Fixed bug in can_detect_signals? in test. Patch from #243 by Alexey +* Fixed bug in can\_detect\_signals? in test. Patch from #243 by Alexey Borzenkov. === 10.1.1 and earlier @@ -195,366 +215,1843 @@ Additions to the old CHANGES file were not made consistently so some versions are missing from this file. These changes are usually described in the individual release notes files. -=== 0.9.3 +=== 10.1.0 -* The rake test loader now removes arguments it has processed. Issue #51 -* Rake::TaskArguments now responds to #values_at -* RakeFileUtils.verbose_flag = nil silences output the same as 0.8.7 -* Rake tests are now directory-independent -* Rake tests are no longer require flexmock -* Commands constant is no longer polluting top level namespace. -* Show only the interesting portion of the backtrace by default (James M. Lawrence). -* Added --reduce-compat optiont to remove backward compatible DSL hacks (James M. Lawrence). -* lib/rake/file_list.rb (Rake::FileList#egrep): there is no need to - open files in binary mode. (NAKAMURA Usaku) +==== Changes -=== 0.9.2 +===== New Features -* Unknown +* Add support for variable length task argument lists. If more actual + arguments are supplied than named arguments, then the extra + arguments values will be in args.extras. -=== 0.9.1 +* Application name is not displayed in the help banner. (Previously + "rake" was hardcoded, now rake-based applications can display their + own names). -* Added deprecation warnings to the Rake DSL methods. +===== Bug Fixes -=== 0.9.0 +Bug fixes include: -* *Incompatible* *change*: Rake DSL commands ('task', 'file', etc.) are - no longer private methods in Object. If you need to call 'task :xzy' inside - your class, include Rake::DSL into the class. The DSL is still available at - the top level scope (via the top level object which extends Rake::DSL). +* Fix backtrace suppression issues. -* Rake now warns when the deprecated :needs syntax used. +* Rules now explicit get task arguments passed to them. -* Rake history is now UTF-8 encoded. +* Rename FileList#exclude? to FileList#exclude\_from\_list? to avoid + conflict with new Rails method. -* Rake now uses case-insensitive comparisons to find the Rakefile on Windows. - Based on patch by Roger Pack. +* Clean / Clobber tasks now report failure to remove files. -* Rake now requires (instead of loads) files in the test task. Patch by Cezary - Baginski. +* Plus heaps of internal code cleanup. -* Fixed typos. Patches by Sean Scot August Moon and R.T. Lechow. +==== Thanks -* Rake now prints the Rakefile directory only when it's different from the - current directory. Patch by Alex Chaffee. +As usual, it was input from users that drove a lot of these changes. +The following people contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... -* Improved rakefile_location discovery on Windows. Patch by James Tucker. +* Michael Nikitochkin (general code cleanup) +* Vipul A M (general code cleanup) +* Dennis Bell (variable length task argument lists) +* Jacob Swanner (rules arguments) +* Rafael Rosa Fu (documentation typo) +* Stuart Nelson (install.rb fixes) +* Lee Hambley (application name in help banner) -* Rake now recognizes "Windows Server" as a windows system. Patch by Matthias - Lüdtke +-- Jim Weirich -* Rake::RDocTask is deprecated. Use RDoc::Task from RDoc 2.4.2+ (require - 'rdoc/task') +=== 10.0.3 -* Rake::GemPackageTask is deprecated. Use Gem::PackageTask (require - 'rubygems/package_task') + "Jim, when will Rake reach version 1.0?" -* Rake now outputs various messages to $stderr instead of $stdout. +Over the past several years I've been asked that question at +conferences, panels and over twitter. Due to historical reasons (or +maybe just plain laziness) Rake has (incorrectly) been treating the +second digit of the version as the major release number. So in my head +Rake was already at version 9. -* Rake no longer emits warnings for Config. Patch by Santiago Pastorino. +Well, it's time to fix things. This next version of Rake drops old, +crufty, backwards compatibility hacks such as top level constants, DSL +methods defined in Object and numerous other features that are just no +longer desired. It's also time to drop the leading zero from the +version number as well and call this new version of rake what it +really is: Version 10. -* Split rake.rb into individual files. +So, welcome to Rake 10.0! -* Support for the --where (-W) flag for showing where a task is defined. +Rake 10 is actually feature identical to the latest version of Rake 9 +(that would be the version spelled 0.9.3), *except* that Rake 10 drops +all the sundry deprecated features that have accumulated over the years. -* Fixed quoting in test task. - (http://onestepback.org/redmine/issues/show/44, - http://www.pivotaltracker.com/story/show/1223138) +If your Rakefile is up to date and current with all the new features +of Rake 10, you are ready to go. If your Rakefile still uses a few +deprecated feeatures, feel free to use Rake 9 (0.9.3) with the same +feature set. Just be aware that future features will be in Rake 10 +family line. -* Fixed the silent option parsing problem. - (http://onestepback.org/redmine/issues/show/47) +==== Changes -* Fixed :verbose=>false flag on sh and ruby commands. +As mentioned above, there are no new features in Rake 10. However, +there are a number of features missing: -* Rake command line options may be given by default in a RAKEOPT - environment variable. +* Classic namespaces are now gone. Rake is no longer able to reflect + the options settings in the global variables ($rakefile, $show\_tasks, + $show\_prereqs, $trace, $dryrun and $silent). The + --classic-namespace option is no longer supported. -* Errors in Rake will now display the task invocation chain in effect - at the time of the error. +* Global constants are no longer supported. This includes + Task, FileTask, FileCreationTask and + RakeApp). The constant missing hook to warn about using + global rake constants has been removed. -* Accepted change by warnickr to not expand test patterns in shell - (allowing more files in the test suite). +* The Rake DSL methods (task, file, directory, etc) are in their own + module (Rake::DSL). The stub versions of these methods (that printed + warnings) in Object have been removed. However, the DSL methods are + added to the top-level main object. Since main is + not in the inheritance tree, the presence of the DSL methods in main + should be low impact on other libraries. -* Fixed that file tasks did not perform prereq lookups in scope - (Redmine #57). + If you want to use the Rake DSL commands from your own code, just + include Rake::DSL into your own classes and modules. -=== 0.8.7 +* The deprecated syntax for task arguments (the one using + :needs) has been removed. -* Fixed EXEEXT for JRuby on windows. +* The --reduce-compat flag has been removed (it's not needed + anymore). -=== 0.8.6 +* The deprecated rake/sys.rb library has been removed. -* Minor fixes to the RDoc generation (removed dependency on darkfish - and removed inline source option). +* The deprecated rake/rdoctask.rb library has been removed. + RDoc supplies its own rake task now. -* Now allow # comments to comment a task definition. +* The deprecated rake/gempackagetask.rb library has been + removed. Gem supplies its own package task now. -=== 0.8.5 +There is one small behavioral change: -* Better support for the system command on Windows. +* Non-file tasks now always report the current time as their time + stamp. This is different from the previous behavior where non-file + tasks reported current time only if there were no prerequisites, and + the max prerequisite timestamp otherwise. This lead to inconsistent + and surprising behavior when adding prerequisites to tasks that in + turn were prequisites to file tasks. The new behavior is more + consistent and predictable. -=== 0.8.4 +==== Changes (from 0.9.3, 0.9.4, 0.9.5) -* Preserve case when locating rakefiles (patch from James - M. Lawrence/quix) +Since Rake 10 includes the changes from the last version of Rake 9, +we'll repeat the changes for versions 0.9.3 through 0.9.5 here. -* Better support for windows paths in the test task (patch from Simon - Chiang/bahuvrihi) +===== New Features (in 0.9.3) -* Windows system dir search order is now: HOME, HOMEDRIVE + HOMEPATH, - APPDATA, USERPROFILE (patch from Luis Lavena) +* Multitask tasks now use a thread pool. Use -j to limit the number of + available threads. -* MingGW is now recognized as a windows platform. (patch from Luis - Lavena) +* Use -m to turn regular tasks into multitasks (use at your own risk). -* Numerous fixes to the windows test suite (patch from Luis Lavena). +* You can now do "Rake.add_rakelib 'dir'" in your Rakefile to + programatically add rake task libraries. -* Improved Rakefile case insensitivity testing (patch from Luis - Lavena). +* You can specific backtrace suppression patterns (see + --supress-backtrace) -* Fixed stray ARGV option problem that was interfering with - Test::Unit::Runner. +* Directory tasks can now take prerequisites and actions -* Fixed default verbose mode (was accidently changed to false). +* Use --backtrace to request a full backtrace without the task trace. -* Removed reference to manage_gem to fix the warning produced by the - gem package task. +* You can say "--backtrace=stdout" and "--trace=stdout" to route trace + output to standard output rather than standard error. -=== 0.8.3 +* Optional 'phony' target (enable with 'require 'rake/phony'") for + special purpose builds. -* Enhanced the system directory detection in windows. We now check - HOMEDRIVE/HOMEPATH and USERPROFILE if APPDATA isn't found. (Patch - supplied by James Tucker). Rake no long aborts if it can't find the - directory. +* Task#clear now clears task comments as well as actions and + prerequisites. Task#clear_comment will specifically target comments. -* Added fix to handle ruby installations in directories with spaces in - their name. +* The --all option will force -T and -D to consider all the tasks, + with and without descriptions. -=== 0.8.2 +===== Bug Fixes (in 0.9.3) -* Fixed bug in package task so that it will include the subdir - directory in the package for testing. (Bug found by Adam Majer) +* Semi-colons in windows rakefile paths now work. -* Added ENV var to rakefile to prevent OS X from including extended - attribute junk in a tar file. (Bug found by Adam Majer) +* Improved Control-C support when invoking multiple test suites. -* Fixed filename dependency order bug in test_inspect_pending and - test_to_s_pending. (Bug found by Adam Majer) +* egrep method now reads files in text mode (better support for + Windows) -* Fixed check for file utils options to make them immune to the - symbol/string differences. (Patch supplied by Edwin Pratomo) +* Better deprecation line number reporting. -* Fixed bug with rules involving multiple source (Patch supplied by - Emanuel Indermühle) +* The -W option now works with all tasks, whether they have a + description or not. -* Switched from getoptlong to optparse (patches supplied by Edwin - Pratomo) +* File globs in rake should not be sorted alphabetically, independent + of file system and platform. -* The -T option will now attempt to dynamically sense the size of the - terminal. RAKE_COLUMNS will override any dynamic sensing. +* Numerous internal improvements. -* FileList#clone and FileList#dup have better sematics w.r.t. taint - and freeze. +* Documentation typos and fixes. -* Added ability clear prerequisites, and/or actions from an existing - task. +===== Bug Fixes (in 0.9.4) -* Added the ability to reenable a task to be invoked a second time. +* Exit status with failing tests is not correctly set to non-zero. -* Changed RDoc test task to have no default template. This makes it - easier for the tempate to pick up the template from the environment. +* Simplified syntax for phony task (for older versions of RDoc). -* Changed from using Mutex to Monitor. Evidently Mutex causes thread - join errors when Ruby is compiled with -disable-pthreads. (Patch - supplied by Ittay Dror) +* Stand alone FileList usage gets glob function (without loading in + extra dependencies) -* Fixed bug in makefile parser that had problems with extra spaces in - file task names. (Patch supplied by Ittay Dror) +===== Bug Fixes (in 0.9.5) -* Added a performance patch for reading large makefile dependency - files. (Patch supplied by Ittay Dror) +* --trace and --backtrace no longer swallow following task names. -* Default values for task arguments can easily be specified with the - :with_defaults method. (Idea for default argument merging supplied - by (Adam Q. Salter) +==== Thanks -* The -T output will only self-truncate if the output is a tty. - However, if RAKE_COLUMNS is explicitly set, it will be honored in - any case. (Patch provided by Gavin Stark). +As usual, it was input from users that drove a lot of these changes. The +following people contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... -* Numerous fixes for running under windows. A big thanks to Bheeshmar - Redheendran for spending a good part of the afternoon at the - Lonestar Ruby Conference to help me work out these issues. +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix -=== 0.8.1 +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. -* Removed requires on parsedate.rb (in Ftptools) -* Removed ftools from rake.rb. Made it options in sys.rb +-- Jim Weirich -=== 0.8.0 +=== 10.0.2 -* Added task parameters (e.g. "rake build[version7]") -* Made task parameters passable to prerequisites. -* Comments are limited to 80 columns or so (suggested by Jamis Buck). -* Added -D to display full comments (suggested by Jamis Buck). -* The rake program will set the status value used in any explicit - exit(n) calls. (patch provided by Stephen Touset) -* Fixed error in functional tests that were not including session (and - silently skipping the functionl tests. -* Removed --usage and make -h the same as -H. -* Make a prettier inspect for tasks. +==== Changes -=== 0.7.3 +===== Bug Fixes -* Added existing and existing! methods to FileList -* FileLists now claim to be Arrays (via is_a?) to get better support - from the FileUtil module. -* Added init and top_level for custom rake applications. +* --trace and --backtrace no longer swallow following task names. -=== 0.7.2 +==== Thanks -* Error messages are now send to stderr rather than stdout (from - Payton Quackenbush). -* Better error handling on invalid command line arguments (from Payton - Quackenbush). -* Added rcov task and updated unit testing for better code coverage. -* Fixed some bugs where the application object was going to the global - appliation instead of using its own data. -* Added square and curly bracket patterns to FileList#include (Tilman - Sauerbeck). -* Added plain filename support to rule dependents (suggested by Nobu - Nakada). -* Added pathmap support to rule dependents. -* Added a 'tasks' method to a namespace to get a list of tasks - associated with the namespace. -* Fixed the method name leak from FileUtils (bug found by Glenn - Vanderburg). -* Added rake_extension to handle detection of extension collisions. -* Added test for noop, bad_option and verbose flags to sh command. -* Removed dependency on internal fu_xxx functions from FileUtils. -* Added a 'shame' task to the Rakefile. -* Added tar_command and zip_command options to the Package task. -* Added a description to the gem task in GemPackageTask. -* Fixed a bug when rules have multiple prerequisites (patch by Joel - VanderWerf) -* Added a protected 'require "rubygems"' to test/test_application to - unbreak cruisecontrol.rb. -* Added the handful of RakeFileUtils to the private method as well. -* Added block based exclusion. -* The clean task will no longer delete 'core' if it is a directory. -* Removed rake_dup. Now we just simply rescue a bad dup. -* Refactored the FileList reject logic to remove duplication. -* Removed if __FILE__ at the end of the rake.rb file. +As usual, it was input from users that drove a lot of these changes. The +following people contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... -=== 0.7.1 +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix -* Added optional filter parameter to the --tasks command line option. -* Added flatten to allow rule transform procs to return lists of - prereqs (Joel VanderWerf provided patch). -* Added pathmap to String and FileList. -* The -r option will now load .rake files (but a straight require - doesn't yet). NOTE: This is experimental ... it may be - discontinued. -* The -f option without a value will disable the search for a - Rakefile. The assumption is that the -r files are adequate. -* Fixed the safe_ln function to fall back to cp in more error - scenarios. +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. -=== 0.7.0 +-- Jim Weirich -* Added Rake.original_dir to return the original starting directory of - the rake application. -* Added safe_ln support for openAFS (from Ludvig Omholt). -* Added --trace reminder on short exception messages (David Heinemeier - Hansson suggestion). -* Added multitask declaration that executes prerequisites in - parallel. (Doug Young providied an initial implementation). -* Fixed missing_const hack to be compatible with Rails. (Jamis Buck - supplied test case). -* Made the RDoc task default to internal (in-process) RDoc formatting. - The old behavior is still available by setting the +external+ flag - to true. -* Rakefiles are now loaded with the expanded path to prevent - accidental polution from the Ruby load path. -* The +namespace+ command now returns a NameSpace object that can be - used to lookup tasks defined in that namespace. This allows for - better anonymous namespace behavior. -* Task objects my now be used in prerequisite lists directly. +=== 10.0.1 -=== 0.6.1 +==== Changes -* Rebuilt 0.6.0 gem without signing. +===== Bug Fixes -=== 0.6.0 +* Exit status with failing tests is not correctly set to non-zero. -* Fixed file creation bug in the unit tests (caused infinite loop on - windows). -* Fixed bug where session based functional tests were run under - windows. -* Fixed bug in directory tasks so that updating a directory will not - retrigger file tasks depending on the directory (see - FileCreationTask and EarlyTime). -* Added egrep to FileList -* ruby command now runs same ruby version as rake. -* Added investigation to task object. (suggested by Martin Fowler) -* Added ruby_opts to the test task to allow arbitrary ruby options to - be passed to the test script. (Greg Fast) -* Fixed the test loader to ignore options. (Greg Fast) -* Moved Task, FileTask, FileCreationTask and RakeApp into the Rake - module namespace. Old style namespace behavior can be invoked via - the --classic-namespace option. (requested by Kelly Felkins). -* GemTask is now sensitive to the gem platform (Masao Mutoh). -* A non-existing file prerequisite will no longer cause an exception - (Philipp Neubeck). -* Multiple prerequisites on Rake rules now allowed (initial patch - supplied by Stuart Jansen). +* Simplified syntax for phony task (for older versions of RDoc). -=== 0.5.4 +* Stand alone FileList usage gets glob function (without loading in + extra dependencies) -* Added double quotes to the test runner. -* Added .svn to default ignore list. -* Updated FileList#include to support nested arrays and filelists. +==== Thanks -=== 0.5.3 +As usual, it was input from users that drove a lot of these changes. The +following people contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... -* Added support for importing Rakefile and other dependencies. -* Fixed bug so that now rules can chain off of existing tasks as well - as existing files. -* Fixed verbose flag bug in the testing task. Shortened some failure - messages. -* Make FileUtils methods private at the top level module to avoid - accidental method leaking into other objects. -* Added test loader option to test task. "testrb" is no longer the - default test loader. It is now eating syntax errors that should - halt the unit tests. -* Revamped FileList so that it works more like and array (addressed - flatten bug). Added many tests around file list. -* Added +ext+ method to both String and FileList. +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix -=== 0.5.0 +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. -* Fixed documentation that was lacking the Rake module name (Tilman - Sauerbeck). -* Added tar.gz and tar.bz2 support to package task (Tilman Sauerbeck). -* Recursive rules are now supported (Tilman Sauerbeck). -* Added warning option for the Test Task (requested by Eric Hodel). -* The jamis rdoc template is only used if it exists. -* Added fix for Ruby 1.8.2 test/unit and rails problem. -* Added contributed rake man file (Jani Monoses). -* Added Brian Candler's fix for problems in --trace and --dry-run - mode. +-- Jim Weirich -=== 0.4.15 +=== 10.0.0 -* Fixed a bug that prevented the TESTOPTS flag from working with the - revised for 1.8.2 test task. -* Updated the docs on --trace to indicate that it also enables a full - backtrace on errors. + "Jim, when will Rake reach version 1.0?" -=== 0.4.14 +Over the past several years I've been asked that question at +conferences, panels and over twitter. Due to historical reasons (or +maybe just plain laziness) Rake has (incorrectly) been treating the +second digit of the version as the major release number. So in my head +Rake was already at version 9. + +Well, it's time to fix things. This next version of Rake drops old, +crufty, backwards compatibility hacks such as top level constants, DSL +methods defined in Object and numerous other features that are just no +longer desired. It's also time to drop the leading zero from the +version number as well and call this new version of rake what it +really is: Version 10. + +So, welcome to Rake 10.0! + +Rake 10 is actually feature identical to the latest version of Rake 9 +(that would be the version spelled 0.9.3), *except* that Rake 10 drops +all the sundry deprecated features that have accumulated over the years. + +If your Rakefile is up to date and current with all the new features +of Rake 10, you are ready to go. If your Rakefile still uses a few +deprecated feeatures, feel free to use Rake 9 (0.9.3) with the same +feature set. Just be aware that future features will be in Rake 10 +family line. + +==== Changes in 10.0 + +As mentioned above, there are no new features in Rake 10. However, +there are a number of features missing: + +* Classic namespaces are now gone. Rake is no longer able to reflect + the options settings in the global variables ($rakefile, $show\_tasks, + $show\_prereqs, $trace, $dryrun and $silent). The + --classic-namespace option is no longer supported. + +* Global constants are no longer supported. This includes + Task, FileTask, FileCreationTask and + RakeApp). The constant missing hook to warn about using + global rake constants has been removed. + +* The Rake DSL methods (task, file, directory, etc) are in their own + module (Rake::DSL). The stub versions of these methods (that printed + warnings) in Object have been removed. However, the DSL methods are + added to the top-level main object. Since main is + not in the inheritance tree, the presence of the DSL methods in main + should be low impact on other libraries. + + If you want to use the Rake DSL commands from your own code, just + include Rake::DSL into your own classes and modules. + +* The deprecated syntax for task arguments (the one using + :needs) has been removed. + +* The --reduce-compat flag has been removed (it's not needed + anymore). + +* The deprecated rake/sys.rb library has been removed. + +* The deprecated rake/rdoctask.rb library has been removed. + RDoc supplies its own rake task now. + +* The deprecated rake/gempackagetask.rb library has been + removed. Gem supplies its own package task now. + +There is one small behavioral change: + +* Non-file tasks now always report the current time as their time + stamp. This is different from the previous behavior where non-file + tasks reported current time only if there were no prerequisites, and + the max prerequisite timestamp otherwise. This lead to inconsistent + and surprising behavior when adding prerequisites to tasks that in + turn were prequisites to file tasks. The new behavior is more + consistent and predictable. + +==== Changes (from 0.9.3) + +Since Rake 10 includes the changes from the last version of Rake 9, +we'll repeat the changes for version 0.9.3 here. + +===== New Features + +* Multitask tasks now use a thread pool. Use -j to limit the number of + available threads. + +* Use -m to turn regular tasks into multitasks (use at your own risk). + +* You can now do "Rake.add_rakelib 'dir'" in your Rakefile to + programatically add rake task libraries. + +* You can specific backtrace suppression patterns (see + --supress-backtrace) + +* Directory tasks can now take prerequisites and actions + +* Use --backtrace to request a full backtrace without the task trace. + +* You can say "--backtrace=stdout" and "--trace=stdout" to route trace + output to standard output rather than standard error. + +* Optional 'phony' target (enable with 'require 'rake/phony'") for + special purpose builds. + +* Task#clear now clears task comments as well as actions and + prerequisites. Task#clear_comment will specifically target comments. + +* The --all option will force -T and -D to consider all the tasks, + with and without descriptions. + +===== Bug Fixes + +* Semi-colons in windows rakefile paths now work. + +* Improved Control-C support when invoking multiple test suites. + +* egrep method now reads files in text mode (better support for + Windows) + +* Better deprecation line number reporting. + +* The -W option now works with all tasks, whether they have a + description or not. + +* File globs in rake should not be sorted alphabetically, independent + of file system and platform. + +* Numerous internal improvements. + +* Documentation typos and fixes. + + +==== Thanks + +As usual, it was input from users that drove a lot of these changes. The +following people contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix + +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. + +-- Jim Weirich + +=== 0.9.6 + +Rake version 0.9.6 contains a number of fixes mainly for merging +Rake into the Ruby source tree and fixing tests. + +==== Changes + +===== Bug Fixes (0.9.6) + +* Better trace output when using a multi-threaded Rakefile. +* Arg parsing is now consistent for tasks and multitasks. +* Skip exit code test in versions of Ruby that don't support it well. + +Changes for better integration with the Ruby source tree: + +* Fix version literal for Ruby source tree build. +* Better loading of libraries for testing in Ruby build. +* Use the ruby version provided by Ruby's tests. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix + +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. + +-- Jim Weirich + +=== 0.9.5 + +Rake version 0.9.5 contains a number of bug fixes. + +==== Changes + +===== Bug Fixes (0.9.5) + +* --trace and --backtrace no longer swallow following task names. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix + +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. + +-- Jim Weirich + +=== 0.9.4 + +Rake version 0.9.4 contains a number of bug fixes. + +==== Changes + +===== Bug Fixes (0.9.4) + +* Exit status with failing tests is not correctly set to non-zero. + +* Simplified syntax for phony task (for older versions of RDoc). + +* Stand alone FileList usage gets glob function (without loading in + extra dependencies) + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix + +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. + +-- Jim Weirich + +=== 0.9.3 + +Rake version 0.9.3 contains some new, backwards compatible features and +a number of bug fixes. + +==== Changes + +===== New Features + +* Multitask tasks now use a thread pool. Use -j to limit the number of + available threads. + +* Use -m to turn regular tasks into multitasks (use at your own risk). + +* You can now do "Rake.add_rakelib 'dir'" in your Rakefile to + programatically add rake task libraries. + +* You can specific backtrace suppression patterns (see + --supress-backtrace) + +* Directory tasks can now take prerequisites and actions + +* Use --backtrace to request a full backtrace without the task trace. + +* You can say "--backtrace=stdout" and "--trace=stdout" to route trace + output to standard output rather than standard error. + +* Optional 'phony' target (enable with 'require 'rake/phony'") for + special purpose builds. + +* Task#clear now clears task comments as well as actions and + prerequisites. Task#clear_comment will specifically target comments. + +* The --all option will force -T and -D to consider all the tasks, + with and without descriptions. + +===== Bug Fixes + +* Semi-colons in windows rakefile paths now work. + +* Improved Control-C support when invoking multiple test suites. + +* egrep method now reads files in text mode (better support for + Windows) + +* Better deprecation line number reporting. + +* The -W option now works with all tasks, whether they have a + description or not. + +* File globs in rake should not be sorted alphabetically, independent + of file system and platform. + +* Numerous internal improvements. + +* Documentation typos and fixes. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Aaron Patterson +* Dylan Smith +* Jo Liss +* Jonas Pfenniger +* Kazuki Tsujimoto +* Michael Bishop +* Michael Elufimov +* NAKAMURA Usaku +* Ryan Davis +* Sam Grönblom +* Sam Phippen +* Sergio Wong +* Tay Ray Chuan +* grosser +* quix + +Also, many thanks to Eric Hodel for assisting with getting this release +out the door. + +-- Jim Weirich + +=== Rake 0.9.2.2 + +Rake version 0.9.2.2 is mainly bug fixes. + +==== Changes + +* The rake test loader now removes arguments it has processed. Issue #51 +* Rake::TaskArguments now responds to #values\_at +* RakeFileUtils.verbose_flag = nil silences output the same as 0.8.7 +* Rake tests are now directory-independent +* Rake tests are no longer require flexmock +* Commands constant is no longer polluting top level namespace. +* Show only the interesting portion of the backtrace by default (James M. Lawrence). +* Added --reduce-compat option to remove backward compatible DSL hacks (James M. Lawrence). + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* James M. Lawrence (quix) +* Roger Pack +* Cezary Baginski +* Sean Scot August Moon +* R.T. Lechow +* Alex Chaffee +* James Tucker +* Matthias Lüdtke +* Santiago Pastorino + +Also, bit thanks to Eric Hodel for assisting with getting this release +out the door (where "assisting" includes, but is not by any means +limited to, "pushing" me to get it done). + +-- Jim Weirich + +=== 0.9.2 + +Rake version 0.9.2 has a few small fixes. See below for details. + +==== Changes + +* Support for Ruby 1.8.6 was fixed. +* Global DSL warnings now honor --no-deprecate + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* James M. Lawrence (quix) +* Roger Pack +* Cezary Baginski +* Sean Scot August Moon +* R.T. Lechow +* Alex Chaffee +* James Tucker +* Matthias Lüdtke +* Santiago Pastorino + +Also, bit thanks to Eric Hodel for assisting with getting this release +out the door (where "assisting" includes, but is not by any means +limited to, "pushing" me to get it done). + +-- Jim Weirich + +=== 0.9.1 + +Rake version 0.9.1 has a number of bug fixes and enhancments (see +below for more details). Additionally, the internals have be slightly +restructured and improved. + +==== Changes + +Rake 0.9.1 adds back the global DSL methods, but with deprecation +messages. This allows Rake 0.9.1 to be used with older rakefiles with +warning messages. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* James M. Lawrence (quix) +* Roger Pack +* Cezary Baginski +* Sean Scot August Moon +* R.T. Lechow +* Alex Chaffee +* James Tucker +* Matthias Lüdtke +* Santiago Pastorino + +Also, bit thanks to Eric Hodel for assisting with getting this release +out the door (where "assisting" includes, but is not by any means +limited to, "pushing" me to get it done). + +-- Jim Weirich + +=== 0.9.0 + +Rake version 0.9.0 has a number of bug fixes and enhancments (see +below for more details). Additionally, the internals have be slightly +restructured and improved. + +==== Changes + +===== New Features / Enhancements / Bug Fixes in Version 0.9.0 + +* Rake now warns when the deprecated :needs syntax used (and suggests + the proper syntax in the warning). + +* Moved Rake DSL commands to top level ruby object 'main'. Rake DSL + commands are no longer private methods in Object. (Suggested by + James M. Lawrence/quix) + +* Rake now uses case-insensitive comparisons to find the Rakefile on Windows. + Based on patch by Roger Pack. + +* Rake now requires (instead of loads) files in the test task. Patch by Cezary + Baginski. + +* Fixed typos. Patches by Sean Scot August Moon and R.T. Lechow. + +* Rake now prints the Rakefile directory only when it's different from the + current directory. Patch by Alex Chaffee. + +* Improved rakefile_location discovery on Windows. Patch by James Tucker. + +* Rake now recognizes "Windows Server" as a windows system. Patch by Matthias + Lüdtke + +* Rake::RDocTask is deprecated. Use RDoc::Task from RDoc 2.4.2+ (require + 'rdoc/task') + +* Rake::GemPackageTask is deprecated. Use Gem::PackageTask (require + 'rubygems/package\_task') + +* Rake now outputs various messages to $stderr instead of $stdout. + +* Rake no longer emits warnings for Config. Patch by Santiago Pastorino. + +* Removed Rake's DSL methods from the top level scope. If you need to + call 'task :xzy' in your code, include Rake::DSL into your class, or + put the code in a Rake::DSL.environment do ... end block. + +* Split rake.rb into individual files. + +* Support for the --where (-W) flag for showing where a task is defined. + +* Fixed quoting in test task. + (http://onestepback.org/redmine/issues/show/44, + http://www.pivotaltracker.com/story/show/1223138) + +* Fixed the silent option parsing problem. + (http://onestepback.org/redmine/issues/show/47) + +* Fixed :verbose=>false flag on sh and ruby commands. + +* Rake command line options may be given by default in a RAKEOPT + environment variable. + +* Errors in Rake will now display the task invocation chain in effect + at the time of the error. + +* Accepted change by warnickr to not expand test patterns in shell + (allowing more files in the test suite). + +* Fixed that file tasks did not perform prereq lookups in scope + (Redmine #57). + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* James M. Lawrence (quix) +* Roger Pack +* Cezary Baginski +* Sean Scot August Moon +* R.T. Lechow +* Alex Chaffee +* James Tucker +* Matthias Lüdtke +* Santiago Pastorino + +Also, bit thanks to Eric Hodel for assisting with getting this release +out the door (where "assisting" includes, but is not by any means +limited to, "pushing" me to get it done). + +-- Jim Weirich + + +=== 0.8.7 + +Rake version 0.8.5 introduced greatly improved support for executing +commands on Windows. The "sh" command now has the same semantics on +Windows that it has on Unix based platforms. + +Rake version 0.8.6 includes minor fixes the the RDoc generation. +Rake version 0.8.7 includes a minor fix for JRuby running on windows. + +==== Changes + +===== New Features / Enhancements in Version 0.8.5 + +* Improved implementation of the Rake system command for Windows. + (patch from James M. Lawrence/quix) + +* Support for Ruby 1.9's improved system command. (patch from James + M. Lawrence/quix) + +* Rake now includes the configured extension when invoking an + executable (Config::CONFIG['EXEEXT]) + +===== Bug Fixes in Version 0.8.5 + +* Environment variable keys are now correctly cased (it matters in + some implementations). + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Charles Nutter + +-- Jim Weirich + +=== 0.8.6 + +Rake version 0.8.5 introduced greatly improved support for executing +commands on Windows. The "sh" command now has the same semantics on +Windows that it has on Unix based platforms. + +Rake version 0.8.5 includes minor fixes the the RDoc generation. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* James M. Lawrence/quix +* Luis Lavena + +-- Jim Weirich + +=== 0.8.5 + +Rake version 0.8.5 is a new release of Rake with greatly improved +support for executing commands on Windows. The "sh" command now has +the same semantics on Windows that it has on Unix based platforms. + +==== Changes + +===== New Features / Enhancements in Version 0.8.5 + +* Improved implementation of the Rake system command for Windows. + (patch from James M. Lawrence/quix) + +* Support for Ruby 1.9's improved system command. (patch from James + M. Lawrence/quix) + +* Rake now includes the configured extension when invoking an + executable (Config::CONFIG['EXEEXT]) + +===== Bug Fixes in Version 0.8.5 + +* Environment variable keys are now correctly cased (it matters in + some implementations). + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* James M. Lawrence/quix +* Luis Lavena + +-- Jim Weirich + +=== 0.8.4 + +Rake version 0.8.4 is a bug-fix release of rake. + +NOTE: The version of Rake that comes with Ruby 1.9 has diverged + slightly from the core Rake code base. Rake 0.8.4 will work + with Ruby 1.9, but is not a strict upgrade for the Rake that + comes with Ruby 1.9. A (near) future release of Rake will unify + those two codebases. + +==== Letter Writing Campaign + +Thanks to Aaron Patterson (@tenderlove) and Eric Hodel (@drbrain) for +their encouraging support in organizing a letter writing campaign to +lobby for the "Warning Free" release of rake 0.8.4. A special callout +goes to Jonathan D. Lord, Sr (Dr. Wingnut) whose postcard was the +first to actually reach me. (see +http://tenderlovemaking.com/2009/02/26/we-need-a-new-version-of-rake/ +for details) + +==== Changes + +===== New Features / Enhancements in Version 0.8.4 + +* Case is preserved on rakefile names. (patch from James + M. Lawrence/quix) + +* Improved Rakefile case insensitivity testing (patch from Luis + Lavena). + +* Windows system dir search order is now: HOME, HOMEDRIVE + HOMEPATH, + APPDATA, USERPROFILE (patch from Luis Lavena) + +* MingGW is now recognized as a windows platform. (patch from Luis + Lavena) + +===== Bug Fixes in Version 0.8.4 + +* Removed reference to manage_gem to fix the warning produced by the + gem package task. + +* Fixed stray ARGV option problem that was interfering with + Test::Unit::Runner. (patch from Pivotal Labs) + +===== Infrastructure Improvements in Version 0.8.4 + +* Numerous fixes to the windows test suite (patch from Luis Lavena). + +* Improved Rakefile case insensitivity testing (patch from Luis + Lavena). + +* Better support for windows paths in the test task (patch from Simon + Chiang/bahuvrihi) + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* James M. Lawrence/quix +* Luis Lavena +* Pivotal Labs +* Simon Chiang/bahuvrihi + +-- Jim Weirich + +=== 0.8.3 + +Rake version 0.8.3 is a bug-fix release of rake. + +==== Changes + +===== Bug Fixes in Version 0.8.3 + +* Enhanced the system directory detection in windows. We now check + HOMEDRIVE/HOMEPATH and USERPROFILE if APPDATA isn't found. (Patch + supplied by James Tucker). Rake no long aborts if it can't find the + directory. + +* Added fix to handle ruby installations in directories with spaces in + their name. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Edwin Pratomo +* Gavin Stark +* Adam Q. Salter +* Adam Majer +* Emanuel Indermühle +* Ittay Dror +* Bheeshmar Redheendran (for spending an afternoon with me debugging + windows issues) + +-- Jim Weirich + + +=== 0.8.2 + +Rake version 0.8.2 is a new release of rake that includes a number of +new features and numerous bug fixes. + +==== Changes + +===== New Features in Version 0.8.2 + +* Switched from getoptlong to optparse (patches supplied by Edwin + Pratomo). + +* The -T option will now attempt to dynamically sense the size of the + terminal. The -T output will only self-truncate if the output is a + tty. However, if RAKE_COLUMNS is explicitly set, it will be honored + in any case. (Patch provided by Gavin Stark). + +* The following public methods have been added to rake task objects: + + * task.clear -- Clear both the prerequisites and actions of the + target rake task. + * task.clear_prerequisites -- Clear all the existing prerequisites + from the target rake task. + * task.clear_actions -- Clear all the existing actions from the + target rake task. + * task.reenable -- Re-enable a task, allowing its actions to be + executed again if the task is invoked. + +* Changed RDoc test task to have no default template. This makes it + easier for the tempate to pick up the template from the environment. + +* Default values for task arguments can easily be specified with the + :with_defaults method. (Idea for default argument merging supplied + by (Adam Q. Salter) + +===== Bug Fixes in Version 0.8.2 + +* Fixed bug in package task so that it will include the subdir + directory in the package for testing. (Bug found by Adam Majer) + +* Fixed filename dependency order bug in test\_inspect\_pending and + test\_to\_s\_pending. (Bug found by Adam Majer) + +* Fixed check for file utils options to make them immune to the + symbol/string differences. (Patch supplied by Edwin Pratomo) + +* Fixed bug with rules involving multiple source, where only the first + dependency of a rule has any effect (Patch supplied by Emanuel + Indermühle) + +* FileList#clone and FileList#dup have better sematics w.r.t. taint + and freeze. + +* Changed from using Mutex to Monitor. Evidently Mutex causes thread + join errors when Ruby is compiled with -disable-pthreads. (Patch + supplied by Ittay Dror) + +* Fixed bug in makefile parser that had problems with extra spaces in + file task names. (Patch supplied by Ittay Dror) + +==== Other changes in Version 0.8.2 + +* Added ENV var to rake's own Rakefile to prevent OS X from including + extended attribute junk in the rake package tar file. (Bug found by + Adam Majer) + +* Added a performance patch for reading large makefile dependency + files. (Patch supplied by Ittay Dror) + +==== Task Argument Examples + +Prior to version 0.8.0, rake was only able to handle command line +arguments of the form NAME=VALUE that were passed into Rake via the +ENV hash. Many folks had asked for some kind of simple command line +arguments, perhaps using "--" to separate regular task names from +argument values on the command line. The problem is that there was no +easy way to associate positional arguments on the command line with +different tasks. Suppose both tasks :a and :b expect a command line +argument: does the first value go with :a? What if :b is run first? +Should it then get the first command line argument. + +Rake 0.8.0 solves this problem by explicitly passing values directly +to the tasks that need them. For example, if I had a release task +that required a version number, I could say: + + rake release[0.8.2] + +And the string "0.8.2" will be passed to the :release task. Multiple +arguments can be passed by separating them with a comma, for example: + + rake name[john,doe] + +Just a few words of caution. The rake task name and its arguments +need to be a single command line argument to rake. This generally +means no spaces. If spaces are needed, then the entire rake + +argument string should be quoted. Something like this: + + rake "name[billy bob, smith]" + +(Quoting rules vary between operating systems and shells, so make sure +you consult the proper docs for your OS/shell). + +===== Tasks that Expect Parameters + +Parameters are only given to tasks that are setup to expect them. In +order to handle named parameters, the task declaration syntax for +tasks has been extended slightly. + +For example, a task that needs a first name and last name might be +declared as: + + task :name, :first_name, :last_name + +The first argument is still the name of the task (:name in this case). +The next to argumements are the names of the parameters expected by +:name (:first_name and :last_name in the example). + +To access the values of the paramters, the block defining the task +behaviour can now accept a second parameter: + + task :name, :first_name, :last_name do |t, args| + puts "First name is #{args.first_name}" + puts "Last name is #{args.last_name}" + end + +The first argument of the block "t" is always bound to the current +task object. The second argument "args" is an open-struct like object +that allows access to the task arguments. Extra command line +arguments to a task are ignored. Missing command line arguments are +given the nil value. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Edwin Pratomo +* Gavin Stark +* Adam Q. Salter +* Adam Majer +* Emanuel Indermühle +* Ittay Dror +* Bheeshmar Redheendran (for spending an afternoon with me debugging + windows issues) + +-- Jim Weirich + +=== 0.8.0/0.8.1 + +Rake version 0.8.0 is a new release of rake that includes serveral new +features. + +==== Changes + +===== New Features in Version 0.8.0 + +* Tasks can now receive command line parameters. See the examples + below for more details. + +* Comments are limited to 80 columns on output, but full comments can + be seen by using the -D parameter. (feature suggested by Jamis + Buck). + +* Explicit exit(n) calls will now set the exit status to n. (patch + provided by Stephen Touset). + +* Rake is now compatible with Ruby 1.9. + +Version 0.8.1 is a minor update that includes additional Ruby 1.9 +compatibility fixes. + +==== Task Argument Examples + +Prior to version 0.8.0, rake was only able to handle command line +arguments of the form NAME=VALUE that were passed into Rake via the +ENV hash. Many folks had asked for some kind of simple command line +arguments, perhaps using "--" to separate regular task names from +argument values on the command line. The problem is that there was no +easy way to associate positional arguments on the command line with +different tasks. Suppose both tasks :a and :b expect a command line +argument: does the first value go with :a? What if :b is run first? +Should it then get the first command line argument. + +Rake 0.8.0 solves this problem by explicitly passing values directly +to the tasks that need them. For example, if I had a release task +that required a version number, I could say: + + rake release[0.8.0] + +And the string "0.8.0" will be passed to the :release task. Multiple +arguments can be passed by separating them with a comma, for example: + + rake name[john,doe] + +Just a few words of caution. The rake task name and its arguments +need to be a single command line argument to rake. This generally +means no spaces. If spaces are needed, then the entire rake + +argument string should be quoted. Something like this: + + rake "name[billy bob, smith]" + +(Quoting rules vary between operating systems and shells, so make sure +you consult the proper docs for your OS/shell). + +===== Tasks that Expect Parameters + +Parameters are only given to tasks that are setup to expect them. In +order to handle named parameters, the task declaration syntax for +tasks has been extended slightly. + +For example, a task that needs a first name and last name might be +declared as: + + task :name, :first_name, :last_name + +The first argument is still the name of the task (:name in this case). +The next to argumements are the names of the parameters expected by +:name (:first_name and :last_name in the example). + +To access the values of the paramters, the block defining the task +behaviour can now accept a second parameter: + + task :name, :first_name, :last_name do |t, args| + puts "First name is #{args.first_name}" + puts "Last name is #{args.last_name}" + end + +The first argument of the block "t" is always bound to the current +task object. The second argument "args" is an open-struct like object +that allows access to the task arguments. Extra command line +arguments to a task are ignored. Missing command line arguments are +given the nil value. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +* Jamis Buck (for comment formatting suggestions) +* Stephen Touset (for exit status patch). + +-- Jim Weirich + + +=== 0.7.3 + +Rake version 0.7.3 is a minor release that includes some refactoring to better +support custom Rake applications. + +==== Changes + +===== New Features in Version 0.7.3 + +* Added the +init+ and +top_level+ methods to make the creation of custom Rake applications a bit easier. E.g. + + gem 'rake', ">= 0.7.3" + require 'rake' + + Rake.application.init('myrake') + + task :default do + something_interesting + end + + Rake.application.top_level + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. The +following people either contributed patches, made suggestions or made +otherwise helpful comments. Thanks to ... + +-- Jim Weirich + + +=== 0.7.2 + + +Version 0.7.2 supplies a bug fix and a few minor enhancements. In +particular, the new version fixes an incompatibility with the soon to +be released Ruby 1.8.6. We strongly recommend upgrading to Rake 0.7.2 +in order to be compatible with the new version of Ruby. + +==== Changes + +===== Bug Fixes in 0.7.2 + +There are quite a number of bug fixes in the new 0.7.2 version of +Rake: + +* Removed dependency on internal fu_xxx functions from FileUtils. + +* Error messages are now send to stderr rather than stdout (from + Payton Quackenbush). + +* Better error handling on invalid command line arguments (from Payton + Quackenbush). + +* Fixed some bugs where the application object was going to the global + appliation instead of using its own data. + +* Fixed the method name leak from FileUtils (bug found by Glenn + Vanderburg). + +* Added test for noop, bad_option and verbose flags to sh command. + +* Added a description to the gem task in GemPackageTask. + +* Fixed a bug when rules have multiple prerequisites (patch by Joel + VanderWerf) + +* Added the handful of RakeFileUtils to the private method as well. + +===== New Features in 0.7.2 + +The following new features are available in Rake version 0.7.2: + +* Added square and curly bracket patterns to FileList#include (Tilman + Sauerbeck). + +* FileLists can now pass a block to FileList#exclude to exclude files + based on calculated values. + +* Added plain filename support to rule dependents (suggested by Nobu + Nakada). + +* Added pathmap support to rule dependents. In other words, if a + pathmap format (beginning with a '%') is given as a Rake rule + dependent, then the name of the depend will be the name of the + target with the pathmap format applied. + +* Added a 'tasks' method to a namespace to get a list of tasks + associated with the namespace. + +* Added tar_command and zip_command options to the Package task. + +* The clean task will no longer delete 'core' if it is a directory. + +===== Internal Rake Improvements + +The following changes will are mainly internal improvements and +refactorings and have little effect on the end user. But they may be +of interest to the general public. + +* Added rcov task and updated unit testing for better code coverage. + +* Added a 'shame' task to the Rakefile. + +* Added rake_extension to handle detection of extension collisions. + +* Added a protected 'require "rubygems"' to test/test_application to + unbreak cruisecontrol.rb. + +* Removed rake\_dup. Now we just simply rescue a bad dup. + +* Refactored the FileList reject logic to remove duplication. + +* Removed if \_\_FILE\_\_ at the end of the rake.rb file. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. +The following people either contributed patches, made suggestions or +made otherwise helpful comments. Thanks to ... + +* Payton Quackenbush -- For several error handling improvements. + +* Glenn Vanderburg -- For finding and fixing the method name leak from + FileUtils. + +* Joel VanderWerf -- for finding and fixing a bug in the handling of + multiple prerequisites. + +* Tilman Sauerbeck -- For some enhancing FileList to support more + advanced file globbing. + +* Nobu Nakada -- For suggesting plain file name support to rule dependents. + +-- Jim Weirich + +=== 0.7.1 + +Version 0.7.1 supplies a bug fix and a few minor enhancements. + +==== Changes + +===== Bug Fixes in 0.7.1 + +* Changes in the exception reported for the FileUtils.ln caused + safe_ln to fail with a NotImplementedError. Rake 0.7.1 will now + catch that error or any StandardError and properly fall back to + using +cp+. + +===== New Features in 0.7.1 + +* You can filter the results of the --task option by supplying an + optional regular expression. This allows the user to easily find a + particular task name in a long list of possible names. + +* Transforming procs in a rule may now return a list of prerequisites. + This allows more flexible rule formation. + +* FileList and String now support a +pathmap+ melthod that makes the + transforming paths a bit easier. See the API docs for +pathmap+ for + details. + +* The -f option without a value will disable the search for a + Rakefile. This allows the Rakefile to be defined entirely in a + library (and loaded with the -r option). The current working + directory is not changed when this is done. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. +The following people either contributed patches, made suggestions or +made otherwise helpful comments. Thanks to ... + +* James Britt and Assaph Mehr for reporting and helping to debug the + safe_ln issue. + +-- Jim Weirich + + +=== 0.7.0 + +These changes for Rake have been brewing for a long time. Here they +are, I hope you enjoy them. + +==== Changes + +===== New Features + +* Name space support for task names (see below). +* Prerequisites can be executed in parallel (see below). +* Added safe_ln support for openAFS (via Ludvig Omholt). +* RDoc defaults to internal (in-process) invocation. The old behavior + is still available by setting the +external+ flag to true. +* Rakefiles are now loaded with the expanded path to prevent + accidental polution from the Ruby load path. +* Task objects my now be used in prerequisite lists directly. +* Task objects (in addition to task names) may now be included in the + prerequisite list of a task. +* Internals cleanup and refactoring. + +===== Bug Fixes + +* Compatibility fixes for Ruby 1.8.4 FileUtils changes. + +===== Namespaces + +Tasks can now be nested inside their own namespaces. Tasks within one +namespace will not accidently interfer with tasks named in a different +namespace. + +For example: + + namespace "main" do + task :build do + # Build the main program + end + end + + namespace "samples" do + task :build do + # Build the sample programs + end + end + + task :build_all => ["main:build", "samples:build"] + +Even though both tasks are named :build, they are separate tasks in +their own namespaces. The :build_all task (defined in the toplevel +namespace) references both build tasks in its prerequisites. + +You may invoke each of the individual build tasks with the following +commands: + + rake main:build + rake samples:build + +Or invoke both via the :build_all command: + + rake build_all + +Namespaces may be nested arbitrarily. Since the name of file tasks +correspond to the name of a file in the external file system, +FileTasks are not affected by the namespaces. + +See the Rakefile format documentation (in the Rake API documents) for +more information. + +===== Parallel Tasks + +Sometimes you have several tasks that can be executed in parallel. By +specifying these tasks as prerequisites to a +multitask+ task. + +In the following example the tasks copy\_src, copy\_doc and copy\_bin +will all execute in parallel in their own thread. + + multitask :copy_files => [:copy_src, :copy_doc, :copy_bin] do + puts "All Copies Complete" + end + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. +The following people either contributed patches, made suggestions or +made otherwise helpful comments. Thanks to ... + +* Doug Young (inspriation for the parallel task) +* David Heinemeier Hansson (for --trace message enhancement and for + pushing for namespace support). +* Ludvig Omholt (for the openAFS fix) + +-- Jim Weirich + +=== 0.6.1 + +* Rebuilt 0.6.0 gem without signing. + +=== 0.6.0 + +Its time for some long requested enhancements and lots of bug fixes +... And a whole new web page. + +==== New Web Page + +The primary documentation for rake has moved from the RubyForge based +wiki to its own Hieraki based web site. Constant spam on the wiki +made it a difficult to keep clean. The new site will be easier to +update and organize. + +Check out the new documentation at: http://docs.rubyrake.org + +We will be adding new documentation to the site as time goes on. + +In addition to the new docs page, make sure you check out Martin +Fowlers article on rake at http://martinfowler.com/articles/rake.html + +==== Changes + +===== New Features + +* Multiple prerequisites on Rake rules now allowed. However, keep the + following in mind: + + 1. All the prerequisites of a rule must be available before a rule + is triggered, where "enabled" means (a) an existing file, (b) a + defined rule, or (c) another rule which also must be + trigger-able. + 2. Rules are checked in order of definition, so it is important to + order your rules properly. If a file can be created by two + different rules, put the more specific rule first (otherwise the + more general rule will trigger first and the specific one will + never be triggered). + 3. The source method now returns the name of the first + prerequisite listed in the rule. sources returns the + names of all the rule prerequisites, ordered as they are defined + in the rule. If the task has other prerequisites not defined in + the rule (but defined in an explicit task definition), then they + will _not_ be included in the sources list. + +* FileLists may now use the egrep command. This popular enhancement + is now a core part of the FileList object. If you want to get a + list of all your to-dos, fixmes and TBD comments, add the following + to your Rakefile. + + desc "Look for TODO and FIXME tags in the code" + task :todo do + FileList['**/*.rb'].egrep /#.*(FIXME|TODO|TBD)/ + end + +* The investigation method was added to task object to dump + out some important values. This makes it a bit easier to debug Rake + tasks. + + For example, if you are having problems with a particular task, just + print it out: + + task :huh do + puts Rake::Task['huh'].investigation + end + +* The Rake::TestTask class now supports a "ruby\_opts" option to pass + arbitrary ruby options to a test subprocess. + +===== Some Incompatibilities + +* When using the ruby command to start a Ruby subprocess, the + Ruby interpreter that is currently running rake is used by default. + This makes it easier to use rake in an environment with multiple + ruby installation. (Previously, the first ruby command found in the + PATH was used). + + If you wish to chose a different Ruby interpreter, you can + explicitly choose the interpreter via the sh command. + +* The major rake classes (Task, FileTask, FileCreationTask, RakeApp) + have been moved out of the toplevel scope and are now accessible as + Rake::Task, Rake::FileTask, Rake::FileCreationTask and + Rake::Application. If your Rakefile + directly references any one of these tasks, you may: + + 1. Update your Rakefile to use the new classnames + 2. Use the --classic-namespace option on the rake command to get the + old behavior, + 3. Add require 'rake/classic_namespace' to the + Rakefile to get the old behavior. + + rake will print a rather annoying warning whenever a + deprecated class name is referenced without enabling classic + namespace. + +===== Bug Fixes + +* Several unit tests and functional tests were fixed to run better + under windows. + +* Directory tasks are now a specialized version of a File task. A + directory task will only be triggered if it doesn't exist. It will + not be triggered if it is out of date w.r.t. any of its + prerequisites. + +* Fixed a bug in the Rake::GemPackageTask class so that the gem now + properly contains the platform name. + +* Fixed a bug where a prerequisite on a file task would cause + an exception if the prerequisite did not exist. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. +The following people either contributed patches, made suggestions or +made otherwise helpful comments. Thanks to ... + +* Greg Fast (better ruby_opt test options) +* Kelly Felkins (requested by better namespace support) +* Martin Fowler (suggested Task.investigation) +* Stuart Jansen (send initial patch for multiple prerequisites). +* Masao Mutch (better support for non-ruby Gem platforms) +* Philipp Neubeck (patch for file task exception fix) + +-- Jim Weirich + +=== 0.5.4 + +Time for some minor bug fixes and small enhancements + +==== Changes + +Here are the changes for version 0.5.4 ... + +* Added double quotes to the test runner. This allows the location of + the tests (and runner) to be in a directory path that contains + spaces (e.g. "C:/Program Files/ruby/bin"). +* Added .svn to default ignore list. Now subversion project metadata + is automatically ignored by Rake's FileList. +* Updated FileList#include to support nested arrays and filelists. + FileLists are flat lists of file names. Using a FileList in an + include will flatten out the nested file names. + +== Thanks + +As usual, it was input from users that drove a alot of these changes. +Thanks to ... + +* Tilman Sauerbeck for the nested FileList suggestion. +* Josh Knowles for pointing out the spaces in directory name problem. + +-- Jim Weirich + +=== 0.5.3 + +Although it has only been two weeks since the last release, we have +enough updates to the Rake program to make it time for another +release. + +==== Changes + +Here are the changes for version 0.5.3 ... + +* FileLists have been extensively changed so that they mimic the + behavior of real arrays even more closely. In particular, + operations on FileLists that return a new collection (e.g. collect, + reject) will now return a FileList rather than an array. In + addition, several places where FileLists were not properly expanded + before use have been fixed. +* A method (+ext+) to simplify the handling of file extensions was + added to String and to Array. +* The 'testrb' script in test/unit tends to silently swallow syntax + errors in test suites. Because of that, the default test loader is + now a rake-provided script. You can still use 'testrb' by setting + the loader flag in the test task to :testrb. (See the API documents + for TestTask for all the loader flag values). +* FileUtil methods (e.g. cp, mv, install) are now declared to be + private. This will cut down on the interference with user defined + methods of the same name. +* Fixed the verbose flag in the TestTask so that the test code is + controlled by the flag. Also shortened up some failure messages. + (Thanks to Tobias Luetke for the suggestion). +* Rules will now properly detect a task that can generate a source + file. Previously rules would only consider source files that were + already present. +* Added an +import+ command that allows Rake to dynamically import + dependendencies into a running Rake session. The +import+ command + can run tasks to update the dependency file before loading them. + Dependency files can be in rake or make format, allowing rake to + work with tools designed to generate dependencies for make. + +==== Thanks + +As usual, it was input from users that drove a alot of these changes. +Thanks to ... + +* Brian Gernhardt for the rules fix (especially for the patience to + explain the problem to me until I got what he was talking about). +* Stefan Lang for pointing out problems in the dark corners of the + FileList implementation. +* Alexey Verkhovsky pointing out the silently swallows syntax errors + in tests. +* Tobias Luetke for beautifying the test task output. +* Sam Roberts for some of the ideas behind dependency loading. + +-- Jim Weirich + + +=== 0.5.0 + +It has been a long time in coming, but we finally have a new version +of Rake available. + +==== Changes + +* Fixed documentation that was lacking the Rake module name (Tilman + Sauerbeck). +* Added tar.gz and tar.bz2 support to package task (Tilman Sauerbeck). +* Recursive rules are now supported (Tilman Sauerbeck). +* Added warning option for the Test Task (requested by Eric Hodel). +* The jamis rdoc template is only used if it exists. +* Added fix for Ruby 1.8.2 test/unit and rails problem. +* Added contributed rake man file (Jani Monoses). +* Added Brian Candler's fix for problems in --trace and --dry-run + mode. + +==== Thanks + +Lots of people provided input to this release. Thanks to Tilman +Sauerbeck for numerous patches, documentation fixes and suggestions. +And for also pushing me to get this release out. Also, thanks to +Brian Candler for the finding and fixing --trace/dry-run fix. That +was an obscure bug. Also to Eric Hodel for some good suggestions. + +-- Jim Weirich + +=== 0.4.15 + +==== Changes + +Version 0.4.15 is a bug fix update for the Ruby 1.8.2 compatibility +changes. This release includes: + +* Fixed a bug that prevented the TESTOPTS flag from working with the + revised for 1.8.2 test task. +* Updated the docs on --trace to indicate that it also enables a full + backtrace on errors. +* Several fixes for new warnings generated. + +==== Mini-Roadmap + +I will continue to issue Rake updates in the 0.4.xx series as new +Ruby-1.8.2 issues become manifest. Once the codebase stabilizes, I +will release a 0.5.0 version incorporating all the changes. If you +are not using Ruby-1.8.2 and wish to avoid version churn, I recommend +staying with a release prior to Rake-0.4.14. + +=== 0.4.14 + +Version 0.4.14 is a compatibility fix to allow Rake's test task to +work under Ruby 1.8.2. A change in the Test::Unit autorun feature +prevented Rake from running any tests. This release fixes the +problem. -* Modified the TestTask to workaround the Ruby 1.8.2 change in - autoexecuting unit tests. +Rake 0.4.14 is the recommended release for anyone using Ruby 1.8.2. === 0.4.13 @@ -624,7 +2121,7 @@ the individual release notes files. === 0.4.2 * Added safe_ln that falls back to a copy if a file link is not supported. -* Package builder now uses safe_ln. +* Package builder now uses safe\_ln. === 0.4.1 * Task comments are now additive, combined with "/". @@ -714,6 +2211,6 @@ presentation was being prepared. The changes include: === 0.2.3 * Added rake module for a help target -* Added 'for_files' to Sys +* Added 'for\_files' to Sys * Added a $rakefile constant * Added test for selecting proper rule with multiple targets. diff --git a/Manifest.txt b/Manifest.txt deleted file mode 100644 index 3cbf6195d..000000000 --- a/Manifest.txt +++ /dev/null @@ -1,154 +0,0 @@ -.autotest -.rubocop.yml -.togglerc -CONTRIBUTING.rdoc -History.rdoc -MIT-LICENSE -Manifest.txt -README.rdoc -Rakefile -bin/rake -doc/command_line_usage.rdoc -doc/example/Rakefile1 -doc/example/Rakefile2 -doc/example/a.c -doc/example/b.c -doc/example/main.c -doc/glossary.rdoc -doc/jamis.rb -doc/proto_rake.rdoc -doc/rake.1 -doc/rakefile.rdoc -doc/rational.rdoc -doc/release_notes/rake-0.4.14.rdoc -doc/release_notes/rake-0.4.15.rdoc -doc/release_notes/rake-0.5.0.rdoc -doc/release_notes/rake-0.5.3.rdoc -doc/release_notes/rake-0.5.4.rdoc -doc/release_notes/rake-0.6.0.rdoc -doc/release_notes/rake-0.7.0.rdoc -doc/release_notes/rake-0.7.1.rdoc -doc/release_notes/rake-0.7.2.rdoc -doc/release_notes/rake-0.7.3.rdoc -doc/release_notes/rake-0.8.0.rdoc -doc/release_notes/rake-0.8.2.rdoc -doc/release_notes/rake-0.8.3.rdoc -doc/release_notes/rake-0.8.4.rdoc -doc/release_notes/rake-0.8.5.rdoc -doc/release_notes/rake-0.8.6.rdoc -doc/release_notes/rake-0.8.7.rdoc -doc/release_notes/rake-0.9.0.rdoc -doc/release_notes/rake-0.9.1.rdoc -doc/release_notes/rake-0.9.2.2.rdoc -doc/release_notes/rake-0.9.2.rdoc -doc/release_notes/rake-0.9.3.rdoc -doc/release_notes/rake-0.9.4.rdoc -doc/release_notes/rake-0.9.5.rdoc -doc/release_notes/rake-0.9.6.rdoc -doc/release_notes/rake-10.0.0.rdoc -doc/release_notes/rake-10.0.1.rdoc -doc/release_notes/rake-10.0.2.rdoc -doc/release_notes/rake-10.0.3.rdoc -doc/release_notes/rake-10.1.0.rdoc -lib/rake.rb -lib/rake/application.rb -lib/rake/backtrace.rb -lib/rake/clean.rb -lib/rake/cloneable.rb -lib/rake/contrib/.document -lib/rake/contrib/compositepublisher.rb -lib/rake/contrib/ftptools.rb -lib/rake/contrib/sshpublisher.rb -lib/rake/cpu_counter.rb -lib/rake/default_loader.rb -lib/rake/dsl_definition.rb -lib/rake/early_time.rb -lib/rake/ext/core.rb -lib/rake/ext/fixnum.rb -lib/rake/ext/pathname.rb -lib/rake/ext/string.rb -lib/rake/file_creation_task.rb -lib/rake/file_list.rb -lib/rake/file_task.rb -lib/rake/file_utils.rb -lib/rake/file_utils_ext.rb -lib/rake/invocation_chain.rb -lib/rake/invocation_exception_mixin.rb -lib/rake/late_time.rb -lib/rake/linked_list.rb -lib/rake/loaders/makefile.rb -lib/rake/multi_task.rb -lib/rake/name_space.rb -lib/rake/packagetask.rb -lib/rake/phony.rb -lib/rake/private_reader.rb -lib/rake/promise.rb -lib/rake/pseudo_status.rb -lib/rake/rake_module.rb -lib/rake/rake_test_loader.rb -lib/rake/rule_recursion_overflow_error.rb -lib/rake/scope.rb -lib/rake/task.rb -lib/rake/task_argument_error.rb -lib/rake/task_arguments.rb -lib/rake/task_manager.rb -lib/rake/tasklib.rb -lib/rake/testtask.rb -lib/rake/thread_history_display.rb -lib/rake/thread_pool.rb -lib/rake/trace_output.rb -lib/rake/version.rb -lib/rake/win32.rb -rakelib/test_times.rake -test/file_creation.rb -test/helper.rb -test/support/rakefile_definitions.rb -test/support/ruby_runner.rb -test/test_private_reader.rb -test/test_rake.rb -test/test_rake_application.rb -test/test_rake_application_options.rb -test/test_rake_backtrace.rb -test/test_rake_clean.rb -test/test_rake_cpu_counter.rb -test/test_rake_definitions.rb -test/test_rake_directory_task.rb -test/test_rake_dsl.rb -test/test_rake_early_time.rb -test/test_rake_extension.rb -test/test_rake_file_creation_task.rb -test/test_rake_file_list.rb -test/test_rake_file_list_path_map.rb -test/test_rake_file_task.rb -test/test_rake_file_utils.rb -test/test_rake_ftp_file.rb -test/test_rake_functional.rb -test/test_rake_invocation_chain.rb -test/test_rake_late_time.rb -test/test_rake_linked_list.rb -test/test_rake_makefile_loader.rb -test/test_rake_multi_task.rb -test/test_rake_name_space.rb -test/test_rake_package_task.rb -test/test_rake_path_map.rb -test/test_rake_path_map_explode.rb -test/test_rake_path_map_partial.rb -test/test_rake_pathname_extensions.rb -test/test_rake_pseudo_status.rb -test/test_rake_rake_test_loader.rb -test/test_rake_reduce_compat.rb -test/test_rake_require.rb -test/test_rake_rules.rb -test/test_rake_scope.rb -test/test_rake_task.rb -test/test_rake_task_argument_parsing.rb -test/test_rake_task_arguments.rb -test/test_rake_task_manager.rb -test/test_rake_task_manager_argument_resolution.rb -test/test_rake_task_with_arguments.rb -test/test_rake_test_task.rb -test/test_rake_thread_pool.rb -test/test_rake_top_level_functions.rb -test/test_rake_win32.rb -test/test_thread_history_display.rb -test/test_trace_output.rb diff --git a/Rakefile b/Rakefile index 04dfb4455..97c22a45f 100644 --- a/Rakefile +++ b/Rakefile @@ -6,77 +6,24 @@ # This file may be distributed under an MIT style license. See # MIT-LICENSE for details. -require 'rbconfig' +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -system_rake = File.join RbConfig::CONFIG['rubylibdir'], 'rake.rb' +require 'bundler/gem_tasks' +require 'rake/testtask' +require 'rdoc/task' -# Use our rake, not the installed rake from system -if $".include? system_rake or $".grep(/rake\/name_space\.rb$/).empty? then - exec Gem.ruby, '-Ilib', 'bin/rake', *ARGV +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.verbose = true + t.test_files = FileList['test/**/test_*.rb'] end -require 'hoe' - -Hoe.plugin :git -Hoe.plugin :travis -Hoe.plugin :gemspec - -hoe = Hoe.spec 'rake' do - developer 'Hiroshi SHIBATA', 'hsbt@ruby-lang.org' - developer 'Eric Hodel', 'drbrain@segment7.net' - developer 'Jim Weirich', '' - - require_ruby_version '>= 1.9.3' - require_rubygems_version '>= 1.3.2' - - dependency 'minitest', '~> 5.0', :developer - - license "MIT" - - self.readme_file = 'README.rdoc' - self.history_file = 'History.rdoc' - - self.extra_rdoc_files.concat FileList[ - 'MIT-LICENSE', - 'doc/**/*.rdoc', - '*.rdoc', - ] - - self.local_rdoc_dir = 'html' - self.rsync_args = '-avz --delete' - rdoc_locations << 'docs.seattlerb.org:/data/www/docs.seattlerb.org/rake/' - - self.clean_globs += [ - '**/*.o', - '**/*.rbc', - '*.dot', - 'TAGS', - 'doc/example/main', - ] +RDoc::Task.new do |doc| + doc.main = 'README.rdoc' + doc.title = 'Rake -- Ruby Make' + doc.rdoc_files = FileList.new %w[lib MIT-LICENSE doc/**/*.rdoc *.rdoc] + doc.rdoc_dir = 'html' end -hoe.testlib = :minitest -hoe.test_prelude = 'gem "minitest", "~> 5.0"' - -# Use custom rdoc task due to existence of doc directory - -Rake::Task['docs'].clear -Rake::Task['clobber_docs'].clear - -begin - require 'rdoc/task' - - RDoc::Task.new :rdoc => 'docs', :clobber_rdoc => 'clobber_docs' do |doc| - doc.main = hoe.readme_file - doc.title = 'Rake -- Ruby Make' - - rdoc_files = Rake::FileList.new %w[lib History.rdoc MIT-LICENSE doc] - rdoc_files.add hoe.extra_rdoc_files - - doc.rdoc_files = rdoc_files - - doc.rdoc_dir = 'html' - end -rescue LoadError - warn 'run `rake newb` to install rdoc' -end +task :default => :test diff --git a/appveyor.yml b/appveyor.yml index 681b2a387..2710426ad 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,12 +6,12 @@ install: - ruby --version - gem update --system - gem --version - - gem install hoe minitest --no-document + - gem install minitest --no-document build_script: - net user - net localgroup test_script: - - ruby -Ilib bin/rake + - ruby -Ilib exe/rake environment: matrix: diff --git a/bin/console b/bin/console new file mode 100755 index 000000000..b8342352c --- /dev/null +++ b/bin/console @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "rake" + +require "irb" +IRB.start diff --git a/bin/setup b/bin/setup new file mode 100755 index 000000000..cf4ad25e1 --- /dev/null +++ b/bin/setup @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install diff --git a/doc/example/.cvsignore b/doc/example/.cvsignore deleted file mode 100644 index f0c9b8122..000000000 --- a/doc/example/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -*.o -main diff --git a/doc/release_notes/README.md b/doc/release_notes/README.md new file mode 100644 index 000000000..d7079ad81 --- /dev/null +++ b/doc/release_notes/README.md @@ -0,0 +1,4 @@ +# Note: this release notes will never been updated + +The maintenance policy for release notes has been changed. +Please see [History.rdoc](https://github.com/ruby/rake/blob/master/History.rdoc). diff --git a/doc/release_notes/rake-0.7.3.rdoc b/doc/release_notes/rake-0.7.3.rdoc old mode 100755 new mode 100644 diff --git a/bin/rake b/exe/rake similarity index 95% rename from bin/rake rename to exe/rake index 4e0bbb7b7..f1ac568c6 100755 --- a/bin/rake +++ b/exe/rake @@ -22,12 +22,6 @@ # IN THE SOFTWARE. #++ -begin - require 'rubygems' - gem 'rake' -rescue LoadError -end - require 'rake' Rake.application.run diff --git a/lib/rake.rb b/lib/rake.rb index e8958fa99..a2f1b448e 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -20,9 +20,7 @@ # IN THE SOFTWARE. #++ -module Rake - VERSION = '11.1.2' -end +module Rake; end require 'rake/version' diff --git a/lib/rake/application.rb b/lib/rake/application.rb index f27e874a7..fc0a786d6 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -1,4 +1,3 @@ -require 'shellwords' require 'optparse' require 'rake/task_manager' @@ -35,6 +34,9 @@ class Application # List of the top level task names (task names from the command line). attr_reader :top_level_tasks + # Override the detected TTY output state (mostly for testing) + attr_writer :tty_output + DEFAULT_RAKEFILES = [ 'rakefile', 'Rakefile', @@ -269,11 +271,6 @@ def tty_output? # :nodoc: @tty_output end - # Override the detected TTY output state (mostly for testing) - def tty_output=(tty_output_state) # :nodoc: - @tty_output = tty_output_state - end - # We will truncate output if we are outputting to a TTY or if we've been # given an explicit column width to honor def truncate_output? # :nodoc: diff --git a/lib/rake/contrib/.document b/lib/rake/contrib/.document deleted file mode 100644 index 8b1378917..000000000 --- a/lib/rake/contrib/.document +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/rake/cpu_counter.rb b/lib/rake/cpu_counter.rb index a0415f131..fc8848a5d 100644 --- a/lib/rake/cpu_counter.rb +++ b/lib/rake/cpu_counter.rb @@ -35,23 +35,17 @@ def count count_via_java_runtime else case RbConfig::CONFIG['host_os'] - when /darwin9/ - count_via_hwprefs_cpu_count - when /darwin/ - count_via_hwprefs_thread_count || count_via_sysctl when /linux/ count_via_cpuinfo - when /bsd/ + when /darwin|bsd/ count_via_sysctl when /mswin|mingw/ count_via_win32 else # Try everything count_via_win32 || - count_via_sysctl || - count_via_hwprefs_thread_count || - count_via_hwprefs_cpu_count || - count_via_cpuinfo + count_via_sysctl || + count_via_cpuinfo end end end @@ -77,14 +71,6 @@ def count_via_cpuinfo nil end - def count_via_hwprefs_thread_count - run 'hwprefs', 'thread_count' - end - - def count_via_hwprefs_cpu_count - run 'hwprefs', 'cpu_count' - end - def count_via_sysctl run 'sysctl', '-n', 'hw.ncpu' end diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index ff2f45321..14cb092fc 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -45,13 +45,15 @@ module FileUtils def sh(*cmd, &block) options = (Hash === cmd.last) ? cmd.pop : {} shell_runner = block_given? ? block : create_shell_runner(cmd) + set_verbose_option(options) - options[:noop] ||= Rake::FileUtilsExt.nowrite_flag - Rake.rake_check_options options, :noop, :verbose - Rake.rake_output_message cmd.join(" ") if options[:verbose] + verbose = options.delete :verbose + noop = options.delete(:noop) || Rake::FileUtilsExt.nowrite_flag + + Rake.rake_output_message sh_show_command cmd if verbose - unless options[:noop] - res = system(*cmd) + unless noop + res = system(*cmd, options) status = $? status = Rake::PseudoStatus.new(1) if !res && status.nil? shell_runner.call(res, status) @@ -59,8 +61,9 @@ def sh(*cmd, &block) end def create_shell_runner(cmd) # :nodoc: - show_command = cmd.join(" ") + show_command = sh_show_command cmd show_command = show_command[0, 42] + "..." unless $trace + lambda do |ok, status| ok or fail "Command failed with status (#{status.exitstatus}): " + @@ -69,6 +72,19 @@ def create_shell_runner(cmd) # :nodoc: end private :create_shell_runner + def sh_show_command(cmd) # :nodoc: + cmd = cmd.dup + + if Hash === cmd.first + env = cmd.first + env = env.map { |name, value| "#{name}=#{value}" }.join " " + cmd[0] = env + end + + cmd.join " " + end + private :sh_show_command + def set_verbose_option(options) # :nodoc: unless options.key? :verbose options[:verbose] = diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index 249ee72b1..cdb4879f5 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -63,6 +63,9 @@ class PackageTask < TaskLib # is false). attr_accessor :need_tar_bz2 + # True if a xz'd tar file (tar.xz) should be produced (default is false) + attr_accessor :need_tar_xz + # True if a zip file should be produced (default is false) attr_accessor :need_zip @@ -94,6 +97,7 @@ def init(name, version) @need_tar = false @need_tar_gz = false @need_tar_bz2 = false + @need_tar_xz = false @need_zip = false @tar_command = 'tar' @zip_command = 'zip' @@ -120,7 +124,8 @@ def define [ [need_tar, tgz_file, "z"], [need_tar_gz, tar_gz_file, "z"], - [need_tar_bz2, tar_bz2_file, "j"] + [need_tar_bz2, tar_bz2_file, "j"], + [need_tar_xz, tar_xz_file, "J"] ].each do |(need, file, flag)| if need task :package => ["#{package_dir}/#{file}"] @@ -189,6 +194,12 @@ def tar_bz2_file "#{package_name}.tar.bz2" end + # The package name with .tar.xz added + + def tar_xz_file + "#{package_name}.tar.xz" + end + # The package name with .zip added def zip_file diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index 7e3a6b3f3..bc4e1751e 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -19,4 +19,3 @@ end ARGV.replace argv - diff --git a/lib/rake/rule_recursion_overflow_error.rb b/lib/rake/rule_recursion_overflow_error.rb index da4318da9..b71e08efb 100644 --- a/lib/rake/rule_recursion_overflow_error.rb +++ b/lib/rake/rule_recursion_overflow_error.rb @@ -1,4 +1,3 @@ - module Rake # Error indicating a recursion overflow error in task selection. diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 1d3244d2b..5300b6fc4 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -304,10 +304,10 @@ def transform_comments(separator, &block) private :transform_comments # Get the first sentence in a string. The sentence is terminated - # by the first period or the end of the line. Decimal points do - # not count as periods. + # by the first period, exclamation mark, or the end of the line. + # Decimal points do not count as periods. def first_sentence(string) - string.split(/\.[ \t]|\.$|\n/).first + string.split(/(?<=\w)(\.|!)[ \t]|(\.$|!)|\n/).first end private :first_sentence diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index d86c5d11a..4eaf2f8b9 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -17,7 +17,8 @@ def initialize(names, values, parent=nil) @hash = {} @values = values names.each_with_index { |name, i| - @hash[name.to_sym] = values[i] unless values[i].nil? + next if values[i].nil? || values[i] == '' + @hash[name.to_sym] = values[i] } end diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 4e048d37e..27ad790af 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -69,6 +69,9 @@ class TestTask < TaskLib # Description of the test task. (default is 'Run tests') attr_accessor :description + # Task prerequisites. + attr_accessor :deps + # Explicitly define the list of test files to be included in a # test. +list+ is expected to be an array of file names (a # FileList is acceptable). If both +pattern+ and +test_files+ are @@ -89,6 +92,7 @@ def initialize(name=:test) @loader = :rake @ruby_opts = [] @description = "Run tests" + (@name == :test ? "" : " for #{@name}") + @deps = [] yield self if block_given? @pattern = 'test/test*.rb' if @pattern.nil? && @test_files.nil? define @@ -97,7 +101,7 @@ def initialize(name=:test) # Create the tasks defined by this task lib. def define desc @description - task @name do + task @name => Array(deps) do FileUtilsExt.verbose(@verbose) do args = "#{ruby_opts_string} #{run_code} " + diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb index 691daeabe..a11af0393 100644 --- a/lib/rake/thread_pool.rb +++ b/lib/rake/thread_pool.rb @@ -1,4 +1,3 @@ -require 'thread' require 'set' require 'rake/promise' diff --git a/lib/rake/version.rb b/lib/rake/version.rb index b9b1b2d48..07f341dd7 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,4 +1,6 @@ module Rake + VERSION = '11.2.0' + module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' diff --git a/rake.gemspec b/rake.gemspec index a4e298758..dd5750e8a 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -1,40 +1,30 @@ -# -*- encoding: utf-8 -*- +# coding: utf-8 +$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) +require 'rake/version' Gem::Specification.new do |s| s.name = "rake".freeze - s.version = "11.1.2" - - s.required_rubygems_version = Gem::Requirement.new(">= 1.3.2".freeze) if s.respond_to? :required_rubygems_version= - s.require_paths = ["lib".freeze] - s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] + s.version = Rake::VERSION s.date = "2016-03-27" - s.description = "Rake is a Make-like program implemented in Ruby. Tasks and dependencies are\nspecified in standard Ruby syntax.\n\nRake has the following features:\n\n* Rakefiles (rake's version of Makefiles) are completely defined in\n standard Ruby syntax. No XML files to edit. No quirky Makefile\n syntax to worry about (is that a tab or a space?)\n\n* Users can specify tasks with prerequisites.\n\n* Rake supports rule patterns to synthesize implicit tasks.\n\n* Flexible FileLists that act like arrays but know about manipulating\n file names and paths.\n\n* A library of prepackaged tasks to make building rakefiles easier. For example,\n tasks for building tarballs and publishing to FTP or SSH sites. (Formerly\n tasks for building RDoc and Gems were included in rake but they're now\n available in RDoc and RubyGems respectively.)\n\n* Supports parallel execution of tasks.".freeze + s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] - s.executables = ["rake".freeze] - s.extra_rdoc_files = ["CONTRIBUTING.rdoc".freeze, "History.rdoc".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "doc/command_line_usage.rdoc".freeze, "doc/glossary.rdoc".freeze, "doc/proto_rake.rdoc".freeze, "doc/rakefile.rdoc".freeze, "doc/rational.rdoc".freeze, "doc/release_notes/rake-0.4.14.rdoc".freeze, "doc/release_notes/rake-0.4.15.rdoc".freeze, "doc/release_notes/rake-0.5.0.rdoc".freeze, "doc/release_notes/rake-0.5.3.rdoc".freeze, "doc/release_notes/rake-0.5.4.rdoc".freeze, "doc/release_notes/rake-0.6.0.rdoc".freeze, "doc/release_notes/rake-0.7.0.rdoc".freeze, "doc/release_notes/rake-0.7.1.rdoc".freeze, "doc/release_notes/rake-0.7.2.rdoc".freeze, "doc/release_notes/rake-0.7.3.rdoc".freeze, "doc/release_notes/rake-0.8.0.rdoc".freeze, "doc/release_notes/rake-0.8.2.rdoc".freeze, "doc/release_notes/rake-0.8.3.rdoc".freeze, "doc/release_notes/rake-0.8.4.rdoc".freeze, "doc/release_notes/rake-0.8.5.rdoc".freeze, "doc/release_notes/rake-0.8.6.rdoc".freeze, "doc/release_notes/rake-0.8.7.rdoc".freeze, "doc/release_notes/rake-0.9.0.rdoc".freeze, "doc/release_notes/rake-0.9.1.rdoc".freeze, "doc/release_notes/rake-0.9.2.2.rdoc".freeze, "doc/release_notes/rake-0.9.2.rdoc".freeze, "doc/release_notes/rake-0.9.3.rdoc".freeze, "doc/release_notes/rake-0.9.4.rdoc".freeze, "doc/release_notes/rake-0.9.5.rdoc".freeze, "doc/release_notes/rake-0.9.6.rdoc".freeze, "doc/release_notes/rake-10.0.0.rdoc".freeze, "doc/release_notes/rake-10.0.1.rdoc".freeze, "doc/release_notes/rake-10.0.2.rdoc".freeze, "doc/release_notes/rake-10.0.3.rdoc".freeze, "doc/release_notes/rake-10.1.0.rdoc".freeze, "MIT-LICENSE".freeze, "doc/command_line_usage.rdoc".freeze, "doc/glossary.rdoc".freeze, "doc/proto_rake.rdoc".freeze, "doc/rakefile.rdoc".freeze, "doc/rational.rdoc".freeze, "doc/release_notes/rake-0.4.14.rdoc".freeze, "doc/release_notes/rake-0.4.15.rdoc".freeze, "doc/release_notes/rake-0.5.0.rdoc".freeze, "doc/release_notes/rake-0.5.3.rdoc".freeze, "doc/release_notes/rake-0.5.4.rdoc".freeze, "doc/release_notes/rake-0.6.0.rdoc".freeze, "doc/release_notes/rake-0.7.0.rdoc".freeze, "doc/release_notes/rake-0.7.1.rdoc".freeze, "doc/release_notes/rake-0.7.2.rdoc".freeze, "doc/release_notes/rake-0.7.3.rdoc".freeze, "doc/release_notes/rake-0.8.0.rdoc".freeze, "doc/release_notes/rake-0.8.2.rdoc".freeze, "doc/release_notes/rake-0.8.3.rdoc".freeze, "doc/release_notes/rake-0.8.4.rdoc".freeze, "doc/release_notes/rake-0.8.5.rdoc".freeze, "doc/release_notes/rake-0.8.6.rdoc".freeze, "doc/release_notes/rake-0.8.7.rdoc".freeze, "doc/release_notes/rake-0.9.0.rdoc".freeze, "doc/release_notes/rake-0.9.1.rdoc".freeze, "doc/release_notes/rake-0.9.2.2.rdoc".freeze, "doc/release_notes/rake-0.9.2.rdoc".freeze, "doc/release_notes/rake-0.9.3.rdoc".freeze, "doc/release_notes/rake-0.9.4.rdoc".freeze, "doc/release_notes/rake-0.9.5.rdoc".freeze, "doc/release_notes/rake-0.9.6.rdoc".freeze, "doc/release_notes/rake-10.0.0.rdoc".freeze, "doc/release_notes/rake-10.0.1.rdoc".freeze, "doc/release_notes/rake-10.0.2.rdoc".freeze, "doc/release_notes/rake-10.0.3.rdoc".freeze, "doc/release_notes/rake-10.1.0.rdoc".freeze, "CONTRIBUTING.rdoc".freeze, "History.rdoc".freeze, "README.rdoc".freeze] - s.files = [".autotest".freeze, ".rubocop.yml".freeze, ".togglerc".freeze, "CONTRIBUTING.rdoc".freeze, "History.rdoc".freeze, "MIT-LICENSE".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "Rakefile".freeze, "bin/rake".freeze, "doc/command_line_usage.rdoc".freeze, "doc/example/Rakefile1".freeze, "doc/example/Rakefile2".freeze, "doc/example/a.c".freeze, "doc/example/b.c".freeze, "doc/example/main.c".freeze, "doc/glossary.rdoc".freeze, "doc/jamis.rb".freeze, "doc/proto_rake.rdoc".freeze, "doc/rake.1".freeze, "doc/rakefile.rdoc".freeze, "doc/rational.rdoc".freeze, "doc/release_notes/rake-0.4.14.rdoc".freeze, "doc/release_notes/rake-0.4.15.rdoc".freeze, "doc/release_notes/rake-0.5.0.rdoc".freeze, "doc/release_notes/rake-0.5.3.rdoc".freeze, "doc/release_notes/rake-0.5.4.rdoc".freeze, "doc/release_notes/rake-0.6.0.rdoc".freeze, "doc/release_notes/rake-0.7.0.rdoc".freeze, "doc/release_notes/rake-0.7.1.rdoc".freeze, "doc/release_notes/rake-0.7.2.rdoc".freeze, "doc/release_notes/rake-0.7.3.rdoc".freeze, "doc/release_notes/rake-0.8.0.rdoc".freeze, "doc/release_notes/rake-0.8.2.rdoc".freeze, "doc/release_notes/rake-0.8.3.rdoc".freeze, "doc/release_notes/rake-0.8.4.rdoc".freeze, "doc/release_notes/rake-0.8.5.rdoc".freeze, "doc/release_notes/rake-0.8.6.rdoc".freeze, "doc/release_notes/rake-0.8.7.rdoc".freeze, "doc/release_notes/rake-0.9.0.rdoc".freeze, "doc/release_notes/rake-0.9.1.rdoc".freeze, "doc/release_notes/rake-0.9.2.2.rdoc".freeze, "doc/release_notes/rake-0.9.2.rdoc".freeze, "doc/release_notes/rake-0.9.3.rdoc".freeze, "doc/release_notes/rake-0.9.4.rdoc".freeze, "doc/release_notes/rake-0.9.5.rdoc".freeze, "doc/release_notes/rake-0.9.6.rdoc".freeze, "doc/release_notes/rake-10.0.0.rdoc".freeze, "doc/release_notes/rake-10.0.1.rdoc".freeze, "doc/release_notes/rake-10.0.2.rdoc".freeze, "doc/release_notes/rake-10.0.3.rdoc".freeze, "doc/release_notes/rake-10.1.0.rdoc".freeze, "lib/rake.rb".freeze, "lib/rake/application.rb".freeze, "lib/rake/backtrace.rb".freeze, "lib/rake/clean.rb".freeze, "lib/rake/cloneable.rb".freeze, "lib/rake/contrib/.document".freeze, "lib/rake/contrib/compositepublisher.rb".freeze, "lib/rake/contrib/ftptools.rb".freeze, "lib/rake/contrib/sshpublisher.rb".freeze, "lib/rake/cpu_counter.rb".freeze, "lib/rake/default_loader.rb".freeze, "lib/rake/dsl_definition.rb".freeze, "lib/rake/early_time.rb".freeze, "lib/rake/ext/core.rb".freeze, "lib/rake/ext/fixnum.rb".freeze, "lib/rake/ext/pathname.rb".freeze, "lib/rake/ext/string.rb".freeze, "lib/rake/file_creation_task.rb".freeze, "lib/rake/file_list.rb".freeze, "lib/rake/file_task.rb".freeze, "lib/rake/file_utils.rb".freeze, "lib/rake/file_utils_ext.rb".freeze, "lib/rake/invocation_chain.rb".freeze, "lib/rake/invocation_exception_mixin.rb".freeze, "lib/rake/late_time.rb".freeze, "lib/rake/linked_list.rb".freeze, "lib/rake/loaders/makefile.rb".freeze, "lib/rake/multi_task.rb".freeze, "lib/rake/name_space.rb".freeze, "lib/rake/packagetask.rb".freeze, "lib/rake/phony.rb".freeze, "lib/rake/private_reader.rb".freeze, "lib/rake/promise.rb".freeze, "lib/rake/pseudo_status.rb".freeze, "lib/rake/rake_module.rb".freeze, "lib/rake/rake_test_loader.rb".freeze, "lib/rake/rule_recursion_overflow_error.rb".freeze, "lib/rake/scope.rb".freeze, "lib/rake/task.rb".freeze, "lib/rake/task_argument_error.rb".freeze, "lib/rake/task_arguments.rb".freeze, "lib/rake/task_manager.rb".freeze, "lib/rake/tasklib.rb".freeze, "lib/rake/testtask.rb".freeze, "lib/rake/thread_history_display.rb".freeze, "lib/rake/thread_pool.rb".freeze, "lib/rake/trace_output.rb".freeze, "lib/rake/version.rb".freeze, "lib/rake/win32.rb".freeze, "rakelib/test_times.rake".freeze, "test/file_creation.rb".freeze, "test/helper.rb".freeze, "test/support/rakefile_definitions.rb".freeze, "test/support/ruby_runner.rb".freeze, "test/test_private_reader.rb".freeze, "test/test_rake.rb".freeze, "test/test_rake_application.rb".freeze, "test/test_rake_application_options.rb".freeze, "test/test_rake_backtrace.rb".freeze, "test/test_rake_clean.rb".freeze, "test/test_rake_cpu_counter.rb".freeze, "test/test_rake_definitions.rb".freeze, "test/test_rake_directory_task.rb".freeze, "test/test_rake_dsl.rb".freeze, "test/test_rake_early_time.rb".freeze, "test/test_rake_extension.rb".freeze, "test/test_rake_file_creation_task.rb".freeze, "test/test_rake_file_list.rb".freeze, "test/test_rake_file_list_path_map.rb".freeze, "test/test_rake_file_task.rb".freeze, "test/test_rake_file_utils.rb".freeze, "test/test_rake_ftp_file.rb".freeze, "test/test_rake_functional.rb".freeze, "test/test_rake_invocation_chain.rb".freeze, "test/test_rake_late_time.rb".freeze, "test/test_rake_linked_list.rb".freeze, "test/test_rake_makefile_loader.rb".freeze, "test/test_rake_multi_task.rb".freeze, "test/test_rake_name_space.rb".freeze, "test/test_rake_package_task.rb".freeze, "test/test_rake_path_map.rb".freeze, "test/test_rake_path_map_explode.rb".freeze, "test/test_rake_path_map_partial.rb".freeze, "test/test_rake_pathname_extensions.rb".freeze, "test/test_rake_pseudo_status.rb".freeze, "test/test_rake_rake_test_loader.rb".freeze, "test/test_rake_reduce_compat.rb".freeze, "test/test_rake_require.rb".freeze, "test/test_rake_rules.rb".freeze, "test/test_rake_scope.rb".freeze, "test/test_rake_task.rb".freeze, "test/test_rake_task_argument_parsing.rb".freeze, "test/test_rake_task_arguments.rb".freeze, "test/test_rake_task_manager.rb".freeze, "test/test_rake_task_manager_argument_resolution.rb".freeze, "test/test_rake_task_with_arguments.rb".freeze, "test/test_rake_test_task.rb".freeze, "test/test_rake_thread_pool.rb".freeze, "test/test_rake_top_level_functions.rb".freeze, "test/test_rake_win32.rb".freeze, "test/test_thread_history_display.rb".freeze, "test/test_trace_output.rb".freeze] + + s.summary = "Rake is a Make-like program implemented in Ruby".freeze + s.description = "Rake is a Make-like program implemented in Ruby. Tasks and dependencies are\nspecified in standard Ruby syntax.\n\nRake has the following features:\n\n* Rakefiles (rake's version of Makefiles) are completely defined in\n standard Ruby syntax. No XML files to edit. No quirky Makefile\n syntax to worry about (is that a tab or a space?)\n\n* Users can specify tasks with prerequisites.\n\n* Rake supports rule patterns to synthesize implicit tasks.\n\n* Flexible FileLists that act like arrays but know about manipulating\n file names and paths.\n\n* A library of prepackaged tasks to make building rakefiles easier. For example,\n tasks for building tarballs and publishing to FTP or SSH sites. (Formerly\n tasks for building RDoc and Gems were included in rake but they're now\n available in RDoc and RubyGems respectively.)\n\n* Supports parallel execution of tasks.".freeze s.homepage = "https://github.com/ruby/rake".freeze s.licenses = ["MIT".freeze] - s.rdoc_options = ["--main".freeze, "README.rdoc".freeze] + + s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + s.bindir = "exe" + s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) } + s.require_paths = ["lib".freeze] + s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze) s.rubygems_version = "2.6.1".freeze - s.summary = "Rake is a Make-like program implemented in Ruby".freeze - - if s.respond_to? :specification_version then - s.specification_version = 4 + s.required_rubygems_version = Gem::Requirement.new(">= 1.3.2".freeze) + s.rdoc_options = ["--main".freeze, "README.rdoc".freeze] - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_development_dependency(%q.freeze, ["~> 5.8"]) - s.add_development_dependency(%q.freeze, ["~> 4.0"]) - s.add_development_dependency(%q.freeze, ["~> 3.14"]) - else - s.add_dependency(%q.freeze, ["~> 5.8"]) - s.add_dependency(%q.freeze, ["~> 4.0"]) - s.add_dependency(%q.freeze, ["~> 3.14"]) - end - else - s.add_dependency(%q.freeze, ["~> 5.8"]) - s.add_dependency(%q.freeze, ["~> 4.0"]) - s.add_dependency(%q.freeze, ["~> 3.14"]) - end + s.add_development_dependency(%q.freeze, ["~> 1.11"]) + s.add_development_dependency(%q.freeze, ["~> 5.8"]) + s.add_development_dependency(%q.freeze, ["~> 4.0"]) end diff --git a/rakelib/test_times.rake b/rakelib/test_times.rake deleted file mode 100644 index daf1bc6e9..000000000 --- a/rakelib/test_times.rake +++ /dev/null @@ -1,25 +0,0 @@ -module TestTimes - def self.run(test_results, limit=0) - limit = limit.nonzero? || 10 - tests = [] - test_results.split(/\n/).each do |line| - if line =~ /^(.+?#[^:]+): ([0-9.]+) s: \.$/ - tests << [$1, $2.to_f, line] - end - end - - puts "#{limit} Slowest tests" - puts tests.sort_by { |item| - item[1] - }.reverse[0...limit].map { |item| - "%6.3f: %-s\n" % [item[1], item[0]] - } - end -end - -namespace :test do - desc "Find the slowest unit tests" - task :times, [:limit] do |t, args| - TestTimes.run `rake test:units TESTOPTS='--verbose'`, args.limit.to_i - end -end diff --git a/test/helper.rb b/test/helper.rb index ab3416314..f8f1fe106 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,16 +1,11 @@ -require 'rubygems' $:.unshift File.expand_path('../../lib', __FILE__) -begin - gem 'minitest', '~> 5' -rescue Gem::LoadError -end - +gem 'minitest', '~> 5' require 'minitest/autorun' require 'rake' require 'tmpdir' -require File.expand_path('../file_creation', __FILE__) +require_relative 'support/file_creation' require_relative 'support/ruby_runner' require_relative 'support/rakefile_definitions' @@ -28,20 +23,10 @@ class TaskManager def setup ARGV.clear - test_dir = File.basename File.dirname File.expand_path __FILE__ - - @rake_root = - if test_dir == 'test' - # rake repository - File.expand_path '../../', __FILE__ - else - # ruby repository - File.expand_path '../../../', __FILE__ - end - @verbose = ENV['VERBOSE'] - @rake_exec = File.join @rake_root, 'bin', 'rake' + @rake_root = File.expand_path '../../', __FILE__ + @rake_exec = File.join @rake_root, 'exe', 'rake' @rake_lib = File.join @rake_root, 'lib' @ruby_options = ["-I#{@rake_lib}", "-I."] diff --git a/test/file_creation.rb b/test/support/file_creation.rb similarity index 100% rename from test/file_creation.rb rename to test/support/file_creation.rb diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index d3ba12b78..1525bcd6a 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -72,7 +72,7 @@ def test_describe_with_pattern def test_execute $xyzzy = 0 - flags('--execute=$xyzzy=1', '-e $xyzzy=1') do |opts| + flags('--execute=$xyzzy=1', '-e $xyzzy=1') do assert_equal 1, $xyzzy assert_equal :exit, @exit $xyzzy = 0 @@ -81,7 +81,7 @@ def test_execute def test_execute_and_continue $xyzzy = 0 - flags('--execute-continue=$xyzzy=1', '-E $xyzzy=1') do |opts| + flags('--execute-continue=$xyzzy=1', '-E $xyzzy=1') do assert_equal 1, $xyzzy refute_equal :exit, @exit $xyzzy = 0 @@ -91,7 +91,7 @@ def test_execute_and_continue def test_execute_and_print $xyzzy = 0 out, = capture_io do - flags('--execute-print=$xyzzy="pugh"', '-p $xyzzy="pugh"') do |opts| + flags('--execute-print=$xyzzy="pugh"', '-p $xyzzy="pugh"') do assert_equal 'pugh', $xyzzy assert_equal :exit, @exit $xyzzy = 0 @@ -134,7 +134,7 @@ def test_jobs end def test_libdir - flags(['--libdir', 'xx'], ['-I', 'xx'], ['-Ixx']) do |opts| + flags(['--libdir', 'xx'], ['-I', 'xx'], ['-Ixx']) do $:.include?('xx') end ensure @@ -148,7 +148,7 @@ def test_multitask end def test_rakefile - flags(['--rakefile', 'RF'], ['--rakefile=RF'], ['-f', 'RF'], ['-fRF']) do |opts| + flags(['--rakefile', 'RF'], ['--rakefile=RF'], ['-f', 'RF'], ['-fRF']) do assert_equal ['RF'], @app.instance_eval { @rakefiles } end end diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 3204a5799..1b43a49d1 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -141,6 +141,18 @@ def test_sh_with_a_single_string_argument } end + def test_sh_with_env + check_environment + + env = { + 'RAKE_TEST_SH' => 'someval' + } + + verbose(false) { + sh env, RUBY, 'check_environment.rb', 'RAKE_TEST_SH', 'someval' + } + end + def test_sh_with_multiple_arguments skip if jruby9? # https://github.com/jruby/jruby/issues/3653 @@ -152,6 +164,22 @@ def test_sh_with_multiple_arguments } end + def test_sh_with_spawn_options + skip 'JRuby does not support spawn options' if jruby? + + echocommand + + r, w = IO.pipe + + verbose(false) { + sh RUBY, 'echocommand.rb', out: w + } + + w.close + + assert_equal "echocommand.rb\n", r.read + end + def test_sh_failure shellcommand @@ -187,6 +215,10 @@ def test_sh_noop end def test_sh_bad_option + # Skip on JRuby because option checking is performed by spawn via system + # now. + skip 'JRuby does not support spawn options' if jruby? + shellcommand ex = assert_raises(ArgumentError) { @@ -241,6 +273,20 @@ def test_ruby_with_a_single_string_argument } end + def test_sh_show_command + env = { + 'RAKE_TEST_SH' => 'someval' + } + + cmd = [env, RUBY, 'some_file.rb', 'some argument'] + + show_cmd = send :sh_show_command, cmd + + expected_cmd = "RAKE_TEST_SH=someval #{RUBY} some_file.rb some argument" + + assert_equal expected_cmd, show_cmd + end + def test_ruby_with_multiple_arguments skip if jruby9? # https://github.com/jruby/jruby/issues/3653 @@ -279,6 +325,16 @@ def check_no_expansion CHECK_EXPANSION end + def check_environment + command 'check_environment.rb', <<-CHECK_ENVIRONMENT +if ENV[ARGV[0]] != ARGV[1] + exit 1 +else + exit 0 +end + CHECK_ENVIRONMENT + end + def check_expansion command 'check_expansion.rb', <<-CHECK_EXPANSION if ARGV[0] != ARGV[1] @@ -289,6 +345,16 @@ def check_expansion CHECK_EXPANSION end + def echocommand + command 'echocommand.rb', <<-ECHOCOMMAND +#!/usr/bin/env ruby + +puts "echocommand.rb" + +exit 0 + ECHOCOMMAND + end + def replace_ruby ruby = FileUtils::RUBY FileUtils.send :remove_const, :RUBY diff --git a/test/test_rake_package_task.rb b/test/test_rake_package_task.rb index 87cb57c10..d7821e032 100644 --- a/test/test_rake_package_task.rb +++ b/test/test_rake_package_task.rb @@ -19,6 +19,7 @@ def test_initialize p.need_tar = true p.need_tar_gz = true p.need_tar_bz2 = true + p.need_tar_xz = true p.need_zip = true } @@ -32,6 +33,7 @@ def test_initialize assert Rake::Task['pkg/pkgr-1.2.3.tgz'] assert Rake::Task['pkg/pkgr-1.2.3.tar.gz'] assert Rake::Task['pkg/pkgr-1.2.3.tar.bz2'] + assert Rake::Task['pkg/pkgr-1.2.3.tar.xz'] assert Rake::Task['pkg/pkgr-1.2.3.zip'] assert Rake::Task['pkg/pkgr-1.2.3'] assert Rake::Task[:clobber_package] @@ -76,4 +78,3 @@ def test_package_name_noversion end end - diff --git a/test/test_rake_require.rb b/test/test_rake_require.rb index d229edbc2..80b5f0f1c 100644 --- a/test/test_rake_require.rb +++ b/test/test_rake_require.rb @@ -1,6 +1,10 @@ require File.expand_path('../helper', __FILE__) class TestRakeRequire < Rake::TestCase + def setup + super + $LOAD_PATH.unshift '.' if jruby17? + end def test_can_load_rake_library rakefile_rakelib @@ -37,4 +41,3 @@ def test_throws_error_if_library_not_found assert_match(/testx/, ex.message) end end - diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 63ff86556..d9e13bd60 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -352,12 +352,24 @@ def test_comment_setting assert_equal "A Comment", t.comment end - def test_comments_with_sentences + def test_comments_with_sentences_period desc "Comment 1. Comment 2." t = task(:t, :name, :rev) assert_equal "Comment 1", t.comment end + def test_comments_with_sentences_exclamation_mark + desc "An exclamation mark! Comment." + t = task(:t, :name, :rev) + assert_equal "An exclamation mark", t.comment + end + + def test_comments_with_many_periods + desc "This is a test...I think ... testing. Comment." + t = task(:t, :name, :rev) + assert_equal "This is a test...I think ... testing", t.comment + end + def test_comments_with_tabbed_sentences desc "Comment 1.\tComment 2." t = task(:t, :name, :rev) diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index abd41ebea..554c13f57 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -19,6 +19,11 @@ def test_multiple_values_in_args assert_equal({:a => :one, :b => :two, :c => :three}, ta.to_hash) end + def test_blank_values_in_args + ta = Rake::TaskArguments.new([:a, :b, :c], ['', :two, '']) + assert_equal({:b => :two}, ta.to_hash) + end + def test_has_key ta = Rake::TaskArguments.new([:a], [:one]) assert(ta.has_key?(:a)) diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index bb4d43c96..9b27bfdd8 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -12,6 +12,7 @@ def test_initialize assert_equal 'test/test*.rb', tt.pattern assert_equal false, tt.verbose assert_equal true, tt.warning + assert_equal [], tt.deps assert Task.task_defined?(:test) end @@ -22,6 +23,7 @@ def test_initialize_override t.pattern = 'test/tc_*.rb' t.warning = true t.verbose = true + t.deps = [:env] end refute_nil tt assert_equal "Run example tests", tt.description @@ -30,6 +32,7 @@ def test_initialize_override assert_equal 'test/tc_*.rb', tt.pattern assert_equal true, tt.warning assert_equal true, tt.verbose + assert_equal [:env], tt.deps assert_match(/-w/, tt.ruby_opts_string) assert Task.task_defined?(:example) end @@ -101,25 +104,6 @@ def test_run_code_rake Gem.loaded_specs['rake'] = rake end - def test_run_code_rake_default_gem - skip 'this ruby does not have default gems' unless - Gem::Specification.method_defined? :default_specifications_dir - - default_spec = Gem::Specification.new 'rake', 0 - default_spec.loaded_from = File.join Gem::Specification.default_specifications_dir, 'rake-0.gemspec' - begin - rake, Gem.loaded_specs['rake'] = Gem.loaded_specs['rake'], default_spec - - test_task = Rake::TestTask.new do |t| - t.loader = :rake - end - - assert_match(/\A(-I".*?" *)* ".*?"\Z/, test_task.run_code) - ensure - Gem.loaded_specs['rake'] = rake - end - end - def test_test_files_equals tt = Rake::TestTask.new do |t| t.test_files = FileList['a.rb', 'b.rb'] @@ -127,4 +111,15 @@ def test_test_files_equals assert_equal ["a.rb", 'b.rb'], tt.file_list.to_a end + + def test_task_prerequisites + Rake::TestTask.new :parent + + Rake::TestTask.new :child do |t| + t.deps = :parent + end + + task = Rake::Task[:child] + assert_includes task.prerequisites, 'parent' + end end