shellplay 0.0.5 → 0.0.6

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: 491a3d029d1bdb1e7157cd28b55056ff02f93f30
4
- data.tar.gz: 1359b3988d567ad789711a0fdacde95238822c03
3
+ metadata.gz: 621f7005189c515470dba44094889a9c347bc03d
4
+ data.tar.gz: 01b0252c57e3178e6639bea8b56110e797d95e4e
5
5
  SHA512:
6
- metadata.gz: 1b7b3cf450b2f7b5f40028ef00e5795eaad3323a39cfd804e4ce4c7f207ee50904ebe3a705c13bf0a6e59029d72c1fcf73de9c6899902e451f98b591d7a3f8b3
7
- data.tar.gz: 7d53e72b160c7b00c4fab117bd8e61478e54bb1c5b2d0284256a9001f979ab1c9cf185ef6fa69b867816f8a17df26c2c4d28b755ff4356fce0f42fc06b93575c
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
- @noplayprompt = false
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
- puts "You are at the end of the session."
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
- print "\n\e[36m>\e[0m " if @playprompt
83
- print "\e[35melapsed: #{@lastelapsed}s\e[0m " unless @lastelapsed == 0
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("bash","-l","-c",command.strip) do |i, o, e, t|
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' => command,
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|
@@ -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
 
@@ -61,7 +61,7 @@ module Shellplay
61
61
  h[:sequence] = @sequence.map(&:export)
62
62
  outfile = File.join(@config.basedir, "#{@name}.json")
63
63
  File.open(outfile, 'w') do |f|
64
- f.write JSON.dump(h)
64
+ f.write JSON.pretty_generate(h)
65
65
  end
66
66
  end
67
67
 
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - mose