Sha256: 8cbe978c80dffe3a84e1cdb8e944bbba832fc7e460c47489d82bf671f394a94e

Contents?: true

Size: 883 Bytes

Versions: 6

Compression:

Stored size: 883 Bytes

Contents

require 'citrin'
require 'citrin/helpers'
require 'citrin/app'
require 'citrin/commands'

class Citrin::CLI
  extend Citrin::Helpers

  def self.start(*args)
    command = args.shift.strip rescue "help"
    Citrin::Commands.load
    name = args[0]
    env = args[1]
    app = Citrin::App.new(name, env)
    case command
    when "create_database"
      return Commands::CreateDatabase.run(app)
    when "create_webserver"
      return Commands::CreateWebserver.run(app)
    when "setup_logrotate"
      return Commands::SetupLogrotate.run(app)
    when "write_config"
      `cp #{File.dirname(__FILE__)}/../../etc/citrin.yml /etc/citrin.yml`
    else
      begin
        puts `#{File.dirname(__FILE__)}/../../commands/#{command} #{args.join(" ")}`
      rescue
        help
      end
    end
  end

  def self.help
    puts `#{File.dirname(__FILE__)}/../../commands/help`
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
citrin-0.1.6 lib/citrin/cli.rb
citrin-0.1.5 lib/citrin/cli.rb
citrin-0.1.4 lib/citrin/cli.rb
citrin-0.1.3 lib/citrin/cli.rb
citrin-0.1.2 lib/citrin/cli.rb
citrin-0.1.1 lib/citrin/cli.rb