burly 0.3.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: 298e3e0443003780775f640174bbdfff24bcc8eec0aa46a73f7be42451ca25af
4
- data.tar.gz: 2caf8f8c2b51aaaa37209133ac2c74c27f3a92fa2f845ba2bb2c1134d91a8d12
3
+ metadata.gz: 4ee29f60f553f2beda4f2904c9451620e3f51629b3ca3a0f32889ac07e9623be
4
+ data.tar.gz: 1711b71044722dfc61876645ba51c6e66fe65817e59927ce02a3d26e9f1a5ecc
5
5
  SHA512:
6
- metadata.gz: 9568d9b9200cb1ff5930df559c6128450c9eb952d29611c4dfb12476166f1e27bdc2be2d3cb88e814e57f29fc074b261842cdf0f4157ac7f05b103d6c04b30f2
7
- data.tar.gz: c9cde32949748f17cb84273144cf3e1b84c90630bb4f888a0c1ded81e3e2b75fe9fdfcc61f081255341a09ee8e999c4119e20623e499026a299aff219e69bb01
6
+ metadata.gz: f4d6527105e193e904fcfb027b0399971a968db52b7ef974f273d1056b8f06a2a343eb6cb0ed10ce3cf577c124f1fdb35975c1e6b9f607c86286470052606800
7
+ data.tar.gz: a6acfe754967fcd61635c7fc8d7d10950d5d4a951d092ca556156fe3d3e21e8477cf2431f3f76d7bbf1226c3c50b2217a96a67a3a22e8b01ec15fc9b15221278
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Burly
2
2
 
3
- **A Ruby gem for extracting URLs from HTML, JSON, and plaintext documents.**
3
+ A Ruby gem for extracting URLs from HTML, JSON, and plaintext documents.
4
4
 
5
5
  [![Gem](https://img.shields.io/gem/v/burly.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/burly)
6
6
  [![Downloads](https://img.shields.io/gem/dt/burly.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/burly)
@@ -48,7 +48,7 @@ In all cases, neither order nor uniqueness is guaranteed. You may also consider
48
48
 
49
49
  ## Parser Options
50
50
 
51
- Burly's HTML parser supports a single option, `context`, which accepts either a String or an Array of Strings. The values may be either CSS or XPath selectors
51
+ Burly's HTML parser supports a single option, `context`, which accepts either a String or an Array of Strings. The values may be either CSS or XPath selectors.
52
52
 
53
53
  ```ruby
54
54
  Burly.parse(File.read("example.html"), context: "main", mime_type: "text/html")
@@ -74,4 +74,4 @@ In all cases, Burly will search for nodes matching the provided selector(s) and
74
74
 
75
75
  ## License
76
76
 
77
- Burly is freely available under the [MIT License](https://opensource.org/license/MIT).
77
+ This project is freely available under the [MIT License](https://opensource.org/license/MIT).
data/burly.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
4
4
  spec.required_ruby_version = ">= 2.6"
5
5
 
6
6
  spec.name = "burly"
7
- spec.version = "0.3.0"
7
+ spec.version = "0.3.1"
8
8
  spec.authors = ["Jason Garber"]
9
9
  spec.email = ["jason@sixtwothree.org"]
10
10
 
@@ -20,7 +20,14 @@ module Burly
20
20
 
21
21
  def recursive_parse(*objs)
22
22
  objs.flat_map do |obj|
23
- return obj.flat_map { |value| recursive_parse(value) }.compact if obj.is_a?(Array)
23
+ if obj.is_a?(Array)
24
+ obj.map! { |value| recursive_parse(value) }
25
+ obj.flatten!
26
+ obj.compact!
27
+
28
+ return obj
29
+ end
30
+
24
31
  return recursive_parse(obj.values) if obj.is_a?(Hash)
25
32
 
26
33
  obj if obj.is_a?(String) && obj.match?(URI_REGEXP)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Garber
@@ -44,11 +44,11 @@ licenses:
44
44
  - MIT
45
45
  metadata:
46
46
  bug_tracker_uri: https://codeberg.org/jgarber/burly/issues
47
- changelog_uri: https://codeberg.org/jgarber/burly/releases/tag/v0.3.0
48
- documentation_uri: https://rubydoc.info/gems/burly/0.3.0
47
+ changelog_uri: https://codeberg.org/jgarber/burly/releases/tag/v0.3.1
48
+ documentation_uri: https://rubydoc.info/gems/burly/0.3.1
49
49
  homepage_uri: https://codeberg.org/jgarber/burly
50
50
  rubygems_mfa_required: 'true'
51
- source_code_uri: https://codeberg.org/jgarber/burly/src/tag/v0.3.0
51
+ source_code_uri: https://codeberg.org/jgarber/burly/src/tag/v0.3.1
52
52
  rdoc_options: []
53
53
  require_paths:
54
54
  - lib
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.6.8
66
+ rubygems_version: 4.0.20
67
67
  specification_version: 4
68
68
  summary: Extract URLs from HTML, JSON, and plaintext documents.
69
69
  test_files: []