Class: YamlRefResolver::CLI
- Inherits:
-
Object
- Object
- YamlRefResolver::CLI
- Defined in:
- lib/yaml_ref_resolver/cli.rb
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run(argv) ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
7 8 9 10 11 12 13 14 |
# File 'lib/yaml_ref_resolver/cli.rb', line 7 def initialize @opt = OptionParser.new @input = nil @output = nil @watch = false end |
Instance Method Details
#run(argv) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/yaml_ref_resolver/cli.rb', line 16 def run(argv) @opt.parse!(argv) validate_input_path resolve_and_dump if @watch FileWatcher.new(resolver.files).watch do |filename| resolver.reload(File.(filename)) resolve_and_dump end end end |