Sha256: 77724a8c969845146f49697b0ed7dec7266d39f2af78589db0ca14f30258e8c5
Contents?: true
Size: 973 Bytes
Versions: 17
Compression:
Stored size: 973 Bytes
Contents
module Flydata module Command class Base def initialize @api_client = ApiClient.instance end def flydata; @api_client end def retrieve_data_entries data_entries = flydata.get('/data_entries') unless flydata.response.code == 200 raise "Failed to retrieve data_entries" end data_entries end def register_crontab data_entries = retrieve_data_entries if data_entries.any?{|e| e['log_deletion']} Flydata::Command::Crontab.new.run end end # print console def newline; puts end def ask_yes_no(message) loop do ans = ask("#{message} (yes/no): ") if ans.size > 0 case ans[0].downcase when 'y'; return true when 'n'; return false end end say(" ! Please answer y[es] or n[o]") newline end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems