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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a8eb8cba64115cb2e8051ccdcae9fcb547795c7
4
- data.tar.gz: 6887fefbfe325001e00fa2a6e35cd4bf19649775
3
+ metadata.gz: 4792c4d6bd31872ceda20216a0731b78ec12ffe1
4
+ data.tar.gz: d87b5dcaa7942e50b4563548b4fdeb07eea89da8
5
5
  SHA512:
6
- metadata.gz: 5be5306505b67b6872d483c504b0abdfef02d99b39c1d2e39f8d18dca1795e5ef0e02590b1ffb9162b2d3cb407f5e57a9f0118f15bbd42094b6ad96f8e01db4c
7
- data.tar.gz: f99747cdc5985dcaedd93d9d30f6d614f7c0e8e132217cdb5339eba7757528c1cbc696a6131fe186de7899c486598a462239c4917463aa6af9ddcb69ee3830b6
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
- 'jruby.version' => '${jruby.version}',
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}',
@@ -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
@@ -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
- unless spec = find_spec_via_rubygems( name )
76
- spec = install_gem( name )
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 install_gem( name )
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
@@ -1,5 +1,5 @@
1
1
  module Jars
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  JRUBY_PLUGINS_VERSION = '1.0.10'.freeze
4
4
  DEPENDENCY_PLUGIN_VERSION = '2.8'.freeze
5
5
  end
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.1
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-06 00:00:00.000000000 Z
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