Text 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ require 'rake/rdoctask'
9
9
 
10
10
  gemspec = Gem::Specification.new do |s|
11
11
  s.name = 'Text'
12
- s.version = '1.1.1'
12
+ s.version = '1.1.2'
13
13
  s.summary ='A collection of text algorithms'
14
14
  s.files = FileList['{lib,test}/**/*.*', 'README.rdoc', 'rakefile.rb']
15
15
  s.require_path = 'lib'
@@ -1,11 +1,18 @@
1
1
  require File.join(File.dirname(__FILE__), 'preamble')
2
- require 'rubygems'
3
- require 'fastercsv'
2
+
3
+ begin
4
+ require 'rubygems' rescue nil
5
+ require 'fastercsv'
6
+ METHOD = [ FasterCSV, :foreach, { :col_sep => ', ' } ]
7
+ rescue LoadError
8
+ require 'csv'
9
+ METHOD = [ CSV, :open, 'r', ', ' ]
10
+ end
4
11
 
5
12
  class DoubleMetaphoneTest < Test::Unit::TestCase
6
13
 
7
14
  def test_cases
8
- FasterCSV.read(File.rel('data', 'double_metaphone.csv'), :col_sep => ', ').each_with_index do |row, i|
15
+ METHOD.shift.send(METHOD.shift, File.rel('data', 'double_metaphone.csv'), *METHOD) do |row|
9
16
  primary, secondary = Text::Metaphone.double_metaphone(row[0])
10
17
 
11
18
  assert_equal row[1], primary
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0.10
3
3
  specification_version: 1
4
4
  name: Text
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.1
6
+ version: 1.1.2
7
7
  date: 2007-02-20 00:00:00 +00:00
8
8
  summary: A collection of text algorithms
9
9
  require_paths: