shellplay 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f55dfc5a678eb16a4cb71c13f7d4f28ce7c78aa
4
- data.tar.gz: b665727c3a94d92745fbadfb97c2b3f2a814fe6c
3
+ metadata.gz: 2937f66aa7223a0f607bc613c3e0c52200adad46
4
+ data.tar.gz: 1309d48512b243a4afcf98ea869492c85295a123
5
5
  SHA512:
6
- metadata.gz: 1c2b09cd94a775e1a209d6619016e4011f5d2f7a6304e2d912fb5149a7e805be64a620099cc518e7d6a70fd303861f0b1f4053011fb1b155798df0d07c008baa
7
- data.tar.gz: a6509a8bd4e0e7552704a132e377f6c290ef3d09790b3ea40ebe83010158c0571e386f886d3441fae6d6e97d1e0683847903353beef1625b662ba063041895be
6
+ metadata.gz: 5e3d2748ef7a575673562b2c20b495f8327ed75e548e1ecedb0979fabac3afbbd37312128241ddd830a123c99a3fc085ecc9a0860901e741e3330855d0e211c8
7
+ data.tar.gz: 3be0f23a0cb1034ca0264f558bc7602f02376c6152b063e746bacb93205fe567102539bc1eb5a08c272c9c06b9db36f4eb11d4fc1e61d737e5857fb842926b31
@@ -1,6 +1,11 @@
1
1
  Shellplay Changelog
2
2
  =========================
3
3
 
4
+ v0.1.4 - 2014-08-19
5
+ -------------------
6
+ - optimize html export
7
+ - fix display of prompts in html export
8
+
4
9
  v0.1.3 - 2014-08-19
5
10
  -------------------
6
11
  - html export rudimentary but functional
data/Gemfile CHANGED
@@ -3,3 +3,4 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in shellprez.gemspec
4
4
  gemspec
5
5
 
6
+ #gem "shell2html", path: '../shell2html'
data/README.md CHANGED
@@ -103,12 +103,18 @@ To export
103
103
 
104
104
  It will save the html in a dir in `.shellplay` under the name of the session. The dir contains index.html, css, and js files, ready to be played from your laptop or uploaded to your server.
105
105
 
106
+ Navigation on the html version is
107
+
108
+ - `p`, `left` for previous screen,
109
+ - `n`, `enter` or `right` for next screen
110
+
106
111
  ## Todo
107
112
 
108
113
  - <s>handle the no-display entries</s>
114
+ - <s>when prototype is ready, switch to v0.1.0</s>
115
+ - make an html export
109
116
  - write a shell colors parser of some sort because \e[1;33m sucks
110
117
  - add a function in player to edit a screen
111
- - when prototype is ready, switch to v0.1.0
112
118
  - test coverage
113
119
  - save and load sessions from gist
114
120
  - add gist token to config or something
@@ -23,9 +23,20 @@ File.open(File.join(dest, "index.html"), 'w') do |f|
23
23
  f.puts erb.result(binding)
24
24
  end
25
25
 
26
- FileUtils.cp(File.join(tpl, 'jquery-1.11.1.min.js'), dest)
27
- FileUtils.cp(File.join(tpl, 'shellplay.js'), dest)
28
- FileUtils.cp(File.join(tpl, 'shellplay.css'), dest)
29
- File.open(File.join(dest, "colors.css"), 'w') do |f|
30
- f.puts Shell2html.css
26
+ unless File.exist? File.join(dest, 'jquery-1.11.1.min.js')
27
+ FileUtils.cp(File.join(tpl, 'jquery-1.11.1.min.js'), dest)
28
+ end
29
+
30
+ unless File.exist? File.join(dest, 'shellplay.js')
31
+ FileUtils.cp(File.join(tpl, 'shellplay.js'), dest)
32
+ end
33
+
34
+ unless File.exist? File.join(dest, 'shellplay.css')
35
+ FileUtils.cp(File.join(tpl, 'shellplay.css'), dest)
36
+ end
37
+
38
+ unless File.exist? File.join(dest, 'colors.css')
39
+ File.open(File.join(dest, "colors.css"), 'w') do |f|
40
+ f.puts Shell2html.css
41
+ end
31
42
  end
@@ -13,8 +13,12 @@
13
13
  <div class="container">
14
14
  <div class="row">
15
15
  <div class="col-md-12 main">
16
+ <div class="screen" id="intro">
17
+ <%= Shell2html.to_html("\e[33m>\e[0m Type <enter> to begin.") %>
18
+ </div>
16
19
  <% @session.sequence.each_with_index do |screen, i| %>
17
20
  <div class="screen" id="s<%= i %>">
21
+ <% if screen.displaycommand %>
18
22
  <% if screen.customprompt %>
19
23
  <%= Shell2html.to_html(screen.customprompt) %>
20
24
  <% else %>
@@ -22,10 +26,17 @@
22
26
  <% end %>
23
27
  <%= Shell2html.to_html(screen.stdin) %>
24
28
  <br>
29
+ <% end %>
25
30
  <%= Shell2html.to_html(screen.stdout) %>
26
31
  <% if screen.stderr %>
27
32
  <%= Shell2html.to_html(screen.stderr) %>
28
33
  <% end %>
34
+ <% if screen.playprompt %>
35
+ <%= Shell2html.to_html("\n\e[33m>\e[0m ") %>
36
+ <% if screen.timespent != 0 && screen.displaycommand %>
37
+ <%= Shell2html.to_html(sprintf("\e[33melapsed: \e[0m\e[1;93m#{@session.config.timeformat}s\e[0m ", screen.timespent)) %>
38
+ <% end %>
39
+ <% end %>
29
40
  </div>
30
41
  <% end %>
31
42
  </div>
@@ -21,7 +21,8 @@ body {
21
21
  border: 1px solid #848484;
22
22
  border-radius: 5px;
23
23
  box-shadow: 0 0 35px 20px #424648;
24
- overflow: hidden;
24
+ overflow-x: hidden;
25
+ overflow-y: auto;
25
26
  }
26
27
  .screen {
27
28
  margin: 30px;
@@ -23,7 +23,9 @@
23
23
  draw();
24
24
  }
25
25
 
26
- draw();
26
+ $(".screen").hide();
27
+ $("#intro").show();
28
+
27
29
 
28
30
  $(document).keydown(function(e) {
29
31
  switch(e.keyCode) {
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.1.3
4
+ version: 0.1.4
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-18 00:00:00.000000000 Z
11
+ date: 2014-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint