tdiary-contrib 5.0.6 → 5.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a05b3f25047b6bc6e9017c6c7994464cefac13fd
4
- data.tar.gz: c95af7773f37e017db01f658171af17335a47586
2
+ SHA256:
3
+ metadata.gz: 83f450ca5f0bd73c888d7495ed05323b5104d3f67c3ca8f077dbf64e61409aa5
4
+ data.tar.gz: 4d6f9afd972dd55417dd82ea98f57a0acbd3bda8db2637ceecdd1edd84907c09
5
5
  SHA512:
6
- metadata.gz: 3ea47a5edc86322387c752dc256a9510e1871218a67ab1880aac45a2773e71462378c970547c4fdb489dc3e0c2d7bfd8d72097172ca21623e7fea07592608413
7
- data.tar.gz: 765627b88d1e2e0f64b5249ad8aa26477f357396c250fdbd6491e5f786416a2fbceb7b963e0395d0e39bcf9027111d5e9abe9966deb11b74ac524cf779ba3ce6
6
+ metadata.gz: d6330a3ef7dd885b07b75ddd3d16ca8b4c9857a52b596c5c8dba6f5121ced57b5c30833c10df38f47497696a54d397f0c3ee7424ae8441cc29f95a1196faa576
7
+ data.tar.gz: 621078f662b39ffa102b0a08df3717450fed12542465c4f9e75e70ad7bb09f5d125e9951529d00c377c33ebfb7b5c787e344a84286cededb31b71c68a27a4f09
@@ -1,5 +1,5 @@
1
1
  module TDiary
2
2
  class Contrib
3
- VERSION = "5.0.6"
3
+ VERSION = "5.0.7"
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@
26
26
  # You can distribute this file under the GPL2 or any later version.
27
27
  #
28
28
  def comment_pushbullet
29
- require 'pushbullet'
29
+ require 'pushbullet_ruby'
30
30
 
31
31
  header = (@conf['comment_mail.header'] || '').dup
32
32
  header << ":#{@conf.date_format}" unless /%[a-zA-Z%]/ =~ header
@@ -35,8 +35,9 @@ def comment_pushbullet
35
35
  body = @comment.body.sub( /[\r\n]+\Z/, '' )
36
36
  link = @conf.base_url + anchor(@date.strftime('%Y%m%d')) + '#c' + "%02d"%serial
37
37
 
38
- Pushbullet.api_token = @conf['comment_pushbullet.access_token']
39
- Pushbullet::Contact.me.push_link(title,link,body)
38
+ client = PushbulletRuby::Client.new(@conf['comment_pushbullet.access_token'])
39
+ params = {title: title, url: link, body: body}
40
+ client.push_link(id: client.me, params: params)
40
41
  end
41
42
 
42
43
  add_update_proc do
@@ -5,10 +5,6 @@
5
5
  # Distributed under GPL.
6
6
  #
7
7
 
8
- def nicovideo_player_path
9
- 'http://www.nicovideo.jp'
10
- end
11
-
12
8
  def nicovideo_feed( i )
13
9
  <<-HTML
14
10
  <table border="0" cellpadding="4" cellspacing="0" summary="#{h i[:title]}"><tr valign="top">
@@ -9,7 +9,7 @@ def google_photos(src, width, height, alt="photo", place="photo", scale=nil)
9
9
  scale = scale || @conf['google_photos.scale'] || 100
10
10
  width = width.to_i * (scale.to_f / 100)
11
11
  height = height.to_i * (scale.to_f / 100)
12
- %Q|<img title="#{alt}" width="#{width}" height="#{height}" alt="#{alt}" src="#{src}" class="#{place} google">|
12
+ %Q|<img title="#{alt}" width="#{width.to_i}" height="#{height.to_i}" alt="#{alt}" src="#{src}" class="#{place} google">|
13
13
  end
14
14
 
15
15
  def google_photos_left(src, width, height, alt="photo", scale=nil)
@@ -5,10 +5,6 @@
5
5
  # Distributed under GPL.
6
6
  #
7
7
 
8
- def nicovideo_player_path
9
- 'http://www.nicovideo.jp'
10
- end
11
-
12
8
  def nicovideo_feed( i )
13
9
  <<-HTML
14
10
  <table border="0" cellpadding="4" cellspacing="0" summary="#{h i[:title]}"><tr valign="top">
data/plugin/nicovideo.rb CHANGED
@@ -73,17 +73,12 @@ def nicovideo_iframe( video_id )
73
73
  %Q|<iframe src="http://www.nicovideo.jp/thumb/#{video_id}" scrolling="no" style="border:1px solid #CCC;" frameborder="0"><a href="http://www.nicovideo.jp/watch/#{video_id}">#{label || 'link for nicovideo'}</a></iframe>\n|
74
74
  end
75
75
 
76
- def nicovideo_player( video_id, size = [544,384] )
76
+ def nicovideo_player(video_id, size = [640,360])
77
77
  if feed?
78
- nicovideo( video_id )
79
- elsif base_url =~ /\Ahttps:/
80
78
  nicovideo(video_id)
81
79
  else
82
- q = ''
83
- if size then
84
- q = "?w=#{h size[0]}&amp;h=#{h size[1]}"
85
- end
86
- %Q|<script type="text/javascript" src="#{nicovideo_player_path}/thumb_watch/#{video_id}#{q}"></script>|
80
+ q = size ? "?w=#{h size[0]}&amp;h=#{h size[1]}" : ''
81
+ %Q|<script type="application/javascript" src="https://embed.nicovideo.jp/watch/#{video_id}/script#{q}"></script>|
87
82
  end
88
83
  end
89
84
 
@@ -93,16 +88,15 @@ def nicovideo( video_id, label = nil, link = nil )
93
88
  r << %Q|<div id="thumbnail-#{video_id}">|
94
89
  api = nicovideo_call_api( video_id )
95
90
  thumb = @conf.to_native( nicovideo_inline( video_id, api, label, link ), 'UTF-8' )
96
- thumb.gsub!( /"INLINE_PLAYER"/, %Q|"#" onclick="return nicovideoPlayer( '#{video_id}' );"| )
97
91
  r << thumb
98
92
  r << '</div>'
99
93
  if feed?
100
94
  r.gsub!( /<a(?:[ \t\n\r][^>]*)?>/, '' )
101
95
  r.gsub!( %r{</a[ \t\n\r]*>}, '' )
102
- elsif base_url !~ /\Ahttps:/
96
+ else
103
97
  r << %Q|<div id="player-#{video_id}" style="display:none;background-color:#000;margin-left:2em;padding-bottom:4px;">|
104
98
  r << %Q|<a name="player-#{video_id}">|
105
- r << nicovideo_player( video_id, [544,384] )
99
+ r << nicovideo_player(video_id, [640,360])
106
100
  r << %Q|</a>|
107
101
  r << %Q|<div class="nicovideo-player-close" style="margin:4px;padding:8px;">|
108
102
  r << %Q|<a href="#" onclick="return nicovideoThumbnail( '#{video_id}' )" style="background-color:black; color:white; margin:2px; padding:8px; border-color:white; border-radius:6px; border-width:2px; border-style:solid; text-decoration:none;">▲CLOSE PLAYER</a>|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdiary-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.6
4
+ version: 5.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - tDiary contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-29 00:00:00.000000000 Z
11
+ date: 2017-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tdiary
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: ruby-pushbullet
28
+ name: pushbullet_ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -506,7 +506,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
506
506
  version: '0'
507
507
  requirements: []
508
508
  rubyforge_project:
509
- rubygems_version: 2.6.13
509
+ rubygems_version: 2.7.3
510
510
  signing_key:
511
511
  specification_version: 4
512
512
  summary: tDiary contributions package