tdiary 4.1.1 → 4.1.2

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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/ChangeLog +42 -0
  4. data/Gemfile +2 -11
  5. data/Gemfile.lock +64 -61
  6. data/README.md +4 -2
  7. data/doc/HOWTO-authenticate-in-rack.md +96 -8
  8. data/doc/HOWTO-testing-tDiary.md +1 -1
  9. data/doc/INSTALL-paas.md +19 -54
  10. data/doc/README.en.md +1 -1
  11. data/doc/README.md +1 -1
  12. data/js/comment_ajax.js +1 -1
  13. data/lib/tdiary/application/configuration.rb +5 -9
  14. data/lib/tdiary/application.rb +59 -36
  15. data/lib/tdiary/cli.rb +9 -3
  16. data/lib/tdiary/core_ext.rb +1 -1
  17. data/lib/tdiary/diary_container.rb +55 -0
  18. data/lib/tdiary/environment.rb +3 -0
  19. data/lib/tdiary/plugin/00default.rb +4 -3
  20. data/lib/tdiary/plugin/05referer.rb +9 -7
  21. data/lib/tdiary/plugin.rb +13 -2
  22. data/lib/tdiary/rack/auth/basic.rb +1 -1
  23. data/lib/tdiary/rack/auth/omniauth/authorization.rb +64 -0
  24. data/lib/tdiary/rack/auth/omniauth.rb +78 -46
  25. data/lib/tdiary/rack/auth.rb +20 -0
  26. data/lib/tdiary/rack/session.rb +35 -0
  27. data/lib/tdiary/rack.rb +2 -5
  28. data/lib/tdiary/style.rb +2 -1
  29. data/lib/tdiary/tasks/assets.rake +1 -1
  30. data/lib/tdiary/tasks/release.rake +18 -7
  31. data/lib/tdiary/version.rb +1 -1
  32. data/lib/tdiary.rb +1 -0
  33. data/misc/paas/heroku/Gemfile.local +8 -0
  34. data/misc/paas/heroku/app.json +19 -0
  35. data/misc/paas/heroku/config.ru +6 -0
  36. data/misc/paas/heroku/tasks/mongodb.rake +12 -0
  37. data/misc/paas/heroku/tdiary.conf +14 -14
  38. data/misc/plugin/amazon.rb +9 -1
  39. data/misc/plugin/category.rb +1 -19
  40. data/misc/plugin/category_autocomplete.rb +2 -2
  41. data/misc/plugin/comment_ajax.rb +2 -0
  42. data/misc/plugin/comment_emoji_autocomplete.rb +2 -2
  43. data/misc/plugin/comment_mail-smtp.rb +23 -8
  44. data/misc/plugin/makerss.rb +5 -1
  45. data/misc/plugin/recent_comment3.rb +1 -5
  46. data/misc/plugin/recent_list.rb +1 -5
  47. data/misc/plugin/theme_online.rb +8 -2
  48. data/spec/acceptance/save_conf_plugin_spec.rb +2 -2
  49. data/spec/core/application_spec.rb +65 -0
  50. data/spec/core/diary_container_spec.rb +71 -0
  51. data/spec/core/plugin_spec.rb +13 -0
  52. data/spec/fixtures/tdiary.conf.gem +2 -2
  53. data/spec/fixtures/tdiary.conf.rack +2 -2
  54. data/spec/fixtures/tdiary.conf.secure +2 -2
  55. data/spec/fixtures/tdiary.conf.webrick +2 -2
  56. data/spec/spec_helper.rb +5 -4
  57. metadata +15 -6
  58. data/lib/tdiary/application/extensions/omniauth.rb +0 -22
  59. data/misc/paas/heroku/Gemfile +0 -20
  60. data/misc/paas/heroku/Gemfile.lock +0 -74
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e0cdcd3df43f6f079f1900ed1409dc22e3b57c4
4
- data.tar.gz: 0e11be7ab4835fa702e74c8ade5fe3daf720cee2
3
+ metadata.gz: ff39704729d6f51707c5f7f6798b57b54a7f8f4a
4
+ data.tar.gz: b2395bd9d5f340af43d6c3f40290545053ca5ca4
5
5
  SHA512:
6
- metadata.gz: c65ab2e34e364888e6ea2499ed53d28ba47dd40643b8dd48ffe75a95f1d68e32a7b3cce899f2ee8b918d674b78a938941653d95fc17f83332045921cbd5d987d
7
- data.tar.gz: 2eb47c944e874938e9e5144eba1e539e7042514ec37520c1932df1abe8d0cfa45d8fcf605c40c1ffd989df4488b1873efdbbb22456744a18fdb93464860c396d
6
+ metadata.gz: 1c93b34dcfd979505945f036f88214c4fa7ad0562b5326d82c7a7c609bca5301f08449769868cd161e70676ea253e347cebbaf432e40ea94736c9856eede5625
7
+ data.tar.gz: fb1cf6d5f5d79fb6543709b50dd2aef2a93ab4357371818744227fd49326c072e546660206da16342ae9629b6bdde8ffeb8448f28e1da8f35ad924c27a6c0253
data/.travis.yml CHANGED
@@ -5,9 +5,9 @@ sudo: false
5
5
  services: memcache
6
6
 
7
7
  rvm:
8
- - 1.9.3
9
8
  - 2.0.0
10
9
  - 2.1
10
+ - 2.2
11
11
  - ruby-head
12
12
 
13
13
  cache:
data/ChangeLog CHANGED
@@ -1,3 +1,45 @@
1
+ 2015-03-15 MATSUOKA Kohei <kohei@machu.jp>
2
+ * use omniauth automatically if omniauth gem loaded
3
+ * support some auth providers (twitter, facebook, google, github)
4
+
5
+ 2015-02-25 MATSUOKA Kohei <kohei@machu.jp>
6
+ * support ruby-2.2 and unsupport ruby-1.9.3
7
+
8
+ 2015-02-19 TADA Tadashi <t@tdtds.jp>
9
+ * enable to specify multiple twitter user in OmniAuth
10
+
11
+ 2015-02-02 TADA Tadashi <t@tdtds.jp>
12
+ * Gemfile: work around about rack 1.6 not separate params with ';'. see #485
13
+
14
+ 2015-01-28 TADA Tadashi <t@tdtds.jp>
15
+ * use Rack::Session::Dalli automatically if dalli gem loaded
16
+
17
+ 2015-01-27 TADA Tadashi <t@tdtds.jp>
18
+ * plugin/00default.rb: fix #482 by another code: bad url of og:image
19
+
20
+ 2015-01-26 TADA Tadashi <t@tdtds.jp>
21
+ * accept external JavaScript or CSS URL without scheme
22
+ * plugin/theme_online.rb: support another theme site by options
23
+
24
+ 2015-01-24 TADA Tadashi <t@tdtds.jp>
25
+ * plugin/comment_mail-smtp.rb: use Mail gem instead of Net::SMTP
26
+ * plugin/comment_ajax.rb: set theme_url into js
27
+
28
+ 2015-01-21 MATSUOKA Kohei <kohei@machu.jp>
29
+ * add add_startup_proc plugin interface
30
+ * plugin/makerss.rb: create rdf on startup
31
+
32
+ 2015-01-19 TADA Tadashi <t@tdtds.jp>
33
+ * plugin/amazon.rb: retry by returning error from rpaproxy
34
+
35
+ 2015-01-10 MATSUOKA Kohei <kohei@machu.jp>
36
+ * diary_container.rb: add the model to get diary directoly without using CGI
37
+ * Gemfile: use webrick server as default (to use other server, write in Gemfile.local)
38
+ * cli.rb: add --log option to tdiary server command
39
+
40
+ 2014-12-29 MATSUOKA Kohei <kohei@machu.jp>
41
+ * release 4.1.1
42
+
1
43
  2014-12-27 MATSUOKA Kohei <kohei@machu.jp>
2
44
  * lib/tdiary/application.rb: fix #442: call extensions setup before the core setup
3
45
  * lib/tdiary/application/extensions/omniauth.rb: fix error with base_dir
data/Gemfile CHANGED
@@ -1,26 +1,17 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rack'
3
+ gem 'rack', '~> 1.5.0'
4
4
  gem 'sprockets'
5
5
  gem 'hikidoc'
6
6
  gem 'fastimage'
7
7
  gem 'gemoji'
8
+ gem 'mail'
8
9
 
9
10
  group :coffee do
10
11
  gem 'coffee-script'
11
12
  gem 'therubyracer'
12
13
  end
13
14
 
14
- group :server do
15
- platforms :mri do
16
- gem 'thin'
17
- end
18
-
19
- platforms :jruby do
20
- gem 'trinidad'
21
- end
22
- end
23
-
24
15
  group :development do
25
16
  gem 'pit', require: false
26
17
  gem 'racksh', require: false
data/Gemfile.lock CHANGED
@@ -1,11 +1,9 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.3.6)
5
- byebug (3.5.1)
6
- columnize (~> 0.8)
7
- debugger-linecache (~> 1.2)
8
- slop (~> 3.6)
4
+ addressable (2.3.8)
5
+ byebug (4.0.4)
6
+ columnize (= 0.9.0)
9
7
  capybara (2.4.4)
10
8
  mime-types (>= 1.16)
11
9
  nokogiri (>= 1.3.3)
@@ -18,53 +16,57 @@ GEM
18
16
  coffee-script (2.3.0)
19
17
  coffee-script-source
20
18
  execjs
21
- coffee-script-source (1.8.0)
19
+ coffee-script-source (1.9.1)
22
20
  columnize (0.9.0)
23
- coveralls (0.7.2)
24
- multi_json (~> 1.3)
25
- rest-client (= 1.6.7)
26
- simplecov (>= 0.7)
27
- term-ansicolor (= 1.2.2)
28
- thor (= 0.18.1)
29
- daemons (1.1.9)
30
- debugger-linecache (1.2.0)
21
+ coveralls (0.7.12)
22
+ multi_json (~> 1.10)
23
+ rest-client (>= 1.6.8, < 2)
24
+ simplecov (~> 0.9.1)
25
+ term-ansicolor (~> 1.3)
26
+ thor (~> 0.19.1)
31
27
  diff-lcs (1.2.5)
32
28
  docile (1.1.5)
33
- eventmachine (1.0.4)
34
- execjs (2.2.2)
35
- fastimage (1.6.6)
29
+ domain_name (0.5.23)
30
+ unf (>= 0.0.5, < 1.0.0)
31
+ execjs (2.4.0)
32
+ fastimage (1.6.8)
36
33
  addressable (~> 2.3, >= 2.3.5)
37
- ffi (1.9.6)
34
+ ffi (1.9.8)
38
35
  gemoji (2.1.0)
39
36
  hike (1.2.3)
40
37
  hikidoc (0.1.0)
41
- jasmine (2.1.0)
42
- jasmine-core (~> 2.1.0)
38
+ http-cookie (1.0.2)
39
+ domain_name (~> 0.5)
40
+ jasmine (2.2.0)
41
+ jasmine-core (~> 2.2)
43
42
  phantomjs
44
43
  rack (>= 1.2.1)
45
44
  rake
46
- jasmine-core (2.1.3)
45
+ jasmine-core (2.2.0)
47
46
  launchy (2.4.3)
48
47
  addressable (~> 2.3)
49
48
  libv8 (3.16.14.7)
49
+ mail (2.6.3)
50
+ mime-types (>= 1.16, < 3)
50
51
  method_source (0.8.2)
51
52
  mime-types (2.4.3)
52
- mini_portile (0.6.1)
53
- multi_json (1.10.1)
54
- nokogiri (1.6.5)
53
+ mini_portile (0.6.2)
54
+ multi_json (1.11.0)
55
+ netrc (0.10.3)
56
+ nokogiri (1.6.6.2)
55
57
  mini_portile (~> 0.6.0)
56
- phantomjs (1.9.7.1)
58
+ phantomjs (1.9.8.0)
57
59
  pit (0.0.7)
58
- power_assert (0.2.2)
60
+ power_assert (0.2.3)
59
61
  pry (0.10.1)
60
62
  coderay (~> 1.1.0)
61
63
  method_source (~> 0.8.1)
62
64
  slop (~> 3.4)
63
- pry-byebug (2.0.0)
64
- byebug (~> 3.4)
65
+ pry-byebug (3.1.0)
66
+ byebug (~> 4.0)
65
67
  pry (~> 0.10)
66
- rack (1.6.0)
67
- rack-test (0.6.2)
68
+ rack (1.5.2)
69
+ rack-test (0.6.3)
68
70
  rack (>= 1.0)
69
71
  racksh (1.0.0)
70
72
  rack (>= 1.0)
@@ -72,32 +74,35 @@ GEM
72
74
  rake (10.4.2)
73
75
  redcarpet (3.2.2)
74
76
  ref (1.0.5)
75
- rest-client (1.6.7)
76
- mime-types (>= 1.16)
77
- rspec (3.1.0)
78
- rspec-core (~> 3.1.0)
79
- rspec-expectations (~> 3.1.0)
80
- rspec-mocks (~> 3.1.0)
81
- rspec-core (3.1.7)
82
- rspec-support (~> 3.1.0)
83
- rspec-expectations (3.1.2)
77
+ rest-client (1.8.0)
78
+ http-cookie (>= 1.0.2, < 2.0)
79
+ mime-types (>= 1.16, < 3.0)
80
+ netrc (~> 0.7)
81
+ rspec (3.2.0)
82
+ rspec-core (~> 3.2.0)
83
+ rspec-expectations (~> 3.2.0)
84
+ rspec-mocks (~> 3.2.0)
85
+ rspec-core (3.2.2)
86
+ rspec-support (~> 3.2.0)
87
+ rspec-expectations (3.2.0)
88
+ diff-lcs (>= 1.2.0, < 2.0)
89
+ rspec-support (~> 3.2.0)
90
+ rspec-mocks (3.2.1)
84
91
  diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.1.0)
86
- rspec-mocks (3.1.3)
87
- rspec-support (~> 3.1.0)
88
- rspec-support (3.1.2)
89
- rubyzip (1.1.6)
90
- selenium-webdriver (2.44.0)
92
+ rspec-support (~> 3.2.0)
93
+ rspec-support (3.2.2)
94
+ rubyzip (1.1.7)
95
+ selenium-webdriver (2.45.0)
91
96
  childprocess (~> 0.5)
92
97
  multi_json (~> 1.0)
93
98
  rubyzip (~> 1.0)
94
99
  websocket (~> 1.0)
95
- sequel (4.17.0)
96
- simplecov (0.9.1)
100
+ sequel (4.20.0)
101
+ simplecov (0.9.2)
97
102
  docile (~> 1.1.0)
98
103
  multi_json (~> 1.0)
99
- simplecov-html (~> 0.8.0)
100
- simplecov-html (0.8.0)
104
+ simplecov-html (~> 0.9.0)
105
+ simplecov-html (0.9.0)
101
106
  slop (3.6.0)
102
107
  sprockets (2.12.3)
103
108
  hike (~> 1.2)
@@ -105,20 +110,19 @@ GEM
105
110
  rack (~> 1.0)
106
111
  tilt (~> 1.1, != 1.3.0)
107
112
  sqlite3 (1.3.10)
108
- term-ansicolor (1.2.2)
109
- tins (~> 0.8)
110
- test-unit (3.0.8)
113
+ term-ansicolor (1.3.0)
114
+ tins (~> 1.0)
115
+ test-unit (3.0.9)
111
116
  power_assert
112
117
  therubyracer (0.12.1)
113
118
  libv8 (~> 3.16.14.0)
114
119
  ref
115
- thin (1.6.3)
116
- daemons (~> 1.0, >= 1.0.9)
117
- eventmachine (~> 1.0)
118
- rack (~> 1.0)
119
- thor (0.18.1)
120
+ thor (0.19.1)
120
121
  tilt (1.4.1)
121
- tins (0.13.2)
122
+ tins (1.3.5)
123
+ unf (0.1.4)
124
+ unf_ext
125
+ unf_ext (0.0.6)
122
126
  websocket (1.2.1)
123
127
  xpath (2.0.0)
124
128
  nokogiri (~> 1.3)
@@ -135,9 +139,10 @@ DEPENDENCIES
135
139
  hikidoc
136
140
  jasmine
137
141
  launchy
142
+ mail
138
143
  pit
139
144
  pry-byebug
140
- rack
145
+ rack (~> 1.5.0)
141
146
  racksh
142
147
  rake
143
148
  redcarpet
@@ -149,5 +154,3 @@ DEPENDENCIES
149
154
  sqlite3
150
155
  test-unit
151
156
  therubyracer
152
- thin
153
- trinidad
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # tDiary
2
2
 
3
+ [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://www.heroku.com/deploy?template=https://github.com/tdiary/tdiary-core/tree/heroku)
4
+
3
5
  [![Gem Version](https://badge.fury.io/rb/tdiary.png)](https://rubygems.org/gems/tdiary) [![Build Status](https://secure.travis-ci.org/tdiary/tdiary-core.png)](https://travis-ci.org/tdiary/tdiary-core) [![Coverage Status](https://coveralls.io/repos/tdiary/tdiary-core/badge.png?branch=master)](https://coveralls.io/r/tdiary/tdiary-core) [![Dependency Status](https://gemnasium.com/tdiary/tdiary-core.png)](https://gemnasium.com/tdiary/tdiary-core) [![Code Climate](https://codeclimate.com/github/tdiary/tdiary-core.png)](https://codeclimate.com/github/tdiary/tdiary-core)
4
6
 
5
7
  ## tDiary, The TSUKKOMI-able Weblog.
@@ -18,7 +20,7 @@ tDiaryには以下のような特徴があります。
18
20
 
19
21
  ### レンタルサーバーユーザにやさしい
20
22
 
21
- 必要なのはRuby(1.9.2ないしは2.0.0以降に対応)だけ。単独でCGIとして動作し、基本機能はデータベースや追加のライブラリを必要としません。
23
+ 必要なのはRuby(2.0.0以降に対応)だけ。単独でCGIとして動作し、基本機能はデータベースや追加のライブラリを必要としません。
22
24
 
23
25
  ### プラグインで拡張できます
24
26
 
@@ -30,4 +32,4 @@ tDiaryには以下のような特徴があります。
30
32
 
31
33
  ### その他
32
34
 
33
- インストールにはドキュメント(doc/INSTALL.html)を参照して下さい。動作にはruby(1.9.2以降または2.0.0以降)と、CGIをサポートするWebサーバが必要です。
35
+ インストールにはドキュメント(doc/INSTALL.html)を参照して下さい。動作にはruby(2.0.0以降)と、CGIもしくはRackをサポートするWebサーバが必要です。
@@ -39,24 +39,27 @@ htpasswd -cd .htpasswd username
39
39
 
40
40
  ### ライブラリを有効にする
41
41
 
42
- まず、利用する外部サービスに対応したライブラリを有効にします。Twitter認証では `omniauth-twitter` ライブラリを使用します。Gemfile.localにて以下の行が有効になっていることを確認してください。無ければ追加してください。
42
+ 利用する外部サービスに対応したライブラリを有効にします。Twitter認証では `omniauth-twitter` ライブラリを使用します。Gemfile.localにて以下の行が有効になっていることを確認してください。無ければ追加してください。
43
43
 
44
44
  ```
45
45
  gem 'omniauth'
46
46
  gem 'omniauth-twitter'
47
47
  ```
48
48
 
49
- 次に設定ファイル `config.ru` を編集します。 ```run TDiary::Applicationn.new( base_dir )``` の前に以下の行を追加します。無ければ追加してください。
49
+ ### Twitter Appsへのアプリケーションの登録
50
50
 
51
- ```
52
- require 'tdiary/application/extensions/omniauth'
53
- ```
51
+ Twitter 認証を使うためには、Twitter のサイトにてアプリケーションを登録する必要があります。[Twitter Apps](https://dev.twitter.com/apps/new)にアクセスし、以下の情報を入力して新しいアプリケーションを登録してください。
54
52
 
55
- ### 鍵とパスワードの取得と環境変数への設定
53
+ - Name: アプリケーションの名前です。設置する日記のタイトルを設定すると分かりやすいでしょう。
54
+ - Description: アプリケーションの説明です。迷ったら「日記へログインするためのTwitter認証」などとすると良いでしょう。
55
+ - Website: アプリケーションのURLです。設置する日記のトップページを設定すると分かりやすいでしょう。
56
+ - Callback URL: 認証後に移動するURLです。Websiteと同じURLを設定してください。
56
57
 
57
- Twitter 認証を使うためには、Twitter認証を利用するための鍵 (Consumer key) とパスワード (Consumer secret) としてTWITTER_KEYとTWITTER_SECRETを環境変数として設定する必要があります。これらは[Twitterのサイト](https://dev.twitter.com/apps/new)から取得できます。
58
+ Name, Description, Websiteに設定した値は、Twitterのアプリ連携画面(認証画面)に表示されます。また、Callback URLを空欄にするとTwitter認証が動作しなくなります。任意のURLで良いので設定してください。
58
59
 
59
- 鍵とパスワードを取得したら環境変数に設定します。
60
+ ### 鍵とパスワードの取得と環境変数への設定
61
+
62
+ Twitterのサイトから鍵とパスワードを取得したら、鍵 (Consumer key) とパスワード (Consumer secret) をそれぞれ環境変数として設定します。
60
63
 
61
64
  ```
62
65
  export TWITTER_KEY="your_consumer_key"
@@ -74,3 +77,88 @@ export TWITTER_NAME='your_twitter_screen_name'
74
77
  ```
75
78
 
76
79
  日記の編集画面にアクセスすると、Twitterのログイン画面が表示されるようになります。編集画面へは `your_twitter_screen_name` で指定したアカウントのみがアクセスできます。
80
+
81
+ サポートしている外部サービス認証の一覧
82
+ ----
83
+
84
+ ### Twitter
85
+
86
+ Gemfile.localの記述
87
+
88
+ ```
89
+ gem 'omniauth'
90
+ gem 'omniauth-twitter'
91
+ ```
92
+
93
+ 環境変数の設定
94
+
95
+ ```
96
+ export TWITTER_KEY="your_consumer_key" # Consumer Key (API Key)
97
+ export TWITTER_SECRET="your_consumer_secret" # Consumer Secret (API Secret)
98
+ export TWITTER_NAME="your_screen_name" # アクセスを許可するアカウント名
99
+ ```
100
+
101
+ KeyとSecretは [Twitter Application Management](https://apps.twitter.com/) にて取得できます。
102
+
103
+ ### Facebook
104
+
105
+ Gemfile.localの記述
106
+
107
+ ```
108
+ gem 'omniauth'
109
+ gem 'omniauth-facebook'
110
+ ```
111
+
112
+ 環境変数の設定
113
+
114
+ ```
115
+ export FACEBOOK_KEY="your_app_id" # App ID
116
+ export FACEBOOK_SECRET="your_app_secret" # App Secret
117
+ export FACEBOOK_EMAIL="your_email@example.com" # アクセスを許可するアカウントのメールアドレス
118
+ ```
119
+
120
+ IDとSecretは [Facebook Developers](https://developers.facebook.com/) にて取得できます。
121
+ 設定画面にてWebsiteの「Site URL」と「Mobile Site URL」には、設置する日記のアドレスを指定してください。
122
+
123
+ ### Google
124
+
125
+ Gemfile.localの記述
126
+
127
+ ```
128
+ gem 'omniauth'
129
+ gem 'omniauth-google-oauth2'
130
+ ```
131
+
132
+ 環境変数の設定
133
+
134
+ ```
135
+ export GOOGLE_CLIENT_ID="your_client_id" # クライアント ID
136
+ export GOOGLE_CLIENT_SECRET="your_client_secret" # クライアント シークレット
137
+ export GOOGLE_EMAIL="your_email@gmail.com" # アクセスを許可するアカウントのメールアドレス
138
+ ```
139
+
140
+ IDとシークレットは [Google Developers Console](https://code.google.com/apis/console/) にて取得できます。
141
+ 設定画面にて「リダイレクトURL」には、設定する日記のアドレスの末尾に `update.rb/auth/google_oauth2/callback` を加えたものを指定してください。
142
+ 日記のアドレスが `http://diary.example.com/` の場合、リダイレクトURLは `http://diary.example.com/update.rb/auth/google_oauth2/callback` となります。
143
+
144
+ また、Google Developers Consoleの「APIと認証」にて、Google+ APIのステータスをonにしてください。
145
+
146
+ ### GitHub
147
+
148
+ Gemfile.localの記述
149
+
150
+ ```
151
+ gem 'omniauth'
152
+ gem 'omniauth-github'
153
+ ```
154
+
155
+ 環境変数の設定
156
+
157
+ ```
158
+ export GITHUB_KEY="your_client_id" # Cliend ID
159
+ export GITHUB_SECRET="your_client_secret" # Cliend Secret
160
+ export GITHUB_NAME="your_github_nickname" # アクセスを許可するアカウント名
161
+ ```
162
+
163
+ Cliend ID と Cliend Secret は、 [New OAuth Application](https://github.com/settings/applications/new) にて取得できます。
164
+ 設定画面にて「Authorization callback URL」には、設置する日記のアドレスを指定してください。
@@ -18,7 +18,7 @@ tDiary-3.0.1.20101011 以降のバージョンでは tDiary を test するた
18
18
 
19
19
  tDiary でテストを実行するためには以下の環境を用意する必要があります。
20
20
 
21
- - Ruby 1.9.3 または Ruby 2.0.0
21
+ - Ruby 2.0.0 以降
22
22
  - Bundler 1.3.5 以降
23
23
 
24
24
  動かし方
data/doc/INSTALL-paas.md CHANGED
@@ -6,74 +6,39 @@ Install to PaaS
6
6
 
7
7
  tDiary-3.1.3 以降のバージョンでは tDiary を [Heroku](http://www.heroku.com) や [sqale](http://sqale.jp) のような PasS で動かすことが可能です。PaaS を利用することで、3.1.3 以前のバージョンで必要とされていた Apache のような http サーバーの用意や CGI として動作させるための環境設定を行う事なく、 tDiary を動かして日記を書くことが可能となります。
8
8
 
9
- 必要なもの
10
- -----
11
-
12
- tDiary を PaaS で動作させるためには以下のツールが必要となります。
13
-
14
- - [git](http://git-scm.com)
15
- - Ruby 1.9.2 以降
16
- - RubyGems 1.3.7 以降
17
- - Bundler 1.0.0 以降
18
-
19
- また、よくわからない場合は Heroku が配布している [heroku toolbelt](https://toolbelt.heroku.com) を用いると簡単に上記のツールをインストールすることができます。
20
-
21
9
  動かし方 - Heroku の場合
22
10
  ----
23
11
 
24
- tDiary の最新版を取得します。
25
-
26
- ```
27
- git clone git://github.com/tdiary/tdiary-core.git
28
- ```
29
-
30
- 続いて、依存するライブラリをインストールするために bundle install コマンドを実行します。
12
+ Webブラウザだけあれば動作させることが可能です。
31
13
 
32
- ```
33
- % cd tdiary-core
34
- % bundle install
35
- ```
14
+ 日記の更新時にTwitterのOAuthを使って認証するようになっています。あらかじめ[Twitter Application Management](https://apps.twitter.com/)にてアプリケーションを作成し、Consumer Key (API Key) と Consumer Secret (API Secret) を取得しておきます。
36
15
 
37
- heroku コマンドを用いて Heroku でアプリケーションを作成します。なお、Heroku のアカウント作成方法は本ドキュメントでは省略します。tDiary のルートディレクトリ(Gemfile が存在する箇所) で以下のコマンドを実行します。
16
+ 続いて GitHub 上にある[tDiaryのリポジトリ](https://github.com/tdiary/tdiary-core)から、Herokuボタンを使ってデプロイしてください(トップページ下部のREADMEにあります)。
38
17
 
39
- ```
40
- % heroku apps:create [アプリケーション名]
41
- ```
18
+ Heroku の New App ページになったら、下記の情報を入力して、Deploy for Free ボタンを押します。
42
19
 
43
- アプリケーション名には mydiary など任意の名前を英数字で入力します。続いて、Heroku 専用の作業ブランチを作成します。
20
+ * App Name (任意)
21
+ * TWITTER_KEY: Twitter の Consumer Key (API Key)
22
+ * TWITTER_SECRET: Twitter の Consumer Secret (API Secret)
23
+ * TWITTER_NAME: 認証に使う Twitter のユーザ名
44
24
 
45
- ```
46
- % git checkout -b deploy
47
- ```
25
+ 「Deployed to Heroku」まで進めば利用可能です。「View it」のリンクから日記に飛んで下さい。
48
26
 
49
- 作業ブランチで Heroku で動かすために必要な設定ファイルをコピーします。
27
+ 【注意】View itから飛んだ先のURLは https://~ になっています。いったん http://~ にしないと認証が通らないので注意してください。なお、設定画面で「日記のURL」を https://~ に変更することで https での利用が可能です。
50
28
 
51
- ```
52
- % cp misc/paas/heroku/* .
53
- ```
54
-
55
- 続いて .gitignore の 2 行目の .htpasswd と 9 行目の tdiary.conf を削除します。
56
-
57
- 日記更新時に必要となるユーザー名とパスワードを保存する .htpasswd ファイルを作成します。この情報は重要なので、外部には公開しないでください。
58
-
59
- ```
60
- % bundle exec bin/tdiary htpasswd
61
- ```
29
+ 動かし方 - sqale の場合
30
+ ----
62
31
 
63
- ここまでの変更内容を deploy ブランチにコミットし、Heroku にアプリケーションを転送します。
32
+ tDiary sqale で動作させるためには以下のツールが必要となります。
64
33
 
65
- ```
66
- git add .
67
- git commit -m "deploy"
68
- git push heroku deploy:master
69
- ```
70
-
71
- これで http://mydiary.herokuapp.com にアクセスして日記を書くことができます。
34
+ - [git](http://git-scm.com)
35
+ - Ruby 2.0.0 以降
36
+ - RubyGems 1.3.7 以降
37
+ - Bundler 1.0.0 以降
72
38
 
73
- 動かし方 - sqale の場合
74
- ----
39
+ また、よくわからない場合は Heroku が配布している [heroku toolbelt](https://toolbelt.heroku.com) を用いると簡単に上記のツールをインストールすることができます。
75
40
 
76
- tDiary の最新版を取得します。
41
+ git を使って tDiary の最新版を取得します。
77
42
 
78
43
  ```
79
44
  git clone git://github.com/tdiary/tdiary-core.git
data/doc/README.en.md CHANGED
@@ -36,7 +36,7 @@ You can choice a grammar of writing your diary by 'Style' feature. Some style fi
36
36
 
37
37
  ### Written in Ruby
38
38
 
39
- Important :-). tDiary requires Ruby-1.9.2 or later.
39
+ Important :-). tDiary requires Ruby-2.0.0 or later.
40
40
 
41
41
  ### Others
42
42
 
data/doc/README.md CHANGED
@@ -36,7 +36,7 @@ iモードに限らず、ほとんどの携帯電話やPalm・ザウルスなど
36
36
 
37
37
  ### Rubyで書かれている
38
38
 
39
- 重要なポイントでしょう:-)??実行にはruby 1.9.2またはruby 2.0.0以上が必要です。
39
+ 重要なポイントでしょう:-)??ruby 2.0.0以上が必要です。
40
40
 
41
41
  セクション(段落)アンカーや過去の日記の参照など、一般的なWeb日記システムの持つ機能は基本的にサポートしています。
42
42
 
data/js/comment_ajax.js CHANGED
@@ -12,7 +12,7 @@ $(function() {
12
12
  $('<input type="hidden">').attr('name', 'comment').appendTo(form);
13
13
  $(':submit', form).attr('disabled', 'disabled');
14
14
  $('div.button input', form).hide();
15
- $('div.button', form).append('<div id="loading-button"><img src="theme/loading.gif">')
15
+ $('div.button', form).append('<div id="loading-button"><img src="' + $tDiary.plugin.comment_ajax.theme + '/loading.gif">')
16
16
  $.post(form.attr('action'), form.serialize(), function(data) {
17
17
  $('#loading-button').remove();
18
18
  $('div.button input', form).show();
@@ -1,7 +1,7 @@
1
1
  module TDiary
2
2
  class Application
3
3
  class Configuration
4
- attr_accessor :assets_paths, :assets_precompile, :plugin_paths, :path, :builder_procs, :authenticate_proc
4
+ attr_accessor :assets_precompile, :plugin_paths, :path
5
5
 
6
6
  def initialize
7
7
  # if you need to auto compilation for CoffeeScript
@@ -12,16 +12,12 @@ module TDiary
12
12
  update: '/update.rb',
13
13
  assets: '/assets'
14
14
  }
15
- @builder_procs = []
16
- @authenticate_proc = proc { }
17
15
  end
18
16
 
19
- def builder(&block)
20
- @builder_procs << block
21
- end
22
-
23
- def authenticate(middleware, *params, &block)
24
- @authenticate_proc = proc { use middleware, *params, &block }
17
+ def assets_paths
18
+ TDiary::Extensions::constants.map {|extension|
19
+ TDiary::Extensions::const_get( extension ).assets_path
20
+ }.flatten.uniq
25
21
  end
26
22
  end
27
23
  end