js-namespace-rails 1.0.1 → 1.0.2
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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e856175ef86aae61fe8652a9eab0eca6ea5b8be2
         | 
| 4 | 
            +
              data.tar.gz: 2b3898475d0ab5ee4151ca442841fe8014e553da
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d8ad6b85b9ee92e81b4e0fce12b8599fc7c90a36ed6eb63deab9ff8fea754228a95dc954550732cba7512cf626620cf5a711e1eca35cd6ca4c8c81157a77e442
         | 
| 7 | 
            +
              data.tar.gz: 73dcd9281f30f4c9c540127ea01216f751a942ad2c9b886f7f85d7930fea02423b8f7f2adfa8566f2f6f7f31c78267d0d3a3822f08c4d93ec0456e4c6434bb84
         | 
| @@ -1,5 +1,7 @@ | |
| 1 1 | 
             
            document.addEventListener('DOMContentLoaded', function() {
         | 
| 2 | 
            -
              document. | 
| 3 | 
            -
              document. | 
| 4 | 
            -
              window.JsSpace | 
| 2 | 
            +
              document.body.setAttribute('data-controller', '<%= controller_path.gsub(/\//,'_') %>');
         | 
| 3 | 
            +
              document.body.setAttribute('data-action', '<%= action_name %>');
         | 
| 4 | 
            +
              if(window.JsSpace){
         | 
| 5 | 
            +
                window.JsSpace.params = <%= raw @js_namespace_rails_params.to_json %>;
         | 
| 6 | 
            +
              }
         | 
| 5 7 | 
             
            });
         | 
| @@ -6,6 +6,7 @@ module JsNamespaceRails | |
| 6 6 | 
             
                  base.module_eval do
         | 
| 7 7 | 
             
                    helper_method :js_execute
         | 
| 8 8 | 
             
                    helper_method :insert_hook_script
         | 
| 9 | 
            +
                    helper_method :initialize_script
         | 
| 9 10 | 
             
                  end
         | 
| 10 11 | 
             
                end
         | 
| 11 12 |  | 
| @@ -15,11 +16,15 @@ module JsNamespaceRails | |
| 15 16 | 
             
                end
         | 
| 16 17 |  | 
| 17 18 | 
             
                def js_execute
         | 
| 18 | 
            -
                  view_context.render | 
| 19 | 
            +
                  view_context.render partial: 'js_namespace_rails/init.js.erb'
         | 
| 19 20 | 
             
                end
         | 
| 20 21 |  | 
| 21 22 | 
             
                def insert_hook_script
         | 
| 22 | 
            -
                  view_context.render | 
| 23 | 
            +
                  view_context.render partial: 'js_namespace_rails/hook.js.erb'
         | 
| 24 | 
            +
                end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                def initialize_script
         | 
| 27 | 
            +
                  view_context.render partial: 'js_namespace_rails/initialize_script.html.erb'
         | 
| 23 28 | 
             
                end
         | 
| 24 29 | 
             
              end
         | 
| 25 30 | 
             
              ::ActionController::Base.send :include, ActionControllerExtension
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: js-namespace-rails
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jason Hou
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2017-01-19 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: railties
         | 
| @@ -147,6 +147,7 @@ files: | |
| 147 147 | 
             
            - app/assets/javascripts/js-namespace-rails.js
         | 
| 148 148 | 
             
            - app/views/js_namespace_rails/_hook.js.erb
         | 
| 149 149 | 
             
            - app/views/js_namespace_rails/_init.js.erb
         | 
| 150 | 
            +
            - app/views/js_namespace_rails/_initialize_script.html.erb
         | 
| 150 151 | 
             
            - lib/js-namespace-rails.rb
         | 
| 151 152 | 
             
            - lib/js_namespace_rails.rb
         | 
| 152 153 | 
             
            - lib/js_namespace_rails/action_controller_extension.rb
         | 
| @@ -165,7 +166,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 165 166 | 
             
              requirements:
         | 
| 166 167 | 
             
              - - ">="
         | 
| 167 168 | 
             
                - !ruby/object:Gem::Version
         | 
| 168 | 
            -
                  version: '0'
         | 
| 169 | 
            +
                  version: '2.0'
         | 
| 169 170 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 170 171 | 
             
              requirements:
         | 
| 171 172 | 
             
              - - ">="
         | 
| @@ -173,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 173 174 | 
             
                  version: '0'
         | 
| 174 175 | 
             
            requirements: []
         | 
| 175 176 | 
             
            rubyforge_project: 
         | 
| 176 | 
            -
            rubygems_version: 2.6. | 
| 177 | 
            +
            rubygems_version: 2.6.8
         | 
| 177 178 | 
             
            signing_key: 
         | 
| 178 179 | 
             
            specification_version: 4
         | 
| 179 180 | 
             
            summary: js-namespace-rails let you choose which javascript snippet can execute in
         |