git-pcheckout 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19ebb7be03ae20a913488690729afd281e5989a4
4
- data.tar.gz: 5df1feabe877b12315955ce0b0b8d480ad49cb9c
3
+ metadata.gz: 962ae0262f03c2d8ee9e7d852865f309a3c28411
4
+ data.tar.gz: 03ba6068918bacc974d61b3c7bd675d5b1af74b2
5
5
  SHA512:
6
- metadata.gz: e3064c7df5e48508363f0105cc20aec8faae792a18df9ebc2b70e7ea6dafe73f271bd67bf3ae98b807a7bc2adcb4f184fa45bcd18e89d3083b803a354025db16
7
- data.tar.gz: 3f32fbaa2c8a1ac25bff5857a09238acce97de293e008b0e1c712e29e6d7a0a9c138b92278e9f5251d392b05db6b98cee20bbd1451e73919e9b6733c11d4ecec
6
+ metadata.gz: 42d0d26981b86a8e9cf73453720ceb00f1c52e4eff40d8450e9ca63c84204d451afb93bc786bbc572e26e5f56fcdba50e20220a36b156a45dddb2ae68ff34042
7
+ data.tar.gz: b45511597f1c0a20e0bff5f5cfaa647975e1dfaeaa7de5b44e4389f5231d3ba4f4f835c4e26288cd474860c60fc3530cbc4d2c82a14dd8729093dcb2349ea740
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+
3
+ notifications:
4
+ email: false
5
+
6
+ addons:
7
+ code_climate:
8
+ repo_token: 32d88d56f8a96d8f9d953e967899842bfd356ef382518fd448531774420371da
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # git-pcheckout
2
2
 
3
- [![Build Status](https://api.travis-ci.org/vrybas/git-pcheckout.svg)][travis]
4
- [![Gem Version](http://img.shields.io/gem/v/git-pcheckout.svg)][gem]
5
- [![Code Climate](http://img.shields.io/codeclimate/github/vrybas/git-pcheckout.svg)][codeclimate]
3
+ [![Gem Version](https://badge.fury.io/rb/git-pcheckout.png)][gem]
4
+ [![Code Climate](https://codeclimate.com/github/vrybas/git-pcheckout.png)][codeclimate]
5
+ [![Coverage](https://codeclimate.com/github/vrybas/git-pcheckout/coverage.png)][coverage]
6
+ [![Build Status](https://travis-ci.org/vrybas/git-pcheckout.png?branch=master)][travis]
6
7
 
7
8
  Git command to evenly checkout local/remote branches and source/fork
8
9
  pull requests by URL (with Hub)
@@ -49,3 +50,4 @@ pull requests by URL (with Hub)
49
50
  [travis]: https://travis-ci.org/vrybas/git-pcheckout
50
51
  [gem]: http://rubygems.org/gems/git-pcheckout
51
52
  [codeclimate]: https://codeclimate.com/github/vrybas/git-pcheckout
53
+ [coverage]: https://coveralls.io/r/vrybas/git-pcheckout?branch=master
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
+ spec.add_development_dependency "codeclimate-test-reporter"
24
25
  end
@@ -7,24 +7,17 @@ module GitPcheckout
7
7
  end
8
8
 
9
9
  def perform
10
- validate_current_branch_state
11
-
12
10
  if pull_request_url?(arg)
13
11
  handle_pull_request_url(arg)
14
12
  else
15
13
  handle_branch_name(arg)
16
14
  end
15
+ rescue
16
+ puts 'aborted'
17
17
  end
18
18
 
19
19
  private
20
20
 
21
- def validate_current_branch_state
22
- if dirty_branch?
23
- puts errors[:dirty_branch]
24
- exit(1)
25
- end
26
- end
27
-
28
21
  def pull_request_url?(arg)
29
22
  arg.match /https:\/\/github.com\//
30
23
  end
@@ -74,24 +67,6 @@ module GitPcheckout
74
67
  HandleBranch.new(branch).perform
75
68
  end
76
69
 
77
- def dirty_branch?
78
- status_lines = get_status_lines
79
- return false if status_lines.empty?
80
-
81
- if modified_deleted_renamed?(status_lines)
82
- puts status_lines
83
- true
84
- end
85
- end
86
-
87
- def get_status_lines
88
- `git status -s`.split("\n").map(&:lstrip)
89
- end
90
-
91
- def modified_deleted_renamed?(lines)
92
- lines.any? { |line| line.match(/(^M|^D|^R)\s/) }
93
- end
94
-
95
70
  def errors
96
71
  { dirty_branch: "Please, commit your changes or stash them before you can switch branches"}
97
72
  end
@@ -1,3 +1,3 @@
1
1
  module GitPcheckout
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -9,12 +9,6 @@ describe GitPcheckout::Base do
9
9
  end
10
10
 
11
11
  context '#perofrm' do
12
- it 'doesn\'t run if current branch is dirty' do
13
- instance = described_class.new('foo')
14
- instance.stub(:dirty_branch?).and_return(true)
15
- expect { instance.perform }.to raise_error(SystemExit)
16
- end
17
-
18
12
  context 'plain branch name' do
19
13
  it 'handles plain branch name' do
20
14
  instance = described_class.new('foo')
@@ -1,3 +1,6 @@
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
3
+
1
4
  require 'rubygems'
2
5
  require 'bundler/setup'
3
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-pcheckout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Rybas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-02 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: codeclimate-test-reporter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Git command to evenly checkout local/remote branches and source/fork
56
70
  pull requests by URL (with Hub)
57
71
  email:
@@ -63,6 +77,7 @@ extra_rdoc_files: []
63
77
  files:
64
78
  - ".gitignore"
65
79
  - ".rspec"
80
+ - ".travis.yml"
66
81
  - Gemfile
67
82
  - Guardfile
68
83
  - LICENSE.txt