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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a53a7c5dd95e62d71e00ac6e22f8e979c7ea48a6
4
- data.tar.gz: 9b9b2523b75218c48024d99af34a603c4b89c99a
3
+ metadata.gz: ba854b4f4b3733be57136c5e1d70feb11331afbc
4
+ data.tar.gz: 4ecd5975829070dc004a07874818defd00692282
5
5
  SHA512:
6
- metadata.gz: 2de7b3ae6b9e116328cc387606d293c2ef820a680cf4825122a8497c01cb2c59802d94ec54bb2d8de4876a3c03d292c9a2540d27f75d501e29626c663335bdd3
7
- data.tar.gz: 30d611af9e27df2bb312978e8d70d7ad9f1f99fa6a13848d50738cd6aa0d50d6240319be3bc3084f150dfda0771f055e83c405707f00cb364e241fb2bc00787b
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.5.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
- branches = executeCommand("branch -r --no-color | sed 's/^[* ] //'")
29
- executeCommand("branch --no-color | sed 's/^[* ] //' | grep #{name}")
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
@@ -0,0 +1,8 @@
1
+
2
+ puts __FILE__
3
+ puts File.dirname(__FILE__)
4
+ Dir[File.dirname(__FILE__) + "/command_*.rb"].each do |file|
5
+ puts file
6
+
7
+ end
8
+
data/lib/gitit/repo.rb CHANGED
@@ -25,7 +25,7 @@ module Gitit
25
25
  # -------------------------------------------------------------------------
26
26
  # -------------------------------------------------------------------------
27
27
  def init
28
- raise "failed to create repo" if valid?
28
+ raise "already a git repo" if valid?
29
29
  commandres = `(cd #{@location} && git init)`
30
30
  end
31
31
  end
@@ -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.5.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-08-19 00:00:00.000000000 Z
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.3
184
+ rubygems_version: 2.0.7
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: ''