linked_rails 0.0.4.pre.g58e27be7f → 0.0.4.pre.g72bb595fe
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 +1 -3
- data/app/models/linked_rails/actions/item.rb +1 -1
- data/app/models/linked_rails/collection/view.rb +2 -3
- data/app/models/linked_rails/manifest.rb +7 -7
- data/lib/linked_rails/helpers/resource_helper.rb +1 -4
- data/lib/linked_rails/iri_mapper.rb +1 -1
- data/lib/linked_rails/model/iri.rb +0 -1
- data/lib/linked_rails.rb +2 -5
- metadata +2 -3
- data/lib/linked_rails/url.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7810fdc42df9533cc1828c33aec04953486145ee0c744607b01b5f514d67dcb0
|
4
|
+
data.tar.gz: 9056187a625becc1c3e4c234ae7b06b77e77f0d4d3bdcb5d6c24b1249e1e21a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d294b57b181d6995d88ee5967c61d9bd5c69a2a1e3dc6843848032c4f9ee36c7c762d2f163022e97cdd35219bc6d395392b0af9863ab7f0a4dcb924f5c4358ef
|
7
|
+
data.tar.gz: 880a18f47ab624f736ab12421c3ea8c6a4810f9602149d35efca16e5edb21e9563280bfbe9721acf0860a5c7a2602632a0f7056ca5cd7b207e9e4c7582da9f5c
|
@@ -98,8 +98,6 @@ 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)
|
103
101
|
end
|
104
102
|
|
105
103
|
def resource_response_body(iri, rack_body, status)
|
@@ -251,7 +249,7 @@ module LinkedRails
|
|
251
249
|
|
252
250
|
def sanitized_relative_path(iri) # rubocop:disable Metrics/AbcSize
|
253
251
|
iri.path = "#{iri.path}/" unless iri.path&.ends_with?('/')
|
254
|
-
uri = URI(LinkedRails.iri.path.
|
252
|
+
uri = URI(LinkedRails.iri.path.present? ? iri.to_s.split("#{LinkedRails.iri.path}/").last : iri)
|
255
253
|
|
256
254
|
[uri.path, uri.query].compact.join('?')
|
257
255
|
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
|
190
|
+
base.path = "#{base.path}/#{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
|
@@ -8,9 +8,8 @@ module LinkedRails
|
|
8
8
|
include LinkedRails::Model
|
9
9
|
|
10
10
|
attr_accessor :collection, :filter
|
11
|
-
delegate :apply_scope, :association_base, :association_class, :
|
12
|
-
:
|
13
|
-
to: :collection
|
11
|
+
delegate :apply_scope, :association_base, :association_class, :default_page_size, :display, :include_members,
|
12
|
+
:parent, :policy, :total_page_count, :unfiltered_collection, :user_context, to: :collection
|
14
13
|
delegate :count, to: :members
|
15
14
|
|
16
15
|
alias id iri
|
@@ -9,7 +9,7 @@ module LinkedRails
|
|
9
9
|
Storage.hset(
|
10
10
|
:persistent,
|
11
11
|
:manifest,
|
12
|
-
|
12
|
+
LinkedRails.iri.to_s => web_manifest.to_json
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
@@ -41,7 +41,7 @@ module LinkedRails
|
|
41
41
|
def blob_preview_iri
|
42
42
|
return unless ActiveStorage::Blob.service.present?
|
43
43
|
|
44
|
-
|
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
|
141
|
+
src: "#{scope}/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,
|
164
|
+
Storage.hdel(:persistent, :manifest, iri)
|
165
165
|
end
|
166
166
|
|
167
167
|
def move(from, to)
|
168
168
|
Storage.hset(
|
169
169
|
:persistent,
|
170
170
|
:redirect_prefix,
|
171
|
-
|
171
|
+
from => to
|
172
172
|
)
|
173
173
|
|
174
|
-
data = Storage.hget(:persistent, :manifest,
|
174
|
+
data = Storage.hget(:persistent, :manifest, from)
|
175
175
|
|
176
|
-
Storage.hset(:persistent, :manifest,
|
176
|
+
Storage.hset(:persistent, :manifest, to, data) if data
|
177
177
|
|
178
178
|
destroy(from)
|
179
179
|
end
|
@@ -58,10 +58,7 @@ module LinkedRails
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def new_resource_from_parent
|
61
|
-
if requested_resource.is_a?(
|
62
|
-
requested_resource.is_a?(LinkedRails.collection_view_class)
|
63
|
-
return requested_resource.child_resource
|
64
|
-
end
|
61
|
+
return requested_resource.child_resource if requested_resource.is_a?(Collection)
|
65
62
|
|
66
63
|
parent_resource.build_child(
|
67
64
|
controller_class,
|
@@ -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
|
42
42
|
EMPTY_IRI_OPTS.dup
|
43
43
|
end
|
44
44
|
|
data/lib/linked_rails.rb
CHANGED
@@ -54,10 +54,8 @@ 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
|
-
|
59
|
-
opts[:path] = opts[:path].presence || '/'
|
60
|
-
RDF::URI.new(**opts)
|
57
|
+
def iri(**opts)
|
58
|
+
RDF::URI.new(**{scheme: LinkedRails.scheme, host: LinkedRails.host}.merge(opts))
|
61
59
|
end
|
62
60
|
end
|
63
61
|
|
@@ -108,5 +106,4 @@ require 'linked_rails/routes'
|
|
108
106
|
require 'linked_rails/serializer'
|
109
107
|
require 'linked_rails/translate'
|
110
108
|
require 'linked_rails/railtie'
|
111
|
-
require 'linked_rails/url'
|
112
109
|
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.g72bb595fe
|
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-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_response
|
@@ -429,7 +429,6 @@ 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
|
433
432
|
- lib/linked_rails/version.rb
|
434
433
|
- lib/linked_rails/vocab.rb
|
435
434
|
- lib/nill_class_renderer.rb
|