mkdircd 0.0.1 → 0.0.2
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 +4 -4
- data/bin/mkdircd +12 -1
- data/lib/mkdircd/version.rb +1 -1
- data/lib/mkdircd.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f8b36a697c45de128c9589018f8a293aef5572
|
4
|
+
data.tar.gz: 3b2ef3b4cd6b69bd919ec695208738d73fe27730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea7f1b980742dbad86367549f6cf98b3841d4b611523a1a66cb422257d403abe72372df4d932e598e0e6a0ba82fae21a82a96a099fc46146e49d2c705a2b0562
|
7
|
+
data.tar.gz: d8a9efa69a45955b89f7bb2c19a486e1d9de467d78e726af8446d5b94de436567b80722984838b9a0d5c047a84e19494632abe1c4d025669fc7188a99c1492dd
|
data/bin/mkdircd
CHANGED
@@ -1,3 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
# This code was taken from https://github.com/lsegal/yard/blob/master/bin/yard. The code is licensed under the MIT License.
|
4
|
+
|
5
|
+
# We do all this work just to find the proper load path
|
6
|
+
path = __FILE__
|
7
|
+
while File.symlink?(path)
|
8
|
+
path = File.expand_path(File.readlink(path), File.dirname(path))
|
9
|
+
end
|
10
|
+
$:.unshift(File.join(File.dirname(File.expand_path(path)), '..', 'lib'))
|
11
|
+
|
12
|
+
require 'mkdircd'
|
13
|
+
|
14
|
+
process_argv(ARGV)
|
data/lib/mkdircd/version.rb
CHANGED
data/lib/mkdircd.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
require "mkdircd/version"
|
2
|
+
require 'fileutils'
|
3
|
+
|
2
4
|
|
3
5
|
module Mkdircd
|
4
|
-
|
6
|
+
def process_argv(input_argument)
|
7
|
+
new_folder_name = "#{Dir.pwd}/#{input_argument}"
|
8
|
+
FileUtils::mkdir_p(new_folder_name)
|
9
|
+
Dir.chdir(new_folder_name)
|
10
|
+
end
|
5
11
|
end
|