add initial Environment class
This commit is contained in:
parent
4152cfd1ea
commit
1e559fa3ca
@ -1,5 +1,2 @@
|
|||||||
require "rscons/version"
|
require "rscons/version"
|
||||||
|
require "rscons/environment"
|
||||||
module Rscons
|
|
||||||
# Your code goes here...
|
|
||||||
end
|
|
||||||
|
29
lib/rscons/environment.rb
Normal file
29
lib/rscons/environment.rb
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
module Rscons
|
||||||
|
class Environment
|
||||||
|
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
|
||||||
|
# === Arguments
|
||||||
|
# +variables+ _Hash_ ::
|
||||||
|
# the variables hash can contain both construction variables, which are
|
||||||
|
# uppercase strings (such as "CC" or "LDFLAGS"), and rscons options,
|
||||||
|
# which are lowercase symbols (such as :echo).
|
||||||
|
def initialize(variables = {})
|
||||||
|
@variables = variables
|
||||||
|
end
|
||||||
|
|
||||||
|
def process
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user