reveal-ck 3.4.0 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/reveal-ck +4 -0
- data/features/step_definitions/serve_steps.rb +3 -2
- data/lib/reveal-ck/commands/print_banner.rb +4 -3
- data/lib/reveal-ck/commands/serve.rb +4 -3
- data/lib/reveal-ck/commands/start_web_server.rb +4 -2
- data/lib/reveal-ck/version.rb +1 -1
- data/spec/lib/reveal-ck/commands/print_banner_spec.rb +2 -1
- data/spec/lib/reveal-ck/commands/serve_spec.rb +2 -1
- data/spec/lib/reveal-ck/commands/start_web_server_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: 700f151b2efad7591e5ee3640a78c2f2790bbf7b
|
4
|
+
data.tar.gz: dbba1d4ca370e5b5174c8a5fcb7dd8b47632a6c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5c1599f7ce5133c88397c93287cde6653151f400abf79ae6a984d6768092473d24326ede93f74994d4a648cd020f6ac0615447f0341bda141fdb2e7aa647a2f
|
7
|
+
data.tar.gz: 648f9c9768d2e7e2aa2e484a27ae6a814feb6de138a67329034041218e9a74a1b08685b3b93077949865ca41ef6d56322c31523a8cdc184770e443d60df6be1d
|
data/bin/reveal-ck
CHANGED
@@ -59,6 +59,9 @@ class RevealCKExecutable
|
|
59
59
|
c.desc 'The port to serve on'
|
60
60
|
c.flag [:p, :port], default_value: 10_000
|
61
61
|
|
62
|
+
c.desc 'The host to serve on'
|
63
|
+
c.flag [:h, :host], default_value: 'localhost'
|
64
|
+
|
62
65
|
c.desc 'Exit after starting + n seconds (for testing only)'
|
63
66
|
c.flag ['test-quit-after-starting'], type: Integer
|
64
67
|
|
@@ -69,6 +72,7 @@ class RevealCKExecutable
|
|
69
72
|
gem_dir: RevealCK.path,
|
70
73
|
output_dir: slides_dir,
|
71
74
|
port: options[:port],
|
75
|
+
host: options[:host],
|
72
76
|
slides_file: options[:file],
|
73
77
|
user_dir: Dir.pwd
|
74
78
|
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
When(/^I temporarily start reveal\-ck serve$/) do
|
1
|
+
When(/^I temporarily start reveal\-ck serve with host "(.*?)"$/) do |host|
|
2
2
|
port = 10_000 + rand(1000)
|
3
|
-
|
3
|
+
cmd = "reveal-ck serve --port #{port} --host #{host}"
|
4
|
+
run("#{cmd} --test-quit-after-starting 2")
|
4
5
|
end
|
@@ -4,10 +4,11 @@ module RevealCK
|
|
4
4
|
# sent explain everything to do with the serve command (listening,
|
5
5
|
# reloading, and webserving)
|
6
6
|
class PrintBanner
|
7
|
-
attr_reader :doc_root, :port, :slides_file, :ui
|
8
|
-
def initialize(doc_root, port, slides_file, ui)
|
7
|
+
attr_reader :doc_root, :port, :host, :slides_file, :ui
|
8
|
+
def initialize(doc_root, port, host, slides_file, ui)
|
9
9
|
@doc_root = doc_root
|
10
10
|
@port = port
|
11
|
+
@host = host
|
11
12
|
@slides_file = slides_file
|
12
13
|
@ui = ui
|
13
14
|
end
|
@@ -15,7 +16,7 @@ module RevealCK
|
|
15
16
|
def run
|
16
17
|
ui.separator
|
17
18
|
ui.message "Serving up slide content in '#{doc_root}/'."
|
18
|
-
ui.message "Open your browser to 'http
|
19
|
+
ui.message "Open your browser to 'http://#{host}:#{port}'."
|
19
20
|
ui.message 'Press CTRL-C to stop.'
|
20
21
|
ui.separator
|
21
22
|
end
|
@@ -6,12 +6,13 @@ module RevealCK
|
|
6
6
|
# This includes taking an action and managing stdout
|
7
7
|
class Serve
|
8
8
|
include Retrieve
|
9
|
-
attr_reader :doc_root, :port
|
9
|
+
attr_reader :doc_root, :port, :host
|
10
10
|
attr_reader :slides_file, :user_dir, :gem_dir, :output_dir
|
11
11
|
attr_reader :ui
|
12
12
|
def initialize(args)
|
13
13
|
@doc_root = retrieve(:doc_root, args)
|
14
14
|
@port = retrieve(:port, args)
|
15
|
+
@host = retrieve(:host, args)
|
15
16
|
@slides_file = retrieve(:slides_file, args)
|
16
17
|
@gem_dir = retrieve(:gem_dir, args)
|
17
18
|
@output_dir = retrieve(:output_dir, args)
|
@@ -35,7 +36,7 @@ module RevealCK
|
|
35
36
|
private
|
36
37
|
|
37
38
|
def print_banner
|
38
|
-
PrintBanner.new(doc_root, port, slides_file, ui).run
|
39
|
+
PrintBanner.new(doc_root, port, host, slides_file, ui).run
|
39
40
|
end
|
40
41
|
|
41
42
|
def listen_to_reload
|
@@ -52,7 +53,7 @@ module RevealCK
|
|
52
53
|
|
53
54
|
def start_web_server
|
54
55
|
ui.message('Starting Webserver.')
|
55
|
-
StartWebServer.new(doc_root, port).run
|
56
|
+
StartWebServer.new(doc_root, port, host).run
|
56
57
|
end
|
57
58
|
|
58
59
|
def rebuild_options
|
@@ -6,14 +6,16 @@ module RevealCK
|
|
6
6
|
module Commands
|
7
7
|
# The idea of starting up a webserver to display slides locally.
|
8
8
|
class StartWebServer
|
9
|
-
attr_reader :doc_root, :port
|
10
|
-
def initialize(doc_root, port)
|
9
|
+
attr_reader :doc_root, :port, :host
|
10
|
+
def initialize(doc_root, port, host)
|
11
11
|
@doc_root = doc_root
|
12
12
|
@port = port
|
13
|
+
@host = host
|
13
14
|
end
|
14
15
|
|
15
16
|
def run
|
16
17
|
Rack::Server.new(app: build_rack_app(doc_root),
|
18
|
+
Host: host,
|
17
19
|
Port: port,
|
18
20
|
Logger: server_log,
|
19
21
|
DoNotReverseLookup: true,
|
data/lib/reveal-ck/version.rb
CHANGED
@@ -5,6 +5,7 @@ def build_serve
|
|
5
5
|
RevealCK::Commands::Serve
|
6
6
|
.new(doc_root: 'doc_root',
|
7
7
|
port: 'port',
|
8
|
+
host: 'host',
|
8
9
|
user_dir: 'user_dir',
|
9
10
|
gem_dir: 'gem_dir',
|
10
11
|
output_dir: 'output_dir',
|
@@ -74,7 +75,7 @@ module RevealCK
|
|
74
75
|
print_banner = double
|
75
76
|
expect(PrintBanner)
|
76
77
|
.to(receive(:new))
|
77
|
-
.with('doc_root', 'port', 'slides_file', serve_ui)
|
78
|
+
.with('doc_root', 'port', 'host', 'slides_file', serve_ui)
|
78
79
|
.and_return(print_banner)
|
79
80
|
expect(print_banner)
|
80
81
|
.to(receive(:run))
|
@@ -7,7 +7,7 @@ module RevealCK
|
|
7
7
|
describe '#run' do
|
8
8
|
it 'works with Rack to start an application' do
|
9
9
|
start_web_server =
|
10
|
-
StartWebServer.new('doc_root', 'port')
|
10
|
+
StartWebServer.new('doc_root', 'port', 'host')
|
11
11
|
rack_server = double
|
12
12
|
expect(::Rack::Server)
|
13
13
|
.to(receive(:new))
|
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.
|
4
|
+
version: 3.5.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:
|
11
|
+
date: 2017-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docile
|