add initial Environment class

This commit is contained in:
Josh Holtrop 2013-06-30 18:06:28 -04:00
parent 4152cfd1ea
commit 1e559fa3ca
2 changed files with 30 additions and 4 deletions

View File

@ -1,5 +1,2 @@
require "rscons/version"
module Rscons
# Your code goes here...
end
require "rscons/environment"

29
lib/rscons/environment.rb Normal file
View 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