namespace :x1_sat_support do
desc 'Fetch public key from Sat service and store it' task :update_keys do config_file = File.exists?("config") ? "config/x1_sat_support.yml" : "x1_sat_support.yml" raise "Config file is not found. Pleas run 'rake x1_sat_support:generate_config'" unless File.exists?(config_file) X1SatSupport::Client.new(YAML.load(File.read(config_file))).update_keys end desc 'Generate config file' task :generate_config do config_file = File.exists?("config") ? "config/x1_sat_support.yml" : "x1_sat_support.yml" File.write(config_file, File.read("#{File.expand_path("../../templates", __FILE__)}/x1_sat_support.yml")) end
end