Class: Paratrooper::Configuration

Inherits:
Object
  • Object
show all
Includes:
Callbacks
Defined in:
lib/paratrooper/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Callbacks

#add_callback, #build_callback, #callbacks

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



13
14
15
# File 'lib/paratrooper/configuration.rb', line 13

def api_key
  @api_key
end

#app_nameObject

Returns the value of attribute app_name.



13
14
15
# File 'lib/paratrooper/configuration.rb', line 13

def app_name
  @app_name
end

#branch_nameObject

Returns the value of attribute branch_name.



13
14
15
# File 'lib/paratrooper/configuration.rb', line 13

def branch_name
  @branch_name
end

#deployment_hostObject



56
57
58
# File 'lib/paratrooper/configuration.rb', line 56

def deployment_host
  @deployment_host ||= 'heroku.com'
end

#herokuObject



36
37
38
# File 'lib/paratrooper/configuration.rb', line 36

def heroku
  @heroku ||= HerokuWrapper.new(app_name)
end

#http_clientObject



60
61
62
# File 'lib/paratrooper/configuration.rb', line 60

def http_client
  @http_client ||= HttpClientWrapper.new
end

#match_tag_nameObject

Returns the value of attribute match_tag_name.



13
14
15
# File 'lib/paratrooper/configuration.rb', line 13

def match_tag_name
  @match_tag_name
end

#migration_checkObject



32
33
34
# File 'lib/paratrooper/configuration.rb', line 32

def migration_check
  @migration_check ||= PendingMigrationCheck.new(source_control.deployment_sha, heroku, system_caller)
end

#protocolObject



52
53
54
# File 'lib/paratrooper/configuration.rb', line 52

def protocol
  @protocol ||= 'http'
end

#screen_notifierObject



40
41
42
# File 'lib/paratrooper/configuration.rb', line 40

def screen_notifier
  @screen_notifier ||= Notifiers::ScreenNotifier.new
end

#source_controlObject



93
94
95
# File 'lib/paratrooper/configuration.rb', line 93

def source_control
  @source_control ||= SourceControl.new(self)
end

#system_callerObject



89
90
91
# File 'lib/paratrooper/configuration.rb', line 89

def system_caller
  @system_caller ||= SystemCaller.new
end

#tag_nameObject

Returns the value of attribute tag_name.



13
14
15
# File 'lib/paratrooper/configuration.rb', line 13

def tag_name
  @tag_name
end

Instance Method Details

#attributes=(attrs) ⇒ Object



22
23
24
25
26
# File 'lib/paratrooper/configuration.rb', line 22

def attributes=(attrs)
  attrs.each do |method, value|
    public_send("#{method}=", value)
  end
end

#branch_name?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/paratrooper/configuration.rb', line 28

def branch_name?
  !branch_name.to_s.strip.empty?
end

#force_pushObject



81
82
83
# File 'lib/paratrooper/configuration.rb', line 81

def force_push
  @force_push ||= false
end

#force_push=(val) ⇒ Object Also known as: force=



76
77
78
# File 'lib/paratrooper/configuration.rb', line 76

def force_push=(val)
  @force_push= !!val
end

#force_push?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/paratrooper/configuration.rb', line 85

def force_push?
  @force_push
end

#maintenanceObject



64
65
66
# File 'lib/paratrooper/configuration.rb', line 64

def maintenance
  @maintenance ||= false
end

#maintenance=(val) ⇒ Object



68
69
70
# File 'lib/paratrooper/configuration.rb', line 68

def maintenance=(val)
  @maintenance = !!val
end

#maintenance?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/paratrooper/configuration.rb', line 72

def maintenance?
  @maintenance
end

#notifiersObject



48
49
50
# File 'lib/paratrooper/configuration.rb', line 48

def notifiers
  @notifiers ||= [@screen_notifier]
end

#notifiers=(notifers) ⇒ Object



44
45
46
# File 'lib/paratrooper/configuration.rb', line 44

def notifiers=(notifers)
  @notifiers = Array(notifers)
end