class Ludwig::CLI
Public Instance Methods
run()
click to toggle source
# File lib/ludwig/cli.rb, line 7 def run program :version, Ludwig::VERSION program :description, 'Ludwig, the famous composer' @config_file = 'ludwig.yml' global_option('-d', '--debug', 'Enable debug mode') { $debug = true } global_option('-c', '--config filename', String, 'Set config filename') { |config_file| @config_file = config_file } command :compose do |c| c.syntax = 'ludwig compose [options]' c.summary = 'Generate docker-compose.yml' c.action do |args, options| generate_compose_file end end command :up do |c| c.syntax = 'ludwig up [options]' c.summary = 'Generate docker-compose.yml and launch docker-compose' c.action do |args, options| generate_compose_file system 'docker-compose up' end end run! end
Private Instance Methods
config()
click to toggle source
# File lib/ludwig/cli.rb, line 38 def config @config ||= YAML.load_file @config_file end
generate_compose_file()
click to toggle source
# File lib/ludwig/cli.rb, line 42 def generate_compose_file Ludwig::Composer.new(config).write_yaml end