reveal-ck 3.0.1 → 3.1.0
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/templates/index.html/head.html.erb +2 -1
- data/lib/reveal-ck/commands/listen_to_rebuild_slides.rb +3 -2
- data/lib/reveal-ck/commands/print_banner.rb +3 -1
- data/lib/reveal-ck/commands/start_web_server.rb +2 -1
- data/lib/reveal-ck/commands/thread_waker.rb +2 -1
- data/lib/reveal-ck/config.rb +5 -4
- data/lib/reveal-ck/presentation.rb +6 -3
- data/lib/reveal-ck/presentation_dsl.rb +3 -1
- data/lib/reveal-ck/templates/processor.rb +4 -2
- data/lib/reveal-ck/version.rb +1 -1
- data/spec/lib/reveal-ck/builders/index_html_spec.rb +13 -0
- data/spec/lib/reveal-ck/commands/listen_to_rebuild_slides_spec.rb +1 -1
- data/spec/lib/reveal-ck/config_spec.rb +9 -0
- data/spec/lib/reveal-ck/templates/processor_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59fa7e933639f0da930a31f71e84254bb9d3bee6
|
4
|
+
data.tar.gz: 29efbba155e601845b9c0b92ac2d9fbe5da2a8c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0afaad9b2c6330e0002d53062fc9d391ec982723af5166d822ce786d70ff13af2ded8d56c17b50504aa51c58ded38cbfdfe4e16b2ab7d56b65b823f07dbc09cb
|
7
|
+
data.tar.gz: c954437737b835917e0d6fad45b70e247867ba16cf889f7a2849c18e4024b2aa9ce5e7cfa15f5febc0405a9da6beedecb298dd9441c212a3e698fcb1f5859e8c
|
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
<title><%= config.title %></title>
|
4
4
|
|
5
|
-
<meta name="description" content="
|
5
|
+
<meta name="description" content="<%= config.description %>">
|
6
6
|
<meta name="author" content="<%= config.author %>">
|
7
|
+
<meta name="generator" content="reveal-ck <%= RevealCK::VERSION %>">
|
7
8
|
|
8
9
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
9
10
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
@@ -7,7 +7,8 @@ module RevealCK
|
|
7
7
|
class ListenToRebuildSlides
|
8
8
|
attr_reader :ui, :rebuild_method
|
9
9
|
def initialize(ui, &block)
|
10
|
-
@ui
|
10
|
+
@ui = ui
|
11
|
+
@rebuild_method = block
|
11
12
|
end
|
12
13
|
|
13
14
|
def run
|
@@ -25,7 +26,7 @@ module RevealCK
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def ignored_files_regex
|
28
|
-
|
29
|
+
%r{^slides/.+$}
|
29
30
|
end
|
30
31
|
|
31
32
|
def message_and_rebuild(mod, add, del)
|
@@ -6,7 +6,9 @@ module RevealCK
|
|
6
6
|
class PrintBanner
|
7
7
|
attr_reader :doc_root, :port, :slides_file, :ui
|
8
8
|
def initialize(doc_root, port, slides_file, ui)
|
9
|
-
@doc_root
|
9
|
+
@doc_root = doc_root
|
10
|
+
@port = port
|
11
|
+
@slides_file = slides_file
|
10
12
|
@ui = ui
|
11
13
|
end
|
12
14
|
|
@@ -3,7 +3,8 @@ module RevealCK
|
|
3
3
|
# Utility that wakes up a thread periodically
|
4
4
|
class ThreadWaker
|
5
5
|
def initialize(thread_to_wake, wait_period = 1)
|
6
|
-
@thread_to_wake
|
6
|
+
@thread_to_wake = thread_to_wake
|
7
|
+
@wait_period = wait_period
|
7
8
|
end
|
8
9
|
|
9
10
|
def run
|
data/lib/reveal-ck/config.rb
CHANGED
@@ -22,10 +22,11 @@ module RevealCK
|
|
22
22
|
|
23
23
|
def core_defaults
|
24
24
|
{
|
25
|
-
'title'
|
26
|
-
'
|
27
|
-
'
|
28
|
-
'
|
25
|
+
'title' => 'Slides',
|
26
|
+
'description' => '',
|
27
|
+
'author' => '',
|
28
|
+
'theme' => 'black',
|
29
|
+
'transition' => 'default',
|
29
30
|
'data' => {
|
30
31
|
|
31
32
|
}
|
@@ -28,7 +28,8 @@ module RevealCK
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def self.from_template(args)
|
31
|
-
file
|
31
|
+
file = retrieve(:file, args)
|
32
|
+
config = retrieve(:config, args)
|
32
33
|
presentation = Presentation.new config: config
|
33
34
|
template = Templates::Processor.open(file: file, config: config)
|
34
35
|
presentation.html = template.output
|
@@ -36,12 +37,14 @@ module RevealCK
|
|
36
37
|
end
|
37
38
|
|
38
39
|
def self.from_dsl(args)
|
39
|
-
file
|
40
|
+
file = retrieve(:file, args)
|
41
|
+
config = retrieve(:config, args)
|
40
42
|
RevealCK::PresentationDSL.load file: file, config: config
|
41
43
|
end
|
42
44
|
|
43
45
|
def self.load(args)
|
44
|
-
file
|
46
|
+
file = retrieve(:file, args)
|
47
|
+
config = retrieve(:config, args)
|
45
48
|
if file.end_with? '.rb'
|
46
49
|
Presentation.from_dsl file: file, config: config
|
47
50
|
else
|
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
module RevealCK
|
2
3
|
#
|
3
4
|
# Public: A PresentationDSL defines the DSL behind a
|
@@ -64,7 +65,8 @@ module RevealCK
|
|
64
65
|
end
|
65
66
|
|
66
67
|
def self.load(args)
|
67
|
-
file
|
68
|
+
file = retrieve(:file, args)
|
69
|
+
config = retrieve(:config, args)
|
68
70
|
builder = PresentationDSL.new config: config
|
69
71
|
contents = File.open(file).read
|
70
72
|
builder.instance_eval(contents)
|
@@ -15,7 +15,8 @@ module RevealCK
|
|
15
15
|
attr_reader :config
|
16
16
|
|
17
17
|
def initialize(args)
|
18
|
-
|
18
|
+
@config = retrieve(:config, args)
|
19
|
+
file = retrieve(:file, args)
|
19
20
|
@template = Tilt.new file
|
20
21
|
end
|
21
22
|
|
@@ -25,7 +26,8 @@ module RevealCK
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def self.open(args)
|
28
|
-
file
|
29
|
+
file = retrieve(:file, args)
|
30
|
+
config = retrieve(:config, args)
|
29
31
|
Processor.new(file: file, config: config)
|
30
32
|
end
|
31
33
|
end
|
data/lib/reveal-ck/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module RevealCK
|
4
|
+
VERSION = '1.0'
|
5
|
+
|
4
6
|
module Builders
|
5
7
|
describe IndexHtml do
|
6
8
|
let :index_html_erb do
|
@@ -15,6 +17,7 @@ module RevealCK
|
|
15
17
|
let :config do
|
16
18
|
config = Config.new
|
17
19
|
config.title = 'Sample Title'
|
20
|
+
config.description = 'Sample Description'
|
18
21
|
config.author = 'Sample Author'
|
19
22
|
config.theme = 'night'
|
20
23
|
config.transition = 'page'
|
@@ -41,11 +44,21 @@ module RevealCK
|
|
41
44
|
.to include('<html lang="en">')
|
42
45
|
end
|
43
46
|
|
47
|
+
it 'prints the program name and version in the generator tag' do
|
48
|
+
expect(rendered_content)
|
49
|
+
.to include('<meta name="generator" content="reveal-ck 1.0">')
|
50
|
+
end
|
51
|
+
|
44
52
|
it 'supports replacing the configured title' do
|
45
53
|
expect(rendered_content)
|
46
54
|
.to include('<title>Sample Title</title>')
|
47
55
|
end
|
48
56
|
|
57
|
+
it 'support replacing the configured description' do
|
58
|
+
expect(rendered_content)
|
59
|
+
.to include('<meta name="description" content="Sample Description">')
|
60
|
+
end
|
61
|
+
|
49
62
|
it 'supports replacing the configured author' do
|
50
63
|
expect(rendered_content)
|
51
64
|
.to include('<meta name="author" content="Sample Author">')
|
@@ -34,6 +34,15 @@ module RevealCK
|
|
34
34
|
expect(config.title).to eq 'My Presentation'
|
35
35
|
end
|
36
36
|
|
37
|
+
it 'supplies a default description' do
|
38
|
+
expect(config.description).to eq ''
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'supplies a #description, and #description=' do
|
42
|
+
config.description = 'My beautiful slides'
|
43
|
+
expect(config.description).to eq 'My beautiful slides'
|
44
|
+
end
|
45
|
+
|
37
46
|
it 'supplies a default transition' do
|
38
47
|
expect(config.transition).to eq 'default'
|
39
48
|
end
|
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.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jed Northridge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docile
|