Class: CmdCreator
- Inherits:
-
Object
show all
- Defined in:
- lib/cmd_creator.rb
Defined Under Namespace
Classes: NotMandatoryError, Spec, SpecParser, SubSpecParser
Constant Summary
collapse
- MandatoryStart =
"<"
- MandatoryStop =
">"
- OptionalStart =
"["
- OptionalStop =
"]"
- Argument =
"%"
Instance Method Summary
collapse
Instance Method Details
#args(cmd_args = {}) ⇒ Object
184
185
186
|
# File 'lib/cmd_creator.rb', line 184
def args(cmd_args = {})
@args = cmd_args
end
|
#cmd ⇒ Object
188
189
190
191
|
# File 'lib/cmd_creator.rb', line 188
def cmd
sp = SpecParser.new(@spec.split(""), @args)
sp.parse.flatten.join("").strip
end
|
#spec(cmd_spec) ⇒ Object
180
181
182
|
# File 'lib/cmd_creator.rb', line 180
def spec(cmd_spec)
@spec = cmd_spec
end
|