Class: CSVPlusPlus::CLI
- Inherits:
-
Object
- Object
- CSVPlusPlus::CLI
- Extended by:
- T::Sig
- Defined in:
- lib/csv_plus_plus/cli.rb
Overview
Handle running the application with the supported CLIFlags
Instance Attribute Summary collapse
-
#options ⇒ Options
The parsed CLI options.
-
#source_code ⇒ Object
Returns the value of attribute source_code.
Class Method Summary collapse
-
.launch_compiler! ⇒ CLI
Handle CLI flags and launch the compiler.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
Initialize and parse the CLI flags provided to the program.
-
#main ⇒ Object
Compile the given template using the given CLI flags.
Constructor Details
#initialize ⇒ CLI
Initialize and parse the CLI flags provided to the program
30 31 32 33 34 35 |
# File 'lib/csv_plus_plus/cli.rb', line 30 def initialize opts = @source_code = ::T.let(::CSVPlusPlus::SourceCode.new(source_code_filename), ::CSVPlusPlus::SourceCode) @options = ::T.let((opts), ::CSVPlusPlus::Options::Options) end |
Instance Attribute Details
#options ⇒ Options
The parsed CLI options
8 9 10 |
# File 'lib/csv_plus_plus/cli.rb', line 8 def @options end |
#source_code ⇒ Object
Returns the value of attribute source_code.
15 16 17 |
# File 'lib/csv_plus_plus/cli.rb', line 15 def source_code @source_code end |
Class Method Details
.launch_compiler! ⇒ CLI
Handle CLI flags and launch the compiler
21 22 23 24 25 26 |
# File 'lib/csv_plus_plus/cli.rb', line 21 def self.launch_compiler! new.main rescue ::StandardError => e warn(e.) exit(1) end |
Instance Method Details
#main ⇒ Object
Compile the given template using the given CLI flags
39 40 41 |
# File 'lib/csv_plus_plus/cli.rb', line 39 def main ::CSVPlusPlus.cli_compile(source_code, ) end |