nutmeg 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nutmeg/tag_tree.rb +2 -2
- data/lib/nutmeg/version.rb +1 -1
- data/spec/tag_tree_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64792747c20d528aad471a074795da5f4b0cb1e0
|
4
|
+
data.tar.gz: f2747248945f3bef7a1612ae021c5093a0d09fca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 619287a46f89bca279088a8d3bd6218c570796c252feb9b926affad11f93fa7d8e5b123a93642680fd8f4f8d8a998b0658f1d1fc83030fb4fc5a6c718813493c
|
7
|
+
data.tar.gz: b250abcb7edb60b1a71c6a2982f762c00a067213332cbd52c2344666c1828eca7f1410872259218081acd656454c12fa72957758a7d1797d9474c60d19bee66e
|
data/lib/nutmeg/tag_tree.rb
CHANGED
@@ -7,9 +7,9 @@ module Nutmeg
|
|
7
7
|
@original = tree
|
8
8
|
end
|
9
9
|
|
10
|
-
def subtree(
|
10
|
+
def subtree(slug)
|
11
11
|
@original.each do |node|
|
12
|
-
return Nutmeg::TagTree.new(node.detached_subtree_copy) if node.content[:
|
12
|
+
return Nutmeg::TagTree.new(node.detached_subtree_copy) if node.content[:slug] == slug
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
data/lib/nutmeg/version.rb
CHANGED
data/spec/tag_tree_spec.rb
CHANGED
@@ -15,9 +15,9 @@ describe Nutmeg::TagTree do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe "#subtree" do
|
18
|
-
it "returns a subtree starting at tag with
|
18
|
+
it "returns a subtree starting at tag with slug 'base'" do
|
19
19
|
expect(@tag_tree.original.size).to eq(3)
|
20
|
-
expect(@tag_tree.subtree(
|
20
|
+
expect(@tag_tree.subtree("base").original.size).to eq(2)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|