linked_rails 0.0.4.pre.g7123943aa → 0.0.4.pre.g96885856b
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/linked_rails/bulk_controller.rb +3 -1
- data/app/models/linked_rails/actions/item.rb +1 -1
- data/app/models/linked_rails/manifest.rb +2 -2
- data/lib/linked_rails/iri_mapper.rb +1 -1
- data/lib/linked_rails/model/iri.rb +1 -0
- data/lib/linked_rails.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91c75addc6ea759a73ff4fdce94549494d623fe819ee7ed0d2ea1557e7c2ac91
|
4
|
+
data.tar.gz: 4fcd4f439831e7aa196fa2fe610263949dfc316bb4566c9cb94562eb67e1c304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffcb80ce21ecbb28c0d42c79115b998bd859e689acbc4fcbb61ae6a494e75c09f3b906a466141412331fb5cc7076527fcf92fa227a58d00040db732d6123d350
|
7
|
+
data.tar.gz: e72f2247fa7ff7ca882e0644c69ed072e5ab93af8f02842f3495c3522e1fa300ce915703fcd297c21d36b1b658ccb7d0b3194aa4836fb7cf76afecec2e2bfeb0
|
@@ -98,6 +98,8 @@ module LinkedRails
|
|
98
98
|
params = param.permit(:include, :iri)
|
99
99
|
params[:iri] = URI(params[:iri])
|
100
100
|
params
|
101
|
+
rescue URI::InvalidURIError
|
102
|
+
params.except(:iri)
|
101
103
|
end
|
102
104
|
|
103
105
|
def resource_response_body(iri, rack_body, status)
|
@@ -249,7 +251,7 @@ module LinkedRails
|
|
249
251
|
|
250
252
|
def sanitized_relative_path(iri) # rubocop:disable Metrics/AbcSize
|
251
253
|
iri.path = "#{iri.path}/" unless iri.path&.ends_with?('/')
|
252
|
-
uri = URI(LinkedRails.iri.path.present? ? iri.to_s.split("#{LinkedRails.iri.path}/").last : iri)
|
254
|
+
uri = URI(LinkedRails.iri.path.chomp('/').present? ? iri.to_s.split("#{LinkedRails.iri.path}/").last : iri)
|
253
255
|
|
254
256
|
[uri.path, uri.query].compact.join('?')
|
255
257
|
end
|
@@ -187,7 +187,7 @@ module LinkedRails
|
|
187
187
|
|
188
188
|
def target_url_fallback # rubocop:disable Metrics/AbcSize
|
189
189
|
base = (resource.try(:singular_resource?) ? resource.singular_iri : resource.iri).dup
|
190
|
-
base.path = "#{base.path}/#{target_path}" if target_path.present?
|
190
|
+
base.path = "#{base.path.chomp('/')}/#{target_path}" if target_path.present?
|
191
191
|
base.query = Rack::Utils.parse_nested_query(base.query).merge(target_query).to_param if target_query.present?
|
192
192
|
base
|
193
193
|
end
|
@@ -41,7 +41,7 @@ module LinkedRails
|
|
41
41
|
def blob_preview_iri
|
42
42
|
return unless ActiveStorage::Blob.service.present?
|
43
43
|
|
44
|
-
LinkedRails.iri(path: 'rails/active_storage/blobs/redirect/{signed_id}/preview')
|
44
|
+
"#{LinkedRails.iri(path: 'rails/active_storage/blobs/redirect')}/{signed_id}/preview')"
|
45
45
|
end
|
46
46
|
|
47
47
|
def blob_upload_iri
|
@@ -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
|
@@ -38,7 +38,7 @@ module LinkedRails
|
|
38
38
|
params = Rails.application.routes.recognize_path(iri.to_s, method: method)
|
39
39
|
|
40
40
|
route_params_to_opts(params.merge(query), iri.to_s)
|
41
|
-
rescue ActionController::RoutingError
|
41
|
+
rescue ActionController::RoutingError, SystemStackError
|
42
42
|
EMPTY_IRI_OPTS.dup
|
43
43
|
end
|
44
44
|
|
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
|
|
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.g96885856b
|
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-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_response
|