appium_doc_lint 0.0.8 → 0.0.9
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 +11 -2
- data/lib/appium_doc_lint/version.rb +1 -1
- data/release_notes.md +7 -0
- data/spec/lint_spec.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf34820e15746a7650f52dd18f56506d191b401
|
4
|
+
data.tar.gz: b86c445e31a5d4cdd56c261d63608ac2fe1844a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04a73f49c502c5b16b9ac0d1e346d7062e092170bdade13858ec84a35d404e7ab353911049488fd24fb6c5700a5533bd174ba697daf93708f25c12bb3b407b9c
|
7
|
+
data.tar.gz: 313669c69f1502bebdc5d33e425ab09d367ada994a9b44851c782e9965cf48fee51ce44acd6e2e8dfafd9d6147cd5d654bf9368713ff1c1fc65af00ca1959eda
|
@@ -23,7 +23,10 @@ module Appium
|
|
23
23
|
# process docs/en/filename.md#testing links
|
24
24
|
link_target = trim_link link_target
|
25
25
|
|
26
|
-
|
26
|
+
no_slash = !link_target.include?('/')
|
27
|
+
not_link_to_self = link_target != '#'
|
28
|
+
|
29
|
+
if link_target && no_slash && not_link_to_self
|
27
30
|
ext = File.extname link_target
|
28
31
|
if invalid_ext?(ext, link_target)
|
29
32
|
warn index, full
|
@@ -37,12 +40,18 @@ module Appium
|
|
37
40
|
warnings
|
38
41
|
end
|
39
42
|
|
43
|
+
# from github.com/appium/api-docs/lib/api_docs.rb
|
40
44
|
def invalid_ext? ext, link_target
|
41
45
|
ext.empty? && ! link_target.end_with?('/')
|
42
46
|
end
|
43
47
|
|
48
|
+
# process docs/en/filename.md#testing links
|
49
|
+
# handle relative links [getting started](../../README.md)
|
44
50
|
def trim_link link_target
|
45
|
-
|
51
|
+
link_target = link_target.strip if link_target
|
52
|
+
return link_target if link_target.end_with?('/')
|
53
|
+
# trim doc and relative
|
54
|
+
trim = link_target.start_with?('docs/') || link_target.start_with?('../')
|
46
55
|
trim ? File.basename(link_target) : link_target
|
47
56
|
end
|
48
57
|
|
data/release_notes.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
#### v0.0.8 2014-04-27
|
2
|
+
|
3
|
+
- [2d3bfe1](https://github.com/appium/appium_doc_lint/commit/2d3bfe186204455c1c19f714748d369345216d75) Release 0.0.8
|
4
|
+
- [2b9a5d1](https://github.com/appium/appium_doc_lint/commit/2b9a5d1b434eb85fb03a1e91930c45b2fd65d4a9) Detect missing links in docs/ folder
|
5
|
+
- [1171ec6](https://github.com/appium/appium_doc_lint/commit/1171ec69632382382cedbf7596dec06aac7f3168) Add link to folder to test
|
6
|
+
|
7
|
+
|
1
8
|
#### v0.0.7 2014-04-26
|
2
9
|
|
3
10
|
- [9a9eaa9](https://github.com/appium/appium_doc_lint/commit/9a9eaa9854c2f16409d06333b120937995a42af0) Release 0.0.7
|
data/spec/lint_spec.rb
CHANGED
@@ -291,7 +291,7 @@ markdown--
|
|
291
291
|
[link to read](readme)
|
292
292
|
[ok](ok#ok)
|
293
293
|
[intro](intro#start)
|
294
|
-
[testing](docs/en/ok)
|
294
|
+
[testing](docs/en/ok) ok should be ok.md
|
295
295
|
MARKDOWN
|
296
296
|
rule = ExtMissing.new data: data
|
297
297
|
expected = { 1 => [rule.fail + ' [link to read](readme)'],
|
@@ -310,6 +310,8 @@ markdown--
|
|
310
310
|
[intro](intro.md#start)
|
311
311
|
[example](https://example.com/)
|
312
312
|
[testing](docs/en/)
|
313
|
+
[getting started doc](../../README.md)
|
314
|
+
[link to self is valid](#)
|
313
315
|
MARKDOWN
|
314
316
|
rule = ExtMissing.new data: data
|
315
317
|
expected = {}
|