gjp 0.34.0 → 0.35.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency "rspec"
24
24
 
25
25
  s.add_runtime_dependency "clamp"
26
- s.add_runtime_dependency "rubyzip"
26
+ s.add_runtime_dependency "rubyzip", ">= 1.0"
27
27
  s.add_runtime_dependency "rest-client"
28
28
  s.add_runtime_dependency "json"
29
29
  s.add_runtime_dependency "text"
@@ -1,6 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require "find"
4
+ require "zip"
4
5
 
5
6
  module Gjp
6
7
  # checks kits for errors
@@ -25,7 +26,7 @@ module Gjp
25
26
  path. =~ /\.(zip)|([jwe]ar)$/
26
27
  end.map do |path, archive|
27
28
  result = []
28
- Zip::ZipFile.foreach(path) do |entry|
29
+ Zip::File.foreach(path) do |entry|
29
30
  if entry.file?
30
31
  result << [entry.to_s, path]
31
32
  end
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require "digest/sha1"
4
- require "zip/zip"
4
+ require "zip"
5
5
  require "rest_client"
6
6
  require "json"
7
7
  require "pathname"
@@ -28,13 +28,13 @@ module Gjp
28
28
  def get_pom_from_jar(file)
29
29
  log.debug("Attempting unpack of #{file} to find a POM")
30
30
  begin
31
- Zip::ZipFile.foreach(file) do |entry|
31
+ Zip::File.foreach(file) do |entry|
32
32
  if entry.name =~ /\/pom.xml$/
33
33
  log.info("pom.xml found in #{file}##{entry.name}")
34
34
  return entry.get_input_stream.read, :found_in_jar
35
35
  end
36
36
  end
37
- rescue Zip::ZipError
37
+ rescue Zip::Error
38
38
  log.warn("#{file} does not seem to be a valid jar archive, skipping")
39
39
  rescue TypeError
40
40
  log.warn("#{file} seems to be a valid jar archive but is corrupt, skipping")
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Gjp
4
- VERSION = "0.34.0"
4
+ VERSION = "0.35.0"
5
5
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "spec_helper"
4
4
  require "rubygems"
5
- require "zip/zip"
5
+ require "zip"
6
6
 
7
7
  describe Gjp::KitChecker do
8
8
  include Gjp::Mockers
@@ -22,7 +22,7 @@ describe Gjp::KitChecker do
22
22
  FileUtils.touch("top_level")
23
23
  FileUtils.mkdir_p("directory")
24
24
  FileUtils.touch(File.join("directory","in_directory"))
25
- Zip::ZipFile.open("zipped.zip", Zip::ZipFile::CREATE) do |zipfile|
25
+ Zip::File.open("zipped.zip", Zip::File::CREATE) do |zipfile|
26
26
  Dir[File.join("directory", "**", "**")].each do |file|
27
27
  zipfile.add(file.sub("/directory", ""), file)
28
28
  end
@@ -83,14 +83,14 @@ describe Gjp::KitChecker do
83
83
 
84
84
  FileUtils.mkdir_p("package2")
85
85
  FileUtils.touch(File.join("package2","SourcedClass.java"))
86
- Zip::ZipFile.open("zipped-source-2.jar", Zip::ZipFile::CREATE) do |zipfile|
86
+ Zip::File.open("zipped-source-2.jar", Zip::File::CREATE) do |zipfile|
87
87
  Dir[File.join("package2", "**", "**")].each do |file|
88
88
  zipfile.add(file.sub("/package2", ""), file)
89
89
  end
90
90
  end
91
91
  FileUtils.rm(File.join("package2","SourcedClass.java"))
92
92
  FileUtils.touch(File.join("package2","SourcedClass.class"))
93
- Zip::ZipFile.open("zipped-2.jar", Zip::ZipFile::CREATE) do |zipfile|
93
+ Zip::File.open("zipped-2.jar", Zip::File::CREATE) do |zipfile|
94
94
  Dir[File.join("package2", "**", "**")].each do |file|
95
95
  zipfile.add(file.sub("/package2", ""), file)
96
96
  end
@@ -99,7 +99,7 @@ describe Gjp::KitChecker do
99
99
  FileUtils.mkdir_p("package3")
100
100
  FileUtils.touch(File.join("package3","SourcedSameArchive.java"))
101
101
  FileUtils.touch(File.join("package3","SourcedSameArchive.class"))
102
- Zip::ZipFile.open("zipped-3.zip", Zip::ZipFile::CREATE) do |zipfile|
102
+ Zip::File.open("zipped-3.zip", Zip::File::CREATE) do |zipfile|
103
103
  Dir[File.join("package3", "**", "**")].each do |file|
104
104
  zipfile.add(file.sub("/package3", ""), file)
105
105
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gjp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.0
4
+ version: 0.35.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-08 00:00:00.000000000 Z
12
+ date: 2014-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: '1.0'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: '1.0'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rest-client
80
80
  requirement: !ruby/object:Gem::Requirement