Skip to content

Commit d39f047

Browse files
author
qount25
committed
Refactor: simpler way to extract postgres major version
1 parent 0a84b1d commit d39f047

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/pgpm/deb/spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Spec
1212
def initialize(package)
1313
@postgres_distribution = Pgpm::Postgres::Distribution.in_scope
1414
@package = package
15-
@package.postgres_major_version = @postgres_distribution.version.split(".")[0]
15+
@package.postgres_major_version = @postgres_distribution.major_version
1616
@package.os = "debian"
1717
@release = 1
1818
end

lib/pgpm/rpm/spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(package)
1717
# version of postgres and selected OS.
1818
@package = package
1919
@package.os = "redhat"
20-
@package.postgres_major_version = @postgres_distribution.version.split(".")[0]
20+
@package.postgres_major_version = @postgres_distribution.major_version
2121
end
2222

2323
def versionless

0 commit comments

Comments
 (0)