Fetching contributors…
Cannot retrieve contributors at this time
57 lines (49 sloc) 2.06 KB
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
require 'rspec'
require 'rspec/core/rake_task'
require 'jeweler' do |gemspec| = "has_enumeration"
gemspec.summary = "Support for symbol-based enumerations in ActiveRecord"
gemspec.description = <<-EOF
Extends ActiveRecord with the has_enumeration method allowing a symbolic
enumeration to be stored in an ActiveRecord attribute. The enumeration is
specified as a mapping between symbols and their underlying representation
in the database. Predicates are provided for each symbol in the enumeration
and the symbols may be used in finder methods. When using ActiveRecord 3,
the symbols may also be used when interacting with the underlying Arel attribute
for the enumeration. has_enumeration has been tested with Ruby 1.8.7,
Ruby 1.9.2, JRuby 1.5.5, Rubinius 1.1.0, ActiveRecord 2.3.10, and ActiveRecord
EOF = ""
gemspec.homepage = "" = "Greg Spurrier"
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
task :features => 'features:all'
namespace :features do
task :all => [:common, :rails3] do |t|
features = %w(explicitly_mapped_enumeration implicitly_mapped_enumeration
feature_files = {|f| "features/#{f}.feature"}.join(' ')
t.cucumber_opts = feature_files
end do |t|
# the ../ hack is because of a gherkin bug encountered when the file paths
# have exactly two / characters in some interpreters (coughjrubycough)
features = %w(../features/arel_attributes meta_where_queries)
feature_files = {|f| "features/#{f}.feature"}.join(' ')
# With the ../ hack we have to specify the features directory via -r
t.cucumber_opts = '-r features ' +feature_files
desc "Run all specs"'spec')