Class: Foreman::Export::Base
- Inherits:
-
Object
- Object
- Foreman::Export::Base
- Defined in:
- lib/foreman/export/base.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#formation ⇒ Object
readonly
Returns the value of attribute formation.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#port ⇒ Object
readonly
deprecated.
Instance Method Summary collapse
- #app ⇒ Object
- #export ⇒ Object
-
#initialize(location, engine, options = {}) ⇒ Base
constructor
A new instance of Base.
- #log ⇒ Object
- #run ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(location, engine, options = {}) ⇒ Base
Returns a new instance of Base.
15 16 17 18 19 20 |
# File 'lib/foreman/export/base.rb', line 15 def initialize(location, engine, ={}) @location = location @engine = engine @options = .dup @formation = engine.formation end |
Instance Attribute Details
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
8 9 10 |
# File 'lib/foreman/export/base.rb', line 8 def engine @engine end |
#formation ⇒ Object (readonly)
Returns the value of attribute formation.
10 11 12 |
# File 'lib/foreman/export/base.rb', line 10 def formation @formation end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/foreman/export/base.rb', line 7 def location @location end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/foreman/export/base.rb', line 9 def @options end |
#port ⇒ Object (readonly)
deprecated
13 14 15 |
# File 'lib/foreman/export/base.rb', line 13 def port @port end |
Instance Method Details
#app ⇒ Object
29 30 31 |
# File 'lib/foreman/export/base.rb', line 29 def app [:app] || "app" end |
#export ⇒ Object
22 23 24 25 26 27 |
# File 'lib/foreman/export/base.rb', line 22 def export error("Must specify a location") unless location FileUtils.mkdir_p(location) rescue error("Could not create: #{location}") chown user, log chown user, run end |
#log ⇒ Object
33 34 35 |
# File 'lib/foreman/export/base.rb', line 33 def log [:log] || "/var/log/#{app}" end |
#run ⇒ Object
37 38 39 |
# File 'lib/foreman/export/base.rb', line 37 def run [:run] || "/var/run/#{app}" end |
#user ⇒ Object
41 42 43 |
# File 'lib/foreman/export/base.rb', line 41 def user [:user] || app end |