downup 0.8.6 → 0.9.6
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 +4 -4
- data/README.md +2 -2
- data/downup-0.8.6.gem +0 -0
- data/examples/basic.rb +3 -2
- data/lib/downup.rb +11 -7
- data/lib/downup/version.rb +1 -1
- metadata +3 -3
- data/downup-0.8.5.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: f842e61e8bd58bae4db8fc93580498fcc5798e8a
|
|
4
|
+
data.tar.gz: 24295105184635b519fc1e952e88963fe1bb811f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 746815cffd6a3d4fec7882595794dab2a05b84675eb214614068bb871aeb5ce43d108ec656b3effd1eeb201bc2a33095c2de3ea5e34557c1d4bb8167723e1733
|
|
7
|
+
data.tar.gz: 67821fe72ea37dd0945bf74fbb7dda269ae644721e3c95a8c1e944ff82be62cf0a1cf63fe4ebed8432dce6c5eafb45450960b566851bba09b2810738ae87a334
|
data/README.md
CHANGED
|
@@ -32,8 +32,8 @@ options = [
|
|
|
32
32
|
|
|
33
33
|
Downup::Base.new(options: options).prompt
|
|
34
34
|
|
|
35
|
-
# You can also pass a
|
|
36
|
-
Downup::Base.new(options: options,
|
|
35
|
+
# You can also pass a flash message and color when initializing
|
|
36
|
+
Downup::Base.new(options: options, flash_color: :green, flash_message: "Animals: \n").prompt
|
|
37
37
|
|
|
38
38
|
# you can pass a callable header
|
|
39
39
|
# to print out before the menu
|
data/downup-0.8.6.gem
ADDED
|
Binary file
|
data/examples/basic.rb
CHANGED
|
@@ -11,7 +11,7 @@ puts Downup::Base.new(options: options).prompt
|
|
|
11
11
|
|
|
12
12
|
puts Downup::Base.new(
|
|
13
13
|
options: options,
|
|
14
|
-
|
|
14
|
+
header_proc: -> { "Choose an Animal: \n" }
|
|
15
15
|
).prompt
|
|
16
16
|
|
|
17
17
|
def header
|
|
@@ -22,7 +22,8 @@ end
|
|
|
22
22
|
|
|
23
23
|
puts Downup::Base.new(
|
|
24
24
|
options: options,
|
|
25
|
-
|
|
25
|
+
flash_message: "Choose an Animal: \n",
|
|
26
|
+
flash_color: :red,
|
|
26
27
|
header_proc: method(:header)
|
|
27
28
|
).prompt
|
|
28
29
|
|
data/lib/downup.rb
CHANGED
|
@@ -8,7 +8,8 @@ module Downup
|
|
|
8
8
|
|
|
9
9
|
class Base
|
|
10
10
|
def initialize(options:,
|
|
11
|
-
|
|
11
|
+
flash_message: nil,
|
|
12
|
+
flash_color: :green,
|
|
12
13
|
default_color: :brown,
|
|
13
14
|
selected_color: :magenta,
|
|
14
15
|
selector: "‣",
|
|
@@ -17,7 +18,8 @@ module Downup
|
|
|
17
18
|
header_proc: Proc.new {})
|
|
18
19
|
|
|
19
20
|
@options = options
|
|
20
|
-
@
|
|
21
|
+
@flash_color = flash_color
|
|
22
|
+
@flash_message = flash_message
|
|
21
23
|
@default_color = default_color
|
|
22
24
|
@selected_color = selected_color
|
|
23
25
|
@selector = selector
|
|
@@ -31,7 +33,7 @@ module Downup
|
|
|
31
33
|
@selected_position = position_selector(position)
|
|
32
34
|
colonel.system("clear")
|
|
33
35
|
header_proc.call
|
|
34
|
-
|
|
36
|
+
print_flash
|
|
35
37
|
Downup::OptionsPrinter.new(
|
|
36
38
|
options: options,
|
|
37
39
|
selected_position: @selected_position,
|
|
@@ -47,7 +49,8 @@ module Downup
|
|
|
47
49
|
private
|
|
48
50
|
|
|
49
51
|
attr_reader :options,
|
|
50
|
-
:
|
|
52
|
+
:flash_message,
|
|
53
|
+
:flash_color,
|
|
51
54
|
:selected_position,
|
|
52
55
|
:header_proc,
|
|
53
56
|
:selected_color,
|
|
@@ -103,9 +106,10 @@ module Downup
|
|
|
103
106
|
else position; end
|
|
104
107
|
end
|
|
105
108
|
|
|
106
|
-
def
|
|
107
|
-
return if
|
|
108
|
-
|
|
109
|
+
def print_flash
|
|
110
|
+
return if flash_message.nil?
|
|
111
|
+
colored_flash = "\"#{flash_message}\".#{flash_color}"
|
|
112
|
+
stdout.puts eval(colored_flash)
|
|
109
113
|
end
|
|
110
114
|
|
|
111
115
|
def read_char
|
data/lib/downup/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: downup
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Begin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-08-
|
|
11
|
+
date: 2015-08-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -55,7 +55,7 @@ files:
|
|
|
55
55
|
- Rakefile
|
|
56
56
|
- bin/console
|
|
57
57
|
- bin/setup
|
|
58
|
-
- downup-0.8.
|
|
58
|
+
- downup-0.8.6.gem
|
|
59
59
|
- downup.gemspec
|
|
60
60
|
- examples/basic.rb
|
|
61
61
|
- lib/downup.rb
|
data/downup-0.8.5.gem
DELETED
|
Binary file
|