ding 1.2.0 → 1.2.2

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: c1283f43275acdd4e1e0eb77d2d19c529c8f8299
4
- data.tar.gz: b0e9cddae73956fe6df73166af79ebeef10ad10e
3
+ metadata.gz: b6894adf146cfef036be30a3509a7f799be6d206
4
+ data.tar.gz: 3c7ddb4379dd7df1f909079c7b758daf648ce705
5
5
  SHA512:
6
- metadata.gz: 0c7ae14659c594f06209893bbd27a30695a39d058036645fb6fdc35fdfc4d0a87dabe5baa4675d81013a50c5519fb536f5f226baa50dd3bd3a2fc4059ea46450
7
- data.tar.gz: 569c9bfa49d026813df401273cd3e2ac523b7b4794097d56136a21665c8584646c54bcbf341d75602b3a358b59052e1fdcd2275e99bb4c2d01524d35a1adf386
6
+ metadata.gz: a7ffdd1ac10d674e21e7cfcd38c9f3bbbb92fa855054e76fc8912f4e69283244500c5ced02432fa143f58738d324a26023122389a7c1dbb7e3bfb527a300cb84
7
+ data.tar.gz: 08cdc83e6e375be3de31be1f5658315f529bf6de3c15ec2708792024eddf5360c368ef0570bf6608eccf1ee6f5f229357e084be825f8e0322ebc65e2fcd46239
data/lib/ding/cli.rb CHANGED
@@ -30,11 +30,11 @@ module Ding
30
30
  say "> Deleting #{testing_branch}", :green
31
31
  r.delete_branch(testing_branch)
32
32
 
33
- say "> Fetching branches from the remote", :green
34
- r.fetch_branches
33
+ say "> Synchronising with the remote", :green
34
+ r.update
35
35
  end
36
36
 
37
- branches = repo.branches(options[:pattern])
37
+ branches = repo.remote_branches(options[:pattern])
38
38
  if branches.empty?
39
39
  say "\n --> No feature branches available to test, I'm out of here!\n\n", :red
40
40
  exit 1
@@ -9,9 +9,17 @@ module Ding
9
9
  raise "#{repo} is NOT a git repository" unless git_repo?
10
10
  end
11
11
 
12
- def branches(pattern)
12
+ def local_branches(pattern)
13
+ branches pattern, false
14
+ end
15
+
16
+ def remote_branches(pattern)
17
+ branches pattern, true
18
+ end
19
+
20
+ def branches(pattern, remote=true)
13
21
  merged = options[:merged] ? '--merged' : '--no-merged'
14
- remote = options[:local] ? '' : '--remote'
22
+ remote = '--remote' if remote
15
23
  %x(git branch #{remote} --list #{remote_version(pattern)} #{merged}).split
16
24
  end
17
25
 
@@ -70,12 +78,9 @@ module Ding
70
78
  end
71
79
  end
72
80
 
73
- def fetch_branches
74
- raise "Error synchronising with the remote" unless run_cmd 'git fetch --all'
75
- end
76
-
77
81
  def update
78
- raise "Error synchronising with the remote" unless run_cmd "git up"
82
+ command = options[:local] ? 'git up' : 'git fetch --all'
83
+ raise "Error synchronising with the remote" unless run_cmd command
79
84
  end
80
85
 
81
86
  def reset_local_state
data/lib/ding/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ding
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Warren Bain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2015-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler