bash_help 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/general_helpers.rb +10 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ff4c4c051f5fa9d1f96998087be085f06544479c4fcf38f09d5ba90dd8ccd85
4
- data.tar.gz: 36f5d4eb846b84e6aa351fe1caf43bf49a35375cf7376e5989946610a79fe35d
3
+ metadata.gz: c383874ecdec88d015f3c85156bb93e9d5384498682ea76dcf5bf442c07d16f5
4
+ data.tar.gz: 4a3f559b76fdbd066bf36ae0dd53ab558e2488b38718eb1df9f243445b052da4
5
5
  SHA512:
6
- metadata.gz: 51f2afdc162955e236ef908ec9650b4cdd80170b1813a5a69455dca876b3344a2c2cc9720579026ec52d8c864f2f748deef744a06cbb18d806af01e9ce3f51d2
7
- data.tar.gz: '0339edebea70af15bd2dbf121eefec588dffeedc0ca1b6671e7b5af20c4d56867088e0f8a72eaaa3509c86b74553bf9cb798721be8d61b29b2954b2aa04924b7'
6
+ metadata.gz: d64c70d15e623d55c008c69bca7b506cf72c0b0117e87afac5a6a38b9324091691e8ef54fbba4947e4d6cb3cf25f8a4da7dc23a946810d5c2ad31e0f872c6df8
7
+ data.tar.gz: 1be7cf2c0f24e6ca133890a3ecba280fa217bf9e0339bbab6153061eee82421114c384781e0c59dcff154a674281d0a08f487f3d0cb8a88e96f10f39e801b02c
@@ -0,0 +1,10 @@
1
+ ## usage: normalize __FILE__
2
+ # normalize the directory that your scripts execute in, even if they're running from different places.
3
+ # this is useful for when you want to reference a file in the same directory as your script, but you don't know where your script will be run from
4
+ def normalize(path)
5
+ filepath = File.expand_path(path)
6
+ puts filepath
7
+ # now get the dirpath of this file
8
+ dirpath = File.dirname(filepath)
9
+ Dir.chdir(dirpath)
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bash_help
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zack Fisher
@@ -18,6 +18,7 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - lib/bash_help.rb
20
20
  - lib/bash_standins.rb
21
+ - lib/general_helpers.rb
21
22
  - lib/hello_module.rb
22
23
  homepage: https://github.com/zack-fisher
23
24
  licenses: []