jar-dependencies 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Mavenfile +2 -1
- data/jar-dependencies.gemspec +2 -2
- data/lib/jars/maven_factory.rb +13 -9
- data/lib/jars/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4792c4d6bd31872ceda20216a0731b78ec12ffe1
|
4
|
+
data.tar.gz: d87b5dcaa7942e50b4563548b4fdeb07eea89da8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dabd28099a91a7cf7fc45e54788defa80d73639ddfce69998713a33aced404a4eb69b3502dcaf739f1dd3d154cc1aa3c41ededb81435c8680c2cfad2005992d9
|
7
|
+
data.tar.gz: 996b8b52713274079ad388d9be3ce64a3455f1bd4c69360f0612a8e937203c98a525f3d37613a98b4e65c65ba3fcef71e296157b8a212e6893351c0db8c7b3bd
|
data/Mavenfile
CHANGED
@@ -34,7 +34,8 @@ plugin :invoker, '1.8' do
|
|
34
34
|
:postBuildHookScript => 'verify.bsh',
|
35
35
|
:cloneProjectsTo => '${project.build.directory}',
|
36
36
|
:properties => { 'jar-dependencies.version' => '${project.version}',
|
37
|
-
|
37
|
+
# use an old jruby with old ruby-maven here
|
38
|
+
'jruby.version' => '1.7.20',
|
38
39
|
'jruby.plugins.version' => '${jruby.plugins.version}',
|
39
40
|
'bundler.version' => '${bundler.version}',
|
40
41
|
'ruby-maven.version' => '${ruby-maven.version}',
|
data/jar-dependencies.gemspec
CHANGED
@@ -34,11 +34,11 @@ Gem::Specification.new do |s|
|
|
34
34
|
|
35
35
|
if you want to use the executable #{LOCK_JARS} then install ruby-maven gem before using #{LOCK_JARS}
|
36
36
|
|
37
|
-
$ gem install ruby-maven #{RUBY_MAVEN_VERSION}
|
37
|
+
$ gem install ruby-maven -v '#{RUBY_MAVEN_VERSION}'
|
38
38
|
|
39
39
|
or add it as deveopment dependency to your Gemfile
|
40
40
|
|
41
|
-
gem 'ruby-maven', #{RUBY_MAVEN_VERSION}
|
41
|
+
gem 'ruby-maven', '#{RUBY_MAVEN_VERSION}'
|
42
42
|
|
43
43
|
EOF
|
44
44
|
end
|
data/lib/jars/maven_factory.rb
CHANGED
@@ -56,14 +56,14 @@ module Jars
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def lazy_load_maven
|
59
|
-
add_gem_to_load_path( 'ruby-maven-libs' )
|
60
59
|
add_gem_to_load_path( 'ruby-maven' )
|
60
|
+
add_gem_to_load_path( 'ruby-maven-libs' )
|
61
61
|
require 'maven/ruby/maven'
|
62
62
|
end
|
63
63
|
|
64
|
-
def find_spec_via_rubygems( name )
|
64
|
+
def find_spec_via_rubygems( name, req )
|
65
65
|
require 'rubygems/dependency'
|
66
|
-
dep = Gem::Dependency.new( name )
|
66
|
+
dep = Gem::Dependency.new( name, req )
|
67
67
|
dep.matching_specs( true ).last
|
68
68
|
end
|
69
69
|
|
@@ -72,8 +72,9 @@ module Jars
|
|
72
72
|
return if Gem.loaded_specs[ name ]
|
73
73
|
# just install gem if needed and add it to the load_path
|
74
74
|
# and leave activated gems as they are
|
75
|
-
|
76
|
-
|
75
|
+
req = requirement( name )
|
76
|
+
unless spec = find_spec_via_rubygems( name, req )
|
77
|
+
spec = install_gem( name, req )
|
77
78
|
end
|
78
79
|
unless spec
|
79
80
|
raise "failed to resolve gem '#{name}' if you're using Bundler add it as a dependency"
|
@@ -81,12 +82,15 @@ module Jars
|
|
81
82
|
$LOAD_PATH << File.join( spec.full_gem_path, spec.require_path )
|
82
83
|
end
|
83
84
|
|
84
|
-
def
|
85
|
+
def requirement( name )
|
86
|
+
jars = Gem.loaded_specs[ 'jar-dependencies' ]
|
87
|
+
dep = jars.nil? ? nil : jars.dependencies.detect { |d| d.name == name }
|
88
|
+
dep.nil? ? Gem::Requirement.create( '>0' ) : dep.requirement
|
89
|
+
end
|
90
|
+
|
91
|
+
def install_gem( name, req )
|
85
92
|
puts "Installing gem '#{name}' . . ."
|
86
93
|
require 'rubygems/dependency_installer'
|
87
|
-
jars = Gem.loaded_specs[ 'jar-dependencies' ]
|
88
|
-
dep = jars.dependencies.detect { |d| d.name == name }
|
89
|
-
req = dep.nil? ? Gem::Requirement.create( '>0' ) : dep.requirement
|
90
94
|
inst = Gem::DependencyInstaller.new( @options ||= {} )
|
91
95
|
inst.install( name, req ).first
|
92
96
|
rescue => e
|
data/lib/jars/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jar-dependencies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- christian meier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,9 +88,9 @@ licenses:
|
|
88
88
|
- MIT
|
89
89
|
metadata: {}
|
90
90
|
post_install_message: "\nif you want to use the executable lock_jars then install\
|
91
|
-
\ ruby-maven gem before using lock_jars \n\n $ gem install ruby-maven ~> 3.3.3\n\
|
92
|
-
\nor add it as deveopment dependency to your Gemfile\n\n gem 'ruby-maven', ~>\
|
93
|
-
\ 3.3.3\n\n"
|
91
|
+
\ ruby-maven gem before using lock_jars \n\n $ gem install ruby-maven -v '~> 3.3.3'\n\
|
92
|
+
\nor add it as deveopment dependency to your Gemfile\n\n gem 'ruby-maven', '~>\
|
93
|
+
\ 3.3.3'\n\n"
|
94
94
|
rdoc_options: []
|
95
95
|
require_paths:
|
96
96
|
- lib
|