ninny 0.1.2 → 0.1.8

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
  SHA256:
3
- metadata.gz: f3e4dd9b38aa0b80d3653029755fe498ca57ef2ba468ef326ae9082dcd00d507
4
- data.tar.gz: 6ae95c628aa6343ae5c7b60cd55d4a940027ca31c51d449e578f43f07a145059
3
+ metadata.gz: 3082655bfdf20dd399f2e6c319db64d44714d533b7cc31d5c15a131ed4407189
4
+ data.tar.gz: 3e00456225b143715daa81b246a0f89a6b56fd6bfe76a0700b7a861fb77902e5
5
5
  SHA512:
6
- metadata.gz: 9afbd929c0b16fc9223757f4eba952ba938535dfc0b0997df5ee65c1627abfecf4135cdd1bb83224cefa89bf47c659cb96007c67b5b0524630ff75ef6c9782b6
7
- data.tar.gz: 07ab07cd7f538f054178bb203195bfba2456b407b25bb1e771f8ad12f34655c837e46e8f8d6aa1e2cf57bc4a098b44a7dfcd318e87554dcf4ebad61135bea2d9
6
+ metadata.gz: b8334b70b6e72842ed4f53a1f1b39b649bddbe2c1506aadf6a867034c4ec1f5cd8935712fa5eaa93f45390f907cee69bda45e21dcffa473d7118b2ad5b3966c7
7
+ data.tar.gz: fc7ebf59fd6b62ba28a94996fca060b31727244fd3764306401cfcfa4a776934aae60299c47357417602e46665b6a36024678e8fe2d0df20b2df471c99d36480
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ninny (0.1.2)
4
+ ninny (0.1.8)
5
5
  git (~> 1.5.0)
6
- gitlab (~> 4.11.0)
6
+ gitlab (~> 4.11)
7
7
  pastel (~> 0.7.2)
8
8
  thor (~> 0.20.0)
9
9
  tty-box (~> 0.3.0)
@@ -19,16 +19,16 @@ GEM
19
19
  diff-lcs (1.3)
20
20
  equatable (0.5.0)
21
21
  git (1.5.0)
22
- gitlab (4.11.0)
23
- httparty (~> 0.14, >= 0.14.0)
22
+ gitlab (4.17.0)
23
+ httparty (~> 0.18)
24
24
  terminal-table (~> 1.5, >= 1.5.1)
25
- httparty (0.17.0)
25
+ httparty (0.18.1)
26
26
  mime-types (~> 3.0)
27
27
  multi_xml (>= 0.5.2)
28
28
  kramdown (1.16.2)
29
- mime-types (3.2.2)
29
+ mime-types (3.3.1)
30
30
  mime-types-data (~> 3.2015)
31
- mime-types-data (3.2019.0331)
31
+ mime-types-data (3.2020.1104)
32
32
  multi_xml (0.6.0)
33
33
  necromancer (0.4.0)
34
34
  pastel (0.7.2)
@@ -33,7 +33,8 @@ 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, false)
37
+ Ninny.git.track_current_branch
37
38
  rescue Ninny::Git::NoBranchOfType
38
39
  prompt.say "No #{branch_type} branch available. Creating one now."
39
40
  CreateDatedBranch.new(branch: branch_type).execute
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ninny
2
4
  class Git
3
5
  extend Forwardable
@@ -38,7 +40,7 @@ module Ninny
38
40
  def merge(branch_name)
39
41
  if_clean do
40
42
  git.fetch
41
- current_branch.merge("origin/#{branch_name}")
43
+ command 'merge', ['--no-ff', "origin/#{branch_name}"]
42
44
  raise MergeFailed unless clean?
43
45
  push
44
46
  end
@@ -58,6 +60,28 @@ module Ninny
58
60
  end
59
61
  end
60
62
 
63
+ # Public: Check out the given branch name
64
+ #
65
+ # branch_name - The name of the branch to check out
66
+ # do_after_pull - Should a pull be done after checkout?
67
+ def check_out(branch, do_after_pull=true)
68
+ git.fetch
69
+ branch.checkout
70
+ pull if do_after_pull
71
+ unless current_branch.name == branch.name
72
+ raise CheckoutFailed, "Failed to check out '#{branch}'"
73
+ end
74
+ end
75
+
76
+ # Public: Track remote branch matching current branch
77
+ #
78
+ # do_after_pull - Should a pull be done after tracking?
79
+ def track_current_branch(do_after_pull=true)
80
+ command('branch', ['-u', "origin/#{current_branch_name}"])
81
+ pull if do_after_pull
82
+ end
83
+
84
+
61
85
  # Public: Create a new branch from the given source
62
86
  #
63
87
  # new_branch_name - The name of the branch to create
@@ -141,6 +165,7 @@ module Ninny
141
165
 
142
166
 
143
167
  # Exceptions
168
+ CheckoutFailed = Class.new(StandardError)
144
169
  NotOnBranch = Class.new(StandardError)
145
170
  NoBranchOfType = Class.new(StandardError)
146
171
  DirtyIndex = Class.new(StandardError)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ninny
2
- VERSION = "0.1.2"
4
+ VERSION = "0.1.8"
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
 
2
4
  lib = File.expand_path("../lib", __FILE__)
3
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
@@ -61,7 +63,7 @@ Gem::Specification.new do |spec|
61
63
  spec.add_dependency "thor", "~> 0.20.0"
62
64
 
63
65
  spec.add_dependency "git", "~> 1.5.0"
64
- spec.add_dependency "gitlab", "~> 4.11.0"
66
+ spec.add_dependency "gitlab", "~> 4.11"
65
67
 
66
68
  spec.add_development_dependency "bundler", "~> 1.17"
67
69
  spec.add_development_dependency "rake", "~> 10.0"
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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Allen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-box
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 4.11.0
131
+ version: '4.11'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 4.11.0
138
+ version: '4.11'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: bundler
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -237,11 +237,11 @@ files:
237
237
  - lib/ninny/user_config.rb
238
238
  - lib/ninny/version.rb
239
239
  - ninny.gemspec
240
- homepage:
240
+ homepage:
241
241
  licenses:
242
242
  - MIT
243
243
  metadata: {}
244
- post_install_message:
244
+ post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths:
247
247
  - lib
@@ -256,8 +256,8 @@ 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
260
- signing_key:
259
+ rubygems_version: 3.0.8
260
+ signing_key:
261
261
  specification_version: 4
262
262
  summary: 'ninny (n): an foolish person, see: git'
263
263
  test_files: []