namespace :cms do namespace :license do desc "Check if a license file is valid (options: FILE=/path/to/license.xml, default: currently installed license)" task :check => :environment do RailsConnector::Configuration.license_file = ENV['FILE'] puts "Checking license #{RailsConnector::Configuration.license_file}" begin Obj.root.fetch_attr_values puts "OK, license is valid." exit 0 rescue RailsConnector::InvalidLicenseError => e puts e exit 1 end end end end