epuber 0.6.0 → 0.7.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.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -3
  3. data/README.md +3 -11
  4. data/bin/epuber +2 -3
  5. data/epuber.gemspec +3 -6
  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 -1
  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 +1 -1
  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 +3 -1
  46. data/lib/epuber/compiler.rb +7 -11
  47. data/lib/epuber/config.rb +1 -2
  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_user.js → dataPriv.js} +2 -2
  115. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_priv.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 +48 -30
  204. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
  205. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
  206. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/strundefined.js +0 -3
  207. data/lib/epuber/vendor/globals_context.rb +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2899b08ccdd624b08c96377e111df6872f4c6b0871ee689e28d1264d42bf5294
4
- data.tar.gz: 6391e4b90172bc5d06d7c3f903aafa52efab3917ee0daaaf406723f3ee2d381f
3
+ metadata.gz: 6560c1375c0b773b66e5938c09a94767ad7a9e8dae29b670e469028828e88db9
4
+ data.tar.gz: e6c72d1f60af9ea5b2f60b7bd9ee044d8896abe0d3e0a8ebead44965a1971876
5
5
  SHA512:
6
- metadata.gz: 7a2df3f599de46ca5c5e976154d32752981fa9d2a76e0a46754b91f5583c3e671c3ab77c777bc8511dbda09f23ea0a8534d16656a1dfce4748b762fa7d7c3947
7
- data.tar.gz: b5d8d5556ce730d2215a6239405a56505f87e649fa1b06078cb2145f524c2d59e82d2789b21d0873c573079daa807ff9cc3d22b16bf26d85f4e223ac20ead502
6
+ metadata.gz: 40f4c800bb62695192e7934402dae40c34540b0eebc175cc951bce8d669e4e9d61c855864281b134945d9e5b51f41467fb329a1a66ca47b326af2383151b2956
7
+ data.tar.gz: aa8ad6eeba9f8f0223dc3a4a62aef8477a0a6c7444441f871eb3a4d7138f60f3891e27227c49f96076669b9842a87c9e10e271822cb78a03f80712b237bf74cb
data/Gemfile CHANGED
@@ -1,9 +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 'ruby-debug-ide'
9
- gem 'debase'
8
+ group :dev, optional: true do
9
+ gem 'debase', require: false
10
+ gem 'ruby-debug-ide', require: false
11
+ end
data/README.md CHANGED
@@ -67,7 +67,7 @@ Except for paths to plugins `book.use`, every path could be only name of the fil
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 (only v6 for now)
70
+ - ImageMagick
71
71
  - pkg-config
72
72
 
73
73
  On OS X make sure you Xcode Command Line Tools installed:
@@ -76,13 +76,11 @@ On OS X make sure you Xcode Command Line Tools installed:
76
76
 
77
77
  And the easiest way to install prerequisites on macOS is to use [brew](http://brew.sh):
78
78
 
79
- brew install imagemagick@6 node@12 pkg-config
80
- brew link --force imagemagick@6
81
- brew link --force --overwrite node@12
79
+ brew install imagemagick node pkg-config
82
80
 
83
81
  On Ubuntu, you can run:
84
82
 
85
- sudo apt-get install libmagickwand-dev
83
+ sudo apt install libmagickwand-dev
86
84
 
87
85
 
88
86
  ### Finish
@@ -108,12 +106,6 @@ To install this gem onto your local machine, run `bundle exec rake install`.
108
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.
109
107
 
110
108
 
111
- ## TODO
112
-
113
- - [ ] move all cards from Trello to GitHub
114
- - [ ] create documentation
115
- - [ ] create several examples of book specification
116
-
117
109
  ## License
118
110
 
119
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'
@@ -21,7 +19,7 @@ Gem::Specification.new do |spec|
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', '~> 6.0'
22
+ spec.add_runtime_dependency 'activesupport', '>= 6.0', '< 8.0'
25
23
  spec.add_runtime_dependency 'addressable', '~> 2.7'
26
24
  spec.add_runtime_dependency 'nokogiri', '~> 1.8', '>= 1.8.2'
27
25
  spec.add_runtime_dependency 'mime-types', '~> 3.0'
@@ -41,9 +39,8 @@ Gem::Specification.new do |spec|
41
39
 
42
40
  spec.add_runtime_dependency 'epuber-stylus', '~> 1.1', '>= 1.1.1'
43
41
  spec.add_runtime_dependency 'coffee-script', '~> 2.4'
44
- spec.add_runtime_dependency 'bade', '~> 0.2.4'
42
+ spec.add_runtime_dependency 'bade', '~> 0.3', '>= 0.3.1'
45
43
 
46
- spec.add_development_dependency 'bundler'
47
44
  spec.add_development_dependency 'rspec', '~> 3.2'
48
45
  spec.add_development_dependency 'rubocop', '~> 1.14'
49
46
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -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,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/core_ext/object/try'
4
4
 
@@ -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
 
@@ -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,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
4
  require 'addressable'
@@ -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
 
@@ -1,18 +1,13 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'English'
4
-
5
4
  require 'pathname'
6
5
  require 'fileutils'
7
-
8
6
  require 'zip'
9
7
 
10
8
  require_relative 'vendor/nokogiri_extensions'
11
- require_relative 'vendor/globals_context'
12
-
13
9
  require_relative 'plugin'
14
10
 
15
-
16
11
  module Epuber
17
12
  class Compiler
18
13
  require_relative 'compiler/compilation_context'
@@ -29,10 +24,11 @@ module Epuber
29
24
 
30
25
  EPUB_CONTENT_FOLDER = 'OEBPS'
31
26
 
32
- # @return [Epuber::GlobalsContext]
27
+ # @return [Bade::Runtime::GlobalsTracker]
33
28
  #
34
- def self.globals_catcher
35
- @globals_catcher ||= Epuber::GlobalsContext.new
29
+ def self.globals_tracker
30
+ @globals_tracker ||=
31
+ Bade::Runtime::GlobalsTracker.new(constants_location_prefixes: [Config.instance.project_path])
36
32
  end
37
33
 
38
34
  # @return [Epuber::Compiler::FileResolver]
@@ -70,7 +66,7 @@ module Epuber
70
66
  compilation_context.verbose = verbose
71
67
  compilation_context.use_cache = use_cache
72
68
 
73
- self.class.globals_catcher.catch do
69
+ self.class.globals_tracker.catch do
74
70
  @build_folder = build_folder
75
71
 
76
72
  FileUtils.mkdir_p(build_folder)
@@ -100,7 +96,7 @@ module Epuber
100
96
  compilation_context.target_file_database.save_to_file
101
97
  end
102
98
  ensure
103
- self.class.globals_catcher.clear_all
99
+ self.class.globals_tracker.clear_all
104
100
  end
105
101
 
106
102
  # Archives current target files to epub
data/lib/epuber/config.rb CHANGED
@@ -1,10 +1,9 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'pathname'
4
4
  require 'bade'
5
5
  require_relative 'lockfile'
6
6
 
7
-
8
7
  module Epuber
9
8
  class Config
10
9
  WORKING_PATH = '.epuber'
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'date'
4
4
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
 
4
4
  module Epuber
@@ -18,7 +18,7 @@ module Epuber
18
18
  # @return nil
19
19
  #
20
20
  def attribute(name, options = {})
21
- attr = Attribute.new(name, options)
21
+ attr = Attribute.new(name, **options)
22
22
 
23
23
  dsl_attributes[name] = attr
24
24
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative 'attribute'
4
4
  require_relative 'attribute_support'
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative 'object'
4
4
 
data/lib/epuber/helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Epuber
4
4
  module Helper
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'yaml'
4
4
  require_relative 'vendor/version'
data/lib/epuber/plugin.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative 'checker'
4
4
  require_relative 'transformer'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  class MatchData
3
4
  # @return [Array<String>]
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  class Thread
3
4
  class Backtrace
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
4