ngzip 1.0.7 → 1.1.0
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 +5 -5
- data/Gemfile +8 -0
- data/Rakefile +6 -4
- data/lib/ngzip.rb +6 -3
- data/lib/ngzip/builder.rb +33 -25
- data/lib/ngzip/version.rb +3 -1
- data/ngzip.gemspec +17 -14
- data/test/lib/ngzip/builder_test.rb +89 -69
- data/test/lib/ngzip/version_test.rb +6 -6
- data/test/test_helper.rb +6 -2
- metadata +20 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 84899280f348b240160b5c6984b7a4130a7a48f71b9c7d903051f99a36326f09
|
4
|
+
data.tar.gz: 1b1b057b9da9d80900035e732ed586b13c9e5a25659b4b9ac226862f7d6782b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f5b599664e6b4f49de86596596ae5bdae4f9ab8601c260e58e075c6376d6a37c5aa25a441baa971cf590a1b11d218e675369e67140ca9076df197fc2c62aeaa
|
7
|
+
data.tar.gz: 815fb0735456a2020781276b456c47e8e76d567e2ef8b35bcd65856e38913c55e00c717cb1a0ced8da4f8e39d1d9febf9deec9645dcb9d2bf4de2790520ddee1
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
|
5
|
+
require 'rake/testtask'
|
4
6
|
|
5
7
|
Rake::TestTask.new do |t|
|
6
8
|
t.libs << 'lib'
|
7
9
|
t.test_files = FileList['test/lib/ngzip/*_test.rb']
|
8
10
|
t.verbose = true
|
9
11
|
end
|
10
|
-
|
11
|
-
task :
|
12
|
+
|
13
|
+
task default: :test
|
data/lib/ngzip.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
require "ngzip/builder"
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
3
|
+
require 'ngzip/version'
|
4
|
+
require 'ngzip/builder'
|
5
|
+
|
6
|
+
# Ngzip module
|
4
7
|
module Ngzip
|
5
8
|
def self.build(files, options)
|
6
|
-
Ngzip::Builder.new
|
9
|
+
Ngzip::Builder.new.build(files, options)
|
7
10
|
end
|
8
11
|
end
|
data/lib/ngzip/builder.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'zlib'
|
2
4
|
require 'uri'
|
5
|
+
require 'erb'
|
3
6
|
|
4
7
|
module Ngzip
|
8
|
+
# The manifest builder based on the file list
|
5
9
|
class Builder
|
6
10
|
BUFFER_SIZE = 8 * 1024
|
7
11
|
|
@@ -13,22 +17,25 @@ module Ngzip
|
|
13
17
|
# Returns a line for each file separated by \n
|
14
18
|
#
|
15
19
|
# The following options are available:
|
16
|
-
# :
|
17
|
-
# :
|
18
|
-
# :
|
20
|
+
# crc: Enable or disable CRC-32 checksums
|
21
|
+
# crc_cache: Allows for provided cached CRC-32 checksums in a hash where the key is the file path
|
22
|
+
# base_dir: Use this as root for the relative pathes in the archive, keep all directories below
|
19
23
|
def build(files, options = {})
|
20
|
-
settings = {:
|
24
|
+
settings = { crc: true }
|
21
25
|
settings.merge! options
|
22
26
|
|
23
27
|
list = file_list(files)
|
24
28
|
prefix = options[:base_dir] || detect_common_prefix(list)
|
25
29
|
prefix += '/' unless prefix.end_with?('/')
|
26
30
|
list.map do |f|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
format(
|
32
|
+
'%<crc>s %<size>d %<url>s %<name>s',
|
33
|
+
{
|
34
|
+
crc: compute_crc32(f, settings),
|
35
|
+
size: File.size(f).to_i,
|
36
|
+
url: Builder.encode(f),
|
37
|
+
name: f.gsub(prefix, '')
|
38
|
+
}
|
32
39
|
)
|
33
40
|
end.join("\n")
|
34
41
|
end
|
@@ -36,15 +43,15 @@ module Ngzip
|
|
36
43
|
# Public: Get the special header to signal the mod_zip
|
37
44
|
#
|
38
45
|
# Returns the header as a string "key: value"
|
39
|
-
def header
|
40
|
-
|
46
|
+
def header
|
47
|
+
'X-Archive-Files: zip'
|
41
48
|
end
|
42
49
|
|
43
50
|
# Public: Encode the string
|
44
51
|
#
|
45
52
|
# Returns the encoded string using URL escape formatting
|
46
53
|
def self.encode(string)
|
47
|
-
|
54
|
+
ERB::Util.url_encode(string)
|
48
55
|
end
|
49
56
|
|
50
57
|
private
|
@@ -55,16 +62,17 @@ module Ngzip
|
|
55
62
|
#
|
56
63
|
# Returns a common prefix
|
57
64
|
def detect_common_prefix(list)
|
58
|
-
if list.size == 1
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
min, max =
|
65
|
+
return File.dirname(list.first) if list.size == 1
|
66
|
+
|
67
|
+
prefix = StringIO.new
|
68
|
+
excluding_file_names = list.map { |p| File.dirname p }
|
69
|
+
min, max = excluding_file_names.sort.values_at(0, -1)
|
63
70
|
min.split(//).each_with_index do |c, i|
|
64
71
|
break if c != max[i, 1]
|
72
|
+
|
65
73
|
prefix << c
|
66
74
|
end
|
67
|
-
prefix
|
75
|
+
prefix.string
|
68
76
|
end
|
69
77
|
|
70
78
|
# Internal: Compute the file list by expanding directories
|
@@ -72,7 +80,9 @@ module Ngzip
|
|
72
80
|
def file_list(files)
|
73
81
|
Array(files).map do |e|
|
74
82
|
if File.directory?(e)
|
75
|
-
|
83
|
+
# `expand_path` removes any trailing slash from the path string
|
84
|
+
sanitized_path = File.expand_path(e)
|
85
|
+
Dir.glob("#{sanitized_path}/**/*").reject { |f| File.directory?(f) }
|
76
86
|
else
|
77
87
|
e
|
78
88
|
end
|
@@ -80,7 +90,7 @@ module Ngzip
|
|
80
90
|
end
|
81
91
|
|
82
92
|
# Internal: Compute the CRC-32 checksum for a file unless the settings
|
83
|
-
# disable the computation (:
|
93
|
+
# disable the computation (crc: false) and this method returns "-"
|
84
94
|
#
|
85
95
|
# file - The full path to the file
|
86
96
|
# settings - The settings hash
|
@@ -90,14 +100,12 @@ module Ngzip
|
|
90
100
|
return '-' unless settings[:crc]
|
91
101
|
|
92
102
|
# honor the cache
|
93
|
-
if settings[:crc_cache] && settings[:crc_cache][file]
|
94
|
-
return settings[:crc_cache][file]
|
95
|
-
end
|
103
|
+
return settings[:crc_cache][file] if settings[:crc_cache] && settings[:crc_cache][file]
|
96
104
|
|
97
105
|
# read using a buffer, we might operate on large files!
|
98
106
|
crc32 = 0
|
99
|
-
File.open(file,'rb') do |f|
|
100
|
-
while buffer = f.read(BUFFER_SIZE)
|
107
|
+
File.open(file, 'rb') do |f|
|
108
|
+
while (buffer = f.read(BUFFER_SIZE))
|
101
109
|
crc32 = Zlib.crc32(buffer, crc32)
|
102
110
|
end
|
103
111
|
end
|
data/lib/ngzip/version.rb
CHANGED
data/ngzip.gemspec
CHANGED
@@ -1,24 +1,27 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'english'
|
4
6
|
require 'ngzip/version'
|
5
7
|
|
6
8
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
9
|
+
spec.name = 'ngzip'
|
8
10
|
spec.version = Ngzip::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description = %
|
12
|
-
See http://wiki.nginx.org/NginxNgxZip for the nginx module.
|
13
|
-
spec.summary =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
11
|
+
spec.authors = ['dup2']
|
12
|
+
spec.email = ['zarkov@cargoserver.ch']
|
13
|
+
spec.description = %(Provides a nginx mod_zip compatible file manifest for streaming support.
|
14
|
+
See http://wiki.nginx.org/NginxNgxZip for the nginx module.)
|
15
|
+
spec.summary = 'Provides a nginx mod_zip compatible file manifest for streaming support'
|
16
|
+
spec.homepage = 'https://github.com/cargoserver/ngzip'
|
17
|
+
spec.license = 'MIT'
|
16
18
|
|
17
|
-
spec.files = `git ls-files`.split(
|
19
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
18
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ['lib']
|
21
23
|
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'rubocop'
|
24
27
|
end
|
@@ -1,134 +1,154 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../test_helper'
|
2
4
|
require 'uri'
|
3
5
|
require 'pathname'
|
4
6
|
|
5
7
|
describe Ngzip do
|
6
|
-
|
7
8
|
it 'must support the static method :build' do
|
8
|
-
Ngzip.respond_to?(:build).must_equal true
|
9
|
+
expect(Ngzip.respond_to?(:build)).must_equal true
|
9
10
|
end
|
10
|
-
|
11
11
|
end
|
12
12
|
|
13
13
|
describe Ngzip::Builder do
|
14
|
+
def encode_file_path(path)
|
15
|
+
ERB::Util.url_encode path
|
16
|
+
end
|
14
17
|
|
15
|
-
let(:builder) {Ngzip::Builder.new
|
16
|
-
let(:lorem) {File.expand_path('
|
17
|
-
let(:ipsum) {File.expand_path('
|
18
|
-
let(:without_dot) {File.expand_path('
|
19
|
-
let(:my_file) {File.expand_path('
|
20
|
-
let(:whitespaced) {File.expand_path('
|
21
|
-
let(:plused) {File.expand_path('
|
22
|
-
let(:cargo) {File.expand_path('
|
23
|
-
let(:sit) {File.expand_path('
|
24
|
-
let(:a) {File.expand_path('
|
25
|
-
let(:questions) { File.expand_path('
|
18
|
+
let(:builder) { Ngzip::Builder.new }
|
19
|
+
let(:lorem) { File.expand_path('../../data/a/lorem.txt', __dir__) }
|
20
|
+
let(:ipsum) { File.expand_path('../../data/a/ipsum.txt', __dir__) }
|
21
|
+
let(:without_dot) { File.expand_path('../../data/a/filename-without-a-dot', __dir__) }
|
22
|
+
let(:my_file) { File.expand_path('../../data/a/d/my_file.txt', __dir__) }
|
23
|
+
let(:whitespaced) { File.expand_path('../../data/a/A filename with whitespace.txt', __dir__) }
|
24
|
+
let(:plused) { File.expand_path('../../data/c/A filename with space and + in it.txt', __dir__) }
|
25
|
+
let(:cargo) { File.expand_path('../../data/b/Cargo.png', __dir__) }
|
26
|
+
let(:sit) { File.expand_path('../../data/sit.txt', __dir__) }
|
27
|
+
let(:a) { File.expand_path('../../data/a', __dir__) }
|
28
|
+
let(:questions) { File.expand_path('../../data/c/questions?', __dir__) }
|
26
29
|
|
27
30
|
it 'must be defined' do
|
28
|
-
Ngzip::Builder.wont_be_nil
|
31
|
+
expect(Ngzip::Builder).wont_be_nil
|
29
32
|
end
|
30
33
|
|
31
34
|
it 'must be a class we can call :new on' do
|
32
|
-
Ngzip::Builder.new
|
35
|
+
expect(Ngzip::Builder.new).wont_be_nil
|
33
36
|
end
|
34
37
|
|
35
38
|
it 'must respond to :build' do
|
36
|
-
builder.respond_to?(:build).must_equal true
|
39
|
+
expect(builder.respond_to?(:build)).must_equal true
|
37
40
|
end
|
38
41
|
|
39
|
-
describe
|
40
|
-
let(:options) { {:
|
42
|
+
describe 'with CRC-32 checksums disabled' do
|
43
|
+
let(:options) { { crc: false } }
|
41
44
|
|
42
45
|
it 'must return a correct list for one file' do
|
43
|
-
expected = "- 446 #{lorem} lorem.txt"
|
44
|
-
builder.build(lorem, options).must_equal expected
|
46
|
+
expected = "- 446 #{encode_file_path(lorem)} lorem.txt"
|
47
|
+
expect(builder.build(lorem, options)).must_equal expected
|
45
48
|
end
|
46
49
|
end
|
47
50
|
|
48
|
-
describe
|
49
|
-
let(:options) { {:
|
51
|
+
describe 'with CRC-32 checksums enabled' do
|
52
|
+
let(:options) { { crc: true } }
|
50
53
|
|
51
54
|
it 'must return a correct list for one file with a checksum' do
|
52
|
-
expected = "8f92322f 446 #{lorem} lorem.txt"
|
53
|
-
builder.build(lorem, options).must_equal expected
|
55
|
+
expected = "8f92322f 446 #{encode_file_path(lorem)} lorem.txt"
|
56
|
+
expect(builder.build(lorem, options)).must_equal expected
|
54
57
|
end
|
55
58
|
|
56
59
|
it 'must return a correct list for one binary file with a checksum' do
|
57
|
-
expected = "b2f4655b 11550 #{cargo} Cargo.png"
|
58
|
-
builder.build(cargo, options).must_equal expected
|
60
|
+
expected = "b2f4655b 11550 #{encode_file_path(cargo)} Cargo.png"
|
61
|
+
expect(builder.build(cargo, options)).must_equal expected
|
59
62
|
end
|
60
63
|
|
61
64
|
it 'must escape the path name' do
|
62
|
-
expected = "8f92322f 446 #{
|
63
|
-
builder.build(whitespaced, options).must_equal expected
|
65
|
+
expected = "8f92322f 446 #{encode_file_path(whitespaced)} A filename with whitespace.txt"
|
66
|
+
expect(builder.build(whitespaced, options)).must_equal expected
|
64
67
|
end
|
65
68
|
|
66
69
|
it 'must return a correct list for all files in a directory' do
|
67
|
-
expected =
|
68
|
-
expected << "
|
69
|
-
expected << "\n8f92322f 446 #{without_dot} filename-without-a-dot"
|
70
|
-
expected << "\n8f92322f 446 #{ipsum} ipsum.txt"
|
71
|
-
expected << "\n8f92322f 446 #{lorem} lorem.txt"
|
72
|
-
|
70
|
+
expected = StringIO.new
|
71
|
+
expected << "8f92322f 446 #{encode_file_path(whitespaced)} A filename with whitespace.txt"
|
72
|
+
expected << "\n8f92322f 446 #{encode_file_path(without_dot)} filename-without-a-dot"
|
73
|
+
expected << "\n8f92322f 446 #{encode_file_path(ipsum)} ipsum.txt"
|
74
|
+
expected << "\n8f92322f 446 #{encode_file_path(lorem)} lorem.txt"
|
75
|
+
expected << "\n8f92322f 446 #{encode_file_path(my_file)} d/my_file.txt"
|
76
|
+
expect(builder.build(a, options)).must_equal expected.string
|
73
77
|
end
|
74
78
|
|
75
79
|
it 'must allow to mix files and directories' do
|
76
|
-
expected =
|
77
|
-
expected << "
|
78
|
-
expected << "\n8f92322f 446 #{without_dot} a/filename-without-a-dot"
|
79
|
-
expected << "\n8f92322f 446 #{ipsum} a/ipsum.txt"
|
80
|
-
expected << "\n8f92322f 446 #{lorem} a/lorem.txt"
|
81
|
-
expected << "\
|
82
|
-
|
80
|
+
expected = StringIO.new
|
81
|
+
expected << "8f92322f 446 #{encode_file_path(whitespaced)} a/A filename with whitespace.txt"
|
82
|
+
expected << "\n8f92322f 446 #{encode_file_path(without_dot)} a/filename-without-a-dot"
|
83
|
+
expected << "\n8f92322f 446 #{encode_file_path(ipsum)} a/ipsum.txt"
|
84
|
+
expected << "\n8f92322f 446 #{encode_file_path(lorem)} a/lorem.txt"
|
85
|
+
expected << "\n8f92322f 446 #{encode_file_path(my_file)} a/d/my_file.txt"
|
86
|
+
expected << "\nf7c0867d 1342 #{encode_file_path(sit)} sit.txt"
|
87
|
+
expect(builder.build([a, sit], options)).must_equal expected.string
|
83
88
|
end
|
84
89
|
|
85
90
|
it 'must preserve directory names' do
|
86
91
|
expected = [
|
87
|
-
"8f92322f 446 #{lorem} a/lorem.txt",
|
88
|
-
"8f92322f 446 #{ipsum} a/ipsum.txt",
|
89
|
-
"b2f4655b 11550 #{cargo} b/Cargo.png"
|
90
|
-
|
91
|
-
builder.build([lorem,ipsum,cargo], options).must_equal expected
|
92
|
+
"8f92322f 446 #{encode_file_path(lorem)} a/lorem.txt",
|
93
|
+
"8f92322f 446 #{encode_file_path(ipsum)} a/ipsum.txt",
|
94
|
+
"b2f4655b 11550 #{encode_file_path(cargo)} b/Cargo.png"
|
95
|
+
].join("\n")
|
96
|
+
expect(builder.build([lorem, ipsum, cargo], options)).must_equal expected
|
92
97
|
end
|
93
98
|
|
94
99
|
it 'must honor the CRC cache' do
|
95
|
-
invalid_but_cached =
|
96
|
-
expected = "#{invalid_but_cached} 446 #{lorem} lorem.txt"
|
97
|
-
builder.build(lorem, options.merge(:
|
100
|
+
invalid_but_cached = '781aaabcc124'
|
101
|
+
expected = "#{invalid_but_cached} 446 #{encode_file_path(lorem)} lorem.txt"
|
102
|
+
expect(builder.build(lorem, options.merge(crc_cache: { lorem => invalid_but_cached }))).must_equal expected
|
98
103
|
end
|
99
104
|
|
100
105
|
it 'must remove common directories by default' do
|
101
|
-
pathes = builder.build([lorem, ipsum]).split("\n").map{|line| line.split.last}
|
102
|
-
expected = [
|
103
|
-
pathes.must_equal expected
|
106
|
+
pathes = builder.build([lorem, ipsum]).split("\n").map { |line| line.split.last }
|
107
|
+
expected = ['lorem.txt', 'ipsum.txt']
|
108
|
+
expect(pathes).must_equal expected
|
109
|
+
end
|
110
|
+
|
111
|
+
describe 'when building the manifest from a directory path parameter' do
|
112
|
+
it 'removes trailing slash from builder file path' do
|
113
|
+
dir_path = File.join(File.dirname(lorem), '/')
|
114
|
+
result = builder.build(dir_path)
|
115
|
+
encoded_host_path = ERB::Util.url_encode(File.join(File.expand_path('../data', File.dirname(__dir__)), '/'))
|
116
|
+
manifest = <<~MANIFEST.chomp
|
117
|
+
8f92322f 446 #{encoded_host_path}a%2FA%20filename%20with%20whitespace.txt A filename with whitespace.txt
|
118
|
+
8f92322f 446 #{encoded_host_path}a%2Ffilename-without-a-dot filename-without-a-dot
|
119
|
+
8f92322f 446 #{encoded_host_path}a%2Fipsum.txt ipsum.txt
|
120
|
+
8f92322f 446 #{encoded_host_path}a%2Florem.txt lorem.txt
|
121
|
+
8f92322f 446 #{encoded_host_path}a%2Fd%2Fmy_file.txt d/my_file.txt
|
122
|
+
MANIFEST
|
123
|
+
expect(result).must_equal manifest
|
124
|
+
end
|
104
125
|
end
|
105
126
|
|
106
127
|
it 'must keep common directories if :base_dir is provided' do
|
107
|
-
options = {:
|
108
|
-
pathes = builder.build([lorem, ipsum], options).split("\n").map{|line| line.split.last}
|
109
|
-
expected = [
|
110
|
-
pathes.must_equal expected
|
128
|
+
options = { base_dir: Pathname.new(lorem).parent.parent.to_s }
|
129
|
+
pathes = builder.build([lorem, ipsum], options).split("\n").map { |line| line.split.last }
|
130
|
+
expected = ['a/lorem.txt', 'a/ipsum.txt']
|
131
|
+
expect(pathes).must_equal expected
|
111
132
|
end
|
112
133
|
|
113
134
|
it 'must cope with a trailing / in the :base_dir' do
|
114
|
-
options = {:
|
115
|
-
pathes = builder.build([lorem, ipsum], options).split("\n").map{|line| line.split.last}
|
116
|
-
expected = [
|
117
|
-
pathes.must_equal expected
|
135
|
+
options = { base_dir: "#{Pathname.new(lorem).parent.parent}/" }
|
136
|
+
pathes = builder.build([lorem, ipsum], options).split("\n").map { |line| line.split.last }
|
137
|
+
expected = ['a/lorem.txt', 'a/ipsum.txt']
|
138
|
+
expect(pathes).must_equal expected
|
118
139
|
end
|
119
140
|
|
120
141
|
it 'must correctly encode filenames with a "+"' do
|
121
142
|
options = {}
|
122
|
-
name = File.join(Pathname.new(plused).parent.to_s, 'A
|
123
|
-
expected = "8f92322f 446 #{name} A filename with space and + in it.txt"
|
124
|
-
builder.build([plused], options).must_equal expected
|
143
|
+
name = File.join(Pathname.new(plused).parent.to_s, 'A filename with space and + in it.txt')
|
144
|
+
expected = "8f92322f 446 #{encode_file_path(name)} A filename with space and + in it.txt"
|
145
|
+
expect(builder.build([plused], options)).must_equal expected
|
125
146
|
end
|
126
147
|
|
127
148
|
it 'must correctly encode the "?" character' do
|
128
|
-
name = File.join(Pathname.new(questions).parent.to_s, 'questions
|
129
|
-
expected = "f03102f5 13 #{name} test.txt"
|
130
|
-
|
131
|
-
builder.build([File.join(questions, 'test.txt')]).must_equal expected
|
149
|
+
name = File.join(Pathname.new(questions).parent.to_s, 'questions?/test.txt')
|
150
|
+
expected = "f03102f5 13 #{encode_file_path(name)} test.txt"
|
151
|
+
expect(builder.build([File.join(questions, 'test.txt')])).must_equal expected
|
132
152
|
end
|
133
153
|
end
|
134
154
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative '../../test_helper'
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
describe Ngzip do
|
6
|
+
it 'must define a version' do
|
7
|
+
expect(Ngzip::VERSION).wont_be_nil
|
7
8
|
end
|
8
|
-
|
9
|
-
end
|
9
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'minitest/autorun'
|
2
4
|
require 'minitest/pride'
|
3
|
-
require
|
4
|
-
|
5
|
+
require 'minitest/reporters'
|
6
|
+
require 'pry'
|
7
|
+
Minitest::Reporters.use!
|
8
|
+
require File.expand_path('../lib/ngzip.rb', __dir__)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ngzip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dup2
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: |-
|
42
56
|
Provides a nginx mod_zip compatible file manifest for streaming support.
|
43
57
|
See http://wiki.nginx.org/NginxNgxZip for the nginx module.
|
@@ -74,7 +88,7 @@ homepage: https://github.com/cargoserver/ngzip
|
|
74
88
|
licenses:
|
75
89
|
- MIT
|
76
90
|
metadata: {}
|
77
|
-
post_install_message:
|
91
|
+
post_install_message:
|
78
92
|
rdoc_options: []
|
79
93
|
require_paths:
|
80
94
|
- lib
|
@@ -89,9 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
103
|
- !ruby/object:Gem::Version
|
90
104
|
version: '0'
|
91
105
|
requirements: []
|
92
|
-
|
93
|
-
|
94
|
-
signing_key:
|
106
|
+
rubygems_version: 3.0.8
|
107
|
+
signing_key:
|
95
108
|
specification_version: 4
|
96
109
|
summary: Provides a nginx mod_zip compatible file manifest for streaming support
|
97
110
|
test_files:
|