Class: Tr4n5l4te::Runner
- Inherits:
-
Object
- Object
- Tr4n5l4te::Runner
- Defined in:
- lib/tr4n5l4te/runner.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
17 18 19 20 |
# File 'lib/tr4n5l4te/runner.rb', line 17 def initialize @options = collect_args validate_args end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
11 12 13 |
# File 'lib/tr4n5l4te/runner.rb', line 11 def count @count end |
#logger ⇒ Object
Returns the value of attribute logger.
11 12 13 |
# File 'lib/tr4n5l4te/runner.rb', line 11 def logger @logger end |
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/tr4n5l4te/runner.rb', line 11 def @options end |
Class Method Details
.instance ⇒ Object
13 14 15 |
# File 'lib/tr4n5l4te/runner.rb', line 13 def self.instance @instance ||= new end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/tr4n5l4te/runner.rb', line 22 def run start_time = Time.now log_identifier(start_time) @count = 0 # configure Tr4n5l4te.configure do |config| config.timeout = [:timeout] end hash = YAML.load_file([:yaml_file]) translated = process(hash) store_translation(replace_lang_key(translated)) puts("Processed #{@count} strings in [#{Time.now - start_time}] seconds.".yellow) end |