Class: HR_Deploy::Target

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Target

Returns a new instance of Target.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/hr_deploy/target.rb', line 11

def initialize(args)

  @name = args[:name]
  @new_relic_disable_pinger_url = args[:new_relic_disable_pinger_url]
  @new_relic_enable_pinger_url = args[:new_relic_enable_pinger_url]
  @s3_asset_sync = args[:s3_asset_sync]
  @default = args[:default]
  @app_url = args[:app_url]

  # Use name for description, if no description given
  @description = args[:description] || name

  # Backup is off by default
  @backup_db = args[:backup_db] == true

  # Control maintenance mode is on by default
  @maintenance = args[:maintenance] == false ? false : true
end

Instance Attribute Details

#app_urlObject (readonly)

Returns the value of attribute app_url.



9
10
11
# File 'lib/hr_deploy/target.rb', line 9

def app_url
  @app_url
end

#descriptionObject (readonly)

Returns the value of attribute description.



8
9
10
# File 'lib/hr_deploy/target.rb', line 8

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/hr_deploy/target.rb', line 5

def name
  @name
end

#new_relic_disable_pinger_urlObject (readonly)

Returns the value of attribute new_relic_disable_pinger_url.



6
7
8
# File 'lib/hr_deploy/target.rb', line 6

def new_relic_disable_pinger_url
  @new_relic_disable_pinger_url
end

#new_relic_enable_pinger_urlObject (readonly)

Returns the value of attribute new_relic_enable_pinger_url.



7
8
9
# File 'lib/hr_deploy/target.rb', line 7

def new_relic_enable_pinger_url
  @new_relic_enable_pinger_url
end

Instance Method Details

#backup_db?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/hr_deploy/target.rb', line 46

def backup_db?
  !!backup_db
end

#default?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/hr_deploy/target.rb', line 54

def default?
  !!default
end

#maintenance_interaction?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/hr_deploy/target.rb', line 50

def maintenance_interaction?
  !!maintenance
end

#pinging_interaction?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/hr_deploy/target.rb', line 30

def pinging_interaction?
  !!new_relic_disable_pinger_url
end

#requires_curl?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/hr_deploy/target.rb', line 34

def requires_curl?
  pinging_interaction?
end

#requires_rake?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/hr_deploy/target.rb', line 38

def requires_rake?
  s3_asset_sync?
end

#s3_asset_sync?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/hr_deploy/target.rb', line 42

def s3_asset_sync?
  !!s3_asset_sync
end