Skip to content

Commit

Permalink
Merge commit 'rake-0.9.2'
Browse files Browse the repository at this point in the history
Conflicts:
	lib/rake/version.rb
  • Loading branch information
quix committed Jul 31, 2011
2 parents a05c318 + b2a8487 commit 4d1cdcd
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 17 deletions.
2 changes: 1 addition & 1 deletion doc/rakefile.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ each other.

For example:

namespace "main"
namespace "main" do
task :build do
# Build the main program
end
Expand Down
49 changes: 49 additions & 0 deletions doc/release_notes/rake-0.9.2.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
= Rake 0.9.2 Released

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

== What is Rake

Rake is a build tool similar to the make program in many ways. But
instead of cryptic make recipes, Rake uses standard Ruby code to
declare tasks and dependencies. You have the full power of a modern
scripting language built right into your build tool.

== Availability

The easiest way to get and install rake is via RubyGems ...

gem install rake (you may need root/admin privileges)

Otherwise, you can get it from the more traditional places:

Home Page:: http://rake.rubyforge.org/
Download:: http://rubyforge.org/project/showfiles.php?group_id=50
GitHub:: git://github.com/jimweirich/rake.git

== 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
27 changes: 16 additions & 11 deletions lib/rake/dsl_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,23 @@ def import(*fns)
end

module DeprecatedObjectDSL
dsl = Object.new.extend DSL
Commands = Object.new.extend DSL
DSL.private_instance_methods(false).each do |name|
define_method name do |*args, &block|
unless @rake_dsl_warning
$stderr.puts "WARNING: Global access to Rake DSL methods is deprecated. Please Include"
$stderr.puts " ... Rake::DSL into classes and modules which use the Rake DSL methods."
@rake_dsl_warning = true
end
$stderr.puts "WARNING: DSL method #{self.class}##{name} called at #{caller.first}"
dsl.send(name, *args, &block)
end
private name
line = __LINE__+1
class_eval %{
def #{name}(*args, &block)
unless Rake.application.options.ignore_deprecate
unless @rake_dsl_warning
$stderr.puts "WARNING: Global access to Rake DSL methods is deprecated. Please include"
$stderr.puts " ... Rake::DSL into classes and modules which use the Rake DSL methods."
@rake_dsl_warning = true
end
$stderr.puts "WARNING: DSL method \#{self.class}##{name} called at \#{caller.first}"
end
Rake::DeprecatedObjectDSL::Commands.send(:#{name}, *args, &block)
end
private :#{name}
}, __FILE__, line
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/rake/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module Version
NUMBERS = [
MAJOR = 0,
MINOR = 9,
BUILD = 1,
BUILD = 2,
DRAKE_MAJOR = 0,
DRAKE_MINOR = 3,
DRAKE_BUILD = 0,
DRAKE_BUILD = 1,
]
end
VERSION = Version::NUMBERS.join('.')
Expand Down
1 change: 1 addition & 0 deletions test/data/extra/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
task :default
File renamed without changes.
20 changes: 20 additions & 0 deletions test/test_rake_dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

class TestRakeDsl < Rake::TestCase

def setup
super
Rake::Task.clear
end

def test_namespace_command
namespace "n" do
task "t"
Expand Down Expand Up @@ -50,4 +55,19 @@ def test_deprecated_object_dsl
assert_match(/Foo\#file/, err)
assert_match(/test_rake_dsl\.rb:\d+/, err)
end

def test_deprecated_object_dsl_with_suppressed_warnings
Rake.application.options.ignore_deprecate = true
out, err = capture_io do
Foo.new
Rake.application.invoke_task :foo_deprecated_a
end
assert_equal("ba", out)
refute_match(/deprecated/, err)
refute_match(/Foo\#task/, err)
refute_match(/Foo\#file/, err)
refute_match(/test_rake_dsl\.rb:\d+/, err)
ensure
Rake.application.options.ignore_deprecate = false
end
end
6 changes: 3 additions & 3 deletions test/test_rake_functional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def test_system_excludes_rakelib_files_too
end

def test_by_default_rakelib_files_are_included
in_environment('RAKE_SYSTEM' => 'test/data/sys') do
rake '-T', 'extra'
in_environment('RAKE_SYSTEM' => 'test/data/sys', "PWD" => 'test/data/extra') do
rake '-T', 'extra', '--trace'
end
assert_match %r{extra:extra}, @out
end
Expand All @@ -145,7 +145,7 @@ def test_implicit_system
end

def test_no_system
in_environment('RAKE_SYSTEM' => 'test/data/sys') do
in_environment('RAKE_SYSTEM' => 'test/data/sys', "PWD" => "test/data/extra") do
rake '-G', "sys1"
end
assert_match %r{^Don't know how to build task}, @err # emacs wart: '
Expand Down

0 comments on commit 4d1cdcd

Please sign in to comment.