Class: Rubypack::Deployer

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypack/deployer.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Deployer

Returns a new instance of Deployer.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rubypack/deployer.rb', line 5

def initialize(options)
  @options = options
  @output = if options[:verbose]
              VerboseOutput.new
            elsif options[:quiet]
              QuietOutput.new
            else
              DefaultOutput.new
            end

  @filename = options[:filename]
  @directory = options[:directory]
end

Instance Method Details

#deploy!Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rubypack/deployer.rb', line 19

def deploy!
  success = unpack_file
  return unless success

  success = install_gems
  return false unless success

  true
rescue => exception
  @output.error(exception.message)
  verbose(exception.backtrace.join("\n"))
  false
end