validates_truthiness 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- validates_truthiness (0.0.1)
4
+ validates_truthiness (0.1.1)
5
5
  activerecord (~> 3.0.3)
6
6
  bundler (~> 1.0.10)
7
7
 
@@ -1,17 +1,3 @@
1
- module ActiveModel
2
- module Validations
3
- class TruthinessValidator < ActiveModel::EachValidator
4
- def validate_each(record, attribute, value)
5
- record.errors.add(attribute, :truthiness, :message => options[:message], :value => value) unless (value.is_a?(FalseClass) || value.is_a?(TrueClass))
6
- end
7
- end
8
-
9
- module HelperMethods
10
- def validates_truthiness_of(*attr_names)
11
- validates_with TruthinessValidator, _merge_attributes(attr_names)
12
- end
13
-
14
- alias validates_booleanship_of validates_truthiness_of
15
- end
16
- end
17
- end
1
+ require File.dirname(__FILE__) + "/validates_truthiness/validates_truthiness.rb"
2
+ require File.dirname(__FILE__) + "/validates_truthiness/validates_verity.rb"
3
+ require File.dirname(__FILE__) + "/validates_truthiness/validates_falsity.rb"
@@ -0,0 +1,17 @@
1
+ module ActiveModel
2
+ module Validations
3
+ class TruthinessValidator < ActiveModel::EachValidator
4
+ def validate_each(record, attribute, value)
5
+ record.errors.add(attribute, :truthiness, :message => options[:message], :value => value) unless (value.is_a?(FalseClass) || value.is_a?(TrueClass))
6
+ end
7
+ end
8
+
9
+ module HelperMethods
10
+ def validates_truthiness_of(*attr_names)
11
+ validates_with TruthinessValidator, _merge_attributes(attr_names)
12
+ end
13
+
14
+ alias validates_booleanship_of validates_truthiness_of
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module ValidatesTruthiness
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,5 +1,7 @@
1
1
  Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
2
2
 
3
+ require 'validates_truthiness'
4
+
3
5
  RSpec.configure do |config|
4
6
  config.before do
5
7
  I18n.locale = :en
@@ -1,6 +1,5 @@
1
1
  # encoding: utf-8
2
2
  require "spec_helper"
3
- require File.join(File.dirname(__FILE__), "..", "lib", "validates_falsity")
4
3
 
5
4
  describe ".validates_falsity_of" do
6
5
  it "allows false" do
@@ -1,6 +1,5 @@
1
1
  # encoding: utf-8
2
2
  require "spec_helper"
3
- require File.join(File.dirname(__FILE__), "..", "lib", "validates_truthiness")
4
3
 
5
4
  describe ".validates_truthiness_of" do
6
5
  it "allows true" do
@@ -1,6 +1,5 @@
1
1
  # encoding: utf-8
2
2
  require "spec_helper"
3
- require File.join(File.dirname(__FILE__), "..", "lib", "validates_verity")
4
3
 
5
4
  describe ".validates_verity_of" do
6
5
  it "allows true" do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: validates_truthiness
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - thekompanee
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-02-01 00:00:00 -06:00
14
+ date: 2011-02-02 00:00:00 -06:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -86,19 +86,20 @@ files:
86
86
  - LICENSE
87
87
  - README.md
88
88
  - Rakefile
89
- - lib/validates_falsity.rb
90
89
  - lib/validates_truthiness.rb
90
+ - lib/validates_truthiness/validates_falsity.rb
91
+ - lib/validates_truthiness/validates_truthiness.rb
92
+ - lib/validates_truthiness/validates_verity.rb
91
93
  - lib/validates_truthiness/version.rb
92
- - lib/validates_verity.rb
93
94
  - spec/model.rb
94
95
  - spec/spec_helper.rb
95
96
  - spec/support/activemodel.rb
96
97
  - spec/support/i18n.rb
97
98
  - spec/support/languages.yml
98
99
  - spec/support/simplecov.rb
99
- - spec/validates_falsity_spec.rb
100
- - spec/validates_truthiness_spec.rb
101
- - spec/validates_verity_spec.rb
100
+ - spec/validates_truthiness/validates_falsity_spec.rb
101
+ - spec/validates_truthiness/validates_truthiness_spec.rb
102
+ - spec/validates_truthiness/validates_verity_spec.rb
102
103
  - validates_truthiness.gemspec
103
104
  has_rdoc: true
104
105
  homepage: http://github.com/jfelchner/apple_cart
@@ -127,7 +128,7 @@ rubyforge_project: validates_truthiness
127
128
  rubygems_version: 1.5.0
128
129
  signing_key:
129
130
  specification_version: 3
130
- summary: validates_truthiness-0.1.0
131
+ summary: validates_truthiness-0.1.1
131
132
  test_files:
132
133
  - spec/model.rb
133
134
  - spec/spec_helper.rb
@@ -135,6 +136,6 @@ test_files:
135
136
  - spec/support/i18n.rb
136
137
  - spec/support/languages.yml
137
138
  - spec/support/simplecov.rb
138
- - spec/validates_falsity_spec.rb
139
- - spec/validates_truthiness_spec.rb
140
- - spec/validates_verity_spec.rb
139
+ - spec/validates_truthiness/validates_falsity_spec.rb
140
+ - spec/validates_truthiness/validates_truthiness_spec.rb
141
+ - spec/validates_truthiness/validates_verity_spec.rb