pagelime-rails 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +83 -47
- data/VERSION +1 -1
- data/lib/pagelime/rails.rb +14 -1
- data/pagelime-rails.gemspec +7 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58e60826a5397d0cc87cb048bc64e4b33318298d
|
4
|
+
data.tar.gz: 1983331f41658deadeafa5f413bbfa164522adf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3212b2942a8744db1ff6553519a4c81fff4ff67e4df855177e785c4aab05b5e23a514a594526cc1574c1cf5b065ce512da33dff4edc51945283139f8da83097f
|
7
|
+
data.tar.gz: 8e6af18dbcee6f3325bae95a75f9682c55adc57c2a89272f5065bfa7cc0a230a5f0252d0afefcaf3ccd698a49ec9a1bb384c48e727e7cf7697fe70fb859fcbf1
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,16 +3,31 @@ Pagelime Rails Plugin
|
|
3
3
|
|
4
4
|
Easily add the Pagelime CMS to your Rails app.
|
5
5
|
|
6
|
-
Pagelime is a simple CMS service that allows you to define editable regions in your
|
7
|
-
Simply add a `class="cms-editable"` to any HTML element, and log-in to the Pagelime CMS service to edit your content and images with a nice UI.
|
6
|
+
Pagelime is a simple CMS service that allows you to define editable regions in your pages without installing any software on your website or app.
|
7
|
+
Simply add a `class="cms-editable"` to any HTML element, and log-in to the Pagelime CMS service to edit your content and images with a nice, simple UI.
|
8
8
|
We host all of the code, content, and data until you publish a page.
|
9
|
-
When you publish a page,
|
9
|
+
When you publish a page, the PageLime CMS pushes the content to your website via secure FTP or an API.
|
10
|
+
Using the Rails plugin, we pull the new content into your app dynamically via an API.
|
10
11
|
|
11
|
-
|
12
|
+
### Quick Start (2 lines of code!)
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
First, add the `cms-editable` class and an `id` to make content editable:
|
15
|
+
|
16
|
+
```html
|
17
|
+
<div id="my_content" class="cms-editable">
|
18
|
+
This content is now editable in Pagelime... no code... no databases... no fuss
|
19
|
+
</div>
|
20
|
+
```
|
21
|
+
|
22
|
+
Second, add `acts_as_cms_editable` to your controller to display the latest content:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
class CmsPagesController < ApplicationController
|
26
|
+
acts_as_cms_editable
|
27
|
+
end
|
28
|
+
```
|
29
|
+
|
30
|
+
Done!
|
16
31
|
|
17
32
|
Getting Started
|
18
33
|
---------------
|
@@ -24,25 +39,35 @@ Getting Started
|
|
24
39
|
|
25
40
|
### Step 1: Install the Pagelime Rails gem
|
26
41
|
|
27
|
-
#### For Rails
|
42
|
+
#### For Rails 3
|
28
43
|
|
29
|
-
Edit your `
|
44
|
+
Edit your `Gemfile` and add
|
30
45
|
|
31
|
-
|
46
|
+
```ruby
|
47
|
+
gem "pagelime-rack"
|
48
|
+
gem "pagelime-rails"
|
49
|
+
```
|
32
50
|
|
33
51
|
then run
|
34
52
|
|
35
|
-
|
53
|
+
```bash
|
54
|
+
bundle install
|
55
|
+
```
|
36
56
|
|
37
|
-
#### For Rails
|
57
|
+
#### For Rails 2 (not officially supported)
|
38
58
|
|
39
|
-
Edit your `
|
59
|
+
Edit your `config/environment.rb` file and add:
|
40
60
|
|
41
|
-
|
61
|
+
```ruby
|
62
|
+
config.gem "pagelime-rack"
|
63
|
+
config.gem "pagelime-rails"
|
64
|
+
```
|
42
65
|
|
43
66
|
then run
|
44
67
|
|
45
|
-
|
68
|
+
```bash
|
69
|
+
rake gems:install
|
70
|
+
```
|
46
71
|
|
47
72
|
### Step 2: Setup your Pagelime credentials
|
48
73
|
|
@@ -55,38 +80,45 @@ Make sure that the "Integration Method" for your site on the advanced tab is set
|
|
55
80
|
|
56
81
|
For any controller that renders views that you want editable, add the `acts_as_cms_editable` behavior like so:
|
57
82
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
def index
|
63
|
-
end
|
64
|
-
end
|
83
|
+
```ruby
|
84
|
+
class CmsPagesController < ApplicationController
|
85
|
+
# attach the cms behavior to the controller
|
86
|
+
acts_as_cms_editable
|
65
87
|
|
66
|
-
|
88
|
+
def index
|
89
|
+
end
|
90
|
+
end
|
91
|
+
```
|
67
92
|
|
68
|
-
|
93
|
+
You can pass an `:except` parameter just like with a filter like so:
|
69
94
|
|
70
|
-
|
95
|
+
```ruby
|
96
|
+
acts_as_cms_editable :except => :index
|
97
|
+
```
|
71
98
|
|
72
|
-
|
73
|
-
|
74
|
-
config.cache = Rails.cache
|
75
|
-
# options passed to `fetch(key, options = {}, &block)`
|
76
|
-
config.cache_fetch_options = { :expires_in => 1.year }
|
77
|
-
# any standard logger
|
78
|
-
config.logger = Rails.logger
|
79
|
-
end
|
99
|
+
Caching and logging are automatically setup using your Rails configuration.
|
100
|
+
You can specify custom caching and logging by adding the following to an initializer file.
|
80
101
|
|
81
|
-
|
102
|
+
```ruby
|
103
|
+
Pagelime.configure do |config|
|
82
104
|
|
83
|
-
|
105
|
+
# object that responds to `fetch` and `delete`
|
106
|
+
config.cache = Rails.cache
|
107
|
+
|
108
|
+
# options passed to `fetch(key, options = {}, &block)`
|
109
|
+
config.cache_fetch_options = { :expires_in => 1.year }
|
110
|
+
|
111
|
+
# any standard logger
|
112
|
+
config.logger = Rails.logger
|
113
|
+
|
114
|
+
end
|
115
|
+
```
|
84
116
|
|
85
|
-
|
117
|
+
*It is highly recommended that you enable server caching to reduce latency on each request when retrieving CMS content. [MemCachier](https://www.memcachier.com/) has a great [Heroku addon](https://addons.heroku.com/memcachier) for caching if you don't have caching configured.*
|
86
118
|
|
87
|
-
|
119
|
+
#### Rack Middleware
|
88
120
|
|
89
|
-
|
121
|
+
The `Rack::Pagelime` middleware is inserted before `Rack::ConditionalGet` to retrieve CMS content before HTTP caching is performed.
|
90
122
|
|
91
123
|
#### Additional configuration options
|
92
124
|
|
@@ -96,19 +128,23 @@ These routes are used by Pagelime to clear any caches after save and publish eve
|
|
96
128
|
|
97
129
|
Create some editable regions in your views like so:
|
98
130
|
|
99
|
-
|
100
|
-
|
101
|
-
|
131
|
+
```html
|
132
|
+
<div id="my_content" class="cms-editable">
|
133
|
+
this is now editable
|
134
|
+
</div>
|
135
|
+
```
|
102
136
|
|
103
|
-
*The ID and the class are required for the CMS to work*
|
137
|
+
*The `ID` and the `class` are required for the CMS to work*
|
104
138
|
|
105
139
|
Optionally: If you don't want to have your entire controller CMS editable for some reason, you can sorround areas in your view with a code block like so:
|
106
140
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
141
|
+
```rhtml
|
142
|
+
<% cms_content do %>
|
143
|
+
<div id="my_content" class="cms-editable">
|
144
|
+
hello world
|
145
|
+
</div>
|
146
|
+
<% end %>
|
147
|
+
```
|
112
148
|
|
113
149
|
### Step 5: Edit your pages!
|
114
150
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/lib/pagelime/rails.rb
CHANGED
@@ -17,11 +17,24 @@ module Pagelime
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def configure_pagelime!
|
20
|
+
assets = ::Rails.application.config.assets
|
21
|
+
|
20
22
|
::Pagelime.configure do |config|
|
21
23
|
config.toggle_processing = "per_request"
|
22
24
|
config.logger = ::Rails.logger
|
23
|
-
config.cache = ::Rails.cache
|
24
25
|
config.cache_fetch_options = { :expires_in => 1.year }
|
26
|
+
config.cache = ::Rails.cache
|
27
|
+
|
28
|
+
if assets.enabled == true
|
29
|
+
|
30
|
+
# fallback on asset logger if available
|
31
|
+
config.logger ||= assets.logger if assets.logger != false
|
32
|
+
|
33
|
+
# fallback on asset cache_store if available
|
34
|
+
config.cache ||= ActiveSupport::Cache.lookup_store(assets.cache_store) if assets.cache_store != false
|
35
|
+
|
36
|
+
end
|
37
|
+
|
25
38
|
end
|
26
39
|
end
|
27
40
|
end
|
data/pagelime-rails.gemspec
CHANGED
@@ -2,14 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: pagelime-rails 0.4.4 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "pagelime-rails"
|
8
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.4"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
12
|
s.authors = ["Emil Anticevic", "Joel Van Horn"]
|
12
|
-
s.date = "
|
13
|
+
s.date = "2014-02-11"
|
13
14
|
s.description = ""
|
14
15
|
s.email = "emil@pagelime.com"
|
15
16
|
s.extra_rdoc_files = [
|
@@ -39,25 +40,25 @@ Gem::Specification.new do |s|
|
|
39
40
|
s.homepage = "http://github.com/eanticev/pagelime_rails"
|
40
41
|
s.licenses = ["MIT"]
|
41
42
|
s.require_paths = ["lib"]
|
42
|
-
s.rubygems_version = "2.
|
43
|
+
s.rubygems_version = "2.1.5"
|
43
44
|
s.summary = "Pagelime Rails Plugin"
|
44
45
|
|
45
46
|
if s.respond_to? :specification_version then
|
46
47
|
s.specification_version = 4
|
47
48
|
|
48
49
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
-
s.add_runtime_dependency(%q<pagelime-rack>, [">= 0.4.
|
50
|
+
s.add_runtime_dependency(%q<pagelime-rack>, [">= 0.4.6"])
|
50
51
|
s.add_runtime_dependency(%q<rails>, [">= 2.3"])
|
51
52
|
s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
|
52
53
|
s.add_development_dependency(%q<jeweler>, [">= 1.6.4"])
|
53
54
|
else
|
54
|
-
s.add_dependency(%q<pagelime-rack>, [">= 0.4.
|
55
|
+
s.add_dependency(%q<pagelime-rack>, [">= 0.4.6"])
|
55
56
|
s.add_dependency(%q<rails>, [">= 2.3"])
|
56
57
|
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
57
58
|
s.add_dependency(%q<jeweler>, [">= 1.6.4"])
|
58
59
|
end
|
59
60
|
else
|
60
|
-
s.add_dependency(%q<pagelime-rack>, [">= 0.4.
|
61
|
+
s.add_dependency(%q<pagelime-rack>, [">= 0.4.6"])
|
61
62
|
s.add_dependency(%q<rails>, [">= 2.3"])
|
62
63
|
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
63
64
|
s.add_dependency(%q<jeweler>, [">= 1.6.4"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagelime-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Anticevic
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pagelime-rack
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.4.
|
20
|
+
version: 0.4.6
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.4.
|
27
|
+
version: 0.4.6
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rails
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.1.5
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Pagelime Rails Plugin
|