golf 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/golf/compiler.rb +4 -4
- data/lib/golf/version.rb +1 -1
- metadata +2 -2
data/lib/golf/compiler.rb
CHANGED
@@ -22,13 +22,13 @@ module Golf
|
|
22
22
|
def res_json(dir = @golfpath)
|
23
23
|
results = {}
|
24
24
|
mypath = dir.split('').last == "/" ? dir : dir+"/"
|
25
|
+
myroot = @golfpath.split('').last == "/" ? @golfpath : @golfpath+"/"
|
25
26
|
Find.find(mypath) do |path|
|
26
|
-
|
27
|
-
|
27
|
+
e = path.slice(mypath.length, path.length-mypath.length)
|
28
|
+
r = path.slice(myroot.length, path.length-myroot.length)
|
28
29
|
f = URI.escape(e)
|
29
30
|
g = File.basename(e)
|
30
|
-
|
31
|
-
h = File.dirname(e) == "." ? [] : File.dirname(e).split("/")
|
31
|
+
h = File.dirname(r) == "." ? [] : File.dirname(r).split("/")
|
32
32
|
if FileTest.directory?(path)
|
33
33
|
next
|
34
34
|
else
|
data/lib/golf/version.rb
CHANGED