pry-vterm_aliases 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df90d52f0cca61954dbc4cb5b1e1586dee84e98d
4
- data.tar.gz: 63eab4ed09b86545915bd27871f4499e00db9e62
3
+ metadata.gz: a4ac5888627575d9104fde0aab15ceb4cb095b59
4
+ data.tar.gz: 11f058929d972188e1cc1d9931c11608ecd2a82c
5
5
  SHA512:
6
- metadata.gz: 5a539f407d7a9e658ca002893f117e1688861f86f5e28c4329bcf446e173eb30a4f9766cd15f4b259e569ae75073a05003da53a601dbf6f1a9b19a2a11f076e0
7
- data.tar.gz: d4c58dfa39f7fab25772564dd6c22284c6652260bba7200ac1482bde847b633416dce03ba883438c9096eb2a9f7e116334326b169b7c4cb9a44440850c4a56e0
6
+ metadata.gz: 7b30cc6f8e3e09f6c05a71c31737cfbbc5a55fbfe7cfe3c482cf7403d3c0aa09140212ed7fac57a50c0fa7308abdd15f8a0ced50c1166b81ef3665f30592f7f6
7
+ data.tar.gz: 8807c9e780c6866f73b826a64934c498644329642e1f667f745cbd4c6a59228977a7c983c8c7ccf20db3d5eee81d88fc559db4a0b24c2afa3ac74c2f534a18c6
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2013 Jordon Bedwell
1
+ Copyright (c) 2011-2015 Jordon Bedwell
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # Pry-Vterm_Aliases
2
2
 
3
- [![Build Status](https://travis-ci.org/envygeeks/pry-vterm_aliases.png?branch=master)](https://travis-ci.org/envygeeks/pry-vterm_aliases) [![Coverage Status](https://coveralls.io/repos/envygeeks/pry-vterm_aliases/badge.png?branch=master)](https://coveralls.io/r/envygeeks/pry-vterm_aliases) [![Code Climate](https://codeclimate.com/github/envygeeks/pry-vterm_aliases.png)](https://codeclimate.com/github/envygeeks/pry-vterm_aliases) [![Dependency Status](https://gemnasium.com/envygeeks/pry-vterm_aliases.png)](https://gemnasium.com/envygeeks/pry-vterm_aliases)
3
+ [![Build Status](https://travis-ci.org/envygeeks/ruby-pry-vterm_aliases.png?branch=master)](https://travis-ci.org/envygeeks/ruby-pry-vterm_aliases) [![Coverage Status](https://coveralls.io/repos/envygeeks/ruby-pry-vterm_aliases/badge.png?branch=master)](https://coveralls.io/r/envygeeks/ruby-pry-vterm_aliases) [![Code Climate](https://codeclimate.com/github/envygeeks/ruby-pry-vterm_aliases.png)](https://codeclimate.com/github/envygeeks/ruby-pry-vterm_aliases) [![Dependency Status](https://gemnasium.com/envygeeks/ruby-pry-vterm_aliases.png)](https://gemnasium.com/envygeeks/ruby-pry-vterm_aliases)
4
4
 
5
5
  Enable your ZSH and Bash aliases inside of Pry.
6
6
 
@@ -6,22 +6,31 @@ unless ::RbConfig::CONFIG["host_os"] =~ /mswin|mingw32/
6
6
  module VTermAliases
7
7
  class << self
8
8
  def create_aliases
9
- aliases.each { |als, cmd| create_alias(als, cmd) }
9
+ aliases.each do |a, c|
10
+ create_alias(
11
+ a, c
12
+ )
13
+ end
10
14
  end
11
15
 
12
16
  def create_alias(als, desc = nil)
13
17
  Pry::Commands.create_command(cmd_regexp(als), listing: ".#{als}") do
14
- description("alias to: #{Pry::Helpers::Text.bold(desc)}.") if desc
15
- group("Terminal Aliases")
18
+ description "alias to: #{Pry::Helpers::Text.bold(desc)}." if desc
19
+ group "Terminal Aliases"
16
20
 
17
21
  def process(cmd, extra)
18
- Pry::VTermAliases.run_alias(cmd, extra, output)
22
+ Pry::VTermAliases.run_alias(
23
+ cmd, extra, output
24
+ )
19
25
  end
20
26
  end
21
27
  end
22
28
 
23
29
  def aliases
24
- @aliases ||= (shell.nil? || shell.empty?) ? {} : find_aliases
30
+ @aliases ||= if shell.nil? || shell.empty?
31
+ then {}
32
+ else find_aliases
33
+ end
25
34
  end
26
35
 
27
36
  def shell
@@ -46,24 +55,30 @@ unless ::RbConfig::CONFIG["host_os"] =~ /mswin|mingw32/
46
55
 
47
56
  private
48
57
  def find_aliases
49
- `#{shell} -ic 'alias'`.split(/\n/).inject({}) do |hash, alius|
50
- alius = alius.sub(/\Aalias\s/, "").split("=")
51
- unless alius.first =~ /\s/
52
- strip_wrapping_quotes(alius.shift).tap do |k|
53
- hash.update(k => Shellwords.shellwords(alius.join("=")).join)
58
+ `#{shell} -ic 'alias'`.split(/\n/).inject({}) do |h, a|
59
+ if a =~ /\Aalias\s+/
60
+ a = a.sub(/\Aalias\s/, "").split("=")
61
+ unless a.first =~ /\s/
62
+ strip_wrapping_quotes(a.shift).tap do |k|
63
+ h.update(
64
+ k => Shellwords.shellwords(a.join("=")).join
65
+ )
66
+ end
54
67
  end
55
68
  end
56
- hash
69
+
70
+ h
57
71
  end
58
72
  end
59
73
  end
60
74
 
61
75
  # Better way?!?!
62
76
  module ObjectExt
63
- private
64
77
  def capture_vterm_alias(als, extra = nil, out = StringIO.new)
65
78
  Pry::VTermAliases.run_alias(als.gsub(/\A\./, ""), extra, out)
66
- StringIO === out ? out.string : out
79
+ if !out.is_a?(StringIO)
80
+ then out else out.string
81
+ end
67
82
  end
68
83
  end
69
84
  end
@@ -1,5 +1,5 @@
1
1
  class Pry
2
2
  module VTermAliases
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,106 +1,106 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-vterm_aliases
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordon Bedwell
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-20 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: 0.10.1
20
15
  requirement: !ruby/object:Gem::Requirement
21
16
  requirements:
22
- - - ~>
17
+ - - "~>"
23
18
  - !ruby/object:Gem::Version
24
- version: 0.10.1
25
- prerelease: false
19
+ version: '0.10'
26
20
  type: :runtime
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
21
+ prerelease: false
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - ~>
24
+ - - "~>"
32
25
  - !ruby/object:Gem::Version
33
- version: '3.0'
26
+ version: '0.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
34
29
  requirement: !ruby/object:Gem::Requirement
35
30
  requirements:
36
- - - ~>
31
+ - - "~>"
37
32
  - !ruby/object:Gem::Version
38
- version: '3.0'
39
- prerelease: false
33
+ version: '3.3'
40
34
  type: :development
41
- - !ruby/object:Gem::Dependency
42
- name: envygeeks-coveralls
35
+ prerelease: false
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
- - - ~>
38
+ - - "~>"
46
39
  - !ruby/object:Gem::Version
47
- version: 0.2.0
40
+ version: '3.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: envygeeks-coveralls
48
43
  requirement: !ruby/object:Gem::Requirement
49
44
  requirements:
50
- - - ~>
45
+ - - "~>"
51
46
  - !ruby/object:Gem::Version
52
- version: 0.2.0
53
- prerelease: false
47
+ version: '1.0'
54
48
  type: :development
55
- - !ruby/object:Gem::Dependency
56
- name: luna-rspec-formatters
49
+ prerelease: false
57
50
  version_requirements: !ruby/object:Gem::Requirement
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '1.2'
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: luna-rspec-formatters
62
57
  requirement: !ruby/object:Gem::Requirement
63
58
  requirements:
64
- - - ~>
59
+ - - "~>"
65
60
  - !ruby/object:Gem::Version
66
- version: '1.2'
67
- prerelease: false
61
+ version: '3.3'
68
62
  type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.3'
69
69
  description: Enable your Bash and ZSH alises in Pry shell.
70
70
  email:
71
- - jordon@envygeeks.com
71
+ - jordon@envygeeks.io
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - Readme.md
77
- - Rakefile
78
- - License
79
76
  - Gemfile
77
+ - LICENSE
78
+ - README.md
79
+ - Rakefile
80
80
  - lib/pry-vterm_aliases.rb
81
81
  - lib/pry-vterm_aliases/version.rb
82
82
  homepage: https://github.com/envygeeks/pry-vterm_aliases
83
83
  licenses:
84
84
  - MIT
85
85
  metadata: {}
86
- post_install_message:
86
+ post_install_message:
87
87
  rdoc_options: []
88
88
  require_paths:
89
89
  - lib
90
90
  required_ruby_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - '>='
97
+ - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubyforge_project:
102
- rubygems_version: 2.1.9
103
- signing_key:
101
+ rubyforge_project:
102
+ rubygems_version: 2.4.8
103
+ signing_key:
104
104
  specification_version: 4
105
105
  summary: Enable your Bash and ZSH alises in Pry.
106
106
  test_files: []