![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package rubygem-rake for openSUSE:Factory checked in at 2015-02-05 11:01:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-rake (Old) and /work/SRC/openSUSE:Factory/.rubygem-rake.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-rake" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-rake/rubygem-rake.changes 2014-10-23 14:21:18.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-rake.new/rubygem-rake.changes 2015-02-05 11:01:08.000000000 +0100 @@ -1,0 +2,15 @@ +Wed Feb 4 12:38:31 UTC 2015 - hvogel@suse.com + +- Update to version 10.4.2 + * Rake no longer edits ARGV. This allows you to re-exec rake from a rake task. + * Documented how Rake::DSL#desc handles sentences in task descriptions. + * Added support for Pathname in rake tasks. + * Rake now ignores falsy dependencies which allows for easier programmatic + creation of tasks. + * Etc.nprocessors is used for counting the number of CPUs. + * Updated rake manpage. + * Add Rake::LATE to allow rebuilding of files that depend on deleted files. + * Fix relinking of files when repackaging. + * Try counting CPUs via cpuinfo if host_os was not matched. + +------------------------------------------------------------------- Old: ---- rake-10.3.2.gem New: ---- rake-10.4.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-rake.spec ++++++ --- /var/tmp/diff_new_pack.iKWjao/_old 2015-02-05 11:01:09.000000000 +0100 +++ /var/tmp/diff_new_pack.iKWjao/_new 2015-02-05 11:01:09.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-rake # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: rubygem-rake -Version: 10.3.2 +Version: 10.4.2 Release: 0 %define mod_name rake %define mod_full_name %{mod_name}-%{version} ++++++ rake-10.3.2.gem -> rake-10.4.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CONTRIBUTING.rdoc new/CONTRIBUTING.rdoc --- old/CONTRIBUTING.rdoc 2014-05-16 06:15:57.000000000 +0200 +++ new/CONTRIBUTING.rdoc 2014-12-03 08:34:56.000000000 +0100 @@ -1,9 +1,9 @@ = Source Repository Rake is currently hosted at github. The github web page is -http://github.com/jimweirich/rake . The public git clone URL is +http://github.com/ruby/rake . The public git clone URL is - git://github.com/jimweirich/rake.git + git://github.com/ruby/rake.git = Running the Rake Test Suite @@ -30,5 +30,5 @@ When submitting pull requests please check the rake Travis-CI page for test failures: - https://travis-ci.org/jimweirich/rake + https://travis-ci.org/ruby/rake diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.rdoc new/History.rdoc --- old/History.rdoc 2014-05-16 06:15:57.000000000 +0200 +++ new/History.rdoc 2014-12-03 08:34:56.000000000 +0100 @@ -1,3 +1,45 @@ +=== 10.4.2 / 2014-12-02 + +Bug fixes: + +* Rake no longer edits ARGV. This allows you to re-exec rake from a rake + task. Pull requset #9 by Matt Palmer. +* Documented how Rake::DSL#desc handles sentences in task descriptions. + Issue #7 by Raza Sayed. +* Fixed test error on 1.9.3 with legacy RubyGems. Issue #8 by Matt Palmer. +* Deleted duplicated History entry. Pull request #10 by Yuji Yamamoto. + +=== 10.4.1 / 2014-12-01 + +Bug fixes: + +* Reverted fix for #277 as it caused numerous issues for rake users. + rails/spring issue #366 by Gustavo Dutra. + +=== 10.4.0 / 2014-11-22 + +Enhancements: + +* Upgraded to minitest 5. Pull request #292 by Teo Ljungberg. +* Added support for Pathname in rake tasks. Pull request #271 by Randy + Coulman. +* Rake now ignores falsy dependencies which allows for easier programmatic + creation of tasks. Pull request #273 by Manav. +* Rake no longer edits ARGV. This allows you to re-exec rake from a rake + task. Issue #277 by Matt Palmer. +* Etc.nprocessors is used for counting the number of CPUs. + +Bug fixes: + +* Updated rake manpage. Issue #283 by Nathan Long, pull request #291 by + skittleys. +* Add Rake::LATE to allow rebuilding of files that depend on deleted files. + Bug #286, pull request #287 by David Grayson. +* Fix relinking of files when repackaging. Bug #276 by Muenze. +* Fixed some typos. Pull request #280 by Jed Northridge. +* Try counting CPUs via cpuinfo if host_os was not matched. Pull request + #282 by Edouard B. + === 10.3.2 / 2014-05-15 Bug fixes: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Manifest.txt new/Manifest.txt --- old/Manifest.txt 2014-05-16 06:15:57.000000000 +0200 +++ new/Manifest.txt 2014-12-03 08:34:56.000000000 +0100 @@ -17,7 +17,7 @@ doc/glossary.rdoc doc/jamis.rb doc/proto_rake.rdoc -doc/rake.1.gz +doc/rake.1 doc/rakefile.rdoc doc/rational.rdoc doc/release_notes/rake-0.4.14.rdoc @@ -69,6 +69,7 @@ lib/rake/early_time.rb lib/rake/ext/core.rb lib/rake/ext/module.rb +lib/rake/ext/pathname.rb lib/rake/ext/string.rb lib/rake/ext/time.rb lib/rake/file_creation_task.rb @@ -79,6 +80,7 @@ lib/rake/gempackagetask.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 @@ -133,6 +135,7 @@ 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 @@ -141,6 +144,7 @@ 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.rdoc new/README.rdoc --- old/README.rdoc 2014-05-16 06:15:57.000000000 +0200 +++ new/README.rdoc 2014-12-03 08:34:56.000000000 +0100 @@ -1,7 +1,7 @@ = RAKE -- Ruby Make -home :: https://github.com/jimweirich/rake -bugs :: https://github.com/jimweirich/rake/issues +home :: https://github.com/ruby/rake +bugs :: https://github.com/ruby/rake/issues docs :: http://docs.seattlerb.org/rake == Description @@ -86,6 +86,9 @@ 2. {Rake File Lists}[http://devblog.avdi.org/2014/04/22/rake-part-2-file-lists/] 3. {Rake Rules}[http://devblog.avdi.org/2014/04/23/rake-part-3-rules/] 4. {Rake Pathmap}[http://devblog.avdi.org/2014/04/24/rake-part-4-pathmap/] + 5. {File Operations}[http://devblog.avdi.org/2014/04/25/rake-part-5-file-operations/] + 6. {Clean and Clobber}[http://devblog.avdi.org/2014/04/28/rake-part-6-clean-and-clobber/] + 7. {MultiTask}[http://devblog.avdi.org/2014/04/29/rake-part-7-multitask/] * Jim Weirich's 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/ * Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2014-05-16 06:15:57.000000000 +0200 +++ new/Rakefile 2014-12-03 08:34:56.000000000 +0100 @@ -28,7 +28,7 @@ require_ruby_version '>= 1.8.7' require_rubygems_version '>= 1.3.2' - dependency 'minitest', '~> 4.0', :developer + dependency 'minitest', '~> 5.0', :developer license "MIT" @@ -54,7 +54,7 @@ ] end -hoe.test_prelude = 'gem "minitest", "~> 4.0"' +hoe.test_prelude = 'gem "minitest", "~> 5.0"' # Use custom rdoc task due to existence of doc directory Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/checksums.yaml.gz.sig new/checksums.yaml.gz.sig --- old/checksums.yaml.gz.sig 2014-05-16 06:15:57.000000000 +0200 +++ new/checksums.yaml.gz.sig 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -TÞ*=ØåSÃA;$k -^à÷©ÍQÞ¯ò·øý4ÇÏÜÿ]Eg¶mü {áXšôÙ£ø¿"-ôo_9#ÛÜÌCp/p|xvÝú§'ÌàBÑkC/»ŒËl,®Jp2%Û§0öÃ`0Ù®µ ßÕšX¿¶Â:¶a©î_1c¶YÃèhÕ&ét+ÿyOZµ¹Üô}ÊûÆ3LS!O7ßZŽln/þ"ä)²ÑõüDUfNºtÐ5$P¥4F öɣѡ¥ä¶<µÓÝÿ¯øñÍØ÷7Qe÷·µZA¶O \ No newline at end of file Files old/data.tar.gz.sig and new/data.tar.gz.sig differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/rake.1 new/doc/rake.1 --- old/doc/rake.1 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/rake.1 2014-12-03 08:34:56.000000000 +0100 @@ -0,0 +1,141 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH RAKE 1 "August 27, 2014" "rake 10.3.2" "Rake User Commands" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +rake \- a make-like build utility for Ruby +.SH SYNOPSIS +\fBrake\fR [\fI\-f rakefile\fR] {\fIOPTIONS\fR} \fITARGETS...\fR +.br +.SH DESCRIPTION +.B rake +is a make-like build utility for Ruby. Tasks and dependencies are specified in +standard Ruby syntax. +.SH OPTIONS +.TP +\fB\-m\fR, \fB\-\-multitask\fR +Treat all tasks as multitasks. +.TP +\fB\-B\fR, \fB\-\-build\-all\fR +Build all prerequisites, including those which are up\-to\-date. + +.TP +\fB\-j\fR, \fB\-\-jobs\fR [\fINUMBER\fR] +Specifies the maximum number of tasks to execute in parallel (default is number of CPU cores + 4). + +.SS Modules +.TP +\fB\-I\fR, \fB\-\-libdir\fR \fILIBDIR\fR +Include \fILIBDIR\fR in the search path for required modules. +.TP +\fB\-r\fR, \fB\-\-require\fR \fIMODULE\fR +Require \fIMODULE\fR before executing rakefile. + +.SS Rakefile location +.TP +\fB\-f\fR, \fB\-\-rakefile\fR [\fIFILENAME\fR] +Use \fIFILENAME\fR as the rakefile to search for. +.TP +\fB\-N\fR, \fB\-\-no\-search\fR, \fB\-\-nosearch\fR +Do not search parent directories for the Rakefile. +.TP +\fB\-G\fR, \fB\-\-no\-system\fR, \fB\-\-nosystem\fR +Use standard project Rakefile search paths, ignore system wide rakefiles. +.TP +\fB\-R\fR, \fB\-\-rakelibdir\fR \fIRAKELIBDIR\fR +Auto\-import any .rake files in \fIRAKELIBDIR\fR (default is 'rakelib') +.HP +\fB\-\-rakelib\fR +.TP +\fB\-g\fR, \fB\-\-system\fR +Using system wide (global) rakefiles (usually '\fI~/.rake/*.rake\fR'). + +.SS Debugging +.TP +\fB\-\-backtrace\fR=\fI\,[OUT]\/\fR +Enable full backtrace. \fIOUT\fR can be stderr (default) or stdout. +.TP +\fB\-t\fR, \fB\-\-trace\fR=\fI\,[OUT]\/\fR +Turn on invoke/execute tracing, enable full backtrace. \fIOUT\fR can be stderr (default) or stdout. +.TP +\fB\-\-suppress\-backtrace\fR \fIPATTERN\fR +Suppress backtrace lines matching regexp \fIPATTERN\fR. Ignored if \fI\-\-trace\fR is on. +.TP +\fB\-\-rules\fR +Trace the rules resolution. + +.TP +\fB\-n\fR, \fB\-\-dry\-run\fR +Do a dry run without executing actions. +.TP +\fB\-T\fR, \fB\-\-tasks\fR [\fIPATTERN\fR] +Display the tasks (matching optional \fIPATTERN\fR) with descriptions, then exit. +.TP +\fB\-D\fR, \fB\-\-describe\fR [\fIPATTERN\fR] +Describe the tasks (matching optional \fIPATTERN\fR), then exit. +.TP +\fB\-W\fR, \fB\-\-where\fR [\fIPATTERN\fR] +Describe the tasks (matching optional \fIPATTERN\fR), then exit. +.TP +\fB\-P\fR, \fB\-\-prereqs\fR +Display the tasks and dependencies, then exit. + +.TP +\fB\-e\fR, \fB\-\-execute\fR \fICODE\fR +Execute some Ruby code and exit. +.TP +\fB\-p\fR, \fB\-\-execute\-print\fR \fICODE\fR +Execute some Ruby code, print the result, then exit. +.TP +\fB\-E\fR, \fB\-\-execute\-continue\fR \fICODE\fR +Execute some Ruby code, then continue with normal task processing. + +.SS Information +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Log message to standard output. +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Do not log messages to standard output. +.TP +\fB\-s\fR, \fB\-\-silent\fR +Like \fB\-\-quiet\fR, but also suppresses the 'in directory' announcement. +.TP +\fB\-X\fR, \fB\-\-no\-deprecation\-warnings\fR +Disable the deprecation warnings. +.TP +\fB\-\-comments\fR +Show commented tasks only +.TP +\fB\-A\fR, \fB\-\-all\fR +Show all tasks, even uncommented ones (in combination with \fB\-T\fR or \fB\-D\fR) +.TP +\fB\-\-job\-stats\fR [\fILEVEL\fR] +Display job statistics. \fILEVEL=history\fR displays a complete job list +.TP +\fB\-V\fR, \fB\-\-version\fR +Display the program version. +.TP +\fB\-h\fR, \fB\-H\fR, \fB\-\-help\fR +Display a help message. + +.SH SEE ALSO +The complete documentation for \fBrake\fR has been installed at \fI/usr/share/doc/rake-doc/html/index.html\fR. It is also available online at \fIhttp://docs.seattlerb.org/rake\fR. +.SH AUTHOR +.B rake +was written by Jim Weirich <jim@weirichhouse.org> +.PP +This manual was created by Caitlin Matos <caitlin.matos@zoho.com> for the Debian project (but may be used by others). It was inspired by the manual by Jani Monoses <jani@iv.ro> for the Ubuntu project. Files old/doc/rake.1.gz and new/doc/rake.1.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/application.rb new/lib/rake/application.rb --- old/lib/rake/application.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/application.rb 2014-12-03 08:34:56.000000000 +0100 @@ -83,8 +83,8 @@ def init(app_name='rake') standard_exception_handling do @name = app_name - handle_options - collect_command_line_tasks + args = handle_options + collect_command_line_tasks(args) end end @@ -616,7 +616,9 @@ end private :select_trace_output - # Read and handle the command line options. + # Read and handle the command line options. Returns the command line + # arguments that we didn't understand, which should (in theory) be just + # task names and env vars. def handle_options # :nodoc: options.rakelib = ['rakelib'] options.trace_output = $stderr @@ -633,7 +635,7 @@ standard_rake_options.each { |args| opts.on(*args) } opts.environment('RAKEOPT') - end.parse! + end.parse(ARGV) end # Similar to the regular Ruby +require+ command, but will check @@ -727,9 +729,14 @@ # Collect the list of tasks on the command line. If no tasks are # given, return a list containing only the default task. # Environmental assignments are processed at this time as well. - def collect_command_line_tasks # :nodoc: + # + # `args` is the list of arguments to peruse to get the list of tasks. + # It should be the command line that was given to rake, less any + # recognised command-line options, which OptionParser.parse will + # have taken care of already. + def collect_command_line_tasks(args) # :nodoc: @top_level_tasks = [] - ARGV.each do |arg| + args.each do |arg| if arg =~ /^(\w+)=(.*)$/m ENV[$1] = $2 else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/backtrace.rb new/lib/rake/backtrace.rb --- old/lib/rake/backtrace.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/backtrace.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,6 +1,6 @@ module Rake module Backtrace # :nodoc: all - SYS_KEYS = RbConfig::CONFIG.keys.grep(/(prefix|libdir)/) + SYS_KEYS = RbConfig::CONFIG.keys.grep(/(?:[a-z]prefix|libdir)\z/) SYS_PATHS = RbConfig::CONFIG.values_at(*SYS_KEYS).uniq + [ File.join(File.dirname(__FILE__), "..") ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/cloneable.rb new/lib/rake/cloneable.rb --- old/lib/rake/cloneable.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/cloneable.rb 2014-12-03 08:34:56.000000000 +0100 @@ -3,7 +3,7 @@ # Mixin for creating easily cloned objects. module Cloneable # :nodoc: - # The hook that invoked by 'clone' and 'dup' methods. + # The hook that is invoked by 'clone' and 'dup' methods. def initialize_copy(source) super source.instance_variables.each do |var| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/contrib/.document new/lib/rake/contrib/.document --- old/lib/rake/contrib/.document 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/contrib/.document 2014-12-03 08:34:56.000000000 +0100 @@ -0,0 +1 @@ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/contrib/sshpublisher.rb new/lib/rake/contrib/sshpublisher.rb --- old/lib/rake/contrib/sshpublisher.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/contrib/sshpublisher.rb 2014-12-03 08:34:56.000000000 +0100 @@ -20,7 +20,7 @@ # Uploads the files def upload - sh %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}} + sh "scp", "-rq", "#{@local_dir}/*", "#{@host}:#{@remote_dir}" end end @@ -30,8 +30,8 @@ # Uploads the files after removing the existing remote directory. def upload - sh %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil - sh %{ssh #{@host} mkdir #{@remote_dir}} + sh "ssh", @host, "rm", "-rf", @remote_dir rescue nil + sh "ssh", @host, "mkdir", @remote_dir super end end @@ -54,7 +54,7 @@ def upload @files.each do |fn| - sh %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}} + sh "scp", "-q", "#{@local_dir}/#{fn}", "#{@host}:#{@remote_dir}" end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/cpu_counter.rb new/lib/rake/cpu_counter.rb --- old/lib/rake/cpu_counter.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/cpu_counter.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,8 +1,3 @@ -require 'rbconfig' - -# TODO: replace with IO.popen using array-style arguments in Rake 11 -require 'open3' - module Rake # Based on a script at: @@ -18,6 +13,26 @@ default end + begin + require 'etc' + rescue LoadError + else + if Etc.respond_to?(:nprocessors) + def count + return Etc.nprocessors + end + end + end + end +end + +unless Rake::CpuCounter.method_defined?(:count) + Rake::CpuCounter.class_eval <<-'end;', __FILE__, __LINE__+1 + require 'rbconfig' + + # TODO: replace with IO.popen using array-style arguments in Rake 11 + require 'open3' + def count if defined?(Java::Java) count_via_java_runtime @@ -38,7 +53,8 @@ count_via_win32 || count_via_sysctl || count_via_hwprefs_thread_count || - count_via_hwprefs_cpu_count + count_via_hwprefs_cpu_count || + count_via_cpuinfo end end end @@ -105,5 +121,5 @@ out.eof? ? nil : command end end - end + end; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/dsl_definition.rb new/lib/rake/dsl_definition.rb --- old/lib/rake/dsl_definition.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/dsl_definition.rb 2014-12-03 08:34:56.000000000 +0100 @@ -98,6 +98,7 @@ def directory(*args, &block) # :doc: result = file_create(*args, &block) dir, _ = *Rake.application.resolve_args(args) + dir = Rake.from_pathname(dir) Rake.each_dir_parent(dir) do |d| file_create d do |t| mkdir_p t.name unless File.exist?(t.name) @@ -150,7 +151,7 @@ # # Example: # rule '.o' => '.c' do |t| - # sh %{cc -o #{t.name} #{t.source}} + # sh 'cc', '-o', t.name, t.source # end # def rule(*args, &block) # :doc: @@ -158,6 +159,8 @@ end # Describes the next rake task. Duplicate descriptions are discarded. + # Descriptions are shown with <code>rake -T</code> (up to the first + # sentence) and <code>rake -D</code> (the entire description). # # Example: # desc "Run the Unit Tests" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/ext/module.rb new/lib/rake/ext/module.rb --- old/lib/rake/ext/module.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/ext/module.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1 +1,2 @@ + # TODO: remove in Rake 11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/ext/pathname.rb new/lib/rake/ext/pathname.rb --- old/lib/rake/ext/pathname.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/rake/ext/pathname.rb 2014-12-03 08:34:56.000000000 +0100 @@ -0,0 +1,25 @@ +require 'rake/ext/core' +require 'pathname' + +class Pathname + + rake_extension("ext") do + # Return a new Pathname with <tt>String#ext</tt> applied to it. + # + # This Pathname extension comes from Rake + def ext(newext='') + Pathname.new(Rake.from_pathname(self).ext(newext)) + end + end + + rake_extension("pathmap") do + # Apply the pathmap spec to the Pathname, returning a + # new Pathname with the modified paths. (See String#pathmap for + # details.) + # + # This Pathname extension comes from Rake + def pathmap(spec=nil, &block) + Pathname.new(Rake.from_pathname(self).pathmap(spec, &block)) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/ext/string.rb new/lib/rake/ext/string.rb --- old/lib/rake/ext/string.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/ext/string.rb 2014-12-03 08:34:56.000000000 +0100 @@ -49,7 +49,7 @@ end protected :pathmap_partial - # Preform the pathmap replacement operations on the given path. The + # Perform the pathmap replacement operations on the given path. The # patterns take the form 'pat1,rep1;pat2,rep2...'. # # This String extension comes from Rake diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/ext/time.rb new/lib/rake/ext/time.rb --- old/lib/rake/ext/time.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/ext/time.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,12 +1,13 @@ #-- -# Extensions to time to allow comparisons with an early time class. +# Extensions to time to allow comparisons with early and late time classes. require 'rake/early_time' +require 'rake/late_time' class Time # :nodoc: all alias rake_original_time_compare :<=> def <=>(other) - if Rake::EarlyTime === other + if Rake::EarlyTime === other || Rake::LateTime === other - other.<=>(self) else rake_original_time_compare(other) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/file_list.rb new/lib/rake/file_list.rb --- old/lib/rake/file_list.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/file_list.rb 2014-12-03 08:34:56.000000000 +0100 @@ -49,7 +49,7 @@ # List of methods that should not be delegated here (we define special # versions of them explicitly below). - MUST_NOT_DEFINE = %w[to_a to_ary partition *] + MUST_NOT_DEFINE = %w[to_a to_ary partition * <<] # List of delegated methods that return new array values which need # wrapping. @@ -119,7 +119,7 @@ if fn.respond_to? :to_ary include(*fn.to_ary) else - @pending_add << fn + @pending_add << Rake.from_pathname(fn) end end @pending = true @@ -149,7 +149,7 @@ # def exclude(*patterns, &block) patterns.each do |pat| - @exclude_patterns << pat + @exclude_patterns << Rake.from_pathname(pat) end @exclude_procs << block if block_given? resolve_exclude unless @pending @@ -196,6 +196,12 @@ end end + def <<(obj) + resolve + @items << Rake.from_pathname(obj) + self + end + # Resolve all the pending adds now. def resolve if @pending @@ -346,7 +352,7 @@ # Should the given file name be excluded from the list? # - # NOTE: This method was formally named "exclude?", but Rails + # NOTE: This method was formerly named "exclude?", but Rails # introduced an exclude? method as an array method and setup a # conflict with file list. We renamed the method to avoid # confusion. If you were using "FileList#exclude?" in your user @@ -410,5 +416,13 @@ dir = File.dirname(dir) end end + + # Convert Pathname and Pathname-like objects to strings; + # leave everything else alone + def from_pathname(path) # :nodoc: + path = path.to_path if path.respond_to?(:to_path) + path = path.to_str if path.respond_to?(:to_str) + path + end end end # module Rake diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/file_task.rb new/lib/rake/file_task.rb --- old/lib/rake/file_task.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/file_task.rb 2014-12-03 08:34:56.000000000 +0100 @@ -21,7 +21,7 @@ if File.exist?(name) File.mtime(name.to_s) else - Rake::EARLY + Rake::LATE end end @@ -39,7 +39,7 @@ # Apply the scope to the task name according to the rules for this kind # of task. File based tasks ignore the scope when creating the name. def scope_name(scope, task_name) - task_name + Rake.from_pathname(task_name) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/file_utils.rb new/lib/rake/file_utils.rb --- old/lib/rake/file_utils.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/file_utils.rb 2014-12-03 08:34:56.000000000 +0100 @@ -14,12 +14,24 @@ OPT_TABLE['sh'] = %w(noop verbose) OPT_TABLE['ruby'] = %w(noop verbose) - # Run the system command +cmd+. If multiple arguments are given the command - # is not run with the shell (same semantics as Kernel::exec and + # Run the system command +cmd+. If multiple arguments are given the command + # is run directly (without the shell, same semantics as Kernel::exec and # Kernel::system). # - # Example: - # sh %{ls -ltr} + # It is recommended you use the multiple argument form over interpolating + # user input for both usability and security reasons. With the multiple + # argument form you can easily process files with spaces or other shell + # reserved characters in them. With the multiple argument form your rake + # tasks are not vulnerable to users providing an argument like + # <code>; rm # -rf /</code>. + # + # If a block is given, upon command completion the block is called with an + # OK flag (true on a zero exit status) and a Process::Status object. + # Without a block a RuntimeError is raised when the command exits non-zero. + # + # Examples: + # + # sh 'ls -ltr' # # sh 'ls', 'file with spaces' # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/invocation_chain.rb new/lib/rake/invocation_chain.rb --- old/lib/rake/invocation_chain.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/invocation_chain.rb 2014-12-03 08:34:56.000000000 +0100 @@ -31,7 +31,7 @@ private def prefix - "#{tail.to_s} => " + "#{tail} => " end # Null object for an empty chain. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/late_time.rb new/lib/rake/late_time.rb --- old/lib/rake/late_time.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/rake/late_time.rb 2014-12-03 08:34:56.000000000 +0100 @@ -0,0 +1,17 @@ +module Rake + # LateTime is a fake timestamp that occurs _after_ any other time value. + class LateTime + include Comparable + include Singleton + + def <=>(other) + 1 + end + + def to_s + '<LATE TIME>' + end + end + + LATE = LateTime.instance +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/packagetask.rb new/lib/rake/packagetask.rb --- old/lib/rake/packagetask.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/packagetask.rb 2014-12-03 08:34:56.000000000 +0100 @@ -127,7 +127,7 @@ file "#{package_dir}/#{file}" => [package_dir_path] + package_files do chdir(package_dir) do - sh %{#{@tar_command} #{flag}cvf #{file} #{package_name}} + sh @tar_command, "#{flag}cvf", file, package_name end end end @@ -138,15 +138,12 @@ file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do chdir(package_dir) do - sh %{#{@zip_command} -r #{zip_file} #{package_name}} + sh @zip_command, "-r", zip_file, package_name end end end - directory package_dir - - file package_dir_path => @package_files do - mkdir_p package_dir rescue nil + directory package_dir_path => @package_files do @package_files.each do |fn| f = File.join(package_dir_path, fn) fdir = File.dirname(f) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake/task_manager.rb new/lib/rake/task_manager.rb --- old/lib/rake/task_manager.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake/task_manager.rb 2014-12-03 08:34:56.000000000 +0100 @@ -35,7 +35,7 @@ task_name = task_class.scope_name(@scope, task_name) deps = [deps] unless deps.respond_to?(:to_ary) - deps = deps.map { |d| d.to_s } + deps = deps.map { |d| Rake.from_pathname(d).to_s } task = intern(task_class, task_name) task.set_arg_names(arg_names) unless arg_names.empty? if Rake::TaskManager.record_task_metadata @@ -111,7 +111,7 @@ if args.empty? task_name = key arg_names = [] - deps = value + deps = value || [] else task_name = args.shift arg_names = key diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rake.rb new/lib/rake.rb --- old/lib/rake.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/lib/rake.rb 2014-12-03 08:34:56.000000000 +0100 @@ -21,7 +21,7 @@ #++ module Rake - VERSION = '10.3.2' + VERSION = '10.4.2' end require 'rake/version' @@ -63,6 +63,7 @@ require 'rake/file_list' require 'rake/default_loader' require 'rake/early_time' +require 'rake/late_time' require 'rake/name_space' require 'rake/task_manager' require 'rake/application' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2014-05-16 06:15:57.000000000 +0200 +++ new/metadata 2014-12-03 08:34:56.000000000 +0100 @@ -1,36 +1,15 @@ --- !ruby/object:Gem::Specification name: rake version: !ruby/object:Gem::Version - version: 10.3.2 + version: 10.4.2 platform: ruby authors: - Eric Hodel - Jim Weirich autorequire: bindir: bin -cert_chain: -- | - -----BEGIN CERTIFICATE----- - MIIDNjCCAh6gAwIBAgIBAjANBgkqhkiG9w0BAQUFADBBMRAwDgYDVQQDDAdkcmJy - YWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZFgNu - ZXQwHhcNMTQwMzI0MjEwNTQ1WhcNMTUwMzI0MjEwNTQ1WjBBMRAwDgYDVQQDDAdk - cmJyYWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZ - FgNuZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbbgLrGLGIDE76 - LV/cvxdEzCuYuS3oG9PrSZnuDweySUfdp/so0cDq+j8bqy6OzZSw07gdjwFMSd6J - U5ddZCVywn5nnAQ+Ui7jMW54CYt5/H6f2US6U0hQOjJR6cpfiymgxGdfyTiVcvTm - Gj/okWrQl0NjYOYBpDi+9PPmaH2RmLJu0dB/NylsDnW5j6yN1BEI8MfJRR+HRKZY - mUtgzBwF1V4KIZQ8EuL6I/nHVu07i6IkrpAgxpXUfdJQJi0oZAqXurAV3yTxkFwd - g62YrrW26mDe+pZBzR6bpLE+PmXCzz7UxUq3AE0gPHbiMXie3EFE0oxnsU3lIduh - sCANiQ8BAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW - BBS5k4Z75VSpdM0AclG2UvzFA/VW5DANBgkqhkiG9w0BAQUFAAOCAQEACQFPYbmk - P51YZtd2sTMJkwhMs3RtLy+MqFpITMoPUjK1gvPw6NyzotvW0WkiU3KXIOem4l8s - lDqWPIGobRf+Hvzp92hX/CEDGOSMbVBzuLZ4NAQftpvF91FE8KYCvrO+Nj8ei2X/ - +R7biySvcvWhCsIuBawVW6RxZdxaEHVZrbTX9cqGTAfnWhOIpsGJ/vNOofu1jIrw - dAwolOAbVCvXy7lPI7oFtVzGu18RT7NW6Q4frd28V0Qs4shmW+ckdlneSzN1hVft - pfkQPF5Ezsi73pEpFN93Fy21NKCYQH1jCwWeKUF29MIMGd6kE3ZmHW/7fz5GwKIM - Ls5SgY48a0l7Hw== - -----END CERTIFICATE----- -date: 2014-05-16 00:00:00.000000000 Z +cert_chain: [] +date: 2014-12-03 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: minitest @@ -38,14 +17,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: '5.2' + version: '5.4' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '5.2' + version: '5.4' - !ruby/object:Gem::Dependency name: rdoc requirement: !ruby/object:Gem::Requirement @@ -66,14 +45,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: '3.7' + version: '3.13' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '3.7' + version: '3.13' description: |- Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax. @@ -165,7 +144,7 @@ - doc/glossary.rdoc - doc/jamis.rb - doc/proto_rake.rdoc -- doc/rake.1.gz +- doc/rake.1 - doc/rakefile.rdoc - doc/rational.rdoc - doc/release_notes/rake-0.4.14.rdoc @@ -217,6 +196,7 @@ - lib/rake/early_time.rb - lib/rake/ext/core.rb - lib/rake/ext/module.rb +- lib/rake/ext/pathname.rb - lib/rake/ext/string.rb - lib/rake/ext/time.rb - lib/rake/file_creation_task.rb @@ -227,6 +207,7 @@ - lib/rake/gempackagetask.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 @@ -281,6 +262,7 @@ - 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 @@ -289,6 +271,7 @@ - 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 @@ -308,7 +291,7 @@ - test/test_rake_win32.rb - test/test_thread_history_display.rb - test/test_trace_output.rb -homepage: https://github.com/jimweirich/rake +homepage: https://github.com/ruby/rake licenses: - MIT metadata: {} @@ -329,8 +312,8 @@ - !ruby/object:Gem::Version version: 1.3.2 requirements: [] -rubyforge_project: rake -rubygems_version: 2.2.2 +rubyforge_project: +rubygems_version: 2.4.2 signing_key: specification_version: 4 summary: Rake is a Make-like program implemented in Ruby @@ -355,6 +338,7 @@ - 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 @@ -363,6 +347,7 @@ - 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 Files old/metadata.gz.sig and new/metadata.gz.sig differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/helper.rb new/test/helper.rb --- old/test/helper.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/helper.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,7 +1,10 @@ require 'rubygems' $:.unshift File.expand_path('../../lib', __FILE__) -gem 'minitest', '~> 4' +begin + gem 'minitest', '~> 5' +rescue Gem::LoadError +end require 'minitest/autorun' require 'rake' @@ -19,7 +22,7 @@ require 'test/support/rakefile_definitions' end -class Rake::TestCase < MiniTest::Unit::TestCase +class Rake::TestCase < Minitest::Test include FileCreation include Rake::DSL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/support/rakefile_definitions.rb new/test/support/rakefile_definitions.rb --- old/test/support/rakefile_definitions.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/support/rakefile_definitions.rb 2014-12-03 08:34:56.000000000 +0100 @@ -460,7 +460,7 @@ TEST_TASK open 'a_test.rb', 'w' do |io| io << "require 'minitest/autorun'\n" - io << "class ExitTaskTest < MiniTest::Unit::TestCase\n" + io << "class ExitTaskTest < Minitest::Test\n" io << " def test_exit\n" io << " assert false, 'this should fail'\n" io << " end\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/support/ruby_runner.rb new/test/support/ruby_runner.rb --- old/test/support/ruby_runner.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/support/ruby_runner.rb 2014-12-03 08:34:56.000000000 +0100 @@ -18,12 +18,13 @@ def run_ruby(option_list) puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose - inn, out, err, wait = Open3.popen3(RUBY, *option_list) - inn.close + Open3.popen3(RUBY, *option_list) {|inn, out, err, wait| + inn.close - @exit = wait ? wait.value : $? - @out = out.read - @err = err.read + @exit = wait ? wait.value : $? + @out = out.read + @err = err.read + } puts "OUTPUT: [#{@out}]" if @verbose puts "ERROR: [#{@err}]" if @verbose diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_application.rb new/test/test_rake_application.rb --- old/test/test_rake_application.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_application.rb 2014-12-03 08:34:56.000000000 +0100 @@ -17,8 +17,10 @@ end def test_display_exception_details + obj = Object.new + obj.instance_eval("def #{__method__}; raise 'test'; end", "ruby") begin - raise 'test' + obj.__send__(__method__) rescue => ex end @@ -368,7 +370,7 @@ # HACK no assertions end - def test_handle_options_should_strip_options_from_argv + def test_handle_options_should_not_strip_options_from_argv assert !@app.options.trace valid_option = '--trace' @@ -376,7 +378,7 @@ @app.handle_options - assert !ARGV.include?(valid_option) + assert ARGV.include?(valid_option) assert @app.options.trace end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_application_options.rb new/test/test_rake_application_options.rb --- old/test/test_rake_application_options.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_application_options.rb 2014-12-03 08:34:56.000000000 +0100 @@ -457,8 +457,8 @@ throw :system_exit, :exit end @app.instance_eval do - handle_options - collect_command_line_tasks + args = handle_options + collect_command_line_tasks(args) end @tasks = @app.top_level_tasks @app.options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_backtrace.rb new/test/test_rake_backtrace.rb --- old/test/test_rake_backtrace.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_backtrace.rb 2014-12-03 08:34:56.000000000 +0100 @@ -42,7 +42,7 @@ super skip 'tmpdir is suppressed in backtrace' if - Dir.pwd =~ Rake::Backtrace::SUPPRESS_PATTERN + Rake::Backtrace::SUPPRESS_PATTERN =~ Dir.pwd end def invoke(*args) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_clean.rb new/test/test_rake_clean.rb --- old/test/test_rake_clean.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_clean.rb 2014-12-03 08:34:56.000000000 +0100 @@ -41,7 +41,13 @@ FileUtils.touch(file_name) FileUtils.chmod(0, file_name) FileUtils.chmod(0, dir_name) - file_name + begin + FileUtils.chmod(0644, file_name) + rescue + file_name + else + skip "Permission to delete files is different on thie system" + end end def remove_undeletable_file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_cpu_counter.rb new/test/test_rake_cpu_counter.rb --- old/test/test_rake_cpu_counter.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_cpu_counter.rb 2014-12-03 08:34:56.000000000 +0100 @@ -8,43 +8,61 @@ @cpu_counter = Rake::CpuCounter.new end - def test_count_via_win32 - if Rake::Win32.windows? then - assert_kind_of Numeric, @cpu_counter.count_via_win32 - else - assert_nil @cpu_counter.count_via_win32 - end + def test_count + num = @cpu_counter.count + skip 'cannot count CPU' if num == nil + assert_kind_of Numeric, num + assert_operator num, :>=, 1 end - def test_in_path_command - with_ruby_in_path do |ruby| - assert_equal ruby, @cpu_counter.in_path_command(ruby) - end - rescue Errno::ENOENT => e - raise unless e.message =~ /\bwhich\b/ + def test_count_with_default_nil + def @cpu_counter.count; nil; end + assert_equal(8, @cpu_counter.count_with_default(8)) + assert_equal(4, @cpu_counter.count_with_default) + end - skip 'cannot find which for this test' + def test_count_with_default_raise + def @cpu_counter.count; raise; end + assert_equal(8, @cpu_counter.count_with_default(8)) + assert_equal(4, @cpu_counter.count_with_default) end - def test_run - with_ruby_in_path do |ruby| - assert_equal 7, @cpu_counter.run(ruby, '-e', 'puts 3 + 4') + class TestClassMethod < Rake::TestCase + def setup + super + + @klass = Class.new(Rake::CpuCounter) end - end - def with_ruby_in_path - ruby = File.basename Gem.ruby - ruby_dir = File.dirname Gem.ruby - - begin - orig_path, ENV['PATH'] = - ENV['PATH'], [ruby_dir, *ENV['PATH']].join(File::PATH_SEPARATOR) - - yield ruby - ensure - ENV['PATH'] = orig_path + def test_count + @klass.class_eval do + def count; 8; end + end + assert_equal(8, @klass.count) end - end -end + def test_count_nil + counted = false + @klass.class_eval do + define_method(:count) do + counted = true + nil + end + end + assert_equal(4, @klass.count) + assert_equal(true, counted) + end + def test_count_raise + counted = false + @klass.class_eval do + define_method(:count) do + counted = true + raise + end + end + assert_equal(4, @klass.count) + assert_equal(true, counted) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_definitions.rb new/test/test_rake_definitions.rb --- old/test/test_rake_definitions.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_definitions.rb 2014-12-03 08:34:56.000000000 +0100 @@ -59,6 +59,11 @@ assert_raises(RuntimeError) { Task[:x].invoke } end + def test_falsey_dependencies + task :x => nil + assert_equal [], Task[:x].prerequisites + end + def test_implicit_file_dependencies runs = [] create_existing_file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_directory_task.rb new/test/test_rake_directory_task.rb --- old/test/test_rake_directory_task.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_directory_task.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,5 +1,6 @@ require File.expand_path('../helper', __FILE__) require 'fileutils' +require 'pathname' class TestRakeDirectoryTask < Rake::TestCase include Rake @@ -60,4 +61,16 @@ assert_equal ["t2", "a/b/c"], runlist assert File.directory?("a/b/c") end + + def test_can_use_pathname + directory Pathname.new "a/b/c" + + assert_equal FileCreationTask, Task["a/b/c"].class + + verbose(false) { + Task['a/b/c'].invoke + } + + assert File.directory?("a/b/c") + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_file_list.rb new/test/test_rake_file_list.rb --- old/test/test_rake_file_list.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_file_list.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,4 +1,5 @@ require File.expand_path('../helper', __FILE__) +require 'pathname' class TestRakeFileList < Rake::TestCase FileList = Rake::FileList @@ -46,6 +47,12 @@ fl.sort end + def test_create_with_pathname + fl = FileList.new(Pathname.new("*.c")) + assert_equal ["abc.c", "x.c", "xyz.c"].sort, + fl.sort + end + def test_create_with_block fl = FileList.new { |f| f.include("x") } assert_equal ["x"], fl.resolve @@ -74,12 +81,24 @@ fl.sort end + def test_include_with_pathname + fl = FileList.new.include(Pathname.new("*.c")) + assert_equal ["abc.c", "x.c", "xyz.c"].sort, + fl.sort + end + def test_append fl = FileList.new fl << "a.rb" << "b.rb" assert_equal ['a.rb', 'b.rb'], fl end + def test_append_pathname + fl = FileList.new + fl << Pathname.new("a.rb") + assert_equal ['a.rb'], fl + end + def test_add_many fl = FileList.new fl.include %w(a d c) @@ -163,6 +182,15 @@ assert_equal [], fl end + def test_exclude_pathname + fl = FileList['x.c', 'abc.c', 'other'] + fl.each { |fn| touch fn, :verbose => false } + + fl.exclude(Pathname.new('*.c')) + + assert_equal ['other'], fl + end + def test_excluding_via_block fl = FileList['a.c', 'b.c', 'xyz.c'] fl.exclude { |fn| fn.pathmap('%n') == 'xyz' } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_file_task.rb new/test/test_rake_file_task.rb --- old/test/test_rake_file_task.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_file_task.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,5 +1,6 @@ require File.expand_path('../helper', __FILE__) require 'fileutils' +require 'pathname' class TestRakeFileTask < Rake::TestCase include Rake @@ -23,6 +24,7 @@ File.delete(ftask.name) rescue nil assert ftask.needed?, "file should be needed" + assert_equal Rake::LATE, ftask.timestamp open(ftask.name, "w") { |f| f.puts "HI" } @@ -83,19 +85,14 @@ end def test_existing_file_depends_on_non_existing_file - @ran = false - create_file(OLDFILE) delete_file(NEWFILE) - file NEWFILE do - @ran = true - end - - file OLDFILE => NEWFILE + file NEWFILE do |t| @runs << t.name end + file OLDFILE => NEWFILE do |t| @runs << t.name end Task[OLDFILE].invoke - assert @ran + assert_equal [NEWFILE, OLDFILE], @runs end def test_needed_eh_build_all @@ -162,6 +159,20 @@ assert_equal ["preqA", "preqB"], t.sources end + def test_task_can_be_pathname + name = "dummy" + file Pathname.new name + + ftask = Task[name] + + assert_equal name.to_s, ftask.name + end + + def test_prerequisite_can_be_pathname + t = file :f => Pathname.new("preq") + assert_equal "preq", t.source + end + # I have currently disabled this test. I'm not convinced that # deleting the file target on failure is always the proper thing to # do. I'm willing to hear input on this topic. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_late_time.rb new/test/test_rake_late_time.rb --- old/test/test_rake_late_time.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/test/test_rake_late_time.rb 2014-12-03 08:34:56.000000000 +0100 @@ -0,0 +1,18 @@ +require File.expand_path('../helper', __FILE__) + +class TestRakeLateTime < Rake::TestCase + def test_late_time_comparisons + late = Rake::LATE + assert_equal late, late + assert late >= Time.now + assert late > Time.now + assert late != Time.now + assert Time.now < late + assert Time.now <= late + assert Time.now != late + end + + def test_to_s + assert_equal '<LATE TIME>', Rake::LATE.to_s + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_multi_task.rb new/test/test_rake_multi_task.rb --- old/test/test_rake_multi_task.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_multi_task.rb 2014-12-03 08:34:56.000000000 +0100 @@ -13,6 +13,12 @@ @mutex = Mutex.new end + def teardown + Rake.application.thread_pool.join + + super + end + def add_run(obj) @mutex.synchronize do @runs << obj diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_pathname_extensions.rb new/test/test_rake_pathname_extensions.rb --- old/test/test_rake_pathname_extensions.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/test/test_rake_pathname_extensions.rb 2014-12-03 08:34:56.000000000 +0100 @@ -0,0 +1,15 @@ +require File.expand_path('../helper', __FILE__) +require 'rake/ext/pathname' + +class TestRakePathnameExtensions < Rake::TestCase + def test_ext_works_on_pathnames + pathname = Pathname.new("abc.foo") + assert_equal Pathname.new("abc.bar"), pathname.ext("bar") + end + + def test_path_map_works_on_pathnames + pathname = Pathname.new("this/is/a/dir/abc.rb") + assert_equal Pathname.new("abc.rb"), pathname.pathmap("%f") + assert_equal Pathname.new("this/is/a/dir"), pathname.pathmap("%d") + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_task.rb new/test/test_rake_task.rb --- old/test/test_rake_task.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_task.rb 2014-12-03 08:34:56.000000000 +0100 @@ -13,6 +13,7 @@ def teardown Rake::TaskManager.record_task_metadata = false + Rake.application.thread_pool.join super end @@ -270,7 +271,7 @@ result = [] t_a = task(:a) do |t| - sleep 0.02 + sleep 0.2 mx.synchronize { result << t.name } end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_task_argument_parsing.rb new/test/test_rake_task_argument_parsing.rb --- old/test/test_rake_task_argument_parsing.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_task_argument_parsing.rb 2014-12-03 08:34:56.000000000 +0100 @@ -49,6 +49,16 @@ assert_equal ["one", "two", "three_a, three_b", "four"], args end + def test_treat_blank_arg_as_empty_string + name, args = @app.parse_task_string("name[one,]") + assert_equal "name", name + assert_equal ["one", ""], args + + name, args = @app.parse_task_string("name[one,,two]") + assert_equal "name", name + assert_equal ["one", "", "two"], args + end + def test_terminal_width_using_env app = Rake::Application.new app.terminal_columns = 1234 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_task_with_arguments.rb new/test/test_rake_task_with_arguments.rb --- old/test/test_rake_task_with_arguments.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_task_with_arguments.rb 2014-12-03 08:34:56.000000000 +0100 @@ -12,6 +12,7 @@ def teardown Rake::TaskManager.record_task_metadata = false + Rake.application.thread_pool.join super end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_test_task.rb new/test/test_rake_test_task.rb --- old/test/test_rake_test_task.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_test_task.rb 2014-12-03 08:34:56.000000000 +0100 @@ -97,17 +97,22 @@ 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' - rake, Gem.loaded_specs['rake'] = Gem.loaded_specs['rake'], default_spec + begin + rake, Gem.loaded_specs['rake'] = Gem.loaded_specs['rake'], default_spec - test_task = Rake::TestTask.new do |t| - t.loader = :rake - end + test_task = Rake::TestTask.new do |t| + t.loader = :rake + end - assert_match(/\A ".*?"\Z/, test_task.run_code) - ensure - Gem.loaded_specs['rake'] = rake + assert_match(/\A(-I".*?" *)* ".*?"\Z/, test_task.run_code) + ensure + Gem.loaded_specs['rake'] = rake + end end def test_run_code_testrb_ruby_1_8_2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_rake_thread_pool.rb new/test/test_rake_thread_pool.rb --- old/test/test_rake_thread_pool.rb 2014-05-16 06:15:57.000000000 +0200 +++ new/test/test_rake_thread_pool.rb 2014-12-03 08:34:56.000000000 +0100 @@ -1,6 +1,5 @@ require File.expand_path('../helper', __FILE__) require 'rake/thread_pool' -require 'test/unit/assertions' class TestRakeTestThreadPool < Rake::TestCase include Rake @@ -33,6 +32,8 @@ refute_equal threads[0], threads[1] refute_equal Thread.current, threads[0] refute_equal Thread.current, threads[1] + ensure + pool.join end def test_pool_creates_the_correct_number_of_threads @@ -95,6 +96,8 @@ assert_raises(CustomError) do pool.future(2, &deep_exception_block).value end + ensure + pool.join end def test_pool_prevents_deadlock