tdiary 4.1.0.20141126 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0e0cdcd3df43f6f079f1900ed1409dc22e3b57c4
4
+ data.tar.gz: 0e11be7ab4835fa702e74c8ade5fe3daf720cee2
5
+ SHA512:
6
+ metadata.gz: c65ab2e34e364888e6ea2499ed53d28ba47dd40643b8dd48ffe75a95f1d68e32a7b3cce899f2ee8b918d674b78a938941653d95fc17f83332045921cbd5d987d
7
+ data.tar.gz: 2eb47c944e874938e9e5144eba1e539e7042514ec37520c1932df1abe8d0cfa45d8fcf605c40c1ffd989df4488b1873efdbbb22456744a18fdb93464860c396d
data/ChangeLog CHANGED
@@ -1,3 +1,17 @@
1
+ 2014-12-27 MATSUOKA Kohei <kohei@machu.jp>
2
+ * lib/tdiary/application.rb: fix #442: call extensions setup before the core setup
3
+ * lib/tdiary/application/extensions/omniauth.rb: fix error with base_dir
4
+ * lib/tdiary/rack/auth/omniauth.rb: remove github authentication
5
+
6
+ 2014-12-22 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
7
+ * lib/tdiary.rb: fixed load path of additional gems
8
+
9
+ 2014-12-16 TADA Tadashi <t@tdtds.jp>
10
+ * plugin/category.rb: fix error on update running on ruby 1.9.3
11
+
12
+ 2014-11-29 TADA Tadashi <t@tdtds.jp>
13
+ * release 4.1.0
14
+
1
15
  2014-11-26 TADA Tadashi <t@tdtds.jp>
2
16
  * misc/plugin/category.rb: support plugin storage
3
17
  * misc/plugin/disp_referrer.rb: unsupport nora library
data/Gemfile CHANGED
@@ -13,7 +13,6 @@ end
13
13
 
14
14
  group :server do
15
15
  platforms :mri do
16
- gem 'eventmachine', github: 'eventmachine/eventmachine'
17
16
  gem 'thin'
18
17
  end
19
18
 
data/Gemfile.lock CHANGED
@@ -1,9 +1,3 @@
1
- GIT
2
- remote: git://github.com/eventmachine/eventmachine.git
3
- revision: 4d53154a9ea420cdc65bf8985b9156ad4c3730c9
4
- specs:
5
- eventmachine (1.0.3)
6
-
7
1
  GEM
8
2
  remote: https://rubygems.org/
9
3
  specs:
@@ -25,7 +19,7 @@ GEM
25
19
  coffee-script-source
26
20
  execjs
27
21
  coffee-script-source (1.8.0)
28
- columnize (0.8.9)
22
+ columnize (0.9.0)
29
23
  coveralls (0.7.2)
30
24
  multi_json (~> 1.3)
31
25
  rest-client (= 1.6.7)
@@ -36,8 +30,9 @@ GEM
36
30
  debugger-linecache (1.2.0)
37
31
  diff-lcs (1.2.5)
38
32
  docile (1.1.5)
33
+ eventmachine (1.0.4)
39
34
  execjs (2.2.2)
40
- fastimage (1.6.4)
35
+ fastimage (1.6.6)
41
36
  addressable (~> 2.3, >= 2.3.5)
42
37
  ffi (1.9.6)
43
38
  gemoji (2.1.0)
@@ -48,7 +43,7 @@ GEM
48
43
  phantomjs
49
44
  rack (>= 1.2.1)
50
45
  rake
51
- jasmine-core (2.1.2)
46
+ jasmine-core (2.1.3)
52
47
  launchy (2.4.3)
53
48
  addressable (~> 2.3)
54
49
  libv8 (3.16.14.7)
@@ -56,11 +51,11 @@ GEM
56
51
  mime-types (2.4.3)
57
52
  mini_portile (0.6.1)
58
53
  multi_json (1.10.1)
59
- nokogiri (1.6.4.1)
54
+ nokogiri (1.6.5)
60
55
  mini_portile (~> 0.6.0)
61
56
  phantomjs (1.9.7.1)
62
57
  pit (0.0.7)
63
- power_assert (0.2.1)
58
+ power_assert (0.2.2)
64
59
  pry (0.10.1)
65
60
  coderay (~> 1.1.0)
66
61
  method_source (~> 0.8.1)
@@ -68,14 +63,14 @@ GEM
68
63
  pry-byebug (2.0.0)
69
64
  byebug (~> 3.4)
70
65
  pry (~> 0.10)
71
- rack (1.5.2)
66
+ rack (1.6.0)
72
67
  rack-test (0.6.2)
73
68
  rack (>= 1.0)
74
69
  racksh (1.0.0)
75
70
  rack (>= 1.0)
76
71
  rack-test (>= 0.5)
77
- rake (10.3.2)
78
- redcarpet (3.2.0)
72
+ rake (10.4.2)
73
+ redcarpet (3.2.2)
79
74
  ref (1.0.5)
80
75
  rest-client (1.6.7)
81
76
  mime-types (>= 1.16)
@@ -97,7 +92,7 @@ GEM
97
92
  multi_json (~> 1.0)
98
93
  rubyzip (~> 1.0)
99
94
  websocket (~> 1.0)
100
- sequel (4.16.0)
95
+ sequel (4.17.0)
101
96
  simplecov (0.9.1)
102
97
  docile (~> 1.1.0)
103
98
  multi_json (~> 1.0)
@@ -112,7 +107,7 @@ GEM
112
107
  sqlite3 (1.3.10)
113
108
  term-ansicolor (1.2.2)
114
109
  tins (~> 0.8)
115
- test-unit (3.0.7)
110
+ test-unit (3.0.8)
116
111
  power_assert
117
112
  therubyracer (0.12.1)
118
113
  libv8 (~> 3.16.14.0)
@@ -135,7 +130,6 @@ DEPENDENCIES
135
130
  capybara
136
131
  coffee-script
137
132
  coveralls
138
- eventmachine!
139
133
  fastimage
140
134
  gemoji
141
135
  hikidoc
@@ -8,7 +8,6 @@ TDiary::Application.configure do
8
8
  use OmniAuth::Builder do
9
9
  configure {|conf| conf.path_prefix = "/auth" }
10
10
  provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
11
- provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
12
11
  end
13
12
 
14
13
  map('/auth') do
@@ -18,6 +17,6 @@ TDiary::Application.configure do
18
17
 
19
18
  config.authenticate TDiary::Rack::Auth::OmniAuth, :twitter do |auth|
20
19
  # TODO: an user can setting
21
- auth.info.nickname == ENV['TWITTER_NAME'] || ENV['GITHUB_NAME']
20
+ auth.info.nickname == ENV['TWITTER_NAME']
22
21
  end
23
22
  end
@@ -29,7 +29,8 @@ module TDiary
29
29
  def initialize( base_dir = '/' )
30
30
  @app = ::Rack::Builder.app {
31
31
  map base_dir do
32
- Application.config.builder_procs.each do |builder_proc|
32
+ # call extensions setup before the core setup (fixed #442)
33
+ Application.config.builder_procs.reverse.each do |builder_proc|
33
34
  instance_eval &builder_proc
34
35
  end
35
36
  end
@@ -19,7 +19,7 @@ module TDiary
19
19
  result = ERB.new(File.read("#{File.dirname(__FILE__)}/../../views/tdiary.rconf").untaint).result(binding)
20
20
  result.untaint unless @secure
21
21
  Safe::safe( @secure ? 4 : 1 ) do
22
- eval( result, binding, "(TDiary::Config#save)", 1 )
22
+ eval( result, binding, "(TDiary::Configuration#save)", 1 )
23
23
  end
24
24
  @io_class.save_cgi_conf(self, result)
25
25
  end
@@ -118,7 +118,7 @@ module TDiary
118
118
  eval( def_vars1, b )
119
119
  Safe::safe( @secure ? 4 : 1 ) do
120
120
  begin
121
- eval( cgi_conf, b, "(TDiary::Config#load_cgi_conf)", 1 )
121
+ eval( cgi_conf, b, "(TDiary::Configuration#load_cgi_conf)", 1 )
122
122
  rescue SyntaxError
123
123
  enc = case @lang
124
124
  when 'en'
@@ -11,7 +11,7 @@ module TDiary
11
11
  def initialize( request, cgi )
12
12
  @request = request
13
13
  @cgi = cgi
14
- @conf = TDiary::Config::new( cgi, request )
14
+ @conf = TDiary::Configuration::new( cgi, request )
15
15
  @params = request.params
16
16
  end
17
17
 
@@ -11,7 +11,7 @@ module TDiary
11
11
  def initialize( request, cgi )
12
12
  @request = request
13
13
  @cgi = cgi
14
- @conf = TDiary::Config::new( cgi, request )
14
+ @conf = TDiary::Configuration::new( cgi, request )
15
15
  @params = request.params
16
16
  end
17
17
 
@@ -47,7 +47,7 @@ module TDiary
47
47
  end
48
48
  TDiary::Style.constants(false).each do |name|
49
49
  prefix = name.slice(/\A(.*)Diary\z/, 1)
50
- if prefix && /\A(Base|Categorizable)\z/ !~ prefix
50
+ if prefix && /\A(Base|Categorizable|Uncategorizable)\z/ !~ prefix
51
51
  klass = TDiary::Style.const_get(name)
52
52
  klass.send(:include, TDiary::Style::BaseDiary)
53
53
  klass.send(:include, TDiary::Style::CategorizableDiary)
data/lib/tdiary/plugin.rb CHANGED
@@ -4,7 +4,6 @@
4
4
  # plugin management class
5
5
  #
6
6
  require 'erb'
7
- require 'pathname'
8
7
 
9
8
  module TDiary
10
9
  class Plugin
@@ -21,7 +21,7 @@ module TDiary
21
21
  def login(env)
22
22
  env['rack.session']['tdiary.auth.redirect'] =
23
23
  "#{env['REQUEST_PATH']}?#{env['QUERY_STRING']}"
24
- redirect = "#{::OmniAuth.config.path_prefix}/#{@provider}"
24
+ redirect = File.join(File.dirname(env['REQUEST_PATH']), "#{::OmniAuth.config.path_prefix}/#{@provider}")
25
25
  [302, {'Content-Type' => 'text/plain', 'Location' => redirect}, []]
26
26
  end
27
27
 
@@ -1,3 +1,3 @@
1
1
  module TDiary
2
- VERSION = '4.1.0.20141126'
2
+ VERSION = '4.1.1'
3
3
  end
data/lib/tdiary/view.rb CHANGED
@@ -169,6 +169,13 @@ module TDiary
169
169
  end
170
170
  end
171
171
 
172
+ #
173
+ # class TDiaryDayWithoutFilter
174
+ #
175
+ class TDiaryDayWithoutFilter < TDiaryDay
176
+ def referer_filter(referer); end
177
+ end
178
+
172
179
  #
173
180
  # class TDiaryComment
174
181
  # save a comment
data/lib/tdiary.rb CHANGED
@@ -14,7 +14,7 @@ TDIARY_VERSION = TDiary::VERSION
14
14
 
15
15
  $:.unshift File.join(File::dirname(__FILE__), '../misc/lib').untaint
16
16
  ['../misc/lib/*/lib', '../vendor/*/lib'].each do |path|
17
- Dir["#{File::dirname(__FILE__) + path}"].each {|dir| $:.unshift dir.untaint }
17
+ Dir[File.join(File.dirname(__FILE__), path)].each {|dir| $:.unshift dir.untaint }
18
18
  end
19
19
 
20
20
  require 'cgi'
@@ -76,6 +76,7 @@ module TDiary
76
76
  autoload :TDiaryShowComment, 'tdiary/admin'
77
77
  autoload :TDiaryView, 'tdiary/view'
78
78
  autoload :TDiaryDay, 'tdiary/view'
79
+ autoload :TDiaryDayWithoutFilter, 'tdiary/view'
79
80
  autoload :TDiaryComment, 'tdiary/view'
80
81
  autoload :TDiaryMonthBase, 'tdiary/view'
81
82
  autoload :TDiaryMonth, 'tdiary/view'
@@ -423,7 +423,7 @@ class Cache
423
423
  end
424
424
 
425
425
  def get(db, cat)
426
- JSON.load(db.get(cat))
426
+ JSON.load(db.get(cat) || '{}')
427
427
  end
428
428
 
429
429
  def set(db, cat, data)
@@ -497,7 +497,7 @@ class Cache
497
497
  ms.each do |m|
498
498
  ym = "#{y}#{m}"
499
499
  cgi.params['date'] = [ym]
500
- m = TDiaryMonth.new(cgi, '', @conf)
500
+ m = TDiaryMonthWithoutFilter.new(cgi, '', @conf)
501
501
  m.diaries.each do |ymd, diary|
502
502
  next if !diary.visible? or !diary.categorizable?
503
503
  categorized = categorize_diary(diary)
@@ -451,7 +451,6 @@ DispReferrer2_Engines = {
451
451
  [%r{\Ahttp://(?:image-search\.yahoo\.co\.jp/(?:search|detail)|images\.search\.yahoo\.co\.jp/bin/(?:search|query))}, '".co.jpのYahoo!画像検索"', ['p'], DispReferrer2_Google_cache],
452
452
  [%r{\Ahttp://images\.search\.yahoo\.(:?com|co\.jp)/search/images(?:/view)?}, '".comのYahoo!画像検索"', ['p'], DispReferrer2_Google_cache],
453
453
  ],
454
- 'yahoofs' => [[%r{\Ahttp://cache\.yahoofs\.jp/}i, '"Yahoo!検索"', ['w'], DispReferrer2_Yahoofs]],
455
454
  'netscape' => [[%r{\Ahttp://[^/]+\.netscape\.([^/]+)/}i, '".#{$1}のNetscape検索"', ['search', 'query'], DispReferrer2_Google_cache]],
456
455
  'msn' => [[%r{\Ahttp://[^/]+\.MSN\.([^/]+)/}i, '".#{$1}のMSNサーチ"', ['q', 'MT'], nil ]],
457
456
  'bing' => [[%r{\Ahttp://(www|jp)\.bing\.com/}i, '"Bing検索"', ['q'], nil ]],
@@ -480,7 +479,6 @@ DispReferrer2_Engines = {
480
479
  [%r{\Ahttp://srchnavi\.nifty\.com/}i, '"@niftyのリダイレクタ"', ['title'], nil ],
481
480
  [%r{\Ahttp://azby\.search\.nifty\.com/}i, '"AzbyClub"', ['Text'], nil ],
482
481
  ],
483
- 'eniro' => [[%r{\Ahttp://[^/]+\.eniro\.se/}i, '"Eniro"', ['q'], DispReferrer2_Google_cache]],
484
482
  'excite' => [[%r{\Ahttp://[^/]+\.excite\.([^/]+)/}i, '".#{$1}のExcite"', ['search', 's', 'query', 'qkw'], nil ]],
485
483
  'biglobe' => [
486
484
  [%r{\Ahttp://(?:[^/]+\.)?search\.biglobe\.ne\.jp/}i, '"BIGLOBEサーチ"', ['q'], nil ],
@@ -585,11 +585,11 @@ def replace_entities( text )
585
585
  '&yacute;' => '&#253;',
586
586
  '&thorn;' => '&#254;',
587
587
  '&yuml;' => '&#255;',
588
- '&oelig;' => '&#338;',
588
+ '&OElig;' => '&#338;',
589
589
  '&oelig;' => '&#339;',
590
- '&scaron;' => '&#352;',
590
+ '&Scaron;' => '&#352;',
591
591
  '&scaron;' => '&#353;',
592
- '&yuml;' => '&#376;',
592
+ '&Yuml;' => '&#376;',
593
593
  '&circ;' => '&#710;',
594
594
  '&tilde;' => '&#732;',
595
595
  '&ensp;' => '&#8194;',
@@ -669,7 +669,7 @@ def replace_entities( text )
669
669
  '&bull;' => '&#8226;',
670
670
  '&hellip;' => '&#8230;',
671
671
  '&prime;' => '&#8242;',
672
- '&prime;' => '&#8243;',
672
+ '&Prime;' => '&#8243;',
673
673
  '&oline;' => '&#8254;',
674
674
  '&frasl;' => '&#8260;',
675
675
  '&weierp;' => '&#8472;',
@@ -10,6 +10,7 @@
10
10
  require 'pstore'
11
11
  require 'fileutils'
12
12
  require 'time'
13
+ require 'pathname'
13
14
 
14
15
  def recent_comment3_format(format, *args)
15
16
  format.gsub(/\$(\d)/) {|s| args[$1.to_i - 1]}
@@ -100,7 +101,7 @@ def recent_comment3(ob_max = 'OBSOLUTE' ,sep = 'OBSOLUTE',ob_date_format = 'OBSO
100
101
  tree_order.each do |entry_date|
101
102
  a_entry = @index + anchor(entry_date)
102
103
  cgi.params['date'] = [entry_date]
103
- diary = TDiaryDay::new(cgi, '', @conf)
104
+ diary = TDiaryDayWithoutFilter::new(cgi, '', @conf)
104
105
  title = diary.diaries[entry_date].title.gsub( /<[^>]*>/, '' ) if diary
105
106
 
106
107
  if title.nil? || title.length == 0 || title.strip.delete(' ').delete(' ').length == 0 then
@@ -11,5 +11,21 @@ describe TDiary do
11
11
  it "include misc path into load path" do
12
12
  expect(@loaded_paths).to be_include @root_path + '/misc/lib'
13
13
  end
14
+
15
+ context 'append gem' do
16
+ before do
17
+ FileUtils.mkdir_p @root_path + '/misc/lib/foo-0.0.1/lib'
18
+ load @root_path + '/lib/tdiary.rb'
19
+ @loaded_paths = $LOAD_PATH.map{|path| File.expand_path(path)}
20
+ end
21
+
22
+ it "include append gem path into load path" do
23
+ expect(@loaded_paths).to be_include @root_path + '/misc/lib/foo-0.0.1/lib'
24
+ end
25
+
26
+ after do
27
+ FileUtils.rm_rf @root_path + '/misc/lib/foo-0.0.1'
28
+ end
29
+ end
14
30
  end
15
31
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdiary
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0.20141126
5
- prerelease:
4
+ version: 4.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - TADA Tadashi
@@ -11,12 +10,11 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2014-11-22 00:00:00.000000000 Z
13
+ date: 2014-12-29 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: thor
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
19
  - - "~>"
22
20
  - !ruby/object:Gem::Version
@@ -24,7 +22,6 @@ dependencies:
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
26
  - - "~>"
30
27
  - !ruby/object:Gem::Version
@@ -32,7 +29,6 @@ dependencies:
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: bundler
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
33
  - - "~>"
38
34
  - !ruby/object:Gem::Version
@@ -40,7 +36,6 @@ dependencies:
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
40
  - - "~>"
46
41
  - !ruby/object:Gem::Version
@@ -437,30 +432,26 @@ files:
437
432
  homepage: http://www.tdiary.org/
438
433
  licenses:
439
434
  - GPL2
435
+ metadata: {}
440
436
  post_install_message:
441
437
  rdoc_options: []
442
438
  require_paths:
443
439
  - lib
444
440
  required_ruby_version: !ruby/object:Gem::Requirement
445
- none: false
446
441
  requirements:
447
442
  - - ">="
448
443
  - !ruby/object:Gem::Version
449
444
  version: 1.9.2
450
445
  required_rubygems_version: !ruby/object:Gem::Requirement
451
- none: false
452
446
  requirements:
453
447
  - - ">="
454
448
  - !ruby/object:Gem::Version
455
449
  version: '0'
456
- segments:
457
- - 0
458
- hash: 4014152882961253422
459
450
  requirements: []
460
451
  rubyforge_project:
461
- rubygems_version: 1.8.29
452
+ rubygems_version: 2.2.2
462
453
  signing_key:
463
- specification_version: 3
454
+ specification_version: 4
464
455
  summary: a TSUKKOMI-able Web-log
465
456
  test_files:
466
457
  - spec/acceptance/append_comment_spec.rb