atk_toolbox 0.0.85 → 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1be06eba95081b6c96474395cec11725013051340b97824f372f8a6c4db543e
4
- data.tar.gz: 8278323e7bc9ccbd279d3e335d30f1a92c863b1487909d4c168da681dce52efe
3
+ metadata.gz: 3353cee7d23d6626dfa308edfccc97753ace097385bb6ed2c164e96cd2be2a12
4
+ data.tar.gz: 4f7237049096f3e52c1e6037e3f53cdd94130052faaffd82c6e354bb4a3f7f82
5
5
  SHA512:
6
- metadata.gz: 4e18239ef2c6c43890bbb7f63ecdea67d4be98690dff0bde533aac8f1d52219487f8724e1c82fd9cffc536b5e2ebaf9e15a653ef9d50dc4cffbd3f54e40872a9
7
- data.tar.gz: 8f730ef8cc49c963992a1214e47e79d23cd8e0a34eb2f6101463177b4a9079e789b5a678c4f7bad78609627e616132eb5cfaf2d04ca84d2d8cc9861b3c614121
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.shift('/')
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
@@ -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 Dir.pwd/"info.yaml"
325
+ return self.folder()/"info.yaml"
305
326
  end
306
327
  end
@@ -1,3 +1,3 @@
1
1
  module AtkToolbox
2
- VERSION = '0.0.85'
2
+ VERSION = '0.0.86'
3
3
  end
data/test/info.yaml CHANGED
@@ -1,4 +1,4 @@
1
- (using_atk_version): 0.0
1
+ (using_atk_version): 1.0
2
2
  (project):
3
3
  name: A Project
4
4
  description: A new project
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atk_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.85
4
+ version: 0.0.86
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Hykin