pry-vterm_aliases 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
File without changes
File without changes
data/Readme.md ADDED
@@ -0,0 +1,3 @@
1
+ Enable your Bash and ZSH alises in Pry.
2
+
3
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/envygeeks/pry-vterm_aliases)
@@ -1,21 +1,22 @@
1
- $:.unshift File.dirname(__FILE__) and require 'pry'
1
+ $:.unshift File.dirname(__FILE__) and require "pry"
2
2
  unless defined? Pry::Plugins
3
- Pry.const_set :Plugins, Class.new
3
+ Pry.const_set(:Plugins, Class.new)
4
4
  end
5
5
 
6
- unless RbConfig::CONFIG['host_os'] =~ /mswin/
7
- Pry::Commands.block_command /\.(.*)/, '.shell commands' do |cmd|
6
+ unless RbConfig::CONFIG["host_os"] =~ /mswin|mingw32/
7
+ Pry::Commands.block_command /\.(.*)/, ".shell commands" do |cmd|
8
8
  if defined?(Pry::Plugins::VTerm) && Pry::Plugins::VTerm.aliases.include?(cmd)
9
9
  cmd = Pry::Plugins::VTerm.aliases[cmd]
10
10
  end
11
11
 
12
- Pry.config.system.call Pry.output, cmd, _pry_
12
+ Pry.config.system.call(Pry.output, cmd, _pry_)
13
13
  end
14
14
 
15
15
  class Pry::Plugins::VTerm
16
16
  class << self
17
+ VERSION = "0.1.0"
17
18
  def version
18
- '0.0.7'
19
+ VERSION
19
20
  end
20
21
 
21
22
  def aliases
@@ -25,6 +26,6 @@ unless RbConfig::CONFIG['host_os'] =~ /mswin/
25
26
  end
26
27
 
27
28
  case ENV['SHELL']
28
- when %r!/(?:bash|zsh)\Z! then require 'pry/aliases/common'
29
+ when %r!/(?:bash|zsh)\Z! then require "pry/aliases/common"
29
30
  end
30
31
  end
@@ -1,21 +1,23 @@
1
- if defined? Pry::Plugins::VTerm
2
- class Pry::Plugins::VTerm
3
- class << self
4
- command = 'bash'
5
- if ENV['SHELL'] =~ %r!/zsh\Z!
6
- command = 'zsh'
7
- end
1
+ class Pry
2
+ class Plugins
3
+ class VTerm
4
+ class << self
5
+ command = "bash"
6
+ if ENV["SHELL"] =~ %r!/zsh\Z!
7
+ command = "zsh"
8
+ end
8
9
 
9
- @@aliases = `#{command} -i -c 'alias'`.each_line.to_a.map(&:chomp).delete_if { |line| line !~ /=/ }.inject({}) do |hash, cmd|
10
- cmd = Shellwords.shellwords(cmd.gsub(/\Aalias\s{1}/, '')).join
11
- cmd = cmd.split('=')
12
- cmd[1] = cmd[1..-1].join('=')
10
+ @@aliases = `#{command} -i -c 'alias'`.each_line.to_a.map(&:chomp).delete_if { |line|
11
+ line !~ /=/ }.inject({}) do |hash, cmd|
12
+ cmd = Shellwords.shellwords(cmd.gsub(/\Aalias\s{1}/, "")).join
13
+ cmd = cmd.split("=")
14
+ cmd[1] = cmd[1..-1].join("=")
13
15
 
14
- # Just double check...
15
- unless cmd[0] =~ /\s/
16
- hash.update({cmd[0] => cmd[1]})
17
- end
16
+ unless cmd[0] =~ /\s/
17
+ hash.update({cmd[0] => cmd[1]})
18
+ end
19
+ end
18
20
  end
19
21
  end
20
22
  end
21
- end
23
+ end
@@ -0,0 +1,15 @@
1
+ require File.expand_path("../lib/pry-vterm_aliases", __FILE__)
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "pry-vterm_aliases"
5
+ spec.version = Pry::Plugins::VTerm.version
6
+ spec.email = ["jordon@envygeeks.com"]
7
+ spec.authors = ["Jordon Bedwell"]
8
+ spec.add_dependency("pry", "~> 0.9.8")
9
+ spec.description = "Enable your Bash and ZSH alises in Pry."
10
+ spec.files = Dir["**/*"]
11
+ spec.homepage = "https://github.com/envygeeks/pry-vterm_aliases"
12
+ spec.licenses = ["MIT"]
13
+ spec.require_paths = ["lib"]
14
+ spec.summary = "Enable your Bash and ZSH alises in Pry."
15
+ end
@@ -0,0 +1,14 @@
1
+ require "./lib/pry-vterm_aliases"
2
+ require "minitest/autorun"
3
+ require "minitest/pride"
4
+
5
+ describe Pry::Plugins::VTerm do
6
+ it "should have a proper version number" do
7
+ Pry::Plugins::VTerm.version.split(/\./).delete_if { |val|
8
+ val =~ /pre\d{0,2}/ }.length.must_equal 3
9
+ end
10
+
11
+ it "should output a hash of aliases when calling aliases" do
12
+ assert Pry::Plugins::VTerm.aliases.class, Hash
13
+ end
14
+ 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.7
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-12 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
16
- requirement: &22598140 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,20 +21,27 @@ dependencies:
21
21
  version: 0.9.8
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *22598140
25
- description: Preserve your VTerm aliases in Pry.
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.9.8
30
+ description: Enable your Bash and ZSH alises in Pry.
26
31
  email:
27
32
  - jordon@envygeeks.com
28
33
  executables: []
29
34
  extensions: []
30
35
  extra_rdoc_files: []
31
36
  files:
32
- - readme.md
33
- - license.txt
34
- - lib/pry/aliases/common.rb
37
+ - License.txt
35
38
  - lib/pry-vterm_aliases.rb
36
- - rakefile.rb
37
- - gemfile.rb
39
+ - lib/pry/aliases/common.rb
40
+ - Rakefile
41
+ - tests/pry-vterm_aliases.rb
42
+ - Readme.md
43
+ - Gemfile
44
+ - pry-vterm_aliases.gemspec
38
45
  homepage: https://github.com/envygeeks/pry-vterm_aliases
39
46
  licenses:
40
47
  - MIT
@@ -56,8 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
63
  version: '0'
57
64
  requirements: []
58
65
  rubyforge_project:
59
- rubygems_version: 1.8.15
66
+ rubygems_version: 1.8.24
60
67
  signing_key:
61
68
  specification_version: 3
62
- summary: Preserve your VTerm aliases in Pry.
69
+ summary: Enable your Bash and ZSH alises in Pry.
63
70
  test_files: []
data/readme.md DELETED
@@ -1 +0,0 @@
1
- Enable your Bash and ZSH alises in Pry.