add initial Environment class

This commit is contained in:
josh committed 2013-06-30 18:06:28 -04:00
1 parent 4152cfd1ea
commit 1e559fa3ca
2 files changed
+30 -4

No files matched your search

+1 -4
View File
@@ -1,5 +1,2 @@
require "rscons/version"
module Rscons
# Your code goes here...
end
require "rscons/environment"
+29
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