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
@@ -20,7 +20,13 @@ include_theme("default-description")
20
20
  include_theme("image")
21
21
  include_theme("table")
22
22
  include_theme("newline-in-slides")
23
- include_theme("slide-number")
23
+
24
+ unless print?
25
+ include_theme("image-slide-number")
26
+ if canvas.allotted_time
27
+ include_theme("image-timer")
28
+ end
29
+ end
24
30
 
25
31
  include_theme("per-slide-background-color")
26
32
 
@@ -1,3 +1,3 @@
1
1
  @category = N_("Theme")
2
- @title = N_("mayuco")
3
- @description = N_("mayuco theme")
2
+ @title = N_("Enishi Green")
3
+ @description = N_("EnishTech green based theme")
@@ -1,16 +1,34 @@
1
+ # Copyright (C) 2005-2012 Kouhei Sutou <kou@cozmixng.org>
2
+ #
3
+ # This program is free software; you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation; either version 2 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License along
14
+ # with this program; if not, write to the Free Software Foundation, Inc.,
15
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
+
1
17
  require 'erb'
2
18
 
3
19
  require 'rabbit/rabbit'
20
+ require "rabbit/gem-finder"
4
21
 
5
22
  module Rabbit
6
23
  module Theme
7
24
  class Entry
8
25
  extend ERB::DefMethod
9
26
 
27
+ include Enumerable
10
28
  include ERB::Util
11
29
  include GetText
12
- include Enumerable
13
-
30
+
31
+ THEME_BASE_NAME = "theme"
14
32
  PROPERTY_BASE_NAME = "property"
15
33
 
16
34
  class << self
@@ -47,8 +65,8 @@ module Rabbit
47
65
  attr_reader :dependencies, :parameters
48
66
  attr_accessor :logger
49
67
 
50
- def initialize(theme_dir, name)
51
- @logger = nil
68
+ def initialize(logger, theme_dir, name)
69
+ @logger = logger
52
70
  @theme_dir = theme_dir
53
71
  @name = name
54
72
  @title = @name
@@ -68,10 +86,6 @@ module Rabbit
68
86
  File.writable?(property_file)
69
87
  end
70
88
 
71
- def theme_file
72
- File.join(@theme_dir, "#{@name}.rb")
73
- end
74
-
75
89
  def <=>(other)
76
90
  @name <=> other.name
77
91
  end
@@ -81,7 +95,12 @@ module Rabbit
81
95
  end
82
96
 
83
97
  def full_path(target)
84
- File.join(@theme_dir, target)
98
+ if have_data_dir?
99
+ File.join(data_dir, target)
100
+ else
101
+ # backward compatibility
102
+ File.join(@theme_dir, target)
103
+ end
85
104
  end
86
105
 
87
106
  def category
@@ -89,19 +108,28 @@ module Rabbit
89
108
  end
90
109
 
91
110
  def image_theme?
92
- false
111
+ have_data_dir?
112
+ end
113
+
114
+ def data_dir
115
+ File.join(@theme_dir, "data")
93
116
  end
94
117
 
95
118
  def files
96
- rejected_files = [theme_file, property_file]
97
- Dir[File.join(@theme_dir, "*")].delete_if do |name|
98
- rejected_files.include?(name)
99
- end.sort
119
+ if have_data_dir?
120
+ Dir.glob(File.join(data_dir, "*")).sort
121
+ else
122
+ # backward compatibility
123
+ rejected_files = [theme_file, property_file]
124
+ Dir[File.join(@theme_dir, "*")].delete_if do |name|
125
+ rejected_files.include?(name)
126
+ end.sort
127
+ end
100
128
  end
101
129
 
102
130
  private
103
131
  def property_file
104
- File.join(@theme_dir, "#{PROPERTY_BASE_NAME}.rb")
132
+ File.join(@theme_dir, "#{PROPERTY_BASE_NAME}.rb")
105
133
  end
106
134
 
107
135
  def parse_property
@@ -115,11 +143,27 @@ module Rabbit
115
143
  end
116
144
  end
117
145
  end
146
+
147
+ def have_data_dir?
148
+ File.directory?(data_dir)
149
+ end
150
+ end
151
+
152
+ class FileEntry < Entry
153
+ def theme_file
154
+ File.join(@theme_dir, "#{@name}.rb")
155
+ end
156
+ end
157
+
158
+ class ImageFileEntry < FileEntry
159
+ def image_theme?
160
+ true
161
+ end
118
162
  end
119
163
 
120
164
  class DirectoryEntry < Entry
121
- def initialize(theme_dir)
122
- super(theme_dir, File.basename(theme_dir))
165
+ def theme_file
166
+ File.join(@theme_dir, "#{THEME_BASE_NAME}.rb")
123
167
  end
124
168
  end
125
169
 
@@ -129,25 +173,39 @@ module Rabbit
129
173
  end
130
174
  end
131
175
 
132
- class SingleFileEntry < Entry
133
- def initialize(theme_dir, name)
134
- super(theme_dir, name)
176
+ class GemEntry < Entry
177
+ def initialize(logger, name)
178
+ finder = GemFinder.new(logger)
179
+ @spec = finder.find(name, "rabbit-theme-")
180
+ theme_dir = nil
181
+ theme_dir = @spec.gem_dir if @spec
182
+ super(logger, theme_dir, name)
135
183
  end
136
184
 
137
- def property_editable?
138
- false
185
+ def available?
186
+ @theme_dir and super
187
+ end
188
+
189
+ def theme_file
190
+ File.join(@theme_dir, "#{THEME_BASE_NAME}.rb")
191
+ end
192
+
193
+ def full_path(target)
194
+ File.join(data_dir, target)
139
195
  end
140
196
 
141
197
  def files
142
- []
198
+ Dir.glob(File.join(data_dir, "*")).sort
143
199
  end
200
+ end
144
201
 
145
- def have_file?(target)
146
- name == target
202
+ class ImageGemEntry < GemEntry
203
+ def available?
204
+ @theme_dir and File.directory?(data_dir)
147
205
  end
148
206
 
149
- private
150
- def parse_property
207
+ def image_theme?
208
+ true
151
209
  end
152
210
  end
153
211
  end
@@ -3,7 +3,10 @@ add_image_path("rabbit-images")
3
3
  proc_name = "image-slide-number"
4
4
 
5
5
  @image_slide_number_image ||= "mini-usa-taro.png"
6
- @image_slide_number_show_text ||= false
6
+ if !defined?(@image_slide_number_show_text) or
7
+ @image_slide_number_show_text.nil?
8
+ @image_slide_number_show_text = true
9
+ end
7
10
  @image_slide_number_font_size ||= @xx_small_font_size
8
11
  @image_slide_number_text_color ||= "white"
9
12
  if !defined?(@image_slide_number_show_flag) or
@@ -1,4 +1,3 @@
1
- @slide_number_uninstall = true
2
1
  @default_headline_line_color = "black"
3
2
  @default_item1_mark_type = "check"
4
3
  @default_item2_mark_type = "circle"
@@ -40,7 +40,6 @@ include_theme("powered-by")
40
40
  if print?
41
41
  include_theme("slide-number")
42
42
  else
43
- @image_slide_number_show_text = true
44
43
  include_theme("image-slide-number")
45
44
 
46
45
  @image_timer_limit ||= canvas.allotted_time || 5 * 60
@@ -48,10 +48,12 @@ add_image_path("rabbit-images")
48
48
  @font_family = find_font_family("Times")
49
49
  @monospace_font_family = find_font_family("Times")
50
50
 
51
- @slide_number_uninstall = !print?
52
- if print?
53
- include_theme("slide-number")
54
- end
51
+ add_image_path("nari-images")
52
+ @image_slide_number_image ||= "gc_kun.png"
53
+ @image_slide_number_show_text = false
54
+ @image_slide_number_start_image = "nari-start-flag.png"
55
+ @image_slide_number_goal_image = "nari-goal-flag.png"
56
+ @image_timer_image ||= "chibi_nari.png"
55
57
 
56
58
  include_theme("default")
57
59
  include_theme("newline-in-title")
@@ -86,18 +88,6 @@ match(Slide, Body) do |bodies|
86
88
  end
87
89
  end
88
90
 
89
- add_image_path("nari-images")
90
- unless print?
91
- @image_slide_number_image ||= "gc_kun.png"
92
- @image_slide_number_start_image = "nari-start-flag.png"
93
- @image_slide_number_goal_image = "nari-goal-flag.png"
94
- include_theme("image-slide-number")
95
- if canvas.allotted_time
96
- @image_timer_image ||= "chibi_nari.png"
97
- include_theme("image-timer")
98
- end
99
- end
100
-
101
91
  @slide_footer_info_left_text ||= canvas.title
102
92
  @slide_footer_info_right_text ||= "Powered by Rabbit #{Rabbit::VERSION}"
103
93
  include_theme("slide-footer-info")
@@ -0,0 +1,3 @@
1
+ @category = N_("Theme")
2
+ @title = N_("Nari")
3
+ @description = N_("Nari's theme")
@@ -4,8 +4,6 @@
4
4
  @image_caption_color = @default_foreground
5
5
  @table_caption_color = @default_foreground
6
6
 
7
- @slide_number_uninstall = true
8
-
9
7
  @default_item1_mark_color = "#a00000"
10
8
  @default_item1_mark_type = "circle"
11
9
  @default_item2_mark_color = "#a00000"
@@ -19,7 +17,3 @@
19
17
  @table_body_fill_color = "#101010"
20
18
 
21
19
  include_theme("default")
22
-
23
- @image_slide_number_show_text = true
24
- include_theme("image-slide-number")
25
- include_theme("image-timer")
@@ -4,15 +4,11 @@ rescue LoadError
4
4
  end
5
5
 
6
6
  if canvas.allotted_time
7
- @image_slide_number_image = "mini-usa-taro.png"
8
- @image_slide_number_show_text = true
9
-
10
7
  @image_slide_number_margin_left = @margin_left
11
8
  @image_slide_number_margin_right = @margin_right
12
9
  @image_slide_number_margin_bottom = @margin_bottom
13
10
  include_theme("image-slide-number")
14
11
 
15
- @image_timer_image = "mini-kame-taro.png"
16
12
  @image_timer_margin_left = @margin_left
17
13
  @image_timer_margin_right = @margin_right
18
14
  @image_timer_margin_bottom = @margin_bottom
@@ -35,12 +35,6 @@ include_theme("rabbit-headline-logo")
35
35
  @title_shadow_color = "#c09090cc"
36
36
  include_theme("title-shadow")
37
37
 
38
- @slide_number_uninstall = true
39
- include_theme("slide-number")
40
-
41
- @image_slide_number_show_text = true
42
- include_theme("image-slide-number")
43
-
44
38
  include_theme("rabbit-powered-by")
45
39
  include_theme("rabbit-icon")
46
40
 
@@ -49,8 +49,6 @@ end
49
49
  @default_description_item1_mark_color = ranguba_color
50
50
  @default_block_quote_item1_mark_color = ranguba_color
51
51
 
52
- @slide_number_uninstall = !print?
53
-
54
52
  include_theme("default")
55
53
 
56
54
  @icon_images = ["ranguba-mark.png"]
@@ -65,16 +63,6 @@ end
65
63
  end
66
64
  include_theme("slide-logo")
67
65
 
68
- unless print?
69
- @image_slide_number_image ||= "mini-usa-taro.png"
70
- @image_slide_number_show_text = true
71
- include_theme("image-slide-number")
72
- if canvas.allotted_time
73
- @image_timer_image ||= "mini-kame-taro.png"
74
- include_theme("image-timer")
75
- end
76
- end
77
-
78
66
  @slide_footer_info_left_text ||= canvas.title.gsub(/\n+/, ' ')
79
67
  @slide_footer_info_right_text ||= "Powered by Rabbit #{Rabbit::VERSION}"
80
68
  include_theme("slide-footer-info")
@@ -34,10 +34,6 @@ match("**", Emphasis) do |ems|
34
34
  ems.prop_set("foreground", @ruby_gnome2_emphasis_color)
35
35
  end
36
36
 
37
- @image_slide_number_image = "mini-usa-taro.png"
38
- @image_slide_number_show_text = true
39
- include_theme("image-slide-number")
40
-
41
37
  if print?
42
38
  @powered_by_text = "Powered by Rabbit #{VERSION}, Ruby-GNOME2 and COZMIXNG"
43
39
  end
@@ -48,6 +44,13 @@ end
48
44
  ]
49
45
  include_theme("powered-by")
50
46
 
47
+ unless print?
48
+ include_theme("image-slide-number")
49
+ if canvas.allotted_time
50
+ include_theme("image-timer")
51
+ end
52
+ end
53
+
51
54
  @lightning_talk_proc_name = "lightning-ruby-gnome2"
52
55
  @lightning_talk_as_large_as_possible = true
53
56
  include_theme("lightning-talk-toolkit")
@@ -24,7 +24,8 @@ fill_color = "#ffffff4d"
24
24
  @table_head_fill_color = dark_color
25
25
  @table_header_font_props[:color] = "white"
26
26
 
27
- @slide_number_uninstall = true
27
+ @image_slide_number_start_flag_color = dark_color
28
+ @image_slide_number_goal_flag_color = dark_color
28
29
 
29
30
  include_theme("default")
30
31
 
@@ -45,11 +46,3 @@ background_image = "rubykaigi2011-background-white.jpg"
45
46
  @slide_background_image = background_image
46
47
  include_theme("title-slide-background-image")
47
48
  include_theme("slide-background-image")
48
-
49
- if canvas.allotted_time
50
- include_theme("image-slide-number")
51
- @image_slide_number_show_text = true
52
- @image_slide_number_start_flag_color = dark_color
53
- @image_slide_number_goal_flag_color = dark_color
54
- include_theme("image-timer")
55
- end
@@ -41,17 +41,25 @@ module Rabbit
41
41
  end
42
42
 
43
43
  def find_theme(theme_name=name, only_image=false)
44
- if only_image
45
- collector = "collect_image_theme"
46
- else
47
- collector = "collect_all_theme"
44
+ if theme_name == "."
45
+ if only_image
46
+ entry = ImageDirectoryEntry.new(@logger, ".", ".")
47
+ else
48
+ entry = DirectoryEntry.new(@logger, ".", ".")
49
+ end
50
+ return entry if entry.available?
48
51
  end
49
52
 
50
53
  unless only_image
51
- entry = SingleFileEntry.new(base_directory, theme_name)
54
+ entry = FileEntry.new(@logger, base_directory, theme_name)
52
55
  return entry if entry.available?
53
56
  end
54
57
 
58
+ if only_image
59
+ collector = "collect_image_theme"
60
+ else
61
+ collector = "collect_all_theme"
62
+ end
55
63
  found_entry = nil
56
64
  __send__(collector) do |entry|
57
65
  if theme_name == entry.name
@@ -60,7 +68,16 @@ module Rabbit
60
68
  end
61
69
  end
62
70
 
63
- raise LoadError, "can't find theme: #{theme_name}." if found_entry.nil?
71
+ if found_entry.nil?
72
+ if only_image
73
+ entry = ImageGemEntry.new(@logger, theme_name)
74
+ else
75
+ entry = GemEntry.new(@logger, theme_name)
76
+ end
77
+ return entry if entry.available?
78
+ raise LoadError, "can't find theme: #{theme_name}."
79
+ end
80
+
64
81
  found_entry
65
82
  end
66
83
 
@@ -93,11 +110,12 @@ module Rabbit
93
110
  end
94
111
 
95
112
  def collect_theme(&block)
96
- _collect_theme(theme_load_path, DirectoryEntry, &block)
113
+ _collect_theme(theme_load_path, [FileEntry, DirectoryEntry], &block)
97
114
  end
98
115
 
99
116
  def collect_image_theme(&block)
100
- _collect_theme(image_load_path, ImageDirectoryEntry, "image_dir", &block)
117
+ _collect_theme(image_load_path, [ImageFileEntry, ImageDirectoryEntry],
118
+ "image_dir", &block)
101
119
  end
102
120
 
103
121
  def theme_load_path
@@ -108,21 +126,25 @@ module Rabbit
108
126
  Config::IMAGE_PATH + $LOAD_PATH
109
127
  end
110
128
 
111
- def _collect_theme(path, entry_class, converter=nil, &block)
129
+ def _collect_theme(path, entry_classes, converter=nil, &block)
112
130
  converter ||= "theme_dir"
113
131
  themes = []
114
- theme_name = {}
132
+ theme_names = {}
115
133
  path.each do |dir|
116
134
  base_name = __send__(converter, dir)
117
135
  if File.directory?(base_name)
118
136
  Dir.foreach(base_name) do |theme|
119
137
  next if /\A..?\z/ =~ theme
120
- file = File.join(File.expand_path(base_name), theme)
121
- entry = entry_class.new(file)
122
- if entry.available? and !theme_name.has_key?(theme)
123
- block.call(entry) if block
124
- themes << entry
125
- theme_name[theme] = true
138
+ next if theme_names.has_key?(theme)
139
+ theme_dir = File.join(File.expand_path(base_name), theme)
140
+ entry_classes.each do |entry_class|
141
+ entry = entry_class.new(@logger, theme_dir, theme)
142
+ if entry.available?
143
+ block.call(entry) if block
144
+ themes << entry
145
+ theme_names[theme] = true
146
+ break
147
+ end
126
148
  end
127
149
  end
128
150
  end