downup 0.10.6 → 0.11.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +8 -0
- data/examples/basic.rb +6 -1
- data/lib/downup.rb +15 -11
- data/lib/downup/options_printer.rb +4 -5
- data/lib/downup/version.rb +1 -1
- metadata +1 -2
- data/downup-0.9.6.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63d7f26b086ddbde4f3a21cb2ec9c81303669b04
|
4
|
+
data.tar.gz: af8cb68e73047c496b68980eacfe67e1f778bbf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ac0ce0d0356e55f869e258902b864e065b62dae42bc570fd54ba4adde9fc9b71621beba1e7b28177a01ab343407e134f7e0b6a3ad30842edfe5b26f235fb42d
|
7
|
+
data.tar.gz: 37220a831740dc68870a37ae1610c26403c35009a31b98a70ab677a895b8fa38508c7c2c7fffb1992f15e6fd6e4efbba92db4f3a1d737bccbf123d99aff0b90a
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -103,6 +103,14 @@ puts Downup::Base.new(options: options, selector: "†").prompt
|
|
103
103
|
|
104
104
|
# You can also enable multi_select,
|
105
105
|
Downup::Base.new(options: options, type: :multi_select).prompt
|
106
|
+
|
107
|
+
# You can customize the Multi Select Selector
|
108
|
+
Downup::Base.new(
|
109
|
+
options: options,
|
110
|
+
type: :multi_select,
|
111
|
+
multi_select_selector: "X",
|
112
|
+
selected_color: :red
|
113
|
+
).prompt
|
106
114
|
```
|
107
115
|
|
108
116
|
## Inspired By
|
data/examples/basic.rb
CHANGED
data/lib/downup.rb
CHANGED
@@ -14,23 +14,25 @@ module Downup
|
|
14
14
|
flash_color: :green,
|
15
15
|
default_color: :brown,
|
16
16
|
selected_color: :magenta,
|
17
|
+
multi_select_selector: "√",
|
17
18
|
selector: "‣",
|
18
19
|
type: :default,
|
19
20
|
stdin: $stdin,
|
20
21
|
stdout: $stdout,
|
21
22
|
header_proc: Proc.new {})
|
22
23
|
|
23
|
-
@options
|
24
|
-
@flash_color
|
25
|
-
@flash_message
|
26
|
-
@default_color
|
27
|
-
@selected_color
|
28
|
-
@selector
|
29
|
-
@type
|
30
|
-
@header_proc
|
31
|
-
@stdin
|
32
|
-
@stdout
|
33
|
-
@colonel
|
24
|
+
@options = options
|
25
|
+
@flash_color = flash_color
|
26
|
+
@flash_message = flash_message
|
27
|
+
@default_color = default_color
|
28
|
+
@selected_color = selected_color
|
29
|
+
@selector = selector
|
30
|
+
@type = type
|
31
|
+
@header_proc = header_proc
|
32
|
+
@stdin = stdin
|
33
|
+
@stdout = stdout
|
34
|
+
@colonel = Kernel
|
35
|
+
@multi_select_selector = multi_select_selector
|
34
36
|
|
35
37
|
@multi_selected_positions = []
|
36
38
|
end
|
@@ -44,6 +46,7 @@ module Downup
|
|
44
46
|
options: options,
|
45
47
|
selected_position: @selected_position,
|
46
48
|
multi_selected_positions: @multi_selected_positions,
|
49
|
+
multi_select_selector: multi_select_selector,
|
47
50
|
default_color: default_color,
|
48
51
|
selected_color: selected_color,
|
49
52
|
selector: selector,
|
@@ -77,6 +80,7 @@ module Downup
|
|
77
80
|
:default_color,
|
78
81
|
:stdin,
|
79
82
|
:stdout,
|
83
|
+
:multi_select_selector,
|
80
84
|
:colonel
|
81
85
|
|
82
86
|
def process_input(input)
|
@@ -10,6 +10,7 @@ module Downup
|
|
10
10
|
selected_color: :magenta,
|
11
11
|
selector: "‣",
|
12
12
|
multi_selected_positions: [],
|
13
|
+
multi_select_selector: "√",
|
13
14
|
type: :default,
|
14
15
|
stdin: $stdout,
|
15
16
|
stdout: $stdout)
|
@@ -19,6 +20,7 @@ module Downup
|
|
19
20
|
@selected_position = selected_position
|
20
21
|
@selected_color = selected_color
|
21
22
|
@multi_selected_positions = multi_selected_positions
|
23
|
+
@multi_select_selector = multi_select_selector
|
22
24
|
@selector = selector
|
23
25
|
@type = type
|
24
26
|
@stdin = stdin
|
@@ -46,6 +48,7 @@ module Downup
|
|
46
48
|
:selector,
|
47
49
|
:default_color,
|
48
50
|
:multi_selected_positions,
|
51
|
+
:multi_select_selector,
|
49
52
|
:type,
|
50
53
|
:stdin,
|
51
54
|
:stdout,
|
@@ -73,7 +76,7 @@ module Downup
|
|
73
76
|
stdout.puts "(#{eval("selector.#{selected_color}")}) " +
|
74
77
|
eval("option_array.last.#{selected_color}")
|
75
78
|
elsif multi_selected_positions.include?(index)
|
76
|
-
stdout.puts "(#{eval("
|
79
|
+
stdout.puts "(#{eval("multi_select_selector.#{selected_color}")}) " +
|
77
80
|
eval("option_array.last.#{selected_color}")
|
78
81
|
else
|
79
82
|
stdout.print "(#{eval("option_array.first.#{default_color}")}) "
|
@@ -104,9 +107,5 @@ module Downup
|
|
104
107
|
option.is_a?(Hash) && option.has_key?("display")
|
105
108
|
}
|
106
109
|
end
|
107
|
-
|
108
|
-
def multi_selector
|
109
|
-
"•"
|
110
|
-
end
|
111
110
|
end
|
112
111
|
end
|
data/lib/downup/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: downup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Begin
|
@@ -55,7 +55,6 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- bin/console
|
57
57
|
- bin/setup
|
58
|
-
- downup-0.9.6.gem
|
59
58
|
- downup.gemspec
|
60
59
|
- examples/basic.rb
|
61
60
|
- lib/downup.rb
|
data/downup-0.9.6.gem
DELETED
Binary file
|