tdiary 3.2.2.20130720 → 3.2.2.20130722

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 331ad10aa781304284bf30bcffd7ac906d10008e
4
- data.tar.gz: 145e4dce8f97b01b8956b766c90750e58e518cd3
3
+ metadata.gz: 5b6e3a0840f82ea88b49793172e7dd026fca46b3
4
+ data.tar.gz: 1f7c778358ad00817f22edf54c8758803ff8ca35
5
5
  SHA512:
6
- metadata.gz: 1bb6644b7d7c0d49ad63deeee553e71382ff5d672e5e4a101b59e5c0acf8d6a6aed60ee4fcff745d792fa43104fed0adcb017e9fa1593a6ff593567ae3366099
7
- data.tar.gz: dee79535c57ab09450c3ef61179d6a1cd109be72ec990ee123cce53a237f127c27d390bcf866612321df67f3792e5358c68d2ba991dac560d2642665c77ac8e6
6
+ metadata.gz: 736b942cf60416e2c544e6f8b79893ae7589543b944da0d741c183e0a16846163bddccf6679935c5aa7390f664bb1bea86f6092179cbb22db398d62c3c161a64
7
+ data.tar.gz: 693c426918012327fd6450e19a3611bd0433a4e1c305f8d85adea0f26447fcc0bf1fb469fc3e447bd6f3e9fc540e9b0fd8fbc76a273a9a7d3dabacdbf7c52f62
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- if File.exist?('tdiary.gemspec')
3
+ if File.exist?(File.expand_path('../tdiary.gemspec', __FILE__))
4
4
  # directly installed (e.g. git clone, archive file)
5
5
  gemspec
6
6
  else
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tdiary (3.2.2.20130720)
4
+ tdiary (3.2.2.20130722)
5
5
  bundler (~> 1.3)
6
6
  fastimage
7
7
  hikidoc (>= 0.0.6)
data/doc/INSTALL-cgi.md CHANGED
@@ -32,9 +32,11 @@ tDiaryのダウンロードサイトから、配布アーカイブを取得し
32
32
  % git clone git://github.com/tdiary/tdiary-core.git
33
33
  % mv tdiary-core tdiary
34
34
  % cd tdiary
35
- % bundle install
35
+ % bundle install --without coffee:memcached:redis:gfm:server:development
36
36
  ```
37
37
 
38
+ 上記の例では tDiary を動作させるのに最低限必要なライブラリのみインストールしています。もし、memcached に伽種を保存したり、GFM スタイルを使用する場合は --without オプションから該当ライブラリの文字列を削除して実行してください。
39
+
38
40
  ## CGIスクリプトの設定
39
41
 
40
42
  配布アーカイブを展開し、中身をすべて/home/foo/public\_html/diaryにコピーします。以下の2つのファイルがCGIスクリプト本体なので、WWWサーバの権限で実行可能なようにパーミッションを設定してください。
data/doc/INSTALL.md CHANGED
@@ -29,6 +29,26 @@ tdiary.conf.beginnerをtdiary.confにリネームして、内容を書き換え
29
29
 
30
30
  tdiary.confには、他にもいろいろな設定項目を記述できます。これらの項目には以下の3つの種類があります。
31
31
 
32
+ tDiary は日記データのキャッシュを PStore ファイルとして保存しますが、設定を変えることによりより高速な memcached を使用することも可能です。memcached をキャッシュの保存先として使用する場合は tdiary.conf を以下のように変更します。
33
+
34
+ ```
35
+ # 以下の行をコメントアウト
36
+ # require 'tdiary/io/cache/file'
37
+ require 'tdiary/io/cache/memcached'
38
+ require 'tdiary/io/default'
39
+ @io_class = DefaultIO
40
+ ```
41
+
42
+ 同様に redis を使用する場合は tdiary.conf を以下のように変更します。
43
+
44
+ ```
45
+ # 以下の行をコメントアウト
46
+ # require 'tdiary/io/cache/file'
47
+ require 'tdiary/io/cache/redis'
48
+ require 'tdiary/io/default'
49
+ @io_class = DefaultIO
50
+ ```
51
+
32
52
  #### CGIで設定できない項目
33
53
 
34
54
  @data\_pathのように、CGIでは設定できない項目です。これらの項目は、tdiary.confファイルを直接編集して変更しなければいけません。
@@ -105,7 +105,7 @@ class MakeRssFull
105
105
  def file
106
106
  f = @conf['makerss.file'] || 'index.rdf'
107
107
  f = 'index.rdf' if f.empty?
108
- f =~ %r|^/| ? f : "#{TDiary.document_root}/#{f}"
108
+ f =~ %r|^/| ? f : "#{document_root}/#{f}"
109
109
  end
110
110
 
111
111
  def writable?
@@ -137,6 +137,14 @@ class MakeRssFull
137
137
  u = "#{base_url}#{File.basename(file)}" if u.empty?
138
138
  u
139
139
  end
140
+
141
+ def document_root
142
+ if @cgi.is_a?(RackCGI)
143
+ File.join(TDiary.server_root, 'public')
144
+ else
145
+ TDiary.server_root
146
+ end
147
+ end
140
148
  end
141
149
 
142
150
  @makerss_rsses << MakeRssFull::new(@conf, @cgi)
@@ -154,7 +162,7 @@ class MakeRssNoComments < MakeRssFull
154
162
  def file
155
163
  f = @conf['makerss.no_comments.file'] || 'no_comments.rdf'
156
164
  f = 'no_comments.rdf' if f.empty?
157
- f =~ %r|^/| ? f : "#{TDiary.document_root}/#{f}"
165
+ f =~ %r|^/| ? f : "#{document_root}/#{f}"
158
166
  end
159
167
 
160
168
  def write( encoder )
@@ -13,21 +13,16 @@
13
13
  # You can distribute this under GPL.
14
14
  #
15
15
 
16
- begin
17
- require 'rubygems'
18
- rescue LoadError
19
- ensure
20
- require 'redcarpet'
21
- require 'twitter-text'
22
- end
16
+ require 'redcarpet'
17
+ require 'pygments'
18
+ require 'twitter-text'
23
19
 
24
20
  class HTMLwithPygments < Redcarpet::Render::HTML
25
21
  def block_code(code, language)
26
- require 'pygments'
27
22
  Pygments.highlight(code, :lexer => language)
28
23
  rescue Exception
29
24
  <<-HTML
30
- <div class="highlight"><pre>#{code}</pre></div>
25
+ <div class="highlight"><pre>#{CGI.escapeHTML(code)}</pre></div>
31
26
  HTML
32
27
  end
33
28
  end
data/tdiary.rb CHANGED
@@ -130,15 +130,6 @@ module TDiary
130
130
  def server_root
131
131
  Dir.pwd
132
132
  end
133
-
134
- # directory in which the document is published
135
- def document_root
136
- if defined?( Rack )
137
- File.join(server_root, 'public')
138
- else
139
- server_root
140
- end
141
- end
142
133
  end
143
134
  end
144
135
 
data/tdiary/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TDiary
2
- VERSION = '3.2.2.20130720'
2
+ VERSION = '3.2.2.20130722'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdiary
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2.20130720
4
+ version: 3.2.2.20130722
5
5
  platform: ruby
6
6
  authors:
7
7
  - TADA Tadashi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-20 00:00:00.000000000 Z
13
+ date: 2013-07-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack