hocus_pocus 0.4.0 → 0.4.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
  SHA256:
3
- metadata.gz: c50f4663cf52a24e1af23e866e8ba90564c9ae6cd041c8a2aef7d8e6fc636ccf
4
- data.tar.gz: 219f63589b0736115d11e761df2c88502243da4b43b81e554926a8a13fd4189e
3
+ metadata.gz: 9e189194e1124be04610db4649e328ae71703fcf95ca1edfe2e40998735c424d
4
+ data.tar.gz: 972c0c72e3dd81a238def68e3437e192c3fb39f39749998ecf76b344faea07bc
5
5
  SHA512:
6
- metadata.gz: 0dcb97d7aa7d4b53fb39ff5561dcb1e07b6cb0b863569ebb257ab813ccb92d0d431b25b488bc8173e3701ec872a073e77fa68a2678cad2c3bbdb048e989563a3
7
- data.tar.gz: 598eff9be126b971a5de919c78878a598196d7a86dfed0f870c25bcb559ca8d7689624d4164d2b0f1b3a276f3f644054b34d21f07da4aec8860fd0b0e91d2e59
6
+ metadata.gz: 93cc9018f7b274afd9019a119ad44b2aa9a2ce1c3efdb0008e6942ded92f10adc4ed03735dc6f641380c5ee6c61c0ad0bff8625d64bad6f9ef4f8b88b3ea11af
7
+ data.tar.gz: 6e3f75ec3c25584165315454b0137b625a142f484c89799de5633415e31624c4fc477fbbad52dd9fcb335e3d85ed3c2c072a4b5064180e688ddff7a2b889cbb5
@@ -7,16 +7,30 @@ module HocusPocus
7
7
  PARTIAL_FILENAMES = :__hocus_pocus_partial_filenames__
8
8
 
9
9
  module PartialRendererExtension
10
- def render_partial
11
- (Thread.current[HocusPocus::Editor::PARTIAL_FILENAMES] ||= []) << @template unless @view.controller.class.name.starts_with?('HocusPocus::')
12
- super
10
+ if ::ActionView::PartialRenderer.instance_method(:render_partial).arity == 2 # Rails 6
11
+ def render_partial(view, template)
12
+ (Thread.current[HocusPocus::Editor::PARTIAL_FILENAMES] ||= []) << template unless view.controller.class.name.starts_with?('HocusPocus::')
13
+ super
14
+ end
15
+ else
16
+ def render_partial
17
+ (Thread.current[HocusPocus::Editor::PARTIAL_FILENAMES] ||= []) << @template unless @view.controller.class.name.starts_with?('HocusPocus::')
18
+ super
19
+ end
13
20
  end
14
21
  end
15
22
 
16
23
  module TemplateRendererExtension
17
- def render_template(template, layout_name = nil, locals = {})
18
- Thread.current[HocusPocus::Editor::VIEW_FILENAME] = template.virtual_path if @view.controller.try(:request).try(:format).try(:html?) && !@view.controller.class.name.starts_with?('HocusPocus::')
19
- super
24
+ if ::ActionView::TemplateRenderer.instance_method(:render_template).arity == 4 # Rails 6
25
+ def render_template(view, template, layout_name, locals)
26
+ Thread.current[HocusPocus::Editor::VIEW_FILENAME] = template.virtual_path if view.controller.try(:request).try(:format).try(:html?) && !view.controller.class.name.starts_with?('HocusPocus::')
27
+ super
28
+ end
29
+ else
30
+ def render_template(template, layout_name = nil, locals = {})
31
+ Thread.current[HocusPocus::Editor::VIEW_FILENAME] = template.virtual_path if @view.controller.try(:request).try(:format).try(:html?) && !@view.controller.class.name.starts_with?('HocusPocus::')
32
+ super
33
+ end
20
34
  end
21
35
  end
22
36
 
@@ -17,7 +17,7 @@
17
17
  <div id="container">
18
18
  <div id="generate">
19
19
  <h1>Generate Scaffold</h1>
20
- <%= form_tag scaffold_generator_path, :remote => true, :id => 'generator_form' do %>
20
+ <%= form_tag scaffold_generator_path, :remote => true, :id => 'generator_form', authenticity_token: true do %>
21
21
  <h2>
22
22
  <% if @name.include? '_' %>
23
23
  g scaffold
@@ -1,3 +1,3 @@
1
1
  module HocusPocus
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hocus_pocus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-09 00:00:00.000000000 Z
11
+ date: 2019-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nested_scaffold
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.0.1
118
+ rubygems_version: 3.0.3
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: A magical Engine that casts a spell on your Rails 3.1 app