From b1342cb5983c150a4a83ac02bfdf90eb7eb93234 Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 13:48:21 -0400 Subject: [PATCH 1/9] Remove independent Rails 3 test --- Rakefile | 7 - test/rails3/models/name.rb | 3 - test/rails3/models/user.rb | 7 - test/rails3/models/user_with_allow_new.rb | 9 -- test/rails3/models/user_with_allow_nil.rb | 9 -- test/rails3/models/user_with_both.rb | 7 - test/rails3/models/user_with_fk.rb | 9 -- test/rails3/models/user_with_has_many.rb | 7 - test/rails3/models/user_with_old_syntax.rb | 9 -- test/rails3/models/user_with_poly.rb | 9 -- .../rails3/models/user_with_poly_allow_nil.rb | 9 -- test/rails3/test_helper.rb | 28 ---- test/rails3/validates_existence_test.rb | 125 ------------------ 13 files changed, 238 deletions(-) delete mode 100644 test/rails3/models/name.rb delete mode 100644 test/rails3/models/user.rb delete mode 100644 test/rails3/models/user_with_allow_new.rb delete mode 100644 test/rails3/models/user_with_allow_nil.rb delete mode 100644 test/rails3/models/user_with_both.rb delete mode 100644 test/rails3/models/user_with_fk.rb delete mode 100644 test/rails3/models/user_with_has_many.rb delete mode 100644 test/rails3/models/user_with_old_syntax.rb delete mode 100644 test/rails3/models/user_with_poly.rb delete mode 100644 test/rails3/models/user_with_poly_allow_nil.rb delete mode 100644 test/rails3/test_helper.rb delete mode 100644 test/rails3/validates_existence_test.rb diff --git a/Rakefile b/Rakefile index ded994a..840b1a8 100644 --- a/Rakefile +++ b/Rakefile @@ -23,13 +23,6 @@ rescue LoadError puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" end -Rake::TestTask.new(:test_rails3) do |t| - t.libs << "lib" - t.libs << "test/rails3" - t.pattern = "test/rails3/**/*_test.rb" - t.verbose = true -end - Rake::TestTask.new(:test_rails31) do |t| t.libs << "lib" t.libs << "test/rails31" diff --git a/test/rails3/models/name.rb b/test/rails3/models/name.rb deleted file mode 100644 index 452bb03..0000000 --- a/test/rails3/models/name.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Name < ActiveRecord::Base - -end \ No newline at end of file diff --git a/test/rails3/models/user.rb b/test/rails3/models/user.rb deleted file mode 100644 index 7eac033..0000000 --- a/test/rails3/models/user.rb +++ /dev/null @@ -1,7 +0,0 @@ -class User < ActiveRecord::Base - - belongs_to :name - - validates :name, :existence => true - -end diff --git a/test/rails3/models/user_with_allow_new.rb b/test/rails3/models/user_with_allow_new.rb deleted file mode 100644 index 3669944..0000000 --- a/test/rails3/models/user_with_allow_new.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UserWithAllowNew < ActiveRecord::Base - - self.table_name = "users" - - belongs_to :name - - validates :name, :existence => { :allow_new => true } - -end diff --git a/test/rails3/models/user_with_allow_nil.rb b/test/rails3/models/user_with_allow_nil.rb deleted file mode 100644 index 638ae32..0000000 --- a/test/rails3/models/user_with_allow_nil.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UserWithAllowNil < ActiveRecord::Base - - self.table_name = "users" - - belongs_to :name - - validates :name, :existence => true, :allow_nil => true - -end \ No newline at end of file diff --git a/test/rails3/models/user_with_both.rb b/test/rails3/models/user_with_both.rb deleted file mode 100644 index 205c956..0000000 --- a/test/rails3/models/user_with_both.rb +++ /dev/null @@ -1,7 +0,0 @@ -class UserWithBoth < ActiveRecord::Base - self.table_name = "users" - - belongs_to :name - - validates :name, :existence => {:both => false} -end \ No newline at end of file diff --git a/test/rails3/models/user_with_fk.rb b/test/rails3/models/user_with_fk.rb deleted file mode 100644 index 4b1756e..0000000 --- a/test/rails3/models/user_with_fk.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UserWithFk < ActiveRecord::Base - - self.table_name = "users2" - - belongs_to :name, :foreign_key => :custom_id - - validates :name, :existence => true - -end \ No newline at end of file diff --git a/test/rails3/models/user_with_has_many.rb b/test/rails3/models/user_with_has_many.rb deleted file mode 100644 index bf99703..0000000 --- a/test/rails3/models/user_with_has_many.rb +++ /dev/null @@ -1,7 +0,0 @@ -class UserWithHasMany < ActiveRecord::Base - self.table_name = "users" - - has_many :names - - validates :names, :existence => true -end \ No newline at end of file diff --git a/test/rails3/models/user_with_old_syntax.rb b/test/rails3/models/user_with_old_syntax.rb deleted file mode 100644 index 25520da..0000000 --- a/test/rails3/models/user_with_old_syntax.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UserWithOldSyntax < ActiveRecord::Base - - self.table_name = "users" - - belongs_to :name - - validates_existence_of :name - -end diff --git a/test/rails3/models/user_with_poly.rb b/test/rails3/models/user_with_poly.rb deleted file mode 100644 index 13ed318..0000000 --- a/test/rails3/models/user_with_poly.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UserWithPoly < ActiveRecord::Base - - self.table_name = "users" - - belongs_to :relation, :polymorphic => true - - validates :relation, :existence => true - -end diff --git a/test/rails3/models/user_with_poly_allow_nil.rb b/test/rails3/models/user_with_poly_allow_nil.rb deleted file mode 100644 index 03879d4..0000000 --- a/test/rails3/models/user_with_poly_allow_nil.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UserWithPolyAllowNil < ActiveRecord::Base - - self.table_name = "users" - - belongs_to :relation, :polymorphic => true - - validates :relation, :existence => true, :allow_nil => true - -end \ No newline at end of file diff --git a/test/rails3/test_helper.rb b/test/rails3/test_helper.rb deleted file mode 100644 index dfeed45..0000000 --- a/test/rails3/test_helper.rb +++ /dev/null @@ -1,28 +0,0 @@ -require "rubygems" - -gem "rails", "~> 3.0.7" - -require "rails" -require "sqlite3" -require "test/unit" -require "active_record" -require "active_record/base" - -ActiveRecord::Migration.verbose = false -ActiveRecord::Base.establish_connection( - "adapter" => "sqlite3", - "database" => ":memory:" -) - -require File.join(File.dirname(__FILE__), "..", "..", "lib", "validates_existence") - -autoload :Name, File.join(File.dirname(__FILE__), "models", "name.rb") -autoload :User, File.join(File.dirname(__FILE__), "models", "user.rb") -autoload :UserWithOldSyntax, File.join(File.dirname(__FILE__), "models", "user_with_old_syntax.rb") -autoload :UserWithAllowNil, File.join(File.dirname(__FILE__), "models", "user_with_allow_nil.rb") -autoload :UserWithAllowNew, File.join(File.dirname(__FILE__), "models", "user_with_allow_new.rb") -autoload :UserWithPoly, File.join(File.dirname(__FILE__), "models", "user_with_poly.rb") -autoload :UserWithPolyAllowNil, File.join(File.dirname(__FILE__), "models", "user_with_poly_allow_nil.rb") -autoload :UserWithHasMany, File.join(File.dirname(__FILE__), "models", "user_with_has_many.rb") -autoload :UserWithBoth, File.join(File.dirname(__FILE__), "models", "user_with_both.rb") -autoload :UserWithFk, File.join(File.dirname(__FILE__), "models", "user_with_fk.rb") diff --git a/test/rails3/validates_existence_test.rb b/test/rails3/validates_existence_test.rb deleted file mode 100644 index beb3229..0000000 --- a/test/rails3/validates_existence_test.rb +++ /dev/null @@ -1,125 +0,0 @@ -require 'test_helper.rb' - -class TestValidatesExistence < Test::Unit::TestCase - - def setup - ActiveRecord::Schema.define(:version => 1) do - - create_table :names, :force => true do |t| - t.column :name, :string - end - - create_table :users, :force => true do |t| - t.references :name - t.references :relation, :polymorphic => true - end - - create_table :users2, :force => true do |t| - t.column :custom_id, :integer - end - - end - end - - def teardown - ActiveRecord::Base.connection.drop_table(:users) - ActiveRecord::Base.connection.drop_table(:names) - end - - def test_save_with_no_relation - user = User.new - assert_equal user.save, false - assert_not_nil user.errors[:name] - assert_not_nil user.errors[:name_id] - end - - def test_save_with_relation - name = Name.create(:name => "foo") - assert_equal User.new(:name => name).save, true - end - - def test_save_with_bogus_id - assert_equal User.new(:name_id => 100).save, false - end - - def test_allow_nil - assert_equal UserWithAllowNil.new.save, true - end - - def test_poly_relation - assert_equal UserWithPoly.new.save, false - end - - def test_poly_relation_with_name - name = Name.create(:name => "bar") - assert_equal UserWithPoly.new(:relation => name).save, true - end - - def test_poly_relation_with_allow_nil - assert_equal UserWithPolyAllowNil.new.save, true - end - - def test_argument_error - assert_raise ArgumentError do - UserWithHasMany.new.save - end - end - - def test_errors_on_one_field - user = UserWithBoth.new - user.save - - assert_not_nil user.errors[:name] - assert_empty user.errors[:name_id] - end - - def test_save_with_new_record - name = Name.create(:name => "foobar") - user = User.create(:name => name) - - user.name = Name.new - user.save - - assert_not_nil user.errors[:name] - end - - def test_save_with_new_record_and_allow_new - name = Name.new(:name => "foo") - assert_equal UserWithAllowNew.new(:name => name).save, true - end - - def test_save_with_custom_fk - user = UserWithFk.new - user.save - - assert_not_nil user.errors[:name] - assert_not_nil user.errors[:custom_id] - end - - def test_message_without_i18n - I18n.locale = :en - - user = User.new :name_id => 100 - user.save - - assert_equal ["does not exist"], user.errors[:name] - end - - def test_message_with_i18n - I18n.load_path << File.expand_path("./test/shared/locales/pt.yml") - I18n.backend.send(:init_translations) - I18n.locale = :pt - - user = User.new :name_id => 100 - user.save - - assert_equal %w(inexistente), user.errors[:name] - end - - def test_old_syntax - name = Name.create(:name => "foo") - assert_equal UserWithOldSyntax.new(:name => name).save, true - end - -end - From 524701f5db863bae504d713c2710678af5fc80eb Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 13:56:53 -0400 Subject: [PATCH 2/9] Move everything into primary test dir --- Rakefile | 6 +++--- test/{shared => }/locales/pt.yml | 0 test/{rails31 => }/models/name.rb | 0 test/{rails31 => }/models/user.rb | 0 test/{rails31 => }/models/user_with_allow_new.rb | 0 test/{rails31 => }/models/user_with_allow_nil.rb | 0 test/{rails31 => }/models/user_with_both.rb | 0 test/{rails31 => }/models/user_with_fk.rb | 0 test/{rails31 => }/models/user_with_has_many.rb | 0 test/{rails31 => }/models/user_with_old_syntax.rb | 0 test/{rails31 => }/models/user_with_poly.rb | 0 test/{rails31 => }/models/user_with_poly_allow_nil.rb | 0 test/{rails31 => }/test_helper.rb | 2 +- test/{rails31 => }/validates_existence_test.rb | 4 ++-- 14 files changed, 6 insertions(+), 6 deletions(-) rename test/{shared => }/locales/pt.yml (100%) rename test/{rails31 => }/models/name.rb (100%) rename test/{rails31 => }/models/user.rb (100%) rename test/{rails31 => }/models/user_with_allow_new.rb (100%) rename test/{rails31 => }/models/user_with_allow_nil.rb (100%) rename test/{rails31 => }/models/user_with_both.rb (100%) rename test/{rails31 => }/models/user_with_fk.rb (100%) rename test/{rails31 => }/models/user_with_has_many.rb (100%) rename test/{rails31 => }/models/user_with_old_syntax.rb (100%) rename test/{rails31 => }/models/user_with_poly.rb (100%) rename test/{rails31 => }/models/user_with_poly_allow_nil.rb (100%) rename test/{rails31 => }/test_helper.rb (93%) rename test/{rails31 => }/validates_existence_test.rb (96%) diff --git a/Rakefile b/Rakefile index 840b1a8..9d089a8 100644 --- a/Rakefile +++ b/Rakefile @@ -23,9 +23,9 @@ rescue LoadError puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" end -Rake::TestTask.new(:test_rails31) do |t| +Rake::TestTask.new(:test) do |t| t.libs << "lib" - t.libs << "test/rails31" - t.pattern = "test/rails31/**/*_test.rb" + t.libs << "test" + t.pattern = "test/**/*_test.rb" t.verbose = true end diff --git a/test/shared/locales/pt.yml b/test/locales/pt.yml similarity index 100% rename from test/shared/locales/pt.yml rename to test/locales/pt.yml diff --git a/test/rails31/models/name.rb b/test/models/name.rb similarity index 100% rename from test/rails31/models/name.rb rename to test/models/name.rb diff --git a/test/rails31/models/user.rb b/test/models/user.rb similarity index 100% rename from test/rails31/models/user.rb rename to test/models/user.rb diff --git a/test/rails31/models/user_with_allow_new.rb b/test/models/user_with_allow_new.rb similarity index 100% rename from test/rails31/models/user_with_allow_new.rb rename to test/models/user_with_allow_new.rb diff --git a/test/rails31/models/user_with_allow_nil.rb b/test/models/user_with_allow_nil.rb similarity index 100% rename from test/rails31/models/user_with_allow_nil.rb rename to test/models/user_with_allow_nil.rb diff --git a/test/rails31/models/user_with_both.rb b/test/models/user_with_both.rb similarity index 100% rename from test/rails31/models/user_with_both.rb rename to test/models/user_with_both.rb diff --git a/test/rails31/models/user_with_fk.rb b/test/models/user_with_fk.rb similarity index 100% rename from test/rails31/models/user_with_fk.rb rename to test/models/user_with_fk.rb diff --git a/test/rails31/models/user_with_has_many.rb b/test/models/user_with_has_many.rb similarity index 100% rename from test/rails31/models/user_with_has_many.rb rename to test/models/user_with_has_many.rb diff --git a/test/rails31/models/user_with_old_syntax.rb b/test/models/user_with_old_syntax.rb similarity index 100% rename from test/rails31/models/user_with_old_syntax.rb rename to test/models/user_with_old_syntax.rb diff --git a/test/rails31/models/user_with_poly.rb b/test/models/user_with_poly.rb similarity index 100% rename from test/rails31/models/user_with_poly.rb rename to test/models/user_with_poly.rb diff --git a/test/rails31/models/user_with_poly_allow_nil.rb b/test/models/user_with_poly_allow_nil.rb similarity index 100% rename from test/rails31/models/user_with_poly_allow_nil.rb rename to test/models/user_with_poly_allow_nil.rb diff --git a/test/rails31/test_helper.rb b/test/test_helper.rb similarity index 93% rename from test/rails31/test_helper.rb rename to test/test_helper.rb index 4f28527..333d704 100644 --- a/test/rails31/test_helper.rb +++ b/test/test_helper.rb @@ -14,7 +14,7 @@ "database" => ":memory:" ) -require File.join(File.dirname(__FILE__), "..", "..", "lib", "validates_existence") +require File.join(File.dirname(__FILE__), "..", "lib", "validates_existence") autoload :Name, File.join(File.dirname(__FILE__), "models", "name.rb") autoload :User, File.join(File.dirname(__FILE__), "models", "user.rb") diff --git a/test/rails31/validates_existence_test.rb b/test/validates_existence_test.rb similarity index 96% rename from test/rails31/validates_existence_test.rb rename to test/validates_existence_test.rb index 60fb6e3..90aba8c 100644 --- a/test/rails31/validates_existence_test.rb +++ b/test/validates_existence_test.rb @@ -1,4 +1,4 @@ -require 'test_helper.rb' +require 'test_helper' class TestValidatesExistence < Test::Unit::TestCase @@ -110,7 +110,7 @@ def test_message_without_i18n end def test_message_with_i18n - I18n.load_path << File.expand_path("./test/shared/locales/pt.yml") + I18n.load_path << File.expand_path("./test/locales/pt.yml") I18n.backend.send(:init_translations) I18n.locale = :pt From 2b50b6a8deca3748b5e60bb2119b87ca214a0898 Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 13:57:25 -0400 Subject: [PATCH 3/9] Switch rails dependency to activie record --- test/test_helper.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 333d704..dbc8e8e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,8 +1,7 @@ require "rubygems" -gem "rails", ">= 3.1.0" +gem "activerecord", ">= 3.1.0" -require "rails" require "sqlite3" require "test/unit" require "active_record" From a11ff5d237b9a4e217b50d8afa66f24827c680b0 Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 14:34:22 -0400 Subject: [PATCH 4/9] Add development dependencies --- Rakefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 9d089a8..5928010 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,4 @@ +require "rubygems" require "rake" require "rake/testtask" require "rake/clean" @@ -17,7 +18,10 @@ begin jewel.description = "A library for validating model association existence." jewel.authors = ["Tanel Suurhans", "Tarmo Lehtpuu"] jewel.files = FileList["rails/*.rb", "lib/**/*.rb", "*.rb", "MIT-LICENCE", "README.markdown"] - jewel.add_dependency "active_record" + jewel.add_dependency "activerecord", ">= 3.0.0" + jewel.add_development_dependency "appraisal", ">= 1.0.0.beta" + jewel.add_development_dependency "minitest", "~> 4.0" + jewel.add_development_dependency "sqlite3" end rescue LoadError puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" From a42929e8e77911a9877b593b589360c6820ea57e Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 14:35:07 -0400 Subject: [PATCH 5/9] Remove uneeded gem version spec in gemfile --- test/test_helper.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index dbc8e8e..87eae1d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,4 @@ require "rubygems" - -gem "activerecord", ">= 3.1.0" - require "sqlite3" require "test/unit" require "active_record" From 7e1cad182d941995a2a3090d30db3ac233f8668b Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 14:35:38 -0400 Subject: [PATCH 6/9] Add appraisals for different ActiveRecord versions --- Appraisals | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Appraisals diff --git a/Appraisals b/Appraisals new file mode 100644 index 0000000..70c6fe3 --- /dev/null +++ b/Appraisals @@ -0,0 +1,19 @@ +appraise "3.0" do + gem "activerecord", "~> 3.0.20" + gem "validates_existence", :path => "../" +end + +appraise "3.1" do + gem "activerecord", "~> 3.1.12" + gem "validates_existence", :path => "../" +end + +appraise "3.2" do + gem "activerecord", "~> 3.2.15" + gem "validates_existence", :path => "../" +end + +appraise "4.0" do + gem "activerecord", "~> 4.0.0" + gem "validates_existence", :path => "../" +end From 25bb376a45de844bed62a3ecadeb4bc109890111 Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 14:36:19 -0400 Subject: [PATCH 7/9] Generate gemspec and gemfiles for testing updates --- Gemfile | 4 ++ Gemfile.lock | 90 +++++++++++++++++++++++++++++++++++ gemfiles/3.0.gemfile | 9 ++++ gemfiles/3.0.gemfile.lock | 89 +++++++++++++++++++++++++++++++++++ gemfiles/3.1.gemfile | 9 ++++ gemfiles/3.1.gemfile.lock | 90 +++++++++++++++++++++++++++++++++++ gemfiles/3.2.gemfile | 9 ++++ gemfiles/3.2.gemfile.lock | 90 +++++++++++++++++++++++++++++++++++ gemfiles/4.0.gemfile | 9 ++++ gemfiles/4.0.gemfile.lock | 94 +++++++++++++++++++++++++++++++++++++ validates_existence.gemspec | 40 ++++++++++++++-- 11 files changed, 529 insertions(+), 4 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 gemfiles/3.0.gemfile create mode 100644 gemfiles/3.0.gemfile.lock create mode 100644 gemfiles/3.1.gemfile create mode 100644 gemfiles/3.1.gemfile.lock create mode 100644 gemfiles/3.2.gemfile create mode 100644 gemfiles/3.2.gemfile.lock create mode 100644 gemfiles/4.0.gemfile create mode 100644 gemfiles/4.0.gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..f68a903 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gemspec + diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..636bdbd --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,90 @@ +PATH + remote: . + specs: + validates_existence (0.9.1) + activerecord (>= 3.0.0) + jeweler + validates_existence + +GEM + remote: https://rubygems.org/ + specs: + activemodel (4.0.0) + activesupport (= 4.0.0) + builder (~> 3.1.0) + activerecord (4.0.0) + activemodel (= 4.0.0) + activerecord-deprecated_finders (~> 1.0.2) + activesupport (= 4.0.0) + arel (~> 4.0.0) + activerecord-deprecated_finders (1.0.3) + activesupport (4.0.0) + i18n (~> 0.6, >= 0.6.4) + minitest (~> 4.2) + multi_json (~> 1.3) + thread_safe (~> 0.1) + tzinfo (~> 0.3.37) + addressable (2.3.5) + appraisal (1.0.0.beta1) + bundler + rake + thor (~> 0.18.1) + arel (4.0.1) + atomic (1.1.14) + builder (3.1.4) + faraday (0.8.8) + multipart-post (~> 1.2.0) + git (1.2.6) + github_api (0.10.1) + addressable + faraday (~> 0.8.1) + hashie (>= 1.2) + multi_json (~> 1.4) + nokogiri (~> 1.5.2) + oauth2 + hashie (2.0.5) + highline (1.6.20) + httpauth (0.2.0) + i18n (0.6.5) + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc + json (1.8.1) + jwt (0.1.8) + multi_json (>= 1.5) + minitest (4.7.5) + multi_json (1.8.2) + multi_xml (0.5.5) + multipart-post (1.2.0) + nokogiri (1.5.10) + oauth2 (0.9.2) + faraday (~> 0.8) + httpauth (~> 0.2) + jwt (~> 0.1.4) + multi_json (~> 1.0) + multi_xml (~> 0.5) + rack (~> 1.2) + rack (1.5.2) + rake (10.1.0) + rdoc (4.0.1) + json (~> 1.4) + sqlite3 (1.3.7) + thor (0.18.1) + thread_safe (0.1.3) + atomic + tzinfo (0.3.38) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal (>= 1.0.0.beta) + minitest (~> 4.0) + sqlite3 + validates_existence! diff --git a/gemfiles/3.0.gemfile b/gemfiles/3.0.gemfile new file mode 100644 index 0000000..c02cafc --- /dev/null +++ b/gemfiles/3.0.gemfile @@ -0,0 +1,9 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" +gem "activerecord", "~> 3.0.20" +gem "validates_existence", :path=>"../" + +gemspec :path=>".././" diff --git a/gemfiles/3.0.gemfile.lock b/gemfiles/3.0.gemfile.lock new file mode 100644 index 0000000..d02dcb1 --- /dev/null +++ b/gemfiles/3.0.gemfile.lock @@ -0,0 +1,89 @@ +GIT + remote: git@github.com:technicalpickles/jeweler.git + revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 + specs: + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc + +PATH + remote: .. + specs: + validates_existence (0.9.1) + activerecord (>= 3.0.0) + jeweler + validates_existence + +GEM + remote: https://rubygems.org/ + specs: + activemodel (3.0.20) + activesupport (= 3.0.20) + builder (~> 2.1.2) + i18n (~> 0.5.0) + activerecord (3.0.20) + activemodel (= 3.0.20) + activesupport (= 3.0.20) + arel (~> 2.0.10) + tzinfo (~> 0.3.23) + activesupport (3.0.20) + addressable (2.3.5) + appraisal (1.0.0.beta1) + bundler + rake + thor (~> 0.18.1) + arel (2.0.10) + builder (2.1.2) + faraday (0.8.8) + multipart-post (~> 1.2.0) + git (1.2.6) + github_api (0.10.1) + addressable + faraday (~> 0.8.1) + hashie (>= 1.2) + multi_json (~> 1.4) + nokogiri (~> 1.5.2) + oauth2 + hashie (2.0.5) + highline (1.6.20) + httpauth (0.2.0) + i18n (0.5.0) + json (1.8.1) + jwt (0.1.8) + multi_json (>= 1.5) + minitest (4.7.5) + multi_json (1.8.2) + multi_xml (0.5.5) + multipart-post (1.2.0) + nokogiri (1.5.10) + oauth2 (0.9.2) + faraday (~> 0.8) + httpauth (~> 0.2) + jwt (~> 0.1.4) + multi_json (~> 1.0) + multi_xml (~> 0.5) + rack (~> 1.2) + rack (1.5.2) + rake (10.1.0) + rdoc (4.0.1) + json (~> 1.4) + sqlite3 (1.3.7) + thor (0.18.1) + tzinfo (0.3.38) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (~> 3.0.20) + appraisal (>= 1.0.0.beta) + jeweler! + minitest (~> 4.0) + sqlite3 + validates_existence! diff --git a/gemfiles/3.1.gemfile b/gemfiles/3.1.gemfile new file mode 100644 index 0000000..fdec761 --- /dev/null +++ b/gemfiles/3.1.gemfile @@ -0,0 +1,9 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" +gem "activerecord", "~> 3.1.12" +gem "validates_existence", :path=>"../" + +gemspec :path=>".././" diff --git a/gemfiles/3.1.gemfile.lock b/gemfiles/3.1.gemfile.lock new file mode 100644 index 0000000..0dd7490 --- /dev/null +++ b/gemfiles/3.1.gemfile.lock @@ -0,0 +1,90 @@ +GIT + remote: git@github.com:technicalpickles/jeweler.git + revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 + specs: + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc + +PATH + remote: .. + specs: + validates_existence (0.9.1) + activerecord (>= 3.0.0) + jeweler + validates_existence + +GEM + remote: https://rubygems.org/ + specs: + activemodel (3.1.12) + activesupport (= 3.1.12) + builder (~> 3.0.0) + i18n (~> 0.6) + activerecord (3.1.12) + activemodel (= 3.1.12) + activesupport (= 3.1.12) + arel (~> 2.2.3) + tzinfo (~> 0.3.29) + activesupport (3.1.12) + multi_json (~> 1.0) + addressable (2.3.5) + appraisal (1.0.0.beta1) + bundler + rake + thor (~> 0.18.1) + arel (2.2.3) + builder (3.0.4) + faraday (0.8.8) + multipart-post (~> 1.2.0) + git (1.2.6) + github_api (0.10.1) + addressable + faraday (~> 0.8.1) + hashie (>= 1.2) + multi_json (~> 1.4) + nokogiri (~> 1.5.2) + oauth2 + hashie (2.0.5) + highline (1.6.20) + httpauth (0.2.0) + i18n (0.6.5) + json (1.8.1) + jwt (0.1.8) + multi_json (>= 1.5) + minitest (4.7.5) + multi_json (1.8.2) + multi_xml (0.5.5) + multipart-post (1.2.0) + nokogiri (1.5.10) + oauth2 (0.9.2) + faraday (~> 0.8) + httpauth (~> 0.2) + jwt (~> 0.1.4) + multi_json (~> 1.0) + multi_xml (~> 0.5) + rack (~> 1.2) + rack (1.5.2) + rake (10.1.0) + rdoc (4.0.1) + json (~> 1.4) + sqlite3 (1.3.7) + thor (0.18.1) + tzinfo (0.3.38) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (~> 3.1.12) + appraisal (>= 1.0.0.beta) + jeweler! + minitest (~> 4.0) + sqlite3 + validates_existence! diff --git a/gemfiles/3.2.gemfile b/gemfiles/3.2.gemfile new file mode 100644 index 0000000..b0d3218 --- /dev/null +++ b/gemfiles/3.2.gemfile @@ -0,0 +1,9 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" +gem "activerecord", "~> 3.2.15" +gem "validates_existence", :path=>"../" + +gemspec :path=>".././" diff --git a/gemfiles/3.2.gemfile.lock b/gemfiles/3.2.gemfile.lock new file mode 100644 index 0000000..eedc30f --- /dev/null +++ b/gemfiles/3.2.gemfile.lock @@ -0,0 +1,90 @@ +GIT + remote: git@github.com:technicalpickles/jeweler.git + revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 + specs: + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc + +PATH + remote: .. + specs: + validates_existence (0.9.1) + activerecord (>= 3.0.0) + jeweler + validates_existence + +GEM + remote: https://rubygems.org/ + specs: + activemodel (3.2.15) + activesupport (= 3.2.15) + builder (~> 3.0.0) + activerecord (3.2.15) + activemodel (= 3.2.15) + activesupport (= 3.2.15) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activesupport (3.2.15) + i18n (~> 0.6, >= 0.6.4) + multi_json (~> 1.0) + addressable (2.3.5) + appraisal (1.0.0.beta1) + bundler + rake + thor (~> 0.18.1) + arel (3.0.2) + builder (3.0.4) + faraday (0.8.8) + multipart-post (~> 1.2.0) + git (1.2.6) + github_api (0.10.1) + addressable + faraday (~> 0.8.1) + hashie (>= 1.2) + multi_json (~> 1.4) + nokogiri (~> 1.5.2) + oauth2 + hashie (2.0.5) + highline (1.6.20) + httpauth (0.2.0) + i18n (0.6.5) + json (1.8.1) + jwt (0.1.8) + multi_json (>= 1.5) + minitest (4.7.5) + multi_json (1.8.2) + multi_xml (0.5.5) + multipart-post (1.2.0) + nokogiri (1.5.10) + oauth2 (0.9.2) + faraday (~> 0.8) + httpauth (~> 0.2) + jwt (~> 0.1.4) + multi_json (~> 1.0) + multi_xml (~> 0.5) + rack (~> 1.2) + rack (1.5.2) + rake (10.1.0) + rdoc (4.0.1) + json (~> 1.4) + sqlite3 (1.3.7) + thor (0.18.1) + tzinfo (0.3.38) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (~> 3.2.15) + appraisal (>= 1.0.0.beta) + jeweler! + minitest (~> 4.0) + sqlite3 + validates_existence! diff --git a/gemfiles/4.0.gemfile b/gemfiles/4.0.gemfile new file mode 100644 index 0000000..0840da5 --- /dev/null +++ b/gemfiles/4.0.gemfile @@ -0,0 +1,9 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" +gem "activerecord", "~> 4.0.0" +gem "validates_existence", :path=>"../" + +gemspec :path=>".././" diff --git a/gemfiles/4.0.gemfile.lock b/gemfiles/4.0.gemfile.lock new file mode 100644 index 0000000..3a4bd50 --- /dev/null +++ b/gemfiles/4.0.gemfile.lock @@ -0,0 +1,94 @@ +GIT + remote: git@github.com:technicalpickles/jeweler.git + revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 + specs: + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc + +PATH + remote: .. + specs: + validates_existence (0.9.1) + activerecord (>= 3.0.0) + jeweler + validates_existence + +GEM + remote: https://rubygems.org/ + specs: + activemodel (4.0.0) + activesupport (= 4.0.0) + builder (~> 3.1.0) + activerecord (4.0.0) + activemodel (= 4.0.0) + activerecord-deprecated_finders (~> 1.0.2) + activesupport (= 4.0.0) + arel (~> 4.0.0) + activerecord-deprecated_finders (1.0.3) + activesupport (4.0.0) + i18n (~> 0.6, >= 0.6.4) + minitest (~> 4.2) + multi_json (~> 1.3) + thread_safe (~> 0.1) + tzinfo (~> 0.3.37) + addressable (2.3.5) + appraisal (1.0.0.beta1) + bundler + rake + thor (~> 0.18.1) + arel (4.0.1) + atomic (1.1.14) + builder (3.1.4) + faraday (0.8.8) + multipart-post (~> 1.2.0) + git (1.2.6) + github_api (0.10.1) + addressable + faraday (~> 0.8.1) + hashie (>= 1.2) + multi_json (~> 1.4) + nokogiri (~> 1.5.2) + oauth2 + hashie (2.0.5) + highline (1.6.20) + httpauth (0.2.0) + i18n (0.6.5) + json (1.8.1) + jwt (0.1.8) + multi_json (>= 1.5) + minitest (4.7.5) + multi_json (1.8.2) + multi_xml (0.5.5) + multipart-post (1.2.0) + nokogiri (1.5.10) + oauth2 (0.9.2) + faraday (~> 0.8) + httpauth (~> 0.2) + jwt (~> 0.1.4) + multi_json (~> 1.0) + multi_xml (~> 0.5) + rack (~> 1.2) + rack (1.5.2) + rake (10.1.0) + rdoc (4.0.1) + json (~> 1.4) + thor (0.18.1) + thread_safe (0.1.3) + atomic + tzinfo (0.3.38) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (~> 4.0.0) + appraisal (>= 1.0.0.beta) + jeweler! + validates_existence! diff --git a/validates_existence.gemspec b/validates_existence.gemspec index 9cf23a5..68675b8 100644 --- a/validates_existence.gemspec +++ b/validates_existence.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Tanel Suurhans", "Tarmo Lehtpuu"] - s.date = "2013-09-05" + s.date = "2013-11-01" s.description = "A library for validating model association existence." s.email = ["tanel.suurhans@perfectline.ee", "tarmo.lehtpuu@perfectline.ee"] s.extra_rdoc_files = [ @@ -23,14 +23,46 @@ Gem::Specification.new do |s| ] s.homepage = "http://github.com/perfectline/validates_existence/tree/master" s.require_paths = ["lib"] - s.rubygems_version = "2.0.3" + s.rubygems_version = "2.0.6" s.summary = "Validates Rails model belongs_to association existence." if s.respond_to? :specification_version then s.specification_version = 4 - s.add_runtime_dependency(%q, [">= 0"]) + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q, [">= 0"]) + s.add_runtime_dependency(%q, [">= 0"]) + s.add_development_dependency(%q, [">= 1.0.0.beta"]) + s.add_development_dependency(%q, [">= 1.0.0.beta"]) + s.add_development_dependency(%q, [">= 1.0.0.beta"]) + s.add_development_dependency(%q, ["~> 4.0"]) + s.add_runtime_dependency(%q, [">= 3.0.0"]) + s.add_development_dependency(%q, [">= 1.0.0.beta"]) + s.add_development_dependency(%q, ["~> 4.0"]) + s.add_development_dependency(%q, [">= 0"]) + else + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, ["~> 4.0"]) + s.add_dependency(%q, [">= 3.0.0"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, ["~> 4.0"]) + s.add_dependency(%q, [">= 0"]) + end else - s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, ["~> 4.0"]) + s.add_dependency(%q, [">= 3.0.0"]) + s.add_dependency(%q, [">= 1.0.0.beta"]) + s.add_dependency(%q, ["~> 4.0"]) + s.add_dependency(%q, [">= 0"]) end end From 68a64ade4fb859fc5644d86dca1cce18f9f0c8c6 Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 14:39:05 -0400 Subject: [PATCH 8/9] Add config for Travis CI --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..46622f6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +rvm: + - 1.9.3 + - 2.0.0 + +gemfile: + - gemfiles/3.0.gemfile + - gemfiles/3.1.gemfile + - gemfiles/3.2.gemfile + - gemfiles/4.0.gemfile From e8f86b291c3a035e503b0bd9e638fd66b08ac4b7 Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 1 Nov 2013 14:47:37 -0400 Subject: [PATCH 9/9] Update appraisal gemfiles --- gemfiles/3.0.gemfile | 1 - gemfiles/3.0.gemfile.lock | 24 +++++++++--------------- gemfiles/3.1.gemfile | 1 - gemfiles/3.1.gemfile.lock | 24 +++++++++--------------- gemfiles/3.2.gemfile | 1 - gemfiles/3.2.gemfile.lock | 24 +++++++++--------------- gemfiles/4.0.gemfile | 1 - gemfiles/4.0.gemfile.lock | 27 ++++++++++++--------------- 8 files changed, 39 insertions(+), 64 deletions(-) diff --git a/gemfiles/3.0.gemfile b/gemfiles/3.0.gemfile index c02cafc..8bffd7e 100644 --- a/gemfiles/3.0.gemfile +++ b/gemfiles/3.0.gemfile @@ -2,7 +2,6 @@ source "https://rubygems.org" -gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" gem "activerecord", "~> 3.0.20" gem "validates_existence", :path=>"../" diff --git a/gemfiles/3.0.gemfile.lock b/gemfiles/3.0.gemfile.lock index d02dcb1..7e3897f 100644 --- a/gemfiles/3.0.gemfile.lock +++ b/gemfiles/3.0.gemfile.lock @@ -1,17 +1,3 @@ -GIT - remote: git@github.com:technicalpickles/jeweler.git - revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 - specs: - jeweler (1.8.8) - builder - bundler (~> 1.0) - git (>= 1.2.5) - github_api (= 0.10.1) - highline (>= 1.6.15) - nokogiri (= 1.5.10) - rake - rdoc - PATH remote: .. specs: @@ -54,6 +40,15 @@ GEM highline (1.6.20) httpauth (0.2.0) i18n (0.5.0) + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc json (1.8.1) jwt (0.1.8) multi_json (>= 1.5) @@ -83,7 +78,6 @@ PLATFORMS DEPENDENCIES activerecord (~> 3.0.20) appraisal (>= 1.0.0.beta) - jeweler! minitest (~> 4.0) sqlite3 validates_existence! diff --git a/gemfiles/3.1.gemfile b/gemfiles/3.1.gemfile index fdec761..6d36569 100644 --- a/gemfiles/3.1.gemfile +++ b/gemfiles/3.1.gemfile @@ -2,7 +2,6 @@ source "https://rubygems.org" -gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" gem "activerecord", "~> 3.1.12" gem "validates_existence", :path=>"../" diff --git a/gemfiles/3.1.gemfile.lock b/gemfiles/3.1.gemfile.lock index 0dd7490..9a8b16f 100644 --- a/gemfiles/3.1.gemfile.lock +++ b/gemfiles/3.1.gemfile.lock @@ -1,17 +1,3 @@ -GIT - remote: git@github.com:technicalpickles/jeweler.git - revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 - specs: - jeweler (1.8.8) - builder - bundler (~> 1.0) - git (>= 1.2.5) - github_api (= 0.10.1) - highline (>= 1.6.15) - nokogiri (= 1.5.10) - rake - rdoc - PATH remote: .. specs: @@ -55,6 +41,15 @@ GEM highline (1.6.20) httpauth (0.2.0) i18n (0.6.5) + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc json (1.8.1) jwt (0.1.8) multi_json (>= 1.5) @@ -84,7 +79,6 @@ PLATFORMS DEPENDENCIES activerecord (~> 3.1.12) appraisal (>= 1.0.0.beta) - jeweler! minitest (~> 4.0) sqlite3 validates_existence! diff --git a/gemfiles/3.2.gemfile b/gemfiles/3.2.gemfile index b0d3218..fbf20ee 100644 --- a/gemfiles/3.2.gemfile +++ b/gemfiles/3.2.gemfile @@ -2,7 +2,6 @@ source "https://rubygems.org" -gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" gem "activerecord", "~> 3.2.15" gem "validates_existence", :path=>"../" diff --git a/gemfiles/3.2.gemfile.lock b/gemfiles/3.2.gemfile.lock index eedc30f..a49367c 100644 --- a/gemfiles/3.2.gemfile.lock +++ b/gemfiles/3.2.gemfile.lock @@ -1,17 +1,3 @@ -GIT - remote: git@github.com:technicalpickles/jeweler.git - revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 - specs: - jeweler (1.8.8) - builder - bundler (~> 1.0) - git (>= 1.2.5) - github_api (= 0.10.1) - highline (>= 1.6.15) - nokogiri (= 1.5.10) - rake - rdoc - PATH remote: .. specs: @@ -55,6 +41,15 @@ GEM highline (1.6.20) httpauth (0.2.0) i18n (0.6.5) + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc json (1.8.1) jwt (0.1.8) multi_json (>= 1.5) @@ -84,7 +79,6 @@ PLATFORMS DEPENDENCIES activerecord (~> 3.2.15) appraisal (>= 1.0.0.beta) - jeweler! minitest (~> 4.0) sqlite3 validates_existence! diff --git a/gemfiles/4.0.gemfile b/gemfiles/4.0.gemfile index 0840da5..dd6b3c2 100644 --- a/gemfiles/4.0.gemfile +++ b/gemfiles/4.0.gemfile @@ -2,7 +2,6 @@ source "https://rubygems.org" -gem "jeweler", :git=>"git@github.com:technicalpickles/jeweler.git" gem "activerecord", "~> 4.0.0" gem "validates_existence", :path=>"../" diff --git a/gemfiles/4.0.gemfile.lock b/gemfiles/4.0.gemfile.lock index 3a4bd50..0b558bb 100644 --- a/gemfiles/4.0.gemfile.lock +++ b/gemfiles/4.0.gemfile.lock @@ -1,17 +1,3 @@ -GIT - remote: git@github.com:technicalpickles/jeweler.git - revision: c0e945c2ae7e8a5783ba724d068de1a039119b21 - specs: - jeweler (1.8.8) - builder - bundler (~> 1.0) - git (>= 1.2.5) - github_api (= 0.10.1) - highline (>= 1.6.15) - nokogiri (= 1.5.10) - rake - rdoc - PATH remote: .. specs: @@ -60,6 +46,15 @@ GEM highline (1.6.20) httpauth (0.2.0) i18n (0.6.5) + jeweler (1.8.8) + builder + bundler (~> 1.0) + git (>= 1.2.5) + github_api (= 0.10.1) + highline (>= 1.6.15) + nokogiri (= 1.5.10) + rake + rdoc json (1.8.1) jwt (0.1.8) multi_json (>= 1.5) @@ -79,6 +74,7 @@ GEM rake (10.1.0) rdoc (4.0.1) json (~> 1.4) + sqlite3 (1.3.7) thor (0.18.1) thread_safe (0.1.3) atomic @@ -90,5 +86,6 @@ PLATFORMS DEPENDENCIES activerecord (~> 4.0.0) appraisal (>= 1.0.0.beta) - jeweler! + minitest (~> 4.0) + sqlite3 validates_existence!