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.
Class Method Summary collapse
-
.procfile ⇒ Object
deprecated.
Instance Method Summary collapse
- #app ⇒ Object
- #export ⇒ Object
-
#initialize(location, engine, options = {}) ⇒ Base
constructor
A new instance of Base.
- #log ⇒ Object
- #run ⇒ Object
-
#template ⇒ Object
deprecated.
- #user ⇒ Object
Constructor Details
#initialize(location, engine, options = {}) ⇒ Base
Returns a new instance of Base.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/foreman/export/base.rb', line 16 def initialize(location, engine, ={}) @location = location @engine = engine @options = .dup @formation = engine.formation # deprecated def port Foreman::Export::Base.warn_deprecation! engine.base_port end # deprecated def template Foreman::Export::Base.warn_deprecation! [:template] end # deprecated def @engine.procfile Foreman::Export::Base.warn_deprecation! @processes.map do |process| OpenStruct.new( :name => @names[process], :process => process ) end end end |
Instance Attribute Details
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
9 10 11 |
# File 'lib/foreman/export/base.rb', line 9 def engine @engine end |
#formation ⇒ Object (readonly)
Returns the value of attribute formation.
11 12 13 |
# File 'lib/foreman/export/base.rb', line 11 def formation @formation end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
8 9 10 |
# File 'lib/foreman/export/base.rb', line 8 def location @location end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/foreman/export/base.rb', line 10 def @options end |
#port ⇒ Object (readonly)
deprecated
14 15 16 |
# File 'lib/foreman/export/base.rb', line 14 def port @port end |
Class Method Details
Instance Method Details
#app ⇒ Object
53 54 55 |
# File 'lib/foreman/export/base.rb', line 53 def app [:app] || "app" end |
#export ⇒ Object
46 47 48 49 50 51 |
# File 'lib/foreman/export/base.rb', line 46 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
57 58 59 |
# File 'lib/foreman/export/base.rb', line 57 def log [:log] || "/var/log/#{app}" end |
#run ⇒ Object
61 62 63 |
# File 'lib/foreman/export/base.rb', line 61 def run [:run] || "/var/run/#{app}" end |
#template ⇒ Object
deprecated
29 30 31 32 |
# File 'lib/foreman/export/base.rb', line 29 def template Foreman::Export::Base.warn_deprecation! [:template] end |
#user ⇒ Object
65 66 67 |
# File 'lib/foreman/export/base.rb', line 65 def user [:user] || app end |