Class: Cult::CLI::ConsoleContext
- Inherits:
-
ProjectContext
- Object
- ProjectContext
- Cult::CLI::ConsoleContext
- Defined in:
- lib/cult/cli/console_cmd.rb
Instance Attribute Summary collapse
-
#original_argv ⇒ Object
Returns the value of attribute original_argv.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #cult(*argv) ⇒ Object
-
#initialize(project, argv) ⇒ ConsoleContext
constructor
A new instance of ConsoleContext.
- #load_rc ⇒ Object
- #path ⇒ Object
Methods inherited from ProjectContext
Constructor Details
#initialize(project, argv) ⇒ ConsoleContext
Returns a new instance of ConsoleContext.
15 16 17 18 19 20 21 |
# File 'lib/cult/cli/console_cmd.rb', line 15 def initialize(project, argv) @project = project # super(project) @original_argv = [$0, *argv] ENV['CULT_PROJECT'] = self.path end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Cult::ProjectContext
Instance Attribute Details
#original_argv ⇒ Object
Returns the value of attribute original_argv.
12 13 14 |
# File 'lib/cult/cli/console_cmd.rb', line 12 def original_argv @original_argv end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
14 15 16 |
# File 'lib/cult/cli/console_cmd.rb', line 14 def project @project end |
Instance Method Details
#cult(*argv) ⇒ Object
40 41 42 |
# File 'lib/cult/cli/console_cmd.rb', line 40 def cult(*argv) system $0, *argv end |
#load_rc ⇒ Object
27 28 29 30 31 32 |
# File 'lib/cult/cli/console_cmd.rb', line 27 def load_rc consolerc = project.location_of(".cultconsolerc") # We don't `load' so the rc file has a more convenient context. eval File.read(consolerc) if File.exist?(consolerc) end |
#path ⇒ Object
23 24 25 |
# File 'lib/cult/cli/console_cmd.rb', line 23 def path project.path end |