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 +4 -4
- data/README.md +3 -3
- data/burly.gemspec +1 -1
- data/lib/burly/parsers/json_parser.rb +8 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ee29f60f553f2beda4f2904c9451620e3f51629b3ca3a0f32889ac07e9623be
|
|
4
|
+
data.tar.gz: 1711b71044722dfc61876645ba51c6e66fe65817e59927ce02a3d26e9f1a5ecc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f4d6527105e193e904fcfb027b0399971a968db52b7ef974f273d1056b8f06a2a343eb6cb0ed10ce3cf577c124f1fdb35975c1e6b9f607c86286470052606800
|
|
7
|
+
data.tar.gz: a6acfe754967fcd61635c7fc8d7d10950d5d4a951d092ca556156fe3d3e21e8477cf2431f3f76d7bbf1226c3c50b2217a96a67a3a22e8b01ec15fc9b15221278
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Burly
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Ruby gem for extracting URLs from HTML, JSON, and plaintext documents.
|
|
4
4
|
|
|
5
5
|
[](https://rubygems.org/gems/burly)
|
|
6
6
|
[](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
|
-
|
|
77
|
+
This project is freely available under the [MIT License](https://opensource.org/license/MIT).
|
data/burly.gemspec
CHANGED
|
@@ -20,7 +20,14 @@ module Burly
|
|
|
20
20
|
|
|
21
21
|
def recursive_parse(*objs)
|
|
22
22
|
objs.flat_map do |obj|
|
|
23
|
-
|
|
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.
|
|
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.
|
|
48
|
-
documentation_uri: https://rubydoc.info/gems/burly/0.3.
|
|
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.
|
|
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:
|
|
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: []
|