twig_ruby 0.0.5 → 0.0.6
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 +4 -4
- data/lib/tasks/twig_parity.rake +1 -1
- data/lib/twig/extension/core.rb +12 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a2cec3c9f7ff1aee90cc8728a14a711376ecfb5c0dcad92d02bd4e25a926a91
|
4
|
+
data.tar.gz: dca954724b75bea4b3ed372371791e2cdc16d6f1e8a6429d876e4d5e14ed34f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdaf2674839c428dc0a784c4173407d89ddce53027342a33c81ca550335ea9bbc3b4c609ded535d8249eed06f2d45e3d544f4419cf9e303b2c51a9f8fe08e197
|
7
|
+
data.tar.gz: 69dab9d2e128182be3d75a1948d3c4c1cc79b392121ce87c091bae7fa1c52c5fe7ec123102d85615eb2430ffa1454b158ab25139e9f5a55d8639bb4a18becb96
|
data/lib/tasks/twig_parity.rake
CHANGED
@@ -256,7 +256,7 @@ class TwigFixture
|
|
256
256
|
templates = {}
|
257
257
|
test.scan(/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=--TEMPLATE|\z)/mx).map do |name, contents|
|
258
258
|
templates[name || 'index.twig'] = contents.
|
259
|
-
gsub(
|
259
|
+
gsub(/\n*\z/, '').
|
260
260
|
gsub('d/m/Y H:i:s P', '%d/%m/%Y %H:%M:%S %:z'). # Change dates to Ruby format
|
261
261
|
gsub('Twig\Tests\TwigTestFoo', 'TwigTestFoo') # Change class name to match Ruby
|
262
262
|
end
|
data/lib/twig/extension/core.rb
CHANGED
@@ -880,11 +880,11 @@ module Twig
|
|
880
880
|
return object[attribute] || (attribute.is_a?(String) ? object[attribute.to_sym] : object[attribute.to_s])
|
881
881
|
end
|
882
882
|
|
883
|
-
if defined_test
|
884
|
-
return false
|
885
|
-
end
|
886
|
-
|
887
883
|
if type == Template::ARRAY_CALL
|
884
|
+
if defined_test
|
885
|
+
return false
|
886
|
+
end
|
887
|
+
|
888
888
|
if ignore_strict_check || !environment.strict_variables?
|
889
889
|
return
|
890
890
|
end
|
@@ -893,7 +893,13 @@ module Twig
|
|
893
893
|
end
|
894
894
|
end
|
895
895
|
|
896
|
-
|
896
|
+
responds_to = begin
|
897
|
+
object.respond_to?(attribute)
|
898
|
+
rescue StandardError
|
899
|
+
false
|
900
|
+
end
|
901
|
+
|
902
|
+
if responds_to
|
897
903
|
if defined_test
|
898
904
|
return true
|
899
905
|
end
|
@@ -933,7 +939,7 @@ module Twig
|
|
933
939
|
end
|
934
940
|
end
|
935
941
|
# Constant could be nil but we should return if we find it
|
936
|
-
elsif (constant = get_constant(object, attribute)) && constant[0] == :found
|
942
|
+
elsif (constant = get_constant(object, attribute.to_s)) && constant[0] == :found
|
937
943
|
constant[1]
|
938
944
|
else
|
939
945
|
return if ignore_strict_check || !environment.strict_variables?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twig_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Blanchette
|
8
8
|
- Fabian Potencier
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|