branchy 0.0.2 → 0.4.0

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: 2c5d9b3fca0ddfde5f84ee83c435240855b161f6
4
- data.tar.gz: 66d609339da6215e683c3bb1af1ea751d790cd8f
3
+ metadata.gz: ed3b4d0d61cab54a877cdfe1189243e29fca9706
4
+ data.tar.gz: 7e8edebf165f2de57c3965613e42edcc72a91f2a
5
5
  SHA512:
6
- metadata.gz: 46380a8451159a2331ac0601537b82e53a428bde99889240e1ac6bd54bedf87f9319f1c84acf602fb0ba8601dcd2377d8f663dd48950ac6c8d608478bb60226f
7
- data.tar.gz: bbc9f998d72a5251545050db9d9dd1f87a816084fc45d491f75a28fe8fd1b10e20fe604feec8ba8fd751ae2e52c36804755d349c38f6430060d852ba0fe293e0
6
+ metadata.gz: fc1b13b2dfc60097984d7b62a55d553ed2fb8caf4d51f8568f845fa37a31117482f1d06f6e311869e9bd3f11e4639d4397a88a00f8b72922165fbc750a3038db
7
+ data.tar.gz: 604d96dd3f37bbd1191f6cbff430f0cf6e9436aaa2491bd6b8201bbdb65a4ad8aa782cdf5ab3f4b64aae4984be46b1096ed74625a7be204b2b1dcab66f41a9ce
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  == Branchy
2
2
 
3
3
  Branchy is a library for getting the name of the branch you're on. Lame, right? But its real purpose is to make it very easy to use
4
- the branched database pattern in Ruby, where each branch in your project has its own database. Rails was the original use-case, but
4
+ the branched database pattern in Ruby, where each branch (and tag) in your project has its own database. Rails was the original use-case, but
5
5
  there's nothing Rails-specific in it - you should be able to use it with just about any Ruby ORM. That said, all examples assume
6
6
  Rails and ActiveRecord. Salt to taste.
7
7
 
@@ -5,9 +5,10 @@ module Branchy
5
5
  class Git
6
6
  extend ::Branchy::CLI
7
7
 
8
- # Returns the git branch name
8
+ # Returns the git branch or tag name
9
9
  def self.branch
10
- exec_or_raise('git symbolic-ref HEAD').sub('refs/heads/', '')
10
+ digest = exec_or_raise('git rev-parse HEAD')
11
+ exec_or_raise("git name-rev --name-only #{digest}").sub(/^tags\//, '').sub(/\^0$/, '')
11
12
  end
12
13
 
13
14
  # Returns true if it's the master/trunk/mainline branch.
@@ -1,4 +1,4 @@
1
1
  module Branchy
2
2
  # The gem version
3
- VERSION = '0.0.2'.freeze
3
+ VERSION = '0.4.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: branchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Coleman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-17 00:00:00.000000000 Z
12
+ date: 2015-07-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Use a different database for each of your branches!
15
15
  email: jordan@jordanhollinger.com
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  requirements: []
48
48
  rubyforge_project:
49
- rubygems_version: 2.2.2
49
+ rubygems_version: 2.4.5
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: Branched database helpers