inertia_rails 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/push.yml +11 -5
- data/CHANGELOG.md +7 -0
- data/inertia_rails.gemspec +3 -3
- data/lib/inertia_rails/controller.rb +1 -1
- data/lib/inertia_rails/inertia_rails.rb +39 -6
- data/lib/inertia_rails/rspec.rb +1 -1
- data/lib/inertia_rails/version.rb +1 -1
- data/lib/patches/request.rb +4 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef2ef33ca24036a92d67ec557bab99829468a7f9546422b68a703624bd52489d
|
4
|
+
data.tar.gz: 6beb16df6b7511813b62e42e91fbb7d0a251264b2e802e0e0345b04bd08700ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e2d7527c48047f950207b163fa539b6b4735655d501a573035a782cb623f5973a74789574be6722bbf7bd4088835c5a486d9a8962df02d17473c4c2d42a0012
|
7
|
+
data.tar.gz: 96d8302e0fd851874d14ef2cee34c013278924c9e619d7302a2a66ae2a3c5dbd7c3a5e3a7ee2e01f8849adfbd0f54e65b1661cfeeb27320e8f94b415d8ca5567
|
data/.github/workflows/push.yml
CHANGED
@@ -1,21 +1,27 @@
|
|
1
1
|
name: Testing
|
2
2
|
|
3
|
-
on: [push]
|
3
|
+
on: [push, pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
6
|
test:
|
7
|
+
strategy:
|
8
|
+
fail-fast: false
|
9
|
+
matrix:
|
10
|
+
ruby: [2.6, 2.7]
|
11
|
+
|
7
12
|
runs-on: ubuntu-latest
|
13
|
+
name: Test against Ruby ${{ matrix.ruby }}
|
8
14
|
|
9
15
|
steps:
|
10
|
-
- uses: actions/checkout@
|
16
|
+
- uses: actions/checkout@v2
|
11
17
|
|
12
18
|
- name: Setup System
|
13
19
|
run: sudo apt-get install libsqlite3-dev
|
14
20
|
|
15
|
-
- name: Set up Ruby
|
16
|
-
uses:
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
17
23
|
with:
|
18
|
-
ruby-version:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
19
25
|
|
20
26
|
- name: Install gems
|
21
27
|
run: |
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.4.0] - 2020-07-09
|
8
|
+
|
9
|
+
* Fixed Ruby 2.7 deprecation warnings
|
10
|
+
* Added `inertia_partial?` method
|
11
|
+
* Fixed homepage in the gemspec
|
12
|
+
* Make the InertiaRails module data threadsafe
|
13
|
+
|
7
14
|
## [1.3.1] - 2020-02-20
|
8
15
|
|
9
16
|
* Fix a typo in the README (inertia only has 1 t!)
|
data/inertia_rails.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["brain@bellawatt.com", "brandon@bellawatt.com", "eugene@bellawatt.com"]
|
10
10
|
|
11
11
|
spec.summary = %q{Inertia adapter for Rails}
|
12
|
-
spec.homepage = "https://github.com/inertiajs/inertia-rails
|
12
|
+
spec.homepage = "https://github.com/inertiajs/inertia-rails"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 2.0"
|
29
|
-
spec.add_development_dependency "rake", "~>
|
30
|
-
spec.add_development_dependency "rspec-rails", "~>
|
29
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
30
|
+
spec.add_development_dependency "rspec-rails", "~> 4.0"
|
31
31
|
spec.add_development_dependency "rails"
|
32
32
|
spec.add_development_dependency "rails-controller-testing"
|
33
33
|
spec.add_development_dependency "sqlite3"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module InertiaRails
|
2
|
-
|
3
|
-
|
2
|
+
thread_mattr_accessor :threadsafe_shared_plain_data
|
3
|
+
thread_mattr_accessor :threadsafe_shared_blocks
|
4
4
|
|
5
5
|
def self.configure
|
6
6
|
yield(Configuration)
|
@@ -21,11 +21,11 @@ module InertiaRails
|
|
21
21
|
|
22
22
|
# "Setters"
|
23
23
|
def self.share(**args)
|
24
|
-
shared_plain_data.merge
|
24
|
+
self.shared_plain_data = self.shared_plain_data.merge(args)
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.share_block(block)
|
28
|
-
shared_blocks.
|
28
|
+
self.shared_blocks = self.shared_blocks + [block]
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.reset!
|
@@ -36,12 +36,45 @@ module InertiaRails
|
|
36
36
|
private
|
37
37
|
|
38
38
|
module Configuration
|
39
|
-
|
40
|
-
|
39
|
+
thread_mattr_accessor :threadsafe_layout
|
40
|
+
thread_mattr_accessor :threadsafe_version
|
41
41
|
|
42
42
|
def self.evaluated_version
|
43
43
|
self.version.respond_to?(:call) ? self.version.call : self.version
|
44
44
|
end
|
45
|
+
|
46
|
+
def self.layout
|
47
|
+
self.threadsafe_layout || 'application'
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.layout=(val)
|
51
|
+
self.threadsafe_layout = val
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.version
|
55
|
+
self.threadsafe_version
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.version=(val)
|
59
|
+
self.threadsafe_version = val
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Getters and setters to provide default values for the threadsafe attributes
|
64
|
+
def self.shared_plain_data
|
65
|
+
self.threadsafe_shared_plain_data || {}
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.shared_plain_data=(val)
|
69
|
+
self.threadsafe_shared_plain_data = val
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.shared_blocks
|
73
|
+
self.threadsafe_shared_blocks || []
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.shared_blocks=(val)
|
77
|
+
self.threadsafe_shared_blocks = val
|
45
78
|
end
|
46
79
|
|
47
80
|
def self.evaluated_blocks(controller, blocks)
|
data/lib/inertia_rails/rspec.rb
CHANGED
@@ -61,7 +61,7 @@ RSpec.configure do |config|
|
|
61
61
|
config.before(:each, inertia: true) do
|
62
62
|
new_renderer = InertiaRails::Renderer.method(:new)
|
63
63
|
allow(InertiaRails::Renderer).to receive(:new) do |component, controller, request, response, render, named_args|
|
64
|
-
new_renderer.call(component, controller, request, response, inertia_wrap_render(render), named_args)
|
64
|
+
new_renderer.call(component, controller, request, response, inertia_wrap_render(render), **named_args)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
data/lib/patches/request.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inertia_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Knoles
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-07-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -32,28 +32,28 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
35
|
+
version: '13.0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '13.0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rspec-rails
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
49
|
+
version: '4.0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
56
|
+
version: '4.0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rails
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,13 +133,13 @@ files:
|
|
133
133
|
- lib/patches/debug_exceptions/patch-5-0.rb
|
134
134
|
- lib/patches/debug_exceptions/patch-5-1.rb
|
135
135
|
- lib/patches/request.rb
|
136
|
-
homepage: https://github.com/inertiajs/inertia-rails
|
136
|
+
homepage: https://github.com/inertiajs/inertia-rails
|
137
137
|
licenses:
|
138
138
|
- MIT
|
139
139
|
metadata:
|
140
|
-
homepage_uri: https://github.com/inertiajs/inertia-rails
|
141
|
-
source_code_uri: https://github.com/inertiajs/inertia-rails
|
142
|
-
changelog_uri: https://github.com/inertiajs/inertia-rails
|
140
|
+
homepage_uri: https://github.com/inertiajs/inertia-rails
|
141
|
+
source_code_uri: https://github.com/inertiajs/inertia-rails
|
142
|
+
changelog_uri: https://github.com/inertiajs/inertia-rails/CHANGELOG.md
|
143
143
|
post_install_message:
|
144
144
|
rdoc_options: []
|
145
145
|
require_paths:
|