rubyzip 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $: << '../lib'
3
+ $LOAD_PATH << '../lib'
4
4
 
5
5
  require 'zip'
6
6
 
7
- include Zip
8
-
9
- OutputStream.open('simple.zip') do |zos|
7
+ ::Zip::OutputStream.open('simple.zip') do |zos|
10
8
  zos.put_next_entry 'entry.txt'
11
9
  zos.puts 'Hello world'
12
10
  end
@@ -2,36 +2,37 @@
2
2
 
3
3
  $VERBOSE = true
4
4
 
5
- $: << '../lib'
5
+ $LOAD_PATH << '../lib'
6
6
 
7
7
  require 'zip'
8
8
  require 'find'
9
9
 
10
10
  module Zip
11
11
  module ZipFind
12
- def self.find(path, zipFilePattern = /\.zip$/i)
13
- Find.find(path) do |fileName|
14
- yield(fileName)
15
- next unless zipFilePattern.match(fileName) && File.file?(fileName)
12
+ def self.find(path, zip_file_pattern = /\.zip$/i)
13
+ Find.find(path) do |filename|
14
+ yield(filename)
15
+ next unless zip_file_pattern.match(filename) && File.file?(filename)
16
+
16
17
  begin
17
- Zip::File.foreach(fileName) do |zipEntry|
18
- yield(fileName + File::SEPARATOR + zipEntry.to_s)
18
+ Zip::File.foreach(filename) do |entry|
19
+ yield(filename + File::SEPARATOR + entry.to_s)
19
20
  end
20
- rescue Errno::EACCES => ex
21
- puts ex
21
+ rescue Errno::EACCES => e
22
+ puts e
22
23
  end
23
24
  end
24
25
  end
25
26
 
26
- def self.find_file(path, fileNamePattern, zipFilePattern = /\.zip$/i)
27
- find(path, zipFilePattern) do |fileName|
28
- yield(fileName) if fileNamePattern.match(fileName)
27
+ def self.find_file(path, filename_pattern, zip_file_pattern = /\.zip$/i)
28
+ find(path, zip_file_pattern) do |filename|
29
+ yield(filename) if filename_pattern.match(filename)
29
30
  end
30
31
  end
31
32
  end
32
33
  end
33
34
 
34
- if $0 == __FILE__
35
+ if $PROGRAM_NAME == __FILE__
35
36
  module ZipFindConsoleRunner
36
37
  PATH_ARG_INDEX = 0
37
38
  FILENAME_PATTERN_ARG_INDEX = 1
@@ -41,24 +42,24 @@ if $0 == __FILE__
41
42
  check_args(args)
42
43
  Zip::ZipFind.find_file(args[PATH_ARG_INDEX],
43
44
  args[FILENAME_PATTERN_ARG_INDEX],
44
- args[ZIPFILE_PATTERN_ARG_INDEX]) do |fileName|
45
- report_entry_found fileName
45
+ args[ZIPFILE_PATTERN_ARG_INDEX]) do |filename|
46
+ report_entry_found filename
46
47
  end
47
48
  end
48
49
 
49
50
  def self.check_args(args)
50
- if args.size != 3
51
- usage
52
- exit
53
- end
51
+ return if args.size == 3
52
+
53
+ usage
54
+ exit
54
55
  end
55
56
 
56
57
  def self.usage
57
- puts "Usage: #{$0} PATH ZIPFILENAME_PATTERN FILNAME_PATTERN"
58
+ puts "Usage: #{$PROGRAM_NAME} PATH ZIPFILENAME_PATTERN FILNAME_PATTERN"
58
59
  end
59
60
 
60
- def self.report_entry_found(fileName)
61
- puts fileName
61
+ def self.report_entry_found(filename)
62
+ puts filename
62
63
  end
63
64
  end
64
65
 
metadata CHANGED
@@ -1,85 +1,91 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyzip
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Simonov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-01 00:00:00.000000000 Z
11
+ date: 2020-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: coveralls
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.3'
19
+ version: '0.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10.3'
26
+ version: '0.7'
27
27
  - !ruby/object:Gem::Dependency
28
- name: pry
28
+ name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.10'
33
+ version: '5.4'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.10'
40
+ version: '5.4'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.4'
47
+ version: '0.10'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.4'
54
+ version: '0.10'
55
55
  - !ruby/object:Gem::Dependency
56
- name: coveralls
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.7'
61
+ version: '12.3'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 12.3.3
62
65
  type: :development
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
69
  - - "~>"
67
70
  - !ruby/object:Gem::Version
68
- version: '0.7'
71
+ version: '12.3'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 12.3.3
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rubocop
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: 0.49.1
81
+ version: '0.79'
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: 0.49.1
88
+ version: '0.79'
83
89
  description:
84
90
  email:
85
91
  - alex@simonov.me
@@ -140,9 +146,9 @@ licenses:
140
146
  - BSD 2-Clause
141
147
  metadata:
142
148
  bug_tracker_uri: https://github.com/rubyzip/rubyzip/issues
143
- changelog_uri: https://github.com/rubyzip/rubyzip/blob/v2.2.0/Changelog.md
144
- documentation_uri: https://www.rubydoc.info/gems/rubyzip/2.2.0
145
- source_code_uri: https://github.com/rubyzip/rubyzip/tree/v2.2.0
149
+ changelog_uri: https://github.com/rubyzip/rubyzip/blob/v2.3.0/Changelog.md
150
+ documentation_uri: https://www.rubydoc.info/gems/rubyzip/2.3.0
151
+ source_code_uri: https://github.com/rubyzip/rubyzip/tree/v2.3.0
146
152
  wiki_uri: https://github.com/rubyzip/rubyzip/wiki
147
153
  post_install_message:
148
154
  rdoc_options: []