nutmeg 0.0.9 → 0.0.10
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 +4 -0
- data/lib/nutmeg/version.rb +1 -1
- data/spec/tag_tree_spec.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e34dc8d400048a8654846073af14fd44e0ceef
|
4
|
+
data.tar.gz: d438e2b3fa1788d226f141d799a44e2c0f8c672c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3939c6bebaf518d17b43e57b151105c287bf44df7e4a34405faf7bb7a5ee1946464a3432e7ae27b819c376bda2f2422cc4f9f698a6f8750921b7b62e6c290c91
|
7
|
+
data.tar.gz: f1979b7501fe1337573ecf78e748c2b67f606aa8ca608ee9240c6762a2a374d0567cff6b8681832aeb3f1e6d093bf9f9459aceb41b9b292144878e63af14a036
|
data/lib/nutmeg/tag_tree.rb
CHANGED
@@ -27,6 +27,10 @@ module Nutmeg
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
def get_paths_eager(tags_given)
|
31
|
+
@original.children.select{|l| tags_given.include?(l.content[:slug])}.collect{|leaf| ([leaf] + leaf.parentage).reverse }
|
32
|
+
end
|
33
|
+
|
30
34
|
def get_paths_formatted(tags_given, seperator = "/")
|
31
35
|
get_paths(tags_given).collect do |tags|
|
32
36
|
tags.reject{|tag| tag.content[:slug] == "root"}.map{|node| node.content[:slug]}.join(seperator)
|
data/lib/nutmeg/version.rb
CHANGED
data/spec/tag_tree_spec.rb
CHANGED
@@ -21,8 +21,10 @@ describe Nutmeg::TagTree do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
describe "#
|
25
|
-
|
24
|
+
describe "#get_paths_eager" do
|
25
|
+
it 'verifies output is similar' do
|
26
|
+
expect(@tag_tree.get_paths_eager(["base"]).first.first.class).to eq(@tag_tree.get_paths(["base", "child"]).first.first.class)
|
27
|
+
end
|
26
28
|
end
|
27
29
|
|
28
30
|
describe "#get_paths_formatted" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutmeg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis van der Vliet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubytree
|