Skip to content

Commit

Permalink
Merge pull request #7785 from dependabot/deivid-rodriguez/simplify-bu…
Browse files Browse the repository at this point in the history
…ndler-helpers

Simplify Bundler native helper runners
  • Loading branch information
deivid-rodriguez authored Aug 10, 2023
2 parents 221897f + fbdb114 commit 6f7ac3a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
14 changes: 0 additions & 14 deletions bundler/helpers/v1/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,11 @@

require "functions"

MAX_BUNDLER_VERSION = "2.0.0"

def validate_bundler_version!
return true if correct_bundler_version?

raise StandardError, "Called with Bundler '#{Bundler::VERSION}', expected < '#{MAX_BUNDLER_VERSION}'"
end

def correct_bundler_version?
Gem::Version.new(Bundler::VERSION) < Gem::Version.new(MAX_BUNDLER_VERSION)
end

def output(obj)
print JSON.dump(obj)
end

begin
validate_bundler_version!

request = JSON.parse($stdin.read)

function = request["function"]
Expand Down
16 changes: 1 addition & 15 deletions bundler/helpers/v2/run.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

gem "bundler", "~> 2.3"
gem "bundler", "~> 2.4"
require "bundler"
require "json"

Expand All @@ -19,25 +19,11 @@

require "functions"

MIN_BUNDLER_VERSION = "2.1.0"

def validate_bundler_version!
return true if correct_bundler_version?

raise StandardError, "Called with Bundler '#{Bundler::VERSION}', expected >= '#{MIN_BUNDLER_VERSION}'"
end

def correct_bundler_version?
Gem::Version.new(Bundler::VERSION) >= Gem::Version.new(MIN_BUNDLER_VERSION)
end

def output(obj)
print JSON.dump(obj)
end

begin
validate_bundler_version!

request = JSON.parse($stdin.read)

function = request["function"]
Expand Down

0 comments on commit 6f7ac3a

Please sign in to comment.