Class: KRL_CMD::Checkout

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ruleset, options) ⇒ Checkout

Returns a new instance of Checkout.



16
17
18
19
20
21
22
23
# File 'lib/checkout.rb', line 16

def initialize(ruleset, options)
  @user = User.new
  @ruleset = ruleset
  @include_title = options["title"] 
  @all = options["all"]
  app = KRL_COMMON::get_app rescue nil
			raise "You are already in an application directory: #{app.application_id}" if app
end

Class Method Details

.go(ruleset, options) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/checkout.rb', line 6

def self.go(ruleset, options)
  begin
    c = self.new(ruleset, options)
    c.checkout
  rescue Exception => e
    puts e.message
    ap e.backtrace if $DEBUG
  end
end

Instance Method Details

#checkoutObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/checkout.rb', line 25

def checkout

  if @all
    @user.applications["apps"].each do |app|
      begin
        @ruleset = app["appid"]
        do_checkout
      rescue => e
        puts e.message
      end
    end
  else
    do_checkout
  end

  
end