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 +4 -4
- data/README.rdoc +1 -1
- data/lib/branchy/drivers/git.rb +3 -2
- data/lib/branchy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed3b4d0d61cab54a877cdfe1189243e29fca9706
|
4
|
+
data.tar.gz: 7e8edebf165f2de57c3965613e42edcc72a91f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/branchy/drivers/git.rb
CHANGED
@@ -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
|
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.
|
data/lib/branchy/version.rb
CHANGED
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
|
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:
|
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.
|
49
|
+
rubygems_version: 2.4.5
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Branched database helpers
|