stream_parser 0.3 → 0.5

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: 3cc1101615985f944d1a8f88cd37509d985860be8950fed026bd75399184ce2d
4
- data.tar.gz: c5088acc9378bb08a988a4d53c6fc3d9ec0d92ddfb20a4484a8c5b83e5ce6031
3
+ metadata.gz: 8dabaf4b8b64deb8ab440c5e95ebd53074e146499dbb891fc93dc98206f4c271
4
+ data.tar.gz: e830ad1b54a20338fad235a132f1e429d4c203a39c60545ea10a3a8a8289ee84
5
5
  SHA512:
6
- metadata.gz: 8519f3bbcd0dc82e16fb52d366f893fc2465720ac626aa7822604a294c55baed11567bf62ae4b2f6971de0df8f67c2b5722413f1fdd8a86466b894810ef105ec
7
- data.tar.gz: 7c5888f18e4dd6f65d86d117826294bfa4d3aac80a9c14c529764ac93243beb06fbef751107374818b5497fd9e571cfeab5f585c4012cf6763b440d5d23c8885
6
+ metadata.gz: 5acc2c1a6df0587ffd3c823c59aa142c548e0dd8a08eeffe340d490f81d9531d8fb6e9026a2f5a36d7151842da3f1445ca86faadf17efaaae6be5e7f268c99cd
7
+ data.tar.gz: fbd36a2f97c19534fea348e86ac8bc29b433be4209c3d30c627ac6eba753c2b2342135d51a2cdb70b56a1e3f8e7f4596855c10500db89c29ce95fc46c56dbb0b
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class StreamParser::HTML::Tag
2
4
  attr_reader :name, :attributes
3
5
  attr_writer :self_closing
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module StreamParser::HTML
2
4
 
3
5
  autoload :Tag, File.expand_path('../html/tag', __FILE__)
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ class StreamParser::SyntaxError < StandardError; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module StreamParser
2
- VERSION = '0.3'
4
+ VERSION = '0.5'
3
5
  end
data/lib/stream_parser.rb CHANGED
@@ -1,6 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module StreamParser
2
4
 
3
- autoload :HTML, File.expand_path('../stream_parser/html', __FILE__)
5
+ autoload :HTML, 'stream_parser/html'
6
+ autoload :SyntaxError, 'stream_parser/syntax_error'
4
7
 
5
8
  def self.included(base)
6
9
  base.extend ClassMethods
@@ -125,10 +128,10 @@ module StreamParser
125
128
  end
126
129
 
127
130
  def quoted_value(quote_char = '"', escape_chars = ["\\"])
128
- ret_value = ""
131
+ ret_value = String.new
129
132
  while scan_until(/(#{quote_char}|\Z)/)
130
133
  if match != quote_char
131
- raise Net::HTTPHeaderSyntaxError.new("Invalid Set-Cookie header format: unbalanced quotes (#{quote_char})")
134
+ raise StreamParser::SyntaxError.new("Unbalanced quotes #{quote_char}")
132
135
  elsif !escape_chars.include?(pre_match[-1])
133
136
  ret_value << pre_match
134
137
  return ret_value
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-09 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -120,6 +120,7 @@ files:
120
120
  - lib/stream_parser.rb
121
121
  - lib/stream_parser/html.rb
122
122
  - lib/stream_parser/html/tag.rb
123
+ - lib/stream_parser/syntax_error.rb
123
124
  - lib/stream_parser/version.rb
124
125
  homepage: https://github.com/malomalo/stream_parser
125
126
  licenses:
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubygems_version: 3.4.13
146
+ rubygems_version: 3.5.21
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: SAX/Stream style parse helpers