showoff 0.13.1 → 0.13.2

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: 7a500763400a9b53499d748a5128aad932228638
4
- data.tar.gz: 34570d4eb7bbd84cbccac8d61b7fd44ebf1b47ee
3
+ metadata.gz: 5ea96eb5e4bf1886cb16471125acfb7750c50425
4
+ data.tar.gz: 617dde95b0f92b1029a267f354941a34d8d6a411
5
5
  SHA512:
6
- metadata.gz: 706412e299a95a4d67d6de1ae9f5c9f66042c073905f237a1bb6bb33c392e14e5bc6664066a22743309401e83ad5e02cd346f788555edb884412e807557503d3
7
- data.tar.gz: 50f32ce8a733aa0f7866671f4c05c4273f050161be8a4836ee58eaacef5af53a618da3c0f3eadaec3924e676682351c15b36ddc842b333eedb32228caa8fabf3
6
+ metadata.gz: 23a7ba04e6ff1456a986799fe5fdbf50f161752fed18c2998975e47b81d3edb61777fe3509bea3bb3f80a33772c2a1a3ea4b56817b0660fcab27ac0c2f064f44
7
+ data.tar.gz: 8bce9a117fe1097e54071daefad9cc5be3d25a3775d60c43e7e12df4d5e6ec6fbbc4ba494ee66ee6158cf48ef590e7afd25a052ecde11b60e68374660f1bb6a7
data/Rakefile CHANGED
@@ -1,11 +1,38 @@
1
+ require 'fileutils'
2
+
1
3
  task :default do
2
4
  system("rake -T")
3
5
  end
4
6
 
7
+ def version
8
+ `git describe --tags --abbrev=0`.chomp.sub('v','')
9
+ end
10
+
11
+ def next_version(type = :patch)
12
+ section = [:major,:minor,:patch].index type
13
+
14
+ n = version.split '.'
15
+ n[section] = n[section].to_i + 1
16
+ n.join '.'
17
+ end
18
+
19
+ desc "Build Docker image"
20
+ task 'docker' do
21
+ Dir.chdir('build') do
22
+ system("docker build -t binford2k/showoff:#{version} -t binford2k/showoff:latest .")
23
+ end
24
+ puts
25
+ puts 'Start container with: docker run -p 9090:9090 binford2k/showoff'
26
+ end
27
+
28
+ desc "Upload image to Docker Hub"
29
+ task 'docker:push' => ['docker'] do
30
+ system("docker push binford2k/showoff:#{version}")
31
+ system("docker push binford2k/showoff:latest")
32
+ end
33
+
5
34
  desc "Build HTML documentation"
6
35
  task :doc do
7
- require 'fileutils'
8
-
9
36
  FileUtils.rm_rf('doc')
10
37
  Dir.chdir('documentation') do
11
38
  system("rdoc --main -HOME.rdoc /*.rdoc --op ../doc")
@@ -14,8 +41,6 @@ end
14
41
 
15
42
  desc "Update docs for webpage"
16
43
  task 'doc:website' => [:doc] do
17
- require 'fileutils'
18
-
19
44
  if system('git checkout gh-pages')
20
45
  FileUtils.rm_rf('documentation')
21
46
  FileUtils.mv('doc', 'documentation')
data/bin/showoff CHANGED
@@ -146,7 +146,7 @@ command :serve do |c|
146
146
  c.switch [:r, :review]
147
147
 
148
148
  c.desc 'Enable remote code execution'
149
- c.switch [:x, :executecode]
149
+ c.switch [:x, :execute, :executecode]
150
150
 
151
151
  c.desc 'Run in standalone mode, with no audience interaction'
152
152
  c.switch [:S, :standalone]
@@ -175,6 +175,9 @@ command :serve do |c|
175
175
  c.default_value "showoff.json"
176
176
  c.flag [:f, :file, :pres_file]
177
177
 
178
+ c.desc 'Git URL to a repository containing the presentation'
179
+ c.flag [:u, :url]
180
+
178
181
  c.action do |global_options,options,args|
179
182
 
180
183
  # This is gross. A serious revamp in config file parsing is due.
@@ -190,6 +193,15 @@ command :serve do |c|
190
193
  options[:ssl_private_key] ||= config['ssl_private_key']
191
194
  options[:standalone] ||= config['standalone']
192
195
 
196
+ options[:pres_dir] = args[0]
197
+ options[:port] = options[:port].to_i
198
+
199
+ ssl_options = {
200
+ :cert_chain_file => options[:ssl_certificate],
201
+ :private_key_file => options[:ssl_private_key],
202
+ :verify_peer => false,
203
+ }
204
+
193
205
  protocol = options[:ssl] ? 'https' : 'http'
194
206
  host = options[:host] == '0.0.0.0' ? 'localhost' : options[:host]
195
207
  url = "#{protocol}://#{host}:#{options[:p].to_i}"
@@ -206,26 +218,22 @@ To run it from presenter view, go to: [ #{url}/presenter ]
206
218
 
207
219
  "
208
220
 
209
- ShowOff.run!( :host => options[:host],
210
- :port => options[:port].to_i,
211
- :pres_file => options[:file],
212
- :pres_dir => args[0],
213
- :verbose => options[:verbose],
214
- :review => options[:review],
215
- :execute => options[:executecode],
216
- :nocache => options[:nocache],
217
- :bind => options[:host],
218
- :standalone => options[:standalone],
219
- ) do |server|
220
- if options[:ssl]
221
- ssl_options = {
222
- :cert_chain_file => options[:ssl_certificate],
223
- :private_key_file => options[:ssl_private_key],
224
- :verify_peer => false,
225
- }
226
-
227
- server.ssl = true
228
- server.ssl_options = ssl_options
221
+ if options[:url]
222
+ ShowOffUtils.clone(options[:url], options[:verbose]) do
223
+ ShowOff.run!(options) do |server|
224
+ if options[:ssl]
225
+ server.ssl = true
226
+ server.ssl_options = ssl_options
227
+ end
228
+ end
229
+ end
230
+
231
+ else
232
+ ShowOff.run!(options) do |server|
233
+ if options[:ssl]
234
+ server.ssl = true
235
+ server.ssl_options = ssl_options
236
+ end
229
237
  end
230
238
  end
231
239
 
@@ -1,3 +1,3 @@
1
1
  # No namespace here since ShowOff is a class and I'd have to inherit from
2
2
  # Sinatra::Application (which we don't want to load here)
3
- SHOWOFF_VERSION = '0.13.1'
3
+ SHOWOFF_VERSION = '0.13.2'
data/lib/showoff.rb CHANGED
@@ -88,8 +88,8 @@ class ShowOff < Sinatra::Application
88
88
  settings.showoff_config = showoff_json
89
89
 
90
90
  # Set options for encoding, template and page size
91
- settings.encoding = showoff_json["encoding"]
92
- settings.page_size = showoff_json["page-size"] || "Letter"
91
+ settings.encoding = showoff_json["encoding"] || 'UTF-8'
92
+ settings.page_size = showoff_json["page-size"] || "Letter"
93
93
  settings.pres_template = showoff_json["templates"]
94
94
  end
95
95
 
data/lib/showoff_utils.rb CHANGED
@@ -204,6 +204,20 @@ class ShowOffUtils
204
204
  `git update-ref refs/heads/gh-pages #{commit_sha}`
205
205
  end
206
206
 
207
+ # clone a repo url, then run a provided block
208
+ def self.clone(url, verbose=false)
209
+ require 'tmpdir'
210
+ Dir.mktmpdir do |dir|
211
+ Dir.chdir dir do
212
+ puts "Cloning presentation repository to #{dir}..." if verbose
213
+ system('git', 'clone', '--depth', '1', url, '.')
214
+
215
+ yield if block_given?
216
+ end
217
+ end
218
+
219
+ end
220
+
207
221
  # Makes a slide as a string.
208
222
  # [title] title of the slide
209
223
  # [classes] any "classes" to include, such as 'smaller', 'transition', etc.
@@ -543,7 +543,40 @@ img#disconnected {
543
543
  padding: 0;
544
544
  }
545
545
 
546
- /* Add a Shell "code highlighting" style to resemble the look of a terminal window. */
546
+ /* Add Console "code highlighting" styles to resemble the look of a terminal window. */
547
+ pre.highlight code.language-console {
548
+ background: #222;
549
+ background: url(titlebar/left.png) left top no-repeat, url(titlebar/right.png) right top no-repeat, url(titlebar/center.png) center top repeat-x #222;
550
+ color: #63de00;
551
+ padding: 30px 0.5em 0.5em;
552
+ border: 1px solid #acacac;
553
+ border-radius: 6px;
554
+ border-top-left-radius: 12px;
555
+ border-top-right-radius: 12px;
556
+ box-shadow: 0px 0px 10px #acacac;
557
+ overflow: hidden;
558
+ }
559
+
560
+ pre.highlight code.language-powershellconsole {
561
+ background: rgb(1, 36, 86);
562
+ background: url(titlebar/powershell-controls.png) right top no-repeat, url(titlebar/powershell.png) left top repeat-x rgb(1, 36, 86);
563
+ color: rgb(238, 237, 240);
564
+ padding: 32px 0.5em 0.5em;
565
+ border: 6px solid rgb(102, 202, 234);
566
+ border-top: 2px solid rgb(102, 202, 234);
567
+ border-radius: 4px;
568
+ overflow: hidden;
569
+ }
570
+
571
+ pre.highlight code.language-console.nochrome,
572
+ pre.highlight code.language-powershellconsole.nochrome {
573
+ background-image: none;
574
+ border-width: 1px;
575
+ padding: 0.5em;
576
+ border-radius: 4px;
577
+ }
578
+
579
+ /* to avoid breaking changes */
547
580
  .highlight .language-shell {
548
581
  display: block;
549
582
  background-color: #222;
@@ -553,6 +586,8 @@ img#disconnected {
553
586
  overflow: hidden;
554
587
  }
555
588
 
589
+
590
+
556
591
  /**********************************
557
592
  *** code execution ***
558
593
  **********************************/
Binary file
Binary file
Binary file
Binary file
@@ -138,6 +138,9 @@ function openSlave()
138
138
  slaveWindow.presenterView = window;
139
139
  slaveWindow.mode = { track: false, slave: true, follow: false };
140
140
 
141
+ // Add a class to differentiate from the audience view
142
+ slaveWindow.document.getElementById("preso").className = 'display';
143
+
141
144
  $('#slaveWindow').addClass('enabled');
142
145
  }
143
146
  catch(e) {
data/public/js/showoff.js CHANGED
@@ -1148,6 +1148,7 @@ function toggleDebug () {
1148
1148
 
1149
1149
  function reloadSlides () {
1150
1150
  if (confirm('Are you sure you want to reload the slides?')) {
1151
+ location.reload(true);
1151
1152
  loadSlides(loadSlidesBool, loadSlidesPrefix, true);
1152
1153
  showSlide();
1153
1154
  }
data/views/header.erb CHANGED
@@ -39,6 +39,7 @@
39
39
  setupPreso(<%= @slides.nil? ? "true" : "false"%>, '<%= @asset_path %>');
40
40
  });
41
41
 
42
+ editUrl = "<%= @edit %>";
42
43
  interactive = <%= @interactive %>;
43
44
 
44
45
  keymap = <%= JSON.pretty_generate @keymap %>;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-01 00:00:00.000000000 Z
11
+ date: 2016-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -319,6 +319,11 @@ files:
319
319
  - public/css/presenter.css
320
320
  - public/css/showoff.css
321
321
  - public/css/spinner_bar.gif
322
+ - public/css/titlebar/center.png
323
+ - public/css/titlebar/left.png
324
+ - public/css/titlebar/powershell-controls.png
325
+ - public/css/titlebar/powershell.png
326
+ - public/css/titlebar/right.png
322
327
  - public/favicon.ico
323
328
  - public/js/TimeCircles.js
324
329
  - public/js/coffee-script.js
@@ -332,7 +337,7 @@ files:
332
337
  - public/js/jquery.parsequery.min.js
333
338
  - public/js/presenter.js
334
339
  - public/js/showoff.js
335
- homepage: http://github.com/puppetlabs/showoff
340
+ homepage: https://puppetlabs.github.io/showoff
336
341
  licenses:
337
342
  - MIT
338
343
  metadata: {}