tdiary-contrib 3.2.2.20130518
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +35 -0
- data/README.en.md +12 -0
- data/README.md +13 -0
- data/Rakefile +41 -0
- data/doc/en/filter/spambayes.txt +3 -0
- data/doc/en/plugin.txt +1 -0
- data/doc/en/style/hatena.txt +10 -0
- data/doc/en/style/markdown.txt +16 -0
- data/doc/en/util.txt +1 -0
- data/doc/ja/filter/antirefspam.history.txt +59 -0
- data/doc/ja/filter/antirefspam.txt +86 -0
- data/doc/ja/filter/comment_key.ja.html +182 -0
- data/doc/ja/filter/spambayes.txt +3 -0
- data/doc/ja/plugin/add_bookmark.txt +50 -0
- data/doc/ja/plugin/category_to_tag.txt +21 -0
- data/doc/ja/plugin/cocoment.txt +31 -0
- data/doc/ja/plugin/google_adsense.txt +25 -0
- data/doc/ja/plugin/google_analytics.txt +7 -0
- data/doc/ja/plugin/image_detail.txt +69 -0
- data/doc/ja/plugin/image_gps.txt +36 -0
- data/doc/ja/plugin/image_gps2.txt +41 -0
- data/doc/ja/plugin/livedoor_weather.txt +105 -0
- data/doc/ja/plugin/opensearch_ad.txt +16 -0
- data/doc/ja/plugin/section_footer.txt +84 -0
- data/doc/ja/plugin/select_theme.txt +1 -0
- data/doc/ja/plugin.txt +13 -0
- data/doc/ja/style/hatena.txt +10 -0
- data/doc/ja/style/markdown.txt +13 -0
- data/doc/ja/util.txt +12 -0
- data/filter/antirefspam.rb +263 -0
- data/filter/commentkey.rb +29 -0
- data/filter/commentsize.rb +18 -0
- data/filter/hidecomment.rb +13 -0
- data/filter/iplookup.rb +55 -0
- data/filter/plugin/antirefspam.rb +59 -0
- data/filter/plugin/commentkey.rb +58 -0
- data/filter/plugin/commentsize.rb +12 -0
- data/filter/plugin/en/iplookup.rb +9 -0
- data/filter/plugin/en/spambayes.rb +123 -0
- data/filter/plugin/iplookup.rb +39 -0
- data/filter/plugin/ja/antirefspam.rb +91 -0
- data/filter/plugin/ja/commentkey.rb +17 -0
- data/filter/plugin/ja/commentsize.rb +6 -0
- data/filter/plugin/ja/iplookup.rb +9 -0
- data/filter/plugin/ja/spambayes.rb +124 -0
- data/filter/plugin/spambayes.rb +501 -0
- data/filter/plugin/zh/iplookup.rb +9 -0
- data/filter/rblcheck.rb +36 -0
- data/filter/spambayes.rb +535 -0
- data/filter/spamlookup.rb +37 -0
- data/io/dbi_io/ChangeLog +19 -0
- data/io/dbi_io/README.ja +39 -0
- data/io/dbi_io/dbi_io.rb +181 -0
- data/io/dbi_io/plugin/refererDbiIO.rb +76 -0
- data/io/dbi_io/tdiary_table.sql +42 -0
- data/js/appstore.js +109 -0
- data/js/datepicker.js +69 -0
- data/js/editor.js +82 -0
- data/js/flickr.js +157 -0
- data/js/image_ex.js +79 -0
- data/js/jquery.socialbutton.js +842 -0
- data/js/nicovideo.js +17 -0
- data/js/picasa.js +322 -0
- data/js/plugin_checker.js +71 -0
- data/js/prettify/lang-apollo.js +2 -0
- data/js/prettify/lang-clj.js +18 -0
- data/js/prettify/lang-css.js +2 -0
- data/js/prettify/lang-go.js +1 -0
- data/js/prettify/lang-hs.js +2 -0
- data/js/prettify/lang-lisp.js +3 -0
- data/js/prettify/lang-lua.js +2 -0
- data/js/prettify/lang-ml.js +2 -0
- data/js/prettify/lang-n.js +4 -0
- data/js/prettify/lang-proto.js +1 -0
- data/js/prettify/lang-scala.js +2 -0
- data/js/prettify/lang-sql.js +2 -0
- data/js/prettify/lang-tex.js +1 -0
- data/js/prettify/lang-vb.js +2 -0
- data/js/prettify/lang-vhdl.js +3 -0
- data/js/prettify/lang-wiki.js +2 -0
- data/js/prettify/lang-xq.js +3 -0
- data/js/prettify/lang-yaml.js +2 -0
- data/js/prettify/prettify.css +1 -0
- data/js/prettify/prettify.js +28 -0
- data/js/referer.js +17 -0
- data/js/show_and_hide.js +39 -0
- data/js/socialbutton.js +126 -0
- data/js/twitter_anywhere.js +28 -0
- data/js/yahoo_kousei.js +21 -0
- data/lib/bayes/convert.rb +34 -0
- data/lib/bayes.rb +232 -0
- data/lib/exifparser/BUGS +1 -0
- data/lib/exifparser/ChangeLog +169 -0
- data/lib/exifparser/README +15 -0
- data/lib/exifparser/install.rb +1015 -0
- data/lib/exifparser/lib/exifparser/makernote/canon.rb +502 -0
- data/lib/exifparser/lib/exifparser/makernote/fujifilm.rb +415 -0
- data/lib/exifparser/lib/exifparser/makernote/minolta.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/mk_nikonflensname.rb +39 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon.rb +267 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon2.rb +581 -0
- data/lib/exifparser/lib/exifparser/makernote/nikonflensname.rb +438 -0
- data/lib/exifparser/lib/exifparser/makernote/olympus.rb +225 -0
- data/lib/exifparser/lib/exifparser/makernote/prove.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/sigma.rb +237 -0
- data/lib/exifparser/lib/exifparser/pre-setup.rb +1 -0
- data/lib/exifparser/lib/exifparser/scan.rb +278 -0
- data/lib/exifparser/lib/exifparser/tag.rb +2298 -0
- data/lib/exifparser/lib/exifparser/thumbnail.rb +76 -0
- data/lib/exifparser/lib/exifparser/utils.rb +88 -0
- data/lib/exifparser/lib/exifparser.rb +265 -0
- data/lib/exifparser/sample/exifview.rb +279 -0
- data/lib/tdiary-contrib.rb +19 -0
- data/lib/wgs2tky.rb +93 -0
- data/misc/section_footer2/buzzurl.yaml +6 -0
- data/misc/section_footer2/fc2.yaml +6 -0
- data/misc/section_footer2/ldc.yaml +6 -0
- data/misc/section_footer2/retweet.yaml +7 -0
- data/misc/section_footer2/twitter.yaml +7 -0
- data/misc/section_footer2/yahoo.yaml +6 -0
- data/misc/tdiarygraph/tdiarygraph120x90e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph125x125e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph240x180e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph468x60e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph728x90e.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r7.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125s.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes234x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes468x30.swf +0 -0
- data/plugin/add_bookmark.rb +89 -0
- data/plugin/apple_webclip.rb +26 -0
- data/plugin/appstore.rb +47 -0
- data/plugin/bigpresen.rb +86 -0
- data/plugin/bitly.rb +39 -0
- data/plugin/bootstrap-navi.rb +54 -0
- data/plugin/canonical.rb +9 -0
- data/plugin/category_similar.rb +73 -0
- data/plugin/category_to_tag.rb +60 -0
- data/plugin/category_to_tagcloud.rb +172 -0
- data/plugin/cocomment.rb +37 -0
- data/plugin/code-prettify.rb +23 -0
- data/plugin/coderwall.rb +34 -0
- data/plugin/datepicker.rb +28 -0
- data/plugin/day2section.rb +20 -0
- data/plugin/del_footer.rb +111 -0
- data/plugin/description_from_body.rb +23 -0
- data/plugin/development.rb +16 -0
- data/plugin/editor.rb +11 -0
- data/plugin/en/add_bookmark.rb +20 -0
- data/plugin/en/del_footer.rb +10 -0
- data/plugin/en/git-register.rb +3 -0
- data/plugin/en/livedoor_weather.rb +25 -0
- data/plugin/en/microsummary.rb +18 -0
- data/plugin/en/nicovideo.rb +38 -0
- data/plugin/en/openid.rb +8 -0
- data/plugin/en/section_footer.rb +6 -0
- data/plugin/en/section_footer2.rb +3 -0
- data/plugin/en/socialbutton.rb +5 -0
- data/plugin/everytrail.rb +39 -0
- data/plugin/facebook_comments.rb +59 -0
- data/plugin/flickr.rb +209 -0
- data/plugin/gist.rb +16 -0
- data/plugin/git-register.rb +240 -0
- data/plugin/github_badge.rb +27 -0
- data/plugin/github_link.rb +9 -0
- data/plugin/goo_gl.rb +42 -0
- data/plugin/google_adsense.rb +132 -0
- data/plugin/google_analytics.rb +39 -0
- data/plugin/google_map.rb +168 -0
- data/plugin/google_sitemaps.rb +60 -0
- data/plugin/google_webmaster.rb +22 -0
- data/plugin/hatena_bookmark_nocomment.rb +9 -0
- data/plugin/hatena_star.rb +66 -0
- data/plugin/hb_footer.rb +255 -0
- data/plugin/hb_footer4sec.rb +244 -0
- data/plugin/hb_footer4sec_js.rb +30 -0
- data/plugin/hide_comment_form.rb +4 -0
- data/plugin/hide_sidebar_iphone.rb +21 -0
- data/plugin/iddy.rb +81 -0
- data/plugin/image_detail.rb +143 -0
- data/plugin/image_ex.rb +462 -0
- data/plugin/image_gps.rb +128 -0
- data/plugin/inline_wiki.rb +6 -0
- data/plugin/instagr.rb +64 -0
- data/plugin/ja/add_bookmark.rb +20 -0
- data/plugin/ja/del_footer.rb +10 -0
- data/plugin/ja/flickr.rb +62 -0
- data/plugin/ja/git-register.rb +3 -0
- data/plugin/ja/google_sitemaps.rb +35 -0
- data/plugin/ja/livedoor_weather.rb +25 -0
- data/plugin/ja/microsummary.rb +18 -0
- data/plugin/ja/nicovideo.rb +41 -0
- data/plugin/ja/openid.rb +7 -0
- data/plugin/ja/section_footer.rb +6 -0
- data/plugin/ja/section_footer2.rb +4 -0
- data/plugin/ja/socialbutton.rb +6 -0
- data/plugin/jdate.rb +20 -0
- data/plugin/jholiday.rb +16 -0
- data/plugin/jmonth.rb +20 -0
- data/plugin/jquery_ui_theme.rb +55 -0
- data/plugin/jroku.rb +28 -0
- data/plugin/jyear.rb +37 -0
- data/plugin/latlonglab_route.rb +25 -0
- data/plugin/lazy_referer.rb +38 -0
- data/plugin/livedoor_weather.rb +180 -0
- data/plugin/make_link.rb +44 -0
- data/plugin/makerss_category.rb +43 -0
- data/plugin/makerss_comment.rb +35 -0
- data/plugin/microsummary.rb +62 -0
- data/plugin/mm_footer.rb +215 -0
- data/plugin/monthly_autopagerize.rb +67 -0
- data/plugin/my_hotentry.rb +132 -0
- data/plugin/navi_day.rb +118 -0
- data/plugin/navi_this_month.rb +15 -0
- data/plugin/nicovideo.rb +115 -0
- data/plugin/notify_miniblog.rb +134 -0
- data/plugin/ogp.rb +55 -0
- data/plugin/ohmsha_estore.rb +71 -0
- data/plugin/openid.rb +90 -0
- data/plugin/opensearch_ad.rb +33 -0
- data/plugin/picasa.rb +56 -0
- data/plugin/plugin_checker.rb +41 -0
- data/plugin/popit.rb +22 -0
- data/plugin/prettify.rb +19 -0
- data/plugin/prezi.rb +10 -0
- data/plugin/profile.rb +222 -0
- data/plugin/puboo.rb +93 -0
- data/plugin/pygments_css.rb +76 -0
- data/plugin/rating.rb +419 -0
- data/plugin/recent_estraier.rb +50 -0
- data/plugin/recent_tweet.rb +71 -0
- data/plugin/retweet.rb +86 -0
- data/plugin/rubykaigi.rb +99 -0
- data/plugin/search-bing.rb +87 -0
- data/plugin/search-default.rb +264 -0
- data/plugin/search-google-custom.rb +60 -0
- data/plugin/search-yahoo-websearch.rb +121 -0
- data/plugin/search-yahoo.rb +109 -0
- data/plugin/section_footer.rb +195 -0
- data/plugin/section_footer2.rb +278 -0
- data/plugin/section_permalink.rb +73 -0
- data/plugin/section_permalink_anchor.rb +39 -0
- data/plugin/select_style.rb +42 -0
- data/plugin/select_theme.rb +90 -0
- data/plugin/show_and_hide.rb +77 -0
- data/plugin/slideshare.rb +10 -0
- data/plugin/socialbutton.rb +60 -0
- data/plugin/tatsu_zine.rb +93 -0
- data/plugin/tdiarygraph_flashstyle.rb +296 -0
- data/plugin/tdiarytimes.rb +166 -0
- data/plugin/tdiarytimes2.rb +406 -0
- data/plugin/tdiarytimes_flashstyle.rb +263 -0
- data/plugin/tdiarytimes_textstyle.rb +290 -0
- data/plugin/title_anchor.rb +16 -0
- data/plugin/tweet_quote.rb +106 -0
- data/plugin/twitpic.rb +10 -0
- data/plugin/twitter.rb +46 -0
- data/plugin/twitter_anywhere.rb +209 -0
- data/plugin/twitter_badge.rb +42 -0
- data/plugin/twitter_js.rb +59 -0
- data/plugin/ustream.rb +19 -0
- data/plugin/vimeo.rb +14 -0
- data/plugin/volatile.rb +89 -0
- data/plugin/vote.rb +100 -0
- data/plugin/wikiloc.rb +27 -0
- data/plugin/windex.rb +512 -0
- data/plugin/yahoo_kousei.rb +79 -0
- data/plugin/yahoo_map.rb +97 -0
- data/plugin/youtube.rb +33 -0
- data/plugin/yshop.rb +189 -0
- data/plugin/zenback.rb +46 -0
- data/spec/apple_webclip_spec.rb +46 -0
- data/spec/fixtures/friendfeed.xml +2 -0
- data/spec/fixtures/github.json +1 -0
- data/spec/fixtures/twitter.xml +73 -0
- data/spec/gist_spec.rb +16 -0
- data/spec/github_link_spec.rb +39 -0
- data/spec/google_analytics_spec.rb +60 -0
- data/spec/jdate_spec.rb +23 -0
- data/spec/jmonth_spec.rb +28 -0
- data/spec/jyear_spec.rb +21 -0
- data/spec/my_hotentry_spec.rb +78 -0
- data/spec/openid_spec.rb +246 -0
- data/spec/opensearch_ad_spec.rb +50 -0
- data/spec/profile_spec.rb +88 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec_helper.rb +223 -0
- data/spec/title_anchor_spec.rb +39 -0
- data/spec/twitter_js_spec.rb +116 -0
- data/spec/youtube_spec.rb +20 -0
- data/style/hatena_style.rb +1011 -0
- data/style/markdown_style.rb +239 -0
- data/style/wikiext_style.rb +21 -0
- data/tdiary-contrib.gemspec +25 -0
- data/util/clean-spam/README.ja +1 -0
- data/util/clean-spam/tdiary-comment-clean +46 -0
- data/util/clean-spam/tdiary-comment-clean2 +81 -0
- data/util/clean-spam/tdiary-referer-clean +46 -0
- data/util/convert_pstore.rb +82 -0
- data/util/estraier-search/ChangeLog +36 -0
- data/util/estraier-search/README.ja +114 -0
- data/util/estraier-search/en/estraier-register.rb +3 -0
- data/util/estraier-search/estraier-register.rb +298 -0
- data/util/estraier-search/estraier-search.rb +273 -0
- data/util/estraier-search/estraier.rhtml +73 -0
- data/util/estraier-search/estraier.rxml +23 -0
- data/util/estraier-search/i.estraier.rhtml +31 -0
- data/util/estraier-search/ja/estraier-register.rb +3 -0
- data/util/image-gallery/README.ja +27 -0
- data/util/image-gallery/image-gallery.rb +523 -0
- data/util/image-gallery/image-gallery.rb.euc-jp +523 -0
- data/util/image-gallery/js/SmoothGallery/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/css/ReMooz.css +186 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/loading-bar-black.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_e.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_n.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_ne.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_nw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_s.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_se.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_sw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_w.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/spinner.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/jd.gallery.css +371 -0
- data/util/image-gallery/js/SmoothGallery/css/layout.css +91 -0
- data/util/image-gallery/js/SmoothGallery/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/resizer.php +113 -0
- data/util/image-gallery/js/SmoothGallery/scripts/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.Routing.js +126 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.js +109 -0
- data/util/image-gallery/js/SmoothGallery/scripts/ReMooz.js +364 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.js +843 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.set.js +183 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.transitions.js +90 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jdgalleryresize.js +828 -0
- data/util/image-gallery/js/SmoothGallery/scripts/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2-more.js +103 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2.1-core-yc.js +349 -0
- data/util/image-gallery/js/SmoothGallery/scripts/resizer.php +113 -0
- data/util/image-gallery/misc/plugin/recent_image.rb +406 -0
- data/util/image-gallery/skel/gallery.rhtml +154 -0
- data/util/image-gallery/skel/gallery.rhtml.euc-jp +154 -0
- data/util/image-gallery/tdiary.conf.igsample +8 -0
- data/util/image-gallery/theme/image-gallery.css +85 -0
- data/util/image2flickr.rb +282 -0
- data/util/posttdiary/README.ja +12 -0
- data/util/posttdiary/posttdiary-ex.rb +1155 -0
- data/util/posttdiary/posttdiary.rb +245 -0
- data/util/rast-search/ChangeLog +55 -0
- data/util/rast-search/README.ja +99 -0
- data/util/rast-search/en/rast-register.rb +3 -0
- data/util/rast-search/i.rast.rhtml +33 -0
- data/util/rast-search/ja/rast-register.rb +3 -0
- data/util/rast-search/rast-register.rb +326 -0
- data/util/rast-search/rast-search.rb +249 -0
- data/util/rast-search/rast.rhtml +66 -0
- data/util/rast-search/rast.rxml +21 -0
- data/util/section_link/README +11 -0
- data/util/section_link/misc/plugin/section_link.rb +68 -0
- data/util/section_link/misc/plugin/section_link_anchor.rb +38 -0
- data/util/section_link/tdiary/tdiary_day_ext.rb +21 -0
- data/util/section_link/tdiary/tdiaryext_style.rb +36 -0
- data/util/section_link/tdiary/wikiext_style.rb +36 -0
- data/util/tdiary-for-ruby1.9/compatible.rb +97 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.2.0.patch +98 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.3.1.patch +212 -0
- data/util/tdiary-grep/README +4 -0
- data/util/tdiary-grep/grep.rb +445 -0
- data/util/tdiary-mode/http.el +130 -0
- data/util/tdiary-mode/tdiary-mode.el +613 -0
- data/util/tdiary-vim/ChangeLog +25 -0
- data/util/tdiary-vim/README +60 -0
- data/util/tdiary-vim/tdiary.vim +350 -0
- data/util/tdiarysearch/README.en +53 -0
- data/util/tdiarysearch/README.ja +99 -0
- data/util/tdiarysearch/search.rb +504 -0
- metadata +497 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<user>
|
3
|
+
<id>65589541</id>
|
4
|
+
<name>tDiary.org</name>
|
5
|
+
<screen_name>tDiary</screen_name>
|
6
|
+
<location></location>
|
7
|
+
<description>tDiaryオフィシャルアカウント</description>
|
8
|
+
<profile_image_url>http://a0.twimg.com/profile_images/379668735/square_logo_normal.png</profile_image_url>
|
9
|
+
<profile_image_url_https>https://si0.twimg.com/profile_images/379668735/square_logo_normal.png</profile_image_url_https>
|
10
|
+
<url>http://www.tdiary.org/</url>
|
11
|
+
<protected>false</protected>
|
12
|
+
<followers_count>286</followers_count>
|
13
|
+
<profile_background_color>FFFFFF</profile_background_color>
|
14
|
+
<profile_text_color>333333</profile_text_color>
|
15
|
+
<profile_link_color>0084B4</profile_link_color>
|
16
|
+
<profile_sidebar_fill_color>D0FFD0</profile_sidebar_fill_color>
|
17
|
+
<profile_sidebar_border_color>D0FFD0</profile_sidebar_border_color>
|
18
|
+
<friends_count>261</friends_count>
|
19
|
+
<created_at>Fri Aug 14 07:50:23 +0000 2009</created_at>
|
20
|
+
<favourites_count>3</favourites_count>
|
21
|
+
<utc_offset>32400</utc_offset>
|
22
|
+
<time_zone>Tokyo</time_zone>
|
23
|
+
<profile_background_image_url>http://a0.twimg.com/images/themes/theme1/bg.png</profile_background_image_url>
|
24
|
+
<profile_background_image_url_https>https://si0.twimg.com/images/themes/theme1/bg.png</profile_background_image_url_https>
|
25
|
+
<profile_background_tile>false</profile_background_tile>
|
26
|
+
<profile_use_background_image>false</profile_use_background_image>
|
27
|
+
<notifications></notifications>
|
28
|
+
<geo_enabled>false</geo_enabled>
|
29
|
+
<verified>false</verified>
|
30
|
+
<following></following>
|
31
|
+
<statuses_count>313</statuses_count>
|
32
|
+
<lang>ja</lang>
|
33
|
+
<contributors_enabled>false</contributors_enabled>
|
34
|
+
<follow_request_sent></follow_request_sent>
|
35
|
+
<listed_count>31</listed_count>
|
36
|
+
<default_profile>false</default_profile>
|
37
|
+
<default_profile_image>false</default_profile_image>
|
38
|
+
<is_translator>false</is_translator>
|
39
|
+
<status>
|
40
|
+
<created_at>Mon Sep 17 00:04:52 +0000 2012</created_at>
|
41
|
+
<id>247486242491604992</id>
|
42
|
+
<text>RT @hsbt: DefaultIO から RdbIO へのインポータできた #tdiary</text>
|
43
|
+
<source><a href="http://www.crowy.net/" rel="nofollow">Crowy</a></source>
|
44
|
+
<truncated>false</truncated>
|
45
|
+
<favorited>false</favorited>
|
46
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
47
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
48
|
+
<in_reply_to_screen_name></in_reply_to_screen_name>
|
49
|
+
<retweet_count>2</retweet_count>
|
50
|
+
<retweeted>false</retweeted>
|
51
|
+
<retweeted_status>
|
52
|
+
<created_at>Mon Sep 17 00:01:16 +0000 2012</created_at>
|
53
|
+
<id>247485333179101185</id>
|
54
|
+
<text>DefaultIO から RdbIO へのインポータできた #tdiary</text>
|
55
|
+
<source><a href="http://mzp.github.com/atig/" rel="nofollow">atig.rb</a></source>
|
56
|
+
<truncated>false</truncated>
|
57
|
+
<favorited>false</favorited>
|
58
|
+
<in_reply_to_status_id></in_reply_to_status_id>
|
59
|
+
<in_reply_to_user_id></in_reply_to_user_id>
|
60
|
+
<in_reply_to_screen_name></in_reply_to_screen_name>
|
61
|
+
<retweet_count>2</retweet_count>
|
62
|
+
<retweeted>false</retweeted>
|
63
|
+
<geo/>
|
64
|
+
<coordinates/>
|
65
|
+
<place/>
|
66
|
+
<contributors/>
|
67
|
+
</retweeted_status>
|
68
|
+
<geo/>
|
69
|
+
<coordinates/>
|
70
|
+
<place/>
|
71
|
+
<contributors/>
|
72
|
+
</status>
|
73
|
+
</user>
|
data/spec/gist_spec.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "gist plugin" do
|
5
|
+
DUMMY_GIST_ID = 1234567890
|
6
|
+
|
7
|
+
it 'should render javascript tag with specified gist-id' do
|
8
|
+
plugin = fake_plugin(:gist)
|
9
|
+
snippet = plugin.gist(DUMMY_GIST_ID)
|
10
|
+
expected = (<<-EOS).chomp
|
11
|
+
<div class="gist_plugin"><script src="http://gist.github.com/1234567890.js"></script>
|
12
|
+
<noscript><a href="http://gist.github.com/1234567890">gist:1234567890</a></noscript></div>
|
13
|
+
EOS
|
14
|
+
snippet.should == expected
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "github link plugin" do
|
5
|
+
let(:plugin) { fake_plugin(:github_link) }
|
6
|
+
subject { plugin.gh_link(*args) }
|
7
|
+
|
8
|
+
describe 'repository page' do
|
9
|
+
let(:args) { ['tdiary/tdiary-contrib'] }
|
10
|
+
|
11
|
+
it 'should render repository a tag' do
|
12
|
+
should == %(<a href='https://github.com/tdiary/tdiary-contrib'>tdiary-contrib</a>)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe 'issues page' do
|
17
|
+
let(:args) { ['tdiary/tdiary-contrib#100'] }
|
18
|
+
|
19
|
+
it 'should render issues a tag' do
|
20
|
+
should == %(<a href='https://github.com/tdiary/tdiary-contrib/issues/100'>tdiary-contrib#100</a>)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
context "When given altenative text" do
|
24
|
+
let(:text) { 'This project' }
|
25
|
+
let(:github_identifier) { 'tdiary/tdiary-contrib' }
|
26
|
+
let(:args) { [github_identifier, text] }
|
27
|
+
|
28
|
+
it 'should render repository a tag with the specified text' do
|
29
|
+
should == %(<a href='https://github.com/#{github_identifier}'>#{text}</a>)
|
30
|
+
end
|
31
|
+
context "but the text is including <script>" do
|
32
|
+
let(:text) { '<script>alert("hoge");</script>' }
|
33
|
+
|
34
|
+
it 'should render a link text after sanitizing.' do
|
35
|
+
should_not == %(<a href='https://github.com/#{github_identifier}'>#{text}</a>)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "google_analytics plugin" do
|
5
|
+
def setup_google_analytics_plugin(profile_id, mode)
|
6
|
+
fake_plugin(:google_analytics) { |plugin|
|
7
|
+
plugin.mode = mode
|
8
|
+
plugin.conf['google_analytics.profile'] = profile_id
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "should render javascript" do
|
13
|
+
before do
|
14
|
+
@plugin = setup_google_analytics_plugin('53836-1', 'latest')
|
15
|
+
end
|
16
|
+
|
17
|
+
it "for footer" do
|
18
|
+
snippet = @plugin.footer_proc
|
19
|
+
snippet.should == expected_html_footer_snippet
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "should render javascript" do
|
24
|
+
before do
|
25
|
+
@plugin = setup_google_analytics_plugin('53836-1', 'conf')
|
26
|
+
end
|
27
|
+
|
28
|
+
it "for footer" do
|
29
|
+
snippet = @plugin.footer_proc
|
30
|
+
snippet.should be_empty
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "should not render when profile_id is empty" do
|
35
|
+
before do
|
36
|
+
@plugin = setup_google_analytics_plugin(nil, 'latest')
|
37
|
+
end
|
38
|
+
|
39
|
+
it "for footer" do
|
40
|
+
snippet = @plugin.footer_proc
|
41
|
+
snippet.should be_empty
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def expected_html_footer_snippet
|
46
|
+
expected = <<-SCRIPT
|
47
|
+
<script type="text/javascript"><!--
|
48
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
49
|
+
document.write(unescape('%3Cscript src="' + gaJsHost + 'google-analytics.com/ga.js" type="text/javascript"%3E%3C/script%3E'));
|
50
|
+
// --></script>
|
51
|
+
<script type="text/javascript"><!--
|
52
|
+
try {
|
53
|
+
var pageTracker = _gat._getTracker("UA-53836-1");
|
54
|
+
pageTracker._trackPageview();
|
55
|
+
} catch (err) {}
|
56
|
+
// --></script>
|
57
|
+
SCRIPT
|
58
|
+
expected.gsub( /^\t/, '' ).chomp
|
59
|
+
end
|
60
|
+
end
|
data/spec/jdate_spec.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
$:.unshift(File.dirname(__FILE__))
|
4
|
+
require 'spec_helper'
|
5
|
+
require 'time'
|
6
|
+
|
7
|
+
describe "jdate plugin" do
|
8
|
+
{
|
9
|
+
'20080121' => '月',
|
10
|
+
'20080122' => '火',
|
11
|
+
'20080123' => '水',
|
12
|
+
'20080124' => '木',
|
13
|
+
'20080125' => '金',
|
14
|
+
'20080126' => '土',
|
15
|
+
'20080127' => '日',
|
16
|
+
}.each do |k,v|
|
17
|
+
it { setup_jdate_plugin(Time.parse(k)).date.strftime('%J').should == v }
|
18
|
+
end
|
19
|
+
|
20
|
+
def setup_jdate_plugin(date)
|
21
|
+
fake_plugin(:jdate) {|plugin| plugin.date = date}
|
22
|
+
end
|
23
|
+
end
|
data/spec/jmonth_spec.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
$:.unshift(File.dirname(__FILE__))
|
4
|
+
require 'spec_helper'
|
5
|
+
require 'time'
|
6
|
+
|
7
|
+
describe "jmonth plugin" do
|
8
|
+
{
|
9
|
+
'2007/01/01' => '睦月',
|
10
|
+
'2007/02/01' => '如月',
|
11
|
+
'2007/03/01' => '弥生',
|
12
|
+
'2007/04/01' => '卯月',
|
13
|
+
'2007/05/01' => '皐月',
|
14
|
+
'2007/06/01' => '水無月',
|
15
|
+
'2007/07/01' => '文月',
|
16
|
+
'2007/08/01' => '葉月',
|
17
|
+
'2007/09/01' => '長月',
|
18
|
+
'2007/10/01' => '神無月',
|
19
|
+
'2007/11/01' => '霜月',
|
20
|
+
'2007/12/01' => '師走'
|
21
|
+
}.each do |k,v|
|
22
|
+
it { setup_jmonth_plugin(Time.parse(k)).date.strftime('%i').should == v }
|
23
|
+
end
|
24
|
+
|
25
|
+
def setup_jmonth_plugin(date)
|
26
|
+
fake_plugin(:jmonth) { |plugin| plugin.date = date }
|
27
|
+
end
|
28
|
+
end
|
data/spec/jyear_spec.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
$:.unshift(File.dirname(__FILE__))
|
4
|
+
require 'spec_helper'
|
5
|
+
require 'time'
|
6
|
+
|
7
|
+
describe "jyear plugin" do
|
8
|
+
{
|
9
|
+
'1925/01/01' => '昔々',
|
10
|
+
'1926/12/25' => '昭和元年',
|
11
|
+
'1927/01/01' => '昭和2',
|
12
|
+
'1989/01/08' => '平成元年',
|
13
|
+
'1990/01/01' => '平成2',
|
14
|
+
}.each do |k,v|
|
15
|
+
it { setup_jyear_plugin(Time.parse(k)).date.strftime('%K').should == v }
|
16
|
+
end
|
17
|
+
|
18
|
+
def setup_jyear_plugin(date)
|
19
|
+
fake_plugin(:jyear) { |plugin| plugin.date = date }
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
$:.unshift(File.dirname(__FILE__))
|
4
|
+
require 'spec_helper'
|
5
|
+
require 'tmpdir'
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
describe "MyHotEntry" do
|
9
|
+
def cache_filename
|
10
|
+
"#{File.basename(__FILE__, ".rb")}-#{$$}"
|
11
|
+
end
|
12
|
+
before(:each) do
|
13
|
+
fake_plugin(:my_hotentry)
|
14
|
+
@cache_path = File.join(Dir.tmpdir, cache_filename)
|
15
|
+
Dir.mkdir(@cache_path)
|
16
|
+
@dbfile = "#{@cache_path}/my_hotentry.dat"
|
17
|
+
@base_url = 'http://d.hatena.ne.jp/'
|
18
|
+
@hotentry = MyHotEntry.new(@dbfile)
|
19
|
+
end
|
20
|
+
|
21
|
+
after(:each) do
|
22
|
+
FileUtils.rmtree(@cache_path)
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "#update" do
|
26
|
+
before do
|
27
|
+
@hotentry.update(@base_url)
|
28
|
+
@entries = @hotentry.entries
|
29
|
+
end
|
30
|
+
|
31
|
+
it "キャッシュファイルが生成されていること" do
|
32
|
+
File.should be_file(@dbfile)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "人気の日記が取得できていること" do
|
36
|
+
@entries.size.should > 0
|
37
|
+
end
|
38
|
+
|
39
|
+
it "取得したエントリにbase_urlとタイトルが含まれていること" do
|
40
|
+
@entries.each do |entry|
|
41
|
+
entry[:url].should be_include(@base_url)
|
42
|
+
entry[:title].size.should > 0
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "何度もupdateした場合" do
|
48
|
+
before do
|
49
|
+
@hotentry.update(@base_url)
|
50
|
+
@original_entry_size = @hotentry.entries.size
|
51
|
+
@hotentry.update(@base_url)
|
52
|
+
@entry_size = @hotentry.entries.size
|
53
|
+
end
|
54
|
+
|
55
|
+
it "キャッシュサイズが大きくならないこと" do
|
56
|
+
@entry_size.should == @original_entry_size
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "取得結果が空の場合" do
|
61
|
+
before do
|
62
|
+
@exist_url = 'http://d.hatena.ne.jp/'
|
63
|
+
@empty_url = 'http://empty-url.example.com/'
|
64
|
+
end
|
65
|
+
|
66
|
+
it "キャッシュをクリアしないこと" do
|
67
|
+
@hotentry.update(@empty_url)
|
68
|
+
@hotentry.entries.size.should == 0
|
69
|
+
|
70
|
+
@hotentry.update(@exist_url)
|
71
|
+
@hotentry.entries.size.should > 0
|
72
|
+
exist_size = @hotentry.entries.size
|
73
|
+
|
74
|
+
@hotentry.update(@empty_url)
|
75
|
+
@hotentry.entries.size.should == exist_size
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/spec/openid_spec.rb
ADDED
@@ -0,0 +1,246 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "openid plugin w/" do
|
5
|
+
def setup_open_id_plugin(service, userid)
|
6
|
+
fake_plugin(:openid) { |plugin|
|
7
|
+
plugin.mode = 'latest'
|
8
|
+
plugin.conf['openid.service'] = service
|
9
|
+
plugin.conf['openid.id'] = userid
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "Hatena" do
|
14
|
+
before do
|
15
|
+
plugin = setup_open_id_plugin('Hatena', 'tdtds')
|
16
|
+
@header_snippet = plugin.header_proc
|
17
|
+
end
|
18
|
+
|
19
|
+
it { @header_snippet.should include_link_tag_with(
|
20
|
+
:rel => 'openid.server',
|
21
|
+
:href => 'https://www.hatena.ne.jp/openid/server')}
|
22
|
+
|
23
|
+
it { @header_snippet.should include_link_tag_with(
|
24
|
+
:rel => 'openid.delegate',
|
25
|
+
:href => 'http://www.hatena.ne.jp/tdtds/')}
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "livedoor" do
|
29
|
+
before do
|
30
|
+
plugin = setup_open_id_plugin('livedoor', 'tdtds')
|
31
|
+
@header_snippet = plugin.header_proc
|
32
|
+
end
|
33
|
+
|
34
|
+
it { @header_snippet.should include_link_tag_with(
|
35
|
+
:rel => 'openid.server',
|
36
|
+
:href => 'http://auth.livedoor.com/openid/server')}
|
37
|
+
|
38
|
+
it { @header_snippet.should include_link_tag_with(
|
39
|
+
:rel => 'openid.delegate',
|
40
|
+
:href => 'http://profile.livedoor.com/tdtds')}
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "LiveJournal" do
|
44
|
+
before do
|
45
|
+
plugin = setup_open_id_plugin('LiveJournal', 'tdtds')
|
46
|
+
@header_snippet = plugin.header_proc
|
47
|
+
end
|
48
|
+
|
49
|
+
it { @header_snippet.should include_link_tag_with(
|
50
|
+
:rel => 'openid.server',
|
51
|
+
:href => 'http://www.livejournal.com/openid/server.bml')}
|
52
|
+
|
53
|
+
it { @header_snippet.should include_link_tag_with(
|
54
|
+
:rel => 'openid.delegate',
|
55
|
+
:href => 'http://tdtds.livejournal.com/')}
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
describe "OpenID.ne.jp" do
|
60
|
+
before do
|
61
|
+
plugin = setup_open_id_plugin('OpenID.ne.jp', 'tdtds')
|
62
|
+
@header_snippet = plugin.header_proc
|
63
|
+
end
|
64
|
+
|
65
|
+
it { @header_snippet.should include_link_tag_with(
|
66
|
+
:rel => 'openid.server',
|
67
|
+
:href => 'http://www.openid.ne.jp/user/auth')}
|
68
|
+
|
69
|
+
it { @header_snippet.should include_link_tag_with(
|
70
|
+
:rel => 'openid.delegate',
|
71
|
+
:href => 'http://tdtds.openid.ne.jp')}
|
72
|
+
|
73
|
+
it { @header_snippet.should include_xrds_meta_tag_with(
|
74
|
+
:content => 'http://tdtds.openid.ne.jp/user/xrds')}
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
describe "TypeKey" do
|
79
|
+
before do
|
80
|
+
plugin = setup_open_id_plugin('TypeKey', 'tdtds')
|
81
|
+
@header_snippet = plugin.header_proc
|
82
|
+
end
|
83
|
+
|
84
|
+
it { @header_snippet.should include_link_tag_with(
|
85
|
+
:rel => 'openid.server',
|
86
|
+
:href => 'http://www.typekey.com/t/openid/')}
|
87
|
+
|
88
|
+
it { @header_snippet.should include_link_tag_with(
|
89
|
+
:rel => 'openid.delegate',
|
90
|
+
:href => 'http://profile.typekey.com/tdtds/')}
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
describe "Vox" do
|
95
|
+
before do
|
96
|
+
plugin = setup_open_id_plugin('Vox', 'tdtds')
|
97
|
+
@header_snippet = plugin.header_proc
|
98
|
+
end
|
99
|
+
|
100
|
+
it { @header_snippet.should include_link_tag_with(
|
101
|
+
:rel => 'openid.server',
|
102
|
+
:href => 'http://www.vox.com/services/openid/server')}
|
103
|
+
|
104
|
+
it { @header_snippet.should include_link_tag_with(
|
105
|
+
:rel => 'openid.delegate',
|
106
|
+
:href => 'http://tdtds.vox.com/')}
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "myopenid.com" do
|
110
|
+
before do
|
111
|
+
@plugin = setup_open_id_plugin('myopenid.com', 'tdtds')
|
112
|
+
@header_snippet = @plugin.header_proc
|
113
|
+
end
|
114
|
+
|
115
|
+
it { @header_snippet.should include_xrds_meta_tag_with(
|
116
|
+
:content => "http://www.myopenid.com/xrds?username=tdtds")}
|
117
|
+
|
118
|
+
it { @header_snippet.should include_link_tag_with(
|
119
|
+
:rel => "openid.server",
|
120
|
+
:href => "http://www.myopenid.com/server")}
|
121
|
+
|
122
|
+
it { @header_snippet.should include_link_tag_with(
|
123
|
+
:rel => "openid.delegate",
|
124
|
+
:href => "http://tdtds.myopenid.com")}
|
125
|
+
|
126
|
+
it { @header_snippet.should include_link_tag_with(
|
127
|
+
:rel => "openid2.provider",
|
128
|
+
:href => "http://www.myopenid.com/server")}
|
129
|
+
|
130
|
+
it { @header_snippet.should include_link_tag_with(
|
131
|
+
:rel => "openid2.local_id",
|
132
|
+
:href => "http://tdtds.myopenid.com")}
|
133
|
+
end
|
134
|
+
|
135
|
+
describe "claimID.com" do
|
136
|
+
before do
|
137
|
+
@plugin = setup_open_id_plugin('claimID.com', 'tdtds')
|
138
|
+
@header_snippet = @plugin.header_proc
|
139
|
+
end
|
140
|
+
|
141
|
+
it { @header_snippet.should include_xrds_meta_tag_with(
|
142
|
+
:content => "http://claimid.com/tdtds/xrds")}
|
143
|
+
|
144
|
+
it { @header_snippet.should include_link_tag_with(
|
145
|
+
:rel => "openid.server",
|
146
|
+
:href => "http://openid.claimid.com/server")}
|
147
|
+
|
148
|
+
it { @header_snippet.should include_link_tag_with(
|
149
|
+
:rel => "openid.delegate",
|
150
|
+
:href => "http://openid.claimid.com/tdtds")}
|
151
|
+
end
|
152
|
+
|
153
|
+
describe "Personal Identity Provider (PIP)" do
|
154
|
+
before do
|
155
|
+
@plugin = setup_open_id_plugin('Personal Identity Provider (PIP)', 'tdtds')
|
156
|
+
@header_snippet = @plugin.header_proc
|
157
|
+
end
|
158
|
+
|
159
|
+
it { @header_snippet.should include_xrds_meta_tag_with(
|
160
|
+
:content => "http://pip.verisignlabs.com/user/tdtds/yadisxrds")}
|
161
|
+
|
162
|
+
it { @header_snippet.should include_link_tag_with(
|
163
|
+
:rel => "openid.server",
|
164
|
+
:href => "http://pip.verisignlabs.com/server")}
|
165
|
+
|
166
|
+
it { @header_snippet.should include_link_tag_with(
|
167
|
+
:rel => "openid.delegate",
|
168
|
+
:href => "http://tdtds.pip.verisignlabs.com/")}
|
169
|
+
|
170
|
+
it { @header_snippet.should include_link_tag_with(
|
171
|
+
:rel => "openid2.provider",
|
172
|
+
:href => "http://pip.verisignlabs.com/server")}
|
173
|
+
|
174
|
+
it { @header_snippet.should include_link_tag_with(
|
175
|
+
:rel => "openid2.local_id",
|
176
|
+
:href => "http://tdtds.pip.verisignlabs.com/")}
|
177
|
+
end
|
178
|
+
|
179
|
+
describe "Yahoo! Japan" do
|
180
|
+
before do
|
181
|
+
plugin = setup_open_id_plugin('Yahoo! Japan', 'tdtds')
|
182
|
+
@header_snippet = plugin.header_proc
|
183
|
+
end
|
184
|
+
|
185
|
+
it { @header_snippet.should include_link_tag_with(
|
186
|
+
:rel => 'openid2.provider',
|
187
|
+
:href => 'https://open.login.yahooapis.jp/openid/op/auth')}
|
188
|
+
|
189
|
+
it { @header_snippet.should include_link_tag_with(
|
190
|
+
:rel => 'openid2.local_id',
|
191
|
+
:href => 'https://me.yahoo.co.jp/a/tdtds')}
|
192
|
+
|
193
|
+
it { @header_snippet.should_not include_link_tag_with(
|
194
|
+
:rel => "openid.server")}
|
195
|
+
|
196
|
+
it { @header_snippet.should_not include_link_tag_with(
|
197
|
+
:rel => "openid.delegate")}
|
198
|
+
|
199
|
+
end
|
200
|
+
|
201
|
+
describe "Yahoo!" do
|
202
|
+
before do
|
203
|
+
plugin = setup_open_id_plugin('Yahoo!', 'tdtds')
|
204
|
+
@header_snippet = plugin.header_proc
|
205
|
+
end
|
206
|
+
|
207
|
+
it { @header_snippet.should include_link_tag_with(
|
208
|
+
:rel => 'openid2.provider',
|
209
|
+
:href => 'https://open.login.yahooapis.com/openid/op/auth')}
|
210
|
+
|
211
|
+
it { @header_snippet.should include_link_tag_with(
|
212
|
+
:rel => 'openid2.local_id',
|
213
|
+
:href => 'https://me.yahoo.com/a/tdtds')}
|
214
|
+
|
215
|
+
it { @header_snippet.should_not include_link_tag_with(
|
216
|
+
:rel => "openid.server")}
|
217
|
+
|
218
|
+
it { @header_snippet.should_not include_link_tag_with(
|
219
|
+
:rel => "openid.delegate")}
|
220
|
+
end
|
221
|
+
|
222
|
+
RSpec::Matchers.define :include_link_tag_with do |options|
|
223
|
+
description do
|
224
|
+
"include #{options[:rel]} link tag"
|
225
|
+
end
|
226
|
+
|
227
|
+
match do |actual|
|
228
|
+
expected = %|<link rel="#{options[:rel]}"| if options[:rel]
|
229
|
+
expected <<= %| href="#{options[:href]}">| if options[:href]
|
230
|
+
actual.include?( expected )
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
RSpec::Matchers.define :include_xrds_meta_tag_with do |options|
|
235
|
+
description do
|
236
|
+
"include XRDS meta tag"
|
237
|
+
end
|
238
|
+
|
239
|
+
match do |actual|
|
240
|
+
expected = (<<-"EOS").chomp
|
241
|
+
<meta http-equiv="X-XRDS-Location" content="#{options[:content]}">
|
242
|
+
EOS
|
243
|
+
actual.include?( expected )
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "opensearch_ad plugin w/" do
|
5
|
+
def setup_opensearch_ad_plugin(title, xml, mode)
|
6
|
+
fake_plugin(:opensearch_ad) { |plugin|
|
7
|
+
plugin.mode = mode
|
8
|
+
plugin.conf['opensearch.title'] = title
|
9
|
+
plugin.conf['opensearch.xml'] = xml
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "in day mode" do
|
14
|
+
before do
|
15
|
+
plugin = setup_opensearch_ad_plugin('OpenSearch', 'http://example.com/opensearch.xml', 'day')
|
16
|
+
@header_snippet = plugin.header_proc
|
17
|
+
end
|
18
|
+
|
19
|
+
it { @header_snippet.should == expected_link_tag_with(
|
20
|
+
:title => 'OpenSearch',
|
21
|
+
:xml => 'http://example.com/opensearch.xml')}
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "in latest mode" do
|
25
|
+
before do
|
26
|
+
plugin = setup_opensearch_ad_plugin('OpenSearch', 'http://example.com/opensearch.xml', 'latest')
|
27
|
+
@header_snippet = plugin.header_proc
|
28
|
+
end
|
29
|
+
|
30
|
+
it { @header_snippet.should == expected_link_tag_with(
|
31
|
+
:title => 'OpenSearch',
|
32
|
+
:xml => 'http://example.com/opensearch.xml')}
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "in edit mode" do
|
36
|
+
before do
|
37
|
+
plugin = setup_opensearch_ad_plugin('OpenSearch', 'http://example.com/opensearch.xml', 'edit')
|
38
|
+
@header_snippet = plugin.header_proc
|
39
|
+
end
|
40
|
+
|
41
|
+
it { @header_snippet.should be_empty }
|
42
|
+
end
|
43
|
+
|
44
|
+
def expected_link_tag_with(options)
|
45
|
+
result = <<-HTML
|
46
|
+
<link type="application/opensearchdescription+xml" rel="search" title="#{options[:title]}" href="#{options[:xml]}">
|
47
|
+
HTML
|
48
|
+
result.gsub( /^\t/, '' ).chomp
|
49
|
+
end
|
50
|
+
end
|