shellplay 0.0.12 → 0.0.13
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 +7 -0
- data/README.md +4 -1
- data/bin/shellplay +6 -4
- data/bin/shellrecord +3 -0
- data/lib/shellplay/config.rb +1 -3
- data/lib/shellplay/session.rb +13 -3
- 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: 3be4372cef7b451d4d2f6ea2661de6e7e70ef2e2
|
4
|
+
data.tar.gz: 5269f1ac75a28271e2a5c802390a3daa236e5950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d7d350e8063e277d1ff9b3d19bae272db9d38c6a7121e4e88022f67d27d2d6bf706cc05a5d623d200264d74cc82795752175dd1dca1351e7104123e10942596
|
7
|
+
data.tar.gz: f246ce479c9a94bd228203c2c91016399ad9f999cf006a5eb6e6a64329a75c70a00c03cf436ea7fd79fd3bfddbe8fd5de81ddac07261bf347862ee9c53a0fa5f
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
Shellplay Changelog
|
2
2
|
=========================
|
3
3
|
|
4
|
+
v0.0.13 - 2014-08-15
|
5
|
+
-----------------
|
6
|
+
- add a `x` command in recorder to cancel a record
|
7
|
+
- add a default prompt at config creation
|
8
|
+
- improve the session selection menu to include remote recording
|
9
|
+
- add a 'type enter to begin' at the first screen
|
10
|
+
|
4
11
|
v0.0.12 - 2014-08-15
|
5
12
|
-----------------
|
6
13
|
- fix recorder to take account of `cd` properly
|
data/README.md
CHANGED
data/bin/shellplay
CHANGED
@@ -90,11 +90,9 @@ def show(index)
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
print "\n\e[33m>\e[0m Type <enter> to begin."
|
94
|
+
|
93
95
|
while continue do
|
94
|
-
if @playprompt
|
95
|
-
print "\n\e[33m>\e[0m "
|
96
|
-
printf("\e[33melapsed: \e[0m\e[1;93m#{@session.timeformat || @session.config.timeformat}s\e[0m ", @lastelapsed) unless @lastelapsed == 0
|
97
|
-
end
|
98
96
|
command = STDIN.gets.strip
|
99
97
|
case command
|
100
98
|
when /^(?:q|x)$/
|
@@ -127,4 +125,8 @@ while continue do
|
|
127
125
|
puts Paint[e.message, :red, :bold]
|
128
126
|
end
|
129
127
|
end
|
128
|
+
if @playprompt
|
129
|
+
print "\n\e[33m>\e[0m "
|
130
|
+
printf("\e[33melapsed: \e[0m\e[1;93m#{@session.timeformat || @session.config.timeformat}s\e[0m ", @lastelapsed) unless @lastelapsed == 0
|
131
|
+
end
|
130
132
|
end
|
data/bin/shellrecord
CHANGED
data/lib/shellplay/config.rb
CHANGED
@@ -8,8 +8,6 @@ module Shellplay
|
|
8
8
|
include Cliprompt
|
9
9
|
|
10
10
|
def initialize(options = nil, input = STDIN, output = STDOUT)
|
11
|
-
confdir = File.join(ENV['HOME'], '.shellplay')
|
12
|
-
FileUtils::mkdir_p confdir unless Dir.exist? confdir
|
13
11
|
super(options = nil, input = STDIN, output = STDOUT)
|
14
12
|
end
|
15
13
|
|
@@ -22,7 +20,7 @@ module Shellplay
|
|
22
20
|
values = {}
|
23
21
|
output.puts Paint['Create a new shellplay configuration:', :blue]
|
24
22
|
values['editor'] = guess 'EDITOR', 'What is the path to launch your text editor?', 'vim'
|
25
|
-
values['prompt'] = ask 'What is the default prompt you want to use?'
|
23
|
+
values['prompt'] = ask 'What is the default prompt you want to use?', "\e[36m #{ENV['USER']} > \e[0m"
|
26
24
|
values['timeformat'] = ask 'What is the time format you want to display?', '%.1f'
|
27
25
|
write values
|
28
26
|
end
|
data/lib/shellplay/session.rb
CHANGED
@@ -22,9 +22,19 @@ module Shellplay
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def import(name)
|
25
|
-
name
|
26
|
-
|
27
|
-
|
25
|
+
unless name
|
26
|
+
sessions = Dir.glob(File.join(@config.basedir, '*.json'))
|
27
|
+
if sessions.count == 0
|
28
|
+
puts "There is no recorded session locally."
|
29
|
+
puts "Do you want to play a remote recording?"
|
30
|
+
name = ask "url: "
|
31
|
+
else
|
32
|
+
puts "What session do you want to load?"
|
33
|
+
name = ask "(input a number or an url if you want to play a remote recording)",
|
34
|
+
aslist: true,
|
35
|
+
choices: sessions.map { |f| File.basename(f, '.json') }
|
36
|
+
end
|
37
|
+
end
|
28
38
|
if /^https?:\/\//.match name
|
29
39
|
infile = open(name) { |f| f.read }
|
30
40
|
else
|