diff --git a/lib/rscons.rb b/lib/rscons.rb index 79da761..061c97c 100644 --- a/lib/rscons.rb +++ b/lib/rscons.rb @@ -1,5 +1,2 @@ require "rscons/version" - -module Rscons - # Your code goes here... -end +require "rscons/environment" diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb new file mode 100644 index 0000000..41c8e56 --- /dev/null +++ b/lib/rscons/environment.rb @@ -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