safrano 0.8.7 → 0.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2eed096c2669da58d766a50abb6361f96003f8489367bcd4ab784e7a7306410
4
- data.tar.gz: 991dbed63c5ceeda823024f9af0ea796a0aad5145c8549ad7cd114222b5ec973
3
+ metadata.gz: b92fa13256a9916955424463617069d13f71aefee5fedb3a4fc1c17535874e74
4
+ data.tar.gz: 3bc6d8d42e58d0dca7ba4109238dd042ffb50502969b1dd7f07fe54bcbb7a02e
5
5
  SHA512:
6
- metadata.gz: 7722469a7e2a9cbfda56d955c3cd2efb97e07d881ac4738e61971b522a642ed8aae9bb387fcc8e625b19e8317cbd4fa57d073c01e2dfe93c88667e23b8a4c914
7
- data.tar.gz: '06795fce287398b3f1087d5331427bd95db54359b84ca454304033285e6e8e73f289ac704364f4eb43c1f1f6cdb536e1378a58f14847eebd02a892dcb128bb7f'
6
+ metadata.gz: d0d0bcaa6df005df66eded6b5e4285af6c88896720e40ab1036d18d541d4d58643c8772a146d6187124ba4af61197cbbd74e3a0b452456745d71ac8e4908d0dc
7
+ data.tar.gz: e586938c711020382f7ab4e55f271b7b1094a1b45f13db0cc7c8e82e52c75143087daaa05c362cd02dec150a042bc8493c792bdb0e6ef305ce0746f7933672b9
@@ -16,11 +16,9 @@ module Safrano
16
16
 
17
17
  def symbolize_keys!
18
18
  transform_keys! do |key|
19
- begin
20
- key.to_sym
21
- rescue StandardError
22
- key
23
- end
19
+ key.to_sym
20
+ rescue StandardError
21
+ key
24
22
  end
25
23
  end
26
24
  end
@@ -4,8 +4,8 @@ module Safrano
4
4
  module MatchData
5
5
  module MatchLen
6
6
  unless method_defined? :match_length
7
- def match_length(i)
8
- self[i].length
7
+ def match_length(idx)
8
+ self[idx].length
9
9
  end
10
10
  end
11
11
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'json'
4
4
  require_relative '../safrano/core'
5
- require_relative './entity'
5
+ require_relative 'entity'
6
6
 
7
7
  module Safrano
8
8
  # Represents a named and valued attribute of an Entity
data/lib/odata/batch.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require_relative '../safrano/rack_app'
4
4
  require_relative '../safrano/core'
5
5
  require 'rack/body_proxy'
6
- require_relative './common_logger'
6
+ require_relative 'common_logger'
7
7
 
8
8
  module Safrano
9
9
  # Support for OData multipart $batch Requests
@@ -164,7 +164,7 @@ module Safrano
164
164
  set_relation_info(@parent, childattrib)
165
165
 
166
166
  @child_method = parent.method(childattrib.to_sym)
167
- @child_dataset_method = parent.method("#{childattrib}_dataset".to_sym)
167
+ @child_dataset_method = parent.method(:"#{childattrib}_dataset")
168
168
 
169
169
  @cx = navigated_dataset
170
170
  end
@@ -55,7 +55,7 @@ module Safrano
55
55
  @filtexpr.map_result! { |f| dtcx.where(f) }
56
56
  end
57
57
 
58
- # Note: this is really only *parse* error, ie the error encounterd while
58
+ # NOTE: this is really only *parse* error, ie the error encounterd while
59
59
  # trying to build the AST
60
60
  # Later when evaluating the AST, there can be other errors, they shall
61
61
  # be tracked with @error
@@ -4,7 +4,7 @@ require 'rack'
4
4
  require 'fileutils'
5
5
  require 'tempfile'
6
6
  require 'pathname'
7
- require_relative './navigation_attribute'
7
+ require_relative 'navigation_attribute'
8
8
 
9
9
  module Safrano
10
10
  module Media
@@ -141,7 +141,7 @@ module Safrano
141
141
  abs_media_directory(entity).children(false).max.to_s
142
142
  end
143
143
 
144
- # Note: add a new Version and remove the previous one
144
+ # NOTE: add a new Version and remove the previous one
145
145
  def replace_file(data:, entity:)
146
146
  with_media_directory(entity) do |d|
147
147
  tp = Tempfile.open('', @abs_temp_dir) do |temp_file|
@@ -48,7 +48,7 @@ module Safrano
48
48
  end
49
49
 
50
50
  def build_oarg
51
- field, ord = @orderp.split(' ')
51
+ field, ord = @orderp.split
52
52
  oargu = if field.include?('/')
53
53
  @assoc, field = field.split('/')
54
54
  @jh.add @assoc
@@ -132,7 +132,7 @@ module Safrano
132
132
  # wrapper
133
133
  # for OData Entity return them directly
134
134
  def self.do_execute_func_result(result, _req, apply_query_params: false)
135
- # note: Sequel entities instances seem to be thread safe, so we can
135
+ # NOTE: Sequel entities instances seem to be thread safe, so we can
136
136
  # safely add request-dependant data (eg. req.params) there
137
137
  apply_query_params ? result : result.inactive_query_params
138
138
  end
@@ -273,7 +273,7 @@ module Safrano
273
273
  def self.ComplexType(**props)
274
274
  Class.new(Safrano::ComplexType) do
275
275
  @props = props
276
- props.each do |a, _klassmod|
276
+ props.each_key do |a|
277
277
  asym = a.to_sym
278
278
  define_method(asym) { @values[asym] }
279
279
  define_method("#{a}=") { |val| @values[asym] = val }
@@ -29,7 +29,7 @@ module Safrano
29
29
 
30
30
  DB_TYPE_FLOATP_RGX = /\A\s*(FLOAT)\s*(\(\s*(\d+)\s*\))?\s*\z/i.freeze
31
31
 
32
- # Note: "char" (quoted!) is postgresql's byte type
32
+ # NOTE: "char" (quoted!) is postgresql's byte type
33
33
  DB_TYPE_INTLIKE_RGX = /\A\s*(smallserial|smallint|integer|int2|int4|int8|int|mediumint|bigint|serial|bigserial|tinyint)\s*/i.freeze
34
34
  # used in $metadata
35
35
  # cf. Sequel Database column_schema_default_to_ruby_value
data/lib/odata/expand.rb CHANGED
@@ -41,13 +41,13 @@ module Safrano
41
41
  # Recursive array to deep hash
42
42
  # [1,2,3,4] --> {1=>{2=>{3=>4}}}
43
43
  # [1] --> 1
44
- DEEPH_0 = ->(inp) { inp.size > 1 ? { inp[0] => DEEPH_0.call(inp[1..-1]) } : inp[0] }
44
+ DEEPH_0 = ->(inp) { inp.size > 1 ? { inp[0] => DEEPH_0.call(inp[1..]) } : inp[0] }
45
45
 
46
46
  # used for building output template
47
47
  # Recursive array to deep hash
48
48
  # [1,2,3,4] --> {1=>{2=>{3=>4}}}
49
49
  # [1] --> { 1 => {} }
50
- DEEPH_1 = ->(inp) { inp.size > 1 ? { inp[0] => DEEPH_1.call(inp[1..-1]) } : { inp[0] => {} } }
50
+ DEEPH_1 = ->(inp) { inp.size > 1 ? { inp[0] => DEEPH_1.call(inp[1..]) } : { inp[0] => {} } }
51
51
 
52
52
  NODESEP = '/'
53
53
 
@@ -79,7 +79,7 @@ module Safrano
79
79
  COMASPLIT = /\s*,\s*/.freeze
80
80
  attr_reader :template
81
81
 
82
- # Note: if you change this method, please also update arity_full_monkey?
82
+ # NOTE: if you change this method, please also update arity_full_monkey?
83
83
  # see below
84
84
  def initialize(expandstr, model)
85
85
  @model = model
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './token'
4
- require_relative './tree'
5
- require_relative './error'
3
+ require_relative 'token'
4
+ require_relative 'tree'
5
+ require_relative 'error'
6
6
 
7
7
  # top level Safrano namespace
8
8
  module Safrano
@@ -20,6 +20,7 @@ module Safrano
20
20
  @input = input
21
21
  @stack = []
22
22
  @binop_stack = []
23
+ @binop_stack_markers = []
23
24
  end
24
25
 
25
26
  def server_error
@@ -63,6 +64,13 @@ module Safrano
63
64
  @error = ErrorUnmatchedClose.new(tok, typ, @cursor)
64
65
  end
65
66
 
67
+ def scoped_prev_binop
68
+ base = @binop_stack_markers.last || 0
69
+ return nil if @binop_stack.length <= base
70
+
71
+ @binop_stack.last
72
+ end
73
+
66
74
  def with_accepted(tok, typ)
67
75
  (err = @cursor.accept?(tok, typ)) ? (@error = err) : yield
68
76
  end
@@ -81,16 +89,19 @@ module Safrano
81
89
  unless @error
82
90
  openarg = ArgTree.new('(')
83
91
  @stack << openarg
92
+ @binop_stack_markers << @binop_stack.length
84
93
  grow_at_cursor(openarg)
85
94
  end
86
95
  end
87
96
 
88
97
  when ')'
98
+ mark_len = @binop_stack_markers.pop
89
99
  break invalid_closing_delimiter_error(tok, typ) unless (@cursor = @stack.pop)
90
100
 
91
101
  with_accepted(tok, typ) do
92
102
  @cursor.update_state(tok, typ)
93
103
  cursor_at_parent
104
+ @binop_stack.slice!(mark_len..)
94
105
  end
95
106
  end
96
107
 
@@ -101,7 +112,7 @@ module Safrano
101
112
 
102
113
  when :UnopTree
103
114
  unoptr = UnopTree.new(tok)
104
- if (prev = @binop_stack.last)
115
+ if (prev = scoped_prev_binop)
105
116
  # handling of lower precedence binding vs the other
106
117
  # ones(le,gt,eq...)
107
118
  unless prev.precedence < unoptr.precedence
@@ -116,7 +127,7 @@ module Safrano
116
127
  when :BinopBool
117
128
  with_accepted(tok, typ) do
118
129
  binoptr = BinopBool.new(tok)
119
- if (prev = @binop_stack.last)
130
+ if (prev = scoped_prev_binop)
120
131
  # handling of lower precedence binding vs the other
121
132
  # ones(le,gt,eq...)
122
133
  unless prev.precedence < binoptr.precedence
@@ -132,7 +143,7 @@ module Safrano
132
143
  when :BinopArithm
133
144
  with_accepted(tok, typ) do
134
145
  binoptr = BinopArithm.new(tok)
135
- if (prev = @binop_stack.last)
146
+ if (prev = scoped_prev_binop)
136
147
  # handling of lower precedence binding vs the other
137
148
  # ones(le,gt,eq...)
138
149
  unless prev.precedence < binoptr.precedence
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './base'
4
- require_relative './sequel_function_adapter'
5
- require_relative './sequel_datetime_adapter'
3
+ require_relative 'base'
4
+ require_relative 'sequel_function_adapter'
5
+ require_relative 'sequel_datetime_adapter'
6
6
  module Safrano
7
7
  module Filter
8
8
  # Base class for Leaves, Trees, RootTrees etc
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './tree'
4
- require_relative './sequel'
3
+ require_relative 'tree'
4
+ require_relative 'sequel'
5
5
 
6
6
  module Safrano
7
7
  module Filter
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './tree'
4
- require_relative './sequel'
3
+ require_relative 'tree'
4
+ require_relative 'sequel'
5
5
 
6
6
  module Safrano
7
7
  module Filter
@@ -31,48 +31,47 @@ module Safrano
31
31
 
32
32
  inp.scan(RGX) do |groups|
33
33
  groups.each_with_index do |tok, i|
34
- if tok
34
+ next unless tok
35
35
 
36
- typ = case i
37
- when 0
38
- :FuncTree
39
- when 1
40
- :NullLiteral
41
- when 2
42
- case tok
43
- when '(', ')'
44
- :Delimiter
45
- when ','
46
- :Separator
47
- end
48
- when 3
49
- :BinopBool
50
- when 4
51
- :BinopArithm
52
- when 5
53
- :UnopTree
54
- when 6
55
- :QString
56
- when 7
57
- :DecimalLit
58
- when 8
59
- :FPNumber
60
- when 9
61
- :Qualit
62
- when 10
63
- :DateTimeLit
64
- when 11
65
- :DateTimeOffsetLit
66
- when 12
67
- :GuidLit
68
- when 13
69
- :Literal
70
- when 14
71
- :unmatchedQuote
36
+ typ = case i
37
+ when 0
38
+ :FuncTree
39
+ when 1
40
+ :NullLiteral
41
+ when 2
42
+ case tok
43
+ when '(', ')'
44
+ :Delimiter
45
+ when ','
46
+ :Separator
72
47
  end
73
- yield tok, typ
74
- break
75
- end
48
+ when 3
49
+ :BinopBool
50
+ when 4
51
+ :BinopArithm
52
+ when 5
53
+ :UnopTree
54
+ when 6
55
+ :QString
56
+ when 7
57
+ :DecimalLit
58
+ when 8
59
+ :FPNumber
60
+ when 9
61
+ :Qualit
62
+ when 10
63
+ :DateTimeLit
64
+ when 11
65
+ :DateTimeOffsetLit
66
+ when 12
67
+ :GuidLit
68
+ when 13
69
+ :Literal
70
+ when 14
71
+ :unmatchedQuote
72
+ end
73
+ yield tok, typ
74
+ break
76
75
  end
77
76
  end
78
77
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './base'
4
- require_relative './error'
3
+ require_relative 'base'
4
+ require_relative 'error'
5
5
 
6
6
  module Safrano
7
7
  module Filter
@@ -314,19 +314,17 @@ module Safrano
314
314
  case typ
315
315
  when :Delimiter
316
316
  if @value == '(' && tok == ')' && @state != :closed
317
- if (@parent.class == IdentityFuncTree) ||
317
+ if @parent.instance_of?(IdentityFuncTree) ||
318
318
  @parent.arity_full?(@children.size)
319
319
 
320
320
  nil
321
321
  else
322
322
  Parser::ErrorInvalidArity.new(tok, typ, self)
323
323
  end
324
+ elsif @value == '(' && tok == '(' && @state == :open
325
+ nil
324
326
  else
325
- if @value == '(' && tok == '(' && @state == :open
326
- nil
327
- else
328
- Parser::ErrorUnmatchedClose.new(tok, typ, self)
329
- end
327
+ Parser::ErrorUnmatchedClose.new(tok, typ, self)
330
328
  end
331
329
  when :Separator
332
330
  if @value == '(' && tok == ',' && @state == :val
@@ -135,7 +135,7 @@ module Safrano
135
135
 
136
136
  def check_missing_params
137
137
  # do we have all parameters provided ? use Set difference to check
138
- pkeys = @params.keys.map(&:to_sym).to_set
138
+ pkeys = @params.keys.to_set(&:to_sym)
139
139
  if (idiff = @input.keys.to_set - pkeys).empty?
140
140
  Contract::OK
141
141
  else
@@ -217,7 +217,7 @@ module Safrano
217
217
  # (application-)error handling
218
218
  # the result is an Error object or class
219
219
 
220
- # Note: Sequel::Error exceptions are already
220
+ # NOTE: Sequel::Error exceptions are already
221
221
  # handled on rack app level (cf. the call methode )
222
222
  Safrano.with_error(result) do |error|
223
223
  @error = error
@@ -452,9 +452,9 @@ module Safrano
452
452
  if metadata[:edm_type] == 'Edm.Guid'
453
453
  props = db_schema[primary_key]
454
454
  @pk_castfunc = if props[:type] == :blob # Edm.Guid but as 16 byte binary Blob on DB level, eg in Sqlite
455
- lambda { |x| "guid'#{UUIDTools::UUID.parse_raw(x)}'" unless x.nil? }
455
+ ->(x) { "guid'#{UUIDTools::UUID.parse_raw(x)}'" unless x.nil? }
456
456
  else
457
- lambda { |x| "guid'#{x}'" unless x.nil? }
457
+ ->(x) { "guid'#{x}'" unless x.nil? }
458
458
  end
459
459
  else
460
460
  @pk_castfunc = @casted_cols[primary_key]
@@ -512,7 +512,7 @@ module Safrano
512
512
  @odata_upk_parts = odata_upk_build.join(',').split('?')
513
513
 
514
514
  # regex parts for unordered matching
515
- @iuk_rgx_parts = primary_key.map do |pk|
515
+ @iuk_rgx_parts = primary_key.to_h do |pk|
516
516
  kvpredicate = case db_schema[pk][:type]
517
517
  when :integer
518
518
  '(\\d+)'
@@ -520,7 +520,7 @@ module Safrano
520
520
  "'(\\w+)'"
521
521
  end
522
522
  [pk, "#{pk}=#{kvpredicate}"]
523
- end.to_h
523
+ end
524
524
 
525
525
  # single regex assuming the key fields are ordered !
526
526
  @iuk_rgx = /\A#{@iuk_rgx_parts.values.join(',\s*')}\z/
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'json'
4
4
  require_relative '../safrano/core'
5
- require_relative './entity'
5
+ require_relative 'entity'
6
6
 
7
7
  module Safrano
8
8
  # remove the relation between entity and parent by clearing
@@ -28,7 +28,7 @@ module Safrano
28
28
  def self.create_nav_relation(child, assoc, parent)
29
29
  return unless assoc
30
30
 
31
- # Note: this coding shares some bits from our sequel/plugins/join_by_paths,
31
+ # NOTE: this coding shares some bits from our sequel/plugins/join_by_paths,
32
32
  # method build_unique_join_segments
33
33
  # eventually there is an opportunity to have more reusable code here
34
34
  case assoc[:type]
@@ -72,7 +72,7 @@ module Safrano
72
72
  def each_rel
73
73
  raise ArgumentError unless block_given?
74
74
 
75
- @list.each { |_rid, rel| yield rel }
75
+ @list.each_value { |rel| yield rel }
76
76
  end
77
77
 
78
78
  def get(arg)
@@ -34,12 +34,12 @@ module Safrano
34
34
  match_len = -1
35
35
  tres_next = nil
36
36
 
37
- @allowed_transitions.each { |t|
37
+ @allowed_transitions.each do |t|
38
38
  if (res = t.longer_match(path_remain, match_len))
39
39
  tres_next = res
40
40
  match_len = tres_next.match_length
41
41
  end
42
- }
42
+ end
43
43
  tres_next
44
44
  end
45
45
  end
@@ -56,12 +56,12 @@ module Safrano
56
56
  match_len = -1
57
57
  tres_next = nil
58
58
 
59
- allowed_transitions.each { |t|
59
+ allowed_transitions.each do |t|
60
60
  if (res = t.longer_match(path_remain, match_len))
61
61
  tres_next = res
62
62
  match_len = tres_next.match_length
63
63
  end
64
- }
64
+ end
65
65
  tres_next
66
66
  end
67
67
  end
@@ -58,7 +58,7 @@ module MIME
58
58
  if (hmd = HMD_RGX.match(line))
59
59
  @target_hd[hmd[1].downcase] = hmd[2].strip
60
60
 
61
- elsif CRLF == line
61
+ elsif line == CRLF
62
62
  @target_ct = @target_hd[CTT_TYPE_LC] || TEXT_PLAIN
63
63
  @state = new_content
64
64
 
@@ -118,7 +118,7 @@ module MIME
118
118
  def new_content
119
119
  @target =
120
120
  if @target_ct.start_with?(MPS) &&
121
- (md = (MP_RGX1.match(@target_ct[10..-1]) || MP_RGX2.match(@target_ct[10..-1])))
121
+ (md = (MP_RGX1.match(@target_ct[10..]) || MP_RGX2.match(@target_ct[10..])))
122
122
  multipart_content(md[2].strip)
123
123
  elsif @target_ct.start_with?(APP_HTTP)
124
124
  MIME::Content::Application::Http.new
@@ -211,7 +211,7 @@ module MIME
211
211
  def parse_head(line)
212
212
  if (hmd = HMD_RGX.match(line))
213
213
  @target.hd[hmd[1].downcase] = hmd[2].strip
214
- elsif CRLF == line
214
+ elsif line == CRLF
215
215
  @state = :b
216
216
  else
217
217
  @target.content << line
@@ -383,15 +383,13 @@ module MIME
383
383
  # of the changes
384
384
 
385
385
  full_req.db.transaction do
386
- begin
387
- @response.content = @content.map { |part| part.get_response(full_req) }
388
- rescue Sequel::Rollback => e
389
- # one of the changes of the changeset has failed
390
- # --> provide a dummy empty response for the change-parts
391
- # then transmit the Rollback to Sequel
392
- get_failed_changeset_response(e)
393
- raise
394
- end
386
+ @response.content = @content.map { |part| part.get_response(full_req) }
387
+ rescue Sequel::Rollback => e
388
+ # one of the changes of the changeset has failed
389
+ # --> provide a dummy empty response for the change-parts
390
+ # then transmit the Rollback to Sequel
391
+ get_failed_changeset_response(e)
392
+ raise
395
393
  end
396
394
  else
397
395
  @response.content = @content.map { |part| part.get_response(full_req) }
@@ -528,7 +526,7 @@ module MIME
528
526
  def parse_head(line)
529
527
  if (hmd = HMD_RGX.match(line))
530
528
  @target.content.hd[hmd[1].downcase] = hmd[2].strip
531
- elsif CRLF == line
529
+ elsif line == CRLF
532
530
  @state = :b
533
531
  else
534
532
  @body_lines << line
@@ -224,14 +224,13 @@ module Safrano
224
224
  end
225
225
 
226
226
  def accept
227
- @env['safrano.accept'] ||= begin
227
+ @env['safrano.accept'] ||=
228
228
  if @env.include?('HTTP_ACCEPT') && (@env['HTTP_ACCEPT'].to_s != '')
229
229
  @env['HTTP_ACCEPT'].to_s.scan(HEADER_VAL_WITH_PAR)
230
230
  .map! { |e| AcceptEntry.new(e) }.sort
231
231
  else
232
232
  [AcceptEntry.new('*/*')]
233
233
  end
234
- end
235
234
  end
236
235
 
237
236
  def accept?(type)
@@ -166,7 +166,10 @@ module Safrano
166
166
  FINAL_TEMPLATE_FUNC_DEFAULT = ->(_template) {}
167
167
  FINAL_TEMPLATE_FUNC_SKIP_META = ->(template) { template.delete(:meta) }
168
168
  FINAL_TEMPLATE_FUNC_SKIP_DEFERR = ->(template) { template.delete(:deferr) }
169
- FINAL_TEMPLATE_FUNC_SKIP_META_DEFERR = ->(template) { template.delete(:meta); template.delete(:deferr) }
169
+ FINAL_TEMPLATE_FUNC_SKIP_META_DEFERR = lambda do |template|
170
+ template.delete(:meta)
171
+ template.delete(:deferr)
172
+ end
170
173
 
171
174
  def self.app_setup_singleton
172
175
  @app_setup_singleton
@@ -185,7 +188,7 @@ module Safrano
185
188
  # enabled per default starting from 0.6
186
189
  @xbugfix_create_response = true
187
190
  klass = self.class
188
- # TODO better error
191
+ # TODO: better error
189
192
  raise StandardError unless (klass.publish_proc or template_instance)
190
193
 
191
194
  tmpli = if template_instance
@@ -291,14 +294,14 @@ module Safrano
291
294
  (@v2.server_url(surl)) if @v2
292
295
  end
293
296
 
294
- VALID_RESP_FORMAT_OPTS = [:skip_deferred, :skip_metadata]
297
+ VALID_RESP_FORMAT_OPTS = %i[skip_deferred skip_metadata].freeze
295
298
  def valid_resp_format_options(*args)
296
299
  raise API::InvalidRespFormatOption.new(args) unless args
297
300
 
298
301
  args.map!(&:to_sym)
299
- args.each { |arg|
302
+ args.each do |arg|
300
303
  raise API::InvalidRespFormatOption.new(arg) unless VALID_RESP_FORMAT_OPTS.include?(arg)
301
- }
304
+ end
302
305
  yield(args)
303
306
  end
304
307
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Note: Safrano has hardcoded mapping rules for most of types.
3
+ # NOTE: Safrano has hardcoded mapping rules for most of types.
4
4
  # But
5
5
  # it might not be 100% complete
6
6
  # it might not always do what is expected
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Safrano
4
- VERSION = '0.8.7'
4
+ VERSION = '0.8.8'
5
5
  end
@@ -138,8 +138,8 @@ class JoinByPathsHelper < Set
138
138
  result_ = []
139
139
 
140
140
  # in case of multiple many_to_many rels, we need differing through aliases
141
- many_to_many_count = many_to_many_count + 1
142
- through_alias = "t#{many_to_many_count}".to_sym
141
+ many_to_many_count += 1
142
+ through_alias = :"t#{many_to_many_count}"
143
143
 
144
144
  # For many_to_many first we add the join with assigment table
145
145
  lks_ = [assoc[:left_primary_key]].flatten
@@ -242,7 +242,7 @@ module Sequel
242
242
  @aliases_sym[pstr]
243
243
  else
244
244
  @alias_cnt += 1
245
- @aliases_sym[pstr] = "a#{@alias_cnt}".to_sym
245
+ @aliases_sym[pstr] = :"a#{@alias_cnt}"
246
246
  end
247
247
  end
248
248
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - oz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-16 00:00:00.000000000 Z
11
+ date: 2025-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack