hobofields 0.9.106 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hobo_fields.rb +1 -1
- data/test/rich_types.rdoctest +4 -2
- metadata +32 -16
data/lib/hobo_fields.rb
CHANGED
data/test/rich_types.rdoctest
CHANGED
@@ -59,7 +59,7 @@ This class defines the methods `to_html` to customize the way the type is render
|
|
59
59
|
# Loud text always renderd in caps.
|
60
60
|
# It's rude to shout too much so it's not allowed to be
|
61
61
|
# longer than 100 characters
|
62
|
-
class LoudText <
|
62
|
+
class LoudText < String
|
63
63
|
|
64
64
|
COLUMN_TYPE = :string
|
65
65
|
|
@@ -80,9 +80,11 @@ This class defines the methods `to_html` to customize the way the type is render
|
|
80
80
|
|
81
81
|
end
|
82
82
|
|
83
|
+
If you place this class in `app/rich_types/loud_text.rb`, Hobo will load it automatically.
|
84
|
+
|
83
85
|
That's all there is to it. Defining `to_html`, `format` and `validate` are optional, defining `COLUMN_TYPE` and calling `HoboFields.register_type` are not.
|
84
86
|
|
85
|
-
We
|
87
|
+
We inherit from String in this instance. This does not work for all types -- for example, with Fixnum, you should inherit from `DelegateClass(Fixnum)` instead.
|
86
88
|
|
87
89
|
The format function is added as a before\_validation hook. Ensure that multiple invocations of your format function is safe -- shout.format.format should return the same as shout.format.
|
88
90
|
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobofields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 1.0.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Tom Locke
|
@@ -9,37 +14,46 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-02-23 00:00:00 +11:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rails
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 2
|
30
|
+
- 2
|
23
31
|
version: 2.2.2
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: hobosupport
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - "="
|
32
40
|
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 0
|
44
|
+
- 0
|
45
|
+
version: 1.0.0
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
description:
|
36
49
|
email: tom@tomlocke.com
|
37
50
|
executables: []
|
38
51
|
|
39
52
|
extensions: []
|
40
53
|
|
41
|
-
extra_rdoc_files:
|
42
|
-
|
54
|
+
extra_rdoc_files:
|
55
|
+
- LICENSE.txt
|
56
|
+
- README.txt
|
43
57
|
files:
|
44
58
|
- CHANGES.txt
|
45
59
|
- LICENSE.txt
|
@@ -96,18 +110,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
110
|
requirements:
|
97
111
|
- - ">="
|
98
112
|
- !ruby/object:Gem::Version
|
113
|
+
segments:
|
114
|
+
- 0
|
99
115
|
version: "0"
|
100
|
-
version:
|
101
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
117
|
requirements:
|
103
118
|
- - ">="
|
104
119
|
- !ruby/object:Gem::Version
|
120
|
+
segments:
|
121
|
+
- 0
|
105
122
|
version: "0"
|
106
|
-
version:
|
107
123
|
requirements: []
|
108
124
|
|
109
125
|
rubyforge_project: hobo
|
110
|
-
rubygems_version: 1.3.
|
126
|
+
rubygems_version: 1.3.6
|
111
127
|
signing_key:
|
112
128
|
specification_version: 3
|
113
129
|
summary: Rich field types and migration generator for Rails
|