pagelime_rails 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Heroku.md ADDED
@@ -0,0 +1,4 @@
1
+ Pagelime CMS Addon
2
+ =====================
3
+
4
+ The CMS add-on enables the Pagelime CMS for your app, and allows your team to edit content on your Heroku app without commiting new code, modifying the database, or impacting the release process.
data/Readme.md ADDED
@@ -0,0 +1,81 @@
1
+ Pagelime Rails Plugin
2
+ =====================
3
+
4
+ Easily add the Pagelime CMS to your rails app.
5
+
6
+ Pagelime is a simple CMS service that allows you to define editable regions in your content without installing any software on your site or app. 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. We host all of the code, content, and data until you publish a page. When you publish a page, we push the content to your site/app via secure FTP or web APIs.
7
+
8
+ One line example:
9
+ `<div id="my_content" class="cms-editable">This content is now editable in Pagelime... no code... no databases... no fuss</div>`
10
+
11
+ Getting Started
12
+ ---------------
13
+
14
+ Requirements:
15
+
16
+ * Pagelime account (either a standalone from pagelime.com or as a Heroku add-on)
17
+ * Nokogiri gem
18
+
19
+ ### Step 1. (Skip if using Heroku add-on)
20
+ If NOT on Heroku, set up a site for your Rails app in Pagelime. Make sure that the "Integration Method" for your site on the advanced tab is set to "web services"
21
+
22
+ ### Step 2.
23
+ Require the **pagelime_rails** gem
24
+
25
+ #### For Rails 2
26
+ edit your `config/environment.rb` file and add:
27
+
28
+ `config.gem "pagelime_rails"`
29
+
30
+ then run
31
+
32
+ `rake gems:install`
33
+
34
+ #### For Rails 3
35
+ edit your `Gemfile` and add
36
+
37
+ `gem "pagelime_rails"`
38
+
39
+ then run
40
+
41
+ `bundle install`
42
+
43
+ ### Step 3. (Only for Rails 2.3.X)
44
+ Add the plugin routes to your `config/routes.rb` configuration:
45
+
46
+ `map.cms_routes`
47
+
48
+ These routes are used by Pagelime to clear any caches after save and publish events on your files.
49
+
50
+ *Rails 3 does not need this statement, as the plugin will behave as an engine*
51
+
52
+ ### Step 4.
53
+ For any controller that renders views that you want editable, add the acts_as_cms_editable behavior like so:
54
+
55
+ class CmsPagesController < ApplicationController
56
+ # attach the cms behavior to the controller
57
+ acts_as_cms_editable
58
+
59
+ def index
60
+ end
61
+ end
62
+
63
+ You can pass an `:except` parameter just like with a filter like so:
64
+
65
+ `acts_as_cms_editable :except => :index`
66
+
67
+ ### Step 5.
68
+ Create some editable regions in your views like so:
69
+
70
+ `<div id="my_content" class="cms-editable">this is now editable</div>`
71
+
72
+ *The ID and the class are required for the CMS to work*
73
+
74
+ ### Step 6. (OPTIONAL)
75
+ 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:
76
+
77
+ <% cms_content do %>
78
+ <div id="my_content" class="cms-editable">hello world</div>
79
+ <% end %>
80
+
81
+ Copyright (c) 2011 Pagelime LLC, released under the MIT license
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/config/routes.rb CHANGED
@@ -7,15 +7,27 @@ if Rails::VERSION::MAJOR == 2
7
7
  end
8
8
 
9
9
  elsif Rails::VERSION::MAJOR == 3
10
+
11
+ if Rails::VERSION::MINOR == 0
10
12
 
11
- puts "PAGELIME CMS PLUGIN: setting up rails 3 routes"
13
+ puts "PAGELIME CMS PLUGIN: setting up rails 3 routes"
14
+
15
+ Rails.application.routes.draw do
16
+ match 'pagelime/:action' => 'pagelime_receiver'
17
+ end
18
+
19
+ else
20
+
21
+ puts "PAGELIME CMS PLUGIN: setting up rails 3.1 routes"
22
+
23
+ Pagelime::Engine.routes.draw do
24
+ match 'pagelime/:action' => 'pagelime_receiver'
25
+ end
26
+
27
+ Rails.application.routes.draw do
28
+ mount Pagelime::Engine => "/"
29
+ end
12
30
 
13
- Pagelime::Engine.routes.draw do
14
- match 'pagelime/:action' => 'pagelime_receiver'
15
- end
16
-
17
- Rails.application.routes.draw do
18
- mount Pagelime::Engine => "/"
19
31
  end
20
32
 
21
33
  end
@@ -5,21 +5,19 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pagelime_rails}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Emil Anticevic"]
12
12
  s.date = %q{2012-01-09}
13
13
  s.description = %q{}
14
14
  s.email = %q{eanticev@gmail.com}
15
- s.extra_rdoc_files = [
16
- "README"
17
- ]
18
15
  s.files = [
19
16
  "Gemfile",
17
+ "Heroku.md",
20
18
  "MIT-LICENSE",
21
- "README",
22
19
  "Rakefile",
20
+ "Readme.md",
23
21
  "VERSION",
24
22
  "config/routes.rb",
25
23
  "init.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagelime_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Emil Anticevic
@@ -84,13 +84,14 @@ executables: []
84
84
 
85
85
  extensions: []
86
86
 
87
- extra_rdoc_files:
88
- - README
87
+ extra_rdoc_files: []
88
+
89
89
  files:
90
90
  - Gemfile
91
+ - Heroku.md
91
92
  - MIT-LICENSE
92
- - README
93
93
  - Rakefile
94
+ - Readme.md
94
95
  - VERSION
95
96
  - config/routes.rb
96
97
  - init.rb
data/README DELETED
@@ -1,59 +0,0 @@
1
- Pagelime Rails Plugin
2
- ========
3
-
4
- Easily add the Pagelime CMS to your rails app.
5
-
6
- Pagelime is a simple CMS service that allows you to define editable regions in your content without installing any software on your site or app. 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. We host all of the code, content, and data until you publish a page. When you publish a page, we push the content to your site/app via secure FTP or web APIs.
7
-
8
- One line example:
9
- <div id="my_content" class="cms-editable">This content is now editable in Pagelime... no code... no databases... no fuss</div>
10
-
11
-
12
- Getting Started
13
- =======
14
-
15
- Requirements:
16
- * Pagelime account (either a standalone from www.pagelime.com or as a Heroku add-on)
17
- * Nokogiri gem
18
-
19
- Step 1.
20
- If NOT on Heroku, set up a site for your Rails app in Pagelime. Make sure that the "Integration Method" for your site on the advanced tab is set to "web services"
21
-
22
- Step 2.
23
- Install this plugin on your Rails app, or use it as a gem (pagelime-rails)
24
-
25
- Step 3.
26
- Add the plugin routes to your routes.rb configuration:
27
-
28
- map.cms_routes
29
-
30
- These routes are used by Pagelime to clear any caches after save and publish events on your files.
31
-
32
- Step 4.
33
- For any controller that renders views that you want editable, add the acts_as_cms_editable behavior like so:
34
-
35
- class CmsPagesController < ApplicationController
36
- acts_as_cms_editable
37
-
38
- def index
39
- end
40
- end
41
-
42
- You can pass an :except parameter just like with a filter like so:
43
-
44
- acts_as_cms_editable :except => :index
45
-
46
- Step 5.
47
- Create some editable regions in your views like so:
48
- <div id="my_content" class="cms-editable">...</div>
49
-
50
- The ID is required.
51
-
52
- Step 6. (OPTIONAL)
53
- 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:
54
-
55
- <% cms_content do %>
56
- <div id="my_content" class="cms-editable">hello world</div>
57
- <% end %>
58
-
59
- Copyright (c) 2011 Pagelime LLC, released under the MIT license