Sha256: 4f7b78dc61afdb5d1310693c77e533448c1c069e5a0fc1996add60d4c2287d06
Contents?: true
Size: 767 Bytes
Versions: 25
Compression:
Stored size: 767 Bytes
Contents
module Localeapp module CLI class Update < Command attr_accessor :poller def execute self.poller = Localeapp::Poller.new if timestamp_too_old? @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 protected def timestamp_too_old? poller.updated_at < six_months_ago end def six_months_ago Time.now.to_i - 15552000 # This is 6.months.to_i according to ActiveRecord end end end end
Version data entries
25 entries across 25 versions & 1 rubygems