mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* lib/rake*: Updated to rake 0.9.4
http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for a list of changes in 0.9.4. * test/rake*: ditto * NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									e9c28d0fce
								
							
						
					
					
						commit
						1b023030a8
					
				
					 13 changed files with 90 additions and 28 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,11 @@
 | 
			
		|||
Fri Nov 16 07:23:18 2012  Eric Hodel  <drbrain@segment7.net>
 | 
			
		||||
 | 
			
		||||
	* lib/rake*:  Updated to rake 0.9.4
 | 
			
		||||
	  http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for
 | 
			
		||||
	  a list of changes in 0.9.4.
 | 
			
		||||
	* test/rake*:  ditto
 | 
			
		||||
	* NEWS:  ditto
 | 
			
		||||
 | 
			
		||||
Fri Nov 16 06:58:52 2012  Eric Hodel  <drbrain@segment7.net>
 | 
			
		||||
 | 
			
		||||
	* lib/rake*:  Updated to rake 0.9.3.  See
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										10
									
								
								NEWS
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								NEWS
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -182,12 +182,14 @@ with all sufficient information, see the ChangeLog file.
 | 
			
		|||
    * Pathname#find returns an enumerator if no block is given.
 | 
			
		||||
 | 
			
		||||
* rake
 | 
			
		||||
  * rake has been updated to version 0.9.3.
 | 
			
		||||
  * rake has been updated to version 0.9.4.
 | 
			
		||||
 | 
			
		||||
    This version is backwards-compatible with previous rake versions and
 | 
			
		||||
    contains many bug fixes.  See
 | 
			
		||||
    http://rake.rubyforge.org/doc/release_notes/rake-0_9_3_rdoc.html for a list
 | 
			
		||||
    of changes in rake 0.9.3
 | 
			
		||||
    contains many bug fixes.
 | 
			
		||||
 | 
			
		||||
    See
 | 
			
		||||
    http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for a list
 | 
			
		||||
    of changes in rake 0.9.3 and 0.9.4.
 | 
			
		||||
 | 
			
		||||
* resolv
 | 
			
		||||
  * new methods:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@ require 'shellwords'
 | 
			
		|||
require 'optparse'
 | 
			
		||||
 | 
			
		||||
require 'rake/task_manager'
 | 
			
		||||
require 'rake/file_list'
 | 
			
		||||
require 'rake/thread_pool'
 | 
			
		||||
require 'rake/thread_history_display'
 | 
			
		||||
require 'rake/win32'
 | 
			
		||||
| 
						 | 
				
			
			@ -204,7 +205,7 @@ module Rake
 | 
			
		|||
    def have_rakefile
 | 
			
		||||
      @rakefiles.each do |fn|
 | 
			
		||||
        if File.exist?(fn)
 | 
			
		||||
          others = Rake.glob(fn, File::FNM_CASEFOLD)
 | 
			
		||||
          others = FileList.glob(fn, File::FNM_CASEFOLD)
 | 
			
		||||
          return others.size == 1 ? others.first : fn
 | 
			
		||||
        elsif fn == ''
 | 
			
		||||
          return fn
 | 
			
		||||
| 
						 | 
				
			
			@ -609,7 +610,7 @@ module Rake
 | 
			
		|||
    end
 | 
			
		||||
 | 
			
		||||
    def glob(path, &block)
 | 
			
		||||
      Rake.glob(path.gsub("\\", '/')).each(&block)
 | 
			
		||||
      FileList.glob(path.gsub("\\", '/')).each(&block)
 | 
			
		||||
    end
 | 
			
		||||
    private :glob
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,6 +5,7 @@
 | 
			
		|||
 | 
			
		||||
require 'date'
 | 
			
		||||
require 'net/ftp'
 | 
			
		||||
require 'rake/file_list'
 | 
			
		||||
 | 
			
		||||
module Rake # :nodoc:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -127,8 +128,7 @@ module Rake # :nodoc:
 | 
			
		|||
    # Upload all files matching +wildcard+ to the uploader's root
 | 
			
		||||
    # path.
 | 
			
		||||
    def upload_files(wildcard)
 | 
			
		||||
      fail "OUCH"
 | 
			
		||||
      Rake.glob(wildcard).each do |fn|
 | 
			
		||||
      FileList.glob(wildcard).each do |fn|
 | 
			
		||||
        upload(fn)
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,6 +10,7 @@ begin
 | 
			
		|||
rescue LoadError
 | 
			
		||||
end
 | 
			
		||||
require 'rbconfig'
 | 
			
		||||
require 'rake/file_list'
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# Sys provides a number of file manipulation tools for the convenience
 | 
			
		||||
| 
						 | 
				
			
			@ -27,7 +28,7 @@ module Sys
 | 
			
		|||
  # Install all the files matching +wildcard+ into the +dest_dir+
 | 
			
		||||
  # directory.  The permission mode is set to +mode+.
 | 
			
		||||
  def install(wildcard, dest_dir, mode)
 | 
			
		||||
    Rake.glob(wildcard).each do |fn|
 | 
			
		||||
    FileList.glob(wildcard).each do |fn|
 | 
			
		||||
      File.install(fn, dest_dir, mode, $verbose)
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
| 
						 | 
				
			
			@ -81,7 +82,7 @@ module Sys
 | 
			
		|||
  # recursively delete directories.
 | 
			
		||||
  def delete(*wildcards)
 | 
			
		||||
    wildcards.each do |wildcard|
 | 
			
		||||
      Rake.glob(wildcard).each do |fn|
 | 
			
		||||
      FileList.glob(wildcard).each do |fn|
 | 
			
		||||
        if File.directory?(fn)
 | 
			
		||||
          log "Deleting directory #{fn}"
 | 
			
		||||
          Dir.delete(fn)
 | 
			
		||||
| 
						 | 
				
			
			@ -96,10 +97,10 @@ module Sys
 | 
			
		|||
  # Recursively delete all files and directories matching +wildcard+.
 | 
			
		||||
  def delete_all(*wildcards)
 | 
			
		||||
    wildcards.each do |wildcard|
 | 
			
		||||
      Rake.glob(wildcard).each do |fn|
 | 
			
		||||
      FileList.glob(wildcard).each do |fn|
 | 
			
		||||
        next if ! File.exist?(fn)
 | 
			
		||||
        if File.directory?(fn)
 | 
			
		||||
          Rake.glob("#{fn}/*").each do |subfn|
 | 
			
		||||
          FileList.glob("#{fn}/*").each do |subfn|
 | 
			
		||||
            next if subfn=='.' || subfn=='..'
 | 
			
		||||
            delete_all(subfn)
 | 
			
		||||
          end
 | 
			
		||||
| 
						 | 
				
			
			@ -161,7 +162,7 @@ module Sys
 | 
			
		|||
  # Perform a block with each file matching a set of wildcards.
 | 
			
		||||
  def for_files(*wildcards)
 | 
			
		||||
    wildcards.each do |wildcard|
 | 
			
		||||
      Rake.glob(wildcard).each do |fn|
 | 
			
		||||
      FileList.glob(wildcard).each do |fn|
 | 
			
		||||
        yield(fn)
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			@ -172,7 +173,7 @@ module Sys
 | 
			
		|||
  private # ----------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
  def for_matching_files(wildcard, dest_dir)
 | 
			
		||||
    Rake.glob(wildcard).each do |fn|
 | 
			
		||||
    FileList.glob(wildcard).each do |fn|
 | 
			
		||||
      dest_file = File.join(dest_dir, fn)
 | 
			
		||||
      parent = File.dirname(dest_file)
 | 
			
		||||
      makedirs(parent) if ! File.directory?(parent)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -340,7 +340,7 @@ module Rake
 | 
			
		|||
 | 
			
		||||
    # Add matching glob patterns.
 | 
			
		||||
    def add_matching(pattern)
 | 
			
		||||
      Rake.glob(pattern).each do |fn|
 | 
			
		||||
      FileList.glob(pattern).each do |fn|
 | 
			
		||||
        self << fn unless exclude?(fn)
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			@ -383,6 +383,13 @@ module Rake
 | 
			
		|||
      def [](*args)
 | 
			
		||||
        new(*args)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      # Get a sorted list of files matching the pattern. This method
 | 
			
		||||
      # should be prefered to Dir[pattern] and Dir.glob[pattern] because
 | 
			
		||||
      # the files returned are guaranteed to be sorted.
 | 
			
		||||
      def glob(pattern, *args)
 | 
			
		||||
        Dir.glob(pattern, *args).sort
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,6 +8,8 @@ require 'rake'
 | 
			
		|||
 | 
			
		||||
task :phony
 | 
			
		||||
 | 
			
		||||
def (Rake::Task[:phony]).timestamp
 | 
			
		||||
  Time.at 0
 | 
			
		||||
Rake::Task[:phony].tap do |task|
 | 
			
		||||
  def task.timestamp # :nodoc:
 | 
			
		||||
    Time.at 0
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,13 +32,6 @@ module Rake
 | 
			
		|||
        application.options.rakelib << file
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # Get a sorted list of files matching the pattern. This method
 | 
			
		||||
    # should be prefered to Dir[pattern] and Dir.glob[pattern] because
 | 
			
		||||
    # the files returned are guaranteed to be sorted.
 | 
			
		||||
    def glob(pattern, *args)
 | 
			
		||||
      Dir.glob(pattern, *args).sort
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +1,12 @@
 | 
			
		|||
require 'test/unit'
 | 
			
		||||
require 'test/unit/assertions'
 | 
			
		||||
require 'rake/file_list'
 | 
			
		||||
 | 
			
		||||
module Rake
 | 
			
		||||
  include Test::Unit::Assertions
 | 
			
		||||
 | 
			
		||||
  def run_tests(pattern='test/test*.rb', log_enabled=false)
 | 
			
		||||
    Rake.glob(pattern).each { |fn|
 | 
			
		||||
    FileList.glob(pattern).each { |fn|
 | 
			
		||||
      $stderr.puts fn if log_enabled
 | 
			
		||||
      begin
 | 
			
		||||
        require fn
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -96,9 +96,12 @@ module Rake
 | 
			
		|||
      desc "Run tests" + (@name==:test ? "" : " for #{@name}")
 | 
			
		||||
      task @name do
 | 
			
		||||
        FileUtilsExt.verbose(@verbose) do
 | 
			
		||||
          ruby "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}" do |ok, status|
 | 
			
		||||
          args = "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}"
 | 
			
		||||
          ruby args do |ok, status|
 | 
			
		||||
            if !ok && status.respond_to?(:signaled?) && status.signaled?
 | 
			
		||||
              raise SignalException.new(status.termsig)
 | 
			
		||||
            elsif !ok
 | 
			
		||||
              fail "Command failed with status (#{status.exitstatus}): [ruby #{args}]"
 | 
			
		||||
            end
 | 
			
		||||
          end
 | 
			
		||||
        end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ module Rake
 | 
			
		|||
    NUMBERS = [
 | 
			
		||||
      MAJOR = 0,
 | 
			
		||||
      MINOR = 9,
 | 
			
		||||
      BUILD = 3,
 | 
			
		||||
      BUILD = 4,
 | 
			
		||||
    ]
 | 
			
		||||
  end
 | 
			
		||||
  VERSION = Version::NUMBERS.join('.')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -519,4 +519,31 @@ task :default => :test
 | 
			
		|||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def rakefile_failing_test_task
 | 
			
		||||
    rakefile <<-TEST_TASK
 | 
			
		||||
require 'rake/testtask'
 | 
			
		||||
 | 
			
		||||
task :default => :test
 | 
			
		||||
Rake::TestTask.new(:test) do |t|
 | 
			
		||||
  t.test_files = ['a_test.rb']
 | 
			
		||||
end
 | 
			
		||||
    TEST_TASK
 | 
			
		||||
    open 'a_test.rb', 'w' do |io|
 | 
			
		||||
      io << "require 'minitest/autorun'\n"
 | 
			
		||||
      io << "class ExitTaskTest < MiniTest::Unit::TestCase\n"
 | 
			
		||||
      io << "  def test_exit\n"
 | 
			
		||||
      io << "    assert false, 'this should fail'\n"
 | 
			
		||||
      io << "  end\n"
 | 
			
		||||
      io << "end\n"
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def rakefile_stand_alone_filelist
 | 
			
		||||
    open 'stand_alone_filelist.rb', 'w' do |io|
 | 
			
		||||
      io << "require 'rake/file_list'\n"
 | 
			
		||||
      io << "FL = Rake::FileList['*.rb']\n"
 | 
			
		||||
      io << "puts FL\n"
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -439,6 +439,21 @@ class TestRakeFunctional < Rake::TestCase
 | 
			
		|||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_failing_test_sets_exit_status
 | 
			
		||||
    rakefile_failing_test_task
 | 
			
		||||
    rake
 | 
			
		||||
    assert_equal 1, @exit.exitstatus
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_stand_alone_filelist
 | 
			
		||||
    rakefile_stand_alone_filelist
 | 
			
		||||
 | 
			
		||||
    run_ruby @ruby_options + ["stand_alone_filelist.rb"]
 | 
			
		||||
 | 
			
		||||
    assert_match(/^stand_alone_filelist\.rb$/, @out)
 | 
			
		||||
    assert_equal 0, @exit.exitstatus
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
  # Run a shell Ruby command with command line options (using the
 | 
			
		||||
| 
						 | 
				
			
			@ -458,14 +473,16 @@ class TestRakeFunctional < Rake::TestCase
 | 
			
		|||
  def run_ruby(option_list)
 | 
			
		||||
    puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
 | 
			
		||||
 | 
			
		||||
    inn, out, err = Open3.popen3(Gem.ruby, *option_list)
 | 
			
		||||
    inn, out, err, wait = Open3.popen3(Gem.ruby, *option_list)
 | 
			
		||||
    inn.close
 | 
			
		||||
 | 
			
		||||
    @out = out.read
 | 
			
		||||
    @err = err.read
 | 
			
		||||
    @exit = wait.value
 | 
			
		||||
 | 
			
		||||
    puts "OUTPUT:  [#{@out}]" if @verbose
 | 
			
		||||
    puts "ERROR:   [#{@err}]" if @verbose
 | 
			
		||||
    puts "EXIT:    [#{@exit.inspect}]" if @verbose
 | 
			
		||||
    puts "PWD:     [#{Dir.pwd}]" if @verbose
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue