mdspell 0.1.1 → 0.1.2

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: 167c31fb49e320ecb9a67cae141e171b806446ea
4
- data.tar.gz: 209aa4bc10977836b2ab9458510fb798a3621d2b
3
+ metadata.gz: e9afcdac3d5c1ed898a1880ab4dd0bc55db5bfcf
4
+ data.tar.gz: 4eb4112a9edacb8f50bf8423562fb4bc64ae0472
5
5
  SHA512:
6
- metadata.gz: bd3666dcba329f752f9ce3f5c87ace2cbbbaea87a6613a124fae877823a2558302e905fa8f786eed2f9581e0de6256c18154b94103e1f6ab5da557dfe551b551
7
- data.tar.gz: 7e5b5582be2cc45272e47586693ce108488e6d2b0bd66c8728cc27a254b75488a7a5310254138df3b04f4f81a909acf9c3e0a971d8d70de3a925897714b886bd
6
+ metadata.gz: 599cacde11b6f1d60958d3cc4413de5c88e4e7f0c90a27050d57efb6421007d3031fb8effeeeb88a3e6278e87ae5cb3bee15bca03538955af1e296f435d4da35
7
+ data.tar.gz: 495d0c7eede2b7dcfc871bf198fecdc29a640e8045006dec254c3622e8a73ac28ddd1673b4572e4ea429757e6e081ceb8ccfff2916e2169543a31fe656153a03
data/README.md CHANGED
@@ -15,7 +15,16 @@ A Ruby markdown spell checking tool.
15
15
  To install from [rubygems.org](http://rubygems.org/), run:
16
16
 
17
17
  ```console
18
- gem install mdspell
18
+ $ gem install mdspell
19
+ ```
20
+
21
+ On top of that, make sure that [GNU Aspell](http://aspell.net/) is installed on the system:
22
+
23
+ ```console
24
+ # Ubuntu
25
+ $ sudo apt-get install aspell
26
+ # Arch Linux
27
+ $ sudo pacman -S aspell
19
28
  ```
20
29
 
21
30
  ## Usage
@@ -23,19 +32,18 @@ gem install mdspell
23
32
  To spell-check markdown files, simply run `mdspell` with the filenames as a parameter:
24
33
 
25
34
  ```console
26
- mdspell README.md
35
+ $ mdspell README.md
27
36
  ```
28
37
 
29
38
  To check all markdown files within the directory:
30
39
 
31
40
  ```console
32
- mdspell docs/
41
+ $ mdspell docs/
33
42
  ```
34
43
 
35
44
  For each spelling error found, MdSpell will display the misspelled word, filename and line number:
36
45
 
37
46
  ```console
38
- Spell-checking ./README.md...
39
47
  ./README.md:10: actualy
40
48
  ```
41
49
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module MdSpell
4
4
  # Current version
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  end
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.0001 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.00041 seconds |
7
- ./spec/mdspell/cli_spec.rb[1:4:2:1] | passed | 0.00054 seconds |
8
- ./spec/mdspell/cli_spec.rb[1:4:3:1] | passed | 0.00111 seconds |
9
- ./spec/mdspell/configuration_spec.rb[1:1:1] | passed | 0.00033 seconds |
10
- ./spec/mdspell/configuration_spec.rb[1:1:2:1] | passed | 0.00038 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.00055 seconds |
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
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.00035 seconds |
15
- ./spec/mdspell/configuration_spec.rb[1:2:2:2] | passed | 0.00038 seconds |
16
- ./spec/mdspell/configuration_spec.rb[1:3:1] | passed | 0.00071 seconds |
17
- ./spec/mdspell/configuration_spec.rb[1:3:2:1] | passed | 0.00037 seconds |
18
- ./spec/mdspell/configuration_spec.rb[1:3:2:2] | passed | 0.00035 seconds |
19
- ./spec/mdspell/configuration_spec.rb[1:4:1] | passed | 0.00033 seconds |
20
- ./spec/mdspell/configuration_spec.rb[1:4:2:1] | passed | 0.00043 seconds |
21
- ./spec/mdspell/configuration_spec.rb[1:4:2:2] | passed | 0.00044 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
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.0006 seconds |
24
- ./spec/mdspell/spell_checker_spec.rb[1:1:3] | passed | 0.00066 seconds |
25
- ./spec/mdspell/spell_checker_spec.rb[1:2:1] | passed | 0.00014 seconds |
26
- ./spec/mdspell/spell_checker_spec.rb[1:2:2] | passed | 0.00035 seconds |
27
- ./spec/mdspell/spell_checker_spec.rb[1:2:3] | passed | 0.0005 seconds |
28
- ./spec/mdspell/spell_checker_spec.rb[1:3:1] | passed | 0.00116 seconds |
29
- ./spec/mdspell/spell_checker_spec.rb[1:3:2:1] | passed | 0.00074 seconds |
30
- ./spec/mdspell/spell_checker_spec.rb[1:4:1] | passed | 0.03383 seconds |
31
- ./spec/mdspell/spell_checker_spec.rb[1:5:1] | passed | 0.01874 seconds |
32
- ./spec/mdspell/spell_checker_spec.rb[1:5:2] | passed | 0.00913 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
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.00008 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.00007 seconds |
38
- ./spec/mdspell/text_line_spec.rb[1:2:1] | passed | 0.00013 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
39
  ./spec/mdspell/text_line_spec.rb[1:3:1] | passed | 0.00007 seconds |
40
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.0004 seconds |
42
- ./spec/mdspell/text_line_spec.rb[1:6:1] | passed | 0.00015 seconds |
43
- ./spec/mdspell/text_line_spec.rb[1:6:2:1] | passed | 0.00039 seconds |
44
- ./spec/mdspell/text_line_spec.rb[1:6:3:1] | passed | 0.00011 seconds |
45
- ./spec/mdspell/text_line_spec.rb[1:6:3:2] | passed | 0.0001 seconds |
46
- ./spec/mdspell/text_line_spec.rb[1:6:4:1] | passed | 0.00043 seconds |
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.00094 seconds |
49
- ./spec/mdspell/typo_spec.rb[1:1:1] | passed | 0.00052 seconds |
50
- ./spec/mdspell/typo_spec.rb[1:1:2] | passed | 0.00009 seconds |
51
- ./spec/mdspell/typo_spec.rb[1:1:3] | passed | 0.00008 seconds |
52
- ./spec/mdspell/typo_spec.rb[1:2:1] | passed | 0.00097 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
53
  ./spec/mdspell/typo_spec.rb[1:2:2] | passed | 0.00013 seconds |
54
54
  ./spec/mdspell/typo_spec.rb[1:2:3] | passed | 0.00014 seconds |
55
- ./spec/mdspell/typo_spec.rb[1:3:1] | passed | 0.00042 seconds |
56
- ./spec/mdspell/typo_spec.rb[1:4:1] | passed | 0.00016 seconds |
57
- ./spec/mdspell/typo_spec.rb[1:5:1] | passed | 0.00028 seconds |
58
- ./spec/mdspell/typo_spec.rb[1:5:2] | passed | 0.00034 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 |
@@ -0,0 +1,31 @@
1
+ # First header
2
+
3
+ ## Second Header
4
+
5
+ ### Third Header
6
+
7
+ #### Fourth Header
8
+
9
+ ##### Fifth Header
10
+
11
+ First paragraph
12
+
13
+ Second paragraph
14
+
15
+ Multi-line
16
+ paragraph
17
+
18
+ > Block-quote
19
+
20
+ > Another block-quote
21
+ >
22
+ > > Nested block-quote
23
+
24
+ * Unordered
25
+ * List
26
+
27
+ 1. Ordered
28
+ 1. List
29
+
30
+ * Multi-line paragraph
31
+ as list item
@@ -29,21 +29,23 @@ 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(2).item
32
+ expect(subject.files).to have(3).item
33
33
 
34
- expect(subject.files).to include('spec/examples/with_errors.md')
35
34
  expect(subject.files).to include('spec/examples/simple.md')
35
+ expect(subject.files).to include('spec/examples/complete.md')
36
+ expect(subject.files).to include('spec/examples/with_errors.md')
36
37
  end
37
38
  end
38
39
 
39
40
  context 'if both directory and single file given' do
40
41
  it 'should return all files' do
41
42
  subject.run(['README.md', 'spec/examples'])
42
- expect(subject.files).to have(3).item
43
+ expect(subject.files).to have(4).item
43
44
 
44
- expect(subject.files).to include('spec/examples/with_errors.md')
45
- expect(subject.files).to include('spec/examples/simple.md')
46
45
  expect(subject.files).to include('README.md')
46
+ expect(subject.files).to include('spec/examples/simple.md')
47
+ expect(subject.files).to include('spec/examples/complete.md')
48
+ expect(subject.files).to include('spec/examples/with_errors.md')
47
49
  end
48
50
  end
49
51
  end
@@ -92,20 +92,37 @@ describe MdSpell::TextLine do
92
92
  end
93
93
 
94
94
  context '::scan' do
95
- let(:simple_md) { Kramdown::Document.new(File.read('spec/examples/simple.md'), input: 'GFM') }
95
+ let(:complete_md) do
96
+ Kramdown::Document.new(File.read('spec/examples/complete.md'), input: 'GFM')
97
+ end
96
98
 
97
99
  it 'should expect Kramdown::Document as argument' do
98
100
  expect { MdSpell::TextLine.scan }. to raise_error ArgumentError
99
101
  end
100
102
 
101
103
  it 'should find proper lines' do
102
- lines = MdSpell::TextLine.scan(simple_md)
103
-
104
- expect(lines).to have(3).items
105
-
106
- expect(lines[0].content).to eq 'Simple'
107
- expect(lines[1].content).to eq 'markdown'
108
- expect(lines[2].content).to eq 'file'
104
+ lines = MdSpell::TextLine.scan(complete_md)
105
+
106
+ expect(lines).to have(18).items
107
+
108
+ expect(lines[0].content).to eq 'First header'
109
+ expect(lines[1].content).to eq 'Second Header'
110
+ expect(lines[2].content).to eq 'Third Header'
111
+ expect(lines[3].content).to eq 'Fourth Header'
112
+ expect(lines[4].content).to eq 'Fifth Header'
113
+ expect(lines[5].content).to eq 'First paragraph'
114
+ expect(lines[6].content).to eq 'Second paragraph'
115
+ expect(lines[7].content).to eq 'Multi-line'
116
+ expect(lines[8].content).to eq 'paragraph'
117
+ expect(lines[9].content).to eq 'Block-quote'
118
+ expect(lines[10].content).to eq 'Another block-quote'
119
+ expect(lines[11].content).to eq 'Nested block-quote'
120
+ expect(lines[12].content).to eq 'Unordered'
121
+ expect(lines[13].content).to eq 'List'
122
+ expect(lines[14].content).to eq 'Ordered'
123
+ expect(lines[15].content).to eq 'List'
124
+ expect(lines[16].content).to eq 'Multi-line paragraph'
125
+ expect(lines[17].content).to eq 'as list item'
109
126
  end
110
127
  end
111
128
  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.1
4
+ version: 0.1.2
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-30 00:00:00.000000000 Z
11
+ date: 2015-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -57,6 +57,7 @@ files:
57
57
  - lib/mdspell/typo.rb
58
58
  - lib/mdspell/version.rb
59
59
  - spec/examples.cache
60
+ - spec/examples/complete.md
60
61
  - spec/examples/mdspell.config
61
62
  - spec/examples/simple.md
62
63
  - spec/examples/with_errors.md
@@ -96,6 +97,7 @@ test_files:
96
97
  - spec/spec_helper.rb
97
98
  - spec/examples/with_errors.md
98
99
  - spec/examples/mdspell.config
100
+ - spec/examples/complete.md
99
101
  - spec/examples/simple.md
100
102
  - spec/mdspell/configuration_spec.rb
101
103
  - spec/mdspell/cli_spec.rb