deckrb 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/bin/deck +11 -2
- data/lib/deck/rack_app.rb +1 -1
- data/lib/deck/slide.rb +2 -1
- data/lib/deck/version.rb +1 -1
- data/spec/rack_app_spec.rb +7 -2
- metadata +131 -85
data/README.md
CHANGED
@@ -148,6 +148,7 @@ and you'll get a web server running on `http://localhost:4333` serving up a slid
|
|
148
148
|
* PDF
|
149
149
|
* rewrite internal links to files and serve them relative to current dir, not slide dir
|
150
150
|
* custom `.css`, `.scss`, and `.js` files, which will get imported into all slides
|
151
|
+
* support some more extensions https://github.com/imakewebthings/deck.js/wiki
|
151
152
|
|
152
153
|
## TODO (community)
|
153
154
|
|
data/bin/deck
CHANGED
@@ -3,9 +3,18 @@
|
|
3
3
|
here = File.expand_path(File.dirname(__FILE__))
|
4
4
|
$: << File.join(here, '..', 'lib')
|
5
5
|
|
6
|
+
require "trollop"
|
6
7
|
require "rack"
|
7
8
|
require "deck"
|
8
9
|
require "deck/rack_app"
|
10
|
+
require "deck/version"
|
11
|
+
|
12
|
+
options = Trollop.options do
|
13
|
+
version "deck v#{Deck::VERSION}"
|
14
|
+
banner version
|
15
|
+
banner "Usage: deck [options] run [slides]"
|
16
|
+
opt :port, "Specify alternate port", :default => 4333
|
17
|
+
end
|
9
18
|
|
10
19
|
command = ARGV.shift
|
11
20
|
|
@@ -21,7 +30,7 @@ when 'build'
|
|
21
30
|
basename ||= File.basename(arg, ".md")
|
22
31
|
output_path ||= "#{output_dir}/#{basename}.html"
|
23
32
|
|
24
|
-
slides += Slide.from_file arg
|
33
|
+
slides += Slide.from_file arg
|
25
34
|
end
|
26
35
|
|
27
36
|
File.open(output_path, "w") do |file|
|
@@ -35,7 +44,7 @@ when 'run'
|
|
35
44
|
# Fix Rack bug https://github.com/rack/rack/issues/301
|
36
45
|
require 'deck/rack_static_patch'
|
37
46
|
|
38
|
-
port =
|
47
|
+
port = options[:port]
|
39
48
|
slide_files = ARGV
|
40
49
|
Rack::Handler.default.run Deck::RackApp.build(slide_files), :Port => port
|
41
50
|
|
data/lib/deck/rack_app.rb
CHANGED
@@ -54,7 +54,7 @@ module Deck
|
|
54
54
|
@file_servers =
|
55
55
|
[Rack::File.new("#{::Deck::RackApp.app_root}/public")] +
|
56
56
|
@slide_files.map do |slide_file|
|
57
|
-
File.expand_path File.dirname(slide_file) if slide_file.is_a? File
|
57
|
+
File.expand_path File.dirname(slide_file.path) if slide_file.is_a? File
|
58
58
|
end.compact.uniq.map do |slide_file_dir|
|
59
59
|
Rack::File.new(slide_file_dir)
|
60
60
|
end
|
data/lib/deck/slide.rb
CHANGED
@@ -7,8 +7,9 @@ module Deck
|
|
7
7
|
|
8
8
|
include Deck::Noko
|
9
9
|
|
10
|
-
# todo: test this method
|
10
|
+
# todo: test this method on its own
|
11
11
|
def self.from_file markdown_file
|
12
|
+
markdown_file = markdown_file.path if markdown_file.is_a? File # fix for Ruby 1.8.7
|
12
13
|
split File.read(markdown_file)
|
13
14
|
end
|
14
15
|
|
data/lib/deck/version.rb
CHANGED
data/spec/rack_app_spec.rb
CHANGED
@@ -46,8 +46,13 @@ module Deck
|
|
46
46
|
it "serves up deck.js source files" do
|
47
47
|
deckjs_core_path = "deck.js/core/deck.core.js"
|
48
48
|
get "/#{deckjs_core_path}"
|
49
|
-
|
50
|
-
|
49
|
+
path = "#{here}/../public/#{deckjs_core_path}"
|
50
|
+
expected_body = begin
|
51
|
+
File.read(path, :encoding => last_response.body.encoding)
|
52
|
+
rescue NoMethodError # fix for Ruby 1.8.7
|
53
|
+
File.read(path)
|
54
|
+
end
|
55
|
+
assert { last_response.body == expected_body }
|
51
56
|
end
|
52
57
|
|
53
58
|
it "finds coderay.css" do
|
metadata
CHANGED
@@ -1,104 +1,147 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: deckrb
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Alex Chaffee
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2012-02-29 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
22
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3107287963
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 9
|
30
|
+
- 0
|
31
|
+
- pre
|
32
|
+
- 1
|
21
33
|
version: 0.9.0.pre1
|
22
|
-
type: :runtime
|
23
34
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
35
|
+
requirement: *id001
|
36
|
+
name: erector
|
37
|
+
type: :runtime
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
28
40
|
none: false
|
29
|
-
requirements:
|
41
|
+
requirements:
|
30
42
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 7
|
45
|
+
segments:
|
46
|
+
- 2
|
47
|
+
version: "2"
|
48
|
+
prerelease: false
|
49
|
+
requirement: *id002
|
50
|
+
name: redcarpet
|
33
51
|
type: :runtime
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
34
62
|
prerelease: false
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
63
|
+
requirement: *id003
|
37
64
|
name: rack
|
38
|
-
|
65
|
+
type: :runtime
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
39
68
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
prerelease: false
|
77
|
+
requirement: *id004
|
78
|
+
name: trollop
|
44
79
|
type: :runtime
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
45
90
|
prerelease: false
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
91
|
+
requirement: *id005
|
48
92
|
name: nokogiri
|
49
|
-
requirement: &70106368068280 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
93
|
type: :runtime
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
56
104
|
prerelease: false
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
105
|
+
requirement: *id006
|
59
106
|
name: coderay
|
60
|
-
requirement: &70106368067860 !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
|
-
requirements:
|
63
|
-
- - ! '>='
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version: '0'
|
66
107
|
type: :runtime
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
67
118
|
prerelease: false
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
119
|
+
requirement: *id007
|
70
120
|
name: json
|
71
|
-
requirement: &70106368067440 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
|
-
requirements:
|
74
|
-
- - ! '>='
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
121
|
type: :runtime
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
version: "0"
|
78
132
|
prerelease: false
|
79
|
-
|
80
|
-
- !ruby/object:Gem::Dependency
|
133
|
+
requirement: *id008
|
81
134
|
name: rack-codehighlighter
|
82
|
-
requirement: &70106368067020 !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
|
-
requirements:
|
85
|
-
- - ! '>='
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '0'
|
88
135
|
type: :runtime
|
89
|
-
|
90
|
-
version_requirements: *70106368067020
|
91
|
-
description: deck.js (http://imakewebthings.github.com/deck.js) is a JavaScript library
|
92
|
-
for building slide presentations using HTML 5. deck.rb (http://github.com/alexch/deck.rb)
|
93
|
-
builds on top of deck.js, adding some features and letting you focus on your slides,
|
94
|
-
not the HTML infrastructure.
|
136
|
+
description: deck.js (http://imakewebthings.github.com/deck.js) is a JavaScript library for building slide presentations using HTML 5. deck.rb (http://github.com/alexch/deck.rb) builds on top of deck.js, adding some features and letting you focus on your slides, not the HTML infrastructure.
|
95
137
|
email: alex@stinky.com
|
96
|
-
executables:
|
138
|
+
executables:
|
97
139
|
- deck
|
98
140
|
extensions: []
|
99
|
-
|
141
|
+
|
142
|
+
extra_rdoc_files:
|
100
143
|
- README.md
|
101
|
-
files:
|
144
|
+
files:
|
102
145
|
- lib/deck/noko.rb
|
103
146
|
- lib/deck/rack_app.rb
|
104
147
|
- lib/deck/rack_static_patch.rb
|
@@ -183,35 +226,38 @@ files:
|
|
183
226
|
- bin/deck
|
184
227
|
homepage: http://github.com/alexch/deck
|
185
228
|
licenses: []
|
229
|
+
|
186
230
|
post_install_message:
|
187
231
|
rdoc_options: []
|
188
|
-
|
232
|
+
|
233
|
+
require_paths:
|
189
234
|
- lib
|
190
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
235
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
191
236
|
none: false
|
192
|
-
requirements:
|
193
|
-
- -
|
194
|
-
- !ruby/object:Gem::Version
|
195
|
-
|
196
|
-
segments:
|
237
|
+
requirements:
|
238
|
+
- - ">="
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
hash: 3
|
241
|
+
segments:
|
197
242
|
- 0
|
198
|
-
|
199
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
243
|
+
version: "0"
|
244
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
245
|
none: false
|
201
|
-
requirements:
|
202
|
-
- -
|
203
|
-
- !ruby/object:Gem::Version
|
204
|
-
|
205
|
-
segments:
|
246
|
+
requirements:
|
247
|
+
- - ">="
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
hash: 3
|
250
|
+
segments:
|
206
251
|
- 0
|
207
|
-
|
252
|
+
version: "0"
|
208
253
|
requirements: []
|
254
|
+
|
209
255
|
rubyforge_project:
|
210
|
-
rubygems_version: 1.8.
|
256
|
+
rubygems_version: 1.8.15
|
211
257
|
signing_key:
|
212
258
|
specification_version: 3
|
213
259
|
summary: Make HTML slide shows; wraps deck.js
|
214
|
-
test_files:
|
260
|
+
test_files:
|
215
261
|
- spec/javascripts/support/jasmine_config.rb
|
216
262
|
- spec/javascripts/support/jasmine_runner.rb
|
217
263
|
- spec/rack_app_spec.rb
|