epuber 0.5.6 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/README.md +20 -26
  4. data/bin/epuber +2 -3
  5. data/epuber.gemspec +10 -12
  6. data/lib/epuber/book/contributor.rb +1 -1
  7. data/lib/epuber/book/file_request.rb +1 -1
  8. data/lib/epuber/book/target.rb +1 -2
  9. data/lib/epuber/book/toc_item.rb +1 -2
  10. data/lib/epuber/book.rb +1 -2
  11. data/lib/epuber/checker/text_checker.rb +1 -1
  12. data/lib/epuber/checker.rb +1 -2
  13. data/lib/epuber/checker_transformer_base.rb +1 -0
  14. data/lib/epuber/command/build.rb +1 -2
  15. data/lib/epuber/command/compile.rb +1 -1
  16. data/lib/epuber/command/init.rb +1 -2
  17. data/lib/epuber/command/server.rb +1 -2
  18. data/lib/epuber/command.rb +1 -1
  19. data/lib/epuber/compiler/compilation_context.rb +1 -1
  20. data/lib/epuber/compiler/file_database.rb +3 -5
  21. data/lib/epuber/compiler/file_finders/abstract.rb +1 -1
  22. data/lib/epuber/compiler/file_finders/imaginary.rb +1 -2
  23. data/lib/epuber/compiler/file_finders/normal.rb +1 -1
  24. data/lib/epuber/compiler/file_resolver.rb +1 -2
  25. data/lib/epuber/compiler/file_stat.rb +0 -1
  26. data/lib/epuber/compiler/file_types/abstract_file.rb +1 -2
  27. data/lib/epuber/compiler/file_types/bade_file.rb +1 -2
  28. data/lib/epuber/compiler/file_types/coffee_script_file.rb +1 -2
  29. data/lib/epuber/compiler/file_types/container_xml_file.rb +1 -2
  30. data/lib/epuber/compiler/file_types/generated_file.rb +1 -2
  31. data/lib/epuber/compiler/file_types/ibooks_display_options_file.rb +1 -7
  32. data/lib/epuber/compiler/file_types/image_file.rb +1 -2
  33. data/lib/epuber/compiler/file_types/mime_type_file.rb +1 -2
  34. data/lib/epuber/compiler/file_types/nav_file.rb +1 -2
  35. data/lib/epuber/compiler/file_types/opf_file.rb +1 -2
  36. data/lib/epuber/compiler/file_types/source_file.rb +1 -2
  37. data/lib/epuber/compiler/file_types/static_file.rb +1 -2
  38. data/lib/epuber/compiler/file_types/stylus_file.rb +1 -2
  39. data/lib/epuber/compiler/file_types/xhtml_file.rb +2 -4
  40. data/lib/epuber/compiler/generator.rb +1 -1
  41. data/lib/epuber/compiler/meta_inf_generator.rb +1 -1
  42. data/lib/epuber/compiler/nav_generator.rb +6 -2
  43. data/lib/epuber/compiler/opf_generator.rb +1 -1
  44. data/lib/epuber/compiler/problem.rb +1 -2
  45. data/lib/epuber/compiler/xhtml_processor.rb +5 -3
  46. data/lib/epuber/compiler.rb +7 -11
  47. data/lib/epuber/config.rb +3 -4
  48. data/lib/epuber/dsl/attribute.rb +1 -1
  49. data/lib/epuber/dsl/attribute_support.rb +2 -2
  50. data/lib/epuber/dsl/object.rb +1 -1
  51. data/lib/epuber/dsl/tree_object.rb +1 -1
  52. data/lib/epuber/helper.rb +1 -1
  53. data/lib/epuber/lockfile.rb +1 -1
  54. data/lib/epuber/plugin.rb +1 -1
  55. data/lib/epuber/ruby_extensions/match_data.rb +1 -0
  56. data/lib/epuber/ruby_extensions/thread.rb +1 -0
  57. data/lib/epuber/server/handlers.rb +1 -1
  58. data/lib/epuber/server.rb +2 -2
  59. data/lib/epuber/templates.rb +2 -1
  60. data/lib/epuber/third_party/bower/bower.json +3 -3
  61. data/lib/epuber/third_party/bower/bower_components/cookies-js/bower.json +1 -1
  62. data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.js +2 -3
  63. data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.min.js +6 -6
  64. data/lib/epuber/third_party/bower/bower_components/jquery/AUTHORS.txt +278 -0
  65. data/lib/epuber/third_party/bower/bower_components/jquery/{MIT-LICENSE.txt → LICENSE.txt} +17 -2
  66. data/lib/epuber/third_party/bower/bower_components/jquery/README.md +65 -0
  67. data/lib/epuber/third_party/bower/bower_components/jquery/bower.json +2 -16
  68. data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.js +2566 -1962
  69. data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.js +4 -5
  70. data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.map +1 -1
  71. data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/LICENSE.txt +36 -0
  72. data/lib/epuber/third_party/bower/bower_components/jquery/{src → external}/sizzle/dist/sizzle.js +236 -160
  73. data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  74. data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  75. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/jsonp.js +25 -14
  76. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/load.js +20 -12
  77. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseJSON.js +2 -2
  78. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseXML.js +4 -5
  79. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js +16 -12
  80. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/location.js +3 -0
  81. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/nonce.js +2 -2
  82. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/rquery.js +3 -3
  83. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/xhr.js +73 -42
  84. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax.js +116 -57
  85. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/attr.js +49 -48
  86. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/classes.js +86 -67
  87. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/prop.js +63 -32
  88. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/support.js +6 -5
  89. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/val.js +40 -24
  90. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes.js +2 -2
  91. data/lib/epuber/third_party/bower/bower_components/jquery/src/callbacks.js +114 -87
  92. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/access.js +11 -6
  93. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/init.js +27 -16
  94. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/parseHTML.js +10 -8
  95. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/ready.js +20 -14
  96. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/var/rsingleTag.js +4 -3
  97. data/lib/epuber/third_party/bower/bower_components/jquery/src/core.js +77 -85
  98. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/addGetHookIf.js +5 -3
  99. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/adjustCSS.js +65 -0
  100. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/curCSS.js +20 -17
  101. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/defaultDisplay.js +16 -14
  102. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/hiddenVisibleSelectors.js +9 -6
  103. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/showHide.js +48 -0
  104. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/support.js +86 -61
  105. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/cssExpand.js +2 -2
  106. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/getStyles.js +8 -5
  107. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/isHidden.js +6 -3
  108. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rmargin.js +3 -3
  109. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rnumnonpx.js +2 -2
  110. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/{swap.js → var/swap.js} +3 -7
  111. data/lib/epuber/third_party/bower/bower_components/jquery/src/css.js +107 -55
  112. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/Data.js +93 -74
  113. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/{accepts.js → var/acceptData.js} +4 -6
  114. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_priv.js → dataPriv.js} +2 -2
  115. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_user.js → dataUser.js} +2 -2
  116. data/lib/epuber/third_party/bower/bower_components/jquery/src/data.js +49 -40
  117. data/lib/epuber/third_party/bower/bower_components/jquery/src/deferred.js +34 -25
  118. data/lib/epuber/third_party/bower/bower_components/jquery/src/deprecated.js +27 -8
  119. data/lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js +9 -5
  120. data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/Tween.js +14 -7
  121. data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/animatedSelector.js +4 -4
  122. data/lib/epuber/third_party/bower/bower_components/jquery/src/effects.js +96 -115
  123. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/ajax.js +11 -4
  124. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/alias.js +11 -23
  125. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/focusin.js +53 -0
  126. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/support.js +3 -3
  127. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/trigger.js +183 -0
  128. data/lib/epuber/third_party/bower/bower_components/jquery/src/event.js +168 -325
  129. data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/amd.js +3 -3
  130. data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/global.js +2 -8
  131. data/lib/epuber/third_party/bower/bower_components/jquery/src/intro.js +1 -1
  132. data/lib/epuber/third_party/bower/bower_components/jquery/src/jquery.js +5 -5
  133. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/_evalUrl.js +6 -4
  134. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
  135. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/getAll.js +21 -0
  136. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
  137. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/support.js +7 -6
  138. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -3
  139. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
  140. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
  141. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
  142. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation.js +206 -305
  143. data/lib/epuber/third_party/bower/bower_components/jquery/src/offset.js +40 -29
  144. data/lib/epuber/third_party/bower/bower_components/jquery/src/outro.js +1 -0
  145. data/lib/epuber/third_party/bower/bower_components/jquery/src/queue/delay.js +6 -6
  146. data/lib/epuber/third_party/bower/bower_components/jquery/src/queue.js +23 -22
  147. data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-native.js +107 -68
  148. data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-sizzle.js +5 -5
  149. data/lib/epuber/third_party/bower/bower_components/jquery/src/selector.js +1 -1
  150. data/lib/epuber/third_party/bower/bower_components/jquery/src/serialize.js +28 -14
  151. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/findFilter.js +13 -13
  152. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/dir.js +20 -0
  153. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/rneedsContext.js +2 -2
  154. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/siblings.js +15 -0
  155. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing.js +32 -56
  156. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/arr.js +2 -2
  157. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/class2type.js +3 -2
  158. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/concat.js +2 -2
  159. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/document.js +3 -0
  160. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/documentElement.js +5 -0
  161. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/hasOwn.js +2 -2
  162. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/indexOf.js +2 -2
  163. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/pnum.js +3 -3
  164. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/push.js +2 -2
  165. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rcssNum.js +7 -0
  166. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rnotwhite.js +3 -3
  167. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/slice.js +2 -2
  168. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/support.js +3 -2
  169. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/toString.js +2 -2
  170. data/lib/epuber/third_party/bower/bower_components/jquery/src/wrap.js +19 -19
  171. data/lib/epuber/third_party/bower/bower_components/spin.js/{LICENSE.txt → LICENSE.md} +2 -1
  172. data/lib/epuber/third_party/bower/bower_components/spin.js/README.md +21 -21
  173. data/lib/epuber/third_party/bower/bower_components/spin.js/bower.json +0 -1
  174. data/lib/epuber/third_party/bower/bower_components/spin.js/jquery.spin.js +23 -24
  175. data/lib/epuber/third_party/bower/bower_components/spin.js/spin.js +153 -113
  176. data/lib/epuber/third_party/bower/bower_components/spin.js/spin.min.js +2 -0
  177. data/lib/epuber/third_party/bower/bower_components/uri.js/CHANGELOG.md +424 -0
  178. data/lib/epuber/third_party/bower/bower_components/uri.js/README.md +23 -308
  179. data/lib/epuber/third_party/bower/bower_components/uri.js/SECURITY.md +12 -0
  180. data/lib/epuber/third_party/bower/bower_components/uri.js/bower.json +2 -2
  181. data/lib/epuber/third_party/bower/bower_components/uri.js/contributing.md +0 -4
  182. data/lib/epuber/third_party/bower/bower_components/uri.js/src/IPv6.js +3 -6
  183. data/lib/epuber/third_party/bower/bower_components/uri.js/src/SecondLevelDomains.js +8 -4
  184. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentQuery.js +21 -4
  185. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentURI.js +1 -1
  186. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.js +312 -69
  187. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.min.js +85 -77
  188. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URITemplate.js +28 -11
  189. data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.js +17 -18
  190. data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.min.js +6 -6
  191. data/lib/epuber/third_party/bower/bower_components/uri.js/src/punycode.js +63 -38
  192. data/lib/epuber/third_party/bower.rb +2 -0
  193. data/lib/epuber/transformer/text_transformer.rb +1 -2
  194. data/lib/epuber/transformer.rb +1 -2
  195. data/lib/epuber/user_interface.rb +1 -1
  196. data/lib/epuber/vendor/hash_binding.rb +1 -1
  197. data/lib/epuber/vendor/nokogiri_extensions.rb +24 -21
  198. data/lib/epuber/vendor/ruby_templater.rb +1 -2
  199. data/lib/epuber/vendor/size.rb +1 -0
  200. data/lib/epuber/vendor/version.rb +1 -1
  201. data/lib/epuber/version.rb +2 -1
  202. data/lib/epuber.rb +1 -1
  203. metadata +78 -48
  204. data/lib/epuber/ruby_extensions/string.rb +0 -16
  205. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
  206. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
  207. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/strundefined.js +0 -3
  208. data/lib/epuber/vendor/globals_context.rb +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b03d446f6c71a6105554b794179ec35e719bc3a3c630ece5bd2607edbf379681
4
- data.tar.gz: b8c27f00396dc720d1e5dfc13d92fa5d97061f58947217d873a173c2ce939f7d
3
+ metadata.gz: 6560c1375c0b773b66e5938c09a94767ad7a9e8dae29b670e469028828e88db9
4
+ data.tar.gz: e6c72d1f60af9ea5b2f60b7bd9ee044d8896abe0d3e0a8ebead44965a1971876
5
5
  SHA512:
6
- metadata.gz: 632a864249f1e89cdf915e28bcfdd8e83dbae9f3b8b4c84d933ccb873eed6d4b5ef3ab74d6775af229e9b49b6e21f9d199fe8990a542ef5b12f50fb8eda3e30d
7
- data.tar.gz: 9105843aac2528104ff2febf949ccd89e9a3efe9724e8a422c5a98de003563b3bd58643f5894964c5a787071b30325c64ace3e13414c2960058c28c2417e1291
6
+ metadata.gz: 40f4c800bb62695192e7934402dae40c34540b0eebc175cc951bce8d669e4e9d61c855864281b134945d9e5b51f41467fb329a1a66ca47b326af2383151b2956
7
+ data.tar.gz: aa8ad6eeba9f8f0223dc3a4a62aef8477a0a6c7444441f871eb3a4d7138f60f3891e27227c49f96076669b9842a87c9e10e271822cb78a03f80712b237bf74cb
data/Gemfile CHANGED
@@ -1,8 +1,11 @@
1
- # encoding: utf-8
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
- gem 'coveralls', require: false
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://travis-ci.org/epuber-io/epuber.svg?branch=master)](https://travis-ci.org/epuber-io/epuber) [![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](http://inch-ci.org/github/epuber-io/epuber.svg?branch=master)](http://inch-ci.org/github/epuber-io/epuber) [![Join the chat at https://gitter.im/epuber-io/epuber](https://badges.gitter.im/epuber-io/epuber.svg)](https://gitter.im/epuber-io/epuber?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
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
- | 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
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 OS X is to use [brew](http://brew.sh):
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-get install libmagickwand-dev
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
- # encoding: utf-8
2
+ # frozen_string_literal: true
3
3
 
4
- lib = File.expand_path('../lib', File.dirname(__FILE__))
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
- # encoding: utf-8
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.3'
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', '~> 5.0'
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.14'
37
- spec.add_runtime_dependency 'rubyzip', '~> 1.0'
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.2.4'
42
+ spec.add_runtime_dependency 'bade', '~> 0.3', '>= 0.3.1'
44
43
 
45
- spec.add_development_dependency 'bundler', '~> 1.15'
46
44
  spec.add_development_dependency 'rspec', '~> 3.2'
47
- spec.add_development_dependency 'rubocop', '~> 0.49'
48
- spec.add_development_dependency 'rake', '~> 12.2'
49
- spec.add_development_dependency 'fakefs', '~> 0.6'
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
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Epuber
4
4
  class Book
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Epuber
4
4
  class Book
@@ -1,10 +1,9 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative '../vendor/version'
4
4
  require_relative '../vendor/size'
5
5
  require_relative '../dsl/tree_object'
6
6
 
7
-
8
7
  module Epuber
9
8
  class Book
10
9
  require_relative 'file_request'
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative '../dsl/tree_object'
4
4
 
5
-
6
5
  module Epuber
7
6
  class Book
8
7
  require_relative 'file_request'
data/lib/epuber/book.rb CHANGED
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative 'dsl/object'
4
4
 
5
-
6
5
  module Epuber
7
6
  class Book < DSL::Object
8
7
  require_relative 'book/contributor'
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/core_ext/string/access'
4
4
 
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative 'checker_transformer_base'
4
4
 
5
-
6
5
  module Epuber
7
6
  class Checker < CheckerTransformerBase
8
7
  require_relative 'checker/text_checker'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  module Epuber
3
4
  class CheckerTransformerBase
@@ -1,11 +1,10 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
4
  require 'os'
5
5
 
6
6
  require_relative '../command'
7
7
 
8
-
9
8
  module Epuber
10
9
  class Command
11
10
  class Build < Command
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative 'build'
4
4
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
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
@@ -1,9 +1,8 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative '../command'
4
4
  require 'os'
5
5
 
6
-
7
6
  module Epuber
8
7
  class Command
9
8
  class Server < Command
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'claide'
4
4
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
 
4
4
  module Epuber
@@ -1,8 +1,6 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
- require 'yaml'
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 = YAML.load_file(path) || {}
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,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Epuber
4
4
  class Compiler
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Epuber
4
4
  class Compiler
@@ -169,4 +169,3 @@ module Epuber
169
169
  end
170
170
  end
171
171
  end
172
-
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Epuber
4
4
  class Compiler
@@ -1,6 +1,5 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative '../ruby_extensions/string'
4
3
  require 'active_support/core_ext/object/try'
5
4
 
6
5
  module Epuber
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  module Epuber
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'bade'
4
4
 
5
-
6
5
  module Epuber
7
6
  class Compiler
8
7
  module FileTypes
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'coffee-script'
4
4
 
5
-
6
5
  module Epuber
7
6
  class Compiler
8
7
  module FileTypes
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -24,8 +23,3 @@ module Epuber
24
23
  end
25
24
  end
26
25
  end
27
-
28
-
29
-
30
-
31
-
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'rmagick'
4
4
 
5
-
6
5
  module Epuber
7
6
  class Compiler
8
7
  module FileTypes
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,8 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'epuber-stylus'
4
4
 
5
-
6
5
  module Epuber
7
6
  class Compiler
8
7
  module FileTypes
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
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,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
4
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'mime-types'
4
4
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative '../book/toc_item'
4
4
 
@@ -121,7 +121,7 @@ module Epuber
121
121
  end
122
122
  end
123
123
 
124
- if @target.epub_version >= 3 && toc_items.length > 0
124
+ if @target.epub_version >= 3 && toc_items.length > 0 && contains_item_with_title(toc_items)
125
125
  @xml.ol do
126
126
  iterate_lambda.call
127
127
  end
@@ -130,6 +130,10 @@ module Epuber
130
130
  end
131
131
  end
132
132
 
133
+ def contains_item_with_title(toc_items)
134
+ toc_items.any? { |a| a.title || contains_item_with_title(a.sub_items) }
135
+ end
136
+
133
137
  # @param toc_item [Epuber::Book::TocItem]
134
138
  #
135
139
  def visit_toc_item(toc_item)
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'time'
4
4
 
@@ -1,5 +1,4 @@
1
- # encoding: utf-8
2
-
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Epuber
5
4
  class Compiler
@@ -1,7 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
- require 'uri'
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
 
@@ -208,7 +210,7 @@ module Epuber
208
210
  uri = URI(path)
209
211
  rescue URI::InvalidURIError
210
212
  begin
211
- uri = URI(URI::encode(path))
213
+ uri = URI(Addressable::URI.encode(path))
212
214
  rescue URI::InvalidURIError
213
215
  # skip not valid uri
214
216
  raise UnparseableLinkError, "Unparseable link `#{path}`"