linked_rails 0.0.4.pre.g72bb595fe → 0.0.4.pre.g76dedd8ba
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/linked_rails/manifest.rb +6 -6
- data/lib/linked_rails/model/iri.rb +1 -0
- data/lib/linked_rails/url.rb +11 -0
- data/lib/linked_rails.rb +5 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c64c5a485e952fa401c1bcea4761f493b4f94650bbec75d7f19e9787dad1f84
|
4
|
+
data.tar.gz: 4616e0044f6e3fefb204a464347c2dfc5d98adc0d12d11e8ef65e074968af3e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08c5759176b7e96922b54ba4fdc60c42aa8513ea7265ac9e7e86e9b1f77726e4f113485896f891dc88f8ce056feebef844db3263dfc2d4327e43eb390e31f7f3'
|
7
|
+
data.tar.gz: b915500d88b3a0cdb03d9e2d8e1d5f724967a353c138e0977afaef890162c423e0f57f2303db73b03004426042066cdeb24dfe6edc169efb104575bf3324c749
|
@@ -9,7 +9,7 @@ module LinkedRails
|
|
9
9
|
Storage.hset(
|
10
10
|
:persistent,
|
11
11
|
:manifest,
|
12
|
-
LinkedRails.iri
|
12
|
+
URL.as_href(LinkedRails.iri) => web_manifest.to_json
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
@@ -138,7 +138,7 @@ module LinkedRails
|
|
138
138
|
|
139
139
|
def web_manifest_sw_section
|
140
140
|
{
|
141
|
-
src: "#{scope}/sw.js",
|
141
|
+
src: "#{scope.chomp('/')}/sw.js",
|
142
142
|
scope: scope
|
143
143
|
}
|
144
144
|
end
|
@@ -161,19 +161,19 @@ module LinkedRails
|
|
161
161
|
|
162
162
|
class << self
|
163
163
|
def destroy(iri)
|
164
|
-
Storage.hdel(:persistent, :manifest, iri)
|
164
|
+
Storage.hdel(:persistent, :manifest, URL.as_href(iri))
|
165
165
|
end
|
166
166
|
|
167
167
|
def move(from, to)
|
168
168
|
Storage.hset(
|
169
169
|
:persistent,
|
170
170
|
:redirect_prefix,
|
171
|
-
from => to
|
171
|
+
URL.as_href(from) => URL.as_href(to)
|
172
172
|
)
|
173
173
|
|
174
|
-
data = Storage.hget(:persistent, :manifest, from)
|
174
|
+
data = Storage.hget(:persistent, :manifest, URL.as_href(from))
|
175
175
|
|
176
|
-
Storage.hset(:persistent, :manifest, to, data) if data
|
176
|
+
Storage.hset(:persistent, :manifest, URL.as_href(to), data) if data
|
177
177
|
|
178
178
|
destroy(from)
|
179
179
|
end
|
data/lib/linked_rails.rb
CHANGED
@@ -54,8 +54,10 @@ module LinkedRails
|
|
54
54
|
@@scheme ||= Rails.application.routes.default_url_options[:protocol] || :http # rubocop:disable Style/ClassVars
|
55
55
|
end
|
56
56
|
|
57
|
-
def iri(**
|
58
|
-
|
57
|
+
def iri(**args)
|
58
|
+
opts = {scheme: LinkedRails.scheme, host: LinkedRails.host}.merge(args)
|
59
|
+
opts[:path] = opts[:path].presence || '/'
|
60
|
+
RDF::URI.new(**opts)
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
@@ -106,4 +108,5 @@ require 'linked_rails/routes'
|
|
106
108
|
require 'linked_rails/serializer'
|
107
109
|
require 'linked_rails/translate'
|
108
110
|
require 'linked_rails/railtie'
|
111
|
+
require 'linked_rails/url'
|
109
112
|
require 'linked_rails/storage'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linked_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.4.pre.
|
4
|
+
version: 0.0.4.pre.g76dedd8ba
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Dingemans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_response
|
@@ -429,6 +429,7 @@ files:
|
|
429
429
|
- lib/linked_rails/translate.rb
|
430
430
|
- lib/linked_rails/types/iri_type.rb
|
431
431
|
- lib/linked_rails/uri_template.rb
|
432
|
+
- lib/linked_rails/url.rb
|
432
433
|
- lib/linked_rails/version.rb
|
433
434
|
- lib/linked_rails/vocab.rb
|
434
435
|
- lib/nill_class_renderer.rb
|