warp-dir 1.1.5 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6ec44f13babd62ebe33c745d7d7092fb952a0a9
4
- data.tar.gz: 05f95afa9a62f41cc6db11c34da440f1c198285a
3
+ metadata.gz: ce99a9d0405623c7ea50b88e363f95309c9b1773
4
+ data.tar.gz: 149746d9e2645ffaff1cb7abc422a7e3b508aafc
5
5
  SHA512:
6
- metadata.gz: d30616fa3c72e44bf067309e7c17439b9b7979f1a85a9990e1351fa0f1e14572fef2cd3b5f4b27ac1710832b8f3d53b7e3084dc5b2dbeebdacaa7956c9f6a41d
7
- data.tar.gz: f91e1dd10053a0de0fd68791b42073c2c26ef75a48891aacb0c8828aaa9d89fb08b006878f3e7c88f69f7527efb1e93d83c08d3261747d4e0b9158ddad97781a
6
+ metadata.gz: 47407f8fe071a1d127137f358aadb7a19c626522cf3bc21bf96592fe2bb378023de3a224080f5165a28f59c209d49f0fdde3575604fe12adcd0738f9eafee2f1
7
+ data.tar.gz: a67e48b9e831686f47853d14ce8b4bacf158fa8091cfafb9c7ebd574772054ef4c42c494ad4da7ae5c0b2e019b6ed69f89b074d72edf932a4d5a9e07e6f4e75c
@@ -4,7 +4,7 @@ env:
4
4
  rvm:
5
5
  - 2.2.3
6
6
  - 2.3.0
7
- script: "bundle exec rspec"
7
+ script: "gem install bundler rake --no-ri --no-rdoc; rake"
8
8
  notifications:
9
9
  email:
10
10
  recipients:
data/Rakefile CHANGED
@@ -19,10 +19,11 @@ task :reinstall do
19
19
  EOF
20
20
  end
21
21
 
22
- namespace :gemfile do
23
- desc 'Install dependencies by creating a temporary Gemfile'
22
+ namespace :development do
23
+ desc 'Setup temporary Gemfile, install all dependencies, and remove Gemfile'
24
24
  task :install => [:setup, :cleanup]
25
25
 
26
+ desc 'Setup temporary Gemfile and install all dependencies.'
26
27
  task :setup do
27
28
  sh %q{
28
29
  echo "source 'https://rubygems.org'; gemspec" > Gemfile
@@ -42,14 +43,14 @@ namespace :gemfile do
42
43
  end
43
44
  desc "Invoke Bundler's 'release' task to push the gem to RubyGems.org"
44
45
  task :release => [ :setup, :load ] do
45
- Rake::Task["release"].invoke
46
- Rake::Task["gemfile:cleanup"].invoke
46
+ Rake::Task['release'].invoke
47
+ Rake::Task['development:cleanup'].invoke
47
48
  end
48
49
 
49
- desc "Installs and invokes Bundler's 'release' task"
50
+ desc 'Package and install the gem locally'
50
51
  task :install => [ :setup, :load ] do
51
- Rake::Task["install:local"].invoke
52
- Rake::Task["gemfile:cleanup"].invoke
52
+ Rake::Task['install:local'].invoke
53
+ Rake::Task['development:cleanup'].invoke
53
54
  end
54
55
  end
55
56
  end
@@ -63,4 +64,8 @@ begin
63
64
  rescue LoadError
64
65
  end
65
66
 
67
+ task :spec => [ 'development:setup' ] do
68
+ Rake::Task['development:cleanup'].invoke
69
+ end
70
+
66
71
  task :default => [:spec]
@@ -34,13 +34,32 @@ wd_not_found() {
34
34
  }
35
35
 
36
36
  _wd() {
37
- local WDWORDS cur
37
+ local WD_OPTS WD_POINTS cur prev
38
+
39
+ cur="${COMP_WORDS[COMP_CWORD]}"
40
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
38
41
 
39
42
  COMPREPLY=()
40
- _get_comp_words_by_ref cur
41
43
 
42
- WDWORDS=$(wd list --no-color | awk '{ print $1 }')
43
- COMPREPLY=( $( compgen -W "$WDWORDS" -- "$cur" ) )
44
+ # Only perform completion if the current word starts with a dash ('-'),
45
+ # meaning that the user is trying to complete an option.
46
+ if [[ ${cur} == -* ]] ; then
47
+ # COMPREPLY is the array of possible completions, generated with
48
+ WD_COMP_OPTIONS=$(wd --help | awk 'BEGIN{FS="--"}{print "--" $2}' | sed -E '/^--$/d' | egrep -v ']|help' | egrep -- "${cur}" | awk '{if ($1 != "") { printf "%s\n", $1} } ')
49
+ else
50
+ WD_COMMANDS="add ls remove warp install help list"
51
+ if [[ -z "${cur}" ]] ; then
52
+ WD_POINTS=$(wd list --no-color | awk '{ print $1 }')
53
+ WD_DIRS=$(ls -1p | grep '/')
54
+ else
55
+ WD_POINTS=$(wd list --no-color | awk '{ print $1 }' | egrep -e "^${cur}")
56
+ WD_DIRS=$(ls -1p | grep '/' | egrep -e "^${cur}")
57
+ fi
58
+ WD_COMP_OPTIONS="$WD_POINTS $WD_DIRS"
59
+ fi
60
+ [[ $COMP_CWORD == 1 ]] && WD_COMP_OPTIONS="${WD_COMP_OPTIONS} ${WD_COMMANDS}"
61
+ COMPREPLY=( $(compgen -W "${WD_COMP_OPTIONS}" -- ${cur}) )
62
+ return 0
44
63
  }
45
64
 
46
65
  complete -F _wd wd
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- require 'bundler/setup'
3
2
  require 'warp/dir'
4
3
  require 'slop'
5
4
  require 'colored'
@@ -1,7 +1,7 @@
1
1
  require_relative '../../colored'
2
2
  module Warp
3
3
  module Dir
4
- VERSION = '1.1.5'
4
+ VERSION = '1.2.0'
5
5
 
6
6
  @install_notice = <<-EOF
7
7
 
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.required_ruby_version = '>= 2.0.0'
24
24
  s.required_rubygems_version = '>= 1.3.6'
25
25
 
26
- s.add_runtime_dependency('slop', '~> 4.2')
26
+ s.add_dependency('slop', '~> 4.2')
27
27
 
28
28
  s.add_development_dependency 'codeclimate-test-reporter', '~> 0.5'
29
29
  s.add_development_dependency 'bundler', '~> 1.11'
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.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-14 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop