github-markup 4.0.2 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd63799d40b4736d12d90eb198959465570f9516bbe8d63badf267525f3f6e9f
4
- data.tar.gz: 4327fcc8c8ff440c838bb04b862267cc1780a866c177c56a26e3b840ec9d729f
3
+ metadata.gz: 0c0a1b208f2db4d8dbe2da7b892e9ab357901f60a4474967ffce14103a57cbea
4
+ data.tar.gz: a4d1eb586fdcf139731eb53550af3ce1a6bd4216dc44a2b7bd3bb6f69f237ecf
5
5
  SHA512:
6
- metadata.gz: ca67d30be3dacfa8b4d2e7ec0824e7ecc45692a610e4c12f56f85f4cce609ad8c1a79a1aef35a40b0b45834b14d04ca7876d43c4a5a4a6959f2ba003ffe5d475
7
- data.tar.gz: 95e8e50c8effb1af7884bfa996f006899818f9a07288a02371518258e002fd91f240da891be2ff2e3830b231380d4ff17ecac43113d6bafc6633f9ef9b170eb3
6
+ metadata.gz: 70544a9808c1858e816e37e283ecc2688b9c775b642f609f3cf92eefb4b6c6cdcf91386c1f058c5e13c90afd537aa99caf188f4ed8a78cd657f6ec50159f8d6f
7
+ data.tar.gz: a101a59c827e06dd5f687a22c5f7fdfe0316d4ff2cfee7d36d13df0b2bfd65669f1340a072013a02e9e120705d31d0bfaf5efe42b6024e127005b6541bb70dce
@@ -11,10 +11,10 @@ jobs:
11
11
  strategy:
12
12
  matrix:
13
13
  ruby:
14
- - "2.4"
15
- - "2.5"
16
- - "2.6"
17
- - "2.7"
14
+ - "3.0"
15
+ - "3.1"
16
+ - "3.2"
17
+ - "3.3"
18
18
  fail-fast: false
19
19
 
20
20
  steps:
data/.gitignore CHANGED
@@ -4,4 +4,5 @@ pkg/
4
4
  Gemfile.lock
5
5
  .project
6
6
  .buildpath
7
- *~
7
+ *~
8
+ vendor/
data/Gemfile CHANGED
@@ -1,17 +1,17 @@
1
1
  source "http://rubygems.org"
2
2
  gemspec
3
3
 
4
- gem "posix-spawn", :platforms => :ruby
5
4
  gem "redcarpet", :platforms => :ruby
6
5
  gem "kramdown", :platforms => :jruby
7
6
  gem "RedCloth"
8
7
  # using a tag version here because 0.18.3 was not published by the author to encourage users to upgrade.
9
8
  # however we want to bump up to this version since this has a security patch
10
9
  gem "commonmarker", git: "https://github.com/gjtorikian/commonmarker.git", tag: "v0.18.3"
11
- gem "rdoc", "~>3.6"
10
+ gem "rdoc", "~> 6.7.0"
12
11
  gem "org-ruby", "= 0.9.9"
13
12
  gem "creole", "~>0.3.6"
14
13
  gem "wikicloth", "=0.8.3"
15
14
  gem "twitter-text", "~> 1.14"
16
15
  gem "asciidoctor", "~> 2.0.5"
17
16
  gem "rake"
17
+ gem "rexml"
data/HISTORY.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 5.0.0 - 2024-06-17
2
+ * Drop support for Ruby versions < 3
3
+ * Bump nokogiri from 1.8.1 to 1.16.5
4
+ * Bump nokogiri-diff from 0.2.0 to 0.3.0
5
+ * Bump rdoc from 3.6 to 6.7.0
6
+ * Update CommandImplementation to better support large files (affecting RST and POD6 rendering)
7
+
1
8
  ## 4.0.2 - 2023-10-10
2
9
  * Add support for .mdx files in markdown
3
10
 
@@ -13,8 +13,9 @@ Gem::Specification.new do |s|
13
13
  s.homepage = "https://github.com/github/markup"
14
14
  s.license = "MIT"
15
15
 
16
+ s.required_ruby_version = '>= 3.0.0'
17
+
16
18
  s.files = `git ls-files`.split($\)
17
- s.files += Dir['vendor/**/*']
18
19
  s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
19
20
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
20
21
  s.require_paths = %w[lib]
@@ -24,7 +25,7 @@ Gem::Specification.new do |s|
24
25
  s.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
25
26
  s.add_development_dependency 'html-pipeline', '~> 1.0'
26
27
  s.add_development_dependency 'sanitize', '>= 4.6.3'
27
- s.add_development_dependency 'nokogiri', '~> 1.8.1'
28
- s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
28
+ s.add_development_dependency 'nokogiri', '~> 1.16.5'
29
+ s.add_development_dependency 'nokogiri-diff', '~> 0.3.0'
29
30
  s.add_development_dependency "github-linguist", ">= 7.1.3"
30
31
  end
@@ -1,9 +1,4 @@
1
- begin
2
- require "posix-spawn"
3
- rescue LoadError
4
- require "open3"
5
- end
6
-
1
+ require "open3"
7
2
  require "github/markup/implementation"
8
3
 
9
4
 
@@ -39,28 +34,13 @@ module GitHub
39
34
  end
40
35
  end
41
36
 
42
- if defined?(POSIX::Spawn)
43
- def execute(command, target)
44
- spawn = POSIX::Spawn::Child.new(*command, :input => target)
45
- if spawn.status.success?
46
- sanitize(spawn.out, target.encoding)
47
- else
48
- raise CommandError.new(spawn.err.strip)
49
- end
50
- end
51
- else
52
- def execute(command, target)
53
- output = Open3.popen3(*command) do |stdin, stdout, stderr, wait_thr|
54
- stdin.puts target
55
- stdin.close
56
- if wait_thr.value.success?
57
- stdout.readlines
58
- else
59
- raise CommandError.new(stderr.readlines.join('').strip)
60
- end
61
- end
62
- sanitize(output.join(''), target.encoding)
63
- end
37
+ def execute(command, target)
38
+ # capture3 blocks until both buffers are written to and the process terminates, but
39
+ # it won't allow either buffer to fill up
40
+ stdout, stderr, status = Open3.capture3(*command, stdin_data: target)
41
+
42
+ raise CommandError.new(stderr) unless status.success?
43
+ sanitize(stdout, target.encoding)
64
44
  end
65
45
 
66
46
  def sanitize(input, encoding)
data/lib/github-markup.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module GitHub
2
2
  module Markup
3
- VERSION = '4.0.2'
3
+ VERSION = '5.0.0'
4
4
  Version = VERSION
5
5
  end
6
6
  end
data/test/markup_test.rb CHANGED
@@ -66,6 +66,11 @@ class MarkupTest < Minitest::Test
66
66
  f.close_write
67
67
  f.read
68
68
  end
69
+
70
+ if ENV['UPDATE']
71
+ File.open(expected_file, 'w') { |f| f.write actual }
72
+ end
73
+
69
74
  assert_html_equal expected, actual, <<message
70
75
  #{File.basename expected_file}'s contents are not html equal to output:
71
76
  #{diff}
@@ -106,7 +111,7 @@ message
106
111
  begin
107
112
  GitHub::Markup.render('README.java', "stop swallowing errors", symlink: false)
108
113
  rescue GitHub::Markup::CommandError => e
109
- assert_equal "failure message", e.message
114
+ assert_equal "failure message", e.message.strip
110
115
  else
111
116
  fail "an exception was expected but was not raised"
112
117
  end
@@ -59,4 +59,4 @@ Here is some source code.
59
59
  <p>content</p>
60
60
  </div>
61
61
  </div>
62
- </div>
62
+ </div>
@@ -1,3 +1,3 @@
1
1
  <div>
2
2
  <p>This test verifies the author can disable the document title by adding <code>:!showtitle:</code> to the document header.</p>
3
- </div>
3
+ </div>
@@ -52,4 +52,4 @@ like links and unordered lists, are fine:</p>
52
52
  </ul>
53
53
  <p>Tabs work too:</p>
54
54
  <p>test "tabbed code", -&gt;
55
- ok yes</p>
55
+ ok yes</p>