Class: BrighterPlanet::Deploy::Cm1
- Inherits:
-
Object
- Object
- BrighterPlanet::Deploy::Cm1
show all
- Includes:
- ReadsFromPublicUrl, Singleton
- Defined in:
- lib/brighter_planet_deploy/cm1.rb
Constant Summary
collapse
- RED_IP =
'184.73.240.13'
- WANTS =
[
:resque_redis_url,
:incoming_queue,
:color,
:role,
:environment,
:log_dir,
:phase,
:carrier, :ey_app, :service
]
Instance Method Summary
collapse
#from_public_url
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_id, *args) ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/brighter_planet_deploy/cm1.rb', line 42
def method_missing(method_id, *args)
if args.length == 0 and not block_given?
from_public_url method_id
else
super
end
end
|
Instance Method Details
#color ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/brighter_planet_deploy/cm1.rb', line 34
def color
if Deploy.instance.servers.me.service.to_s.underscore == 'cm1'
(AuthoritativeDnsResolver.getaddress(domain) == RED_IP) ? 'red' : 'blue'
else
from_public_url :color
end
end
|
#domain ⇒ Object
26
27
28
|
# File 'lib/brighter_planet_deploy/cm1.rb', line 26
def domain
'carbon.brighterplanet.com'
end
|
#endpoint ⇒ Object
30
31
32
|
# File 'lib/brighter_planet_deploy/cm1.rb', line 30
def endpoint
"http://#{domain}"
end
|
#service ⇒ Object
22
23
24
|
# File 'lib/brighter_planet_deploy/cm1.rb', line 22
def service
self.class.to_s.demodulize
end
|