ninny 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: f3e4dd9b38aa0b80d3653029755fe498ca57ef2ba468ef326ae9082dcd00d507
4
- data.tar.gz: 6ae95c628aa6343ae5c7b60cd55d4a940027ca31c51d449e578f43f07a145059
3
+ metadata.gz: a17662c1c2ef0bb98f982f5c463ffd6801e92c39433f58b744384bed0d34389c
4
+ data.tar.gz: d4966ce3533cf81411be4433b20e3684daf31d2b610ac2073f1f564f488577ba
5
5
  SHA512:
6
- metadata.gz: 9afbd929c0b16fc9223757f4eba952ba938535dfc0b0997df5ee65c1627abfecf4135cdd1bb83224cefa89bf47c659cb96007c67b5b0524630ff75ef6c9782b6
7
- data.tar.gz: 07ab07cd7f538f054178bb203195bfba2456b407b25bb1e771f8ad12f34655c837e46e8f8d6aa1e2cf57bc4a098b44a7dfcd318e87554dcf4ebad61135bea2d9
6
+ metadata.gz: 6b0e1e47db683db36036c7a43cc122a13ba280caf2f1bc63474c2950422b2c9ca0c873f096712b23946678e7018e3eafc71dc6218b64e0b3000b99eb841992bf
7
+ data.tar.gz: cb4133dedc6165482306b1a1bf30679d024448f336dfcdac697a8d9060b287b7c3b79b954ac33e5048e8097ecc25bdffbb06fafbebc2728a86c0ee0b1a7ff7f4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ninny (0.1.2)
4
+ ninny (0.1.3)
5
5
  git (~> 1.5.0)
6
6
  gitlab (~> 4.11.0)
7
7
  pastel (~> 0.7.2)
@@ -33,7 +33,7 @@ module Ninny
33
33
 
34
34
  # Public: Check out the branch
35
35
  def check_out_branch
36
- branch_to_merge_into.checkout
36
+ Ninny.git.check_out(branch_to_merge_into)
37
37
  rescue Ninny::Git::NoBranchOfType
38
38
  prompt.say "No #{branch_type} branch available. Creating one now."
39
39
  CreateDatedBranch.new(branch: branch_type).execute
data/lib/ninny/git.rb CHANGED
@@ -38,7 +38,7 @@ module Ninny
38
38
  def merge(branch_name)
39
39
  if_clean do
40
40
  git.fetch
41
- current_branch.merge("origin/#{branch_name}")
41
+ command 'merge', '--no-ff', "origin/#{branch_name}"
42
42
  raise MergeFailed unless clean?
43
43
  push
44
44
  end
@@ -58,6 +58,19 @@ module Ninny
58
58
  end
59
59
  end
60
60
 
61
+ # Public: Check out the given branch name
62
+ #
63
+ # branch_name - The name of the branch to check out
64
+ # do_after_pull - Should a pull be done after checkout?
65
+ def check_out(branch, do_after_pull=true)
66
+ git.fetch
67
+ branch.checkout
68
+ git.pull if do_after_pull
69
+ unless current_branch.name == branch.name
70
+ raise CheckoutFailed, "Failed to check out '#{branch}'"
71
+ end
72
+ end
73
+
61
74
  # Public: Create a new branch from the given source
62
75
  #
63
76
  # new_branch_name - The name of the branch to create
@@ -141,6 +154,7 @@ module Ninny
141
154
 
142
155
 
143
156
  # Exceptions
157
+ CheckoutFailed = Class.new(StandardError)
144
158
  NotOnBranch = Class.new(StandardError)
145
159
  NoBranchOfType = Class.new(StandardError)
146
160
  DirtyIndex = Class.new(StandardError)
data/lib/ninny/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ninny
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Allen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2019-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-box
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.0.3
259
+ rubygems_version: 3.0.4
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: 'ninny (n): an foolish person, see: git'