use default Environment.new, check block_given?() from initialize()
This commit is contained in:
parent
25f0d4e36a
commit
bbdd6e930f
@ -4,19 +4,6 @@ module Rscons
|
|||||||
class Environment
|
class Environment
|
||||||
attr_reader :builders
|
attr_reader :builders
|
||||||
|
|
||||||
class << self
|
|
||||||
alias_method :orig_new, :new
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.new(*args)
|
|
||||||
e = Environment.orig_new(*args)
|
|
||||||
if block_given?
|
|
||||||
yield e
|
|
||||||
e.process
|
|
||||||
end
|
|
||||||
e
|
|
||||||
end
|
|
||||||
|
|
||||||
# Initialize a newly constructed Environment object
|
# Initialize a newly constructed Environment object
|
||||||
# === Arguments
|
# === Arguments
|
||||||
# +variables+ _Hash_ ::
|
# +variables+ _Hash_ ::
|
||||||
@ -40,6 +27,11 @@ module Rscons
|
|||||||
add_builder(builder)
|
add_builder(builder)
|
||||||
end
|
end
|
||||||
@variables[:echo] ||= :command
|
@variables[:echo] ||= :command
|
||||||
|
|
||||||
|
if block_given?
|
||||||
|
yield self
|
||||||
|
self.process
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_builder(builder)
|
def add_builder(builder)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user