pageflow-chart 2.4.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +6 -0
- data/CHANGELOG.md +7 -12
- data/Gemfile +7 -0
- data/README.md +1 -1
- data/chart.gemspec +5 -5
- data/lib/pageflow/chart/downloader.rb +1 -1
- data/lib/pageflow/chart/engine.rb +18 -1
- data/lib/pageflow/chart/page_type.rb +1 -1
- data/lib/pageflow/chart/refresh_tag_following_downloader.rb +1 -1
- data/lib/pageflow/chart/version.rb +1 -1
- data/lib/pageflow/chart.rb +2 -0
- data/spec/pageflow/chart/refresh_tag_following_downloader_spec.rb +10 -10
- metadata +44 -32
- data/.travis.yml +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37c0ed62a0b2f6cdc20c35554be884a13c8d784dee430b4f35d7844b3a350ef3
|
4
|
+
data.tar.gz: 4e003683b187ea0dd1b7df9a7a7e8408fe2ccb7997a23e052de3a8d8022d5ba1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bf0e9acaa44d3333ad97cd8c44a66d34f9d62c8e52b89e173f6ecbbb39697d460a9798a77aee5a684fb2eb1d7e96c6d699058f9b83dcee932e0dbc0519c3918
|
7
|
+
data.tar.gz: 9fa7d5e26a90167110a89601425e92ca21abf042c1bbe591f1d5a6f8b3718bca3ec7714eb089a1a5c8cb57887471018b1e3785e230385626f1608419f7a28dcd
|
data/CHANGELOG.md
CHANGED
@@ -1,20 +1,15 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
### Version 2.
|
3
|
+
### Version 2.6.0
|
4
4
|
|
5
|
-
|
5
|
+
2024-01-15
|
6
6
|
|
7
|
-
[Compare changes](https://github.com/codevise/pageflow-chart/compare/2-
|
7
|
+
[Compare changes](https://github.com/codevise/pageflow-chart/compare/2-5-stable...v2.6.0)
|
8
8
|
|
9
|
-
-
|
10
|
-
([#
|
11
|
-
-
|
12
|
-
([#60](https://github.com/codevise/pageflow-chart/pull/60))
|
13
|
-
- Display original chart instead of scraped site
|
14
|
-
([#59](https://github.com/codevise/pageflow-chart/pull/59))
|
15
|
-
- Embed opt-in
|
16
|
-
([#58](https://github.com/codevise/pageflow-chart/pull/58))
|
9
|
+
- Support Pageflow 17
|
10
|
+
([#64](https://github.com/codevise/pageflow-chart/pull/64),
|
11
|
+
[#63](https://github.com/codevise/pageflow-chart/pull/63))
|
17
12
|
|
18
13
|
See
|
19
|
-
[2-
|
14
|
+
[2-5-stable branch](https://github.com/codevise/pageflow-chart/blob/2-5-stable/CHANGELOG.md)
|
20
15
|
for previous changes.
|
data/Gemfile
CHANGED
@@ -2,3 +2,10 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in chart.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
if ENV['PAGEFLOW_DEPENDENCIES'] == 'experimental'
|
7
|
+
git 'https://github.com/codevise/pageflow', branch: 'edge', glob: '**/*.gemspec' do
|
8
|
+
gem 'pageflow'
|
9
|
+
gem 'pageflow-support'
|
10
|
+
end
|
11
|
+
end
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Pageflow Chart
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/pageflow-chart.svg)](http://badge.fury.io/rb/pageflow-chart)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/codevise/pageflow-chart/workflows/tests/badge.svg)](https://github.com/codevise/pageflow-chart/actions)
|
5
5
|
|
6
6
|
Page type showing scraped svg diagramms from Datawrapper.
|
7
7
|
|
data/chart.gemspec
CHANGED
@@ -16,17 +16,17 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
|
19
|
-
spec.required_ruby_version = '
|
19
|
+
spec.required_ruby_version = '>= 2.1'
|
20
20
|
|
21
|
-
spec.add_runtime_dependency 'pageflow', '
|
21
|
+
spec.add_runtime_dependency 'pageflow', ['>= 15.7', '< 18']
|
22
22
|
spec.add_runtime_dependency 'nokogiri', '~> 1.0'
|
23
23
|
spec.add_runtime_dependency 'pageflow-public-i18n', '~> 1.0'
|
24
24
|
|
25
|
-
spec.add_development_dependency 'pageflow-support', '~> 15.x'
|
26
25
|
spec.add_development_dependency 'bundler', ['>= 1.0', '< 3']
|
27
|
-
spec.add_development_dependency 'rake', '~> 12.0'
|
28
|
-
spec.add_development_dependency 'rspec-rails', '~> 3.0'
|
29
26
|
spec.add_development_dependency 'factory_bot_rails', '~> 4.8'
|
27
|
+
spec.add_development_dependency 'pageflow-support', ['>= 15.0', '< 18']
|
28
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
29
|
+
spec.add_development_dependency 'rspec-rails', '~> 6.0'
|
30
30
|
spec.add_development_dependency 'webmock', '~> 3.0'
|
31
31
|
|
32
32
|
# Semantic versioning rake tasks
|
@@ -13,7 +13,7 @@ module Pageflow
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def load(url, raise_on_http_error: false)
|
16
|
-
file =
|
16
|
+
file = make_absolute(url).open
|
17
17
|
yield(file)
|
18
18
|
rescue OpenURI::HTTPError => exception
|
19
19
|
Rails.logger.error "Exception loading url #{url}: #{exception.message}"
|
@@ -1,11 +1,28 @@
|
|
1
1
|
require 'pageflow-public-i18n'
|
2
|
+
require 'sprockets/rails'
|
2
3
|
|
3
4
|
module Pageflow
|
4
5
|
module Chart
|
5
6
|
class Engine < Rails::Engine
|
6
7
|
isolate_namespace Pageflow::Chart
|
7
8
|
|
8
|
-
|
9
|
+
if Rails.respond_to?(:autoloaders)
|
10
|
+
lib = root.join('lib')
|
11
|
+
|
12
|
+
config.autoload_paths << lib
|
13
|
+
config.eager_load_paths << lib
|
14
|
+
|
15
|
+
initializer 'pageflow_chart.autoloading' do
|
16
|
+
Rails.autoloaders.main.ignore(
|
17
|
+
lib.join('generators'),
|
18
|
+
lib.join('pageflow/chart/configuration.rb'),
|
19
|
+
lib.join('pageflow/chart/version.rb')
|
20
|
+
)
|
21
|
+
end
|
22
|
+
else
|
23
|
+
config.autoload_paths << File.join(config.root, 'lib')
|
24
|
+
end
|
25
|
+
|
9
26
|
config.assets.precompile += ['pageflow/chart/custom.css', 'pageflow/chart/transparent_background.css']
|
10
27
|
config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s]
|
11
28
|
|
@@ -10,7 +10,7 @@ module Pageflow
|
|
10
10
|
class NoUrlInRefreshMetaTag < StandardError; end
|
11
11
|
|
12
12
|
def load_following_refresh_tags(url, options = {}, redirect_count = 0, &block)
|
13
|
-
load(url, options) do |file|
|
13
|
+
load(url, **options) do |file|
|
14
14
|
if (redirect_url = find_refresh_meta_tag_url(file.read))
|
15
15
|
if redirect_count >= MAX_REDIRECT_COUNT
|
16
16
|
raise TooManyRedirects, 'Too many redirects via refresh meta tags.'
|
data/lib/pageflow/chart.rb
CHANGED
@@ -17,7 +17,7 @@ module Pageflow
|
|
17
17
|
result = ''
|
18
18
|
|
19
19
|
allow(downloader).to receive(:load)
|
20
|
-
.with(original_url,
|
20
|
+
.with(original_url, any_args)
|
21
21
|
.and_yield(StringIO.new(chart_html))
|
22
22
|
|
23
23
|
refresh_tag_following_downloader.load_following_refresh_tags(original_url) do |file|
|
@@ -57,11 +57,11 @@ module Pageflow
|
|
57
57
|
result = ''
|
58
58
|
|
59
59
|
allow(downloader).to receive(:load)
|
60
|
-
.with(original_url,
|
60
|
+
.with(original_url, any_args)
|
61
61
|
.and_yield(StringIO.new(redirect_html))
|
62
62
|
|
63
63
|
allow(downloader).to receive(:load)
|
64
|
-
.with(target_url,
|
64
|
+
.with(target_url, any_args)
|
65
65
|
.and_yield(StringIO.new(chart_html))
|
66
66
|
|
67
67
|
refresh_tag_following_downloader.load_following_refresh_tags(original_url) do |file|
|
@@ -88,11 +88,11 @@ module Pageflow
|
|
88
88
|
result = ''
|
89
89
|
|
90
90
|
allow(downloader).to receive(:load)
|
91
|
-
.with(original_url,
|
91
|
+
.with(original_url, any_args)
|
92
92
|
.and_yield(StringIO.new(redirect_html))
|
93
93
|
|
94
94
|
allow(downloader).to receive(:load)
|
95
|
-
.with(target_url,
|
95
|
+
.with(target_url, any_args)
|
96
96
|
.and_yield(StringIO.new(chart_html))
|
97
97
|
|
98
98
|
refresh_tag_following_downloader.load_following_refresh_tags(original_url) do |file|
|
@@ -119,11 +119,11 @@ module Pageflow
|
|
119
119
|
result = ''
|
120
120
|
|
121
121
|
allow(downloader).to receive(:load)
|
122
|
-
.with(original_url,
|
122
|
+
.with(original_url, any_args)
|
123
123
|
.and_yield(StringIO.new(redirect_html))
|
124
124
|
|
125
125
|
allow(downloader).to receive(:load)
|
126
|
-
.with(target_url,
|
126
|
+
.with(target_url, any_args)
|
127
127
|
.and_yield(StringIO.new(chart_html))
|
128
128
|
|
129
129
|
refresh_tag_following_downloader.load_following_refresh_tags(original_url) do |file|
|
@@ -143,7 +143,7 @@ module Pageflow
|
|
143
143
|
<html><head><meta http-equiv="REFRESH" content="0; url=#{original_url}"></head></html>
|
144
144
|
HTML
|
145
145
|
|
146
|
-
allow(downloader).to receive(:load).with(original_url,
|
146
|
+
allow(downloader).to receive(:load).with(original_url, any_args) do |&block|
|
147
147
|
block.call(StringIO.new(redirect_html))
|
148
148
|
end
|
149
149
|
|
@@ -162,7 +162,7 @@ module Pageflow
|
|
162
162
|
<html><head><meta http-equiv="REFRESH" content="something strange"></head></html>
|
163
163
|
HTML
|
164
164
|
|
165
|
-
allow(downloader).to receive(:load).with(original_url,
|
165
|
+
allow(downloader).to receive(:load).with(original_url, any_args).and_yield(StringIO.new(redirect_html))
|
166
166
|
|
167
167
|
expect {
|
168
168
|
refresh_tag_following_downloader.load_following_refresh_tags(original_url)
|
@@ -179,7 +179,7 @@ module Pageflow
|
|
179
179
|
<html><head><meta http-equiv="REFRESH"></head></html>
|
180
180
|
HTML
|
181
181
|
|
182
|
-
allow(downloader).to receive(:load).with(original_url,
|
182
|
+
allow(downloader).to receive(:load).with(original_url, any_args).and_yield(StringIO.new(redirect_html))
|
183
183
|
|
184
184
|
expect {
|
185
185
|
refresh_tag_following_downloader.load_following_refresh_tags(original_url)
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pageflow-chart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Codevise Solutions Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pageflow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '15.7'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: '18'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '15.7'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: '18'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: nokogiri
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +58,6 @@ dependencies:
|
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '1.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pageflow-support
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 15.x
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 15.x
|
69
61
|
- !ruby/object:Gem::Dependency
|
70
62
|
name: bundler
|
71
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,47 +79,67 @@ dependencies:
|
|
87
79
|
- !ruby/object:Gem::Version
|
88
80
|
version: '3'
|
89
81
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
82
|
+
name: factory_bot_rails
|
91
83
|
requirement: !ruby/object:Gem::Requirement
|
92
84
|
requirements:
|
93
85
|
- - "~>"
|
94
86
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
87
|
+
version: '4.8'
|
96
88
|
type: :development
|
97
89
|
prerelease: false
|
98
90
|
version_requirements: !ruby/object:Gem::Requirement
|
99
91
|
requirements:
|
100
92
|
- - "~>"
|
101
93
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
94
|
+
version: '4.8'
|
103
95
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
96
|
+
name: pageflow-support
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '15.0'
|
102
|
+
- - "<"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '18'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '15.0'
|
112
|
+
- - "<"
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '18'
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: rake
|
105
117
|
requirement: !ruby/object:Gem::Requirement
|
106
118
|
requirements:
|
107
119
|
- - "~>"
|
108
120
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
121
|
+
version: '12.0'
|
110
122
|
type: :development
|
111
123
|
prerelease: false
|
112
124
|
version_requirements: !ruby/object:Gem::Requirement
|
113
125
|
requirements:
|
114
126
|
- - "~>"
|
115
127
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
128
|
+
version: '12.0'
|
117
129
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
130
|
+
name: rspec-rails
|
119
131
|
requirement: !ruby/object:Gem::Requirement
|
120
132
|
requirements:
|
121
133
|
- - "~>"
|
122
134
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
135
|
+
version: '6.0'
|
124
136
|
type: :development
|
125
137
|
prerelease: false
|
126
138
|
version_requirements: !ruby/object:Gem::Requirement
|
127
139
|
requirements:
|
128
140
|
- - "~>"
|
129
141
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
142
|
+
version: '6.0'
|
131
143
|
- !ruby/object:Gem::Dependency
|
132
144
|
name: webmock
|
133
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,9 +175,9 @@ executables: []
|
|
163
175
|
extensions: []
|
164
176
|
extra_rdoc_files: []
|
165
177
|
files:
|
178
|
+
- ".github/workflows/tests.yml"
|
166
179
|
- ".gitignore"
|
167
180
|
- ".jshintrc"
|
168
|
-
- ".travis.yml"
|
169
181
|
- CHANGELOG.md
|
170
182
|
- Gemfile
|
171
183
|
- README.md
|
@@ -253,7 +265,7 @@ require_paths:
|
|
253
265
|
- lib
|
254
266
|
required_ruby_version: !ruby/object:Gem::Requirement
|
255
267
|
requirements:
|
256
|
-
- - "
|
268
|
+
- - ">="
|
257
269
|
- !ruby/object:Gem::Version
|
258
270
|
version: '2.1'
|
259
271
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -262,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
274
|
- !ruby/object:Gem::Version
|
263
275
|
version: '0'
|
264
276
|
requirements: []
|
265
|
-
rubygems_version: 3.
|
277
|
+
rubygems_version: 3.4.10
|
266
278
|
signing_key:
|
267
279
|
specification_version: 4
|
268
280
|
summary: Pagetype for Embedded Datawrapper Charts
|
data/.travis.yml
DELETED