shellplay 0.0.5 → 0.0.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/CHANGELOG.md +8 -0
- data/bin/shellplay +10 -6
- data/bin/shellrecord +5 -4
- data/lib/shellplay/config.rb +1 -0
- data/lib/shellplay/session.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 621f7005189c515470dba44094889a9c347bc03d
|
4
|
+
data.tar.gz: 01b0252c57e3178e6639bea8b56110e797d95e4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d94a35061475ebff28fb7ed00ea52b12ff16b6fdf59831827f9099d8ece5f0125d5e43d2c8fd948b6e042b6a0be2e2fa2d58f1dadae9d50d239244e13d82e99
|
7
|
+
data.tar.gz: 412f6788ed609248916086796f21dfcce5fccf9754ac98d883f13c0eaedc916a4e24ac5183b83e339aafdc6ce1ebf2ebefd3aa31c11d1e7b38236ba2915b1fdd
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
Shellplay Changelog
|
2
2
|
=========================
|
3
3
|
|
4
|
+
v0.0.6 - 2014-08-13
|
5
|
+
--------------------
|
6
|
+
- save json session in pretty format for manual intervention
|
7
|
+
- chomp output so there is less spaces
|
8
|
+
- add a config param for setting time format on the elapsed time of last command
|
9
|
+
- fix display of playprompt
|
10
|
+
- improved styling on 'timespent' display
|
11
|
+
|
4
12
|
v0.0.5 - 2014-08-12
|
5
13
|
------------------
|
6
14
|
- add a `/` record prefix for clearscreen, works with iterm2 on mac, linux trick don't work yet
|
data/bin/shellplay
CHANGED
@@ -16,7 +16,7 @@ require 'shellplay/session'
|
|
16
16
|
continue = true
|
17
17
|
@sleeptime = 1.0/48.0
|
18
18
|
@lastelapsed = 0
|
19
|
-
@
|
19
|
+
@playprompt = true
|
20
20
|
|
21
21
|
counter = 1
|
22
22
|
def usage
|
@@ -53,6 +53,7 @@ def display(screen)
|
|
53
53
|
@lastelapsed = 0
|
54
54
|
end
|
55
55
|
print screen.stdout
|
56
|
+
@playprompt = screen.playprompt
|
56
57
|
if screen.stderr != ""
|
57
58
|
printf "\n#{Paint[screen.stderr, :red]}"
|
58
59
|
end
|
@@ -63,7 +64,8 @@ def shownext
|
|
63
64
|
display @session.current_screen
|
64
65
|
@session.next
|
65
66
|
else
|
66
|
-
|
67
|
+
print Paint["... ", :cyan]
|
68
|
+
@playprompt = false
|
67
69
|
@lastelapsed = 0
|
68
70
|
end
|
69
71
|
end
|
@@ -79,8 +81,10 @@ def show(index)
|
|
79
81
|
end
|
80
82
|
|
81
83
|
while continue do
|
82
|
-
|
83
|
-
|
84
|
+
if @playprompt
|
85
|
+
print "\n\e[33m>\e[0m "
|
86
|
+
printf("\e[33melapsed: \e[0m\e[1;93m#{@session.config.timeformat}s\e[0m ", @lastelapsed) unless @lastelapsed == 0
|
87
|
+
end
|
84
88
|
command = STDIN.gets.strip
|
85
89
|
case command
|
86
90
|
when /^(?:q|x)$/
|
@@ -97,13 +101,13 @@ while continue do
|
|
97
101
|
when ''
|
98
102
|
shownext
|
99
103
|
else
|
100
|
-
Open3.popen3(
|
104
|
+
Open3.popen3(command.strip) do |i, o, e, t|
|
101
105
|
o.read.split("\n").each do |line|
|
102
106
|
print line
|
103
107
|
sleep sleeptime
|
104
108
|
end
|
105
109
|
e.read.split("\n").each do |line|
|
106
|
-
print Paint[line, :red]
|
110
|
+
print Paint[line, :red, :bold]
|
107
111
|
end
|
108
112
|
end
|
109
113
|
end
|
data/bin/shellrecord
CHANGED
@@ -87,7 +87,7 @@ while continue do
|
|
87
87
|
'clearscreen' => clearscreen,
|
88
88
|
'customprompt' => customprompt,
|
89
89
|
'stdin' => command,
|
90
|
-
'stdout' => out,
|
90
|
+
'stdout' => out.chomp,
|
91
91
|
'stderr' => '',
|
92
92
|
'timespent' => 0
|
93
93
|
})
|
@@ -99,14 +99,15 @@ while continue do
|
|
99
99
|
err = e.read
|
100
100
|
end_time = Time.now
|
101
101
|
elapsed = end_time - start_time
|
102
|
+
stdin = displaycommand ? command : ""
|
102
103
|
session.add_screen({
|
103
104
|
'displaycommand' => displaycommand,
|
104
105
|
'playprompt' => playprompt,
|
105
106
|
'clearscreen' => clearscreen,
|
106
107
|
'customprompt' => customprompt,
|
107
|
-
'stdin' =>
|
108
|
-
'stdout' => out,
|
109
|
-
'stderr' => err,
|
108
|
+
'stdin' => stdin,
|
109
|
+
'stdout' => out.chomp,
|
110
|
+
'stderr' => err.chomp,
|
110
111
|
'timespent' => elapsed
|
111
112
|
})
|
112
113
|
out.split("\n").each do |line|
|
data/lib/shellplay/config.rb
CHANGED
@@ -16,6 +16,7 @@ module Shellplay
|
|
16
16
|
output.puts Paint['Create a new shellplay configuration:', :blue]
|
17
17
|
values['editor'] = guess 'EDITOR', 'What is the path to launch your text editor?', 'vim'
|
18
18
|
values['prompt'] = ask 'What is the default prompt you want to use?'
|
19
|
+
values['timeformat'] = ask 'What is the time format you want to display?', '%.1f'
|
19
20
|
write values
|
20
21
|
end
|
21
22
|
|
data/lib/shellplay/session.rb
CHANGED