ohm-contrib 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +24 -0
- data/VERSION +1 -1
- data/lib/ohm/contrib.rb +3 -1
- data/ohm-contrib.gemspec +78 -0
- metadata +4 -3
data/README.markdown
CHANGED
@@ -19,6 +19,26 @@ Example usage
|
|
19
19
|
include Ohm::Timestamping
|
20
20
|
include Ohm::ToHash
|
21
21
|
include Ohm::Boundaries
|
22
|
+
include Ohm::WebValidations
|
23
|
+
include Ohm::NumberValidations
|
24
|
+
|
25
|
+
attribute :amount
|
26
|
+
attribute :url
|
27
|
+
attribute :poster_email
|
28
|
+
attribute :slug
|
29
|
+
|
30
|
+
def validate
|
31
|
+
# from NumberValidations
|
32
|
+
assert_decimal :amount
|
33
|
+
|
34
|
+
# or if you want it to be optional
|
35
|
+
assert_decimal :amount unless amount.to_s.empty?
|
36
|
+
|
37
|
+
# from WebValidations
|
38
|
+
assert_slug :slug
|
39
|
+
assert_url :url
|
40
|
+
assert_email :poster_email
|
41
|
+
end
|
22
42
|
end
|
23
43
|
|
24
44
|
Post.first
|
@@ -28,6 +48,10 @@ Example usage
|
|
28
48
|
Post.create.created_at
|
29
49
|
Post.create.updated_at
|
30
50
|
|
51
|
+
Credits
|
52
|
+
-------
|
53
|
+
Thanks to github user gnrfan for the web validations.
|
54
|
+
|
31
55
|
Note on Patches/Pull Requests
|
32
56
|
-----------------------------
|
33
57
|
* Fork the project.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/ohm/contrib.rb
CHANGED
data/ohm-contrib.gemspec
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{ohm-contrib}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Cyril David"]
|
12
|
+
s.date = %q{2010-05-15}
|
13
|
+
s.description = %q{Highly decoupled drop-in functionality for Ohm models}
|
14
|
+
s.email = %q{cyx.ucron@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.markdown"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.markdown",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/ohm/contrib.rb",
|
27
|
+
"lib/ohm/contrib/boundaries.rb",
|
28
|
+
"lib/ohm/contrib/number_validations.rb",
|
29
|
+
"lib/ohm/contrib/timestamping.rb",
|
30
|
+
"lib/ohm/contrib/to_hash.rb",
|
31
|
+
"lib/ohm/contrib/web_validations.rb",
|
32
|
+
"ohm-contrib.gemspec",
|
33
|
+
"test/helper.rb",
|
34
|
+
"test/test_ohm_boundaries.rb",
|
35
|
+
"test/test_ohm_contrib.rb",
|
36
|
+
"test/test_ohm_number_validations.rb",
|
37
|
+
"test/test_ohm_timestamping.rb",
|
38
|
+
"test/test_ohm_to_hash.rb",
|
39
|
+
"test/test_ohm_web_validations.rb"
|
40
|
+
]
|
41
|
+
s.homepage = %q{http://github.com/sinefunc/ohm-contrib}
|
42
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
43
|
+
s.require_paths = ["lib"]
|
44
|
+
s.rubygems_version = %q{1.3.6}
|
45
|
+
s.summary = %q{A collection of ohm related modules}
|
46
|
+
s.test_files = [
|
47
|
+
"test/helper.rb",
|
48
|
+
"test/test_ohm_boundaries.rb",
|
49
|
+
"test/test_ohm_contrib.rb",
|
50
|
+
"test/test_ohm_number_validations.rb",
|
51
|
+
"test/test_ohm_timestamping.rb",
|
52
|
+
"test/test_ohm_to_hash.rb",
|
53
|
+
"test/test_ohm_web_validations.rb"
|
54
|
+
]
|
55
|
+
|
56
|
+
if s.respond_to? :specification_version then
|
57
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
58
|
+
s.specification_version = 3
|
59
|
+
|
60
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
61
|
+
s.add_development_dependency(%q<contest>, [">= 0"])
|
62
|
+
s.add_development_dependency(%q<redis>, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<ohm>, [">= 0"])
|
64
|
+
s.add_development_dependency(%q<timecop>, [">= 0"])
|
65
|
+
else
|
66
|
+
s.add_dependency(%q<contest>, [">= 0"])
|
67
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
68
|
+
s.add_dependency(%q<ohm>, [">= 0"])
|
69
|
+
s.add_dependency(%q<timecop>, [">= 0"])
|
70
|
+
end
|
71
|
+
else
|
72
|
+
s.add_dependency(%q<contest>, [">= 0"])
|
73
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
74
|
+
s.add_dependency(%q<ohm>, [">= 0"])
|
75
|
+
s.add_dependency(%q<timecop>, [">= 0"])
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Cyril David
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-15 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/ohm/contrib/timestamping.rb
|
88
88
|
- lib/ohm/contrib/to_hash.rb
|
89
89
|
- lib/ohm/contrib/web_validations.rb
|
90
|
+
- ohm-contrib.gemspec
|
90
91
|
- test/helper.rb
|
91
92
|
- test/test_ohm_boundaries.rb
|
92
93
|
- test/test_ohm_contrib.rb
|