deface 1.8.2 → 1.9.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/main.yml +5 -5
- data/Appraisals +9 -0
- data/gemfiles/{rails_6_1.gemfile → rails_7.0.gemfile} +2 -6
- data/lib/deface/override.rb +2 -2
- data/lib/deface/search.rb +1 -1
- data/lib/deface/template_helper.rb +3 -3
- data/lib/deface/version.rb +1 -1
- data/spec/deface/search_spec.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26589c63a50265b4e04831dcb67dc38a16e7a00d21c2e6158d64b7443928aa48
|
4
|
+
data.tar.gz: fed8af2ec7577935cc784e5fe91cb7166e7d383f5be281a4f3934cd0e078d8ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f830667a04b8a024430b1e32a4c8f209e0c0fbfcec3d468d2eaa1bf6ec53a95d1e1388c204a29ccdae5417c6c462a0f267b5828ec0e4807d5693426721a6790e
|
7
|
+
data.tar.gz: 768515c2072167c2f06bbce63c3d9197590da1377711cc2c09315166639411c05cee8f5abf8c4650f50c79d8136e296c28ca0d98e50c576a351e95d626f66640
|
data/.github/workflows/main.yml
CHANGED
@@ -15,19 +15,19 @@ jobs:
|
|
15
15
|
# - ruby: "2.7"
|
16
16
|
# gemfile: "rails_6_1"
|
17
17
|
- ruby: "2.6"
|
18
|
-
gemfile: "
|
18
|
+
gemfile: "rails_6.1"
|
19
19
|
- ruby: "2.5"
|
20
|
-
gemfile: "
|
20
|
+
gemfile: "rails_6.1"
|
21
21
|
|
22
22
|
# - ruby: "2.7"
|
23
23
|
# gemfile: "rails_6_0"
|
24
24
|
- ruby: "2.6"
|
25
|
-
gemfile: "
|
25
|
+
gemfile: "rails_6.0"
|
26
26
|
- ruby: "2.5"
|
27
|
-
gemfile: "
|
27
|
+
gemfile: "rails_6.0"
|
28
28
|
|
29
29
|
- ruby: "2.5"
|
30
|
-
gemfile: "
|
30
|
+
gemfile: "rails_5.2"
|
31
31
|
|
32
32
|
runs-on: ubuntu-latest
|
33
33
|
|
data/Appraisals
CHANGED
data/lib/deface/override.rb
CHANGED
@@ -70,8 +70,8 @@ module Deface
|
|
70
70
|
raise(ArgumentError, ":action is invalid") if self.action.nil?
|
71
71
|
end
|
72
72
|
|
73
|
-
#
|
74
|
-
@args[:updated_at] ||= Time.
|
73
|
+
# Set loaded time (if not already present) for hash invalidation
|
74
|
+
@args[:updated_at] ||= Time.current.to_f
|
75
75
|
@args[:railtie_class] = self.class.current_railtie
|
76
76
|
|
77
77
|
self.class.all[virtual_key][name_key] = self
|
data/lib/deface/search.rb
CHANGED
@@ -7,7 +7,7 @@ module Deface
|
|
7
7
|
def find(details)
|
8
8
|
return [] if self.all.empty? || details.empty?
|
9
9
|
|
10
|
-
virtual_path = details[:virtual_path]
|
10
|
+
virtual_path = details[:virtual_path].dup
|
11
11
|
return [] if virtual_path.nil?
|
12
12
|
|
13
13
|
[/^\//, /\.\w+\z/].each { |regex| virtual_path.gsub!(regex, '') }
|
@@ -11,14 +11,14 @@ module Deface
|
|
11
11
|
parts = virtual_path.split("/")
|
12
12
|
|
13
13
|
if parts.size == 2
|
14
|
-
prefix =
|
14
|
+
prefix = nil
|
15
15
|
name = virtual_path
|
16
16
|
else
|
17
|
-
prefix = parts.shift
|
17
|
+
prefix = [parts.shift]
|
18
18
|
name = parts.join("/")
|
19
19
|
end
|
20
20
|
|
21
|
-
view = lookup_context.disable_cache { lookup_context.find(name,
|
21
|
+
view = lookup_context.disable_cache { lookup_context.find(name, prefix, partial) }
|
22
22
|
|
23
23
|
source =
|
24
24
|
if view.handler.to_s == "Haml::Plugin"
|
data/lib/deface/version.rb
CHANGED
data/spec/deface/search_spec.rb
CHANGED
@@ -20,6 +20,12 @@ module Deface
|
|
20
20
|
it "should return empty array when no details hash passed" do
|
21
21
|
expect(Deface::Override.find({})).to eq([])
|
22
22
|
end
|
23
|
+
|
24
|
+
context 'with a frozen string as virtual_path' do
|
25
|
+
it 'works' do
|
26
|
+
expect(Deface::Override.find({:virtual_path => "posts/index".freeze}).size).to eq(1)
|
27
|
+
end
|
28
|
+
end
|
23
29
|
end
|
24
30
|
|
25
31
|
describe "#find_using" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian D Quinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -241,7 +241,7 @@ files:
|
|
241
241
|
- gemfiles/rails_5.2.gemfile
|
242
242
|
- gemfiles/rails_6.0.gemfile
|
243
243
|
- gemfiles/rails_6.1.gemfile
|
244
|
-
- gemfiles/
|
244
|
+
- gemfiles/rails_7.0.gemfile
|
245
245
|
- lib/deface.rb
|
246
246
|
- lib/deface/action_view_extensions.rb
|
247
247
|
- lib/deface/actions/action.rb
|