config_hound 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67a3b97b5e40deb8ed9509031898e66a2de9577d
4
- data.tar.gz: 53db1854e4cf25048107062b23718de22b15083d
3
+ metadata.gz: 221d83abd19025a9a2dda8abbeb87b5ac679a120
4
+ data.tar.gz: 87ccb306f52f230d2b14a606169a15ebc43b024a
5
5
  SHA512:
6
- metadata.gz: f9db6a68b39dda85488488ab959acd9b962ef61510d6a4e1b182e21aa16b48c30540c46ce61df4c6b80cb8a8710fff4a54c76679e3adea50d4ba03da90baf291
7
- data.tar.gz: 5ca8f26c807be682d782c2969c174ce5ca664fafd820fe4ea348b04dac4abf50edb2e3553f415e77d8bb6846d029bf327aad08be96e1db73263728ff160c6f20
6
+ metadata.gz: ce10dc81bba78fd68ae07037e23082090019f472fc78c275da7acd21692b7b8341b6d0f05973c68a799f1d689570265d97658c5001f2d1437343c6e53f33f7d4
7
+ data.tar.gz: aa4391c66ade9fc59f1c776b3750114212e61155a53d855cf08a5c2803784dfd1539704f33c0ad4c3d5c6574a130c94753737a2fbcf8a65edc4160f37ea88ebe
@@ -2,3 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 2.2
4
4
  - 2.4
5
+ - 2.5
@@ -1,5 +1,6 @@
1
1
  require "config_hound/error"
2
2
  require "dig_rb"
3
+ require "set"
3
4
 
4
5
  module ConfigHound
5
6
 
@@ -29,14 +29,16 @@ module ConfigHound
29
29
  when %r{^\w+:/}
30
30
  URI(arg)
31
31
  when %r{^/}
32
- URI("file:#{arg}")
32
+ URI("file://#{arg}")
33
33
  else
34
- URI("file:#{File.expand_path(arg)}")
34
+ URI("file://#{File.expand_path(arg)}")
35
35
  end
36
36
  end
37
37
 
38
38
  end
39
39
 
40
+ attr_reader :uri
41
+
40
42
  def to_s
41
43
  uri.to_s
42
44
  end
@@ -67,8 +69,6 @@ module ConfigHound
67
69
  @uri = uri
68
70
  end
69
71
 
70
- attr_reader :uri
71
-
72
72
  end
73
73
 
74
74
  end
@@ -1,3 +1,3 @@
1
1
  module ConfigHound
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  end
@@ -13,7 +13,7 @@ describe ConfigHound::Resource do
13
13
  let(:path) { uri }
14
14
 
15
15
  it "retains the URI" do
16
- expect(resource.to_s).to eq(uri.to_s)
16
+ expect(resource.uri).to eq uri
17
17
  end
18
18
 
19
19
  end
@@ -23,7 +23,7 @@ describe ConfigHound::Resource do
23
23
  let(:path) { "/path/to/file" }
24
24
 
25
25
  it "assumes it's a file" do
26
- expect(resource.to_s).to eq("file:/path/to/file")
26
+ expect(resource.uri).to eq URI("file:///path/to/file")
27
27
  end
28
28
 
29
29
  describe "#resolve" do
@@ -32,21 +32,21 @@ describe ConfigHound::Resource do
32
32
  it "resolves relatively" do
33
33
  other_resource = resource.resolve("other_file")
34
34
  expect(other_resource).to be_a(ConfigHound::Resource)
35
- expect(other_resource.to_s).to eq("file:/path/to/other_file")
35
+ expect(other_resource.uri).to eq URI("file:///path/to/other_file")
36
36
  end
37
37
  end
38
38
 
39
39
  context "with an absolute file path" do
40
40
  it "resolves relatively" do
41
41
  other_resource = resource.resolve("/different/path")
42
- expect(other_resource.to_s).to eq("file:/different/path")
42
+ expect(other_resource.uri).to eq URI("file:///different/path")
43
43
  end
44
44
  end
45
45
 
46
46
  context "with a fully-qualified URI" do
47
47
  it "uses the URI provided" do
48
48
  other_resource = resource.resolve("http://foo/bar")
49
- expect(other_resource.to_s).to eq("http://foo/bar")
49
+ expect(other_resource.uri).to eq URI("http://foo/bar")
50
50
  end
51
51
  end
52
52
 
@@ -59,7 +59,7 @@ describe ConfigHound::Resource do
59
59
  let(:path) { "config.yml" }
60
60
 
61
61
  it "assumes it's a file relative to $CWD" do
62
- expect(resource.to_s).to eq("file:#{Dir.pwd}/config.yml")
62
+ expect(resource.uri).to eq URI("file://#{Dir.pwd}/config.yml")
63
63
  end
64
64
 
65
65
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_hound
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-23 00:00:00.000000000 Z
11
+ date: 2018-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dig_rb
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.6.13
106
+ rubygems_version: 2.6.14.1
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Sniffs out config, wherever it may be.