tdiary-contrib 4.2.0 → 4.2.1

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/js/preview.js +50 -0
  3. data/lib/tdiary/contrib/version.rb +1 -1
  4. data/plugin/category-lite.rb +235 -0
  5. data/plugin/code-prettify.rb +1 -8
  6. data/plugin/en/category-lite.rb +46 -0
  7. data/plugin/flickr.rb +1 -6
  8. data/plugin/google_analytics.rb +8 -9
  9. data/plugin/image_gps.rb +15 -5
  10. data/plugin/instagr.rb +8 -39
  11. data/plugin/instagram.rb +59 -2
  12. data/plugin/ja/category-lite.rb +48 -0
  13. data/plugin/ohmsha_estore.rb +9 -22
  14. data/plugin/playstore.rb +16 -24
  15. data/plugin/preview.rb +10 -0
  16. data/plugin/profile.rb +7 -19
  17. data/plugin/rubykaigi.rb +7 -1
  18. data/plugin/socialbutton.rb +1 -1
  19. data/spec/fixtures/github.json +1 -1
  20. data/spec/flicker_spec.rb +1 -1
  21. data/spec/google_analytics_spec.rb +8 -9
  22. data/spec/profile_spec.rb +2 -18
  23. metadata +78 -41
  24. data/.gitignore +0 -2
  25. data/.travis.yml +0 -18
  26. data/Gemfile +0 -13
  27. data/Gemfile.lock +0 -66
  28. data/js/prettify/lang-apollo.js +0 -2
  29. data/js/prettify/lang-clj.js +0 -18
  30. data/js/prettify/lang-css.js +0 -2
  31. data/js/prettify/lang-go.js +0 -1
  32. data/js/prettify/lang-hs.js +0 -2
  33. data/js/prettify/lang-lisp.js +0 -3
  34. data/js/prettify/lang-lua.js +0 -2
  35. data/js/prettify/lang-ml.js +0 -2
  36. data/js/prettify/lang-n.js +0 -4
  37. data/js/prettify/lang-proto.js +0 -1
  38. data/js/prettify/lang-scala.js +0 -2
  39. data/js/prettify/lang-sql.js +0 -2
  40. data/js/prettify/lang-tex.js +0 -1
  41. data/js/prettify/lang-vb.js +0 -2
  42. data/js/prettify/lang-vhdl.js +0 -3
  43. data/js/prettify/lang-wiki.js +0 -2
  44. data/js/prettify/lang-xq.js +0 -3
  45. data/js/prettify/lang-yaml.js +0 -2
  46. data/js/prettify/prettify.css +0 -1
  47. data/js/prettify/prettify.js +0 -28
  48. data/misc/tdiarygraph/tdiarygraph120x90e.swf +0 -0
  49. data/misc/tdiarygraph/tdiarygraph125x125e.swf +0 -0
  50. data/misc/tdiarygraph/tdiarygraph240x180e.swf +0 -0
  51. data/misc/tdiarygraph/tdiarygraph468x60e.swf +0 -0
  52. data/misc/tdiarygraph/tdiarygraph728x90e.swf +0 -0
  53. data/misc/tdiarytimes/tdiarytimes125x125r.swf +0 -0
  54. data/misc/tdiarytimes/tdiarytimes125x125r7.swf +0 -0
  55. data/misc/tdiarytimes/tdiarytimes125x125s.swf +0 -0
  56. data/misc/tdiarytimes/tdiarytimes125x30.swf +0 -0
  57. data/misc/tdiarytimes/tdiarytimes234x30.swf +0 -0
  58. data/misc/tdiarytimes/tdiarytimes468x30.swf +0 -0
  59. data/plugin/tdiarygraph_flashstyle.rb +0 -292
  60. data/plugin/tdiarytimes.rb +0 -166
  61. data/tdiary-contrib.gemspec +0 -25
@@ -1,166 +0,0 @@
1
- # tdiarytimes.rb $Revision: 1.2 $
2
- #
3
- # Copyright (c) 2003 neuichi <neuichi@nmnl.jp>
4
- # Distributed under the GPL
5
- #
6
- # プラグイン配布ページ
7
- # http://nmnl.jp/hiki/software/?tDiary+%3A%3A+Plugin
8
- #
9
- # 動作条件:
10
- # ruby-gdが使える環境が必要です。
11
- #
12
- # 使い方:
13
- # このプラグインをプラグインディレクトリに入れ、
14
- # index.rbと同じディレクトリに、tdiarytimes.pngという名前の
15
- # サーバが書き込み権限を持っているファイルを作ります。
16
- # これで日記に書き込みするごとに、tdiarytimes.pngに
17
- # 画像を書き込みます。
18
- #
19
- # 日記上からこのpngファイルを呼び出すには、
20
- # tDiray上からプラグインとして
21
- # <%=tdiarytimes%>
22
- # として呼び出します。
23
- # 引数としてimgタグのaltの文字列を指定することも出来ます。
24
- # <%=tdiarytimes '文字列'%>
25
- #
26
- # また、tdiary.confに以下のオプションを書き込むことにより、
27
- # カスタマイズをすることが出来ます。
28
- #
29
- # @options['tdiarytimes.width'] = 400
30
- # 四角の横幅。デフォルト値400。
31
- # 実際に出力される画像サイズは、これに+10したサイズ。
32
- #
33
- # @options['tdiarytimes.height'] = 20
34
- # 四角の縦幅。デフォルト値20。
35
- # 実際に出力される画像サイズは、これに+16したサイズ。
36
- #
37
- # @options['tdiarytimes.file'] = 'tdiarytimes.png'
38
- # 出力する画像ファイル名。デフォルトは'tdiarytimes.png'
39
- #
40
- # @options['tdiarytimes.fillcolor'] = '#444444'
41
- # 四角の色。デフォルトは'#444444'
42
- #
43
- # @options['tdiarytimes.linecolor'] = '#ffffff'
44
- # 縦棒の色。デフォルトは'#ffffff'
45
- #
46
- # @options['tdiarytimes.textcolor'] = '#444444'
47
- # 文字色。デフォルトは'#444444'
48
- #
49
- # @options['tdiarytimes.text'] = 'T D I A R Y T I M E S'
50
- # 出力する文字。デフォルトは'T D I A R Y T I M E S'。なお半角英数字のみ対応。
51
- #
52
- # @options['tdiarytimes.day'] = 30
53
- # ログを保存する最大日数。デフォルトは30。
54
- # この場合、30日以上経ったデータは消去され、縦棒として描画されなくなる。
55
- #
56
-
57
- require 'GD'
58
-
59
- if /^(append|replace)$/ =~ @mode then
60
-
61
- #初期設定
62
- width = @options['tdiarytimes.width'] || 400
63
- height = @options['tdiarytimes.height'] || 20
64
- file = @options['tdiarytimes.file'] || 'tdiarytimes.png'
65
- fillcolor = @options['tdiarytimes.fillcolor'] || '#444444'
66
- linecolor = @options['tdiarytimes.linecolor'] || '#ffffff'
67
- textcolor = @options['tdiarytimes.textcolor'] || '#444444'
68
- text = @options['tdiarytimes.text'] || 'T D I A R Y T I M E S'
69
- day = @options['tdiarytimes.day'] || 30
70
-
71
- cache = "#{@cache_path}/tdiarytimes"
72
- Dir::mkdir( cache ) unless File::directory?( cache )
73
-
74
- image = GD::Image.new(width + 10,height + 16)
75
- transcolor = image.colorAllocate("#fffffe")
76
- image.transparent(transcolor)
77
- image.interlace = TRUE
78
- fillcolor = image.colorAllocate(fillcolor)
79
- linecolor = image.colorAllocate(linecolor)
80
- textcolor = image.colorAllocate(textcolor)
81
-
82
- #帯の描画
83
- image.filledRectangle(5,8,width + 4,height + 7,fillcolor)
84
-
85
- #時間挿入
86
- if width >= 160
87
- hour = 2
88
- hour_w = width / 12.0
89
- image.string(GD::Font::TinyFont, 2, height + 8, "0", textcolor)
90
- 11.times {
91
- image.string(GD::Font::TinyFont, (hour_w * hour/2).to_i , height + 8, hour.to_s, textcolor)
92
- hour += 2
93
- }
94
- image.string(GD::Font::TinyFont, width + 2, height + 8, "0", textcolor)
95
- else
96
- hour = 0
97
- hour_w = width / 6.0
98
- 6.times {
99
- image.string(GD::Font::TinyFont, (hour_w * hour/4).to_i + 4, height + 8, hour.to_s, textcolor)
100
- hour += 4
101
- }
102
- image.string(GD::Font::TinyFont, width + 2, height + 8, "0", textcolor)
103
- end
104
-
105
- #現在時刻の保存,読み込み
106
- begin
107
- io = open("#{cache}/tdiarytimes.dat","r")
108
- ary_times = Marshal.load(io)
109
- io.close
110
- rescue
111
- ary_times = []
112
- end
113
-
114
- ary_times << Time.now.to_f
115
- ary_times_new = []
116
-
117
- while ary_times.size != 0
118
- time = ary_times.shift
119
- time_now = Time.now.to_f.to_i
120
- ary_times_new << time.to_i if (86400 * day) > (time_now - time).to_i
121
- end
122
-
123
- ary_times = ary_times_new
124
-
125
- io = open("#{cache}/tdiarytimes.dat","w")
126
- Marshal.dump(ary_times,io)
127
- io.close
128
-
129
-
130
- #時間軸の挿入
131
- while ary_times.size != 0
132
- time = Time.at(ary_times.shift)
133
- time_w = ((time.to_a[2] * 60 + time.to_a[1]) / 1440.0 * width).to_i
134
- image.line(time_w + 5, 8 ,time_w + 5,height + 7, linecolor)
135
- end
136
-
137
- #文字の挿入
138
- image.string(GD::Font::TinyFont, 5, 0, text, textcolor)
139
-
140
- pngfile = open(file, 'w')
141
- image.png(pngfile)
142
- pngfile.close
143
-
144
- end
145
-
146
- def tdiarytimes(alt = nil)
147
- width = @options['tdiarytimes.width'].to_i || 400
148
- width += 10
149
-
150
- height = @options['tdiarytimes.height'].to_i || 20
151
- height += 16
152
-
153
- file = @options['tdiarytimes.file'] || 'tdiarytimes.png'
154
- text = @options['tdiarytimes.text'] || 'T D I A R Y T I M E S'
155
-
156
- result = ""
157
-
158
- if alt
159
- result << %Q|<img src="#{h file}" alt="#{h alt}" width="#{width}" height="#{height}" class="tdiarytimes">|
160
- else
161
- result << %Q|<img src="#{h file}" alt="#{h text}" width="#{width}" height="#{height}" class="tdiarytimes">|
162
- end
163
-
164
- result
165
-
166
- end
@@ -1,25 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'tdiary/contrib/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "tdiary-contrib"
8
- spec.version = TDiary::Contrib::VERSION
9
- spec.authors = ["tDiary contributors"]
10
- spec.email = ["support@tdiary.org"]
11
- spec.summary = %q{tDiary contributions package}
12
- spec.description = %q{tDiary contributions package that includes plugins, styles, utilities, libraries, filters, and extended io.}
13
- spec.homepage = "http://www.tdiary.org/"
14
- spec.license = "GPL-2 and/or others"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_dependency 'tdiary'
22
-
23
- spec.add_development_dependency "bundler", "~> 1.3"
24
- spec.add_development_dependency "rake"
25
- end