engineyard-serverside-adapter 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,7 @@ module EY
13
13
  @arguments = options[:arguments] || Arguments.new
14
14
  block.call @arguments if block
15
15
  @serverside_version = @arguments[:serverside_version]
16
+ @serverside_version ||= Gem::Version.create(ENGINEYARD_SERVERSIDE_VERSION.dup)
16
17
  validate!
17
18
  end
18
19
 
@@ -37,24 +38,20 @@ module EY
37
38
  private
38
39
 
39
40
  def applicable_options
40
- @applicable_options ||= self.class.options.select { |option| option.on_version?(engineyard_serverside_version) }
41
+ @applicable_options ||= self.class.options.select { |option| option.on_version?(@serverside_version) }
41
42
  end
42
43
 
43
44
  def check_and_install_command
44
45
  "(#{check_command}) || (#{install_command})"
45
46
  end
46
47
 
47
- def engineyard_serverside_version
48
- @serverside_version || ENGINEYARD_SERVERSIDE_VERSION
49
- end
50
-
51
48
  def check_command
52
- escaped_engineyard_serverside_version = engineyard_serverside_version.gsub(/\./, '\.')
49
+ escaped_serverside_version = @serverside_version.to_s.gsub(/\./, '\.')
53
50
 
54
51
  [
55
52
  Escape.shell_command([gem_path, "list", "engineyard-serverside"]),
56
53
  Escape.shell_command(["grep", "engineyard-serverside "]),
57
- Escape.shell_command(["egrep", "-q", "#{escaped_engineyard_serverside_version}[,)]"]),
54
+ Escape.shell_command(["egrep", "-q", "#{escaped_serverside_version}[,)]"]),
58
55
  ].join(" | ")
59
56
  end
60
57
 
@@ -65,7 +62,7 @@ module EY
65
62
  #
66
63
  # rubygems help suggests that --remote will disable this
67
64
  # behavior, but it doesn't.
68
- install_command = "cd `mktemp -d` && #{gem_path} install engineyard-serverside --no-rdoc --no-ri -v #{engineyard_serverside_version}"
65
+ install_command = "cd `mktemp -d` && #{gem_path} install engineyard-serverside --no-rdoc --no-ri -v #{@serverside_version}"
69
66
  Escape.shell_command(['sudo', 'sh', '-c', install_command])
70
67
  end
71
68
 
@@ -74,7 +71,7 @@ module EY
74
71
  end
75
72
 
76
73
  def action_command
77
- cmd = Command.new(@gem_bin_path, engineyard_serverside_version, *task)
74
+ cmd = Command.new(@gem_bin_path, @serverside_version, *task)
78
75
  applicable_options.each do |option|
79
76
  cmd.send("#{option.type}_argument", option.to_switch, @arguments[option.name])
80
77
  end
@@ -64,7 +64,7 @@ module EY
64
64
  end
65
65
 
66
66
  def serverside_version=(value)
67
- self[:serverside_version] = Gem::Version.create(value).to_s
67
+ self[:serverside_version] = Gem::Version.create(value.dup) # dup b/c Gem::Version sometimes modifies its argument :(
68
68
  end
69
69
 
70
70
  def method_missing(meth, *)
@@ -14,8 +14,8 @@ module EY
14
14
  "--#{@name}".gsub(/_/, '-')
15
15
  end
16
16
 
17
- def on_version?(version)
18
- !@version_requirement or @version_requirement.satisfied_by?(Gem::Version.create(version))
17
+ def on_version?(serverside_version)
18
+ !@version_requirement or @version_requirement.satisfied_by?(serverside_version)
19
19
  end
20
20
 
21
21
  def required?
@@ -1,7 +1,7 @@
1
1
  module EY
2
2
  module Serverside
3
3
  class Adapter
4
- VERSION = "2.0.3"
4
+ VERSION = "2.0.4"
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.
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.3
4
+ version: 2.0.4
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: 2012-08-30 00:00:00.000000000 Z
13
+ date: 2012-09-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: escape
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  segments:
128
128
  - 0
129
- hash: -3663156867639779323
129
+ hash: -633305540513114072
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  none: false
132
132
  requirements: