middleman-spellcheck 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/middleman-spellcheck/extension.rb +11 -1
- data/lib/middleman-spellcheck/version.rb +1 -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: cc78078d67f2333e29a7b05751aa5bbf08d313d2
|
4
|
+
data.tar.gz: cfd3822f1fccf0007a1336f94b4befe3c48cf794
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d9077b0513f76faffc0d14f8a43548b86b53732520d457d6c60096307b4e317f2299ccdce3625e7dd7db3567e15e9765acf54b79af030338d8d2e9d0e9680ce
|
7
|
+
data.tar.gz: 38d36abde02d9af11b31d6ad9e1fe62226be035e00097dde0ad57f5babba28a9922a88e351045e95bca54fcc552431f2e1417ac00b5d87346ae2984f1e1a829e
|
data/README.md
CHANGED
@@ -36,6 +36,14 @@ If there are some words that you would like to be allowed
|
|
36
36
|
activate :spellcheck, allow: ["Gooby", "pls"]
|
37
37
|
```
|
38
38
|
|
39
|
+
Middleman-spellcheck automatically ignores `.css`, `.js`, & `.coffee` file
|
40
|
+
extensions. If there are some additional file type extensions that you would
|
41
|
+
like to skip:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
activate :spellcheck, ignored_exts: [".xml", ".png"]
|
45
|
+
```
|
46
|
+
|
39
47
|
## Contributing
|
40
48
|
|
41
49
|
1. Fork it
|
@@ -8,6 +8,7 @@ module Middleman
|
|
8
8
|
option :page, "/*", "Run only pages that match the regex through the spellchecker"
|
9
9
|
option :tags, [], "Run spellcheck only on some tags from the output"
|
10
10
|
option :allow, [], "Allow specific words to be misspelled"
|
11
|
+
option :ignored_exts, [], "Ignore specific extensions (ex: '.xml')"
|
11
12
|
|
12
13
|
def after_build(builder)
|
13
14
|
filtered = filter_resources(app, options.page)
|
@@ -56,7 +57,7 @@ module Middleman
|
|
56
57
|
|
57
58
|
def filter_resources(app, pattern)
|
58
59
|
app.sitemap.resources.select { |resource| resource.url.match(pattern) }
|
59
|
-
.reject { |resource|
|
60
|
+
.reject { |resource| option_ignored_exts.include? resource.ext }
|
60
61
|
end
|
61
62
|
|
62
63
|
def run_check(text, dictionary="en")
|
@@ -78,6 +79,15 @@ module Middleman
|
|
78
79
|
allowed.map(&:downcase)
|
79
80
|
end
|
80
81
|
|
82
|
+
def option_ignored_exts
|
83
|
+
ignored_exts = if options.ignored_exts.is_a? Array
|
84
|
+
options.ignored_exts
|
85
|
+
else
|
86
|
+
[options.ignored_exts]
|
87
|
+
end
|
88
|
+
REJECTED_EXTS + ignored_exts
|
89
|
+
end
|
90
|
+
|
81
91
|
def error_message(misspell)
|
82
92
|
"The word '#{misspell[:word]}' is misspelled"
|
83
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-spellcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Zarea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|