Module: Ferry::DSL::Env
- Included in:
- Ferry::DSL
- Defined in:
- lib/ferry/dsl/env.rb
Instance Method Summary collapse
- #any?(key) ⇒ Boolean
- #ask(key, value, options = {}) ⇒ Object
- #asset_timestamp ⇒ Object
- #configure_backend ⇒ Object
- #delete(key) ⇒ Object
- #env ⇒ Object
- #fetch(key, default = nil, &block) ⇒ Object
- #primary(role) ⇒ Object
- #release_roles(*names) ⇒ Object
- #release_timestamp ⇒ Object
- #role(name, servers, options = {}) ⇒ Object
- #role_properties(*names, &block) ⇒ Object
- #roles(*names) ⇒ Object
- #server(name, properties = {}) ⇒ Object
- #set(key, value) ⇒ Object
- #set_if_empty(key, value) ⇒ Object
Instance Method Details
#any?(key) ⇒ Boolean
13 14 15 16 17 18 19 20 |
# File 'lib/ferry/dsl/env.rb', line 13 def any?(key) value = fetch(key) if value && value.respond_to?(:any?) value.any? else !fetch(key).nil? end end |
#ask(key, value, options = {}) ⇒ Object
34 35 36 |
# File 'lib/ferry/dsl/env.rb', line 34 def ask(key, value, ={}) env.ask(key, value, ) end |
#asset_timestamp ⇒ Object
75 76 77 |
# File 'lib/ferry/dsl/env.rb', line 75 def env..strftime("%Y%m%d%H%M.%S") end |
#configure_backend ⇒ Object
5 6 7 |
# File 'lib/ferry/dsl/env.rb', line 5 def configure_backend env.configure_backend end |
#delete(key) ⇒ Object
30 31 32 |
# File 'lib/ferry/dsl/env.rb', line 30 def delete(key) env.delete(key) end |
#env ⇒ Object
67 68 69 |
# File 'lib/ferry/dsl/env.rb', line 67 def env Configuration.env end |
#fetch(key, default = nil, &block) ⇒ Object
9 10 11 |
# File 'lib/ferry/dsl/env.rb', line 9 def fetch(key, default=nil, &block) env.fetch(key, default, &block) end |
#primary(role) ⇒ Object
63 64 65 |
# File 'lib/ferry/dsl/env.rb', line 63 def primary(role) env.primary(role) end |
#release_roles(*names) ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/ferry/dsl/env.rb', line 54 def release_roles(*names) if names.last.is_a? Hash names.last.merge!({ :exclude => :no_release }) else names << { exclude: :no_release } end roles(*names) end |
#release_timestamp ⇒ Object
71 72 73 |
# File 'lib/ferry/dsl/env.rb', line 71 def env..strftime("%Y%m%d%H%M%S") end |
#role(name, servers, options = {}) ⇒ Object
38 39 40 |
# File 'lib/ferry/dsl/env.rb', line 38 def role(name, servers, ={}) env.role(name, servers, ) end |
#role_properties(*names, &block) ⇒ Object
50 51 52 |
# File 'lib/ferry/dsl/env.rb', line 50 def role_properties(*names, &block) env.role_properties_for(names, &block) end |
#roles(*names) ⇒ Object
46 47 48 |
# File 'lib/ferry/dsl/env.rb', line 46 def roles(*names) env.roles_for(names.flatten) end |
#server(name, properties = {}) ⇒ Object
42 43 44 |
# File 'lib/ferry/dsl/env.rb', line 42 def server(name, properties={}) env.server(name, properties) end |
#set(key, value) ⇒ Object
22 23 24 |
# File 'lib/ferry/dsl/env.rb', line 22 def set(key, value) env.set(key, value) end |
#set_if_empty(key, value) ⇒ Object
26 27 28 |
# File 'lib/ferry/dsl/env.rb', line 26 def set_if_empty(key, value) env.set_if_empty(key, value) end |