pgversion 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pgversion.rb +7 -1
- data/pgversion.gemspec +1 -1
- data/spec/pgversion_spec.rb +16 -1
- data/spec/spec_helper.rb +0 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90ec278816748e4da89d34815910e99bf9bbf9aa
|
4
|
+
data.tar.gz: 9c38557ea8c01b9389f69d3115c0ca1c9bb92f00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d3a8cd1c9732deedec9824a474eeef46c23ffb57064107a2b1b76be49bf5f64d6dad28826922a9d81da6cf3dd7e561a814d3c43cfda4fd6c0c5a90ef0d22d4f
|
7
|
+
data.tar.gz: f46b7f50651cb77b44118240d7fd3fe03a900a75426181a9522daccef47f389a118507f9384142fe05a086d579be9afbc016b47e97f28cd2e8953991b570668a
|
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.2"
|
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
|
@@ -117,6 +117,12 @@ class PGVersion
|
|
117
117
|
def beta?; @state == :beta; end
|
118
118
|
def alpha?; @state == :alpha; end
|
119
119
|
|
120
|
+
# Return the major and minor components of the version as a String,
|
121
|
+
# omitting the point release
|
122
|
+
def major_minor
|
123
|
+
"#{major}.#{minor}"
|
124
|
+
end
|
125
|
+
|
120
126
|
def to_s
|
121
127
|
patch = if release?
|
122
128
|
".#{point}" unless point.nil?
|
data/pgversion.gemspec
CHANGED
data/spec/pgversion_spec.rb
CHANGED
@@ -27,6 +27,22 @@ describe PGVersion do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
describe "#major_minor" do
|
31
|
+
[ PGVersion.new(8,3,:alpha1),
|
32
|
+
PGVersion.new(8,3,:alpha3),
|
33
|
+
PGVersion.new(8,3,:beta1),
|
34
|
+
PGVersion.new(8,3,:beta2),
|
35
|
+
PGVersion.new(8,3,:rc1),
|
36
|
+
PGVersion.new(8,3,:rc3),
|
37
|
+
PGVersion.new(8,3,0),
|
38
|
+
PGVersion.new(8,3,1),
|
39
|
+
PGVersion.new(8,3) ].each do |version|
|
40
|
+
it "should format #{version.to_s} as 8.3" do
|
41
|
+
expect(version.major_minor).to eq("8.3")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
30
46
|
describe "#<=>" do
|
31
47
|
it "ignores bit_depth" do
|
32
48
|
expect(PGVersion.new(9,0,0, bit_depth: 32) <=> PGVersion.new(9,0,0, bit_depth: 32)).to eq(0)
|
@@ -74,4 +90,3 @@ describe PGVersion do
|
|
74
90
|
end
|
75
91
|
end
|
76
92
|
end
|
77
|
-
|
data/spec/spec_helper.rb
CHANGED
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciek Sakrejda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
description: Easy Postgres version utilities
|
28
28
|
email:
|
29
29
|
- m.sakrejda@gmail.com
|