github-markup 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/github-markup.gemspec +1 -1
- data/lib/github-markup.rb +1 -1
- data/lib/github/markup/command_implementation.rb +3 -13
- data/lib/github/markups.rb +2 -2
- data/test/markup_test.rb +1 -1
- data/test/markups/README.lhs.html +1 -1
- data/test/markups/README.litcoffee.html +8 -8
- data/test/markups/README.rst.html +1 -1
- data/test/markups/README.rst.txt +8 -0
- data/test/markups/README.rst.txt.html +24 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2bf28c5515feafd037786383c67ce40e482f3f3
|
4
|
+
data.tar.gz: 99c65eb34485a76969611064d7202612c89535e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82cc2f19d92b7301d6593fb67056ef5a450cc64cacd11572671fa7acb25dce036c1f4765d8202f0fffa7717a714a2cc349c91c23a56dd638574a9c9cc85b3d39
|
7
|
+
data.tar.gz: a40f9887214699a9fc58b9596763c4788bbf72431711c66cad40ab2a7d566b91c5969bb71d31058c090befac3fafffc93ed6acf5c5a62aea1e4b66ac9c7cbb4e
|
data/Gemfile
CHANGED
data/github-markup.gemspec
CHANGED
@@ -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-
|
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,9 +1,4 @@
|
|
1
|
-
|
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
|
-
|
39
|
-
|
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
|
data/lib/github/markups.rb
CHANGED
@@ -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(
|
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(
|
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) => [a]
|
5
|
+
<pre><code class="haskell">isPrefixOf :: (Eq a) => [a] -> [a] -> Bool
|
6
6
|
isPrefixOf [] _ = True
|
7
7
|
isPrefixOf _ [] = False
|
8
8
|
isPrefixOf (x:xs) (y:ys)= x == y && isPrefixOf xs ys
|
@@ -6,18 +6,18 @@
|
|
6
6
|
|
7
7
|
<p>comment comment</p>
|
8
8
|
|
9
|
-
<pre><code>test "basic literate CoffeeScript parsing",
|
9
|
+
<pre><code>test "basic literate CoffeeScript parsing", ->
|
10
10
|
ok yes
|
11
11
|
</code></pre>
|
12
12
|
|
13
13
|
<p>now with a...</p>
|
14
14
|
|
15
|
-
<pre><code>test "broken up indentation",
|
15
|
+
<pre><code>test "broken up indentation", ->
|
16
16
|
</code></pre>
|
17
17
|
|
18
18
|
<p>... broken up ...</p>
|
19
19
|
|
20
|
-
<pre><code> do
|
20
|
+
<pre><code> do ->
|
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 "code blocks must be preceded by a blank line",
|
30
|
+
<pre><code>test "code blocks must be preceded by a blank line", ->
|
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 "comments in indented blocks work",
|
42
|
-
do
|
43
|
-
do
|
41
|
+
<pre><code>test "comments in indented blocks work", ->
|
42
|
+
do ->
|
43
|
+
do ->
|
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 "tabbed code",
|
65
|
+
<p>test "tabbed code", ->
|
66
66
|
ok yes</p>
|
data/test/markups/README.rst.txt
CHANGED
@@ -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.
|
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-
|
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
|
-
-
|
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.
|
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
|