jar-dependencies 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b5ca03580773f81be7b901142b450a339ff44e8
4
- data.tar.gz: 1dd1e49ac644f249edb809e46711d0c284491b4c
3
+ metadata.gz: c590350225f5e40fa4d0f49bacfe5cdf3dee5c63
4
+ data.tar.gz: ac2ea4bdf69e52c0652e9be0ac8dd09db89afa7d
5
5
  SHA512:
6
- metadata.gz: 2d72c2b427e7b4a207d3ad6555252999b8634a2c892eab21b0b3c32037ef5a6b57acec243eafc649c386931c8e3b5c237ab488abfb917c725cc67fa9968285be
7
- data.tar.gz: 4771ea73f136626e720d7bbc7513d1a9e04f90129bd769505b61616d6134b87a2b5571f78e0c54dc07b9262853977250ad98ae2956584b7be8bff3e85cf4fb5a
6
+ metadata.gz: dc6ea065a3d8ddc6d65fe72dea663a125cc0e1e48d3b321233a921c8f5777a02e1d3d46ef7c31a07d69000bf4730c3cb85898c5f597c68a4cf965f78a40f0732
7
+ data.tar.gz: 2b62b6e8d113c95842592eebdec04c7aaed950f525c5149ef62560c393c3b1ac911e60b34f2ee74b6fd9d979c8063fd8d7ec8851aba78f2db853f5ff2b0cf68a
data/Readme.md CHANGED
@@ -56,9 +56,11 @@ per default all jars need to come from maven-central (<search.maven.org>), in or
56
56
 
57
57
  **NOTE:** gems depending on jars other then maven-central will **NOT** work when they get published on rubygems.org since the user of those gems will not have the right settings.xml to allow them to access the jar dependencies.
58
58
 
59
- ## just look at the example ##
59
+ ## examples ##
60
60
 
61
- the [readme.md](example/Readme.md) walks you through an example and shows how development works and shows what happens during installation.
61
+ an [example with rspec and all](example/Readme.md) walks you through setup and shows how development works and shows what happens during installation.
62
+
63
+ there are some more examples with the various [project setups for gems and application](examples/README.md). this includes using proper maven for the project or ruby-maven with rake or the rake-compiler in conjuction with jar-dependencies.
62
64
 
63
65
  # configuration #
64
66
 
@@ -156,7 +156,7 @@ module Jars
156
156
  if ( @_jars_maven_user_settings_ ||= nil ).nil?
157
157
  if settings = absolute( to_prop( MAVEN_SETTINGS ) )
158
158
  unless File.exists?(settings)
159
- warn "configured ENV['#{MAVEN_SETTINGS}'] = '#{settings}' not found"
159
+ Jars.warn { "configured ENV['#{MAVEN_SETTINGS}'] = '#{settings}' not found" }
160
160
  settings = false
161
161
  end
162
162
  else # use maven default (user) settings
@@ -206,6 +206,7 @@ module Jars
206
206
  while done != urls do
207
207
  urls.each do |url|
208
208
  unless done.member?( url )
209
+ Jars.debug { "--- load jars from #{url}" }
209
210
  classpath = Jars::Classpath.new( nil, "uri:#{url}" )
210
211
  classpath.require( scope )
211
212
  done << url
@@ -213,7 +214,9 @@ module Jars
213
214
  end
214
215
  urls = jars_lock_from_class_loader
215
216
  end
217
+ no_more_warnings
216
218
  elsif jars_lock = Jars.lock_path
219
+ Jars.debug { "--- load jars from #{jars_lock}" }
217
220
  @@jars_lock = jars_lock
218
221
  # funny error during spec where it tries to load it again
219
222
  # and finds it as gem instead of the LOAD_PATH
@@ -222,6 +225,10 @@ module Jars
222
225
  classpath.require( scope )
223
226
  no_more_warnings
224
227
  end
228
+ Jars.debug {
229
+ loaded = @@jars.collect{ |k,v| "#{k}:#{v}" }
230
+ "--- loaded jars ---\n\t#{loaded.join("\n\t")}"
231
+ }
225
232
  end
226
233
 
227
234
  def setup( options = nil )
@@ -257,8 +264,12 @@ module Jars
257
264
  end
258
265
  end
259
266
 
260
- def warn(msg)
261
- Kernel.warn(msg) unless quiet?
267
+ def warn(msg = nil, &block)
268
+ Kernel.warn(msg || block.call) unless quiet? and not verbose?
269
+ end
270
+
271
+ def debug(msg = nil, &block)
272
+ Kernel.warn(msg || block.call) if verbose?
262
273
  end
263
274
 
264
275
  private
@@ -312,7 +323,7 @@ module Jars
312
323
  end
313
324
  local_repo
314
325
  rescue
315
- warn "error reading or parsing #{settings}"
326
+ Jars.warn { "error reading or parsing #{settings}" }
316
327
  nil
317
328
  end
318
329
 
@@ -345,7 +356,8 @@ def require_jar( *args )
345
356
  return nil unless Jars.require?
346
357
  result = Jars.require_jar( *args )
347
358
  if result.is_a? String
348
- Jars.warn "jar coordinate #{args[0..-2].join( ':' )} already loaded with version #{result}"
359
+ Jars.warn { "--- jar coordinate #{args[0..-2].join( ':' )} already loaded with version #{result} - omit version #{args[-1]}" }
360
+ Jars.debug { " try to load from #{caller.join("\n\t")}" }
349
361
  return false
350
362
  end
351
363
  result
@@ -1,5 +1,5 @@
1
1
  module Jars
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  JRUBY_PLUGINS_VERSION = '1.1.3'.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.4
4
+ version: 0.2.5
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-11-02 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement