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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 132c854b8e1083c6b2e1b32cbebc3e07fd664e80
4
- data.tar.gz: 6884081815a69c9fa9db605933d62b8b7e28817e
3
+ metadata.gz: 6c58f00f90be15cf9f60d197c6b3c2626f1a608f
4
+ data.tar.gz: 872740610e21a74db9e125ce3abd24b0b272574d
5
5
  SHA512:
6
- metadata.gz: 8fb3ff0857f47c2e30af358c89341fcaabaa7a23cd10e9840e9aabc3dad558ee682bbaae39acc76caac5d550c5ef29187e85db294d326e19384c417e9e970166
7
- data.tar.gz: 950924c425c916b671201efedaa368d0eb6ee4c72dc3a99fd1d3fec8a84a67f2d51a90e2f836f3aaa8a11460977d28d1ef02e338ebcdefdccce6b890d6ed27e8
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RenderAnywhere
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  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.7
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-01 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails