forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand Centralized Ecosystem Format with Language Version Information…
… for Bundler (dependabot#10867) * Add Bundler language version to centralized ecosystem structure
- Loading branch information
Showing
8 changed files
with
205 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# typed: strong | ||
# frozen_string_literal: true | ||
|
||
require "sorbet-runtime" | ||
require "dependabot/bundler/version" | ||
require "dependabot/ecosystem" | ||
|
||
module Dependabot | ||
module Bundler | ||
LANGUAGE = "ruby" | ||
|
||
class Language < Dependabot::Ecosystem::VersionManager | ||
extend T::Sig | ||
|
||
sig { params(raw_version: String).void } | ||
def initialize(raw_version) | ||
super( | ||
LANGUAGE, | ||
Version.new(raw_version) | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# typed: false | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/bundler/language" | ||
require "dependabot/ecosystem" | ||
require "spec_helper" | ||
|
||
RSpec.describe Dependabot::Bundler::Language do | ||
let(:language) { described_class.new(version) } | ||
let(:version) { "3.0.0" } | ||
|
||
describe "#initialize" do | ||
context "when version is a String" do | ||
let(:version) { "3.0.0" } | ||
|
||
it "sets the version correctly" do | ||
expect(language.version).to eq(Dependabot::Bundler::Version.new(version)) | ||
end | ||
|
||
it "sets the name correctly" do | ||
expect(language.name).to eq(Dependabot::Bundler::LANGUAGE) | ||
end | ||
end | ||
|
||
context "when version is a Dependabot::Bundler::Version" do | ||
let(:version) { "3.0.0" } | ||
|
||
it "sets the version correctly" do | ||
expect(language.version).to eq(version) | ||
end | ||
|
||
it "sets the name correctly" do | ||
expect(language.name).to eq(Dependabot::Bundler::LANGUAGE) | ||
end | ||
end | ||
end | ||
|
||
describe "#unsupported?" do | ||
it "returns false by default as no specific support or deprecation for languages is currently defined" do | ||
expect(language.unsupported?).to be false | ||
end | ||
end | ||
|
||
describe "#deprecated?" do | ||
it "returns false by default as no specific deprecation for languages is currently defined" do | ||
expect(language.deprecated?).to be false | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.