pry-vterm_aliases 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/gemfile.rb ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,30 @@
1
+ $:.unshift File.dirname(__FILE__) and require 'pry'
2
+ unless defined? Pry::Plugins
3
+ Pry.const_set :Plugins, Class.new
4
+ end
5
+
6
+ unless RbConfig::CONFIG['host_os'] =~ /mswin/
7
+ Pry::Commands.block_command /\.(.*)/, '.shell commands' do |cmd|
8
+ if defined?(Pry::Plugins::VTerm) && Pry::Plugins::VTerm.aliases.include?(cmd)
9
+ cmd = Pry::Plugins::VTerm.aliases[cmd]
10
+ end
11
+
12
+ Pry.config.system.call Pry.output, cmd
13
+ end
14
+
15
+ class Pry::Plugins::VTerm
16
+ class << self
17
+ def version
18
+ '0.0.4'
19
+ end
20
+
21
+ def aliases
22
+ return @@aliases || {}
23
+ end
24
+ end
25
+ end
26
+
27
+ case ENV['SHELL']
28
+ when '/bin/bash' then require 'pry/aliases/bash'
29
+ end
30
+ end
data/license.txt ADDED
@@ -0,0 +1,17 @@
1
+ Copyright (c) 2011 Jordon Bedwell
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in the
5
+ Software without restriction, including without limitation the rights to use,
6
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions: The above copyright notice and this
9
+ permission notice shall be included in all copies or substantial portions of
10
+ the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/rakefile.rb ADDED
@@ -0,0 +1,7 @@
1
+ require './lib/pry-vterm_aliases'
2
+ require 'rubygems/package_task'
3
+ require 'rake/testtask'
4
+ task :default => [:test]
5
+
6
+ Rake::TestTask.new { |test| test.verbose, test.pattern = true, 'tests/**/*.rb' }
7
+ Gem::PackageTask.new(eval(IO.read('pry-vterm_aliases.gemspec'))) { |pkg| pkg.need_tar, pkg.need_zip = true }
data/readme.md ADDED
@@ -0,0 +1 @@
1
+ Enable your Bash and ZSH alises in Pry.
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pry-vterm_aliases
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jordon Bedwell
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-02-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry
16
+ requirement: &14930520 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.9.8
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *14930520
25
+ description: Preserve your VTerm aliases in Pry.
26
+ email:
27
+ - jordon@envygeeks.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - readme.md
33
+ - license.txt
34
+ - lib/pry/aliases/bash.rb
35
+ - lib/pry-vterm_aliases.rb
36
+ - rakefile.rb
37
+ - gemfile.rb
38
+ homepage: https://github.com/envygeeks/pry-vterm_aliases
39
+ licenses:
40
+ - MIT
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 1.8.15
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: Preserve your VTerm aliases in Pry.
63
+ test_files: []