gum 0.3.0-arm64-linux
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 +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +460 -0
- data/exe/arm64-linux/gum +0 -0
- data/exe/gum +11 -0
- data/gum.gemspec +35 -0
- data/lib/gum/command.rb +159 -0
- data/lib/gum/commands/choose.rb +95 -0
- data/lib/gum/commands/confirm.rb +57 -0
- data/lib/gum/commands/file.rb +84 -0
- data/lib/gum/commands/filter.rb +119 -0
- data/lib/gum/commands/format.rb +74 -0
- data/lib/gum/commands/input.rb +68 -0
- data/lib/gum/commands/join.rb +41 -0
- data/lib/gum/commands/log.rb +98 -0
- data/lib/gum/commands/pager.rb +55 -0
- data/lib/gum/commands/spin.rb +167 -0
- data/lib/gum/commands/style.rb +93 -0
- data/lib/gum/commands/table.rb +93 -0
- data/lib/gum/commands/write.rb +84 -0
- data/lib/gum/upstream.rb +17 -0
- data/lib/gum/version.rb +7 -0
- data/lib/gum.rb +174 -0
- data/sig/gum/command.rbs +23 -0
- data/sig/gum/commands/choose.rbs +42 -0
- data/sig/gum/commands/confirm.rbs +30 -0
- data/sig/gum/commands/file.rbs +38 -0
- data/sig/gum/commands/filter.rbs +48 -0
- data/sig/gum/commands/format.rbs +47 -0
- data/sig/gum/commands/input.rbs +32 -0
- data/sig/gum/commands/join.rbs +24 -0
- data/sig/gum/commands/log.rbs +56 -0
- data/sig/gum/commands/pager.rbs +28 -0
- data/sig/gum/commands/spin.rbs +55 -0
- data/sig/gum/commands/style.rbs +44 -0
- data/sig/gum/commands/table.rbs +35 -0
- data/sig/gum/commands/write.rbs +35 -0
- data/sig/gum/upstream.rbs +9 -0
- data/sig/gum/version.rbs +5 -0
- data/sig/gum.rbs +79 -0
- metadata +84 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/choose.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Choose an option from a list of choices
|
|
5
|
+
#
|
|
6
|
+
# @example Single selection with array
|
|
7
|
+
# color = Gum.choose(%w[red green blue])
|
|
8
|
+
#
|
|
9
|
+
# @example Single selection with splat
|
|
10
|
+
# color = Gum.choose("red", "green", "blue")
|
|
11
|
+
#
|
|
12
|
+
# @example Multiple selection
|
|
13
|
+
# colors = Gum.choose(%w[red green blue], limit: 2)
|
|
14
|
+
#
|
|
15
|
+
# @example Unlimited selection
|
|
16
|
+
# colors = Gum.choose(%w[red green blue], no_limit: true)
|
|
17
|
+
#
|
|
18
|
+
# @example With header and custom height
|
|
19
|
+
# choice = Gum.choose(options, header: "Pick one:", height: 10)
|
|
20
|
+
class Choose
|
|
21
|
+
# Choose from a list of options
|
|
22
|
+
#
|
|
23
|
+
# @rbs *items: Array[String] | String -- list of choices to display (array or splat)
|
|
24
|
+
# @rbs limit: Integer? -- maximum number of items that can be selected (1 = single select)
|
|
25
|
+
# @rbs no_limit: bool -- allow unlimited selections (use tab/ctrl+space to select)
|
|
26
|
+
# @rbs ordered: bool? -- maintain selection order
|
|
27
|
+
# @rbs height: Integer? -- height of the list
|
|
28
|
+
# @rbs cursor: String? -- cursor character (default: ">")
|
|
29
|
+
# @rbs header: String? -- header text displayed above choices
|
|
30
|
+
# @rbs cursor_prefix: String? -- prefix for the cursor line
|
|
31
|
+
# @rbs selected_prefix: String? -- prefix for selected items (default: "✓")
|
|
32
|
+
# @rbs unselected_prefix: String? -- prefix for unselected items (default: "○")
|
|
33
|
+
# @rbs selected: Array[String]? -- items to pre-select
|
|
34
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
35
|
+
# @rbs cursor_style: Hash[Symbol, untyped]? -- cursor style options
|
|
36
|
+
# @rbs header_style: Hash[Symbol, untyped]? -- header text style
|
|
37
|
+
# @rbs item_style: Hash[Symbol, untyped]? -- item text style
|
|
38
|
+
# @rbs selected_style: Hash[Symbol, untyped]? -- selected item style
|
|
39
|
+
# @rbs return: String | Array[String] | nil -- selected item(s), or nil if cancelled
|
|
40
|
+
def self.call: (*Array[String] | String items, ?limit: Integer?, ?no_limit: bool, ?ordered: bool?, ?height: Integer?, ?cursor: String?, ?header: String?, ?cursor_prefix: String?, ?selected_prefix: String?, ?unselected_prefix: String?, ?selected: Array[String]?, ?timeout: Integer?, ?cursor_style: Hash[Symbol, untyped]?, ?header_style: Hash[Symbol, untyped]?, ?item_style: Hash[Symbol, untyped]?, ?selected_style: Hash[Symbol, untyped]?) -> (String | Array[String] | nil)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/confirm.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Ask for user confirmation
|
|
5
|
+
#
|
|
6
|
+
# @example Basic confirmation
|
|
7
|
+
# if Gum.confirm("Delete file?")
|
|
8
|
+
# File.delete(path)
|
|
9
|
+
# end
|
|
10
|
+
#
|
|
11
|
+
# @example With default value
|
|
12
|
+
# proceed = Gum.confirm("Continue?", default: true)
|
|
13
|
+
#
|
|
14
|
+
# @example With custom button labels
|
|
15
|
+
# Gum.confirm("Save changes?", affirmative: "Save", negative: "Discard")
|
|
16
|
+
class Confirm
|
|
17
|
+
# Prompt for yes/no confirmation
|
|
18
|
+
#
|
|
19
|
+
# @rbs prompt: String -- the confirmation prompt
|
|
20
|
+
# @rbs default: bool? -- default value (true = yes, false = no)
|
|
21
|
+
# @rbs affirmative: String? -- text for affirmative button (default: "Yes")
|
|
22
|
+
# @rbs negative: String? -- text for negative button (default: "No")
|
|
23
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
24
|
+
# @rbs prompt_style: Hash[Symbol, untyped]? -- prompt text style options
|
|
25
|
+
# @rbs selected_style: Hash[Symbol, untyped]? -- selected button style options
|
|
26
|
+
# @rbs unselected_style: Hash[Symbol, untyped]? -- unselected button style options
|
|
27
|
+
# @rbs return: bool -- true if confirmed, false if rejected
|
|
28
|
+
def self.call: (?String prompt, ?default: bool?, ?affirmative: String?, ?negative: String?, ?timeout: Integer?, ?prompt_style: Hash[Symbol, untyped]?, ?selected_style: Hash[Symbol, untyped]?, ?unselected_style: Hash[Symbol, untyped]?) -> bool
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/file.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Pick a file from a folder
|
|
5
|
+
#
|
|
6
|
+
# @example Basic file picker
|
|
7
|
+
# path = Gum.file
|
|
8
|
+
#
|
|
9
|
+
# @example Start from specific directory
|
|
10
|
+
# path = Gum.file(directory: "~/Documents")
|
|
11
|
+
#
|
|
12
|
+
# @example Show hidden files
|
|
13
|
+
# path = Gum.file(all: true)
|
|
14
|
+
#
|
|
15
|
+
# @example Only show directories
|
|
16
|
+
# dir = Gum.file(directory_only: true)
|
|
17
|
+
class FilePicker
|
|
18
|
+
# Pick a file from the filesystem
|
|
19
|
+
#
|
|
20
|
+
# @rbs path: String? -- starting directory path
|
|
21
|
+
# @rbs cursor: String? -- cursor character
|
|
22
|
+
# @rbs all: bool? -- show hidden files and directories
|
|
23
|
+
# @rbs file: bool? -- allow file selection (default: true)
|
|
24
|
+
# @rbs directory: bool? -- allow directory selection (default: false)
|
|
25
|
+
# @rbs directory_only: bool -- only allow directory selection (convenience option)
|
|
26
|
+
# @rbs height: Integer? -- height of the file picker
|
|
27
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
28
|
+
# @rbs cursor_style: Hash[Symbol, untyped]? -- cursor style options
|
|
29
|
+
# @rbs symlink_style: Hash[Symbol, untyped]? -- symlink text style
|
|
30
|
+
# @rbs directory_style: Hash[Symbol, untyped]? -- directory text style
|
|
31
|
+
# @rbs file_style: Hash[Symbol, untyped]? -- file text style
|
|
32
|
+
# @rbs permissions_style: Hash[Symbol, untyped]? -- permissions text style
|
|
33
|
+
# @rbs selected_style: Hash[Symbol, untyped]? -- selected item style
|
|
34
|
+
# @rbs file_size_style: Hash[Symbol, untyped]? -- file size text style
|
|
35
|
+
# @rbs return: String? -- selected file path, or nil if cancelled
|
|
36
|
+
def self.call: (?String? path, ?cursor: String?, ?all: bool?, ?file: bool?, ?directory: bool?, ?directory_only: bool, ?height: Integer?, ?timeout: Integer?, ?cursor_style: Hash[Symbol, untyped]?, ?symlink_style: Hash[Symbol, untyped]?, ?directory_style: Hash[Symbol, untyped]?, ?file_style: Hash[Symbol, untyped]?, ?permissions_style: Hash[Symbol, untyped]?, ?selected_style: Hash[Symbol, untyped]?, ?file_size_style: Hash[Symbol, untyped]?) -> String?
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/filter.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Filter items from a list with fuzzy matching
|
|
5
|
+
#
|
|
6
|
+
# @example Single selection filter with array
|
|
7
|
+
# file = Gum.filter(Dir.glob("*"))
|
|
8
|
+
#
|
|
9
|
+
# @example Single selection filter with splat
|
|
10
|
+
# file = Gum.filter("file1.rb", "file2.rb", "file3.rb")
|
|
11
|
+
#
|
|
12
|
+
# @example Multiple selection filter
|
|
13
|
+
# files = Gum.filter(Dir.glob("*"), limit: 5)
|
|
14
|
+
#
|
|
15
|
+
# @example With placeholder and height
|
|
16
|
+
# selection = Gum.filter(items, placeholder: "Search...", height: 20)
|
|
17
|
+
class Filter
|
|
18
|
+
# Filter a list with fuzzy matching
|
|
19
|
+
#
|
|
20
|
+
# @rbs *items: Array[String] | String -- list of items to filter (array or splat)
|
|
21
|
+
# @rbs limit: Integer? -- maximum number of items that can be selected
|
|
22
|
+
# @rbs no_limit: bool -- allow unlimited selections (use tab/ctrl+space to select)
|
|
23
|
+
# @rbs height: Integer? -- height of the list
|
|
24
|
+
# @rbs width: Integer? -- width of the filter input
|
|
25
|
+
# @rbs placeholder: String? -- placeholder text for the filter input
|
|
26
|
+
# @rbs prompt: String? -- prompt string shown before input
|
|
27
|
+
# @rbs value: String? -- initial filter value
|
|
28
|
+
# @rbs header: String? -- header text displayed above the list
|
|
29
|
+
# @rbs indicator: String? -- character for selected item indicator
|
|
30
|
+
# @rbs selected_prefix: String? -- prefix for selected items
|
|
31
|
+
# @rbs unselected_prefix: String? -- prefix for unselected items
|
|
32
|
+
# @rbs match_prefix: String? -- prefix for matched text
|
|
33
|
+
# @rbs fuzzy: bool? -- enable fuzzy matching (default: true)
|
|
34
|
+
# @rbs sort: bool? -- sort results by match score (default: true)
|
|
35
|
+
# @rbs strict: bool? -- require exact match
|
|
36
|
+
# @rbs reverse: bool? -- reverse the order of results
|
|
37
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
38
|
+
# @rbs header_style: Hash[Symbol, untyped]? -- header text style
|
|
39
|
+
# @rbs text_style: Hash[Symbol, untyped]? -- text style for items
|
|
40
|
+
# @rbs cursor_text_style: Hash[Symbol, untyped]? -- style for cursor line text
|
|
41
|
+
# @rbs match_style: Hash[Symbol, untyped]? -- style for matched characters
|
|
42
|
+
# @rbs placeholder_style: Hash[Symbol, untyped]? -- placeholder text style
|
|
43
|
+
# @rbs prompt_style: Hash[Symbol, untyped]? -- prompt text style
|
|
44
|
+
# @rbs indicator_style: Hash[Symbol, untyped]? -- indicator character style
|
|
45
|
+
# @rbs return: String | Array[String] | nil -- selected item(s), or nil if cancelled
|
|
46
|
+
def self.call: (*Array[String] | String items, ?limit: Integer?, ?no_limit: bool, ?height: Integer?, ?width: Integer?, ?placeholder: String?, ?prompt: String?, ?value: String?, ?header: String?, ?indicator: String?, ?selected_prefix: String?, ?unselected_prefix: String?, ?match_prefix: String?, ?fuzzy: bool?, ?sort: bool?, ?strict: bool?, ?reverse: bool?, ?timeout: Integer?, ?header_style: Hash[Symbol, untyped]?, ?text_style: Hash[Symbol, untyped]?, ?cursor_text_style: Hash[Symbol, untyped]?, ?match_style: Hash[Symbol, untyped]?, ?placeholder_style: Hash[Symbol, untyped]?, ?prompt_style: Hash[Symbol, untyped]?, ?indicator_style: Hash[Symbol, untyped]?) -> (String | Array[String] | nil)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/format.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Format text with markdown, code highlighting, templates, or emojis
|
|
5
|
+
#
|
|
6
|
+
# @example Markdown formatting
|
|
7
|
+
# Gum.format("# Hello\n- Item 1\n- Item 2")
|
|
8
|
+
#
|
|
9
|
+
# @example Code highlighting
|
|
10
|
+
# Gum.format(code, type: :code, language: "ruby")
|
|
11
|
+
#
|
|
12
|
+
# @example Template formatting
|
|
13
|
+
# Gum.format('{{ Bold "Hello" }} {{ Color "99" "0" " World " }}', type: :template)
|
|
14
|
+
#
|
|
15
|
+
# @example Emoji formatting
|
|
16
|
+
# Gum.format("I :heart: Ruby :gem:", type: :emoji)
|
|
17
|
+
class Format
|
|
18
|
+
TYPES: Array[Symbol]
|
|
19
|
+
|
|
20
|
+
# Format and render text
|
|
21
|
+
#
|
|
22
|
+
# @rbs *text: String -- text content to format (multiple strings joined with newlines)
|
|
23
|
+
# @rbs type: Symbol | String | nil -- format type (:markdown, :code, :template, :emoji)
|
|
24
|
+
# @rbs language: String? -- programming language for code highlighting
|
|
25
|
+
# @rbs theme: String? -- syntax highlighting theme
|
|
26
|
+
# @rbs return: String? -- formatted text output
|
|
27
|
+
def self.call: (*String text, ?type: Symbol | String | nil, ?language: String?, ?theme: String?) -> String?
|
|
28
|
+
|
|
29
|
+
# @rbs text: String -- markdown text to format
|
|
30
|
+
# @rbs return: String? -- rendered markdown output
|
|
31
|
+
def self.markdown: (String text) -> String?
|
|
32
|
+
|
|
33
|
+
# @rbs text: String -- source code to highlight
|
|
34
|
+
# @rbs language: String? -- programming language for highlighting
|
|
35
|
+
# @rbs theme: String? -- syntax highlighting theme
|
|
36
|
+
# @rbs return: String? -- syntax-highlighted code output
|
|
37
|
+
def self.code: (String text, ?language: String?, ?theme: String?) -> String?
|
|
38
|
+
|
|
39
|
+
# @rbs text: String -- template string with Termenv helpers
|
|
40
|
+
# @rbs return: String? -- rendered template output
|
|
41
|
+
def self.template: (String text) -> String?
|
|
42
|
+
|
|
43
|
+
# @rbs text: String -- text with :emoji_name: codes
|
|
44
|
+
# @rbs return: String? -- text with emojis rendered
|
|
45
|
+
def self.emoji: (String text) -> String?
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/input.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Prompt for single-line input
|
|
5
|
+
#
|
|
6
|
+
# @example Basic input
|
|
7
|
+
# name = Gum.input(placeholder: "Enter your name")
|
|
8
|
+
#
|
|
9
|
+
# @example Password input
|
|
10
|
+
# password = Gum.input(password: true)
|
|
11
|
+
#
|
|
12
|
+
# @example With default value and custom prompt
|
|
13
|
+
# email = Gum.input(value: "user@", prompt: "> ", placeholder: "email")
|
|
14
|
+
class Input
|
|
15
|
+
# Prompt for single-line input
|
|
16
|
+
#
|
|
17
|
+
# @rbs placeholder: String? -- placeholder text shown when input is empty
|
|
18
|
+
# @rbs prompt: String? -- prompt string shown before input
|
|
19
|
+
# @rbs value: String? -- initial value for the input
|
|
20
|
+
# @rbs char_limit: Integer? -- maximum number of characters allowed
|
|
21
|
+
# @rbs width: Integer? -- width of the input field
|
|
22
|
+
# @rbs password: bool -- mask input characters for password entry
|
|
23
|
+
# @rbs header: String? -- header text displayed above the input
|
|
24
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
25
|
+
# @rbs cursor: Hash[Symbol, untyped]? -- cursor style options (foreground, background)
|
|
26
|
+
# @rbs prompt_style: Hash[Symbol, untyped]? -- prompt text style options
|
|
27
|
+
# @rbs placeholder_style: Hash[Symbol, untyped]? -- placeholder text style options
|
|
28
|
+
# @rbs header_style: Hash[Symbol, untyped]? -- header text style options
|
|
29
|
+
# @rbs return: String? -- the entered text, or nil if cancelled
|
|
30
|
+
def self.call: (?placeholder: String?, ?prompt: String?, ?value: String?, ?char_limit: Integer?, ?width: Integer?, ?password: bool, ?header: String?, ?timeout: Integer?, ?cursor: Hash[Symbol, untyped]?, ?prompt_style: Hash[Symbol, untyped]?, ?placeholder_style: Hash[Symbol, untyped]?, ?header_style: Hash[Symbol, untyped]?) -> String?
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/join.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Join text blocks horizontally or vertically
|
|
5
|
+
#
|
|
6
|
+
# @example Horizontal join (default)
|
|
7
|
+
# combined = Gum.join(box1, box2)
|
|
8
|
+
#
|
|
9
|
+
# @example Vertical join
|
|
10
|
+
# stacked = Gum.join(box1, box2, vertical: true)
|
|
11
|
+
#
|
|
12
|
+
# @example With alignment
|
|
13
|
+
# aligned = Gum.join(box1, box2, vertical: true, align: :center)
|
|
14
|
+
class Join
|
|
15
|
+
# Join text blocks together
|
|
16
|
+
#
|
|
17
|
+
# @rbs *texts: String -- text blocks to join (usually styled with Gum.style)
|
|
18
|
+
# @rbs vertical: bool -- stack blocks vertically (default: false, horizontal)
|
|
19
|
+
# @rbs horizontal: bool -- place blocks side by side (default)
|
|
20
|
+
# @rbs align: Symbol | String | nil -- alignment (:left, :center, :right for vertical; :top, :middle, :bottom for horizontal)
|
|
21
|
+
# @rbs return: String? -- combined text output
|
|
22
|
+
def self.call: (*String texts, ?vertical: bool, ?horizontal: bool, ?align: Symbol | String | nil) -> String?
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/log.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Log messages with different levels and formatting
|
|
5
|
+
#
|
|
6
|
+
# @example Basic logging
|
|
7
|
+
# Gum.log("Application started", level: :info)
|
|
8
|
+
#
|
|
9
|
+
# @example Structured logging with key-value pairs
|
|
10
|
+
# Gum.log("User created", level: :info, user_id: 123, email: "user@example.com")
|
|
11
|
+
#
|
|
12
|
+
# @example With timestamp
|
|
13
|
+
# Gum.log("Error occurred", level: :error, time: :rfc822)
|
|
14
|
+
class Log
|
|
15
|
+
LEVELS: Array[Symbol]
|
|
16
|
+
|
|
17
|
+
TIME_FORMATS: Array[Symbol]
|
|
18
|
+
|
|
19
|
+
# Log a message
|
|
20
|
+
#
|
|
21
|
+
# @rbs message: String -- log message text
|
|
22
|
+
# @rbs level: Symbol | String | nil -- log level (:debug, :info, :warn, :error, :fatal, :none)
|
|
23
|
+
# @rbs time: Symbol | String | nil -- time format (:rfc822, :rfc3339, :kitchen, etc.) or custom Go time format
|
|
24
|
+
# @rbs structured: bool? -- output structured log format (key=value pairs)
|
|
25
|
+
# @rbs formatter: Symbol | String | nil -- log formatter (:text, :json, :logfmt)
|
|
26
|
+
# @rbs prefix: String? -- log message prefix
|
|
27
|
+
# @rbs **fields: untyped -- additional key-value fields for structured logging
|
|
28
|
+
# @rbs return: String? -- formatted log output
|
|
29
|
+
def self.call: (String message, ?level: Symbol | String | nil, ?time: Symbol | String | nil, ?structured: bool?, ?formatter: Symbol | String | nil, ?prefix: String?, **untyped fields) -> String?
|
|
30
|
+
|
|
31
|
+
# @rbs message: String -- log message text
|
|
32
|
+
# @rbs **fields: untyped -- additional key-value fields
|
|
33
|
+
# @rbs return: String? -- formatted debug log output
|
|
34
|
+
def self.debug: (String message, **untyped fields) -> String?
|
|
35
|
+
|
|
36
|
+
# @rbs message: String -- log message text
|
|
37
|
+
# @rbs **fields: untyped -- additional key-value fields
|
|
38
|
+
# @rbs return: String? -- formatted info log output
|
|
39
|
+
def self.info: (String message, **untyped fields) -> String?
|
|
40
|
+
|
|
41
|
+
# @rbs message: String -- log message text
|
|
42
|
+
# @rbs **fields: untyped -- additional key-value fields
|
|
43
|
+
# @rbs return: String? -- formatted warn log output
|
|
44
|
+
def self.warn: (String message, **untyped fields) -> String?
|
|
45
|
+
|
|
46
|
+
# @rbs message: String -- log message text
|
|
47
|
+
# @rbs **fields: untyped -- additional key-value fields
|
|
48
|
+
# @rbs return: String? -- formatted error log output
|
|
49
|
+
def self.error: (String message, **untyped fields) -> String?
|
|
50
|
+
|
|
51
|
+
# @rbs message: String -- log message text
|
|
52
|
+
# @rbs **fields: untyped -- additional key-value fields
|
|
53
|
+
# @rbs return: String? -- formatted fatal log output
|
|
54
|
+
def self.fatal: (String message, **untyped fields) -> String?
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/pager.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Scroll through content in a pager
|
|
5
|
+
#
|
|
6
|
+
# @example View file content
|
|
7
|
+
# Gum.pager(File.read("README.md"))
|
|
8
|
+
#
|
|
9
|
+
# @example With line numbers
|
|
10
|
+
# Gum.pager(content, show_line_numbers: true)
|
|
11
|
+
#
|
|
12
|
+
# @example Soft wrap long lines
|
|
13
|
+
# Gum.pager(content, soft_wrap: true)
|
|
14
|
+
class Pager
|
|
15
|
+
# Display content in a scrollable pager
|
|
16
|
+
#
|
|
17
|
+
# @rbs content: String -- content to display in the pager
|
|
18
|
+
# @rbs show_line_numbers: bool? -- display line numbers
|
|
19
|
+
# @rbs soft_wrap: bool? -- wrap long lines instead of horizontal scrolling
|
|
20
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
21
|
+
# @rbs help_style: Hash[Symbol, untyped]? -- help text style
|
|
22
|
+
# @rbs line_number_style: Hash[Symbol, untyped]? -- line number style
|
|
23
|
+
# @rbs match_style: Hash[Symbol, untyped]? -- search match style
|
|
24
|
+
# @rbs match_highlight_style: Hash[Symbol, untyped]? -- current search match highlight style
|
|
25
|
+
# @rbs return: void
|
|
26
|
+
def self.call: (String content, ?show_line_numbers: bool?, ?soft_wrap: bool?, ?timeout: Integer?, ?help_style: Hash[Symbol, untyped]?, ?line_number_style: Hash[Symbol, untyped]?, ?match_style: Hash[Symbol, untyped]?, ?match_highlight_style: Hash[Symbol, untyped]?) -> void
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/spin.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Display a spinner while running a command or block
|
|
5
|
+
#
|
|
6
|
+
# @example With shell command
|
|
7
|
+
# Gum.spin("Installing...", command: "npm install")
|
|
8
|
+
#
|
|
9
|
+
# @example With Ruby block
|
|
10
|
+
# result = Gum.spin("Processing...") do
|
|
11
|
+
# # long running operation
|
|
12
|
+
# expensive_computation
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
# @example Custom spinner type
|
|
16
|
+
# Gum.spin("Loading...", spinner: :dot, command: "sleep 5")
|
|
17
|
+
class Spin
|
|
18
|
+
SPINNERS: Array[Symbol]
|
|
19
|
+
|
|
20
|
+
# Display a spinner while running a command or block
|
|
21
|
+
#
|
|
22
|
+
# @rbs title: String -- spinner title text (default: "Loading...")
|
|
23
|
+
# @rbs command: String? -- shell command to execute
|
|
24
|
+
# @rbs spinner: Symbol | String | nil -- spinner type (see SPINNERS constant)
|
|
25
|
+
# @rbs show_output: bool? -- show command stdout after completion
|
|
26
|
+
# @rbs show_error: bool? -- show command stderr after completion
|
|
27
|
+
# @rbs align: Symbol? -- alignment of spinner and title (:left, :right)
|
|
28
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
29
|
+
# @rbs spinner_style: Hash[Symbol, untyped]? -- spinner animation style
|
|
30
|
+
# @rbs title_style: Hash[Symbol, untyped]? -- title text style
|
|
31
|
+
# @rbs &block: ^() -> untyped | nil -- Ruby block to execute (alternative to command)
|
|
32
|
+
# @rbs return: String | untyped | nil -- command output or block result, nil if cancelled
|
|
33
|
+
def self.call: (?String title, ?command: String?, ?spinner: Symbol | String | nil, ?show_output: bool?, ?show_error: bool?, ?align: Symbol?, ?timeout: Integer?, ?spinner_style: Hash[Symbol, untyped]?, ?title_style: Hash[Symbol, untyped]?) ?{ (?) -> untyped } -> (String | untyped | nil)
|
|
34
|
+
|
|
35
|
+
# @rbs title: String -- spinner title text
|
|
36
|
+
# @rbs command: String -- shell command to execute
|
|
37
|
+
# @rbs spinner: Symbol | String | nil -- spinner type
|
|
38
|
+
# @rbs show_output: bool? -- show command stdout
|
|
39
|
+
# @rbs show_error: bool? -- show command stderr
|
|
40
|
+
# @rbs align: Symbol? -- alignment of spinner
|
|
41
|
+
# @rbs timeout: Integer? -- timeout in seconds
|
|
42
|
+
# @rbs spinner_style: Hash[Symbol, untyped]? -- spinner animation style
|
|
43
|
+
# @rbs title_style: Hash[Symbol, untyped]? -- title text style
|
|
44
|
+
# @rbs return: bool? -- true if command succeeded, false/nil otherwise
|
|
45
|
+
def self.run_with_command: (String title, command: String, spinner: Symbol | String | nil, show_output: bool?, show_error: bool?, align: Symbol?, timeout: Integer?, spinner_style: Hash[Symbol, untyped]?, title_style: Hash[Symbol, untyped]?) -> bool?
|
|
46
|
+
|
|
47
|
+
# @rbs title: String -- spinner title text
|
|
48
|
+
# @rbs spinner: Symbol | String | nil -- spinner type
|
|
49
|
+
# @rbs spinner_style: Hash[Symbol, untyped]? -- spinner animation style
|
|
50
|
+
# @rbs title_style: Hash[Symbol, untyped]? -- title text style
|
|
51
|
+
# @rbs &block: ^() -> untyped -- Ruby block to execute
|
|
52
|
+
# @rbs return: untyped -- block result
|
|
53
|
+
def self.run_with_block: (String title, spinner: Symbol | String | nil, spinner_style: Hash[Symbol, untyped]?, title_style: Hash[Symbol, untyped]?) ?{ (?) -> untyped } -> untyped
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/style.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Apply styling to text
|
|
5
|
+
#
|
|
6
|
+
# @example Basic styling
|
|
7
|
+
# styled = Gum.style("Hello", foreground: "212", bold: true)
|
|
8
|
+
#
|
|
9
|
+
# @example With border
|
|
10
|
+
# box = Gum.style("Content", border: :double, padding: "1 2")
|
|
11
|
+
#
|
|
12
|
+
# @example Multiple lines
|
|
13
|
+
# styled = Gum.style("Line 1", "Line 2", align: :center, width: 50)
|
|
14
|
+
class Style
|
|
15
|
+
BORDERS: Array[Symbol]
|
|
16
|
+
|
|
17
|
+
ALIGNMENTS: Array[Symbol]
|
|
18
|
+
|
|
19
|
+
# Apply styling to text
|
|
20
|
+
#
|
|
21
|
+
# @rbs *text: String -- text content to style (multiple strings become separate lines)
|
|
22
|
+
# @rbs foreground: String | Integer | nil -- text color (ANSI code, hex, or color name)
|
|
23
|
+
# @rbs background: String | Integer | nil -- background color (ANSI code, hex, or color name)
|
|
24
|
+
# @rbs border: Symbol | String | nil -- border style (:none, :hidden, :rounded, :double, :thick, :normal)
|
|
25
|
+
# @rbs border_foreground: String | Integer | nil -- border color
|
|
26
|
+
# @rbs border_background: String | Integer | nil -- border background color
|
|
27
|
+
# @rbs align: Symbol | String | nil -- text alignment (:left, :center, :right)
|
|
28
|
+
# @rbs height: Integer? -- fixed height in lines
|
|
29
|
+
# @rbs width: Integer? -- fixed width in characters
|
|
30
|
+
# @rbs margin: String | Array[Integer] | nil -- margin around the box ("1" or "1 2" or [1, 2, 1, 2])
|
|
31
|
+
# @rbs padding: String | Array[Integer] | nil -- padding inside the box ("1" or "1 2" or [1, 2, 1, 2])
|
|
32
|
+
# @rbs bold: bool? -- bold text
|
|
33
|
+
# @rbs italic: bool? -- italic text
|
|
34
|
+
# @rbs strikethrough: bool? -- strikethrough text
|
|
35
|
+
# @rbs underline: bool? -- underlined text
|
|
36
|
+
# @rbs faint: bool? -- faint/dim text
|
|
37
|
+
# @rbs return: String? -- styled text output
|
|
38
|
+
def self.call: (*String text, ?foreground: String | Integer | nil, ?background: String | Integer | nil, ?border: Symbol | String | nil, ?border_foreground: String | Integer | nil, ?border_background: String | Integer | nil, ?align: Symbol | String | nil, ?height: Integer?, ?width: Integer?, ?margin: String | Array[Integer] | nil, ?padding: String | Array[Integer] | nil, ?bold: bool?, ?italic: bool?, ?strikethrough: bool?, ?underline: bool?, ?faint: bool?) -> String?
|
|
39
|
+
|
|
40
|
+
# @rbs value: String | Integer | Array[Integer] | nil -- spacing value to format
|
|
41
|
+
# @rbs return: String? -- formatted spacing string
|
|
42
|
+
def self.format_spacing: (String | Integer | Array[Integer] | nil value) -> String?
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/table.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Display and select from tabular data
|
|
5
|
+
#
|
|
6
|
+
# @example From array of arrays
|
|
7
|
+
# selection = Gum.table([["Alice", 30], ["Bob", 25]], columns: %w[Name Age])
|
|
8
|
+
#
|
|
9
|
+
# @example From CSV string
|
|
10
|
+
# Gum.table(File.read("data.csv"))
|
|
11
|
+
#
|
|
12
|
+
# @example With custom separator
|
|
13
|
+
# Gum.table(data, separator: "\t")
|
|
14
|
+
class Table
|
|
15
|
+
# Display tabular data and optionally allow row selection
|
|
16
|
+
#
|
|
17
|
+
# @rbs data: String | Array[Array[untyped]] -- CSV string or array of row arrays
|
|
18
|
+
# @rbs columns: Array[String]? -- column headers (required when data is array)
|
|
19
|
+
# @rbs separator: String? -- column separator (default: ",")
|
|
20
|
+
# @rbs widths: Array[Integer]? -- column widths
|
|
21
|
+
# @rbs height: Integer? -- table height in rows
|
|
22
|
+
# @rbs print: bool? -- print table without selection (non-interactive)
|
|
23
|
+
# @rbs border: Symbol | String | nil -- border style (:rounded, :thick, :normal, :hidden, :double, :none)
|
|
24
|
+
# @rbs border_foreground: String | Integer | nil -- border color
|
|
25
|
+
# @rbs border_background: String | Integer | nil -- border background color
|
|
26
|
+
# @rbs cell_foreground: String | Integer | nil -- cell text color
|
|
27
|
+
# @rbs cell_background: String | Integer | nil -- cell background color
|
|
28
|
+
# @rbs header_foreground: String | Integer | nil -- header text color
|
|
29
|
+
# @rbs header_background: String | Integer | nil -- header background color
|
|
30
|
+
# @rbs selected_foreground: String | Integer | nil -- selected row text color
|
|
31
|
+
# @rbs selected_background: String | Integer | nil -- selected row background color
|
|
32
|
+
# @rbs return: String? -- selected row data, or nil if cancelled
|
|
33
|
+
def self.call: (String | Array[Array[untyped]] data, ?columns: Array[String]?, ?separator: String?, ?widths: Array[Integer]?, ?height: Integer?, ?print: bool?, ?border: Symbol | String | nil, ?border_foreground: String | Integer | nil, ?border_background: String | Integer | nil, ?cell_foreground: String | Integer | nil, ?cell_background: String | Integer | nil, ?header_foreground: String | Integer | nil, ?header_background: String | Integer | nil, ?selected_foreground: String | Integer | nil, ?selected_background: String | Integer | nil) -> String?
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Generated from lib/gum/commands/write.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
# Prompt for multi-line text input
|
|
5
|
+
#
|
|
6
|
+
# @example Basic multi-line input
|
|
7
|
+
# description = Gum.write(placeholder: "Enter description...")
|
|
8
|
+
#
|
|
9
|
+
# @example With dimensions
|
|
10
|
+
# notes = Gum.write(width: 80, height: 10, header: "Notes")
|
|
11
|
+
class Write
|
|
12
|
+
# Prompt for multi-line text input (Ctrl+D to submit)
|
|
13
|
+
#
|
|
14
|
+
# @rbs placeholder: String? -- placeholder text shown when empty
|
|
15
|
+
# @rbs prompt: String? -- prompt string shown at the start of each line
|
|
16
|
+
# @rbs value: String? -- initial value for the text area
|
|
17
|
+
# @rbs char_limit: Integer? -- maximum number of characters allowed
|
|
18
|
+
# @rbs width: Integer? -- width of the text area
|
|
19
|
+
# @rbs height: Integer? -- height of the text area in lines
|
|
20
|
+
# @rbs header: String? -- header text displayed above the input
|
|
21
|
+
# @rbs show_cursor_line: bool? -- highlight the line with the cursor
|
|
22
|
+
# @rbs show_line_numbers: bool? -- display line numbers
|
|
23
|
+
# @rbs timeout: Integer? -- timeout in seconds (0 = no timeout)
|
|
24
|
+
# @rbs cursor: Hash[Symbol, untyped]? -- cursor style options
|
|
25
|
+
# @rbs cursor_line: Hash[Symbol, untyped]? -- cursor line highlight style
|
|
26
|
+
# @rbs placeholder_style: Hash[Symbol, untyped]? -- placeholder text style
|
|
27
|
+
# @rbs prompt_style: Hash[Symbol, untyped]? -- prompt text style
|
|
28
|
+
# @rbs end_of_buffer: Hash[Symbol, untyped]? -- end of buffer character style
|
|
29
|
+
# @rbs line_number: Hash[Symbol, untyped]? -- line number style
|
|
30
|
+
# @rbs header_style: Hash[Symbol, untyped]? -- header text style
|
|
31
|
+
# @rbs base: Hash[Symbol, untyped]? -- base text style
|
|
32
|
+
# @rbs return: String? -- the entered text, or nil if cancelled
|
|
33
|
+
def self.call: (?placeholder: String?, ?prompt: String?, ?value: String?, ?char_limit: Integer?, ?width: Integer?, ?height: Integer?, ?header: String?, ?show_cursor_line: bool?, ?show_line_numbers: bool?, ?timeout: Integer?, ?cursor: Hash[Symbol, untyped]?, ?cursor_line: Hash[Symbol, untyped]?, ?placeholder_style: Hash[Symbol, untyped]?, ?prompt_style: Hash[Symbol, untyped]?, ?end_of_buffer: Hash[Symbol, untyped]?, ?line_number: Hash[Symbol, untyped]?, ?header_style: Hash[Symbol, untyped]?, ?base: Hash[Symbol, untyped]?) -> String?
|
|
34
|
+
end
|
|
35
|
+
end
|
data/sig/gum/version.rbs
ADDED
data/sig/gum.rbs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Generated from lib/gum.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Gum
|
|
4
|
+
GEM_NAME: ::String
|
|
5
|
+
|
|
6
|
+
DEFAULT_DIR: untyped
|
|
7
|
+
|
|
8
|
+
class Error < StandardError
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
class ExecutableNotFoundException < Error
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class UnsupportedPlatformException < Error
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class DirectoryNotFoundException < Error
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.execute: (*untyped args) -> untyped
|
|
21
|
+
|
|
22
|
+
def self.platform: () -> untyped
|
|
23
|
+
|
|
24
|
+
def self.version: () -> untyped
|
|
25
|
+
|
|
26
|
+
def self.executable: (?exe_path: untyped) -> untyped
|
|
27
|
+
|
|
28
|
+
# Prompt for single-line input
|
|
29
|
+
# @see Gum::Input#call
|
|
30
|
+
def self.input: (**untyped) -> untyped
|
|
31
|
+
|
|
32
|
+
# Prompt for multi-line text input
|
|
33
|
+
# @see Gum::Write#call
|
|
34
|
+
def self.write: (**untyped) -> untyped
|
|
35
|
+
|
|
36
|
+
# Choose from a list of options
|
|
37
|
+
# @see Gum::Choose#call
|
|
38
|
+
def self.choose: (untyped items, **untyped) -> untyped
|
|
39
|
+
|
|
40
|
+
# Filter items with fuzzy matching
|
|
41
|
+
# @see Gum::Filter#call
|
|
42
|
+
def self.filter: (untyped items, **untyped) -> untyped
|
|
43
|
+
|
|
44
|
+
# Prompt for confirmation
|
|
45
|
+
# @see Gum::Confirm#call
|
|
46
|
+
def self.confirm: (?untyped prompt, **untyped) -> untyped
|
|
47
|
+
|
|
48
|
+
# Pick a file from the filesystem
|
|
49
|
+
# @see Gum::FilePicker#call
|
|
50
|
+
def self.file: (?untyped path, **untyped) -> untyped
|
|
51
|
+
|
|
52
|
+
# Display content in a scrollable pager
|
|
53
|
+
# @see Gum::Pager#call
|
|
54
|
+
def self.pager: (untyped content, **untyped) -> untyped
|
|
55
|
+
|
|
56
|
+
# Display a spinner while running a command or block
|
|
57
|
+
# @see Gum::Spin#call
|
|
58
|
+
def self.spin: (?untyped title, **untyped) ?{ (?) -> untyped } -> untyped
|
|
59
|
+
|
|
60
|
+
# Apply styling to text
|
|
61
|
+
# @see Gum::Style#call
|
|
62
|
+
def self.style: (*untyped text, **untyped) -> untyped
|
|
63
|
+
|
|
64
|
+
# Join text blocks together
|
|
65
|
+
# @see Gum::Join#call
|
|
66
|
+
def self.join: (*untyped texts, **untyped) -> untyped
|
|
67
|
+
|
|
68
|
+
# Format text (markdown, code, template, emoji)
|
|
69
|
+
# @see Gum::Format#call
|
|
70
|
+
def self.format: (*untyped text, **untyped) -> untyped
|
|
71
|
+
|
|
72
|
+
# Display and select from tabular data
|
|
73
|
+
# @see Gum::Table#call
|
|
74
|
+
def self.table: (untyped data, **untyped) -> untyped
|
|
75
|
+
|
|
76
|
+
# Log a message
|
|
77
|
+
# @see Gum::Log#call
|
|
78
|
+
def self.log: (untyped message, **untyped) -> untyped
|
|
79
|
+
end
|