Class: ORS

Inherits:
Object
  • Object
show all
Defined in:
lib/ors/base.rb,
lib/ors/config.rb,
lib/ors/helpers.rb,
lib/ors/version.rb,
lib/ors/log_unifier.rb,
lib/ors/commands/env.rb,
lib/ors/commands/base.rb,
lib/ors/commands/exec.rb,
lib/ors/commands/help.rb,
lib/ors/commands/logs.rb,
lib/ors/commands/ruby.rb,
lib/ors/commands/stop.rb,
lib/ors/commands/setup.rb,
lib/ors/commands/start.rb,
lib/ors/commands/deploy.rb,
lib/ors/commands/runner.rb,
lib/ors/commands/update.rb,
lib/ors/commands/changes.rb,
lib/ors/commands/console.rb,
lib/ors/commands/migrate.rb,
lib/ors/commands/restart.rb,
lib/ors/commands/symlink.rb,
lib/ors/commands/timestamps.rb

Defined Under Namespace

Modules: Commands, Helpers Classes: Config, LogUnifier

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.config(options = []) ⇒ Object



2
3
4
# File 'lib/ors/base.rb', line 2

def self.config(options = [])
  @config ||= ORS::Config.new(options)
end

Instance Method Details

#run(args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ors/base.rb', line 6

def run args
  command, *options = args
  klass_string = command.to_s.capitalize

  # setup initial config
  ORS.config(options)

  # determine command to use
  if command =~ /-*version/i
    puts "ORS v#{ORS::VERSION}"
  else
    if available_commands.include? klass_string
      ORS::Commands.const_get(klass_string).run
    else
      ORS::Commands::Help.run
    end
  end
end