pry-vterm_aliases 0.0.4 → 0.0.5

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.
@@ -15,7 +15,7 @@ unless RbConfig::CONFIG['host_os'] =~ /mswin/
15
15
  class Pry::Plugins::VTerm
16
16
  class << self
17
17
  def version
18
- '0.0.4'
18
+ '0.0.5'
19
19
  end
20
20
 
21
21
  def aliases
@@ -25,6 +25,6 @@ unless RbConfig::CONFIG['host_os'] =~ /mswin/
25
25
  end
26
26
 
27
27
  case ENV['SHELL']
28
- when '/bin/bash' then require 'pry/aliases/bash'
28
+ when %r!/(?:bash|zsh)\Z! then require 'pry/aliases/common'
29
29
  end
30
30
  end
@@ -0,0 +1,13 @@
1
+ class Pry::Plugins::VTerm
2
+ class << self
3
+ command = 'bash'
4
+ if ENV['SHELL'] =~ %r!/zsh\Z!
5
+ command = 'zsh'
6
+ end
7
+
8
+ @@aliases = `#{command} -i -c 'alias'`.gsub(/\Aalias\s{1}/, '').split(/\salias/).inject({}) do |hash, cmd|
9
+ cmd = cmd.split('=\'')
10
+ hash.update({cmd.first.strip => cmd.last.gsub(/'\Z/, '')})
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-vterm_aliases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
16
- requirement: &14930520 !ruby/object:Gem::Requirement
16
+ requirement: &20786700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.9.8
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *14930520
24
+ version_requirements: *20786700
25
25
  description: Preserve your VTerm aliases in Pry.
26
26
  email:
27
27
  - jordon@envygeeks.com
@@ -31,7 +31,7 @@ extra_rdoc_files: []
31
31
  files:
32
32
  - readme.md
33
33
  - license.txt
34
- - lib/pry/aliases/bash.rb
34
+ - lib/pry/aliases/common.rb
35
35
  - lib/pry-vterm_aliases.rb
36
36
  - rakefile.rb
37
37
  - gemfile.rb
@@ -1,8 +0,0 @@
1
- class Pry::Plugins::VTerm
2
- class << self
3
- @@aliases = `bash -i -c 'alias'`.gsub(/\Aalias\s{1}/, '').split(/\salias/).inject({}) do |bash_hash, bash_alias|
4
- bash_alias = bash_alias.split('=\'')
5
- bash_hash.update({bash_alias.first.strip => bash_alias.last.gsub(/'\Z/, '')})
6
- end
7
- end
8
- end