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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3037dad18fbd29d5487d985c388e288a8a09beab3f075488696ece006855f64
4
- data.tar.gz: e0426d2ab7f6bfb762ff856f4bfb3afcca7af1c499ddedefdbfd9111c41c26eb
3
+ metadata.gz: d9c965d277e7c87c68de6ce7a12aff28da257d813573de2519bfe36943df1f4f
4
+ data.tar.gz: a62d02a8fe962b060c36a9c615445f586fe76ea1c570d71f05175d140d631d32
5
5
  SHA512:
6
- metadata.gz: 8024a4c6de518aab23991e056554ea97d4a21c06b3ba27e38362840be82b5021bebe618d82698903d1e2ce7a5b49d22b131f8cfb7d460074198a89cef9873476
7
- data.tar.gz: 6137ab273b1418e2e5f063eda6ef35f1b3bdec5841272e73ef3a9ac25c8e7995ac09aa2495c5f0ad9e88726e88c8fdba97ac50d8d5bdc0e16d271a00c5a42597
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)
@@ -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)
@@ -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
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MicroMicro
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
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.0'
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.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-12 00:00:00.000000000 Z
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.0
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.0
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.0/CHANGELOG.md
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: []