capita_git 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -25,6 +25,8 @@ PLATFORMS
25
25
 
26
26
  DEPENDENCIES
27
27
  capita_git!
28
+ git (>= 1.2.5)
28
29
  open4
29
30
  ronn (>= 0.7.3)
30
31
  shoulda (>= 2.11.0)
32
+ thor (>= 0.14.6)
data/bin/gitc CHANGED
@@ -4,6 +4,9 @@ require 'capita_git/cli'
4
4
 
5
5
  begin
6
6
  CapitaGit::CLI.start
7
+ rescue CapitaGit::UncleanError => e
8
+ CapitaGit.ui.error e.message
9
+ system 'git status'
7
10
  rescue => e
8
11
  CapitaGit.ui.error e.message
9
12
  CapitaGit.ui.debug e.backtrace.join("\n")
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GITC" "5" "January 2011" "GITC 0.1.0" "GITC Manual"
4
+ .TH "GITC" "5" "January 2011" "GITC 0.1.1" "GITC Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBgitc\fR \- git helper for CAPITA Unternehmensberatung GmbH
@@ -1,5 +1,5 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GITC\-CHECK" "" "January 2011" "GITC 0.1.0" "GITC Manual"
4
+ .TH "GITC\-CHECK" "" "January 2011" "GITC 0.1.1" "GITC Manual"
5
5
 
@@ -2,4 +2,4 @@ GITC-CHECK() GITC Manual GITC-CHECK()
2
2
 
3
3
 
4
4
 
5
- GITC 0.1.0 January 2011 GITC-CHECK()
5
+ GITC 0.1.1 January 2011 GITC-CHECK()
@@ -50,4 +50,4 @@ COMMANDS
50
50
 
51
51
 
52
52
 
53
- GITC 0.1.0 January 2011 GITC(5)
53
+ GITC 0.1.1 January 2011 GITC(5)
@@ -12,6 +12,7 @@ module CapitaGit
12
12
 
13
13
  def initialize(path)
14
14
  @repository = Git.open path
15
+ check_for_changes
15
16
  end
16
17
 
17
18
  def update_from_remote
@@ -22,6 +23,13 @@ module CapitaGit
22
23
  @repository.branches.local.select { |b| b.full == @repository.lib.branch_current }[0]
23
24
  end
24
25
 
26
+ def check_for_changes
27
+ unless @repository.status.untracked.empty? and @repository.status.changed.empty? and @repository.status.deleted.empty? and
28
+ @repository.status.added.empty?
29
+ raise CapitaGit::UncleanError.new "Repository is not clean!"
30
+ end
31
+ end
32
+
25
33
  def create_feature_branch(name)
26
34
  raise "Can't create feature branch from branch #{current_branch} since you already seem to be on one" if current_branch =~ /#{user_shortcut}/
27
35
  system "git checkout -b #{user_shortcut}/#{current_branch}/#{name}"
@@ -69,7 +77,7 @@ module CapitaGit
69
77
  end
70
78
 
71
79
  def is_local_feature_branch?(name)
72
- ! name.match(/^#{user_shortcut}/).nil?
80
+ !name.match(/^#{user_shortcut}/).nil?
73
81
  end
74
82
 
75
83
  def create_remote_fixbranch_for_version(version)
@@ -1,3 +1,3 @@
1
1
  module CapitaGit
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/capita_git.rb CHANGED
@@ -13,4 +13,7 @@ module CapitaGit
13
13
  def self.do
14
14
  puts "Working"
15
15
  end
16
+
17
+ class UncleanError < StandardError
18
+ end
16
19
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capita_git
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease:
4
+ hash: 25
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sebastian Georgi
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-27 00:00:00 +01:00
19
+ date: 2011-02-01 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -126,9 +126,9 @@ files:
126
126
  - test/shoulda_macros.rb
127
127
  - test/test_helper.rb
128
128
  - lib/capita_git/man/gitc
129
- - lib/capita_git/man/gitc.txt
130
129
  - lib/capita_git/man/gitc-check.txt
131
130
  - lib/capita_git/man/gitc-check
131
+ - lib/capita_git/man/gitc.txt
132
132
  has_rdoc: true
133
133
  homepage: https://github.com/capita/capita_git
134
134
  licenses: []
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  requirements: []
160
160
 
161
161
  rubyforge_project: capita_git
162
- rubygems_version: 1.4.1
162
+ rubygems_version: 1.3.7
163
163
  signing_key:
164
164
  specification_version: 3
165
165
  summary: Git-automation tool for quick handling of common patterns for feature and fix branches