markdpwn 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +11 -11
- data/Gemfile.lock +66 -55
- data/VERSION +1 -1
- data/lib/markdpwn/code.rb +5 -5
- data/lib/markdpwn/docs.rb +2 -2
- data/lib/markdpwn/dpwn.rb +9 -9
- data/lib/markdpwn/red_carpet_renderer.rb +9 -9
- data/markdpwn.gemspec +52 -52
- data/test/markdpwn/code_test.rb +30 -35
- data/test/markdpwn/docs_test.rb +12 -12
- data/test/markdpwn/dpwn_test.rb +5 -5
- data/test/markdpwn_test.rb +13 -13
- metadata +55 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd0760f301c1f04764fa36933f65e871f4354b15
|
4
|
+
data.tar.gz: 1ce5c6592af9b4579169b87ac3499e48c36190fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56831c5fe4f3f0fa831d61e97252c16d4a0a29df1264d840f6a9805a787524c06aa56fa13f57bca8627fa1efa1028e33dc37c9cb2f09aedc4621fbefeb3a18dd
|
7
|
+
data.tar.gz: d6956d86912f10726a124c92ac7b773e2b54844df47ab3be2977b5b4e52a0ec05a457d7731b5f4371868368c165c669965322f7f2f256ff84c5b3d4b1b4b6046
|
data/Gemfile
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
# Code formatting.
|
4
|
-
gem 'pygments.rb', '>=
|
4
|
+
gem 'pygments.rb', '>= 1.1.2'
|
5
5
|
|
6
6
|
# Github formatting.
|
7
|
-
gem 'asciidoctor', '>=
|
8
|
-
gem 'github-markup', '>= 1.
|
9
|
-
gem 'redcarpet', '>= 3.
|
10
|
-
gem 'RedCloth', '>= 4.2
|
7
|
+
gem 'asciidoctor', '>= 1.5.5'
|
8
|
+
gem 'github-markup', '>= 1.6.0', require: 'github/markup'
|
9
|
+
gem 'redcarpet', '>= 3.4.0'
|
10
|
+
gem 'RedCloth', '>= 4.3.2'
|
11
11
|
#gem 'rdoc', '~> 3.12'
|
12
|
-
gem 'org-ruby', '>= 0.9.
|
12
|
+
gem 'org-ruby', '>= 0.9.12'
|
13
13
|
gem 'creole', '>= 0.5.0'
|
14
|
-
gem 'wikicloth', '>= 0.8.
|
14
|
+
gem 'wikicloth', '>= 0.8.3'
|
15
15
|
|
16
16
|
group :development do
|
17
|
-
gem 'minitest', '>= 4.
|
18
|
-
gem 'yard', '>= 0.
|
17
|
+
gem 'minitest', '>= 5.4.1'
|
18
|
+
gem 'yard', '>= 0.9.9'
|
19
19
|
gem 'bundler', '>= 1.3.5'
|
20
|
-
gem 'jeweler', '>= 2.
|
21
|
-
gem 'simplecov', '>= 0', platform: :mri
|
20
|
+
gem 'jeweler', '>= 2.3.5'
|
21
|
+
gem 'simplecov', '>= 0.14.1', platform: :mri
|
22
22
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
RedCloth (4.2
|
5
|
-
addressable (2.
|
6
|
-
|
7
|
-
|
4
|
+
RedCloth (4.3.2)
|
5
|
+
addressable (2.5.1)
|
6
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
7
|
+
asciidoctor (1.5.5)
|
8
|
+
builder (3.2.3)
|
8
9
|
creole (0.5.0)
|
9
10
|
descendants_tracker (0.0.4)
|
10
11
|
thread_safe (~> 0.3, >= 0.3.1)
|
11
12
|
docile (1.1.5)
|
12
13
|
expression_parser (0.9.0)
|
13
|
-
faraday (0.9.
|
14
|
+
faraday (0.9.2)
|
14
15
|
multipart-post (>= 1.2, < 3)
|
15
|
-
git (1.
|
16
|
-
github-markup (1.
|
17
|
-
posix-spawn (~> 0.3.8)
|
16
|
+
git (1.3.0)
|
17
|
+
github-markup (1.6.0)
|
18
18
|
github_api (0.11.3)
|
19
19
|
addressable (~> 2.3)
|
20
20
|
descendants_tracker (~> 0.0.1)
|
@@ -23,72 +23,83 @@ GEM
|
|
23
23
|
multi_json (>= 1.7.5, < 2.0)
|
24
24
|
nokogiri (~> 1.6.0)
|
25
25
|
oauth2
|
26
|
-
hashie (3.
|
27
|
-
highline (1.
|
28
|
-
|
26
|
+
hashie (3.5.5)
|
27
|
+
highline (1.7.8)
|
28
|
+
htmlentities (4.3.4)
|
29
|
+
jeweler (2.3.5)
|
29
30
|
builder
|
30
31
|
bundler (>= 1.0)
|
31
32
|
git (>= 1.2.5)
|
32
|
-
github_api
|
33
|
+
github_api (~> 0.11.0)
|
33
34
|
highline (>= 1.6.15)
|
34
35
|
nokogiri (>= 1.5.10)
|
36
|
+
psych (~> 2.2)
|
35
37
|
rake
|
36
38
|
rdoc
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
semver2
|
40
|
+
json (2.1.0)
|
41
|
+
jwt (1.5.6)
|
42
|
+
mini_portile2 (2.1.0)
|
43
|
+
minitest (5.10.2)
|
44
|
+
multi_json (1.12.1)
|
45
|
+
multi_xml (0.6.0)
|
43
46
|
multipart-post (2.0.0)
|
44
|
-
nokogiri (1.6.
|
45
|
-
|
46
|
-
oauth2 (
|
47
|
-
faraday (>= 0.8, < 0.
|
47
|
+
nokogiri (1.6.8.1)
|
48
|
+
mini_portile2 (~> 2.1.0)
|
49
|
+
oauth2 (1.3.1)
|
50
|
+
faraday (>= 0.8, < 0.12)
|
48
51
|
jwt (~> 1.0)
|
49
52
|
multi_json (~> 1.3)
|
50
53
|
multi_xml (~> 0.5)
|
51
|
-
rack (
|
52
|
-
org-ruby (0.9.
|
54
|
+
rack (>= 1.2, < 3)
|
55
|
+
org-ruby (0.9.12)
|
53
56
|
rubypants (~> 0.2)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
rack (
|
59
|
-
rake (
|
60
|
-
rdoc (
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
simplecov (0.8.2)
|
57
|
+
psych (2.2.4)
|
58
|
+
public_suffix (2.0.5)
|
59
|
+
pygments.rb (1.1.2)
|
60
|
+
multi_json (>= 1.0.0)
|
61
|
+
rack (2.0.2)
|
62
|
+
rake (12.0.0)
|
63
|
+
rdoc (5.1.0)
|
64
|
+
redcarpet (3.4.0)
|
65
|
+
rubypants (0.6.0)
|
66
|
+
semver2 (3.4.2)
|
67
|
+
simplecov (0.14.1)
|
66
68
|
docile (~> 1.1.0)
|
67
|
-
|
68
|
-
simplecov-html (~> 0.
|
69
|
-
simplecov-html (0.
|
70
|
-
thread_safe (0.3.
|
71
|
-
|
69
|
+
json (>= 1.8, < 3)
|
70
|
+
simplecov-html (~> 0.10.0)
|
71
|
+
simplecov-html (0.10.0)
|
72
|
+
thread_safe (0.3.6)
|
73
|
+
twitter-text (1.14.5)
|
74
|
+
unf (~> 0.1.0)
|
75
|
+
unf (0.1.4)
|
76
|
+
unf_ext
|
77
|
+
unf_ext (0.0.7.4)
|
78
|
+
wikicloth (0.8.3)
|
72
79
|
builder
|
73
80
|
expression_parser
|
74
|
-
|
75
|
-
|
76
|
-
|
81
|
+
htmlentities
|
82
|
+
nokogiri
|
83
|
+
twitter-text
|
84
|
+
yard (0.9.9)
|
77
85
|
|
78
86
|
PLATFORMS
|
79
87
|
ruby
|
80
88
|
|
81
89
|
DEPENDENCIES
|
82
|
-
RedCloth (>= 4.2
|
83
|
-
asciidoctor (>=
|
90
|
+
RedCloth (>= 4.3.2)
|
91
|
+
asciidoctor (>= 1.5.5)
|
84
92
|
bundler (>= 1.3.5)
|
85
93
|
creole (>= 0.5.0)
|
86
|
-
github-markup (>= 1.
|
87
|
-
jeweler (>= 2.
|
88
|
-
minitest (>= 4.
|
89
|
-
org-ruby (>= 0.9.
|
90
|
-
pygments.rb (>=
|
91
|
-
redcarpet (>= 3.
|
92
|
-
simplecov
|
93
|
-
wikicloth (>= 0.8.
|
94
|
-
yard (>= 0.
|
94
|
+
github-markup (>= 1.6.0)
|
95
|
+
jeweler (>= 2.3.5)
|
96
|
+
minitest (>= 5.4.1)
|
97
|
+
org-ruby (>= 0.9.12)
|
98
|
+
pygments.rb (>= 1.1.2)
|
99
|
+
redcarpet (>= 3.4.0)
|
100
|
+
simplecov (>= 0.14.1)
|
101
|
+
wikicloth (>= 0.8.3)
|
102
|
+
yard (>= 0.9.9)
|
103
|
+
|
104
|
+
BUNDLED WITH
|
105
|
+
1.14.4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/markdpwn/code.rb
CHANGED
@@ -28,8 +28,8 @@ module Code
|
|
28
28
|
#
|
29
29
|
def self.pygment(code, options = {})
|
30
30
|
lexer = pygments_lexer options
|
31
|
-
pygments_args = { :
|
32
|
-
:
|
31
|
+
pygments_args = { formatter: 'html',
|
32
|
+
options: { encoding: 'utf-8', nowrap: true } }
|
33
33
|
pygments_args[:lexer] = lexer if lexer
|
34
34
|
Pygments.highlight code, pygments_args
|
35
35
|
end
|
@@ -44,7 +44,7 @@ module Code
|
|
44
44
|
def self.pygments_lexer(options = {})
|
45
45
|
if language = options[:language]
|
46
46
|
lexer = begin
|
47
|
-
Pygments.lexer_name_for :
|
47
|
+
Pygments.lexer_name_for lexer: language
|
48
48
|
rescue IOError
|
49
49
|
nil
|
50
50
|
end
|
@@ -53,7 +53,7 @@ module Code
|
|
53
53
|
|
54
54
|
if mime_type = options[:mime_type]
|
55
55
|
lexer = begin
|
56
|
-
Pygments.lexer_name_for :
|
56
|
+
Pygments.lexer_name_for mimetype: mime_type
|
57
57
|
rescue IOError
|
58
58
|
nil
|
59
59
|
end
|
@@ -62,7 +62,7 @@ module Code
|
|
62
62
|
|
63
63
|
if file_name = options[:file_name]
|
64
64
|
lexer = begin
|
65
|
-
Pygments.lexer_name_for :
|
65
|
+
Pygments.lexer_name_for filename: file_name
|
66
66
|
rescue IOError
|
67
67
|
nil
|
68
68
|
end
|
data/lib/markdpwn/docs.rb
CHANGED
@@ -21,10 +21,10 @@ module Docs
|
|
21
21
|
# @return [String] the GitHub::Markup output, or nil if the file cannot be
|
22
22
|
# rendered by GitHub::Markup
|
23
23
|
def self.gh_markup(text, options = {})
|
24
|
-
# NOTE: the MIME type is specified in the API so clients won't need to
|
24
|
+
# NOTE: the MIME type is specified in the API so clients won't need to
|
25
25
|
# change if/when MIME-based detection is added
|
26
26
|
file_name = options[:file_name]
|
27
|
-
if file_name && GitHub::Markup.can_render?(file_name)
|
27
|
+
if file_name && GitHub::Markup.can_render?(file_name, text)
|
28
28
|
GitHub::Markup.render file_name, text
|
29
29
|
else
|
30
30
|
nil
|
data/lib/markdpwn/dpwn.rb
CHANGED
@@ -13,19 +13,19 @@ module Dpwn
|
|
13
13
|
# @param [Hash] options rendering options (currently ignored)
|
14
14
|
# @return [String] a HTML fragment containing the formatted text
|
15
15
|
def self.render(text, options = {})
|
16
|
-
renderer = Markdpwn::RedCarpetRenderer.new
|
16
|
+
renderer = Markdpwn::RedCarpetRenderer.new
|
17
17
|
md = Redcarpet::Markdown.new renderer,
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
autolink: true,
|
19
|
+
no_intra_emphasis: true,
|
20
|
+
tables: true,
|
21
|
+
fenced_code_blocks: true,
|
22
|
+
strikethrough: true,
|
23
|
+
space_after_headers: true
|
24
24
|
md.render text
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
# Checks if some file should be formatted using Markdpwn.
|
28
|
-
# @param [Hash] options file properties considered in the decision process
|
28
|
+
# @param [Hash] options file properties considered in the decision process
|
29
29
|
# @option options [String] :mime_type the MIME type of the code file; e-mail
|
30
30
|
# attachments and git blobs have MIME types
|
31
31
|
# @option options [String] :file_name the name of the file containing the
|
@@ -1,20 +1,20 @@
|
|
1
1
|
module Markdpwn
|
2
|
-
|
2
|
+
|
3
3
|
# RedCarpet HTML renderer, augmented to parse code blocks.
|
4
4
|
# @private
|
5
5
|
class RedCarpetRenderer < Redcarpet::Render::HTML
|
6
|
-
DEFAULT_OPTIONS = {
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
}.freeze
|
11
|
-
|
6
|
+
DEFAULT_OPTIONS = {
|
7
|
+
filter_html: true,
|
8
|
+
no_styles: true,
|
9
|
+
safe_links_only: true
|
10
|
+
}.freeze
|
11
|
+
|
12
12
|
def initialize(options = {})
|
13
13
|
super DEFAULT_OPTIONS.merge options
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
def block_code(code, language)
|
17
|
-
Markdpwn::Code.render code, :
|
17
|
+
Markdpwn::Code.render code, language: language
|
18
18
|
end
|
19
19
|
end # class MarkdDpwn::RedCarpetRenderer
|
20
20
|
|
data/markdpwn.gemspec
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: markdpwn 0.
|
5
|
+
# stub: markdpwn 0.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "markdpwn"
|
9
|
-
s.version = "0.
|
8
|
+
s.name = "markdpwn".freeze
|
9
|
+
s.version = "0.3.0"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["Victor Costan"]
|
14
|
-
s.date = "
|
15
|
-
s.description = "HTML-formats text documents such as Markdown, textile, and source code"
|
16
|
-
s.email = "victor@costan.us"
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Victor Costan".freeze]
|
14
|
+
s.date = "2017-05-15"
|
15
|
+
s.description = "HTML-formats text documents such as Markdown, textile, and source code".freeze
|
16
|
+
s.email = "victor@costan.us".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.markdown"
|
@@ -49,57 +49,57 @@ Gem::Specification.new do |s|
|
|
49
49
|
"test/markdpwn/dpwn_test.rb",
|
50
50
|
"test/markdpwn_test.rb"
|
51
51
|
]
|
52
|
-
s.homepage = "http://github.com/pwnall/markdpwn"
|
53
|
-
s.licenses = ["MIT"]
|
54
|
-
s.rubygems_version = "2.
|
55
|
-
s.summary = "HTML-formats text documents such as Markdown, textile, and source code"
|
52
|
+
s.homepage = "http://github.com/pwnall/markdpwn".freeze
|
53
|
+
s.licenses = ["MIT".freeze]
|
54
|
+
s.rubygems_version = "2.6.10".freeze
|
55
|
+
s.summary = "HTML-formats text documents such as Markdown, textile, and source code".freeze
|
56
56
|
|
57
57
|
if s.respond_to? :specification_version then
|
58
58
|
s.specification_version = 4
|
59
59
|
|
60
60
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
-
s.add_runtime_dependency(%q<pygments.rb
|
62
|
-
s.add_runtime_dependency(%q<asciidoctor
|
63
|
-
s.add_runtime_dependency(%q<github-markup
|
64
|
-
s.add_runtime_dependency(%q<redcarpet
|
65
|
-
s.add_runtime_dependency(%q<RedCloth
|
66
|
-
s.add_runtime_dependency(%q<org-ruby
|
67
|
-
s.add_runtime_dependency(%q<creole
|
68
|
-
s.add_runtime_dependency(%q<wikicloth
|
69
|
-
s.add_development_dependency(%q<minitest
|
70
|
-
s.add_development_dependency(%q<yard
|
71
|
-
s.add_development_dependency(%q<bundler
|
72
|
-
s.add_development_dependency(%q<jeweler
|
73
|
-
s.add_development_dependency(%q<simplecov
|
61
|
+
s.add_runtime_dependency(%q<pygments.rb>.freeze, [">= 1.1.2"])
|
62
|
+
s.add_runtime_dependency(%q<asciidoctor>.freeze, [">= 1.5.5"])
|
63
|
+
s.add_runtime_dependency(%q<github-markup>.freeze, [">= 1.6.0"])
|
64
|
+
s.add_runtime_dependency(%q<redcarpet>.freeze, [">= 3.4.0"])
|
65
|
+
s.add_runtime_dependency(%q<RedCloth>.freeze, [">= 4.3.2"])
|
66
|
+
s.add_runtime_dependency(%q<org-ruby>.freeze, [">= 0.9.12"])
|
67
|
+
s.add_runtime_dependency(%q<creole>.freeze, [">= 0.5.0"])
|
68
|
+
s.add_runtime_dependency(%q<wikicloth>.freeze, [">= 0.8.3"])
|
69
|
+
s.add_development_dependency(%q<minitest>.freeze, [">= 5.4.1"])
|
70
|
+
s.add_development_dependency(%q<yard>.freeze, [">= 0.9.9"])
|
71
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 1.3.5"])
|
72
|
+
s.add_development_dependency(%q<jeweler>.freeze, [">= 2.3.5"])
|
73
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0.14.1"])
|
74
74
|
else
|
75
|
-
s.add_dependency(%q<pygments.rb
|
76
|
-
s.add_dependency(%q<asciidoctor
|
77
|
-
s.add_dependency(%q<github-markup
|
78
|
-
s.add_dependency(%q<redcarpet
|
79
|
-
s.add_dependency(%q<RedCloth
|
80
|
-
s.add_dependency(%q<org-ruby
|
81
|
-
s.add_dependency(%q<creole
|
82
|
-
s.add_dependency(%q<wikicloth
|
83
|
-
s.add_dependency(%q<minitest
|
84
|
-
s.add_dependency(%q<yard
|
85
|
-
s.add_dependency(%q<bundler
|
86
|
-
s.add_dependency(%q<jeweler
|
87
|
-
s.add_dependency(%q<simplecov
|
75
|
+
s.add_dependency(%q<pygments.rb>.freeze, [">= 1.1.2"])
|
76
|
+
s.add_dependency(%q<asciidoctor>.freeze, [">= 1.5.5"])
|
77
|
+
s.add_dependency(%q<github-markup>.freeze, [">= 1.6.0"])
|
78
|
+
s.add_dependency(%q<redcarpet>.freeze, [">= 3.4.0"])
|
79
|
+
s.add_dependency(%q<RedCloth>.freeze, [">= 4.3.2"])
|
80
|
+
s.add_dependency(%q<org-ruby>.freeze, [">= 0.9.12"])
|
81
|
+
s.add_dependency(%q<creole>.freeze, [">= 0.5.0"])
|
82
|
+
s.add_dependency(%q<wikicloth>.freeze, [">= 0.8.3"])
|
83
|
+
s.add_dependency(%q<minitest>.freeze, [">= 5.4.1"])
|
84
|
+
s.add_dependency(%q<yard>.freeze, [">= 0.9.9"])
|
85
|
+
s.add_dependency(%q<bundler>.freeze, [">= 1.3.5"])
|
86
|
+
s.add_dependency(%q<jeweler>.freeze, [">= 2.3.5"])
|
87
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0.14.1"])
|
88
88
|
end
|
89
89
|
else
|
90
|
-
s.add_dependency(%q<pygments.rb
|
91
|
-
s.add_dependency(%q<asciidoctor
|
92
|
-
s.add_dependency(%q<github-markup
|
93
|
-
s.add_dependency(%q<redcarpet
|
94
|
-
s.add_dependency(%q<RedCloth
|
95
|
-
s.add_dependency(%q<org-ruby
|
96
|
-
s.add_dependency(%q<creole
|
97
|
-
s.add_dependency(%q<wikicloth
|
98
|
-
s.add_dependency(%q<minitest
|
99
|
-
s.add_dependency(%q<yard
|
100
|
-
s.add_dependency(%q<bundler
|
101
|
-
s.add_dependency(%q<jeweler
|
102
|
-
s.add_dependency(%q<simplecov
|
90
|
+
s.add_dependency(%q<pygments.rb>.freeze, [">= 1.1.2"])
|
91
|
+
s.add_dependency(%q<asciidoctor>.freeze, [">= 1.5.5"])
|
92
|
+
s.add_dependency(%q<github-markup>.freeze, [">= 1.6.0"])
|
93
|
+
s.add_dependency(%q<redcarpet>.freeze, [">= 3.4.0"])
|
94
|
+
s.add_dependency(%q<RedCloth>.freeze, [">= 4.3.2"])
|
95
|
+
s.add_dependency(%q<org-ruby>.freeze, [">= 0.9.12"])
|
96
|
+
s.add_dependency(%q<creole>.freeze, [">= 0.5.0"])
|
97
|
+
s.add_dependency(%q<wikicloth>.freeze, [">= 0.8.3"])
|
98
|
+
s.add_dependency(%q<minitest>.freeze, [">= 5.4.1"])
|
99
|
+
s.add_dependency(%q<yard>.freeze, [">= 0.9.9"])
|
100
|
+
s.add_dependency(%q<bundler>.freeze, [">= 1.3.5"])
|
101
|
+
s.add_dependency(%q<jeweler>.freeze, [">= 2.3.5"])
|
102
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0.14.1"])
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
data/test/markdpwn/code_test.rb
CHANGED
@@ -5,99 +5,94 @@ describe Markdpwn::Code do
|
|
5
5
|
describe 'with view.html.erb' do
|
6
6
|
let :result do
|
7
7
|
Markdpwn::Code.render code_fixture('view.html.erb'),
|
8
|
-
:
|
8
|
+
file_name: 'view.html.erb'
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
it 'is wrapped in a <div> with the markdpwn-parsed-code class' do
|
12
|
-
result.must_match
|
12
|
+
result.must_match(/\A<div class="markdpwn-parsed-code">.*<\/div>\Z/m)
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it 'includes a parsed <h1> tag' do
|
16
|
-
result.must_match '<span class="nt"
|
16
|
+
result.must_match '<span class="nt">h1</span>'
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
it 'includes a parsed :partial symbol' do
|
20
20
|
result.must_match '<span class="ss">:partial</span>'
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
describe '#pygment return value' do
|
26
26
|
describe 'with ruby code' do
|
27
27
|
let :result do
|
28
|
-
Markdpwn::Code.pygment ":symbol => 'string'", :
|
28
|
+
Markdpwn::Code.pygment ":symbol => 'string'", language: 'ruby'
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
it 'includes a parsed symbol' do
|
32
32
|
result.must_match '<span class="ss">:symbol</span>'
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
it 'does not contain a <div>' do
|
36
36
|
result.wont_match '<div'
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
it 'does not contain a <pre>' do
|
40
40
|
result.wont_match '<pre'
|
41
41
|
end
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
describe 'with view.html.erb' do
|
45
45
|
let :result do
|
46
46
|
Markdpwn::Code.pygment code_fixture('view.html.erb'),
|
47
|
-
:
|
47
|
+
file_name: 'view.html.erb'
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
it 'includes a parsed <h1> tag' do
|
51
|
-
result.must_match '<span class="nt"
|
51
|
+
result.must_match '<span class="nt">h1</span>'
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
it 'includes a parsed :partial symbol' do
|
55
55
|
result.must_match '<span class="ss">:partial</span>'
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
describe '#pygments_lexer' do
|
61
61
|
describe 'with :mime_type' do
|
62
62
|
it 'returns rb for text/x-ruby' do
|
63
|
-
Markdpwn::Code.pygments_lexer(:
|
64
|
-
must_equal 'rb'
|
63
|
+
Markdpwn::Code.pygments_lexer(mime_type: 'text/x-ruby').must_equal 'rb'
|
65
64
|
end
|
66
65
|
|
67
66
|
it 'returns nil for application/random-mime' do
|
68
|
-
Markdpwn::Code.pygments_lexer(:
|
69
|
-
|
67
|
+
Markdpwn::Code.pygments_lexer(mime_type: 'application/random-mime').
|
68
|
+
must_be_nil
|
70
69
|
end
|
71
70
|
end
|
72
|
-
|
71
|
+
|
73
72
|
describe 'with :file_name' do
|
74
73
|
it 'returns rb for x.rb' do
|
75
|
-
Markdpwn::Code.pygments_lexer(:
|
76
|
-
must_equal 'rb'
|
74
|
+
Markdpwn::Code.pygments_lexer(file_name: 'x.rb').must_equal 'rb'
|
77
75
|
end
|
78
76
|
|
79
77
|
it 'returns nil for x.random-ext' do
|
80
|
-
Markdpwn::Code.pygments_lexer(:
|
81
|
-
must_equal nil
|
78
|
+
Markdpwn::Code.pygments_lexer(file_name: 'x.random-ext').must_be_nil
|
82
79
|
end
|
83
80
|
end
|
84
|
-
|
81
|
+
|
85
82
|
describe 'with :language' do
|
86
83
|
it 'returns rb for ruby' do
|
87
|
-
Markdpwn::Code.pygments_lexer(:
|
88
|
-
must_equal 'rb'
|
84
|
+
Markdpwn::Code.pygments_lexer(language: 'ruby').must_equal 'rb'
|
89
85
|
end
|
90
86
|
|
91
87
|
it 'returns nil for random-lang' do
|
92
|
-
Markdpwn::Code.pygments_lexer(:
|
93
|
-
must_equal nil
|
88
|
+
Markdpwn::Code.pygments_lexer(language: 'random-lang').must_be_nil
|
94
89
|
end
|
95
90
|
end
|
96
|
-
|
91
|
+
|
97
92
|
describe 'with :code' do
|
98
|
-
it 'returns html+erb or
|
99
|
-
|
100
|
-
|
93
|
+
it 'returns rhtml, html+erb or html+ruby view.html.erb' do
|
94
|
+
%w(rhtml html+erb html+ruby).must_include(
|
95
|
+
Markdpwn::Code.pygments_lexer(code: code_fixture('view.html.erb')))
|
101
96
|
end
|
102
97
|
end
|
103
98
|
end
|
data/test/markdpwn/docs_test.rb
CHANGED
@@ -10,33 +10,33 @@ describe Markdpwn::Docs do
|
|
10
10
|
Markdpwn::Docs.gh_markup code_fixture("readme#{ext}"),
|
11
11
|
:file_name => "readme#{ext}"
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
it 'includes a heading' do
|
15
|
-
result.must_match
|
15
|
+
result.must_match(/<h2[^>]*>.*List.*<\/h2>/m)
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
it 'includes a list item' do
|
19
|
-
result.must_match
|
19
|
+
result.must_match(/<li>.*Eggs.*<\/li>/m)
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
it 'is not wrapped in a <div>' do
|
23
|
-
result.wont_match '<
|
23
|
+
result.wont_match '<div'
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
it 'does not contain a <pre>' do
|
27
27
|
result.wont_match '<pre'
|
28
28
|
end
|
29
29
|
end
|
30
|
-
end
|
31
|
-
|
30
|
+
end
|
31
|
+
|
32
32
|
describe 'with view.html.erb' do
|
33
33
|
let :result do
|
34
34
|
Markdpwn::Docs.gh_markup code_fixture('view.html.erb'),
|
35
|
-
:file_name => 'view.html.erb'
|
35
|
+
:file_name => 'view.html.erb'
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
it 'is nil' do
|
39
|
-
result.
|
39
|
+
result.must_be_nil
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/test/markdpwn/dpwn_test.rb
CHANGED
@@ -6,15 +6,15 @@ describe Markdpwn::Dpwn do
|
|
6
6
|
let :result do
|
7
7
|
Markdpwn::Dpwn.render code_fixture("readme.md")
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
it 'includes a heading' do
|
11
|
-
result.must_match
|
11
|
+
result.must_match(/<h2[^>]*>.*List.*<\/h2>/m)
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
it 'includes a list item' do
|
15
|
-
result.must_match
|
15
|
+
result.must_match(/<li>.*Eggs.*<\/li>/m)
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
it 'includes a parsed symbol' do
|
19
19
|
result.must_match '<span class="ss">:symbol</span>'
|
20
20
|
end
|
data/test/markdpwn_test.rb
CHANGED
@@ -6,7 +6,7 @@ describe Markdpwn do
|
|
6
6
|
let :result do
|
7
7
|
Markdpwn.markup code_fixture("readme.md"), :file_name => 'readme.md'
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
it 'includes a parsed <h1> tag' do
|
11
11
|
result.must_match '<span class="nt"><h1></span>'
|
12
12
|
end
|
@@ -15,21 +15,21 @@ describe Markdpwn do
|
|
15
15
|
result.must_match '<span class="ss">:partial</span>'
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
describe "with the readme.textile fixture" do
|
20
20
|
let :result do
|
21
21
|
Markdpwn.markup code_fixture("readme.textile"),
|
22
22
|
:file_name => 'readme.textile'
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
it 'includes a heading' do
|
26
|
-
result.must_match
|
26
|
+
result.must_match(/<h2[^>]*>.*List.*<\/h2>/m)
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
it 'includes a list item' do
|
30
|
-
result.must_match
|
30
|
+
result.must_match(/<li>.*Eggs.*<\/li>/m)
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
it 'is not wrapped in a <div>' do
|
34
34
|
result.wont_match '<pre'
|
35
35
|
end
|
@@ -40,15 +40,15 @@ describe Markdpwn do
|
|
40
40
|
Markdpwn.markup code_fixture("view.html.erb"),
|
41
41
|
:file_name => 'view.html.erb'
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
it 'is wrapped in a <div> with the markdpwn-parsed-code class' do
|
45
|
-
result.must_match
|
45
|
+
result.must_match(/\A<div class="markdpwn-parsed-code">.*<\/div>\Z/m)
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
it 'includes a parsed <h1> tag' do
|
49
|
-
result.must_match '<span class="nt"
|
49
|
+
result.must_match '<span class="nt">h1</span>'
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
it 'includes a parsed :partial symbol' do
|
53
53
|
result.must_match '<span class="ss">:partial</span>'
|
54
54
|
end
|
@@ -60,7 +60,7 @@ describe Markdpwn do
|
|
60
60
|
let :result do
|
61
61
|
Markdpwn.markdpwn code_fixture("readme.md")
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
it 'includes a parsed <h1> tag' do
|
65
65
|
result.must_match '<span class="nt"><h1></span>'
|
66
66
|
end
|
metadata
CHANGED
@@ -1,197 +1,197 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markdpwn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Costan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pygments.rb
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.1.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: asciidoctor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.5.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.5.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: github-markup
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.6.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.6.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: redcarpet
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
61
|
+
version: 3.4.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.
|
68
|
+
version: 3.4.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: RedCloth
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 4.2
|
75
|
+
version: 4.3.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 4.2
|
82
|
+
version: 4.3.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: org-ruby
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.9.
|
89
|
+
version: 0.9.12
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.9.
|
96
|
+
version: 0.9.12
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: creole
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 0.5.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.5.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: wikicloth
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.8.
|
117
|
+
version: 0.8.3
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.8.
|
124
|
+
version: 0.8.3
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: minitest
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 4.
|
131
|
+
version: 5.4.1
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 4.
|
138
|
+
version: 5.4.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: yard
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.9.9
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.9.9
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: bundler
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: 1.3.5
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 1.3.5
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: jeweler
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.
|
173
|
+
version: 2.3.5
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 2.
|
180
|
+
version: 2.3.5
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: simplecov
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- -
|
185
|
+
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
187
|
+
version: 0.14.1
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
194
|
+
version: 0.14.1
|
195
195
|
description: HTML-formats text documents such as Markdown, textile, and source code
|
196
196
|
email: victor@costan.us
|
197
197
|
executables: []
|
@@ -200,8 +200,8 @@ extra_rdoc_files:
|
|
200
200
|
- LICENSE.txt
|
201
201
|
- README.markdown
|
202
202
|
files:
|
203
|
-
- .document
|
204
|
-
- .project
|
203
|
+
- ".document"
|
204
|
+
- ".project"
|
205
205
|
- Gemfile
|
206
206
|
- Gemfile.lock
|
207
207
|
- LICENSE.txt
|
@@ -239,17 +239,17 @@ require_paths:
|
|
239
239
|
- lib
|
240
240
|
required_ruby_version: !ruby/object:Gem::Requirement
|
241
241
|
requirements:
|
242
|
-
- -
|
242
|
+
- - ">="
|
243
243
|
- !ruby/object:Gem::Version
|
244
244
|
version: '0'
|
245
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
246
246
|
requirements:
|
247
|
-
- -
|
247
|
+
- - ">="
|
248
248
|
- !ruby/object:Gem::Version
|
249
249
|
version: '0'
|
250
250
|
requirements: []
|
251
251
|
rubyforge_project:
|
252
|
-
rubygems_version: 2.
|
252
|
+
rubygems_version: 2.6.10
|
253
253
|
signing_key:
|
254
254
|
specification_version: 4
|
255
255
|
summary: HTML-formats text documents such as Markdown, textile, and source code
|