engineyard-serverside 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,16 @@ module EY
|
|
22
22
|
|
23
23
|
# Calls def_option and adds a name? predicate method
|
24
24
|
def self.def_boolean_option(name, default=nil, &block)
|
25
|
-
|
25
|
+
key ||= name.to_s
|
26
|
+
|
27
|
+
define_method(name) do
|
28
|
+
if block
|
29
|
+
val = fetch(key) {instance_eval(&block)}
|
30
|
+
else
|
31
|
+
val = fetch(key, default)
|
32
|
+
end
|
33
|
+
not [false,nil,'false','nil'].include?(val) # deal with command line options turning booleans into strings
|
34
|
+
end
|
26
35
|
alias_method(:"#{name}?", name)
|
27
36
|
end
|
28
37
|
|
data/spec/configuration_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe EY::Serverside::Deploy::Configuration do
|
|
11
11
|
'account_name' => 'acc',
|
12
12
|
'migrate' => nil,
|
13
13
|
'branch' => 'branch_from_command_line',
|
14
|
-
'config' => {'custom' => 'custom_from_extra_config'}.to_json
|
14
|
+
'config' => {'custom' => 'custom_from_extra_config', 'maintenance_on_migrate' => 'false'}.to_json
|
15
15
|
})
|
16
16
|
|
17
17
|
@deploy = FullTestDeploy.new(test_servers, @config, test_shell)
|
@@ -25,6 +25,7 @@ describe EY::Serverside::Deploy::Configuration do
|
|
25
25
|
'branch' => 'branch_from_ey_yml',
|
26
26
|
'custom' => 'custom_from_ey_yml',
|
27
27
|
'bundle_without' => 'only test',
|
28
|
+
'maintenance_on_migrate' => true,
|
28
29
|
}
|
29
30
|
}
|
30
31
|
}
|
@@ -69,5 +70,11 @@ describe EY::Serverside::Deploy::Configuration do
|
|
69
70
|
@deploy.load_ey_yml
|
70
71
|
@deploy.config.bundle_without.should == 'only test'
|
71
72
|
end
|
73
|
+
|
74
|
+
it "overrides boolean ey.yml only options with --conifg strings" do
|
75
|
+
write_ey_yml 'ey.yml', @yaml_data
|
76
|
+
@deploy.load_ey_yml
|
77
|
+
@deploy.config.should_not be_maintenance_on_migrate
|
78
|
+
end
|
72
79
|
end
|
73
80
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engineyard-serverside
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -477,7 +477,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
477
477
|
version: '0'
|
478
478
|
segments:
|
479
479
|
- 0
|
480
|
-
hash:
|
480
|
+
hash: 3769806345729603200
|
481
481
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
482
482
|
none: false
|
483
483
|
requirements:
|