veracode 1.0.1 → 1.1.2

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: f66a40787c8297707914cc96ba81def96cff04a70d119b07bbd84c3fc59933d3
4
- data.tar.gz: 1183be46375e9050ffa70a61565f17c428fc2478a03ef7f80d09658a3cdda9e0
3
+ metadata.gz: 93df1bb16b124fe649b1c79f27b5b35ab2567b0f8c1042a5bb5dbb7de8c38d22
4
+ data.tar.gz: 6b4c1c75b8ba56feda1ec2dc8101efcbbf95af8a5b40a121699528d85446d4ee
5
5
  SHA512:
6
- metadata.gz: 285a3853aed2b60503bbd7d042fe4a3a9d9f7b5652a6435791ff909774b9ab46b955fdf41f962bc78cb10c290c96e878804da389ebf83f777c5a336ad739b659
7
- data.tar.gz: 27e5ac6b2d3fdb44d36284a131f8b337daa0529e06e0dbf042751df169dddb2b51d7b395013e2fc03a3556c7afd2f96ed6016b644ddfa8ded6c6b3cf5b7ef5d4
6
+ metadata.gz: f158cd253e1b2f0e05360ace7474b7984ea011c675ef36147ebe60c67061fc747a2cbc190dc958260ce099a0f18d5abae8dee457516fb017885b4fb42bde45d5
7
+ data.tar.gz: 22972cfe35f63bfa91f1a1e5e81ab002737ba52899594afc84e6ed1c8f9d662f08f2ba90e5806e9f344651f5b6778daaf6fede6b6d3a152491cd9d2cddf38537
data/bin/veracode CHANGED
@@ -25,7 +25,7 @@ $options = {
25
25
  :include_inherited => false,
26
26
  :environment => false,
27
27
  :verbose => false,
28
- :jruby => false,
28
+ :skipenvironment => false,
29
29
  :skipactiverecord => false,
30
30
  :skipactionview => false,
31
31
  :skipsprockets => false,
@@ -42,8 +42,8 @@ case subcommand
42
42
  $options[:verbose] = true
43
43
  end
44
44
 
45
- opts.on("-j", "--jruby", "Force JRuby mode") do
46
- $options[:jruby] = true
45
+ opts.on("-E", "--skip-environment", "Skip environment") do
46
+ $options[:skipenvironment] = true
47
47
  end
48
48
 
49
49
  opts.on("-O", "--skip-active-record", "Skip ActiveRecord") do
@@ -70,6 +70,17 @@ case subcommand
70
70
  $options[:snapshot] = true
71
71
  end
72
72
 
73
+ # only print the options that match the documentation in the help center
74
+ opts.on("-h", "--help", "Print help") do
75
+ msg = <<-HELPMSG.strip
76
+ Usage: veracode prepare [options]
77
+ -v, --verbose Run verbosely
78
+ -D, --debug Enable debug output
79
+ HELPMSG
80
+ puts msg
81
+ exit
82
+ end
83
+
73
84
  end.parse!
74
85
 
75
86
  Veracode.prepare
@@ -1,4 +1,4 @@
1
1
  module Veracode
2
- VERSION = '1.0.1'
2
+ VERSION = '1.1.2'
3
3
  ARCHIVE_VERSION = '2020-06-29'
4
4
  end
data/lib/veracode.rb CHANGED
@@ -184,6 +184,7 @@ module Veracode
184
184
  }
185
185
  }
186
186
  else
187
+ Zip.write_zip64_support = true
187
188
  Zip::File.open(@archive_filename, Zip::File::CREATE) { |zf|
188
189
  @manifest.each { |file|
189
190
 
@@ -643,29 +644,33 @@ module Veracode
643
644
 
644
645
  def self.archive_rails6_templates
645
646
  puts "archiving views" if $options[:verbose]
646
- o = @view.compiled_method_container
647
- compiled_views = o.instance_methods - @view_methods
648
- formatted_contents = ""
649
- for m_symbol in compiled_views
650
- begin
651
- m = o.instance_method(m_symbol)
652
- formatted_contents += format_method(m, "public_instance", true)
653
- rescue Exception => e
654
- log_error "Error archiving singleton method #{m_symbol.to_s.dump}: #{e.message}"
647
+ begin
648
+ o = @view.compiled_method_container
649
+ compiled_views = o.instance_methods - @view_methods
650
+ formatted_contents = ""
651
+ for m_symbol in compiled_views
652
+ begin
653
+ m = o.instance_method(m_symbol)
654
+ formatted_contents += format_method(m, "public_instance", true)
655
+ rescue Exception => e
656
+ log_error "Error archiving singleton method #{m_symbol.to_s.dump}: #{e.message}"
657
+ end
655
658
  end
659
+ # fake the module outpput to match what SAF expects from Rails <= 5
660
+ add_to_archive "module \"ActionView::CompiledTemplates\"\n" +
661
+ "extend \"ActiveSupport::Dependencies::ModuleConstMissing\"\n" +
662
+ "extend \"Module::Concerning\"\n" +
663
+ "extend \"ActiveSupport::ToJsonWithActiveSupportEncoder\"\n" +
664
+ "extend \"PP::ObjectMixin\"\n" +
665
+ "extend \"ActiveSupport::Dependencies::Loadable\"\n" +
666
+ "extend \"JSON::Ext::Generator::GeneratorMethods::Object\"\n" +
667
+ "extend \"ActiveSupport::Tryable\"\n" +
668
+ "extend \"Kernel\"\n" +
669
+ formatted_contents +
670
+ "endmodule\n"
671
+ rescue Exception => e
672
+ log_error "Error archiving Rails 6 views: #{e.message}"
656
673
  end
657
- # fake the module outpput to match what SAF expects from Rails <= 5
658
- add_to_archive "module \"ActionView::CompiledTemplates\"\n" +
659
- "extend \"ActiveSupport::Dependencies::ModuleConstMissing\"\n" +
660
- "extend \"Module::Concerning\"\n" +
661
- "extend \"ActiveSupport::ToJsonWithActiveSupportEncoder\"\n" +
662
- "extend \"PP::ObjectMixin\"\n" +
663
- "extend \"ActiveSupport::Dependencies::Loadable\"\n" +
664
- "extend \"JSON::Ext::Generator::GeneratorMethods::Object\"\n" +
665
- "extend \"ActiveSupport::Tryable\"\n" +
666
- "extend \"Kernel\"\n" +
667
- formatted_contents +
668
- "endmodule\n"
669
674
  end
670
675
 
671
676
 
@@ -989,7 +994,11 @@ end
989
994
 
990
995
  glob_require "config/application.rb"
991
996
 
992
- Rails.application.require_environment! unless $options[:jruby]
997
+ begin
998
+ Rails.application.require_environment! unless $options[:skipenvironment]
999
+ rescue Exception => e
1000
+ log_error "Unable to require environment: #{e.message}"
1001
+ end
993
1002
  # Following line will actually kick off IRB
994
1003
  # Rails::Console.start(Rails.application)
995
1004
 
@@ -1042,14 +1051,14 @@ end
1042
1051
  self.update
1043
1052
  self.stats if $options[:verbose]
1044
1053
  end
1054
+
1055
+ # Ensure compiled templates are fully disassembled in archive
1056
+ @baseline_modules.delete(ActionView::CompiledTemplates) unless @rails6
1045
1057
  rescue Exception => e
1046
1058
  puts "Unable to compile templates: #{e.message}" if $options[:verbose]
1047
1059
  log_error "Unable to compile templates: #{e.message}"
1048
1060
  end
1049
1061
 
1050
- # Ensure compiled templates are fully disassembled in archive
1051
- @baseline_modules.delete(ActionView::CompiledTemplates) unless @rails6
1052
-
1053
1062
  if $options[:environment]
1054
1063
  puts "Processing and disassembling environment"
1055
1064
  archive(@modules.reject {|o| safe_name(o) =~ /^#<(Class|Module):0x[0-9a-f]+>/i }
@@ -1075,6 +1084,7 @@ end
1075
1084
  log_error e.message
1076
1085
  log_error e.backtrace.join("\n")
1077
1086
  else
1087
+ puts "Failed to prepare veracode archive. Please see #{@archive_dirname + '/' + @errorlog_filename}."
1078
1088
  raise
1079
1089
  end
1080
1090
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veracode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Veracode
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-03 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  description: Prepares your Ruby on Rails app for submission to Veracode.
@@ -39,7 +39,7 @@ files:
39
39
  homepage: http://veracode.com/
40
40
  licenses: []
41
41
  metadata: {}
42
- post_install_message:
42
+ post_install_message:
43
43
  rdoc_options: []
44
44
  require_paths:
45
45
  - lib
@@ -54,8 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.1.4
58
- signing_key:
57
+ rubygems_version: 3.1.6
58
+ signing_key:
59
59
  specification_version: 4
60
60
  summary: Command line tool for preparing your Ruby on Rails app for submission to
61
61
  Veracode