ninny 0.1.1 → 0.1.6

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: 445c02c3ef66d3a1cae6a955c10a0ec9926e108a3709f54a6dfa12879740ded5
4
- data.tar.gz: 8da306e6a35e23efcd7a124c1672dd67ef6d5241bdccab3163453d4ae8728b3b
3
+ metadata.gz: c1b394ae3cffee19b4c978dcdcc46a442ac6cd6bb2b49915fa9838c83455b16c
4
+ data.tar.gz: 36e1b4e1fd52d3049b5f097f85f183c767f6d3b7bddae24680d56838305bf2de
5
5
  SHA512:
6
- metadata.gz: 23efb1c11441e03cef136050bc9faad7659922d47d9211e253ade366ac7fc642842aca560cf7cf086838e9e57ce7c6eb75cedc01c70b0b901dbc0fc1084b7128
7
- data.tar.gz: ade698566b283360095e2bad1a0f2f4dc1839f37ae2569b9fa5178d5f1299c3bf5bcf6e2ecd6d01cfa1adc0af63a43917d104c9a013ed5388bd424bc621fde98
6
+ metadata.gz: b715894da4e3af69cbc8aea35e3075625320eb8f62df5925bbdc49f41a1c6bef986e431210843afc6057c2912fe9c50aa6d7f185a6ccb43e8dcb1421fb4d41d6
7
+ data.tar.gz: 6b5bc90feba98311f0147441a0b6e9c0181ac3420561009d8a01e04286a3c618d37f7c10a1edb7c63b0430ba419aa0a3860d1fc47ed2423f38e272379f1666b1
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ninny (0.1.1)
4
+ ninny (0.1.6)
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)
22
+ gitlab (4.15.0)
23
23
  httparty (~> 0.14, >= 0.14.0)
24
24
  terminal-table (~> 1.5, >= 1.5.1)
25
- httparty (0.17.0)
25
+ httparty (0.18.0)
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.0512)
32
32
  multi_xml (0.6.0)
33
33
  necromancer (0.4.0)
34
34
  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
@@ -31,7 +31,11 @@ module Ninny
31
31
  end
32
32
 
33
33
  def prompt_for_gitlab_private_token
34
- new_token_text = config.gitlab_private_token ? ' new' : ''
34
+ begin
35
+ new_token_text = config.gitlab_private_token ? ' new' : ''
36
+ rescue MissingUserConfig
37
+ new_token_text = 'new'
38
+ end
35
39
  if prompt.yes?("Do you have a#{new_token_text} gitlab private token?")
36
40
  private_token = prompt.ask("Enter private token", required: true)
37
41
  config.set(:gitlab_private_token, value: private_token)
@@ -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,19 @@ 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
+
61
76
  # Public: Create a new branch from the given source
62
77
  #
63
78
  # new_branch_name - The name of the branch to create
@@ -141,6 +156,7 @@ module Ninny
141
156
 
142
157
 
143
158
  # Exceptions
159
+ CheckoutFailed = Class.new(StandardError)
144
160
  NotOnBranch = Class.new(StandardError)
145
161
  NoBranchOfType = Class.new(StandardError)
146
162
  DirtyIndex = Class.new(StandardError)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Ninny
2
- VERSION = "0.1.1"
4
+ VERSION = "0.1.6"
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.1
4
+ version: 0.1.6
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-06-09 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.4
260
+ signing_key:
261
261
  specification_version: 4
262
262
  summary: 'ninny (n): an foolish person, see: git'
263
263
  test_files: []