gabriel 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Enrico Bianco
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ gabriel - "Thou shalt not type full god commands"
2
+ =================================================
3
+
4
+ Gabriel gives you tab-completion for god commands, options, tasks, and groups in bash.
5
+
6
+ How to Use
7
+ ----------
8
+
9
+ Run `bin/gabriel-install`, follow the directions given, and you're good to go.
10
+
11
+ $ god st<TAB>
12
+ start status stop
13
+
14
+ $ god status
15
+ atest: up
16
+ btest: up
17
+ ctest: up
18
+
19
+ $ god start <TAB>
20
+ atest btest ctest
21
+
22
+ How to Contribute
23
+ -----------------
24
+
25
+ This is currently very alpha and honestly, I have little acquaintance with shell scripting.
26
+
27
+ If you can find a way to make Gabriel's completions even better, please do send a pull request.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Take it away, bash!
4
+ exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./install'"
data/install ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+
3
+ if [ ! -d ~/.gabriel ] ; then
4
+ mkdir -p ~/.gabriel
5
+ fi
6
+
7
+ cp -f `pwd`/scripts/gabriel.bash ~/.gabriel/gabriel.bash
8
+
9
+ touch ~/.bashrc
10
+ grep "gabriel.bash" ~/.bashrc > /dev/null
11
+ if [ $? != 0 ] ; then
12
+ echo "" >> ~/.bashrc
13
+ echo "source ~/.gabriel/gabriel.bash" >> ~/.bashrc
14
+ fi
15
+
16
+ printf "DONE! To activate the installed completions:\n\n"
17
+ printf "1) Ensure that ~/.bashrc is sourced from your profile (~/.bash_profile or ~/.profile):\n"
18
+ printf "$ echo \"source ~/.bashrc\" >> ~/.bash_profile\n\n"
19
+ printf "2) Exit and re-enter your shell or issue the following command:\n"
20
+ printf "$ source ~/.gabriel/gabriel.bash\n\n"
21
+ printf "Enjoy! -- Enrico B\n"
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # gabriel.bash
4
+ # Bash completion for god
5
+
6
+ __god_commands='start stop restart monitor unmonitor remove status signal load quit terminate check'
7
+
8
+ __god_options_long='--config-file --port --auto-bind --pid --log --no-daemonize --version --log-level --no-syslog --attach --no-events --bleakhouse'
9
+ __god_options_short='-c -p -b -P -l -D -v -V'
10
+ __god_options="${__god_options_long} ${__god_options_short}"
11
+
12
+ __god_log_levels="debug info warn error fatal"
13
+
14
+ __god_task_group_names() {
15
+ god status > /dev/null
16
+ if [ "$?" -eq "0" ]; then
17
+ god status | awk '{ print $1 }' | tr -d \\n | sed 's/:/ /g'
18
+ else
19
+ echo ""
20
+ fi
21
+ }
22
+
23
+ _god() {
24
+ local cur prev
25
+ cur="${COMP_WORDS[COMP_CWORD]}"
26
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
27
+
28
+ case "${prev}" in
29
+ start|stop|restart|monitor|unmonitor|remove|status)
30
+ local tasks="$(__god_task_group_names)"
31
+ COMPREPLY=( $(compgen -W "${tasks}" -- ${cur}) )
32
+ return 0
33
+ ;;
34
+ signal)
35
+ local tasks="$(__god_task_group_names)"
36
+ COMPREPLY=( $(compgen -W "${tasks}" -A signal -- ${cur}) )
37
+ return 0
38
+ ;;
39
+ load|-c|--config-file|-P|--pid|-l|--log)
40
+ COMPREPLY=( $(compgen -A file -- ${cur}) )
41
+ return 0
42
+ ;;
43
+ --log-level)
44
+ COMPREPLY=( $(compgen -W "${__god_log_levels}" -- ${cur}) )
45
+ return 0
46
+ ;;
47
+ *)
48
+ ;;
49
+ esac
50
+
51
+ COMPREPLY=( $(compgen -W "${__god_commands} ${__god_options}" -- ${cur}) )
52
+ return 0
53
+ }
54
+ complete -F _god god
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gabriel
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Enrico Bianco
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-08-26 00:00:00 -04:00
19
+ default_executable: gabriel-install
20
+ dependencies: []
21
+
22
+ description: gabriel helps you communicate with god by giving you bash completions for commands, options, tasks, and groups
23
+ email: enricob@gmail.com
24
+ executables:
25
+ - gabriel-install
26
+ extensions: []
27
+
28
+ extra_rdoc_files:
29
+ - LICENSE
30
+ - README.md
31
+ files:
32
+ - LICENSE
33
+ - README.md
34
+ - VERSION
35
+ - bin/gabriel-install
36
+ - install
37
+ - scripts/gabriel.bash
38
+ has_rdoc: true
39
+ homepage: http://github.com/enricob/gabriel
40
+ licenses: []
41
+
42
+ post_install_message:
43
+ rdoc_options:
44
+ - --charset=UTF-8
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ hash: 3
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ requirements: []
66
+
67
+ rubyforge_project:
68
+ rubygems_version: 1.3.7
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: Bash completion for god
72
+ test_files: []
73
+