Skip to content

Commit

Permalink
Handle racc as default gem in Ruby 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
presidentbeef committed Dec 24, 2023
1 parent 391c95e commit e490ebe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion brakeman.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ Gem::Specification.new do |s|

Check warning on line 30 in brakeman.gemspec

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `none`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: This function is not related to authentication or authorization
s.files += Dir['bundle/ruby/*/gems/**/*'].reject do |path|
# Skip unnecessary files in dependencies
path =~ /^bundle\/ruby\/\d\.\d\.\d\/gems\/[^\/]+\/(Rakefile|benchmark|bin|doc|example|man|site|spec|test)/
path =~ /^bundle\/ruby\/\d\.\d\.\d\/gems\/[^\/]+\/(Rakefile|benchmark|bin|doc|example|man|site|spec|test)/ or
path.include? '/gems/racc'
end

# racc is not only a built-in gem, but also has native code which we cannot
# bundle with Brakeman, so leaving it as a regular dependency
s.add_dependency "racc"
else
Brakeman::GemDependencies.dev_dependencies(s) unless ENV['BM_PACKAGE']
Brakeman::GemDependencies.base_dependencies(s)
Expand Down
2 changes: 1 addition & 1 deletion build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
f.puts "path = File.expand_path('../..', __FILE__)"

Check warning on line 13 in build.rb

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `none`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: This function is not related to authentication or authorization

Dir["bundle/ruby/**/lib"].each do |dir|
f.puts %Q[$:.unshift "\#{path}/#{dir}"]
f.puts %Q[$:.unshift "\#{path}/#{dir}"] unless dir.include? 'racc'
end
end

Expand Down
1 change: 1 addition & 0 deletions gem_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def self.base_dependencies spec
spec.add_dependency "sexp_processor", "~> 4.7"

Check warning on line 13 in gem_common.rb

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `none`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: This function is not related to authentication or authorization
spec.add_dependency "ruby2ruby", "~>2.4.0"
spec.add_dependency "safe_yaml", ">= 1.0"
spec.add_dependency "racc"
end

def self.extended_dependencies spec
Expand Down

0 comments on commit e490ebe

Please sign in to comment.