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.
16 17 18 19 |
# File 'lib/tr4n5l4te/runner.rb', line 16 def initialize @options = collect_args validate_args end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
10 11 12 |
# File 'lib/tr4n5l4te/runner.rb', line 10 def count @count end |
#logger ⇒ Object
Returns the value of attribute logger.
10 11 12 |
# File 'lib/tr4n5l4te/runner.rb', line 10 def logger @logger end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/tr4n5l4te/runner.rb', line 10 def @options end |
Class Method Details
.instance ⇒ Object
12 13 14 |
# File 'lib/tr4n5l4te/runner.rb', line 12 def self.instance @instance ||= new end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/tr4n5l4te/runner.rb', line 21 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(translated) puts("Processed #{@count} strings in [#{Time.now - start_time}] seconds.".yellow) end |