chef 12.2.0.rc.2-x86-mingw32 → 12.2.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/util/path_helper.rb +3 -3
- data/lib/chef/version.rb +1 -1
- data/spec/unit/util/path_helper_spec.rb +22 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93766b12ac46c57581c4945e64dd79619e4dd40b
|
4
|
+
data.tar.gz: da93669cfe6fd813330a92b2eed059acefa81e89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d54a3105c9732293f92b326602fc6f3d22b7f2b33b71a7bd3689469e4afeae29179a46d0f0b8551b4cca48f9ba80d195a7b3a17f80b5e9834132a8bd4819b53
|
7
|
+
data.tar.gz: c2985dfe159c46fc1631631a578ebd404a74f6379137a5289fae57e505597eb8b01f70242b128d43502d915a665f07415d9ec5072721e2461cde19316f7473e6
|
@@ -196,7 +196,7 @@ class Chef
|
|
196
196
|
paths << ENV['HOMESHARE'] + ENV['HOMEPATH'] if ENV['HOMESHARE'] && ENV['HOMEPATH']
|
197
197
|
paths << ENV['USERPROFILE']
|
198
198
|
end
|
199
|
-
paths << Dir.home
|
199
|
+
paths << Dir.home if ENV['HOME']
|
200
200
|
|
201
201
|
# Depending on what environment variables we're using, the slashes can go in any which way.
|
202
202
|
# Just change them all to / to keep things consistent.
|
@@ -204,11 +204,11 @@ class Chef
|
|
204
204
|
# the particular brand of kool-aid you consume. This code assumes that \ and / are both
|
205
205
|
# path separators on any system being used.
|
206
206
|
paths = paths.map { |home_path| home_path.gsub(path_separator, ::File::SEPARATOR) if home_path }
|
207
|
-
|
207
|
+
|
208
208
|
# Filter out duplicate paths and paths that don't exist.
|
209
209
|
valid_paths = paths.select { |home_path| home_path && Dir.exists?(home_path) }
|
210
210
|
valid_paths = valid_paths.uniq
|
211
|
-
|
211
|
+
|
212
212
|
# Join all optional path elements at the end.
|
213
213
|
# If a block is provided, invoke it - otherwise just return what we've got.
|
214
214
|
joined_paths = valid_paths.map { |home_path| File.join(home_path, *args) }
|
data/lib/chef/version.rb
CHANGED
@@ -230,4 +230,26 @@ describe Chef::Util::PathHelper do
|
|
230
230
|
end
|
231
231
|
end
|
232
232
|
end
|
233
|
+
|
234
|
+
describe "all_homes" do
|
235
|
+
before do
|
236
|
+
stub_const('ENV', env)
|
237
|
+
allow(Chef::Platform).to receive(:windows?).and_return(is_windows)
|
238
|
+
end
|
239
|
+
|
240
|
+
context "on windows" do
|
241
|
+
let (:is_windows) { true }
|
242
|
+
end
|
243
|
+
|
244
|
+
context "on unix" do
|
245
|
+
let (:is_windows) { false }
|
246
|
+
|
247
|
+
context "when HOME is not set" do
|
248
|
+
let (:env) { {} }
|
249
|
+
it "returns an empty array" do
|
250
|
+
expect(PathHelper.all_homes).to eq([])
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
233
255
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.2.
|
4
|
+
version: 12.2.1
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-config
|
@@ -2208,9 +2208,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2208
2208
|
version: 2.0.0
|
2209
2209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2210
2210
|
requirements:
|
2211
|
-
- - "
|
2211
|
+
- - ">="
|
2212
2212
|
- !ruby/object:Gem::Version
|
2213
|
-
version:
|
2213
|
+
version: '0'
|
2214
2214
|
requirements: []
|
2215
2215
|
rubyforge_project:
|
2216
2216
|
rubygems_version: 2.4.4
|