rnexus 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nexus/artifact.rb +29 -0
- data/lib/{repository.rb → nexus/repository.rb} +0 -0
- data/lib/rnexus.rb +2 -2
- data/test/artifact_test.rb +25 -4
- metadata +34 -21
- data/.document +0 -5
- data/.gitignore +0 -5
- data/Rakefile +0 -58
- data/VERSION +0 -1
- data/lib/artifact.rb +0 -13
- data/rnexus.gemspec +0 -60
@@ -0,0 +1,29 @@
|
|
1
|
+
class Nexus::Artifact
|
2
|
+
attr_accessor :group, :name, :version, :type, :uri, :repo, :classifier
|
3
|
+
|
4
|
+
def initialize(parameters)
|
5
|
+
@group = parameters['groupId']
|
6
|
+
@name = parameters['artifactId']
|
7
|
+
@version = parameters['version']
|
8
|
+
@type = parameters['packaging']
|
9
|
+
@uri = parameters['resourceURI']
|
10
|
+
@repo = parameters['repoId']
|
11
|
+
@classifier = parameters['classifier']
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_hash
|
15
|
+
hash = {}
|
16
|
+
hash['groupId'] = group
|
17
|
+
hash['artifactId'] = name
|
18
|
+
hash['version'] = version
|
19
|
+
hash['packaging'] = type
|
20
|
+
hash['resourceURI'] = uri
|
21
|
+
hash['repoId'] = repo
|
22
|
+
hash['classifier'] = classifier
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
|
26
|
+
def == other
|
27
|
+
to_hash == other.to_hash
|
28
|
+
end
|
29
|
+
end
|
File without changes
|
data/lib/rnexus.rb
CHANGED
data/test/artifact_test.rb
CHANGED
@@ -1,20 +1,41 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class ArtifactTest < Test::Unit::TestCase
|
4
|
-
def
|
5
|
-
|
4
|
+
def setup
|
5
|
+
@hash = {
|
6
6
|
'groupId' => 'group',
|
7
7
|
'artifactId' => 'name',
|
8
8
|
'version' => 'version',
|
9
9
|
'packaging' => 'war',
|
10
10
|
'resourceURI' => 'uri',
|
11
|
-
'repoId' => 'repo'
|
12
|
-
|
11
|
+
'repoId' => 'repo',
|
12
|
+
'classifier' => 'classifier'
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_construction_from_a_hash
|
17
|
+
artifact = Nexus::Artifact.new @hash
|
18
|
+
|
13
19
|
assert_equal('group', artifact.group)
|
14
20
|
assert_equal('name', artifact.name)
|
15
21
|
assert_equal('version', artifact.version)
|
16
22
|
assert_equal('war', artifact.type)
|
17
23
|
assert_equal('uri', artifact.uri)
|
18
24
|
assert_equal('repo', artifact.repo)
|
25
|
+
assert_equal('classifier', artifact.classifier)
|
19
26
|
end
|
27
|
+
|
28
|
+
def test_serialization_to_a_hash
|
29
|
+
artifact = Nexus::Artifact.new @hash
|
30
|
+
assert_equal @hash, artifact.to_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_serialization_to_a_hash_roundtrips
|
34
|
+
artifact = Nexus::Artifact.new @hash
|
35
|
+
assert_equal artifact, Nexus::Artifact.new(artifact.to_hash)
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_artifact_equality
|
39
|
+
assert(Nexus::Artifact.new(@hash) == Nexus::Artifact.new(@hash))
|
40
|
+
end
|
20
41
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rnexus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Darrin Holst
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-23 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -50,26 +50,37 @@ dependencies:
|
|
50
50
|
version: 0.1.3
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: fakeweb
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 27
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 3
|
65
|
+
- 0
|
66
|
+
version: 1.3.0
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
53
69
|
description:
|
54
|
-
email:
|
70
|
+
email:
|
71
|
+
- darrinholst@gmail.com
|
55
72
|
executables: []
|
56
73
|
|
57
74
|
extensions: []
|
58
75
|
|
59
|
-
extra_rdoc_files:
|
60
|
-
|
61
|
-
- README.rdoc
|
76
|
+
extra_rdoc_files: []
|
77
|
+
|
62
78
|
files:
|
63
|
-
- .
|
64
|
-
- .
|
79
|
+
- lib/nexus/artifact.rb
|
80
|
+
- lib/nexus/repository.rb
|
81
|
+
- lib/rnexus.rb
|
65
82
|
- LICENSE
|
66
83
|
- README.rdoc
|
67
|
-
- Rakefile
|
68
|
-
- VERSION
|
69
|
-
- lib/artifact.rb
|
70
|
-
- lib/repository.rb
|
71
|
-
- lib/rnexus.rb
|
72
|
-
- rnexus.gemspec
|
73
84
|
- test/artifact_test.rb
|
74
85
|
- test/repository_test.rb
|
75
86
|
- test/test_helper.rb
|
@@ -78,8 +89,8 @@ homepage: http://github.com/darrinholst/rnexus
|
|
78
89
|
licenses: []
|
79
90
|
|
80
91
|
post_install_message:
|
81
|
-
rdoc_options:
|
82
|
-
|
92
|
+
rdoc_options: []
|
93
|
+
|
83
94
|
require_paths:
|
84
95
|
- lib
|
85
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -96,10 +107,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
107
|
requirements:
|
97
108
|
- - ">="
|
98
109
|
- !ruby/object:Gem::Version
|
99
|
-
hash:
|
110
|
+
hash: 23
|
100
111
|
segments:
|
101
|
-
-
|
102
|
-
|
112
|
+
- 1
|
113
|
+
- 3
|
114
|
+
- 6
|
115
|
+
version: 1.3.6
|
103
116
|
requirements: []
|
104
117
|
|
105
118
|
rubyforge_project:
|
data/.document
DELETED
data/Rakefile
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "rnexus"
|
8
|
-
gem.summary = %Q{a ruby wrapper to interact with a nexus maven repository}
|
9
|
-
gem.email = "darrinholst@gmail.com"
|
10
|
-
gem.homepage = "http://github.com/darrinholst/rnexus"
|
11
|
-
gem.authors = ["Darrin Holst"]
|
12
|
-
gem.add_dependency("rest-client", "~> 1.6.1")
|
13
|
-
gem.add_dependency("crack", "~> 0.1.3")
|
14
|
-
end
|
15
|
-
|
16
|
-
Jeweler::GemcutterTasks.new
|
17
|
-
rescue LoadError
|
18
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
19
|
-
end
|
20
|
-
|
21
|
-
require 'rake/testtask'
|
22
|
-
Rake::TestTask.new(:test) do |test|
|
23
|
-
test.libs << 'lib' << 'test'
|
24
|
-
test.pattern = 'test/**/*_test.rb'
|
25
|
-
test.verbose = true
|
26
|
-
end
|
27
|
-
|
28
|
-
begin
|
29
|
-
require 'rcov/rcovtask'
|
30
|
-
Rcov::RcovTask.new do |test|
|
31
|
-
test.libs << 'test'
|
32
|
-
test.pattern = 'test/**/*_test.rb'
|
33
|
-
test.verbose = true
|
34
|
-
end
|
35
|
-
rescue LoadError
|
36
|
-
task :rcov do
|
37
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
task :default => :test
|
43
|
-
|
44
|
-
require 'rake/rdoctask'
|
45
|
-
Rake::RDocTask.new do |rdoc|
|
46
|
-
if File.exist?('VERSION.yml')
|
47
|
-
config = YAML.load(File.read('VERSION.yml'))
|
48
|
-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
49
|
-
else
|
50
|
-
version = ""
|
51
|
-
end
|
52
|
-
|
53
|
-
rdoc.rdoc_dir = 'rdoc'
|
54
|
-
rdoc.title = "rnexus #{version}"
|
55
|
-
rdoc.rdoc_files.include('README*')
|
56
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
57
|
-
end
|
58
|
-
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.6
|
data/lib/artifact.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
class Nexus::Artifact
|
2
|
-
attr_accessor :group, :name, :version, :type, :uri, :repo, :classifier
|
3
|
-
|
4
|
-
def initialize(parameters)
|
5
|
-
self.group = parameters['groupId']
|
6
|
-
self.name = parameters['artifactId']
|
7
|
-
self.version = parameters['version']
|
8
|
-
self.type = parameters['packaging']
|
9
|
-
self.uri = parameters['resourceURI']
|
10
|
-
self.repo = parameters['repoId']
|
11
|
-
self.classifier = parameters['classifier']
|
12
|
-
end
|
13
|
-
end
|
data/rnexus.gemspec
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{rnexus}
|
8
|
-
s.version = "0.0.6"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Darrin Holst"]
|
12
|
-
s.date = %q{2010-10-12}
|
13
|
-
s.email = %q{darrinholst@gmail.com}
|
14
|
-
s.extra_rdoc_files = [
|
15
|
-
"LICENSE",
|
16
|
-
"README.rdoc"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
".document",
|
20
|
-
".gitignore",
|
21
|
-
"LICENSE",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION",
|
25
|
-
"lib/artifact.rb",
|
26
|
-
"lib/repository.rb",
|
27
|
-
"lib/rnexus.rb",
|
28
|
-
"rnexus.gemspec",
|
29
|
-
"test/artifact_test.rb",
|
30
|
-
"test/repository_test.rb",
|
31
|
-
"test/test_helper.rb"
|
32
|
-
]
|
33
|
-
s.homepage = %q{http://github.com/darrinholst/rnexus}
|
34
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
35
|
-
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version = %q{1.3.7}
|
37
|
-
s.summary = %q{a ruby wrapper to interact with a nexus maven repository}
|
38
|
-
s.test_files = [
|
39
|
-
"test/artifact_test.rb",
|
40
|
-
"test/repository_test.rb",
|
41
|
-
"test/test_helper.rb"
|
42
|
-
]
|
43
|
-
|
44
|
-
if s.respond_to? :specification_version then
|
45
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
|
-
s.specification_version = 3
|
47
|
-
|
48
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
-
s.add_runtime_dependency(%q<rest-client>, ["~> 1.6.1"])
|
50
|
-
s.add_runtime_dependency(%q<crack>, ["~> 0.1.3"])
|
51
|
-
else
|
52
|
-
s.add_dependency(%q<rest-client>, ["~> 1.6.1"])
|
53
|
-
s.add_dependency(%q<crack>, ["~> 0.1.3"])
|
54
|
-
end
|
55
|
-
else
|
56
|
-
s.add_dependency(%q<rest-client>, ["~> 1.6.1"])
|
57
|
-
s.add_dependency(%q<crack>, ["~> 0.1.3"])
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|