multiview 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 650c7df341ee5b96e1a2fda99e8d026c2aad2f2f
4
- data.tar.gz: eba95cc7ffc902f9df1357c41a2b157fe236c0bb
3
+ metadata.gz: 1e132d129c25fffcfa989a0dba045156cfe3bd6d
4
+ data.tar.gz: f959713516300b1a16987e233707fadb0bff4c0f
5
5
  SHA512:
6
- metadata.gz: 145978eaf69e93ede41a767433073879ed7cf1eb97948150a14d8f7de800e1a6dc9ea760b867d4faa7fa8fd5e952f3a4fcba98224f176a894d7e2b5cfa678f2a
7
- data.tar.gz: 694c768525e76b4433b178fcffc3389fa5c9e99fea4af6f0db05fd81588e239c82901b40b048efa173b7cc20c4b4b89b85d1c955c03cc60268d229e18d9a8ba9
6
+ metadata.gz: 9a27e21c6b8cba2ebbf3041cb99c2e92aaa56b0f7b24a6086d584172fcd027502e2f6869cb57cec6121be56ae5af4da83fb7f74dd84dcd0df0b34db548818602
7
+ data.tar.gz: c909c6820c06a9d87dc820d92e8ea872962becb9cd48aa12a966ecd53976ff0d2b3d47ed35586e34fe2cc3d8e74555898d70e0651d53b97bc2c1ebeacc4248e8
data/README.md CHANGED
@@ -74,12 +74,16 @@ class ApplicationController < ActionController::Base
74
74
  # $multiview.redispatch(self, params[:controller], params[:action])
75
75
 
76
76
  # if exist V3::XxxController, should to call V3::XxxController
77
- # if not, should to call XxxController
77
+ # if not, should to call XxxController and prepend v3 views path
78
+ # when you just want to change something for views, you should not to redefined a controller for the version
78
79
  # $multiview.redispatch(self, params[:controller], params[:action], 'v3')
79
80
  end
80
81
  end
81
82
  ```
82
83
 
84
+ Limitation: We only overwrite those action about already defined.
85
+
86
+
83
87
  ### Dispatch request by middleware
84
88
 
85
89
  ```
@@ -108,6 +112,11 @@ end
108
112
  config.middleware.insert_before Rails.application.routes, MultiviewMiddleware
109
113
  ```
110
114
 
115
+ Limitation: Depend Rails.application.routes.recognize_path, if you have some specific routes, might it cannot work.
116
+
117
+ Anyway, it soloved that problem of `before_action`
118
+
119
+
111
120
 
112
121
  ## Development
113
122
 
@@ -5,7 +5,7 @@ module Multiview
5
5
  # Params:
6
6
  # config: {controller_path: version
7
7
  def initialize(versions_map)
8
- @versions_map = versions_map
8
+ @versions_map = versions_map.symbolize_keys
9
9
  end
10
10
 
11
11
  def dispatch(env, controller_path, action_name, version = nil)
@@ -57,6 +57,5 @@ module Multiview
57
57
  Rails.logger.warn("[Multiview] Prepend view path app/views/#{version}")
58
58
  controller.prepend_view_path(Rails.root.join("app/views/#{version}"))
59
59
  end
60
-
61
60
  end
62
61
  end
@@ -1,3 +1,3 @@
1
1
  module Multiview
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/multiview.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  require "multiview/version"
2
2
 
3
+ require 'active_support'
4
+ require 'active_support/core_ext/module/remove_method'
5
+ require 'active_support/core_ext'
6
+
3
7
  module Multiview
4
8
  require 'multiview/manager'
5
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Xie
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project:
124
- rubygems_version: 2.4.5.2
124
+ rubygems_version: 2.6.11
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Support multiple versions for Rails view.