dead_simple_cms 0.11.0 → 0.11.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.
@@ -22,7 +22,7 @@ module DeadSimpleCMS
|
|
22
22
|
|
23
23
|
VALID_INPUT_TYPES = [:string, :text, :select, :file, :radio, :datetime].freeze
|
24
24
|
|
25
|
-
attr_reader :
|
25
|
+
attr_reader :input_type, :group_hierarchy, :required
|
26
26
|
attr_accessor :section
|
27
27
|
|
28
28
|
def initialize(identifier, options={})
|
@@ -42,6 +42,10 @@ module DeadSimpleCMS
|
|
42
42
|
(group_hierarchy + [self]).map(&:identifier).join("_").to_sym
|
43
43
|
end
|
44
44
|
|
45
|
+
def hint
|
46
|
+
@hint.is_a?(Proc) ? @hint.call : @hint
|
47
|
+
end
|
48
|
+
|
45
49
|
def default
|
46
50
|
@default.is_a?(Proc) ? @default.call : @default
|
47
51
|
end
|
@@ -57,7 +57,22 @@ describe DeadSimpleCMS::Attribute::Type::Base do
|
|
57
57
|
its (:root_group?) { should be true }
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
|
+
describe "#hint" do
|
62
|
+
|
63
|
+
its(:hint) { should == "some hint" }
|
64
|
+
|
65
|
+
context "when hint is passed in as a Proc" do
|
66
|
+
before(:each) do
|
67
|
+
delayed_hint = 123
|
68
|
+
subject.instance_variable_set(:@hint, lambda { delayed_hint } )
|
69
|
+
end
|
70
|
+
|
71
|
+
its(:hint) { should == 123 }
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
61
76
|
describe "#default" do
|
62
77
|
|
63
78
|
its (:default) { should == 413 }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dead_simple_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -208,18 +208,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
208
|
- - ! '>='
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
|
-
segments:
|
212
|
-
- 0
|
213
|
-
hash: -4057074833708238682
|
214
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
212
|
none: false
|
216
213
|
requirements:
|
217
214
|
- - ! '>='
|
218
215
|
- !ruby/object:Gem::Version
|
219
216
|
version: '0'
|
220
|
-
segments:
|
221
|
-
- 0
|
222
|
-
hash: -4057074833708238682
|
223
217
|
requirements: []
|
224
218
|
rubyforge_project:
|
225
219
|
rubygems_version: 1.8.24
|