render_anywhere 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/render_anywhere.rb +13 -1
- data/lib/render_anywhere/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c58f00f90be15cf9f60d197c6b3c2626f1a608f
|
4
|
+
data.tar.gz: 872740610e21a74db9e125ce3abd24b0b272574d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ddf711993dcace39c1302913733fb13534ce5bc9a4ed58dcaa01f007d53518f517343871b4b69a474a5257298bd5a39d9f12b6a07fd206f6460484473789961
|
7
|
+
data.tar.gz: e21e7f0684929e71d1532a3e452632547ea4934bb6b1d4207dcdebc97b5415705d55dda02a29a309429efc73319ec69b1e41f14face5e2ac0bfe3a2d868d0aa1
|
data/README.md
CHANGED
@@ -27,6 +27,18 @@ In your Rails app, in a rake task, model, background job, or where ever you like
|
|
27
27
|
:layout => 'application'
|
28
28
|
html
|
29
29
|
end
|
30
|
+
# Include an additional helper
|
31
|
+
# If being used in a rake task, you may need to require the file(s)
|
32
|
+
# Ex: require Rails.root.join('app', 'helpers', 'blog_pages_helper')
|
33
|
+
def include_helper(helper_name)
|
34
|
+
set_render_anywhere_helpers(helper_name)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Apply an instance variable to the controller
|
38
|
+
# If you need to use instance variables instead of locals, just call this method as many times as you need.
|
39
|
+
def set_instance_variable(var, value)
|
40
|
+
set_instance_variable(var, value)
|
41
|
+
end
|
30
42
|
end
|
31
43
|
|
32
44
|
Thanks
|
data/lib/render_anywhere.rb
CHANGED
@@ -8,7 +8,19 @@ module RenderAnywhere
|
|
8
8
|
def render(*args)
|
9
9
|
rendering_controller.render_to_string(*args)
|
10
10
|
end
|
11
|
-
|
11
|
+
def set_render_anywhere_helpers(*args)
|
12
|
+
args.each do |helper_name|
|
13
|
+
rendering_controller.class_eval do
|
14
|
+
helper helper_name.to_s.constantize
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
def set_instance_variable(var, value)
|
19
|
+
rendering_controller.class_eval do
|
20
|
+
attr_accessor :"#{var}"
|
21
|
+
end
|
22
|
+
rendering_controller.public_send("#{var}=", value)
|
23
|
+
end
|
12
24
|
def rendering_controller
|
13
25
|
@rendering_controller ||= RenderAnywhere::RenderingController.new
|
14
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_anywhere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Melia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|