strip-tags 1.0.5 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af2346bfaf613d78a8cb0451d6913ae788b5a629fff5d72466de3be531370265
4
- data.tar.gz: daff9b49baf2be82e9a7846c96e71d0bcab2999a425e4cff3f8816c228745956
3
+ metadata.gz: '0028c1ad9d486eef4c972747922e9a484fc7ff2356b488c31175eee5f08774ce'
4
+ data.tar.gz: b2cb48f07cb9e2d12e0d21bb128038c3d22fb46ef40cf36762ff5dd92c8d4804
5
5
  SHA512:
6
- metadata.gz: abc5ec6a88ceab556c9ac892e4fe43d409ead3047efb2cadb7f88e602ac70ef2f45a3e6405019dff004f1cd4263b1761e0d14fac9b6ea9da6ff494c10edb92fa
7
- data.tar.gz: 046170e57a5a5b993a92265adc4a0624d8201b6257fd331aafdc0324869497f1348d0ea1789e3184a08c52fe14195a58498ca87da37c21038ce04ab710285704
6
+ metadata.gz: 6cc80ad2c09f2df5eb7e6fb45c2bc50dc2d7233ce6ec4aa37ccf17690f7d7f88a3bf6fec8b547e05c2ff9c771df7db1c2ccd3a52528fdcfa05b3855d71825729
7
+ data.tar.gz: 4a0d4e2b8f0bb28024c2aea463359c7b094fd89b6b6f5de434878dad8f566a06c64f2c96289af8f84a2bc52abea96630c18085d27ddea77145938b9601d04367
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Main]
2
2
 
3
+ ## [1.1.0] - 2024-01-15
4
+
5
+ - Support for Rails 7.1.
6
+
3
7
  ## [1.0.0] - 2023-08-03
4
8
 
5
9
  - First version.
data/Gemfile CHANGED
@@ -1,2 +1,8 @@
1
1
  source "https://rubygems.org"
2
2
  gemspec
3
+
4
+ gem "active_attr", "~> 0.15"
5
+
6
+ group :development, :test do
7
+ gem "rspec-rails"
8
+ end
data/Gemfile.lock CHANGED
@@ -1,65 +1,100 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strip-tags (1.0.5)
4
+ strip-tags (1.1.1)
5
5
  activemodel (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionpack (7.0.6)
11
- actionview (= 7.0.6)
12
- activesupport (= 7.0.6)
13
- rack (~> 2.0, >= 2.2.4)
10
+ actionpack (7.1.2)
11
+ actionview (= 7.1.2)
12
+ activesupport (= 7.1.2)
13
+ nokogiri (>= 1.8.5)
14
+ racc
15
+ rack (>= 2.2.4)
16
+ rack-session (>= 1.0.1)
14
17
  rack-test (>= 0.6.3)
15
- rails-dom-testing (~> 2.0)
16
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
- actionview (7.0.6)
18
- activesupport (= 7.0.6)
18
+ rails-dom-testing (~> 2.2)
19
+ rails-html-sanitizer (~> 1.6)
20
+ actionview (7.1.2)
21
+ activesupport (= 7.1.2)
19
22
  builder (~> 3.1)
20
- erubi (~> 1.4)
21
- rails-dom-testing (~> 2.0)
22
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
- active_attr (0.15.4)
24
- actionpack (>= 3.0.2, < 7.1)
25
- activemodel (>= 3.0.2, < 7.1)
26
- activesupport (>= 3.0.2, < 7.1)
27
- activemodel (7.0.6)
28
- activesupport (= 7.0.6)
29
- activesupport (7.0.6)
23
+ erubi (~> 1.11)
24
+ rails-dom-testing (~> 2.2)
25
+ rails-html-sanitizer (~> 1.6)
26
+ active_attr (0.16.0)
27
+ actionpack (>= 3.0.2, < 7.2)
28
+ activemodel (>= 3.0.2, < 7.2)
29
+ activesupport (>= 3.0.2, < 7.2)
30
+ activemodel (7.1.2)
31
+ activesupport (= 7.1.2)
32
+ activesupport (7.1.2)
33
+ base64
34
+ bigdecimal
30
35
  concurrent-ruby (~> 1.0, >= 1.0.2)
36
+ connection_pool (>= 2.2.5)
37
+ drb
31
38
  i18n (>= 1.6, < 2)
32
39
  minitest (>= 5.1)
40
+ mutex_m
33
41
  tzinfo (~> 2.0)
42
+ base64 (0.2.0)
43
+ bigdecimal (3.1.5)
34
44
  builder (3.2.4)
35
45
  concurrent-ruby (1.2.2)
46
+ connection_pool (2.4.1)
36
47
  crass (1.0.6)
37
48
  diff-lcs (1.5.0)
49
+ drb (2.2.0)
50
+ ruby2_keywords
38
51
  erubi (1.12.0)
39
52
  i18n (1.14.1)
40
53
  concurrent-ruby (~> 1.0)
41
- loofah (2.21.3)
54
+ io-console (0.7.1)
55
+ irb (1.11.1)
56
+ rdoc
57
+ reline (>= 0.4.2)
58
+ loofah (2.22.0)
42
59
  crass (~> 1.0.2)
43
60
  nokogiri (>= 1.12.0)
44
- minitest (5.18.1)
45
- nokogiri (1.15.3-arm64-darwin)
61
+ minitest (5.21.1)
62
+ mutex_m (0.2.0)
63
+ nokogiri (1.16.0-arm64-darwin)
46
64
  racc (~> 1.4)
47
- racc (1.7.1)
48
- rack (2.2.7)
65
+ nokogiri (1.16.0-x86_64-linux)
66
+ racc (~> 1.4)
67
+ psych (5.1.2)
68
+ stringio
69
+ racc (1.7.3)
70
+ rack (2.2.8)
71
+ rack-session (1.0.2)
72
+ rack (< 3)
49
73
  rack-test (2.1.0)
50
74
  rack (>= 1.3)
51
- rails-dom-testing (2.1.1)
75
+ rackup (1.0.0)
76
+ rack (< 3)
77
+ webrick
78
+ rails-dom-testing (2.2.0)
52
79
  activesupport (>= 5.0.0)
53
80
  minitest
54
81
  nokogiri (>= 1.6)
55
82
  rails-html-sanitizer (1.6.0)
56
83
  loofah (~> 2.21)
57
84
  nokogiri (~> 1.14)
58
- rake (13.0.6)
59
- rspec (3.12.0)
60
- rspec-core (~> 3.12.0)
61
- rspec-expectations (~> 3.12.0)
62
- rspec-mocks (~> 3.12.0)
85
+ railties (7.1.2)
86
+ actionpack (= 7.1.2)
87
+ activesupport (= 7.1.2)
88
+ irb
89
+ rackup (>= 1.0.0)
90
+ rake (>= 12.2)
91
+ thor (~> 1.0, >= 1.2.2)
92
+ zeitwerk (~> 2.6)
93
+ rake (13.1.0)
94
+ rdoc (6.6.2)
95
+ psych (>= 4.0.0)
96
+ reline (0.4.2)
97
+ io-console (~> 0.5)
63
98
  rspec-core (3.12.2)
64
99
  rspec-support (~> 3.12.0)
65
100
  rspec-expectations (3.12.3)
@@ -68,17 +103,31 @@ GEM
68
103
  rspec-mocks (3.12.6)
69
104
  diff-lcs (>= 1.2.0, < 2.0)
70
105
  rspec-support (~> 3.12.0)
106
+ rspec-rails (6.1.0)
107
+ actionpack (>= 6.1)
108
+ activesupport (>= 6.1)
109
+ railties (>= 6.1)
110
+ rspec-core (~> 3.12)
111
+ rspec-expectations (~> 3.12)
112
+ rspec-mocks (~> 3.12)
113
+ rspec-support (~> 3.12)
71
114
  rspec-support (3.12.1)
115
+ ruby2_keywords (0.0.5)
116
+ stringio (3.1.0)
117
+ thor (1.3.0)
72
118
  tzinfo (2.0.6)
73
119
  concurrent-ruby (~> 1.0)
120
+ webrick (1.8.1)
121
+ zeitwerk (2.6.12)
74
122
 
75
123
  PLATFORMS
76
124
  arm64-darwin-22
125
+ x86_64-linux
77
126
 
78
127
  DEPENDENCIES
79
128
  active_attr (~> 0.15)
80
129
  rake
81
- rspec (>= 3.12.0)
130
+ rspec-rails
82
131
  strip-tags!
83
132
 
84
133
  BUNDLED WITH
data/README.md CHANGED
@@ -31,7 +31,7 @@ gem "strip-tags"
31
31
 
32
32
  ```ruby
33
33
  class DrunkPokerPlayer < ActiveRecord::Base
34
- strip-tags
34
+ strip_tags
35
35
  end
36
36
  ```
37
37
 
@@ -40,7 +40,7 @@ end
40
40
  ```ruby
41
41
  # all attributes will be stripped except :boxers
42
42
  class SoberPokerPlayer < ActiveRecord::Base
43
- strip-tags except: :boxers
43
+ strip_tags except: :boxers
44
44
  end
45
45
  ```
46
46
 
@@ -49,7 +49,7 @@ end
49
49
  ```ruby
50
50
  # only :shoe, :sock, and :glove attributes will be stripped
51
51
  class ConservativePokerPlayer < ActiveRecord::Base
52
- strip-tags only: [:shoe, :sock, :glove]
52
+ strip_tags only: [:shoe, :sock, :glove]
53
53
  end
54
54
  ```
55
55
 
@@ -58,7 +58,7 @@ end
58
58
  ```ruby
59
59
  # Only records with odd ids will be stripped
60
60
  class OddPokerPlayer < ActiveRecord::Base
61
- strip-tags if: :strip_me?
61
+ strip_tags if: :strip_me?
62
62
 
63
63
  def strip_me?
64
64
  id.odd?
@@ -69,9 +69,9 @@ end
69
69
  ### Using `unless`
70
70
 
71
71
  ```ruby
72
- # strip-tags will be applied randomly
72
+ # strip_tags will be applied randomly
73
73
  class RandomPokerPlayer < ActiveRecord::Base
74
- strip-tags unless: :strip_me?
74
+ strip_tags unless: :strip_me?
75
75
 
76
76
  def strip_me?
77
77
  [true, false].sample
@@ -84,7 +84,7 @@ end
84
84
  ```ruby
85
85
  # Empty attributes will not be converted to nil
86
86
  class BrokePokerPlayer < ActiveRecord::Base
87
- strip-tags allow_empty: true
87
+ strip_tags allow_empty: true
88
88
  end
89
89
  ```
90
90
 
@@ -98,7 +98,7 @@ It also works on other ActiveModel classes, such as [Mongoid](http://mongoid.org
98
98
  class User
99
99
  include Mongoid::Document
100
100
 
101
- strip-tags only: :email
101
+ strip_tags only: :email
102
102
  end
103
103
  ```
104
104
 
@@ -112,7 +112,7 @@ class Person
112
112
  attribute :name
113
113
  attribute :email
114
114
 
115
- strip-tags
115
+ strip_tags
116
116
  end
117
117
 
118
118
  ```
@@ -30,7 +30,11 @@ module StripTags
30
30
  @attribute = attribute
31
31
  subject.send("#{@attribute}=", "foo> & <<script>alert('xss')</script>")
32
32
  subject.valid?
33
- subject.send(@attribute) == "foo> & <"
33
+ if Gem::Version.new(Rails.version) >= Gem::Version.new("7.1")
34
+ subject.send(@attribute) == "foo> & <alert('xss')"
35
+ else
36
+ subject.send(@attribute) == "foo> & <"
37
+ end
34
38
  end
35
39
  end
36
40
 
@@ -1,3 +1,3 @@
1
1
  module StripTags
2
- VERSION = "1.0.5"
2
+ VERSION = "1.1.1"
3
3
  end
data/run-tests.sh ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ BUNDLE_GEMFILE=spec/dummy_apps/rails-7.0/Gemfile TEST_VERSION=7.0 bundle exec rake
6
+ BUNDLE_GEMFILE=spec/dummy_apps/rails-7.1/Gemfile TEST_VERSION=7.1 bundle exec rake
data/strip_tags.gemspec CHANGED
@@ -28,7 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_runtime_dependency "activemodel", ">= 5.2"
31
- spec.add_development_dependency "active_attr", "~> 0.15"
32
- spec.add_development_dependency "rspec", ">= 3.12.0"
33
31
  spec.add_development_dependency "rake"
34
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strip-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Moen Wulffeld
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-03 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -24,34 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.2'
27
- - !ruby/object:Gem::Dependency
28
- name: active_attr
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.15'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.15'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 3.12.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 3.12.0
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: rake
57
29
  requirement: !ruby/object:Gem::Requirement
@@ -81,12 +53,10 @@ files:
81
53
  - LICENSE
82
54
  - README.md
83
55
  - Rakefile
84
- - gemfiles/activemodel-5.2.gemfile
85
- - gemfiles/activemodel-6.1.gemfile
86
- - gemfiles/activemodel-7.0.gemfile
87
56
  - lib/strip-tags.rb
88
57
  - lib/strip-tags/matchers.rb
89
58
  - lib/strip-tags/version.rb
59
+ - run-tests.sh
90
60
  - strip_tags.gemspec
91
61
  homepage: https://github.com/wulffeld/strip-tags
92
62
  licenses:
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "activemodel", "~> 5.2.0"
4
-
5
- gemspec path: "../"
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "activemodel", "~> 6.1.0"
4
-
5
- gemspec path: "../"
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "activemodel", "~> 7.0.0"
4
-
5
- gemspec path: "../"