Class: Localeapp::CLI::Update

Inherits:
Object
  • Object
show all
Defined in:
lib/localeapp/cli/update.rb

Instance Method Summary collapse

Constructor Details

#initialize(output = $stdout) ⇒ Update

Returns a new instance of Update.



4
5
6
# File 'lib/localeapp/cli/update.rb', line 4

def initialize(output = $stdout)
  @output = output
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
# File 'lib/localeapp/cli/update.rb', line 8

def execute
  poller = Localeapp::Poller.new
  @output.puts("Localeapp update: checking for translations since #{poller.updated_at}")
  if poller.poll!
    @output.puts "Found and updated new translations"
  else
    @output.puts "No new translations"
  end
end