sixarm_ruby_markdown 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9ba8590ac0d2bd4b5794190e2c570d45a239ca642f490ef81b20fc5b2f205de6
4
+ data.tar.gz: aaf32b72afcfec851c5eb51870207c897dc896e2aef3428e24caa33764d80767
5
+ SHA512:
6
+ metadata.gz: 3fcf8f64f0571e4d4818575944bc407e659f2b138a0bd11dea38fb4bd9e9b1115f62e1c9aede2b1c13928691d56162dc3d8272deb1281d4273d02d094fc9b34b
7
+ data.tar.gz: 0b4de1f52e4bfabe4c4a9b8dba29b95caa4c16b8c0056833b483b3864084ec0c35320a63eabd158f9e18da12dd0f94d9b717ac6fc16a914a92da4b0e96fdd7b4
checksums.yaml.gz.sig ADDED
Binary file
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "rake"
3
+ require "rake/testtask"
4
+
5
+ task :default => [:test]
6
+
7
+ Rake::TestTask.new(:test) do |t|
8
+ t.libs.push("lib", "test")
9
+ t.pattern = "test/**/*.rb"
10
+ end
@@ -0,0 +1,13 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin rdoc
3
+ =end
4
+
5
+ module SixArm; module Markdown; end; end
6
+
7
+ class SixArm::Markdown::File < ::File
8
+
9
+ def slurp
10
+ SixArm::Markdown::String.new(read.scrub)
11
+ end
12
+
13
+ end
@@ -0,0 +1,17 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin rdoc
3
+ =end
4
+
5
+ module SixArm; module Markdown; end; end
6
+
7
+ class SixArm::Markdown::Headline < OpenStruct
8
+
9
+ def link
10
+ "[#{text}](##{anchor})"
11
+ end
12
+
13
+ def anchor
14
+ text.downcase.gsub(/\W+/,'-')
15
+ end
16
+
17
+ end
@@ -0,0 +1,8 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin rdoc
3
+ =end
4
+
5
+ module SixArm; module Markdown; end; end
6
+
7
+ class SixArm::Markdown::String < ::String
8
+ end
@@ -0,0 +1,11 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin rdoc
3
+ Please see README
4
+ =end
5
+
6
+ require "ostruct"
7
+ require "sixarm_ruby_file_rewrite"
8
+
9
+ require_relative "sixarm_ruby_markdown/sixarm/markdown/headline"
10
+ require_relative "sixarm_ruby_markdown/sixarm/markdown/file"
11
+ require_relative "sixarm_ruby_markdown/sixarm/markdown/string"
@@ -0,0 +1,31 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "sixarm_ruby_markdown_test"
3
+
4
+ describe SixArm::Markdown::File do
5
+
6
+ let(:dir){ File.expand_path File.dirname(__FILE__) }
7
+ let(:file_path){ dir + "tempfile"}
8
+ let(:text){ "foo" }
9
+
10
+ describe "#slurp" do
11
+
12
+ before do
13
+ file = SixArm::Markdown::File.new(file_path, "w")
14
+ file.write(text)
15
+ file.close
16
+ end
17
+
18
+ it "read and scrub, and return a Markdown::String" do
19
+ file = SixArm::Markdown::File.new(file_path)
20
+ s = file.slurp
21
+ expect(s).must_equal text
22
+ expect(s).must_be_kind_of SixArm::Markdown::String
23
+ end
24
+
25
+ after do
26
+ File.delete(file_path)
27
+ end
28
+
29
+ end
30
+
31
+ end
@@ -0,0 +1,42 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "sixarm_ruby_markdown_test"
3
+
4
+ describe SixArm::Markdown::Headline do
5
+
6
+ let(:level){ 3 }
7
+ let(:text){ "Hello World" }
8
+ let(:headline){ SixArm::Markdown::Headline.new(level: level, text: text) }
9
+
10
+ describe "#level" do
11
+
12
+ it "return level" do
13
+ expect(headline.level).must_equal level
14
+ end
15
+
16
+ end
17
+
18
+ describe "#text" do
19
+
20
+ it "return text" do
21
+ expect(headline.text).must_equal text
22
+ end
23
+
24
+ end
25
+
26
+ describe "#anchor" do
27
+
28
+ it "return anchor, which is the text as lowercase, and replacing every run of non-word characters with a dash" do
29
+ expect(headline.anchor).must_equal "hello-world"
30
+ end
31
+
32
+ end
33
+
34
+ describe "#link" do
35
+
36
+ it "return link, which is the Markdown formatting of the text and anchor" do
37
+ expect(headline.link).must_equal "[Hello World](#hello-world)"
38
+ end
39
+
40
+ end
41
+
42
+ end
@@ -0,0 +1,14 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "sixarm_ruby_markdown_test"
3
+
4
+ describe SixArm::Markdown::String do
5
+
6
+ describe "#new" do
7
+
8
+ it "ok" do
9
+ expect(SixArm::Markdown::String.new).must_be_kind_of(SixArm::Markdown::String)
10
+ end
11
+
12
+ end
13
+
14
+ end
@@ -0,0 +1,12 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "minitest/autorun"
3
+ #require "minitest/benchmark" if ENV["BENCH"]
4
+ require "coveralls"
5
+ require "simplecov"
6
+ Coveralls.wear!
7
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
8
+ SimpleCov::Formatter::HTMLFormatter,
9
+ Coveralls::SimpleCov::Formatter
10
+ ])
11
+ SimpleCov.start
12
+ require "sixarm_ruby_markdown"
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,217 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sixarm_ruby_markdown
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - SixArm
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIFPDCCAyQCCQDx7Y5LWGuPPzANBgkqhkiG9w0BAQsFADBgMQswCQYDVQQGEwJV
14
+ UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEP
15
+ MA0GA1UECgwGU2l4QXJtMRMwEQYDVQQDDApzaXhhcm0uY29tMB4XDTE4MDExMzIy
16
+ NDYyM1oXDTIwMTAwOTIyNDYyM1owYDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNh
17
+ bGl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yEJkh4+xlE72a
33
+ D8Eu8NFr9Tt5lHWXdZBI5BhzhQxPPxeIuw0wZ3+kiwxRie7K4XhKsOIrPmu2i6QV
34
+ Yl/663wZgWpqrroSnc3PE3lsuTW7quUvayjtqMTU2qrh7i21oB+/Nn+I6gcxYJZb
35
+ UlK+tvsqoM94U6sFTjw9mDt62MLQGrJtHShS+ZZiGmWj1sKreuwGJnCVDoBk15xa
36
+ oqlvfvLAMBCqlfrHhvGUfbIMgzb9uXNmCjzYMsQxuIgF6IMis6Kq02NBAR91HPMe
37
+ 2RoY7CdBHMxW+O0tgS2xoQbOwb+ti1j4MbsWpCqS9Mteck0Z7jZpRRrUDjXU+/7Z
38
+ RmW9HX0oLIoCBDChCcEKG0Ma4IvHUgjv47f5iYpkXuhifiK4xMG/s+T5Euw3Wg9J
39
+ tzpk/VnZXj7Ek/earx+N/Z+Wtnl2xENm5IF8SFPeI1HFa9NH47pqtxF1YKpNIEVc
40
+ 2xa2BNHSePe7tys/2hbmZuyMu8X5ERmovsabSXB3a+YwtJh5c2jhA21wF7986s0q
41
+ -----END CERTIFICATE-----
42
+ date: 2018-02-11 00:00:00.000000000 Z
43
+ dependencies:
44
+ - !ruby/object:Gem::Dependency
45
+ name: sixarm_ruby_file_rewrite
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '1'
51
+ - - "<"
52
+ - !ruby/object:Gem::Version
53
+ version: '2'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '1'
61
+ - - "<"
62
+ - !ruby/object:Gem::Version
63
+ version: '2'
64
+ - !ruby/object:Gem::Dependency
65
+ name: minitest
66
+ requirement: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 5.7.0
71
+ - - "<"
72
+ - !ruby/object:Gem::Version
73
+ version: '6'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 5.7.0
81
+ - - "<"
82
+ - !ruby/object:Gem::Version
83
+ version: '6'
84
+ - !ruby/object:Gem::Dependency
85
+ name: sixarm_ruby_minitest_extensions
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 1.0.8
91
+ - - "<"
92
+ - !ruby/object:Gem::Version
93
+ version: '2'
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 1.0.8
101
+ - - "<"
102
+ - !ruby/object:Gem::Version
103
+ version: '2'
104
+ - !ruby/object:Gem::Dependency
105
+ name: rake
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">"
109
+ - !ruby/object:Gem::Version
110
+ version: 10.4.2
111
+ - - "<"
112
+ - !ruby/object:Gem::Version
113
+ version: '11'
114
+ type: :development
115
+ prerelease: false
116
+ version_requirements: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">"
119
+ - !ruby/object:Gem::Version
120
+ version: 10.4.2
121
+ - - "<"
122
+ - !ruby/object:Gem::Version
123
+ version: '11'
124
+ - !ruby/object:Gem::Dependency
125
+ name: simplecov
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 0.10.0
131
+ - - "<"
132
+ - !ruby/object:Gem::Version
133
+ version: '2'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: 0.10.0
141
+ - - "<"
142
+ - !ruby/object:Gem::Version
143
+ version: '2'
144
+ - !ruby/object:Gem::Dependency
145
+ name: coveralls
146
+ requirement: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: 0.8.2
151
+ - - "<"
152
+ - !ruby/object:Gem::Version
153
+ version: '2'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 0.8.2
161
+ - - "<"
162
+ - !ruby/object:Gem::Version
163
+ version: '2'
164
+ description: Markdown general purpose classes
165
+ email: sixarm@sixarm.com
166
+ executables: []
167
+ extensions: []
168
+ extra_rdoc_files: []
169
+ files:
170
+ - Rakefile
171
+ - lib/sixarm_ruby_markdown.rb
172
+ - lib/sixarm_ruby_markdown/sixarm/markdown/file.rb
173
+ - lib/sixarm_ruby_markdown/sixarm/markdown/headline.rb
174
+ - lib/sixarm_ruby_markdown/sixarm/markdown/string.rb
175
+ - test/sixarm_ruby_markdown_test.rb
176
+ - test/sixarm_ruby_markdown_test/sixarm/markdown/file_test.rb
177
+ - test/sixarm_ruby_markdown_test/sixarm/markdown/headline_test.rb
178
+ - test/sixarm_ruby_markdown_test/sixarm/markdown/string_test.rb
179
+ homepage: http://sixarm.com/
180
+ licenses:
181
+ - Apache-2.0
182
+ - Artistic-2.0
183
+ - BSD-3-Clause
184
+ - CC-BY-NC-SA-4.0
185
+ - AGPL-3.0
186
+ - GPL-2.0
187
+ - GPL-3.0
188
+ - LGPL-3.0
189
+ - MIT
190
+ - MPL-2.0
191
+ - Ruby
192
+ metadata: {}
193
+ post_install_message:
194
+ rdoc_options: []
195
+ require_paths:
196
+ - lib
197
+ required_ruby_version: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '2.2'
202
+ required_rubygems_version: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ requirements: []
208
+ rubyforge_project:
209
+ rubygems_version: 2.7.3
210
+ signing_key:
211
+ specification_version: 4
212
+ summary: SixArm.com → Ruby → Markdown
213
+ test_files:
214
+ - test/sixarm_ruby_markdown_test.rb
215
+ - test/sixarm_ruby_markdown_test/sixarm/markdown/file_test.rb
216
+ - test/sixarm_ruby_markdown_test/sixarm/markdown/headline_test.rb
217
+ - test/sixarm_ruby_markdown_test/sixarm/markdown/string_test.rb
metadata.gz.sig ADDED
Binary file