engineyard-serverside 1.5.23.ruby19.13 → 1.5.23.ruby19.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,6 @@ require 'engineyard-serverside/configuration'
23
23
  require 'engineyard-serverside/deprecation'
24
24
  require 'engineyard-serverside/future'
25
25
 
26
- $DEBUG = false
27
26
  module EY
28
27
  module Serverside
29
28
  RemoteFailure = Class.new StandardError
@@ -57,7 +56,8 @@ module EY
57
56
 
58
57
  def self.read_encoded_dna
59
58
  encoded_dna = '{}'
60
- force_unicode = encoded_dna.respond_to?(:force_encoding) || ($KCODE = 'U' && false)
59
+ force_unicode = encoded_dna.respond_to?(:force_encoding)
60
+ $KCODE = 'U' unless force_unicode
61
61
 
62
62
  if File.exist?(dna_path)
63
63
  encoded_dna = `sudo cat #{dna_path}`
@@ -187,16 +187,22 @@ module EY
187
187
  EY::Serverside::Deploy.new(config).restart_with_maintenance_page
188
188
  end
189
189
 
190
- desc "install_bundler [VERSION]", "Make sure VERSION of bundler is installed (in system ruby)"
190
+ desc "install_bundler [VERSION]", "Make sure VERSION of bundler is installed (in system ruby)"
191
191
  def install_bundler(version)
192
- has_bundler_cmd = "gem list -i bundler -v '#{version}'"
192
+ egrep_escaped_version = version.gsub(/\./, '\.')
193
+ # the grep "bundler " is so that gems like bundler08 don't get
194
+ # their versions considered too
195
+ #
196
+ # the [,$] is to stop us from looking for e.g. 0.9.2, seeing
197
+ # 0.9.22, and mistakenly thinking 0.9.2 is there
198
+ has_bundler_cmd = "gem list bundler | grep \"bundler \" | egrep -q '#{egrep_escaped_version}[,)]'"
193
199
 
194
200
  unless system(has_bundler_cmd)
195
201
  system("gem install bundler -q --no-rdoc --no-ri -v '#{version}'")
196
202
  end
197
203
  end
198
204
 
199
- desc "propagate", "Propagate the engineyard-serverside gem to the other instances in the cluster. This will install exactly version #{EY::Serverside::VERSION}."
205
+ desc "propagate", "Propagate the engineyard-serverside gem to the other instances in the cluster. This will install exactly version #{EY::Serverside::VERSION}."
200
206
  def propagate
201
207
  ey_server_side = Dependency.new('engineyard-serverside', EY::Serverside::VERSION)
202
208
  servers = EY::Serverside::Server.all.find_all { |server| !server.local? }
@@ -167,7 +167,7 @@ To fix this problem, commit your Gemfile.lock to your repository and redeploy.
167
167
 
168
168
  # GIT_SSH needs to be defined in the environment for customers with private bundler repos in their Gemfile.
169
169
  def clean_environment
170
- %Q[export GIT_SSH="#{ssh_executable}" && export LANG="en_US.UTF-8" && unset BUNDLE_PATH BUNDLE_FROZEN BUNDLE_WITHOUT BUNDLE_BIN BUNDLE_GEMFILE]
170
+ %Q[export GIT_SSH="#{ssh_executable}" && export LANG="en_US.UTF-8" && unset RUBYOPT BUNDLE_PATH BUNDLE_FROZEN BUNDLE_WITHOUT BUNDLE_BIN BUNDLE_GEMFILE]
171
171
  end
172
172
 
173
173
  # If we don't have a local version of the ssh wrapper script yet,
@@ -426,10 +426,7 @@ Deploy again if your services configuration appears incomplete or out of date.
426
426
  clean_bundle_on_system_version_change
427
427
 
428
428
  bundler_version, install_switches = bundler_config
429
- installed = run "gem list -i bundler -v '#{bundler_version}'" rescue false
430
- unless installed
431
- sudo "gem install bundler -q --no-rdoc --no-ri -v '#{bundler_version}'"
432
- end
429
+ sudo "#{clean_environment} && #{serverside_bin} install_bundler #{bundler_version}"
433
430
  run "#{clean_environment} && cd #{c.release_path} && ruby -S bundle _#{bundler_version}_ install #{install_switches}"
434
431
 
435
432
  write_system_version
@@ -18,10 +18,6 @@ module EY
18
18
  def error?
19
19
  !success?
20
20
  end
21
-
22
- def inspect
23
- %Q{<Serverside::Future @server="#{@server.hostname}" @args="#{@args}" @value="#{@value}"}
24
- end
25
21
  end
26
22
 
27
23
  if RUBY_VERSION =~ /1\.8/
@@ -4,17 +4,23 @@ module EY
4
4
  require 'dataflow'
5
5
 
6
6
  class Future
7
+ extend Dataflow
8
+
7
9
  def self.call(servers, *args, &block)
8
- futures = barrier(*servers.map do |server|
9
- new(server, *args, &block)
10
+ futures = []
11
+ # Dataflow needs to call `barrier` and `need_later` in the same object
12
+ barrier(*servers.map do |server|
13
+ future = new(server, *args, &block)
14
+ futures << future
15
+
16
+ need_later { future.call }
10
17
  end)
11
18
 
12
- futures.each {|f| f.call}
13
19
  futures
14
20
  end
15
21
 
16
22
  def future
17
- need_later { @block.call(@server, *@args) }
23
+ @block.call(@server, *@args)
18
24
  end
19
25
 
20
26
  def call
@@ -16,9 +16,15 @@ module EY
16
16
  end
17
17
 
18
18
  def any_database_adapter?
19
- %w[mysql2 mysql do_mysql pg do_postgres].any? do |gem|
20
- @contents.index(/^\s+#{gem}\s\([^\)]+\)$/)
19
+ any_ruby_adapter = %w[mysql2 mysql do_mysql pg do_postgres sqlite3].any? do |type|
20
+ @contents.index(/^\s+#{type}\s\([^\)]+\)$/)
21
21
  end
22
+
23
+ any_jruby_adapter = %w[mysql postgresql sqlite3].any? do |type|
24
+ @contents.index(/^\s+jdbc-#{type}\s\([^\)]+\)$/) || @contents.index(/^\s+activerecord-jdbc#{type}-adapter\s\([^\)]+\)$/)
25
+ end
26
+
27
+ any_ruby_adapter || any_jruby_adapter
22
28
  end
23
29
 
24
30
  def parse
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '1.5.23.ruby19.13'
3
+ VERSION = '1.5.23.ruby19.14'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,35 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
- version: !ruby/object:Gem::Version
4
- hash: -966683994
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.23.ruby19.14
5
5
  prerelease: 7
6
- segments:
7
- - 1
8
- - 5
9
- - 23
10
- - ruby
11
- - 19
12
- - 13
13
- version: 1.5.23.ruby19.13
14
6
  platform: ruby
15
- authors:
7
+ authors:
16
8
  - EY Cloud Team
17
9
  autorequire:
18
10
  bindir: bin
19
11
  cert_chain: []
20
-
21
- date: 2012-01-10 00:00:00 Z
12
+ date: 2012-01-10 00:00:00.000000000 Z
22
13
  dependencies: []
23
-
24
14
  description:
25
15
  email: cloud@engineyard.com
26
- executables:
16
+ executables:
27
17
  - engineyard-serverside
28
18
  extensions: []
29
-
30
19
  extra_rdoc_files: []
31
-
32
- files:
20
+ files:
33
21
  - bin/engineyard-serverside
34
22
  - lib/engineyard-serverside/cli.rb
35
23
  - lib/engineyard-serverside/configuration.rb
@@ -159,40 +147,29 @@ files:
159
147
  - spec/support/integration.rb
160
148
  homepage: http://github.com/engineyard/engineyard-serverside
161
149
  licenses: []
162
-
163
150
  post_install_message:
164
151
  rdoc_options: []
165
-
166
- require_paths:
152
+ require_paths:
167
153
  - lib
168
- required_ruby_version: !ruby/object:Gem::Requirement
154
+ required_ruby_version: !ruby/object:Gem::Requirement
169
155
  none: false
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- hash: 3
174
- segments:
175
- - 0
176
- version: "0"
177
- required_rubygems_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
178
161
  none: false
179
- requirements:
180
- - - ">"
181
- - !ruby/object:Gem::Version
182
- hash: 25
183
- segments:
184
- - 1
185
- - 3
186
- - 1
187
- version: 1.3.1
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: 1.3.6
188
166
  requirements: []
189
-
190
167
  rubyforge_project:
191
- rubygems_version: 1.8.6
168
+ rubygems_version: 1.8.10
192
169
  signing_key:
193
170
  specification_version: 3
194
171
  summary: A gem that deploys ruby applications on EY Cloud instances
195
- test_files:
172
+ test_files:
196
173
  - spec/basic_deploy_spec.rb
197
174
  - spec/bundler_deploy_spec.rb
198
175
  - spec/custom_deploy_spec.rb
@@ -224,3 +201,4 @@ test_files:
224
201
  - spec/services_deploy_spec.rb
225
202
  - spec/spec_helper.rb
226
203
  - spec/support/integration.rb
204
+ has_rdoc: