isomorfeus-data 2.0.0.rc8 → 2.0.0.rc9
Sign up to get free protection for your applications and to get access to all the features.
- 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 +14 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 488526bc3eec0dddbb940d10212ed6cf5f52d9ed822d2bb17ca5a751329f8d6e
|
4
|
+
data.tar.gz: d33096a4ec8882c6a852707207fe048ecc1e5a029f1fe2a7a4e25e8385e1a93e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ecb4de741d8da01af6d4e2cf0ddc4fdbb1e25c54408e27566f190776aaa5041ce3aabda2fb42c2db22aada016b5a1b6327d5737b30b1c8a6166e9d6b60139dd
|
7
|
+
data.tar.gz: 8a7e441b79d1be7a38dbbdef529943530c51440af2270d9855b3a7bd1662e509ea1f192a7a13324a62351d216ba526a66507382c1c9f30562b2ad1f82a048192
|
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.rc9
|
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-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 7.0.0
|
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
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: oj
|
43
29
|
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.3
|
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.3
|
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.5
|
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.5
|
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.rc9
|
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.rc9
|
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.rc9
|
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.rc9
|
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
|
@@ -260,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
249
|
- !ruby/object:Gem::Version
|
261
250
|
version: 1.3.1
|
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.
|