Class: Clamshell::CLI
- Inherits:
-
Thor
- Object
- Thor
- Clamshell::CLI
- Defined in:
- lib/clamshell/cli.rb
Instance Method Summary collapse
- #convert(file) ⇒ Object
- #convert_string(string) ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
Instance Method Details
#convert(file) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/clamshell/cli.rb', line 14 def convert(file) check_file(file) file_out = Clamshell.settings[:shell_out] if file_out File.open(file_out, "w") {|f| f.write(Dsl.build(file) + "\n") } else puts Dsl.build(file) end end |
#convert_string(string) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/clamshell/cli.rb', line 27 def convert_string(string) input = <<-I Environment.setup do #{string} end I puts instance_eval(input).inspect end |