net-http-structured_field_values 0.2.0 → 0.3.1

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: 122e225e84821c215dc9ac1e74a217c1478bcf7aadf6880ba92a4c226a16d411
4
- data.tar.gz: f9e64b774db64f27008fc7e4878195658c3fa0463f45d72cc7f7890325bd9384
3
+ metadata.gz: 0f6293fee0686fc5dbdc5e66e53afca76ddaae8394d5260efae7099f043037aa
4
+ data.tar.gz: c6939923111374117dca4db5ba9261b3a8cbfa96129653fb20a6e228f9ff2155
5
5
  SHA512:
6
- metadata.gz: 741f761276f8ac92908bfc476c2d5b2af034fb9dd379cbfdabf3ac11f04057ba2d10d788571d2f9ca636d3de9d1a139ac6fab42b3d51baa2996868a2d43a8b55
7
- data.tar.gz: eb29e89936608cb9a121367a94ea43351fff2d120cfc741c40be18831e8c11bfb63c4de3a02a88437c21e92286fd97717ed0713206ba2e86745a6bf127c6e993
6
+ metadata.gz: d3899f1e3e404834817745dc80a83df7fa48077e86f0330e46556d03e713e74e1f9552ae5e06501dbbaedb66e6bb09f6ed84b9087f63688a1aed43b91046dd12
7
+ data.tar.gz: f627eeef3f9696e0f9bffb231f2d62c12bca5d5d17c12dfe1c2723e74aec667810cad165d83a1233b8404a2b9041f7c130b8972fcaa20b2483c114ee48559312
@@ -28,7 +28,7 @@ jobs:
28
28
  run: bundle exec rspec
29
29
 
30
30
  - name: Upload coverage report
31
- uses: codecov/codecov-action@v3
31
+ uses: codecov/codecov-action@v5
32
32
 
33
33
  rubocop:
34
34
  runs-on: ubuntu-latest
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.4.1
data/Gemfile CHANGED
@@ -14,7 +14,7 @@ group :development, :test do
14
14
  gem 'rubocop', '~> 1.56'
15
15
  gem 'rubocop-performance', '~> 1.19'
16
16
  gem 'rubocop-rake', '~> 0.4'
17
- gem 'rubocop-rspec', '~> 2.1'
17
+ gem 'rubocop-rspec', '~> 3.0'
18
18
  end
19
19
 
20
20
  group :test do
data/Gemfile.lock CHANGED
@@ -1,66 +1,60 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- net-http-structured_field_values (0.2.0)
4
+ net-http-structured_field_values (0.3.1)
5
+ base64 (~> 0.2.0)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
10
  ast (2.4.2)
10
- base64 (0.1.1)
11
- diff-lcs (1.5.0)
11
+ base64 (0.2.0)
12
+ diff-lcs (1.5.1)
12
13
  docile (1.4.0)
13
- json (2.6.3)
14
+ json (2.9.0)
14
15
  language_server-protocol (3.17.0.3)
15
- parallel (1.23.0)
16
- parser (3.2.2.3)
16
+ parallel (1.26.3)
17
+ parser (3.3.6.0)
17
18
  ast (~> 2.4.1)
18
19
  racc
19
- racc (1.7.1)
20
+ racc (1.8.1)
20
21
  rainbow (3.1.1)
21
- rake (13.0.6)
22
- regexp_parser (2.8.1)
23
- rexml (3.2.6)
24
- rspec (3.12.0)
25
- rspec-core (~> 3.12.0)
26
- rspec-expectations (~> 3.12.0)
27
- rspec-mocks (~> 3.12.0)
28
- rspec-core (3.12.2)
29
- rspec-support (~> 3.12.0)
30
- rspec-expectations (3.12.3)
22
+ rake (13.2.1)
23
+ regexp_parser (2.9.3)
24
+ rexml (3.3.6)
25
+ strscan
26
+ rspec (3.13.0)
27
+ rspec-core (~> 3.13.0)
28
+ rspec-expectations (~> 3.13.0)
29
+ rspec-mocks (~> 3.13.0)
30
+ rspec-core (3.13.0)
31
+ rspec-support (~> 3.13.0)
32
+ rspec-expectations (3.13.0)
31
33
  diff-lcs (>= 1.2.0, < 2.0)
32
- rspec-support (~> 3.12.0)
33
- rspec-mocks (3.12.6)
34
+ rspec-support (~> 3.13.0)
35
+ rspec-mocks (3.13.0)
34
36
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.12.0)
36
- rspec-support (3.12.1)
37
- rubocop (1.56.4)
38
- base64 (~> 0.1.1)
37
+ rspec-support (~> 3.13.0)
38
+ rspec-support (3.13.0)
39
+ rubocop (1.69.2)
39
40
  json (~> 2.3)
40
41
  language_server-protocol (>= 3.17.0)
41
42
  parallel (~> 1.10)
42
- parser (>= 3.2.2.3)
43
+ parser (>= 3.3.0.2)
43
44
  rainbow (>= 2.2.2, < 4.0)
44
- regexp_parser (>= 1.8, < 3.0)
45
- rexml (>= 3.2.5, < 4.0)
46
- rubocop-ast (>= 1.28.1, < 2.0)
45
+ regexp_parser (>= 2.9.3, < 3.0)
46
+ rubocop-ast (>= 1.36.2, < 2.0)
47
47
  ruby-progressbar (~> 1.7)
48
- unicode-display_width (>= 2.4.0, < 3.0)
49
- rubocop-ast (1.29.0)
50
- parser (>= 3.2.1.0)
51
- rubocop-capybara (2.18.0)
52
- rubocop (~> 1.41)
53
- rubocop-factory_bot (2.23.1)
54
- rubocop (~> 1.33)
55
- rubocop-performance (1.19.1)
56
- rubocop (>= 1.7.0, < 2.0)
57
- rubocop-ast (>= 0.4.0)
48
+ unicode-display_width (>= 2.4.0, < 4.0)
49
+ rubocop-ast (1.36.2)
50
+ parser (>= 3.3.1.0)
51
+ rubocop-performance (1.23.0)
52
+ rubocop (>= 1.48.1, < 2.0)
53
+ rubocop-ast (>= 1.31.1, < 2.0)
58
54
  rubocop-rake (0.6.0)
59
55
  rubocop (~> 1.0)
60
- rubocop-rspec (2.24.0)
61
- rubocop (~> 1.33)
62
- rubocop-capybara (~> 2.17)
63
- rubocop-factory_bot (~> 2.22)
56
+ rubocop-rspec (3.3.0)
57
+ rubocop (~> 1.61)
64
58
  ruby-progressbar (1.13.0)
65
59
  simplecov (0.22.0)
66
60
  docile (~> 1.1)
@@ -71,7 +65,8 @@ GEM
71
65
  simplecov (~> 0.19)
72
66
  simplecov-html (0.12.3)
73
67
  simplecov_json_formatter (0.1.4)
74
- unicode-display_width (2.4.2)
68
+ strscan (3.1.0)
69
+ unicode-display_width (2.6.0)
75
70
 
76
71
  PLATFORMS
77
72
  ruby
@@ -84,7 +79,7 @@ DEPENDENCIES
84
79
  rubocop (~> 1.56)
85
80
  rubocop-performance (~> 1.19)
86
81
  rubocop-rake (~> 0.4)
87
- rubocop-rspec (~> 2.1)
82
+ rubocop-rspec (~> 3.0)
88
83
  simplecov (~> 0.22)
89
84
  simplecov-cobertura (~> 2.1)
90
85
 
@@ -35,14 +35,14 @@ module Net
35
35
  def parse_as(type)
36
36
  raise ArgumentError, "Invalid type: #{type}" unless TOP_LEVEL_TYPES.include?(type)
37
37
 
38
- send("parse_as_#{type}").tap do
38
+ send(:"parse_as_#{type}").tap do
39
39
  remove_leading_spaces
40
40
  raise ParseError, 'Unexpected input' unless scanner.eos?
41
41
  end
42
42
  end
43
43
 
44
44
  TOP_LEVEL_TYPES.each do |type|
45
- define_singleton_method("parse_as_#{type}") do |input|
45
+ define_singleton_method(:"parse_as_#{type}") do |input|
46
46
  new(input).parse_as(type)
47
47
  end
48
48
  end
@@ -28,11 +28,38 @@ module Net
28
28
  result.encode(Encoding::ASCII)
29
29
  end
30
30
 
31
+ # Serializes given object.
32
+ #
33
+ # @see {https://www.rfc-editor.org/rfc/rfc8941#section-4.1}
34
+ #
35
+ # @param [Array, Hash, ParameterizedValue, Integer, Float, String, Symbol, Boolean] obj object to be serialized
31
36
  # @return [String]
32
37
  def self.serialize(obj)
33
38
  new.serialize(obj)
34
39
  end
35
40
 
41
+ # Serializes input as Inner List.
42
+ #
43
+ # @note Use of this method breaks RFC8941.
44
+ #
45
+ # @param [Array, ParameterizedValue] input object to be serialized
46
+ # @return [String] serialized output
47
+ def serialize_as_inner_list(input)
48
+ arr, params = unpack_parameterized_value(input)
49
+ serialize_inner_list(arr, params)
50
+ result.encode(Encoding::ASCII)
51
+ end
52
+
53
+ # Serializes input as Inner List.
54
+ #
55
+ # @note Use of this method breaks RFC8941.
56
+ #
57
+ # @param [Array, ParameterizedValue] input object to be serialized
58
+ # @return [String] serialized output
59
+ def self.serialize_as_inner_list(input)
60
+ new.serialize_as_inner_list(input)
61
+ end
62
+
36
63
  private
37
64
 
38
65
  attr_reader :result
@@ -5,7 +5,7 @@ require 'net/http'
5
5
  module Net
6
6
  class HTTP
7
7
  module StructuredFieldValues
8
- VERSION = '0.2.0'
8
+ VERSION = '0.3.1'
9
9
  end
10
10
  end
11
11
  end
@@ -36,5 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
37
  spec.require_paths = ['lib']
38
38
 
39
- spec.required_ruby_version = '>= 3.2'
39
+ spec.required_ruby_version = '>= 3.3'
40
+
41
+ spec.add_dependency 'base64', '~> 0.2.0'
40
42
  end
data/renovate.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
3
  "extends": [
4
- "config:base"
4
+ "config:recommended"
5
5
  ]
6
6
  }
metadata CHANGED
@@ -1,16 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-http-structured_field_values
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyori19
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-10-08 00:00:00.000000000 Z
12
- dependencies: []
13
- description:
10
+ date: 2024-12-27 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: 0.2.0
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: 0.2.0
14
26
  email:
15
27
  - kyori@accelf.net
16
28
  executables: []
@@ -47,7 +59,6 @@ metadata:
47
59
  rubygems_mfa_required: 'true'
48
60
  homepage_uri: https://github.com/kyori19/net-http-structured_field_values
49
61
  source_code_uri: https://github.com/kyori19/net-http-structured_field_values
50
- post_install_message:
51
62
  rdoc_options: []
52
63
  require_paths:
53
64
  - lib
@@ -55,15 +66,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
55
66
  requirements:
56
67
  - - ">="
57
68
  - !ruby/object:Gem::Version
58
- version: '3.2'
69
+ version: '3.3'
59
70
  required_rubygems_version: !ruby/object:Gem::Requirement
60
71
  requirements:
61
72
  - - ">="
62
73
  - !ruby/object:Gem::Version
63
74
  version: '0'
64
75
  requirements: []
65
- rubygems_version: 3.4.10
66
- signing_key:
76
+ rubygems_version: 3.6.2
67
77
  specification_version: 4
68
78
  summary: A Ruby implementation of RFC 8941 - Structured Field Values for HTTP
69
79
  test_files: []