jar-dependencies 0.3.9 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,22 +1,16 @@
1
- require 'jar_dependencies'
2
- require 'rubygems/request'
3
1
  require 'rubygems/uri_formatter'
4
2
  module Jars
5
3
  class MavenSettings
6
-
7
4
  LINE_SEPARATOR = ENV_JAVA['line.separator']
8
5
 
9
6
  class << self
10
-
11
7
  def local_settings
12
8
  unless instance_variable_defined?(:@_jars_maven_local_settings_)
13
9
  @_jars_maven_local_settings_ = nil
14
10
  end
15
11
  if @_jars_maven_local_settings_.nil?
16
- if settings = Jars.absolute( 'settings.xml' )
17
- if File.exists?(settings)
18
- @_jars_maven_local_settings_ = settings
19
- end
12
+ if settings = Jars.absolute('settings.xml')
13
+ @_jars_maven_local_settings_ = settings if File.exist?(settings)
20
14
  end
21
15
  end
22
16
  @_jars_maven_local_settings_ || nil
@@ -27,14 +21,14 @@ module Jars
27
21
  @_jars_maven_user_settings_ = nil
28
22
  end
29
23
  if @_jars_maven_user_settings_.nil?
30
- if settings = Jars.absolute( Jars.to_prop( MAVEN_SETTINGS ) )
31
- unless File.exists?(settings)
24
+ if settings = Jars.absolute(Jars.to_prop(MAVEN_SETTINGS))
25
+ unless File.exist?(settings)
32
26
  Jars.warn { "configured ENV['#{MAVEN_SETTINGS}'] = '#{settings}' not found" }
33
27
  settings = false
34
28
  end
35
29
  else # use maven default (user) settings
36
- settings = File.join( Jars.user_home, '.m2', 'settings.xml' )
37
- settings = false unless File.exists?(settings)
30
+ settings = File.join(Jars.user_home, '.m2', 'settings.xml')
31
+ settings = false unless File.exist?(settings)
38
32
  end
39
33
  @_jars_maven_user_settings_ = settings
40
34
  end
@@ -47,9 +41,11 @@ module Jars
47
41
  end
48
42
  if @_jars_effective_maven_settings_.nil?
49
43
  begin
44
+ require 'rubygems/request'
45
+
50
46
  http = Gem::Request.proxy_uri(Gem.configuration[:http_proxy] || Gem::Request.get_proxy_from_env('http'))
51
47
  https = Gem::Request.proxy_uri(Gem.configuration[:https_proxy] || Gem::Request.get_proxy_from_env('https'))
52
- rescue NoMethodError
48
+ rescue
53
49
  Jars.debug('ignore rubygems proxy configuration as rubygems is too old')
54
50
  end
55
51
  if http.nil? && https.nil?
@@ -63,9 +59,7 @@ module Jars
63
59
  end
64
60
 
65
61
  def cleanup
66
- if effective_settings != settings
67
- File.unlink(effective_settings)
68
- end
62
+ File.unlink(effective_settings) if effective_settings != settings
69
63
  ensure
70
64
  reset
71
65
  end
@@ -78,9 +72,7 @@ module Jars
78
72
  unless instance_variable_defined?(:@_jars_maven_settings_)
79
73
  @_jars_maven_settings_ = nil
80
74
  end
81
- if @_jars_maven_settings_.nil?
82
- local_settings || user_settings
83
- end
75
+ local_settings || user_settings if @_jars_maven_settings_.nil?
84
76
  end
85
77
 
86
78
  def global_settings
@@ -88,9 +80,9 @@ module Jars
88
80
  @_jars_maven_global_settings_ = nil
89
81
  end
90
82
  if @_jars_maven_global_settings_.nil?
91
- if mvn_home = ENV[ 'M2_HOME' ] || ENV[ 'MAVEN_HOME' ]
92
- settings = File.join( mvn_home, 'conf/settings.xml' )
93
- settings = false unless File.exists?(settings)
83
+ if mvn_home = ENV['M2_HOME'] || ENV['MAVEN_HOME']
84
+ settings = File.join(mvn_home, 'conf/settings.xml')
85
+ settings = false unless File.exist?(settings)
94
86
  else
95
87
  settings = false
96
88
  end
@@ -111,7 +103,7 @@ module Jars
111
103
  Jars.warn("can not interpolated proxy info for #{settings}")
112
104
  return
113
105
  else
114
- raw.sub!("<settings>", "<settings>#{LINE_SEPARATOR}#{proxy}")
106
+ raw.sub!('<settings>', "<settings>#{LINE_SEPARATOR}#{proxy}")
115
107
  end
116
108
  end
117
109
  tempfile = java.io.File.create_temp_file('settings', '.xml')
@@ -127,7 +119,7 @@ module Jars
127
119
  raw.sub!('__HTTP_SERVER__', http.host)
128
120
  raw.sub!('__HTTP_PORT__', http.port.to_s)
129
121
  else
130
- raw.sub!('__HTTP_ACTIVE__', 'false')
122
+ raw.sub!('__HTTP_ACTIVE__', 'false')
131
123
  end
132
124
  if https
133
125
  raw.sub!('__HTTPS_ACTIVE__', 'true')
@@ -2,7 +2,7 @@
2
2
 
3
3
  if ENV_JAVA['jars.quiet'] != 'true'
4
4
  model.dependencies.each do |d|
5
- puts " " + d.group_id + ':' + d.artifact_id + (d.classifier ? ":" + d.classifier : "" ) + ":" + d.version + ':' + (d.scope || 'compile')
6
- puts " exclusions: " + d.exclusions.collect{ |e| e.group_id + ':' + e.artifact_id }.join unless d.exclusions.empty?
5
+ puts ' ' + d.group_id + ':' + d.artifact_id + (d.classifier ? ':' + d.classifier : '') + ':' + d.version + ':' + (d.scope || 'compile')
6
+ puts ' exclusions: ' + d.exclusions.collect { |e| e.group_id + ':' + e.artifact_id }.join unless d.exclusions.empty?
7
7
  end
8
8
  end
@@ -19,11 +19,11 @@
19
19
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  #
21
21
 
22
- if defined?( JRUBY_VERSION ) && Gem.post_install_hooks.empty?
22
+ if defined?(JRUBY_VERSION) && Gem.post_install_hooks.empty?
23
23
  Gem.post_install do |gem_installer|
24
24
  unless (ENV['JARS_SKIP'] || ENV_JAVA['jars.skip']) == 'true'
25
25
  require 'jars/installer'
26
- jars = Jars::Installer.new( gem_installer.spec )
26
+ jars = Jars::Installer.new(gem_installer.spec)
27
27
  jars.ruby_maven_install_options = gem_installer.options || {}
28
28
  jars.vendor_jars
29
29
  end
@@ -1,4 +1,4 @@
1
- # to do as bundler does and allow to load Jars.lock via
1
+ # to do as bundler does and allow to load Jars.lock via
2
2
  # require 'jars/setup'. can be useful via commandline -rjars/setup
3
3
  # or tell bundler autorequire to load it
4
4
 
@@ -1,5 +1,5 @@
1
1
  module Jars
2
- VERSION = '0.3.9'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  JRUBY_PLUGINS_VERSION = '1.1.3'.freeze
4
4
  DEPENDENCY_PLUGIN_VERSION = '2.8'.freeze
5
5
  end
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jar-dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian meier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '5.3'
18
+ version: 5.10.0
19
19
  name: minitest
20
20
  prerelease: false
21
21
  type: :development
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.3'
26
+ version: 5.10.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -52,7 +52,10 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.3.11
55
- description: manage jar dependencies for gems and keep track which jar was already loaded using maven artifact coordinates. it warns on version conflicts and loads only ONE jar assuming the first one is compatible to the second one otherwise your project needs to lock down the right version by providing a Jars.lock file.
55
+ description: manage jar dependencies for gems and keep track which jar was already
56
+ loaded using maven artifact coordinates. it warns on version conflicts and loads
57
+ only ONE jar assuming the first one is compatible to the second one otherwise your
58
+ project needs to lock down the right version by providing a Jars.lock file.
56
59
  email:
57
60
  - mkristian@web.de
58
61
  executables:
@@ -91,10 +94,16 @@ homepage: https://github.com/mkristian/jar-dependencies
91
94
  licenses:
92
95
  - MIT
93
96
  metadata: {}
94
- post_install_message: "\nif you want to use the executable lock_jars then install\
95
- \ ruby-maven gem before using lock_jars \n\n $ gem install ruby-maven -v '~> 3.3.11'\n\
96
- \nor add it as a development dependency to your Gemfile\n\n gem 'ruby-maven',\
97
- \ '~> 3.3.11'\n\n"
97
+ post_install_message: |2+
98
+
99
+ if you want to use the executable lock_jars then install ruby-maven gem before using lock_jars
100
+
101
+ $ gem install ruby-maven -v '~> 3.3.11'
102
+
103
+ or add it as a development dependency to your Gemfile
104
+
105
+ gem 'ruby-maven', '~> 3.3.11'
106
+
98
107
  rdoc_options: []
99
108
  require_paths:
100
109
  - lib
@@ -110,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
119
  version: '0'
111
120
  requirements: []
112
121
  rubyforge_project:
113
- rubygems_version: 2.4.8
122
+ rubygems_version: 2.6.14.1
114
123
  signing_key:
115
124
  specification_version: 4
116
125
  summary: manage jar dependencies for gems