atk_toolbox 0.0.85 → 0.0.86
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atk/file_sys.rb +4 -2
- data/lib/atk/yaml_info_parser.rb +22 -1
- data/lib/atk_toolbox/version.rb +1 -1
- data/test/info.yaml +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3353cee7d23d6626dfa308edfccc97753ace097385bb6ed2c164e96cd2be2a12
|
4
|
+
data.tar.gz: 4f7237049096f3e52c1e6037e3f53cdd94130052faaffd82c6e354bb4a3f7f82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03dcebb02f6d27ee1e54b1a05ae14ae916d3fcc3b32be85887004e3f1e881956eed4cead3d9078807fa0fef084927290fd33db08d726a3b4ac648f450995c695
|
7
|
+
data.tar.gz: 92a93334d1df828f8d06138cd5d4601b30fb2173a734c5f3d5782437f739bc986bde2ca2e6cd5106f3444f146c9ccbfef13123579e525706255af1b9f5620338
|
data/lib/atk/file_sys.rb
CHANGED
@@ -207,9 +207,11 @@ class FileSys
|
|
207
207
|
# add the root if the path is absolute
|
208
208
|
if FileSys.abs?(path)
|
209
209
|
if not OS.is?("windows")
|
210
|
-
pieces.
|
210
|
+
pieces.unshift('/')
|
211
|
+
else
|
212
|
+
# TODO: eventually make this work for any drive, not just the current drive
|
213
|
+
pieces.unshift('\\')
|
211
214
|
end
|
212
|
-
# FIXME: fix this for windows
|
213
215
|
end
|
214
216
|
return [ *pieces[0...-1], basebasename, extname ]
|
215
217
|
end
|
data/lib/atk/yaml_info_parser.rb
CHANGED
@@ -300,7 +300,28 @@ class Info
|
|
300
300
|
return @@data[element.to_s]
|
301
301
|
end
|
302
302
|
|
303
|
+
def self.folder()
|
304
|
+
first_location = Dir.pwd/"info.yaml"
|
305
|
+
*folders, name, ext = FS.path_pieces(first_location)
|
306
|
+
loop do
|
307
|
+
# if all folders exhausted
|
308
|
+
if folders.size == 0
|
309
|
+
raise <<-HEREDOC.remove_indent
|
310
|
+
|
311
|
+
Couldn't find an info.yaml in the current directory or any parent directory
|
312
|
+
#{Dir.pwd}
|
313
|
+
Are you sure you're running the command from the correct directory?
|
314
|
+
HEREDOC
|
315
|
+
end
|
316
|
+
# if the info.yaml exists, then use it
|
317
|
+
path = FS.join(*folders, "info.yaml")
|
318
|
+
if FS.file?(path)
|
319
|
+
return FS.join(*folders)
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
303
324
|
def self.source_path()
|
304
|
-
return
|
325
|
+
return self.folder()/"info.yaml"
|
305
326
|
end
|
306
327
|
end
|
data/lib/atk_toolbox/version.rb
CHANGED
data/test/info.yaml
CHANGED