Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated Sprouts to support Rake 0.9.7 release - which hid the DSL fea…

…tures from the Global scope
  • Loading branch information...
commit 2ac3877067d928aaa2c833ecfa45ce5cb9db0d1c 1 parent c3b869b
@lukebayes authored
Showing with 23 additions and 1 deletion.
  1. +1 −1  VERSION
  2. +1 −0  lib/sprout.rb
  3. +21 −0 lib/sprout/executable/base.rb
View
2  VERSION
@@ -1 +1 @@
-1.1.11.pre
+1.1.12.pre
View
1  lib/sprout.rb
@@ -4,6 +4,7 @@
# External tools and std libs:
require 'rake'
+require 'rake/dsl'
require 'delegate'
require 'logger'
View
21 lib/sprout/executable/base.rb
@@ -75,6 +75,25 @@ def static_default_value_collection
@static_default_value_collection ||= []
end
+ ##
+ # A collection of parameters that we should allow
+ # executables to clobber, even if they already exist.
+ #
+ # One should be able to add to this list if
+ # you have parameters that you'd like to clobber
+ # in an Executable base class.
+ #
+ # When Rake 0.9.x was released, they added these
+ # fields (and more) to global which caused failing
+ # tests in this project and FlashSDK.
+ def clobberable_params
+ @clobberable_params ||= {
+ :directory => true,
+ :namespace => true,
+ :file => true,
+ }
+ end
+
def set key, value
set_default_value key, value
end
@@ -83,6 +102,8 @@ def set key, value
def accessor_can_be_defined_at name
if(instance_defines? name)
+ # Do not explode if the parameter name is "clobberable":
+ return if clobberable_params[name]
message = "add_param called with a name that is already in use (#{name}=) on (#{self})"
raise Sprout::Errors::DuplicateMemberError.new(message)
end
Please sign in to comment.
Something went wrong with that request. Please try again.