epuber 0.5.7 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -2
- data/README.md +20 -26
- data/bin/epuber +2 -3
- data/epuber.gemspec +10 -12
- data/lib/epuber/book/contributor.rb +1 -1
- data/lib/epuber/book/file_request.rb +1 -1
- data/lib/epuber/book/target.rb +1 -2
- data/lib/epuber/book/toc_item.rb +1 -2
- data/lib/epuber/book.rb +1 -2
- data/lib/epuber/checker/text_checker.rb +1 -1
- data/lib/epuber/checker.rb +1 -2
- data/lib/epuber/checker_transformer_base.rb +1 -0
- data/lib/epuber/command/build.rb +1 -2
- data/lib/epuber/command/compile.rb +1 -1
- data/lib/epuber/command/init.rb +1 -2
- data/lib/epuber/command/server.rb +1 -2
- data/lib/epuber/command.rb +1 -1
- data/lib/epuber/compiler/compilation_context.rb +1 -1
- data/lib/epuber/compiler/file_database.rb +3 -5
- data/lib/epuber/compiler/file_finders/abstract.rb +1 -1
- data/lib/epuber/compiler/file_finders/imaginary.rb +1 -2
- data/lib/epuber/compiler/file_finders/normal.rb +1 -1
- data/lib/epuber/compiler/file_resolver.rb +1 -2
- data/lib/epuber/compiler/file_stat.rb +0 -1
- data/lib/epuber/compiler/file_types/abstract_file.rb +1 -2
- data/lib/epuber/compiler/file_types/bade_file.rb +1 -2
- data/lib/epuber/compiler/file_types/coffee_script_file.rb +1 -2
- data/lib/epuber/compiler/file_types/container_xml_file.rb +1 -2
- data/lib/epuber/compiler/file_types/generated_file.rb +1 -2
- data/lib/epuber/compiler/file_types/ibooks_display_options_file.rb +1 -7
- data/lib/epuber/compiler/file_types/image_file.rb +1 -2
- data/lib/epuber/compiler/file_types/mime_type_file.rb +1 -2
- data/lib/epuber/compiler/file_types/nav_file.rb +1 -2
- data/lib/epuber/compiler/file_types/opf_file.rb +1 -2
- data/lib/epuber/compiler/file_types/source_file.rb +1 -2
- data/lib/epuber/compiler/file_types/static_file.rb +1 -2
- data/lib/epuber/compiler/file_types/stylus_file.rb +1 -2
- data/lib/epuber/compiler/file_types/xhtml_file.rb +2 -4
- data/lib/epuber/compiler/generator.rb +1 -1
- data/lib/epuber/compiler/meta_inf_generator.rb +1 -1
- data/lib/epuber/compiler/nav_generator.rb +1 -1
- data/lib/epuber/compiler/opf_generator.rb +1 -1
- data/lib/epuber/compiler/problem.rb +1 -2
- data/lib/epuber/compiler/xhtml_processor.rb +6 -6
- data/lib/epuber/compiler.rb +7 -11
- data/lib/epuber/config.rb +3 -4
- data/lib/epuber/dsl/attribute.rb +1 -1
- data/lib/epuber/dsl/attribute_support.rb +2 -2
- data/lib/epuber/dsl/object.rb +1 -1
- data/lib/epuber/dsl/tree_object.rb +1 -1
- data/lib/epuber/helper.rb +1 -1
- data/lib/epuber/lockfile.rb +1 -1
- data/lib/epuber/plugin.rb +1 -1
- data/lib/epuber/ruby_extensions/match_data.rb +1 -0
- data/lib/epuber/ruby_extensions/thread.rb +1 -0
- data/lib/epuber/server/handlers.rb +1 -1
- data/lib/epuber/server.rb +3 -2
- data/lib/epuber/templates.rb +2 -1
- data/lib/epuber/third_party/bower/bower.json +3 -3
- data/lib/epuber/third_party/bower/bower_components/cookies-js/bower.json +1 -1
- data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.js +2 -3
- data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.min.js +6 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/AUTHORS.txt +278 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/{MIT-LICENSE.txt → LICENSE.txt} +17 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/README.md +65 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/bower.json +2 -16
- data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.js +2566 -1962
- data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.js +4 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.map +1 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/LICENSE.txt +36 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/{src → external}/sizzle/dist/sizzle.js +236 -160
- data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/jsonp.js +25 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/load.js +20 -12
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseJSON.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseXML.js +4 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js +16 -12
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/location.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/nonce.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/rquery.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/xhr.js +73 -42
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax.js +116 -57
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/attr.js +49 -48
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/classes.js +86 -67
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/prop.js +63 -32
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/support.js +6 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/val.js +40 -24
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/callbacks.js +114 -87
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/access.js +11 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/init.js +27 -16
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/parseHTML.js +10 -8
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/ready.js +20 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/var/rsingleTag.js +4 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core.js +77 -85
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/addGetHookIf.js +5 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/adjustCSS.js +65 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/curCSS.js +20 -17
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/defaultDisplay.js +16 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/hiddenVisibleSelectors.js +9 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/showHide.js +48 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/support.js +86 -61
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/cssExpand.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/getStyles.js +8 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/isHidden.js +6 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rmargin.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rnumnonpx.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/{swap.js → var/swap.js} +3 -7
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css.js +107 -55
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/Data.js +93 -74
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/{accepts.js → var/acceptData.js} +4 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_priv.js → dataPriv.js} +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_user.js → dataUser.js} +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data.js +49 -40
- data/lib/epuber/third_party/bower/bower_components/jquery/src/deferred.js +34 -25
- data/lib/epuber/third_party/bower/bower_components/jquery/src/deprecated.js +27 -8
- data/lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js +9 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/Tween.js +14 -7
- data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/animatedSelector.js +4 -4
- data/lib/epuber/third_party/bower/bower_components/jquery/src/effects.js +96 -115
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/ajax.js +11 -4
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/alias.js +11 -23
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/focusin.js +53 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/support.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/trigger.js +183 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event.js +168 -325
- data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/amd.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/global.js +2 -8
- data/lib/epuber/third_party/bower/bower_components/jquery/src/intro.js +1 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/src/jquery.js +5 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/_evalUrl.js +6 -4
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/getAll.js +21 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/support.js +7 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation.js +206 -305
- data/lib/epuber/third_party/bower/bower_components/jquery/src/offset.js +40 -29
- data/lib/epuber/third_party/bower/bower_components/jquery/src/outro.js +1 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/queue/delay.js +6 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/queue.js +23 -22
- data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-native.js +107 -68
- data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-sizzle.js +5 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/selector.js +1 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/src/serialize.js +28 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/findFilter.js +13 -13
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/dir.js +20 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/rneedsContext.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/siblings.js +15 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing.js +32 -56
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/arr.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/class2type.js +3 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/concat.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/document.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/documentElement.js +5 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/hasOwn.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/indexOf.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/pnum.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/push.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rcssNum.js +7 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rnotwhite.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/slice.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/support.js +3 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/toString.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/wrap.js +19 -19
- data/lib/epuber/third_party/bower/bower_components/spin.js/{LICENSE.txt → LICENSE.md} +2 -1
- data/lib/epuber/third_party/bower/bower_components/spin.js/README.md +21 -21
- data/lib/epuber/third_party/bower/bower_components/spin.js/bower.json +0 -1
- data/lib/epuber/third_party/bower/bower_components/spin.js/jquery.spin.js +23 -24
- data/lib/epuber/third_party/bower/bower_components/spin.js/spin.js +153 -113
- data/lib/epuber/third_party/bower/bower_components/spin.js/spin.min.js +2 -0
- data/lib/epuber/third_party/bower/bower_components/uri.js/CHANGELOG.md +424 -0
- data/lib/epuber/third_party/bower/bower_components/uri.js/README.md +23 -308
- data/lib/epuber/third_party/bower/bower_components/uri.js/SECURITY.md +12 -0
- data/lib/epuber/third_party/bower/bower_components/uri.js/bower.json +2 -2
- data/lib/epuber/third_party/bower/bower_components/uri.js/contributing.md +0 -4
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/IPv6.js +3 -6
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/SecondLevelDomains.js +8 -4
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentQuery.js +21 -4
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentURI.js +1 -1
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.js +312 -69
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.min.js +85 -77
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URITemplate.js +28 -11
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.js +17 -18
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.min.js +6 -6
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/punycode.js +63 -38
- data/lib/epuber/third_party/bower.rb +2 -0
- data/lib/epuber/transformer/text_transformer.rb +1 -2
- data/lib/epuber/transformer.rb +1 -2
- data/lib/epuber/user_interface.rb +1 -1
- data/lib/epuber/vendor/hash_binding.rb +1 -1
- data/lib/epuber/vendor/nokogiri_extensions.rb +24 -21
- data/lib/epuber/vendor/ruby_templater.rb +1 -2
- data/lib/epuber/vendor/size.rb +1 -0
- data/lib/epuber/vendor/version.rb +1 -1
- data/lib/epuber/version.rb +2 -1
- data/lib/epuber.rb +1 -1
- metadata +77 -46
- data/lib/epuber/ruby_extensions/string.rb +0 -16
- data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/strundefined.js +0 -3
- data/lib/epuber/vendor/globals_context.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f0a0a9ea184becf56e460ca8440c93808f3f36fc517ff98e7e573b49f3df0f
|
4
|
+
data.tar.gz: 3070d122e6a5a6dda0755d0a15f5df756896318150e39e9708db986ce6d755c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a010e7d5ce0554f6b22f0c28edd4454a53f9253753f4f9a350a420211ae0506843508ad074c09d5617aef79dbb2f4fed9321f3d6dfd34a413801ead3b1e515f
|
7
|
+
data.tar.gz: 53031c9e1abd696a24727c37d24e1907466d50587efb83843eafded9469b608e0ad9caec0553b9635bd4c623b2e90fa3f4ca333456ed4fd4c402c70d5b3dcc85
|
data/Gemfile
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in Epuber.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
|
8
|
+
group :dev, optional: true do
|
9
|
+
gem 'debase', require: false
|
10
|
+
gem 'ruby-debug-ide', require: false
|
11
|
+
end
|
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,21 +46,21 @@ 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
|
@@ -74,20 +74,20 @@ 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 node pkg-config
|
80
80
|
|
81
81
|
On Ubuntu, you can run:
|
82
82
|
|
83
|
-
sudo apt
|
83
|
+
sudo apt install libmagickwand-dev
|
84
84
|
|
85
85
|
|
86
86
|
### Finish
|
87
87
|
|
88
88
|
Then just type following line to terminal:
|
89
89
|
|
90
|
-
sudo gem install epuber
|
90
|
+
[sudo] gem install epuber
|
91
91
|
|
92
92
|
If everything goes well, try running following line in terminal:
|
93
93
|
|
@@ -106,12 +106,6 @@ To install this gem onto your local machine, run `bundle exec rake install`.
|
|
106
106
|
Bug reports and pull requests are welcome on GitHub at https://github.com/epuber-io/epuber. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
107
107
|
|
108
108
|
|
109
|
-
## TODO
|
110
|
-
|
111
|
-
- [ ] move all cards from Trello to GitHub
|
112
|
-
- [ ] create documentation
|
113
|
-
- [ ] create several examples of book specification
|
114
|
-
|
115
109
|
## License
|
116
110
|
|
117
111
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/bin/epuber
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby -Ku
|
2
|
-
#
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
|
-
lib = File.expand_path('../lib',
|
4
|
+
lib = File.expand_path('../lib', __dir__)
|
5
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
6
|
|
7
7
|
require 'epuber'
|
8
8
|
|
9
|
-
|
10
9
|
Epuber::Command.run(ARGV)
|
data/epuber.gemspec
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
4
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
3
|
|
6
4
|
require 'epuber/version'
|
@@ -14,14 +12,15 @@ Gem::Specification.new do |spec|
|
|
14
12
|
spec.summary = 'Epuber is simple tool to compile and pack source files into EPUB format.'
|
15
13
|
spec.homepage = Epuber::HOME_URL
|
16
14
|
spec.license = 'MIT'
|
17
|
-
spec.required_ruby_version = '>= 2.
|
15
|
+
spec.required_ruby_version = '>= 2.5'
|
18
16
|
|
19
17
|
spec.files = Dir['bin/**/*'] + Dir['lib/**/*'] + %w(epuber.gemspec Gemfile LICENSE.txt README.md)
|
20
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
20
|
spec.require_paths = ['lib']
|
23
21
|
|
24
|
-
spec.add_runtime_dependency 'activesupport', '
|
22
|
+
spec.add_runtime_dependency 'activesupport', '>= 6.0', '< 8.0'
|
23
|
+
spec.add_runtime_dependency 'addressable', '~> 2.7'
|
25
24
|
spec.add_runtime_dependency 'nokogiri', '~> 1.8', '>= 1.8.2'
|
26
25
|
spec.add_runtime_dependency 'mime-types', '~> 3.0'
|
27
26
|
spec.add_runtime_dependency 'claide', '~> 1.0'
|
@@ -33,18 +32,17 @@ Gem::Specification.new do |spec|
|
|
33
32
|
spec.add_runtime_dependency 'sinatra-contrib', '~> 2.0'
|
34
33
|
spec.add_runtime_dependency 'thin', '~> 1.6'
|
35
34
|
|
36
|
-
spec.add_runtime_dependency 'rmagick', '~> 2
|
37
|
-
spec.add_runtime_dependency 'rubyzip', '~>
|
35
|
+
spec.add_runtime_dependency 'rmagick', '~> 4.2'
|
36
|
+
spec.add_runtime_dependency 'rubyzip', '~> 2.3'
|
38
37
|
|
39
38
|
spec.add_runtime_dependency 'epubcheck-ruby', '~> 4.0'
|
40
39
|
|
41
40
|
spec.add_runtime_dependency 'epuber-stylus', '~> 1.1', '>= 1.1.1'
|
42
41
|
spec.add_runtime_dependency 'coffee-script', '~> 2.4'
|
43
|
-
spec.add_runtime_dependency 'bade', '~> 0.
|
42
|
+
spec.add_runtime_dependency 'bade', '~> 0.3', '>= 0.3.1'
|
44
43
|
|
45
|
-
spec.add_development_dependency 'bundler'
|
46
44
|
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', '~>
|
45
|
+
spec.add_development_dependency 'rubocop', '~> 1.14'
|
46
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
47
|
+
spec.add_development_dependency 'fakefs', '~> 1.3'
|
50
48
|
end
|
data/lib/epuber/book/target.rb
CHANGED
data/lib/epuber/book/toc_item.rb
CHANGED
data/lib/epuber/book.rb
CHANGED
data/lib/epuber/checker.rb
CHANGED
data/lib/epuber/command/build.rb
CHANGED
data/lib/epuber/command/init.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'fileutils'
|
4
4
|
|
@@ -6,7 +6,6 @@ require_relative '../templates'
|
|
6
6
|
require_relative '../command'
|
7
7
|
require_relative '../vendor/ruby_templater'
|
8
8
|
|
9
|
-
|
10
9
|
module Epuber
|
11
10
|
class Command
|
12
11
|
class Init < Command
|
data/lib/epuber/command.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
|
-
require '
|
5
|
-
|
3
|
+
require 'psych'
|
6
4
|
|
7
5
|
module Epuber
|
8
6
|
class Compiler
|
@@ -22,8 +20,8 @@ module Epuber
|
|
22
20
|
#
|
23
21
|
def initialize(path)
|
24
22
|
@store_file_path = path
|
25
|
-
@all_files =
|
26
|
-
rescue
|
23
|
+
@all_files = Psych.load_file(path, permitted_classes: [Epuber::Compiler::FileStat, Time]) || {}
|
24
|
+
rescue StandardError
|
27
25
|
@all_files = {}
|
28
26
|
end
|
29
27
|
|
@@ -1,5 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
3
|
module Epuber
|
5
4
|
class Compiler
|
@@ -9,7 +8,6 @@ module Epuber
|
|
9
8
|
require_relative 'source_file'
|
10
9
|
|
11
10
|
class XHTMLFile < SourceFile
|
12
|
-
|
13
11
|
# @return [Epuber::Book::TocItem]
|
14
12
|
#
|
15
13
|
attr_accessor :toc_item
|
@@ -52,7 +50,7 @@ module Epuber
|
|
52
50
|
compilation_context.perform_plugin_things(Transformer, :source_text_file) do |transformer|
|
53
51
|
xhtml_content = transformer.call(abs_source_path, xhtml_content, compilation_context)
|
54
52
|
end
|
55
|
-
|
53
|
+
|
56
54
|
# perform custom validation
|
57
55
|
if compilation_context.should_check
|
58
56
|
compilation_context.perform_plugin_things(Checker, :source_text_file) do |checker|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'nokogiri'
|
4
|
-
require '
|
4
|
+
require 'addressable'
|
5
5
|
|
6
6
|
|
7
7
|
module Epuber
|
@@ -20,6 +20,8 @@ module Epuber
|
|
20
20
|
# @return [Nokogiri::XML::Document] parsed document
|
21
21
|
#
|
22
22
|
def self.xml_doc_from_str_with_errors(text, file_path = nil)
|
23
|
+
text = text.dup
|
24
|
+
|
23
25
|
if /\A[\n\r ]+(<\?xml)/ =~ text
|
24
26
|
UI.warning('XML header must be at the beginning of document', location: UI::Location.new(file_path, 1))
|
25
27
|
|
@@ -58,9 +60,7 @@ module Epuber
|
|
58
60
|
if doc.errors.empty?
|
59
61
|
errors = []
|
60
62
|
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|
|
63
|
+
errors = doc.errors.map do |e|
|
64
64
|
Problem.new(:error, e.message, text_for_errors, line: e.line, column: e.column, file_path: file_path)
|
65
65
|
end
|
66
66
|
end
|
@@ -210,7 +210,7 @@ module Epuber
|
|
210
210
|
uri = URI(path)
|
211
211
|
rescue URI::InvalidURIError
|
212
212
|
begin
|
213
|
-
uri = URI(URI
|
213
|
+
uri = URI(Addressable::URI.encode(path))
|
214
214
|
rescue URI::InvalidURIError
|
215
215
|
# skip not valid uri
|
216
216
|
raise UnparseableLinkError, "Unparseable link `#{path}`"
|