veracode 1.1.4 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/veracode +2 -2
- data/lib/veracode/version.rb +1 -1
- data/lib/veracode.rb +22 -4
- 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: 5cd6b5054a777beb3edbe568783105295ef5d2aba60403bc80afee04a53b3348
|
4
|
+
data.tar.gz: 3c47c2749ce2038a316571e9f529b47ad0f19bdb3dcf45658783ad38e8783cfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0240d159fe34cb8516a19b1ec8e5cb0920dd5dcd777606a2dc7ce3553367d925424781f42a99e1a5b65d297a45a16a3196cb35db019673d51c45921e0abbd117
|
7
|
+
data.tar.gz: ec7c3e0a1d0f3350c6cdd6f10f5c7200469598a05ccee43453ac432082894ea7be8ee203531159045048bfebb383679f5694db38554ee85fbd4753e766cea360
|
data/bin/veracode
CHANGED
@@ -4,10 +4,10 @@ require 'optparse'
|
|
4
4
|
$:.unshift File.expand_path(File.dirname(__FILE__) + "/../lib")
|
5
5
|
$:.unshift Dir.pwd
|
6
6
|
|
7
|
-
if File.
|
7
|
+
if File.exist?('Gemfile.lock')
|
8
8
|
rails_version = File.open('Gemfile.lock').grep(/^\s*rails\s*\(=\s*[34]/)
|
9
9
|
else
|
10
|
-
rails_version = File.
|
10
|
+
rails_version = File.exist?("script/rails") #fallback for rails 3.0
|
11
11
|
end
|
12
12
|
unless rails_version
|
13
13
|
$stderr.puts "Current directory #{File.basename(Dir.pwd).dump} does not appear to be a Rails 3/4 application."
|
data/lib/veracode/version.rb
CHANGED
data/lib/veracode.rb
CHANGED
@@ -39,7 +39,7 @@ module Veracode
|
|
39
39
|
@expanded_app_dir = Dir.getwd
|
40
40
|
|
41
41
|
def self.init
|
42
|
-
if Gem::Dependency.new('', '~> 2.2.0').match?('', RUBY_VERSION)
|
42
|
+
if Gem::Dependency.new('', '~> 2.2.0').match?('', RUBY_VERSION.dup)
|
43
43
|
$stderr.puts "Ruby 2.2 is not supported, please consult the compilation guide for all supported Ruby versions"
|
44
44
|
exit
|
45
45
|
end
|
@@ -48,7 +48,7 @@ module Veracode
|
|
48
48
|
@archive_dirname = File.join("tmp","veracode-#{@run_id}")
|
49
49
|
@required_libs.merge(["pathname", "set", "zlib", "zip/zip", "veracode"])
|
50
50
|
|
51
|
-
if !Dir.
|
51
|
+
if !Dir.exist?("tmp")
|
52
52
|
begin
|
53
53
|
Dir.mkdir("tmp")
|
54
54
|
rescue Exception => e
|
@@ -57,7 +57,7 @@ module Veracode
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
while Dir.
|
60
|
+
while Dir.exist?(@archive_dirname)
|
61
61
|
@run_id = Time.now.strftime("%Y%m%d%H%M%S")
|
62
62
|
@archive_dirname = File.join("tmp","veracode-#{@run_id}")
|
63
63
|
end
|
@@ -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
|
@@ -866,7 +884,7 @@ module Veracode
|
|
866
884
|
def self.require_libs(lib_paths)
|
867
885
|
for lib_path in lib_paths
|
868
886
|
dirsToProcess = [Pathname(lib_path)]
|
869
|
-
until dirsToProcess.count == 0 || !Dir.
|
887
|
+
until dirsToProcess.count == 0 || !Dir.exist?(dirsToProcess[0])
|
870
888
|
currentDir = dirsToProcess.delete_at(0)
|
871
889
|
for child in currentDir.children
|
872
890
|
if child.directory?
|
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.6
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|