nexus 1.4.0 → 1.5.1
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.
- checksums.yaml +5 -5
- data/lib/commands/abstract_command.rb +5 -0
- data/lib/commands/nexus.rb +5 -0
- data/lib/nexus/cipher.rb +5 -0
- data/lib/nexus/config.rb +5 -0
- data/lib/nexus/config_file.rb +8 -3
- data/lib/nexus/version.rb +6 -1
- data/lib/rubygems_plugin.rb +5 -0
- data/test/abstract_command_test.rb +5 -20
- data/test/cipher_test.rb +5 -0
- data/test/command_helper.rb +6 -1
- data/test/config_test.rb +7 -2
- data/test/configfile_test.rb +6 -1
- data/test/nexus_command_test.rb +11 -6
- metadata +11 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 210f5f076cb3baa04605d4761e4976f03901da8dbf4105e68b53067d31028772
|
|
4
|
+
data.tar.gz: 965602324a55a6f5a684cde56ac7aa66355acdde0ad43d5454371707b4a0547b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4771813a366dbb775ce709e2a51e01189aa7a1c3bf8bbf6cf5084c057e62c95e0d5d24007f8fc8edb5499602dd806a51446826b22c556cac36c0fd7c9076ba65
|
|
7
|
+
data.tar.gz: c73b63ddb527c01ace95b4e5a69d3da2922a35c76c9c8ca471a556f22ee1f4d85237eb41b43cf674d1b5912794926392d20e4b438ecba8f0d796bc651f1bccd1
|
data/lib/commands/nexus.rb
CHANGED
data/lib/nexus/cipher.rb
CHANGED
data/lib/nexus/config.rb
CHANGED
data/lib/nexus/config_file.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
|
3
|
+
# "Sonatype" is a trademark of Sonatype, Inc.
|
|
4
|
+
#
|
|
5
|
+
|
|
1
6
|
require 'rubygems/local_remote_options'
|
|
2
7
|
require 'net/http'
|
|
3
8
|
require 'base64'
|
|
@@ -14,7 +19,7 @@ module Nexus
|
|
|
14
19
|
if configfile.is_a?( String )
|
|
15
20
|
@file = configfile
|
|
16
21
|
|
|
17
|
-
if File.
|
|
22
|
+
if File.exist?( configfile )
|
|
18
23
|
@all = YAML.load( ::File.read( configfile ) )
|
|
19
24
|
else
|
|
20
25
|
store # make sure we can write it
|
|
@@ -99,8 +104,8 @@ module Nexus
|
|
|
99
104
|
|
|
100
105
|
def store
|
|
101
106
|
dirname = File.dirname( @file )
|
|
102
|
-
Dir.mkdir( dirname ) unless File.
|
|
103
|
-
new = !File.
|
|
107
|
+
Dir.mkdir( dirname ) unless File.exist?( dirname )
|
|
108
|
+
new = !File.exist?( @file )
|
|
104
109
|
|
|
105
110
|
File.open( @file, 'w') do |f|
|
|
106
111
|
f.write @all.to_yaml
|
data/lib/nexus/version.rb
CHANGED
data/lib/rubygems_plugin.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
|
3
|
+
# "Sonatype" is a trademark of Sonatype, Inc.
|
|
4
|
+
#
|
|
5
|
+
|
|
1
6
|
require 'command_helper'
|
|
2
7
|
|
|
3
8
|
class Gem::Commands::FakeCommand < Gem::AbstractCommand
|
|
@@ -128,26 +133,6 @@ class AbstractCommandTest < CommandTest
|
|
|
128
133
|
end
|
|
129
134
|
end
|
|
130
135
|
|
|
131
|
-
context 'separeted config per repo key' do
|
|
132
|
-
should 'store the config on per key' do
|
|
133
|
-
config_path = File.join( 'pkg', 'configrepo')
|
|
134
|
-
FileUtils.rm_f( config_path )
|
|
135
|
-
@command.options[ :nexus_config ] = config_path
|
|
136
|
-
@command.options[ :nexus_repo ] = :first
|
|
137
|
-
@command.config.url = :thing
|
|
138
|
-
@command.options[ :nexus_repo ] = :second
|
|
139
|
-
@command.send :instance_variable_set, '@config'.to_sym, nil
|
|
140
|
-
@command.config.url = :otherthing
|
|
141
|
-
@command.options[ :nexus_repo ] = nil
|
|
142
|
-
@command.send :instance_variable_set, '@config'.to_sym, nil
|
|
143
|
-
@command.config.url = :nothing
|
|
144
|
-
assert_equal( Gem.configuration.load_file(config_path),
|
|
145
|
-
{ :first => {:url => :thing},
|
|
146
|
-
:second => {:url => :otherthing},
|
|
147
|
-
:url => :nothing } )
|
|
148
|
-
end
|
|
149
|
-
end
|
|
150
|
-
|
|
151
136
|
context "clear username + password" do
|
|
152
137
|
|
|
153
138
|
should "clear stored authorization" do
|
data/test/cipher_test.rb
CHANGED
data/test/command_helper.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
|
3
|
+
# "Sonatype" is a trademark of Sonatype, Inc.
|
|
4
|
+
#
|
|
5
|
+
|
|
1
6
|
require 'minitest/autorun'
|
|
2
7
|
|
|
3
8
|
require 'shoulda'
|
|
@@ -37,7 +42,7 @@ class CommandTest < ActiveSupport::TestCase
|
|
|
37
42
|
end
|
|
38
43
|
|
|
39
44
|
def stub_config(config)
|
|
40
|
-
file = Gem::ConfigFile.new(
|
|
45
|
+
file = Gem::ConfigFile.new([])
|
|
41
46
|
config.each { |key, value| file[key] = value }
|
|
42
47
|
stub(Gem).configuration { config }
|
|
43
48
|
end
|
data/test/config_test.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
|
3
|
+
# "Sonatype" is a trademark of Sonatype, Inc.
|
|
4
|
+
#
|
|
5
|
+
|
|
1
6
|
require 'minitest/autorun'
|
|
2
7
|
require 'shoulda'
|
|
3
8
|
require 'fileutils'
|
|
@@ -87,7 +92,7 @@ class ConfigTest < ::MiniTest::Unit::TestCase
|
|
|
87
92
|
end
|
|
88
93
|
|
|
89
94
|
Nexus::Config.new( file ).new_secrets( sfile )
|
|
90
|
-
assert File.
|
|
95
|
+
assert File.exist?( sfile ), true
|
|
91
96
|
|
|
92
97
|
repos.each do |repo|
|
|
93
98
|
c = Nexus::Config.new( sfile, repo )
|
|
@@ -105,7 +110,7 @@ class ConfigTest < ::MiniTest::Unit::TestCase
|
|
|
105
110
|
end
|
|
106
111
|
|
|
107
112
|
Nexus::Config.new( file ).new_secrets( nil )
|
|
108
|
-
assert_equal File.
|
|
113
|
+
assert_equal File.exist?( sfile ), false
|
|
109
114
|
|
|
110
115
|
repos.each do |repo|
|
|
111
116
|
c = Nexus::Config.new( file, repo )
|
data/test/configfile_test.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
|
3
|
+
# "Sonatype" is a trademark of Sonatype, Inc.
|
|
4
|
+
#
|
|
5
|
+
|
|
1
6
|
require 'minitest/autorun'
|
|
2
7
|
require 'shoulda'
|
|
3
8
|
require 'fileutils'
|
|
@@ -9,7 +14,7 @@ class ConfigTest < ::MiniTest::Unit::TestCase
|
|
|
9
14
|
context 'file' do
|
|
10
15
|
|
|
11
16
|
should 'store key/values' do
|
|
12
|
-
file = File.join(
|
|
17
|
+
file = File.join('pkg', 'cfg' )
|
|
13
18
|
FileUtils.rm_f file
|
|
14
19
|
f = Nexus::ConfigFile.new( file )
|
|
15
20
|
f[ 'asd_key', nil ] = 'dsa_value'
|
data/test/nexus_command_test.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
|
3
|
+
# "Sonatype" is a trademark of Sonatype, Inc.
|
|
4
|
+
#
|
|
5
|
+
|
|
1
6
|
require 'command_helper'
|
|
2
7
|
require 'fileutils'
|
|
3
8
|
|
|
@@ -152,8 +157,8 @@ class NexusCommandTest < CommandTest
|
|
|
152
157
|
@command.options[ :nexus_clear_all ] = true
|
|
153
158
|
mock(@command).ask( 'delete all current credentials ? (y/N)' ){ 'y' }
|
|
154
159
|
@command.execute
|
|
155
|
-
assert_equal( File.
|
|
156
|
-
assert_equal( File.
|
|
160
|
+
assert_equal( File.exist?( @with + ".config" ), true )
|
|
161
|
+
assert_equal( File.exist?( @with + ".secrets" ), false )
|
|
157
162
|
|
|
158
163
|
@command.options.delete( :nexus_clear_all )
|
|
159
164
|
mock(@command).sign_in
|
|
@@ -194,7 +199,7 @@ class NexusCommandTest < CommandTest
|
|
|
194
199
|
@command.options[ :nexus_config ] = @with + ".config"
|
|
195
200
|
@command.options[ :nexus_secrets ] = false
|
|
196
201
|
@command.execute
|
|
197
|
-
assert_equal( File.
|
|
202
|
+
assert_equal( File.exist?( @with + ".secrets" ), false )
|
|
198
203
|
|
|
199
204
|
@command.options.delete( :nexus_secrets )
|
|
200
205
|
mock(@command).send_gem
|
|
@@ -206,7 +211,7 @@ class NexusCommandTest < CommandTest
|
|
|
206
211
|
@command.options[ :nexus_config ] = @with
|
|
207
212
|
@command.options[ :nexus_secrets ] = @with + '.newsecrets'
|
|
208
213
|
@command.execute
|
|
209
|
-
assert_equal( File.
|
|
214
|
+
assert_equal( File.exist?( @with + ".newsecrets" ), true )
|
|
210
215
|
|
|
211
216
|
@command.options.delete( :nexus_secrets )
|
|
212
217
|
mock(@command).send_gem
|
|
@@ -218,8 +223,8 @@ class NexusCommandTest < CommandTest
|
|
|
218
223
|
@command.options[ :nexus_config ] = @with + ".config"
|
|
219
224
|
@command.options[ :nexus_secrets ] = @with + '.newsecrets'
|
|
220
225
|
@command.execute
|
|
221
|
-
assert_equal( File.
|
|
222
|
-
assert_equal( File.
|
|
226
|
+
assert_equal( File.exist?( @with + ".secrets" ), false )
|
|
227
|
+
assert_equal( File.exist?( @with + ".newsecrets" ), true )
|
|
223
228
|
|
|
224
229
|
@command.options.delete( :nexus_secrets )
|
|
225
230
|
mock(@command).send_gem
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nexus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
autorequire:
|
|
7
|
+
- Sonatype
|
|
8
|
+
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2023-12-28 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: rake
|
|
@@ -17,14 +16,14 @@ dependencies:
|
|
|
17
16
|
requirements:
|
|
18
17
|
- - "~>"
|
|
19
18
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: '
|
|
19
|
+
version: '13.1'
|
|
21
20
|
type: :development
|
|
22
21
|
prerelease: false
|
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
23
|
requirements:
|
|
25
24
|
- - "~>"
|
|
26
25
|
- !ruby/object:Gem::Version
|
|
27
|
-
version: '
|
|
26
|
+
version: '13.1'
|
|
28
27
|
- !ruby/object:Gem::Dependency
|
|
29
28
|
name: shoulda
|
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -103,8 +102,7 @@ dependencies:
|
|
|
103
102
|
version: '2.4'
|
|
104
103
|
description: Adds a command to RubyGems for uploading gems to a nexus server.
|
|
105
104
|
email:
|
|
106
|
-
-
|
|
107
|
-
- m.kristian@web.de
|
|
105
|
+
- nexus-gem@sonatype.com
|
|
108
106
|
executables:
|
|
109
107
|
- nbundle
|
|
110
108
|
extensions: []
|
|
@@ -126,11 +124,11 @@ files:
|
|
|
126
124
|
- test/config_test.rb
|
|
127
125
|
- test/configfile_test.rb
|
|
128
126
|
- test/nexus_command_test.rb
|
|
129
|
-
homepage: https://
|
|
127
|
+
homepage: https://links.sonatype.com/products/nxrm3/docs/nexus-gem
|
|
130
128
|
licenses:
|
|
131
129
|
- MIT
|
|
132
130
|
metadata: {}
|
|
133
|
-
post_install_message:
|
|
131
|
+
post_install_message:
|
|
134
132
|
rdoc_options: []
|
|
135
133
|
require_paths:
|
|
136
134
|
- lib
|
|
@@ -145,9 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
145
143
|
- !ruby/object:Gem::Version
|
|
146
144
|
version: '0'
|
|
147
145
|
requirements: []
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
signing_key:
|
|
146
|
+
rubygems_version: 3.5.3
|
|
147
|
+
signing_key:
|
|
151
148
|
specification_version: 4
|
|
152
149
|
summary: Gem Command to interact with Nexus server
|
|
153
150
|
test_files: []
|