sample_models 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/sample_models.rb +5 -6
- data/sample_models.gemspec +6 -2
- data/spec_or_test/database.yml +4 -5
- data/spec_or_test/setup.rb +2 -0
- data/test/db/placeholder +0 -0
- data/test/test_sample_models.rb +2 -2
- metadata +20 -6
data/.gitignore
CHANGED
data/Rakefile
CHANGED
@@ -55,6 +55,7 @@ A library for making it extremely fast for Rails developers to set up and save A
|
|
55
55
|
gem.email = "francis.hwang@profitably.com"
|
56
56
|
gem.homepage = "http://github.com/fhwang/sample_models"
|
57
57
|
gem.authors = ["Francis Hwang"]
|
58
|
+
gem.add_development_dependency('rspec')
|
58
59
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
59
60
|
end
|
60
61
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/lib/sample_models.rb
CHANGED
@@ -14,11 +14,7 @@ module SampleModels
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.hash_with_indifferent_access_class
|
17
|
-
|
18
|
-
ActiveSupport::HashWithIndifferentAccess
|
19
|
-
else
|
20
|
-
HashWithIndifferentAccess
|
21
|
-
end
|
17
|
+
HashWithIndifferentAccess
|
22
18
|
end
|
23
19
|
|
24
20
|
protected
|
@@ -103,6 +99,7 @@ validations_to_intercept = [
|
|
103
99
|
:validates_email_format_of, :validates_inclusion_of, :validates_presence_of,
|
104
100
|
:validates_uniqueness_of
|
105
101
|
]
|
102
|
+
optional_interceptions = [:validates_email_format_of]
|
106
103
|
validations_to_intercept.each do |validation|
|
107
104
|
recipient = validation_recipients.detect { |vr|
|
108
105
|
vr.method_defined?(validation)
|
@@ -115,7 +112,9 @@ validations_to_intercept.each do |validation|
|
|
115
112
|
end
|
116
113
|
recipient.alias_method_chain validation, :sample_models
|
117
114
|
else
|
118
|
-
|
115
|
+
unless optional_interceptions.include?(validation)
|
116
|
+
raise "Can't find who defines the validation method #{validation}"
|
117
|
+
end
|
119
118
|
end
|
120
119
|
end
|
121
120
|
|
data/sample_models.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sample_models}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Francis Hwang"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-12-18}
|
13
13
|
s.description = %q{
|
14
14
|
A library for making it extremely fast for Rails developers to set up and save ActiveRecord instances when writing test cases. It aims to:
|
15
15
|
|
@@ -54,6 +54,7 @@ A library for making it extremely fast for Rails developers to set up and save A
|
|
54
54
|
"spec_or_test/vendor/validates_email_format_of/test/test_helper.rb",
|
55
55
|
"spec_or_test/vendor/validates_email_format_of/test/validates_email_format_of_test.rb",
|
56
56
|
"tasks/sample_models_tasks.rake",
|
57
|
+
"test/db/placeholder",
|
57
58
|
"test/test_sample_models.rb",
|
58
59
|
"uninstall.rb",
|
59
60
|
"vendor/ar_query/MIT-LICENSE",
|
@@ -81,9 +82,12 @@ A library for making it extremely fast for Rails developers to set up and save A
|
|
81
82
|
s.specification_version = 3
|
82
83
|
|
83
84
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
85
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
84
86
|
else
|
87
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
85
88
|
end
|
86
89
|
else
|
90
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
87
91
|
end
|
88
92
|
end
|
89
93
|
|
data/spec_or_test/database.yml
CHANGED
data/spec_or_test/setup.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
gem 'activerecord', ENV['ACTIVE_RECORD_VERSION']
|
3
|
+
gem "activesupport", ENV['ACTIVE_RECORD_VERSION']
|
3
4
|
RAILS_ENV = 'test'
|
4
5
|
require 'active_record'
|
5
6
|
require 'active_record/base'
|
6
7
|
require 'active_support/core_ext/logger'
|
8
|
+
|
7
9
|
require File.dirname(__FILE__) +
|
8
10
|
'/vendor/validates_email_format_of/lib/validates_email_format_of'
|
9
11
|
require File.dirname(__FILE__) + '/../lib/sample_models'
|
data/test/db/placeholder
ADDED
File without changes
|
data/test/test_sample_models.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'test/unit'
|
2
|
-
require File.dirname(__FILE__) + "/../spec_or_test/setup"
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + "/../spec_or_test/setup"
|
3
3
|
|
4
4
|
# auto-convert specs into tests whoooooha
|
5
5
|
@@test_class_sequence = 1
|
@@ -24,5 +24,5 @@ end
|
|
24
24
|
|
25
25
|
initialize_db
|
26
26
|
|
27
|
-
require File.dirname(__FILE__) +
|
27
|
+
require File.expand_path(File.dirname(__FILE__)) + "/../spec_or_test/specs_or_test_cases"
|
28
28
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sample_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Francis Hwang
|
@@ -15,10 +15,23 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-18 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rspec
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
22
35
|
description: |
|
23
36
|
|
24
37
|
A library for making it extremely fast for Rails developers to set up and save ActiveRecord instances when writing test cases. It aims to:
|
@@ -67,6 +80,7 @@ files:
|
|
67
80
|
- spec_or_test/vendor/validates_email_format_of/test/test_helper.rb
|
68
81
|
- spec_or_test/vendor/validates_email_format_of/test/validates_email_format_of_test.rb
|
69
82
|
- tasks/sample_models_tasks.rake
|
83
|
+
- test/db/placeholder
|
70
84
|
- test/test_sample_models.rb
|
71
85
|
- uninstall.rb
|
72
86
|
- vendor/ar_query/MIT-LICENSE
|