Class: Bosh::Deployer::Stub
- Inherits:
-
Object
- Object
- Bosh::Deployer::Stub
- Includes:
- Cancun::Highline
- Defined in:
- lib/bosh-deployer/stub.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(path = '~/.bosh-deployer/stubs') ⇒ Stub
constructor
A new instance of Stub.
- #name ⇒ Object
Constructor Details
#initialize(path = '~/.bosh-deployer/stubs') ⇒ Stub
Returns a new instance of Stub.
13 14 15 16 |
# File 'lib/bosh-deployer/stub.rb', line 13 def initialize(path = '~/.bosh-deployer/stubs') path = path[0..-2] if path[-1] == '/' @filename = "#{path}/#{name}.yml" end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
11 12 13 |
# File 'lib/bosh-deployer/stub.rb', line 11 def filename @filename end |
Instance Method Details
#generate ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/bosh-deployer/stub.rb', line 22 def generate if File.exists?(filename) and !agree "#{filename} already exists, do you want to overwrite it?" say 'Stub generation cancelled!' return end save_stub end |
#name ⇒ Object
18 19 20 |
# File 'lib/bosh-deployer/stub.rb', line 18 def name raise NotImplementedError end |