Skip to content

Commit

Permalink
Merge branch 'master' into feat/amp-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
machu committed Mar 2, 2017
2 parents 5fef5c2 + 63f7bae commit 14b5ae1
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 54 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2017-02-09 TADA Tadashi <t@tdtds.jp>
* fix: ignore @css by theme location in tdiary.conf

2017-01-20 TADA Tadashi <t@tdtds.jp>
* support ruby 2.4.0
* drop ruby 2.1
Expand Down
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ GEM
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
byebug (9.0.6)
capybara (2.11.0)
capybara (2.12.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.5.9)
childprocess (0.6.1)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.1)
concurrent-ruby (1.0.4)
Expand Down Expand Up @@ -57,7 +57,7 @@ GEM
sawyer (~> 0.8.0, >= 0.5.3)
phantomjs (2.1.1.0)
pit (0.0.7)
power_assert (0.4.1)
power_assert (1.0.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
Expand Down Expand Up @@ -91,15 +91,15 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubyzip (1.2.0)
rubyzip (1.2.1)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
selenium-webdriver (3.0.5)
selenium-webdriver (3.0.8)
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)
sequel (4.42.1)
sequel (4.43.0)
simplecov (0.9.2)
docile (~> 1.1.0)
multi_json (~> 1.0)
Expand All @@ -115,11 +115,11 @@ GEM
test-unit (3.2.3)
power_assert
thor (0.19.4)
tins (1.13.0)
tins (1.13.2)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
websocket (1.2.3)
websocket (1.2.4)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand Down Expand Up @@ -151,4 +151,4 @@ DEPENDENCIES
test-unit

BUNDLED WITH
1.13.7
1.14.3
2 changes: 1 addition & 1 deletion doc/HOWTO-authenticate-in-rack.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export GOOGLE_CLIENT_SECRET="your_client_secret" # クライアント シーク
export GOOGLE_EMAIL="your_email@gmail.com" # アクセスを許可するアカウントのメールアドレス
```

IDとシークレットは [Google Developers Console](https://code.google.com/apis/console/) にて取得できます。
IDとシークレットは [Google API](https://console.developers.google.com/iam-admin/projects) にて取得できます。
設定画面にて「リダイレクトURL」には、設定する日記のアドレスの末尾に `update.rb/auth/google_oauth2/callback` を加えたものを指定してください。
日記のアドレスが `http://diary.example.com/` の場合、リダイレクトURLは `http://diary.example.com/update.rb/auth/google_oauth2/callback` となります。

Expand Down
4 changes: 2 additions & 2 deletions lib/tdiary/filter/spam.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ def update_config
if @conf.options.include?('spamlookup.ip.list')
@spamlookup_ip_list = @conf.options['spamlookup.ip.list']
else
@spamlookup_ip_list = "dnsbl.spam-champuru.livedoor.com"
@spamlookup_ip_list = "bsb.spamlookup.net"
end

if @conf.options.include?('spamlookup.domain.list')
@spamlookup_domain_list = @conf.options['spamlookup.domain.list']
else
@spamlookup_domain_list = "bsb.spamlookup.net\nsc.surbl.org\nrbl.bulkfeeds.jp"
@spamlookup_domain_list = "bsb.spamlookup.net\nmulti.surbl.org\nrbl.bulkfeeds.jp"
end

if @conf.options.include?('spamlookup.safe_domain.list')
Expand Down
6 changes: 3 additions & 3 deletions lib/tdiary/plugin/00default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ def theme_url
end

def css_tag
location, name = (@conf.theme || '').split(%r[/], 2)
if @mode =~ /conf$/ then
css = "#{h theme_url}/conf.css"
elsif @conf.theme and @conf.theme.length > 0
location, name = @conf.theme.split(%r[/], 2)
elsif name && name.length > 0
css = __send__("theme_url_#{location}", name)
css = theme_url_local('default') unless css # the location is not defined
else
Expand Down Expand Up @@ -974,7 +974,7 @@ def saveconf_recommendfilter
@conf['spamfilter.max_uris'] = "1"
@conf['spamfilter.resolv_check'] = true
@conf['spamfilter.resolv_check_mode'] = false
@conf['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nsc.surbl.org\r\nrbl.bulkfeeds.jp"
@conf['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nmulti.surbl.org\r\nrbl.bulkfeeds.jp"
@conf['spamlookup.ip.list'] = "dnsbl.spam-champuru.livedoor.com"
@conf['spamlookup.safe_domain.list'] = "www.google.com\r\nwww.google.co.jp\r\nezsch.ezweb.ne.jp\r\nwww.yahoo.co.jp\r\nsearch.mobile.yahoo.co.jp\r\nwww.bing.com"
end
Expand Down
4 changes: 2 additions & 2 deletions lib/tdiary/plugin/10spamfilter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
auto_migration_spam_champuru

# initialize DNSBL list
@conf['spamlookup.domain.list'] ||= "bsb.spamlookup.net\nsc.surbl.org\nrbl.bulkfeeds.jp"
@conf['spamlookup.domain.list'] ||= "bsb.spamlookup.net\nmulti.surbl.org\nrbl.bulkfeeds.jp"

# initialize safe domain list.
@conf['spamlookup.safe_domain.list'] ||= "search.yahoo.co.jp\nwww.google.com\nwww.google.co.jp\nsearch.msn.co.jp"
Expand Down Expand Up @@ -144,7 +144,7 @@
auto_migration_spam_champuru

# initialize DNSBL list
@conf['spamlookup.domain.list'] ||= "bsb.spamlookup.net\nsc.surbl.org\nrbl.bulkfeeds.jp"
@conf['spamlookup.domain.list'] ||= "bsb.spamlookup.net\nmulti.surbl.org\nrbl.bulkfeeds.jp"

# initialize safe domain list.
@conf['spamlookup.safe_domain.list'] ||= "www.google.com\nwww.google.co.jp\nsearch.yahoo.co.jp\nwww.bing.com"
Expand Down
2 changes: 1 addition & 1 deletion lib/tdiary/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module TDiary
VERSION = '5.0.3.20170116'
VERSION = '5.0.3.20170209'
end
2 changes: 1 addition & 1 deletion misc/paas/heroku/Gemfile.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ruby '~> 2.4.0'
ruby '~> 2.3.0'
gem 'puma', require: false
gem 'tdiary-io-mongodb', git: 'https://github.com/tdiary/tdiary-io-mongodb.git'
gem 'tdiary-contrib', git: 'https://github.com/tdiary/tdiary-contrib.git'
Expand Down
34 changes: 17 additions & 17 deletions misc/paas/heroku/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ GEM
public_suffix (~> 2.0, >= 2.0.2)
bson (4.2.1)
byebug (9.0.6)
capybara (2.11.0)
capybara (2.12.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.5.9)
childprocess (0.6.1)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.1)
concurrent-ruby (1.0.4)
Expand All @@ -58,11 +58,11 @@ GEM
addressable (~> 2)
ffi (1.9.17)
github-markdown (0.6.9)
hashie (3.4.6)
hashie (3.5.1)
hikidoc (0.1.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (0.7.0)
i18n (0.8.0)
jasmine (2.5.1)
jasmine-core (>= 2.5.1, < 3.0.0)
phantomjs
Expand All @@ -81,9 +81,9 @@ GEM
minitest (5.10.1)
mongo (2.4.1)
bson (>= 4.2.1, < 5.0.0)
mongoid (6.0.3)
mongoid (6.1.0)
activemodel (~> 5.0)
mongo (~> 2.3)
mongo (>= 2.4.1, < 3.0.0)
multi_json (1.12.1)
multipart-post (2.0.0)
netrc (0.11.0)
Expand All @@ -92,18 +92,18 @@ GEM
oauth (0.5.1)
octokit (4.6.2)
sawyer (~> 0.8.0, >= 0.5.3)
omniauth (1.3.2)
omniauth (1.4.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-twitter (1.3.0)
omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1)
rack
phantomjs (2.1.1.0)
pit (0.0.7)
power_assert (0.4.1)
power_assert (1.0.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
Expand All @@ -112,7 +112,7 @@ GEM
byebug (~> 9.0)
pry (~> 0.10)
public_suffix (2.0.5)
puma (3.6.2)
puma (3.7.0)
rack (1.6.5)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -143,15 +143,15 @@ GEM
ruby-pushbullet (0.1.4)
json
rest-client (~> 1.8.0)
rubyzip (1.2.0)
rubyzip (1.2.1)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
selenium-webdriver (3.0.5)
selenium-webdriver (3.0.8)
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)
sequel (4.42.1)
sequel (4.43.0)
simplecov (0.9.2)
docile (~> 1.1.0)
multi_json (~> 1.0)
Expand Down Expand Up @@ -185,15 +185,15 @@ GEM
power_assert
thor (0.19.4)
thread_safe (0.3.5)
tins (1.13.0)
tins (1.13.2)
twitter-text (1.14.5)
unf (~> 0.1.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
websocket (1.2.3)
websocket (1.2.4)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand Down Expand Up @@ -234,7 +234,7 @@ DEPENDENCIES
test-unit

RUBY VERSION
ruby 2.4.0p0
ruby 2.3.3p222

BUNDLED WITH
1.13.7
1.14.3
10 changes: 5 additions & 5 deletions misc/plugin/en/search_form.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# search_form.rb English resource.

def google_form( button_name = "Google Search", size = 20, default_text = "" )
first = %Q[<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_40wht.gif"
first = %Q[<a href="https://www.google.com/">
<img src="https://www.google.com/logos/Logo_40wht.gif"
style="border-width: 0px; vertical-align: middle;" alt="Google"></a>]
search_form( "http://www.google.com/search", "q", button_name, size, default_text, first, '' )
search_form( "https://www.google.com/search", "q", button_name, size, default_text, first, '' )
end

def yahoo_form( button_name = "Yahoo! Search", size = 20, default_text = "" )
first = %Q[<a href="http://www.yahoo.com/">
first = %Q[<a href="https://www.yahoo.com/">
<img src="http://us.i1.yimg.com/us.yimg.com/i/yahootogo/ytg_search.gif"
style="border-width: 0px; vertical-align: middle;" alt="[Yahoo!]"></a>]
search_form( "http://search.yahoo.com/search", "p", button_name, size, default_text, first, "" )
search_form( "https://search.yahoo.com/search", "p", button_name, size, default_text, first, "" )
end

# Local Variables:
Expand Down
10 changes: 5 additions & 5 deletions misc/plugin/ja/search_form.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# search_form.rb japanese resource.

def googlej_form( button_name = "Google 検索", size = 20, default_text = "" )
first = %Q[<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_40wht.gif"
first = %Q[<a href="https://www.google.com/">
<img src="https://www.google.com/logos/Logo_40wht.gif"
style="border-width: 0px; vertical-align: middle;" alt="Google"></a>]
last = %Q[<input type="hidden" name="hl" value="ja"><input type="hidden" name="ie" value="utf-8">]
search_form( "http://www.google.com/search", "q", button_name, size, default_text, first, last )
search_form( "https://www.google.com/search", "q", button_name, size, default_text, first, last )
end

def google_form( button_name = "Google 検索", size = 20, default_text = "" )
googlej_form( button_name, size, default_text )
end

def yahooj_form( button_name = "Yahoo! 検索", size = 20, default_text = "" )
first = %Q[<a href="http://www.yahoo.co.jp/">
first = %Q[<a href="https://www.yahoo.co.jp/">
<img src="http://img.yahoo.co.jp/images/yahoojp_sm.gif"
style="border-width: 0px; vertical-align: middle;" alt="Yahoo! JAPAN"></a>]
search_form( "http://search.yahoo.co.jp/bin/search", "p", button_name, size, default_text, first, "" )
search_form( "https://search.yahoo.co.jp/bin/search", "p", button_name, size, default_text, first, "" )
end

def yahoo_form( button_name = "Yahoo! 検索", size = 20, default_text = "" )
Expand Down
4 changes: 2 additions & 2 deletions misc/plugin/kw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def kw_parse( str )
end

def kw_generate_dic
kw_dic = {nil => ['http://www.google.com/search?ie=utf-8&q=$1', 'utf-8']}
kw_dic = {nil => ['https://www.google.com/search?ie=utf-8&q=$1', 'utf-8']}

kw_list = []
case @conf['kw.dic'].class.to_s
Expand Down Expand Up @@ -111,7 +111,7 @@ def kw_desc
<h3>リンクリストの指定</h3>
<p>特定のサイトへのリンクを、簡単な記述で生成するためのプラグイン(kw)です。
「キー URL エンコードスタイル」と空白で区切って指定します。例えば、</p>
<pre>google http://www.google.com/search?ie=utf-8&amp;q=$1 utf-8</pre>
<pre>google https://www.google.com/search?ie=utf-8&amp;q=$1 utf-8</pre>
<p>と指定すると、</p>
<pre>&lt;%=kw('google:tdiary')%&gt;</pre>
<p>のように日記に書けばgoogleでtdiaryを検索するリンクになります
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/random_google.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def random_google_init
popup = h(@conf['random_google.popup'].gsub(/\$1/, rrr)) # escaped
<<-HTML
<div class="body-enter">
[<a href="http://www.google.com/search?lr=lang_ja&amp;ie=utf-8&amp;q=#{rr}" title="#{popup}">
[<a href="https://www.google.com/search?lr=lang_ja&amp;ie=utf-8&amp;q=#{rr}" title="#{popup}">
#{caption}
</a>]
</div>
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/tdiary.conf.gem
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ recent_list.rb
@options['spamfilter.max_uris'] = "2"
@options['spamfilter.resolv_check'] = false
@options['spamfilter.resolv_check_mode'] = false
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nsc.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nmulti.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.safe_domain.list'] = "search.yahoo.co.jp\r\nwww.google.com\r\nwww.google.co.jp\r\nsearch.msn.co.jp"


Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/tdiary.conf.rack
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ recent_list.rb
@options['spamfilter.max_uris'] = "2"
@options['spamfilter.resolv_check'] = false
@options['spamfilter.resolv_check_mode'] = false
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nsc.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nmulti.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.safe_domain.list'] = "search.yahoo.co.jp\r\nwww.google.com\r\nwww.google.co.jp\r\nsearch.msn.co.jp"


Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/tdiary.conf.webrick
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ recent_list.rb
@options['spamfilter.max_uris'] = "2"
@options['spamfilter.resolv_check'] = false
@options['spamfilter.resolv_check_mode'] = false
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nsc.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nmulti.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.safe_domain.list'] = "search.yahoo.co.jp\r\nwww.google.com\r\nwww.google.co.jp\r\nsearch.msn.co.jp"


Expand Down
2 changes: 1 addition & 1 deletion tdiary.conf.beginner
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ recent_list.rb
@options['spamfilter.max_uris'] = "2"
@options['spamfilter.resolv_check'] = false
@options['spamfilter.resolv_check_mode'] = false
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nsc.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.domain.list'] = "bsb.spamlookup.net\r\nmulti.surbl.org\r\nrbl.bulkfeeds.jp"
@options['spamlookup.safe_domain.list'] = "search.yahoo.co.jp\r\nwww.google.com\r\nwww.google.co.jp\r\nsearch.msn.co.jp"


Expand Down
2 changes: 1 addition & 1 deletion views/tdiary.rconf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ options2 = {
<% @options2.keys.sort.each do |k|
if @options2[k].class.to_s == "String" then
v = @options2[k].force_encoding('ASCII-8BIT').dump
elsif @options2[k].class.to_s =~ /^(Integer|Fixnum|FalseClass|TrueClass|NilClass)$/
elsif @options2[k].class.to_s =~ /\A(Integer|Fixnum|FalseClass|TrueClass|NilClass)\z/
v = @options2[k].inspect
else
next
Expand Down

0 comments on commit 14b5ae1

Please sign in to comment.