Skip to content

Commit

Permalink
version 0.5, rails 3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jkraemer committed Sep 7, 2010
1 parent 219c0a3 commit b3fef50
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 125 deletions.
1 change: 1 addition & 0 deletions Gemfile
@@ -0,0 +1 @@
gemspec
31 changes: 12 additions & 19 deletions acts_as_ferret.gemspec
@@ -1,7 +1,9 @@
require File.expand_path("../lib/acts_as_ferret/version", __FILE__)

Gem::Specification.new do |s|

s.name = 'acts_as_ferret'
s.version = '0.4.8.rails3'
s.version = ActsAsFerret::VERSION
s.authors = ['Jens Kraemer']
s.summary = 'acts_as_ferret - Ferret based full text search for any ActiveRecord model'
s.description = 'Rails plugin that adds powerful full text search capabilities to ActiveRecord models.'
Expand All @@ -12,37 +14,26 @@ Gem::Specification.new do |s|
s.bindir = 'bin'
s.executables = ['aaf_install']
s.default_executable = 'aaf_install'
s.require_paths = ["lib"]


s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>=1.8'
s.required_ruby_version = '>= 1.8.7'
s.rubygems_version = '1.3.6'
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency('ferret', [">= 0.11.6"])
else
s.add_dependency('ferret', [">= 0.11.6"])
end
else
s.add_dependency('ferret', [">= 0.11.6"])
end

# the latest official published ferret gem is 0.11.6 which is incompatible with Ruby 1.9.x.
# Therefore I decided to publish the jk-ferret gem built from git head.
s.add_dependency 'jk-ferret', ">= 0.11.8"
s.add_dependency 'rails', ">= 3.0"


s.has_rdoc = true
s.rdoc_options << "--charset=UTF-8" << '--title' << 'ActsAsFeret - Ferret powered full text search for Rails' << '--main' << 'README'


s.extra_rdoc_files = [
'LICENSE',
'README'
]

s.test_files = Dir['test/**/*rb']
s.files = [
'*rb',
'README',
'LICENSE',
'bin/*',
Expand All @@ -54,4 +45,6 @@ Gem::Specification.new do |s|
'lib/**/*rb'
].map{|p| Dir[p]}.flatten

s.require_path = 'lib'

end
3 changes: 3 additions & 0 deletions lib/acts_as_ferret/version.rb
@@ -0,0 +1,3 @@
module ActsAsFerret
VERSION = '0.5'
end
112 changes: 6 additions & 106 deletions rakefile
@@ -1,117 +1,17 @@
# rakefile for acts_as_ferret.
# use to create a gem or generate rdoc api documentation.
#
# RELEASE creation:
# rake release REL=x.y.z

require 'pathname'
require 'yaml'
require 'rake'
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/testtask'
require 'rake/contrib/rubyforgepublisher'

def announce(msg='')
STDERR.puts msg
end


PKG_NAME = 'acts_as_ferret'
PKG_VERSION = ENV['REL']
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
RUBYFORGE_PROJECT = 'actsasferret'
RUBYFORGE_USER = 'jkraemer'

desc 'Default: run unit tests.'
task :default => :test

desc 'Test the acts_as_ferret plugin.'
desc 'Test the library.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end

desc 'Generate documentation for the acts_as_ferret plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'html'
rdoc.title = "acts_as_ferret - Ferret based full text search for any ActiveRecord model"
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.options << '--main' << 'README'
rdoc.rdoc_files.include('README', 'LICENSE')
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.rdoc_files.include('lib/**/*.rb')
end

# FIXME
desc "Publish the API documentation"
task :pdoc => [:rdoc] do
# Rake::RubyForgePublisher.new(RUBYFORGE_PROJECT, RUBYFORGE_USER).upload
end
gemspec = eval(File.read("acts_as_ferret.gemspec"))

if PKG_VERSION
spec = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION.dup
s.platform = Gem::Platform::RUBY
s.rubyforge_project = 'acts_as_ferret'
s.summary = "acts_as_ferret - Ferret based full text search for any ActiveRecord model"
s.description = "Rails plugin that adds powerful full text search capabilities to ActiveRecord models."
s.files = Dir.glob('**/*', File::FNM_DOTMATCH).reject do |f|
[ /\.$/, /sqlite$/, /\.log$/, /^pkg/, /\.svn/, /\.git/, /\.\w+\.sw.$/,
/^html/, /\~$/, /\/\._/, /\/#/, /\._/, /tmp\// ].any? {|regex| f =~ regex }
end
#s.files = FileList["{lib,test}/**/*"].to_a + %w(README MIT-LICENSE CHANGELOG)
s.add_dependency 'ferret'
s.require_path = 'lib'
s.bindir = "bin"
s.executables = ["aaf_install"]
s.default_executable = "aaf_install"
# s.autorequire = 'acts_as_ferret'
s.has_rdoc = true
# s.test_files = Dir['test/**/*_test.rb']
s.author = "Jens Kraemer"
s.email = "jk@jkraemer.net"
s.homepage = "http://github.com/jkraemer/acts_as_ferret"
end

desc "Update the gemspec for GitHub's gem server"
task :gemspec do
Pathname("#{spec.name}.gemspec").open('w') {|f| f << YAML.dump(spec) }
end
task :build => "#{gemspec.full_name}.gem"

desc 'build the gem'
task :package => :gemspec do
`gem build acts_as_ferret.gemspec`
`mv #{PKG_FILE_NAME}.gem pkg/#{PKG_FILE_NAME}.gem`
end

desc 'publish to rubygems.org'
task :push => [ :package, :tag ] do
if ENV['RELTEST']
announce "Release Task Testing, not pushing to rubygems.org"
else
`gem push pkg/#{PKG_FILE_NAME}.gem`
end
end


desc "tag the new release"
task :tag do
reltag = "rel_#{PKG_VERSION.gsub(/\./, '_')}"
announce "Tagging with [#{PKG_VERSION}]"
if ENV['RELTEST']
announce "Release Task Testing, skipping tagging"
else
`git tag -m 'tagging release #{reltag}' -s #{reltag} HEAD`
`git tag -d stable`
`git tag -m 'tagging HEAD as stable' -s stable HEAD`
end
end

desc 'Publish the gem and API docs'
task :release => [:pdoc, :push ]

file "#{gemspec.full_name}.gem" => gemspec.files + ["acts_as_ferret.gemspec"] do
system "gem build acts_as_ferret.gemspec"
system "gem install #{gemspec.full_name}.gem"
end

0 comments on commit b3fef50

Please sign in to comment.