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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ea9663bfdf214432df8e2a1e5bbdb7930c7ef57
4
- data.tar.gz: 856c53a3876a1057654e3d55edd0cf544e09e022
3
+ metadata.gz: 90ec278816748e4da89d34815910e99bf9bbf9aa
4
+ data.tar.gz: 9c38557ea8c01b9389f69d3115c0ca1c9bb92f00
5
5
  SHA512:
6
- metadata.gz: 7284ef96b1fa6b6e0ab2466d286a7df5cfa039353305a1fdefd2c696b138d82fe5160aeea0c6c5e54fa4bdf7460180e4f52237082e616444878322115f78f3ef
7
- data.tar.gz: 15bcc4a97179d019effe325b81a2e13b81dd8a9d0efb1c76ef610c0674929ba8d789458eeb0e537627264dcf9378715309672cc75e9f26217c04c5896c3d5cfa
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.1"
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
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.version = PGVersion::VERSION
16
16
  gem.license = "MIT"
17
17
 
18
- gem.add_development_dependency "rspec", '~> 4.0'
18
+ gem.add_development_dependency "rspec", '~> 3.0'
19
19
  end
@@ -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
@@ -5,7 +5,6 @@
5
5
  #
6
6
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
7
  RSpec.configure do |config|
8
- config.treat_symbols_as_metadata_keys_with_true_values = true
9
8
  config.run_all_when_everything_filtered = true
10
9
  config.filter_run :focus
11
10
 
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.1
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-03 00:00:00.000000000 Z
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: '4.0'
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: '4.0'
26
+ version: '3.0'
27
27
  description: Easy Postgres version utilities
28
28
  email:
29
29
  - m.sakrejda@gmail.com