class Gladys::Help
def self.message
def self.message scripts_documentation puts "\n" puts "See: https://github.com/heroku/gladys for more information or to contribute." end
def self.script_example_command(script)
def self.script_example_command(script) if script.option_sets.any? "gladys prepare #{script.script_name} --database-url <database-url> --option-set <option-set>" else "gladys prepare #{script.script_name} --database-url <database-url>" end end
def self.script_option_set_documentation(script)
def self.script_option_set_documentation(script) return unless script.option_sets.any? puts "\n" puts "Available option-sets:" script.option_sets.each do |option_set| puts " #{option_set.name}:\t#{option_set.describe}\n" end end
def self.scripts_documentation
def self.scripts_documentation puts "The following scripts are available:" Gladys::Script.all.each do |script| puts "\n[#{script.name}]" puts script.describe script_option_set_documentation(script) puts "\nThis script can be run with the following command:" puts "\n\t$ #{script_example_command(script)}" end end