pgversion 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pgversion.rb +7 -2
- data/spec/pgversion_spec.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ef6ef9ef955a64d9f7a067143604c003ec254b
|
4
|
+
data.tar.gz: 6cd9803a6bdda4ab2f22c23ee4a7675d33973187
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56dfbb24baa1b37f6eff1e04dcb9f043f4c18f0d6a5958191e6cc074c854c33ab0d453e60a6e12c1e88c90e99ae98aa3099a3598a353fda880dd1e4af8ea18ea
|
7
|
+
data.tar.gz: 5745ad5dcedf0afd8479de374ca272314d8ad3de5800b9598406c12e46c643b6160778628db73f4f6598e854e31dc933745b5eb91f6909d776b566f62d21f616
|
data/lib/pgversion.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
class PGVersion
|
6
6
|
include Comparable
|
7
7
|
|
8
|
-
VERSION = "0.0.
|
8
|
+
VERSION = "0.0.5"
|
9
9
|
|
10
10
|
# The major and minor version taken together determine the stable
|
11
11
|
# interface to Postgres. New features may be introduced or breaking
|
@@ -110,7 +110,12 @@ class PGVersion
|
|
110
110
|
# Return the major and minor components of the version as a String,
|
111
111
|
# omitting the point release
|
112
112
|
def major_minor
|
113
|
-
|
113
|
+
case major
|
114
|
+
when 10
|
115
|
+
"#{major}"
|
116
|
+
else
|
117
|
+
"#{major}.#{minor}"
|
118
|
+
end
|
114
119
|
end
|
115
120
|
|
116
121
|
def to_s
|
data/spec/pgversion_spec.rb
CHANGED
@@ -12,7 +12,9 @@ describe PGVersion do
|
|
12
12
|
"PostgreSQL 8.4alpha3 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-16ubuntu6) 4.8.2, 64-bit" =>
|
13
13
|
PGVersion.new(8,4,:alpha3, host: 'x86_64-unknown-linux-gnu', compiler: 'gcc (Ubuntu 4.8.2-16ubuntu6) 4.8.2', bit_depth: 64),
|
14
14
|
"PostgreSQL 10.0 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-16ubuntu6) 4.8.2, 64-bit" =>
|
15
|
-
PGVersion.new(10,0,nil, host: 'x86_64-unknown-linux-gnu', compiler: 'gcc (Ubuntu 4.8.2-16ubuntu6) 4.8.2', bit_depth: 64)
|
15
|
+
PGVersion.new(10,0,nil, host: 'x86_64-unknown-linux-gnu', compiler: 'gcc (Ubuntu 4.8.2-16ubuntu6) 4.8.2', bit_depth: 64),
|
16
|
+
"PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit" =>
|
17
|
+
PGVersion.new(10,1,nil, host: 'x86_64-pc-linux-gnu', compiler: 'gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4', bit_depth: 64)
|
16
18
|
}.each do |version_str, version|
|
17
19
|
describe '.parse' do
|
18
20
|
it "parses #{version_str} into corresponding version #{version}" do
|
@@ -40,6 +42,12 @@ describe PGVersion do
|
|
40
42
|
expect(version.major_minor).to eq("8.3")
|
41
43
|
end
|
42
44
|
end
|
45
|
+
[ PGVersion.new(10,1, nil),
|
46
|
+
PGVersion.new(10,0, nil) ].each do |version|
|
47
|
+
it "should format #{version.to_s} as 10" do
|
48
|
+
expect(version.major_minor).to eq("10")
|
49
|
+
end
|
50
|
+
end
|
43
51
|
end
|
44
52
|
|
45
53
|
describe "#<=>" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgversion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciek Sakrejda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|