ruby-maven 3.3.8 → 3.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +2 -1
- data/Gemfile +3 -0
- data/Mavenfile +8 -8
- data/README.md +71 -0
- data/Rakefile +33 -0
- data/lib/maven/ruby/maven.rb +7 -3
- data/lib/maven/ruby/version.rb +1 -1
- data/lib/ruby_maven.rb +27 -12
- data/ruby-maven.gemspec +1 -1
- data/spec/maven_ruby_maven_spec.rb +39 -0
- data/spec/maven_ruby_maven_spec.rb~ +55 -0
- data/spec/ruby_maven_spec.rb +15 -22
- data/spec/setup.rb +21 -1
- metadata +7 -3
- data/.gitignore +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 807c782954acf707feffc26aed345ea99d62ebae
|
4
|
+
data.tar.gz: 275062d1e8ccaac102e5a4a486c27e2389556c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6788c4e87be241c50c8e8ba2a5c9f05d8a11bab1f44086e6badf81248f39b291bc0620cc7c378f55c20df976bea4d61389367df77ddf4dfaa38092d49e1f8668
|
7
|
+
data.tar.gz: a3b8a90e850629739ee3a3de890c5ebbd451f772995f68de2f9b6813f3d8b78fd905570055f76c820b490d51f9de12f952b7ef944d4ff137932d764f5b115456
|
data/.mvn/extensions.xml
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!-- from ruby-maven gem -->
|
2
3
|
<extensions>
|
3
4
|
<extension>
|
4
5
|
<groupId>io.takari.polyglot</groupId>
|
5
6
|
<artifactId>polyglot-ruby</artifactId>
|
6
|
-
<version>0.1.
|
7
|
+
<version>0.1.15</version>
|
7
8
|
</extension>
|
8
9
|
</extensions>
|
data/Gemfile
ADDED
data/Mavenfile
CHANGED
@@ -6,18 +6,18 @@ distribution_management do
|
|
6
6
|
repository :id => :ossrh, :url => 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
7
7
|
end
|
8
8
|
|
9
|
-
plugin :deploy, '2.8.2' do
|
10
|
-
execute_goal :deploy, :phase => :deploy, :id => 'deploy gem to maven central', :skip => '${deploy.skip}'
|
11
|
-
end
|
9
|
+
#plugin :deploy, '2.8.2' do
|
10
|
+
# execute_goal :deploy, :phase => :deploy, :id => 'deploy gem to maven central', :skip => '${deploy.skip}'
|
11
|
+
#end
|
12
12
|
|
13
|
-
properties 'push.skip' => true
|
13
|
+
properties 'push.skip' => true #, 'deploy.skip' => true
|
14
14
|
|
15
15
|
profile :id => :release do
|
16
16
|
properties 'maven.test.skip' => true, 'invoker.skip' => true
|
17
|
-
properties 'push.skip' => false
|
18
|
-
plugin :gpg, '1.5' do
|
19
|
-
execute_goal :sign, :id => 'sign artifacts', :phase => :verify
|
20
|
-
end
|
17
|
+
properties 'push.skip' => false #, 'deploy.skip' => false
|
18
|
+
# plugin :gpg, '1.5' do
|
19
|
+
# execute_goal :sign, :id => 'sign artifacts', :phase => :verify
|
20
|
+
# end
|
21
21
|
build do
|
22
22
|
default_goal :deploy
|
23
23
|
end
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# ruby maven #
|
2
|
+
|
3
|
+
this is a ruby wrapper around [maven-3.3.x](http://maven.apache.org)
|
4
|
+
and comes with the ruby DSL from
|
5
|
+
[Polyglot Maven](https://github.com/takari/polyglot-maven)
|
6
|
+
preconfigured.
|
7
|
+
|
8
|
+
## command line ###
|
9
|
+
|
10
|
+
just execute it with ```rmvn``` or
|
11
|
+
|
12
|
+
```
|
13
|
+
$ rmvn --version
|
14
|
+
Polyglot Maven Extension 0.1.13
|
15
|
+
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
|
16
|
+
Maven home: /usr/local/lib/ruby/gems/2.2.0/gems/ruby-maven-libs-3.3.3/maven-home
|
17
|
+
Java version: 1.8.0_51, vendor: Oracle Corporation
|
18
|
+
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
|
19
|
+
Default locale: en_US, platform encoding: UTF-8
|
20
|
+
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"
|
21
|
+
```
|
22
|
+
|
23
|
+
## using it from ruby ##
|
24
|
+
|
25
|
+
```
|
26
|
+
require 'ruby-maven'
|
27
|
+
|
28
|
+
RubyMaven.exec( '--version' )
|
29
|
+
```
|
30
|
+
|
31
|
+
this will run the same maven as the above command execution.
|
32
|
+
|
33
|
+
## Mavenfile, pom.rb and pom.xml ##
|
34
|
+
|
35
|
+
the polyglot maven part will look for either of those files
|
36
|
+
|
37
|
+
* Mavenfile
|
38
|
+
* pom.rb
|
39
|
+
* pom.xml
|
40
|
+
|
41
|
+
in this order. the first two are ruby files using a ruby DSL for POM.
|
42
|
+
|
43
|
+
best see these files for a more examples on this ruby DSL
|
44
|
+
|
45
|
+
* [maven style](https://github.com/torquebox/maven-tools/blob/master/spec/pom_maven_style/pom.rb) - almost like the original pom.xml with nested blocks
|
46
|
+
* [hash style](https://github.com/torquebox/maven-tools/blob/master/spec/pom_maven_hash_style/pom.rb)
|
47
|
+
* [some alternatives](https://github.com/torquebox/maven-tools/blob/master/spec/pom_maven_alternative_style/pom.rb)
|
48
|
+
|
49
|
+
all three examples are equivalent to
|
50
|
+
[pom.xml](https://github.com/torquebox/maven-tools/blob/master/spec/pom.xml).
|
51
|
+
|
52
|
+
Mavenfile and pom.rb are the same thing, one is closer to ruby and the
|
53
|
+
other is closer to maven in its naming.
|
54
|
+
|
55
|
+
## license ##
|
56
|
+
|
57
|
+
it is licensed under (EPL-1.0)[https://www.eclipse.org/legal/epl-v10.html]
|
58
|
+
|
59
|
+
## contributing #
|
60
|
+
|
61
|
+
1. Fork it
|
62
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
63
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
64
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
65
|
+
5. Create new Pull Request
|
66
|
+
|
67
|
+
# meta-fu #
|
68
|
+
|
69
|
+
enjoy :)
|
70
|
+
|
71
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
#-*- mode: ruby -*-
|
2
|
+
|
3
|
+
task :default => [ :specs ]
|
4
|
+
|
5
|
+
desc 'run specs'
|
6
|
+
task :specs do
|
7
|
+
$LOAD_PATH << "spec"
|
8
|
+
|
9
|
+
Dir['spec/*_spec.rb'].each do |f|
|
10
|
+
require File.basename( f.sub(/.rb$/, '' ) )
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
task :headers do
|
15
|
+
require 'copyright_header'
|
16
|
+
|
17
|
+
s = Gem::Specification.load( Dir["*gemspec"].first )
|
18
|
+
|
19
|
+
args = {
|
20
|
+
:license => s.license,
|
21
|
+
:copyright_software => s.name,
|
22
|
+
:copyright_software_description => s.description,
|
23
|
+
:copyright_holders => s.authors,
|
24
|
+
:copyright_years => [Time.now.year],
|
25
|
+
:add_path => "lib",
|
26
|
+
:output_dir => './'
|
27
|
+
}
|
28
|
+
|
29
|
+
command_line = CopyrightHeader::CommandLine.new( args )
|
30
|
+
command_line.execute
|
31
|
+
end
|
32
|
+
|
33
|
+
# vim: syntax=Ruby
|
data/lib/maven/ruby/maven.rb
CHANGED
@@ -93,9 +93,13 @@ module Maven
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
def inherit_jruby_version
|
97
|
-
if
|
98
|
-
|
96
|
+
def inherit_jruby_version( version = nil )
|
97
|
+
if version == nil
|
98
|
+
if defined? JRUBY_VERSION
|
99
|
+
self['jruby.version'] = JRUBY_VERSION
|
100
|
+
end
|
101
|
+
elsif version
|
102
|
+
self['jruby.version'] = version
|
99
103
|
end
|
100
104
|
end
|
101
105
|
|
data/lib/maven/ruby/version.rb
CHANGED
data/lib/ruby_maven.rb
CHANGED
@@ -22,10 +22,11 @@ require 'maven'
|
|
22
22
|
require 'maven/ruby/maven'
|
23
23
|
|
24
24
|
module RubyMaven
|
25
|
+
POLYGLOT_VERSION = "0.1.15"
|
25
26
|
|
26
27
|
def self.exec( *args )
|
27
28
|
if args.member?('-version') or args.member?('--version') or args.member?('-v')
|
28
|
-
|
29
|
+
warn "Polyglot Maven Extension #{version}"
|
29
30
|
launch( '--version' )
|
30
31
|
elsif defined? Bundler
|
31
32
|
# it can be switching from ruby to jruby with invoking maven
|
@@ -42,31 +43,45 @@ module RubyMaven
|
|
42
43
|
@dir ||= File.expand_path( '../../', __FILE__ )
|
43
44
|
end
|
44
45
|
|
46
|
+
def self.version
|
47
|
+
polyglot_version = begin
|
48
|
+
xml = File.read( File.join( dir, '.mvn/extensions.xml' ) )
|
49
|
+
xml.sub( /.*<version>/m, '' ).sub(/<\/version>.*/m, '' )
|
50
|
+
rescue Errno::ENOENT => e
|
51
|
+
nil
|
52
|
+
end
|
53
|
+
POLYGLOT_VERSION.replace(polyglot_version) if polyglot_version
|
54
|
+
POLYGLOT_VERSION
|
55
|
+
end
|
56
|
+
|
45
57
|
def self.launch( *args )
|
46
58
|
old_maven_home = ENV['M2_HOME']
|
47
59
|
ENV['M2_HOME'] = Maven.home
|
48
60
|
|
49
61
|
extensions = File.join( '.mvn/extensions.xml' )
|
50
|
-
|
62
|
+
if has_extensions = File.exists?( extensions )
|
63
|
+
# tests need copy instead of move
|
64
|
+
FileUtils.cp( extensions, extensions + ".orig" )
|
65
|
+
else
|
51
66
|
FileUtils.mkdir_p( '.mvn' )
|
52
|
-
FileUtils.cp( File.join( dir, extensions), extensions )
|
53
67
|
end
|
68
|
+
FileUtils.cp( File.join( dir, extensions ), extensions ) rescue nil
|
69
|
+
|
70
|
+
# setup version
|
71
|
+
self.version
|
72
|
+
|
54
73
|
Maven.exec( *args )
|
55
74
|
|
56
75
|
ensure
|
57
76
|
ENV['M2_HOME'] = old_maven_home
|
58
|
-
|
59
|
-
|
77
|
+
|
78
|
+
FileUtils.rm_f( extensions )
|
79
|
+
if has_extensions
|
80
|
+
FileUtils.move( extensions + '.orig', extensions )
|
81
|
+
else
|
60
82
|
dir = File.dirname( extensions )
|
61
83
|
# delete empty .mvn directory
|
62
84
|
FileUtils.rm_rf( dir ) if Dir[File.join(dir, '*')].size == 0
|
63
85
|
end
|
64
86
|
end
|
65
|
-
|
66
|
-
POLYGLOT_VERSION = begin
|
67
|
-
xml = File.read( File.join( dir, '.mvn/extensions.xml' ) )
|
68
|
-
xml.sub( /.*<version>/m, '' ).sub(/<\/version>.*/m, '' )
|
69
|
-
rescue Errno::ENOENT => e
|
70
|
-
'0.1.11'
|
71
|
-
end
|
72
87
|
end
|
data/ruby-maven.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.executable = 'rmvn'
|
19
19
|
|
20
|
-
s.files =
|
20
|
+
s.files = Dir['lib/**/*'] + Dir['spec/**/*'] + Dir['bin/*'] + Dir['*file'] + Dir['.mvn/*'] + ['README.md', 'ruby-maven.gemspec']
|
21
21
|
|
22
22
|
s.rdoc_options = ["--main", "README.md"]
|
23
23
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative 'setup'
|
2
|
+
require 'maven/ruby/maven'
|
3
|
+
|
4
|
+
describe Maven::Ruby::Maven do
|
5
|
+
|
6
|
+
subject { Maven::Ruby::Maven.new }
|
7
|
+
|
8
|
+
it 'shows mvn commandline with verbose flag' do
|
9
|
+
CatchStdout.exec do
|
10
|
+
subject.exec( '-Dverbose', 'validate' )
|
11
|
+
end
|
12
|
+
subject.verbose = false
|
13
|
+
CatchStdout.result.must_match /mvn -Dverbose validate/
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'takes declared jruby version' do
|
17
|
+
begin
|
18
|
+
subject.inherit_jruby_version '9.0.4.0'
|
19
|
+
subject.exec( '-X', 'initialize', '-l', 'pkg/log1.txt' )
|
20
|
+
File.read('pkg/log1.txt').must_match /resolve jruby for version 9.0.4.0/
|
21
|
+
ensure
|
22
|
+
subject['jruby.version'] = nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined? JRUBY_VERSION
|
27
|
+
it 'inherits jruby version' do
|
28
|
+
subject.inherit_jruby_version
|
29
|
+
subject.exec( '-X', 'initialize', '-l', 'pkg/log2.txt' )
|
30
|
+
File.read('pkg/log2.txt').must_match /resolve jruby for version #{JRUBY_VERSION}/
|
31
|
+
end
|
32
|
+
else
|
33
|
+
it 'takes default jruby version with inherit jruby version' do
|
34
|
+
subject.inherit_jruby_version
|
35
|
+
subject.exec( '-X', 'initialize', '-l', 'pkg/log3.txt' )
|
36
|
+
File.read('pkg/log3.txt').must_match /resolve jruby for version 1.7.22/
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require_relative 'setup'
|
2
|
+
require 'ruby_maven'
|
3
|
+
require 'stringio'
|
4
|
+
require 'maven/ruby/version'
|
5
|
+
|
6
|
+
module CatchStdout
|
7
|
+
|
8
|
+
def self.exec
|
9
|
+
out = $stdout
|
10
|
+
err = $stderr
|
11
|
+
@result = StringIO.new
|
12
|
+
$stdout = @result
|
13
|
+
$stderr = @result
|
14
|
+
yield
|
15
|
+
ensure
|
16
|
+
$stdout = out
|
17
|
+
$stderr = err
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.result
|
21
|
+
@result.string
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe RubyMaven do
|
26
|
+
|
27
|
+
it 'displays the version info' do
|
28
|
+
Dir.chdir 'spec' do
|
29
|
+
CatchStdout.exec do
|
30
|
+
RubyMaven.exec( '--version' )
|
31
|
+
end
|
32
|
+
CatchStdout.result.must_match /Polyglot Maven Extension 0.1.15/
|
33
|
+
xml = File.read('.mvn/extensions.xml')
|
34
|
+
xml.must_equal "dummy\n"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
let :gem do
|
39
|
+
v = Maven::Ruby::VERSION
|
40
|
+
v += '-SNAPSHOT' if v =~ /[a-zA-Z]/
|
41
|
+
"pkg/ruby-maven-#{v}.gem"
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'pack the gem' do
|
45
|
+
FileUtils.rm_f gem
|
46
|
+
CatchStdout.exec do
|
47
|
+
RubyMaven.exec( '-Dverbose', 'package' )
|
48
|
+
end
|
49
|
+
CatchStdout.result.must_match /mvn -Dverbose package/
|
50
|
+
File.exists?( gem ).must_equal true
|
51
|
+
File.exists?( '.mvn/extensions.xml' ).must_equal true
|
52
|
+
File.exists?( '.mvn/extensions.xml.orig' ).wont_equal true
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/spec/ruby_maven_spec.rb
CHANGED
@@ -1,30 +1,19 @@
|
|
1
1
|
require_relative 'setup'
|
2
2
|
require 'ruby_maven'
|
3
|
+
require 'stringio'
|
3
4
|
require 'maven/ruby/version'
|
4
5
|
|
5
|
-
module CatchStdout
|
6
|
-
|
7
|
-
def self.exec
|
8
|
-
out = $stdout
|
9
|
-
@result = StringIO.new
|
10
|
-
$stdout = @result
|
11
|
-
yield
|
12
|
-
ensure
|
13
|
-
$stdout = out
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.result
|
17
|
-
@result.string
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
6
|
describe RubyMaven do
|
22
7
|
|
23
8
|
it 'displays the version info' do
|
24
|
-
|
25
|
-
|
9
|
+
Dir.chdir 'spec' do
|
10
|
+
CatchStdout.exec do
|
11
|
+
RubyMaven.exec( '--version' )
|
12
|
+
end
|
13
|
+
CatchStdout.result.must_match /Polyglot Maven Extension 0.1.15/
|
14
|
+
xml = File.read('.mvn/extensions.xml')
|
15
|
+
xml.must_equal "dummy\n"
|
26
16
|
end
|
27
|
-
CatchStdout.result.must_match /Polyglot Maven Extension 0.1.9/
|
28
17
|
end
|
29
18
|
|
30
19
|
let :gem do
|
@@ -36,10 +25,14 @@ describe RubyMaven do
|
|
36
25
|
it 'pack the gem' do
|
37
26
|
FileUtils.rm_f gem
|
38
27
|
CatchStdout.exec do
|
39
|
-
|
28
|
+
# need newer jruby version
|
29
|
+
RubyMaven.exec( '-Dverbose', 'package', '-Djruby.version=1.7.24' )
|
40
30
|
end
|
31
|
+
#puts CatchStdout.result
|
41
32
|
CatchStdout.result.must_match /mvn -Dverbose package/
|
42
|
-
File.exists?( gem )
|
33
|
+
File.exists?( gem ).must_equal true
|
34
|
+
File.exists?( '.mvn/extensions.xml' ).must_equal true
|
35
|
+
File.exists?( '.mvn/extensions.xml.orig' ).wont_equal true
|
43
36
|
end
|
44
|
-
|
37
|
+
|
45
38
|
end
|
data/spec/setup.rb
CHANGED
@@ -1,6 +1,26 @@
|
|
1
|
-
$LOAD_PATH
|
1
|
+
$LOAD_PATH.unshift File.expand_path( '../../lib', __FILE__ )
|
2
2
|
begin
|
3
3
|
require 'minitest'
|
4
4
|
rescue LoadError
|
5
5
|
end
|
6
6
|
require 'minitest/autorun'
|
7
|
+
|
8
|
+
|
9
|
+
module CatchStdout
|
10
|
+
|
11
|
+
def self.exec
|
12
|
+
out = $stdout
|
13
|
+
err = $stderr
|
14
|
+
@result = StringIO.new
|
15
|
+
$stdout = @result
|
16
|
+
$stderr = @result
|
17
|
+
yield
|
18
|
+
ensure
|
19
|
+
$stdout = out
|
20
|
+
$stderr = err
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.result
|
24
|
+
@result.string
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-maven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Meier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,9 +60,11 @@ executables:
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gitignore
|
64
63
|
- .mvn/extensions.xml
|
64
|
+
- Gemfile
|
65
65
|
- Mavenfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
66
68
|
- bin/rmvn
|
67
69
|
- lib/maven/ruby.rb
|
68
70
|
- lib/maven/ruby/maven.rb
|
@@ -71,6 +73,8 @@ files:
|
|
71
73
|
- lib/ruby-maven.rb
|
72
74
|
- lib/ruby_maven.rb
|
73
75
|
- ruby-maven.gemspec
|
76
|
+
- spec/maven_ruby_maven_spec.rb
|
77
|
+
- spec/maven_ruby_maven_spec.rb~
|
74
78
|
- spec/ruby_maven_spec.rb
|
75
79
|
- spec/setup.rb
|
76
80
|
homepage: https://github.com/takari/ruby-maven
|
data/.gitignore
DELETED