shellplay 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39699fdb96d41ece0aac692ab591f4ac4ac0a7c6
4
- data.tar.gz: b3749683977e0bcedce2cde2741cf9be37cd17c4
3
+ metadata.gz: 3be4372cef7b451d4d2f6ea2661de6e7e70ef2e2
4
+ data.tar.gz: 5269f1ac75a28271e2a5c802390a3daa236e5950
5
5
  SHA512:
6
- metadata.gz: 4ca057f38b7f7b9a2ca37ba3462173e73252d7b644536bf4e56260985c099ddc4b85201f319b735aa491a4b0eb9f31fb01b61372cd44b6c51fee0258a85cd93c
7
- data.tar.gz: 64a96b31b6fee9a27295fef342a170cca0d560ed0669f933a1605a359e9d6a4bea4018a9ff0c9fd4e19b64b9e3e7aaee968d50259b4b435ed078b6297c1a6d86
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
@@ -41,7 +41,10 @@ d
41
41
  will delete last recorded screen
42
42
 
43
43
  q
44
- finishes the recording
44
+ finishes the recording and saves
45
+
46
+ x
47
+ ends the recording without saving
45
48
 
46
49
  <enter>
47
50
  will introduce a blank screen
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
@@ -26,6 +26,9 @@ while continue do
26
26
  session.save
27
27
  puts "\nRecord ended.\n"
28
28
  continue = false
29
+ when 'x'
30
+ puts "\nRecord cancelled.\n"
31
+ continue = false
29
32
  when "d"
30
33
  if session.pointer == 0
31
34
  puts "There is no screen to delete."
@@ -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
@@ -22,9 +22,19 @@ module Shellplay
22
22
  end
23
23
 
24
24
  def import(name)
25
- name ||= ask "What session do you want to load?",
26
- aslist: true,
27
- choices: Dir.glob(File.join(@config.basedir, '*.json')).map { |f| File.basename(f, '.json') }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shellplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - mose