bosh_cli 1.2619.0 → 1.2624.0

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.
@@ -700,7 +700,7 @@ module Bosh
700
700
  :header => headers,
701
701
  }, &block)
702
702
 
703
- rescue URI::Error, SocketError, Errno::ECONNREFUSED, Timeout::Error, HTTPClient::TimeoutError => e
703
+ rescue URI::Error, SocketError, Errno::ECONNREFUSED, Timeout::Error, HTTPClient::TimeoutError, HTTPClient::KeepAliveDisconnected => e
704
704
  raise DirectorInaccessible, "cannot access director (#{e.message})"
705
705
 
706
706
  rescue HTTPClient::BadResponseError => e
@@ -54,7 +54,7 @@ module Bosh::Cli
54
54
  if package_spec["name"] != package_dirname
55
55
  raise InvalidPackage,
56
56
  "Found `#{package_spec["name"]}' package in " +
57
- "`#{package_dirname}' directory, please fix it"
57
+ "`#{package_dirname}' directory, please fix it"
58
58
  end
59
59
 
60
60
  is_final = options[:final]
@@ -71,7 +71,7 @@ module Bosh::Cli
71
71
  end
72
72
 
73
73
  def initialize(spec, release_dir, final, blobstore,
74
- sources_dir = nil, blobs_dir = nil, alt_src_dir = nil)
74
+ sources_dir = nil, blobs_dir = nil, alt_src_dir = nil)
75
75
  spec = load_yaml_file(spec) if spec.is_a?(String) && File.file?(spec)
76
76
 
77
77
  @name = spec["name"]
@@ -119,7 +119,7 @@ module Bosh::Cli
119
119
  end
120
120
 
121
121
  def reload # Mostly for tests
122
- @fingerprint = nil
122
+ @fingerprint = nil
123
123
  @resolved_globs = nil
124
124
  init_indices
125
125
  self
@@ -248,10 +248,10 @@ module Bosh::Cli
248
248
  @globs.each do |glob|
249
249
  matches = Set.new
250
250
 
251
- src_matches = Dir.chdir(@sources_dir) { resolve_glob_in_cwd(glob) }
251
+ src_matches = resolve_glob_in_dir(glob, @sources_dir)
252
252
  src_alt_matches = []
253
253
  if File.directory?(@alt_sources_dir)
254
- src_alt_matches = Dir.chdir(@alt_sources_dir) { resolve_glob_in_cwd(glob) }
254
+ src_alt_matches = resolve_glob_in_dir(glob, @alt_sources_dir)
255
255
  end
256
256
 
257
257
  # Glob like core/dea/**/* might not yield anything in alt source even
@@ -260,7 +260,7 @@ module Bosh::Cli
260
260
  top_dir = glob.split(File::SEPARATOR)[0]
261
261
  top_dir_in_src_alt_exists = top_dir && File.exists?(File.join(@alt_sources_dir, top_dir))
262
262
 
263
- if top_dir_in_src_alt_exists && src_alt_matches.empty? && !src_matches.empty?
263
+ if top_dir_in_src_alt_exists && src_alt_matches.empty? && src_matches.any?
264
264
  raise InvalidPackage, "Package `#{name}' has a glob that " +
265
265
  "doesn't match in `#{File.basename(@alt_sources_dir)}' " +
266
266
  "but matches in `#{File.basename(@sources_dir)}'. " +
@@ -280,10 +280,7 @@ module Bosh::Cli
280
280
  # will complement already found matches, unless this particular path
281
281
  # has already been matched.
282
282
  if File.directory?(File.join(@blobs_dir))
283
- Dir.chdir(@blobs_dir) do
284
- blob_matches = resolve_glob_in_cwd(glob)
285
- blob_matches.each { |path| matches << GlobMatch.new(@blobs_dir, path) }
286
- end
283
+ resolve_glob_in_dir(glob, @blobs_dir).each { |path| matches << GlobMatch.new(@blobs_dir, path) }
287
284
  end
288
285
 
289
286
  if matches.empty?
@@ -294,14 +291,16 @@ module Bosh::Cli
294
291
  end
295
292
 
296
293
  all_matches.reject! do |match|
297
- @excluded_globs.detect {|excluded_glob| File.fnmatch(excluded_glob, match.path)}
294
+ @excluded_globs.detect { |excluded_glob| File.fnmatch(excluded_glob, match.path) }
298
295
  end
299
296
  all_matches.sort
300
297
  end
301
298
 
302
- def resolve_glob_in_cwd(glob)
303
- Dir.glob(glob, File::FNM_DOTMATCH).reject do |fn|
304
- %w(. ..).include?(File.basename(fn))
299
+ def resolve_glob_in_dir(glob, dir)
300
+ Dir.chdir(dir) do
301
+ Dir.glob(glob, File::FNM_DOTMATCH).reject do |fn|
302
+ %w(. ..).include?(File.basename(fn))
303
+ end
305
304
  end
306
305
  end
307
306
 
data/lib/cli/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Cli
3
- VERSION = '1.2619.0'
3
+ VERSION = '1.2624.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2619.0
4
+ version: 1.2624.0
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: 2014-06-26 00:00:00.000000000 Z
12
+ date: 2014-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bosh_common
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.2619.0
21
+ version: 1.2624.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.2619.0
29
+ version: 1.2624.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: json_pure
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 1.2619.0
117
+ version: 1.2624.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 1.2619.0
125
+ version: 1.2624.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: net-ssh
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -205,7 +205,7 @@ dependencies:
205
205
  version: 0.5.4
206
206
  description: ! 'BOSH CLI
207
207
 
208
- a38edb'
208
+ 03f604'
209
209
  email: support@cloudfoundry.com
210
210
  executables:
211
211
  - bosh
@@ -317,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
317
  version: '0'
318
318
  segments:
319
319
  - 0
320
- hash: -2868564875147078069
320
+ hash: 201558621678155011
321
321
  requirements: []
322
322
  rubyforge_project:
323
323
  rubygems_version: 1.8.23.2