warp-dir 1.6.2 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md DELETED
@@ -1,178 +0,0 @@
1
- # Warp Directory
2
-
3
- [![Downloads](http://ruby-gem-downloads-badge.herokuapp.com/warp-dir?type=total)](https://rubygems.org/gems/warp-dir)
4
- [![Gem Version](https://badge.fury.io/rb/warp-dir.svg)](https://badge.fury.io/rb/warp-dir)
5
- [![Build Status](https://travis-ci.org/kigster/warp-dir.svg?branch=master)](https://travis-ci.org/kigster/warp-dir)
6
- [![Code Climate](https://codeclimate.com/github/kigster/warp-dir/badges/gpa.svg)](https://codeclimate.com/github/kigster/warp-dir)
7
- [![Test Coverage](https://codeclimate.com/github/kigster/warp-dir/badges/coverage.svg)](https://codeclimate.com/github/kigster/warp-dir/coverage)
8
-
9
- ---
10
-
11
- [![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/kigster/warp-dir)
12
-
13
- This is a ruby implementation of the tool `wd` (warp directory),
14
- [originally written as a `ZSH` module](https://github.com/mfaerevaag/wd)
15
- by [Markus Færevaag](https://github.com/mfaerevaag).
16
-
17
- I personaly went back to `bash` after trying out `ZSH`, but it was the `wd` plugin that I really missed.
18
-
19
- While Markus kindly offered a ruby version in a [separate branch of this module](https://github.com/mfaerevaag/wd/tree/ruby),
20
- it wasn't quite as extensible as I wanted to (or well tested), so it ended up being an inspiration for this gem.
21
-
22
- ## Warp This
23
-
24
- WarpDir is a UNIX command line tool that works somewhat similar to the standard built-in command `cd` — "change directory".
25
-
26
- The main difference is that `wd` is able to add/remove/list folder "shortcuts", and allows you to jump to these shortcuts from anywhere on the filesystem.
27
-
28
- This of this as a folder-navigation super-charge tool that you'd use on a most frequently-used set of folders. This becomes __really useful__ if you are often finding youself going into a small number of deeply nested folders with a long path prefix.
29
-
30
- ## Installation
31
-
32
- Three steps:
33
-
34
- - `wd` requires a Ruby interpreter version 2.2 higher.
35
- - Please Check your default ruby with `ruby --version`. You should see something like "ruby 2.3.0p0....".
36
- - If you see version 1.9 or earlier, please upgrade your ruby using the package manager native to your OS.
37
- - Install `warp-dir` ruby gem (note: you may need to prefix the command with `sudo` if you are installing into the "system" ruby namespace).
38
-
39
- ```bash
40
- $ gem install warp-dir --no-ri --no-rdoc
41
- ```
42
-
43
- - The last step is to install the `wd` BASH function and auto-completion. This step appends the required shell function to your shell initialization file, that is specified with the `--dotfile` flag.
44
-
45
- ```bash
46
- $ warp-dir install --dotfile ~/.bash_profile
47
- ```
48
-
49
- After the last step you __need to restart your session__, so – if you are on Mac OS X, – please reopen your Terminal or better yet – [iTerm2](https://www.iterm2.com/), and then type:
50
-
51
- ```bash
52
- $ wd help
53
- ```
54
-
55
- If the above command returns a properly formatted help that looks like the image below, your setup is now complete!
56
-
57
- ![Image](doc/wd-help.png?refresh=1)
58
-
59
-
60
- ## Usage
61
-
62
- __NOTE:__ in the below examples, the characters `~ ❯ ` denote the current shell prompt, showing the current folder you are in. The command to type is on the right hand side of the "❯".
63
-
64
- Let's first bookmark a long directory:
65
-
66
- ```bash
67
- ~ ❯ cd ~/workspace/arduino/robots/command-bridge/src
68
- ~/workspace/arduino/robots/command-bridge/src ❯ wd add cbsrc
69
- Warp point saved!
70
-
71
- ~/workspace/arduino/robots/command-bridge/src ❯ cd ~/workspace/c++/foo/src
72
- ~/workspace/c++/foo/src ❯ wd add foosrc
73
- Warp point saved!
74
-
75
- ~/workspace/c++/foo/src ❯ cd /usr/local/Cellar
76
- /usr/local/Cellar ❯ wd add brew
77
- Warp point saved!
78
- ```
79
-
80
- Now we can list/inspect current set of warp points:
81
-
82
- ```bash
83
- /usr/local/Cellar ❯ wd l
84
- cbsrc -> ~/workspace/arduino/robots/command-bridge/src
85
- foosrc -> ~/workspace/c++/foo/src
86
- brew -> /usr/local/Cellar
87
- ```
88
-
89
- Now we can jump around these warp points, as well as run 'ls' inside (even passing arbitrary arguments to the `ls` itself):
90
-
91
- ```bash
92
- /usr/local/Cellar ❯ wd cbsrc
93
- ~/workspace/arduino/robots/command-bridge/src ❯ wd foosrc
94
- ~/workspace/c++/foo/src ❯ 1 wd ls brew -- -alF | head -4 # run ls -alF inside /usr/local/Cellar
95
- total 0
96
- drwxrwx--- 73 kig staff 2482 May 7 15:29 ./
97
- drwxrwx--- 21 kig staff 714 Apr 28 11:40 ../
98
- drwxrwx--- 3 kig staff 102 Dec 24 03:14 ack/
99
- ```
100
-
101
- ### Command Completion
102
-
103
- If you installed `wd` properly, it should register it's own command completion for BASH and be ready for your tabs :)
104
-
105
- Note that you can use `wd` to change directory by giving an absolute or relative directory name, just like `cd` (so not just using warp-points), so when you type `wd [TAB]` you will see all saved warp points as well as the local directories you can `cd` into.
106
-
107
- That's basically it!
108
-
109
- ### Config File (aka. Warp Points Database)
110
-
111
- All of the mappings are stored in the `~/.warprc` file, where the warp point name is followed by a colon, and the path it maps to. So it's trivial to do a global search/replace on that file in your favorite editor, if, for example, a commond top level folder had changed.
112
-
113
- The format of the file was left identical to that of the `ZSH` version of `wd` so that one could switch back and force between the two versions of `wd` and still be able to use their collection of warp points.
114
-
115
- See? I think we thought of everything :)
116
-
117
- Happy warping!
118
-
119
-
120
- ## `wd` Concept
121
-
122
- The overall concept comes from the realization that when we work on the command line, we often do things that `wd` tool provides straight out of the box, such as:
123
-
124
- * we often have to deal with a limited number of folders at any given time
125
- * on occastion have to jump between these folders (which we call __warp points__), which may require mult-level `cd` command, for example: `cd ~/workspace/foo/src/include/; ....; cd ~/Documents/Microsoft\ Word/; ...`
126
- * seems like it should be easy to add, remove and list warp points
127
- * everything should require typing few characters as possible :)
128
- * it would be great to have full BASH completion support
129
-
130
- Some future extensions could be based on some additional realizations:
131
-
132
- * perhaps you might want to inspect a bookmarked folder without leaving your current place.
133
- * maybe by inspecting we mean — running a `find`, or `ls` or any other command for that matter
134
-
135
- ### Notable Differences with original `wd`
136
-
137
- * instead of `wd add!` use `wd add -f <point>` (or --force)
138
-
139
- These features will be added shortly:
140
-
141
- * for now `wd clean` is not supported
142
- * for now history is not supported
143
- * for now '-' is not supported
144
-
145
- ## Future Development
146
-
147
- I have so many cool ideas about where this can go, that I created a
148
- [dedicated page](ROADMAP.md) for the discussion of future features. Please head over
149
- there if you'ld like to participate.
150
-
151
- ## Development
152
-
153
- After checking out the repo, run `bin/setup` to install dependencies.
154
- You can also run `bin/console` for an interactive prompt that will
155
- allow you to experiment.
156
-
157
- To install this gem onto your local machine, run `bundle exec rake install`.
158
- To release a new version, update the version number in `version.rb`, and
159
- then run `bundle exec rake release`, which will create a git tag for the
160
- version, push git commits and tags, and push the `.gem` file
161
- to [rubygems.org](https://rubygems.org).
162
-
163
- ## Adding New Commands
164
-
165
- Just follow the patter in the `lib/warp/dir/commands/` folder, copy and modify
166
- one of the existing commands. Command class name is used as an actual command.
167
-
168
- ## Contributing
169
-
170
- Bug reports and pull requests are welcome on GitHub at https://github.com/kigster/warp-dir.
171
-
172
- ## Author
173
-
174
- <p>&copy; 2016 Konstantin Gredeskoul, all rights reserved.</p>
175
-
176
- ## License
177
-
178
- This project is distributed under the [MIT License](https://raw.githubusercontent.com/kigster/warp-dir/master/LICENSE).
data/ROADMAP.md DELETED
@@ -1,96 +0,0 @@
1
- # Warp Directory – Future Roadmap
2
-
3
- [![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/kigster/warp-dir)
4
-
5
- Here I'd like to document various ideas and feature requests from myself and others.
6
-
7
- ## Simplify Interface
8
-
9
- Questionable value, but this sort of interface appear a bit more consistent.
10
-
11
- Still I am not sure I want to type `wd -j proj` or `wd -a proj` instead of `wd proj` and `wd add proj`...
12
-
13
- ```bash
14
- wd -j/--jump point
15
- wd -a/--add point
16
- wd -r/--remove point
17
- wd -l/--ls point
18
- wd -p/--path point
19
-
20
- wd -L/--list
21
- wd -C/--clean
22
- wd -S/--scan # report whether points exist on the file system
23
- ```
24
-
25
- ## Run Commands In A Warp Point
26
-
27
- Pass an arbitrary command to execute, and return back to CWD.
28
-
29
- ```bash
30
- wd proj -x/--exec -- "command"
31
- ```
32
-
33
- ## Group Commands
34
-
35
- Create a group of several warp points:
36
-
37
- ```bash
38
- wd -g/--group group1 -d/--define "point1,point2,...,pointN"
39
- wd -g/--group group1 -r/--remove point1 # remove a point from the group
40
- wd -g/--group group1 -a/--add point1 # add a point to the group
41
- ```
42
-
43
- Execute command in all warp points of the group:
44
-
45
- ```bash
46
- wd -x/--exec [ -g/--group group ] [ -r/--return-code ] -- command
47
- ```
48
-
49
- As above, until one returns non-blank output (ie, search).
50
- If -r is passed, it stops at the first return code of value passed, or 0
51
-
52
- ```bash
53
- wd -f/--find [ -g/--group group ] [ -r/--return-code ] -- command
54
- ```
55
-
56
- As above, until one returns blank output. If -r is passed, it stops at the first
57
- return code not equal to the value passed, or 0
58
-
59
- ```bash
60
- wd -a/--all [ -g/--group group ] [ -r/--return-code ] -- command
61
-
62
- ```
63
-
64
- The idea here is that you can group several warp points together, and then
65
- execute a command in all of them. You could use to:
66
-
67
- * search for a specific file in one of the project repos – you expect to exist in
68
- only one of them, and so you want the search to stop once found (indicated
69
- by return code equal to 1):
70
-
71
- ```bash
72
- wd --find --group project-group --return-code=1 -- \
73
- find . -name .aws-credentials.lol
74
- ```
75
-
76
- * you want to run rspec in all projects of the group, and stop at the
77
- first non-zero return:
78
-
79
- ```bash
80
- wd --all --group project-group --return-code -- bundle exec rspec
81
- ```
82
-
83
- ## Networking
84
-
85
- Can we go across SSH?
86
-
87
- ```bash
88
- wd add proj kig@remote.server.com:~/workspace/proj
89
- wd ls proj
90
- wd proj
91
- ```
92
- This then establishes and SSH connection to the server and logs you into the shell. Should be pretty easy, I think :)
93
-
94
- ## What Else?
95
-
96
- Sky is the limit :) Well, and the black hole that the warp directory is :)