starry 0.1.0 → 0.2.0

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: b104249aac02869f4536ddd816a828005419c76b7dfd14222ba781599d9ffc94
4
- data.tar.gz: a795783282e4123bc20a964e90c36cfa228d257b2fe8e25c0cb83970aa87d2df
3
+ metadata.gz: 7f92d79d80fbff68d10676bc6928f055dc9d3729069916ecf91b66d503f24e55
4
+ data.tar.gz: 400042d7d2720de3749091f340ef6e47a75733fe9240d71cd4903afd2ce58047
5
5
  SHA512:
6
- metadata.gz: 6502b2202ae627ebd6bdbb2a4590ff8c4fac70fcc8373a8d44d214617132dcab7e5a2e2ec7b3792503f4e3379f1d6ae489d80c545936d1c58ff3b438c23f62b2
7
- data.tar.gz: 02ddf59cef3d6399c5deabf6c438b18685936727ed3cac0be5671cece355559d9620b246cb6fd1d757a0d7dbb2ba1af7a704c78325e8313945a08056df0d94b0
6
+ metadata.gz: d51d2264e9cd5af525f64a6bef2842fa6f599b2a9efab23317e84bd45632057a4a873ee1d4ab8f5f8cf74f46955e94dad9e5795cd18b9f390b660f5d23c2ee65
7
+ data.tar.gz: fd801d6a9a51c2d6ede8f7ecf30a7b995a4950c38cec9a04363c153fe9c682524675d9d8a99be93404052c73de0a87f157691d88fab3140f1aa17e7282ca2c10
@@ -23,4 +23,10 @@ class Starry::InnerList
23
23
  end
24
24
  "(#{ members.join(' ') })#{ Starry.serialize_parameters(parameters) }"
25
25
  end
26
+
27
+ alias deconstruct to_a
28
+
29
+ def deconstruct_keys(keys)
30
+ { value: @value, parameters: @parameters }
31
+ end
26
32
  end
data/lib/starry/item.rb CHANGED
@@ -14,4 +14,8 @@ class Starry::Item
14
14
  def to_s
15
15
  "#{ Starry.serialize_bare_item(value) }#{ Starry.serialize_parameters(parameters) }"
16
16
  end
17
+
18
+ def deconstruct_keys(keys)
19
+ { value: @value, parameters: @parameters }
20
+ end
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module Starry
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/starry.rb CHANGED
@@ -121,19 +121,19 @@ module Starry
121
121
  end
122
122
  end
123
123
 
124
- def parse_list(input)
124
+ def parse_list(input, symbolize_names: false)
125
125
  ensure_ascii_only(input)
126
- Parser.new(input).parse(:list)
126
+ Parser.new(input, symbolize_names: symbolize_names).parse(:list)
127
127
  end
128
128
 
129
- def parse_dictionary(input)
129
+ def parse_dictionary(input, symbolize_names: false)
130
130
  ensure_ascii_only(input)
131
- Parser.new(input).parse(:dictionary)
131
+ Parser.new(input, symbolize_names: symbolize_names).parse(:dictionary)
132
132
  end
133
133
 
134
- def parse_item(input)
134
+ def parse_item(input, symbolize_names: false)
135
135
  ensure_ascii_only(input)
136
- Parser.new(input).parse(:item)
136
+ Parser.new(input, symbolize_names: symbolize_names).parse(:item)
137
137
  end
138
138
 
139
139
  private def ensure_ascii_only(input)
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takemaro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-07 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description:
14
28
  email: info@takemaro.com
15
29
  executables: []
@@ -27,7 +41,7 @@ licenses:
27
41
  metadata:
28
42
  bug_tracker_uri: https://github.com/takemar/starry/issues
29
43
  homepage_uri: https://github.com/takemar/starry
30
- source_code_uri: https://github.com/takemar/starry/issues
44
+ source_code_uri: https://github.com/takemar/starry
31
45
  post_install_message:
32
46
  rdoc_options: []
33
47
  require_paths:
@@ -43,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
57
  - !ruby/object:Gem::Version
44
58
  version: '0'
45
59
  requirements: []
46
- rubygems_version: 3.4.10
60
+ rubygems_version: 3.5.3
47
61
  signing_key:
48
62
  specification_version: 4
49
63
  summary: An implementation of HTTP Structured Field Values (RFC 8941)