cartoonist-pages 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,9 @@ class PageController < CartoonistController
2
2
  def show
3
3
  path = params[:id].downcase
4
4
  @page = Page.from_path path
5
- render
6
- cache_page_as "#{path}.#{cache_type}.html"
5
+
6
+ cache_page_as "#{path}.#{cache_type}.html" do
7
+ render
8
+ end
7
9
  end
8
10
  end
data/app/models/page.rb CHANGED
@@ -7,6 +7,12 @@ class Page < ActiveRecord::Base
7
7
  entity_description &:title
8
8
  attr_accessible :title, :path, :posted_at, :content, :locked, :comments, :in_sitemap
9
9
 
10
+ def to_backup_entries
11
+ page = Backup::Entry.new id, path, "markdown", content
12
+ meta = Backup::Entry.new id, "#{path}.meta", "json", to_json(:except => :content)
13
+ [page, meta]
14
+ end
15
+
10
16
  def url
11
17
  "/#{path}"
12
18
  end
@@ -5,7 +5,7 @@ module CartoonistPages
5
5
  Cartoonist::Migration.add_for self
6
6
 
7
7
  Cartoonist::Backup.for :pages do
8
- Page.order(:id).all
8
+ Page.order(:id)
9
9
  end
10
10
 
11
11
  Cartoonist::Sitemap.add do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cartoonist-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-15 00:00:00.000000000 Z
12
+ date: 2012-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cartoonist
16
- requirement: &13672880 !ruby/object:Gem::Requirement
16
+ requirement: &19272580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
20
20
  - !ruby/object:Gem::Version
21
- version: 0.0.9
21
+ version: 0.0.10
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13672880
24
+ version_requirements: *19272580
25
25
  description: This core plugin for Cartoonist adds arbitrary pages.
26
26
  email: reasonnumber@gmail.com
27
27
  executables: []