github-markup 0.1.6 → 0.1.7

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.
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.7 (2009-11-17)
2
+
3
+ * Ditch asciidoc2html, call asciidoc directly
4
+
1
5
  ## 0.1.6 (2009-11-17)
2
6
 
3
7
  * mdown
data/lib/github/markup.rb CHANGED
@@ -31,10 +31,9 @@ module GitHub
31
31
  command = file
32
32
  end
33
33
 
34
- return if !system("which #{command} > /dev/null")
35
-
36
34
  add_markup(regexp) do |content|
37
35
  rendered = execute(command, content)
36
+ rendered = rendered.to_s.empty? ? content : rendered
38
37
  block ? block.call(rendered) : rendered
39
38
  end
40
39
  end
@@ -64,6 +63,8 @@ module GitHub
64
63
  out = stdout.read
65
64
  end
66
65
  out.gsub("\r", '')
66
+ rescue Errno::EPIPE
67
+ ""
67
68
  end
68
69
 
69
70
  # Define markups
@@ -1,5 +1,5 @@
1
1
  module GitHub
2
2
  module Markup
3
- Version = '0.1.6'
3
+ Version = '0.1.7'
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ end
12
12
 
13
13
  command(:rest2html, /rest|rst/)
14
14
 
15
- command(:asciidoc2html, /asciidoc/)
15
+ command('asciidoc -s --backend=xhtml11 -o - -', /asciidoc/)
16
16
 
17
17
  # pod2html is nice enough to generate a full-on HTML document for us,
18
18
  # so we return the favor by ripping out the good parts.
data/test/markup_test.rb CHANGED
@@ -30,7 +30,7 @@ message
30
30
  def test_fails_gracefully_on_missing_commands
31
31
  GitHub::Markup.command(:i_made_it_up, /mde/)
32
32
  text = 'hi there'
33
- assert_equal false, GitHub::Markup.can_render?('README.mde')
33
+ assert GitHub::Markup.can_render?('README.mde')
34
34
  actual = GitHub::Markup.render('README.mde', text)
35
35
  assert_equal text, actual
36
36
  end
@@ -38,7 +38,7 @@ message
38
38
  def test_fails_gracefully_on_missing_env_commands
39
39
  GitHub::Markup.command('/usr/bin/env totally_fake', /tf/)
40
40
  text = 'hey mang'
41
- assert_equal false, GitHub::Markup.can_render?('README.tf')
41
+ assert GitHub::Markup.can_render?('README.tf')
42
42
  actual = GitHub::Markup.render('README.tf', text)
43
43
  assert_equal text, actual
44
44
  end
@@ -10,4 +10,3 @@ Two
10
10
  </p>
11
11
  </li>
12
12
  </ul></div>
13
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-markup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath