Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed require 'rubygems' and moved all files into validatable subfo…

  • Loading branch information...
commit f36fe2e0656c7294d27646d8e6932c08f00ebc00 1 parent edcd8be
@jnunemaker authored
Showing with 32 additions and 68 deletions.
  1. +11 −42 Rakefile
  2. +20 −23 lib/validatable.rb
  3. 0  lib/{ → validatable}/child_validation.rb
  4. 0  lib/{ → validatable}/errors.rb
  5. 0  lib/{ → validatable}/included_validation.rb
  6. 0  lib/{ → validatable}/macros.rb
  7. 0  lib/{ → validatable}/object_extension.rb
  8. 0  lib/{ → validatable}/requireable.rb
  9. 0  lib/{ → validatable}/understandable.rb
  10. 0  lib/{ → validatable}/validatable_class_methods.rb
  11. 0  lib/{ → validatable}/validatable_instance_methods.rb
  12. 0  lib/{ → validatable}/validations/validates_acceptance_of.rb
  13. 0  lib/{ → validatable}/validations/validates_associated.rb
  14. 0  lib/{ → validatable}/validations/validates_confirmation_of.rb
  15. 0  lib/{ → validatable}/validations/validates_each.rb
  16. 0  lib/{ → validatable}/validations/validates_format_of.rb
  17. 0  lib/{ → validatable}/validations/validates_length_of.rb
  18. 0  lib/{ → validatable}/validations/validates_numericality_of.rb
  19. 0  lib/{ → validatable}/validations/validates_presence_of.rb
  20. 0  lib/{ → validatable}/validations/validates_true_for.rb
  21. 0  lib/{ → validatable}/validations/validation_base.rb
  22. +0 −1  test/all_tests.rb
  23. +1 −2  test/test_helper.rb
View
53 Rakefile
@@ -1,54 +1,23 @@
require 'rubygems'
require 'rake'
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "jnunemaker-validatable"
- gem.summary = %Q{Validatable is a library for adding validations.}
- gem.email = "nunemaker@gmail.com"
- gem.homepage = "http://github.com/jnunemaker/validatable"
- gem.authors = ['Jay Fields', 'John Nunemaker']
- gem.files = FileList['lib/**/*.rb', '[A-Z]*', 'test/**/*'].to_a
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+require 'jeweler'
+Jeweler::Tasks.new do |gem|
+ gem.name = "jnunemaker-validatable"
+ gem.summary = %Q{Validatable is a library for adding validations.}
+ gem.email = "nunemaker@gmail.com"
+ gem.homepage = "http://github.com/jnunemaker/validatable"
+ gem.authors = ['Jay Fields', 'John Nunemaker']
+ gem.files = FileList['lib/**/*.rb', '[A-Z]*', 'test/**/*'].to_a
end
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
+ test.libs << 'test'
+ test.ruby_opts << '-rubygems'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
-end
-
+task :test => :check_dependencies
task :default => :test
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- if File.exist?('VERSION.yml')
- config = YAML.load(File.read('VERSION.yml'))
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
- else
- version = ""
- end
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "validatable #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
View
43 lib/validatable.rb
@@ -1,25 +1,22 @@
require 'forwardable'
-require 'rubygems'
-require 'activesupport'
+require 'active_support'
-dir = File.expand_path(File.dirname(__FILE__))
-
-require File.join(dir, 'object_extension')
-require File.join(dir, 'errors')
-require File.join(dir, 'validatable_class_methods')
-require File.join(dir, 'macros')
-require File.join(dir, 'validatable_instance_methods')
-require File.join(dir, 'included_validation')
-require File.join(dir, 'child_validation')
-require File.join(dir, 'understandable')
-require File.join(dir, 'requireable')
-require File.join(dir, 'validations/validation_base')
-require File.join(dir, 'validations/validates_format_of')
-require File.join(dir, 'validations/validates_presence_of')
-require File.join(dir, 'validations/validates_acceptance_of')
-require File.join(dir, 'validations/validates_confirmation_of')
-require File.join(dir, 'validations/validates_length_of')
-require File.join(dir, 'validations/validates_true_for')
-require File.join(dir, 'validations/validates_numericality_of')
-require File.join(dir, 'validations/validates_each')
-require File.join(dir, 'validations/validates_associated')
+require 'validatable/object_extension'
+require 'validatable/errors'
+require 'validatable/validatable_class_methods'
+require 'validatable/macros'
+require 'validatable/validatable_instance_methods'
+require 'validatable/included_validation'
+require 'validatable/child_validation'
+require 'validatable/understandable'
+require 'validatable/requireable'
+require 'validatable/validations/validation_base'
+require 'validatable/validations/validates_format_of'
+require 'validatable/validations/validates_presence_of'
+require 'validatable/validations/validates_acceptance_of'
+require 'validatable/validations/validates_confirmation_of'
+require 'validatable/validations/validates_length_of'
+require 'validatable/validations/validates_true_for'
+require 'validatable/validations/validates_numericality_of'
+require 'validatable/validations/validates_each'
+require 'validatable/validations/validates_associated'
View
0  lib/child_validation.rb → lib/validatable/child_validation.rb
File renamed without changes
View
0  lib/errors.rb → lib/validatable/errors.rb
File renamed without changes
View
0  lib/included_validation.rb → lib/validatable/included_validation.rb
File renamed without changes
View
0  lib/macros.rb → lib/validatable/macros.rb
File renamed without changes
View
0  lib/object_extension.rb → lib/validatable/object_extension.rb
File renamed without changes
View
0  lib/requireable.rb → lib/validatable/requireable.rb
File renamed without changes
View
0  lib/understandable.rb → lib/validatable/understandable.rb
File renamed without changes
View
0  lib/validatable_class_methods.rb → lib/validatable/validatable_class_methods.rb
File renamed without changes
View
0  lib/validatable_instance_methods.rb → lib/validatable/validatable_instance_methods.rb
File renamed without changes
View
0  lib/validations/validates_acceptance_of.rb → ...alidatable/validations/validates_acceptance_of.rb
File renamed without changes
View
0  lib/validations/validates_associated.rb → lib/validatable/validations/validates_associated.rb
File renamed without changes
View
0  lib/validations/validates_confirmation_of.rb → ...idatable/validations/validates_confirmation_of.rb
File renamed without changes
View
0  lib/validations/validates_each.rb → lib/validatable/validations/validates_each.rb
File renamed without changes
View
0  lib/validations/validates_format_of.rb → lib/validatable/validations/validates_format_of.rb
File renamed without changes
View
0  lib/validations/validates_length_of.rb → lib/validatable/validations/validates_length_of.rb
File renamed without changes
View
0  lib/validations/validates_numericality_of.rb → ...idatable/validations/validates_numericality_of.rb
File renamed without changes
View
0  lib/validations/validates_presence_of.rb → lib/validatable/validations/validates_presence_of.rb
File renamed without changes
View
0  lib/validations/validates_true_for.rb → lib/validatable/validations/validates_true_for.rb
File renamed without changes
View
0  lib/validations/validation_base.rb → lib/validatable/validations/validation_base.rb
File renamed without changes
View
1  test/all_tests.rb
@@ -1 +0,0 @@
-Dir['test/**/test_*.rb'].each { |test_case| require test_case }
View
3  test/test_helper.rb
@@ -1,11 +1,10 @@
require 'test/unit'
-require 'rubygems'
require 'mocha'
require 'dust'
require 'set'
require 'expectations'
-require File.dirname(__FILE__) + '/../lib/validatable'
+require File.expand_path(File.dirname(__FILE__) + '/../lib/validatable')
class << Test::Unit::TestCase
def expect(expected_value, &block)
Please sign in to comment.
Something went wrong with that request. Please try again.