gitit 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/VERSION +1 -1
- data/lib/gitit/command_branches.rb +26 -4
- data/lib/gitit/foo.rb +8 -0
- data/lib/gitit/repo.rb +1 -1
- data/spec/gitit_branches_spec.rb +15 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba854b4f4b3733be57136c5e1d70feb11331afbc
|
4
|
+
data.tar.gz: 4ecd5975829070dc004a07874818defd00692282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2ff59d8a930000b26247c0eaf95db88bd28eb15d4b057ddd610eef9efa2da450a338d2225f7878bfde79996c36171b00e21d99d50c320c8a324fb3e61d939a1
|
7
|
+
data.tar.gz: 6d9a15cce181b644f342afe116dbb5889790f57cae1fdc696289f0adb93fcd5ada7e68b5c578ba7a3069d5467591f9ed305b2b9973a668d071e1b97acbc89313
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Gitit
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/patbonecrusher/gitit.png?branch=master)](https://travis-ci.org/patbonecrusher/gitit) <a href="https://codeclimate.com/github/patbonecrusher/gitit"><img src="https://codeclimate.com/github/patbonecrusher/gitit.png" /></a>
|
4
|
+
|
3
5
|
TODO: Write a gem description
|
4
6
|
|
5
7
|
## Installation
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
@@ -16,7 +16,6 @@ module Gitit
|
|
16
16
|
# -------------------------------------------------------------------------
|
17
17
|
# -------------------------------------------------------------------------
|
18
18
|
def existsLocally?(name)
|
19
|
-
branches = executeCommand("branch --no-color | sed 's/^[* ] //'")
|
20
19
|
executeCommand("branch --no-color | sed 's/^[* ] //' | grep #{name}")
|
21
20
|
return true if $?.exitstatus == 0
|
22
21
|
return false
|
@@ -24,12 +23,35 @@ module Gitit
|
|
24
23
|
|
25
24
|
# -------------------------------------------------------------------------
|
26
25
|
# -------------------------------------------------------------------------
|
27
|
-
def existsRemotely?(name)
|
28
|
-
|
29
|
-
|
26
|
+
def existsRemotely?(name, remote)
|
27
|
+
executeCommand("branch -r --no-color | sed 's/^[* ] //' | grep #{remote}/#{name}")
|
28
|
+
return true if $?.exitstatus == 0
|
29
|
+
return false
|
30
|
+
end
|
31
|
+
|
32
|
+
# -------------------------------------------------------------------------
|
33
|
+
# -------------------------------------------------------------------------
|
34
|
+
def createLocalBranch(name)
|
35
|
+
raise "a branch with that name already exists" if existsLocally?(name)
|
36
|
+
executeCommand("branch #{name}")
|
37
|
+
return true if $?.exitstatus == 0
|
38
|
+
return false
|
39
|
+
end
|
40
|
+
|
41
|
+
# -------------------------------------------------------------------------
|
42
|
+
# -------------------------------------------------------------------------
|
43
|
+
def pushLocalBranchToRemote(name, remote)
|
44
|
+
raise "a branch with that name does not exists" unless existsLocally?(name)
|
45
|
+
executeCommand("push #{remote} #{name}")
|
30
46
|
return true if $?.exitstatus == 0
|
31
47
|
return false
|
32
48
|
end
|
49
|
+
|
50
|
+
# -------------------------------------------------------------------------
|
51
|
+
# -------------------------------------------------------------------------
|
52
|
+
def updateFromRemote(branchName, remote)
|
53
|
+
|
54
|
+
end
|
33
55
|
|
34
56
|
end
|
35
57
|
|
data/lib/gitit/foo.rb
ADDED
data/lib/gitit/repo.rb
CHANGED
@@ -25,7 +25,7 @@ module Gitit
|
|
25
25
|
# -------------------------------------------------------------------------
|
26
26
|
# -------------------------------------------------------------------------
|
27
27
|
def init
|
28
|
-
raise "
|
28
|
+
raise "already a git repo" if valid?
|
29
29
|
commandres = `(cd #{@location} && git init)`
|
30
30
|
end
|
31
31
|
end
|
data/spec/gitit_branches_spec.rb
CHANGED
@@ -36,11 +36,24 @@ module Gitit
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "will successfully find a valid remote branch" do
|
39
|
-
@repoBranches.existsRemotely?("master").should eq true
|
39
|
+
@repoBranches.existsRemotely?("master", "origin").should eq true
|
40
40
|
end
|
41
41
|
|
42
42
|
it "will fail to find an invalid remote branch" do
|
43
|
-
@repoBranches.existsRemotely?("asdasdsad").should eq false
|
43
|
+
@repoBranches.existsRemotely?("asdasdsad", "origin").should eq false
|
44
|
+
end
|
45
|
+
|
46
|
+
it "will create a local branch successfully" do
|
47
|
+
@repoBranches.createLocalBranch("mybranch").should eq true
|
48
|
+
@repoBranches.existsLocally?("mybranch").should eq true
|
49
|
+
@repoBranches.existsRemotely?("mybranch", "origin").should eq false
|
50
|
+
end
|
51
|
+
|
52
|
+
it "will push a local branch to the remote" do
|
53
|
+
@repoBranches.createLocalBranch("mybranch").should eq true
|
54
|
+
@repoBranches.existsRemotely?("mybranch", "origin").should eq false
|
55
|
+
@repoBranches.pushLocalBranchToRemote("mybranch", "origin").should eq true
|
56
|
+
@repoBranches.existsRemotely?("mybranch", "origin").should eq true
|
44
57
|
end
|
45
58
|
|
46
59
|
after(:each) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Laplante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/gitit/command_config.rb
|
151
151
|
- lib/gitit/command_executor.rb
|
152
152
|
- lib/gitit/command_status.rb
|
153
|
+
- lib/gitit/foo.rb
|
153
154
|
- lib/gitit/git.rb
|
154
155
|
- lib/gitit/repo.rb
|
155
156
|
- lib/gitit/version.rb
|
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
181
|
version: '0'
|
181
182
|
requirements: []
|
182
183
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.0.
|
184
|
+
rubygems_version: 2.0.7
|
184
185
|
signing_key:
|
185
186
|
specification_version: 4
|
186
187
|
summary: ''
|