mdspell 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/mdspell/cli.rb +1 -1
- data/lib/mdspell/text_line.rb +11 -9
- data/lib/mdspell/typo.rb +3 -3
- data/lib/mdspell/version.rb +1 -3
- data/spec/examples.cache +46 -46
- data/spec/mdspell/spell_checker_spec.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9e742f047498234b1aba8292424a95463daa22b
|
4
|
+
data.tar.gz: 8a075a15c2d2a7cd358c40fe712fbf3d103b502a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f950d2148aae2c9d019879064b58a9cdbf3f1a9d20abe2901f08d0a1a22ea7f265a2fc1934979ef58eae472e44765de9eaaa51a8e44cbac91da9cf8fa3a638b5
|
7
|
+
data.tar.gz: fe65fa538ee5281ff19435cc22c6838d1c4b40b54a38a295b7104051aee1471e3f296b3dc56d1e880769af4c47148d94f07838daf9afb0d63f37be205b70f0e6
|
data/README.md
CHANGED
@@ -9,6 +9,8 @@ https://codeclimate.com/github/mtuchowski/mdspell)
|
|
9
9
|
https://codeclimate.com/github/mtuchowski/mdspell/coverage)
|
10
10
|
[![Inline docs](http://inch-ci.org/github/mtuchowski/mdspell.svg?branch=master)](
|
11
11
|
http://inch-ci.org/github/mtuchowski/mdspell)
|
12
|
+
[![Dependency Status](https://gemnasium.com/mtuchowski/mdspell.svg)](
|
13
|
+
https://gemnasium.com/mtuchowski/mdspell)
|
12
14
|
|
13
15
|
A Ruby markdown spell checking tool.
|
14
16
|
|
data/lib/mdspell/cli.rb
CHANGED
data/lib/mdspell/text_line.rb
CHANGED
@@ -4,7 +4,7 @@ module MdSpell
|
|
4
4
|
# Containing concatenated text from single document line.
|
5
5
|
class TextLine
|
6
6
|
# Accepted types of elements.
|
7
|
-
ELEMENT_TYPES = [:text, :smart_quote]
|
7
|
+
ELEMENT_TYPES = [:text, :smart_quote].freeze
|
8
8
|
|
9
9
|
# Line number of the element in document.
|
10
10
|
attr_reader :location
|
@@ -15,7 +15,7 @@ module MdSpell
|
|
15
15
|
# Create a new TextLine from Kramdown::Element object.
|
16
16
|
# @param element [Kramdown::Element]
|
17
17
|
def initialize(element)
|
18
|
-
TextLine.assert_element_type element
|
18
|
+
TextLine.send :assert_element_type, element
|
19
19
|
|
20
20
|
@content = ''
|
21
21
|
@location = element.options[:location]
|
@@ -31,7 +31,7 @@ module MdSpell
|
|
31
31
|
# @param element [Kramdown::Element]
|
32
32
|
# @raise ArgumentError if element is in different location.
|
33
33
|
def <<(element)
|
34
|
-
TextLine.assert_element_type element
|
34
|
+
TextLine.send :assert_element_type, element
|
35
35
|
|
36
36
|
return self unless ELEMENT_TYPES.include? element.type
|
37
37
|
return self unless element.options[:location] == @location
|
@@ -74,11 +74,11 @@ module MdSpell
|
|
74
74
|
return if value.nil? || value.empty?
|
75
75
|
|
76
76
|
value = value.strip
|
77
|
-
if @content.empty? || @content[-1] == "'"
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
@content += if @content.empty? || @content[-1] == "'"
|
78
|
+
value
|
79
|
+
else
|
80
|
+
' ' + value
|
81
|
+
end
|
82
82
|
end
|
83
83
|
|
84
84
|
def appent_quote(type)
|
@@ -93,8 +93,9 @@ module MdSpell
|
|
93
93
|
# Private class methods
|
94
94
|
|
95
95
|
def self.assert_element_type(elem)
|
96
|
-
|
96
|
+
raise ArgumentError, 'expected Kramdown::Element' unless elem.instance_of? Kramdown::Element
|
97
97
|
end
|
98
|
+
private_class_method :assert_element_type
|
98
99
|
|
99
100
|
def self.get_all_textual_elements(elements)
|
100
101
|
result = []
|
@@ -109,5 +110,6 @@ module MdSpell
|
|
109
110
|
|
110
111
|
result
|
111
112
|
end
|
113
|
+
private_class_method :get_all_textual_elements
|
112
114
|
end
|
113
115
|
end
|
data/lib/mdspell/typo.rb
CHANGED
@@ -27,17 +27,17 @@ module MdSpell
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def assert_proper_line_type(line)
|
30
|
-
|
30
|
+
raise ArgumentError, "expected TextLine, got #{line.class.inspect}" unless
|
31
31
|
line.class == TextLine
|
32
32
|
end
|
33
33
|
|
34
34
|
def assert_proper_word_type(word)
|
35
|
-
|
35
|
+
raise ArgumentError, "expected String, got #{word.class.inspect}" unless
|
36
36
|
word.class == String
|
37
37
|
end
|
38
38
|
|
39
39
|
def assert_proper_suggestions_type(suggestions)
|
40
|
-
|
40
|
+
raise ArgumentError, "expected Array, got #{suggestions.class.inspect}" unless
|
41
41
|
suggestions.class == Array
|
42
42
|
end
|
43
43
|
end
|
data/lib/mdspell/version.rb
CHANGED
data/spec/examples.cache
CHANGED
@@ -1,58 +1,58 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
--------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/mdspell/cli_spec.rb[1:1] | passed | 0.
|
4
|
-
./spec/mdspell/cli_spec.rb[1:2] | passed | 0.
|
5
|
-
./spec/mdspell/cli_spec.rb[1:3:1] | passed | 0.
|
6
|
-
./spec/mdspell/cli_spec.rb[1:4:1:1] | passed | 0.
|
7
|
-
./spec/mdspell/cli_spec.rb[1:4:2:1] | passed | 0.
|
8
|
-
./spec/mdspell/cli_spec.rb[1:4:3:1] | passed | 0.
|
9
|
-
./spec/mdspell/configuration_spec.rb[1:1:1] | passed | 0.
|
10
|
-
./spec/mdspell/configuration_spec.rb[1:1:2:1] | passed | 0.
|
11
|
-
./spec/mdspell/configuration_spec.rb[1:1:2:2] | passed | 0.
|
12
|
-
./spec/mdspell/configuration_spec.rb[1:1:3:1] | passed | 0.
|
13
|
-
./spec/mdspell/configuration_spec.rb[1:2:1] | passed | 0.
|
3
|
+
./spec/mdspell/cli_spec.rb[1:1] | passed | 0.00011 seconds |
|
4
|
+
./spec/mdspell/cli_spec.rb[1:2] | passed | 0.00012 seconds |
|
5
|
+
./spec/mdspell/cli_spec.rb[1:3:1] | passed | 0.00016 seconds |
|
6
|
+
./spec/mdspell/cli_spec.rb[1:4:1:1] | passed | 0.00047 seconds |
|
7
|
+
./spec/mdspell/cli_spec.rb[1:4:2:1] | passed | 0.00047 seconds |
|
8
|
+
./spec/mdspell/cli_spec.rb[1:4:3:1] | passed | 0.00172 seconds |
|
9
|
+
./spec/mdspell/configuration_spec.rb[1:1:1] | passed | 0.00031 seconds |
|
10
|
+
./spec/mdspell/configuration_spec.rb[1:1:2:1] | passed | 0.00034 seconds |
|
11
|
+
./spec/mdspell/configuration_spec.rb[1:1:2:2] | passed | 0.00034 seconds |
|
12
|
+
./spec/mdspell/configuration_spec.rb[1:1:3:1] | passed | 0.0004 seconds |
|
13
|
+
./spec/mdspell/configuration_spec.rb[1:2:1] | passed | 0.00031 seconds |
|
14
14
|
./spec/mdspell/configuration_spec.rb[1:2:2:1] | passed | 0.00032 seconds |
|
15
|
-
./spec/mdspell/configuration_spec.rb[1:2:2:2] | passed | 0.
|
16
|
-
./spec/mdspell/configuration_spec.rb[1:3:1] | passed | 0.
|
15
|
+
./spec/mdspell/configuration_spec.rb[1:2:2:2] | passed | 0.00033 seconds |
|
16
|
+
./spec/mdspell/configuration_spec.rb[1:3:1] | passed | 0.00033 seconds |
|
17
17
|
./spec/mdspell/configuration_spec.rb[1:3:2:1] | passed | 0.00031 seconds |
|
18
|
-
./spec/mdspell/configuration_spec.rb[1:3:2:2] | passed | 0.
|
19
|
-
./spec/mdspell/configuration_spec.rb[1:4:1] | passed | 0.
|
20
|
-
./spec/mdspell/configuration_spec.rb[1:4:2:1] | passed | 0.
|
21
|
-
./spec/mdspell/configuration_spec.rb[1:4:2:2] | passed | 0.
|
22
|
-
./spec/mdspell/spell_checker_spec.rb[1:1:1] | passed | 0.
|
23
|
-
./spec/mdspell/spell_checker_spec.rb[1:1:2] | passed | 0.
|
24
|
-
./spec/mdspell/spell_checker_spec.rb[1:1:3] | passed | 0.
|
25
|
-
./spec/mdspell/spell_checker_spec.rb[1:2:1] | passed | 0.
|
26
|
-
./spec/mdspell/spell_checker_spec.rb[1:2:2] | passed | 0.
|
27
|
-
./spec/mdspell/spell_checker_spec.rb[1:2:3] | passed | 0.
|
28
|
-
./spec/mdspell/spell_checker_spec.rb[1:3:1] | passed | 0.
|
29
|
-
./spec/mdspell/spell_checker_spec.rb[1:3:2:1] | passed | 0.
|
30
|
-
./spec/mdspell/spell_checker_spec.rb[1:4:1] | passed | 0.
|
31
|
-
./spec/mdspell/spell_checker_spec.rb[1:5:1] | passed | 0.
|
32
|
-
./spec/mdspell/spell_checker_spec.rb[1:5:2] |
|
33
|
-
./spec/mdspell/spell_checker_spec.rb[1:5:3] |
|
34
|
-
./spec/mdspell/text_line_spec.rb[1:1:1] | passed | 0.
|
35
|
-
./spec/mdspell/text_line_spec.rb[1:1:2] | passed | 0.
|
36
|
-
./spec/mdspell/text_line_spec.rb[1:1:3] | passed | 0.
|
37
|
-
./spec/mdspell/text_line_spec.rb[1:1:4] | passed | 0.
|
38
|
-
./spec/mdspell/text_line_spec.rb[1:2:1] | passed | 0.
|
18
|
+
./spec/mdspell/configuration_spec.rb[1:3:2:2] | passed | 0.00033 seconds |
|
19
|
+
./spec/mdspell/configuration_spec.rb[1:4:1] | passed | 0.00031 seconds |
|
20
|
+
./spec/mdspell/configuration_spec.rb[1:4:2:1] | passed | 0.00039 seconds |
|
21
|
+
./spec/mdspell/configuration_spec.rb[1:4:2:2] | passed | 0.00039 seconds |
|
22
|
+
./spec/mdspell/spell_checker_spec.rb[1:1:1] | passed | 0.00061 seconds |
|
23
|
+
./spec/mdspell/spell_checker_spec.rb[1:1:2] | passed | 0.00057 seconds |
|
24
|
+
./spec/mdspell/spell_checker_spec.rb[1:1:3] | passed | 0.00114 seconds |
|
25
|
+
./spec/mdspell/spell_checker_spec.rb[1:2:1] | passed | 0.00013 seconds |
|
26
|
+
./spec/mdspell/spell_checker_spec.rb[1:2:2] | passed | 0.00093 seconds |
|
27
|
+
./spec/mdspell/spell_checker_spec.rb[1:2:3] | passed | 0.00054 seconds |
|
28
|
+
./spec/mdspell/spell_checker_spec.rb[1:3:1] | passed | 0.00111 seconds |
|
29
|
+
./spec/mdspell/spell_checker_spec.rb[1:3:2:1] | passed | 0.00045 seconds |
|
30
|
+
./spec/mdspell/spell_checker_spec.rb[1:4:1] | passed | 0.00114 seconds |
|
31
|
+
./spec/mdspell/spell_checker_spec.rb[1:5:1] | passed | 0.04924 seconds |
|
32
|
+
./spec/mdspell/spell_checker_spec.rb[1:5:2] | failed | 0.00073 seconds |
|
33
|
+
./spec/mdspell/spell_checker_spec.rb[1:5:3] | failed | 0.00139 seconds |
|
34
|
+
./spec/mdspell/text_line_spec.rb[1:1:1] | passed | 0.00007 seconds |
|
35
|
+
./spec/mdspell/text_line_spec.rb[1:1:2] | passed | 0.00009 seconds |
|
36
|
+
./spec/mdspell/text_line_spec.rb[1:1:3] | passed | 0.00007 seconds |
|
37
|
+
./spec/mdspell/text_line_spec.rb[1:1:4] | passed | 0.00008 seconds |
|
38
|
+
./spec/mdspell/text_line_spec.rb[1:2:1] | passed | 0.00014 seconds |
|
39
39
|
./spec/mdspell/text_line_spec.rb[1:3:1] | passed | 0.00007 seconds |
|
40
|
-
./spec/mdspell/text_line_spec.rb[1:4:1] | passed | 0.
|
40
|
+
./spec/mdspell/text_line_spec.rb[1:4:1] | passed | 0.00007 seconds |
|
41
41
|
./spec/mdspell/text_line_spec.rb[1:5:1] | passed | 0.00008 seconds |
|
42
|
-
./spec/mdspell/text_line_spec.rb[1:6:1] | passed | 0.
|
42
|
+
./spec/mdspell/text_line_spec.rb[1:6:1] | passed | 0.00015 seconds |
|
43
43
|
./spec/mdspell/text_line_spec.rb[1:6:2:1] | passed | 0.00008 seconds |
|
44
|
-
./spec/mdspell/text_line_spec.rb[1:6:3:1] | passed | 0.
|
45
|
-
./spec/mdspell/text_line_spec.rb[1:6:3:2] | passed | 0.
|
44
|
+
./spec/mdspell/text_line_spec.rb[1:6:3:1] | passed | 0.00012 seconds |
|
45
|
+
./spec/mdspell/text_line_spec.rb[1:6:3:2] | passed | 0.00009 seconds |
|
46
46
|
./spec/mdspell/text_line_spec.rb[1:6:4:1] | passed | 0.00008 seconds |
|
47
|
-
./spec/mdspell/text_line_spec.rb[1:7:1] | passed | 0.
|
48
|
-
./spec/mdspell/text_line_spec.rb[1:7:2] | passed | 0.
|
47
|
+
./spec/mdspell/text_line_spec.rb[1:7:1] | passed | 0.00011 seconds |
|
48
|
+
./spec/mdspell/text_line_spec.rb[1:7:2] | passed | 0.00305 seconds |
|
49
49
|
./spec/mdspell/typo_spec.rb[1:1:1] | passed | 0.00008 seconds |
|
50
50
|
./spec/mdspell/typo_spec.rb[1:1:2] | passed | 0.00009 seconds |
|
51
|
-
./spec/mdspell/typo_spec.rb[1:1:3] | passed | 0.
|
52
|
-
./spec/mdspell/typo_spec.rb[1:2:1] | passed | 0.
|
53
|
-
./spec/mdspell/typo_spec.rb[1:2:2] | passed | 0.
|
54
|
-
./spec/mdspell/typo_spec.rb[1:2:3] | passed | 0.
|
55
|
-
./spec/mdspell/typo_spec.rb[1:3:1] | passed | 0.
|
56
|
-
./spec/mdspell/typo_spec.rb[1:4:1] | passed | 0.
|
51
|
+
./spec/mdspell/typo_spec.rb[1:1:3] | passed | 0.00008 seconds |
|
52
|
+
./spec/mdspell/typo_spec.rb[1:2:1] | passed | 0.00011 seconds |
|
53
|
+
./spec/mdspell/typo_spec.rb[1:2:2] | passed | 0.00013 seconds |
|
54
|
+
./spec/mdspell/typo_spec.rb[1:2:3] | passed | 0.00015 seconds |
|
55
|
+
./spec/mdspell/typo_spec.rb[1:3:1] | passed | 0.00044 seconds |
|
56
|
+
./spec/mdspell/typo_spec.rb[1:4:1] | passed | 0.0001 seconds |
|
57
57
|
./spec/mdspell/typo_spec.rb[1:5:1] | passed | 0.00008 seconds |
|
58
58
|
./spec/mdspell/typo_spec.rb[1:5:2] | passed | 0.00009 seconds |
|
@@ -16,7 +16,7 @@ describe MdSpell::SpellChecker do
|
|
16
16
|
|
17
17
|
context '#initialize' do
|
18
18
|
it 'should expect filename' do
|
19
|
-
expect {
|
19
|
+
expect { MdSpell::SpellChecker.new }.to raise_error ArgumentError
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'should fail if given wrong filename' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdspell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Tuchowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -133,21 +133,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.5.1
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: A Ruby markdown spell checking tool.
|
140
140
|
test_files:
|
141
|
+
- spec/mdspell/text_line_spec.rb
|
142
|
+
- spec/mdspell/cli_spec.rb
|
143
|
+
- spec/mdspell/typo_spec.rb
|
144
|
+
- spec/mdspell/spell_checker_spec.rb
|
145
|
+
- spec/mdspell/configuration_spec.rb
|
146
|
+
- spec/spec_helper.rb
|
141
147
|
- spec/examples.cache
|
142
148
|
- spec/examples/mdspell.config
|
143
|
-
- spec/examples/spanish_errors.md
|
144
|
-
- spec/examples/simple.md
|
145
149
|
- spec/examples/complete.md
|
146
150
|
- spec/examples/with_errors.md
|
147
|
-
- spec/
|
148
|
-
- spec/
|
149
|
-
- spec/mdspell/typo_spec.rb
|
150
|
-
- spec/mdspell/cli_spec.rb
|
151
|
-
- spec/mdspell/text_line_spec.rb
|
152
|
-
- spec/mdspell/configuration_spec.rb
|
151
|
+
- spec/examples/spanish_errors.md
|
152
|
+
- spec/examples/simple.md
|
153
153
|
has_rdoc:
|