Class: Conjure::Command

Inherits:
Thor
  • Object
show all
Defined in:
lib/conjure/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Command

Returns a new instance of Command.



6
7
8
9
# File 'lib/conjure/command.rb', line 6

def initialize(*args)
  super
  Log.level = :debug if options[:verbose]
end

Instance Method Details

#consoleObject



55
56
57
58
59
# File 'lib/conjure/command.rb', line 55

def console
  Service::RailsConsole.new(:shell => target.existing_instance.shell) do |stdout|
    print stdout
  end
end

#createObject



15
16
17
# File 'lib/conjure/command.rb', line 15

def create
  target.new_instance.create
end

#deployObject



23
24
25
# File 'lib/conjure/command.rb', line 23

def deploy
  (target.existing_instance || target.new_instance).deploy
end

#export(file) ⇒ Object



33
34
35
# File 'lib/conjure/command.rb', line 33

def export(file)
  target.existing_instance.database.export file
end

#import(file) ⇒ Object



28
29
30
# File 'lib/conjure/command.rb', line 28

def import(file)
  target.existing_instance.database.import file
end

#logObject



40
41
42
43
44
# File 'lib/conjure/command.rb', line 40

def log
  Service::RailsLogView.new(:shell => target.existing_instance.shell, :rails_env => target.existing_instance.rails_env, :lines => options[:num], :tail => options[:tail]) do |stdout|
    print stdout
  end
end

#rake(*arguments) ⇒ Object



47
48
49
50
51
52
# File 'lib/conjure/command.rb', line 47

def rake(*arguments)
  task = arguments.join(" ")
  Service::RakeTask.new(:task => task, :shell => target.existing_instance.shell) do |stdout|
    print stdout
  end
end

#showObject



62
63
64
# File 'lib/conjure/command.rb', line 62

def show
  puts View::ApplicationView.new(target.application).render
end