hal_api-rails 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4a383f7f5a7b49036f2f1bf9d213da2577984ef069bb9167f3ac01e7f439403
4
- data.tar.gz: f8439a6fedd8b7d50cdda86eac60ec58e71380354cc2d02be7804c9964bc30d4
3
+ metadata.gz: e860a4faedcb7482b0386c25f54c8772eb994462d701f2284102625779eb8495
4
+ data.tar.gz: c0d805143f39b55bd1c5eca1a806d6089705ff401a172237f33dc3e7405b21b0
5
5
  SHA512:
6
- metadata.gz: 66af2d5541debb9174aedb920a52db996d792474722e9d1aca0c7dda083023dbec5332364dac991de00f54aa10e04b51c76da9bec32aeb6343af920e734225aa
7
- data.tar.gz: e405ea5770a85801b2bd1cf5c5110ad7cc6a6c7b56940866dbfc2aaeec6a82cb4d4afb483d2794a9fd13f6fa01ca98f22179e87c0db82e8f19d362ba301414f8
6
+ metadata.gz: 33f3fbd03301ffe1b95bd2d386e81dcd424ef191e65be21817be4c96710af106c9ce1b86ecc8873e08b2d04b009d60fb886d2a73d8d199d56e2705797a32cf88
7
+ data.tar.gz: 2870c2e994dad97268a9024c8f12ff763b8f7aca902c7991f5651893ebdf6a6417486692a958374fa09edeba64e8766d7bfb36c1f112fb17eb95ab969d2d5666
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 3.3.2
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.email = ['carhoden@gmail.com', 'andrew@beginsinwonder.com']
12
12
 
13
13
  spec.summary = 'JSON HAL APIs on Rails in the style of PRX'
14
- spec.description = 'JSON HAL APIs on Rails in the style of PRX v4. Uses ROAR'
14
+ spec.description = 'JSON HAL APIs on Rails in the style of PRX. Uses ROAR'
15
15
  spec.homepage = 'https://www.github.com/PRX/'
16
16
  spec.license = 'MIT'
17
17
 
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'minitest'
31
31
  spec.add_development_dependency 'pry-byebug'
32
32
  spec.add_development_dependency 'rack-test'
33
- spec.add_development_dependency 'rails', '~> 5.2.4'
34
- spec.add_development_dependency 'rake', '>= 12.3.3'
33
+ spec.add_development_dependency 'rails', '>= 5'
34
+ spec.add_development_dependency 'rake', '>= 12'
35
35
  end
@@ -46,12 +46,14 @@ module HalApi::Controller::Exceptions
46
46
  trace = wrapper.application_trace
47
47
  trace = wrapper.framework_trace if trace.empty?
48
48
 
49
- ActiveSupport::Deprecation.silence do
50
- message = "\n#{exception.class} (#{exception.message}):\n"
51
- message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code)
52
- message << " " << trace.join("\n ")
53
- logger.fatal("#{message}\n\n")
49
+ message = "\n#{exception.class} (#{exception.message}):\n"
50
+ if exception.respond_to?(:annoted_source_code)
51
+ ActiveSupport::Deprecation.silence do
52
+ message << exception.annoted_source_code.to_s
53
+ end
54
54
  end
55
+ message << " " << trace.join("\n ")
56
+ logger.fatal("#{message}\n\n")
55
57
  end
56
58
 
57
59
  def notice_error(error)
@@ -1,3 +1,5 @@
1
+ require 'ostruct'
2
+
1
3
  module HalApi::Controller::Filtering
2
4
  extend ActiveSupport::Concern
3
5
 
@@ -85,7 +87,7 @@ module HalApi::Controller::Filtering
85
87
 
86
88
  # parse query param
87
89
  (params[:filters] || '').split(',').each do |str|
88
- name, value = str.split('=', 2)
90
+ name, value = (str || '').split('=', 2)
89
91
  next unless filters_map.key?(name)
90
92
 
91
93
  # convert/guess type of known params
@@ -43,7 +43,7 @@ module HalApi::Controller::Sorting
43
43
  # parse sort param for name of the column and direction
44
44
  # default is descending, because I say so, and we have a bias towards the new
45
45
  (params[:sorts] || '').split(',').each do |str|
46
- name, direction = str.split(':', 2).map { |s| s.to_s.strip }
46
+ name, direction = (str || '').split(':', 2).map { |s| s.to_s.strip }
47
47
  name = name.underscore
48
48
  direction = direction.blank? ? 'desc' : direction.downcase
49
49
  unless allowed_sorts.include?(name)
@@ -1,6 +1,7 @@
1
1
  require 'forwardable'
2
2
  require 'openssl'
3
3
  require 'active_model'
4
+ require 'ostruct'
4
5
 
5
6
  class HalApi::PagedCollection
6
7
  extend ActiveModel::Naming
@@ -2,6 +2,6 @@
2
2
 
3
3
  module HalApi
4
4
  module Rails
5
- VERSION = '1.2.0'
5
+ VERSION = '1.2.2'
6
6
  end
7
7
  end
@@ -15,7 +15,8 @@ module HalApi::Representer::LinkSerialize
15
15
  if options.is_a?(Hash) && (options.delete(:writeable) || options[:reader])
16
16
  name = options[:rel].to_s.split(':').last.split('/').last
17
17
  pname = "set_#{name}_uri"
18
- reader = options.delete(:reader) || ->(represented:, doc:, **) do
18
+ reader = options.delete(:reader) || ->(obj) do
19
+ doc = obj[:doc]
19
20
  try("#{name}_id=", id_from_url(doc[pname])) if doc[pname]
20
21
  Representable::Pipeline::Stop
21
22
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hal_api-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Rhoden
8
8
  - Andrew Kuklewicz
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-12-05 00:00:00.000000000 Z
12
+ date: 2024-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -141,31 +141,31 @@ dependencies:
141
141
  name: rails
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - "~>"
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
- version: 5.2.4
146
+ version: '5'
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - "~>"
151
+ - - ">="
152
152
  - !ruby/object:Gem::Version
153
- version: 5.2.4
153
+ version: '5'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: rake
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: 12.3.3
160
+ version: '12'
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 12.3.3
168
- description: JSON HAL APIs on Rails in the style of PRX v4. Uses ROAR
167
+ version: '12'
168
+ description: JSON HAL APIs on Rails in the style of PRX. Uses ROAR
169
169
  email:
170
170
  - carhoden@gmail.com
171
171
  - andrew@beginsinwonder.com
@@ -212,7 +212,7 @@ homepage: https://www.github.com/PRX/
212
212
  licenses:
213
213
  - MIT
214
214
  metadata: {}
215
- post_install_message:
215
+ post_install_message:
216
216
  rdoc_options: []
217
217
  require_paths:
218
218
  - lib
@@ -227,8 +227,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubygems_version: 3.1.4
231
- signing_key:
230
+ rubygems_version: 3.5.9
231
+ signing_key:
232
232
  specification_version: 4
233
233
  summary: JSON HAL APIs on Rails in the style of PRX
234
234
  test_files: []