rabbit 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +46 -12
- data/data/locale/en/LC_MESSAGES/rabbit.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rabbit.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rabbit.mo +0 -0
- data/doc/_config.yml +3 -3
- data/doc/_layouts/en.html +10 -0
- data/doc/_layouts/ja.html +10 -0
- data/doc/css/rabbit.css +25 -4
- data/doc/en/index.rd +1 -1
- data/doc/en/news.rd +46 -0
- data/doc/images/rabbit-slide-show-logo.png +0 -0
- data/doc/images/rabbit-slide-show-logo.svg +597 -0
- data/doc/images/screenshots/en/blue-circle-raw.png +0 -0
- data/doc/images/screenshots/en/blue-circle.png +0 -0
- data/doc/images/screenshots/en/clear-blue-raw.png +0 -0
- data/doc/images/screenshots/en/clear-blue.png +0 -0
- data/doc/images/screenshots/en/cozmixng-raw.png +0 -0
- data/doc/images/screenshots/en/cozmixng.png +0 -0
- data/doc/images/screenshots/en/dark-gradation-raw.png +0 -0
- data/doc/images/screenshots/en/dark-gradation.png +0 -0
- data/doc/images/screenshots/en/day-white-raw.png +0 -0
- data/doc/images/screenshots/en/day-white.png +0 -0
- data/doc/images/screenshots/en/debian-raw.png +0 -0
- data/doc/images/screenshots/en/debian.png +0 -0
- data/doc/images/screenshots/en/green-circle-raw.png +0 -0
- data/doc/images/screenshots/en/green-circle.png +0 -0
- data/doc/images/screenshots/en/night-black-raw.png +0 -0
- data/doc/images/screenshots/en/night-black.png +0 -0
- data/doc/images/screenshots/en/rabbit-raw.png +0 -0
- data/doc/images/screenshots/en/rabbit.png +0 -0
- data/doc/images/screenshots/en/ranguba-raw.png +0 -0
- data/doc/images/screenshots/en/ranguba.png +0 -0
- data/doc/images/screenshots/en/red-frame-raw.png +0 -0
- data/doc/images/screenshots/en/red-frame.png +0 -0
- data/doc/images/screenshots/en/ruby-gnome2-raw.png +0 -0
- data/doc/images/screenshots/en/ruby-gnome2.png +0 -0
- data/doc/images/screenshots/en/rubykaigi2011-raw.png +0 -0
- data/doc/images/screenshots/en/rubykaigi2011.png +0 -0
- data/doc/images/screenshots/ja/blue-circle-raw.png +0 -0
- data/doc/images/screenshots/ja/blue-circle.png +0 -0
- data/doc/images/screenshots/ja/clear-blue-raw.png +0 -0
- data/doc/images/screenshots/ja/clear-blue.png +0 -0
- data/doc/images/screenshots/ja/cozmixng-raw.png +0 -0
- data/doc/images/screenshots/ja/cozmixng.png +0 -0
- data/doc/images/screenshots/ja/dark-gradation-raw.png +0 -0
- data/doc/images/screenshots/ja/dark-gradation.png +0 -0
- data/doc/images/screenshots/ja/day-white-raw.png +0 -0
- data/doc/images/screenshots/ja/day-white.png +0 -0
- data/doc/images/screenshots/ja/debian-raw.png +0 -0
- data/doc/images/screenshots/ja/debian.png +0 -0
- data/doc/images/screenshots/ja/green-circle-raw.png +0 -0
- data/doc/images/screenshots/ja/green-circle.png +0 -0
- data/doc/images/screenshots/ja/night-black-raw.png +0 -0
- data/doc/images/screenshots/ja/night-black.png +0 -0
- data/doc/images/screenshots/ja/rabbit-raw.png +0 -0
- data/doc/images/screenshots/ja/rabbit.png +0 -0
- data/doc/images/screenshots/ja/ranguba-raw.png +0 -0
- data/doc/images/screenshots/ja/ranguba.png +0 -0
- data/doc/images/screenshots/ja/red-frame-raw.png +0 -0
- data/doc/images/screenshots/ja/red-frame.png +0 -0
- data/doc/images/screenshots/ja/ruby-gnome2-raw.png +0 -0
- data/doc/images/screenshots/ja/ruby-gnome2.png +0 -0
- data/doc/images/screenshots/ja/rubykaigi2011-raw.png +0 -0
- data/doc/images/screenshots/ja/rubykaigi2011.png +0 -0
- data/doc/index.html.ja +2 -2
- data/doc/ja/how-to-make/rd.rd +30 -3
- data/doc/ja/index.rd +1 -1
- data/doc/ja/news.rd +46 -0
- data/doc/ja/slides.rd +1 -1
- data/doc/ja/usage/rabbit-theme.rd +1 -1
- data/doc/ja/users.rd +16 -2
- data/lib/rabbit/author-configuration.rb +6 -6
- data/lib/rabbit/command/rabbit-slide.rb +208 -161
- data/lib/rabbit/command/rabbit.rb +2 -2
- data/lib/rabbit/console.rb +1 -1
- data/lib/rabbit/element/text-renderer.rb +2 -2
- data/lib/rabbit/element/video.rb +167 -0
- data/lib/rabbit/image/pdf.rb +19 -10
- data/lib/rabbit/parser/ext/video.rb +18 -0
- data/lib/rabbit/parser/rd/ext/block-verbatim.rb +10 -0
- data/lib/rabbit/parser/rd/ext/video.rb +15 -0
- data/lib/rabbit/slide-configuration.rb +15 -8
- data/lib/rabbit/slideshare.rb +93 -13
- data/lib/rabbit/task/slide.rb +5 -4
- data/lib/rabbit/task/theme.rb +3 -1
- data/lib/rabbit/theme/applier.rb +1 -1
- data/lib/rabbit/theme/entry.rb +0 -29
- data/lib/rabbit/theme/title-shadow/title-shadow.rb +1 -1
- data/lib/rabbit/version.rb +1 -1
- data/lib/rabbit/video-window.rb +122 -0
- data/misc/github-post-receiver/config.ru +170 -0
- data/misc/github-post-receiver/config.yaml.sample +3 -0
- data/misc/github-post-receiver/tmp/restart.txt +0 -0
- data/po/en/rabbit.po~ +2567 -0
- data/po/fr/rabbit.po~ +2674 -0
- data/po/ja/rabbit.po~ +2695 -0
- data/po/rabbit.pot +1195 -1094
- data/rabbit.gemspec +1 -0
- data/test/test-author-configuration.rb +1 -0
- data/test/test-slide-configuration.rb +3 -0
- metadata +659 -640
- data/bin/rabbit-theme-manager +0 -133
- data/lib/rabbit/theme-browser.rb +0 -104
- data/lib/rabbit/theme-browser/default-tag.yaml +0 -89
- data/lib/rabbit/theme-browser/document.rb +0 -200
- data/lib/rabbit/theme-browser/ext/block-verbatim.rb +0 -39
- data/lib/rabbit/theme-browser/page.rb +0 -133
- data/lib/rabbit/theme-browser/rd2document-lib.rb +0 -181
- data/lib/rabbit/theme-browser/tag.rb +0 -67
- data/lib/rabbit/theme-browser/tree.rb +0 -91
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/doc/index.html.ja
CHANGED
|
@@ -8,9 +8,9 @@ no_sidebar: true
|
|
|
8
8
|
<p>{{ site.release_date }}にリリースされた<a href="/ja/news.html">{{ site.version }}</a>が最新リリースです。</p>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
<section
|
|
11
|
+
<section id="screenshots">
|
|
12
12
|
<h2>スクリーンショット</h2>
|
|
13
|
-
<ul
|
|
13
|
+
<ul>
|
|
14
14
|
<li><img src="images/screenshots/ja/blue-circle.png"
|
|
15
15
|
alt="青い円テーマ" /></li>
|
|
16
16
|
<li><img src="images/screenshots/ja/clear-blue.png"
|
data/doc/ja/how-to-make/rd.rd
CHANGED
|
@@ -50,10 +50,37 @@ TODO: 他にもメタデータが増えているはず。
|
|
|
50
50
|
|
|
51
51
|
=== 画像
|
|
52
52
|
|
|
53
|
-
verbatim block
|
|
54
|
-
てください。
|
|
53
|
+
verbatim blockとして記述します。
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
最初の行は「(({# image}))」からはじめます。「(({src = 画像のパス}))」は
|
|
56
|
+
必ず指定しなければいけません。以下はスライドと同じディレクトリにある
|
|
57
|
+
(({lavie.png}))を表示する例です。
|
|
58
|
+
|
|
59
|
+
# image
|
|
60
|
+
# src = lavie.png
|
|
61
|
+
|
|
62
|
+
「(({caption = キャプション}))」でキャプションも指定できます。
|
|
63
|
+
|
|
64
|
+
# image
|
|
65
|
+
# src = lavie.png
|
|
66
|
+
# caption = Lavie
|
|
67
|
+
|
|
68
|
+
「(({relative_width = 90}))」を指定するとスライドの横幅ほとんどを使って
|
|
69
|
+
大きく画像を表示します。横長の画像を大きく表示するときはこの指定をする
|
|
70
|
+
とよいでしょう。
|
|
71
|
+
|
|
72
|
+
# image
|
|
73
|
+
# src = lavie.png
|
|
74
|
+
# relative_width = 90
|
|
75
|
+
|
|
76
|
+
縦長の画像は「(({relative_height = 90}))」を指定してください。スライド
|
|
77
|
+
の縦幅ほとんどを使って大きく画像を表示します。
|
|
78
|
+
|
|
79
|
+
# image
|
|
80
|
+
# src = lavie.png
|
|
81
|
+
# relative_height = 90
|
|
82
|
+
|
|
83
|
+
TODO: 指定できるオプションのリストを書く
|
|
57
84
|
|
|
58
85
|
=== 実体参照
|
|
59
86
|
|
data/doc/ja/index.rd
CHANGED
|
@@ -175,7 +175,7 @@ Framework|URL:http://prototype.conio.net/>))を見てください。
|
|
|
175
175
|
data/rabbit/image/rubykaigi2011-images/rubykaigi2011-background-white.jpg
|
|
176
176
|
と
|
|
177
177
|
data/rabbit/image/rubykaigi2011-images/rubykaigi2011-background-black.jpg
|
|
178
|
-
の作者はnorioさんでラインセンスはCC-
|
|
178
|
+
の作者はnorioさんでラインセンスはCC-BY-3.0です。
|
|
179
179
|
|
|
180
180
|
== メーリングリスト
|
|
181
181
|
|
data/doc/ja/news.rd
CHANGED
|
@@ -3,6 +3,52 @@ layout: ja
|
|
|
3
3
|
title: お知らせ
|
|
4
4
|
apply_data: false
|
|
5
5
|
---
|
|
6
|
+
== 2.0.6: 2012-12-29
|
|
7
|
+
|
|
8
|
+
ビデオサポートリリース!2012年最後のリリース!
|
|
9
|
+
|
|
10
|
+
=== 改良
|
|
11
|
+
|
|
12
|
+
==== rabbit-slide
|
|
13
|
+
|
|
14
|
+
* Ustreamに対応。
|
|
15
|
+
* Vimeoに対応。
|
|
16
|
+
* SlideShareでのURLにはタイトルではなくIDを使うようにした。
|
|
17
|
+
[Masafumi Yokoyamaさんがパッチ提供]
|
|
18
|
+
* changeコマンドで設定を変更できるようにした。
|
|
19
|
+
|
|
20
|
+
==== ドキュメント
|
|
21
|
+
|
|
22
|
+
* RDを使った時の画像の使い方を追加。 [ほっかいさんが追加]
|
|
23
|
+
|
|
24
|
+
==== rabbit
|
|
25
|
+
|
|
26
|
+
* ファイルの拡張子もチェックしてPDFを認識するようにした。
|
|
27
|
+
* [非互換] 画像としてPDFを使うときに指定するページ番号を0スタートでは
|
|
28
|
+
なく1スタートにした。これは、PDFが1ページからカウントするので、それ
|
|
29
|
+
にあわせるためである。
|
|
30
|
+
* [実験的] スライドにビデオを埋め込めるようにした。
|
|
31
|
+
[Narihiro Nakamuraさんがパッチ提供]
|
|
32
|
+
* テキストの影を元のテキストから離れ過ぎないようにした。
|
|
33
|
+
|
|
34
|
+
==== rabbit-theme-manager
|
|
35
|
+
|
|
36
|
+
* 必要がないので削除。
|
|
37
|
+
|
|
38
|
+
=== 修正
|
|
39
|
+
|
|
40
|
+
==== rabbit
|
|
41
|
+
|
|
42
|
+
* .rabbitディレクトリを起動オプションを指定したファイルとはみなさない
|
|
43
|
+
ようにした。 [Koichi Akabeさんが報告]
|
|
44
|
+
|
|
45
|
+
=== 感謝
|
|
46
|
+
|
|
47
|
+
* Masafumi Yokoyamaさん
|
|
48
|
+
* Koichi Akabeさん
|
|
49
|
+
* ほっかいさん
|
|
50
|
+
* Narihiro Nakamuraさん
|
|
51
|
+
|
|
6
52
|
== 2.0.5: 2012-09-14
|
|
7
53
|
|
|
8
54
|
バグフィックスリリース。
|
data/doc/ja/slides.rd
CHANGED
|
@@ -7,7 +7,7 @@ title: スライド
|
|
|
7
7
|
Rabbitで作ったスライドがたくさん公開されています。Rabbitで作っ
|
|
8
8
|
たスライドを公開したら自由に追加してください。
|
|
9
9
|
|
|
10
|
-
* ((<kou|URL:http://
|
|
10
|
+
* ((<kou|URL:http://slide.rabbit-shocker.org/authors/kou/>))
|
|
11
11
|
* ((<zunda|URL:http://zunda.freeshell.org/d/?year=2004;month=3Q;category=rabbit>))さん
|
|
12
12
|
* ((<oxy|URL:http://mono.kmc.gr.jp/~oxy/d/?date=20041019#p02>))さん
|
|
13
13
|
* かずひこさん
|
data/doc/ja/users.rd
CHANGED
|
@@ -8,8 +8,22 @@ Rabbitユーザのコミュニティとして「Rabbitショッカー」があ
|
|
|
8
8
|
|
|
9
9
|
== 活動の場
|
|
10
10
|
|
|
11
|
-
Rabbit
|
|
12
|
-
|
|
11
|
+
Rabbitショッカーの主な活動場所はプレゼンテーションの場です。ただし、プ
|
|
12
|
+
レゼンテーションの場に限らずいくつか活動場所があります。
|
|
13
|
+
|
|
14
|
+
=== slide.rabbit-shocker.org
|
|
15
|
+
|
|
16
|
+
RabbitショッカーのみなさんはRabbitを使ってプレゼンテーションした後は使っ
|
|
17
|
+
たスライドを
|
|
18
|
+
((<slide.rabbit-shocker.org|URL:http://slide.rabbit-shocker.org/>))へアッ
|
|
19
|
+
プロードしています。slide.rabbit-shocker.orgへ行けばRabbitでどんなスラ
|
|
20
|
+
イドを作れるかを確認することができます。
|
|
21
|
+
|
|
22
|
+
あなたもRabbitショッカーとしてプレゼンテーションしたらスライドを
|
|
23
|
+
slide.rabbit-shocker.orgへアップロードしましょう。
|
|
24
|
+
|
|
25
|
+
アップロード方法については((<"usage/rabbit-slide.rb"|rabbit-slideコマン
|
|
26
|
+
ドの使い方>))に書かれています。
|
|
13
27
|
|
|
14
28
|
=== メーリングリスト
|
|
15
29
|
|
|
@@ -63,12 +63,12 @@ module Rabbit
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def merge!(conf)
|
|
66
|
-
@markup_language
|
|
67
|
-
@name
|
|
68
|
-
@email
|
|
69
|
-
@rubygems_user
|
|
70
|
-
@slideshare_user
|
|
71
|
-
@speaker_deck_user
|
|
66
|
+
@markup_language = conf["markup_language"] || @markup_language
|
|
67
|
+
@name = conf["name"] || @name
|
|
68
|
+
@email = conf["email"] || @email
|
|
69
|
+
@rubygems_user = conf["rubygems_user"] || @rubygems_user
|
|
70
|
+
@slideshare_user = conf["slideshare_user"] || @slideshare_user
|
|
71
|
+
@speaker_deck_user = conf["speaker_deck_user"] || @spearker_deck_user
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def to_hash
|
|
@@ -43,7 +43,7 @@ module Rabbit
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def run(arguments)
|
|
46
|
-
|
|
46
|
+
parse_command_line_arguments(arguments)
|
|
47
47
|
|
|
48
48
|
validate
|
|
49
49
|
unless @validation_errors.empty?
|
|
@@ -52,7 +52,7 @@ module Rabbit
|
|
|
52
52
|
return false
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
run_command
|
|
56
56
|
@author_conf.save
|
|
57
57
|
true
|
|
58
58
|
end
|
|
@@ -60,164 +60,186 @@ module Rabbit
|
|
|
60
60
|
private
|
|
61
61
|
def parse_command_line_arguments(arguments)
|
|
62
62
|
Rabbit::Console.parse!(ARGV) do |parser, options|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
@slide_conf.author = @author_conf
|
|
68
|
-
|
|
69
|
-
format = _("Usage: %s new [options]\n" \
|
|
70
|
-
" e.g.: %s new \\\n" \
|
|
71
|
-
" --id rubykaigi2012 \\\n" \
|
|
72
|
-
" --base-name rabbit-introduction \\\n" \
|
|
73
|
-
" --markup-language rd \\\n" \
|
|
74
|
-
" --name \"Kouhei Sutou\" \\\n" \
|
|
75
|
-
" --email kou@cozmixng.org \\\n" \
|
|
76
|
-
" --rubygems-user kou \\\n" \
|
|
77
|
-
" --slideshare-user kou \\\n" \
|
|
78
|
-
" --speaker-deck-user kou")
|
|
79
|
-
|
|
80
|
-
program = File.basename($0, ".*")
|
|
81
|
-
parser.banner = format % [program, program]
|
|
82
|
-
|
|
83
|
-
parser.separator("")
|
|
84
|
-
|
|
85
|
-
parser.separator(_("Slide information"))
|
|
86
|
-
|
|
87
|
-
parser.on("--id=ID",
|
|
88
|
-
_("Slide ID"),
|
|
89
|
-
_("(e.g.: %s)") % "--id=rubykaigi2012",
|
|
90
|
-
_("(must)")) do |id|
|
|
91
|
-
@slide_conf.id = id
|
|
92
|
-
end
|
|
63
|
+
setup_options(parser, options)
|
|
64
|
+
end
|
|
65
|
+
@command = @options.rest.first || default_command
|
|
66
|
+
end
|
|
93
67
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
68
|
+
def setup_options(parser, options)
|
|
69
|
+
@options = options
|
|
70
|
+
@logger = @options.default_logger
|
|
71
|
+
@author_conf = AuthorConfiguration.new(@logger)
|
|
72
|
+
@author_conf.load
|
|
73
|
+
@slide_conf = SlideConfiguration.new(@logger)
|
|
74
|
+
@slide_conf.author = @author_conf
|
|
75
|
+
|
|
76
|
+
format = _("Usage: %s COMMAND [OPTIONS]\n" \
|
|
77
|
+
" e.g.: %s new \\\n" \
|
|
78
|
+
" --id rubykaigi2012 \\\n" \
|
|
79
|
+
" --base-name rabbit-introduction \\\n" \
|
|
80
|
+
" --markup-language rd \\\n" \
|
|
81
|
+
" --name \"Kouhei Sutou\" \\\n" \
|
|
82
|
+
" --email kou@cozmixng.org \\\n" \
|
|
83
|
+
" --rubygems-user kou \\\n" \
|
|
84
|
+
" --slideshare-user kou \\\n" \
|
|
85
|
+
" --speaker-deck-user kou")
|
|
86
|
+
|
|
87
|
+
program = File.basename($0, ".*")
|
|
88
|
+
parser.banner = format % [program, program]
|
|
89
|
+
|
|
90
|
+
parser.separator("")
|
|
91
|
+
parser.separator(_("COMMAND"))
|
|
92
|
+
parser.separator(_(" new: create a new slide"))
|
|
93
|
+
parser.separator(_(" change: change an existing slide"))
|
|
94
|
+
|
|
95
|
+
parser.separator("")
|
|
96
|
+
parser.separator(_("Slide information"))
|
|
97
|
+
|
|
98
|
+
parser.on("--id=ID",
|
|
99
|
+
_("Slide ID"),
|
|
100
|
+
_("(e.g.: %s)") % "--id=rubykaigi2012",
|
|
101
|
+
_("(must)")) do |id|
|
|
102
|
+
@slide_conf.id = id
|
|
103
|
+
end
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
end
|
|
114
|
-
messages << _("(optional)")
|
|
115
|
-
parser.on("--markup-language=LANGUAGE", available_markup_languages,
|
|
116
|
-
*messages) do |language|
|
|
117
|
-
@author_conf.markup_language = language
|
|
118
|
-
end
|
|
105
|
+
messages = [
|
|
106
|
+
_("Base name for the slide source file and generated PDF file"),
|
|
107
|
+
_("(e.g.: %s)") % "--base-name=rabbit-introduction",
|
|
108
|
+
_("(must)"),
|
|
109
|
+
]
|
|
110
|
+
parser.on("--base-name=NAME",
|
|
111
|
+
*messages) do |base_name|
|
|
112
|
+
@slide_conf.base_name = base_name
|
|
113
|
+
end
|
|
119
114
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
115
|
+
available_markup_languages = [:rd, :hiki, :markdown]
|
|
116
|
+
label = "[" + available_markup_languages.join(", ") + "]"
|
|
117
|
+
messages = [
|
|
118
|
+
_("Markup language for the new slide"),
|
|
119
|
+
_("(e.g.: %s)") % "--markup-language=rd",
|
|
120
|
+
_("(available markup languages: %s)") % label,
|
|
121
|
+
]
|
|
122
|
+
if @author_conf.markup_language
|
|
123
|
+
messages << _("(default: %s)") % @author_conf.markup_language
|
|
124
|
+
end
|
|
125
|
+
messages << _("(optional)")
|
|
126
|
+
parser.on("--markup-language=LANGUAGE", available_markup_languages,
|
|
127
|
+
*messages) do |language|
|
|
128
|
+
@author_conf.markup_language = language
|
|
129
|
+
end
|
|
126
130
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
end
|
|
131
|
+
parser.on("--title=TITLE",
|
|
132
|
+
_("Title of the new slide"),
|
|
133
|
+
_("(e.g.: %s)") % _("--title=\"Rabbit Introduction\""),
|
|
134
|
+
_("(optional)")) do |title|
|
|
135
|
+
@title = title
|
|
136
|
+
end
|
|
134
137
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
parser.on("--tags=TAG,TAG,...",
|
|
139
|
+
Array,
|
|
140
|
+
_("Tags of the new slide"),
|
|
141
|
+
_("(e.g.: %s)") % "--tags=rabbit,presentation,ruby",
|
|
142
|
+
_("(optional)")) do |tags|
|
|
143
|
+
@slide_conf.tags.concat(tags)
|
|
144
|
+
end
|
|
141
145
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
parser.on("--allotted-time=TIME",
|
|
147
|
+
_("Allotted time in presentaion"),
|
|
148
|
+
_("(e.g.: %s)") % "--allotted-time=5m",
|
|
149
|
+
_("(optional)")) do |allotted_time|
|
|
150
|
+
@allotted_time = allotted_time
|
|
151
|
+
end
|
|
148
152
|
|
|
149
|
-
|
|
153
|
+
parser.on("--presentation-date=DATE",
|
|
154
|
+
_("Presentation date with the new slide"),
|
|
155
|
+
_("(e.g.: %s)") % "--presentation-date=2012/06/29",
|
|
156
|
+
_("(optional)")) do |date|
|
|
157
|
+
@slide_conf.presentation_date = date
|
|
158
|
+
end
|
|
150
159
|
|
|
151
|
-
|
|
152
|
-
_("Author name of the new slide"),
|
|
153
|
-
_("(e.g.: %s)") % "--name=\"Kouhei Sutou\"",
|
|
154
|
-
]
|
|
155
|
-
if @author_conf.name
|
|
156
|
-
messages << _("(default: %s)") % @author_conf.name
|
|
157
|
-
end
|
|
158
|
-
messages << _("(optional)")
|
|
159
|
-
parser.on("--name=NAME",
|
|
160
|
-
*messages) do |name|
|
|
161
|
-
@author_conf.name = name
|
|
162
|
-
end
|
|
160
|
+
parser.separator(_("Your information"))
|
|
163
161
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
162
|
+
messages = [
|
|
163
|
+
_("Author name of the new slide"),
|
|
164
|
+
_("(e.g.: %s)") % "--name=\"Kouhei Sutou\"",
|
|
165
|
+
]
|
|
166
|
+
if @author_conf.name
|
|
167
|
+
messages << _("(default: %s)") % @author_conf.name
|
|
168
|
+
end
|
|
169
|
+
messages << _("(optional)")
|
|
170
|
+
parser.on("--name=NAME",
|
|
171
|
+
*messages) do |name|
|
|
172
|
+
@author_conf.name = name
|
|
173
|
+
end
|
|
176
174
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
end
|
|
175
|
+
messages = [
|
|
176
|
+
_("Author e-mail of the new slide"),
|
|
177
|
+
_("(e.g.: %s)") % "--email=kou@cozmixng.org",
|
|
178
|
+
]
|
|
179
|
+
if @author_conf.email
|
|
180
|
+
messages << _("(default: %s)") % @author_conf.email
|
|
181
|
+
end
|
|
182
|
+
messages << _("(optional)")
|
|
183
|
+
parser.on("--email=EMAIL",
|
|
184
|
+
*messages) do |email|
|
|
185
|
+
@author_conf.email = email
|
|
186
|
+
end
|
|
190
187
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
188
|
+
messages = [
|
|
189
|
+
_("Account for %s") % "RubyGems.org",
|
|
190
|
+
_("It is used to publish your slide to %s") % "RubyGems.org",
|
|
191
|
+
_("(e.g.: %s)") % "--rubygems-user=kou",
|
|
192
|
+
]
|
|
193
|
+
if @author_conf.rubygems_user
|
|
194
|
+
messages << _("(default: %s)") % @author_conf.rubygems_user
|
|
195
|
+
end
|
|
196
|
+
messages << _("(optional)")
|
|
197
|
+
parser.on("--rubygems-user=USER",
|
|
198
|
+
*messages) do |user|
|
|
199
|
+
@author_conf.rubygems_user = user
|
|
200
|
+
end
|
|
204
201
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
202
|
+
messages = [
|
|
203
|
+
_("Account for %s") % "SlideShare",
|
|
204
|
+
_("It is used to publish your slide to %s") % "SlideShare",
|
|
205
|
+
_("(e.g.: %s)") % "--slideshare-user=kou",
|
|
206
|
+
]
|
|
207
|
+
if @author_conf.slideshare_user
|
|
208
|
+
messages << _("(default: %s)") % @author_conf.slideshare_user
|
|
209
|
+
end
|
|
210
|
+
messages << _("(optional)")
|
|
211
|
+
parser.on("--slideshare-user=USER",
|
|
212
|
+
*messages) do |user|
|
|
213
|
+
@author_conf.slideshare_user = user
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
messages = [
|
|
217
|
+
_("Account for %s") % "Speaker Deck",
|
|
218
|
+
_("It is used to publish your slide to %s") % "Speaker Deck",
|
|
219
|
+
_("(e.g.: %s)") % "--speaker-deck-user=kou",
|
|
220
|
+
]
|
|
221
|
+
if @author_conf.speaker_deck_user
|
|
222
|
+
messages << _("(default: %s)") % @author_conf.speaker_deck_user
|
|
223
|
+
end
|
|
224
|
+
messages << _("(optional)")
|
|
225
|
+
parser.on("--speaker-deck-user=USER",
|
|
226
|
+
*messages) do |user|
|
|
227
|
+
@author_conf.speaker_deck_user = user
|
|
218
228
|
end
|
|
219
229
|
end
|
|
220
230
|
|
|
231
|
+
def default_command
|
|
232
|
+
if File.file("config.yaml")
|
|
233
|
+
"change"
|
|
234
|
+
else
|
|
235
|
+
"new"
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
def available_commands
|
|
240
|
+
["new", "change"]
|
|
241
|
+
end
|
|
242
|
+
|
|
221
243
|
def validate
|
|
222
244
|
@validation_errors = []
|
|
223
245
|
validate_command
|
|
@@ -226,17 +248,13 @@ module Rabbit
|
|
|
226
248
|
end
|
|
227
249
|
|
|
228
250
|
def validate_command
|
|
229
|
-
if @options.rest.
|
|
230
|
-
@options.rest << "new"
|
|
231
|
-
end
|
|
232
|
-
if @options.rest.size != 1
|
|
251
|
+
if @options.rest.size > 1
|
|
233
252
|
message = _("too many commands: %s") % @options.rest.inspect
|
|
234
253
|
@validation_errors << message
|
|
235
254
|
end
|
|
236
|
-
@command
|
|
237
|
-
if @command != "new"
|
|
255
|
+
unless available_commands.include?(@command)
|
|
238
256
|
format = _("invalid command: <%s>: available commands: %s")
|
|
239
|
-
message = format % [@command, "[
|
|
257
|
+
message = format % [@command, "[#{available_commands.join(', ')}]"]
|
|
240
258
|
@validation_errors << message
|
|
241
259
|
end
|
|
242
260
|
end
|
|
@@ -253,8 +271,33 @@ module Rabbit
|
|
|
253
271
|
end
|
|
254
272
|
end
|
|
255
273
|
|
|
256
|
-
def
|
|
274
|
+
def run_command
|
|
275
|
+
__send__("run_command_#{@command}")
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
def run_command_new
|
|
257
279
|
generate_directory
|
|
280
|
+
generate_template
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
def run_command_change
|
|
284
|
+
merge_config_yaml
|
|
285
|
+
generate_template
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
def merge_config_yaml
|
|
289
|
+
existing_slide_conf = SlideConfiguration.new(@logger)
|
|
290
|
+
existing_slide_conf.load
|
|
291
|
+
existing_slide_conf.merge!(@slide_conf.to_hash)
|
|
292
|
+
@slide_conf = existing_slide_conf
|
|
293
|
+
@author_conf = @slide_conf.author
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
def generate_directory
|
|
297
|
+
create_directory(base_directory)
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def generate_template
|
|
258
301
|
generate_dot_gitignore
|
|
259
302
|
generate_dot_rabbit
|
|
260
303
|
generate_slide_configuration
|
|
@@ -263,10 +306,6 @@ module Rabbit
|
|
|
263
306
|
generate_slide
|
|
264
307
|
end
|
|
265
308
|
|
|
266
|
-
def generate_directory
|
|
267
|
-
create_directory(@slide_conf.id)
|
|
268
|
-
end
|
|
269
|
-
|
|
270
309
|
def generate_dot_gitignore
|
|
271
310
|
create_file(".gitignore") do |dot_gitignore|
|
|
272
311
|
dot_gitignore.puts(<<-EOD)
|
|
@@ -289,7 +328,7 @@ EOD
|
|
|
289
328
|
end
|
|
290
329
|
|
|
291
330
|
def generate_slide_configuration
|
|
292
|
-
@slide_conf.save(
|
|
331
|
+
@slide_conf.save(base_directory)
|
|
293
332
|
end
|
|
294
333
|
|
|
295
334
|
def generate_readme
|
|
@@ -342,7 +381,6 @@ require "rabbit/task/slide"
|
|
|
342
381
|
# Edit ./config.yaml to customize meta data
|
|
343
382
|
|
|
344
383
|
Rabbit::Task::Slide.new do |task|
|
|
345
|
-
# task.spec.licenses = ["CC BY-SA 3.0"]
|
|
346
384
|
# task.spec.files += Dir.glob("doc/**/*.*")
|
|
347
385
|
# task.spec.files -= Dir.glob("private/**/*.*")
|
|
348
386
|
# task.spec.add_runtime_dependency("YOUR THEME")
|
|
@@ -429,7 +467,7 @@ EOR
|
|
|
429
467
|
end
|
|
430
468
|
end
|
|
431
469
|
end
|
|
432
|
-
source << "\n
|
|
470
|
+
source << "\n"
|
|
433
471
|
end
|
|
434
472
|
|
|
435
473
|
def slide_source_items(source, generator)
|
|
@@ -449,8 +487,17 @@ EOR
|
|
|
449
487
|
source << "\n"
|
|
450
488
|
end
|
|
451
489
|
|
|
490
|
+
def base_directory
|
|
491
|
+
case @command
|
|
492
|
+
when "change"
|
|
493
|
+
"."
|
|
494
|
+
else
|
|
495
|
+
@slide_conf.id
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
|
|
452
499
|
def create_file(path, &block)
|
|
453
|
-
super(File.join(
|
|
500
|
+
super(File.join(base_directory, path), &block)
|
|
454
501
|
end
|
|
455
502
|
end
|
|
456
503
|
end
|