tty-prompt 0.18.1 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +95 -0
- data/README.md +598 -256
- data/lib/tty-prompt.rb +1 -2
- data/lib/tty/prompt.rb +192 -144
- data/lib/tty/prompt/answers_collector.rb +5 -5
- data/lib/tty/prompt/{enum_paginator.rb → block_paginator.rb} +20 -19
- data/lib/tty/prompt/choice.rb +9 -10
- data/lib/tty/prompt/choices.rb +30 -12
- data/lib/tty/prompt/confirm_question.rb +42 -16
- data/lib/tty/prompt/const.rb +17 -0
- data/lib/tty/prompt/converter_dsl.rb +6 -7
- data/lib/tty/prompt/converter_registry.rb +31 -26
- data/lib/tty/prompt/converters.rb +139 -32
- data/lib/tty/prompt/enum_list.rb +81 -26
- data/lib/tty/prompt/errors.rb +31 -0
- data/lib/tty/prompt/evaluator.rb +2 -2
- data/lib/tty/prompt/expander.rb +45 -15
- data/lib/tty/prompt/keypress.rb +33 -36
- data/lib/tty/prompt/list.rb +198 -63
- data/lib/tty/prompt/mask_question.rb +11 -8
- data/lib/tty/prompt/multi_list.rb +131 -28
- data/lib/tty/prompt/multiline.rb +9 -7
- data/lib/tty/prompt/paginator.rb +38 -26
- data/lib/tty/prompt/question.rb +92 -37
- data/lib/tty/prompt/question/checks.rb +20 -2
- data/lib/tty/prompt/question/modifier.rb +4 -2
- data/lib/tty/prompt/question/validation.rb +3 -3
- data/lib/tty/prompt/selected_choices.rb +77 -0
- data/lib/tty/prompt/slider.rb +125 -30
- data/lib/tty/prompt/statement.rb +3 -3
- data/lib/tty/prompt/suggestion.rb +7 -6
- data/lib/tty/prompt/symbols.rb +58 -34
- data/lib/tty/prompt/test.rb +36 -0
- data/lib/tty/prompt/timer.rb +75 -0
- data/lib/tty/prompt/utils.rb +1 -3
- data/lib/tty/prompt/version.rb +1 -1
- metadata +29 -227
- data/Rakefile +0 -8
- data/examples/ask.rb +0 -7
- data/examples/ask_valid.rb +0 -12
- data/examples/collect.rb +0 -21
- data/examples/echo.rb +0 -11
- data/examples/enum_select.rb +0 -7
- data/examples/enum_select_disabled.rb +0 -16
- data/examples/enum_select_paged.rb +0 -9
- data/examples/enum_select_wrapped.rb +0 -15
- data/examples/expand.rb +0 -29
- data/examples/in.rb +0 -9
- data/examples/inputs.rb +0 -10
- data/examples/key_events.rb +0 -15
- data/examples/keypress.rb +0 -9
- data/examples/mask.rb +0 -13
- data/examples/multi_select.rb +0 -8
- data/examples/multi_select_disabled.rb +0 -17
- data/examples/multi_select_paged.rb +0 -9
- data/examples/multi_select_wrapped.rb +0 -15
- data/examples/multiline.rb +0 -9
- data/examples/pause.rb +0 -9
- data/examples/select.rb +0 -24
- data/examples/select_disabled.rb +0 -18
- data/examples/select_enum.rb +0 -8
- data/examples/select_filtered.rb +0 -11
- data/examples/select_paginated.rb +0 -11
- data/examples/select_wrapped.rb +0 -15
- data/examples/slider.rb +0 -6
- data/examples/validation.rb +0 -9
- data/examples/yes_no.rb +0 -7
- data/lib/tty/prompt/messages.rb +0 -49
- data/lib/tty/prompt/timeout.rb +0 -78
- data/lib/tty/test_prompt.rb +0 -20
- data/spec/spec_helper.rb +0 -45
- data/spec/unit/ask_spec.rb +0 -132
- data/spec/unit/choice/eql_spec.rb +0 -22
- data/spec/unit/choice/from_spec.rb +0 -96
- data/spec/unit/choices/add_spec.rb +0 -12
- data/spec/unit/choices/each_spec.rb +0 -13
- data/spec/unit/choices/find_by_spec.rb +0 -10
- data/spec/unit/choices/new_spec.rb +0 -10
- data/spec/unit/choices/pluck_spec.rb +0 -9
- data/spec/unit/collect_spec.rb +0 -96
- data/spec/unit/converters/convert_bool_spec.rb +0 -58
- data/spec/unit/converters/convert_char_spec.rb +0 -11
- data/spec/unit/converters/convert_custom_spec.rb +0 -14
- data/spec/unit/converters/convert_date_spec.rb +0 -34
- data/spec/unit/converters/convert_file_spec.rb +0 -18
- data/spec/unit/converters/convert_number_spec.rb +0 -39
- data/spec/unit/converters/convert_path_spec.rb +0 -15
- data/spec/unit/converters/convert_range_spec.rb +0 -22
- data/spec/unit/converters/convert_regex_spec.rb +0 -12
- data/spec/unit/converters/convert_string_spec.rb +0 -21
- data/spec/unit/converters/on_error_spec.rb +0 -9
- data/spec/unit/distance/distance_spec.rb +0 -73
- data/spec/unit/enum_paginator_spec.rb +0 -75
- data/spec/unit/enum_select_spec.rb +0 -446
- data/spec/unit/error_spec.rb +0 -20
- data/spec/unit/evaluator_spec.rb +0 -67
- data/spec/unit/expand_spec.rb +0 -198
- data/spec/unit/keypress_spec.rb +0 -72
- data/spec/unit/mask_spec.rb +0 -132
- data/spec/unit/multi_select_spec.rb +0 -511
- data/spec/unit/multiline_spec.rb +0 -77
- data/spec/unit/new_spec.rb +0 -20
- data/spec/unit/ok_spec.rb +0 -10
- data/spec/unit/paginator_spec.rb +0 -73
- data/spec/unit/question/checks_spec.rb +0 -97
- data/spec/unit/question/default_spec.rb +0 -31
- data/spec/unit/question/echo_spec.rb +0 -38
- data/spec/unit/question/in_spec.rb +0 -115
- data/spec/unit/question/initialize_spec.rb +0 -12
- data/spec/unit/question/modifier/apply_to_spec.rb +0 -24
- data/spec/unit/question/modifier/letter_case_spec.rb +0 -41
- data/spec/unit/question/modifier/whitespace_spec.rb +0 -51
- data/spec/unit/question/modify_spec.rb +0 -41
- data/spec/unit/question/required_spec.rb +0 -92
- data/spec/unit/question/validate_spec.rb +0 -115
- data/spec/unit/question/validation/call_spec.rb +0 -31
- data/spec/unit/question/validation/coerce_spec.rb +0 -30
- data/spec/unit/result_spec.rb +0 -40
- data/spec/unit/say_spec.rb +0 -67
- data/spec/unit/select_spec.rb +0 -660
- data/spec/unit/slider_spec.rb +0 -100
- data/spec/unit/statement/initialize_spec.rb +0 -15
- data/spec/unit/subscribe_spec.rb +0 -22
- data/spec/unit/suggest_spec.rb +0 -28
- data/spec/unit/warn_spec.rb +0 -21
- data/spec/unit/yes_no_spec.rb +0 -251
- data/tasks/console.rake +0 -11
- data/tasks/coverage.rake +0 -11
- data/tasks/spec.rake +0 -29
- data/tty-prompt.gemspec +0 -33
data/lib/tty/prompt/statement.rb
CHANGED
@@ -28,10 +28,10 @@ module TTY
|
|
28
28
|
# change the message display to color
|
29
29
|
#
|
30
30
|
# @api public
|
31
|
-
def initialize(prompt,
|
31
|
+
def initialize(prompt, newline: true, color: false)
|
32
32
|
@prompt = prompt
|
33
|
-
@newline =
|
34
|
-
@color =
|
33
|
+
@newline = newline
|
34
|
+
@color = color
|
35
35
|
end
|
36
36
|
|
37
37
|
# Output the message to the prompt
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "distance"
|
4
4
|
|
5
5
|
module TTY
|
6
6
|
# A class responsible for terminal prompt interactions.
|
@@ -11,9 +11,9 @@ module TTY
|
|
11
11
|
class Suggestion
|
12
12
|
DEFAULT_INDENT = 8
|
13
13
|
|
14
|
-
SINGLE_TEXT =
|
14
|
+
SINGLE_TEXT = "Did you mean this?"
|
15
15
|
|
16
|
-
PLURAL_TEXT =
|
16
|
+
PLURAL_TEXT = "Did you mean one of these?"
|
17
17
|
|
18
18
|
# Number of spaces
|
19
19
|
#
|
@@ -33,7 +33,7 @@ module TTY
|
|
33
33
|
# Initialize a Suggestion
|
34
34
|
#
|
35
35
|
# @api public
|
36
|
-
def initialize(options
|
36
|
+
def initialize(**options)
|
37
37
|
@indent = options.fetch(:indent) { DEFAULT_INDENT }
|
38
38
|
@single_text = options.fetch(:single_text) { SINGLE_TEXT }
|
39
39
|
@plural_text = options.fetch(:plural_text) { PLURAL_TEXT }
|
@@ -88,6 +88,7 @@ module TTY
|
|
88
88
|
# @api private
|
89
89
|
def evaluate
|
90
90
|
return @suggestions if @suggestions.empty?
|
91
|
+
|
91
92
|
if @suggestions.one?
|
92
93
|
build_single_suggestion
|
93
94
|
else
|
@@ -97,14 +98,14 @@ module TTY
|
|
97
98
|
|
98
99
|
# @api private
|
99
100
|
def build_single_suggestion
|
100
|
-
single_text + "\n" + (
|
101
|
+
single_text + "\n" + (" " * indent) + @suggestions.first
|
101
102
|
end
|
102
103
|
|
103
104
|
# @api private
|
104
105
|
def build_multiple_suggestions
|
105
106
|
plural_text + "\n" +
|
106
107
|
@suggestions.map do |sugest|
|
107
|
-
|
108
|
+
" " * indent + sugest
|
108
109
|
end.join("\n")
|
109
110
|
end
|
110
111
|
end # Suggestion
|
data/lib/tty/prompt/symbols.rb
CHANGED
@@ -7,43 +7,67 @@ module TTY
|
|
7
7
|
# @api public
|
8
8
|
module Symbols
|
9
9
|
KEYS = {
|
10
|
-
tick:
|
11
|
-
cross:
|
12
|
-
star:
|
13
|
-
square:
|
14
|
-
square_empty:
|
15
|
-
dot:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
10
|
+
tick: "✓",
|
11
|
+
cross: "✘",
|
12
|
+
star: "★",
|
13
|
+
square: "◼",
|
14
|
+
square_empty: "◻",
|
15
|
+
dot: "•",
|
16
|
+
bullet: "●",
|
17
|
+
bullet_empty: "○",
|
18
|
+
marker: "‣",
|
19
|
+
line: "─",
|
20
|
+
pipe: "|",
|
21
|
+
ellipsis: "…",
|
22
|
+
radio_on: "⬢",
|
23
|
+
radio_off: "⬡",
|
24
|
+
checkbox_on: "☒",
|
25
|
+
checkbox_off: "☐",
|
26
|
+
circle: "◯",
|
27
|
+
circle_on: "ⓧ",
|
28
|
+
circle_off: "Ⓘ",
|
29
|
+
arrow_up: "↑",
|
30
|
+
arrow_down: "↓",
|
31
|
+
arrow_up_down: "↕",
|
32
|
+
arrow_left: "←",
|
33
|
+
arrow_right: "→",
|
34
|
+
arrow_left_right: "↔",
|
35
|
+
heart: "♥",
|
36
|
+
diamond: "♦",
|
37
|
+
club: "♣",
|
38
|
+
spade: "♠"
|
27
39
|
}.freeze
|
28
40
|
|
29
41
|
WIN_KEYS = {
|
30
|
-
tick:
|
31
|
-
cross:
|
32
|
-
star:
|
33
|
-
square:
|
34
|
-
square_empty:
|
35
|
-
dot:
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
tick: "√",
|
43
|
+
cross: "x",
|
44
|
+
star: "*",
|
45
|
+
square: "[█]",
|
46
|
+
square_empty: "[ ]",
|
47
|
+
dot: ".",
|
48
|
+
bullet: "O",
|
49
|
+
bullet_empty: "○",
|
50
|
+
marker: ">",
|
51
|
+
line: "-",
|
52
|
+
pipe: "|",
|
53
|
+
ellipsis: "...",
|
54
|
+
radio_on: "(*)",
|
55
|
+
radio_off: "( )",
|
56
|
+
checkbox_on: "[×]",
|
57
|
+
checkbox_off: "[ ]",
|
58
|
+
circle: "( )",
|
59
|
+
circle_on: "(x)",
|
60
|
+
circle_off: "( )",
|
61
|
+
arrow_up: "↑",
|
62
|
+
arrow_down: "↓",
|
63
|
+
arrow_up_down: "↕",
|
64
|
+
arrow_left: "←",
|
65
|
+
arrow_right: "→",
|
66
|
+
arrow_left_right: "↔",
|
67
|
+
heart: "♥",
|
68
|
+
diamond: "♦",
|
69
|
+
club: "♣",
|
70
|
+
spade: "♠"
|
47
71
|
}.freeze
|
48
72
|
|
49
73
|
def symbols
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "stringio"
|
4
|
+
|
5
|
+
require_relative "../prompt"
|
6
|
+
|
7
|
+
module TTY
|
8
|
+
# Used for initializing test cases
|
9
|
+
class Prompt
|
10
|
+
module StringIOExtensions
|
11
|
+
def wait_readable(*)
|
12
|
+
true
|
13
|
+
end
|
14
|
+
|
15
|
+
def ioctl(*)
|
16
|
+
80
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Test < TTY::Prompt
|
21
|
+
def initialize(**options)
|
22
|
+
@input = StringIO.new
|
23
|
+
@input.extend(StringIOExtensions)
|
24
|
+
@output = StringIO.new
|
25
|
+
|
26
|
+
options.merge!({
|
27
|
+
input: @input,
|
28
|
+
output: @output,
|
29
|
+
env: { "TTY_TEST" => true },
|
30
|
+
enable_color: options.fetch(:enable_color, true)
|
31
|
+
})
|
32
|
+
super(**options)
|
33
|
+
end
|
34
|
+
end # Test
|
35
|
+
end # Prompt
|
36
|
+
end # TTY
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TTY
|
4
|
+
class Prompt
|
5
|
+
class Timer
|
6
|
+
attr_reader :duration
|
7
|
+
|
8
|
+
attr_reader :total
|
9
|
+
|
10
|
+
attr_reader :interval
|
11
|
+
|
12
|
+
def initialize(duration, interval)
|
13
|
+
@duration = duration
|
14
|
+
@interval = interval
|
15
|
+
@total = 0.0
|
16
|
+
@current = nil
|
17
|
+
@events = []
|
18
|
+
end
|
19
|
+
|
20
|
+
def start
|
21
|
+
return if @current
|
22
|
+
|
23
|
+
@current = time_now
|
24
|
+
end
|
25
|
+
|
26
|
+
def stop
|
27
|
+
return unless @current
|
28
|
+
|
29
|
+
@current = nil
|
30
|
+
end
|
31
|
+
|
32
|
+
def runtime
|
33
|
+
time_now - @current
|
34
|
+
end
|
35
|
+
|
36
|
+
def on_tick(&block)
|
37
|
+
@events << block
|
38
|
+
end
|
39
|
+
|
40
|
+
def while_remaining
|
41
|
+
start
|
42
|
+
remaining = duration
|
43
|
+
|
44
|
+
if @duration
|
45
|
+
while remaining >= 0.0
|
46
|
+
if runtime >= total
|
47
|
+
tick = duration - @total
|
48
|
+
@events.each { |block| block.(tick) }
|
49
|
+
@total += @interval
|
50
|
+
end
|
51
|
+
|
52
|
+
yield(remaining)
|
53
|
+
remaining = duration - runtime
|
54
|
+
end
|
55
|
+
else
|
56
|
+
loop { yield }
|
57
|
+
end
|
58
|
+
ensure
|
59
|
+
stop
|
60
|
+
end
|
61
|
+
|
62
|
+
if defined?(Process::CLOCK_MONOTONIC)
|
63
|
+
# Object representing current time
|
64
|
+
def time_now
|
65
|
+
::Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
66
|
+
end
|
67
|
+
else
|
68
|
+
# Object represeting current time
|
69
|
+
def time_now
|
70
|
+
::Time.now
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end # Timer
|
74
|
+
end # Prompt
|
75
|
+
end # TTY
|
data/lib/tty/prompt/utils.rb
CHANGED
data/lib/tty/prompt/version.rb
CHANGED
metadata
CHANGED
@@ -1,105 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-prompt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: necromancer
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.0
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: pastel
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
19
|
+
version: '0.8'
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: timers
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '4.0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '4.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: tty-cursor
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.6.0
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.6.0
|
26
|
+
version: '0.8'
|
69
27
|
- !ruby/object:Gem::Dependency
|
70
28
|
name: tty-reader
|
71
29
|
requirement: !ruby/object:Gem::Requirement
|
72
30
|
requirements:
|
73
31
|
- - "~>"
|
74
32
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
33
|
+
version: '0.8'
|
76
34
|
type: :runtime
|
77
35
|
prerelease: false
|
78
36
|
version_requirements: !ruby/object:Gem::Requirement
|
79
37
|
requirements:
|
80
38
|
- - "~>"
|
81
39
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: bundler
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 1.5.0
|
90
|
-
- - "<"
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: '2.0'
|
93
|
-
type: :development
|
94
|
-
prerelease: false
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - ">="
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 1.5.0
|
100
|
-
- - "<"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '2.0'
|
40
|
+
version: '0.8'
|
103
41
|
- !ruby/object:Gem::Dependency
|
104
42
|
name: rake
|
105
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,75 +56,49 @@ dependencies:
|
|
118
56
|
name: rspec
|
119
57
|
requirement: !ruby/object:Gem::Requirement
|
120
58
|
requirements:
|
121
|
-
- - "
|
59
|
+
- - ">="
|
122
60
|
- !ruby/object:Gem::Version
|
123
61
|
version: '3.0'
|
124
62
|
type: :development
|
125
63
|
prerelease: false
|
126
64
|
version_requirements: !ruby/object:Gem::Requirement
|
127
65
|
requirements:
|
128
|
-
- - "
|
66
|
+
- - ">="
|
129
67
|
- !ruby/object:Gem::Version
|
130
68
|
version: '3.0'
|
131
69
|
description: A beautiful and powerful interactive command line prompt with a robust
|
132
70
|
API for getting and validating complex inputs.
|
133
71
|
email:
|
134
|
-
-
|
72
|
+
- piotr@piotrmurach.com
|
135
73
|
executables: []
|
136
74
|
extensions: []
|
137
|
-
extra_rdoc_files:
|
75
|
+
extra_rdoc_files:
|
76
|
+
- README.md
|
77
|
+
- CHANGELOG.md
|
78
|
+
- LICENSE.txt
|
138
79
|
files:
|
139
80
|
- CHANGELOG.md
|
140
81
|
- LICENSE.txt
|
141
82
|
- README.md
|
142
|
-
- Rakefile
|
143
|
-
- examples/ask.rb
|
144
|
-
- examples/ask_valid.rb
|
145
|
-
- examples/collect.rb
|
146
|
-
- examples/echo.rb
|
147
|
-
- examples/enum_select.rb
|
148
|
-
- examples/enum_select_disabled.rb
|
149
|
-
- examples/enum_select_paged.rb
|
150
|
-
- examples/enum_select_wrapped.rb
|
151
|
-
- examples/expand.rb
|
152
|
-
- examples/in.rb
|
153
|
-
- examples/inputs.rb
|
154
|
-
- examples/key_events.rb
|
155
|
-
- examples/keypress.rb
|
156
|
-
- examples/mask.rb
|
157
|
-
- examples/multi_select.rb
|
158
|
-
- examples/multi_select_disabled.rb
|
159
|
-
- examples/multi_select_paged.rb
|
160
|
-
- examples/multi_select_wrapped.rb
|
161
|
-
- examples/multiline.rb
|
162
|
-
- examples/pause.rb
|
163
|
-
- examples/select.rb
|
164
|
-
- examples/select_disabled.rb
|
165
|
-
- examples/select_enum.rb
|
166
|
-
- examples/select_filtered.rb
|
167
|
-
- examples/select_paginated.rb
|
168
|
-
- examples/select_wrapped.rb
|
169
|
-
- examples/slider.rb
|
170
|
-
- examples/validation.rb
|
171
|
-
- examples/yes_no.rb
|
172
83
|
- lib/tty-prompt.rb
|
173
84
|
- lib/tty/prompt.rb
|
174
85
|
- lib/tty/prompt/answers_collector.rb
|
86
|
+
- lib/tty/prompt/block_paginator.rb
|
175
87
|
- lib/tty/prompt/choice.rb
|
176
88
|
- lib/tty/prompt/choices.rb
|
177
89
|
- lib/tty/prompt/confirm_question.rb
|
90
|
+
- lib/tty/prompt/const.rb
|
178
91
|
- lib/tty/prompt/converter_dsl.rb
|
179
92
|
- lib/tty/prompt/converter_registry.rb
|
180
93
|
- lib/tty/prompt/converters.rb
|
181
94
|
- lib/tty/prompt/distance.rb
|
182
95
|
- lib/tty/prompt/enum_list.rb
|
183
|
-
- lib/tty/prompt/
|
96
|
+
- lib/tty/prompt/errors.rb
|
184
97
|
- lib/tty/prompt/evaluator.rb
|
185
98
|
- lib/tty/prompt/expander.rb
|
186
99
|
- lib/tty/prompt/keypress.rb
|
187
100
|
- lib/tty/prompt/list.rb
|
188
101
|
- lib/tty/prompt/mask_question.rb
|
189
|
-
- lib/tty/prompt/messages.rb
|
190
102
|
- lib/tty/prompt/multi_list.rb
|
191
103
|
- lib/tty/prompt/multiline.rb
|
192
104
|
- lib/tty/prompt/paginator.rb
|
@@ -195,78 +107,25 @@ files:
|
|
195
107
|
- lib/tty/prompt/question/modifier.rb
|
196
108
|
- lib/tty/prompt/question/validation.rb
|
197
109
|
- lib/tty/prompt/result.rb
|
110
|
+
- lib/tty/prompt/selected_choices.rb
|
198
111
|
- lib/tty/prompt/slider.rb
|
199
112
|
- lib/tty/prompt/statement.rb
|
200
113
|
- lib/tty/prompt/suggestion.rb
|
201
114
|
- lib/tty/prompt/symbols.rb
|
202
|
-
- lib/tty/prompt/
|
115
|
+
- lib/tty/prompt/test.rb
|
116
|
+
- lib/tty/prompt/timer.rb
|
203
117
|
- lib/tty/prompt/utils.rb
|
204
118
|
- lib/tty/prompt/version.rb
|
205
|
-
|
206
|
-
- spec/spec_helper.rb
|
207
|
-
- spec/unit/ask_spec.rb
|
208
|
-
- spec/unit/choice/eql_spec.rb
|
209
|
-
- spec/unit/choice/from_spec.rb
|
210
|
-
- spec/unit/choices/add_spec.rb
|
211
|
-
- spec/unit/choices/each_spec.rb
|
212
|
-
- spec/unit/choices/find_by_spec.rb
|
213
|
-
- spec/unit/choices/new_spec.rb
|
214
|
-
- spec/unit/choices/pluck_spec.rb
|
215
|
-
- spec/unit/collect_spec.rb
|
216
|
-
- spec/unit/converters/convert_bool_spec.rb
|
217
|
-
- spec/unit/converters/convert_char_spec.rb
|
218
|
-
- spec/unit/converters/convert_custom_spec.rb
|
219
|
-
- spec/unit/converters/convert_date_spec.rb
|
220
|
-
- spec/unit/converters/convert_file_spec.rb
|
221
|
-
- spec/unit/converters/convert_number_spec.rb
|
222
|
-
- spec/unit/converters/convert_path_spec.rb
|
223
|
-
- spec/unit/converters/convert_range_spec.rb
|
224
|
-
- spec/unit/converters/convert_regex_spec.rb
|
225
|
-
- spec/unit/converters/convert_string_spec.rb
|
226
|
-
- spec/unit/converters/on_error_spec.rb
|
227
|
-
- spec/unit/distance/distance_spec.rb
|
228
|
-
- spec/unit/enum_paginator_spec.rb
|
229
|
-
- spec/unit/enum_select_spec.rb
|
230
|
-
- spec/unit/error_spec.rb
|
231
|
-
- spec/unit/evaluator_spec.rb
|
232
|
-
- spec/unit/expand_spec.rb
|
233
|
-
- spec/unit/keypress_spec.rb
|
234
|
-
- spec/unit/mask_spec.rb
|
235
|
-
- spec/unit/multi_select_spec.rb
|
236
|
-
- spec/unit/multiline_spec.rb
|
237
|
-
- spec/unit/new_spec.rb
|
238
|
-
- spec/unit/ok_spec.rb
|
239
|
-
- spec/unit/paginator_spec.rb
|
240
|
-
- spec/unit/question/checks_spec.rb
|
241
|
-
- spec/unit/question/default_spec.rb
|
242
|
-
- spec/unit/question/echo_spec.rb
|
243
|
-
- spec/unit/question/in_spec.rb
|
244
|
-
- spec/unit/question/initialize_spec.rb
|
245
|
-
- spec/unit/question/modifier/apply_to_spec.rb
|
246
|
-
- spec/unit/question/modifier/letter_case_spec.rb
|
247
|
-
- spec/unit/question/modifier/whitespace_spec.rb
|
248
|
-
- spec/unit/question/modify_spec.rb
|
249
|
-
- spec/unit/question/required_spec.rb
|
250
|
-
- spec/unit/question/validate_spec.rb
|
251
|
-
- spec/unit/question/validation/call_spec.rb
|
252
|
-
- spec/unit/question/validation/coerce_spec.rb
|
253
|
-
- spec/unit/result_spec.rb
|
254
|
-
- spec/unit/say_spec.rb
|
255
|
-
- spec/unit/select_spec.rb
|
256
|
-
- spec/unit/slider_spec.rb
|
257
|
-
- spec/unit/statement/initialize_spec.rb
|
258
|
-
- spec/unit/subscribe_spec.rb
|
259
|
-
- spec/unit/suggest_spec.rb
|
260
|
-
- spec/unit/warn_spec.rb
|
261
|
-
- spec/unit/yes_no_spec.rb
|
262
|
-
- tasks/console.rake
|
263
|
-
- tasks/coverage.rake
|
264
|
-
- tasks/spec.rake
|
265
|
-
- tty-prompt.gemspec
|
266
|
-
homepage: https://piotrmurach.github.io/tty
|
119
|
+
homepage: https://ttytoolkit.org
|
267
120
|
licenses:
|
268
121
|
- MIT
|
269
|
-
metadata:
|
122
|
+
metadata:
|
123
|
+
allowed_push_host: https://rubygems.org
|
124
|
+
bug_tracker_uri: https://github.com/piotrmurach/tty-prompt/issues
|
125
|
+
changelog_uri: https://github.com/piotrmurach/tty-prompt/blob/master/CHANGELOG.md
|
126
|
+
documentation_uri: https://www.rubydoc.info/gems/tty-prompt
|
127
|
+
homepage_uri: https://ttytoolkit.org
|
128
|
+
source_code_uri: https://github.com/piotrmurach/tty-prompt
|
270
129
|
post_install_message:
|
271
130
|
rdoc_options: []
|
272
131
|
require_paths:
|
@@ -282,65 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
141
|
- !ruby/object:Gem::Version
|
283
142
|
version: '0'
|
284
143
|
requirements: []
|
285
|
-
|
286
|
-
rubygems_version: 2.7.3
|
144
|
+
rubygems_version: 3.1.2
|
287
145
|
signing_key:
|
288
146
|
specification_version: 4
|
289
147
|
summary: A beautiful and powerful interactive command line prompt.
|
290
|
-
test_files:
|
291
|
-
- spec/spec_helper.rb
|
292
|
-
- spec/unit/ask_spec.rb
|
293
|
-
- spec/unit/choice/eql_spec.rb
|
294
|
-
- spec/unit/choice/from_spec.rb
|
295
|
-
- spec/unit/choices/add_spec.rb
|
296
|
-
- spec/unit/choices/each_spec.rb
|
297
|
-
- spec/unit/choices/find_by_spec.rb
|
298
|
-
- spec/unit/choices/new_spec.rb
|
299
|
-
- spec/unit/choices/pluck_spec.rb
|
300
|
-
- spec/unit/collect_spec.rb
|
301
|
-
- spec/unit/converters/convert_bool_spec.rb
|
302
|
-
- spec/unit/converters/convert_char_spec.rb
|
303
|
-
- spec/unit/converters/convert_custom_spec.rb
|
304
|
-
- spec/unit/converters/convert_date_spec.rb
|
305
|
-
- spec/unit/converters/convert_file_spec.rb
|
306
|
-
- spec/unit/converters/convert_number_spec.rb
|
307
|
-
- spec/unit/converters/convert_path_spec.rb
|
308
|
-
- spec/unit/converters/convert_range_spec.rb
|
309
|
-
- spec/unit/converters/convert_regex_spec.rb
|
310
|
-
- spec/unit/converters/convert_string_spec.rb
|
311
|
-
- spec/unit/converters/on_error_spec.rb
|
312
|
-
- spec/unit/distance/distance_spec.rb
|
313
|
-
- spec/unit/enum_paginator_spec.rb
|
314
|
-
- spec/unit/enum_select_spec.rb
|
315
|
-
- spec/unit/error_spec.rb
|
316
|
-
- spec/unit/evaluator_spec.rb
|
317
|
-
- spec/unit/expand_spec.rb
|
318
|
-
- spec/unit/keypress_spec.rb
|
319
|
-
- spec/unit/mask_spec.rb
|
320
|
-
- spec/unit/multi_select_spec.rb
|
321
|
-
- spec/unit/multiline_spec.rb
|
322
|
-
- spec/unit/new_spec.rb
|
323
|
-
- spec/unit/ok_spec.rb
|
324
|
-
- spec/unit/paginator_spec.rb
|
325
|
-
- spec/unit/question/checks_spec.rb
|
326
|
-
- spec/unit/question/default_spec.rb
|
327
|
-
- spec/unit/question/echo_spec.rb
|
328
|
-
- spec/unit/question/in_spec.rb
|
329
|
-
- spec/unit/question/initialize_spec.rb
|
330
|
-
- spec/unit/question/modifier/apply_to_spec.rb
|
331
|
-
- spec/unit/question/modifier/letter_case_spec.rb
|
332
|
-
- spec/unit/question/modifier/whitespace_spec.rb
|
333
|
-
- spec/unit/question/modify_spec.rb
|
334
|
-
- spec/unit/question/required_spec.rb
|
335
|
-
- spec/unit/question/validate_spec.rb
|
336
|
-
- spec/unit/question/validation/call_spec.rb
|
337
|
-
- spec/unit/question/validation/coerce_spec.rb
|
338
|
-
- spec/unit/result_spec.rb
|
339
|
-
- spec/unit/say_spec.rb
|
340
|
-
- spec/unit/select_spec.rb
|
341
|
-
- spec/unit/slider_spec.rb
|
342
|
-
- spec/unit/statement/initialize_spec.rb
|
343
|
-
- spec/unit/subscribe_spec.rb
|
344
|
-
- spec/unit/suggest_spec.rb
|
345
|
-
- spec/unit/warn_spec.rb
|
346
|
-
- spec/unit/yes_no_spec.rb
|
148
|
+
test_files: []
|