puffer_pages 0.0.8 → 0.0.9
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.
- data/Gemfile +3 -1
- data/Gemfile.lock +4 -0
- data/README.md +5 -1
- data/VERSION +1 -1
- data/app/models/page.rb +8 -1
- data/puffer_pages.gemspec +12 -4
- data/spec/dummy/config/database.yml +7 -0
- data/spec/dummy/config/environments/pg_test.rb +35 -0
- data/spec/{models → lib}/tags_spec.rb +0 -0
- metadata +44 -14
data/Gemfile
CHANGED
@@ -5,9 +5,11 @@ gem 'liquid'
|
|
5
5
|
gem 'nested_set'
|
6
6
|
gem 'puffer', '>= 0.0.17'
|
7
7
|
|
8
|
-
group :development, :test do
|
8
|
+
group :development, :test, :pg_test do
|
9
9
|
gem "capybara", ">= 0.4.0"
|
10
10
|
gem "sqlite3-ruby", :require => "sqlite3"
|
11
|
+
gem "pg"
|
12
|
+
gem "mysql"
|
11
13
|
|
12
14
|
gem "rspec-rails"
|
13
15
|
gem "autotest"
|
data/Gemfile.lock
CHANGED
@@ -77,10 +77,12 @@ GEM
|
|
77
77
|
daemons (>= 1.0.3)
|
78
78
|
fastthread (>= 1.0.1)
|
79
79
|
gem_plugin (>= 0.2.3)
|
80
|
+
mysql (2.8.1)
|
80
81
|
nested_set (1.6.3)
|
81
82
|
activerecord (>= 3.0.0)
|
82
83
|
railties (>= 3.0.0)
|
83
84
|
nokogiri (1.4.4)
|
85
|
+
pg (0.10.1)
|
84
86
|
polyglot (0.3.1)
|
85
87
|
puffer (0.0.17)
|
86
88
|
cells (~> 3.4.4)
|
@@ -146,7 +148,9 @@ DEPENDENCIES
|
|
146
148
|
jeweler
|
147
149
|
liquid
|
148
150
|
mongrel
|
151
|
+
mysql
|
149
152
|
nested_set
|
153
|
+
pg
|
150
154
|
puffer (>= 0.0.17)
|
151
155
|
rails (~> 3.0.3)
|
152
156
|
rspec-rails
|
data/README.md
CHANGED
@@ -46,12 +46,16 @@ Pages - tree-based structure of site.
|
|
46
46
|
Every page has one or more page parts.
|
47
47
|
Every page part must have main page part, named by default `body`. You can configure main page part name in config/initializers/puffer_pages.rb
|
48
48
|
|
49
|
+
## PageParts
|
50
|
+
Page_parts are the same as content_for block in rails. You can insert current page page_patrs at layout.
|
51
|
+
Also, page_parts are inheritable. It means, that if root has page_part named `sidebar`, all its children will have the same page_part until this page_part will be redefined.
|
52
|
+
|
49
53
|
## Layouts
|
50
54
|
Layout is page canvas, so you can draw page parts on it.
|
51
55
|
You can use layouts from database or applcation for pages.
|
52
56
|
|
53
57
|
### Application layouts
|
54
|
-
For application layout
|
58
|
+
For application layout page_part body will be inserted instead of SUDDENLY! <%= yield %>
|
55
59
|
Rules are the same. If no page part name specified puffer will use page part with default name.
|
56
60
|
See `yield` liquid tag reference
|
57
61
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
data/app/models/page.rb
CHANGED
@@ -95,7 +95,14 @@ class Page < ActiveRecord::Base
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def inherited_page_parts
|
98
|
-
PagePart.where(:page_id => self_and_ancestors.map(&:id).reverse)
|
98
|
+
scope = PagePart.where(:page_id => self_and_ancestors.map(&:id).reverse)
|
99
|
+
case PagePart.connection.adapter_name.downcase
|
100
|
+
when 'postgresql' then
|
101
|
+
ids = scope.select('distinct on (page_parts.name) page_parts.id').joins(:page).order('page_parts.name, pages.lft desc').map(&:id)
|
102
|
+
PagePart.where(:id => ids).order("name = '#{PufferPages.primary_page_part_name}' desc, name")
|
103
|
+
else
|
104
|
+
scope.group('name').order("name = '#{PufferPages.primary_page_part_name}' desc, name")
|
105
|
+
end
|
99
106
|
end
|
100
107
|
|
101
108
|
def part name
|
data/puffer_pages.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{puffer_pages}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["pyromaniac"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-13}
|
13
13
|
s.description = %q{Puffer pages is integratable rails CMS with puffer admin interface}
|
14
14
|
s.email = %q{kinwizard@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -84,6 +84,7 @@ Gem::Specification.new do |s|
|
|
84
84
|
"spec/dummy/config/database.yml",
|
85
85
|
"spec/dummy/config/environment.rb",
|
86
86
|
"spec/dummy/config/environments/development.rb",
|
87
|
+
"spec/dummy/config/environments/pg_test.rb",
|
87
88
|
"spec/dummy/config/environments/production.rb",
|
88
89
|
"spec/dummy/config/environments/test.rb",
|
89
90
|
"spec/dummy/config/initializers/backtrace_silencers.rb",
|
@@ -129,8 +130,8 @@ Gem::Specification.new do |s|
|
|
129
130
|
"spec/fabricators/pages_fabricator.rb",
|
130
131
|
"spec/fabricators/snippets_fabricator.rb",
|
131
132
|
"spec/integration/navigation_spec.rb",
|
133
|
+
"spec/lib/tags_spec.rb",
|
132
134
|
"spec/models/page_spec.rb",
|
133
|
-
"spec/models/tags_spec.rb",
|
134
135
|
"spec/puffer_pages_spec.rb",
|
135
136
|
"spec/spec_helper.rb"
|
136
137
|
]
|
@@ -150,6 +151,7 @@ Gem::Specification.new do |s|
|
|
150
151
|
"spec/dummy/config/boot.rb",
|
151
152
|
"spec/dummy/config/environment.rb",
|
152
153
|
"spec/dummy/config/environments/development.rb",
|
154
|
+
"spec/dummy/config/environments/pg_test.rb",
|
153
155
|
"spec/dummy/config/environments/production.rb",
|
154
156
|
"spec/dummy/config/environments/test.rb",
|
155
157
|
"spec/dummy/config/initializers/backtrace_silencers.rb",
|
@@ -170,8 +172,8 @@ Gem::Specification.new do |s|
|
|
170
172
|
"spec/fabricators/pages_fabricator.rb",
|
171
173
|
"spec/fabricators/snippets_fabricator.rb",
|
172
174
|
"spec/integration/navigation_spec.rb",
|
175
|
+
"spec/lib/tags_spec.rb",
|
173
176
|
"spec/models/page_spec.rb",
|
174
|
-
"spec/models/tags_spec.rb",
|
175
177
|
"spec/puffer_pages_spec.rb",
|
176
178
|
"spec/spec_helper.rb"
|
177
179
|
]
|
@@ -186,6 +188,8 @@ Gem::Specification.new do |s|
|
|
186
188
|
s.add_runtime_dependency(%q<puffer>, [">= 0.0.17"])
|
187
189
|
s.add_development_dependency(%q<capybara>, [">= 0.4.0"])
|
188
190
|
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
191
|
+
s.add_development_dependency(%q<pg>, [">= 0"])
|
192
|
+
s.add_development_dependency(%q<mysql>, [">= 0"])
|
189
193
|
s.add_development_dependency(%q<rspec-rails>, [">= 0"])
|
190
194
|
s.add_development_dependency(%q<autotest>, [">= 0"])
|
191
195
|
s.add_development_dependency(%q<forgery>, [">= 0"])
|
@@ -199,6 +203,8 @@ Gem::Specification.new do |s|
|
|
199
203
|
s.add_dependency(%q<puffer>, [">= 0.0.17"])
|
200
204
|
s.add_dependency(%q<capybara>, [">= 0.4.0"])
|
201
205
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
206
|
+
s.add_dependency(%q<pg>, [">= 0"])
|
207
|
+
s.add_dependency(%q<mysql>, [">= 0"])
|
202
208
|
s.add_dependency(%q<rspec-rails>, [">= 0"])
|
203
209
|
s.add_dependency(%q<autotest>, [">= 0"])
|
204
210
|
s.add_dependency(%q<forgery>, [">= 0"])
|
@@ -213,6 +219,8 @@ Gem::Specification.new do |s|
|
|
213
219
|
s.add_dependency(%q<puffer>, [">= 0.0.17"])
|
214
220
|
s.add_dependency(%q<capybara>, [">= 0.4.0"])
|
215
221
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
222
|
+
s.add_dependency(%q<pg>, [">= 0"])
|
223
|
+
s.add_dependency(%q<mysql>, [">= 0"])
|
216
224
|
s.add_dependency(%q<rspec-rails>, [">= 0"])
|
217
225
|
s.add_dependency(%q<autotest>, [">= 0"])
|
218
226
|
s.add_dependency(%q<forgery>, [">= 0"])
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
22
|
+
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
27
|
+
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
|
33
|
+
# Print deprecation notices to the stderr
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
end
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puffer_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- pyromaniac
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-13 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -121,7 +121,7 @@ dependencies:
|
|
121
121
|
version: "0"
|
122
122
|
requirement: *id007
|
123
123
|
prerelease: false
|
124
|
-
name:
|
124
|
+
name: pg
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
type: :development
|
127
127
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
@@ -135,7 +135,7 @@ dependencies:
|
|
135
135
|
version: "0"
|
136
136
|
requirement: *id008
|
137
137
|
prerelease: false
|
138
|
-
name:
|
138
|
+
name: mysql
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
type: :development
|
141
141
|
version_requirements: &id009 !ruby/object:Gem::Requirement
|
@@ -149,10 +149,38 @@ dependencies:
|
|
149
149
|
version: "0"
|
150
150
|
requirement: *id009
|
151
151
|
prerelease: false
|
152
|
-
name:
|
152
|
+
name: rspec-rails
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
type: :development
|
155
155
|
version_requirements: &id010 !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
hash: 3
|
161
|
+
segments:
|
162
|
+
- 0
|
163
|
+
version: "0"
|
164
|
+
requirement: *id010
|
165
|
+
prerelease: false
|
166
|
+
name: autotest
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
type: :development
|
169
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
hash: 3
|
175
|
+
segments:
|
176
|
+
- 0
|
177
|
+
version: "0"
|
178
|
+
requirement: *id011
|
179
|
+
prerelease: false
|
180
|
+
name: forgery
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
type: :development
|
183
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
156
184
|
none: false
|
157
185
|
requirements:
|
158
186
|
- - "="
|
@@ -163,12 +191,12 @@ dependencies:
|
|
163
191
|
- 9
|
164
192
|
- 2
|
165
193
|
version: 0.9.2
|
166
|
-
requirement: *
|
194
|
+
requirement: *id012
|
167
195
|
prerelease: false
|
168
196
|
name: fabrication
|
169
197
|
- !ruby/object:Gem::Dependency
|
170
198
|
type: :development
|
171
|
-
version_requirements: &
|
199
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
172
200
|
none: false
|
173
201
|
requirements:
|
174
202
|
- - ">="
|
@@ -177,12 +205,12 @@ dependencies:
|
|
177
205
|
segments:
|
178
206
|
- 0
|
179
207
|
version: "0"
|
180
|
-
requirement: *
|
208
|
+
requirement: *id013
|
181
209
|
prerelease: false
|
182
210
|
name: jeweler
|
183
211
|
- !ruby/object:Gem::Dependency
|
184
212
|
type: :development
|
185
|
-
version_requirements: &
|
213
|
+
version_requirements: &id014 !ruby/object:Gem::Requirement
|
186
214
|
none: false
|
187
215
|
requirements:
|
188
216
|
- - ">="
|
@@ -191,7 +219,7 @@ dependencies:
|
|
191
219
|
segments:
|
192
220
|
- 0
|
193
221
|
version: "0"
|
194
|
-
requirement: *
|
222
|
+
requirement: *id014
|
195
223
|
prerelease: false
|
196
224
|
name: mongrel
|
197
225
|
description: Puffer pages is integratable rails CMS with puffer admin interface
|
@@ -271,6 +299,7 @@ files:
|
|
271
299
|
- spec/dummy/config/database.yml
|
272
300
|
- spec/dummy/config/environment.rb
|
273
301
|
- spec/dummy/config/environments/development.rb
|
302
|
+
- spec/dummy/config/environments/pg_test.rb
|
274
303
|
- spec/dummy/config/environments/production.rb
|
275
304
|
- spec/dummy/config/environments/test.rb
|
276
305
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
@@ -316,8 +345,8 @@ files:
|
|
316
345
|
- spec/fabricators/pages_fabricator.rb
|
317
346
|
- spec/fabricators/snippets_fabricator.rb
|
318
347
|
- spec/integration/navigation_spec.rb
|
348
|
+
- spec/lib/tags_spec.rb
|
319
349
|
- spec/models/page_spec.rb
|
320
|
-
- spec/models/tags_spec.rb
|
321
350
|
- spec/puffer_pages_spec.rb
|
322
351
|
- spec/spec_helper.rb
|
323
352
|
has_rdoc: true
|
@@ -366,6 +395,7 @@ test_files:
|
|
366
395
|
- spec/dummy/config/boot.rb
|
367
396
|
- spec/dummy/config/environment.rb
|
368
397
|
- spec/dummy/config/environments/development.rb
|
398
|
+
- spec/dummy/config/environments/pg_test.rb
|
369
399
|
- spec/dummy/config/environments/production.rb
|
370
400
|
- spec/dummy/config/environments/test.rb
|
371
401
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
@@ -386,7 +416,7 @@ test_files:
|
|
386
416
|
- spec/fabricators/pages_fabricator.rb
|
387
417
|
- spec/fabricators/snippets_fabricator.rb
|
388
418
|
- spec/integration/navigation_spec.rb
|
419
|
+
- spec/lib/tags_spec.rb
|
389
420
|
- spec/models/page_spec.rb
|
390
|
-
- spec/models/tags_spec.rb
|
391
421
|
- spec/puffer_pages_spec.rb
|
392
422
|
- spec/spec_helper.rb
|