git_selector 0.2.1 → 0.2.2

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: a5542bea66cbcdb66da2a5819c0a237a4b6b1eb60f861fde66584d0456068084
4
- data.tar.gz: 23e70bbc2fa0285da59cf4d61fc69158c0c952b0ae9a7104c19635c13bb8af86
3
+ metadata.gz: cb239a7bd25eb04147c34c2abf08b85a0011c340de26c5ec6ab432f199fdcc68
4
+ data.tar.gz: b1d5fb88077a842a73e49906f23595920fca485272d3da4ca5d101d01da17e29
5
5
  SHA512:
6
- metadata.gz: 3be88e8b39bd7c2639be38f59df491728dfa7d31253a10a609b60ab481a8717a4383a873e9097427223107f18b31bc3df70c4ead430a094ffc9df20dc4ec46ac
7
- data.tar.gz: 30ac1fc2c1431719f188f1ecc24400840f6fd0064093cb2afb756726cf0c03df718d1cf673b202157984ef4359087b9224c5adbb2e69cb6b422eb85b55342a64
6
+ metadata.gz: ad33d9bf74f706bd203588628ad0fc4a91936545c8e50755791331481cb7e2e413c64b667a5bd21de7852b733005783a1b6203a0d7d02725da3681a99b566634
7
+ data.tar.gz: c4ff0b4254aaf8bc701790b64ec3bd2ada32e1b31a825db122b7dc5da4043bebf62473c837b77056d24312e8df2e59d3d84a98c10c4a8b083d33e383fe6332b1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_selector (0.2.1)
4
+ git_selector (0.2.2)
5
5
  git
6
6
  tty-prompt
7
7
 
@@ -1,3 +1,3 @@
1
1
  module GitSelector
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TTY
4
+ class Prompt
5
+ class List
6
+ def clear
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../git_prompt.rb'
4
+ require_relative './prompt/list.rb'
5
+
6
+ module TTY
7
+ class Prompt
8
+
9
+ # original - https://github.com/piotrmurach/tty-prompt/blob/master/lib/tty/prompt.rb#L226-L250
10
+ def invoke_select(object, question, *args, &block)
11
+ options = Utils.extract_options!(args)
12
+ choices = if args.empty? && !block
13
+ possible = options.dup
14
+ options = {}
15
+ possible
16
+ elsif args.size == 1 && args[0].is_a?(Hash)
17
+ Utils.extract_options!(args)
18
+ else
19
+ args.flatten
20
+ end
21
+
22
+ @list = object.new(self, **options)
23
+ @list.(question, choices, &block)
24
+ end
25
+
26
+ def unsubscribe_list
27
+ self.unsubscribe(@list)
28
+ end
29
+
30
+ def clear_list
31
+ @done = true
32
+ # @list = nil
33
+ unsubscribe_list
34
+ # 2 is for the prompt message
35
+ print(TTY::Cursor.clear_lines(GitPrompt::SELECT_OPTIONS_PER_PAGE + 2, :up))
36
+ end
37
+
38
+ def purge_list
39
+ @list = nil
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_selector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Suzuki
@@ -76,6 +76,8 @@ files:
76
76
  - lib/git_prompt.rb
77
77
  - lib/git_selector.rb
78
78
  - lib/git_selector/version.rb
79
+ - lib/monkey_patches/tty/prompt.rb
80
+ - lib/monkey_patches/tty/prompt/list.rb
79
81
  - lib/treeish_extractor.rb
80
82
  homepage: https://github.com/suzukimilanpaak/git_selector
81
83
  licenses: