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 +4 -4
- data/files/reveal-ck/{Guardfile → templates/reload_Guardfile/Guardfile.erb} +1 -1
- data/lib/reveal-ck/commands/listen_to_rebuild_slides.rb +5 -4
- data/lib/reveal-ck/commands/listen_to_reload_browser.rb +15 -3
- data/lib/reveal-ck/commands/serve.rb +2 -2
- data/lib/reveal-ck/version.rb +1 -1
- data/spec/lib/reveal-ck/commands/listen_to_rebuild_slides_spec.rb +5 -4
- data/spec/lib/reveal-ck/commands/listen_to_reload_browser_spec.rb +12 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64bfaad3a9bb13b60207277ba7a8ea659464349d
|
4
|
+
data.tar.gz: becc438de16e043b74a15289ee79942f2af31be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99a9ad2d37b3fcd3db795f2b3e02c5a3ecbe9fe2b8ec6c97c0792f622b8267c19f59e6fcde9d5b132bf648ba369ab3f481dd63a310faf8a372bf3f88a3d87bdd
|
7
|
+
data.tar.gz: 82539b535c774be2346bf135a94070e35a42cf30df22ebe49c6ea709a3597548f7d9d7157979ce76976f9f803d57c23739dd9f7beeebe85e7b3ce82a899c05bb
|
@@ -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('.',
|
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
|
30
|
-
|
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
|
-
|
35
|
+
contents = guardfile_contents
|
24
36
|
Thread.new do
|
25
|
-
Guard.start(
|
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
|
data/lib/reveal-ck/version.rb
CHANGED
@@ -9,21 +9,22 @@ module RevealCK
|
|
9
9
|
'.'
|
10
10
|
end
|
11
11
|
|
12
|
-
let :
|
13
|
-
|
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,
|
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
|
-
|
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 =
|
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.
|
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
|
+
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
|