mdspell 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9afcdac3d5c1ed898a1880ab4dd0bc55db5bfcf
4
- data.tar.gz: 4eb4112a9edacb8f50bf8423562fb4bc64ae0472
3
+ metadata.gz: 498db120436c18f276565d5869d6ae6633bb5874
4
+ data.tar.gz: de25d5a7b64c13595b116dc1f468c82fe4c04c9d
5
5
  SHA512:
6
- metadata.gz: 599cacde11b6f1d60958d3cc4413de5c88e4e7f0c90a27050d57efb6421007d3031fb8effeeeb88a3e6278e87ae5cb3bee15bca03538955af1e296f435d4da35
7
- data.tar.gz: 495d0c7eede2b7dcfc871bf198fecdc29a640e8045006dec254c3622e8a73ac28ddd1673b4572e4ea429757e6e081ceb8ccfff2916e2169543a31fe656153a03
6
+ metadata.gz: ba929dadf2ef521255dc2cea3c5b92c965003ca632d10b99e782c050d7189c122de14a837a8ab73e06b1947fbe59925a086a2dd09d2cc0b0b075f88af22ff4b7
7
+ data.tar.gz: 711bdcab6d3c6835deb9afd350df72a3337db5b6406c70b5cb3d263314bd76e29dc9772bcc35e1d976650366f607d379a0c7bfae481f19775a26ea5439f9098b
data/README.md CHANGED
@@ -7,6 +7,8 @@ https://travis-ci.org/mtuchowski/mdspell)
7
7
  https://codeclimate.com/github/mtuchowski/mdspell)
8
8
  [![Test Coverage](https://codeclimate.com/github/mtuchowski/mdspell/badges/coverage.svg)](
9
9
  https://codeclimate.com/github/mtuchowski/mdspell/coverage)
10
+ [![Inline docs](http://inch-ci.org/github/mtuchowski/mdspell.svg?branch=master)](
11
+ http://inch-ci.org/github/mtuchowski/mdspell)
10
12
 
11
13
  A Ruby markdown spell checking tool.
12
14
 
@@ -24,7 +24,7 @@ module MdSpell
24
24
 
25
25
  # Return all words in this element.
26
26
  def words
27
- @content.scan(/[\w\']+/)
27
+ @content.scan(/[[[:alpha:]]']+/)
28
28
  end
29
29
 
30
30
  # Append Kramdown::Element's content to this element.
data/spec/examples.cache CHANGED
@@ -1,58 +1,58 @@
1
- example_id | status | run_time |
2
- --------------------------------------------- | ------- | --------------- |
3
- ./spec/mdspell/cli_spec.rb[1:1] | passed | 0.00011 seconds |
4
- ./spec/mdspell/cli_spec.rb[1:2] | passed | 0.00029 seconds |
5
- ./spec/mdspell/cli_spec.rb[1:3:1] | passed | 0.00039 seconds |
6
- ./spec/mdspell/cli_spec.rb[1:4:1:1] | passed | 0.00059 seconds |
7
- ./spec/mdspell/cli_spec.rb[1:4:2:1] | passed | 0.00166 seconds |
8
- ./spec/mdspell/cli_spec.rb[1:4:3:1] | passed | 0.00058 seconds |
9
- ./spec/mdspell/configuration_spec.rb[1:1:1] | passed | 0.00032 seconds |
10
- ./spec/mdspell/configuration_spec.rb[1:1:2:1] | passed | 0.00035 seconds |
11
- ./spec/mdspell/configuration_spec.rb[1:1:2:2] | passed | 0.00037 seconds |
12
- ./spec/mdspell/configuration_spec.rb[1:1:3:1] | passed | 0.0006 seconds |
13
- ./spec/mdspell/configuration_spec.rb[1:2:1] | passed | 0.00034 seconds |
14
- ./spec/mdspell/configuration_spec.rb[1:2:2:1] | passed | 0.00033 seconds |
15
- ./spec/mdspell/configuration_spec.rb[1:2:2:2] | passed | 0.00037 seconds |
16
- ./spec/mdspell/configuration_spec.rb[1:3:1] | passed | 0.00037 seconds |
17
- ./spec/mdspell/configuration_spec.rb[1:3:2:1] | passed | 0.00034 seconds |
18
- ./spec/mdspell/configuration_spec.rb[1:3:2:2] | passed | 0.00036 seconds |
19
- ./spec/mdspell/configuration_spec.rb[1:4:1] | passed | 0.00087 seconds |
20
- ./spec/mdspell/configuration_spec.rb[1:4:2:1] | passed | 0.00048 seconds |
21
- ./spec/mdspell/configuration_spec.rb[1:4:2:2] | passed | 0.00153 seconds |
22
- ./spec/mdspell/spell_checker_spec.rb[1:1:1] | passed | 0.00059 seconds |
23
- ./spec/mdspell/spell_checker_spec.rb[1:1:2] | passed | 0.00065 seconds |
24
- ./spec/mdspell/spell_checker_spec.rb[1:1:3] | passed | 0.00053 seconds |
25
- ./spec/mdspell/spell_checker_spec.rb[1:2:1] | passed | 0.00016 seconds |
26
- ./spec/mdspell/spell_checker_spec.rb[1:2:2] | passed | 0.00012 seconds |
27
- ./spec/mdspell/spell_checker_spec.rb[1:2:3] | passed | 0.00055 seconds |
28
- ./spec/mdspell/spell_checker_spec.rb[1:3:1] | passed | 0.00094 seconds |
29
- ./spec/mdspell/spell_checker_spec.rb[1:3:2:1] | passed | 0.00663 seconds |
30
- ./spec/mdspell/spell_checker_spec.rb[1:4:1] | passed | 0.00446 seconds |
31
- ./spec/mdspell/spell_checker_spec.rb[1:5:1] | passed | 0.01128 seconds |
32
- ./spec/mdspell/spell_checker_spec.rb[1:5:2] | passed | 0.0238 seconds |
33
- ./spec/mdspell/spell_checker_spec.rb[1:5:3] | pending | 0.00001 seconds |
34
- ./spec/mdspell/text_line_spec.rb[1:1:1] | passed | 0.0001 seconds |
35
- ./spec/mdspell/text_line_spec.rb[1:1:2] | passed | 0.00038 seconds |
36
- ./spec/mdspell/text_line_spec.rb[1:1:3] | passed | 0.00008 seconds |
37
- ./spec/mdspell/text_line_spec.rb[1:1:4] | passed | 0.00009 seconds |
38
- ./spec/mdspell/text_line_spec.rb[1:2:1] | passed | 0.00017 seconds |
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.00007 seconds |
41
- ./spec/mdspell/text_line_spec.rb[1:5:1] | passed | 0.00014 seconds |
42
- ./spec/mdspell/text_line_spec.rb[1:6:1] | passed | 0.00017 seconds |
43
- ./spec/mdspell/text_line_spec.rb[1:6:2:1] | passed | 0.00009 seconds |
44
- ./spec/mdspell/text_line_spec.rb[1:6:3:1] | passed | 0.00038 seconds |
45
- ./spec/mdspell/text_line_spec.rb[1:6:3:2] | passed | 0.00011 seconds |
46
- ./spec/mdspell/text_line_spec.rb[1:6:4:1] | passed | 0.00009 seconds |
47
- ./spec/mdspell/text_line_spec.rb[1:7:1] | passed | 0.00018 seconds |
48
- ./spec/mdspell/text_line_spec.rb[1:7:2] | passed | 0.04916 seconds |
49
- ./spec/mdspell/typo_spec.rb[1:1:1] | passed | 0.00008 seconds |
50
- ./spec/mdspell/typo_spec.rb[1:1:2] | passed | 0.00011 seconds |
51
- ./spec/mdspell/typo_spec.rb[1:1:3] | passed | 0.00074 seconds |
52
- ./spec/mdspell/typo_spec.rb[1:2:1] | passed | 0.00018 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.00014 seconds |
55
- ./spec/mdspell/typo_spec.rb[1:3:1] | passed | 0.00059 seconds |
56
- ./spec/mdspell/typo_spec.rb[1:4:1] | passed | 0.00008 seconds |
57
- ./spec/mdspell/typo_spec.rb[1:5:1] | passed | 0.00048 seconds |
58
- ./spec/mdspell/typo_spec.rb[1:5:2] | passed | 0.00012 seconds |
1
+ example_id | status | run_time |
2
+ --------------------------------------------- | ------ | --------------- |
3
+ ./spec/mdspell/cli_spec.rb[1:1] | passed | 0.00011 seconds |
4
+ ./spec/mdspell/cli_spec.rb[1:2] | passed | 0.00011 seconds |
5
+ ./spec/mdspell/cli_spec.rb[1:3:1] | passed | 0.00017 seconds |
6
+ ./spec/mdspell/cli_spec.rb[1:4:1:1] | passed | 0.00042 seconds |
7
+ ./spec/mdspell/cli_spec.rb[1:4:2:1] | passed | 0.00124 seconds |
8
+ ./spec/mdspell/cli_spec.rb[1:4:3:1] | passed | 0.00058 seconds |
9
+ ./spec/mdspell/configuration_spec.rb[1:1:1] | passed | 0.00036 seconds |
10
+ ./spec/mdspell/configuration_spec.rb[1:1:2:1] | passed | 0.00044 seconds |
11
+ ./spec/mdspell/configuration_spec.rb[1:1:2:2] | passed | 0.00041 seconds |
12
+ ./spec/mdspell/configuration_spec.rb[1:1:3:1] | passed | 0.00047 seconds |
13
+ ./spec/mdspell/configuration_spec.rb[1:2:1] | passed | 0.00057 seconds |
14
+ ./spec/mdspell/configuration_spec.rb[1:2:2:1] | passed | 0.00176 seconds |
15
+ ./spec/mdspell/configuration_spec.rb[1:2:2:2] | passed | 0.00039 seconds |
16
+ ./spec/mdspell/configuration_spec.rb[1:3:1] | passed | 0.00039 seconds |
17
+ ./spec/mdspell/configuration_spec.rb[1:3:2:1] | passed | 0.00041 seconds |
18
+ ./spec/mdspell/configuration_spec.rb[1:3:2:2] | passed | 0.00043 seconds |
19
+ ./spec/mdspell/configuration_spec.rb[1:4:1] | passed | 0.00036 seconds |
20
+ ./spec/mdspell/configuration_spec.rb[1:4:2:1] | passed | 0.00045 seconds |
21
+ ./spec/mdspell/configuration_spec.rb[1:4:2:2] | passed | 0.00051 seconds |
22
+ ./spec/mdspell/spell_checker_spec.rb[1:1:1] | passed | 0.00148 seconds |
23
+ ./spec/mdspell/spell_checker_spec.rb[1:1:2] | passed | 0.00072 seconds |
24
+ ./spec/mdspell/spell_checker_spec.rb[1:1:3] | passed | 0.00301 seconds |
25
+ ./spec/mdspell/spell_checker_spec.rb[1:2:1] | passed | 0.00019 seconds |
26
+ ./spec/mdspell/spell_checker_spec.rb[1:2:2] | passed | 0.00014 seconds |
27
+ ./spec/mdspell/spell_checker_spec.rb[1:2:3] | passed | 0.05121 seconds |
28
+ ./spec/mdspell/spell_checker_spec.rb[1:3:1] | passed | 0.00145 seconds |
29
+ ./spec/mdspell/spell_checker_spec.rb[1:3:2:1] | passed | 0.00142 seconds |
30
+ ./spec/mdspell/spell_checker_spec.rb[1:4:1] | passed | 0.00282 seconds |
31
+ ./spec/mdspell/spell_checker_spec.rb[1:5:1] | passed | 0.01528 seconds |
32
+ ./spec/mdspell/spell_checker_spec.rb[1:5:2] | passed | 0.00968 seconds |
33
+ ./spec/mdspell/spell_checker_spec.rb[1:5:3] | passed | 0.05735 seconds |
34
+ ./spec/mdspell/text_line_spec.rb[1:1:1] | passed | 0.00009 seconds |
35
+ ./spec/mdspell/text_line_spec.rb[1:1:2] | passed | 0.0001 seconds |
36
+ ./spec/mdspell/text_line_spec.rb[1:1:3] | passed | 0.00008 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
+ ./spec/mdspell/text_line_spec.rb[1:3:1] | passed | 0.00012 seconds |
40
+ ./spec/mdspell/text_line_spec.rb[1:4:1] | passed | 0.00008 seconds |
41
+ ./spec/mdspell/text_line_spec.rb[1:5:1] | passed | 0.00011 seconds |
42
+ ./spec/mdspell/text_line_spec.rb[1:6:1] | passed | 0.00018 seconds |
43
+ ./spec/mdspell/text_line_spec.rb[1:6:2:1] | passed | 0.00011 seconds |
44
+ ./spec/mdspell/text_line_spec.rb[1:6:3:1] | passed | 0.00022 seconds |
45
+ ./spec/mdspell/text_line_spec.rb[1:6:3:2] | passed | 0.00016 seconds |
46
+ ./spec/mdspell/text_line_spec.rb[1:6:4:1] | passed | 0.00009 seconds |
47
+ ./spec/mdspell/text_line_spec.rb[1:7:1] | passed | 0.00015 seconds |
48
+ ./spec/mdspell/text_line_spec.rb[1:7:2] | passed | 0.00355 seconds |
49
+ ./spec/mdspell/typo_spec.rb[1:1:1] | passed | 0.00012 seconds |
50
+ ./spec/mdspell/typo_spec.rb[1:1:2] | passed | 0.00011 seconds |
51
+ ./spec/mdspell/typo_spec.rb[1:1:3] | passed | 0.0001 seconds |
52
+ ./spec/mdspell/typo_spec.rb[1:2:1] | passed | 0.00013 seconds |
53
+ ./spec/mdspell/typo_spec.rb[1:2:2] | passed | 0.00015 seconds |
54
+ ./spec/mdspell/typo_spec.rb[1:2:3] | passed | 0.00021 seconds |
55
+ ./spec/mdspell/typo_spec.rb[1:3:1] | passed | 0.00051 seconds |
56
+ ./spec/mdspell/typo_spec.rb[1:4:1] | passed | 0.00013 seconds |
57
+ ./spec/mdspell/typo_spec.rb[1:5:1] | passed | 0.00011 seconds |
58
+ ./spec/mdspell/typo_spec.rb[1:5:2] | passed | 0.00011 seconds |
@@ -29,3 +29,5 @@ paragraph
29
29
 
30
30
  * Multi-line paragraph
31
31
  as list item
32
+
33
+ Two quotes: That's one, and here's the other
@@ -0,0 +1,4 @@
1
+ completar
2
+ vivira
3
+ No pude conseguir una habitación porque el hotel está completo.
4
+ Compré la obra completa de Oscar Wilde a un precio muy bajo.
@@ -29,23 +29,25 @@ describe MdSpell::CLI do
29
29
  context 'if directory given' do
30
30
  it 'should return all markdown files in that directory' do
31
31
  subject.run(['spec/examples'])
32
- expect(subject.files).to have(3).item
32
+ expect(subject.files).to have(4).item
33
33
 
34
34
  expect(subject.files).to include('spec/examples/simple.md')
35
35
  expect(subject.files).to include('spec/examples/complete.md')
36
36
  expect(subject.files).to include('spec/examples/with_errors.md')
37
+ expect(subject.files).to include('spec/examples/spanish_errors.md')
37
38
  end
38
39
  end
39
40
 
40
41
  context 'if both directory and single file given' do
41
42
  it 'should return all files' do
42
43
  subject.run(['README.md', 'spec/examples'])
43
- expect(subject.files).to have(4).item
44
+ expect(subject.files).to have(5).item
44
45
 
45
46
  expect(subject.files).to include('README.md')
46
47
  expect(subject.files).to include('spec/examples/simple.md')
47
48
  expect(subject.files).to include('spec/examples/complete.md')
48
49
  expect(subject.files).to include('spec/examples/with_errors.md')
50
+ expect(subject.files).to include('spec/examples/spanish_errors.md')
49
51
  end
50
52
  end
51
53
  end
@@ -65,6 +65,18 @@ describe MdSpell::SpellChecker do
65
65
  expect(typos[3].word).to eq 'tobe'
66
66
  end
67
67
 
68
- it 'should use configured language'
68
+ it 'should use configured language' do
69
+ prev_language = MdSpell::Configuration[:language]
70
+ MdSpell::Configuration[:language] = 'es'
71
+
72
+ typos = MdSpell::SpellChecker.new('spec/examples/spanish_errors.md').typos
73
+
74
+ expect(typos).to have(3).items
75
+ expect(typos[0].word).to eq 'vivira'
76
+ expect(typos[1].word).to eq 'Oscar'
77
+ expect(typos[2].word).to eq 'Wilde'
78
+
79
+ MdSpell::Configuration[:language] = prev_language
80
+ end
69
81
  end
70
82
  end
@@ -103,7 +103,7 @@ describe MdSpell::TextLine do
103
103
  it 'should find proper lines' do
104
104
  lines = MdSpell::TextLine.scan(complete_md)
105
105
 
106
- expect(lines).to have(18).items
106
+ expect(lines).to have(19).items
107
107
 
108
108
  expect(lines[0].content).to eq 'First header'
109
109
  expect(lines[1].content).to eq 'Second Header'
@@ -123,6 +123,7 @@ describe MdSpell::TextLine do
123
123
  expect(lines[15].content).to eq 'List'
124
124
  expect(lines[16].content).to eq 'Multi-line paragraph'
125
125
  expect(lines[17].content).to eq 'as list item'
126
+ expect(lines[18].content).to eq "Two quotes: That's one, and here's the other"
126
127
  end
127
128
  end
128
129
  end
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Tuchowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-31 00:00:00.000000000 Z
11
+ date: 2015-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -40,7 +40,8 @@ dependencies:
40
40
  version: '1.1'
41
41
  description: Check markdown files for spelling errors.
42
42
  email: marek@tuchowski.com.pl
43
- executables: []
43
+ executables:
44
+ - mdspell
44
45
  extensions: []
45
46
  extra_rdoc_files:
46
47
  - README.md
@@ -60,6 +61,7 @@ files:
60
61
  - spec/examples/complete.md
61
62
  - spec/examples/mdspell.config
62
63
  - spec/examples/simple.md
64
+ - spec/examples/spanish_errors.md
63
65
  - spec/examples/with_errors.md
64
66
  - spec/mdspell/cli_spec.rb
65
67
  - spec/mdspell/configuration_spec.rb
@@ -95,6 +97,7 @@ specification_version: 4
95
97
  summary: A Ruby markdown spell checking tool.
96
98
  test_files:
97
99
  - spec/spec_helper.rb
100
+ - spec/examples/spanish_errors.md
98
101
  - spec/examples/with_errors.md
99
102
  - spec/examples/mdspell.config
100
103
  - spec/examples/complete.md