micromicro 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/micro_micro/helpers.rb +6 -0
- data/lib/micro_micro/item.rb +3 -1
- data/lib/micro_micro/version.rb +1 -1
- data/micromicro.gemspec +1 -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: d9c965d277e7c87c68de6ce7a12aff28da257d813573de2519bfe36943df1f4f
|
4
|
+
data.tar.gz: a62d02a8fe962b060c36a9c615445f586fe76ea1c570d71f05175d140d631d32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee19e4ca072c36137746dd54e435405a9a749761c9b735d75ff9f97a5c28f8e5367f79c3a7ad45c83039eb8cb54f1043cac2dd7ddcd1bfd2d4fbbad0d218ad6
|
7
|
+
data.tar.gz: f5f88370b3fc92e2d467c8e358798c6266b5fb9dbfe50fb13e74b2235572e9adfbfeb4f171b1df3d5bf474cc549bac7adfe3fa7c2a59b6830d2bacc3cab3d500
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.0.1 / 2022-08-20
|
4
|
+
|
5
|
+
- Use ruby/debug instead of pry-byebug (2965b2e)
|
6
|
+
- Update nokogiri-html-ext to v0.2.2 (921c486)
|
7
|
+
- Include root items with property class names (dd14212)
|
8
|
+
|
3
9
|
## 2.0.0 / 2022-08-12
|
4
10
|
|
5
11
|
- Refactor implied property parsers (203fec9)
|
data/lib/micro_micro/helpers.rb
CHANGED
@@ -31,6 +31,12 @@ module MicroMicro
|
|
31
31
|
root_class_names_from(node).any?
|
32
32
|
end
|
33
33
|
|
34
|
+
# @param nodes [Nokogiri::XML::NodeSet]
|
35
|
+
# @return [Boolean]
|
36
|
+
def self.item_nodes?(nodes)
|
37
|
+
nodes.filter_map { |node| item_node?(node) }.any?
|
38
|
+
end
|
39
|
+
|
34
40
|
# @param node [Nokogiri::XML::Element]
|
35
41
|
# @return [Array<String>]
|
36
42
|
def self.property_class_names_from(node)
|
data/lib/micro_micro/item.rb
CHANGED
@@ -17,12 +17,13 @@ module MicroMicro
|
|
17
17
|
# @param context [Nokogiri::XML::NodeSet, Nokogiri::XML::Element]
|
18
18
|
# @param node_set [Nokogiri::XML::NodeSet]
|
19
19
|
# @return [Nokogiri::XML::NodeSet]
|
20
|
+
# rubocop:disable Metrics
|
20
21
|
def self.node_set_from(context, node_set = Nokogiri::XML::NodeSet.new(context.document, []))
|
21
22
|
context.each { |node| node_set_from(node, node_set) } if context.is_a?(Nokogiri::XML::NodeSet)
|
22
23
|
|
23
24
|
if context.is_a?(Nokogiri::XML::Element) && !Helpers.ignore_node?(context)
|
24
25
|
if Helpers.item_node?(context)
|
25
|
-
node_set << context unless Helpers.property_node?(context)
|
26
|
+
node_set << context unless Helpers.item_nodes?(context.ancestors) && Helpers.property_node?(context)
|
26
27
|
else
|
27
28
|
node_set_from(context.element_children, node_set)
|
28
29
|
end
|
@@ -30,6 +31,7 @@ module MicroMicro
|
|
30
31
|
|
31
32
|
node_set
|
32
33
|
end
|
34
|
+
# rubocop:enable Metrics
|
33
35
|
|
34
36
|
# Parse a node for microformats2-encoded data.
|
35
37
|
#
|
data/lib/micro_micro/version.rb
CHANGED
data/micromicro.gemspec
CHANGED
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_runtime_dependency 'activesupport', '~> 7.0'
|
31
31
|
spec.add_runtime_dependency 'nokogiri', '>= 1.13'
|
32
|
-
spec.add_runtime_dependency 'nokogiri-html-ext', '~> 0.2.
|
32
|
+
spec.add_runtime_dependency 'nokogiri-html-ext', '~> 0.2.2'
|
33
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: micromicro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.2.
|
47
|
+
version: 0.2.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.2.
|
54
|
+
version: 0.2.2
|
55
55
|
description: Extract microformats2-encoded data from HTML documents.
|
56
56
|
email:
|
57
57
|
- jason@sixtwothree.org
|
@@ -93,7 +93,7 @@ licenses:
|
|
93
93
|
- MIT
|
94
94
|
metadata:
|
95
95
|
bug_tracker_uri: https://github.com/jgarber623/micromicro/issues
|
96
|
-
changelog_uri: https://github.com/jgarber623/micromicro/blob/v2.0.
|
96
|
+
changelog_uri: https://github.com/jgarber623/micromicro/blob/v2.0.1/CHANGELOG.md
|
97
97
|
rubygems_mfa_required: 'true'
|
98
98
|
post_install_message:
|
99
99
|
rdoc_options: []
|