engineyard-serverside-adapter 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - ree
7
+ notifications:
8
+ recipients:
9
+ - memde@engineyard.com
10
+ branches:
11
+ only:
12
+ - master
@@ -26,8 +26,11 @@ module EY
26
26
  end
27
27
 
28
28
  def call(&block)
29
- block.call check_and_install_command.to_s
30
- block.call action_command.to_s
29
+ commands.all? { |cmd| block.call(cmd.to_s) }
30
+ end
31
+
32
+ def commands
33
+ @commands ||= [check_and_install_command, action_command]
31
34
  end
32
35
 
33
36
  def verbose
@@ -14,8 +14,12 @@ module EY
14
14
  yield self if block_given?
15
15
  end
16
16
 
17
+ def to_argv
18
+ [@binary, "_#{@version}_"] + @task + @arguments.sort_by { |x| x.first }.flatten
19
+ end
20
+
17
21
  def to_s
18
- Escape.shell_command [@binary, "_#{@version}_"] + @task + @arguments.sort_by { |x| x.first }.flatten
22
+ Escape.shell_command to_argv
19
23
  end
20
24
 
21
25
  def array_argument(switch, values)
@@ -1,7 +1,7 @@
1
1
  module EY
2
2
  module Serverside
3
3
  class Adapter
4
- VERSION = "2.0.5"
4
+ VERSION = "2.0.7"
5
5
  # For backwards compatibility, the serverside version default will be maintained until 2.1
6
6
  # It is recommended that you supply a serverside_version to engineyard-serverside-adapter
7
7
  # rather than relying on the default version here. This default will go away soon.
@@ -31,6 +31,30 @@ shared_examples_for "a serverside action" do
31
31
  command.should include('--verbose')
32
32
  end
33
33
 
34
+ it "returns true when all commands succeed in call" do
35
+ action = @adapter.send(@method) do |args|
36
+ args.verbose = true
37
+ end
38
+
39
+ commands = []
40
+ action.call { |cmd| commands << cmd; true }.should be_true
41
+ commands.should have(2).entries
42
+ end
43
+
44
+ it "returns false when any commands fail in call, short circuiting if first command fails" do
45
+ action = @adapter.send(@method) do |args|
46
+ args.verbose = true
47
+ end
48
+
49
+ commands = []
50
+ action.call { |cmd| commands << cmd; false }.should be_false
51
+ commands.should have(1).entries
52
+
53
+ commands = []
54
+ action.call { |cmd| commands << cmd; commands.size == 1 ? true : false }.should be_false
55
+ commands.should have(2).entries
56
+ end
57
+
34
58
  it "does not let arguments changes propagate back up to the adapter" do
35
59
  command1 = @adapter.send(@method) do |args|
36
60
  args.app = 'sporkr'
@@ -37,9 +37,7 @@ module ArgumentsHelpers
37
37
  end
38
38
 
39
39
  def all_commands(adapter)
40
- commands = []
41
- adapter.call { |command| commands << command }
42
- commands
40
+ adapter.commands.map(&:to_s)
43
41
  end
44
42
 
45
43
  def last_command(adapter)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-07 00:00:00.000000000 Z
13
+ date: 2013-04-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: escape
@@ -86,6 +86,7 @@ extensions: []
86
86
  extra_rdoc_files: []
87
87
  files:
88
88
  - .gitignore
89
+ - .travis.yml
89
90
  - Gemfile
90
91
  - Guardfile
91
92
  - LICENSE
@@ -127,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
128
  version: '0'
128
129
  segments:
129
130
  - 0
130
- hash: 3338596083708066819
131
+ hash: -3196036238943305077
131
132
  required_rubygems_version: !ruby/object:Gem::Requirement
132
133
  none: false
133
134
  requirements:
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  version: 1.3.6
137
138
  requirements: []
138
139
  rubyforge_project: engineyard-serverside-adapter
139
- rubygems_version: 1.8.24
140
+ rubygems_version: 1.8.25
140
141
  signing_key:
141
142
  specification_version: 3
142
143
  summary: Adapter for speaking to engineyard-serverside