shakespeare 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/app/views/pages/show.html.erb +2 -2
- data/features/public_pages.feature +2 -1
- data/lib/shakespeare.rb +1 -1
- data/lib/shakespeare/view_helpers.rb +28 -28
- data/shakespeare.gemspec +2 -2
- data/spec/debug.log +70 -0
- metadata +3 -3
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<h2><%= @page.title %></h2>
|
2
2
|
|
3
3
|
<%- if Shakespeare::Settings.format_method -%>
|
4
|
-
<%= send(Shakespeare::Settings.format_method, @page.content) %>
|
4
|
+
<%= send(Shakespeare::Settings.format_method, @page.content).html_safe! %>
|
5
5
|
<%- else -%>
|
6
|
-
<%= @page.content %>
|
6
|
+
<%= @page.content.html_safe! %>
|
7
7
|
<%- end -%>
|
data/lib/shakespeare.rb
CHANGED
@@ -3,6 +3,6 @@ require 'shakespeare/shakespeare'
|
|
3
3
|
require 'shakespeare/helpers'
|
4
4
|
require 'shakespeare/view_helpers'
|
5
5
|
|
6
|
-
|
6
|
+
ActionController::Base.send(:include, Shakespeare::Helpers)
|
7
7
|
ActionView::Base.send(:include, Shakespeare::Helpers)
|
8
8
|
ActionView::Base.send(:include, Shakespeare::ViewHelpers)
|
@@ -1,29 +1,29 @@
|
|
1
|
-
module Shakespeare
|
2
|
-
module ViewHelpers
|
3
|
-
def page_title
|
4
|
-
return if page_content.nil? or page_content.title.blank?
|
5
|
-
page_content.title
|
6
|
-
end
|
7
|
-
|
8
|
-
def description_meta_tag
|
9
|
-
return if page_content.nil? or page_content.description.blank?
|
10
|
-
%Q[<meta name="description" content="#{page_content.description}">]
|
11
|
-
end
|
12
|
-
|
13
|
-
def keywords_meta_tag
|
14
|
-
return if page_content.nil? or page_content.keywords.blank?
|
15
|
-
%Q[<meta name="keywords" content="#{page_content.keywords}">]
|
16
|
-
end
|
17
|
-
|
18
|
-
def robots_meta_tag
|
19
|
-
return if page_content.nil? or page_content.robots.blank?
|
20
|
-
%Q[<meta name="robots" content="#{page_content.robots}">]
|
21
|
-
end
|
22
|
-
|
23
|
-
def canonical_link_tag
|
24
|
-
return if page_content.nil? or page_content.canonical.blank?
|
25
|
-
return unless page_content.enable_canonical?
|
26
|
-
%Q[<link href="#{page_content.canonical}" rel="canonical" />]
|
27
|
-
end
|
28
|
-
end
|
1
|
+
module Shakespeare
|
2
|
+
module ViewHelpers
|
3
|
+
def page_title
|
4
|
+
return if page_content.nil? or page_content.title.blank?
|
5
|
+
page_content.title
|
6
|
+
end
|
7
|
+
|
8
|
+
def description_meta_tag
|
9
|
+
return if page_content.nil? or page_content.description.blank?
|
10
|
+
%Q[<meta name="description" content="#{page_content.description}">]
|
11
|
+
end
|
12
|
+
|
13
|
+
def keywords_meta_tag
|
14
|
+
return if page_content.nil? or page_content.keywords.blank?
|
15
|
+
%Q[<meta name="keywords" content="#{page_content.keywords}">]
|
16
|
+
end
|
17
|
+
|
18
|
+
def robots_meta_tag
|
19
|
+
return if page_content.nil? or page_content.robots.blank?
|
20
|
+
%Q[<meta name="robots" content="#{page_content.robots}">]
|
21
|
+
end
|
22
|
+
|
23
|
+
def canonical_link_tag
|
24
|
+
return if page_content.nil? or page_content.canonical.blank?
|
25
|
+
return unless page_content.enable_canonical?
|
26
|
+
%Q[<link href="#{page_content.canonical}" rel="canonical" />]
|
27
|
+
end
|
28
|
+
end
|
29
29
|
end
|
data/shakespeare.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{shakespeare}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Paul Campbell"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-04-27}
|
13
13
|
s.email = %q{paul@rslw.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.md"
|
data/spec/debug.log
CHANGED
@@ -2535,3 +2535,73 @@
|
|
2535
2535
|
[4;36;1mPage Load (0.3ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."url" = '/') LIMIT 1[0m
|
2536
2536
|
[4;35;1mPage Load (0.2ms)[0m [0mSELECT * FROM "pages" [0m
|
2537
2537
|
[4;36;1mPage Create (2.0ms)[0m [0;1mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES(NULL, '2010-03-09 17:53:25', 'Harry B', '2010-03-09 17:53:25', 'harry-b', NULL, NULL, NULL, NULL, NULL, NULL, NULL)[0m
|
2538
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2539
|
+
[4;35;1mSQL (0.4ms)[0m [0m SELECT name
|
2540
|
+
FROM sqlite_master
|
2541
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2542
|
+
[0m
|
2543
|
+
[4;36;1mSQL (2.6ms)[0m [0;1mDROP TABLE "pages"[0m
|
2544
|
+
[4;35;1mSQL (1.6ms)[0m [0mCREATE TABLE "pages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "url" varchar(255), "keywords" text, "description" text, "content" text, "created_at" datetime, "updated_at" datetime, "noindex" boolean, "nofollow" boolean, "canonical" varchar(255), "enable_canonical" boolean, "enable_keywords" boolean) [0m
|
2545
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2546
|
+
FROM sqlite_master
|
2547
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2548
|
+
[0m
|
2549
|
+
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2550
|
+
[4;36;1mPage Load (0.3ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2551
|
+
[4;35;1mPage Load (0.2ms)[0m [0mSELECT * FROM "pages" [0m
|
2552
|
+
[4;36;1mPage Create (0.6ms)[0m [0;1mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES('http://hendersons.com', '2010-03-09 17:57:57', 'Harry and the Hendersons', '2010-03-09 17:57:57', '', 't', '', 't', '', 't', NULL, '80s, movie')[0m
|
2553
|
+
[4;35;1mPage Load (0.4ms)[0m [0mSELECT * FROM "pages" [0m
|
2554
|
+
[4;36;1mPage Create (0.4ms)[0m [0;1mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES(NULL, '2010-03-09 17:57:57', 'Harry and the Hendersons', '2010-03-09 17:57:57', 'kundesmith.co.uk', NULL, NULL, NULL, NULL, NULL, NULL, NULL)[0m
|
2555
|
+
[4;35;1mPage Load (0.3ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."id" = 1) [0m
|
2556
|
+
[4;36;1mPage Load (0.3ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2557
|
+
[4;35;1mPage Load (1.2ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."url" = 'kundesmith.co.uk') LIMIT 1[0m
|
2558
|
+
[4;36;1mPage Load (0.4ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."url" = 'kundesmith.co.uk') LIMIT 1[0m
|
2559
|
+
[4;35;1mPage Update (0.2ms)[0m [0mUPDATE "pages" SET "keywords" = '', "updated_at" = '2010-03-09 17:57:57', "title" = 'Three Men and a Baby', "content" = '', "nofollow" = 'f', "canonical" = '', "description" = '', "noindex" = 'f', "enable_canonical" = 'f' WHERE "id" = 1[0m
|
2560
|
+
[4;36;1mPage Load (0.4ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2561
|
+
[4;35;1mPage Create (0.4ms)[0m [0mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES(NULL, '2010-03-09 17:57:57', 'The Departed', '2010-03-09 17:57:57', 'kautzergoyette.name', NULL, NULL, NULL, NULL, NULL, NULL, NULL)[0m
|
2562
|
+
[4;36;1mPage Load (0.5ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."id" = 1) [0m
|
2563
|
+
[4;35;1mPage Load (0.4ms)[0m [0mSELECT * FROM "pages" [0m
|
2564
|
+
[4;36;1mPage Load (0.4ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."url" = 'kautzergoyette.name') LIMIT 1[0m
|
2565
|
+
[4;35;1mPage Destroy (0.1ms)[0m [0mDELETE FROM "pages" WHERE "id" = 1[0m
|
2566
|
+
[4;36;1mPage Load (0.2ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2567
|
+
[4;35;1mPage Create (0.5ms)[0m [0mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES(NULL, '2010-03-09 17:57:57', 'Mr. MacAllister''s Christmas', '2010-03-09 17:57:57', 'gutmann.ca', NULL, NULL, NULL, NULL, NULL, NULL, NULL)[0m
|
2568
|
+
[4;36;1mPage Load (0.3ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."id" = 1) [0m
|
2569
|
+
[4;35;1mPage Load (0.3ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."title" = 'Mr. MacAllister''s Christmas') LIMIT 1[0m
|
2570
|
+
[4;36;1mPage Update (0.1ms)[0m [0;1mUPDATE "pages" SET "updated_at" = '2010-03-09 17:57:57', "content" = 'I was Home Alone' WHERE "id" = 1[0m
|
2571
|
+
[4;35;1mPage Load (0.3ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."title" = 'Mr. MacAllister''s Christmas') LIMIT 1[0m
|
2572
|
+
[4;36;1mPage Load (0.5ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."url" = 'gutmann.ca') LIMIT 1[0m
|
2573
|
+
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
2574
|
+
[4;35;1mSQL (0.5ms)[0m [0m SELECT name
|
2575
|
+
FROM sqlite_master
|
2576
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2577
|
+
[0m
|
2578
|
+
[4;36;1mSQL (3.5ms)[0m [0;1mDROP TABLE "pages"[0m
|
2579
|
+
[4;35;1mSQL (1.7ms)[0m [0mCREATE TABLE "pages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "url" varchar(255), "keywords" text, "description" text, "content" text, "created_at" datetime, "updated_at" datetime, "noindex" boolean, "nofollow" boolean, "canonical" varchar(255), "enable_canonical" boolean, "enable_keywords" boolean) [0m
|
2580
|
+
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2581
|
+
FROM sqlite_master
|
2582
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
2583
|
+
[0m
|
2584
|
+
[4;35;1mSQL (0.4ms)[0m [0mSELECT version FROM "schema_migrations"[0m
|
2585
|
+
[4;36;1mPage Load (0.2ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2586
|
+
[4;35;1mPage Load (0.2ms)[0m [0mSELECT * FROM "pages" [0m
|
2587
|
+
[4;36;1mPage Create (0.4ms)[0m [0;1mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES('http://hendersons.com', '2010-04-27 13:15:30', 'Harry and the Hendersons', '2010-04-27 13:15:30', '', 't', '', 't', '', 't', NULL, '80s, movie')[0m
|
2588
|
+
[4;35;1mPage Load (0.5ms)[0m [0mSELECT * FROM "pages" [0m
|
2589
|
+
[4;36;1mPage Create (3.7ms)[0m [0;1mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES(NULL, '2010-04-27 13:15:30', 'Harry and the Hendersons', '2010-04-27 13:15:30', 'kundesmith.co.uk', NULL, NULL, NULL, NULL, NULL, NULL, NULL)[0m
|
2590
|
+
[4;35;1mPage Load (4.5ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."id" = 1) [0m
|
2591
|
+
[4;36;1mPage Load (0.6ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2592
|
+
[4;35;1mPage Load (0.4ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."url" = 'kundesmith.co.uk') LIMIT 1[0m
|
2593
|
+
[4;36;1mPage Load (0.4ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."url" = 'kundesmith.co.uk') LIMIT 1[0m
|
2594
|
+
[4;35;1mPage Update (0.1ms)[0m [0mUPDATE "pages" SET "keywords" = '', "updated_at" = '2010-04-27 13:15:30', "title" = 'Three Men and a Baby', "content" = '', "nofollow" = 'f', "canonical" = '', "description" = '', "noindex" = 'f', "enable_canonical" = 'f' WHERE "id" = 1[0m
|
2595
|
+
[4;36;1mPage Load (0.4ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2596
|
+
[4;35;1mPage Create (0.4ms)[0m [0mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES(NULL, '2010-04-27 13:15:30', 'The Departed', '2010-04-27 13:15:30', 'kautzergoyette.name', NULL, NULL, NULL, NULL, NULL, NULL, NULL)[0m
|
2597
|
+
[4;36;1mPage Load (0.4ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."id" = 1) [0m
|
2598
|
+
[4;35;1mPage Load (0.9ms)[0m [0mSELECT * FROM "pages" [0m
|
2599
|
+
[4;36;1mPage Load (0.5ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."url" = 'kautzergoyette.name') LIMIT 1[0m
|
2600
|
+
[4;35;1mPage Destroy (0.1ms)[0m [0mDELETE FROM "pages" WHERE "id" = 1[0m
|
2601
|
+
[4;36;1mPage Load (0.1ms)[0m [0;1mSELECT * FROM "pages" [0m
|
2602
|
+
[4;35;1mPage Create (0.4ms)[0m [0mINSERT INTO "pages" ("canonical", "created_at", "title", "updated_at", "url", "enable_canonical", "content", "nofollow", "description", "noindex", "enable_keywords", "keywords") VALUES(NULL, '2010-04-27 13:15:30', 'Mr. MacAllister''s Christmas', '2010-04-27 13:15:30', 'gutmann.ca', NULL, NULL, NULL, NULL, NULL, NULL, NULL)[0m
|
2603
|
+
[4;36;1mPage Load (0.3ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."id" = 1) [0m
|
2604
|
+
[4;35;1mPage Load (0.4ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."title" = 'Mr. MacAllister''s Christmas') LIMIT 1[0m
|
2605
|
+
[4;36;1mPage Update (0.1ms)[0m [0;1mUPDATE "pages" SET "updated_at" = '2010-04-27 13:15:30', "content" = 'I was Home Alone' WHERE "id" = 1[0m
|
2606
|
+
[4;35;1mPage Load (0.8ms)[0m [0mSELECT * FROM "pages" WHERE ("pages"."title" = 'Mr. MacAllister''s Christmas') LIMIT 1[0m
|
2607
|
+
[4;36;1mPage Load (0.5ms)[0m [0;1mSELECT * FROM "pages" WHERE ("pages"."url" = 'gutmann.ca') LIMIT 1[0m
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Paul Campbell
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-04-27 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|