veracode 1.1.8 → 1.1.9.alpha1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 617054a5bf91d760bb14720f72d19a0f58b31928b024c4e72ef4d96f8d53938d
4
- data.tar.gz: b612aadb4a34c954c3fcf48a975e16595ed8a4588bb1157c0fc56b5ee18bd576
3
+ metadata.gz: 67e45628823d6fd9b98e900a1cbbf2b20ccbca9460b94a69b8824cc9974a4992
4
+ data.tar.gz: 273acd3d3c7023f6059a975c64a65438e008d36355fee09b6e8ef3afa6457973
5
5
  SHA512:
6
- metadata.gz: 6ffcf2c064b7b07a29e2ade7d9934823ebfacd914a58fcec198beca4c8ed728d2706a41afa1dbad42cc0c3ec45e7bfce94c8367d34cab3ddbf88427bc58aec00
7
- data.tar.gz: 994c8a3fbc615160bd5896fe501cd15e2f70cf4b8a6f6135bc4e03e4a0bf6315351e1cb2cdde63517f07055ffac7152f231075b8a9a6497b9d9d62161a9dd85a
6
+ metadata.gz: 898bc78e1c768bb1385cb380746cb59872d6a0017739051f4ec526e084a17c42f838dbe7c6c8f7cd61ff9e84683044dd948b483742c5dd92e72f535b7a505dda
7
+ data.tar.gz: a2656de02ce4115e3e3334655038cf21f45242a1da6951898493dbe0e0e73bb14b073456fa54017941ef6c00bafdc5740d6319d2383180a6ff3cc4a4bac57abd
@@ -1,4 +1,4 @@
1
1
  module Veracode
2
- VERSION = '1.1.8'
2
+ VERSION = '1.1.9.alpha1'
3
3
  ARCHIVE_VERSION = '2020-06-29'
4
4
  end
data/lib/veracode.rb CHANGED
@@ -38,6 +38,8 @@ module Veracode
38
38
 
39
39
  @expanded_app_dir = Dir.getwd
40
40
 
41
+ @app_patterns = ["lib/**/*.rb", "app/**/*.rb"]
42
+
41
43
  def self.init
42
44
  if Gem::Dependency.new('', '~> 2.2.0').match?('', RUBY_VERSION.dup)
43
45
  $stderr.puts "Ruby 2.2 is not supported, please consult the compilation guide for all supported Ruby versions"
@@ -244,6 +246,25 @@ module Veracode
244
246
 
245
247
  def self.rebaseline
246
248
  self.baseline
249
+
250
+ # Modules for the application files should never be in the baseline modules when rebaselining
251
+ if Module.respond_to? :const_source_location
252
+ app_files = @app_patterns.each_with_object(Set.new) do |p, s|
253
+ s.merge(Dir.glob(p).collect { |f| File.expand_path f } )
254
+ end
255
+ @baseline_modules.reject! do |m|
256
+ ret = false
257
+ begin
258
+ mn = m.name
259
+ unless mn.nil?
260
+ csl = Module.const_source_location(mn.to_sym)
261
+ ret = !csl[0].nil? && app_files.include?(csl[0])
262
+ end
263
+ rescue
264
+ end
265
+ ret
266
+ end
267
+ end
247
268
  end
248
269
 
249
270
  def self.update
@@ -287,6 +308,7 @@ module Veracode
287
308
  log_error "Unable to require #{File.expand_path(f).to_s.dump} (#{e.message})"
288
309
  else
289
310
  puts "(OK: #{(required ? "required" : "already required")})" if $options[:verbose]
311
+ log_error "WARNING: #{File.expand_path(f).to_s.dump} was already required"
290
312
  end
291
313
  any_new |= required
292
314
  total += 1
@@ -649,7 +671,7 @@ module Veracode
649
671
  "ActiveJob::",
650
672
  "ActiveSupport::",
651
673
  "ActiveStorage::",
652
- "ActionView::(?!CompiledTemplates)", #Allows Compiled templates with the not group
674
+ "ActionView::",
653
675
  "ActiveRecord::",
654
676
  ]
655
677
  objects = objects.reject do |o|
@@ -670,7 +692,6 @@ module Veracode
670
692
 
671
693
  add_to_archive "#{o.class.to_s.downcase} #{quote(sn)}\n" +
672
694
  ( o.is_a?(Class) ? class_header(o) : "") + # superclass
673
- ( @rails6 && sn == "ActionView::Base" ? "include \"ActionView::CompiledTemplates\"\n" : "") + #hack for rails 6 compiled template output
674
695
  ( o.is_a?(Module) ? module_header(o) : "") + # included modules
675
696
  ( o.is_a?(Object) ? object_contents(o, with_disasm) : "") +
676
697
  ( o.is_a?(Module) ? module_contents(o, with_disasm) : "") +
@@ -694,6 +715,10 @@ module Veracode
694
715
  end
695
716
  end
696
717
  # fake the module outpput to match what SAF expects from Rails <= 5
718
+ add_to_archive "class \"ActionView::Base\"\n" +
719
+ "superclass \"Object\"\n" +
720
+ "include \"ActionView::CompiledTemplates\"\n" +
721
+ "endclass\n\n"
697
722
  add_to_archive "module \"ActionView::CompiledTemplates\"\n" +
698
723
  "extend \"ActiveSupport::Dependencies::ModuleConstMissing\"\n" +
699
724
  "extend \"Module::Concerning\"\n" +
@@ -1071,8 +1096,7 @@ end
1071
1096
  any_new = true
1072
1097
  while any_new
1073
1098
  any_new = false
1074
- any_new |= glob_require "lib/**/*.rb"
1075
- any_new |= glob_require "app/**/*.rb"
1099
+ @app_patterns.each { |p| any_new |= glob_require p }
1076
1100
  puts "new successful requires? #{any_new.to_s}" if $options[:verbose]
1077
1101
  end
1078
1102
 
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.8
4
+ version: 1.1.9.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Veracode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-22 00:00:00.000000000 Z
11
+ date: 2025-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -50,9 +50,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
50
  version: 1.9.3.0
51
51
  required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - ">"
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: 1.3.1
56
56
  requirements: []
57
57
  rubygems_version: 3.1.6
58
58
  signing_key: