sixarm_ruby_markdown_table_of_contents 2.5.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 026d1ec1149a83109cb777cdf75883b106b70ad4d45ce03e18cd407e9551ba5b
4
- data.tar.gz: b3258c73e7f2667425898e25023f1ef8f37562c1548bd5a1f4619d625030496c
3
+ metadata.gz: be2db9428123abfa3c46fa89f3f0a1a0b4313b7d936c38aaf695017dbb3a1ffa
4
+ data.tar.gz: 754dab8295c53492d597552ecffa2cb03b2634d3288ab18358b1876ba2f84b75
5
5
  SHA512:
6
- metadata.gz: a1c53b2dd35ce9e244f8b03cc72a03d50d975b525239c620bc4960b237a004528e6f945c96e121fa59648e9c86326de1af4c9e3679e59a3d77c7d04aa64c9116
7
- data.tar.gz: 77f5da2352aa747b15ada404d9206537248adf719ac2271d9fda9438d0768361a9514a6bad51526b5817964ee3a607ba6c775b70a3bc89e200e96ca5e7f56905
6
+ metadata.gz: 696b418792fad7ab223331991ac4e7a0143a17da70f48b708555b469f0dc0d67d34f292b6781672270fd0bb09a096a4241d33899636db81e4c6ff27007a47759
7
+ data.tar.gz: d4da882258e32ac2f30f7a8676d45a28b6b98e3773d53c10da0f4da6b157640469883ac83cc89c4b8ef2fa18d2556eeced1bede87e29f8359755578ef6d919b3
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,17 +1,36 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "sixarm_ruby_markdown_table_of_contents"
3
+
4
+ def vet_file_path(file_path)
5
+ File.exist?(file_path) or raise ArgumentError.new("File does not exist. File:#{file_path}")
6
+ File.readable?(file_path) or raise ArgumentError.new("File is not readable. File:#{file_path}")
7
+ File.writable?(file_path) or raise ArgumentError.new("File is not writeable. File:#{file_path}")
8
+ end
9
+
10
+ def vet_file_input_markdown(file, md)
11
+ md != nil or raise IOError.new("Input markdown text is nil. File:#{file.path}")
12
+ end
13
+
14
+ def vet_file_output_markdown(file, md)
15
+ md != nil or raise IOError.new("Output markdown text is nil. File:#{file.path}")
16
+ end
17
+
3
18
  begin
4
19
  settings = SixArm::Markdown::TOC::Settings.new
5
20
  settings.option_parsing
6
21
  generator = SixArm::Markdown::TOC::Generator.new(settings: settings)
7
22
  ARGV.each{|markdown_file_path|
23
+ vet_file_path(markdown_file_path)
8
24
  file = SixArm::Markdown::File.new(markdown_file_path)
9
25
  input = file.slurp
26
+ vet_file_input_markdown(file, input)
27
+ p input
10
28
  output = generator.rewrite_toc(input)
29
+ vet_file_output_markdown(file, output)
11
30
  file.rewrite(output)
12
31
  }
13
32
  exit 0
14
33
  rescue
15
- STDERR.puts "Error! " + $!.message
34
+ STDERR.puts "Error!\n\nclass:#{$!.class}\n\nmessage:#{$!.message}\n\n" + $!.backtrace.join("\n")
16
35
  exit 1
17
36
  end
@@ -1,12 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require "minitest/autorun"
3
3
  #require "minitest/benchmark" if ENV["BENCH"]
4
- require "coveralls"
5
4
  require "simplecov"
6
- Coveralls.wear!
7
5
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
8
6
  SimpleCov::Formatter::HTMLFormatter,
9
- Coveralls::SimpleCov::Formatter
10
7
  ])
11
8
  SimpleCov.start
12
9
  require "sixarm_ruby_markdown_table_of_contents"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sixarm_ruby_markdown_table_of_contents
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SixArm
@@ -39,7 +39,7 @@ cert_chain:
39
39
  tzpk/VnZXj7Ek/earx+N/Z+Wtnl2xENm5IF8SFPeI1HFa9NH47pqtxF1YKpNIEVc
40
40
  2xa2BNHSePe7tys/2hbmZuyMu8X5ERmovsabSXB3a+YwtJh5c2jhA21wF7986s0q
41
41
  -----END CERTIFICATE-----
42
- date: 2018-02-16 00:00:00.000000000 Z
42
+ date: 2018-12-23 00:00:00.000000000 Z
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: sixarm_ruby_markdown
@@ -47,47 +47,47 @@ dependencies:
47
47
  requirements:
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 2.1.3
50
+ version: 3.1.0
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '3'
53
+ version: '4'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 2.1.3
60
+ version: 3.1.0
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
- version: '3'
63
+ version: '4'
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: sixarm_ruby_file_rewrite
66
66
  requirement: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: '1'
70
+ version: '2'
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
- version: '2'
73
+ version: '3'
74
74
  type: :runtime
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: '1'
80
+ version: '2'
81
81
  - - "<"
82
82
  - !ruby/object:Gem::Version
83
- version: '2'
83
+ version: '3'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: minitest
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 5.7.0
90
+ version: 5.11.3
91
91
  - - "<"
92
92
  - !ruby/object:Gem::Version
93
93
  version: '6'
@@ -97,7 +97,7 @@ dependencies:
97
97
  requirements:
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
- version: 5.7.0
100
+ version: 5.11.3
101
101
  - - "<"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '6'
@@ -125,29 +125,29 @@ dependencies:
125
125
  name: rake
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - ">"
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: 10.4.2
130
+ version: 12.3.1
131
131
  - - "<"
132
132
  - !ruby/object:Gem::Version
133
- version: '11'
133
+ version: '13'
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ">"
138
+ - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: 10.4.2
140
+ version: 12.3.1
141
141
  - - "<"
142
142
  - !ruby/object:Gem::Version
143
- version: '11'
143
+ version: '13'
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: simplecov
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - ">="
149
149
  - !ruby/object:Gem::Version
150
- version: 0.10.0
150
+ version: 0.16.1
151
151
  - - "<"
152
152
  - !ruby/object:Gem::Version
153
153
  version: '2'
@@ -157,30 +157,110 @@ dependencies:
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: 0.10.0
160
+ version: 0.16.1
161
161
  - - "<"
162
162
  - !ruby/object:Gem::Version
163
163
  version: '2'
164
164
  - !ruby/object:Gem::Dependency
165
- name: coveralls
165
+ name: flog
166
166
  requirement: !ruby/object:Gem::Requirement
167
167
  requirements:
168
168
  - - ">="
169
169
  - !ruby/object:Gem::Version
170
- version: 0.8.2
170
+ version: 4.6.2
171
171
  - - "<"
172
172
  - !ruby/object:Gem::Version
173
- version: '2'
173
+ version: '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: 0.8.2
180
+ version: 4.6.2
181
181
  - - "<"
182
182
  - !ruby/object:Gem::Version
183
- version: '2'
183
+ version: '5'
184
+ - !ruby/object:Gem::Dependency
185
+ name: flay
186
+ requirement: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ version: 2.12.0
191
+ - - "<"
192
+ - !ruby/object:Gem::Version
193
+ version: '3'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: 2.12.0
201
+ - - "<"
202
+ - !ruby/object:Gem::Version
203
+ version: '3'
204
+ - !ruby/object:Gem::Dependency
205
+ name: reek
206
+ requirement: !ruby/object:Gem::Requirement
207
+ requirements:
208
+ - - ">="
209
+ - !ruby/object:Gem::Version
210
+ version: 4.8.1
211
+ - - "<"
212
+ - !ruby/object:Gem::Version
213
+ version: '5'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: 4.8.1
221
+ - - "<"
222
+ - !ruby/object:Gem::Version
223
+ version: '5'
224
+ - !ruby/object:Gem::Dependency
225
+ name: rubycritic
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: 3.4.0
231
+ - - "<"
232
+ - !ruby/object:Gem::Version
233
+ version: '4'
234
+ type: :development
235
+ prerelease: false
236
+ version_requirements: !ruby/object:Gem::Requirement
237
+ requirements:
238
+ - - ">="
239
+ - !ruby/object:Gem::Version
240
+ version: 3.4.0
241
+ - - "<"
242
+ - !ruby/object:Gem::Version
243
+ version: '4'
244
+ - !ruby/object:Gem::Dependency
245
+ name: rubocop
246
+ requirement: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: 0.57.2
251
+ - - "<"
252
+ - !ruby/object:Gem::Version
253
+ version: '1'
254
+ type: :development
255
+ prerelease: false
256
+ version_requirements: !ruby/object:Gem::Requirement
257
+ requirements:
258
+ - - ">="
259
+ - !ruby/object:Gem::Version
260
+ version: 0.57.2
261
+ - - "<"
262
+ - !ruby/object:Gem::Version
263
+ version: '1'
184
264
  description: Generate a Markdown table of contents via headlines, links, and anchors
185
265
  email: sixarm@sixarm.com
186
266
  executables:
@@ -220,7 +300,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
300
  requirements:
221
301
  - - ">="
222
302
  - !ruby/object:Gem::Version
223
- version: '2.2'
303
+ version: '2.5'
224
304
  required_rubygems_version: !ruby/object:Gem::Requirement
225
305
  requirements:
226
306
  - - ">="
@@ -228,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
308
  version: '0'
229
309
  requirements: []
230
310
  rubyforge_project:
231
- rubygems_version: 2.7.6
311
+ rubygems_version: 2.7.8
232
312
  signing_key:
233
313
  specification_version: 4
234
314
  summary: SixArm.com → Ruby → Mardown table of contents
metadata.gz.sig CHANGED
Binary file