jump 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +4 -0
- data/POST_INSTALL.txt +23 -13
- data/README.rdoc +15 -5
- data/Rakefile +6 -3
- data/VERSION +1 -1
- data/bash_integration/bash_completion/jump +8 -6
- data/bash_integration/shell_driver +7 -5
- data/bin/jump-bin +1 -1
- data/lib/bookmarks.rb +1 -1
- data/test/bookmarks_test.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/zsh_integration/jump +59 -0
- metadata +31 -21
data/Changelog
CHANGED
data/POST_INSTALL.txt
CHANGED
@@ -1,20 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
Notes for bash users:
|
2
|
+
It's strongly recommended to install bash_completion. In this way you will have
|
3
|
+
the best user experience.
|
4
|
+
Linux users can install it using their package manager (apt, zypper, yum, emerge...),
|
5
|
+
while OSX users can install it via ports, fink or brew.
|
5
6
|
|
6
|
-
Now that jump is installed execute the following command:
|
7
|
-
|
7
|
+
Now that jump is installed execute the following command:
|
8
|
+
sudo cp `gem contents jump | grep completion` /path_to/bash_completion.d
|
8
9
|
|
9
|
-
The 'bash_completion.d' directory is usually located under /etc/.
|
10
|
-
OSX users will find this directory under fink/port/brew installation directory (e.g. '/opt/local/etc').
|
10
|
+
The 'bash_completion.d' directory is usually located under /etc/.
|
11
|
+
OSX users will find this directory under fink/port/brew installation directory (e.g. '/opt/local/etc').
|
11
12
|
|
12
13
|
|
13
|
-
If you do not want to install 'bash_completion' then execute the following command:
|
14
|
-
|
14
|
+
If you do not want to install 'bash_completion' then execute the following command:
|
15
|
+
cp `gem contents jump | grep shell_driver` ~/.jump_shell_driver
|
15
16
|
|
16
|
-
and add the following code to your bash configuration file (e.g. '~/.bash_profile' or '~/.bashrc'):
|
17
|
+
and add the following code to your bash configuration file (e.g. '~/.bash_profile' or '~/.bashrc'):
|
17
18
|
|
18
|
-
|
19
|
+
source ~/.jump_shell_driver
|
20
|
+
|
21
|
+
Beware: without bash_completion you won't be able use jump's advanced completion features.
|
22
|
+
|
23
|
+
Notes for zsh users:
|
24
|
+
Now that jump is installed execute the following command:
|
25
|
+
cp `gem contents jump | grep zsh` ~/.jump_shell_driver
|
26
|
+
|
27
|
+
and add the following code to your .zshrc file:
|
28
|
+
|
29
|
+
source ~/.jump_shell_driver
|
19
30
|
|
20
|
-
Beware: without bash_completion you won't be able use jump's advanced completion features.
|
data/README.rdoc
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
= Jump, a bookmarking system for the bash
|
1
|
+
= Jump, a bookmarking system for the bash and zsh shells.
|
2
2
|
|
3
3
|
== Introduction
|
4
4
|
|
5
|
-
Jump is a tool that allows you to quickly change directories in the bash
|
6
|
-
|
5
|
+
Jump is a tool that allows you to quickly change directories in the bash and zsh
|
6
|
+
shells using bookmarks. Thanks to Jump, you won't have to type those long
|
7
7
|
paths anymore.
|
8
8
|
Jump was inspired by {go-tool}[http://code.google.com/p/go-tool/] by ActiveState.
|
9
9
|
|
@@ -37,8 +37,6 @@ Don't remember a command? Just type:
|
|
37
37
|
|
38
38
|
=== Advanced completion
|
39
39
|
|
40
|
-
The tight integration between jump and bash_completion offers advanced completion features.
|
41
|
-
|
42
40
|
Suppose you added a bookmark called <i>rails-app</i> pointing to <i>/home/flavio/test/test_app</i>.
|
43
41
|
The folder contains the following files:
|
44
42
|
drwxr-xr-x 6 flavio users 4096 2010-08-10 10:38 app
|
@@ -76,6 +74,9 @@ Hence
|
|
76
74
|
is automatically expanded to
|
77
75
|
$ rails-app/log
|
78
76
|
|
77
|
+
The advanced completion works out of the box for zsh users.
|
78
|
+
The bash shell relies on bash_completion.
|
79
|
+
|
79
80
|
== Installation
|
80
81
|
|
81
82
|
Jump is packaged as a gem:
|
@@ -131,4 +132,13 @@ and add the following code to your bash configuration file (e.g. <i>~/.bash_prof
|
|
131
132
|
|
132
133
|
<b>Beware:</b> without bash_completion you won't be able use jump's advanced completion features.
|
133
134
|
|
135
|
+
== Zsh integration
|
136
|
+
|
137
|
+
After having installed jump execute the following command:
|
138
|
+
cp `gem contents jump | grep zsh` ~/.jump_shell_driver
|
139
|
+
|
140
|
+
and add the following code to your .zshrc file:
|
141
|
+
|
142
|
+
source ~/.jump_shell_driver
|
143
|
+
|
134
144
|
(c) 2010 Flavio Castelli and Giuseppe Capizzi
|
data/Rakefile
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
17
|
# along with Keep; if not, write to the
|
18
18
|
# Free Software Foundation, Inc.,
|
19
|
-
# 51 Franklin
|
19
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
20
|
|
21
21
|
require 'rake'
|
22
22
|
require 'rake/rdoctask'
|
@@ -51,7 +51,7 @@ begin
|
|
51
51
|
require 'jeweler'
|
52
52
|
Jeweler::Tasks.new do |gem|
|
53
53
|
gem.name = %q{jump}
|
54
|
-
gem.summary = %q{A bookmarking system for
|
54
|
+
gem.summary = %q{A bookmarking system for bash and zsh shells}
|
55
55
|
gem.description = %q{Jump is a tool that allows you to quickly change
|
56
56
|
directories in the bash shell using bookmarks.
|
57
57
|
Thanks to Jump, you won't have to type those long paths anymore.
|
@@ -59,7 +59,10 @@ begin
|
|
59
59
|
Jump was inspired by go-tool by ActiveState
|
60
60
|
(http://code.google.com/p/go-tool/).}
|
61
61
|
|
62
|
-
gem.files = FileList['[A-Z]*', '
|
62
|
+
gem.files = FileList[ '[A-Z]*', 'lib/**/*.rb', 'test/**/*.rb',
|
63
|
+
'bash_integration/**/*',
|
64
|
+
'zsh_integration/**/*']
|
65
|
+
|
63
66
|
gem.require_path = 'lib'
|
64
67
|
gem.bindir = 'bin'
|
65
68
|
gem.executables = ['jump-bin']
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -3,12 +3,12 @@
|
|
3
3
|
# Copyright (C) 2010 Flavio Castelli <flavio@castelli.name>
|
4
4
|
# Copyright (C) 2010 Giuseppe Capizzi <gcapizzi@gmail.com>
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# jump is free software; you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
8
|
# the Free Software Foundation; either version 2 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# jump is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
17
|
# along with Keep; if not, write to the
|
18
18
|
# Free Software Foundation, Inc.,
|
19
|
-
# 51 Franklin
|
19
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
20
|
|
21
21
|
_jump()
|
22
22
|
{
|
@@ -26,7 +26,7 @@ _jump()
|
|
26
26
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
27
27
|
opts="--help -h --add -a --del -d --list -l"
|
28
28
|
|
29
|
-
if [[ ${prev} == -d || ${prev} == --
|
29
|
+
if [[ ${prev} == "-d" || ${prev} == "--del" ]] ; then
|
30
30
|
# complete the del command with a list of the available bookmarks
|
31
31
|
local bookmarks=$(jump --bc)
|
32
32
|
COMPREPLY=( $(compgen -W "${bookmarks}" -- ${cur}) )
|
@@ -45,10 +45,12 @@ _jump()
|
|
45
45
|
|
46
46
|
function jump {
|
47
47
|
#echo "jump called with $*"
|
48
|
-
if [
|
48
|
+
if [ $# -lt 1 ]; then
|
49
|
+
jump-bin --help
|
50
|
+
elif [ ${1:0:1} == "-" ]; then
|
49
51
|
jump-bin $*
|
50
52
|
else
|
51
|
-
cd $(jump-bin $*)
|
53
|
+
cd "$(jump-bin $*)"
|
52
54
|
fi
|
53
55
|
}
|
54
56
|
|
@@ -3,12 +3,12 @@
|
|
3
3
|
# Copyright (C) 2010 Flavio Castelli <flavio@castelli.name>
|
4
4
|
# Copyright (C) 2010 Giuseppe Capizzi <gcapizzi@gmail.com>
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# jump is free software; you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
8
|
# the Free Software Foundation; either version 2 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# jump is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
@@ -16,13 +16,15 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
17
|
# along with Keep; if not, write to the
|
18
18
|
# Free Software Foundation, Inc.,
|
19
|
-
# 51 Franklin
|
19
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
20
|
|
21
21
|
function jump {
|
22
22
|
#echo "jump called with $*"
|
23
|
-
if [
|
23
|
+
if [ $# -lt 1 ]; then
|
24
|
+
jump-bin --help
|
25
|
+
elif [ ${1:0:1} == "-" ]; then
|
24
26
|
jump-bin $*
|
25
27
|
else
|
26
|
-
cd $(jump-bin $*)
|
28
|
+
cd "$(jump-bin $*)"
|
27
29
|
fi
|
28
30
|
}
|
data/bin/jump-bin
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
# You should have received a copy of the GNU General Public License
|
19
19
|
# along with Keep; if not, write to the
|
20
20
|
# Free Software Foundation, Inc.,
|
21
|
-
# 51 Franklin
|
21
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
22
22
|
|
23
23
|
THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
|
24
24
|
|
data/lib/bookmarks.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
17
|
# along with Keep; if not, write to the
|
18
18
|
# Free Software Foundation, Inc.,
|
19
|
-
# 51 Franklin
|
19
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
20
|
|
21
21
|
require 'rubygems'
|
22
22
|
require 'yaml'
|
data/test/bookmarks_test.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
17
|
# along with Keep; if not, write to the
|
18
18
|
# Free Software Foundation, Inc.,
|
19
|
-
# 51 Franklin
|
19
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
20
|
|
21
21
|
require "test_helper"
|
22
22
|
require 'bookmarks'
|
data/test/test_helper.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
17
|
# along with Keep; if not, write to the
|
18
18
|
# Free Software Foundation, Inc.,
|
19
|
-
# 51 Franklin
|
19
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
20
|
|
21
21
|
require 'rubygems'
|
22
22
|
require 'test/unit'
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# This file is part of the jump project
|
2
|
+
#
|
3
|
+
# Copyright (C) 2010 Flavio Castelli <flavio@castelli.name>
|
4
|
+
#
|
5
|
+
# jump is free software; you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation; either version 2 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
#
|
10
|
+
# jump is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with Keep; if not, write to the
|
17
|
+
# Free Software Foundation, Inc.,
|
18
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
19
|
+
|
20
|
+
_jump()
|
21
|
+
{
|
22
|
+
local user_input
|
23
|
+
read -cA user_input
|
24
|
+
local cur prev
|
25
|
+
reply=()
|
26
|
+
|
27
|
+
cur="${user_input[$#user_input]}"
|
28
|
+
if [[ $#user_input -gt 2 ]]; then
|
29
|
+
prev="${user_input[$#user_input-1]}"
|
30
|
+
fi
|
31
|
+
|
32
|
+
if [[ ${prev} = "-d" || ${prev} = "--del" ]] ; then
|
33
|
+
# complete the del command with a list of the available bookmarks
|
34
|
+
reply=( $(jump-bin --bc) )
|
35
|
+
return 0
|
36
|
+
fi
|
37
|
+
|
38
|
+
if [[ ${cur[0,1]} = "-" ]]; then
|
39
|
+
reply=( --help -h --add -a --del -d --list -l )
|
40
|
+
return 0
|
41
|
+
else
|
42
|
+
reply=( $(jump-bin --bc ${cur}) )
|
43
|
+
return 0
|
44
|
+
fi
|
45
|
+
}
|
46
|
+
|
47
|
+
function jump {
|
48
|
+
args=$*
|
49
|
+
#echo "jump called with |$args|"
|
50
|
+
if [[ $#args -lt 1 ]]; then
|
51
|
+
jump-bin --help
|
52
|
+
elif [[ ${args[0,1]} = "-" ]]; then
|
53
|
+
jump-bin $*
|
54
|
+
else
|
55
|
+
cd "$(jump-bin $*)"
|
56
|
+
fi
|
57
|
+
}
|
58
|
+
|
59
|
+
compctl -K _jump -S '' jump
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Flavio Castelli
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-08-
|
19
|
+
date: 2010-08-28 00:00:00 +02:00
|
20
20
|
default_executable: jump-bin
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -75,33 +75,43 @@ files:
|
|
75
75
|
- lib/bookmarks.rb
|
76
76
|
- test/bookmarks_test.rb
|
77
77
|
- test/test_helper.rb
|
78
|
+
- zsh_integration/jump
|
78
79
|
- bin/jump-bin
|
79
80
|
has_rdoc: true
|
80
81
|
homepage: http://github.com/flavio/jump
|
81
82
|
licenses: []
|
82
83
|
|
83
|
-
post_install_message:
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
84
|
+
post_install_message: |+
|
85
|
+
Notes for bash users:
|
86
|
+
It's strongly recommended to install bash_completion. In this way you will have
|
87
|
+
the best user experience.
|
88
|
+
Linux users can install it using their package manager (apt, zypper, yum, emerge...),
|
89
|
+
while OSX users can install it via ports, fink or brew.
|
88
90
|
|
89
|
-
|
90
|
-
|
91
|
+
Now that jump is installed execute the following command:
|
92
|
+
sudo cp `gem contents jump | grep completion` /path_to/bash_completion.d
|
91
93
|
|
92
|
-
|
93
|
-
|
94
|
+
The 'bash_completion.d' directory is usually located under /etc/.
|
95
|
+
OSX users will find this directory under fink/port/brew installation directory (e.g. '/opt/local/etc').
|
94
96
|
|
95
97
|
|
96
|
-
|
97
|
-
|
98
|
+
If you do not want to install 'bash_completion' then execute the following command:
|
99
|
+
cp `gem contents jump | grep shell_driver` ~/.jump_shell_driver
|
98
100
|
|
99
|
-
|
101
|
+
and add the following code to your bash configuration file (e.g. '~/.bash_profile' or '~/.bashrc'):
|
100
102
|
|
101
|
-
|
103
|
+
source ~/.jump_shell_driver
|
104
|
+
|
105
|
+
Beware: without bash_completion you won't be able use jump's advanced completion features.
|
106
|
+
|
107
|
+
Notes for zsh users:
|
108
|
+
Now that jump is installed execute the following command:
|
109
|
+
cp `gem contents jump | grep zsh` ~/.jump_shell_driver
|
110
|
+
|
111
|
+
and add the following code to your .zshrc file:
|
112
|
+
|
113
|
+
source ~/.jump_shell_driver
|
102
114
|
|
103
|
-
Beware: without bash_completion you won't be able use jump's advanced completion features.
|
104
|
-
|
105
115
|
rdoc_options:
|
106
116
|
- --line-numbers
|
107
117
|
- --main
|
@@ -132,6 +142,6 @@ rubyforge_project:
|
|
132
142
|
rubygems_version: 1.3.7
|
133
143
|
signing_key:
|
134
144
|
specification_version: 3
|
135
|
-
summary: A bookmarking system for
|
145
|
+
summary: A bookmarking system for bash and zsh shells
|
136
146
|
test_files:
|
137
147
|
- test/bookmarks_test.rb
|