loofah-activerecord 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +12 -0
- data/README.rdoc +5 -1
- data/lib/loofah-activerecord.rb +2 -2
- data/rails_test/Rakefile +13 -14
- data/rails_test/common/active_record/app/models/post.rb +1 -0
- data/rails_test/common/active_record/test/unit/posts_test.rb +1 -1
- data/rails_test/common/xss_foliate/app/models/post.rb +1 -0
- data/rails_test/common/xss_foliate/test/unit/posts_test.rb +1 -1
- data/rails_test/generate_test_directory +20 -13
- metadata +20 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e80a565148e9837afac96a9a6b94bbb41c3fba6
|
4
|
+
data.tar.gz: f70b1ae1c4d7589f78652bc38c8404540eb40442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df8f1284727d44ec9df032401b211d1e1e3235977d1f1f193625fcc8ce619e8c3e545f8375cf58ed6e532d3a4f5f092be9928ec031bd59867219c9226d201d34
|
7
|
+
data.tar.gz: 96058cd04d085ed2112e75e22e7b967d1518221e8df33b06c38a7c1432180bd090136a384a809ce5e4ab70a5e5f96c447b2f68c6c0e1aa85a7e125f7bd034a2d
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,9 +1,21 @@
|
|
1
1
|
|
2
|
+
== 2.0 (2016-11-22)
|
3
|
+
|
4
|
+
Backwards incompatibilities:
|
5
|
+
|
6
|
+
* Removed support for Rails <= 3.0.
|
7
|
+
|
8
|
+
Features:
|
9
|
+
|
10
|
+
* Added support for Rails 5.
|
11
|
+
|
12
|
+
|
2
13
|
== 1.2.0 (2014-08-22)
|
3
14
|
|
4
15
|
Enhancements:
|
5
16
|
|
6
17
|
* Support for Rails 4.0 and 4.1.
|
18
|
+
* Added an `:unencode_special_chars` option to opt out of entity encoding. (Thanks, @openbl!)
|
7
19
|
|
8
20
|
|
9
21
|
== 1.1.0 (2013-01-16)
|
data/README.rdoc
CHANGED
@@ -49,10 +49,14 @@ Attributes are scrubbed with the +:strip+ scrubber by default, unless
|
|
49
49
|
another scrubber is specified or the attribute is present in an
|
50
50
|
+:except+ clause.
|
51
51
|
|
52
|
+
|
52
53
|
== Requirements
|
53
54
|
|
54
55
|
* Loofah >= 1.0.0
|
55
|
-
* Rails 3.2,
|
56
|
+
* Rails 3.2, 4.2, 5.0
|
57
|
+
|
58
|
+
Support for older versions of Rails is available in loofah-activerecord < 2.0.
|
59
|
+
|
56
60
|
|
57
61
|
== Installation
|
58
62
|
|
data/lib/loofah-activerecord.rb
CHANGED
@@ -3,10 +3,10 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.i
|
|
3
3
|
require 'loofah'
|
4
4
|
|
5
5
|
module Loofah::ActiveRecord
|
6
|
-
VERSION = "
|
6
|
+
VERSION = "2.0.0"
|
7
7
|
end
|
8
8
|
|
9
|
-
if defined?(Rails) &&
|
9
|
+
if defined?(Rails) && defined?(Rails::Railtie)
|
10
10
|
require 'loofah/activerecord/railtie'
|
11
11
|
elsif defined? Rails.configuration and Rails.configuration.frameworks.include?([:active_record]) # >= 2.1
|
12
12
|
Rails.configuration.after_initialize do
|
data/rails_test/Rakefile
CHANGED
@@ -17,16 +17,13 @@ namespace "test" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def ruby_version_for rails_version
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
when /^4\./
|
28
|
-
"2.1.2"
|
29
|
-
end
|
20
|
+
## not needed at the moment; all three supported rails versions run on ruby 2.3.1
|
21
|
+
# case rails_version
|
22
|
+
# when /^4\.0/
|
23
|
+
# "2.0.0"
|
24
|
+
# when /^4\./
|
25
|
+
# "2.1.2"
|
26
|
+
# end
|
30
27
|
end
|
31
28
|
|
32
29
|
def dir_to_version_and_flavor dir
|
@@ -36,19 +33,19 @@ namespace "test" do
|
|
36
33
|
|
37
34
|
def run(cmd, ruby_version=nil)
|
38
35
|
if have_rvm?
|
39
|
-
puts "*running rvm: #{cmd}"
|
40
36
|
if ruby_version
|
41
37
|
cmd = "rvm \"#{ruby_version}\" do #{cmd}"
|
42
38
|
end
|
39
|
+
puts "*running rvm: #{cmd}"
|
43
40
|
system cmd
|
44
41
|
elsif have_rbenv?
|
45
|
-
puts "* running rbenv: #{cmd}"
|
46
42
|
begin
|
47
43
|
if ruby_version
|
48
44
|
puts " (with ruby version #{ruby_version})"
|
49
45
|
ENV['RBENV_VERSION'] = ruby_version
|
50
46
|
cmd = "rbenv exec #{cmd}"
|
51
47
|
end
|
48
|
+
puts "* running rbenv: #{cmd}"
|
52
49
|
system cmd
|
53
50
|
ensure
|
54
51
|
ENV.delete('RBENV_VERSION')
|
@@ -92,11 +89,13 @@ namespace "test" do
|
|
92
89
|
|
93
90
|
@results ||= {}
|
94
91
|
Dir.chdir(dir) do
|
95
|
-
ENV['RAILS_ENV'] = "test"
|
96
92
|
FileUtils.mkdir_p "log"
|
97
93
|
begin
|
98
94
|
run "touch db/test.sqlite3" # db:create doesn't exist before rails 2.0
|
99
|
-
Bundler.with_clean_env
|
95
|
+
Bundler.with_clean_env do
|
96
|
+
ENV['RAILS_ENV'] = "test"
|
97
|
+
run "bundle exec rake db:migrate test:units", ruby_version
|
98
|
+
end
|
100
99
|
rescue Object
|
101
100
|
@results[dir] = "FAIL"
|
102
101
|
else
|
@@ -13,6 +13,7 @@ version = ARGV[0]
|
|
13
13
|
flavor = ARGV[1]
|
14
14
|
|
15
15
|
require "rubygems"
|
16
|
+
require "tmpdir"
|
16
17
|
|
17
18
|
def run(cmd)
|
18
19
|
puts "* running '#{cmd}'"
|
@@ -21,19 +22,25 @@ def run(cmd)
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def rails version, dir
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
25
|
+
thisdir = Dir.pwd
|
26
|
+
Dir.mktmpdir do |tmpdir|
|
27
|
+
Dir.chdir tmpdir do
|
28
|
+
begin
|
29
|
+
gem "rails", "=#{version}"
|
30
|
+
rescue Gem::LoadError => e
|
31
|
+
puts "ERROR: could not find rails version #{version}"
|
32
|
+
puts "Try running:"
|
33
|
+
puts " gem install rails --version=#{version}"
|
34
|
+
exit 1
|
35
|
+
end
|
36
|
+
puts "* successfully detected rails version #{version}"
|
37
|
+
if version >= "3"
|
38
|
+
run "yes | rails _#{version}_ new #{dir} > /dev/null"
|
39
|
+
else
|
40
|
+
run "yes | rails _#{version}_ #{dir} > /dev/null"
|
41
|
+
end
|
42
|
+
FileUtils.mv dir, thisdir
|
43
|
+
end
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loofah-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: loofah
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rdoc
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '4.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '4.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: minitest
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +136,34 @@ dependencies:
|
|
150
136
|
- - ">="
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rdoc
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '4.0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '4.0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: hoe
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '3.
|
159
|
+
version: '3.15'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '3.
|
166
|
+
version: '3.15'
|
167
167
|
description: |-
|
168
168
|
+loofah-activerecord+ extends +loofah+'s HTML sanitization into Rails
|
169
169
|
ActiveRecord models.
|
@@ -223,11 +223,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.
|
226
|
+
rubygems_version: 2.5.1
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: "+loofah-activerecord+ extends +loofah+'s HTML sanitization into Rails ActiveRecord
|
230
230
|
models"
|
231
|
-
test_files:
|
232
|
-
- test/unit/test_xss_foliate.rb
|
233
|
-
- test/unit/test_active_record.rb
|
231
|
+
test_files: []
|