Permalink
Browse files

use gem_hadar for building

  • Loading branch information...
1 parent 62b4d03 commit 1708e14d9c2bfe6c11ebba68c2671724b1d60187 @flori flori committed Jul 16, 2011
Showing with 77 additions and 172 deletions.
  1. +2 −2 .gitignore
  2. +3 −0 CHANGES
  3. +5 −0 Gemfile
  4. +7 −9 README → README.rdoc
  5. +25 −133 Rakefile
  6. +1 −1 VERSION
  7. +33 −26 amatch.gemspec
  8. +1 −1 lib/amatch/version.rb
View
@@ -1,3 +1,3 @@
-.*.sw[pon]
-coverage
pkg
+Gemfile.lock
+.*.sw[pon]
View
@@ -1,3 +1,6 @@
+2011-07-16 (0.2.6)
+ * Applied patch by Kevin J. Lynagh <kevin@keminglabs.com> fixing memory
+ leak in Jaro match.
2009-09-23 (0.2.5)
* Added lib to gem's require_paths.
* Using rake-compiler now.
View
@@ -0,0 +1,5 @@
+# vim: set filetype=ruby et sw=2 ts=2:
+
+source :rubygems
+
+gemspec
View
@@ -1,14 +1,14 @@
-== amatch - Approximate Matching Extension for Ruby
+= amatch - Approximate Matching Extension for Ruby
-=== Description
+== Description
This is a collection of classes that can be used for Approximate
matching, searching, and comparing of Strings. They implement algorithms
that compute the Levenshtein edit distance, Sellers edit distance, the
Hamming distance, the longest common subsequence length, the longest common
substring length, the pair distance metric, the Jaro-Winkler metric.
-=== Download
+== Download
The latest version of <b>amatch</b> can be found at
@@ -18,7 +18,7 @@ Online Documentation should be located at
* http://amatch.rubyforge.org
-=== Installation
+== Installation
Just type into the command line as root:
@@ -32,7 +32,7 @@ To install this extension as a gem type
# gem install amatch
-=== Examples
+== Examples
require 'amatch'
# => true
include Amatch
@@ -117,14 +117,12 @@ To install this extension as a gem type
"pattern language".jarowinkler_similar("language of patterns")
# => 0.672222222222222
-=== Author
+== Author
Florian Frank mailto:flori@ping.de
-=== License
+== License
This is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License Version 2 as published by
the Free Software Foundation: http://www.gnu.org/copyleft/gpl.html
-
-
View
158 Rakefile
@@ -1,141 +1,33 @@
# vim: set filetype=ruby et sw=2 ts=2:
-begin
- require 'rake/gempackagetask'
- require 'rake/extensiontask'
-rescue LoadError
-end
-
-require 'rbconfig'
-include Config
-
-require 'rake/clean'
-CLEAN.include 'coverage', 'doc'
-require 'rake/testtask'
-
-MAKE = ENV['MAKE'] || %w[gmake make].find { |c| system(c, '-v') }
-PKG_NAME = 'amatch'
-PKG_VERSION = File.read('VERSION').chomp
-PKG_FILES = FileList["**/*"].exclude(/^(pkg|coverage|doc|tmp)/)
-PKG_DOC_FILES = [ "ext/amatch.c" ].concat(Dir['lib/**/*.rb']) << 'README'
-
-desc "Run unit tests"
-task :test => :compile_ext do
- sh %{testrb -Iext:lib tests/test_*.rb}
-end
-
-desc "Compiling library"
-task :compile_ext do
- cd 'ext' do
- ruby %{extconf.rb}
- sh MAKE
- end
-end
-
-desc "Installing library"
-task :install => :test do
- src, = Dir['ext/amatch.*'].reject { |x| /\.[co]$/.match x }
- filename = File.basename(src)
- dst = File.join(CONFIG["sitelibdir"], filename)
- install(src, dst, :verbose => true)
-end
-
-desc "Removing generated files"
-task :clean do
- cd 'ext' do
- ruby 'extconf.rb'
- sh "#{MAKE} distclean" if File.exist?('Makefile')
- end
-end
-
-desc "Build the documentation"
-task :doc do
- sh "rdoc -m README -t '#{PKG_NAME} - Approximate Matching' #{PKG_DOC_FILES * ' '}"
-end
-
-if defined?(Gem) and defined?(Rake::GemPackageTask) and
- defined?(Rake::ExtensionTask)
-then
- spec_src = <<-GEM
- Gem::Specification.new do |s|
- s.name = '#{PKG_NAME}'
- s.version = '#{PKG_VERSION}'
- s.summary = "Approximate String Matching library"
- s.description = <<EOF
+require 'gem_hadar'
+
+GemHadar do
+ name 'amatch'
+ author 'Florian Frank'
+ email 'flori@ping.de'
+ homepage "http://github.com/flori/#{name}"
+ summary 'Approximate String Matching library'
+ description <<EOT
Amatch is a library for approximate string matching and searching in strings.
Several algorithms can be used to do this, and it's also possible to compute a
similarity metric number between 0.0 and 1.0 for two given strings.
-EOF
-
- s.files = #{PKG_FILES.sort.inspect}
-
- s.extensions << "ext/extconf.rb"
-
- s.require_paths << 'ext' << 'lib'
-
- s.bindir = "bin"
- s.executables = ["agrep.rb"]
- s.default_executable = "agrep.rb"
-
- s.has_rdoc = true
- s.extra_rdoc_files.concat #{PKG_DOC_FILES.sort.inspect}
- s.rdoc_options << '--main' << 'README' <<
- '--title' << "#{PKG_NAME} - Approximate Matching"
- s.test_files.concat Dir['tests/test_*.rb']
-
- s.author = "Florian Frank"
- s.email = "flori@ping.de"
- s.homepage = "http://flori.github.com/#{PKG_NAME}"
- s.rubyforge_project = '#{PKG_NAME}'
- end
- GEM
-
- desc 'Create a gemspec file'
- task :gemspec do
- File.open("#{PKG_NAME}.gemspec", 'w') do |f|
- f.puts spec_src
- end
- end
-
- spec = eval(spec_src)
- Rake::GemPackageTask.new(spec) do |pkg|
- pkg.need_tar = true
- pkg.package_files = PKG_FILES
- end
-
- Rake::ExtensionTask.new do |ext|
- ext.name = PKG_NAME
- ext.gem_spec = spec
- ext.cross_compile = true
- ext.cross_platform = 'i386-mswin32'
- ext.ext_dir = 'ext'
- ext.lib_dir = 'lib'
- end
-end
-
-desc m = "Writing version information for #{PKG_VERSION}"
-task :version do
- puts m
- File.open(File.join('lib', 'amatch', 'version.rb'), 'w') do |v|
- v.puts <<EOT
-module Amatch
- # Amatch version
- VERSION = '#{PKG_VERSION}'
- VERSION_ARRAY = VERSION.split(/\\./).map { |x| x.to_i } # :nodoc:
- VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
- VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
- VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
-end
EOT
+ description 'Library to tail files in Ruby'
+ executables << 'agrep.rb'
+ bindir 'bin'
+ test_dir 'tests'
+ ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock'
+ title "#{name.camelize} - Approximate Matching"
+ readme 'README.rdoc'
+ require_paths %w[lib ext]
+ dependency 'spruz', '~>0.2'
+
+ install_library do
+ libdir = CONFIG["sitelibdir"]
+ src, = Dir['ext/amatch.*'].reject { |x| x =~ /\.[co]$/ }
+ install(src, File.join(libdir, File.basename(src)), :verbose => true)
+ mkdir_p dst = File.join(libdir, 'amatch')
+ install('lib/amatch/version.rb', File.join(dst, 'version.rb'), :verbose => true)
end
end
-
-
-desc "Default task"
-task :default => [ :version, :gemspec, :test ]
-
-desc "Build all gems and archives for a new release."
-task :release => [ :clean, :version, :gemspec, :cross, :native, :gem ] do
- system "#$0 clean native gem"
- system "#$0 clean package"
-end
View
@@ -1 +1 @@
-0.2.5
+0.2.6
View
@@ -1,31 +1,38 @@
- Gem::Specification.new do |s|
- s.name = 'amatch'
- s.version = '0.2.5'
- s.summary = "Approximate String Matching library"
- s.description = <<EOF
-Amatch is a library for approximate string matching and searching in strings.
-Several algorithms can be used to do this, and it's also possible to compute a
-similarity metric number between 0.0 and 1.0 for two given strings.
-EOF
+# -*- encoding: utf-8 -*-
- s.files = ["CHANGES", "COPYING", "README", "Rakefile", "VERSION", "amatch.gemspec", "bin", "bin/agrep.rb", "ext", "ext/amatch.c", "ext/common.h", "ext/extconf.rb", "ext/pair.c", "ext/pair.h", "install.rb", "lib", "lib/amatch", "lib/amatch/version.rb", "tests", "tests/test_hamming.rb", "tests/test_jaro.rb", "tests/test_jaro_winkler.rb", "tests/test_levenshtein.rb", "tests/test_longest_subsequence.rb", "tests/test_longest_substring.rb", "tests/test_pair_distance.rb", "tests/test_sellers.rb"]
+Gem::Specification.new do |s|
+ s.name = %q{amatch}
+ s.version = "0.2.6"
- s.extensions << "ext/extconf.rb"
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Florian Frank"]
+ s.date = %q{2011-07-16}
+ s.default_executable = %q{agrep.rb}
+ s.description = %q{Library to tail files in Ruby}
+ s.email = %q{flori@ping.de}
+ s.executables = ["agrep.rb"]
+ s.extensions = ["ext/extconf.rb"]
+ s.extra_rdoc_files = ["README.rdoc", "lib/amatch/version.rb", "ext/amatch.c", "ext/pair.c"]
+ s.files = [".gitignore", "CHANGES", "COPYING", "Gemfile", "README.rdoc", "Rakefile", "VERSION", "amatch.gemspec", "bin/agrep.rb", "ext/amatch.c", "ext/common.h", "ext/extconf.rb", "ext/pair.c", "ext/pair.h", "install.rb", "lib/amatch/.keep", "lib/amatch/version.rb", "tests/test_hamming.rb", "tests/test_jaro.rb", "tests/test_jaro_winkler.rb", "tests/test_levenshtein.rb", "tests/test_longest_subsequence.rb", "tests/test_longest_substring.rb", "tests/test_pair_distance.rb", "tests/test_sellers.rb"]
+ s.homepage = %q{http://github.com/flori/amatch}
+ s.rdoc_options = ["--title", "Amatch - Approximate Matching", "--main", "README.rdoc"]
+ s.require_paths = ["lib", "ext"]
+ s.rubygems_version = %q{1.6.2}
+ s.summary = %q{Approximate String Matching library}
+ s.test_files = ["tests/test_sellers.rb", "tests/test_jaro.rb", "tests/test_longest_subsequence.rb", "tests/test_longest_substring.rb", "tests/test_hamming.rb", "tests/test_pair_distance.rb", "tests/test_levenshtein.rb", "tests/test_jaro_winkler.rb"]
- s.require_paths << 'ext' << 'lib'
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
- s.bindir = "bin"
- s.executables = ["agrep.rb"]
- s.default_executable = "agrep.rb"
-
- s.has_rdoc = true
- s.extra_rdoc_files.concat ["README", "ext/amatch.c", "lib/amatch/version.rb"]
- s.rdoc_options << '--main' << 'README' <<
- '--title' << "amatch - Approximate Matching"
- s.test_files.concat Dir['tests/test_*.rb']
-
- s.author = "Florian Frank"
- s.email = "flori@ping.de"
- s.homepage = "http://amatch.rubyforge.org"
- s.rubyforge_project = 'amatch'
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<gem_hadar>, ["~> 0.0.3"])
+ s.add_runtime_dependency(%q<spruz>, ["~> 0.2"])
+ else
+ s.add_dependency(%q<gem_hadar>, ["~> 0.0.3"])
+ s.add_dependency(%q<spruz>, ["~> 0.2"])
end
+ else
+ s.add_dependency(%q<gem_hadar>, ["~> 0.0.3"])
+ s.add_dependency(%q<spruz>, ["~> 0.2"])
+ end
+end
View
@@ -1,6 +1,6 @@
module Amatch
# Amatch version
- VERSION = '0.2.5'
+ VERSION = '0.2.6'
VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:

0 comments on commit 1708e14

Please sign in to comment.