nutmeg 0.0.4 → 0.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
  SHA1:
3
- metadata.gz: 64792747c20d528aad471a074795da5f4b0cb1e0
4
- data.tar.gz: f2747248945f3bef7a1612ae021c5093a0d09fca
3
+ metadata.gz: 123b62c1b70f93ad02f00b754a735d2cab3e9e74
4
+ data.tar.gz: 7f189ebe9a2a44b3634b16b5874b7387c2466ed2
5
5
  SHA512:
6
- metadata.gz: 619287a46f89bca279088a8d3bd6218c570796c252feb9b926affad11f93fa7d8e5b123a93642680fd8f4f8d8a998b0658f1d1fc83030fb4fc5a6c718813493c
7
- data.tar.gz: b250abcb7edb60b1a71c6a2982f762c00a067213332cbd52c2344666c1828eca7f1410872259218081acd656454c12fa72957758a7d1797d9474c60d19bee66e
6
+ metadata.gz: 489de4a4be48f792cee9a68efdacb700bbd86c808a8d8eb6b8b22fabcdcec068aead0d045ebe1e462d67873c94f7853c1e1aadeb18f051886ed25032b83dac4f
7
+ data.tar.gz: f8d6f1f8845d61d8308446eb977a203f27870bc8fe4a26af16958ecd8c26636c91c071b808a251f8c131f8dbfc9756085efb52ce75359b3d6a2da5714ae3713c
@@ -47,9 +47,7 @@ module Nutmeg
47
47
  end
48
48
 
49
49
  def traverse_node?(node, tags_given)
50
- return true if node.is_root?
51
- return true if node.level == 1
52
- (node.parentage.select{|n| n.level == 1}.map{|n| n.content[:slug]} & tags_given).count >= 1
50
+ true
53
51
  end
54
52
  end
55
53
  end
@@ -1,3 +1,3 @@
1
1
  module Nutmeg
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -9,7 +9,14 @@ describe Nutmeg::TagTreeHelper do
9
9
  describe "#print_html" do
10
10
  it "outputs html" do
11
11
  expect(Nutmeg::TagTreeHelper.new(@tree_from_yaml.tree).print_html([1]).class).to eq(String)
12
- expect(Nutmeg::TagTreeHelper.new(@tree_from_yaml.tree).print_html(["north", "men", "collections", "summer_2015"])).to eq("<ul><li class='level_1 active'> <a >north</a><ul><li class='level_2 active'> <a >men</a><ul><li class='level_3 active'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/men/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/men/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf active'> <a href='/north/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >women</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/women/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >events</a><ul><li class='level_3 leaf'> <a href='/north/events/lowlands_2014'>lowlands_2014</a></li><li class='level_3 leaf'> <a href='/north/events/sinterklaas_2014'>sinterklaas_2014</a></li></ul></li><li class='level_2'> <a >collaborations</a><ul><li class='level_3 leaf'> <a href='/north/collaborations/afro_jack'>afro_jack</a></li><li class='level_3 leaf'> <a href='/north/collaborations/pr_co'>pr_co</a></li></ul></li></ul></li><li class='level_1'> <a >south</a><ul></li></li></ul></li></ul>")
12
+ expect(Nutmeg::TagTreeHelper.new(@tree_from_yaml.tree).print_html(["north", "men", "collections", "summer_2015"])).to eq("<ul><li class='level_1 active'> <a >north</a><ul><li class='level_2 active'> <a >men</a><ul><li class='level_3 active'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/men/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/men/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf active'> <a href='/north/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >women</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/women/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >events</a><ul><li class='level_3 leaf'> <a href='/north/events/lowlands_2014'>lowlands_2014</a></li><li class='level_3 leaf'> <a href='/north/events/sinterklaas_2014'>sinterklaas_2014</a></li></ul></li><li class='level_2'> <a >collaborations</a><ul><li class='level_3 leaf'> <a href='/north/collaborations/afro_jack'>afro_jack</a></li><li class='level_3 leaf'> <a href='/north/collaborations/pr_co'>pr_co</a></li></ul></li></ul></li><li class='level_1'> <a >south</a><ul><li class='level_2'> <a >men</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/south/men/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/south/men/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/south/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >women</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/south/women/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/south/women/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/south/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li></ul></li></ul>")
13
13
  end
14
+
15
+ it "outputs html for subtree" do
16
+ subtree = @tree_from_yaml.tree.subtree("north")
17
+ expect(Nutmeg::TagTreeHelper.new(subtree).print_html(["men", "collections", "summer_2015"])).to eq("<ul><li class='level_1 active'> <a >men</a><ul><li class='level_2 active'> <a >collections</a><ul><li class='level_3 leaf'> <a href='/north/men/collections/winter_2015'>winter_2015</a></li><li class='level_3 leaf'> <a href='/north/men/collections/spring_2015'>spring_2015</a></li><li class='level_3 leaf active'> <a href='/north/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_1'> <a >women</a><ul><li class='level_2'> <a >collections</a><ul><li class='level_3 leaf'> <a href='/north/women/collections/winter_2015'>winter_2015</a></li><li class='level_3 leaf'> <a href='/north/women/collections/spring_2015'>spring_2015</a></li><li class='level_3 leaf'> <a href='/north/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_1'> <a >events</a><ul><li class='level_2 leaf'> <a href='/north/events/lowlands_2014'>lowlands_2014</a></li><li class='level_2 leaf'> <a href='/north/events/sinterklaas_2014'>sinterklaas_2014</a></li></ul></li><li class='level_1'> <a >collaborations</a><ul><li class='level_2 leaf'> <a href='/north/collaborations/afro_jack'>afro_jack</a></li><li class='level_2 leaf'> <a href='/north/collaborations/pr_co'>pr_co</a></li></ul></li></ul>")
18
+ end
19
+
20
+
14
21
  end
15
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutmeg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis van der Vliet