pry-vterm_aliases 0.0.7 → 0.1.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.
- data/{gemfile.rb → Gemfile} +0 -0
 - data/{license.txt → License.txt} +0 -0
 - data/{rakefile.rb → Rakefile} +0 -0
 - data/Readme.md +3 -0
 - data/lib/pry-vterm_aliases.rb +8 -7
 - data/lib/pry/aliases/common.rb +18 -16
 - data/pry-vterm_aliases.gemspec +15 -0
 - data/tests/pry-vterm_aliases.rb +14 -0
 - metadata +19 -12
 - data/readme.md +0 -1
 
    
        data/{gemfile.rb → Gemfile}
    RENAMED
    
    | 
         
            File without changes
         
     | 
    
        data/{license.txt → License.txt}
    RENAMED
    
    | 
         
            File without changes
         
     | 
    
        data/{rakefile.rb → Rakefile}
    RENAMED
    
    | 
         
            File without changes
         
     | 
    
        data/Readme.md
    ADDED
    
    
    
        data/lib/pry-vterm_aliases.rb
    CHANGED
    
    | 
         @@ -1,21 +1,22 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            $:.unshift File.dirname(__FILE__) and require  
     | 
| 
      
 1 
     | 
    
         
            +
            $:.unshift File.dirname(__FILE__) and require "pry"
         
     | 
| 
       2 
2 
     | 
    
         
             
            unless defined? Pry::Plugins
         
     | 
| 
       3 
     | 
    
         
            -
              Pry.const_set 
     | 
| 
      
 3 
     | 
    
         
            +
              Pry.const_set(:Plugins, Class.new)
         
     | 
| 
       4 
4 
     | 
    
         
             
            end
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
            unless RbConfig::CONFIG[ 
     | 
| 
       7 
     | 
    
         
            -
              Pry::Commands.block_command /\.(.*)/,  
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
    
         
            -
                     
     | 
| 
      
 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  
     | 
| 
      
 29 
     | 
    
         
            +
                when %r!/(?:bash|zsh)\Z! then require "pry/aliases/common"
         
     | 
| 
       29 
30 
     | 
    
         
             
              end
         
     | 
| 
       30 
31 
     | 
    
         
             
            end
         
     | 
    
        data/lib/pry/aliases/common.rb
    CHANGED
    
    | 
         @@ -1,21 +1,23 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
              class  
     | 
| 
       3 
     | 
    
         
            -
                class  
     | 
| 
       4 
     | 
    
         
            -
                   
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
                     
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
| 
      
 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- 
     | 
| 
      
 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:  
     | 
| 
      
 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:  
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
            -  
     | 
| 
       33 
     | 
    
         
            -
            - license.txt
         
     | 
| 
       34 
     | 
    
         
            -
            - lib/pry/aliases/common.rb
         
     | 
| 
      
 37 
     | 
    
         
            +
            - License.txt
         
     | 
| 
       35 
38 
     | 
    
         
             
            - lib/pry-vterm_aliases.rb
         
     | 
| 
       36 
     | 
    
         
            -
            -  
     | 
| 
       37 
     | 
    
         
            -
            -  
     | 
| 
      
 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. 
     | 
| 
      
 66 
     | 
    
         
            +
            rubygems_version: 1.8.24
         
     | 
| 
       60 
67 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       61 
68 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       62 
     | 
    
         
            -
            summary:  
     | 
| 
      
 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.
         
     |