Class: OptionsParser::ScriptOptions
- Inherits:
-
Object
- Object
- OptionsParser::ScriptOptions
- Defined in:
- lib/obfuskit/options_parser.rb
Instance Attribute Summary collapse
-
#dot_env_file_path ⇒ Object
Returns the value of attribute dot_env_file_path.
-
#env_var_keys ⇒ Object
Returns the value of attribute env_var_keys.
-
#keep_annotation ⇒ Object
Returns the value of attribute keep_annotation.
-
#output_language ⇒ Object
Returns the value of attribute output_language.
-
#output_type_name ⇒ Object
Returns the value of attribute output_type_name.
-
#package_name ⇒ Object
Returns the value of attribute package_name.
Instance Method Summary collapse
- #define_options(parser) ⇒ Object
-
#initialize ⇒ ScriptOptions
constructor
A new instance of ScriptOptions.
Constructor Details
#initialize ⇒ ScriptOptions
Returns a new instance of ScriptOptions.
9 10 11 12 13 14 15 16 |
# File 'lib/obfuskit/options_parser.rb', line 9 def initialize self.output_language = nil self.env_var_keys = [] self.package_name = nil self.output_type_name = "ObfusKit" self.dot_env_file_path = ".env" self.keep_annotation = nil end |
Instance Attribute Details
#dot_env_file_path ⇒ Object
Returns the value of attribute dot_env_file_path.
7 8 9 |
# File 'lib/obfuskit/options_parser.rb', line 7 def dot_env_file_path @dot_env_file_path end |
#env_var_keys ⇒ Object
Returns the value of attribute env_var_keys.
7 8 9 |
# File 'lib/obfuskit/options_parser.rb', line 7 def env_var_keys @env_var_keys end |
#keep_annotation ⇒ Object
Returns the value of attribute keep_annotation.
7 8 9 |
# File 'lib/obfuskit/options_parser.rb', line 7 def keep_annotation @keep_annotation end |
#output_language ⇒ Object
Returns the value of attribute output_language.
7 8 9 |
# File 'lib/obfuskit/options_parser.rb', line 7 def output_language @output_language end |
#output_type_name ⇒ Object
Returns the value of attribute output_type_name.
7 8 9 |
# File 'lib/obfuskit/options_parser.rb', line 7 def output_type_name @output_type_name end |
#package_name ⇒ Object
Returns the value of attribute package_name.
7 8 9 |
# File 'lib/obfuskit/options_parser.rb', line 7 def package_name @package_name end |
Instance Method Details
#define_options(parser) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/obfuskit/options_parser.rb', line 18 def (parser) parser. = "Usage: obfuskit [options]" parser.separator "" parser.separator "Specific options:" # add additional options output_language_option(parser) env_var_keys_option(parser) package_name_option(parser) output_type_name_option(parser) (parser) (parser) parser.separator "" parser.separator "Common options:" # No argument, shows at tail. This will print an options summary. # Try it and see! parser.on_tail("-h", "--help", "Show this message") do puts parser exit end # Another typical switch to print the version. parser.on_tail("-v", "--version", "Show version") do puts Obfuskit::VERSION exit end end |