warp-dir 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/warp-dir.iml +12 -11
- data/README.md +37 -15
- data/lib/warp/dir/app/cli.rb +1 -1
- data/lib/warp/dir/command/help.rb +17 -8
- data/lib/warp/dir/command/install.rb +1 -1
- data/lib/warp/dir/command/warp.rb +11 -4
- data/lib/warp/dir/version.rb +1 -1
- data/lib/warp/dir.rb +3 -1
- data/spec/warp/dir/app/cli_spec.rb +14 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a03aa1db919b1fdb774efb8365b27f4fe08b2d2f
|
|
4
|
+
data.tar.gz: 1af544ccadb6429c650769e117c84deb6569b01c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23d52072aac9a4b8cc9bbb53d0f62f76fcfc24c011ca46c97b7d830ae13fbef0d8ccd636d0e28c8947572f063eccd8c135fd0b8aaf6ec1fdc72efd7f1ec75d37
|
|
7
|
+
data.tar.gz: a32e4f31ec0610d42933c23d8159c53d3da24c50afa012698f01f25d5eea5340a64e85a9aa507d6888cb6561101787e75eb73c41e3a487d5b5c5b340490e5739
|
data/.idea/warp-dir.iml
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="true" />
|
|
42
42
|
<method />
|
|
43
43
|
</configuration>
|
|
44
|
-
<configuration default="false" name="
|
|
44
|
+
<configuration default="false" name="Warp::Dir::Store with no existin warprc file creates the file when adding points: warp-dir" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
|
45
45
|
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
|
46
46
|
<module name="warp-dir" />
|
|
47
47
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/warp/dir/store_spec.rb" />
|
|
64
64
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
|
65
65
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
|
66
|
-
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
|
|
66
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::Store with no existin warprc file creates the file when adding points" />
|
|
67
67
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
|
68
68
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
|
69
69
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
|
75
75
|
<method />
|
|
76
76
|
</configuration>
|
|
77
|
-
<configuration default="false" name="Warp::Dir::Store
|
|
77
|
+
<configuration default="false" name="Warp::Dir::Store: warp-dir" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
|
78
78
|
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
|
79
79
|
<module name="warp-dir" />
|
|
80
80
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/warp/dir/store_spec.rb" />
|
|
97
97
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
|
98
98
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
|
99
|
-
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::Store
|
|
99
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::Store" />
|
|
100
100
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
|
101
101
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
|
102
102
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
|
108
108
|
<method />
|
|
109
109
|
</configuration>
|
|
110
|
-
<configuration default="false" name="Warp::Dir::
|
|
110
|
+
<configuration default="false" name="Warp::Dir::App::CLI: warp-dir" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
|
111
111
|
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
|
112
112
|
<module name="warp-dir" />
|
|
113
113
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
|
@@ -126,10 +126,10 @@
|
|
|
126
126
|
</COVERAGE_PATTERN>
|
|
127
127
|
</EXTENSION>
|
|
128
128
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
|
129
|
-
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/warp/dir/
|
|
129
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/warp/dir/app/cli_spec.rb" />
|
|
130
130
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
|
131
131
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
|
132
|
-
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::
|
|
132
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::App::CLI" />
|
|
133
133
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
|
134
134
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
|
135
135
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
|
141
141
|
<method />
|
|
142
142
|
</configuration>
|
|
143
|
-
<configuration default="false" name="Warp::Dir::App::CLI
|
|
143
|
+
<configuration default="false" name="Warp::Dir::App::CLI when running command with a point arg, such as warp <point>: warp-dir" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
|
144
144
|
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
|
145
145
|
<module name="warp-dir" />
|
|
146
146
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/warp/dir/app/cli_spec.rb" />
|
|
163
163
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
|
164
164
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
|
165
|
-
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::App::CLI" />
|
|
165
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::App::CLI when running command with a point arg, such as warp <point>" />
|
|
166
166
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
|
167
167
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
|
168
168
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
|
174
174
|
<method />
|
|
175
175
|
</configuration>
|
|
176
|
-
<configuration default="false" name="Warp::Dir::App::CLI when running command with a point arg, such as
|
|
176
|
+
<configuration default="false" name="Warp::Dir::App::CLI when running command with a point arg, such as warp <point> when using --command: warp-dir" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
|
177
177
|
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
|
178
178
|
<module name="warp-dir" />
|
|
179
179
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/warp/dir/app/cli_spec.rb" />
|
|
196
196
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
|
197
197
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
|
198
|
-
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::App::CLI when running command with a point arg, such as
|
|
198
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="Warp::Dir::App::CLI when running command with a point arg, such as warp <point> when using --command" />
|
|
199
199
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
|
200
200
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
|
201
201
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
|
@@ -216,6 +216,7 @@
|
|
|
216
216
|
<orderEntry type="jdk" jdkName="ruby-2.3.0-p0" jdkType="RUBY_SDK" />
|
|
217
217
|
<orderEntry type="sourceFolder" forTests="false" />
|
|
218
218
|
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.11.2, ruby-2.3.0-p0) [gem]" level="application" />
|
|
219
|
+
<orderEntry type="library" scope="PROVIDED" name="chef (v12.6.0, ruby-2.3.0-p0) [gem]" level="application" />
|
|
219
220
|
<orderEntry type="library" scope="PROVIDED" name="codeclimate-test-reporter (v0.5.0, ruby-2.3.0-p0) [gem]" level="application" />
|
|
220
221
|
<orderEntry type="library" scope="PROVIDED" name="colored (v1.2, ruby-2.3.0-p0) [gem]" level="application" />
|
|
221
222
|
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, ruby-2.3.0-p0) [gem]" level="application" />
|
data/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Warp Directory
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/warp-dir)
|
|
3
4
|
[](https://travis-ci.org/kigster/warp-dir)
|
|
4
5
|
[](https://codeclimate.com/github/kigster/warp-dir)
|
|
5
6
|
[](https://codeclimate.com/github/kigster/warp-dir/coverage)
|
|
@@ -37,7 +38,7 @@ Some future extensions could be based on some additional realizations:
|
|
|
37
38
|
Add this line to your application's Gemfile:
|
|
38
39
|
|
|
39
40
|
```ruby
|
|
40
|
-
gem 'warp-dir'
|
|
41
|
+
gem 'warp-dir'
|
|
41
42
|
```
|
|
42
43
|
And then execute:
|
|
43
44
|
|
|
@@ -47,20 +48,18 @@ Or install it yourself as:
|
|
|
47
48
|
|
|
48
49
|
$ gem install warp-dir --no-ri --no-rdoc
|
|
49
50
|
|
|
50
|
-
After the installation, you will have the `warp-dir` command in the path
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
After the installation, you will have the `warp-dir` command in the path. You can use
|
|
52
|
+
this command almost like `wd` except it can not warp you to another folder due to
|
|
53
|
+
UNIX parent/child process restrictions. To do that you need to also install the shell
|
|
54
|
+
function wrapper in your `~/.bashrc` or similar file:
|
|
54
55
|
|
|
55
|
-
You can do it
|
|
56
|
+
You can do like so (if you don't provide file, it will install in `~/.bashrc`, `~/.bash_profile`
|
|
57
|
+
or `~/.profile` whichever works first, – so use `--file` to override it if you need to).
|
|
56
58
|
|
|
57
|
-
$ warp-dir install [ --
|
|
59
|
+
$ warp-dir install [ --dotfile <file> ]
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`--file` option, it will only add the shell function to the file specified.
|
|
62
|
-
|
|
63
|
-
And after that you should be able to get the helpful message below by typing:
|
|
61
|
+
And after that you need to restart your sheel, and then you should be able to get the
|
|
62
|
+
helpful message below by typing:
|
|
64
63
|
|
|
65
64
|
$ wd help
|
|
66
65
|
|
|
@@ -69,14 +68,37 @@ is now complete!
|
|
|
69
68
|
|
|
70
69
|
## Usage
|
|
71
70
|
|
|
72
|
-
The usage of the tool is
|
|
71
|
+
The usage of the tool is derived from `ZSH`-based inspiration. If it ain't broke, don't fix it!
|
|
72
|
+
I like how `wd` can be used with very short warp points, so it's so much less typing. I often name
|
|
73
|
+
my points `pu` so that I can jump there with `wd pu`.
|
|
74
|
+
|
|
75
|
+
Unlike ZSH counterpart, this tool includes full command line parsing, so
|
|
76
|
+
you can (if you want to) use flags to achieve the same effect with more
|
|
77
|
+
characters to type, for example all below commands do the same thing.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
wd pu
|
|
81
|
+
wd --warp --point pu
|
|
82
|
+
wd -m warp -p pu
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
You can run a comman in the target directory without leaving the current via
|
|
86
|
+
`wd ls pu`, but in this implementation you can also pass arguments to `ls` after
|
|
87
|
+
the `--` in argument list, for example, to run `ls -1` I would do `wd ls pu -- -1`.
|
|
88
|
+
|
|
89
|
+
Here is a full command / help summary.
|
|
73
90
|
|
|
74
|
-

|
|
75
92
|
|
|
76
93
|
#### Notable Differences
|
|
77
94
|
|
|
78
95
|
* instead of `wd add!` use `wd add -f <point>` (or --force)
|
|
79
|
-
|
|
96
|
+
|
|
97
|
+
These features will be added shortly:
|
|
98
|
+
|
|
99
|
+
* for now `wd clean` is not supported
|
|
100
|
+
* for now history is not supported
|
|
101
|
+
* for now '-' is not supported
|
|
80
102
|
|
|
81
103
|
## Future Development
|
|
82
104
|
|
data/lib/warp/dir/app/cli.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Warp
|
|
|
35
35
|
self.store = Warp::Dir::Store.new(config, Warp::Dir::Serializer::Dotfile)
|
|
36
36
|
|
|
37
37
|
config.command = :help if (opts.help? || no_arguments)
|
|
38
|
-
config.command = :warp if
|
|
38
|
+
config.command = :warp if config.warp || config.command == 'warp'
|
|
39
39
|
|
|
40
40
|
if config[:command]
|
|
41
41
|
self.validated = true
|
|
@@ -7,26 +7,35 @@ class Warp::Dir::Command::Help < Warp::Dir::Command
|
|
|
7
7
|
|
|
8
8
|
def run(opts, flags = [])
|
|
9
9
|
commander = ::Warp::Dir.commander
|
|
10
|
+
cmd = self
|
|
10
11
|
on :success do
|
|
11
12
|
message USAGE
|
|
12
13
|
message ' '
|
|
13
14
|
message 'Warp Point Commands:'.bold.green
|
|
14
15
|
message ' '
|
|
15
|
-
|
|
16
|
-
message sprintf(" %s\n", commander.find(installed_commands).help)
|
|
17
|
-
end
|
|
16
|
+
message cmd.commands_needing_points(commander, needing_point: true)
|
|
18
17
|
message ' '
|
|
19
18
|
message 'Global Commands:'.bold.green
|
|
20
19
|
message ' '
|
|
21
|
-
|
|
22
|
-
message sprintf(" %s\n", commander.find(installed_commands).help)
|
|
23
|
-
end
|
|
20
|
+
message cmd.commands_needing_points(commander, needing_point: false)
|
|
24
21
|
message EXAMPLES
|
|
25
22
|
message INSTALLATION
|
|
26
23
|
message opts.to_s
|
|
27
24
|
end
|
|
28
25
|
end
|
|
29
26
|
|
|
27
|
+
def commands_needing_points(commander,
|
|
28
|
+
needing_point: true)
|
|
29
|
+
help = ''
|
|
30
|
+
commander.
|
|
31
|
+
commands.
|
|
32
|
+
select{|cmd| needing_point ? cmd.needs_a_point? : !cmd.needs_a_point? }.
|
|
33
|
+
map(&:command_name).each do |installed_commands|
|
|
34
|
+
help << sprintf(" %s\n", commander.find(installed_commands).help)
|
|
35
|
+
end
|
|
36
|
+
help
|
|
37
|
+
end
|
|
38
|
+
|
|
30
39
|
USAGE = <<EOF
|
|
31
40
|
#{"Usage:".bold.green} wd [ --command ] [ list | help ] [ wd-flags ]
|
|
32
41
|
wd [ --command ] [ [ warp ] | add [-f] | rm | ls ] [ wd flags ] <point> -- [ cmd-flags ]
|
|
@@ -47,8 +56,8 @@ EOF
|
|
|
47
56
|
INSTALLATION = <<EOF
|
|
48
57
|
|
|
49
58
|
#{'Installation'.bold.green}
|
|
50
|
-
It appears that you already have a wrapper installed in one of
|
|
51
|
-
shell init files (#{::Warp::Dir::DOTFILES.join(', ')}
|
|
59
|
+
It appears that you already have a wrapper installed in one of the default
|
|
60
|
+
shell init files (#{::Warp::Dir::DOTFILES.join(', ')}).
|
|
52
61
|
|
|
53
62
|
Which means that 'wd' should be working on your system. If not, edit your
|
|
54
63
|
shell init file, remove any lines related to warp-dir gem, and then reinstall:
|
|
@@ -32,7 +32,7 @@ class Warp::Dir::Command::Install < Warp::Dir::Command
|
|
|
32
32
|
|
|
33
33
|
def run(*args)
|
|
34
34
|
self.shell_init_files = config[:dotfile].split(',') if config[:dotfile]
|
|
35
|
-
self.shell_init_files.
|
|
35
|
+
self.shell_init_files.any? { |dotfile| append_wrapper_to(dotfile) }
|
|
36
36
|
local_existing = self.existing
|
|
37
37
|
local_installed = self.installed
|
|
38
38
|
local_shell_files = self.shell_init_files
|
|
@@ -10,12 +10,19 @@ module Warp
|
|
|
10
10
|
|
|
11
11
|
def run(*args)
|
|
12
12
|
if point.nil? && point_name
|
|
13
|
-
|
|
13
|
+
begin
|
|
14
|
+
self.point = store[point_name]
|
|
15
|
+
rescue ::Warp::Dir::Errors::PointNotFound
|
|
16
|
+
end
|
|
14
17
|
end
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
warp_to_path = if point
|
|
19
|
+
point.absolute_path
|
|
20
|
+
else
|
|
21
|
+
point_name if ::Dir.exist?(point_name.to_s)
|
|
22
|
+
end
|
|
23
|
+
raise ::Warp::Dir::Errors::PointNotFound.new(point_name) unless warp_to_path
|
|
17
24
|
on :shell do
|
|
18
|
-
message "cd #{
|
|
25
|
+
message "cd #{warp_to_path}"
|
|
19
26
|
end
|
|
20
27
|
end
|
|
21
28
|
end
|
data/lib/warp/dir/version.rb
CHANGED
data/lib/warp/dir.rb
CHANGED
|
@@ -3,7 +3,9 @@ module Warp
|
|
|
3
3
|
PROJECT_HOME = PROJECT_LIBS + '/../..'
|
|
4
4
|
|
|
5
5
|
module Dir
|
|
6
|
-
|
|
6
|
+
# tried in order.
|
|
7
|
+
DOTFILES = %w(~/.bashrc ~/.bash_profile ~/.profile)
|
|
8
|
+
|
|
7
9
|
SHELL_WRAPPER = "#{PROJECT_HOME}/bin/warp-dir.bash"
|
|
8
10
|
|
|
9
11
|
class << self
|
|
@@ -129,6 +129,20 @@ RSpec.describe Warp::Dir::App::CLI do
|
|
|
129
129
|
}
|
|
130
130
|
expect(warp_args).to output("cd #{wp_path}")
|
|
131
131
|
end
|
|
132
|
+
|
|
133
|
+
describe 'when using --command' do
|
|
134
|
+
let(:warp_args) { "--command warp -p #{wp_name} #{warprc}"}
|
|
135
|
+
it "should return response with a 'cd' to a warp point" do
|
|
136
|
+
warp_point = wp_name
|
|
137
|
+
expect(warp_args).to validate { |cli|
|
|
138
|
+
expect(cli.config.point).to eql(warp_point.to_s)
|
|
139
|
+
expect(cli.config.command).to eql(:warp)
|
|
140
|
+
expect(cli.store[warp_point]).to eql(Warp::Dir::Point.new(wp_name, wp_path))
|
|
141
|
+
}
|
|
142
|
+
expect(warp_args).to output("cd #{wp_path}")
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
end
|
|
132
146
|
end
|
|
133
147
|
|
|
134
148
|
describe 'remove <point>' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: warp-dir
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Konstantin Gredeskoul
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: slop
|
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
206
206
|
version: '0'
|
|
207
207
|
requirements: []
|
|
208
208
|
rubyforge_project:
|
|
209
|
-
rubygems_version: 2.5.1
|
|
209
|
+
rubygems_version: 2.4.5.1
|
|
210
210
|
signing_key:
|
|
211
211
|
specification_version: 4
|
|
212
212
|
summary: Warp-Dir (aka 'wd') is a command line tool that lets you bookmark any folders,
|
|
@@ -226,3 +226,4 @@ test_files:
|
|
|
226
226
|
- spec/warp/dir/formatter_spec.rb
|
|
227
227
|
- spec/warp/dir/point_spec.rb
|
|
228
228
|
- spec/warp/dir/store_spec.rb
|
|
229
|
+
has_rdoc:
|