rails_view 2.0.0 → 2.2.0

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.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/lib/rails_view.rb +34 -27
  3. data/rails_view.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODlkZmQ4NWRiMzFjZWQ0MGEyODEyZjNkZTlhMGIzODUzOWNjZTZmZA==
4
+ ZDkwYmNhNjY2ZWU1MDNkNmZmMWRlNWQ3OTIwODI4Mjg3NjIwNTI3Yg==
5
5
  data.tar.gz: !binary |-
6
- NDg1MjA3ZjhiNTEwYTNlZTNiZGMyYzE0ZjhiNzI0ZjM1ZDQ2MmFmYg==
6
+ NGFjNzIwZjljYmYxNjgxMWQ5ZWQyYzZkZDQwMjViYTg1YTEzMThmZg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjBhZjljMDBmYjNkNjVlMGY1NmMyNWFkYzcxYTM0NjkwYzNkYTUwYjA5YWFi
10
- NjNhYjdlZmNjNDg5ZjUxNTI0YjNjNzQ1N2VhNTEwNmU5MzYxZmM4OGQ2MmYz
11
- MmEzYWI3MzdhNWQ1NzQ3NDg0NDZkZThhNTM1OThlYzEzMjdmMDY=
9
+ OGVmZTI4NGIxNWFkNmNiYzljNGY2NmQyYjlmZTc2OGRhMDM3YjJkODIzNjY3
10
+ NDFmYzA1ZjM4NDI5YmUwOTg0NWExNmMwZDIyMDI0MzFmMWU5YmZlMzcxYmU1
11
+ ZWQwMWI5M2ZmMWE4YmRiOGFmNTQ3ZTNhYzIxMjkzYzJkYjdkMDM=
12
12
  data.tar.gz: !binary |-
13
- NWMzYjg4NDJkZDZiYTc5MGJhM2FmNTdkODBmZTVhZWJhZWQwN2M4NGQ1MGY1
14
- ZmJmOGUwY2Y5ODZlYWNkZDZmMDdkZTdjYzNjODg0MmE2OWY1MWQwYmU3ZmY5
15
- YTBkODY3ZGRjMjkyYjkwZGQzNTE1OGIzNjJhZTE5NmUzYTYyMWQ=
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.0.0'
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
- def View.controller(&block)
34
- load_shit!
35
-
36
- controller_class = Class.new(::ActionController::Base) do
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
- default_url_options =
42
- begin
43
- require 'rails_default_url_options'
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
- store = ActiveSupport::Cache::MemoryStore.new
50
- request = ActionDispatch::TestRequest.new
51
- response = ActionDispatch::TestResponse.new
52
-
53
- controller = controller_class.new()
54
-
55
- controller.perform_caching = false
56
- controller.cache_store = store
57
- controller.request = request
58
- controller.response = response
59
- #controller.send(:initialize_template_class, response)
60
- #controller.send(:assign_shortcuts, request, response)
61
- controller.send(:default_url_options).merge!(default_url_options)
62
- block ? controller.instance_eval(&block) : controller
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
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "rails_view"
6
- spec.version = "2.0.0"
6
+ spec.version = "2.2.0"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "rails_view"
9
9
  spec.description = "description: rails_view kicks the ass"
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.0.0
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: 2013-11-26 00:00:00.000000000 Z
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