spellchecker 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.
@@ -4,10 +4,19 @@ class Spellchecker
4
4
  require 'rexml/document'
5
5
 
6
6
  ASPELL_WORD_DATA_REGEX = Regexp.new(/\&\s\w+\s\d+\s\d+(.*)$/)
7
- ASPELL_PATH = "/usr/local/bin/aspell"
7
+
8
+ @@aspell_path = "aspell"
9
+
10
+ def self.aspell_path=(path)
11
+ @@aspell_path = path
12
+ end
13
+
14
+ def self.aspell_path
15
+ @@aspell_path
16
+ end
8
17
 
9
18
  def self.check(text, lang='en')
10
- spell_check_response = `echo "#{text}" | #{ASPELL_PATH} -a -l #{lang}`
19
+ spell_check_response = `echo "#{text}" | #{@@aspell_path} -a -l #{lang}`
11
20
  if spell_check_response == ''
12
21
  raise 'Aspell command not found'
13
22
  elsif text == ''
@@ -31,4 +40,5 @@ class Spellchecker
31
40
  return response
32
41
  end
33
42
  end
43
+
34
44
  end
@@ -1,3 +1,3 @@
1
1
  module Spellchecker #:nodoc
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spellchecker
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - RedBeard Tech