rails_view 2.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/rails_view.rb +34 -27
- data/rails_view.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDkwYmNhNjY2ZWU1MDNkNmZmMWRlNWQ3OTIwODI4Mjg3NjIwNTI3Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGFjNzIwZjljYmYxNjgxMWQ5ZWQyYzZkZDQwMjViYTg1YTEzMThmZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGVmZTI4NGIxNWFkNmNiYzljNGY2NmQyYjlmZTc2OGRhMDM3YjJkODIzNjY3
|
10
|
+
NDFmYzA1ZjM4NDI5YmUwOTg0NWExNmMwZDIyMDI0MzFmMWU5YmZlMzcxYmU1
|
11
|
+
ZWQwMWI5M2ZmMWE4YmRiOGFmNTQ3ZTNhYzIxMjkzYzJkYjdkMDM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzAyYTIyZTAxMzhmNDhiMTkxYzRhMmZlMjE5NzJiOWZhM2ViMWVhYWM2OWM3
|
14
|
+
NDE4Njc5ZjIwMDllMjM3YmJiMmRhNWFhZjZlYmY5MmZhYzU3MzI0OWRmOGRi
|
15
|
+
YjE3YmM0N2QyODJlM2NiYzBlZDZlYjgxZjY3ODBhY2RjZmRjMGU=
|
data/lib/rails_view.rb
CHANGED
@@ -2,7 +2,7 @@ require 'rails' unless defined?(::Rails)
|
|
2
2
|
require 'action_controller' unless defined?(::ActionController)
|
3
3
|
|
4
4
|
class View
|
5
|
-
VERSION = '2.
|
5
|
+
VERSION = '2.2.0'
|
6
6
|
|
7
7
|
def View.version
|
8
8
|
View::VERSION
|
@@ -30,36 +30,43 @@ class View
|
|
30
30
|
)
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
layout false
|
38
|
-
helper :all
|
33
|
+
if defined?(::Rails_current) && defined?(::Current)
|
34
|
+
def View.controller(&block)
|
35
|
+
controller = ::Current.controller ? ::Current.controller.dup : ::Current.mock_controller
|
36
|
+
block ? controller.instance_eval(&block) : controller
|
39
37
|
end
|
38
|
+
else
|
39
|
+
def View.controller(&block)
|
40
|
+
load_shit!
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
DefaultUrlOptions
|
45
|
-
rescue LoadError
|
46
|
-
options[:default_url_options] || {}
|
42
|
+
controller_class = Class.new(::ActionController::Base) do
|
43
|
+
layout false
|
44
|
+
helper :all
|
47
45
|
end
|
48
46
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
47
|
+
default_url_options =
|
48
|
+
begin
|
49
|
+
require 'rails_default_url_options'
|
50
|
+
DefaultUrlOptions
|
51
|
+
rescue LoadError
|
52
|
+
options[:default_url_options] || {}
|
53
|
+
end
|
54
|
+
|
55
|
+
store = ActiveSupport::Cache::MemoryStore.new
|
56
|
+
request = ActionDispatch::TestRequest.new
|
57
|
+
response = ActionDispatch::TestResponse.new
|
58
|
+
|
59
|
+
controller = controller_class.new()
|
60
|
+
|
61
|
+
controller.perform_caching = false
|
62
|
+
controller.cache_store = store
|
63
|
+
controller.request = request
|
64
|
+
controller.response = response
|
65
|
+
#controller.send(:initialize_template_class, response)
|
66
|
+
#controller.send(:assign_shortcuts, request, response)
|
67
|
+
controller.send(:default_url_options).merge!(default_url_options)
|
68
|
+
block ? controller.instance_eval(&block) : controller
|
69
|
+
end
|
63
70
|
end
|
64
71
|
|
65
72
|
def View.render(*args)
|
data/rails_view.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ara T. Howard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ! 'description: rails_view kicks the ass'
|
14
14
|
email: ara.t.howard@gmail.com
|