jump 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/POST_INSTALL.txt +6 -12
- data/README.rdoc +6 -11
- data/Rakefile +2 -3
- data/VERSION +1 -1
- data/bin/jump-bin +10 -0
- data/lib/bookmarks.rb +7 -1
- data/test/bookmarks_test.rb +10 -9
- metadata +58 -102
data/POST_INSTALL.txt
CHANGED
@@ -5,26 +5,20 @@ Notes for bash users:
|
|
5
5
|
while OSX users can install it via ports, fink or brew.
|
6
6
|
|
7
7
|
Now that jump is installed execute the following command:
|
8
|
-
sudo cp `
|
8
|
+
sudo cp `jump-bin --bash-integration`/bash_completion/jump /path_to/bash_completion.d
|
9
9
|
|
10
10
|
The 'bash_completion.d' directory is usually located under /etc/.
|
11
11
|
OSX users will find this directory under fink/port/brew installation directory (e.g. '/opt/local/etc').
|
12
12
|
|
13
|
+
If you do not want to install <i>bash_completion</i> then add the following code
|
14
|
+
to your bash configuration file (e.g. <i>~/.bash_profile</i> or <i>~/.bashrc'</i>:
|
13
15
|
|
14
|
-
|
15
|
-
cp `gem contents jump | grep shell_driver` ~/.jump_shell_driver
|
16
|
-
|
17
|
-
and add the following code to your bash configuration file (e.g. '~/.bash_profile' or '~/.bashrc'):
|
18
|
-
|
19
|
-
source ~/.jump_shell_driver
|
16
|
+
source `jump-bin --bash-integration`/shell_driver
|
20
17
|
|
21
18
|
Beware: without bash_completion you won't be able use jump's advanced completion features.
|
22
19
|
|
23
20
|
Notes for zsh users:
|
24
|
-
Now that jump is installed
|
25
|
-
cp `gem contents jump | grep zsh` ~/.jump_shell_driver
|
26
|
-
|
27
|
-
and add the following code to your .zshrc file:
|
21
|
+
Now that jump is installed, add the following code to your .zshrc file:
|
28
22
|
|
29
|
-
source
|
23
|
+
source `jump-bin --zsh-integration`
|
30
24
|
|
data/README.rdoc
CHANGED
@@ -109,7 +109,7 @@ Linux users can install it using their package manager (apt, zypper, yum, emerge
|
|
109
109
|
while OSX users can install it via ports, fink or brew.
|
110
110
|
|
111
111
|
Execute the following command once jump has been installed:
|
112
|
-
sudo cp `
|
112
|
+
sudo cp `jump-bin --bash-integration`/bash_completion/jump /path_to/bash_completion.d
|
113
113
|
|
114
114
|
The <i>bash_completion.d</i> directory is usually located under <i>/etc/</i>.
|
115
115
|
OSX users will find this directory under fink/port/brew installation directory (e.g. <i>/opt/local/etc</i>).
|
@@ -123,22 +123,17 @@ Take a look at the previous section in order to figure out your <i>GEM PATH</i>.
|
|
123
123
|
|
124
124
|
=== Without bash-completion
|
125
125
|
|
126
|
-
If you do not want to install <i>bash_completion</i> then
|
127
|
-
|
126
|
+
If you do not want to install <i>bash_completion</i> then add the following code
|
127
|
+
to your bash configuration file (e.g. <i>~/.bash_profile</i> or <i>~/.bashrc'</i>:
|
128
128
|
|
129
|
-
|
130
|
-
|
131
|
-
source ~/.jump_shell_driver
|
129
|
+
source `jump-bin --bash-integration`/shell_driver
|
132
130
|
|
133
131
|
<b>Beware:</b> without bash_completion you won't be able use jump's advanced completion features.
|
134
132
|
|
135
133
|
== Zsh integration
|
136
134
|
|
137
|
-
After having installed jump
|
138
|
-
cp `gem contents jump | grep zsh` ~/.jump_shell_driver
|
139
|
-
|
140
|
-
and add the following code to your .zshrc file:
|
135
|
+
After having installed jump, add the following code to your .zshrc file:
|
141
136
|
|
142
|
-
source
|
137
|
+
source `jump-bin --zsh-integration`
|
143
138
|
|
144
139
|
(c) 2010 Flavio Castelli and Giuseppe Capizzi
|
data/Rakefile
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
20
|
|
21
21
|
require 'rake'
|
22
|
-
require '
|
22
|
+
require 'rdoc/task'
|
23
23
|
require 'rake/testtask'
|
24
24
|
|
25
25
|
task :default => "test"
|
@@ -68,7 +68,6 @@ begin
|
|
68
68
|
gem.executables = ['jump-bin']
|
69
69
|
gem.test_files = Dir[*['test/**/*_test.rb']]
|
70
70
|
|
71
|
-
gem.has_rdoc = true
|
72
71
|
gem.extra_rdoc_files = ["README.rdoc"]
|
73
72
|
gem.rdoc_options = ['--line-numbers', "--main", "README.rdoc"]
|
74
73
|
|
@@ -76,7 +75,7 @@ begin
|
|
76
75
|
gem.email = %w(flavio@castelli.name gcapizzi@gmail.com)
|
77
76
|
gem.homepage = "http://github.com/flavio/jump"
|
78
77
|
|
79
|
-
gem.add_dependency "terminal-table"
|
78
|
+
gem.add_dependency "terminal-table", '>= 1.4.4'
|
80
79
|
gem.add_development_dependency "fakefs"
|
81
80
|
|
82
81
|
gem.platform = Gem::Platform::RUBY
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/bin/jump-bin
CHANGED
@@ -43,6 +43,16 @@ begin
|
|
43
43
|
options[:list] = true
|
44
44
|
end
|
45
45
|
|
46
|
+
opts.on("--bash-integration", "Prints the path to directory containing the Bash integration files") do
|
47
|
+
puts "#{File.dirname(THIS_FILE)}/../bash_integration"
|
48
|
+
exit
|
49
|
+
end
|
50
|
+
|
51
|
+
opts.on("--zsh-integration", "Prints the path to the ZSH integration file") do
|
52
|
+
puts "#{File.dirname(THIS_FILE)}/../zsh_integration/jump"
|
53
|
+
exit
|
54
|
+
end
|
55
|
+
|
46
56
|
opts.on_tail("-h", "--help", "Show this message") do
|
47
57
|
puts opts
|
48
58
|
exit
|
data/lib/bookmarks.rb
CHANGED
@@ -73,9 +73,10 @@ class Bookmarks
|
|
73
73
|
"No bookmarks saved"
|
74
74
|
else
|
75
75
|
bookmarks_table = table do |t|
|
76
|
+
t.style = { :border_y => '', :border_i => '' }
|
76
77
|
t.headings = "Bookmark", "Path"
|
77
78
|
@bookmarks.keys.sort.each do |bookmark|
|
78
|
-
t << [bookmark, @bookmarks[bookmark]]
|
79
|
+
t << [bookmark, simplify_path(@bookmarks[bookmark])]
|
79
80
|
end
|
80
81
|
end
|
81
82
|
bookmarks_table.to_s
|
@@ -127,6 +128,11 @@ class Bookmarks
|
|
127
128
|
end
|
128
129
|
end
|
129
130
|
|
131
|
+
# Simplifies given path by replacing the user's homedir with ~
|
132
|
+
def simplify_path(path)
|
133
|
+
path.gsub /^#{File.expand_path '~'}/, '~'
|
134
|
+
end
|
135
|
+
|
130
136
|
# Expands paths that could start with a bookmark (e.g. [bookmark]/sub/path)
|
131
137
|
def expand_path(path_with_bookmark)
|
132
138
|
if path_with_bookmark.index("/").nil?
|
data/test/bookmarks_test.rb
CHANGED
@@ -26,8 +26,9 @@ class BookmarksTest < Test::Unit::TestCase
|
|
26
26
|
def setup
|
27
27
|
@test_bookmarks = { "foo" => "/tmp/foo",
|
28
28
|
"bar" => "/tmp/bar",
|
29
|
-
"complex" => "/tmp/foo/bar/complex"}
|
29
|
+
"complex" => "#{File.expand_path '~'}/tmp/foo/bar/complex"}
|
30
30
|
FakeFS do
|
31
|
+
FileUtils.mkdir_p(File.expand_path('~'))
|
31
32
|
File.open(Bookmarks::BOOKMARKS_PATH, 'w') do |file|
|
32
33
|
file << YAML::dump(@test_bookmarks)
|
33
34
|
end
|
@@ -65,15 +66,15 @@ class BookmarksTest < Test::Unit::TestCase
|
|
65
66
|
|
66
67
|
def test_to_s
|
67
68
|
output = <<EOF
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
---------------------------------
|
70
|
+
Bookmark Path
|
71
|
+
---------------------------------
|
72
|
+
bar /tmp/bar
|
73
|
+
complex ~/tmp/foo/bar/complex
|
74
|
+
foo /tmp/foo
|
75
|
+
---------------------------------
|
75
76
|
EOF
|
76
|
-
assert_equal output, @bookmarks.to_s
|
77
|
+
assert_equal output.chomp, @bookmarks.to_s
|
77
78
|
end
|
78
79
|
|
79
80
|
def test_save
|
metadata
CHANGED
@@ -1,69 +1,52 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jump
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 1
|
10
|
-
version: 0.2.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Flavio Castelli
|
14
9
|
- Giuseppe Capizzi
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-03-06 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
23
16
|
name: terminal-table
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &70508760 !ruby/object:Gem::Requirement
|
26
18
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 0
|
33
|
-
version: "0"
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.4.4
|
34
23
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: fakefs
|
38
24
|
prerelease: false
|
39
|
-
|
25
|
+
version_requirements: *70508760
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: fakefs
|
28
|
+
requirement: &70507740 !ruby/object:Gem::Requirement
|
40
29
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
version: "0"
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
48
34
|
type: :development
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
(http://code.google.com/p/go-tool/).
|
57
|
-
email:
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70507740
|
37
|
+
description: ! "Jump is a tool that allows you to quickly change\n directories
|
38
|
+
in the bash and zsh shells using bookmarks.\n Thanks to Jump,
|
39
|
+
you won't have to type those long paths anymore.\n\n Jump
|
40
|
+
was inspired by go-tool by ActiveState\n (http://code.google.com/p/go-tool/)."
|
41
|
+
email:
|
58
42
|
- flavio@castelli.name
|
59
43
|
- gcapizzi@gmail.com
|
60
|
-
executables:
|
44
|
+
executables:
|
61
45
|
- jump-bin
|
62
46
|
extensions: []
|
63
|
-
|
64
|
-
extra_rdoc_files:
|
47
|
+
extra_rdoc_files:
|
65
48
|
- README.rdoc
|
66
|
-
files:
|
49
|
+
files:
|
67
50
|
- COPYING.txt
|
68
51
|
- Changelog
|
69
52
|
- POST_INSTALL.txt
|
@@ -77,71 +60,44 @@ files:
|
|
77
60
|
- test/test_helper.rb
|
78
61
|
- zsh_integration/jump
|
79
62
|
- bin/jump-bin
|
80
|
-
has_rdoc: true
|
81
63
|
homepage: http://github.com/flavio/jump
|
82
64
|
licenses: []
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
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
|
100
|
-
|
101
|
-
and add the following code to your bash configuration file (e.g. '~/.bash_profile' or '~/.bashrc'):
|
102
|
-
|
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
|
114
|
-
|
115
|
-
rdoc_options:
|
65
|
+
post_install_message: ! "Notes for bash users:\n It's strongly recommended to install
|
66
|
+
bash_completion. In this way you will have\n the best user experience.\n Linux
|
67
|
+
users can install it using their package manager (apt, zypper, yum, emerge...),\n
|
68
|
+
\ while OSX users can install it via ports, fink or brew.\n\n Now that jump is
|
69
|
+
installed execute the following command:\n sudo cp `jump-bin --bash-integration`/bash_completion/jump
|
70
|
+
/path_to/bash_completion.d\n\n The 'bash_completion.d' directory is usually located
|
71
|
+
under /etc/.\n OSX users will find this directory under fink/port/brew installation
|
72
|
+
directory (e.g. '/opt/local/etc').\n\n If you do not want to install <i>bash_completion</i>
|
73
|
+
then add the following code\n to your bash configuration file (e.g. <i>~/.bash_profile</i>
|
74
|
+
or <i>~/.bashrc'</i>:\n\n source `jump-bin --bash-integration`/shell_driver\n\n
|
75
|
+
\ Beware: without bash_completion you won't be able use jump's advanced completion
|
76
|
+
features.\n\nNotes for zsh users:\n Now that jump is installed, add the following
|
77
|
+
code to your .zshrc file:\n\n source `jump-bin --zsh-integration`\n\n"
|
78
|
+
rdoc_options:
|
116
79
|
- --line-numbers
|
117
80
|
- --main
|
118
81
|
- README.rdoc
|
119
|
-
require_paths:
|
82
|
+
require_paths:
|
120
83
|
- lib
|
121
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
85
|
none: false
|
123
|
-
requirements:
|
124
|
-
- -
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
127
|
-
|
128
|
-
- 0
|
129
|
-
version: "0"
|
130
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
91
|
none: false
|
132
|
-
requirements:
|
133
|
-
- -
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
version: "0"
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
139
96
|
requirements: []
|
140
|
-
|
141
97
|
rubyforge_project:
|
142
|
-
rubygems_version: 1.
|
98
|
+
rubygems_version: 1.8.15
|
143
99
|
signing_key:
|
144
100
|
specification_version: 3
|
145
101
|
summary: A bookmarking system for bash and zsh shells
|
146
|
-
test_files:
|
102
|
+
test_files:
|
147
103
|
- test/bookmarks_test.rb
|