Class: Textlint::Cli
- Inherits:
-
Object
- Object
- Textlint::Cli
- Defined in:
- lib/textlint/cli.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ stdio: false, paths: [] }.freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Cli
constructor
A new instance of Cli.
-
#run ⇒ void
Run textlint-ruby.
Constructor Details
#initialize(argv) ⇒ Cli
Returns a new instance of Cli.
20 21 22 23 |
# File 'lib/textlint/cli.rb', line 20 def initialize(argv) @options = DEFAULT_OPTIONS.dup (argv) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/textlint/cli.rb', line 7 def @options end |
Class Method Details
.run(argv) ⇒ Object
15 16 17 |
# File 'lib/textlint/cli.rb', line 15 def self.run(argv) new(argv).run end |
Instance Method Details
#run ⇒ void
This method returns an undefined value.
Run textlint-ruby
28 29 30 31 32 33 34 |
# File 'lib/textlint/cli.rb', line 28 def run if @options[:stdio] run_stdio_server else run_file_parser end end |