liquid-autoescape 0.2.1 → 0.2.2

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- N2JlOGEyMGM1MWQ0NWRhMjJhN2NmMjg0NjFlMjY1NWQ2MTZjNjM0MQ==
5
- data.tar.gz: !binary |-
6
- YTFmMDdkMGQxMWQyMzVmZmU3ZWQ5MWNmZjEwNjZlYzZlNTA2NmE4YQ==
2
+ SHA1:
3
+ metadata.gz: c0bb3868d82db6f4e36b31cd0b743ec2e783c926
4
+ data.tar.gz: d3f23c107bb7676248ee94117a2e8323ed2703fe
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YWRmOWZlMzRmNDY1MDgzZjk1OTkyOWRiMzc5YjE3Y2Y4YjM1NDY4YTc4MTA2
10
- MWQ1OWM2NTZmMThlN2NiMzNkOTUxMGNmMjdmYWJlNTY0NGRhMDYzYjkyNzBm
11
- MTc1MjljN2M2ODg5MzE0NjMwYWIyNTY4Y2YxZjZhOWM2Y2RkYzY=
12
- data.tar.gz: !binary |-
13
- MzQ3YmQ0OWFkMWNlMzMyZjA1N2NhZjRmMjcxNTAwYjdiNGE0NDM2Y2VmYjIz
14
- ODk1ZTQ1M2M1ZjQzZTczMTQ2N2IwMWE5NzMyOGFjODRhM2ZlZDkxYzMxNjdk
15
- M2ZjZDc1MjhiNDFhNTVmZjk2YTM4NDI5OTc1MTBjNGQ5MDdkOWM=
6
+ metadata.gz: bb5f6226f2ae6e254bb60cbedc5e9a55a19f889faa4b5da99e72700ce9538b97697eac6e61119887eb0c5f9f99c7571a69b433b525961676bddffb64cee37a7b
7
+ data.tar.gz: 6466e4b630ba6f37de071aa4aa7591b90148ccbc03ed18d7f9b44d2cb3033e96ecbf6bed6927c83dfc9e7a5b166ac9448c5efc9a3127b0b27c0dc38e21339494
@@ -10,14 +10,17 @@ module Liquid
10
10
  module CoreExemptions
11
11
 
12
12
  # A list of all filters that influence escaping
13
- ESCAPING_FILTERS = [:escape, :skip_escape]
13
+ #
14
+ # @private
15
+ ESCAPING_FILTERS = [:escape, :skip_escape].freeze
16
+ private_constant :ESCAPING_FILTERS
14
17
 
15
18
  # Determine whether a Liquid variable uses an escaping filter
16
19
  #
17
20
  # This accounts for both filters that are known to escape the variable
18
21
  # and those that should prevent the variable from being escaped.
19
22
  #
20
- # @param [Liquid::Autoescape::TemplateVariable] A Liquid variable used in a template
23
+ # @param [Liquid::Autoescape::TemplateVariable] variable A Liquid variable used in a template
21
24
  # @return [Boolean]
22
25
  def uses_escaping_filter?(variable)
23
26
  !(variable.filters & ESCAPING_FILTERS).empty?
@@ -28,7 +31,7 @@ module Liquid
28
31
  # Trusted filters can be configured by the user to include any custom
29
32
  # filters that are known to generate already escaped markup.
30
33
  #
31
- # @param [Liquid::Autoescape::TemplateVariable] A Liquid variable used in a template
34
+ # @param [Liquid::Autoescape::TemplateVariable] variable A Liquid variable used in a template
32
35
  # @return [Boolean]
33
36
  def uses_trusted_filter?(variable)
34
37
  !(variable.filters & Autoescape.configuration.trusted_filters).empty?
@@ -35,7 +35,7 @@ module Liquid
35
35
 
36
36
  # Determine whether the exemption applies to a Liquid variable
37
37
  #
38
- # @param [Liquid::Autoescape::TemplateVariable] A Liquid variable used in a template
38
+ # @param [Liquid::Autoescape::TemplateVariable] variable A Liquid variable used in a template
39
39
  # @return [Boolean] Whether the exemption applies to the variable
40
40
  def applies?(variable)
41
41
  @filter.call(variable)
@@ -84,7 +84,7 @@ module Liquid
84
84
  false
85
85
  end
86
86
 
87
- alias_method :apply?, :applies?
87
+ alias apply? applies?
88
88
 
89
89
  # Whether the exemption list has exemptions
90
90
  #
@@ -6,7 +6,7 @@ module Liquid
6
6
  class Variable
7
7
 
8
8
  # @private
9
- alias_method :non_escaping_render, :render
9
+ alias non_escaping_render render
10
10
 
11
11
  # Possibly render the variable with HTML escaping applied
12
12
  #
@@ -61,8 +61,8 @@ module Liquid
61
61
 
62
62
  # Create a wrapper around a Liquid variable used in a template
63
63
  #
64
- # @options options [String] :name The name of the variable
65
- # @options options [Array<Symbol>] :filters The filters applied to the variable
64
+ # @option options [String] :name The name of the variable
65
+ # @option options [Array<Symbol>] :filters The filters applied to the variable
66
66
  def initialize(options={})
67
67
  @name = options.fetch(:name)
68
68
  @filters = options[:filters] || []
@@ -1,5 +1,5 @@
1
1
  module Liquid
2
2
  module Autoescape
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2".freeze
4
4
  end
5
5
  end
@@ -8,7 +8,7 @@ module Liquid
8
8
  # The context variable that stores the autoescape state
9
9
  #
10
10
  # @private
11
- ENABLED_FLAG = "liquid_autoescape_enabled"
11
+ ENABLED_FLAG = "liquid_autoescape_enabled".freeze
12
12
 
13
13
  # Configure Liquid autoescaping
14
14
  #
@@ -29,9 +29,9 @@ module Liquid
29
29
  expect { config.exemptions.add { true } }.to change { config.exemptions.size }.by(1)
30
30
  end
31
31
 
32
- it "cannot directly exemption filters" do
32
+ it "cannot directly set exemption filters" do
33
33
  exemption = lambda { true }
34
- expect { config.exemptions << exemption }.to raise_error
34
+ expect { config.exemptions << exemption }.to raise_error(NoMethodError)
35
35
  end
36
36
 
37
37
  end
metadata CHANGED
@@ -1,91 +1,105 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid-autoescape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Within3
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2017-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '4.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ! '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '2.0'
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: appraisal
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '2.0'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ~>
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '2.0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ~>
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '10.0'
53
+ version: '12.0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '10.0'
60
+ version: '12.0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ~>
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: '3.0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '3.0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rubocop
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.30'
81
+ version: '0.52'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.30'
88
+ version: '0.52'
89
+ - !ruby/object:Gem::Dependency
90
+ name: yard
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: 0.9.11
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 0.9.11
89
103
  description: Apply HTML escaping to all variables in a Liquid block
90
104
  email:
91
105
  - it-operations@within3.com
@@ -123,26 +137,25 @@ require_paths:
123
137
  - lib
124
138
  required_ruby_version: !ruby/object:Gem::Requirement
125
139
  requirements:
126
- - - ! '>='
140
+ - - ">="
127
141
  - !ruby/object:Gem::Version
128
142
  version: '0'
129
143
  required_rubygems_version: !ruby/object:Gem::Requirement
130
144
  requirements:
131
- - - ! '>='
145
+ - - ">="
132
146
  - !ruby/object:Gem::Version
133
147
  version: '0'
134
148
  requirements: []
135
149
  rubyforge_project:
136
- rubygems_version: 2.4.5
150
+ rubygems_version: 2.5.1
137
151
  signing_key:
138
152
  specification_version: 4
139
153
  summary: Autoescape support for Liquid
140
154
  test_files:
141
- - spec/functional/autoescape_tag_spec.rb
142
- - spec/unit/autoescape_spec.rb
143
- - spec/unit/configuration_spec.rb
144
155
  - spec/unit/core_exemptions_spec.rb
156
+ - spec/unit/configuration_spec.rb
157
+ - spec/unit/autoescape_spec.rb
145
158
  - spec/unit/exemption_list_spec.rb
146
159
  - spec/unit/exemption_spec.rb
147
160
  - spec/unit/template_variable_spec.rb
148
- has_rdoc:
161
+ - spec/functional/autoescape_tag_spec.rb