veracode 1.1.5 → 1.1.7
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/lib/veracode/version.rb +1 -1
- data/lib/veracode.rb +30 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2748dd2d1f9ca4ad77e27e5135143f3e310f2b78722d095439126afe3aa5a433
|
4
|
+
data.tar.gz: 6a15bb00abca2f8471d0a535bcd812bd9ae8366e60998b211236981ad5aff5fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abd794f9d29c5e9d226af29e0de4425a0beea89677396698e01955043ca0054b964718dc662c7bab6dfdddf3e60f7988fe9dc5e5b7bd494c8846eb0517994b79
|
7
|
+
data.tar.gz: 9132bf0aa6955ca63449dadcd4965e36fda893940f995d652aa59d1f34d5be43506c00c1f2ab89359db7d9212b10c2d3f55a80f99f548438a539339aaef4d7b5
|
data/lib/veracode/version.rb
CHANGED
data/lib/veracode.rb
CHANGED
@@ -292,6 +292,7 @@ module Veracode
|
|
292
292
|
|
293
293
|
def self.safe_name(o)
|
294
294
|
begin
|
295
|
+
restore_original_class_method(o)
|
295
296
|
case
|
296
297
|
when o == ActiveSupport::TimeWithZone
|
297
298
|
"ActiveSupport::TimeWithZone"
|
@@ -317,6 +318,23 @@ module Veracode
|
|
317
318
|
"Veracode" #should result in this being dropped from the archive since we can't get a safe name for it
|
318
319
|
end
|
319
320
|
end
|
321
|
+
|
322
|
+
# Some Ruby devs override the `class` method.
|
323
|
+
# This is bad practice but is still done sometimes.
|
324
|
+
# For example: https://github.com/faker-ruby/faker/blob/v2.2.1/lib/faker/games/heroes_of_the_storm.rb#L11-L13
|
325
|
+
# This messes with our ability to get the class name.
|
326
|
+
# So we detect this and if it is overriden we restore the original method from `Kernel`
|
327
|
+
def self.restore_original_class_method(obj)
|
328
|
+
original_class_method = Kernel.instance_method(:class)
|
329
|
+
|
330
|
+
class_method_owner = obj.method(:class).owner
|
331
|
+
|
332
|
+
if class_method_owner != Kernel
|
333
|
+
obj.define_singleton_method(:class) do
|
334
|
+
original_class_method.bind(self).call
|
335
|
+
end
|
336
|
+
end
|
337
|
+
end
|
320
338
|
|
321
339
|
def self.quote(o)
|
322
340
|
o.to_s.dump
|
@@ -492,7 +510,17 @@ module Veracode
|
|
492
510
|
|
493
511
|
formatted_contents = ""
|
494
512
|
|
495
|
-
m.
|
513
|
+
constants_method = m.method(:constants)
|
514
|
+
original_constants_method = Module.instance_method(:constants)
|
515
|
+
|
516
|
+
if constants_method != original_constants_method
|
517
|
+
puts " constants method has been overridden, fall back to original method" if $options[:verbose]
|
518
|
+
constants = original_constants_method.bind(m).call($options[:include_inherited])
|
519
|
+
else
|
520
|
+
constants = m.constants($options[:include_inherited])
|
521
|
+
end
|
522
|
+
|
523
|
+
constants.each do |c_symbol|
|
496
524
|
begin
|
497
525
|
c = m.const_get(c_symbol) if m.const_defined? c_symbol
|
498
526
|
formatted_contents += format_constant(c_symbol, c)
|
@@ -1088,7 +1116,7 @@ end
|
|
1088
1116
|
log_error e.message
|
1089
1117
|
log_error e.backtrace.join("\n")
|
1090
1118
|
else
|
1091
|
-
puts "Failed to prepare veracode archive. Please see #{@
|
1119
|
+
puts "Failed to prepare veracode archive. Please see #{@errorlog_filename}."
|
1092
1120
|
raise
|
1093
1121
|
end
|
1094
1122
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: veracode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Veracode
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|