Module: Ferry::DSL::Env

Included in:
Ferry::DSL
Defined in:
lib/ferry/dsl/env.rb

Instance Method Summary collapse

Instance Method Details

#any?(key) ⇒ Boolean

Returns:

  • (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, options={})
  env.ask(key, value, options)
end

#asset_timestampObject



75
76
77
# File 'lib/ferry/dsl/env.rb', line 75

def asset_timestamp
  env.timestamp.strftime("%Y%m%d%H%M.%S")
end

#configure_backendObject



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

#envObject



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_timestampObject



71
72
73
# File 'lib/ferry/dsl/env.rb', line 71

def release_timestamp
  env.timestamp.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, options={})
  env.role(name, servers, options)
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