Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ lib/remarkable-more.rb
*.diff
memory
*.tmproj
*gemspec
.bundle
Gemfile.lock
16 changes: 8 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
source :gemcutter

gem 'activemodel', '3.0.0.beta4'
gem 'activerecord', '3.0.0.beta4'
gem 'activesupport', '3.0.0.beta4'
gemspec

group :development do
gem 'rake', '0.8.7'
gem 'jeweler', '1.4.0'
gem 'sqlite3-ruby', '1.2.5'
end

rspec_version = File.read(File.expand_path("../RSPEC_VERSION",__FILE__)).strip

group :test do
gem 'rspec', '2.0.0.beta.11'
gem 'rspec-core', '2.0.0.beta.11'
gem 'rspec-expectations', '2.0.0.beta.11'
gem 'rspec-mocks', '2.0.0.beta.11'
gem 'rspec-rails', '2.0.0.beta.11'
gem 'rspec', rspec_version
gem 'rspec-core', rspec_version
gem 'rspec-expectations', rspec_version
gem 'rspec-mocks', rspec_version
gem 'rspec-rails', rspec_version
end
1 change: 1 addition & 0 deletions RAILS_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.3
1 change: 1 addition & 0 deletions REMARKABLE_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.0.alpha4
1 change: 1 addition & 0 deletions RSPEC_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3.0
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
current_dir = File.dirname(__FILE__)
require File.join(current_dir, "remarkable/lib/remarkable/core/version.rb")

require "rubygems"
require "fileutils"
include FileUtils

Expand Down
79 changes: 9 additions & 70 deletions rake_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,74 +1,13 @@
# encoding: utf-8
current_dir = File.dirname(__FILE__)
require File.join(current_dir, "remarkable/lib/remarkable/core/version.rb")
require "bundler"
Bundler.setup
Bundler::GemHelper.install_tasks

require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require "rake"
require "rspec/core/rake_task"

########### Common package && release

RUBY_FORGE_PROJECT = "remarkable"
PROJECT_URL = "http://github.com/carlosbrando/remarkable"

GEM_VERSION = Remarkable::VERSION
PACKAGE_DIR = File.join(File.dirname(__FILE__), 'pkg')
RELEASE_NAME = "REL #{GEM_VERSION}"

RSPEC_VERSION = '2.0.0.alpha11'

def self.configure_gemspec!
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.rubyforge_project = RUBY_FORGE_PROJECT
gemspec.name = GEM_NAME
gemspec.version = GEM_VERSION
gemspec.platform = Gem::Platform::RUBY
gemspec.has_rdoc = true
gemspec.extra_rdoc_files = EXTRA_RDOC_FILES
gemspec.summary = PROJECT_SUMMARY
gemspec.description = PROJECT_DESCRIPTION
gemspec.authors = GEM_AUTHOR
gemspec.email = GEM_EMAIL
gemspec.homepage = PROJECT_URL
gemspec.require_path = 'lib'
gemspec.files = EXTRA_RDOC_FILES + Dir.glob("{lib,locale}/**/*") + Dir.glob("*.gemspec")
gemspec.add_dependency('rspec', ">= #{RSPEC_VERSION}")
yield gemspec if block_given?
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
end
end


########### Common specs

gem 'rspec', ">= #{RSPEC_VERSION}"
# RSpec2
gem 'rspec-expectations'
require 'rspec/core/rake_task'
desc "Run the specs under spec"
RSpec::Core::RakeTask.new do |t|
# Stub
end


########## Common rdoc

Rake::RDocTask.new do |rdoc|
rdoc.main = "README"
rdoc.rdoc_dir = 'rdoc'
rdoc.title = GEM_NAME
rdoc.rdoc_files.include(*EXTRA_RDOC_FILES)
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.options << '--line-numbers' << '--inline-source'
end

def load_project_path(project)
project_path = File.join(File.dirname(__FILE__), project, 'lib')
return nil if $LOAD_PATH.include?(File.expand_path(project_path))
$LOAD_PATH.unshift(File.expand_path(project_path))
desc "Run all examples"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w[--color]
t.verbose = false
end
27 changes: 27 additions & 0 deletions remarkable.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version = File.read(File.expand_path("../REMARKABLE_VERSION",__FILE__)).strip

version

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'remarkable'
s.version = version
s.description = 'Remarkable: a framework for rspec matchers and macros, with support for I18n.'

s.required_ruby_version = '>= 1.8.7'
s.required_rubygems_version = ">= 1.3.6"

s.authors = ["Ho-Sheng Hsiao", "Carlos Brando", "Jos\303\251 Valim"]
s.date = '2010-12-23'
s.description = 'Remarkable: a framework for rspec matchers and macros, with support for I18n.'
s.email = ["hosh@sparkfly.com", "eduardobrando@gmail.com", "jose.valim@gmail.com"]

s.add_dependency('remarkable_core', version)
s.add_dependency('remarkable_activemodel', version)
s.add_dependency('remarkable_activerecord', version)

# TODO Add the following later
# s.add_dependency('remarkable_rails', version)
# TODO find a place for the following
# s.add_dependency('remarkable_datamapper', version)
end
21 changes: 0 additions & 21 deletions remarkable/Rakefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,2 @@
# encoding: utf-8
PROJECT_SUMMARY = "Remarkable: a framework for rspec matchers and macros, with support for I18n."
PROJECT_DESCRIPTION = PROJECT_SUMMARY

GEM_NAME = "remarkable"
GEM_AUTHOR = [ "Ho-Sheng Hsiao", "Carlos Brando", "José Valim" ]
GEM_EMAIL = [ "hosh@sparkfly.com", "eduardobrando@gmail.com", "jose.valim@gmail.com" ]

EXTRA_RDOC_FILES = ["README", "LICENSE", "CHANGELOG"]

require File.join(File.dirname(__FILE__), "..", "rake_helpers.rb")

########### Package && release

configure_gemspec!

########### Specs

desc "Run the specs under spec"
task :pre_commit do
puts "\n=> #{GEM_NAME}: rake spec"
Rake::Task[:spec].execute
end
8 changes: 1 addition & 7 deletions remarkable/lib/remarkable/core/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,7 @@ def localize(object, options = {})
RAILS_I18N = Object.const_defined?(:I18n) unless Object.const_defined?(:RAILS_I18N) # Rails >= 2.2

unless RAILS_I18N
begin
require 'i18n'
rescue LoadError
require 'rubygems'
gem 'i18n'
require 'i18n'
end
require 'i18n'

# Set default locale
::I18n.default_locale = :en
Expand Down
50 changes: 50 additions & 0 deletions remarkable/remarkable_core.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version = File.read(File.expand_path("../../REMARKABLE_VERSION",__FILE__)).strip
rails_version = File.read(File.expand_path("../../RAILS_VERSION",__FILE__)).strip
rspec_version = File.read(File.expand_path("../../RSPEC_VERSION",__FILE__)).strip

Gem::Specification.new do |s|
s.name = %q{remarkable_core}
s.version = version

s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Ho-Sheng Hsiao", "Carlos Brando", "Jos\303\251 Valim"]
s.date = %q{2010-12-23}
s.description = %q{Remarkable: a framework for rspec matchers and macros, with support for I18n.}
s.email = ["hosh@sparkfly.com", "eduardobrando@gmail.com", "jose.valim@gmail.com"]
s.extra_rdoc_files = [
"CHANGELOG",
"LICENSE",
"README"
]
s.files = [
"CHANGELOG",
"LICENSE",
"README",
"lib/remarkable/core.rb",
"lib/remarkable/core/base.rb",
"lib/remarkable/core/core_ext/array.rb",
"lib/remarkable/core/dsl.rb",
"lib/remarkable/core/dsl/assertions.rb",
"lib/remarkable/core/dsl/callbacks.rb",
"lib/remarkable/core/dsl/optionals.rb",
"lib/remarkable/core/i18n.rb",
"lib/remarkable/core/macros.rb",
"lib/remarkable/core/matchers.rb",
"lib/remarkable/core/messages.rb",
"lib/remarkable/core/negative.rb",
"lib/remarkable/core/rspec.rb",
"lib/remarkable/core/version.rb",
"locale/en.yml"
]
s.homepage = %q{http://github.com/carlosbrando/remarkable}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{remarkable}
s.rubygems_version = %q{1.3.7}
s.summary = %q{Remarkable: a framework for rspec matchers and macros, with support for I18n.}

s.add_dependency('i18n', '0.4.1')
s.add_dependency('activesupport', rails_version)
s.add_dependency('rspec', rspec_version)
end

1 change: 0 additions & 1 deletion remarkable/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
$TESTING=true

require 'rubygems'
require 'rspec'

require File.expand_path('path_helpers', File.join(File.dirname(__FILE__), '/../../'))
Expand Down
28 changes: 0 additions & 28 deletions remarkable_activemodel/Rakefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,2 @@
# encoding: utf-8
PROJECT_SUMMARY = "Remarkable ActiveModel: collection of matchers and macros with I18n for ActiveModel"
PROJECT_DESCRIPTION = PROJECT_SUMMARY

GEM_NAME = "remarkable_activemodel"
GEM_AUTHOR = [ "Ho-Sheng Hsiao", "Carlos Brando", "José Valim", "Diego Carrion" ]
GEM_EMAIL = [ "hosh@sparkfly.com", "eduardobrando@gmail.com", "jose.valim@gmail.com", "dc.rec1@gmail.com" ]

EXTRA_RDOC_FILES = ["README", "LICENSE", "CHANGELOG"]

require File.join(File.dirname(__FILE__), "..", "rake_helpers.rb")

########### Package && release

configure_gemspec! do |s|
s.add_dependency('remarkable', "~> #{GEM_VERSION}")
end

########### Specs

RAILS_VERSIONS = ['3.0.0']

desc "Run the specs under spec with supported Rails versions"
task :pre_commit do
RAILS_VERSIONS.each do |version|
ENV['RAILS_VERSION'] = version
puts "\n=> #{GEM_NAME}: rake spec RAILS_VERSION=#{version}"
Rake::Task[:spec].execute
end
end
45 changes: 45 additions & 0 deletions remarkable_activemodel/remarkable_activemodel.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version = File.read(File.expand_path("../../REMARKABLE_VERSION",__FILE__)).strip
rails_version = File.read(File.expand_path("../../RAILS_VERSION",__FILE__)).strip
rspec_version = File.read(File.expand_path("../../RSPEC_VERSION",__FILE__)).strip

Gem::Specification.new do |s|
s.name = %q{remarkable_activemodel}
s.version = version

s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Ho-Sheng Hsiao", "Carlos Brando", "Jos\303\251 Valim", "Diego Carrion"]
s.date = %q{2010-12-23}
s.description = %q{Remarkable ActiveModel: collection of matchers and macros with I18n for ActiveModel}
s.email = ["hosh@sparkfly.com", "eduardobrando@gmail.com", "jose.valim@gmail.com", "dc.rec1@gmail.com"]
s.extra_rdoc_files = [
"CHANGELOG",
"LICENSE",
"README"
]
s.files = [
"CHANGELOG",
"LICENSE",
"README",
"lib/remarkable/active_model.rb",
"lib/remarkable/active_model/base.rb",
"lib/remarkable/active_model/matchers/allow_values_for_matcher.rb",
"lib/remarkable/active_model/matchers/validate_acceptance_of_matcher.rb",
"lib/remarkable/active_model/matchers/validate_confirmation_of_matcher.rb",
"lib/remarkable/active_model/matchers/validate_exclusion_of_matcher.rb",
"lib/remarkable/active_model/matchers/validate_inclusion_of_matcher.rb",
"lib/remarkable/active_model/matchers/validate_length_of_matcher.rb",
"lib/remarkable/active_model/matchers/validate_numericality_of_matcher.rb",
"lib/remarkable/active_model/matchers/validate_presence_of_matcher.rb",
"locale/en.yml"
]
s.homepage = %q{http://github.com/carlosbrando/remarkable}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{remarkable}
s.rubygems_version = %q{1.3.7}
s.summary = %q{Remarkable ActiveModel: collection of matchers and macros with I18n for ActiveModel}

s.add_dependency('rspec', rspec_version)
s.add_dependency('remarkable_core', version)
end

Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,8 @@ def define_and_validate(options={})
end

describe "with message option" do

if RAILS_VERSION =~ /^2.3/
it { should define_and_validate(:message => 'not valid').within(3..5).message('not valid') }
it { should_not define_and_validate(:message => 'not valid').within(3..5).message('valid') }
else
it { should define_and_validate(:too_short => 'not valid', :too_long => 'not valid').within(3..5).message('not valid') }
it { should_not define_and_validate(:too_short => 'not valid', :too_long => 'not valid').within(3..5).message('valid') }
end
it { should define_and_validate(:message => 'not valid').within(3..5).message('not valid') }
it { should_not define_and_validate(:message => 'not valid').within(3..5).message('valid') }

it { should define_and_validate(:is => 4, :message => 'not valid').is(4).message('not valid') }
it { should_not define_and_validate(:is => 4, :message => 'not valid').is(4).message('valid') }
Expand Down
7 changes: 0 additions & 7 deletions remarkable_activemodel/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# encoding: utf-8
require 'rubygems'
require 'rspec'

RAILS_VERSION = ENV['RAILS_VERSION'] || '3.0.0.beta4'

gem 'activesupport', RAILS_VERSION
require 'active_support/all'

gem 'activemodel', RAILS_VERSION
require 'active_model'

require File.expand_path('path_helpers', File.join(File.dirname(__FILE__), '/../../'))
Expand Down
Loading