diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-09-30 22:27:02 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-09-30 22:27:02 +0100 |
commit | dd2779e1b83b4d867d47dd286ec0c919f5df12a9 (patch) | |
tree | 6e52ea0a329c24429f4d1d41b065e082f0ed6baa /activemodel | |
parent | 329b14aa8fdd291a00d17ba12c2e0ab4c3a157cc (diff) | |
parent | 420004e030e96f2ace6e27fd622c90ee9e986677 (diff) | |
download | rails-dd2779e1b83b4d867d47dd286ec0c919f5df12a9.tar.gz rails-dd2779e1b83b4d867d47dd286ec0c919f5df12a9.tar.bz2 rails-dd2779e1b83b4d867d47dd286ec0c919f5df12a9.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'activemodel')
-rwxr-xr-x | activemodel/Rakefile | 26 | ||||
-rw-r--r-- | activemodel/activemodel.gemspec | 40 | ||||
-rw-r--r-- | activemodel/lib/active_model/lint.rb | 6 | ||||
-rw-r--r-- | activemodel/test/cases/lint_test.rb | 4 | ||||
-rw-r--r-- | activemodel/test/cases/naming_test.rb | 2 | ||||
-rw-r--r-- | activemodel/test/cases/validations/i18n_generate_message_validation_test.rb | 2 |
6 files changed, 22 insertions, 58 deletions
diff --git a/activemodel/Rakefile b/activemodel/Rakefile index 4a64c90dd9..fd69a557aa 100755 --- a/activemodel/Rakefile +++ b/activemodel/Rakefile @@ -43,34 +43,10 @@ end require 'rake/packagetask' require 'rake/gempackagetask' -spec = Gem::Specification.new do |s| - s.platform = Gem::Platform::RUBY - s.name = PKG_NAME - s.version = PKG_VERSION - s.summary = "A toolkit for building other modeling frameworks like ActiveRecord" - s.description = %q{Extracts common modeling concerns from ActiveRecord to share between similar frameworks like ActiveResource.} +spec = eval(File.read('activemodel.gemspec')) - s.author = "David Heinemeier Hansson" - s.email = "david@loudthinking.com" - s.rubyforge_project = "activemodel" - s.homepage = "http://www.rubyonrails.org" - - s.has_rdoc = true - - s.add_dependency('activesupport', '= 3.0.pre' + PKG_BUILD) - - s.require_path = 'lib' - s.files = Dir["CHANGELOG", "MIT-LICENSE", "README", "Rakefile", "lib/**/*", "test/**/*"] -end - Rake::GemPackageTask.new(spec) do |p| p.gem_spec = spec p.need_tar = true p.need_zip = true end - -task :gemspec do - File.open(File.join(File.dirname(__FILE__), "#{spec.name}.gemspec"), "w") do |file| - file.puts spec.to_ruby - end -end
\ No newline at end of file diff --git a/activemodel/activemodel.gemspec b/activemodel/activemodel.gemspec index e96718e6fd..c3ff624419 100644 --- a/activemodel/activemodel.gemspec +++ b/activemodel/activemodel.gemspec @@ -1,31 +1,19 @@ -# -*- encoding: utf-8 -*- - Gem::Specification.new do |s| - s.name = %q{activemodel} - s.version = "3.0.pre" - - s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= - s.authors = ["David Heinemeier Hansson"] - s.date = %q{2009-09-01} + s.platform = Gem::Platform::RUBY + s.name = 'activemodel' + s.version = '3.0.pre' + s.summary = "A toolkit for building other modeling frameworks like ActiveRecord" s.description = %q{Extracts common modeling concerns from ActiveRecord to share between similar frameworks like ActiveResource.} - s.email = %q{david@loudthinking.com} - s.files = ["CHANGELOG", "MIT-LICENSE", "README", "Rakefile", "lib/active_model", "lib/active_model/attribute_methods.rb", "lib/active_model/conversion.rb", "lib/active_model/deprecated_error_methods.rb", "lib/active_model/dirty.rb", "lib/active_model/errors.rb", "lib/active_model/lint.rb", "lib/active_model/locale", "lib/active_model/locale/en.yml", "lib/active_model/naming.rb", "lib/active_model/observing.rb", "lib/active_model/serialization.rb", "lib/active_model/serializers", "lib/active_model/serializers/json.rb", "lib/active_model/serializers/xml.rb", "lib/active_model/state_machine", "lib/active_model/state_machine/event.rb", "lib/active_model/state_machine/machine.rb", "lib/active_model/state_machine/state.rb", "lib/active_model/state_machine/state_transition.rb", "lib/active_model/state_machine.rb", "lib/active_model/test_case.rb", "lib/active_model/validations", "lib/active_model/validations/acceptance.rb", "lib/active_model/validations/confirmation.rb", "lib/active_model/validations/exclusion.rb", "lib/active_model/validations/format.rb", "lib/active_model/validations/inclusion.rb", "lib/active_model/validations/length.rb", "lib/active_model/validations/numericality.rb", "lib/active_model/validations/presence.rb", "lib/active_model/validations/with.rb", "lib/active_model/validations.rb", "lib/active_model/validations_repair_helper.rb", "lib/active_model/version.rb", "lib/active_model.rb", "lib/activemodel.rb", "test/cases", "test/cases/helper.rb", "test/cases/lint_test.rb", "test/cases/naming_test.rb", "test/cases/observing_test.rb", "test/cases/serializeration", "test/cases/serializeration/json_serialization_test.rb", "test/cases/serializeration/xml_serialization_test.rb", "test/cases/state_machine", "test/cases/state_machine/event_test.rb", "test/cases/state_machine/machine_test.rb", "test/cases/state_machine/state_test.rb", "test/cases/state_machine/state_transition_test.rb", "test/cases/state_machine_test.rb", "test/cases/tests_database.rb", "test/cases/validations", "test/cases/validations/acceptance_validation_test.rb", "test/cases/validations/conditional_validation_test.rb", "test/cases/validations/confirmation_validation_test.rb", "test/cases/validations/exclusion_validation_test.rb", "test/cases/validations/format_validation_test.rb", "test/cases/validations/i18n_generate_message_validation_test.rb", "test/cases/validations/i18n_validation_test.rb", "test/cases/validations/inclusion_validation_test.rb", "test/cases/validations/length_validation_test.rb", "test/cases/validations/numericality_validation_test.rb", "test/cases/validations/presence_validation_test.rb", "test/cases/validations/with_validation_test.rb", "test/cases/validations_test.rb", "test/config.rb", "test/fixtures", "test/fixtures/topics.yml", "test/models", "test/models/contact.rb", "test/models/custom_reader.rb", "test/models/developer.rb", "test/models/person.rb", "test/models/reply.rb", "test/models/topic.rb", "test/schema.rb"] - s.homepage = %q{http://www.rubyonrails.org} - s.require_paths = ["lib"] - s.rubyforge_project = %q{activemodel} - s.rubygems_version = %q{1.3.5} - s.summary = %q{A toolkit for building other modeling frameworks like ActiveRecord} - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 + s.author = "David Heinemeier Hansson" + s.email = "david@loudthinking.com" + s.rubyforge_project = "activemodel" + s.homepage = "http://www.rubyonrails.org" + + s.has_rdoc = true + + s.add_dependency('activesupport', '= 3.0.pre') - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q<activesupport>, ["= 3.0.pre"]) - else - s.add_dependency(%q<activesupport>, ["= 3.0.pre"]) - end - else - s.add_dependency(%q<activesupport>, ["= 3.0.pre"]) - end + s.require_path = 'lib' + s.files = Dir["CHANGELOG", "MIT-LICENSE", "README", "lib/**/*"] end diff --git a/activemodel/lib/active_model/lint.rb b/activemodel/lib/active_model/lint.rb index 478f887043..ceaa29dc8c 100644 --- a/activemodel/lib/active_model/lint.rb +++ b/activemodel/lib/active_model/lint.rb @@ -1,6 +1,3 @@ -require "test/unit" -require "test/unit/ui/console/testrunner" - # You can test whether an object is compliant with the ActiveModel API by # calling ActiveModel::Lint.test(object). It will emit a Test::Unit # output that tells you whether your object is fully compliant, or if not, @@ -16,6 +13,9 @@ require "test/unit/ui/console/testrunner" module ActiveModel module Lint def self.test(object, verbosity = 2, output = STDOUT) + require "test/unit" + require "test/unit/ui/console/testrunner" + test_class = Class.new(::Test::Unit::TestCase) do include Test diff --git a/activemodel/test/cases/lint_test.rb b/activemodel/test/cases/lint_test.rb index 165c353045..ed576a91e2 100644 --- a/activemodel/test/cases/lint_test.rb +++ b/activemodel/test/cases/lint_test.rb @@ -1,6 +1,6 @@ require "cases/helper" -class TestLint < Test::Unit::TestCase +class TestLint < ActiveModel::TestCase class CompliantObject def to_model self @@ -47,4 +47,4 @@ class TestLint < Test::Unit::TestCase def test_errors_full_messages assert_output(CompliantObject.new, 0, 0, /test_errors_aref/) end -end
\ No newline at end of file +end diff --git a/activemodel/test/cases/naming_test.rb b/activemodel/test/cases/naming_test.rb index e75d4541a3..4d97af3d13 100644 --- a/activemodel/test/cases/naming_test.rb +++ b/activemodel/test/cases/naming_test.rb @@ -1,6 +1,6 @@ require 'cases/helper' -class NamingTest < Test::Unit::TestCase +class NamingTest < ActiveModel::TestCase def setup @model_name = ActiveModel::Name.new('Post::TrackBack') end diff --git a/activemodel/test/cases/validations/i18n_generate_message_validation_test.rb b/activemodel/test/cases/validations/i18n_generate_message_validation_test.rb index 07e4341289..443a81c6ac 100644 --- a/activemodel/test/cases/validations/i18n_generate_message_validation_test.rb +++ b/activemodel/test/cases/validations/i18n_generate_message_validation_test.rb @@ -3,7 +3,7 @@ require 'cases/tests_database' require 'models/person' -class I18nGenerateMessageValidationTest < Test::Unit::TestCase +class I18nGenerateMessageValidationTest < ActiveModel::TestCase def setup Person.reset_callbacks(:validate) @person = Person.new |