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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb1c59865edb65cef87d66bbffeb0d3e3294c0ca
4
- data.tar.gz: 0b3b0e451ec22915d82540f6b5ba65bba3ce7c78
3
+ metadata.gz: c9e742f047498234b1aba8292424a95463daa22b
4
+ data.tar.gz: 8a075a15c2d2a7cd358c40fe712fbf3d103b502a
5
5
  SHA512:
6
- metadata.gz: d46f04ef111c950d8cab572b7021bd9d606aac5b7b41480383ad26f78a0cfa200816306edc4608b6421f59d30b4d499f8823e342f76a02c4b5759c2e0cb9c7d1
7
- data.tar.gz: 5869de161cea8b92e749366da8c58c6281179e704f26d439652e8c635c07610d7c6f8ced56962a94557c115202f8ab5e6586c48d883d715b109671c1f9cf2f8d
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
 
@@ -33,7 +33,7 @@ module MdSpell
33
33
  exit: 0
34
34
 
35
35
  def run(argv = ARGV)
36
- fail ArgumentError, 'expected Array of command line options' unless argv.is_a? Array
36
+ raise ArgumentError, 'expected Array of command line options' unless argv.is_a? Array
37
37
 
38
38
  parse_options(argv)
39
39
 
@@ -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
- @content += value
79
- else
80
- @content += ' ' + value
81
- end
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
- fail ArgumentError, 'expected Kramdown::Element' unless elem.instance_of? Kramdown::Element
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
@@ -27,17 +27,17 @@ module MdSpell
27
27
  private
28
28
 
29
29
  def assert_proper_line_type(line)
30
- fail ArgumentError, "expected TextLine, got #{line.class.inspect}" unless
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
- fail ArgumentError, "expected String, got #{word.class.inspect}" unless
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
- fail ArgumentError, "expected Array, got #{suggestions.class.inspect}" unless
40
+ raise ArgumentError, "expected Array, got #{suggestions.class.inspect}" unless
41
41
  suggestions.class == Array
42
42
  end
43
43
  end
@@ -1,6 +1,4 @@
1
- # rubocop:disable Style/Documentation
2
-
3
1
  module MdSpell
4
2
  # Current version
5
- VERSION = '0.1.2'
3
+ VERSION = '0.1.7'.freeze
6
4
  end
@@ -1,58 +1,58 @@
1
1
  example_id | status | run_time |
2
2
  --------------------------------------------- | ------ | --------------- |
3
- ./spec/mdspell/cli_spec.rb[1:1] | passed | 0.00063 seconds |
4
- ./spec/mdspell/cli_spec.rb[1:2] | passed | 0.0001 seconds |
5
- ./spec/mdspell/cli_spec.rb[1:3:1] | passed | 0.0009 seconds |
6
- ./spec/mdspell/cli_spec.rb[1:4:1:1] | passed | 0.00064 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.00053 seconds |
9
- ./spec/mdspell/configuration_spec.rb[1:1:1] | passed | 0.0003 seconds |
10
- ./spec/mdspell/configuration_spec.rb[1:1:2:1] | passed | 0.00032 seconds |
11
- ./spec/mdspell/configuration_spec.rb[1:1:2:2] | passed | 0.00032 seconds |
12
- ./spec/mdspell/configuration_spec.rb[1:1:3:1] | passed | 0.00038 seconds |
13
- ./spec/mdspell/configuration_spec.rb[1:2:1] | passed | 0.0004 seconds |
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.00036 seconds |
16
- ./spec/mdspell/configuration_spec.rb[1:3:1] | passed | 0.00032 seconds |
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.00031 seconds |
19
- ./spec/mdspell/configuration_spec.rb[1:4:1] | passed | 0.00029 seconds |
20
- ./spec/mdspell/configuration_spec.rb[1:4:2:1] | passed | 0.0004 seconds |
21
- ./spec/mdspell/configuration_spec.rb[1:4:2:2] | passed | 0.00037 seconds |
22
- ./spec/mdspell/spell_checker_spec.rb[1:1:1] | passed | 0.00066 seconds |
23
- ./spec/mdspell/spell_checker_spec.rb[1:1:2] | passed | 0.00062 seconds |
24
- ./spec/mdspell/spell_checker_spec.rb[1:1:3] | passed | 0.00064 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.00013 seconds |
27
- ./spec/mdspell/spell_checker_spec.rb[1:2:3] | passed | 0.00047 seconds |
28
- ./spec/mdspell/spell_checker_spec.rb[1:3:1] | passed | 0.03793 seconds |
29
- ./spec/mdspell/spell_checker_spec.rb[1:3:2:1] | passed | 0.00854 seconds |
30
- ./spec/mdspell/spell_checker_spec.rb[1:4:1] | passed | 0.0012 seconds |
31
- ./spec/mdspell/spell_checker_spec.rb[1:5:1] | passed | 0.00991 seconds |
32
- ./spec/mdspell/spell_checker_spec.rb[1:5:2] | passed | 0.00743 seconds |
33
- ./spec/mdspell/spell_checker_spec.rb[1:5:3] | passed | 0.04281 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.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.00007 seconds |
38
- ./spec/mdspell/text_line_spec.rb[1:2:1] | passed | 0.00015 seconds |
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.00009 seconds |
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.00013 seconds |
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.00011 seconds |
45
- ./spec/mdspell/text_line_spec.rb[1:6:3:2] | passed | 0.00012 seconds |
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.00017 seconds |
48
- ./spec/mdspell/text_line_spec.rb[1:7:2] | passed | 0.0032 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.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.00009 seconds |
52
- ./spec/mdspell/typo_spec.rb[1:2:1] | passed | 0.00016 seconds |
53
- ./spec/mdspell/typo_spec.rb[1:2:2] | passed | 0.00014 seconds |
54
- ./spec/mdspell/typo_spec.rb[1:2:3] | passed | 0.00013 seconds |
55
- ./spec/mdspell/typo_spec.rb[1:3:1] | passed | 0.00049 seconds |
56
- ./spec/mdspell/typo_spec.rb[1:4:1] | passed | 0.00008 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.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 { MdSpell::SpellChecker.new }.to raise_error ArgumentError
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.6
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: 2015-12-10 00:00:00.000000000 Z
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.4.8
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/spec_helper.rb
148
- - spec/mdspell/spell_checker_spec.rb
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: