reveal-ck 3.9.0 → 3.9.1

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: 94f1e9761ec12005539ccf53866dc6e570e21c13
4
- data.tar.gz: 99ac3d5e821c7735bb6ec639bdf76226794463d5
3
+ metadata.gz: 64bfaad3a9bb13b60207277ba7a8ea659464349d
4
+ data.tar.gz: becc438de16e043b74a15289ee79942f2af31be7
5
5
  SHA512:
6
- metadata.gz: 5930a4ecd366ba7027fdb6b8fc4e440db8ade2c3f67d39433f5f2dde74ef386e047e833b3cc2660510abc70348dda9e6ae1d65e0760e5ddb13093c7b8774312b
7
- data.tar.gz: 8d98525d33b97953d142b2d7d0e08b9c67f0d186837bace22c6be5cd252832646e82a84cf8c05f7d7e5a18a2dc6f6e568ff4f81f7363f4d207e86424bcb0309a
6
+ metadata.gz: 99a9ad2d37b3fcd3db795f2b3e02c5a3ecbe9fe2b8ec6c97c0792f622b8267c19f59e6fcde9d5b132bf648ba369ab3f481dd63a310faf8a372bf3f88a3d87bdd
7
+ data.tar.gz: 82539b535c774be2346bf135a94070e35a42cf30df22ebe49c6ea709a3597548f7d9d7157979ce76976f9f803d57c23739dd9f7beeebe85e7b3ce82a899c05bb
@@ -1,5 +1,5 @@
1
1
  notification :off
2
2
 
3
3
  guard 'livereload' do
4
- watch(%r{^slides/index.html$})
4
+ watch(%r{^<%= output_dir %>/index.html$})
5
5
  end
@@ -6,13 +6,14 @@ module RevealCK
6
6
  # rebuilding slides.
7
7
  class ListenToRebuildSlides
8
8
  attr_reader :ui, :rebuild_method
9
- def initialize(ui, &block)
9
+ def initialize(ui, slides_file, &block)
10
10
  @ui = ui
11
+ @slides_file = slides_file
11
12
  @rebuild_method = block
12
13
  end
13
14
 
14
15
  def run
15
- ::Listen.to('.', ignore: ignored_files_regex) do |mod, add, del|
16
+ ::Listen.to('.', only: slides_file_regex) do |mod, add, del|
16
17
  message_and_rebuild(mod, add, del)
17
18
  end.start
18
19
  end
@@ -26,8 +27,8 @@ module RevealCK
26
27
  ui.message("#{message}: #{file_names}", :rebuild)
27
28
  end
28
29
 
29
- def ignored_files_regex
30
- %r{^slides/.+$}
30
+ def slides_file_regex
31
+ /^#{@slides_file}$/
31
32
  end
32
33
 
33
34
  def message_and_rebuild(mod, add, del)
@@ -5,8 +5,9 @@ module RevealCK
5
5
  class ListenToReloadBrowser
6
6
  attr_reader :prefix
7
7
 
8
- def initialize(ui)
8
+ def initialize(ui, output_dir)
9
9
  @prefix = ui.prefix_for(:reload)
10
+ @output_dir = output_dir
10
11
  end
11
12
 
12
13
  def run
@@ -17,12 +18,23 @@ module RevealCK
17
18
 
18
19
  private
19
20
 
21
+ def guardfile_contents
22
+ guardfile_erb =
23
+ RevealCK.template_path('reload_Guardfile',
24
+ 'Guardfile.erb')
25
+ template = Tilt.new(guardfile_erb)
26
+ locals = {
27
+ output_dir: @output_dir
28
+ }
29
+ template.render(self, locals)
30
+ end
31
+
20
32
  def setup_and_run_guard
21
33
  require 'guard/cli'
22
34
  Guard::UI.options[:template] = "#{prefix} :message"
23
- guardfile = RevealCK.path('files/reveal-ck/Guardfile')
35
+ contents = guardfile_contents
24
36
  Thread.new do
25
- Guard.start(guardfile: guardfile, no_interactions: true)
37
+ Guard.start(guardfile_contents: contents, no_interactions: true)
26
38
  end
27
39
  end
28
40
  end
@@ -41,12 +41,12 @@ module RevealCK
41
41
 
42
42
  def listen_to_reload
43
43
  ui.message('Getting Ready to Reload Browsers.')
44
- ListenToReloadBrowser.new(ui).run
44
+ ListenToReloadBrowser.new(ui, output_dir).run
45
45
  end
46
46
 
47
47
  def listen_to_rebuild
48
48
  ui.message('Getting Ready to Rebuild Slides.')
49
- ListenToRebuildSlides.new(ui) do
49
+ ListenToRebuildSlides.new(ui, slides_file) do
50
50
  rebuild_slides
51
51
  end.run
52
52
  end
@@ -1,4 +1,4 @@
1
1
  # RevealCK::VERSION is the current version of reveal-ck
2
2
  module RevealCK
3
- VERSION = '3.9.0'.freeze
3
+ VERSION = '3.9.1'.freeze
4
4
  end
@@ -9,21 +9,22 @@ module RevealCK
9
9
  '.'
10
10
  end
11
11
 
12
- let :generated_slides do
13
- %r{^slides/.+$}
12
+ let :slides_file_regex do
13
+ /^slides.md$/
14
14
  end
15
15
 
16
16
  it 'sets up ::Listen to run when things change' do
17
17
  listener = double
18
18
  expect(::Listen)
19
19
  .to(receive(:to))
20
- .with(current_directory, ignore: generated_slides)
20
+ .with(current_directory, only: slides_file_regex)
21
21
  .once
22
22
  .and_return(listener)
23
23
  expect(listener)
24
24
  .to(receive(:start))
25
25
 
26
- ListenToRebuildSlides.new(double('ui')).run
26
+ slides_file = 'slides.md'
27
+ ListenToRebuildSlides.new(double('ui'), slides_file).run
27
28
  end
28
29
  end
29
30
  end
@@ -12,11 +12,21 @@ module RevealCK
12
12
  .to(receive(:prefix_for))
13
13
  .and_return('[prefix]')
14
14
 
15
+ output_dir = 'output_dir'
16
+
17
+ guardfile_watches_index_html_in_output_dir =
18
+ %r{watch\(\%r\{\^#{output_dir}\/index.html\$\}\)}
19
+
20
+ start_args = {
21
+ guardfile_contents: guardfile_watches_index_html_in_output_dir,
22
+ no_interactions: true
23
+ }
15
24
  expect(::Guard)
16
- .to(receive(:start))
25
+ .to(receive(:start).with(start_args))
17
26
  .once
18
27
 
19
- listen_to_reload_browser = ListenToReloadBrowser.new(serve_ui)
28
+ listen_to_reload_browser =
29
+ ListenToReloadBrowser.new(serve_ui, output_dir)
20
30
  thread = listen_to_reload_browser.run
21
31
  thread.join
22
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reveal-ck
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jed Northridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-30 00:00:00.000000000 Z
11
+ date: 2018-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docile
@@ -381,12 +381,12 @@ files:
381
381
  - features/step_definitions/serve_steps.rb
382
382
  - features/support/env.rb
383
383
  - features/support/file_management.rb
384
- - files/reveal-ck/Guardfile
385
384
  - files/reveal-ck/css/reveal-ck.css
386
385
  - files/reveal-ck/templates/index.html/body.html.erb
387
386
  - files/reveal-ck/templates/index.html/head.html.erb
388
387
  - files/reveal-ck/templates/index.html/index.html.erb
389
388
  - files/reveal-ck/templates/index.html/script.js.erb
389
+ - files/reveal-ck/templates/reload_Guardfile/Guardfile.erb
390
390
  - files/reveal-ck/templates/slides/code.slim
391
391
  - files/reveal-ck/templates/slides/image.slim
392
392
  - files/reveal-ck/templates/slides/intro.slim