Class: Haml::I18n::Extractor::CLI
- Inherits:
-
Object
- Object
- Haml::I18n::Extractor::CLI
- Defined in:
- lib/haml-i18n-extractor/cli.rb
Defined Under Namespace
Classes: CliError
Instance Method Summary collapse
-
#initialize(opts) ⇒ CLI
constructor
A new instance of CLI.
- #start ⇒ Object
Constructor Details
#initialize(opts) ⇒ CLI
Returns a new instance of CLI.
6 7 8 9 |
# File 'lib/haml-i18n-extractor/cli.rb', line 6 def initialize(opts) = opts || {} @prompter = Haml::I18n::Extractor::Prompter.new # may as well end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/haml-i18n-extractor/cli.rb', line 11 def start check_interactive_or_not_passed if [:path] check_interactive_or_not_passed pth = File.([:path]) if File.directory?(pth) workflow = Haml::I18n::Extractor::Workflow.new(pth, ) workflow.run elsif File.exists?(pth) && [:interactive] extractor = Haml::I18n::Extractor.new(pth, :type => :overwrite, :interactive => true) extractor.run elsif File.exists?(pth) && [:non_interactive] extractor = Haml::I18n::Extractor.new(pth, :type => :overwrite, :interactive => false) extractor.run end end end |