Skip to content

Commit

Permalink
Merge pull request #3364 from dependabot/feelepxyz/gradle-maven-dev
Browse files Browse the repository at this point in the history
Treat dev and pr as pre-releases for gradle/maven
  • Loading branch information
feelepxyz authored Mar 26, 2021
2 parents 59fab87 + 4eda81b commit 43dc9e0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle/lib/dependabot/gradle/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Version < Gem::Version
"b" => 2, "beta" => 2,
"m" => 3, "milestone" => 3,
"rc" => 4, "cr" => 4, "pr" => 4,
"snapshot" => 5,
"snapshot" => 5, "dev" => 5,
"ga" => 6, "" => 6, "final" => 6,
"sp" => 7
}.freeze
Expand Down
5 changes: 5 additions & 0 deletions gradle/spec/dependabot/gradle/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
let(:version_string) { "1.2.1-1.3.40-eap13-67" }
it { is_expected.to eq(true) }
end

context "with a dev token" do
let(:version_string) { "1.2.1-dev-65" }
it { is_expected.to eq(true) }
end
end

describe "#<=>" do
Expand Down
4 changes: 2 additions & 2 deletions maven/lib/dependabot/maven/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Version < Gem::Version
"a" => 1, "alpha" => 1,
"b" => 2, "beta" => 2,
"m" => 3, "milestone" => 3,
"rc" => 4, "cr" => 4,
"snapshot" => 5,
"rc" => 4, "cr" => 4, "pr" => 4,
"snapshot" => 5, "dev" => 5,
"ga" => 6, "" => 6, "final" => 6,
"sp" => 7
}.freeze
Expand Down
10 changes: 10 additions & 0 deletions maven/spec/dependabot/maven/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@
let(:version_string) { "1.0.0.sp7" }
it { is_expected.to eq(false) }
end

context "with a pre-release" do
let(:version_string) { "2.10.0.pr3" }
it { is_expected.to eq(true) }
end

context "with a dev token" do
let(:version_string) { "1.2.1-dev-65" }
it { is_expected.to eq(true) }
end
end

describe "#<=>" do
Expand Down

0 comments on commit 43dc9e0

Please sign in to comment.