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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5a48995ca11ced8e2a500ce801dd212aa5423b6
4
- data.tar.gz: 71622c3200cf5ca25eb53792093fa3d1e9bf7ddb
3
+ metadata.gz: 75e34dc8d400048a8654846073af14fd44e0ceef
4
+ data.tar.gz: d438e2b3fa1788d226f141d799a44e2c0f8c672c
5
5
  SHA512:
6
- metadata.gz: 02b1843cf8865dfacc6512770db05c2aa3124f5756a473ebbcb7a40e80ad80823e0a2511d370a36906b1fc52d56c24aefc1d7b528bafe207679856cf8bee034b
7
- data.tar.gz: bd08b2a0f9e09b1f6cc53f0852dfbf47abd1f7bda0553f51ae8097a1c9064e569c78fd430b0b7c12bcef341f627de02b2d88deb4b4c879b9f5f9c5a5d6f3e227
6
+ metadata.gz: 3939c6bebaf518d17b43e57b151105c287bf44df7e4a34405faf7bb7a5ee1946464a3432e7ae27b819c376bda2f2422cc4f9f698a6f8750921b7b62e6c290c91
7
+ data.tar.gz: f1979b7501fe1337573ecf78e748c2b67f606aa8ca608ee9240c6762a2a374d0567cff6b8681832aeb3f1e6d093bf9f9459aceb41b9b292144878e63af14a036
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Nutmeg
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -21,8 +21,10 @@ describe Nutmeg::TagTree do
21
21
  end
22
22
  end
23
23
 
24
- describe "#get_paths" do
25
- pending "Fix this"
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.9
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-09-25 00:00:00.000000000 Z
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubytree