nexus_cli 4.1.0 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a7dcf695a6362a17b9b306dc7ca96e214fcdadb3
4
+ data.tar.gz: 37fc7546640803bec9701c0dfd3682d30f433f11
5
+ SHA512:
6
+ metadata.gz: 2e03d6debee792d91a1501b06c02db3d498b6e5bf97e6a8a43c7eb2109e0819c355874883798fc47ad18f36b56716fc1b4865acc9ed167289f2296bc208579f3
7
+ data.tar.gz: 03c4439256bd86a9b72b2774543ded2b2695f77d6b3d21f222df717711c0b75d2111a20a87c3bad5dcf713ba08d1f87a393125c86dfa06b70a896a16833b8fe3
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
@@ -37,6 +37,5 @@ end
37
37
  group :test do
38
38
  gem 'thor'
39
39
  gem 'rake', '>= 0.9.2.2'
40
- gem 'rspec'
41
40
  gem 'fuubar'
42
41
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.0
1
+ 4.1.1
@@ -136,6 +136,27 @@ module NexusCli
136
136
  end
137
137
  end
138
138
 
139
+ # Searches for an artifact using the lucene indexer.
140
+ # requires UI: Search role
141
+ # https://repository.sonatype.org/nexus-indexer-lucene-plugin/default/docs/path__lucene_search.html
142
+ #
143
+ # @param coordinates [String] the Maven identifier
144
+ # @example com.artifact:my-artifact:jar:4.9.*
145
+ #
146
+ # @return [String]
147
+ def search_artifacts_lucene(coordinates)
148
+ artifact = Artifact.new(coordinates)
149
+ query = {:g => artifact.group_id, :a => artifact.artifact_id, :e => artifact.extension, :v => artifact.version, :r => configuration['repository']}
150
+ query.merge!({:c => artifact.classifier}) unless artifact.classifier.nil?
151
+ response = nexus.get(nexus_url("service/local/lucene/search"), query)
152
+ case response.status
153
+ when 200
154
+ return response.content
155
+ else
156
+ raise UnexpectedStatusCodeException.new(response.status)
157
+ end
158
+ end
159
+
139
160
  def transfer_artifact(coordinates, from_repository, to_repository)
140
161
  do_transfer_artifact(coordinates, from_repository, to_repository)
141
162
  end
@@ -58,7 +58,7 @@ module NexusCli
58
58
  # @return [String] A String of XML with information about the desired
59
59
  # repository.
60
60
  def get_repository_info(name)
61
- response = nexus.get(nexus_url("service/local/repositories/#{sanitize_for_id(name)}"))
61
+ response = nexus.get(nexus_url("service/local/repositories/#{sanitize_for_id(name)}"), :header => DEFAULT_ACCEPT_HEADER)
62
62
  case response.status
63
63
  when 200
64
64
  return response.content
@@ -14,6 +14,7 @@ module NexusCli
14
14
  map 'config' => :get_nexus_configuration
15
15
  map 'status' => :get_nexus_status
16
16
  map 'search' => :search_for_artifacts
17
+ map 'search_lucene' => :search_artifacts_lucene
17
18
  map 'search_custom' => :search_artifacts_custom
18
19
  map 'transfer' => :transfer_artifact
19
20
 
@@ -53,6 +54,11 @@ module NexusCli
53
54
  say nexus_remote.search_for_artifacts(coordinates), :green
54
55
  end
55
56
 
57
+ desc "search_artifacts_lucene", "Searches all repositiories with a gaecv maven search using wildcards"
58
+ def search_artifacts_lucene(coordinates)
59
+ say nexus_remote.search_artifacts_lucene(coordinates), :green
60
+ end
61
+
56
62
  desc "get_artifact_custom_info coordinates", "Gets and returns the custom metadata in XML format about a particular artifact."
57
63
  def get_artifact_custom_info(coordinates)
58
64
  raise NotNexusProException unless nexus_remote.kind_of? ProRemote
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ["lib"]
19
19
 
20
20
  s.add_dependency 'thor'
21
- s.add_dependency 'httpclient', '= 2.2.5'
21
+ s.add_dependency 'httpclient', '~> 2.8.0'
22
22
  s.add_dependency 'extlib'
23
23
  s.add_dependency 'json'
24
24
  s.add_dependency 'highline'
@@ -53,7 +53,7 @@ describe NexusCli::Configuration do
53
53
  end
54
54
 
55
55
  before do
56
- YAML.stub(:load_file).and_return(partial_config_file)
56
+ expect(YAML).to receive(:load_file).and_return(partial_config_file)
57
57
  end
58
58
 
59
59
  it "uses non-overridden parts from the file" do
@@ -66,10 +66,6 @@ describe NexusCli::Configuration do
66
66
  subject { from_file }
67
67
  let(:from_file) { configuration.from_file }
68
68
 
69
- before do
70
- YAML.stub(:load_file).and_return(valid_config)
71
- end
72
-
73
69
  context "when the NEXUS_CONFIG environment variable exists" do
74
70
  let(:nexus_config_path) { "/home/var/nexus_cli" }
75
71
 
@@ -78,7 +74,7 @@ describe NexusCli::Configuration do
78
74
  end
79
75
 
80
76
  it "loads the config file from NEXUS_CONFIG" do
81
- YAML.should_receive(:load_file).with(nexus_config_path)
77
+ expect(YAML).to receive(:load_file).with(nexus_config_path)
82
78
  from_file
83
79
  end
84
80
  end
@@ -56,7 +56,7 @@ describe NexusCli do
56
56
  end
57
57
 
58
58
  it "gives you an error when you try to update a user that doesnt exist" do
59
- stub_request(:get, "http://admin:admin123@localhost:8081/nexus/service/local/users/qwertyasdf").
59
+ stub_request(:get, "http://localhost:8081/nexus/service/local/users/qwertyasdf").
60
60
  with(:headers => {
61
61
  'Accept' => 'application/json',
62
62
  'Authorization' => 'Basic YWRtaW46YWRtaW4xMjM='
@@ -72,8 +72,8 @@ describe NexusCli do
72
72
  end
73
73
 
74
74
  it "will return raw xml from the search command" do
75
- stub_request(:get, "http://admin:admin123@localhost:8081/nexus/service/local/data_index?a=something&g=com.something").to_return(:status => 200, :body => fake_xml, :headers => {})
76
- remote.search_for_artifacts("com.something:something").should eq fake_xml
75
+ stub_request(:get, "http://localhost:8081/nexus/service/local/data_index?a=something&g=com.something").to_return(:status => 200, :body => fake_xml, :headers => {})
76
+ expect(remote.search_for_artifacts("com.something:something")).to eq fake_xml
77
77
  end
78
78
 
79
79
  it "gives you errors when you attempt to get an artifact's download url and it cannot be found" do
metadata CHANGED
@@ -1,164 +1,144 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
5
- prerelease:
4
+ version: 4.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kyle Allan
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-29 00:00:00.000000000 Z
11
+ date: 2016-05-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: thor
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: httpclient
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - '='
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
- version: 2.2.5
33
+ version: 2.8.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - '='
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
- version: 2.2.5
40
+ version: 2.8.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: extlib
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: json
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: highline
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: jsonpath
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: chozo
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: 0.6.0
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: 0.6.0
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: activesupport
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ~>
115
+ - - "~>"
132
116
  - !ruby/object:Gem::Version
133
117
  version: 3.2.0
134
118
  type: :runtime
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ~>
122
+ - - "~>"
140
123
  - !ruby/object:Gem::Version
141
124
  version: 3.2.0
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: rspec
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ! '>='
129
+ - - ">="
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ! '>='
136
+ - - ">="
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: aruba
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
143
  - - '='
164
144
  - !ruby/object:Gem::Version
@@ -166,7 +146,6 @@ dependencies:
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
150
  - - '='
172
151
  - !ruby/object:Gem::Version
@@ -174,49 +153,43 @@ dependencies:
174
153
  - !ruby/object:Gem::Dependency
175
154
  name: cucumber
176
155
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
156
  requirements:
179
- - - ! '>='
157
+ - - ">="
180
158
  - !ruby/object:Gem::Version
181
159
  version: '0'
182
160
  type: :development
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
163
  requirements:
187
- - - ! '>='
164
+ - - ">="
188
165
  - !ruby/object:Gem::Version
189
166
  version: '0'
190
167
  - !ruby/object:Gem::Dependency
191
168
  name: rake
192
169
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
170
  requirements:
195
- - - ! '>='
171
+ - - ">="
196
172
  - !ruby/object:Gem::Version
197
173
  version: '0'
198
174
  type: :development
199
175
  prerelease: false
200
176
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
177
  requirements:
203
- - - ! '>='
178
+ - - ">="
204
179
  - !ruby/object:Gem::Version
205
180
  version: '0'
206
181
  - !ruby/object:Gem::Dependency
207
182
  name: webmock
208
183
  requirement: !ruby/object:Gem::Requirement
209
- none: false
210
184
  requirements:
211
- - - ! '>='
185
+ - - ">="
212
186
  - !ruby/object:Gem::Version
213
187
  version: '0'
214
188
  type: :development
215
189
  prerelease: false
216
190
  version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
191
  requirements:
219
- - - ! '>='
192
+ - - ">="
220
193
  - !ruby/object:Gem::Version
221
194
  version: '0'
222
195
  description: A command-line wrapper for making REST calls to Sonatype Nexus.
@@ -227,8 +200,8 @@ executables:
227
200
  extensions: []
228
201
  extra_rdoc_files: []
229
202
  files:
230
- - .gitignore
231
- - .travis.yml
203
+ - ".gitignore"
204
+ - ".travis.yml"
232
205
  - CHANGELOG.md
233
206
  - Gemfile
234
207
  - Guardfile
@@ -277,33 +250,26 @@ files:
277
250
  homepage: https://github.com/RiotGames/nexus_cli
278
251
  licenses:
279
252
  - Apache 2.0
253
+ metadata: {}
280
254
  post_install_message:
281
255
  rdoc_options: []
282
256
  require_paths:
283
257
  - lib
284
258
  required_ruby_version: !ruby/object:Gem::Requirement
285
- none: false
286
259
  requirements:
287
- - - ! '>='
260
+ - - ">="
288
261
  - !ruby/object:Gem::Version
289
262
  version: '0'
290
- segments:
291
- - 0
292
- hash: -445078072146336837
293
263
  required_rubygems_version: !ruby/object:Gem::Requirement
294
- none: false
295
264
  requirements:
296
- - - ! '>='
265
+ - - ">="
297
266
  - !ruby/object:Gem::Version
298
267
  version: '0'
299
- segments:
300
- - 0
301
- hash: -445078072146336837
302
268
  requirements: []
303
269
  rubyforge_project:
304
- rubygems_version: 1.8.23
270
+ rubygems_version: 2.5.1
305
271
  signing_key:
306
- specification_version: 3
272
+ specification_version: 4
307
273
  summary: A command-line wrapper for making REST calls to Sonatype Nexus.
308
274
  test_files:
309
275
  - features/nexus_oss.feature