Module: O2h

Extended by:
O2h
Included in:
O2h
Defined in:
lib/o2h.rb,
lib/o2h/version.rb

Constant Summary collapse

VERSION =
"0.2.1"

Instance Method Summary collapse

Instance Method Details

#app_modeObject



17
18
19
# File 'lib/o2h.rb', line 17

def app_mode
  require 'newrelic_rpm'
end

#capistrano(required = :require) ⇒ Object



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

def capistrano(required = :require)
  defined?(Capistrano) and Capistrano::Configuration.instance(required)
end

#host(recipe) ⇒ Object



21
22
23
# File 'lib/o2h.rb', line 21

def host(recipe)
  File.expand_path(File.join(%w{o2h recipes host} << recipe + ".rb"), File.dirname(__FILE__))
end

#initialize!Object



10
11
12
13
14
15
# File 'lib/o2h.rb', line 10

def initialize!
  # use app mode only when we are not in capistrano
  unless capistrano(false)
    app_mode
  end
end