github-markup 1.0.2 → 1.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d35584dcddd6c4d30a24ef157cb42369161b24af
4
- data.tar.gz: 2b71a47126ef2dcbfdcf2779c4b892eabc22db53
3
+ metadata.gz: f2bf28c5515feafd037786383c67ce40e482f3f3
4
+ data.tar.gz: 99c65eb34485a76969611064d7202612c89535e6
5
5
  SHA512:
6
- metadata.gz: ecb7a19c1bc478049846d7a7ca53f2d0c3a021f5e99a861de190ff5398e0fe66017bd721818ba70848d039eab2b09bef97dd3d61f9c1048f5fab662c02b6130d
7
- data.tar.gz: 5904bb20ed5edf8a027f79468e42719c7220a37846f9fe8d22697535ec272c14c91f4f6474dd45441ad81cdc538d55f074a2b5b05ae5e470a17ac7c7fec2ea05
6
+ metadata.gz: 82cc2f19d92b7301d6593fb67056ef5a450cc64cacd11572671fa7acb25dce036c1f4765d8202f0fffa7717a714a2cc349c91c23a56dd638574a9c9cc85b3d39
7
+ data.tar.gz: a40f9887214699a9fc58b9596763c4788bbf72431711c66cad40ab2a7d566b91c5969bb71d31058c090befac3fafffc93ed6acf5c5a62aea1e4b66ac9c7cbb4e
data/Gemfile CHANGED
@@ -8,3 +8,4 @@ gem "wikicloth", "=0.6.0"
8
8
  gem "literati", "= 0.0.3"
9
9
  gem "asciidoctor", "= 0.1.4"
10
10
  gem "rake"
11
+ gem "posix-spawn"
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  ## the sub! line in the Rakefile
17
17
  s.name = 'github-markup'
18
18
  s.version = GitHub::Markup::VERSION
19
- s.date = '2014-02-14'
19
+ s.date = '2014-02-25'
20
20
  s.executables = ['github-markup']
21
21
 
22
22
  ## Make sure your summary is short. The description may be as long
data/lib/github-markup.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module GitHub
2
2
  module Markup
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  Version = VERSION
5
5
  end
6
6
  end
@@ -1,9 +1,4 @@
1
- begin
2
- require "open3_detach"
3
- rescue LoadError
4
- require "open3"
5
- end
6
-
1
+ require "posix-spawn"
7
2
  require "github/markup/implementation"
8
3
 
9
4
  module GitHub
@@ -35,13 +30,8 @@ module GitHub
35
30
  end
36
31
 
37
32
  def execute(command, target)
38
- out = ''
39
- Open3.popen3(command) do |stdin, stdout, _|
40
- stdin.puts target
41
- stdin.close
42
- out = stdout.read
43
- end
44
- out.gsub("\r", '')
33
+ spawn = POSIX::Spawn::Child.new(*command, :input => target)
34
+ spawn.out.gsub("\r", '')
45
35
  rescue Errno::EPIPE
46
36
  ""
47
37
  rescue Errno::ENOENT
@@ -30,14 +30,14 @@ markup(:asciidoctor, /adoc|asc(iidoc)?/) do |content|
30
30
  Asciidoctor.render(content, :safe => :secure, :attributes => %w(showtitle idprefix idseparator=- env=github env-github source-highlighter=html-pipeline))
31
31
  end
32
32
 
33
- command(:rest2html, /re?st(\.txt)?/)
33
+ command('rest2html', /re?st(\.txt)?/)
34
34
 
35
35
  # pod2html is nice enough to generate a full-on HTML document for us,
36
36
  # so we return the favor by ripping out the good parts.
37
37
  #
38
38
  # Any block passed to `command` will be handed the command's STDOUT for
39
39
  # post processing.
40
- command("/usr/bin/env perl -MPod::Simple::HTML -e Pod::Simple::HTML::go", /pod/) do |rendered|
40
+ command('/usr/bin/env perl -MPod::Simple::HTML -e Pod::Simple::HTML::go', /pod/) do |rendered|
41
41
  if rendered =~ /<!-- start doc -->\s*(.+)\s*<!-- end doc -->/mi
42
42
  $1
43
43
  end
data/test/markup_test.rb CHANGED
@@ -13,7 +13,7 @@ class MarkupTest < Test::Unit::TestCase
13
13
 
14
14
  expected_file = "#{readme}.html"
15
15
  expected = File.read(expected_file).rstrip
16
- actual = GitHub::Markup.render(readme, File.read(readme)).rstrip
16
+ actual = GitHub::Markup.render(readme, File.read(readme)).rstrip.force_encoding("utf-8")
17
17
 
18
18
  if source != expected
19
19
  assert(source != actual, "#{markup} did not render anything")
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p>Except with more magic added.</p>
4
4
 
5
- <pre><code class="haskell">isPrefixOf :: (Eq a) =&gt; [a] -> [a] -> Bool
5
+ <pre><code class="haskell">isPrefixOf :: (Eq a) =&gt; [a] -&gt; [a] -&gt; Bool
6
6
  isPrefixOf [] _ = True
7
7
  isPrefixOf _ [] = False
8
8
  isPrefixOf (x:xs) (y:ys)= x == y &amp;&amp; isPrefixOf xs ys
@@ -6,18 +6,18 @@
6
6
 
7
7
  <p>comment comment</p>
8
8
 
9
- <pre><code>test &quot;basic literate CoffeeScript parsing&quot;, ->
9
+ <pre><code>test &quot;basic literate CoffeeScript parsing&quot;, -&gt;
10
10
  ok yes
11
11
  </code></pre>
12
12
 
13
13
  <p>now with a...</p>
14
14
 
15
- <pre><code>test &quot;broken up indentation&quot;, ->
15
+ <pre><code>test &quot;broken up indentation&quot;, -&gt;
16
16
  </code></pre>
17
17
 
18
18
  <p>... broken up ...</p>
19
19
 
20
- <pre><code> do ->
20
+ <pre><code> do -&gt;
21
21
  </code></pre>
22
22
 
23
23
  <p>... nested block.</p>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <p>Code must be separated from text by a blank line.</p>
29
29
 
30
- <pre><code>test &quot;code blocks must be preceded by a blank line&quot;, ->
30
+ <pre><code>test &quot;code blocks must be preceded by a blank line&quot;, -&gt;
31
31
  </code></pre>
32
32
 
33
33
  <p>The next line is part of the text and will not be executed.
@@ -38,9 +38,9 @@
38
38
 
39
39
  <p>Code in <code>backticks is not parsed</code> and...</p>
40
40
 
41
- <pre><code>test &quot;comments in indented blocks work&quot;, ->
42
- do ->
43
- do ->
41
+ <pre><code>test &quot;comments in indented blocks work&quot;, -&gt;
42
+ do -&gt;
43
+ do -&gt;
44
44
  # Regular comment.
45
45
 
46
46
  ###
@@ -62,5 +62,5 @@ like links and unordered lists, are fine:</p>
62
62
 
63
63
  <p>Tabs work too:</p>
64
64
 
65
- <p>test &quot;tabbed code&quot;, ->
65
+ <p>test &quot;tabbed code&quot;, -&gt;
66
66
  ok yes</p>
@@ -28,4 +28,4 @@
28
28
  <td><a class="reference external" href="https://github.com/tony/pullv">https://github.com/tony/pullv</a></td>
29
29
  </tr>
30
30
  </tbody>
31
- </table>
31
+ </table>
@@ -10,4 +10,12 @@ Header 2
10
10
 
11
11
  2. More ``code``, hooray
12
12
 
13
+ 3. Somé UTF-8°
13
14
 
15
+ ============== ==========================================================
16
+ Travis http://travis-ci.org/tony/pullv
17
+ Docs http://pullv.rtfd.org
18
+ API http://pullv.readthedocs.org/en/latest/api.html
19
+ Issues https://github.com/tony/pullv/issues
20
+ Source https://github.com/tony/pullv
21
+ ============== ==========================================================
@@ -4,4 +4,28 @@
4
4
  <ol class="arabic simple">
5
5
  <li>Blah blah <tt class="docutils literal">code</tt> blah</li>
6
6
  <li>More <tt class="docutils literal">code</tt>, hooray</li>
7
+ <li>Somé UTF-8°</li>
7
8
  </ol>
9
+ <table class="docutils">
10
+ <colgroup>
11
+ <col width="19%" />
12
+ <col width="81%" />
13
+ </colgroup>
14
+ <tbody valign="top">
15
+ <tr><td>Travis</td>
16
+ <td><a class="reference external" href="http://travis-ci.org/tony/pullv">http://travis-ci.org/tony/pullv</a></td>
17
+ </tr>
18
+ <tr><td>Docs</td>
19
+ <td><a class="reference external" href="http://pullv.rtfd.org">http://pullv.rtfd.org</a></td>
20
+ </tr>
21
+ <tr><td>API</td>
22
+ <td><a class="reference external" href="http://pullv.readthedocs.org/en/latest/api.html">http://pullv.readthedocs.org/en/latest/api.html</a></td>
23
+ </tr>
24
+ <tr><td>Issues</td>
25
+ <td><a class="reference external" href="https://github.com/tony/pullv/issues">https://github.com/tony/pullv/issues</a></td>
26
+ </tr>
27
+ <tr><td>Source</td>
28
+ <td><a class="reference external" href="https://github.com/tony/pullv">https://github.com/tony/pullv</a></td>
29
+ </tr>
30
+ </tbody>
31
+ </table>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-markup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-14 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  This gem is used by GitHub to render any fancy markup such as
@@ -73,22 +73,22 @@ licenses: []
73
73
  metadata: {}
74
74
  post_install_message:
75
75
  rdoc_options:
76
- - "--charset=UTF-8"
76
+ - --charset=UTF-8
77
77
  require_paths:
78
78
  - lib
79
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.2.0
91
+ rubygems_version: 2.0.3
92
92
  signing_key:
93
93
  specification_version: 2
94
94
  summary: The code GitHub uses to render README.markup