command-genie 0.2.1 → 0.3.0
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/README.md +3 -0
- data/bin/genie +6 -1
- data/lib/genie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 681b37592c3b1cb07922cac13494386a19c9a00f
|
4
|
+
data.tar.gz: 3817bf8649f305a0e3ebb94e14b2eaa8e5670b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39e4beba0eb48b4185d112eb2648b5108a4c233a342ebaa5d6fd27e224bb48ab0e89d390d5b45c229fc6c87232b1b957d45eff89ee6f7474ff47c1cd5ef8b3f1
|
7
|
+
data.tar.gz: 9524f5e9e081b39c4b4f25199730949cd44bf61c6db4fff00855b8c74da58a6461b43bf41a9edf74b8a4d0378335ee2af9edfca2dacad8142633369958cd4ba3
|
data/README.md
CHANGED
@@ -6,6 +6,9 @@ A good example is when pushing code, we might run `git push origin master` for o
|
|
6
6
|
|
7
7
|
`genie` lets you create commands that are bound to directories. In our example, we can create a `push` command that, depending on which directory we run it in, invoke the correct push command.
|
8
8
|
|
9
|
+
[](https://badge.fury.io/rb/command-genie)
|
10
|
+

|
11
|
+
|
9
12
|
Usage
|
10
13
|
---
|
11
14
|
Here's how to create a command with `genie`:
|
data/bin/genie
CHANGED
@@ -66,6 +66,7 @@ TICK_CHAR = "\u2713"
|
|
66
66
|
|
67
67
|
program :version, CommandGenie::VERSION
|
68
68
|
program :description, HELP_STRING
|
69
|
+
program :help, 'Author', 'Hwee-Boon Yar <hboon@motionobj.com>'
|
69
70
|
|
70
71
|
script_name = File.basename($PROGRAM_NAME)
|
71
72
|
|
@@ -141,6 +142,10 @@ if script_name == APP_NAME
|
|
141
142
|
say_error "Specify the name of the new command you want to create:
|
142
143
|
|
143
144
|
#{APP_NAME} create <command>
|
145
|
+
|
146
|
+
or for help:
|
147
|
+
|
148
|
+
#{APP_NAME} --help
|
144
149
|
" and abort if args.nil? || args.empty?
|
145
150
|
new_cmd = args[0]
|
146
151
|
say_error "I don't think you want to do that." and abort if new_cmd == APP_NAME
|
@@ -155,7 +160,7 @@ if script_name == APP_NAME
|
|
155
160
|
end
|
156
161
|
|
157
162
|
def dir_matching(dirs, dir)
|
158
|
-
found = dirs.find {|e|e == dir || File.expand_path(e) == dir}
|
163
|
+
found = dirs.find {|e| e == dir || File.realpath(File.expand_path(e)) == dir }
|
159
164
|
if found
|
160
165
|
found
|
161
166
|
else
|
data/lib/genie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: command-genie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hwee-Boon Yar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|