Class: Noveku::Core

Inherits:
Object
  • Object
show all
Includes:
Config, Console, Exceptions, Migrate, Mongo, Proxy, Rake, Tail
Defined in:
lib/noveku/core.rb

Overview

Common functionnality

Constant Summary

Constants included from Mongo

Mongo::MONGOHQ_KEY, Mongo::MONGOLAB_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mongo

#mongo_dump, #mongodump_cmd, #mongohq_dump_cmd, #mongolab_dump_cmd

Methods included from Tail

#tail_cmd, #tail_cmd_str

Methods included from Proxy

#method_missing, #proxy_cmd_str, #respond_to_missing?

Methods included from Migrate

#migrate_cmd, #migrate_cmd_args

Methods included from Console

#console_cmd, #console_cmd_str

Methods included from Rake

#rake_cmd, #rake_cmd_str

Methods included from Config

#config_value_for, #config_value_str

Constructor Details

#initialize(*arguments) ⇒ Core

Keep track of the given commands



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/noveku/core.rb', line 27

def initialize(*arguments)
  @environment = arguments.shift

  ensure_env
  ensure_heroku_app

  @command     = arguments.shift
  @arguments   = arguments
rescue Exception => e
  handle_exception(e)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Noveku::Proxy

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



24
25
26
# File 'lib/noveku/core.rb', line 24

def arguments
  @arguments
end

#commandObject (readonly)

Returns the value of attribute command.



24
25
26
# File 'lib/noveku/core.rb', line 24

def command
  @command
end

#environmentObject (readonly)

Returns the value of attribute environment.



24
25
26
# File 'lib/noveku/core.rb', line 24

def environment
  @environment
end

Instance Method Details

#callObject

Run the commands



40
41
42
# File 'lib/noveku/core.rb', line 40

def call
  send "#{@command}_cmd"
end