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.
- checksums.yaml +4 -4
- data/lib/general_helpers.rb +10 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c383874ecdec88d015f3c85156bb93e9d5384498682ea76dcf5bf442c07d16f5
|
4
|
+
data.tar.gz: 4a3f559b76fdbd066bf36ae0dd53ab558e2488b38718eb1df9f243445b052da4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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: []
|