tdiary-contrib 5.1.7 → 5.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tdiary/contrib/version.rb +1 -1
- data/plugin/google_analytics.rb +9 -9
- data/plugin/profile.rb +3 -3
- data/spec/google_analytics_spec.rb +9 -9
- data/util/image-gallery/views/gallery.rhtml +2 -2
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d9db6b81d675a4f945eebadf82221c92e6d769e1ec5a0cdf5342944e3aac785
|
4
|
+
data.tar.gz: 976a48cf8e152883ded722029443fa31078b063c1aa71b7030a81859b37353d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46b93428123e0869d06bb000a497930707606452aadb4489067e854743db547804439315fe4b92485e51ddc2a7212b8f43a3f4b8def633289cde66e56c30ef30
|
7
|
+
data.tar.gz: 17923155395edbe4fc1781886ea3e88d6b8d519d18409823ffd749ad09eca12d0bb998653960a9c847e883a4f826ac022834c17338d8de5f17e9c91b29dae6c4
|
data/plugin/google_analytics.rb
CHANGED
@@ -13,15 +13,15 @@ end
|
|
13
13
|
def google_analytics_insert_code
|
14
14
|
return '' unless @conf['google_analytics.profile']
|
15
15
|
<<-HTML
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
23
|
-
|
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
|
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/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])
|
@@ -44,15 +44,15 @@ describe "google_analytics plugin" do
|
|
44
44
|
|
45
45
|
def expected_html_footer_snippet
|
46
46
|
expected = <<-SCRIPT
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
-
|
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
|
-
|
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.
|
4
|
+
version: 5.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tDiary contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tdiary
|
@@ -143,21 +143,7 @@ dependencies:
|
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - ">="
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: '0'
|
152
|
-
type: :development
|
153
|
-
prerelease: false
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - ">="
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '0'
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: debase
|
146
|
+
name: debug
|
161
147
|
requirement: !ruby/object:Gem::Requirement
|
162
148
|
requirements:
|
163
149
|
- - ">="
|
@@ -558,7 +544,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
558
544
|
- !ruby/object:Gem::Version
|
559
545
|
version: '0'
|
560
546
|
requirements: []
|
561
|
-
rubygems_version: 3.
|
547
|
+
rubygems_version: 3.3.7
|
562
548
|
signing_key:
|
563
549
|
specification_version: 4
|
564
550
|
summary: tDiary contributions package
|