gepub 1.0.15 → 1.0.16

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
  SHA256:
3
- metadata.gz: 19218e13519e47532dee8d0a4f1c45a3acaa65dd105b4fcd1b09774f9f482bd6
4
- data.tar.gz: abeb56bc8baa0d505f75af8403eb4e59a86aa386aeac83040c2dcf9fc2f5b45e
3
+ metadata.gz: 93cb58ca825f4f30efeb8f1ce191ccf9bbb2e74d32f9cfd77f37dedb85cc7a3e
4
+ data.tar.gz: da3618e21ad20a7f6a12c4d52fe43d1159ecdd378a5eb4bae39d1eb2558fb605
5
5
  SHA512:
6
- metadata.gz: d1c20a5567c1033fceafbe660f8bc2b227b3a269125d1da4b58d2183fb13f24a4f7e56242100e37b662f03a17ebb744fc686151782ef2d8fb36c9d94ef39275b
7
- data.tar.gz: 6dcf08c29ca933edba399cd1ffbb001196d8d8ef74cb62bcb8619135eddec743975b1654b5c3ce57342d91da7c8166949057591da1d3e429c1f326967544077e
6
+ metadata.gz: 0ba5fbbd7590739ef20d73af2cc3b50811c0ba330959cc784a6246bb13dbd249d32a0c9fbe3c31adb15ae4e4b9c69a7c7988cc5c62b8b6e65cdf9c105eed85d6
7
+ data.tar.gz: bb66bd6e2f564ed780e0417b91e43993fb0ece0fc938095a31d10fdfff56b9c77d290df812e3ff94feb64256ac1b21e06aa2a36fb29553b6145ee89644c2f684
@@ -11,10 +11,10 @@ jobs:
11
11
 
12
12
  steps:
13
13
  - uses: actions/checkout@master
14
- - name: Set up Ruby 2.6
14
+ - name: Set up Ruby
15
15
  uses: actions/setup-ruby@v1
16
16
  with:
17
- ruby-version: 2.6.x
17
+ ruby-version: 3.1.x
18
18
 
19
19
  - name: Publish to GPR
20
20
  run: |
@@ -4,13 +4,13 @@ jobs:
4
4
  test:
5
5
  strategy:
6
6
  matrix:
7
- ruby: [2.5, 2.6, 2.7, 3.0, jruby]
7
+ ruby: [2.7, 3.0, 3.1, 3.2, 3.3, jruby]
8
8
  platform: [ubuntu-latest, macos-latest, windows-latest]
9
9
  runs-on: ${{ matrix.platform }}
10
10
  env:
11
11
  CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v4
14
14
  - name: Set up Ruby
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
@@ -18,12 +18,12 @@ jobs:
18
18
  - name: setup gems
19
19
  run: bundle install --jobs 4 --retry 3
20
20
  - name: run test and publish code coverage
21
- if: runner.os == 'Linux' && matrix.ruby == '2.7' && env.CC_TEST_REPORTER_ID != ''
22
- uses: paambaati/codeclimate-action@v2.3.0
21
+ if: runner.os == 'Linux' && matrix.ruby == '3.3' && env.CC_TEST_REPORTER_ID != ''
22
+ uses: paambaati/codeclimate-action@v5.0.0
23
23
  env:
24
24
  CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
25
25
  with:
26
26
  coverageCommand: bundle exec rake spec
27
27
  - name: run test
28
- if: runner.os != 'Linux' || matrix.ruby != '2.7' || env.CC_TEST_REPORTER_ID == ''
28
+ if: runner.os != 'Linux' || matrix.ruby != '3.3' || env.CC_TEST_REPORTER_ID == ''
29
29
  run: bundle exec rake spec
data/.gitignore CHANGED
@@ -19,8 +19,6 @@ rdoc
19
19
  pkg
20
20
 
21
21
  ## PROJECT::SPECIFIC
22
- testepub*.epub
23
- example_test*.epub
24
22
 
25
23
  ## BUNDLER
26
24
  Gemfile.lock
data/Gemfile CHANGED
@@ -3,6 +3,4 @@ source "http://rubygems.org"
3
3
  # Specify your gem's dependencies in gepub.gemspec
4
4
  gemspec
5
5
 
6
- # workarond : simplecov 0.18 with cc-reporter is broken
7
- # https://github.com/codeclimate/test-reporter/issues/418
8
6
  gem 'simplecov', '~> 0.21', require: false
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Test Coverage](https://api.codeclimate.com/v1/badges/acd6df07e071a4bbb399/test_coverage)](https://codeclimate.com/github/skoji/gepub/test_coverage)
6
6
  [![Gem Version](https://badge.fury.io/rb/gepub.svg)](http://badge.fury.io/rb/gepub)
7
7
 
8
- * http://rdoc.info/github/skoji/gepub/main/frames
8
+ * https://rubydoc.info/github/skoji/gepub
9
9
 
10
10
  ## DESCRIPTION:
11
11
 
@@ -13,12 +13,12 @@ a generic EPUB parser/generator library.
13
13
 
14
14
  ## FEATURES/PROBLEMS:
15
15
 
16
- * GEPUB::Book provides functionality to create EPUB file, and parsing EPUB files
16
+ * GEPUB::Book provides functionality to create EPUB files and parse EPUB files
17
17
  * Handle every metadata in EPUB2/EPUB3.
18
18
 
19
19
  * See [issues](https://github.com/skoji/gepub/issues/) for known problems.
20
20
 
21
- If you are using GEPUB::Builder and do not like its behaviour(e.g. the block inside is evaluated as inside the Builder instance), please consider using GEPUB::Book directly.
21
+ If you are using GEPUB::Builder and do not like its behavior (e.g., GEPUB::Builder evaluates the block as inside the Builder instance), consider using GEPUB::Book directly.
22
22
 
23
23
  ## SYNOPSIS:
24
24
 
@@ -98,9 +98,9 @@ book.ordered {
98
98
  }
99
99
  epubname = File.join(File.dirname(__FILE__), 'example_test.epub')
100
100
 
101
- # if you do not specify your own nav document with add_item,
102
- # simple navigation text will be generated in generate_epub.
103
- # auto-generated nav file will not appear on spine.
101
+ # if you do not specify a nav document with add_item,
102
+ # generate_epub will generate simple navigation text.
103
+ # auto-generated nav file will not appear on the spine.
104
104
  book.generate_epub(epubname)
105
105
  ```
106
106
  * [examples in this repository](https://github.com/skoji/gepub/tree/main/examples/)
@@ -112,4 +112,3 @@ book.generate_epub(epubname)
112
112
  ## DONATE:
113
113
 
114
114
  * Bitcoin Address: `1M69AwoxpgPZsp5KStLUEjP7so5dHVfDTH`
115
-
data/lib/gepub/book.rb CHANGED
@@ -102,14 +102,14 @@ module GEPUB
102
102
  package = nil
103
103
  package_path = nil
104
104
  book = nil
105
- Zip::InputStream::open(io) {
106
- |zis|
107
- package, package_path = parse_container(zis, files)
105
+ Zip::File.open_buffer(io) do
106
+ |zip_file|
107
+ package, package_path = parse_container(zip_file, files)
108
108
  check_consistency_of_package(package, package_path)
109
109
  parse_files_into_package(files, package)
110
110
  book = Book.new(package.path)
111
111
  book.instance_eval { @package = package; @optional_files = files }
112
- }
112
+ end
113
113
  book
114
114
  end
115
115
 
@@ -379,12 +379,12 @@ EOF
379
379
  end
380
380
 
381
381
  private
382
- def self.parse_container(zis, files)
382
+ def self.parse_container(zip_file, files)
383
383
  package_path = nil
384
384
  package = nil
385
- while entry = zis.get_next_entry
385
+ zip_file.each do |entry|
386
386
  if !entry.directory?
387
- files[entry.name] = zis.read
387
+ files[entry.name] = zip_file.read(entry)
388
388
  case entry.name
389
389
  when MIMETYPE then
390
390
  if files[MIMETYPE] != MIMETYPE_CONTENTS
@@ -138,7 +138,7 @@ module GEPUB
138
138
  meta.add_alternates alternates
139
139
  end
140
140
  yield meta if block_given?
141
- meta
142
- end
141
+ meta
143
142
  end
143
+ end
144
144
  end
data/lib/gepub/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module GEPUB
2
2
  # GEPUB gem version
3
- VERSION = "1.0.15"
3
+ VERSION = "1.0.16"
4
4
  end
@@ -189,9 +189,9 @@ module GEPUB
189
189
  meta.add_alternates alternates
190
190
  end
191
191
  yield meta if block_given?
192
- meta
193
- end
192
+ meta
194
193
  end
194
+ end
195
195
  end
196
196
  EOF
197
197
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gepub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOJIMA Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-09 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubygems_version: 3.0.3.1
181
+ rubygems_version: 3.3.26
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: a generic EPUB library for Ruby.