Class: Localeapp::CLI::Update
- Defined in:
- lib/localeapp/cli/update.rb
Instance Attribute Summary collapse
-
#poller ⇒ Object
Returns the value of attribute poller.
Instance Method Summary collapse
Methods inherited from Command
#initialize, #initialize_config, #load_config_file, #set_command_line_arguments
Constructor Details
This class inherits a constructor from Localeapp::CLI::Command
Instance Attribute Details
#poller ⇒ Object
Returns the value of attribute poller.
4 5 6 |
# File 'lib/localeapp/cli/update.rb', line 4 def poller @poller end |
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/localeapp/cli/update.rb', line 6 def execute self.poller = Localeapp::Poller.new if @output.puts("Timestamp is missing or too old. Please run `localeapp pull` first.") else @output.puts("Localeapp update: checking for translations since #{poller.updated_at}") success = poller.poll! @output.puts(success ? "Found and updated new translations" : "No new translations") end end |