Class: SyntaxTree::CLI::Options
- Inherits:
-
Object
- Object
- SyntaxTree::CLI::Options
- Defined in:
- lib/syntax_tree/cli.rb
Overview
This represents all of the options that can be passed to the CLI. It is responsible for parsing the list and then returning the file paths at the end.
Instance Attribute Summary collapse
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#ignore_files ⇒ Object
readonly
Returns the value of attribute ignore_files.
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
-
#print_width ⇒ Object
readonly
Returns the value of attribute print_width.
-
#scripts ⇒ Object
readonly
Returns the value of attribute scripts.
-
#target_ruby_version ⇒ Object
readonly
Returns the value of attribute target_ruby_version.
Instance Method Summary collapse
- #formatter_options ⇒ Object
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #parse(arguments) ⇒ Object
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
491 492 493 494 495 496 497 498 |
# File 'lib/syntax_tree/cli.rb', line 491 def initialize @ignore_files = [] @plugins = [] @print_width = DEFAULT_PRINT_WIDTH @scripts = [] @extension = ".rb" @target_ruby_version = DEFAULT_RUBY_VERSION end |
Instance Attribute Details
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
484 485 486 |
# File 'lib/syntax_tree/cli.rb', line 484 def extension @extension end |
#ignore_files ⇒ Object (readonly)
Returns the value of attribute ignore_files.
484 485 486 |
# File 'lib/syntax_tree/cli.rb', line 484 def ignore_files @ignore_files end |
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins.
484 485 486 |
# File 'lib/syntax_tree/cli.rb', line 484 def plugins @plugins end |
#print_width ⇒ Object (readonly)
Returns the value of attribute print_width.
484 485 486 |
# File 'lib/syntax_tree/cli.rb', line 484 def print_width @print_width end |
#scripts ⇒ Object (readonly)
Returns the value of attribute scripts.
484 485 486 |
# File 'lib/syntax_tree/cli.rb', line 484 def scripts @scripts end |
#target_ruby_version ⇒ Object (readonly)
Returns the value of attribute target_ruby_version.
484 485 486 |
# File 'lib/syntax_tree/cli.rb', line 484 def target_ruby_version @target_ruby_version end |
Instance Method Details
#formatter_options ⇒ Object
500 501 502 503 |
# File 'lib/syntax_tree/cli.rb', line 500 def @formatter_options ||= Formatter::Options.new(target_ruby_version: target_ruby_version) end |
#parse(arguments) ⇒ Object
505 506 507 |
# File 'lib/syntax_tree/cli.rb', line 505 def parse(arguments) parser.parse!(arguments) end |