git_cli_prompt 0.3.1 → 0.3.3

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: 6b385acfcf571966da995b0f5c9d8992ba009fc5f6719ef6f546f5ca499a2dce
4
- data.tar.gz: 7ee10915b4b88167b1b4660f0d09bf2fa3cec1f1b82cc681060ea69d2e4b1e4b
3
+ metadata.gz: 1d2aa443819b0dc7d3577c77ef08fdf53974dd0678e50e73c6cde089bd03a072
4
+ data.tar.gz: '059102d73442db5e1ec584faeb983eed5929d829db84db54ae5471add417c2c7'
5
5
  SHA512:
6
- metadata.gz: 0201f0407545a07215c3be1332ba2f75f460d44f36b3c2e9ffe7cbd4f1c342d6020c460b40f661637b5832aab1b25a470197c37b8ad9ad1acf4c38487ec35a00
7
- data.tar.gz: acbd75e2b5814c4f28811acde0b2150bc47798d6266aab91046bf16c30ff0c1142afb3861de8edb2c5e70aeb958f1cbd26b282bffa8ab7aa023181ef8364a293
6
+ metadata.gz: 729639587d2024425e15e08a9e625685b6d816316c43c2f9035892ecaedbf57622dd0a156cfc1aeca2db868c25a8d4702241b65b0d7824839888e4e068b931f4
7
+ data.tar.gz: 9df5649bdab0dc3334739f97b9f86bbe89b6e80b74159a75236052f3e2a9024bf5b5a421779c26cbf579c4407ec73166958e715bcd85d4686e99cc419320080c
data/.release_history.yml CHANGED
@@ -8,3 +8,5 @@ git_cli_prompt:
8
8
  :timestamp: 1635927168.4486034
9
9
  - :version: 0.3.0
10
10
  :timestamp: 1661971996.7526693
11
+ - :version: 0.3.2
12
+ :timestamp: 1679816434.3314788
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_cli_prompt (0.3.0)
4
+ git_cli_prompt (0.3.2)
5
5
  teLogger
6
6
  toolrack
7
7
  tty-prompt
@@ -10,45 +10,43 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  base58 (0.2.3)
13
- devops_assist (0.1.1)
13
+ devops_assist (0.3.4)
14
14
  git_cli
15
15
  git_cli_prompt
16
16
  gvcs
17
- tlogger
17
+ teLogger
18
18
  toolrack
19
19
  tty-prompt
20
- diff-lcs (1.4.4)
21
- git_cli (0.9.0)
20
+ diff-lcs (1.5.0)
21
+ git_cli (0.11.2)
22
22
  gvcs
23
23
  ptools (~> 1.4.0)
24
- tlogger
24
+ teLogger
25
25
  toolrack
26
- gvcs (0.1.0)
26
+ gvcs (0.1.1)
27
27
  pastel (0.8.0)
28
28
  tty-color (~> 0.5)
29
- ptools (1.4.2)
29
+ ptools (1.4.3)
30
30
  rake (13.0.6)
31
- rspec (3.10.0)
32
- rspec-core (~> 3.10.0)
33
- rspec-expectations (~> 3.10.0)
34
- rspec-mocks (~> 3.10.0)
35
- rspec-core (3.10.1)
36
- rspec-support (~> 3.10.0)
37
- rspec-expectations (3.10.1)
31
+ rspec (3.12.0)
32
+ rspec-core (~> 3.12.0)
33
+ rspec-expectations (~> 3.12.0)
34
+ rspec-mocks (~> 3.12.0)
35
+ rspec-core (3.12.1)
36
+ rspec-support (~> 3.12.0)
37
+ rspec-expectations (3.12.2)
38
38
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.10.0)
40
- rspec-mocks (3.10.2)
39
+ rspec-support (~> 3.12.0)
40
+ rspec-mocks (3.12.4)
41
41
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.10.0)
43
- rspec-support (3.10.2)
44
- teLogger (0.2.0)
45
- tlogger (0.26.1)
46
- toolrack (0.16.0)
42
+ rspec-support (~> 3.12.0)
43
+ rspec-support (3.12.0)
44
+ teLogger (0.2.2)
45
+ toolrack (0.20.2)
47
46
  base58
48
- tlogger
49
47
  tty-color (0.6.0)
50
48
  tty-cursor (0.7.1)
51
- tty-prompt (0.22.0)
49
+ tty-prompt (0.23.1)
52
50
  pastel (~> 0.8)
53
51
  tty-reader (~> 0.8)
54
52
  tty-reader (0.9.0)
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/git_cli_prompt/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "git_cli_prompt"
7
+ spec.version = GitCliPrompt::VERSION
8
+ spec.authors = ["Chris Liaw"]
9
+ spec.email = ["chrisliaw@antrapol.com"]
10
+
11
+ spec.summary = ""
12
+ spec.description = ""
13
+ spec.homepage = ""
14
+ spec.required_ruby_version = ">= 2.4.0"
15
+
16
+ #spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
17
+
18
+ #spec.metadata["homepage_uri"] = spec.homepage
19
+ #spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
20
+ #spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
+ `git ls-files -z`.split("\x0").reject do |f|
26
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
27
+ end
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ #spec.add_dependency "tlogger"
34
+ spec.add_dependency "teLogger"
35
+ spec.add_dependency "toolrack"
36
+
37
+ spec.add_dependency "tty-prompt"
38
+
39
+ #spec.add_development_dependency "devops_helper"
40
+ spec.add_development_dependency "devops_assist"
41
+
42
+ # Uncomment to register a new dependency of your gem
43
+ # spec.add_dependency "example-gem", "~> 1.0"
44
+
45
+ # For more information and examples about making a new gem, checkout our
46
+ # guide at: https://bundler.io/guides/creating_gem.html
47
+ end
data/lib/commit.rb CHANGED
@@ -110,9 +110,14 @@ module GitCliPrompt
110
110
  end
111
111
 
112
112
 
113
- rescue TTY::Reader::InputInterrupt
113
+ rescue TTY::Reader::InputInterrupt => ex
114
114
  ok "\n\n Aborted"
115
115
 
116
+ if block
117
+ th = block.call(:raise_to_parent)
118
+ raise ex if is_bool?(th)
119
+ end
120
+
116
121
  #rescue UserChangedMind
117
122
  # ok "\n Noted. Please retry the process again\n"
118
123
 
@@ -184,7 +189,7 @@ module GitCliPrompt
184
189
  defMsg = block.call(:default_commit_message)
185
190
  end
186
191
 
187
- msg = pmt.ask(" Commit Message :", required: true) do |m|
192
+ msg = pmt.ask("\n Commit Message : ", required: true) do |m|
188
193
  m.default = defMsg if not_empty?(defMsg)
189
194
  end
190
195
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitCliPrompt
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.3"
5
5
  end
data/lib/push.rb CHANGED
@@ -27,23 +27,43 @@ module GitCliPrompt
27
27
  conf = ws.remote_config
28
28
  end
29
29
 
30
+ if conf.keys.length > 1
31
+ selRemote = pmt.select(" There are more than one remote repository found. Please select which is intended to be push to : ") do |m|
32
+ conf.each do |k,v|
33
+ m.choice "#{k} [#{v["push"]}]", [k, v["push"]]
34
+ end
35
+ end
36
+
37
+ else
38
+ selRemote = [conf.keys.first,conf[conf.keys.first]["push"]]
39
+ end
40
+
30
41
  branch = block.call(:push_to_branch) if block
31
42
  branch = ws.current_branch if is_empty?(branch)
32
43
 
33
- if conf.keys.length == 1
34
- # direct push
35
- name = conf.keys.first
36
- url = conf.values.first["push"]
37
- if confirm_push(name, url)
38
- ws.push_changes_with_tags(name, branch)
39
- block.call(:push_info, { name: name }) if block
40
- else
41
- raise UserAborted
42
- end
44
+ name = selRemote[0]
45
+ url = selRemote[1]
46
+ if confirm_push(name, url)
47
+ ws.push_changes_with_tags(name, branch)
48
+ block.call(:push_info, { name: name, url: url }) if block
43
49
  else
44
- raise UserChangedMind
50
+ pmt.say " Push is skipped ", color: :yellow
45
51
  end
46
52
 
53
+ #if conf.keys.length == 1
54
+ # # direct push
55
+ # name = conf.keys.first
56
+ # url = conf.values.first["push"]
57
+ # if confirm_push(name, url)
58
+ # ws.push_changes_with_tags(name, branch)
59
+ # block.call(:push_info, { name: name }) if block
60
+ # else
61
+ # raise UserAborted
62
+ # end
63
+ #else
64
+ # raise UserChangedMind
65
+ #end
66
+
47
67
  rescue TTY::Reader::InputInterrupt
48
68
  end
49
69
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_cli_prompt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Liaw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-31 00:00:00.000000000 Z
11
+ date: 2023-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: teLogger
@@ -81,6 +81,7 @@ files:
81
81
  - Rakefile
82
82
  - bin/console
83
83
  - bin/setup
84
+ - git_cli_prompt.gemspec
84
85
  - lib/commit.rb
85
86
  - lib/git_cli_prompt.rb
86
87
  - lib/git_cli_prompt/cli_prompt.rb
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  - !ruby/object:Gem::Version
107
108
  version: '0'
108
109
  requirements: []
109
- rubygems_version: 3.2.22
110
+ rubygems_version: 3.4.6
110
111
  signing_key:
111
112
  specification_version: 4
112
113
  summary: ''