whitewash 2.0 → 2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +18 -0
  3. data/lib/whitewash.rb +4 -3
  4. data/whitewash.gemspec +10 -5
  5. metadata +66 -43
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d12cd8543e77f13c08513d9c04f3c65eac2fbcc5
4
+ data.tar.gz: 75eccecd494e88d1383728d4cc35dedfdfcfdc52
5
+ SHA512:
6
+ metadata.gz: b97b5fd37bc00abe8df0096216cd678b978da8a9aee25bde034bcf7c6a2179e0966b1a457dc45458e8a90f9100610fadc29a79de29a713037ec80bc7df5196ae
7
+ data.tar.gz: 1d71ddc4f23b80e1c84aa8ea9ab946e06b44c6a4119074ceb2c127cbc2bfb9b1e1f785442b9fdd87297df70b607a34a2af04c8adafd922bd7fc8495c6e8dd16a
@@ -0,0 +1,18 @@
1
+ # Whitewash: whitelist-based HTML validator for Ruby
2
+ # (originally written for Samizdat project)
3
+ #
4
+ # Copyright (c) 2002-2012, 2016 Dmitry Borodaenko <angdraug@debian.org>
5
+ #
6
+ # This program is free software.
7
+ # You can distribute/modify this program under the terms of
8
+ # the GNU General Public License version 3 or later.
9
+ #
10
+ # vim: et sw=2 sts=2 ts=8 tw=0
11
+
12
+ require 'rake'
13
+
14
+ task :default => :spec
15
+
16
+ task :spec do
17
+ sh 'rspec'
18
+ end
@@ -1,7 +1,7 @@
1
1
  # Whitewash: whitelist-based HTML validator for Ruby
2
2
  # (originally written for Samizdat project)
3
3
  #
4
- # Copyright (c) 2002-2011 Dmitry Borodaenko <angdraug@debian.org>
4
+ # Copyright (c) 2002-2012, 2016 Dmitry Borodaenko <angdraug@debian.org>
5
5
  #
6
6
  # This program is free software.
7
7
  # You can distribute/modify this program under the terms of
@@ -17,13 +17,14 @@ class WhitewashError < RuntimeError; end
17
17
 
18
18
  class Whitewash
19
19
 
20
- if RUBY_VERSION < '1.9.3'
20
+ if RUBY_VERSION >= '2.0' or RUBY_VERSION < '1.9.3'
21
21
  def Whitewash.load(string)
22
22
  YAML.load(string)
23
23
  end
24
24
 
25
25
  else
26
- # use Syck to parse the whitelist until Psych issue #36 is fixed
26
+ # use Syck to parse the whitelist to work around Psych issue #36 that was
27
+ # present in some versions of Ruby 1.9.3
27
28
  #
28
29
  def Whitewash.load(string)
29
30
  Mutex.new.synchronize do
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'whitewash'
3
- spec.version = '2.0'
3
+ spec.version = '2.1'
4
4
  spec.author = 'Dmitry Borodaenko'
5
5
  spec.email = 'angdraug@debian.org'
6
6
  spec.homepage = 'https://github.com/angdraug/whitewash'
@@ -11,8 +11,13 @@ fragment coming from an untrusted source and to remove all dangerous
11
11
  constructs that could be used for cross-site scripting or request
12
12
  forgery.
13
13
  EOF
14
- spec.files = `git ls-files`.split "\n"
15
- spec.license = 'GPL3+'
16
- # spec.add_dependency('nokogiri')
17
- # spec.add_development_dependency('rspec')
14
+ spec.files = %w(COPYING ChangeLog.mtn README.rdoc
15
+ setup.rb Rakefile whitewash.gemspec) +
16
+ Dir['{lib,spec}/**/*.rb'] +
17
+ Dir['data/**/*.yaml']
18
+ spec.test_files = Dir['spec/*_spec.rb']
19
+ spec.license = 'GPL-3.0+'
20
+ spec.add_dependency('nokogiri')
21
+ spec.add_development_dependency('rake')
22
+ spec.add_development_dependency('rspec')
18
23
  end
metadata CHANGED
@@ -1,39 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: whitewash
3
- version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- version: "2.0"
3
+ version: !ruby/object:Gem::Version
4
+ version: '2.1'
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Dmitry Borodaenko
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2012-02-05 00:00:00 Z
18
- dependencies: []
19
-
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
20
55
  description: |
21
56
  This module allows Ruby programs to clean up any HTML document or
22
57
  fragment coming from an untrusted source and to remove all dangerous
23
58
  constructs that could be used for cross-site scripting or request
24
59
  forgery.
25
-
26
60
  email: angdraug@debian.org
27
61
  executables: []
28
-
29
62
  extensions: []
30
-
31
63
  extra_rdoc_files: []
32
-
33
- files:
64
+ files:
34
65
  - COPYING
35
66
  - ChangeLog.mtn
36
67
  - README.rdoc
68
+ - Rakefile
37
69
  - data/whitewash/html5_whitelist.yaml
38
70
  - data/whitewash/whitelist.yaml
39
71
  - lib/whitewash.rb
@@ -42,37 +74,28 @@ files:
42
74
  - spec/whitewash_spec.rb
43
75
  - whitewash.gemspec
44
76
  homepage: https://github.com/angdraug/whitewash
45
- licenses:
46
- - GPL3+
77
+ licenses:
78
+ - GPL-3.0+
79
+ metadata: {}
47
80
  post_install_message:
48
81
  rdoc_options: []
49
-
50
- require_paths:
82
+ require_paths:
51
83
  - lib
52
- required_ruby_version: !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
55
86
  - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
61
- required_rubygems_version: !ruby/object:Gem::Requirement
62
- none: false
63
- requirements:
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
64
91
  - - ">="
65
- - !ruby/object:Gem::Version
66
- hash: 3
67
- segments:
68
- - 0
69
- version: "0"
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
70
94
  requirements: []
71
-
72
95
  rubyforge_project:
73
- rubygems_version: 1.8.15
96
+ rubygems_version: 2.5.1
74
97
  signing_key:
75
- specification_version: 3
98
+ specification_version: 4
76
99
  summary: Whitelist-based HTML filter for Ruby
77
- test_files: []
78
-
100
+ test_files:
101
+ - spec/whitewash_spec.rb