tainted_love 0.1.4 → 0.1.5
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/Gemfile.lock +1 -1
- data/lib/tainted_love/reporter/stdout_reporter.rb +4 -4
- data/lib/tainted_love/validator/rack_builder_eval.rb +15 -0
- data/lib/tainted_love/validator/rake_testtask.rb +15 -0
- data/lib/tainted_love/validator/webpacker_yaml.rb +16 -0
- data/lib/tainted_love/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1fb2f3caa7c9d1c2ad65cd39008d98e7b3d4b90f2fefaa6271651b33a279ba3
|
4
|
+
data.tar.gz: 56a20ce9ecde810993e9d62475097c8187f14143ea9e6f7ab8d7e79ecd4b1f90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31b432b1a5745084e7c3bc4efcae14a1d20bfba8ad8ac47ea5412d1895cc6c648717bc00ca3463e2192f53108dadba9feb74701909e09778c33be621046ed938
|
7
|
+
data.tar.gz: f6903f74b1d35abda62cb44879bc45b745c7f3bdae96a02eed6bcda7cbf8d0e39a4402328238f7a984c62393ca6a9bbc121cf661f32c488b5b61659d1947e7e6
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ module TaintedLove
|
|
4
4
|
module Reporter
|
5
5
|
# Reporter that outputs warnings in the console
|
6
6
|
class StdoutReporter < Base
|
7
|
-
|
7
|
+
attr_accessor :stack_trace_size, :app_path
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
super
|
@@ -34,10 +34,10 @@ module TaintedLove
|
|
34
34
|
warning.stack_trace.lines.take(@stack_trace_size).each do |line|
|
35
35
|
puts format_line(line)
|
36
36
|
|
37
|
-
next unless line[:file].
|
37
|
+
next unless line[:file].start_with?(@app_path)
|
38
38
|
|
39
|
-
File.read(line[:file]).lines.each_with_index.drop(line[:line_number] - 2).take(3).each do |(code, n)|
|
40
|
-
puts "| #{n}\t#{code}"
|
39
|
+
File.read(line[:file]).lines.each_with_index.drop([0, line[:line_number] - 2].max).take(3).each do |(code, n)|
|
40
|
+
puts "| #{n + 1}\t#{code}"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TaintedLove
|
4
|
+
module Validator
|
5
|
+
class RackBuilderEval < Base
|
6
|
+
def remove?(warning)
|
7
|
+
return unless warning.replacer == :ReplaceKernel
|
8
|
+
|
9
|
+
if warning.stack_trace.lines.first[:file]['rack/builder.rb']
|
10
|
+
return true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TaintedLove
|
4
|
+
module Validator
|
5
|
+
class RakeTestTask < Base
|
6
|
+
def remove?(warning)
|
7
|
+
return unless warning.replacer == :ReplaceKernel
|
8
|
+
|
9
|
+
warning.stack_trace.lines.take(5).each do |line|
|
10
|
+
return true if line[:file]['rake/testtask.rb']
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TaintedLove
|
4
|
+
module Validator
|
5
|
+
class WebpackerYaml < Base
|
6
|
+
def remove?(warning)
|
7
|
+
return unless warning.replacer == :ReplaceYAML
|
8
|
+
|
9
|
+
file = warning.stack_trace.lines.first[:file]
|
10
|
+
if file['/lib/webpacker/env.rb'] || file['/lib/webpacker/configuration.rb']
|
11
|
+
return true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/tainted_love/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tainted_love
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benoit Cote-Jodoin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -232,9 +232,12 @@ files:
|
|
232
232
|
- lib/tainted_love/validator/action_view_object_send.rb
|
233
233
|
- lib/tainted_love/validator/base.rb
|
234
234
|
- lib/tainted_love/validator/erb_eval.rb
|
235
|
+
- lib/tainted_love/validator/rack_builder_eval.rb
|
235
236
|
- lib/tainted_love/validator/railties_yaml_load.rb
|
237
|
+
- lib/tainted_love/validator/rake_testtask.rb
|
236
238
|
- lib/tainted_love/validator/redis_store_serialization.rb
|
237
239
|
- lib/tainted_love/validator/sprokets_marshal.rb
|
240
|
+
- lib/tainted_love/validator/webpacker_yaml.rb
|
238
241
|
- lib/tainted_love/version.rb
|
239
242
|
- lib/tainted_love/warning.rb
|
240
243
|
- tainted_love.gemspec
|