appium_doc_lint 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/lib/appium_doc_lint/lint/ext_missing.rb +16 -3
- data/lib/appium_doc_lint/version.rb +2 -2
- data/release_notes.md +6 -0
- data/spec/lint_spec.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7db3e1b388facaa63c87131d99f10ed6ce96bb20
|
4
|
+
data.tar.gz: 20d1a901aff559fe701668df86680718ce8043b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9deecffaf2b9893cba1a43b044fa1d5aa368c32b2cf1df52cfd10dafccccccdf5c9ad593751727480e1f87058b718a449a3fa40bd10bf8975e37ce69283a498d
|
7
|
+
data.tar.gz: 35caf3baca6118ba6aa4360f1249cbfb1a82271db05361f5f77be410e1355a96eb2e80db295ec1c340b822ec21df57a105c16e296ccbd126964b75e6e58bb300
|
@@ -13,19 +13,23 @@ module Appium
|
|
13
13
|
input.lines.each_with_index do |line, index|
|
14
14
|
# regex from github.com/appium/api-docs/lib/api_docs.rb
|
15
15
|
# /(?<!!) -- negative look behind. excludes image links
|
16
|
-
|
16
|
+
|
17
|
+
match_data = line.match(/(?<!!) \[ ( [^\[]* ) \] \( ( [^)]+ ) \)/x)
|
17
18
|
next unless match_data # skip nil matches
|
18
19
|
full = match_data[0]
|
19
20
|
link_text = match_data[1]
|
20
21
|
link_target = match_data[2]
|
21
22
|
|
23
|
+
# process docs/en/filename.md#testing links
|
24
|
+
link_target = trim_link link_target
|
25
|
+
|
22
26
|
if link_target && !link_target.include?('/')
|
23
27
|
ext = File.extname link_target
|
24
|
-
if ext
|
28
|
+
if invalid_ext?(ext, link_target)
|
25
29
|
warn index, full
|
26
30
|
else
|
27
31
|
ext, hash = ext.split '#'
|
28
|
-
warn index, full if ext
|
32
|
+
warn index, full if invalid_ext?(ext, link_target)
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
@@ -33,6 +37,15 @@ module Appium
|
|
33
37
|
warnings
|
34
38
|
end
|
35
39
|
|
40
|
+
def invalid_ext? ext, link_target
|
41
|
+
ext.empty? && ! link_target.end_with?('/')
|
42
|
+
end
|
43
|
+
|
44
|
+
def trim_link link_target
|
45
|
+
trim = link_target.start_with?('docs/') && ! link_target.end_with?('/')
|
46
|
+
trim ? File.basename(link_target) : link_target
|
47
|
+
end
|
48
|
+
|
36
49
|
FAIL = 'Relative markdown links must have an extension'
|
37
50
|
|
38
51
|
def fail
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
class Lint
|
3
|
-
VERSION = '0.0.
|
4
|
-
DATE = '2014-04-
|
3
|
+
VERSION = '0.0.8' unless defined? ::Appium::Lint::VERSION
|
4
|
+
DATE = '2014-04-27' unless defined? ::Appium::Lint::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
#### v0.0.7 2014-04-26
|
2
|
+
|
3
|
+
- [9a9eaa9](https://github.com/appium/appium_doc_lint/commit/9a9eaa9854c2f16409d06333b120937995a42af0) Release 0.0.7
|
4
|
+
- [2499981](https://github.com/appium/appium_doc_lint/commit/24999811c3e9a65a84fe720f0731615e06512918) Default encoding to UTF_8
|
5
|
+
|
6
|
+
|
1
7
|
#### v0.0.6 2014-04-26
|
2
8
|
|
3
9
|
- [0007207](https://github.com/appium/appium_doc_lint/commit/000720755c1745d293e09e6ca6099a0d5bd50202) Release 0.0.6
|
data/spec/lint_spec.rb
CHANGED
@@ -291,11 +291,13 @@ markdown--
|
|
291
291
|
[link to read](readme)
|
292
292
|
[ok](ok#ok)
|
293
293
|
[intro](intro#start)
|
294
|
+
[testing](docs/en/ok) en should be .md
|
294
295
|
MARKDOWN
|
295
296
|
rule = ExtMissing.new data: data
|
296
297
|
expected = { 1 => [rule.fail + ' [link to read](readme)'],
|
297
298
|
2 => [rule.fail + ' [ok](ok#ok)'],
|
298
|
-
3 => [rule.fail + ' [intro](intro#start)']
|
299
|
+
3 => [rule.fail + ' [intro](intro#start)'],
|
300
|
+
4 => [rule.fail + ' [testing](docs/en/ok)'] }
|
299
301
|
actual = rule.call
|
300
302
|
|
301
303
|
expect(actual).to eq(expected)
|
@@ -307,6 +309,7 @@ markdown--
|
|
307
309
|
[README](README.md)
|
308
310
|
[intro](intro.md#start)
|
309
311
|
[example](https://example.com/)
|
312
|
+
[testing](docs/en/)
|
310
313
|
MARKDOWN
|
311
314
|
rule = ExtMissing.new data: data
|
312
315
|
expected = {}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_doc_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- code@bootstraponline.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|