warp-dir 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,21 +2,24 @@ language: ruby
2
2
  env:
3
3
  - CODECLIMATE_REPO_TOKEN=5306e7c3069bd3fef06f717d679f41e969e13bb05efef5bbe1fd781043b0c117
4
4
  rvm:
5
- - 2.2.7
6
- - 2.3.4
7
- - 2.4.1
5
+ - 2.3.8
6
+ - 2.4.9
7
+ - 2.5.7
8
+ - 2.6.5
9
+ - 2.7.0
8
10
  before_install:
9
- - gem install bundler --no-ri --no-rdoc
10
- after_success:
11
- - codeclimate-test-reporter
12
- script: rake
11
+ - gem update --system
12
+ - gem install bundler
13
+ - bundle install --jobs 10 --redownload
14
+ before_script:
15
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
16
+ - chmod +x ./cc-test-reporter
17
+ - ./cc-test-reporter before-build
18
+ script:
19
+ - USER=travis bundle exec rspec --format documentation
20
+ after_script:
21
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
13
22
  cache: bundler
14
- notifications:
15
- email:
16
- recipients:
17
- - kigster@gmail.com
18
- on_success: change
19
- on_failure: always
20
23
  addons:
21
24
  code_climate:
22
25
  repo_token:
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ gem 'rubocop'
8
+ if RUBY_VERSION.to_f > 2.3
9
+ gem 'simplecov'
10
+ end
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
- task :reinstall do
1
+ task :reinstall => [ :'development:cleanup' ] do
2
2
  [ %q(chmod -R o+r .),
3
3
  %q(rm -f *.gem),
4
- %q(rm -rf build),
5
4
  %q(gem uninstall -quiet -a --executables warp-dir 2> /dev/null; true),
6
5
  %q(gem build warp-dir.gemspec)
7
6
  ].each do |command|
@@ -12,9 +11,9 @@ task :reinstall do
12
11
  export gem_file=$(ls -1 *.gem | tail -1)
13
12
  export gem_name=${gem_file//.gem/}
14
13
  if [ "$(which ruby)" == "/usr/bin/ruby" ]; then
15
- gem install $gem_file -n /usr/local/bin --no-ri --no-rdoc
14
+ gem install $gem_file -n /usr/local/bin
16
15
  else
17
- gem install $gem_file --no-ri --no-rdoc
16
+ gem install $gem_file
18
17
  fi
19
18
  EOF
20
19
  end
@@ -26,14 +25,12 @@ namespace :development do
26
25
  desc 'Setup temporary Gemfile and install all dependencies.'
27
26
  task :setup do
28
27
  sh %q{
29
- echo "source 'https://rubygems.org'; gemspec" > Gemfile
30
- [[ -n $(which bundle) ]] || gem install bundler --no-ri --no-rdoc --quiet
31
- bundle install --quiet
28
+ bundle install
32
29
  }.gsub(%r{^\s+}m, '')
33
30
  end
34
31
 
35
32
  task :cleanup do
36
- sh %q{ rm -f Gemfile }
33
+ sh %q{ rm -f build }
37
34
  end
38
35
 
39
36
  namespace :bundler do
@@ -7,44 +7,54 @@
7
7
  #
8
8
  #
9
9
  wd() {
10
- if [ -z "${warp_dir_exec_installed}" -o "${warp_dir_exec_installed}" == "1" ]; then
11
- $(which 'warp-dir') 2>&1 > /dev/null
10
+ if [[ -z "${warp_dir_exec_installed}" || "${warp_dir_exec_installed}" -eq 1 ]]; then
11
+ $(which 'warp-dir') 2>&1 1>/dev/null
12
12
  export warp_dir_exec_installed=$?
13
13
  fi
14
14
 
15
- if [ ${warp_dir_exec_installed} -eq 0 ]; then
16
- IFS_BACKUP=$IFS
17
- IFS="+"
18
- output=$(WARP_DIR_SHELL=yes warp-dir $@ 2>&1)
15
+ if [[ ${warp_dir_exec_installed} -ne 0 ]]; then
16
+ wd_not_found
17
+ return 1
18
+ fi
19
+
20
+ local previous_ifs=$IFS
21
+ IFS="+"
22
+
23
+ local output=$(WARP_DIR_SHELL=yes RUBYOPT="-W0" warp-dir $@ 2>&1)
24
+ local code=$?
25
+
26
+ if [[ $code -eq 127 ]]; then
27
+ [[ -n $(command -v rbenv) ]] && rbenv rehash >/dev/null 2>&1
28
+ output=$(WARP_DIR_SHELL=yes RUBYOPT="-W0" warp-dir $@ 2>&1)
19
29
  code=$?
20
30
  if [ $code -eq 127 ]; then
21
31
  unset warp_dir_exec_installed
22
32
  wd_not_found
23
- else
24
- eval ${output}
25
- IFS=$IFS_BACKUP
33
+ IFS=$previous_ifs
34
+ return 1
26
35
  fi
27
- else
28
- wd_not_found
29
36
  fi
37
+
38
+ eval "${output}"
39
+ export IFS=$previous_ifs
30
40
  }
31
41
 
32
42
  wd_not_found() {
33
- printf "\nWhoops – I can't find 'warp-dir' executable.\n"
34
- printf "Is the gem properly installed?\n"
35
- printf "\nTry reinstalling the gem with, for example:\n\n"
36
- printf " $ gem install warp-dir --no-wrappers\n"
37
- printf " $ hash -r\n"
38
- printf " $ warp-dir install [ --dotfile ~/.bashrc ]\n"
43
+ printf "\nWhoops – I can't find 'warp-dir' executable.\n"
44
+ printf "Is the gem properly installed?\n"
45
+ printf "\nTry reinstalling the gem with, for example:\n\n"
46
+ printf " $ gem install warp-dir --no-wrappers\n"
47
+ printf " $ hash -r\n"
48
+ printf " $ warp-dir install [ --dotfile ~/.bashrc ]\n"
39
49
  }
40
50
 
41
51
  _wd() {
42
- local WD_OPTS WD_POINTS cur prev
52
+ local WD_OPTS WD_POINTS cur prev
43
53
 
44
- cur="${COMP_WORDS[COMP_CWORD]}"
45
- prev="${COMP_WORDS[COMP_CWORD-1]}"
54
+ cur="${COMP_WORDS[COMP_CWORD]}"
55
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
46
56
 
47
- COMPREPLY=()
57
+ COMPREPLY=()
48
58
 
49
59
  # Only perform completion if the current word starts with a dash ('-'),
50
60
  # meaning that the user is trying to complete an option.
@@ -65,6 +75,6 @@ _wd() {
65
75
  [[ $COMP_CWORD == 1 ]] && WD_COMP_OPTIONS="${WD_COMP_OPTIONS} ${WD_COMMANDS}"
66
76
  COMPREPLY=( $(compgen -W "${WD_COMP_OPTIONS}" -- ${cur}) )
67
77
  return 0
68
- }
78
+ }
69
79
 
70
80
  complete -F _wd wd
@@ -80,8 +80,8 @@ module Warp
80
80
  end
81
81
 
82
82
  # a version of add that save right after.
83
- def insert(*args)
84
- add(*args)
83
+ def insert(**opts)
84
+ add(**opts)
85
85
  save!
86
86
  end
87
87
 
@@ -1,27 +1,29 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../../colored'
2
4
  module Warp
3
5
  module Dir
4
- VERSION = '1.6.1'
6
+ VERSION = '1.6.2'
5
7
 
6
- @install_notice = <<-EOF
8
+ @install_notice = <<~EOF
7
9
 
8
- #{'>>> PLEASE READ THIS! '.bold.yellow}
10
+ #{'>>> PLEASE READ THIS! '.bold.yellow}
9
11
 
10
- For this gem to work, you must also install the coupled shell function
11
- into your shell initialization file. The following command should complete the
12
- setup (but please change '~/.bash_login' with whatever you use for shell
13
- initialization, although for most situations ~/.bash_login is good enough).
12
+ For this gem to work, you must also install the coupled shell function
13
+ into your shell initialization file. The following command should complete the
14
+ setup (but please change '~/.bash_profile' with whatever you use for shell
15
+ initialization, although for most situations ~/.bash_profile is good enough).
14
16
 
15
17
  EOF
16
18
  @install_notice += <<-EOF.bold.green
17
- $ warp-dir install --dotfile ~/.bash_login
19
+ $ warp-dir install --dotfile ~/.bash_profile
18
20
 
19
21
  EOF
20
- @install_notice += <<-EOF
21
- Restart your shell, and you should now have 'wd' shell function that
22
- should be used instead of the warp-dir executable.
22
+ @install_notice += <<~EOF
23
+ Restart your shell, and you should now have 'wd' shell function that
24
+ should be used instead of the warp-dir executable.
23
25
 
24
- Start with:
26
+ Start with:
25
27
 
26
28
  EOF
27
29
  @install_notice += <<-EOF.bold.blue
@@ -29,14 +31,13 @@ Start with:
29
31
  $ wd <directory> # change directory – works just like "cd"
30
32
  $ wd add <name> # add current directory as a warp point, call it <name>
31
33
  EOF
32
- @install_notice += <<-EOF
34
+ @install_notice += <<~EOF
33
35
 
34
- Please submit issues to:
35
- https://github.com/kigster/warp-dir
36
+ Please submit issues and pull requests to:
37
+ https://github.com/kigster/warp-dir
36
38
 
37
- Thank you!
39
+ Thank you!
38
40
  EOF
39
41
  INSTALL_NOTICE = @install_notice
40
42
  end
41
43
  end
42
-
@@ -1,5 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib/', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $:.unshift lib unless $:.include?(lib)
4
5
  require 'warp/dir/version'
5
6
 
@@ -10,25 +11,24 @@ Gem::Specification.new do |s|
10
11
  s.email = ['kig@reinvent.one']
11
12
  s.version = Warp::Dir::VERSION
12
13
  s.summary = %q{Warp-Dir (aka 'wd') replaces 'cd' and lets you instantly move between saved "warp points" and regular folders.}
13
- s.description = %q{Warp-Dir is compatible (and inspired by) the popular 'wd' tool available as a ZSH module. This one is written in ruby and so it should work in any shell. Credits for the original zsh-only tool go to (https://github.com/mfaerevaag/wd).}
14
+ s.description = "Warp-Dir is compatible (and inspired by) the popular 'wd' tool available as a ZSH module. This one is written in ruby and so it should work in any shell. Credits for the original zsh-only tool go to (https://github.com/mfaerevaag/wd)."
14
15
  s.homepage = 'https://github.com/kigster/warp-dir'
15
16
  s.files = `git ls-files`.split($\).reject{ |f| f.match(%r{^(doc|spec)/}) }
16
17
 
17
- s.executables << 'warp-dir'
18
- s.bindir = 'exe'
18
+ s.executables << 'warp-dir'
19
+ s.bindir = 'exe'
19
20
 
20
21
  s.post_install_message = ::Warp::Dir::INSTALL_NOTICE
21
22
  s.require_paths = %w(lib)
22
23
 
23
- s.required_ruby_version = '>= 2.0.0'
24
+ s.required_ruby_version = '>= 2.3.0'
24
25
  s.required_rubygems_version = '>= 1.3.6'
25
26
 
26
27
  s.add_dependency('slop', '~> 4.2')
27
28
 
28
29
  s.add_development_dependency 'bundler'
29
- s.add_development_dependency 'simplecov'
30
+ s.add_development_dependency 'codeclimate-test-reporter'
30
31
  s.add_development_dependency 'rake'
31
32
  s.add_development_dependency 'rspec', '~> 3.6'
32
33
  s.add_development_dependency 'rspec-its'
33
- s.add_development_dependency 'codeclimate-test-reporter'
34
34
  end
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.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: simplecov
42
+ name: codeclimate-test-reporter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: codeclimate-test-reporter
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  description: Warp-Dir is compatible (and inspired by) the popular 'wd' tool available
112
98
  as a ZSH module. This one is written in ruby and so it should work in any shell.
113
99
  Credits for the original zsh-only tool go to (https://github.com/mfaerevaag/wd).
@@ -125,9 +111,11 @@ files:
125
111
  - ".idea/modules.xml"
126
112
  - ".idea/runConfigurations/All_Specs.xml"
127
113
  - ".idea/vcs.xml"
114
+ - ".relaxed-rubocop-2.4.yml"
128
115
  - ".rspec"
129
116
  - ".rubocop.yml"
130
117
  - ".travis.yml"
118
+ - Gemfile
131
119
  - Guardfile
132
120
  - LICENSE
133
121
  - README.md
@@ -167,14 +155,14 @@ licenses:
167
155
  metadata: {}
168
156
  post_install_message: "\n\e[33m\e[1m>>> PLEASE READ THIS! \e[0m\e[0m\n\nFor this gem
169
157
  to work, you must also install the coupled shell function\ninto your shell initialization
170
- file. The following command should complete the\nsetup (but please change '~/.bash_login'
171
- with whatever you use for shell\ninitialization, although for most situations ~/.bash_login
172
- is good enough).\n\n\e[32m\e[1m $ warp-dir install --dotfile ~/.bash_login\n\n\e[0m\e[0mRestart
158
+ file. The following command should complete the\nsetup (but please change '~/.bash_profile'
159
+ with whatever you use for shell\ninitialization, although for most situations ~/.bash_profile
160
+ is good enough).\n\n\e[32m\e[1m $ warp-dir install --dotfile ~/.bash_profile\n\n\e[0m\e[0mRestart
173
161
  your shell, and you should now have 'wd' shell function that\nshould be used instead
174
162
  of the warp-dir executable.\n\nStart with:\n\n\e[34m\e[1m $ wd help\n $ wd <directory>
175
163
  \ # change directory – works just like \"cd\"\n $ wd add <name> # add current
176
- directory as a warp point, call it <name>\n\e[0m\e[0m\nPlease submit issues to:\nhttps://github.com/kigster/warp-dir\n\nThank
177
- you!\n"
164
+ directory as a warp point, call it <name>\n\e[0m\e[0m\nPlease submit issues and
165
+ pull requests to:\nhttps://github.com/kigster/warp-dir\n\nThank you!\n"
178
166
  rdoc_options: []
179
167
  require_paths:
180
168
  - lib
@@ -182,15 +170,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
170
  requirements:
183
171
  - - ">="
184
172
  - !ruby/object:Gem::Version
185
- version: 2.0.0
173
+ version: 2.3.0
186
174
  required_rubygems_version: !ruby/object:Gem::Requirement
187
175
  requirements:
188
176
  - - ">="
189
177
  - !ruby/object:Gem::Version
190
178
  version: 1.3.6
191
179
  requirements: []
192
- rubyforge_project:
193
- rubygems_version: 2.7.7
180
+ rubygems_version: 3.1.2
194
181
  signing_key:
195
182
  specification_version: 4
196
183
  summary: Warp-Dir (aka 'wd') replaces 'cd' and lets you instantly move between saved