-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate plugin to use dry-struct from virtus #36
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,6 @@ | |
# | ||
module Maven | ||
module Tools | ||
VERSION = '1.1.7'.freeze | ||
VERSION = '1.2.0'.freeze | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,14 @@ Gem::Specification.new do |s| | |
s.test_files += Dir['spec/**/*gemspec'] | ||
s.test_files += Dir['spec/**/*gem'] | ||
|
||
s.add_runtime_dependency 'virtus', '~> 1.0' | ||
s.add_runtime_dependency 'dry-container', '~> 0.7.2' | ||
s.add_runtime_dependency 'dry-configurable', '~> 0.12.1' | ||
s.add_runtime_dependency 'dry-core', '~> 0.6.0' | ||
s.add_runtime_dependency 'dry-inflector', '~> 0.2.0' | ||
s.add_runtime_dependency 'dry-types', '~> 1.5.1' | ||
s.add_runtime_dependency 'dry-struct', '~> 1.4.0' | ||
s.add_runtime_dependency 'dry-struct-setters', '~> 0.4.0' | ||
Comment on lines
+31
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These were the dependency versions whose releases worked on the version of Ruby in the JRuby dependency |
||
|
||
|
||
# get them out from here until jruby-maven-plugin installs test gems somewhere else then runtime gems | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<modelVersion>4.0.0</modelVersion> | ||
<groupId>rubygems</groupId> | ||
<artifactId>maven-tools</artifactId> | ||
<version>1.1.6</version> | ||
<version>1.2.0</version> | ||
<packaging>gem</packaging> | ||
<name>helpers for maven related tasks</name> | ||
<url>http://github.com/torquebox/maven-tools</url> | ||
|
@@ -19,17 +19,8 @@ | |
</scm> | ||
<repositories> | ||
<repository> | ||
<id>rubygems</id> | ||
<name>Rubygems Proxy</name> | ||
<url>http://rubygems-proxy.torquebox.org/releases</url> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The torquebox domain lapsed recently |
||
<layout>default</layout> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
<updatePolicy>never</updatePolicy> | ||
</snapshots> | ||
<id>mavengems</id> | ||
<url>mavengem:https://rubygems.org</url> | ||
</repository> | ||
</repositories> | ||
<properties> | ||
|
@@ -39,31 +30,67 @@ | |
<dependencies> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>virtus</artifactId> | ||
<version>[1.0,1.99999]</version> | ||
<artifactId>dry-container</artifactId> | ||
<version>0.7.2</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>dry-configurable</artifactId> | ||
<version>0.12.1</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>dry-core</artifactId> | ||
<version>0.6.0</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>dry-inflector</artifactId> | ||
<version>0.2.0</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>dry-types</artifactId> | ||
<version>1.5.1</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>dry-struct</artifactId> | ||
<version>1.4.0</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>dry-struct-setters</artifactId> | ||
<version>0.4.0</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>rake</artifactId> | ||
<version>[10.0,10.99999]</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version ranges didn't seem to work with wagon |
||
<version>10.5.0</version> | ||
<type>gem</type> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>minitest</artifactId> | ||
<version>[5.3,5.99999]</version> | ||
<version>5.15.0</version> | ||
<type>gem</type> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<extensions> | ||
<extension> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>gem-extension</artifactId> | ||
<version>${jruby.plugins.version}</version> | ||
<groupId>org.torquebox.mojo</groupId> | ||
<artifactId>mavengem-wagon</artifactId> | ||
<version>1.0.3</version> | ||
</extension> | ||
</extensions> | ||
<directory>${basedir}/pkg</directory> | ||
|
@@ -72,6 +99,7 @@ | |
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>gem-maven-plugin</artifactId> | ||
<version>${jruby.plugins.version}</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<gemspec>maven-tools.gemspec</gemspec> | ||
</configuration> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,67 +4,67 @@ | |
describe Maven::Tools::Artifact do | ||
|
||
it 'should convert from coordinate' do | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123' ).to_s.must_equal 'sdas:das:jar:tes:123' | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123' ).to_s.must_equal 'sdas:das:jar:123' | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]' ).to_s.must_equal 'sdas:das:jar:tes:[123,234]' | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]' ).to_s.must_equal 'sdas:das:jar:[123,234]' | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:tes:123:[de:fr,gb:us]' | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:123:[de:fr,gb:us]' | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]' | ||
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:[123,234]:[de:fr,gb:us]' | ||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123' ).to_s).must_equal 'sdas:das:jar:tes:123' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minitest was complaining about deprecated calls |
||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123' ).to_s).must_equal 'sdas:das:jar:123' | ||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]' ).to_s).must_equal 'sdas:das:jar:tes:[123,234]' | ||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]' ).to_s).must_equal 'sdas:das:jar:[123,234]' | ||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:tes:123:[de:fr,gb:us]' | ||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:123:[de:fr,gb:us]' | ||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]' | ||
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:[123,234]:[de:fr,gb:us]' | ||
end | ||
|
||
it 'should setup artifact' do | ||
Maven::Tools::Artifact.new( "sdas", "das", "jar", "123", "tes" ).to_s.must_equal 'sdas:das:jar:tes:123' | ||
Maven::Tools::Artifact.new( "sdas", "das", "jar", "123" ).to_s.must_equal 'sdas:das:jar:123' | ||
Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", ["fds:fre"] ).to_s.must_equal 'sdas.asd:das:jar:123:[fds:fre]' | ||
Maven::Tools::Artifact.new( "sdas.asd", "das", "jar","123", "bla", ["fds:fre", "ferf:de"] ).to_s.must_equal 'sdas.asd:das:jar:bla:123:[fds:fre,ferf:de]' | ||
Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", "blub", ["fds:fre", "ferf:de"] ).to_s.must_equal 'sdas.asd:das:jar:blub:123:[fds:fre,ferf:de]' | ||
_(Maven::Tools::Artifact.new( "sdas", "das", "jar", "123", "tes" ).to_s).must_equal 'sdas:das:jar:tes:123' | ||
_(Maven::Tools::Artifact.new( "sdas", "das", "jar", "123" ).to_s).must_equal 'sdas:das:jar:123' | ||
_(Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", ["fds:fre"] ).to_s).must_equal 'sdas.asd:das:jar:123:[fds:fre]' | ||
_(Maven::Tools::Artifact.new( "sdas.asd", "das", "jar","123", "bla", ["fds:fre", "ferf:de"] ).to_s).must_equal 'sdas.asd:das:jar:bla:123:[fds:fre,ferf:de]' | ||
_(Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", "blub", ["fds:fre", "ferf:de"] ).to_s).must_equal 'sdas.asd:das:jar:blub:123:[fds:fre,ferf:de]' | ||
end | ||
|
||
it 'should convert ruby version contraints - gems' do | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '=1' ).to_s.must_equal 'rubygems:asd:gem:[1,1.0.0.0.0.1)' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>=1' ).to_s.must_equal 'rubygems:asd:gem:[1,)' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=1' ).to_s.must_equal 'rubygems:asd:gem:[0,1]' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>1' ).to_s.must_equal 'rubygems:asd:gem:(1,)' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<1' ).to_s.must_equal 'rubygems:asd:gem:[0,1)' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '!=1' ).to_s.must_equal 'rubygems:asd:gem:(1,)' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>1' ).to_s.must_equal 'rubygems:asd:gem:(1,2)' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>1' ).to_s.must_equal 'rubygems:asd:gem:(1,2]' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>=1' ).to_s.must_equal 'rubygems:asd:gem:[1,2)' | ||
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>=1' ).to_s.must_equal 'rubygems:asd:gem:[1,2]' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '=1' ).to_s).must_equal 'rubygems:asd:gem:[1,1.0.0.0.0.1)' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>=1' ).to_s).must_equal 'rubygems:asd:gem:[1,)' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=1' ).to_s).must_equal 'rubygems:asd:gem:[0,1]' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>1' ).to_s).must_equal 'rubygems:asd:gem:(1,)' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<1' ).to_s).must_equal 'rubygems:asd:gem:[0,1)' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '!=1' ).to_s).must_equal 'rubygems:asd:gem:(1,)' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>1' ).to_s).must_equal 'rubygems:asd:gem:(1,2)' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>1' ).to_s).must_equal 'rubygems:asd:gem:(1,2]' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>=1' ).to_s).must_equal 'rubygems:asd:gem:[1,2)' | ||
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>=1' ).to_s).must_equal 'rubygems:asd:gem:[1,2]' | ||
end | ||
|
||
it 'should convert ruby version contraints - jars' do | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '=1' ).to_s.must_equal 'org.something:asd:jar:[1,1.0.0.0.0.1)' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>=1' ).to_s.must_equal 'org.something:asd:jar:[1,)' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=1' ).to_s.must_equal 'org.something:asd:jar:[0,1]' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>1' ).to_s.must_equal 'org.something:asd:jar:(1,)' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<1' ).to_s.must_equal 'org.something:asd:jar:[0,1)' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '!=1' ).to_s.must_equal 'org.something:asd:jar:(1,)' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>1' ).to_s.must_equal 'org.something:asd:jar:(1,2)' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>1' ).to_s.must_equal 'org.something:asd:jar:(1,2]' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>=1' ).to_s.must_equal 'org.something:asd:jar:[1,2)' | ||
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>=1' ).to_s.must_equal 'org.something:asd:jar:[1,2]' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '=1' ).to_s).must_equal 'org.something:asd:jar:[1,1.0.0.0.0.1)' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>=1' ).to_s).must_equal 'org.something:asd:jar:[1,)' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=1' ).to_s).must_equal 'org.something:asd:jar:[0,1]' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>1' ).to_s).must_equal 'org.something:asd:jar:(1,)' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<1' ).to_s).must_equal 'org.something:asd:jar:[0,1)' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '!=1' ).to_s).must_equal 'org.something:asd:jar:(1,)' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>1' ).to_s).must_equal 'org.something:asd:jar:(1,2)' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>1' ).to_s).must_equal 'org.something:asd:jar:(1,2]' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>=1' ).to_s).must_equal 'org.something:asd:jar:[1,2)' | ||
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>=1' ).to_s).must_equal 'org.something:asd:jar:[1,2]' | ||
end | ||
|
||
it 'passes in scope to artifact' do | ||
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1' ) | ||
a.to_s.must_equal 'org.something:asd:jar:1' | ||
_(a.to_s).must_equal 'org.something:asd:jar:1' | ||
a[ :scope ].must_be_nil | ||
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1', :scope => :provided ) | ||
a.to_s.must_equal 'org.something:asd:jar:1' | ||
a[ :scope ].must_equal :provided | ||
_(a.to_s).must_equal 'org.something:asd:jar:1' | ||
_(a[ :scope ]).must_equal :provided | ||
end | ||
it 'passes in exclusions to artifact' do | ||
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1' ) | ||
a.to_s.must_equal 'org.something:asd:jar:1' | ||
_(a.to_s).must_equal 'org.something:asd:jar:1' | ||
a[ :exclusions ].must_be_nil | ||
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1', :exclusions => ["org.something:dsa"] ) | ||
a.to_s.must_equal 'org.something:asd:jar:1:[org.something:dsa]' | ||
a[ :exclusions ].must_equal [ 'org.something:dsa' ] | ||
_(a.to_s).must_equal 'org.something:asd:jar:1:[org.something:dsa]' | ||
_(a[ :exclusions ]).must_equal [ 'org.something:dsa' ] | ||
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1', :exclusions => ["org.something:dsa", "org.anything:qwe"] ) | ||
a.to_s.must_equal 'org.something:asd:jar:1:[org.something:dsa,org.anything:qwe]' | ||
a[ :exclusions ].must_equal [ 'org.something:dsa', 'org.anything:qwe' ] | ||
_(a.to_s).must_equal 'org.something:asd:jar:1:[org.something:dsa,org.anything:qwe]' | ||
_(a[ :exclusions ]).must_equal [ 'org.something:dsa', 'org.anything:qwe' ] | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured
1.2
due to the dependency changes