tdiary-contrib 5.1.4 → 5.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7589d91925dead78181297d0bfb4e994d79d2d362cbc822084367b85a593b56
4
- data.tar.gz: 424a594824fad56caf9c40825d96c1c7eac62857dd0b04bad7028f4a7a7a5685
3
+ metadata.gz: 26ed0292336afd37dbf602aacebe5816077ad450883500b6d0b37a81fe56aa99
4
+ data.tar.gz: 9064adbae3f2a4a7c40ef91b1d737c24e3c219f5dd5cded6429f626ab9c0544b
5
5
  SHA512:
6
- metadata.gz: 656e6bdfc9982c2744c0a323e7b46037dbcf0eab0750add8b4b84807cf1ba99e6ce82f6f130c1e26139ee74dff629bdc7a14390f23537741680a0185ecef7925
7
- data.tar.gz: '0463607988a55b8575c9fa62e16786e7f51e139f3f3cf9c461a7b3930d2efa9b782afaf52a08279e499bcc027399e4040f9a4f221cb306bcfcc7dba1d56e84a8'
6
+ metadata.gz: 8e9476fa421de7453b2fc1649e45be709d1328617c7d898cf47f28d608b1e36afdbfac3746f1af34849cd229e8c7d7def852b2d10cc9c2093e6048b319e57e00
7
+ data.tar.gz: 280e114e9d5f0671153a2e2eb3e1172ffa5cd350b19183eb06cb8098719a80ce38d67b9bd144ed44038bbfe7a3440bda6a01c8ff54dc8300f4f6e78445af3466
@@ -1,5 +1,5 @@
1
1
  module TDiary
2
2
  class Contrib
3
- VERSION = "5.1.4"
3
+ VERSION = "5.2.0"
4
4
  end
5
5
  end
File without changes
@@ -13,15 +13,15 @@ end
13
13
  def google_analytics_insert_code
14
14
  return '' unless @conf['google_analytics.profile']
15
15
  <<-HTML
16
- <script>
17
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
18
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
19
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
20
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
16
+ <!-- Global site tag (gtag.js) - Google Analytics -->
17
+ <script async src="https://www.googletagmanager.com/gtag/js?id=UA-#{@conf['google_analytics.profile']}"></script>
18
+ <script>
19
+ window.dataLayer = window.dataLayer || [];
20
+ function gtag(){dataLayer.push(arguments);}
21
+ gtag('js', new Date());
21
22
 
22
- ga('create', 'UA-#{@conf['google_analytics.profile']}', 'auto');
23
- ga('send', 'pageview');
24
- // --></script>
23
+ gtag('config', 'UA-#{@conf['google_analytics.profile']}');
24
+ </script>
25
25
  HTML
26
26
  end
27
27
 
@@ -34,7 +34,7 @@ add_conf_proc( 'google_analytics', 'Google Analytics' ) do
34
34
  r = <<-HTML
35
35
  <h3>Google Analytics Profile</h3>
36
36
  <p>set your Profile ID (NNNNN-N)</p>
37
- <p><input name="google_analytics.profile" value="#{h @conf['google_analytics.profile']}"></p>
37
+ <p>UA-<input name="google_analytics.profile" value="#{h @conf['google_analytics.profile']}"></p>
38
38
  HTML
39
39
  if defined? AMP
40
40
  r << <<-HTML
data/plugin/jholiday.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'Calendar.rb'
1
+ require 'holiday_japan'
2
2
  require 'date'
3
3
  unless Time::new.respond_to?( :strftime_holiday_backup )
4
4
  then
@@ -7,8 +7,8 @@ then
7
7
  alias strftime_holiday_backup strftime
8
8
  def strftime( format )
9
9
  holiday = ""
10
- day = Day.new(self.day,self.month,self.year,self.wday)
11
- holiday = day.holiday_name_jp if day.holiday?
10
+ day = Date.new(self.year, self.month, self.day)
11
+ holiday = HolidayJapan.name(day) if HolidayJapan.check(day)
12
12
  strftime_holiday_backup( format.gsub( /%K/, holiday ) )
13
13
  end
14
14
  end
@@ -44,7 +44,7 @@ class MyHotEntry
44
44
  begin
45
45
  Timeout.timeout(5) do
46
46
  # convert Tempfile to String because REXML can't accept Tempfile
47
- open(rss_url) do |f|
47
+ URI.open(rss_url) do |f|
48
48
  rss = REXML::Document.new(f.readlines.join("\n"))
49
49
  end
50
50
  end
data/plugin/ogp.rb CHANGED
@@ -41,6 +41,7 @@ def ogp_tag
41
41
  section_index = @cgi.params['p'][0] || sections.size
42
42
  begin
43
43
  section = sections[section_index.to_i - 1].body_to_html
44
+ @image_date = @date.strftime("%Y%m%d") # hack for image plugin
44
45
  section_html = apply_plugin(section)
45
46
 
46
47
  headers['og:description'] = ogp_description(section_html)
data/plugin/openid.rb CHANGED
@@ -43,6 +43,7 @@ if /^(?:latest|conf|saveconf)$/ =~ @mode then
43
43
  nil,
44
44
  ['https://open.login.yahooapis.com/openid/op/auth', 'https://me.yahoo.com/a/<ID>'],
45
45
  'http://open.login.yahooapis.com/openid20/www.yahoo.com/xrds'),
46
+ 'Launchpad' => @openid_config.new(['https://login.launchpad.net/+openid', 'https://login.launchpad.net/+id/<ID>']),
46
47
  }
47
48
 
48
49
  if @conf['openid.service'] and @conf['openid.id'] then
data/plugin/profile.rb CHANGED
@@ -59,7 +59,7 @@ module ::Profile
59
59
  # get a XML document from endpoint and create REXML::Document instance
60
60
  def fetch(endpoint)
61
61
  Timeout.timeout(5) do
62
- open(endpoint) do |f|
62
+ URI.open(endpoint) do |f|
63
63
  doc = REXML::Document.new(f)
64
64
  end
65
65
  end
@@ -90,7 +90,7 @@ module ::Profile
90
90
  def fetch(endpoint)
91
91
  require 'json'
92
92
  Timeout.timeout(5) do
93
- doc = open(endpoint) {|f| JSON.parse(f.read) }
93
+ doc = URI.open(endpoint) {|f| JSON.parse(f.read) }
94
94
  end
95
95
  end
96
96
 
@@ -128,7 +128,7 @@ module ::Profile
128
128
  require 'json'
129
129
  Timeout.timeout(5) do
130
130
  begin
131
- doc = open(endpoint) {|f| JSON.parse(f.read) }
131
+ doc = URI.open(endpoint) {|f| JSON.parse(f.read) }
132
132
  rescue RuntimeError => err
133
133
  if err.message =~ /^redirection forbidden: /
134
134
  endpoint.sub!(/www/, @options[:lang])
data/plugin/tatsu_zine.rb CHANGED
@@ -6,6 +6,7 @@
6
6
  # USAGE: {{tatsu_zine 1}}
7
7
 
8
8
  require 'open-uri'
9
+ require 'openssl'
9
10
 
10
11
  def tatsu_zine_cache_dir
11
12
  cache = "#{@cache_path}/tatsu-zine"
@@ -33,10 +34,10 @@ def tatsu_zine( id, doc = nil )
33
34
  end
34
35
 
35
36
  link = "https://tatsu-zine.com/books/#{id}"
36
- doc ||= open(link, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE).read
37
+ doc ||= URI.open(link, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE).read
37
38
  title = doc.match(%r|<meta property="og:title" content="(.*)">|).to_a[1]
38
39
  image = doc.match(%r|<meta property="og:image" content="(.*)">|).to_a[1]
39
- price = doc.match(%r|span itemprop="price">(.*)</span>|).to_a[1]
40
+ price = doc.match(%r|span itemprop="price">(.*?)</span>|m).to_a[1].gsub(/,/,'').to_i
40
41
  author = doc.match(%r|<p itemprop="author" class="author">(.*)</p>|).to_a[1]
41
42
 
42
43
  result = <<-EOS
@@ -47,7 +48,7 @@ def tatsu_zine( id, doc = nil )
47
48
  <span class="amazon-detail-desc">
48
49
  <span class="amazon-title">#{h title}</span><br>
49
50
  <span class="amazon-author">#{h author}</span><br>
50
- <span class="amazon-price">#{h price}</span>
51
+ <span class="amazon-price">#{h price}円</span>
51
52
  </span><br style="clear: left">
52
53
  </span></a>
53
54
  EOS
@@ -44,15 +44,15 @@ describe "google_analytics plugin" do
44
44
 
45
45
  def expected_html_footer_snippet
46
46
  expected = <<-SCRIPT
47
- <script>
48
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
49
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
50
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
51
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
52
-
53
- ga('create', 'UA-53836-1', 'auto');
54
- ga('send', 'pageview');
55
- // --></script>
47
+ <!-- Global site tag (gtag.js) - Google Analytics -->
48
+ <script async src="https://www.googletagmanager.com/gtag/js?id=UA-53836-1"></script>
49
+ <script>
50
+ window.dataLayer = window.dataLayer || [];
51
+ function gtag(){dataLayer.push(arguments);}
52
+ gtag('js', new Date());
53
+
54
+ gtag('config', 'UA-53836-1');
55
+ </script>
56
56
  SCRIPT
57
57
  expected.gsub( /^\t/, '' ).chomp
58
58
  end
@@ -26,9 +26,9 @@
26
26
  <td>
27
27
  <% if @images[i] != nil %>
28
28
  <% if @images[i].width.to_i > @images[i].height.to_i %>
29
- <p><a href="<%= format_link_viewer_image(@image_hash.index(@images[i])) %>"><img src="<%= @image_url %>/<%= @images[i].url %>" width="<%= @width %>" height="<%= (@width.to_i*@images[i].height.to_i/@images[i].width.to_i).to_s %>" alt="<%= @images[i].file %>" title="<%= @images[i].file %>" class="imagebody"></a></p>
29
+ <p><a href="<%= format_link_viewer_image(@image_hash.key(@images[i])) %>"><img src="<%= @image_url %>/<%= @images[i].url %>" width="<%= @width %>" height="<%= (@width.to_i*@images[i].height.to_i/@images[i].width.to_i).to_s %>" alt="<%= @images[i].file %>" title="<%= @images[i].file %>" class="imagebody"></a></p>
30
30
  <% else %>
31
- <p><a href="<%= format_link_viewer_image(@image_hash.index(@images[i])) %>"><img src="<%= @image_url %>/<%= @images[i].url %>" width="<%= (@width.to_i*@images[i].width.to_i/@images[i].height.to_i).to_s %>" height="<%= @width %>" alt="<%= @images[i].file %>" title="<%= @images[i].file %>" class="imagebody"></a></p>
31
+ <p><a href="<%= format_link_viewer_image(@image_hash.key(@images[i])) %>"><img src="<%= @image_url %>/<%= @images[i].url %>" width="<%= (@width.to_i*@images[i].width.to_i/@images[i].height.to_i).to_s %>" height="<%= @width %>" alt="<%= @images[i].file %>" title="<%= @images[i].file %>" class="imagebody"></a></p>
32
32
  <% end %>
33
33
  <p class="imagetitle"><%= CGI::escapeHTML(@images[i].title) %></p>
34
34
  <p class="imagedate"><a href="./?date=<%= @images[i].date %>" title="<%= CGI::escapeHTML(@images[i].subtitle) %>"><%= @images[i].date.sub(/(\d{4})(\d{2})(\d{2})/, '\1-\2-\3') %></a></p>
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.1.4
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tDiary contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-29 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tdiary
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: holiday_japan
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: coderay
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -544,7 +558,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
544
558
  - !ruby/object:Gem::Version
545
559
  version: '0'
546
560
  requirements: []
547
- rubygems_version: 3.1.4
561
+ rubygems_version: 3.2.32
548
562
  signing_key:
549
563
  specification_version: 4
550
564
  summary: tDiary contributions package