Permalink
Browse files

HAHAHAHAHAHA

I merged sub with bundle gem
  • Loading branch information...
1 parent 9bb10f9 commit 320b49791b64b6ef90a7aea96344c865548916cc @calebthompson committed Oct 16, 2012
Showing with 285 additions and 9 deletions.
  1. +20 −0 LICENSE
  2. +1 −0 bin/vundle
  3. +14 −0 completions/vundle.bash
  4. +19 −0 completions/vundle.zsh
  5. +0 −5 lib/vundler.rb
  6. +0 −3 lib/vundler/version.rb
  7. +41 −0 libexec/vundle
  8. +42 −0 libexec/vundle-commands
  9. +14 −0 libexec/vundle-completions
  10. +51 −0 libexec/vundle-help
  11. +82 −0 libexec/vundle-init
  12. +1 −1 vundler.gemspec
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Caleb Thompson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
View
@@ -0,0 +1,14 @@
+_vundle() {
+ COMPREPLY=()
+ local word="${COMP_WORDS[COMP_CWORD]}"
+
+ if [ "$COMP_CWORD" -eq 1 ]; then
+ COMPREPLY=( $(compgen -W "$(vundle commands)" -- "$word") )
+ else
+ local command="${COMP_WORDS[1]}"
+ local completions="$(vundle completions "$command")"
+ COMPREPLY=( $(compgen -W "$completions" -- "$word") )
+ fi
+}
+
+complete -F _vundle vundle
View
@@ -0,0 +1,19 @@
+if [[ ! -o interactive ]]; then
+ return
+fi
+
+compctl -K _vundle vundle
+
+_vundle() {
+ local word words completions
+ read -cA words
+ word="${words[2]}"
+
+ if [ "${#words}" -eq 2 ]; then
+ completions="$(vundle commands)"
+ else
+ completions="$(vundle completions "${word}")"
+ fi
+
+ reply=("${(ps:\n:)completions}")
+}
View
@@ -1,5 +0,0 @@
-require "vundler/version"
-
-module Vundler
- # Your code goes here...
-end
View
@@ -1,3 +0,0 @@
-module Vundler
- VERSION = "0.0.1"
-end
View
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+set -e
+
+resolve_link() {
+ $(type -p greadlink readlink | head -1) "$1"
+}
+
+abs_dirname() {
+ local cwd="$(pwd)"
+ local path="$1"
+
+ while [ -n "$path" ]; do
+ cd "${path%/*}"
+ local name="${path##*/}"
+ path="$(resolve_link "$name" || true)"
+ done
+
+ pwd
+ cd "$cwd"
+}
+
+libexec_path="$(abs_dirname "$0")"
+export _VUNDLE_ROOT="$(abs_dirname "$libexec_path")"
+export PATH="${libexec_path}:$PATH"
+
+command="$1"
+case "$command" in
+"" | "-h" | "--help" )
+ exec vundle-help
+ ;;
+* )
+ command_path="$(command -v "vundle-$command" || true)"
+ if [ ! -x "$command_path" ]; then
+ echo "vundle: no such command \`$command'" >&2
+ exit 1
+ fi
+
+ shift
+ exec "$command_path" "$@"
+ ;;
+esac
View
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+# Usage: vundle commands
+# Summary: List all vundle commands
+# Help: This command is mostly used for autocompletion in various shells, and for `vundle help`.
+# Also, this command helps find commands that are named the same as potentially builtin shell commands (which, cd, etc)
+
+set -e
+
+# Provide vundle completions
+if [ "$1" = "--complete" ]; then
+ echo --sh
+ echo --no-sh
+ exit
+fi
+
+if [ "$1" = "--sh" ]; then
+ sh=1
+ shift
+elif [ "$1" = "--no-sh" ]; then
+ nosh=1
+ shift
+fi
+
+shopt -s nullglob
+
+{ for path in ${PATH//:/$'\n'}; do
+ for command in "${path}/vundle-"*; do
+ command="${command##*vundle-}"
+ if [ -n "$sh" ]; then
+ if [ ${command:0:3} = "sh-" ]; then
+ echo ${command##sh-}
+ fi
+ elif [ -n "$nosh" ]; then
+ if [ ${command:0:3} != "sh-" ]; then
+ echo ${command##sh-}
+ fi
+ else
+ echo ${command##sh-}
+ fi
+ done
+ done
+} | sort | uniq
View
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+set -e
+
+COMMAND="$1"
+if [ -z "$COMMAND" ]; then
+ echo "usage: vundle completions COMMAND [arg1 arg2...]" >&2
+ exit 1
+fi
+
+COMMAND_PATH="$(command -v "vundle-$COMMAND")"
+if grep -i "^# provide vundle completions" "$COMMAND_PATH" >/dev/null; then
+ shift
+ exec "$COMMAND_PATH" --complete "$@"
+fi
View
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+set -e
+
+print_summaries() {
+ for file in $_VUNDLE_ROOT/libexec/vundle-*; do
+ if [ ! -h $file ]; then
+ local summary=$(grep "^# Summary:" $file | cut -d ' ' -f3-)
+ if [ -n "$summary" ]; then
+ local name=$(basename $file | sed 's/vundle-//')
+ echo "$name" | awk '{ printf " %-20s ", $1}'
+ echo -n $summary
+ echo
+ fi
+ fi
+ done
+}
+
+print_help() {
+ local usage=$(grep "^# Usage:" $1 | cut -d ' ' -f2-)
+ local halp="$(awk '/^# Help:/,/^[^#]/' $1 | grep "^#" | sed "s/^# Help: //" | sed "s/^# //" | sed "s/^#//")"
+
+ if [ -n "$usage" ]; then
+ echo $usage
+ [ -n "$halp" ] && echo && echo "$halp"
+ else
+ echo "Sorry, this command isn't documented yet."
+ fi
+}
+
+# Provide vundle completions
+if [ "$1" = "--complete" ]; then
+ exec "vundle-commands"
+ exit
+fi
+
+case "$1" in
+"") echo "Usage: vundle <command> [<args>]
+
+Some useful vundle commands are:
+$(print_summaries)
+
+See 'vundle help <command>' for information on a specific command."
+;;
+*)
+ command_path="$(command -v "$_VUNDLE_ROOT/libexec/vundle-$1" || true)"
+ if [ -n "$command_path" ]; then
+ print_help "$_VUNDLE_ROOT/libexec/vundle-$1"
+ else
+ echo "vundle: no such command \`$1'"
+ fi
+esac
View
@@ -0,0 +1,82 @@
+#!/usr/bin/env bash
+set -e
+
+print=""
+if [ "$1" = "-" ]; then
+ print=1
+ shift
+fi
+
+shell="$1"
+if [ -z "$shell" ]; then
+ shell="$(basename "$SHELL")"
+fi
+
+resolve_link() {
+ $(type -p greadlink readlink | head -1) $1
+}
+
+abs_dirname() {
+ local cwd="$(pwd)"
+ local path="$1"
+
+ while [ -n "$path" ]; do
+ cd "${path%/*}"
+ local name="${path##*/}"
+ path="$(resolve_link "$name" || true)"
+ done
+
+ pwd
+ cd "$cwd"
+}
+
+root="$(abs_dirname "$0")/.."
+
+if [ -z "$print" ]; then
+ case "$shell" in
+ bash )
+ profile='~/.bash_profile'
+ ;;
+ zsh )
+ profile='~/.zshenv'
+ ;;
+ * )
+ profile='your profile'
+ ;;
+ esac
+
+ { echo "# Load vundle automatically by adding"
+ echo "# the following to ${profile}:"
+ echo
+ echo "eval \"\$(${_VUNDLE_ROOT}/bin/vundle init -)\""
+ echo
+ } >&2
+
+ exit 1
+fi
+
+echo "export PATH=\"\${PATH}:${_VUNDLE_ROOT}/bin\""
+
+case "$shell" in
+bash | zsh )
+ echo "source \"$root/completions/vundle.${shell}\""
+ ;;
+esac
+
+commands=(`vundle commands --sh`)
+IFS="|"
+cat <<EOS
+vundle() {
+ local command="\$1"
+ if [ "\$#" -gt 0 ]; then
+ shift
+ fi
+
+ case "\$command" in
+ ${commands[*]})
+ eval \`vundle "sh-\$command" "\$@"\`;;
+ *)
+ command vundle "\$command" "\$@";;
+ esac
+}
+EOS
View
@@ -5,7 +5,7 @@ require 'vundler/version'
Gem::Specification.new do |gem|
gem.name = "vundler"
- gem.version = Vundler::VERSION
+ gem.version = "0.1.0"
gem.authors = ["Caleb Thompson"]
gem.email = ["cjaysson@gmail.com"]
gem.description = %q{TODO: Write a gem description}

0 comments on commit 320b497

Please sign in to comment.