appium_doc_lint 0.0.9 → 0.0.10
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/gist.md +25 -0
- data/lib/appium_doc_lint/lint.rb +2 -0
- data/lib/appium_doc_lint/version.rb +2 -2
- data/release_notes.md +9 -0
- data/spec/lint_spec.rb +22 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3637ec9c28dbc012b5bfbdef591c8f0187aedcb2
|
4
|
+
data.tar.gz: 5865887056deb7ddf46cece65c03421ac9f7cc7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ea155206d3033272a894b0df55bf50bcdcab7920afc42716db27e55555533f0759eb62b3bc48bde0253c20eabd094e3a5872a893b0cfb60f03829e26849c27
|
7
|
+
data.tar.gz: c284e9b92a89a3ca9f6076bcb77e9a14a6a65a09c2c0ea37813c67d45a8396fa391b544b3d80f78a4b4789554f6bc539030197adcb6d3e0ded258dceecce605b
|
data/gist.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Detect links that include a hash
|
2
|
+
|
3
|
+
```ruby
|
4
|
+
def scan_for_hash_links
|
5
|
+
pwd = Dir.pwd
|
6
|
+
folder = ''
|
7
|
+
raise 'set folder' unless folder
|
8
|
+
path = File.expand_path(File.join(folder, '**', '*.md'))
|
9
|
+
|
10
|
+
Dir.glob(path) do |file|
|
11
|
+
file = File.expand_path file
|
12
|
+
|
13
|
+
relative_path = file.sub folder, ''
|
14
|
+
|
15
|
+
next if File.directory?(file)
|
16
|
+
data = File.read file
|
17
|
+
|
18
|
+
data.scan(/(?<!!) \[ ( [^\[]* ) \] \( ( [^)]+ ) \)/x).each do |matched|
|
19
|
+
puts "#{relative_path}: #{matched}" if matched.last.include?('.md#')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
scan_for_hash_links
|
25
|
+
```
|
data/lib/appium_doc_lint/lint.rb
CHANGED
@@ -29,6 +29,7 @@ module Appium
|
|
29
29
|
file = opts[:file]
|
30
30
|
raise 'File path must be provided' unless file
|
31
31
|
raise "File must exist and be readable #{file}" unless File.exist?(file) && File.readable?(file)
|
32
|
+
raise 'File must not be a dir' if File.directory?(file)
|
32
33
|
file = File.expand_path(file)
|
33
34
|
|
34
35
|
input.data = File.read(file).freeze
|
@@ -70,6 +71,7 @@ module Appium
|
|
70
71
|
def glob dir_glob
|
71
72
|
results = {}
|
72
73
|
Dir.glob dir_glob do |markdown|
|
74
|
+
next if File.directory?(markdown)
|
73
75
|
markdown = File.expand_path markdown
|
74
76
|
results.merge!(self.call(file: markdown))
|
75
77
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
class Lint
|
3
|
-
VERSION = '0.0.
|
4
|
-
DATE = '2014-
|
3
|
+
VERSION = '0.0.10' unless defined? ::Appium::Lint::VERSION
|
4
|
+
DATE = '2014-07-01' unless defined? ::Appium::Lint::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
#### v0.0.9 2014-04-27
|
2
|
+
|
3
|
+
- [3c4661e](https://github.com/appium/appium_doc_lint/commit/3c4661ebe628ab2b320f77f53b53b537b8c1723e) Release 0.0.9
|
4
|
+
- [0d55946](https://github.com/appium/appium_doc_lint/commit/0d5594616ede92898f49e11605426b16028cbedf) Allow linking to self
|
5
|
+
- [a22a980](https://github.com/appium/appium_doc_lint/commit/a22a980d5b93383c5d737463114551a490ddb877) Update api docs helpers
|
6
|
+
- [238e46d](https://github.com/appium/appium_doc_lint/commit/238e46dee3efcb359240a3a3e66ed58c1c39e3f4) Add valid link to test
|
7
|
+
- [58fa4c9](https://github.com/appium/appium_doc_lint/commit/58fa4c9520ade838a9ebb5c9dfa5cab7fdee1ca3) Update comment
|
8
|
+
|
9
|
+
|
1
10
|
#### v0.0.8 2014-04-27
|
2
11
|
|
3
12
|
- [2d3bfe1](https://github.com/appium/appium_doc_lint/commit/2d3bfe186204455c1c19f714748d369345216d75) Release 0.0.8
|
data/spec/lint_spec.rb
CHANGED
@@ -117,6 +117,28 @@ MARKDOWN
|
|
117
117
|
|
118
118
|
expect(actual).to eq(expected)
|
119
119
|
end
|
120
|
+
|
121
|
+
it 'does not error on code blocks' do
|
122
|
+
data = <<'DATA'
|
123
|
+
# title
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
```
|
127
|
+
|
128
|
+
```ruby
|
129
|
+
```
|
130
|
+
|
131
|
+
Here's a Ruby example:
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
# Ruby example
|
135
|
+
```
|
136
|
+
DATA
|
137
|
+
rule = H1Multiple.new data: data
|
138
|
+
expected = {}
|
139
|
+
actual = rule.call
|
140
|
+
expect(actual).to eq(expected)
|
141
|
+
end
|
120
142
|
end
|
121
143
|
|
122
144
|
describe H1Missing do
|
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.10
|
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-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- Rakefile
|
69
69
|
- appium_doc_lint.gemspec
|
70
70
|
- bin/appium_doc_lint
|
71
|
+
- gist.md
|
71
72
|
- lib/appium_doc_lint.rb
|
72
73
|
- lib/appium_doc_lint/lint.rb
|
73
74
|
- lib/appium_doc_lint/lint/base.rb
|