shellplay 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +9 -4
- data/bin/shellplay +2 -2
- data/lib/shellplay/session.rb +12 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7848531f56a521eeee8cb664f5ae436e40ebe4cf
|
4
|
+
data.tar.gz: e30a9160224d17cd9c604b48bff2d8b6704360da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53ee1a566f70b28eaf8ba0df1faef969524d506cca770a469f0f71034b0c59152e994722f112c65ea688ed37c2f1c008a7e21c0d5adb402a2a2b233a29b0774f
|
7
|
+
data.tar.gz: 432664080117d2040c5349d70c13eb0f275528ea0ce13fa6c1330ea8181d7fc842eddb6bc15703420ddf6d6c60f45445919b40e39912e46ed8ff096585d83090
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Shellplay Changelog
|
2
2
|
=========================
|
3
3
|
|
4
|
+
v0.0.11 - 2014-08-14
|
5
|
+
------------------
|
6
|
+
- made possible to open a remote json file with `shellplay http://example.com/something.json`
|
7
|
+
- moved config vars (prompt and timeformat) to session file
|
8
|
+
|
4
9
|
v0.0.10 - 2014-08-13
|
5
10
|
-------------------
|
6
11
|
- added a `shellcat` command to merge sessions
|
data/README.md
CHANGED
@@ -19,29 +19,34 @@ For recording a session
|
|
19
19
|
|
20
20
|
shellrecord
|
21
21
|
|
22
|
-
Then type the commands you want to record,
|
22
|
+
Then type the commands you want to record, and type `q` at the end it will prompt you for a file name and a title.
|
23
23
|
|
24
24
|
The session file is stored in `$HOME/.shellplay/` in json format and can be used to be played.
|
25
25
|
|
26
|
-
You can record a session in several steps, and merge then
|
26
|
+
You can record a session in several steps, and merge then afterwards, with
|
27
27
|
|
28
28
|
shellcat session1 session2 session3
|
29
29
|
|
30
30
|
You will be prompted to provide a new title and a new name, and it will save the new concatenated session file.
|
31
31
|
|
32
|
-
The session file being a pretty-formatted
|
32
|
+
The session file being a pretty-formatted json file, it's also convenient to just edit it for fixes or adjustments. Especially as this tool is still in development and all the optimal edit features are not yet implemented.
|
33
33
|
|
34
34
|
## Playing a session
|
35
35
|
|
36
36
|
For playing
|
37
37
|
|
38
38
|
shellplay <session_file_name>
|
39
|
+
shellplay <remote session url>
|
40
|
+
|
41
|
+
For example
|
42
|
+
|
43
|
+
shellplay https://raw.githubusercontent.com/mose/20140814-dokku/master/dokku-full.json
|
39
44
|
|
40
45
|
or just
|
41
46
|
|
42
47
|
shellplay
|
43
48
|
|
44
|
-
If you don't specify the name of the session, all locally available sessions will be displayed and you will be asked to
|
49
|
+
If you don't specify the name of the session, all locally available sessions will be displayed and you will be asked to choose one.
|
45
50
|
|
46
51
|
Then type enter to go next, or `?` to display list of available commands.
|
47
52
|
|
data/bin/shellplay
CHANGED
@@ -42,7 +42,7 @@ def display(screen)
|
|
42
42
|
if screen.customprompt
|
43
43
|
print screen.customprompt
|
44
44
|
else
|
45
|
-
print @session.config.prompt
|
45
|
+
print @session.prompt || @session.config.prompt
|
46
46
|
end
|
47
47
|
sleep @sleeptime
|
48
48
|
print screen.stdin
|
@@ -93,7 +93,7 @@ end
|
|
93
93
|
while continue do
|
94
94
|
if @playprompt
|
95
95
|
print "\n\e[33m>\e[0m "
|
96
|
-
printf("\e[33melapsed: \e[0m\e[1;93m#{@session.config.timeformat}s\e[0m ", @lastelapsed) unless @lastelapsed == 0
|
96
|
+
printf("\e[33melapsed: \e[0m\e[1;93m#{@session.timeformat || @session.config.timeformat}s\e[0m ", @lastelapsed) unless @lastelapsed == 0
|
97
97
|
end
|
98
98
|
command = STDIN.gets.strip
|
99
99
|
case command
|
data/lib/shellplay/session.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "cliprompt"
|
2
2
|
require "json"
|
3
|
+
require "open-uri"
|
3
4
|
|
4
5
|
require "shellplay/config"
|
5
6
|
require "shellplay/screen"
|
@@ -9,11 +10,13 @@ module Shellplay
|
|
9
10
|
|
10
11
|
include Cliprompt
|
11
12
|
|
12
|
-
attr_reader :title, :config, :pointer, :sequence
|
13
|
+
attr_reader :title, :config, :pointer, :sequence, :prompt, :timeformat
|
13
14
|
|
14
15
|
def initialize(input = STDIN, output = STDOUT)
|
15
16
|
@sequence = []
|
16
17
|
@title = false
|
18
|
+
@prompt = false
|
19
|
+
@timeformat = false
|
17
20
|
@config = Shellplay::Config.new(nil, input, output)
|
18
21
|
@pointer = 0
|
19
22
|
end
|
@@ -22,9 +25,15 @@ module Shellplay
|
|
22
25
|
name ||= ask "What session do you want to load?",
|
23
26
|
aslist: true,
|
24
27
|
choices: Dir.glob(File.join(@config.basedir, '*.json')).map { |f| File.basename(f, '.json') }
|
25
|
-
|
26
|
-
|
28
|
+
if /^https?:\/\//.match name
|
29
|
+
infile = open(name) { |f| f.read }
|
30
|
+
else
|
31
|
+
infile = IO.read(File.join(@config.basedir, "#{name}.json"))
|
32
|
+
end
|
33
|
+
data = JSON.parse(infile)
|
27
34
|
@title = data['title']
|
35
|
+
@prompt = data['prompt']
|
36
|
+
@timeformat = data['timeformat']
|
28
37
|
data['sequence'].each do |screenhash|
|
29
38
|
add_screen(screenhash)
|
30
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shellplay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paint
|