postfinancecheckout-ruby-sdk 3.1.4 → 3.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/lib/postfinancecheckout-ruby-sdk/api/analytics_query_service_api.rb +381 -0
  4. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query.rb +272 -0
  5. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_execution.rb +293 -0
  6. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_execution_state.rb +37 -0
  7. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_result_batch.rb +225 -0
  8. data/lib/postfinancecheckout-ruby-sdk/models/analytics_schema_column.rb +263 -0
  9. data/lib/postfinancecheckout-ruby-sdk/models/analytics_schema_table.rb +215 -0
  10. data/lib/postfinancecheckout-ruby-sdk/models/rendered_document.rb +17 -5
  11. data/lib/postfinancecheckout-ruby-sdk/models/rendered_terminal_receipt.rb +17 -5
  12. data/lib/postfinancecheckout-ruby-sdk/models/rendered_terminal_transaction_summary.rb +17 -5
  13. data/lib/postfinancecheckout-ruby-sdk/version.rb +1 -1
  14. data/lib/postfinancecheckout-ruby-sdk.rb +7 -0
  15. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.1.gem +0 -0
  16. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/ffi-1.15.5/gem_make.out +2 -2
  17. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/gem_make.out +1 -1
  18. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/mkmf.log +1 -1
  19. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/CHANGELOG.md +16 -0
  20. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Gemfile +4 -2
  21. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/LICENSE.txt +0 -0
  22. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/README.md +0 -0
  23. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Rakefile +0 -0
  24. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/data/unicode.data +0 -0
  25. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/native.rb +0 -1
  26. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/pure.rb +0 -1
  27. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna.rb +0 -1
  28. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/template.rb +3 -4
  29. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/uri.rb +57 -53
  30. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/version.rb +1 -2
  31. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable.rb +0 -0
  32. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/idna_spec.rb +0 -1
  33. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/net_http_compat_spec.rb +0 -1
  34. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/security_spec.rb +0 -1
  35. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/template_spec.rb +9 -1
  36. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/uri_spec.rb +81 -1
  37. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/spec_helper.rb +0 -0
  38. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/clobber.rake +0 -0
  39. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/gem.rake +5 -2
  40. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/git.rake +0 -0
  41. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/metrics.rake +0 -0
  42. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/profile.rake +0 -0
  43. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/rspec.rake +0 -0
  44. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/yard.rake +0 -0
  45. data/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +3 -3
  46. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/Makefile +2 -2
  47. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/generator/Makefile +2 -2
  48. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/parser/Makefile +2 -2
  49. data/vendor/bundle/ruby/2.4.0/specifications/{addressable-2.8.0.gemspec → addressable-2.8.1.gemspec} +8 -7
  50. metadata +37 -31
  51. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.0.gem +0 -0
  52. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.8.0/addressable.gemspec +0 -37
@@ -1,5 +1,5 @@
1
1
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c
2
- /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20220808-1653-b1iwd6.rb extconf.rb
2
+ /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20220920-1751-lscnl2.rb extconf.rb
3
3
  checking for ffi.h... yes
4
4
  checking for ffi_prep_closure_loc() in -lffi... yes
5
5
  checking for ffi_prep_cif_var()... yes
@@ -367,4 +367,4 @@ linking shared-object ffi_c.so
367
367
 
368
368
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c
369
369
  make "DESTDIR=" install
370
- /usr/bin/install -c -m 0755 ffi_c.so ./.gem.20220808-1653-1t3tfl
370
+ /usr/bin/install -c -m 0755 ffi_c.so ./.gem.20220920-1751-qm4buv
@@ -1,5 +1,5 @@
1
1
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json
2
- /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20220808-1653-9midx8.rb extconf.rb
2
+ /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20220920-1751-1bldj0t.rb extconf.rb
3
3
  creating Makefile
4
4
 
5
5
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json
@@ -176,7 +176,7 @@ In file included from /opt/hostedtoolcache/Ruby/2.4.1/x64/include/ruby-2.4.0/rub
176
176
  cc1: warning: unrecognized command line option ‘-Wno-self-assign’
177
177
  cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
178
178
  cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
179
- /usr/bin/ld: /tmp/ccJRJFL1.o: in function `t':
179
+ /usr/bin/ld: /tmp/ccVSR7ZN.o: in function `t':
180
180
  /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/parser/conftest.c:16: undefined reference to `rb_enc_interned_str'
181
181
  collect2: error: ld returned 1 exit status
182
182
  checked program was:
@@ -1,3 +1,19 @@
1
+ # Addressable 2.8.1
2
+ - refactor `Addressable::URI.normalize_path` to address linter offenses ([#430](https://github.com/sporkmonger/addressable/pull/430))
3
+ - remove redundant colon in `Addressable::URI::CharacterClasses::AUTHORITY` regex ([#438](https://github.com/sporkmonger/addressable/pull/438))
4
+ - update gemspec to reflect supported Ruby versions ([#466], [#464], [#463])
5
+ - compatibility w/ public_suffix 5.x ([#466], [#465], [#460])
6
+ - fixes "invalid byte sequence in UTF-8" exception when unencoding URLs containing non UTF-8 characters ([#459](https://github.com/sporkmonger/addressable/pull/459))
7
+ - `Ractor` compatibility ([#449](https://github.com/sporkmonger/addressable/pull/449))
8
+ - use the whole string instead of a single line for template match ([#431](https://github.com/sporkmonger/addressable/pull/431))
9
+ - force UTF-8 encoding only if needed ([#341](https://github.com/sporkmonger/addressable/pull/341))
10
+
11
+ [#460]: https://github.com/sporkmonger/addressable/pull/460
12
+ [#463]: https://github.com/sporkmonger/addressable/pull/463
13
+ [#464]: https://github.com/sporkmonger/addressable/pull/464
14
+ [#465]: https://github.com/sporkmonger/addressable/pull/465
15
+ [#466]: https://github.com/sporkmonger/addressable/pull/466
16
+
1
17
  # Addressable 2.8.0
2
18
  - fixes ReDoS vulnerability in Addressable::Template#match
3
19
  - no longer replaces `+` with spaces in queries for non-http(s) schemes
@@ -2,7 +2,7 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- gemspec(path: __FILE__ == "(eval)" ? ".." : ".")
5
+ gemspec
6
6
 
7
7
  group :test do
8
8
  gem 'rspec', '~> 3.8'
@@ -25,4 +25,6 @@ group :test, :development do
25
25
  gem "rake", ">= 12.3.3"
26
26
  end
27
27
 
28
- gem "idn-ruby", platform: :mri
28
+ unless ENV["IDNA_MODE"] == "pure"
29
+ gem "idn-ruby", platform: :mri
30
+ end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -657,12 +656,12 @@ module Addressable
657
656
  def ordered_variable_defaults
658
657
  @ordered_variable_defaults ||= begin
659
658
  expansions, _ = parse_template_pattern(pattern)
660
- expansions.map do |capture|
659
+ expansions.flat_map do |capture|
661
660
  _, _, varlist = *capture.match(EXPRESSION)
662
661
  varlist.split(',').map do |varspec|
663
662
  varspec[VARSPEC, 1]
664
663
  end
665
- end.flatten
664
+ end
666
665
  end
667
666
  end
668
667
 
@@ -1023,7 +1022,7 @@ module Addressable
1023
1022
  end
1024
1023
 
1025
1024
  # Ensure that the regular expression matches the whole URI.
1026
- regexp_string = "^#{regexp_string}$"
1025
+ regexp_string = "\\A#{regexp_string}\\z"
1027
1026
  return expansions, Regexp.new(regexp_string)
1028
1027
  end
1029
1028
 
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -38,20 +37,26 @@ module Addressable
38
37
  ##
39
38
  # Container for the character classes specified in
40
39
  # <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
40
+ #
41
+ # Note: Concatenated and interpolated `String`s are not affected by the
42
+ # `frozen_string_literal` directive and must be frozen explicitly.
43
+ #
44
+ # Interpolated `String`s *were* frozen this way before Ruby 3.0:
45
+ # https://bugs.ruby-lang.org/issues/17104
41
46
  module CharacterClasses
42
47
  ALPHA = "a-zA-Z"
43
48
  DIGIT = "0-9"
44
49
  GEN_DELIMS = "\\:\\/\\?\\#\\[\\]\\@"
45
50
  SUB_DELIMS = "\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\="
46
- RESERVED = GEN_DELIMS + SUB_DELIMS
47
- UNRESERVED = ALPHA + DIGIT + "\\-\\.\\_\\~"
48
- PCHAR = UNRESERVED + SUB_DELIMS + "\\:\\@"
49
- SCHEME = ALPHA + DIGIT + "\\-\\+\\."
50
- HOST = UNRESERVED + SUB_DELIMS + "\\[\\:\\]"
51
- AUTHORITY = PCHAR + "\\[\\:\\]"
52
- PATH = PCHAR + "\\/"
53
- QUERY = PCHAR + "\\/\\?"
54
- FRAGMENT = PCHAR + "\\/\\?"
51
+ RESERVED = (GEN_DELIMS + SUB_DELIMS).freeze
52
+ UNRESERVED = (ALPHA + DIGIT + "\\-\\.\\_\\~").freeze
53
+ PCHAR = (UNRESERVED + SUB_DELIMS + "\\:\\@").freeze
54
+ SCHEME = (ALPHA + DIGIT + "\\-\\+\\.").freeze
55
+ HOST = (UNRESERVED + SUB_DELIMS + "\\[\\:\\]").freeze
56
+ AUTHORITY = (PCHAR + "\\[\\:\\]").freeze
57
+ PATH = (PCHAR + "\\/").freeze
58
+ QUERY = (PCHAR + "\\/\\?").freeze
59
+ FRAGMENT = (PCHAR + "\\/\\?").freeze
55
60
  end
56
61
 
57
62
  module NormalizeCharacterClasses
@@ -469,19 +474,13 @@ module Addressable
469
474
  "Expected Class (String or Addressable::URI), " +
470
475
  "got #{return_type.inspect}"
471
476
  end
472
- uri = uri.dup
473
- # Seriously, only use UTF-8. I'm really not kidding!
474
- uri.force_encoding("utf-8")
475
-
476
- unless leave_encoded.empty?
477
- leave_encoded = leave_encoded.dup.force_encoding("utf-8")
478
- end
479
477
 
480
- result = uri.gsub(/%[0-9a-f]{2}/iu) do |sequence|
478
+ result = uri.gsub(/%[0-9a-f]{2}/i) do |sequence|
481
479
  c = sequence[1..3].to_i(16).chr
482
- c.force_encoding("utf-8")
480
+ c.force_encoding(sequence.encoding)
483
481
  leave_encoded.include?(c) ? sequence : c
484
482
  end
483
+
485
484
  result.force_encoding("utf-8")
486
485
  if return_type == String
487
486
  return result
@@ -561,10 +560,10 @@ module Addressable
561
560
  leave_re = if leave_encoded.length > 0
562
561
  character_class = "#{character_class}%" unless character_class.include?('%')
563
562
 
564
- "|%(?!#{leave_encoded.chars.map do |char|
563
+ "|%(?!#{leave_encoded.chars.flat_map do |char|
565
564
  seq = SEQUENCE_ENCODING_TABLE[char]
566
565
  [seq.upcase, seq.downcase]
567
- end.flatten.join('|')})"
566
+ end.join('|')})"
568
567
  end
569
568
 
570
569
  character_class = if leave_re
@@ -900,7 +899,7 @@ module Addressable
900
899
  end
901
900
  end
902
901
  # All normalized values should be UTF-8
903
- @normalized_scheme.force_encoding(Encoding::UTF_8) if @normalized_scheme
902
+ force_utf8_encoding_if_needed(@normalized_scheme)
904
903
  @normalized_scheme
905
904
  end
906
905
 
@@ -955,7 +954,7 @@ module Addressable
955
954
  end
956
955
  end
957
956
  # All normalized values should be UTF-8
958
- @normalized_user.force_encoding(Encoding::UTF_8) if @normalized_user
957
+ force_utf8_encoding_if_needed(@normalized_user)
959
958
  @normalized_user
960
959
  end
961
960
 
@@ -1012,9 +1011,7 @@ module Addressable
1012
1011
  end
1013
1012
  end
1014
1013
  # All normalized values should be UTF-8
1015
- if @normalized_password
1016
- @normalized_password.force_encoding(Encoding::UTF_8)
1017
- end
1014
+ force_utf8_encoding_if_needed(@normalized_password)
1018
1015
  @normalized_password
1019
1016
  end
1020
1017
 
@@ -1082,9 +1079,7 @@ module Addressable
1082
1079
  end
1083
1080
  end
1084
1081
  # All normalized values should be UTF-8
1085
- if @normalized_userinfo
1086
- @normalized_userinfo.force_encoding(Encoding::UTF_8)
1087
- end
1082
+ force_utf8_encoding_if_needed(@normalized_userinfo)
1088
1083
  @normalized_userinfo
1089
1084
  end
1090
1085
 
@@ -1151,9 +1146,7 @@ module Addressable
1151
1146
  end
1152
1147
  end
1153
1148
  # All normalized values should be UTF-8
1154
- if @normalized_host && !@normalized_host.empty?
1155
- @normalized_host.force_encoding(Encoding::UTF_8)
1156
- end
1149
+ force_utf8_encoding_if_needed(@normalized_host)
1157
1150
  @normalized_host
1158
1151
  end
1159
1152
 
@@ -1271,9 +1264,7 @@ module Addressable
1271
1264
  authority
1272
1265
  end
1273
1266
  # All normalized values should be UTF-8
1274
- if @normalized_authority
1275
- @normalized_authority.force_encoding(Encoding::UTF_8)
1276
- end
1267
+ force_utf8_encoding_if_needed(@normalized_authority)
1277
1268
  @normalized_authority
1278
1269
  end
1279
1270
 
@@ -1507,7 +1498,7 @@ module Addressable
1507
1498
  site_string
1508
1499
  end
1509
1500
  # All normalized values should be UTF-8
1510
- @normalized_site.force_encoding(Encoding::UTF_8) if @normalized_site
1501
+ force_utf8_encoding_if_needed(@normalized_site)
1511
1502
  @normalized_site
1512
1503
  end
1513
1504
 
@@ -1570,7 +1561,7 @@ module Addressable
1570
1561
  result
1571
1562
  end
1572
1563
  # All normalized values should be UTF-8
1573
- @normalized_path.force_encoding(Encoding::UTF_8) if @normalized_path
1564
+ force_utf8_encoding_if_needed(@normalized_path)
1574
1565
  @normalized_path
1575
1566
  end
1576
1567
 
@@ -1646,7 +1637,7 @@ module Addressable
1646
1637
  component == "" ? nil : component
1647
1638
  end
1648
1639
  # All normalized values should be UTF-8
1649
- @normalized_query.force_encoding(Encoding::UTF_8) if @normalized_query
1640
+ force_utf8_encoding_if_needed(@normalized_query)
1650
1641
  @normalized_query
1651
1642
  end
1652
1643
 
@@ -1842,9 +1833,7 @@ module Addressable
1842
1833
  component == "" ? nil : component
1843
1834
  end
1844
1835
  # All normalized values should be UTF-8
1845
- if @normalized_fragment
1846
- @normalized_fragment.force_encoding(Encoding::UTF_8)
1847
- end
1836
+ force_utf8_encoding_if_needed(@normalized_fragment)
1848
1837
  @normalized_fragment
1849
1838
  end
1850
1839
 
@@ -2440,30 +2429,35 @@ module Addressable
2440
2429
  def self.normalize_path(path)
2441
2430
  # Section 5.2.4 of RFC 3986
2442
2431
 
2443
- return nil if path.nil?
2432
+ return if path.nil?
2444
2433
  normalized_path = path.dup
2445
- begin
2446
- mod = nil
2434
+ loop do
2447
2435
  mod ||= normalized_path.gsub!(RULE_2A, SLASH)
2448
2436
 
2449
2437
  pair = normalized_path.match(RULE_2B_2C)
2450
- parent, current = pair[1], pair[2] if pair
2438
+ if pair
2439
+ parent = pair[1]
2440
+ current = pair[2]
2441
+ else
2442
+ parent = nil
2443
+ current = nil
2444
+ end
2445
+
2446
+ regexp = "/#{Regexp.escape(parent.to_s)}/\\.\\./|"
2447
+ regexp += "(/#{Regexp.escape(current.to_s)}/\\.\\.$)"
2448
+
2451
2449
  if pair && ((parent != SELF_REF && parent != PARENT) ||
2452
2450
  (current != SELF_REF && current != PARENT))
2453
- mod ||= normalized_path.gsub!(
2454
- Regexp.new(
2455
- "/#{Regexp.escape(parent.to_s)}/\\.\\./|" +
2456
- "(/#{Regexp.escape(current.to_s)}/\\.\\.$)"
2457
- ), SLASH
2458
- )
2451
+ mod ||= normalized_path.gsub!(Regexp.new(regexp), SLASH)
2459
2452
  end
2460
2453
 
2461
2454
  mod ||= normalized_path.gsub!(RULE_2D, EMPTY_STR)
2462
2455
  # Non-standard, removes prefixed dotted segments from path.
2463
2456
  mod ||= normalized_path.gsub!(RULE_PREFIXED_PARENT, SLASH)
2464
- end until mod.nil?
2457
+ break if mod.nil?
2458
+ end
2465
2459
 
2466
- return normalized_path
2460
+ normalized_path
2467
2461
  end
2468
2462
 
2469
2463
  ##
@@ -2552,5 +2546,15 @@ module Addressable
2552
2546
  remove_instance_variable(:@uri_string) if defined?(@uri_string)
2553
2547
  remove_instance_variable(:@hash) if defined?(@hash)
2554
2548
  end
2549
+
2550
+ ##
2551
+ # Converts the string to be UTF-8 if it is not already UTF-8
2552
+ #
2553
+ # @api private
2554
+ def force_utf8_encoding_if_needed(str)
2555
+ if str && str.encoding != Encoding::UTF_8
2556
+ str.force_encoding(Encoding::UTF_8)
2557
+ end
2558
+ end
2555
2559
  end
2556
2560
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -24,7 +23,7 @@ if !defined?(Addressable::VERSION)
24
23
  module VERSION
25
24
  MAJOR = 2
26
25
  MINOR = 8
27
- TINY = 0
26
+ TINY = 1
28
27
 
29
28
  STRING = [MAJOR, MINOR, TINY].join('.')
30
29
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # coding: utf-8
4
3
  # Copyright (C) Bob Aman
5
4
  #
6
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # coding: utf-8
4
3
  # Copyright (C) Bob Aman
5
4
  #
6
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # coding: utf-8
4
3
  # Copyright (C) Bob Aman
5
4
  #
6
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # coding: utf-8
4
3
  # Copyright (C) Bob Aman
5
4
  #
6
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -78,6 +77,15 @@ describe "==" do
78
77
  end
79
78
  end
80
79
 
80
+ describe "#to_regexp" do
81
+ it "does not match the first line of multiline strings" do
82
+ uri = "https://www.example.com/bar"
83
+ template = Addressable::Template.new(uri)
84
+ expect(template.match(uri)).not_to be_nil
85
+ expect(template.match("#{uri}\ngarbage")).to be_nil
86
+ end
87
+ end
88
+
81
89
  describe "Type conversion" do
82
90
  subject {
83
91
  {
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # coding: utf-8
4
3
  # Copyright (C) Bob Aman
5
4
  #
6
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -999,6 +998,72 @@ describe Addressable::URI, "when frozen" do
999
998
  end
1000
999
  end
1001
1000
 
1001
+ describe Addressable::URI, "when normalized and then deeply frozen" do
1002
+ before do
1003
+ @uri = Addressable::URI.parse(
1004
+ "http://user:password@example.com:8080/path?query=value#fragment"
1005
+ ).normalize!
1006
+
1007
+ @uri.instance_variables.each do |var|
1008
+ @uri.instance_variable_set(var, @uri.instance_variable_get(var).freeze)
1009
+ end
1010
+
1011
+ @uri.freeze
1012
+ end
1013
+
1014
+ it "#normalized_scheme should not error" do
1015
+ expect { @uri.normalized_scheme }.not_to raise_error
1016
+ end
1017
+
1018
+ it "#normalized_user should not error" do
1019
+ expect { @uri.normalized_user }.not_to raise_error
1020
+ end
1021
+
1022
+ it "#normalized_password should not error" do
1023
+ expect { @uri.normalized_password }.not_to raise_error
1024
+ end
1025
+
1026
+ it "#normalized_userinfo should not error" do
1027
+ expect { @uri.normalized_userinfo }.not_to raise_error
1028
+ end
1029
+
1030
+ it "#normalized_host should not error" do
1031
+ expect { @uri.normalized_host }.not_to raise_error
1032
+ end
1033
+
1034
+ it "#normalized_authority should not error" do
1035
+ expect { @uri.normalized_authority }.not_to raise_error
1036
+ end
1037
+
1038
+ it "#normalized_port should not error" do
1039
+ expect { @uri.normalized_port }.not_to raise_error
1040
+ end
1041
+
1042
+ it "#normalized_site should not error" do
1043
+ expect { @uri.normalized_site }.not_to raise_error
1044
+ end
1045
+
1046
+ it "#normalized_path should not error" do
1047
+ expect { @uri.normalized_path }.not_to raise_error
1048
+ end
1049
+
1050
+ it "#normalized_query should not error" do
1051
+ expect { @uri.normalized_query }.not_to raise_error
1052
+ end
1053
+
1054
+ it "#normalized_fragment should not error" do
1055
+ expect { @uri.normalized_fragment }.not_to raise_error
1056
+ end
1057
+
1058
+ it "should be frozen" do
1059
+ expect(@uri).to be_frozen
1060
+ end
1061
+
1062
+ it "should not allow destructive operations" do
1063
+ expect { @uri.normalize! }.to raise_error(RuntimeError)
1064
+ end
1065
+ end
1066
+
1002
1067
  describe Addressable::URI, "when created from string components" do
1003
1068
  before do
1004
1069
  @uri = Addressable::URI.new(
@@ -5993,6 +6058,11 @@ describe Addressable::URI, "when unencoding a multibyte string" do
5993
6058
  expect(Addressable::URI.unencode_component("ski=%BA%DAɫ")).to eq("ski=\xBA\xDAɫ")
5994
6059
  end
5995
6060
 
6061
+ it "should not fail with UTF-8 incompatible string" do
6062
+ url = "/M%E9/\xE9?p=\xFC".b
6063
+ expect(Addressable::URI.unencode_component(url)).to eq("/M\xE9/\xE9?p=\xFC")
6064
+ end
6065
+
5996
6066
  it "should result in correct percent encoded sequence as a URI" do
5997
6067
  expect(Addressable::URI.unencode(
5998
6068
  "/path?g%C3%BCnther", ::Addressable::URI
@@ -6663,3 +6733,13 @@ describe Addressable::URI, "when initializing a subclass of Addressable::URI" do
6663
6733
  expect(@uri.class).to eq(@uri.join('path').class)
6664
6734
  end
6665
6735
  end
6736
+
6737
+ describe Addressable::URI, "when initialized in a non-main `Ractor`" do
6738
+ it "should have the same value as if used in the main `Ractor`" do
6739
+ pending("Ruby 3.0+ for `Ractor` support") unless defined?(Ractor)
6740
+ main = Addressable::URI.parse("http://example.com")
6741
+ expect(
6742
+ Ractor.new { Addressable::URI.parse("http://example.com") }.take
6743
+ ).to eq(main)
6744
+ end
6745
+ end
@@ -19,9 +19,9 @@ namespace :gem do
19
19
  exit(1)
20
20
  end
21
21
 
22
- s.required_ruby_version = ">= 2.0"
22
+ s.required_ruby_version = ">= 2.2"
23
23
 
24
- s.add_runtime_dependency "public_suffix", ">= 2.0.2", "< 5.0"
24
+ s.add_runtime_dependency "public_suffix", ">= 2.0.2", "< 6.0"
25
25
  s.add_development_dependency "bundler", ">= 1.0", "< 3.0"
26
26
 
27
27
  s.require_path = "lib"
@@ -30,6 +30,9 @@ namespace :gem do
30
30
  s.email = "bob@sporkmonger.com"
31
31
  s.homepage = "https://github.com/sporkmonger/addressable"
32
32
  s.license = "Apache-2.0"
33
+ s.metadata = {
34
+ "changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md"
35
+ }
33
36
  end
34
37
 
35
38
  Gem::PackageTask.new(GEM_SPEC) do |p|
@@ -31,8 +31,8 @@ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
31
  vendorarchdir = $(vendorlibdir)/$(sitearch)
32
32
  vendorlibdir = $(vendordir)/$(ruby_version)
33
33
  vendordir = $(rubylibprefix)/vendor_ruby
34
- sitearchdir = $(DESTDIR)./.gem.20220808-1653-1t3tfl
35
- sitelibdir = $(DESTDIR)./.gem.20220808-1653-1t3tfl
34
+ sitearchdir = $(DESTDIR)./.gem.20220920-1751-qm4buv
35
+ sitelibdir = $(DESTDIR)./.gem.20220920-1751-qm4buv
36
36
  sitedir = $(rubylibprefix)/site_ruby
37
37
  rubyarchdir = $(rubylibdir)/$(arch)
38
38
  rubylibdir = $(rubylibprefix)/$(ruby_version)
@@ -138,7 +138,7 @@ LIBS = $(LIBRUBYARG_SHARED) -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc
138
138
  ORIG_SRCS = AbstractMemory.c ArrayType.c Buffer.c Call.c ClosurePool.c DynamicLibrary.c Function.c FunctionInfo.c LastError.c LongDouble.c MappedType.c MemoryPointer.c MethodHandle.c Platform.c Pointer.c Struct.c StructByValue.c StructLayout.c Thread.c Type.c Types.c Variadic.c ffi.c
139
139
  SRCS = $(ORIG_SRCS)
140
140
  OBJS = AbstractMemory.o ArrayType.o Buffer.o Call.o ClosurePool.o DynamicLibrary.o Function.o FunctionInfo.o LastError.o LongDouble.o MappedType.o MemoryPointer.o MethodHandle.o Platform.o Pointer.o Struct.o StructByValue.o StructLayout.o Thread.o Type.o Types.o Variadic.o ffi.o
141
- HDRS = $(srcdir)/compat.h $(srcdir)/Types.h $(srcdir)/MemoryPointer.h $(srcdir)/extconf.h $(srcdir)/Type.h $(srcdir)/Call.h $(srcdir)/ArrayType.h $(srcdir)/MappedType.h $(srcdir)/rbffi.h $(srcdir)/StructByValue.h $(srcdir)/LastError.h $(srcdir)/rbffi_endian.h $(srcdir)/AbstractMemory.h $(srcdir)/ClosurePool.h $(srcdir)/MethodHandle.h $(srcdir)/Struct.h $(srcdir)/DynamicLibrary.h $(srcdir)/Thread.h $(srcdir)/Pointer.h $(srcdir)/LongDouble.h $(srcdir)/Function.h $(srcdir)/Platform.h
141
+ HDRS = $(srcdir)/Struct.h $(srcdir)/DynamicLibrary.h $(srcdir)/MemoryPointer.h $(srcdir)/LongDouble.h $(srcdir)/Types.h $(srcdir)/ArrayType.h $(srcdir)/LastError.h $(srcdir)/ClosurePool.h $(srcdir)/compat.h $(srcdir)/rbffi.h $(srcdir)/rbffi_endian.h $(srcdir)/AbstractMemory.h $(srcdir)/Type.h $(srcdir)/Platform.h $(srcdir)/Thread.h $(srcdir)/StructByValue.h $(srcdir)/MethodHandle.h $(srcdir)/Pointer.h $(srcdir)/Call.h $(srcdir)/extconf.h $(srcdir)/Function.h $(srcdir)/MappedType.h
142
142
  LOCAL_HDRS =
143
143
  TARGET = ffi_c
144
144
  TARGET_NAME = ffi_c
@@ -31,8 +31,8 @@ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
31
  vendorarchdir = $(vendorlibdir)/$(sitearch)
32
32
  vendorlibdir = $(vendordir)/$(ruby_version)
33
33
  vendordir = $(rubylibprefix)/vendor_ruby
34
- sitearchdir = $(DESTDIR)./.gem.20220808-1653-xscx0w
35
- sitelibdir = $(DESTDIR)./.gem.20220808-1653-xscx0w
34
+ sitearchdir = $(DESTDIR)./.gem.20220920-1751-1koanh5
35
+ sitelibdir = $(DESTDIR)./.gem.20220920-1751-1koanh5
36
36
  sitedir = $(rubylibprefix)/site_ruby
37
37
  rubyarchdir = $(rubylibdir)/$(arch)
38
38
  rubylibdir = $(rubylibprefix)/$(ruby_version)
@@ -31,8 +31,8 @@ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
31
  vendorarchdir = $(vendorlibdir)/$(sitearch)
32
32
  vendorlibdir = $(vendordir)/$(ruby_version)
33
33
  vendordir = $(rubylibprefix)/vendor_ruby
34
- sitearchdir = $(DESTDIR)./.gem.20220808-1653-1fabmcc
35
- sitelibdir = $(DESTDIR)./.gem.20220808-1653-1fabmcc
34
+ sitearchdir = $(DESTDIR)./.gem.20220920-1751-t626ps
35
+ sitelibdir = $(DESTDIR)./.gem.20220920-1751-t626ps
36
36
  sitedir = $(rubylibprefix)/site_ruby
37
37
  rubyarchdir = $(rubylibdir)/$(arch)
38
38
  rubylibdir = $(rubylibprefix)/$(ruby_version)
@@ -31,8 +31,8 @@ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
31
  vendorarchdir = $(vendorlibdir)/$(sitearch)
32
32
  vendorlibdir = $(vendordir)/$(ruby_version)
33
33
  vendordir = $(rubylibprefix)/vendor_ruby
34
- sitearchdir = $(DESTDIR)./.gem.20220808-1653-13s46r2
35
- sitelibdir = $(DESTDIR)./.gem.20220808-1653-13s46r2
34
+ sitearchdir = $(DESTDIR)./.gem.20220920-1751-184tgs3
35
+ sitelibdir = $(DESTDIR)./.gem.20220920-1751-184tgs3
36
36
  sitedir = $(rubylibprefix)/site_ruby
37
37
  rubyarchdir = $(rubylibdir)/$(arch)
38
38
  rubylibdir = $(rubylibprefix)/$(ruby_version)