reverse_adoc 0.2.7 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +15 -0
  3. data/.github/workflows/rake.yml +42 -0
  4. data/.gitignore +10 -0
  5. data/.rubocop.yml +12 -2
  6. data/Gemfile +2 -2
  7. data/README.adoc +6 -22
  8. data/Rakefile +1 -1
  9. data/{bin → exe}/reverse_adoc +16 -16
  10. data/{bin → exe}/w2a +17 -17
  11. data/lib/reverse_adoc.rb +27 -0
  12. data/lib/{reverse_asciidoctor → reverse_adoc}/cleaner.rb +4 -4
  13. data/lib/{reverse_asciidoctor → reverse_adoc}/config.rb +3 -2
  14. data/lib/{reverse_asciidoctor → reverse_adoc}/converters.rb +6 -6
  15. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/a.rb +1 -1
  16. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/aside.rb +1 -1
  17. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/audio.rb +1 -1
  18. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/base.rb +5 -3
  19. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/blockquote.rb +2 -2
  20. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/br.rb +1 -1
  21. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/bypass.rb +1 -1
  22. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/code.rb +1 -1
  23. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/div.rb +1 -1
  24. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/drop.rb +1 -1
  25. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/em.rb +1 -1
  26. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/figure.rb +1 -1
  27. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/h.rb +1 -1
  28. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/head.rb +1 -1
  29. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/hr.rb +1 -1
  30. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/ignore.rb +1 -1
  31. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/img.rb +11 -11
  32. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/li.rb +1 -1
  33. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/mark.rb +1 -1
  34. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/math.rb +3 -3
  35. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/ol.rb +1 -1
  36. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/p.rb +1 -1
  37. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/pass_through.rb +1 -1
  38. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/pre.rb +1 -1
  39. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/q.rb +1 -1
  40. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/strong.rb +1 -1
  41. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/sub.rb +1 -1
  42. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/sup.rb +1 -1
  43. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/table.rb +1 -1
  44. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/td.rb +1 -1
  45. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/text.rb +1 -1
  46. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/th.rb +1 -1
  47. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/tr.rb +1 -1
  48. data/lib/{reverse_asciidoctor → reverse_adoc}/converters/video.rb +1 -1
  49. data/lib/{reverse_asciidoctor → reverse_adoc}/errors.rb +1 -1
  50. data/lib/reverse_adoc/html_converter.rb +56 -0
  51. data/lib/reverse_adoc/version.rb +3 -0
  52. data/reverse_adoc.gemspec +7 -5
  53. data/spec/assets/escapables.html +2 -0
  54. data/spec/assets/{test.docx → external_images.docx} +0 -0
  55. data/spec/assets/{test.html → external_images.html} +0 -0
  56. data/spec/bin/reverse_adoc_spec.rb +32 -0
  57. data/spec/bin/w2a_spec.rb +35 -0
  58. data/spec/components/anchors_spec.rb +2 -2
  59. data/spec/components/basic_spec.rb +3 -3
  60. data/spec/components/code_spec.rb +4 -5
  61. data/spec/components/escapables_spec.rb +10 -2
  62. data/spec/components/from_the_wild_spec.rb +2 -2
  63. data/spec/components/html_fragment_spec.rb +2 -3
  64. data/spec/components/lists_spec.rb +2 -2
  65. data/spec/components/paragraphs_spec.rb +2 -2
  66. data/spec/components/quotation_spec.rb +2 -2
  67. data/spec/components/tables_spec.rb +2 -2
  68. data/spec/components/unknown_tags_spec.rb +9 -10
  69. data/spec/lib/reverse_adoc.rb +90 -0
  70. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/cleaner_spec.rb +4 -4
  71. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/config_spec.rb +5 -5
  72. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/aside_spec.rb +2 -2
  73. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/audio_spec.rb +2 -3
  74. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/blockquote_spec.rb +2 -2
  75. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/br_spec.rb +2 -2
  76. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/code_spec.rb +2 -3
  77. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/div_spec.rb +2 -3
  78. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/figure_spec.rb +2 -3
  79. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/img_spec.rb +2 -3
  80. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/li_spec.rb +2 -2
  81. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/mark_spec.rb +2 -2
  82. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/p_spec.rb +2 -3
  83. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/pre_spec.rb +2 -3
  84. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/q_spec.rb +2 -2
  85. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/strong_spec.rb +2 -2
  86. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/text_spec.rb +2 -2
  87. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters/video_spec.rb +2 -3
  88. data/spec/lib/{reverse_asciidoctor → reverse_adoc}/converters_spec.rb +5 -5
  89. data/spec/spec_helper.rb +7 -2
  90. data/spec/support/shell_helpers.rb +15 -0
  91. metadata +124 -104
  92. data/.github/workflows/macos.yml +0 -27
  93. data/.github/workflows/ubuntu.yml +0 -27
  94. data/.github/workflows/windows.yml +0 -30
  95. data/lib/reverse_asciidoctor.rb +0 -70
  96. data/lib/reverse_asciidoctor/version.rb +0 -3
  97. data/spec/lib/reverse_asciidoctor_spec.rb +0 -37
@@ -1,6 +1,6 @@
1
1
  require "uri"
2
2
 
3
- module ReverseAsciidoctor
3
+ module ReverseAdoc
4
4
  module Converters
5
5
  class A < Base
6
6
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Aside < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Audio < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Base
4
4
  def treat_children(node, state)
@@ -8,11 +8,13 @@ module ReverseAsciidoctor
8
8
  end
9
9
 
10
10
  def treat(node, state)
11
- ReverseAsciidoctor::Converters.lookup(node.name).convert(node, state)
11
+ ReverseAdoc::Converters.lookup(node.name).convert(node, state)
12
12
  end
13
13
 
14
14
  def escape_keychars(string)
15
- string.gsub(/(?<!\\)[*_]/, '*' => '\*', '_' => '\_')
15
+ subs = { '*' => '\*', '_' => '\_' }
16
+ string
17
+ .gsub(/((?<=\s)[\*_]+)|[\*_]+(?=\s)/) { |n| n.chars.map { |char| subs[char] }.join }
16
18
  end
17
19
 
18
20
  def extract_title(node)
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Blockquote < Base
4
4
  def convert(node, state = {})
@@ -7,7 +7,7 @@ module ReverseAsciidoctor
7
7
  cite = node['cite']
8
8
  attrs = cite ? "[quote, #{cite}]\n" : ""
9
9
  content = treat_children(node, state).strip
10
- content = ReverseAsciidoctor.cleaner.remove_newlines(content)
10
+ content = ReverseAdoc.cleaner.remove_newlines(content)
11
11
  #"\n\n> " << content.lines.to_a.join('> ') << "\n\n"
12
12
  "\n\n#{attrs}____\n" << content.lines.to_a.join('') << "\n____\n\n"
13
13
  end
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Br < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Bypass < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Code < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Div < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Drop < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Em < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Figure < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class H < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Head < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Hr < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Ignore < Base
4
4
  def convert(node, state = {})
@@ -2,31 +2,31 @@ require "fileutils"
2
2
  require "pathname"
3
3
  require "tempfile"
4
4
  require "base64"
5
- require "mimemagic"
5
+ require "marcel"
6
6
 
7
- module ReverseAsciidoctor
7
+ module ReverseAdoc
8
8
  module Converters
9
9
  class Img < Base
10
10
 
11
11
  def image_number
12
12
  sprintf(
13
- ReverseAsciidoctor.config.image_counter_pattern,
14
- ReverseAsciidoctor.config.image_counter
13
+ ReverseAdoc.config.image_counter_pattern,
14
+ ReverseAdoc.config.image_counter
15
15
  )
16
16
  end
17
17
 
18
18
  def image_number_increment
19
- ReverseAsciidoctor.config.image_counter += 1
19
+ ReverseAdoc.config.image_counter += 1
20
20
  end
21
21
 
22
22
  def datauri2file(src)
23
23
  %r{^data:image/(?<imgtype>[^;]+);base64,(?<imgdata>.+)$} =~ src
24
24
 
25
- dest_dir = Pathname.new(ReverseAsciidoctor.config.destination).dirname
25
+ dest_dir = Pathname.new(ReverseAdoc.config.destination).dirname
26
26
  images_dir = dest_dir + 'images'
27
27
  FileUtils.mkdir_p(images_dir)
28
28
 
29
- ext, image_src_path = determine_image_src_path(imgdata, src)
29
+ ext, image_src_path = determine_image_src_path(src, imgdata)
30
30
  image_dest_path = images_dir + "#{image_number}.#{ext}"
31
31
 
32
32
  # puts "image_dest_path: #{image_dest_path.to_s}"
@@ -38,11 +38,11 @@ module ReverseAsciidoctor
38
38
  image_dest_path.relative_path_from(dest_dir)
39
39
  end
40
40
 
41
- def determine_image_src_path(imgdata, src)
41
+ def determine_image_src_path(src, imgdata)
42
42
  return copy_temp_file(imgdata) if imgdata
43
43
 
44
44
  ext = File.extname(src).strip.downcase[1..-1]
45
- [ext, Pathname.new(ReverseAsciidoctor.config.sourcedir) + src]
45
+ [ext, Pathname.new(ReverseAdoc.config.sourcedir) + src]
46
46
  end
47
47
 
48
48
  def copy_temp_file(imgdata)
@@ -50,7 +50,7 @@ module ReverseAsciidoctor
50
50
  f.binmode
51
51
  f.write(Base64.strict_decode64(imgdata))
52
52
  f.rewind
53
- ext = MimeMagic.by_magic(f).subtype
53
+ ext = Marcel::MimeType.for(f).sub(%r{^[^/]+/}, "")
54
54
  [ext, f.path]
55
55
  end
56
56
  end
@@ -64,7 +64,7 @@ module ReverseAsciidoctor
64
64
  anchor = id ? "[[#{id}]]\n" : ""
65
65
  title = extract_title(node)
66
66
 
67
- if ReverseAsciidoctor.config.external_images
67
+ if ReverseAdoc.config.external_images
68
68
  # puts "external image conversion #{id}, #{src}"
69
69
  src = datauri2file(src)
70
70
  end
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Li < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Mark < Base
4
4
  def convert(node, state = {})
@@ -1,15 +1,15 @@
1
- # Unless run with ReverseAsciidoctor.config.mathml2asciimath,
1
+ # Unless run with ReverseAdoc.config.mathml2asciimath,
2
2
  # this is cheating: we're injecting MathML into Asciidoctor, but
3
3
  # Asciidoctor only understands AsciiMath or LaTeX
4
4
 
5
5
  require "mathml2asciimath"
6
6
 
7
- module ReverseAsciidoctor
7
+ module ReverseAdoc
8
8
  module Converters
9
9
  class Math < Base
10
10
  def convert(node, state = {})
11
11
  stem = node.to_s.gsub(/\n/, " ")
12
- stem = MathML2AsciiMath.m2a(stem) if ReverseAsciidoctor.config.mathml2asciimath
12
+ stem = MathML2AsciiMath.m2a(stem) if ReverseAdoc.config.mathml2asciimath
13
13
  stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub(/\(\(([^\)]+)\)\)/, "(\\1)") unless stem.nil?
14
14
  " stem:[" << stem << "] "
15
15
  end
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Ol < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class P < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class PassThrough < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Pre < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Q < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Strong < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Sub < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Sup < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Table < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Td < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Text < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Th < Td
4
4
  def cellstyle(node)
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Tr < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  module Converters
3
3
  class Video < Base
4
4
  def convert(node, state = {})
@@ -1,4 +1,4 @@
1
- module ReverseAsciidoctor
1
+ module ReverseAdoc
2
2
  class Error < StandardError
3
3
  end
4
4
 
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'reverse_adoc/converters/a'
4
+ require 'reverse_adoc/converters/aside'
5
+ require 'reverse_adoc/converters/audio'
6
+ require 'reverse_adoc/converters/blockquote'
7
+ require 'reverse_adoc/converters/br'
8
+ require 'reverse_adoc/converters/bypass'
9
+ require 'reverse_adoc/converters/code'
10
+ require 'reverse_adoc/converters/div'
11
+ require 'reverse_adoc/converters/drop'
12
+ require 'reverse_adoc/converters/em'
13
+ require 'reverse_adoc/converters/figure'
14
+ require 'reverse_adoc/converters/h'
15
+ require 'reverse_adoc/converters/head'
16
+ require 'reverse_adoc/converters/hr'
17
+ require 'reverse_adoc/converters/ignore'
18
+ require 'reverse_adoc/converters/img'
19
+ require 'reverse_adoc/converters/mark'
20
+ require 'reverse_adoc/converters/li'
21
+ require 'reverse_adoc/converters/ol'
22
+ require 'reverse_adoc/converters/p'
23
+ require 'reverse_adoc/converters/pass_through'
24
+ require 'reverse_adoc/converters/pre'
25
+ require 'reverse_adoc/converters/q'
26
+ require 'reverse_adoc/converters/strong'
27
+ require 'reverse_adoc/converters/sup'
28
+ require 'reverse_adoc/converters/sub'
29
+ require 'reverse_adoc/converters/table'
30
+ require 'reverse_adoc/converters/td'
31
+ require 'reverse_adoc/converters/th'
32
+ require 'reverse_adoc/converters/text'
33
+ require 'reverse_adoc/converters/tr'
34
+ require 'reverse_adoc/converters/video'
35
+ require 'reverse_adoc/converters/math'
36
+
37
+ module ReverseAdoc
38
+ class HtmlConverter
39
+ def self.convert(input, options = {})
40
+ root = if input.is_a?(String)
41
+ then Nokogiri::HTML(input).root
42
+ elsif input.is_a?(Nokogiri::XML::Document)
43
+ then input.root
44
+ elsif input.is_a?(Nokogiri::XML::Node)
45
+ then input
46
+ end
47
+
48
+ root || (return '')
49
+
50
+ ReverseAdoc.config.with(options) do
51
+ result = ReverseAdoc::Converters.lookup(root.name).convert(root)
52
+ ReverseAdoc.cleaner.tidy(result)
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,3 @@
1
+ module ReverseAdoc
2
+ VERSION = '0.3.1'
3
+ end
data/reverse_adoc.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "reverse_asciidoctor/version"
3
+ require "reverse_adoc/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "reverse_adoc"
7
- s.version = ReverseAsciidoctor::VERSION
7
+ s.version = ReverseAdoc::VERSION
8
8
  s.authors = ["Ribose Inc."]
9
9
  s.email = ["open.source@ribose.com"]
10
10
 
@@ -15,14 +15,15 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.executables = `git ls-files -- exe/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.bindir = "exe"
19
20
  s.require_paths = ["lib"]
20
21
  s.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
21
22
 
22
23
  # specify any dependencies here; for example:
23
- s.add_dependency 'nokogiri', ">= 1.10.4"
24
+ s.add_dependency 'nokogiri', "~> 1.10.4"
24
25
  s.add_dependency 'mathml2asciimath'
25
- s.add_dependency 'mimemagic'
26
+ s.add_dependency 'marcel', "~> 1.0.0"
26
27
  s.add_development_dependency 'rspec'
27
28
  s.add_development_dependency 'simplecov'
28
29
  s.add_development_dependency 'rake'
@@ -33,4 +34,5 @@ Gem::Specification.new do |s|
33
34
 
34
35
  # All the following are for bin/w2m
35
36
  s.add_dependency 'word-to-markdown'
37
+ s.add_dependency 'premailer', '~> 1.11.0'
36
38
  end