rabbit 1.0.9 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/GPL +19 -20
  2. data/Rakefile +25 -10
  3. data/bin/rabbit +20 -844
  4. data/bin/rabbit-command +25 -36
  5. data/bin/rabbit-slide +22 -0
  6. data/bin/rabbit-theme +22 -0
  7. data/bin/rabbit-theme-manager +30 -30
  8. data/data/account.kou.gpg +0 -0
  9. data/data/locale/en/LC_MESSAGES/rabbit.mo +0 -0
  10. data/data/locale/fr/LC_MESSAGES/rabbit.mo +0 -0
  11. data/data/locale/ja/LC_MESSAGES/rabbit.mo +0 -0
  12. data/doc/_config.yml +8 -0
  13. data/doc/_includes/en.menu.html +8 -0
  14. data/doc/_includes/ja.menu.html +8 -0
  15. data/doc/_layouts/en.html +19 -16
  16. data/doc/_layouts/ja.html +19 -16
  17. data/doc/_plugins/converters/rd.rb +1 -1
  18. data/doc/_plugins/support_symlink.rb +11 -0
  19. data/doc/en/development.rd +2 -2
  20. data/doc/en/how-to-make/index.rd +5 -5
  21. data/doc/en/how-to-make/rd.rd +1 -1
  22. data/doc/en/index.rd +6 -12
  23. data/doc/en/sample/index.rd +3 -3
  24. data/doc/en/slides.rd +2 -0
  25. data/doc/en/usage.rd +14 -356
  26. data/doc/en/usage/rabbit.rd +360 -0
  27. data/doc/en/users.rd +3 -1
  28. data/doc/images/screenshots/en/blue-circle-raw.png +0 -0
  29. data/doc/images/screenshots/en/blue-circle.png +0 -0
  30. data/doc/images/screenshots/en/clear-blue-raw.png +0 -0
  31. data/doc/images/screenshots/en/clear-blue.png +0 -0
  32. data/doc/images/screenshots/en/cozmixng-raw.png +0 -0
  33. data/doc/images/screenshots/en/cozmixng.png +0 -0
  34. data/doc/images/screenshots/en/dark-gradation-raw.png +0 -0
  35. data/doc/images/screenshots/en/dark-gradation.png +0 -0
  36. data/doc/images/screenshots/en/day-white.png +0 -0
  37. data/doc/images/screenshots/en/debian-raw.png +0 -0
  38. data/doc/images/screenshots/en/debian.png +0 -0
  39. data/doc/images/screenshots/en/green-circle-raw.png +0 -0
  40. data/doc/images/screenshots/en/green-circle.png +0 -0
  41. data/doc/images/screenshots/en/night-black.png +0 -0
  42. data/doc/images/screenshots/en/rabbit-raw.png +0 -0
  43. data/doc/images/screenshots/en/rabbit.png +0 -0
  44. data/doc/images/screenshots/en/ranguba-raw.png +0 -0
  45. data/doc/images/screenshots/en/ranguba.png +0 -0
  46. data/doc/images/screenshots/en/red-frame-raw.png +0 -0
  47. data/doc/images/screenshots/en/red-frame.png +0 -0
  48. data/doc/images/screenshots/en/ruby-gnome2-raw.png +0 -0
  49. data/doc/images/screenshots/en/ruby-gnome2.png +0 -0
  50. data/doc/images/screenshots/en/rubykaigi2011-raw.png +0 -0
  51. data/doc/images/screenshots/en/rubykaigi2011.png +0 -0
  52. data/doc/images/screenshots/ja/blue-circle-raw.png +0 -0
  53. data/doc/images/screenshots/ja/blue-circle.png +0 -0
  54. data/doc/images/screenshots/ja/clear-blue-raw.png +0 -0
  55. data/doc/images/screenshots/ja/clear-blue.png +0 -0
  56. data/doc/images/screenshots/ja/cozmixng-raw.png +0 -0
  57. data/doc/images/screenshots/ja/cozmixng.png +0 -0
  58. data/doc/images/screenshots/ja/dark-gradation-raw.png +0 -0
  59. data/doc/images/screenshots/ja/dark-gradation.png +0 -0
  60. data/doc/images/screenshots/ja/day-white.png +0 -0
  61. data/doc/images/screenshots/ja/debian-raw.png +0 -0
  62. data/doc/images/screenshots/ja/debian.png +0 -0
  63. data/doc/images/screenshots/ja/green-circle-raw.png +0 -0
  64. data/doc/images/screenshots/ja/green-circle.png +0 -0
  65. data/doc/images/screenshots/ja/night-black.png +0 -0
  66. data/doc/images/screenshots/ja/rabbit-raw.png +0 -0
  67. data/doc/images/screenshots/ja/rabbit.png +0 -0
  68. data/doc/images/screenshots/ja/ranguba-raw.png +0 -0
  69. data/doc/images/screenshots/ja/ranguba.png +0 -0
  70. data/doc/images/screenshots/ja/red-frame-raw.png +0 -0
  71. data/doc/images/screenshots/ja/red-frame.png +0 -0
  72. data/doc/images/screenshots/ja/ruby-gnome2-raw.png +0 -0
  73. data/doc/images/screenshots/ja/ruby-gnome2.png +0 -0
  74. data/doc/images/screenshots/ja/rubykaigi2011-raw.png +0 -0
  75. data/doc/images/screenshots/ja/rubykaigi2011.png +0 -0
  76. data/doc/index.html.en +1 -1
  77. data/doc/index.html.ja +1 -1
  78. data/doc/ja/about.rd +3 -3
  79. data/doc/ja/development.rd +2 -2
  80. data/doc/ja/how-to-make/index.rd +5 -5
  81. data/doc/ja/index.rd +10 -16
  82. data/doc/ja/install/macports.rd +1 -1
  83. data/doc/ja/news.rd +4 -4
  84. data/doc/ja/sample/index.rd +3 -3
  85. data/doc/ja/usage.rd +13 -358
  86. data/doc/ja/usage/rabbit.rd +362 -0
  87. data/doc/ja/users.rd +1 -1
  88. data/lib/rabbit/action.rb +2 -2
  89. data/lib/rabbit/author-configuration.rb +73 -0
  90. data/lib/rabbit/canvas.rb +0 -14
  91. data/lib/rabbit/command/rabbit-slide.rb +571 -0
  92. data/lib/rabbit/command/rabbit-theme.rb +381 -0
  93. data/lib/rabbit/command/rabbit.rb +898 -0
  94. data/lib/rabbit/config.rb +40 -0
  95. data/lib/rabbit/console.rb +124 -55
  96. data/lib/rabbit/gem-finder.rb +61 -0
  97. data/lib/rabbit/gettext.rb +6 -79
  98. data/lib/rabbit/html/generator.rb +1 -0
  99. data/lib/rabbit/image.rb +1 -1
  100. data/lib/rabbit/logger.rb +12 -2
  101. data/lib/rabbit/logger/base.rb +33 -32
  102. data/lib/rabbit/logger/stderr.rb +1 -1
  103. data/lib/rabbit/menu.rb +1 -1
  104. data/lib/rabbit/parser.rb +2 -0
  105. data/lib/rabbit/parser/ext/image.rb +14 -20
  106. data/lib/rabbit/path-manipulatable.rb +40 -0
  107. data/lib/rabbit/rabbit.rb +18 -8
  108. data/lib/rabbit/renderer/base.rb +3 -4
  109. data/lib/rabbit/renderer/color.rb +0 -1
  110. data/lib/rabbit/slideshare.rb +116 -0
  111. data/lib/rabbit/source/base.rb +1 -1
  112. data/lib/rabbit/stock.rb +1 -1
  113. data/lib/rabbit/task.rb +18 -0
  114. data/lib/rabbit/task/slide.rb +162 -0
  115. data/lib/rabbit/task/theme.rb +122 -0
  116. data/lib/rabbit/theme-browser/tree.rb +1 -1
  117. data/lib/rabbit/theme/applier.rb +9 -0
  118. data/lib/rabbit/theme/background-image-toolkit/background-image-toolkit.rb +1 -2
  119. data/lib/rabbit/theme/blue-bar/blue-bar.rb +0 -11
  120. data/lib/rabbit/theme/clear-blue/clear-blue.rb +0 -11
  121. data/lib/rabbit/theme/cozmixng/cozmixng.rb +0 -11
  122. data/lib/rabbit/theme/day-white/day-white.rb +0 -6
  123. data/lib/rabbit/theme/default/default.rb +7 -1
  124. data/lib/rabbit/theme/enishi-green/property.rb +2 -2
  125. data/lib/rabbit/theme/entry.rb +85 -27
  126. data/lib/rabbit/theme/image-slide-number/image-slide-number.rb +4 -1
  127. data/lib/rabbit/theme/lightning-monochrome/lightning-monochrome.rb +0 -1
  128. data/lib/rabbit/theme/lightning-simple/lightning-simple.rb +0 -1
  129. data/lib/rabbit/theme/nari/nari.rb +6 -16
  130. data/lib/rabbit/theme/nari/property.rb +3 -0
  131. data/lib/rabbit/theme/night-black/night-black.rb +0 -6
  132. data/lib/rabbit/theme/pdf/pdf.rb +0 -4
  133. data/lib/rabbit/theme/rabbit/rabbit.rb +0 -6
  134. data/lib/rabbit/theme/ranguba/ranguba.rb +0 -12
  135. data/lib/rabbit/theme/ruby-gnome2/ruby-gnome2.rb +7 -4
  136. data/lib/rabbit/theme/rubykaigi2011/rubykaigi2011.rb +2 -9
  137. data/lib/rabbit/theme/searcher.rb +38 -16
  138. data/lib/rabbit/theme/syntax-highlighting/property.rb +2 -2
  139. data/lib/rabbit/version.rb +19 -0
  140. data/po/en/rabbit.po +1605 -1425
  141. data/po/fr/rabbit.po +1756 -1684
  142. data/po/ja/rabbit.po +2198 -2097
  143. data/po/rabbit.pot +1556 -1419
  144. metadata +34 -100
  145. data/bin/rabbirack +0 -99
  146. data/bin/rabbiter +0 -108
  147. data/bin/rabrick +0 -95
  148. data/bin/rabwii +0 -77
  149. data/lib/rabbit/default-config.rb +0 -24
  150. data/lib/rabbit/div/comment-i.erb +0 -7
  151. data/lib/rabbit/div/comment.erb +0 -45
  152. data/lib/rabbit/div/css.erb +0 -1
  153. data/lib/rabbit/div/js.erb +0 -1
  154. data/lib/rabbit/div/log.erb +0 -5
  155. data/lib/rabbit/div/main-i.erb +0 -24
  156. data/lib/rabbit/div/main.css +0 -40
  157. data/lib/rabbit/div/main.erb +0 -33
  158. data/lib/rabbit/div/navi-i.erb +0 -6
  159. data/lib/rabbit/div/navi.erb +0 -6
  160. data/lib/rabbit/div/prototype.js +0 -4320
  161. data/lib/rabbit/div/slide-i.erb +0 -2
  162. data/lib/rabbit/div/slide.erb +0 -5
  163. data/lib/rabbit/div/tofu.rb +0 -309
  164. data/lib/rabbit/middleware/config.ru +0 -42
  165. data/lib/rabbit/middleware/controller.rb +0 -63
  166. data/lib/rabbit/middleware/public/stylesheets/rabbirack.css +0 -12
  167. data/lib/rabbit/middleware/views/index.haml +0 -13
  168. data/lib/rabbit/middleware/views/layout.haml +0 -8
  169. data/lib/rabbit/post-setup.rb +0 -8
  170. data/lib/rabbit/pre-clean.rb +0 -2
  171. data/lib/rabbit/pre-distclean.rb +0 -2
  172. data/lib/rabbit/theme/twitter-comment/property.rb +0 -4
  173. data/lib/rabbit/theme/twitter-comment/twitter-comment.rb +0 -15
  174. data/lib/rabbit/twitter.rb +0 -239
  175. data/sample/theme-bench-en.hiki +0 -100
  176. data/sample/theme-bench-en.rab +0 -127
  177. data/sample/theme-bench.hiki +0 -101
  178. data/sample/theme-bench.rab +0 -128
  179. data/setup.rb +0 -1585
  180. data/update-mo.rb +0 -20
  181. data/update-po.rb +0 -57
@@ -1,2 +0,0 @@
1
- <a href="./">再読み込み</a>
2
- <pre><%= rabbit.current_slide_text %></pre>
@@ -1,5 +0,0 @@
1
- <div class="slide">
2
- <a href="./">
3
- <img title="<%= image_title %>" src="<%= image_path(context) %>" />
4
- </a>
5
- </div>
@@ -1,309 +0,0 @@
1
- require "div/div"
2
- require "div/tofusession"
3
-
4
- require 'rabbit/utils'
5
-
6
- module WEBrick
7
- class Tofulet
8
- def mobile?
9
- %r[(DoCoMo|J-PHONE|Vodafone|MOT-|UP\.Browser|DDIPOCKET|ASTEL|PDXGW|Palmscape|Xiino|sharp pda browser|Windows CE|L-mode|WILLCOM)]i =~ @req["user-agent"]
10
- end
11
- end
12
- end
13
-
14
- module Rabbit
15
- module Div
16
- module RabbitDiv
17
- def initialize(*args)
18
- super
19
- @cache = {}
20
- end
21
-
22
- def to_div_i(context)
23
- to_html_i(context)
24
- rescue
25
- "<p>error! #{h($!)}</p>"
26
- end
27
-
28
- def to_html_i(context)
29
- to_html(context)
30
- end
31
-
32
- private
33
- def rabbit
34
- @session.rabbit
35
- end
36
-
37
- def form2(attrs, method_name, context_or_param, context_or_empty=nil)
38
- result = form(method_name, context_or_param, context_or_empty)
39
- attrs = attrs.collect do |key, value|
40
- "#{h(key)}=\"#{h(value)}\""
41
- end.join(" ")
42
- result.gsub!(/(<form )/, "\\1#{attrs}")
43
- result
44
- end
45
-
46
- def param(method_name, add_param, separator=nil)
47
- param = make_param(method_name, add_param)
48
- ary = param.collect do |k, v|
49
- "#{u(k)}=#{u(v)}"
50
- end
51
- ary.join(separator || h("&"))
52
- end
53
-
54
- def ajax_param(method_name, add_js_param=[])
55
- result = ''
56
- result << param(method_name, {"ajax" => "1"}, "&").dump
57
- add_js_param.each do |k|
58
- result << " + "
59
- result << "&#{u(k)}=".dump
60
- result << " + $F(#{u(k).dump})"
61
- end
62
- result
63
- end
64
-
65
- def ajax?(params)
66
- params.has_key?("ajax")
67
- end
68
-
69
- def uri(method_name, add_param, context)
70
- "#{action(context)}?#{param(method_name, add_param)}"
71
- end
72
-
73
- def cache_read_file(key, *name)
74
- @cache[key] ||= read_file(*name)
75
- end
76
-
77
- def read_file(*name)
78
- path = Utils.find_path_in_load_path(*name)
79
- if path
80
- File.read(path)
81
- else
82
- nil
83
- end
84
- end
85
-
86
- def to_sjis(str)
87
- NKF.nkf("-sWdXm0", str.to_s)
88
- end
89
- end
90
-
91
- class MainDiv < ::Div::Div
92
- include RabbitDiv
93
-
94
- set_erb(File.join("rabbit", "div", "main.erb"))
95
- add_erb("to_html_i(context)", File.join("rabbit", "div", "main-i.erb"))
96
- reload_erb
97
-
98
- attr_reader :navi
99
- def initialize(session)
100
- super
101
- @slide = SlideDiv.new(session)
102
- @navi = NaviDiv.new(session)
103
- @comment = CommentDiv.new(session)
104
- @js = JSDiv.new(session)
105
- @css = CSSDiv.new(session)
106
- end
107
-
108
- def on_display(context)
109
- if context.mobile?
110
- context.res_header("Content-Type", "text/html; charset=Shift_JIS")
111
- context.res_body(to_sjis(to_html_i(context)))
112
- else
113
- context.res_header("Content-Type", "text/html; charset=UTF-8")
114
- context.res_body(to_html(context))
115
- end
116
- end
117
- end
118
-
119
- class NaviDiv < ::Div::Div
120
- include RabbitDiv
121
-
122
- set_erb(File.join("rabbit", "div", "navi.erb"))
123
- add_erb("to_html_i(context)", File.join("rabbit", "div", "navi-i.erb"))
124
- reload_erb
125
-
126
- def do_first(context, params)
127
- rabbit.move_to_first
128
- end
129
-
130
- def do_previous(context, params)
131
- rabbit.move_to_previous_if_can
132
- end
133
-
134
- def do_next(context, params)
135
- rabbit.move_to_next_if_can
136
- end
137
-
138
- def do_last(context, params)
139
- rabbit.move_to_last
140
- end
141
-
142
- private
143
- def a_link(context, key, label, label_only)
144
- HTML.a_link("<a href=\"#{uri(key, {}, context)}\">", label, label_only)
145
- end
146
-
147
- def first_link(context)
148
- a_link(context, "first", h("<<"), rabbit.first_slide?)
149
- end
150
-
151
- def previous_link(context)
152
- a_link(context, "previous", h("<"), !rabbit.have_previous_slide?)
153
- end
154
-
155
- def next_link(context)
156
- a_link(context, "next", h(">"), !rabbit.have_next_slide?)
157
- end
158
-
159
- def last_link(context)
160
- a_link(context, "last", h(">>"), rabbit.last_slide?)
161
- end
162
- end
163
-
164
- class CommentDiv < ::Div::Div
165
- include RabbitDiv
166
-
167
- set_erb(File.join("rabbit", "div", "comment.erb"))
168
- add_erb("to_html_i(context)", File.join("rabbit", "div", "comment-i.erb"))
169
- add_erb("to_log_html(context=nil)", File.join("rabbit", "div", "log.erb"))
170
- reload_erb
171
-
172
- def initialize(session)
173
- super
174
- @error_message = nil
175
- end
176
-
177
- def do_comment(context, params)
178
- comment, = params[comment_param_name]
179
- rabbit.append_comment(comment.to_s) do |error|
180
- @error_message = error.message
181
- end
182
- if ajax?(params)
183
- context.res_header("Content-Type", "text/html; charset=UTF-8")
184
- context.res_body(to_log_html(context))
185
- throw(:tofu_done)
186
- end
187
- end
188
-
189
- private
190
- def comments
191
- rabbit.comments
192
- end
193
-
194
- def comment_param_name
195
- "comment"
196
- end
197
-
198
- def comment_form_name
199
- "comment-form"
200
- end
201
- end
202
-
203
- class SlideDiv < ::Div::Div
204
- include RabbitDiv
205
-
206
- set_erb(File.join("rabbit", "div", "slide.erb"))
207
- add_erb("to_html_i(context)", File.join("rabbit", "div", "slide-i.erb"))
208
- reload_erb
209
-
210
- def do_current(context, params)
211
- context.res_header("Content-Type", "image/#{rabbit.image_type}")
212
- context.res_body(rabbit.current_slide_image)
213
- throw(:tofu_done)
214
- end
215
-
216
- private
217
- def image_title
218
- title = h(rabbit.slide_title)
219
- title << "(#{rabbit.current_slide_number}/"
220
- title << "#{rabbit.total_slide_number - 1})"
221
- title
222
- end
223
-
224
- def image_path(context, name="current", add_param={})
225
- uri(name, add_param, context)
226
- end
227
- end
228
-
229
- class JSDiv < ::Div::Div
230
- include RabbitDiv
231
-
232
- set_erb(File.join("rabbit", "div", "js.erb"))
233
-
234
- def do_else(context, params)
235
- cmd, = params['div_cmd']
236
- content = cache_read_file(cmd, "rabbit", "div", "#{cmd}.js")
237
- setup_js_response(context, content)
238
- end
239
-
240
- private
241
- def setup_js_response(context, js)
242
- context.res_header("Content-Type", "text/javascript; charset=UTF-8")
243
- context.res_body(js.to_s)
244
- throw(:tofu_done)
245
- end
246
-
247
- def js_path(context, name, add_param={})
248
- uri(name, add_param, context)
249
- end
250
-
251
- def script(context, name)
252
- src = js_path(context, name)
253
- %Q!<script type="text/javascript" src="#{src}"></script>!
254
- end
255
- end
256
-
257
- class CSSDiv < ::Div::Div
258
- include RabbitDiv
259
-
260
- set_erb(File.join("rabbit", "div", "css.erb"))
261
-
262
- def do_else(context, params)
263
- cmd, = params['div_cmd']
264
- content = cache_read_file(cmd, "rabbit", "div", "#{cmd}.css")
265
- setup_css_response(context, content)
266
- end
267
-
268
- private
269
- def setup_css_response(context, css)
270
- context.res_header("Content-Type", "text/css; charset=UTF-8")
271
- context.res_body(css.to_s)
272
- throw(:tofu_done)
273
- end
274
-
275
- def css_path(context, name, add_param={})
276
- uri(name, add_param, context)
277
- end
278
-
279
- def css_link(context, name)
280
- path = css_path(context, name)
281
- %Q!<link rel="stylesheet" type="text/css" href="#{path}" />!
282
- end
283
- end
284
-
285
- class TofuSession < ::Div::TofuSession
286
- @@rabbit = nil
287
-
288
- def self.rabbit=(rabbit)
289
- @@rabbit = rabbit
290
- end
291
-
292
- attr_reader :rabbit
293
- def initialize(bartender, hint=nil)
294
- super
295
- @main = MainDiv.new(self)
296
- @rabbit = @@rabbit
297
- end
298
-
299
- def do_GET(context)
300
- update_div(context)
301
- @main.on_display(context)
302
- end
303
-
304
- def fetch(ref)
305
- super || (@rabbit.accept_move? ? @main.navi : nil)
306
- end
307
- end
308
- end
309
- end
@@ -1,42 +0,0 @@
1
- # -*- mode: ruby; coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2011 Kouhei Sutou <kou@clear-code.com>
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation; either version 2 of the License, or
8
- # (at your option) any later version.
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU General Public License
16
- # along with this program; if not, write to the Free Software
17
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
-
19
- require "drb/drb"
20
-
21
- require "rabbit/middleware/controller"
22
-
23
- environment = ENV["RACK_ENV"] || "development"
24
- case environment
25
- when "development"
26
- use Rack::ShowExceptions
27
- end
28
-
29
- use Rack::Runtime
30
- use Rack::ContentLength
31
-
32
- use Rack::Deflater
33
- use Rack::ConditionalGet
34
-
35
- use Rack::Lint
36
- use Rack::Head
37
-
38
- rabbit = DRbObject.new_with_uri(ENV["RABBIT_URI"])
39
- application = Rabbit::Middleware::Controller.new do |controller|
40
- controller.rabbit = rabbit
41
- end
42
- run application
@@ -1,63 +0,0 @@
1
- # -*- mode: ruby; coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2011 Kouhei Sutou <kou@clear-code.com>
4
- #
5
- # This program is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation; either version 2 of the License, or
8
- # (at your option) any later version.
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU General Public License
16
- # along with this program; if not, write to the Free Software
17
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
-
19
- require "sinatra/base"
20
- require "haml"
21
-
22
- module Rabbit
23
- module Middleware
24
- class Controller < Sinatra::Base
25
- attr_accessor :rabbit
26
-
27
- set :app_file, File.join(File.dirname(__FILE__), "config.ru")
28
-
29
- layout
30
-
31
- before do
32
- content_type("text/html", "charset" => "UTF-8")
33
- end
34
-
35
- get "/" do
36
- haml :index
37
- end
38
-
39
- get "/pages/next" do
40
- @rabbit.move_to_next_if_can
41
- haml :index
42
- end
43
-
44
- get "/pages/previous" do
45
- @rabbit.move_to_previous_if_can
46
- haml :index
47
- end
48
-
49
- get "/pages/:number" do |number|
50
- @rabbit.move_to_if_can(number.to_i)
51
- haml :index
52
- end
53
-
54
- def title
55
- "Rabbit"
56
- end
57
-
58
- def slide_title
59
- @rabbit.slide_title
60
- end
61
- end
62
- end
63
- end
@@ -1,12 +0,0 @@
1
- ul,
2
- ul li
3
- {
4
- display: inline;
5
- }
6
-
7
- .navi
8
- {
9
- font-size: 72px;
10
- display: block;
11
- padding: 1em;
12
- }
@@ -1,13 +0,0 @@
1
- %ul
2
- %li
3
- - if @rabbit.have_next?
4
- %a(href="/pages/next")
5
- .navi 次へ
6
- - else
7
- .navi 次へ
8
- %li
9
- - if @rabbit.have_previous?
10
- %a(href="/pages/previous")
11
- .navi 前へ
12
- - else
13
- .navi 前へ