render_anywhere 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/lib/render_anywhere/rendering_controller.rb +15 -8
- data/lib/render_anywhere/version.rb +1 -1
- metadata +36 -39
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,7 @@ In your Rails app, in a rake task, model, background job, or where ever you like
|
|
20
20
|
require 'render_anywhere'
|
21
21
|
|
22
22
|
class AnyClass
|
23
|
-
include
|
23
|
+
include RenderAnywhere
|
24
24
|
|
25
25
|
def build_html
|
26
26
|
html = render :template => 'normal/template/reference',
|
@@ -7,10 +7,6 @@ module RenderAnywhere
|
|
7
7
|
include AbstractController::Helpers
|
8
8
|
include AbstractController::Translation
|
9
9
|
include AbstractController::AssetPaths
|
10
|
-
include Rails.application.routes.url_helpers
|
11
|
-
|
12
|
-
# this is you normal rails application helper
|
13
|
-
helper ApplicationHelper
|
14
10
|
|
15
11
|
# Define additional helpers, this one is for csrf_meta_tag
|
16
12
|
helper_method :protect_against_forgery?
|
@@ -21,10 +17,19 @@ module RenderAnywhere
|
|
21
17
|
# configure the different paths correctly
|
22
18
|
def initialize(*args)
|
23
19
|
super()
|
20
|
+
|
21
|
+
self.class.send :include, Rails.application.routes.url_helpers
|
22
|
+
|
23
|
+
# this is you normal rails application helper
|
24
|
+
self.class.send :helper, ApplicationHelper
|
25
|
+
|
24
26
|
lookup_context.view_paths = Rails.root.join('app', 'views')
|
25
27
|
config.javascripts_dir = Rails.root.join('public', 'javascripts')
|
26
28
|
config.stylesheets_dir = Rails.root.join('public', 'stylesheets')
|
27
29
|
config.assets_dir = Rails.root.join('public')
|
30
|
+
|
31
|
+
# same asset host as the controllers
|
32
|
+
self.asset_host = ActionController::Base.asset_host
|
28
33
|
end
|
29
34
|
|
30
35
|
# we are not in a browser, no need for this
|
@@ -37,12 +42,14 @@ module RenderAnywhere
|
|
37
42
|
{}
|
38
43
|
end
|
39
44
|
|
40
|
-
# same asset host as the controllers
|
41
|
-
self.asset_host = ActionController::Base.asset_host
|
42
|
-
|
43
45
|
# and nil request to differentiate between live and offline
|
44
46
|
def request
|
45
47
|
nil
|
46
48
|
end
|
49
|
+
|
50
|
+
# and params will be accessible
|
51
|
+
def params
|
52
|
+
{}
|
53
|
+
end
|
47
54
|
end
|
48
|
-
end
|
55
|
+
end
|
metadata
CHANGED
@@ -1,39 +1,41 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_anywhere
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Luke Melia
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: rails
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
24
21
|
version: 3.0.7
|
25
22
|
type: :runtime
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.7
|
30
|
+
description: ! 'Out of the box, Rails will render templates in a controller context
|
31
|
+
only. This gem allows for calling "render" from anywhere: models, background jobs,
|
32
|
+
rake tasks, you name it.'
|
33
|
+
email:
|
29
34
|
- luke@lukemelia.com
|
30
35
|
executables: []
|
31
|
-
|
32
36
|
extensions: []
|
33
|
-
|
34
37
|
extra_rdoc_files: []
|
35
|
-
|
36
|
-
files:
|
38
|
+
files:
|
37
39
|
- .gitignore
|
38
40
|
- Gemfile
|
39
41
|
- README.md
|
@@ -42,33 +44,28 @@ files:
|
|
42
44
|
- lib/render_anywhere/rendering_controller.rb
|
43
45
|
- lib/render_anywhere/version.rb
|
44
46
|
- render_anywhere.gemspec
|
45
|
-
|
46
|
-
homepage: ""
|
47
|
+
homepage: ''
|
47
48
|
licenses: []
|
48
|
-
|
49
49
|
post_install_message:
|
50
50
|
rdoc_options: []
|
51
|
-
|
52
|
-
require_paths:
|
51
|
+
require_paths:
|
53
52
|
- lib
|
54
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
54
|
none: false
|
56
|
-
requirements:
|
57
|
-
- -
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version:
|
60
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
60
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version:
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
66
65
|
requirements: []
|
67
|
-
|
68
66
|
rubyforge_project: render_anywhere
|
69
|
-
rubygems_version: 1.
|
67
|
+
rubygems_version: 1.8.24
|
70
68
|
signing_key:
|
71
69
|
specification_version: 3
|
72
70
|
summary: Render Rails templates to a string from anywhere.
|
73
71
|
test_files: []
|
74
|
-
|