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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50ea069f025c5ee5ccdd082820621d10885549b9
4
- data.tar.gz: 7a985a5e14de1a7322681559149e73610c04f5c5
3
+ metadata.gz: 63d7f26b086ddbde4f3a21cb2ec9c81303669b04
4
+ data.tar.gz: af8cb68e73047c496b68980eacfe67e1f778bbf8
5
5
  SHA512:
6
- metadata.gz: 096cefcf1988f3cec67893fcbd73fa5069c8c9887bc04be862f3ba961f2e5ca811cf441a33c7bc6130f678d564c2a8fb294e460a9e358fe7a9b83d3e15968d97
7
- data.tar.gz: 7e96431cae385f47bb5354621501221bcf88736a5f94f168607e2a84cb694a3f21c44e7e95b3490518f9383860494c8654ebf2f5b93d64c58e0c11a136e74ae5
6
+ metadata.gz: 9ac0ce0d0356e55f869e258902b864e065b62dae42bc570fd54ba4adde9fc9b71621beba1e7b28177a01ab343407e134f7e0b6a3ad30842edfe5b26f235fb42d
7
+ data.tar.gz: 37220a831740dc68870a37ae1610c26403c35009a31b98a70ab677a895b8fa38508c7c2c7fffb1992f15e6fd6e4efbba92db4f3a1d737bccbf123d99aff0b90a
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
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
@@ -66,4 +66,9 @@ options = {
66
66
  "e" => "Eel"
67
67
  }
68
68
 
69
- Downup::Base.new(options: options, type: :multi_select).prompt
69
+ Downup::Base.new(
70
+ options: options,
71
+ type: :multi_select,
72
+ multi_select_selector: "X",
73
+ selected_color: :red
74
+ ).prompt
@@ -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 = options
24
- @flash_color = flash_color
25
- @flash_message = flash_message
26
- @default_color = default_color
27
- @selected_color = selected_color
28
- @selector = selector
29
- @type = type
30
- @header_proc = header_proc
31
- @stdin = stdin
32
- @stdout = stdout
33
- @colonel = Kernel
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("multi_selector.#{selected_color}")}) " +
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
@@ -1,3 +1,3 @@
1
1
  module Downup
2
- VERSION = "0.10.6"
2
+ VERSION = "0.11.6"
3
3
  end
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.10.6
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
Binary file