cigarette 2.1 → 2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cigarette.rb +18 -8
- metadata +4 -4
data/lib/cigarette.rb
CHANGED
@@ -7,7 +7,7 @@ require 'cigarette/rvm'
|
|
7
7
|
class Cigarette
|
8
8
|
include Colors
|
9
9
|
|
10
|
-
VERSION = "2.
|
10
|
+
VERSION = "2.2"
|
11
11
|
# Hope.
|
12
12
|
CANCER_DO_NOT_APPEAR = 42
|
13
13
|
|
@@ -45,7 +45,7 @@ class Cigarette
|
|
45
45
|
Curses.clear
|
46
46
|
display_menu
|
47
47
|
display(0,0, "cigarette - Version #{VERSION}")
|
48
|
-
display(4, 8,
|
48
|
+
display(4, 8, status, color)
|
49
49
|
padding_for_time = 8 + status.length
|
50
50
|
display(4, padding_for_time," - #{time.strftime("%T")}")
|
51
51
|
display(4, 0, "STATUS:")
|
@@ -61,6 +61,7 @@ class Cigarette
|
|
61
61
|
case Curses.getch
|
62
62
|
when Curses::Key::RIGHT then move_right
|
63
63
|
when Curses::Key::LEFT then move_left
|
64
|
+
when ?r then rebuild
|
64
65
|
when ?q then onsig
|
65
66
|
end
|
66
67
|
end
|
@@ -141,6 +142,19 @@ class Cigarette
|
|
141
142
|
}
|
142
143
|
end
|
143
144
|
|
145
|
+
def rebuild
|
146
|
+
@current_rb = @rubies[@pos]
|
147
|
+
@outputs[@current_rb] = RVM.run(@current_rb) { @command }
|
148
|
+
out = @outputs[@current_rb]
|
149
|
+
display_main_screen(out[:status], out[:output], out[:time], out[:color])
|
150
|
+
end
|
151
|
+
|
152
|
+
def move
|
153
|
+
@current_rb = @rubies[@pos]
|
154
|
+
out = @outputs[@rubies[@pos]]
|
155
|
+
display_main_screen(out[:status], out[:output], out[:time], out[:color])
|
156
|
+
end
|
157
|
+
|
144
158
|
def inc_pos
|
145
159
|
if @pos == @rubies.length - 1
|
146
160
|
@pos = 0
|
@@ -151,9 +165,7 @@ class Cigarette
|
|
151
165
|
|
152
166
|
def move_right
|
153
167
|
inc_pos
|
154
|
-
|
155
|
-
out = @outputs[@rubies[@pos]]
|
156
|
-
display_main_screen(out[:status], out[:output], out[:time], out[:color])
|
168
|
+
move
|
157
169
|
end
|
158
170
|
|
159
171
|
def dec_pos
|
@@ -166,9 +178,7 @@ class Cigarette
|
|
166
178
|
|
167
179
|
def move_left
|
168
180
|
dec_pos
|
169
|
-
|
170
|
-
out = @outputs[@rubies[@pos]]
|
171
|
-
display_main_screen(out[:status], out[:output], out[:time], out[:color])
|
181
|
+
move
|
172
182
|
end
|
173
183
|
|
174
184
|
def onsig(sig = nil)
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cigarette
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: "2.
|
8
|
+
- 2
|
9
|
+
version: "2.2"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Thibaut Deloffre
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-12-
|
17
|
+
date: 2012-12-31 00:00:00 Z
|
18
18
|
dependencies: []
|
19
19
|
|
20
20
|
description: Tiny test tool
|