deface 1.8.2 → 1.9.0

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: f95e0d9ff0d9928f8791253e4ce8a96e8c3dfda75505f1f6f9d96d5b50ee20cc
4
- data.tar.gz: 5db5672c1fc4c8e43a591674a6d60950a6b70e48f54adbcb9d3f0a380ad2e039
3
+ metadata.gz: 26589c63a50265b4e04831dcb67dc38a16e7a00d21c2e6158d64b7443928aa48
4
+ data.tar.gz: fed8af2ec7577935cc784e5fe91cb7166e7d383f5be281a4f3934cd0e078d8ee
5
5
  SHA512:
6
- metadata.gz: 5b36c2c608cc51a7975a97da0931e351be90dc4a19d4c51bc37d3f5fe6a0023ed31a6b67ed01d6b17105ded32edf6b1d6cfd1a1bd538471a52790fbb526f1cf6
7
- data.tar.gz: 8cf7a37e8af2c13cfcbdeaf039434fd8736e777ec7fb2a2ceeb7186b0a49e4d931c14459e882d71d5d10b527ab523f9f1d6500f452c6acb2b5746b6c015aa99b
6
+ metadata.gz: f830667a04b8a024430b1e32a4c8f209e0c0fbfcec3d468d2eaa1bf6ec53a95d1e1388c204a29ccdae5417c6c462a0f267b5828ec0e4807d5693426721a6790e
7
+ data.tar.gz: 768515c2072167c2f06bbce63c3d9197590da1377711cc2c09315166639411c05cee8f5abf8c4650f50c79d8136e296c28ca0d98e50c576a351e95d626f66640
@@ -15,19 +15,19 @@ jobs:
15
15
  # - ruby: "2.7"
16
16
  # gemfile: "rails_6_1"
17
17
  - ruby: "2.6"
18
- gemfile: "rails_6_1"
18
+ gemfile: "rails_6.1"
19
19
  - ruby: "2.5"
20
- gemfile: "rails_6_1"
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: "rails_6_0"
25
+ gemfile: "rails_6.0"
26
26
  - ruby: "2.5"
27
- gemfile: "rails_6_0"
27
+ gemfile: "rails_6.0"
28
28
 
29
29
  - ruby: "2.5"
30
- gemfile: "rails_5_2"
30
+ gemfile: "rails_5.2"
31
31
 
32
32
  runs-on: ubuntu-latest
33
33
 
data/Appraisals CHANGED
@@ -24,3 +24,12 @@ appraise 'rails-6.1' do
24
24
  gem rails_gem, '~> 6.1.0'
25
25
  end
26
26
  end
27
+
28
+ appraise 'rails-7.0' do
29
+ %w[
30
+ actionview
31
+ railties
32
+ ].each do |rails_gem|
33
+ gem rails_gem, '~> 7.0.0'
34
+ end
35
+ end
@@ -2,12 +2,8 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- %w[
6
- actionview
7
- railties
8
- ].each do |rails_gem|
9
- gem rails_gem, "~> 6.1.0"
10
- end
5
+ gem "actionview", "~> 7.0.0"
6
+ gem "railties", "~> 7.0.0"
11
7
 
12
8
  group :test do
13
9
  gem "test-unit"
@@ -70,8 +70,8 @@ module Deface
70
70
  raise(ArgumentError, ":action is invalid") if self.action.nil?
71
71
  end
72
72
 
73
- #set loaded time (if not already present) for hash invalidation
74
- @args[:updated_at] ||= Time.zone.now.to_f
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, [prefix], partial) }
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"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deface
4
- VERSION = '1.8.2'
4
+ VERSION = '1.9.0'
5
5
 
6
6
  def gem_version
7
7
  Gem::Version.new(VERSION)
@@ -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.8.2
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-02-10 00:00:00.000000000 Z
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/rails_6_1.gemfile
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