lock_jar 0.12.0 → 0.12.1

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: 890e8f58de1d05c870ec1254fd8922e1f3d300c7
4
- data.tar.gz: 79eee178effcfbcf2da3cc50345e1fd23f31d93c
3
+ metadata.gz: b3a691a255e5c05a41c32741bb73b4dd39bfe13c
4
+ data.tar.gz: 9b6593b52c0d38d0816f25e7ea9e036d47b11192
5
5
  SHA512:
6
- metadata.gz: 5d64ba05c2d2c4ee3ef4bb99b8d10437e91c16050ac060f76a70a3a2ed78b4780c2eb36b41e5e777b7ce7eba6322df39d99f1918dcf7c87d53d8d86cdf342395
7
- data.tar.gz: 59ae69cb059f46c198f7336a30b01b9535bdfb53b37739c36d2aa1da8e6f90941179480da427703c1ecaceb0ab8c9e4ccb5211665f2d78c47fabae1d9a2cf123
6
+ metadata.gz: e9ecb0fae86af182cbbb69734516b7ed307d1e124483afa449e229246e16b5081b30e7df0b962dc68aabe440907062153ec48adc246a45705988837d808f26bd
7
+ data.tar.gz: 6e74c403ff8dc46efc2f8340d5950dd1f5368d50749bb6fe87629c202470888aa879ce0843518474766e4f3f24a1f5f9c8c4635a6488cace75f243792478113f
data/.gitignore CHANGED
@@ -1,4 +1,7 @@
1
+ # Dont save the Gemfile since JRuby and CRuby have incompatiable deps
2
+ Gemfile.lock
1
3
  Jarfile.lock
4
+
2
5
  .*
3
6
 
4
7
  tmp
@@ -16,4 +19,41 @@ doc
16
19
  # bundler
17
20
  .bundle
18
21
 
22
+ # jeweler generated
23
+ pkg
24
+
25
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
26
+ #
27
+ # * Create a file at ~/.gitignore
28
+ # * Include files you want ignored
29
+ # * Run: git config --global core.excludesfile ~/.gitignore
30
+ #
31
+ # After doing this, these files will be ignored in all your git projects,
32
+ # saving you from having to 'pollute' every project you touch with them
33
+ #
34
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
35
+ #
36
+ # For MacOS:
37
+ #
38
+ #.DS_Store
39
+
40
+ # For TextMate
41
+ #*.tmproj
42
+ #tmtags
43
+
44
+ # For emacs:
45
+ #*~
46
+ #\#*
47
+ #.\#*
48
+
49
+ # For vim:
50
+ #*.swp
51
+
52
+ # ides:
53
+ .redcar
54
+ *.iml
55
+
56
+ # For rubinius:
57
+ #*.rbc
58
+
19
59
  autotest
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  * Add support for `without_default_maven_repo`
6
6
 
7
+ ### 0.12.1 (Feburary 25, 2015)
8
+
9
+ * Fix for writing remote repositories to lockfile
10
+
7
11
  ### 0.10.0 (June 27, 2014)
8
12
 
9
13
  * Extract Bundler out to own Gem - https://github.com/mguymon/lock_jar_bundler
@@ -131,6 +131,7 @@ module LockJar
131
131
 
132
132
  jarfile.remote_repositories.each do |repo|
133
133
  resolver(opts).add_remote_repository( repo )
134
+ lockfile.remote_repositories << repo
134
135
  end
135
136
 
136
137
  unless jarfile.local_repository.nil?
@@ -1,3 +1,3 @@
1
1
  module LockJar
2
- VERSION = '0.12.0'
2
+ VERSION = '0.12.1'
3
3
  end
@@ -18,7 +18,7 @@ describe LockJar do
18
18
 
19
19
  describe "#lock" do
20
20
  context "creates a lockfile" do
21
- let(:lockfile) do
21
+ let(:lockfile) do
22
22
  LockJar.lock( lockjar_source, :local_repo => "#{TEMP_DIR}/test-repo", :lockfile => "#{TEMP_DIR}/Jarfile.lock" )
23
23
  File.exists?( "#{TEMP_DIR}/Jarfile.lock" ).should be_true
24
24
  LockJar.read("#{TEMP_DIR}/Jarfile.lock")
@@ -85,6 +85,33 @@ describe LockJar do
85
85
 
86
86
  context "from a dsl" do
87
87
 
88
+ describe '#without_default_maven_repo' do
89
+ let(:lockjar_source) do
90
+ LockJar::Domain::Dsl.create do
91
+ without_default_maven_repo
92
+ remote_repo 'https://repository.jboss.org/nexus/content/groups/public'
93
+ jar 'junit:junit:4.10'
94
+ end
95
+ end
96
+
97
+ let(:expected_version) { LockJar::VERSION }
98
+ let(:expected_maps) { {"junit:junit:4.10"=>["#{TEMP_DIR}"] } }
99
+ let(:expected_remote_repositories) { %w[https://repository.jboss.org/nexus/content/groups/public] }
100
+ let(:expected_groups) do
101
+ {
102
+ "default"=>{
103
+ "dependencies"=>["junit:junit:jar:4.10", "org.hamcrest:hamcrest-core:jar:1.1"],
104
+ "artifacts"=>[{
105
+ "jar:junit:junit:jar:4.10"=>{
106
+ "transitive"=>{"org.hamcrest:hamcrest-core:jar:1.1"=>{}}}
107
+ }]
108
+ }
109
+ }
110
+ end
111
+
112
+ it_behaves_like 'a lockfile'
113
+ end
114
+
88
115
  describe '#map' do
89
116
  let(:lockjar_source) do
90
117
  LockJar::Domain::Dsl.create do
@@ -95,11 +122,7 @@ describe LockJar do
95
122
 
96
123
  let(:expected_version) { LockJar::VERSION }
97
124
  let(:expected_maps) { {"junit:junit:4.10"=>["#{TEMP_DIR}"] } }
98
- let(:expected_remote_repositories) do
99
- %w[
100
- http://repo1.maven.org/maven2/
101
- ]
102
- end
125
+ let(:expected_remote_repositories) { %w[http://repo1.maven.org/maven2/] }
103
126
  let(:expected_groups) do
104
127
  {
105
128
  "default"=>{
@@ -126,7 +149,7 @@ describe LockJar do
126
149
 
127
150
  let(:expected_version) { LockJar::VERSION }
128
151
  let(:expected_excludes) { %w[commons-logging logkit] }
129
- let(:expected_remote_repositories) { %w[http://repo1.maven.org/maven2/] }
152
+ let(:expected_remote_repositories) { %w[http://repo1.maven.org/maven2/ https://repository.jboss.org/nexus/content/groups/public] }
130
153
  let(:expected_groups) do
131
154
  { "default" =>
132
155
  {
@@ -315,20 +338,25 @@ describe LockJar do
315
338
  end
316
339
 
317
340
  describe "#load" do
318
- it "by Jarfile.lock" do
341
+
342
+ def expect_java_class_not_loaded(java_class)
319
343
  if Naether.platform == 'java'
320
- lambda { java_import 'org.apache.mina.core.IoUtil' }.should raise_error
344
+ lambda { java_import java_class }.should raise_error
321
345
  else
322
- lambda { Rjb::import('org.apache.mina.core.IoUtil') }.should raise_error
346
+ lambda { Rjb::import(java_class) }.should raise_error
323
347
  end
348
+ end
324
349
 
350
+ def expect_java_class_loaded(java_class)
351
+ if Naether.platform == 'java'
352
+ lambda { java_import java_class }.should_not raise_error
353
+ else
354
+ lambda { Rjb::import(java_class) }.should_not raise_error
355
+ end
356
+ end
325
357
 
326
- LockJar.lock( "spec/fixtures/Jarfile", :local_repo => "#{TEMP_DIR}/test-repo", :lockfile => "#{TEMP_DIR}/Jarfile.lock" )
327
-
328
- jars = LockJar.load( "#{TEMP_DIR}/Jarfile.lock", ['default'], :local_repo => "#{TEMP_DIR}/test-repo" )
329
- LockJar::Registry.instance.lockfile_registered?( "#{TEMP_DIR}/Jarfile.lock" ).should be_false
330
-
331
- jars.should eql([
358
+ let(:expected_jars) do
359
+ [
332
360
  "spec/fixtures/naether-0.13.0.jar",
333
361
  File.expand_path("#{TEMP_DIR}/test-repo/ch/qos/logback/logback-classic/0.9.24/logback-classic-0.9.24.jar"),
334
362
  File.expand_path("#{TEMP_DIR}/test-repo/ch/qos/logback/logback-core/0.9.24/logback-core-0.9.24.jar"),
@@ -340,22 +368,23 @@ describe LockJar do
340
368
  File.expand_path("#{TEMP_DIR}/test-repo/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"),
341
369
  File.expand_path("#{TEMP_DIR}/test-repo/org/apache/mina/mina-core/2.0.4/mina-core-2.0.4.jar"),
342
370
  File.expand_path("#{TEMP_DIR}/test-repo/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar"),
343
- ])
344
- if Naether.platform == 'java'
345
- lambda { java_import 'org.apache.mina.core.IoUtil' }.should_not raise_error
346
- else
347
- lambda { Rjb::import('org.apache.mina.core.IoUtil') }.should_not raise_error
348
- end
371
+ ]
372
+ end
373
+
374
+ it "by Jarfile.lock" do
375
+ expect_java_class_not_loaded('org.apache.mina.core.IoUtil')
376
+
377
+ LockJar.lock( "spec/fixtures/Jarfile", :local_repo => "#{TEMP_DIR}/test-repo", :lockfile => "#{TEMP_DIR}/Jarfile.lock" )
378
+ jars = LockJar.load( "#{TEMP_DIR}/Jarfile.lock", ['default'], :local_repo => "#{TEMP_DIR}/test-repo" )
379
+ LockJar::Registry.instance.lockfile_registered?( "#{TEMP_DIR}/Jarfile.lock" ).should be_false
349
380
 
381
+ jars.should eql(expected_jars)
350
382
 
383
+ expect_java_class_loaded('org.apache.mina.core.IoUtil')
351
384
  end
352
385
 
353
386
  it "by block with resolve option" do
354
- if Naether.platform == 'java'
355
- lambda { java_import 'org.modeshape.common.math.Duration' }.should raise_error
356
- else
357
- lambda { Rjb::import('org.modeshape.common.math.Duration') }.should raise_error
358
- end
387
+ expect_java_class_not_loaded('org.modeshape.common.math.Duration')
359
388
 
360
389
  jars = LockJar.load(:local_repo => TEST_REPO, :resolve => true) do
361
390
  jar 'org.modeshape:modeshape-common:3.4.0.Final'
@@ -363,11 +392,7 @@ describe LockJar do
363
392
 
364
393
  jars.should eql( [File.expand_path(TEST_REPO + "/org/modeshape/modeshape-common/3.4.0.Final/modeshape-common-3.4.0.Final.jar")] )
365
394
 
366
- if Naether.platform == 'java'
367
- lambda { java_import 'org.modeshape.common.math.Duration' }.should_not raise_error
368
- else
369
- lambda { Rjb::import('org.modeshape.common.math.Duration') }.should_not raise_error
370
- end
395
+ expect_java_class_loaded('org.modeshape.common.math.Duration')
371
396
  end
372
397
  end
373
398
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lock_jar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Guymon
@@ -51,7 +51,6 @@ files:
51
51
  - .travis.yml
52
52
  - CHANGELOG.md
53
53
  - Gemfile
54
- - Gemfile.lock
55
54
  - Guardfile
56
55
  - LICENSE
57
56
  - README.md
data/Gemfile.lock DELETED
@@ -1,78 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- lock_jar (0.12.0)
5
- naether (~> 0.14.0)
6
- thor (>= 0.18.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- celluloid (0.15.2)
12
- timers (~> 1.1.0)
13
- coderay (1.1.0)
14
- diff-lcs (1.2.5)
15
- ffi (1.9.3)
16
- ffi (1.9.3-java)
17
- formatador (0.2.5)
18
- guard (2.6.1)
19
- formatador (>= 0.2.4)
20
- listen (~> 2.7)
21
- lumberjack (~> 1.0)
22
- pry (>= 0.9.12)
23
- thor (>= 0.18.1)
24
- guard-rspec (4.2.10)
25
- guard (~> 2.1)
26
- rspec (>= 2.14, < 4.0)
27
- httpclient (2.6.0.1)
28
- jruby-openssl (0.9.5-java)
29
- listen (2.7.9)
30
- celluloid (>= 0.15.2)
31
- rb-fsevent (>= 0.9.3)
32
- rb-inotify (>= 0.9)
33
- lumberjack (1.0.7)
34
- method_source (0.8.2)
35
- naether (0.14.0)
36
- httpclient
37
- rjb (~> 1.4.0)
38
- naether (0.14.0-java)
39
- httpclient
40
- pry (0.10.0)
41
- coderay (~> 1.1.0)
42
- method_source (~> 0.8.1)
43
- slop (~> 3.4)
44
- pry (0.10.0-java)
45
- coderay (~> 1.1.0)
46
- method_source (~> 0.8.1)
47
- slop (~> 3.4)
48
- spoon (~> 0.0)
49
- rb-fsevent (0.9.4)
50
- rb-inotify (0.9.5)
51
- ffi (>= 0.5.0)
52
- rjb (1.4.9)
53
- rspec (2.14.1)
54
- rspec-core (~> 2.14.0)
55
- rspec-expectations (~> 2.14.0)
56
- rspec-mocks (~> 2.14.0)
57
- rspec-core (2.14.8)
58
- rspec-expectations (2.14.5)
59
- diff-lcs (>= 1.1.3, < 2.0)
60
- rspec-mocks (2.14.6)
61
- slop (3.5.0)
62
- spoon (0.0.4)
63
- ffi
64
- thor (0.19.1)
65
- timers (1.1.0)
66
- yard (0.8.7.4)
67
-
68
- PLATFORMS
69
- java
70
- ruby
71
-
72
- DEPENDENCIES
73
- guard-rspec
74
- jruby-openssl
75
- lock_jar!
76
- pry
77
- rspec (~> 2.14.1)
78
- yard