zen 0.3b → 0.3b1

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -1,4 +1,4 @@
1
1
  Following persons have contributed to Zen.
2
2
  (Sorted by number of submitted patches, then alphabetically)
3
3
 
4
- 308 Yorick Peterse <yorickpeterse@gmail.com>
4
+ 313 Yorick Peterse <yorickpeterse@gmail.com>
data/guide/changelog.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## Git Head
3
+ ## 0.3.b1 - November 24th, 2011
4
+
5
+ * Added a markup option for retrieving entries.
6
+
7
+ ## 0.3.b - November 23rd, 2011
4
8
 
5
9
  * Started using checkboxes in favor of select boxes as they're easier to use.
6
10
  * Fixed a small issue that would make it impossible to add/update categories of
@@ -51,6 +51,9 @@ module Ramaze
51
51
  # @option options [TrueClass|FalseClass] :user Whether or not the user
52
52
  # objects should be eager loaded for all entries. Set to ``false`` by
53
53
  # default.
54
+ # @option options [TrueClass|FalseClass] :markup When set to true
55
+ # (default) the values of custom fields are processed using
56
+ # {Zen::Markup}}.
54
57
  # @return [Mixed]
55
58
  #
56
59
  def get_entries(section, options = {})
@@ -64,7 +67,8 @@ module Ramaze
64
67
  :order_by => :id,
65
68
  :order => :desc,
66
69
  :custom_field_values => true,
67
- :user => false
70
+ :user => false,
71
+ :markup => true
68
72
  }.merge(options)
69
73
 
70
74
  eager = [:section]
@@ -108,8 +112,13 @@ module Ramaze
108
112
  # Get the fields?
109
113
  if options[:custom_field_values] == true
110
114
  row.custom_field_values.each do |field_value|
111
- name = field_value.custom_field.slug.to_sym
112
- row.fields[name] = field_value.html
115
+ name = field_value.custom_field.slug.to_sym
116
+
117
+ if options[:markup] == true
118
+ row.fields[name] = field_value.html
119
+ else
120
+ row.fields[name] = field_value.value
121
+ end
113
122
  end
114
123
  end
115
124
  end
@@ -125,18 +134,29 @@ module Ramaze
125
134
  #
126
135
  # @since 0.3
127
136
  # @param [String|Fixnum] entry The ID or slug of an entry to retrieve.
137
+ # @param [Hash] options A hash containing various options to customize
138
+ # the return value.
139
+ # @option options [TrueClass|FalseClass] :markup When set to true
140
+ # (default) the values of custom fields are processed using
141
+ # {Zen::Markup}}.
128
142
  # @return [Mixed]
129
143
  #
130
- def get_entry(entry)
131
- row = Sections::Model::SectionEntry.find_by_pk_or_slug(entry)
144
+ def get_entry(entry, options = {})
145
+ options = {:markup => true}.merge(options)
146
+ row = Sections::Model::SectionEntry.find_by_pk_or_slug(entry)
132
147
 
133
148
  return row if row.nil?
134
149
 
135
150
  row.fields ||= {}
136
151
 
137
152
  row.custom_field_values.each do |field_value|
138
- name = field_value.custom_field.slug.to_sym
139
- row.fields[name] = field_value.html
153
+ name = field_value.custom_field.slug.to_sym
154
+
155
+ if options[:markup] == true
156
+ row.fields[name] = field_value.html
157
+ else
158
+ row.fields[name] = field_value.value
159
+ end
140
160
  end
141
161
 
142
162
  return row
data/lib/zen/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Zen
2
2
  # :nodoc:
3
- VERSION = '0.3b'
3
+ VERSION = '0.3b1'
4
4
  end
@@ -39,3 +39,10 @@ Ramaze::Cache.options.session = Ramaze::Cache::LRU
39
39
  # Ramaze::Cache.options.session you should use an external cache in case you're
40
40
  # running a multi-process based setup.
41
41
  Ramaze::Cache.options.settings = Ramaze::Cache::LRU
42
+
43
+ # The cache driver to use for storing translations. If no value is specified in
44
+ # your application Ramaze::Cache::LRU is used.
45
+ #
46
+ # For this setting it is highly recommended to use an external cache such as
47
+ # Redis or Memcached as it can greatly reduce the amount of used memory.
48
+ Ramaze::Cache.options.translations = Ramaze::Cache::LRU
@@ -145,6 +145,18 @@ describe('Ramaze::Helper::SectionFrontend') do
145
145
  page.find('p:first-child').text.should == entry_1.title
146
146
  end
147
147
 
148
+ it('Retrieve a number of entries without their markup converted') do
149
+ entries = get_entries(section.slug, :markup => false)
150
+
151
+ entries[1].fields[:'spec-field'].should == 'hello'
152
+ end
153
+
154
+ it('Retrieve a single entry without processing the markup') do
155
+ entry = get_entry(entry_1.id, :markup => false)
156
+
157
+ entry.fields[:'spec-field'].should == 'hello'
158
+ end
159
+
148
160
  [
149
161
  field,
150
162
  group,
data/zen.gemspec CHANGED
@@ -5,7 +5,7 @@ path = File.expand_path('../', __FILE__)
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'zen'
7
7
  s.version = Zen::VERSION
8
- s.date = '2011-11-23'
8
+ s.date = '2011-11-24'
9
9
  s.authors = ['Yorick Peterse']
10
10
  s.email = 'info@yorickpeterse.com'
11
11
  s.summary = 'Zen is a modular CMS written using Ramaze.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3b
4
+ version: 0.3b1
5
5
  prerelease: 3
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-23 00:00:00.000000000 Z
12
+ date: 2011-11-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sequel
16
- requirement: &2160155880 !ruby/object:Gem::Requirement
16
+ requirement: &2156048860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.28.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2160155880
24
+ version_requirements: *2156048860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ramaze
27
- requirement: &2160155400 !ruby/object:Gem::Requirement
27
+ requirement: &2156046360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2011.10.23
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2160155400
35
+ version_requirements: *2156046360
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bcrypt-ruby
38
- requirement: &2160154920 !ruby/object:Gem::Requirement
38
+ requirement: &2156044660 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.0.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2160154920
46
+ version_requirements: *2156044660
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &2160154440 !ruby/object:Gem::Requirement
49
+ requirement: &2156043180 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.9.2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2160154440
57
+ version_requirements: *2156043180
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: loofah
60
- requirement: &2160153960 !ruby/object:Gem::Requirement
60
+ requirement: &2156042240 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.2.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2160153960
68
+ version_requirements: *2156042240
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ramaze-asset
71
- requirement: &2160153480 !ruby/object:Gem::Requirement
71
+ requirement: &2155894260 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.2.3
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2160153480
79
+ version_requirements: *2155894260
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: shebang
82
- requirement: &2160153000 !ruby/object:Gem::Requirement
82
+ requirement: &2155891860 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0.1'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2160153000
90
+ version_requirements: *2155891860
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rdiscount
93
- requirement: &2152757080 !ruby/object:Gem::Requirement
93
+ requirement: &2155889700 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.6.8
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2152757080
101
+ version_requirements: *2155889700
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: RedCloth
104
- requirement: &2152755980 !ruby/object:Gem::Requirement
104
+ requirement: &2156040220 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 4.2.8
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *2152755980
112
+ version_requirements: *2156040220
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: bacon
115
- requirement: &2152754480 !ruby/object:Gem::Requirement
115
+ requirement: &2156035120 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 1.1.0
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *2152754480
123
+ version_requirements: *2156035120
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: yard
126
- requirement: &2152753060 !ruby/object:Gem::Requirement
126
+ requirement: &2156034260 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 0.7.2
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *2152753060
134
+ version_requirements: *2156034260
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: capybara
137
- requirement: &2160204560 !ruby/object:Gem::Requirement
137
+ requirement: &2156033340 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: 1.1.1
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *2160204560
145
+ version_requirements: *2156033340
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: sqlite3
148
- requirement: &2160204080 !ruby/object:Gem::Requirement
148
+ requirement: &2156031840 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: 1.3.4
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *2160204080
156
+ version_requirements: *2156031840
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: defensio
159
- requirement: &2160203600 !ruby/object:Gem::Requirement
159
+ requirement: &2156029320 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: 0.9.1
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *2160203600
167
+ version_requirements: *2156029320
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: simplecov
170
- requirement: &2160203120 !ruby/object:Gem::Requirement
170
+ requirement: &2156027760 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,10 +175,10 @@ dependencies:
175
175
  version: 0.4.2
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *2160203120
178
+ version_requirements: *2156027760
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: webmock
181
- requirement: &2160202640 !ruby/object:Gem::Requirement
181
+ requirement: &2156026440 !ruby/object:Gem::Requirement
182
182
  none: false
183
183
  requirements:
184
184
  - - ! '>='
@@ -186,7 +186,7 @@ dependencies:
186
186
  version: 1.6.4
187
187
  type: :development
188
188
  prerelease: false
189
- version_requirements: *2160202640
189
+ version_requirements: *2156026440
190
190
  description: Zen is a modular CMS written using Ramaze. Zen gives you complete freedom
191
191
  to build whatever you want in whatever way you might want to build it.
192
192
  email: info@yorickpeterse.com