epuber 0.5.7 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/README.md +22 -20
- data/epuber.gemspec +8 -7
- data/lib/epuber/compiler/file_resolver.rb +0 -1
- data/lib/epuber/compiler/xhtml_processor.rb +3 -5
- data/lib/epuber/config.rb +2 -2
- data/lib/epuber/version.rb +1 -1
- metadata +34 -21
- data/lib/epuber/ruby_extensions/string.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2899b08ccdd624b08c96377e111df6872f4c6b0871ee689e28d1264d42bf5294
|
4
|
+
data.tar.gz: 6391e4b90172bc5d06d7c3f903aafa52efab3917ee0daaaf406723f3ee2d381f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a2df3f599de46ca5c5e976154d32752981fa9d2a76e0a46754b91f5583c3e671c3ab77c777bc8511dbda09f23ea0a8534d16656a1dfce4748b762fa7d7c3947
|
7
|
+
data.tar.gz: b5d8d5556ce730d2215a6239405a56505f87e649fa1b06078cb2145f524c2d59e82d2789b21d0873c573079daa807ff9cc3d22b16bf26d85f4e223ac20ead502
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Epuber
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/epuber.svg)](http://badge.fury.io/rb/epuber) [![Build Status](https://
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/epuber.svg)](http://badge.fury.io/rb/epuber) [![Build Status](https://github.com/epuber-io/epuber/actions/workflows/tests.yml/badge.svg)](https://github.com/epuber-io/epuber/actions) [![Coverage Status](https://coveralls.io/repos/epuber-io/epuber/badge.svg?branch=master&service=github)](https://coveralls.io/github/epuber-io/epuber?branch=master) [![Inline docs](https://inch-ci.org/github/epuber-io/epuber.svg?branch=master)](https://inch-ci.org/github/epuber-io/epuber)
|
4
4
|
|
5
5
|
Epuber is simple tool to compile and pack source files into EPUB format. Offers to define multiple "targets" which allows to create multiple versions of the book by running only one command. Eliminates copying code and information, eliminates needs to use _git_ branches to differ ebook content.
|
6
6
|
|
@@ -46,37 +46,39 @@ end
|
|
46
46
|
|
47
47
|
Except for paths to plugins `book.use`, every path could be only name of the file, even without extension. So you can rename them, move them, the correct path will always resolved. Only exception is when the same name has more then one file.
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
49
|
+
| | Epuber |
|
50
|
+
|-----------------|------------------------------------------------------------------------------------------------- |
|
51
|
+
|:book: | Creates seamless workflow for creating ebooks |
|
52
|
+
|:monorail: | Defines different _targets_ for several book stores (iBookstore, Google Play store, ...) |
|
53
|
+
|:wrench: | Extend and customise the functionality with _plugins_ |
|
54
|
+
|:pencil2: | Defines _constants_ so you can have link to related book in proper book store |
|
55
|
+
|:pencil: | Defines mechanisms to deal with duplicated |
|
56
|
+
|:tophat: | Easy setup assistant to get started in a few minutes |
|
57
|
+
|:ghost: | Automatically validates generated text so you don't have to worry about typos and other mistakes |
|
58
|
+
|:rocket: | Saves you **hours** when developing new or updating existing book |
|
59
|
+
|:page_with_curl: | Supports template engines, CSS preprocessors and standard EPUB formats at the same time |
|
60
|
+
|:computer: | Have local development web server to iterate and experiment quickly |
|
61
|
+
|:loop: | Automatically refresh web browser when some source file changes |
|
62
|
+
|:bomb: | Quick jumping through pages with arrow keys on keyboard |
|
63
|
+
|:closed_book: | Supports EPUB 2 and 3 |
|
64
64
|
|
65
65
|
|
66
66
|
## Installation
|
67
67
|
|
68
68
|
First of all Epuber uses [RMagick](https://github.com/rmagick/rmagick) which has several external dependencies, so you have to install that first:
|
69
69
|
|
70
|
-
- ImageMagick
|
70
|
+
- ImageMagick (only v6 for now)
|
71
71
|
- pkg-config
|
72
72
|
|
73
73
|
On OS X make sure you Xcode Command Line Tools installed:
|
74
74
|
|
75
75
|
xcode-select --install
|
76
76
|
|
77
|
-
And the easiest way to install prerequisites on
|
77
|
+
And the easiest way to install prerequisites on macOS is to use [brew](http://brew.sh):
|
78
78
|
|
79
|
-
brew install imagemagick pkg-config
|
79
|
+
brew install imagemagick@6 node@12 pkg-config
|
80
|
+
brew link --force imagemagick@6
|
81
|
+
brew link --force --overwrite node@12
|
80
82
|
|
81
83
|
On Ubuntu, you can run:
|
82
84
|
|
@@ -87,7 +89,7 @@ On Ubuntu, you can run:
|
|
87
89
|
|
88
90
|
Then just type following line to terminal:
|
89
91
|
|
90
|
-
sudo gem install epuber
|
92
|
+
[sudo] gem install epuber
|
91
93
|
|
92
94
|
If everything goes well, try running following line in terminal:
|
93
95
|
|
data/epuber.gemspec
CHANGED
@@ -14,14 +14,15 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.summary = 'Epuber is simple tool to compile and pack source files into EPUB format.'
|
15
15
|
spec.homepage = Epuber::HOME_URL
|
16
16
|
spec.license = 'MIT'
|
17
|
-
spec.required_ruby_version = '>= 2.
|
17
|
+
spec.required_ruby_version = '>= 2.5'
|
18
18
|
|
19
19
|
spec.files = Dir['bin/**/*'] + Dir['lib/**/*'] + %w(epuber.gemspec Gemfile LICENSE.txt README.md)
|
20
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_runtime_dependency 'activesupport', '~>
|
24
|
+
spec.add_runtime_dependency 'activesupport', '~> 6.0'
|
25
|
+
spec.add_runtime_dependency 'addressable', '~> 2.7'
|
25
26
|
spec.add_runtime_dependency 'nokogiri', '~> 1.8', '>= 1.8.2'
|
26
27
|
spec.add_runtime_dependency 'mime-types', '~> 3.0'
|
27
28
|
spec.add_runtime_dependency 'claide', '~> 1.0'
|
@@ -33,8 +34,8 @@ Gem::Specification.new do |spec|
|
|
33
34
|
spec.add_runtime_dependency 'sinatra-contrib', '~> 2.0'
|
34
35
|
spec.add_runtime_dependency 'thin', '~> 1.6'
|
35
36
|
|
36
|
-
spec.add_runtime_dependency 'rmagick', '~> 2
|
37
|
-
spec.add_runtime_dependency 'rubyzip', '~>
|
37
|
+
spec.add_runtime_dependency 'rmagick', '~> 4.2'
|
38
|
+
spec.add_runtime_dependency 'rubyzip', '~> 2.3'
|
38
39
|
|
39
40
|
spec.add_runtime_dependency 'epubcheck-ruby', '~> 4.0'
|
40
41
|
|
@@ -44,7 +45,7 @@ Gem::Specification.new do |spec|
|
|
44
45
|
|
45
46
|
spec.add_development_dependency 'bundler'
|
46
47
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
47
|
-
spec.add_development_dependency 'rubocop', '~>
|
48
|
-
spec.add_development_dependency 'rake', '~>
|
49
|
-
spec.add_development_dependency 'fakefs', '~>
|
48
|
+
spec.add_development_dependency 'rubocop', '~> 1.14'
|
49
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
50
|
+
spec.add_development_dependency 'fakefs', '~> 1.3'
|
50
51
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'nokogiri'
|
4
|
-
require '
|
4
|
+
require 'addressable'
|
5
5
|
|
6
6
|
|
7
7
|
module Epuber
|
@@ -58,9 +58,7 @@ module Epuber
|
|
58
58
|
if doc.errors.empty?
|
59
59
|
errors = []
|
60
60
|
else
|
61
|
-
errors = doc.errors
|
62
|
-
.reject { |e| e.message.include?('ERROR: Namespace prefix epub') } # skip errors about missing definition of `epub` namespace
|
63
|
-
.map do |e|
|
61
|
+
errors = doc.errors.map do |e|
|
64
62
|
Problem.new(:error, e.message, text_for_errors, line: e.line, column: e.column, file_path: file_path)
|
65
63
|
end
|
66
64
|
end
|
@@ -210,7 +208,7 @@ module Epuber
|
|
210
208
|
uri = URI(path)
|
211
209
|
rescue URI::InvalidURIError
|
212
210
|
begin
|
213
|
-
uri = URI(URI
|
211
|
+
uri = URI(Addressable::URI.encode(path))
|
214
212
|
rescue URI::InvalidURIError
|
215
213
|
# skip not valid uri
|
216
214
|
raise UnparseableLinkError, "Unparseable link `#{path}`"
|
data/lib/epuber/config.rb
CHANGED
@@ -123,11 +123,11 @@ module Epuber
|
|
123
123
|
|
124
124
|
def warn_for_outdated_versions!
|
125
125
|
if bookspec_lockfile.epuber_version > Epuber::VERSION
|
126
|
-
UI.warning('Warning: the running version of Epuber is older than the version that created the lockfile. We suggest you upgrade to the latest version of Epuber by running `gem install epuber
|
126
|
+
UI.warning('Warning: the running version of Epuber is older than the version that created the lockfile. We suggest you upgrade to the latest version of Epuber by running `gem install epuber`.')
|
127
127
|
end
|
128
128
|
|
129
129
|
if bookspec_lockfile.bade_version && bookspec_lockfile.bade_version > Bade::VERSION
|
130
|
-
UI.warning('Warning: the running version of Bade is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bade by running `gem install bade
|
130
|
+
UI.warning('Warning: the running version of Bade is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bade by running `gem install bade`.')
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
data/lib/epuber/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epuber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Kříž
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
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: '
|
26
|
+
version: '6.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: addressable
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.7'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.7'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: nokogiri
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,28 +176,28 @@ dependencies:
|
|
162
176
|
requirements:
|
163
177
|
- - "~>"
|
164
178
|
- !ruby/object:Gem::Version
|
165
|
-
version: '2
|
179
|
+
version: '4.2'
|
166
180
|
type: :runtime
|
167
181
|
prerelease: false
|
168
182
|
version_requirements: !ruby/object:Gem::Requirement
|
169
183
|
requirements:
|
170
184
|
- - "~>"
|
171
185
|
- !ruby/object:Gem::Version
|
172
|
-
version: '2
|
186
|
+
version: '4.2'
|
173
187
|
- !ruby/object:Gem::Dependency
|
174
188
|
name: rubyzip
|
175
189
|
requirement: !ruby/object:Gem::Requirement
|
176
190
|
requirements:
|
177
191
|
- - "~>"
|
178
192
|
- !ruby/object:Gem::Version
|
179
|
-
version: '
|
193
|
+
version: '2.3'
|
180
194
|
type: :runtime
|
181
195
|
prerelease: false
|
182
196
|
version_requirements: !ruby/object:Gem::Requirement
|
183
197
|
requirements:
|
184
198
|
- - "~>"
|
185
199
|
- !ruby/object:Gem::Version
|
186
|
-
version: '
|
200
|
+
version: '2.3'
|
187
201
|
- !ruby/object:Gem::Dependency
|
188
202
|
name: epubcheck-ruby
|
189
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -280,43 +294,43 @@ dependencies:
|
|
280
294
|
requirements:
|
281
295
|
- - "~>"
|
282
296
|
- !ruby/object:Gem::Version
|
283
|
-
version: '
|
297
|
+
version: '1.14'
|
284
298
|
type: :development
|
285
299
|
prerelease: false
|
286
300
|
version_requirements: !ruby/object:Gem::Requirement
|
287
301
|
requirements:
|
288
302
|
- - "~>"
|
289
303
|
- !ruby/object:Gem::Version
|
290
|
-
version: '
|
304
|
+
version: '1.14'
|
291
305
|
- !ruby/object:Gem::Dependency
|
292
306
|
name: rake
|
293
307
|
requirement: !ruby/object:Gem::Requirement
|
294
308
|
requirements:
|
295
309
|
- - "~>"
|
296
310
|
- !ruby/object:Gem::Version
|
297
|
-
version: '
|
311
|
+
version: '13.0'
|
298
312
|
type: :development
|
299
313
|
prerelease: false
|
300
314
|
version_requirements: !ruby/object:Gem::Requirement
|
301
315
|
requirements:
|
302
316
|
- - "~>"
|
303
317
|
- !ruby/object:Gem::Version
|
304
|
-
version: '
|
318
|
+
version: '13.0'
|
305
319
|
- !ruby/object:Gem::Dependency
|
306
320
|
name: fakefs
|
307
321
|
requirement: !ruby/object:Gem::Requirement
|
308
322
|
requirements:
|
309
323
|
- - "~>"
|
310
324
|
- !ruby/object:Gem::Version
|
311
|
-
version: '
|
325
|
+
version: '1.3'
|
312
326
|
type: :development
|
313
327
|
prerelease: false
|
314
328
|
version_requirements: !ruby/object:Gem::Requirement
|
315
329
|
requirements:
|
316
330
|
- - "~>"
|
317
331
|
- !ruby/object:Gem::Version
|
318
|
-
version: '
|
319
|
-
description:
|
332
|
+
version: '1.3'
|
333
|
+
description:
|
320
334
|
email:
|
321
335
|
- samnung@gmail.com
|
322
336
|
executables:
|
@@ -380,7 +394,6 @@ files:
|
|
380
394
|
- lib/epuber/lockfile.rb
|
381
395
|
- lib/epuber/plugin.rb
|
382
396
|
- lib/epuber/ruby_extensions/match_data.rb
|
383
|
-
- lib/epuber/ruby_extensions/string.rb
|
384
397
|
- lib/epuber/ruby_extensions/thread.rb
|
385
398
|
- lib/epuber/server.rb
|
386
399
|
- lib/epuber/server/auto_refresh/auto_refresh.coffee
|
@@ -539,7 +552,7 @@ homepage: https://github.com/epuber-io/epuber
|
|
539
552
|
licenses:
|
540
553
|
- MIT
|
541
554
|
metadata: {}
|
542
|
-
post_install_message:
|
555
|
+
post_install_message:
|
543
556
|
rdoc_options: []
|
544
557
|
require_paths:
|
545
558
|
- lib
|
@@ -547,15 +560,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
547
560
|
requirements:
|
548
561
|
- - ">="
|
549
562
|
- !ruby/object:Gem::Version
|
550
|
-
version: '2.
|
563
|
+
version: '2.5'
|
551
564
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
552
565
|
requirements:
|
553
566
|
- - ">="
|
554
567
|
- !ruby/object:Gem::Version
|
555
568
|
version: '0'
|
556
569
|
requirements: []
|
557
|
-
rubygems_version: 3.
|
558
|
-
signing_key:
|
570
|
+
rubygems_version: 3.2.17
|
571
|
+
signing_key:
|
559
572
|
specification_version: 4
|
560
573
|
summary: Epuber is simple tool to compile and pack source files into EPUB format.
|
561
574
|
test_files: []
|
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
begin
|
3
|
-
require 'unicode_normalize'
|
4
|
-
rescue LoadError
|
5
|
-
# silently fail
|
6
|
-
|
7
|
-
require 'active_support/multibyte/unicode'
|
8
|
-
|
9
|
-
class String
|
10
|
-
unless respond_to?(:unicode_normalize)
|
11
|
-
def unicode_normalize
|
12
|
-
ActiveSupport::Multibyte::Unicode.normalize(self)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|