isomorfeus-data 2.0.0.rc7 → 2.0.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 +4 -4
- data/LICENSE +7 -19
- data/lib/data_uri/open_uri.rb +22 -0
- data/lib/data_uri/uri.rb +61 -0
- data/lib/data_uri.rb +5 -0
- data/lib/isomorfeus/data/version.rb +1 -1
- data/lib/isomorfeus-data.rb +0 -3
- metadata +22 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8164f378080fd27c2175ab62246f588fc862c463b2ab764c392410ca5169fc0
|
4
|
+
data.tar.gz: ba522d380b2afc47c5f9b420befbaa2b16552cfb60db4be51fee86c132d03708
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e66e159004cf71f9fdf95868624f30af2a95a5ac5c925750745ffc94720bdd1df0caf21fd34309cee844d29530de431e3d1b551339af62b6b7f8ece7138a3f86
|
7
|
+
data.tar.gz: f48628bb5bdc60261c62416345406b8ce28922388a909857b939bae9147dfb2f059762f529d1eb78d6aac33b802c993ff02990cfc1c7c99fce4a83d388abbe0f
|
data/LICENSE
CHANGED
@@ -25,23 +25,11 @@ https://github.com/ajjahn/opal-uri:
|
|
25
25
|
|
26
26
|
Copyright (c) 2015 Jamie Gaskins
|
27
27
|
|
28
|
-
MIT License
|
28
|
+
MIT License as above
|
29
|
+
|
30
|
+
data_uri module in lib directoy originally taken from
|
31
|
+
https://github.com/dball/data_uri:
|
32
|
+
|
33
|
+
Copyright © 2010 Donald Ball <donald.ball@gmail.com>
|
29
34
|
|
30
|
-
|
31
|
-
a copy of this software and associated documentation files (the
|
32
|
-
"Software"), to deal in the Software without restriction, including
|
33
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
34
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
35
|
-
permit persons to whom the Software is furnished to do so, subject to
|
36
|
-
the following conditions:
|
37
|
-
|
38
|
-
The above copyright notice and this permission notice shall be
|
39
|
-
included in all copies or substantial portions of the Software.
|
40
|
-
|
41
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
42
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
43
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
44
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
45
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
46
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
47
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
35
|
+
MIT License as above
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module URI
|
2
|
+
|
3
|
+
class Data
|
4
|
+
|
5
|
+
def open
|
6
|
+
io = StringIO.new(data)
|
7
|
+
OpenURI::Meta.init(io)
|
8
|
+
io.meta_add_field('content-type', content_type)
|
9
|
+
if block_given?
|
10
|
+
begin
|
11
|
+
yield io
|
12
|
+
ensure
|
13
|
+
io.close
|
14
|
+
end
|
15
|
+
else
|
16
|
+
io
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/data_uri/uri.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
module URI
|
2
|
+
class Data < Generic
|
3
|
+
COMPONENT = [:scheme, :opaque].freeze
|
4
|
+
MIME_TYPE_RE = %r{^([-\w.+]+/[-\w.+]*)}.freeze
|
5
|
+
MIME_PARAM_RE = /^;([-\w.+]+)=([^;,]+)/.freeze
|
6
|
+
|
7
|
+
attr_reader :content_type, :data
|
8
|
+
|
9
|
+
def initialize(*args)
|
10
|
+
if args.length == 1
|
11
|
+
uri = args.first.to_s
|
12
|
+
unless uri.match(/^data:/)
|
13
|
+
raise URI::InvalidURIError.new('Invalid Data URI: ' + args.first.inspect)
|
14
|
+
end
|
15
|
+
@scheme = 'data'
|
16
|
+
@opaque = uri[5 .. -1]
|
17
|
+
else
|
18
|
+
super(*args)
|
19
|
+
end
|
20
|
+
@data = @opaque
|
21
|
+
if md = MIME_TYPE_RE.match(@data)
|
22
|
+
@content_type = md[1]
|
23
|
+
@data = @data[@content_type.length .. -1]
|
24
|
+
end
|
25
|
+
@content_type ||= 'text/plain'
|
26
|
+
@mime_params = {}
|
27
|
+
while md = MIME_PARAM_RE.match(@data)
|
28
|
+
@mime_params[md[1]] = md[2]
|
29
|
+
@data = @data[md[0].length .. -1]
|
30
|
+
end
|
31
|
+
if base64 = /^;base64/.match(@data)
|
32
|
+
@data = @data[7 .. -1]
|
33
|
+
end
|
34
|
+
unless /^,/.match(@data)
|
35
|
+
raise URI::InvalidURIError.new('Invalid data URI')
|
36
|
+
end
|
37
|
+
@data = @data[1 .. -1]
|
38
|
+
@data = base64 ? Base64.decode64(@data) : URI.decode(@data)
|
39
|
+
if @data.respond_to?(:force_encoding) && charset = @mime_params['charset']
|
40
|
+
@data.force_encoding(charset)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.build(arg)
|
45
|
+
data = nil
|
46
|
+
content_type = nil
|
47
|
+
case arg
|
48
|
+
when IO
|
49
|
+
data = arg
|
50
|
+
when Hash
|
51
|
+
data = arg[:data]
|
52
|
+
content_type = arg[:content_type]
|
53
|
+
end
|
54
|
+
raise 'Invalid build argument: ' + arg.inspect unless data
|
55
|
+
if !content_type && data.respond_to?(:content_type)
|
56
|
+
content_type = data.content_type
|
57
|
+
end
|
58
|
+
new('data', nil, nil, nil, nil, nil, "#{content_type};base64,#{Base64.encode64(data.read).chop}", nil, nil)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/lib/data_uri.rb
ADDED
data/lib/isomorfeus-data.rb
CHANGED
@@ -47,9 +47,6 @@ else
|
|
47
47
|
uri_path = File.expand_path(File.join(__dir__.untaint, '..', 'opal'))
|
48
48
|
Opal.append_path(uri_path) unless IsoOpal.paths.include?(uri_path)
|
49
49
|
|
50
|
-
data_uri_path = File.join(Gem::Specification.find_by_name('data_uri').gem_dir, 'lib')
|
51
|
-
Opal.append_path(data_uri_path) unless IsoOpal.paths.include?(data_uri_path)
|
52
|
-
|
53
50
|
path = File.expand_path(File.join('app', 'data'))
|
54
51
|
|
55
52
|
Isomorfeus.zeitwerk.push_dir(path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,56 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: data_uri
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1.0
|
26
|
+
version: 7.0.1
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: oj
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.13.
|
33
|
+
version: 3.13.11
|
48
34
|
type: :runtime
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3.13.
|
40
|
+
version: 3.13.11
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: opal
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.4.
|
47
|
+
version: 1.4.1
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.4.
|
54
|
+
version: 1.4.1
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: opal-activesupport
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +72,14 @@ dependencies:
|
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.14.
|
75
|
+
version: 0.14.4
|
90
76
|
type: :runtime
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.14.
|
82
|
+
version: 0.14.4
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: isomorfeus-ferret
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +114,14 @@ dependencies:
|
|
128
114
|
requirements:
|
129
115
|
- - "~>"
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version: 10.6.
|
117
|
+
version: 10.6.6
|
132
118
|
type: :runtime
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
122
|
- - "~>"
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version: 10.6.
|
124
|
+
version: 10.6.6
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: isomorfeus-redux
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,28 +142,28 @@ dependencies:
|
|
156
142
|
requirements:
|
157
143
|
- - '='
|
158
144
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.0.0
|
145
|
+
version: 2.0.0
|
160
146
|
type: :runtime
|
161
147
|
prerelease: false
|
162
148
|
version_requirements: !ruby/object:Gem::Requirement
|
163
149
|
requirements:
|
164
150
|
- - '='
|
165
151
|
- !ruby/object:Gem::Version
|
166
|
-
version: 2.0.0
|
152
|
+
version: 2.0.0
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: isomorfeus
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
157
|
- - '='
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.0.0
|
159
|
+
version: 2.0.0
|
174
160
|
type: :development
|
175
161
|
prerelease: false
|
176
162
|
version_requirements: !ruby/object:Gem::Requirement
|
177
163
|
requirements:
|
178
164
|
- - '='
|
179
165
|
- !ruby/object:Gem::Version
|
180
|
-
version: 2.0.0
|
166
|
+
version: 2.0.0
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
168
|
name: rake
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -215,6 +201,9 @@ extra_rdoc_files: []
|
|
215
201
|
files:
|
216
202
|
- LICENSE
|
217
203
|
- README.md
|
204
|
+
- lib/data_uri.rb
|
205
|
+
- lib/data_uri/open_uri.rb
|
206
|
+
- lib/data_uri/uri.rb
|
218
207
|
- lib/isomorfeus-data.rb
|
219
208
|
- lib/isomorfeus/data/attribute_support.rb
|
220
209
|
- lib/isomorfeus/data/config.rb
|
@@ -256,11 +245,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
256
245
|
version: '0'
|
257
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
247
|
requirements:
|
259
|
-
- - "
|
248
|
+
- - ">="
|
260
249
|
- !ruby/object:Gem::Version
|
261
|
-
version:
|
250
|
+
version: '0'
|
262
251
|
requirements: []
|
263
|
-
rubygems_version: 3.
|
252
|
+
rubygems_version: 3.3.3
|
264
253
|
signing_key:
|
265
254
|
specification_version: 4
|
266
255
|
summary: Compose Graphs and Collections of data just as needed for a isomorfeus app.
|