middleman-spellcheck 0.7.4 → 0.7.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fa52b15a5b66955ef1adf2ab6f3ed0e33bcf076
4
- data.tar.gz: e54634b42cc2b97fb2642aa0ac64bbce2255df0c
3
+ metadata.gz: cc78078d67f2333e29a7b05751aa5bbf08d313d2
4
+ data.tar.gz: cfd3822f1fccf0007a1336f94b4befe3c48cf794
5
5
  SHA512:
6
- metadata.gz: f19120211c6c22e43c678dc8c886e492d164f14befe88448f77d6080bd868e9f022d1c4522e949f1fb00b92f9f408c398e8d7325ace28e4f2d5027a05e8417f3
7
- data.tar.gz: 667d1ea8c78dacc4e9cf810fee89debf8a119b25bcd8f2e2fda6de943947c28cb6ac48aa6b51e12122be55c2404f6468177034201435af68c6320cc2ef8a8726
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| REJECTED_EXTS.include? resource.ext }
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
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Spellcheck
3
- VERSION = "0.7.4"
3
+ VERSION = "0.7.5"
4
4
  end
5
5
  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
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-21 00:00:00.000000000 Z
11
+ date: 2014-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core