nexus_cli 4.0.2 → 4.0.3
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.
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/nexus_cli/configuration.rb +18 -3
- data/spec/unit/nexus_cli/configuration_spec.rb +23 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -83,13 +83,13 @@ There are also two global config options, `--overrides` which overrides the conf
|
|
83
83
|
## Pull Artifact Example
|
84
84
|
|
85
85
|
```
|
86
|
-
nexus-cli pull_artifact com.mycompany.artifacts:myartifact:1.0.0
|
86
|
+
nexus-cli pull_artifact com.mycompany.artifacts:myartifact:tgz:1.0.0
|
87
87
|
```
|
88
88
|
|
89
89
|
## Push Artifact Example
|
90
90
|
|
91
91
|
```
|
92
|
-
nexus-cli push_artifact com.mycompany.artifacts:myartifact:1.0.0
|
92
|
+
nexus-cli push_artifact com.mycompany.artifacts:myartifact:tgz:1.0.0 ~/path/to/file/to/push/myartifact.tgz
|
93
93
|
```
|
94
94
|
|
95
95
|
## Search Example
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.0.
|
1
|
+
4.0.3
|
@@ -21,7 +21,10 @@ module NexusCli
|
|
21
21
|
def from_overrides(overrides)
|
22
22
|
raise MissingSettingsFileException unless overrides
|
23
23
|
overrides = overrides.with_indifferent_access
|
24
|
-
|
24
|
+
|
25
|
+
configuration = (load_config || Hash.new).with_indifferent_access
|
26
|
+
configuration.merge!(overrides)
|
27
|
+
new(configuration)
|
25
28
|
end
|
26
29
|
|
27
30
|
# Creates a new instance of the Configuration object from the config file
|
@@ -29,9 +32,8 @@ module NexusCli
|
|
29
32
|
#
|
30
33
|
# @return [NexusCli::Configuration]
|
31
34
|
def from_file
|
32
|
-
config =
|
35
|
+
config = load_config
|
33
36
|
raise MissingSettingsFileException unless config
|
34
|
-
|
35
37
|
config = config.with_indifferent_access
|
36
38
|
new(config)
|
37
39
|
end
|
@@ -47,6 +49,19 @@ module NexusCli
|
|
47
49
|
raise InvalidSettingsException.new(config.errors)
|
48
50
|
end
|
49
51
|
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
# Loads the config file
|
56
|
+
#
|
57
|
+
# @return [Hash]
|
58
|
+
def load_config
|
59
|
+
begin
|
60
|
+
config = YAML.load_file(file_path)
|
61
|
+
rescue Errno::ENOENT
|
62
|
+
nil
|
63
|
+
end
|
64
|
+
end
|
50
65
|
end
|
51
66
|
|
52
67
|
def validate!
|
@@ -38,6 +38,28 @@ describe NexusCli::Configuration do
|
|
38
38
|
expect { from_overrides.validate! }.not_to raise_error
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
context "when a config file exists" do
|
43
|
+
let(:from_overrides) { configuration.from_overrides(partial_override) }
|
44
|
+
let(:partial_override) do
|
45
|
+
{
|
46
|
+
"repository" => "foobar"
|
47
|
+
}
|
48
|
+
end
|
49
|
+
let(:partial_config_file) do
|
50
|
+
{
|
51
|
+
"url" => "http://somewebsite.com"
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
before do
|
56
|
+
YAML.stub(:load_file).and_return(partial_config_file)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "uses non-overridden parts from the file" do
|
60
|
+
expect(from_overrides.url).to eql("http://somewebsite.com")
|
61
|
+
end
|
62
|
+
end
|
41
63
|
end
|
42
64
|
|
43
65
|
describe "::from_file" do
|
@@ -112,7 +134,7 @@ describe NexusCli::Configuration do
|
|
112
134
|
let(:repository_config) { described_class.new(url: url, repository: repository, username: username, password: password) }
|
113
135
|
|
114
136
|
it "returns the repository" do
|
115
|
-
expect(
|
137
|
+
expect(repository_config.repository).to eq("releases")
|
116
138
|
end
|
117
139
|
|
118
140
|
context "when repository has illegal values" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexus_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
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: 2013-
|
12
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -288,7 +288,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
288
288
|
version: '0'
|
289
289
|
segments:
|
290
290
|
- 0
|
291
|
-
hash:
|
291
|
+
hash: 1086708981034420466
|
292
292
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
293
293
|
none: false
|
294
294
|
requirements:
|
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
297
297
|
version: '0'
|
298
298
|
segments:
|
299
299
|
- 0
|
300
|
-
hash:
|
300
|
+
hash: 1086708981034420466
|
301
301
|
requirements: []
|
302
302
|
rubyforge_project:
|
303
303
|
rubygems_version: 1.8.23
|