guessmethod 0.0.7 → 0.0.8

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.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.0.8 2007-08-07
2
+
3
+ * enhancements
4
+ * GuessMethod::Guesser ignores case, giving the opportunity to accidentally call to_I and not get a ambiguous method error
5
+
1
6
  == 0.0.7 2007-08-06
2
7
 
3
8
  * bug fix: GuessMethod::Options[:active] now correctly affects constant guessing
data/lib/guessmethod.rb CHANGED
@@ -55,11 +55,11 @@ module GuessMethod
55
55
  # match(es) in an array of strings
56
56
  class Guesser
57
57
  def self.find_closest(haystack, needle)
58
- closest_distance = haystack.map {|x| x.levenshtein(needle.to_s,
58
+ closest_distance = haystack.map {|x| x.to_s.downcase.levenshtein(needle.to_s.downcase,
59
59
  Options[:insert_weight], Options[:delete_weight],
60
60
  Options[:substitution_weight])}.min
61
61
  if closest_distance <= Options[:threshold]
62
- haystack.find_all {|x| x.levenshtein(needle.to_s,
62
+ haystack.find_all {|x| x.to_s.downcase.levenshtein(needle.to_s.downcase,
63
63
  Options[:insert_weight], Options[:delete_weight],
64
64
  Options[:substitution_weight]) == closest_distance}
65
65
  else
@@ -2,7 +2,7 @@ module GuessMethod #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -37,6 +37,13 @@ describe "GuessMethod naturally" do
37
37
  Cass.should == Class
38
38
  end
39
39
 
40
+ it "should replace to_I with to_i" do
41
+ '1'.to_I.should == 1
42
+ end
43
+
44
+ it "should replace RUBY_Version with RUBY_VERSION" do
45
+ RUBY_Version.should == RUBY_VERSION
46
+ end
40
47
  end
41
48
 
42
49
  describe "On a method_missing-defining class, GuessMethod" do
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Guess Method</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/guessmethod"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/guessmethod" class="numbers">0.0.7</a>
36
+ <a href="http://rubyforge.org/projects/guessmethod" class="numbers">0.0.8</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;guessmethod&#8217;</h1>
39
39
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: guessmethod
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.7
7
- date: 2007-08-06 00:00:00 -06:00
6
+ version: 0.0.8
7
+ date: 2007-09-22 00:00:00 -06:00
8
8
  summary: an aggressive spell checker for irb
9
9
  require_paths:
10
10
  - lib