shakespeare 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/shakespeare/helpers.rb +17 -15
- data/shakespeare.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/shakespeare/helpers.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
-
module Shakespeare
|
2
|
-
module Helpers
|
3
|
-
def self.included(base)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
module Shakespeare
|
2
|
+
module Helpers
|
3
|
+
def self.included(base)
|
4
|
+
if base.respond_to?(:helper_method)
|
5
|
+
base.send(:helper_method, :page_content, :protect_in_production)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def page_content
|
10
|
+
@page_content = Page.find_by_url("#{controller_name}/#{action_name}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def protect_in_production
|
14
|
+
return true unless Shakespeare.env == 'production'
|
15
|
+
render :text => 'Unauthorized' unless Shakespeare::Settings.allow_anonymous
|
16
|
+
end
|
17
|
+
end
|
16
18
|
end
|
data/shakespeare.gemspec
CHANGED