lib/ctioga2/commands/variables.rb in ctioga2-0.2 vs lib/ctioga2/commands/variables.rb in ctioga2-0.3
- old
+ new
@@ -14,11 +14,11 @@
require 'ctioga2/utils'
require 'ctioga2/commands/strings'
module CTioga2
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
+ Version::register_svn_info('$Revision$', '$Date$')
module Commands
class RecursiveExpansion < Exception
end
@@ -30,11 +30,10 @@
# syntax, just like in make.
#
# There are two kind of variables
# * immediate, defined by
# variable := value
- # or
# These ones are evaluated for once when they are defined.
# They are stored in the form of a String
# * recursively expanded variables. They are mostly like immediate
# variables, excepted that the values of the replacement texts
# for variables used within are expanded at the moment the
@@ -55,13 +54,14 @@
def initialize
@variables = {}
end
# Sets a the variable _name_ to _value_ (being an
- # InterpreterString or a String). If _interpreter_ is given, the
- # value is expanded at the time of the definition, (immediate
- # variable), whereas if it stays _nil_, the variable is defined
- # as a recursively defined variable.
+ # InterpreterString or a String). In the former case
+ # (InterpreterString), if _interpreter_ is given, the value is
+ # expanded at the time of the definition, (immediate variable),
+ # whereas if it stays _nil_, the variable is defined as a
+ # recursively defined variable.
def define_variable(name, value, interpreter = nil)
if value.respond_to? :expand_to_string
if interpreter
value = value.expand_to_string(interpreter)
end