tdiary 4.0.2 → 4.0.2.20140201

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/Gemfile +8 -7
  4. data/Gemfile.lock +17 -15
  5. data/config.ru +0 -2
  6. data/doc/INSTALL-paas.md +17 -5
  7. data/misc/plugin/amazon/amazonimg.rb +1 -1
  8. data/misc/plugin/category.rb +7 -7
  9. data/misc/plugin/image.rb +4 -1
  10. data/misc/plugin/search-default.rb +269 -0
  11. data/misc/theme_convert/theme_convert.rb +3 -3
  12. data/plugin/50sp.rb +3 -2
  13. data/spec/acceptance/append_comment_spec.rb +8 -8
  14. data/spec/acceptance/append_diary_spec.rb +9 -9
  15. data/spec/acceptance/save_conf_comment_spec.rb +7 -7
  16. data/spec/acceptance/save_conf_default_spec.rb +31 -31
  17. data/spec/acceptance/save_conf_dnsbl_spec.rb +28 -28
  18. data/spec/acceptance/save_conf_referer_spec.rb +6 -6
  19. data/spec/acceptance/save_conf_security_spec.rb +37 -37
  20. data/spec/acceptance/support/helpers.rb +8 -8
  21. data/spec/acceptance/update_diary_spec.rb +21 -21
  22. data/spec/acceptance/view_category_spec.rb +5 -5
  23. data/spec/acceptance/view_comment_spec.rb +6 -6
  24. data/spec/acceptance/view_diary_spec.rb +12 -12
  25. data/spec/acceptance/view_referer_spec.rb +3 -3
  26. data/spec/acceptance_helper.rb +2 -2
  27. data/spec/core/configuration_spec.rb +1 -1
  28. data/spec/core/io/default_spec.rb +30 -2
  29. data/spec/core/plugin_spec.rb +1 -1
  30. data/tdiary/application/configuration.rb +0 -1
  31. data/tdiary/application/extensions/omniauth.rb +1 -1
  32. data/tdiary/application.rb +6 -9
  33. data/tdiary/cli.rb +6 -6
  34. data/tdiary/configuration.rb +2 -2
  35. data/tdiary/extensions/core.rb +18 -0
  36. data/tdiary/extensions.rb +6 -0
  37. data/tdiary/io/base.rb +11 -7
  38. data/tdiary/lang/ja.rb +2 -2
  39. data/tdiary/server.rb +1 -1
  40. data/tdiary/version.rb +1 -1
  41. data/tdiary.rb +2 -1
  42. data/test/test_plugin_helper.rb +54 -10
  43. data/test/test_plugin_helper_test.rb +27 -5
  44. data/test/weather_test.rb +26 -22
  45. data/tmp/.gitkeep +0 -0
  46. metadata +7 -3
@@ -2,7 +2,9 @@
2
2
  require File.expand_path('../test_helper', __FILE__)
3
3
  require File.expand_path('../test_plugin_helper', __FILE__)
4
4
 
5
- class TestPluginHelper < TDiary::PluginTestCase
5
+ class TestPluginTestHelper < Test::Unit::TestCase
6
+ include TDiary::PluginTestHelper
7
+
6
8
  def test_absolute_path_of
7
9
  abspath = File.expand_path(File.join(File.dirname(__FILE__), '..', 'plugin', '00default.rb'))
8
10
  assert_equal(abspath, TDiary::PluginTestHelper.absolute_path_of('plugin/00default.rb'))
@@ -18,11 +20,31 @@ class TestPluginHelper < TDiary::PluginTestCase
18
20
  assert_equal(abspath, TDiary::PluginTestHelper.resource_relative_path_of('plugin/00default.rb', 'en'))
19
21
  end
20
22
 
21
- def test_load_plugin_en
22
- assert_nothing_raised{load_plugin('plugin/00default.rb', 'en', binding)}
23
+ def test_new_plugin
24
+ assert_nothing_raised do
25
+ TDiary::StubPlugin::new_plugin('plugin/00default.rb', 'en')
26
+ end
27
+ end
28
+
29
+ def test_load_plugin
30
+ assert_nothing_raised do
31
+ TDiary::StubPlugin::load_plugin('plugin/00default.rb', 'en')
32
+ end
33
+ end
34
+
35
+ def test_plugin_conf
36
+ plugin = TDiary::StubPlugin::load_plugin('plugin/00default.rb', 'en')
37
+ assert_nothing_raised do
38
+ plugin.conf['key'] = 'value'
39
+ end
40
+ assert_equal('value', plugin.conf['key'])
23
41
  end
24
42
 
25
- def test_load_plugin_ja
26
- assert_nothing_raised{load_plugin('plugin/00default.rb', 'ja', binding)}
43
+ def test_plugin_options
44
+ plugin = TDiary::StubPlugin::load_plugin('plugin/00default.rb', 'en')
45
+ assert_nothing_raised do
46
+ plugin.options['key'] = 'value'
47
+ end
48
+ assert_equal('value', plugin.options['key'])
27
49
  end
28
50
  end
data/test/weather_test.rb CHANGED
@@ -1,33 +1,37 @@
1
+ # by @kou
2
+ # https://github.com/tdiary/tdiary-core/pull/218#issuecomment-10048898
3
+
1
4
  require File.expand_path('../test_helper', __FILE__)
2
5
  require File.expand_path('../test_plugin_helper', __FILE__)
3
6
 
4
7
  module EmptyRenderingTests
5
- def setup
6
- load_plugin('misc/plugin/weather.rb', language, binding)
7
- @weather = Weather.new
8
- end
9
-
10
- def test_empty_rendering_to_html
11
- assert_equal('', @weather.to_html)
12
- end
13
-
14
- def test_empty_rendering_to_i_html
15
- assert_equal('', @weather.to_i_html)
16
- end
8
+ def setup
9
+ @plugin_class = TDiary::StubPlugin::new_plugin('misc/plugin/weather.rb', language)
10
+ @weather = @plugin_class::Weather.new
11
+ end
12
+
13
+ def test_empty_rendering_to_html
14
+ assert_equal('', @weather.to_html)
15
+ end
16
+
17
+ def test_empty_rendering_to_i_html
18
+ assert_equal('', @weather.to_i_html)
19
+ end
17
20
  end
18
21
 
19
- class TestEmptyRenderingEn < TDiary::PluginTestCase
20
- include EmptyRenderingTests
22
+ class TestEmptyRenderingEn < Test::Unit::TestCase
23
+ include EmptyRenderingTests
21
24
 
22
- def language
23
- "en"
24
- end
25
+ def language
26
+ "en"
27
+ end
25
28
  end
26
29
 
27
- class TestEmptyRenderingJa < TDiary::PluginTestCase
28
- include EmptyRenderingTests
30
+ class TestEmptyRenderingJa < Test::Unit::TestCase
31
+ include EmptyRenderingTests
29
32
 
30
- def language
31
- "ja"
32
- end
33
+ def language
34
+ "ja"
35
+ end
33
36
  end
37
+
data/tmp/.gitkeep ADDED
File without changes
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: 4.0.2
4
+ version: 4.0.2.20140201
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-11-30 00:00:00.000000000 Z
13
+ date: 2014-02-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -223,6 +223,7 @@ files:
223
223
  - misc/plugin/referer-antibot.rb
224
224
  - misc/plugin/referer-utf8.rb
225
225
  - misc/plugin/referer_scheme.rb
226
+ - misc/plugin/search-default.rb
226
227
  - misc/plugin/search_control.rb
227
228
  - misc/plugin/search_form.rb
228
229
  - misc/plugin/sn.rb
@@ -358,6 +359,8 @@ files:
358
359
  - tdiary/dispatcher/index_main.rb
359
360
  - tdiary/dispatcher/update_main.rb
360
361
  - tdiary/environment.rb
362
+ - tdiary/extensions.rb
363
+ - tdiary/extensions/core.rb
361
364
  - tdiary/filter.rb
362
365
  - tdiary/filter/default.rb
363
366
  - tdiary/filter/spam.rb
@@ -414,6 +417,7 @@ files:
414
417
  - theme/tdiary1/tdiary1.css
415
418
  - theme/tdiary2/README
416
419
  - theme/tdiary2/tdiary2.css
420
+ - tmp/.gitkeep
417
421
  - update.fcgi
418
422
  - update.rb
419
423
  - vendor/.gitkeep
@@ -437,7 +441,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
437
441
  version: '0'
438
442
  requirements: []
439
443
  rubyforge_project:
440
- rubygems_version: 2.2.0
444
+ rubygems_version: 2.2.1
441
445
  signing_key:
442
446
  specification_version: 4
443
447
  summary: a TSUKKOMI-able Web-log