retter 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/.travis.yml +0 -1
- data/Gemfile +0 -1
- data/README.md +124 -40
- data/bin/retter +11 -4
- data/lib/retter/command.rb +19 -0
- data/lib/retter/config.rb +8 -2
- data/lib/retter/entry.rb +33 -5
- data/lib/{generator/newretter.rb → retter/generator/base.rb} +2 -32
- data/lib/retter/generator/creator.rb +34 -0
- data/lib/{generator → retter/generator}/skel/Retterfile +8 -2
- data/lib/retter/generator/skel/layouts/article.html.haml +6 -0
- data/lib/{generator → retter/generator}/skel/layouts/entries.html.haml +2 -2
- data/lib/retter/generator/skel/layouts/entry.html.haml +9 -0
- data/lib/retter/generator/skel/layouts/index.html.haml +11 -0
- data/lib/{generator → retter/generator}/skel/layouts/retter.html.haml +1 -1
- data/lib/retter/generator/updator.rb +7 -0
- data/lib/retter/generator.rb +8 -0
- data/lib/retter/stationery/binder.rb +31 -5
- data/lib/retter/stationery/previewer.rb +1 -1
- data/lib/retter/stationery/view.rb +4 -0
- data/lib/retter/version.rb +1 -1
- data/lib/retter.rb +2 -0
- data/retter.gemspec +3 -2
- data/spec/command/callback_spec.rb +7 -18
- data/spec/command/invoke_after_spec.rb +29 -0
- data/spec/command/preview_spec.rb +2 -2
- data/spec/command/rebind_spec.rb +48 -6
- data/spec/spec_helper.rb +1 -1
- metadata +71 -53
- data/lib/generator/skel/layouts/entry.html.haml +0 -5
- data/lib/generator/skel/layouts/index.html.haml +0 -7
- /data/lib/{generator → retter/generator}/skel/.gitignore +0 -0
- /data/lib/{generator → retter/generator}/skel/Gemfile +0 -0
- /data/lib/{generator → retter/generator}/skel/config.ru +0 -0
- /data/lib/{generator → retter/generator}/skel/entries/.gitkeep +0 -0
- /data/lib/{generator → retter/generator}/skel/images/.gitkeep +0 -0
- /data/lib/{generator → retter/generator}/skel/images/orange/bg_body.jpg +0 -0
- /data/lib/{generator → retter/generator}/skel/images/orange/bg_entry.jpg +0 -0
- /data/lib/{generator → retter/generator}/skel/images/orange/bg_header.png +0 -0
- /data/lib/{generator → retter/generator}/skel/index.html +0 -0
- /data/lib/{generator → retter/generator}/skel/javascripts/.gitkeep +0 -0
- /data/lib/{generator → retter/generator}/skel/layouts/profile.html.haml +0 -0
- /data/lib/{generator → retter/generator}/skel/retters/.gitkeep +0 -0
- /data/lib/{generator → retter/generator}/skel/stylesheets/base.css +0 -0
- /data/lib/{generator → retter/generator}/skel/stylesheets/orange.css +0 -0
- /data/lib/{generator → retter/generator}/skel/stylesheets/retter.css +0 -0
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--format Fuubar
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,25 @@
|
|
1
|
-
#
|
1
|
+
# 注意
|
2
2
|
|
3
|
-
|
3
|
+
0.1.0 以降、`layouts/`ファイル以下に追加と変更があります。
|
4
|
+
以下のコマンドで`layouts/`以下のファイルを上書きしてください。
|
5
|
+
|
6
|
+
~~~~
|
7
|
+
retter gen $RETTER_HOME
|
8
|
+
~~~~
|
9
|
+
|
10
|
+
# RETTER (レッター) Flyweight diary workflow.
|
11
|
+
|
12
|
+
手軽さを追求した記事作成ツール。以下のような特徴があります。
|
4
13
|
|
5
14
|
* CLIでの操作を前提としています
|
6
|
-
*
|
15
|
+
* どこ(cwd)にいてもすぐに記事を編集できます(Markdown)
|
7
16
|
* オフラインで簡単にプレビューできます
|
8
17
|
* だいたいどんなサーバ上でも動作します(静的HTMLまたはRackアプリとして)
|
9
18
|
* RSSフィードを吐きます
|
10
19
|
* トラックバック、コメントなどの機能はありません
|
20
|
+
* コールバックを設定することでさらに手数を減らすことができます
|
11
21
|
|
12
|
-
## Installation
|
22
|
+
## インストール - Installation
|
13
23
|
|
14
24
|
*ruby-1.9.2* or later is required.
|
15
25
|
|
@@ -17,26 +27,35 @@
|
|
17
27
|
gem install retter
|
18
28
|
~~~~
|
19
29
|
|
20
|
-
## Usage
|
30
|
+
## 使い方 - Usage
|
21
31
|
|
22
|
-
###
|
32
|
+
### 新規サイト生成 - New site
|
23
33
|
|
24
|
-
|
34
|
+
`retter new`で新しいサイトのひな形を生成し、依存ライブラリをインストールし、gitリポジトリを初期化します。
|
25
35
|
|
26
36
|
~~~~
|
27
37
|
$ retter new my_sweet_diary
|
28
38
|
~~~~
|
29
39
|
|
30
|
-
|
40
|
+
生成するファイルはHAMLテンプレート、設定ファイル、デフォルトのCSS、Rackアプリ用の設定などです。
|
41
|
+
|
42
|
+
### 初期設定 - Settings
|
43
|
+
|
44
|
+
#### $EDITOR
|
31
45
|
|
32
46
|
**retter requires `$EDITOR` variable.**
|
33
47
|
|
48
|
+
Retterで記事を編集する際には任意のエディタが起動します。そのためには`$EDITOR`環境変数が設定されている必要があります。
|
49
|
+
大抵の場合は設定されていると思いますが、もし設定されていなければ`~/.bash_profile`や`~/.zshenv`などに追記する必要があります。
|
50
|
+
|
34
51
|
~~~~
|
35
52
|
$ echo "export EDITOR=vim" >> ~/.bash_profile
|
36
53
|
$ . ~/.bash_profile
|
37
54
|
~~~~
|
38
55
|
|
39
|
-
|
56
|
+
#### $RETTER_HOME
|
57
|
+
|
58
|
+
ファイルシステム上のどこに居ても`retter`コマンドを使って編集から公開まで行えるよう、 事前に`$RETTER_HOME`環境変数を設定します。
|
40
59
|
|
41
60
|
You can use `retter` command anywhere, If you set `$RETTER_HOME` variable.
|
42
61
|
|
@@ -45,17 +64,24 @@ You can use `retter` command anywhere, If you set `$RETTER_HOME` variable.
|
|
45
64
|
$ . ~/.bash_profile
|
46
65
|
~~~~
|
47
66
|
|
48
|
-
|
67
|
+
作業ディレクトリにRetterfileがある場合は、そのディレクトリが`$RETTER_HOME`に指定されているものとして動作します。
|
49
68
|
|
50
|
-
|
69
|
+
### 記事を書く - Write an article
|
51
70
|
|
52
|
-
`retter
|
71
|
+
`retter`コマンドは設定されているエディタを起動します。今のところMarkdown形式で記事を書くことができます。
|
72
|
+
|
73
|
+
`retter` opens `$EDITOR`. Write an article with Markdown.
|
53
74
|
|
54
75
|
~~~~
|
55
76
|
$ retter
|
56
77
|
~~~~
|
57
78
|
|
58
|
-
|
79
|
+
記事をひと通り書き終えたり確認したくなったら、エディタの機能で記事を保存して終了してください。
|
80
|
+
保存された記事は、その段階ではまだ下書きの状態です。
|
81
|
+
|
82
|
+
### プレビュー - Preview
|
83
|
+
|
84
|
+
下書きの記事を確認するには`preview`サブコマンドを使います(デフォルトブラウザが起動します)。
|
59
85
|
|
60
86
|
`preview` opens the draft article by your default browser.
|
61
87
|
|
@@ -63,6 +89,13 @@ You can use `retter` command anywhere, If you set `$RETTER_HOME` variable.
|
|
63
89
|
$ retter preview
|
64
90
|
~~~~
|
65
91
|
|
92
|
+
気に入らない箇所を見つけたらページを閉じて、また`retter`コマンドで記事を編集します。
|
93
|
+
満足のいく文章が出来上がるまで編集とプレビューを繰り返しましょう。
|
94
|
+
|
95
|
+
|
96
|
+
### 記事の生成 - Bind
|
97
|
+
|
98
|
+
下書きが完成したら、記事をそのサイトのページとして生成します。
|
66
99
|
`bind`, `rebind` は下書きの記事をその日の記事として保存し、すべてのHTMLを再生成します。
|
67
100
|
|
68
101
|
`bind` and `rebind` binds the draft article. And re-generates actual html web pages. All html pages will be overwritten.
|
@@ -71,9 +104,27 @@ You can use `retter` command anywhere, If you set `$RETTER_HOME` variable.
|
|
71
104
|
$ retter bind
|
72
105
|
~~~~
|
73
106
|
|
74
|
-
###
|
107
|
+
### サイト全体の確認 - Browse Offline
|
108
|
+
|
109
|
+
生成されるすべてのページは静的HTMLですから、オフラインでも自分のマシンで全体的な見栄えを確認できます。
|
110
|
+
`open`サブコマンドはデフォルトブラウザを起動してサイトのトップページを開きます。
|
111
|
+
|
112
|
+
`open` sub-command opens your (static) website by your default browser.
|
113
|
+
|
114
|
+
~~~~
|
115
|
+
$ retter open
|
116
|
+
~~~~
|
75
117
|
|
76
|
-
|
118
|
+
デプロイ先のサーバではRackアプリとして起動しているということであれば、rackupで確認しましょう。
|
119
|
+
|
120
|
+
~~~~
|
121
|
+
$ retter home # `home` opens a new shell in $RETTER_HOME.
|
122
|
+
(retter) bundle exec rackup
|
123
|
+
~~~~
|
124
|
+
|
125
|
+
### 記事の公開 - Publish
|
126
|
+
|
127
|
+
記事をインターネット上に公開するには、必要なすべてのファイルを git リポジトリにコミットしリモートサーバに push、または単純にファイルをアップロードします。
|
77
128
|
|
78
129
|
To publish, use the git command. Or, upload the file to your server.
|
79
130
|
|
@@ -98,62 +149,76 @@ To publish, use the git command. Or, upload the file to your server.
|
|
98
149
|
(retter) git push [remote] [branch] # heroku, github pages, etc..
|
99
150
|
~~~~
|
100
151
|
|
101
|
-
|
152
|
+
後述するコールバックを設定しておくことで、さらに手数を減らすことも可能です。
|
153
|
+
|
154
|
+
### 特定の日付の記事を編集する - Edit article (specific date).
|
155
|
+
|
156
|
+
昨日、明日、過去や未来の日付を指定して記事を編集・プレビューするには、 `--date` オプションを用います。
|
157
|
+
|
158
|
+
`--date` option is available in `edit` `preview` sub-command.
|
159
|
+
|
160
|
+
~~~~
|
161
|
+
retter edit --date 20110101
|
162
|
+
retter preview --date 20110101
|
163
|
+
~~~~
|
164
|
+
|
165
|
+
### コールバック - Callbacks
|
102
166
|
|
103
|
-
|
167
|
+
コールバックはいくつかのサブコマンド(edit bind rebind commit)の実行直後に自動的に実行されます。
|
168
|
+
コールバックを定義しておくことで、手数の多い割に代わり映えのしない作業を自動化することができます。
|
104
169
|
|
105
170
|
Callback is enabled in `edit`, `bind`, `rebind` and `commit` sub-command.
|
106
171
|
|
172
|
+
#### Syntax
|
173
|
+
|
107
174
|
~~~~ruby
|
108
175
|
after [command], [invoke command or proc]
|
109
176
|
~~~~
|
110
177
|
|
178
|
+
#### HTMLの生成時、デプロイまでの作業を自動化する - Auto deploying
|
179
|
+
|
111
180
|
以下のような内容を Retterfile に記述しておくことで、rebind または bind が実行されると即座に公開までの処理も実行されます。
|
112
181
|
|
113
182
|
In Retterfile:
|
114
183
|
|
115
184
|
~~~~ruby
|
116
|
-
after :rebind, :commit
|
185
|
+
after :rebind, :commit # git commit
|
117
186
|
|
118
|
-
after :commit do
|
187
|
+
after :commit do # deploy
|
119
188
|
system "cd #{config.retter_home}"
|
120
189
|
system 'git push origin master'
|
121
190
|
end
|
122
191
|
~~~~
|
123
192
|
|
193
|
+
もし毎回デプロイするのが煩わしい場合は、`--silent`オプションを付けることでコールバックを回避できます。
|
194
|
+
その場合は`retter rebind`ではなく`retter rebind --silent`を実行することになります。
|
195
|
+
|
124
196
|
`--silent` option skip the callback.
|
125
197
|
|
126
|
-
|
198
|
+
#### エディタを終了したとき即座にプレビューする - Auto preview
|
127
199
|
|
128
|
-
|
200
|
+
記事を編集しエディタを終了したあとブラウザでプレビューしたい場合は、`edit`へのコールバックを設定できます。
|
129
201
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
retter preview --date=20110101
|
202
|
+
~~~~ruby
|
203
|
+
after :edit do
|
204
|
+
preview if yes?("Preview now? [yes/no]")
|
205
|
+
end
|
135
206
|
~~~~
|
136
207
|
|
137
|
-
|
208
|
+
もしもコールバックを毎回実行したくない場合、`--silent`を指定する以外に、上記のように確認プロンプトを表示させるという方法もあります。
|
138
209
|
|
139
|
-
|
210
|
+
#### コールバック呼出し
|
140
211
|
|
141
|
-
|
212
|
+
コマンド実行後にコールバックだけを再度実行したい場面では、`callback`サブコマンドを使用できます。
|
142
213
|
|
143
214
|
~~~~
|
144
|
-
$ retter
|
215
|
+
$ retter callback --after edit
|
145
216
|
~~~~
|
146
217
|
|
147
|
-
|
148
|
-
|
149
|
-
~~~~
|
150
|
-
$ cd /path/to/my_sweet_diary
|
151
|
-
$ bundle exec rackup
|
152
|
-
~~~~
|
153
|
-
|
154
|
-
### Pre-installed themes
|
218
|
+
### 組込みテーマ - Pre-installed themes
|
155
219
|
|
156
220
|
スタイルシートを変更することでテーマを変更できます。HTMLのヘッダを変更するには `layouts/retter.html.haml` を編集します。
|
221
|
+
スタイルシートの指定を変更し、`retter rebind`コマンドを実行するとすべてのページが更新されます。
|
157
222
|
|
158
223
|
#### Default
|
159
224
|
|
@@ -171,15 +236,34 @@ Or, Use rack if needed.
|
|
171
236
|
|
172
237
|
![Orange](http://hibariya.github.com/images/theme_samples/retter_orange.jpg)
|
173
238
|
|
239
|
+
### HTMLの修正 - HTML Layout
|
240
|
+
|
241
|
+
HTMLのレイアウト自体を変更するには`layouts/`ディレクトリ以下のHAMLファイルを修正します。
|
242
|
+
これらのファイルを変更したとしても、`retter rebind`コマンドを実行するまでは反映されません。
|
243
|
+
|
244
|
+
~~~~
|
245
|
+
layouts
|
246
|
+
|-- article.html.haml
|
247
|
+
|-- entries.html.haml
|
248
|
+
|-- entry.html.haml
|
249
|
+
|-- index.html.haml
|
250
|
+
|-- profile.html.haml
|
251
|
+
`-- retter.html.haml
|
252
|
+
~~~~
|
253
|
+
|
254
|
+
`retter.html.haml`はHTML宣言を含めた全体のHTMLが含まれています。
|
255
|
+
`entry.html.haml`を変更することで日別のページのレイアウトを変更することができます。
|
256
|
+
`article.html.haml`を変更することで個々の記事のレイアウトを変更することができます。
|
257
|
+
その他のファイルは実際のURLと名前が対応しています。
|
258
|
+
|
174
259
|
## LICENSE
|
175
260
|
|
176
261
|
The MIT License
|
177
262
|
|
178
|
-
Copyright (c) 2011 hibariya
|
263
|
+
Copyright (c) 2011 hibariya, uzura29
|
179
264
|
|
180
265
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
181
266
|
|
182
267
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
183
268
|
|
184
269
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
185
|
-
|
data/bin/retter
CHANGED
@@ -5,9 +5,16 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
|
5
5
|
|
6
6
|
require 'retter'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
case ARGV[0]
|
9
|
+
when 'new'
|
10
|
+
Retter::Generator::Creator.start ARGV[1..-1]
|
11
|
+
when 'gen'
|
12
|
+
Retter::Generator::Updator.start ARGV[1..-1]
|
11
13
|
else
|
12
|
-
|
14
|
+
begin
|
15
|
+
Retter::Command.start
|
16
|
+
rescue Errno::ENOENT
|
17
|
+
$stderr.puts "Some files might be broken. run `retter gen $RETTER_HOME`"
|
18
|
+
raise
|
19
|
+
end
|
13
20
|
end
|
data/lib/retter/command.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
class Retter::Command < Thor
|
4
|
+
map '-v' => :version,
|
5
|
+
'-e' => :edit,
|
6
|
+
'-p' => :preview,
|
7
|
+
'-o' => :open,
|
8
|
+
'-r' => :rebind,
|
9
|
+
'-b' => :bind,
|
10
|
+
'-h' => :home
|
11
|
+
|
4
12
|
desc 'edit', 'Open $EDITOR. Write an article with Markdown.'
|
5
13
|
method_options date: :string, silent: :boolean
|
6
14
|
def edit
|
@@ -64,6 +72,12 @@ class Retter::Command < Thor
|
|
64
72
|
say 'bye', :green
|
65
73
|
end
|
66
74
|
|
75
|
+
desc 'callback', 'Call a callback process only'
|
76
|
+
method_options after: :string
|
77
|
+
def callback
|
78
|
+
invoke_after options[:after].intern
|
79
|
+
end
|
80
|
+
|
67
81
|
desc 'new', 'Create a new site'
|
68
82
|
def new; end
|
69
83
|
|
@@ -72,6 +86,11 @@ class Retter::Command < Thor
|
|
72
86
|
say Retter::Command.usage, :green
|
73
87
|
end
|
74
88
|
|
89
|
+
desc 'version', 'Show version.'
|
90
|
+
def version
|
91
|
+
say "Retter version #{Retter::VERSION}"
|
92
|
+
end
|
93
|
+
|
75
94
|
private
|
76
95
|
|
77
96
|
def detected_retter_file
|
data/lib/retter/config.rb
CHANGED
@@ -14,6 +14,7 @@ class Retter::Config
|
|
14
14
|
:layout_file,
|
15
15
|
:profile_layout_file,
|
16
16
|
:entry_layout_file,
|
17
|
+
:article_layout_file,
|
17
18
|
:entries_layout_file,
|
18
19
|
:index_layout_file,
|
19
20
|
:entries_dir,
|
@@ -55,6 +56,7 @@ class Retter::Config
|
|
55
56
|
layout_file layouts_dir.join('retter.html.haml')
|
56
57
|
profile_layout_file layouts_dir.join('profile.html.haml')
|
57
58
|
entry_layout_file layouts_dir.join('entry.html.haml')
|
59
|
+
article_layout_file layouts_dir.join('article.html.haml')
|
58
60
|
entries_layout_file layouts_dir.join('entries.html.haml')
|
59
61
|
index_layout_file layouts_dir.join('index.html.haml')
|
60
62
|
entries_dir retter_home.join('entries/')
|
@@ -66,7 +68,7 @@ class Retter::Config
|
|
66
68
|
|
67
69
|
def load_retterfile_if_exists
|
68
70
|
retterfile = retter_home.join('Retterfile')
|
69
|
-
instance_eval retterfile.read if retterfile.exist?
|
71
|
+
instance_eval retterfile.read, retterfile.to_s if retterfile.exist?
|
70
72
|
end
|
71
73
|
|
72
74
|
def detect_retter_home
|
@@ -82,8 +84,12 @@ class Retter::Config
|
|
82
84
|
entries_dir.join date.strftime('%Y%m%d.html')
|
83
85
|
end
|
84
86
|
|
87
|
+
def entry_dir(date)
|
88
|
+
entries_dir.join date.strftime('%Y%m%d')
|
89
|
+
end
|
90
|
+
|
85
91
|
def self.delegatables
|
86
|
-
ATTRIBUTES + [:retter_file, :entry_file]
|
92
|
+
ATTRIBUTES + [:retter_file, :entry_file, :entry_dir]
|
87
93
|
end
|
88
94
|
|
89
95
|
def after(name, sym = nil, &block)
|
data/lib/retter/entry.rb
CHANGED
@@ -1,13 +1,22 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
class Retter::Entry
|
4
|
-
|
4
|
+
class Article
|
5
|
+
attr_accessor :entry, :id, :title, :body
|
6
|
+
|
7
|
+
def to_s
|
8
|
+
body
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_accessor :date, :lede, :body, :articles
|
5
13
|
|
6
14
|
def initialize(attrs={})
|
7
15
|
@date, @body = attrs.values_at(:date, :body)
|
8
16
|
|
9
17
|
attach_titles
|
10
|
-
|
18
|
+
extract_articles
|
19
|
+
load_lede
|
11
20
|
end
|
12
21
|
|
13
22
|
def to_s
|
@@ -29,9 +38,28 @@ class Retter::Entry
|
|
29
38
|
@body = html.search('//body/*').to_s
|
30
39
|
end
|
31
40
|
|
32
|
-
def
|
33
|
-
@
|
34
|
-
|
41
|
+
def extract_articles
|
42
|
+
@articles = body_elements.search('body > *').each_with_object([]) {|c, r|
|
43
|
+
if c.name == 'h1'
|
44
|
+
article = Article.new
|
45
|
+
article.entry = self
|
46
|
+
article.id = c.attr('id')
|
47
|
+
article.title = c.text
|
48
|
+
article.body = ''
|
49
|
+
r << article
|
50
|
+
else
|
51
|
+
article = r.last
|
52
|
+
next if article.nil?
|
53
|
+
|
54
|
+
article.body += c.to_s
|
55
|
+
end
|
56
|
+
} || []
|
57
|
+
end
|
58
|
+
|
59
|
+
def load_lede
|
60
|
+
@lede = body_elements.search('body > *').each_with_object('') {|c, r|
|
61
|
+
break r if c.name == 'h1'
|
62
|
+
r<< c.to_s
|
35
63
|
}
|
36
64
|
end
|
37
65
|
end
|
@@ -6,7 +6,7 @@ require 'bundler'
|
|
6
6
|
require 'bundler/cli'
|
7
7
|
require 'retter'
|
8
8
|
|
9
|
-
class
|
9
|
+
class Retter::Generator::Base < Thor::Group
|
10
10
|
TEMPLATES = %w(
|
11
11
|
Retterfile
|
12
12
|
Gemfile
|
@@ -14,6 +14,7 @@ class Newretter < Thor::Group
|
|
14
14
|
index.html
|
15
15
|
layouts/entries.html.haml
|
16
16
|
layouts/entry.html.haml
|
17
|
+
layouts/article.html.haml
|
17
18
|
layouts/profile.html.haml
|
18
19
|
layouts/index.html.haml
|
19
20
|
layouts/retter.html.haml
|
@@ -60,35 +61,4 @@ class Newretter < Thor::Group
|
|
60
61
|
|
61
62
|
FileUtils.cd pwd
|
62
63
|
end
|
63
|
-
|
64
|
-
def git_init
|
65
|
-
Grit::Repo.init "#{Dir.pwd}/#{name}"
|
66
|
-
end
|
67
|
-
|
68
|
-
def notice_how_to_use
|
69
|
-
editor = ENV['EDITOR']
|
70
|
-
|
71
|
-
say "-- Thanks for flying Retter :-> --\n", :green
|
72
|
-
say <<-EOM, :green
|
73
|
-
Setting $EDITOR:
|
74
|
-
retter *requires* $EDITOR variable.
|
75
|
-
example:
|
76
|
-
echo "export EDITOR=vim" >> ~/.zshenv # or ~/.bash_profile
|
77
|
-
. ~/.zshenv
|
78
|
-
EOM
|
79
|
-
|
80
|
-
say " Current your $EDITOR is #{editor ? editor : 'undefined'}.\n", :red
|
81
|
-
|
82
|
-
say <<-EOM, :green
|
83
|
-
Setting $RETTER_HOME:
|
84
|
-
You can use retter command anywhere, If you set $RETTER_HOME variable.
|
85
|
-
example:
|
86
|
-
echo "export RETTER_HOME=#{Dir.pwd}/#{name}" >> ~/.zshenv
|
87
|
-
...
|
88
|
-
|
89
|
-
See also:
|
90
|
-
retter usage
|
91
|
-
retter help
|
92
|
-
EOM
|
93
|
-
end
|
94
64
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Retter::Generator::Creator < Retter::Generator::Base
|
4
|
+
def git_init
|
5
|
+
Grit::Repo.init "#{Dir.pwd}/#{name}"
|
6
|
+
end
|
7
|
+
|
8
|
+
def notice_how_to_use
|
9
|
+
editor = ENV['EDITOR']
|
10
|
+
|
11
|
+
say "-- Thanks for flying Retter :-> --\n", :green
|
12
|
+
say <<-EOM, :green
|
13
|
+
Setting $EDITOR:
|
14
|
+
retter *requires* $EDITOR variable.
|
15
|
+
example:
|
16
|
+
echo "export EDITOR=vim" >> ~/.zshenv # or ~/.bash_profile
|
17
|
+
. ~/.zshenv
|
18
|
+
EOM
|
19
|
+
|
20
|
+
say " Current your $EDITOR is #{editor ? editor : 'undefined'}.\n", :red
|
21
|
+
|
22
|
+
say <<-EOM, :green
|
23
|
+
Setting $RETTER_HOME:
|
24
|
+
You can use retter command anywhere, If you set $RETTER_HOME variable.
|
25
|
+
example:
|
26
|
+
echo "export RETTER_HOME=#{Dir.pwd}/#{name}" >> ~/.zshenv
|
27
|
+
...
|
28
|
+
|
29
|
+
See also:
|
30
|
+
retter usage
|
31
|
+
retter help
|
32
|
+
EOM
|
33
|
+
end
|
34
|
+
end
|
@@ -16,6 +16,12 @@ author '<%= ENV["USER"] %>'
|
|
16
16
|
#
|
17
17
|
## Using proc example:
|
18
18
|
# after :commit do
|
19
|
-
#
|
20
|
-
#
|
19
|
+
# if yes?("Deploy now? [yes/no]")
|
20
|
+
# system "cd #{config.retter_home}"
|
21
|
+
# system 'git push origin master'
|
22
|
+
# end
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# after :edit do
|
26
|
+
# preview if yes?("Preview now? [yes/no]")
|
21
27
|
# end
|
@@ -4,6 +4,6 @@
|
|
4
4
|
%li
|
5
5
|
%a.entry{href: entry_path(entry.date)}= entry.date.strftime('%Y/%m/%d')
|
6
6
|
%ul.titles
|
7
|
-
- entry.
|
7
|
+
- entry.articles.each do |article|
|
8
8
|
%li
|
9
|
-
%a.title{href:
|
9
|
+
%a.title{href: article_path(entry.date, article.id)}= article.title
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%article
|
2
|
+
%h1.date
|
3
|
+
%a{href: entry_path(entry.date)}= entry.date.strftime('%Y/%m/%d')
|
4
|
+
- unless entry.lede.empty?
|
5
|
+
= entry.lede
|
6
|
+
- entry.articles.each do |article|
|
7
|
+
%h1{id: article.id}
|
8
|
+
%a{href: article_path(entry.date, article.id)}= article.title
|
9
|
+
= article
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#entries
|
2
|
+
- entries[0..5].each do |entry|
|
3
|
+
%article
|
4
|
+
%h1.date
|
5
|
+
%a{href: entry_path(entry.date)}= entry.date.strftime('%Y/%m/%d')
|
6
|
+
- unless entry.lede.empty?
|
7
|
+
= entry.lede
|
8
|
+
- entry.articles.each do |article|
|
9
|
+
%h1{id: article.id}
|
10
|
+
%a{href: article_path(entry.date, article.id)}= article.title
|
11
|
+
= article
|
@@ -1,7 +1,7 @@
|
|
1
1
|
!!!
|
2
2
|
%html
|
3
3
|
%head
|
4
|
-
%title=
|
4
|
+
%title= title
|
5
5
|
%meta{:'http-equiv' => 'Content-Type', content: 'text/html', charset: 'utf-8'}
|
6
6
|
%link{rel: 'icon', type: 'image/png', href: '/favicon.png'}
|
7
7
|
%link{href: '/stylesheets/base.css', media: 'screen', rel: 'stylesheet', type: 'text/css'}
|
@@ -32,22 +32,44 @@ module Retter::Stationery
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def bind_entries
|
35
|
-
@entries.each
|
35
|
+
@entries.each do |entry|
|
36
|
+
print_entry entry
|
37
|
+
print_articles entry
|
38
|
+
end
|
39
|
+
|
36
40
|
print_toc
|
37
41
|
end
|
38
42
|
|
39
43
|
def print_entry(entry)
|
44
|
+
title = "#{entry.date.strftime('%Y/%m/%d')} - #{config.title}"
|
40
45
|
part = entry_renderer.render(view_scope, entry: entry)
|
41
|
-
html = layout_renderer.render(view_scope, content: part)
|
46
|
+
html = layout_renderer.render(view_scope, content: part, title: title)
|
42
47
|
|
43
48
|
entry_file(entry.date).open('w') do |f|
|
44
49
|
f.puts View::Helper.fix_path(html, '../')
|
45
50
|
end
|
46
51
|
end
|
47
52
|
|
53
|
+
def print_articles(entry)
|
54
|
+
return if entry.articles.empty?
|
55
|
+
|
56
|
+
entry_dir = config.entry_dir(entry.date)
|
57
|
+
entry_dir.mkdir unless entry_dir.directory?
|
58
|
+
|
59
|
+
entry.articles.each do |article|
|
60
|
+
title = "#{article.title} - #{config.title}"
|
61
|
+
part = article_renderer.render(view_scope, entry: entry, article: article)
|
62
|
+
html = layout_renderer.render(view_scope, content: part, title: title)
|
63
|
+
|
64
|
+
entry_dir.join("#{article.id}.html").open('w') do |f|
|
65
|
+
f.puts View::Helper.fix_path(html, '../../')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
48
70
|
def print_index
|
49
71
|
part = Haml::Engine.new(index_layout_file.read, ugly: true).render(view_scope)
|
50
|
-
html = layout_renderer.render(view_scope, content: part)
|
72
|
+
html = layout_renderer.render(view_scope, content: part, title: config.title)
|
51
73
|
|
52
74
|
index_file.open('w') do |f|
|
53
75
|
f.puts View::Helper.fix_path(html, './')
|
@@ -56,7 +78,7 @@ module Retter::Stationery
|
|
56
78
|
|
57
79
|
def print_profile
|
58
80
|
part = Haml::Engine.new(profile_layout_file.read, ugly: true).render(view_scope)
|
59
|
-
html = layout_renderer.render(view_scope, content: part)
|
81
|
+
html = layout_renderer.render(view_scope, content: part, title: config.title)
|
60
82
|
|
61
83
|
profile_file.open('w') do |f|
|
62
84
|
f.puts View::Helper.fix_path(html, './')
|
@@ -65,7 +87,7 @@ module Retter::Stationery
|
|
65
87
|
|
66
88
|
def print_toc
|
67
89
|
part = Haml::Engine.new(entries_layout_file.read, ugly: true).render(view_scope)
|
68
|
-
html = layout_renderer.render(view_scope, content: part)
|
90
|
+
html = layout_renderer.render(view_scope, content: part, title: config.title)
|
69
91
|
|
70
92
|
entries_file.open('w') do |f|
|
71
93
|
f.puts View::Helper.fix_path(html, './')
|
@@ -120,5 +142,9 @@ module Retter::Stationery
|
|
120
142
|
def entry_renderer
|
121
143
|
@entry_renderer ||= Haml::Engine.new(entry_layout_file.read, ugly: true)
|
122
144
|
end
|
145
|
+
|
146
|
+
def article_renderer
|
147
|
+
@article_renderer ||= Haml::Engine.new(article_layout_file.read, ugly: true)
|
148
|
+
end
|
123
149
|
end
|
124
150
|
end
|
@@ -46,7 +46,7 @@ module Retter::Stationery
|
|
46
46
|
def print_html
|
47
47
|
scope = View::Scope.new(config)
|
48
48
|
part = entry_renderer.render(scope, entry: @entry)
|
49
|
-
html = renderer.render(scope, content: part, entries: [@entry])
|
49
|
+
html = renderer.render(scope, content: part, title: config.title, entries: [@entry])
|
50
50
|
|
51
51
|
file_path.open('w') do |file|
|
52
52
|
file.puts View::Helper.fix_path(html, './')
|
data/lib/retter/version.rb
CHANGED
data/lib/retter.rb
CHANGED
data/retter.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ["hibariya", "uzura29"]
|
9
9
|
s.email = ["celluloid.key@gmail.com"]
|
10
10
|
s.homepage = "https://github.com/hibariya/retter"
|
11
|
-
s.summary = %q{
|
12
|
-
s.description = %q{
|
11
|
+
s.summary = %q{Flyweight diary workflow}
|
12
|
+
s.description = %q{Flyweight diary workflow. ruby-1.9.2 or later is required.}
|
13
13
|
|
14
14
|
#s.rubyforge_project = "retter"
|
15
15
|
|
@@ -32,5 +32,6 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.add_development_dependency 'ir_b', ['>= 1.4.0']
|
33
33
|
s.add_development_dependency 'tapp', ['>= 1.1.0']
|
34
34
|
s.add_development_dependency 'rspec', ['>= 2.6.0']
|
35
|
+
s.add_development_dependency 'fuubar', ['>= 0.0.6']
|
35
36
|
s.add_development_dependency 'simplecov', ['>= 0.5.3']
|
36
37
|
end
|
@@ -2,28 +2,17 @@
|
|
2
2
|
|
3
3
|
require File.dirname(__FILE__) + '/../spec_helper'
|
4
4
|
|
5
|
-
describe 'Retter::Command#
|
5
|
+
describe 'Retter::Command#callback', clean: :all do
|
6
6
|
let(:command) { Retter::Command.new }
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
command.stub!(:config) { retter_config }
|
8
|
+
before do
|
9
|
+
command.stub!(:config) { retter_config }
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
retter_config.after(:edit) { commit }
|
12
|
+
command.should_receive(:commit).and_return(true)
|
15
13
|
|
16
|
-
|
14
|
+
command.stub!(:options) { {after: :edit} }
|
17
15
|
end
|
18
16
|
|
19
|
-
|
20
|
-
before do
|
21
|
-
command.stub!(:config) { retter_config }
|
22
|
-
|
23
|
-
retter_config.after(:edit, :commit)
|
24
|
-
command.should_receive(:invoke).with(:commit).and_return(true)
|
25
|
-
end
|
26
|
-
|
27
|
-
it { command.edit.should }
|
28
|
-
end
|
17
|
+
it { command.callback.should }
|
29
18
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
4
|
+
|
5
|
+
describe 'Retter::Command#invoke_after', clean: :all do
|
6
|
+
let(:command) { Retter::Command.new }
|
7
|
+
|
8
|
+
context 'invoke with proc' do
|
9
|
+
before do
|
10
|
+
command.stub!(:config) { retter_config }
|
11
|
+
|
12
|
+
retter_config.after(:edit) { commit }
|
13
|
+
command.should_receive(:commit).and_return(true)
|
14
|
+
end
|
15
|
+
|
16
|
+
it { command.edit.should }
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'invoke with symbol' do
|
20
|
+
before do
|
21
|
+
command.stub!(:config) { retter_config }
|
22
|
+
|
23
|
+
retter_config.after(:edit, :commit)
|
24
|
+
command.should_receive(:invoke).with(:commit).and_return(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it { command.edit.should }
|
28
|
+
end
|
29
|
+
end
|
@@ -23,7 +23,7 @@ describe 'Retter::Command#preview', clean: :all do
|
|
23
23
|
command.preview
|
24
24
|
end
|
25
25
|
|
26
|
-
subject { texts_of(preview, '
|
26
|
+
subject { texts_of(preview, 'article p') }
|
27
27
|
|
28
28
|
it { should == [article] }
|
29
29
|
end
|
@@ -42,7 +42,7 @@ describe 'Retter::Command#preview', clean: :all do
|
|
42
42
|
command.preview
|
43
43
|
end
|
44
44
|
|
45
|
-
subject { texts_of(preview, '
|
45
|
+
subject { texts_of(preview, 'article p') }
|
46
46
|
|
47
47
|
it { should_not be_include('おやすみなさい') }
|
48
48
|
it { should be_include(article) }
|
data/spec/command/rebind_spec.rb
CHANGED
@@ -40,9 +40,9 @@ describe 'Retter::Command#rebind', clean: :all do
|
|
40
40
|
describe 'index.html' do
|
41
41
|
let(:index_html) { retter_config.index_file.read }
|
42
42
|
|
43
|
-
it { texts_of(index_html, '
|
44
|
-
it { texts_of(index_html, '
|
45
|
-
it { texts_of(index_html, '
|
43
|
+
it { texts_of(index_html, 'article p').should include('おはようございます') }
|
44
|
+
it { texts_of(index_html, 'article h1.date').should == %w(2011/01/01) }
|
45
|
+
it { texts_of(index_html, 'article h1').should == %w(2011/01/01 朝11時 夜1時) }
|
46
46
|
end
|
47
47
|
|
48
48
|
describe 'entries.html' do
|
@@ -55,9 +55,51 @@ describe 'Retter::Command#rebind', clean: :all do
|
|
55
55
|
describe 'entry.html' do
|
56
56
|
let(:entry_html) { retter_config.entry_file(Date.parse(date_str)).read }
|
57
57
|
|
58
|
-
it { texts_of(entry_html, '
|
59
|
-
it { texts_of(entry_html, '
|
60
|
-
it { texts_of(entry_html, '
|
58
|
+
it { texts_of(entry_html, 'article p').should == %w(おはようございます おやすみなさい) }
|
59
|
+
it { texts_of(entry_html, 'article h1.date').should == %w(2011/01/01) }
|
60
|
+
it { texts_of(entry_html, 'article h1').should == %w(2011/01/01 朝11時 夜1時) }
|
61
|
+
end
|
62
|
+
|
63
|
+
describe 'entry part(first)' do
|
64
|
+
let(:part_html) { retter_config.entry_dir(Date.parse(date_str)).join('a0.html').read }
|
65
|
+
|
66
|
+
describe 'body' do
|
67
|
+
subject { texts_of(part_html, 'article p') }
|
68
|
+
it { should include('おはようございます') }
|
69
|
+
it { should_not include('おやすみなさい') }
|
70
|
+
end
|
71
|
+
|
72
|
+
describe 'date' do
|
73
|
+
subject { texts_of(part_html, 'article h1.date') }
|
74
|
+
it { should == %w(2011/01/01) }
|
75
|
+
end
|
76
|
+
|
77
|
+
describe 'headings' do
|
78
|
+
subject { texts_of(part_html, 'article h1') }
|
79
|
+
it { should include('朝11時') }
|
80
|
+
it { should_not include('夜1時') }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe 'entry part(last)' do
|
85
|
+
let(:part_html) { retter_config.entry_dir(Date.parse(date_str)).join('a1.html').read }
|
86
|
+
|
87
|
+
describe 'body' do
|
88
|
+
subject { texts_of(part_html, 'article p') }
|
89
|
+
it { should include('おやすみなさい') }
|
90
|
+
it { should_not include('おはようございます') }
|
91
|
+
end
|
92
|
+
|
93
|
+
describe 'date' do
|
94
|
+
subject { texts_of(part_html, 'article h1.date') }
|
95
|
+
it { should == %w(2011/01/01) }
|
96
|
+
end
|
97
|
+
|
98
|
+
describe 'headings' do
|
99
|
+
subject { texts_of(part_html, 'article h1') }
|
100
|
+
it { should include('夜1時') }
|
101
|
+
it { should_not include('朝11時') }
|
102
|
+
end
|
61
103
|
end
|
62
104
|
end
|
63
105
|
|
data/spec/spec_helper.rb
CHANGED
@@ -15,7 +15,7 @@ RSpec.configure do |config|
|
|
15
15
|
config.run_all_when_everything_filtered = true
|
16
16
|
|
17
17
|
retter_home = RETTER_ROOT.join('tmp', 'test')
|
18
|
-
skel = RETTER_ROOT.join('lib', 'generator', 'skel')
|
18
|
+
skel = RETTER_ROOT.join('lib', 'retter', 'generator', 'skel')
|
19
19
|
|
20
20
|
config.before(:each, clean: :all) do
|
21
21
|
FileUtils.cp_r skel, retter_home.dirname.join('test')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-10-11 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
17
|
-
requirement: &
|
17
|
+
requirement: &70099608665480 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 0.14.6
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70099608665480
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: builder
|
28
|
-
requirement: &
|
28
|
+
requirement: &70099608664900 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 3.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70099608664900
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: redcarpet
|
39
|
-
requirement: &
|
39
|
+
requirement: &70099608664340 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 2.0.0b3
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70099608664340
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: coderay
|
50
|
-
requirement: &
|
50
|
+
requirement: &70099608663780 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 0.9.8
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *70099608663780
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: nokogiri
|
61
|
-
requirement: &
|
61
|
+
requirement: &70099608663200 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 1.5.0
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *70099608663200
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: launchy
|
72
|
-
requirement: &
|
72
|
+
requirement: &70099608662620 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 2.0.5
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *70099608662620
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: haml
|
83
|
-
requirement: &
|
83
|
+
requirement: &70099608662020 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ! '>='
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: 3.1.3
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *70099608662020
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: bundler
|
94
|
-
requirement: &
|
94
|
+
requirement: &70099608661500 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
@@ -99,10 +99,10 @@ dependencies:
|
|
99
99
|
version: '1.0'
|
100
100
|
type: :runtime
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *70099608661500
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: grit
|
105
|
-
requirement: &
|
105
|
+
requirement: &70099608660900 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
@@ -110,10 +110,10 @@ dependencies:
|
|
110
110
|
version: 2.4.1
|
111
111
|
type: :runtime
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *70099608660900
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: rake
|
116
|
-
requirement: &
|
116
|
+
requirement: &70099608660380 !ruby/object:Gem::Requirement
|
117
117
|
none: false
|
118
118
|
requirements:
|
119
119
|
- - ! '>='
|
@@ -121,10 +121,10 @@ dependencies:
|
|
121
121
|
version: 0.9.2
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
|
-
version_requirements: *
|
124
|
+
version_requirements: *70099608660380
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: ir_b
|
127
|
-
requirement: &
|
127
|
+
requirement: &70099608659820 !ruby/object:Gem::Requirement
|
128
128
|
none: false
|
129
129
|
requirements:
|
130
130
|
- - ! '>='
|
@@ -132,10 +132,10 @@ dependencies:
|
|
132
132
|
version: 1.4.0
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
|
-
version_requirements: *
|
135
|
+
version_requirements: *70099608659820
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: tapp
|
138
|
-
requirement: &
|
138
|
+
requirement: &70099608659240 !ruby/object:Gem::Requirement
|
139
139
|
none: false
|
140
140
|
requirements:
|
141
141
|
- - ! '>='
|
@@ -143,10 +143,10 @@ dependencies:
|
|
143
143
|
version: 1.1.0
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
|
-
version_requirements: *
|
146
|
+
version_requirements: *70099608659240
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: rspec
|
149
|
-
requirement: &
|
149
|
+
requirement: &70099608658740 !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
152
152
|
- - ! '>='
|
@@ -154,10 +154,21 @@ dependencies:
|
|
154
154
|
version: 2.6.0
|
155
155
|
type: :development
|
156
156
|
prerelease: false
|
157
|
-
version_requirements: *
|
157
|
+
version_requirements: *70099608658740
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: fuubar
|
160
|
+
requirement: &70099608658160 !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 0.0.6
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: *70099608658160
|
158
169
|
- !ruby/object:Gem::Dependency
|
159
170
|
name: simplecov
|
160
|
-
requirement: &
|
171
|
+
requirement: &70099608657600 !ruby/object:Gem::Requirement
|
161
172
|
none: false
|
162
173
|
requirements:
|
163
174
|
- - ! '>='
|
@@ -165,8 +176,8 @@ dependencies:
|
|
165
176
|
version: 0.5.3
|
166
177
|
type: :development
|
167
178
|
prerelease: false
|
168
|
-
version_requirements: *
|
169
|
-
description:
|
179
|
+
version_requirements: *70099608657600
|
180
|
+
description: Flyweight diary workflow. ruby-1.9.2 or later is required.
|
170
181
|
email:
|
171
182
|
- celluloid.key@gmail.com
|
172
183
|
executables:
|
@@ -175,36 +186,41 @@ extensions: []
|
|
175
186
|
extra_rdoc_files: []
|
176
187
|
files:
|
177
188
|
- .gitignore
|
189
|
+
- .rspec
|
178
190
|
- .travis.yml
|
179
191
|
- Gemfile
|
180
192
|
- README.md
|
181
193
|
- Rakefile
|
182
194
|
- bin/retter
|
183
|
-
- lib/generator/newretter.rb
|
184
|
-
- lib/generator/skel/.gitignore
|
185
|
-
- lib/generator/skel/Gemfile
|
186
|
-
- lib/generator/skel/Retterfile
|
187
|
-
- lib/generator/skel/config.ru
|
188
|
-
- lib/generator/skel/entries/.gitkeep
|
189
|
-
- lib/generator/skel/images/.gitkeep
|
190
|
-
- lib/generator/skel/images/orange/bg_body.jpg
|
191
|
-
- lib/generator/skel/images/orange/bg_entry.jpg
|
192
|
-
- lib/generator/skel/images/orange/bg_header.png
|
193
|
-
- lib/generator/skel/index.html
|
194
|
-
- lib/generator/skel/javascripts/.gitkeep
|
195
|
-
- lib/generator/skel/layouts/entries.html.haml
|
196
|
-
- lib/generator/skel/layouts/entry.html.haml
|
197
|
-
- lib/generator/skel/layouts/index.html.haml
|
198
|
-
- lib/generator/skel/layouts/profile.html.haml
|
199
|
-
- lib/generator/skel/layouts/retter.html.haml
|
200
|
-
- lib/generator/skel/retters/.gitkeep
|
201
|
-
- lib/generator/skel/stylesheets/base.css
|
202
|
-
- lib/generator/skel/stylesheets/orange.css
|
203
|
-
- lib/generator/skel/stylesheets/retter.css
|
204
195
|
- lib/retter.rb
|
205
196
|
- lib/retter/command.rb
|
206
197
|
- lib/retter/config.rb
|
207
198
|
- lib/retter/entry.rb
|
199
|
+
- lib/retter/generator.rb
|
200
|
+
- lib/retter/generator/base.rb
|
201
|
+
- lib/retter/generator/creator.rb
|
202
|
+
- lib/retter/generator/skel/.gitignore
|
203
|
+
- lib/retter/generator/skel/Gemfile
|
204
|
+
- lib/retter/generator/skel/Retterfile
|
205
|
+
- lib/retter/generator/skel/config.ru
|
206
|
+
- lib/retter/generator/skel/entries/.gitkeep
|
207
|
+
- lib/retter/generator/skel/images/.gitkeep
|
208
|
+
- lib/retter/generator/skel/images/orange/bg_body.jpg
|
209
|
+
- lib/retter/generator/skel/images/orange/bg_entry.jpg
|
210
|
+
- lib/retter/generator/skel/images/orange/bg_header.png
|
211
|
+
- lib/retter/generator/skel/index.html
|
212
|
+
- lib/retter/generator/skel/javascripts/.gitkeep
|
213
|
+
- lib/retter/generator/skel/layouts/article.html.haml
|
214
|
+
- lib/retter/generator/skel/layouts/entries.html.haml
|
215
|
+
- lib/retter/generator/skel/layouts/entry.html.haml
|
216
|
+
- lib/retter/generator/skel/layouts/index.html.haml
|
217
|
+
- lib/retter/generator/skel/layouts/profile.html.haml
|
218
|
+
- lib/retter/generator/skel/layouts/retter.html.haml
|
219
|
+
- lib/retter/generator/skel/retters/.gitkeep
|
220
|
+
- lib/retter/generator/skel/stylesheets/base.css
|
221
|
+
- lib/retter/generator/skel/stylesheets/orange.css
|
222
|
+
- lib/retter/generator/skel/stylesheets/retter.css
|
223
|
+
- lib/retter/generator/updator.rb
|
208
224
|
- lib/retter/stationery.rb
|
209
225
|
- lib/retter/stationery/binder.rb
|
210
226
|
- lib/retter/stationery/previewer.rb
|
@@ -215,6 +231,7 @@ files:
|
|
215
231
|
- spec/command/callback_spec.rb
|
216
232
|
- spec/command/commit_spec.rb
|
217
233
|
- spec/command/edit_spec.rb
|
234
|
+
- spec/command/invoke_after_spec.rb
|
218
235
|
- spec/command/open_spec.rb
|
219
236
|
- spec/command/preview_spec.rb
|
220
237
|
- spec/command/rebind_spec.rb
|
@@ -246,11 +263,12 @@ rubyforge_project:
|
|
246
263
|
rubygems_version: 1.8.6
|
247
264
|
signing_key:
|
248
265
|
specification_version: 3
|
249
|
-
summary:
|
266
|
+
summary: Flyweight diary workflow
|
250
267
|
test_files:
|
251
268
|
- spec/command/callback_spec.rb
|
252
269
|
- spec/command/commit_spec.rb
|
253
270
|
- spec/command/edit_spec.rb
|
271
|
+
- spec/command/invoke_after_spec.rb
|
254
272
|
- spec/command/open_spec.rb
|
255
273
|
- spec/command/preview_spec.rb
|
256
274
|
- spec/command/rebind_spec.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|