yap-shell 0.4.8 → 0.4.9

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: a31682029b9cbd355da08f48de73df26f18ac7e3
4
- data.tar.gz: 11cac119d25dc8a0b19037c128cd7c08992449d1
3
+ metadata.gz: 6a1ba2e75f86000c31cb6cfaff1d70dd723b5fd3
4
+ data.tar.gz: 5f2e8e4895adadbaa8f17d467990c6364c717478
5
5
  SHA512:
6
- metadata.gz: 73674732a59260cf427392a8cc6617bb0d78a602dc2c49f8c5a588d2e952805a0d0bb51fa086961a7d938d411f4c76f12874a44085a6748d5e4db06ae3c49ec8
7
- data.tar.gz: fa6f4ee6f68e5c426a36ebe600be7a158cf3bfccc448694299af5cf4569a77753b13d735c87058489ad1740a27503c6381faee10369bce92f28829ba286b021e
6
+ metadata.gz: bb0bc319917d0aafde0fddeb14a8d269c8cd3c2419dbb8057c22c55277cfb1785d74da3d7953f1199a2148880cf0d2faf0e2c00606872aab11c86153e74301b3
7
+ data.tar.gz: 087b233e0a51f4b7c6e5becdd249a27c1adf36cd2e86c835079e4ab5b8bc77615d0c363ac0b8e76116e1adfe0edd8b8e19f3252310e201156470e9d773497d5d
data/bin/yap CHANGED
@@ -1,32 +1,50 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- file = __FILE__
4
- if File.symlink?(file)
5
- file = File.readlink(file)
6
- end
3
+ if ENV["YAP_SHELL"].nil?
4
+ # Start YAP with a pristine environment
5
+ env2keep = {
6
+ 'PATH' => ENV['PATH'],
7
+ 'HOME' => ENV['HOME'],
8
+ 'RUBYOPT' => '-rubygems -EUTF-8',
9
+ 'TREEFELL_OUT' => ENV['TREEFELL_OUT'],
10
+ 'DEBUG' => ENV['DEBUG'],
11
+ 'YAP_SHELL' => 'active'
12
+ }
13
+ env_params = env2keep.each_with_object([]) do |(key,value),arr|
14
+ next if value.nil?
15
+ arr << %|#{key}="#{value}"|
16
+ end.join(' ')
17
+ cmd = %|env -i #{env_params} #{$0}|
18
+ exec cmd
19
+ else
20
+ file = __FILE__
21
+ if File.symlink?(file)
22
+ file = File.readlink(file)
23
+ end
7
24
 
8
- trap "SIGTSTP", "IGNORE"
9
- trap "SIGINT", "IGNORE"
10
- trap "SIGTTIN", "IGNORE"
11
- trap "SIGTTOU", "IGNORE"
25
+ trap "SIGTSTP", "IGNORE"
26
+ trap "SIGINT", "IGNORE"
27
+ trap "SIGTTIN", "IGNORE"
28
+ trap "SIGTTOU", "IGNORE"
12
29
 
13
- $LOAD_PATH.unshift File.dirname(file) + '/../lib'
30
+ $LOAD_PATH.unshift File.dirname(file) + '/../lib'
14
31
 
15
- ENV['TERM'] ||= 'linux'
32
+ ENV['TERM'] ||= 'linux'
16
33
 
17
- # Delete all RBENV/RVM environment variables
18
- # Once we're booted, we don't want them being inherited
19
- # by other child processes since those children cannot
20
- # modify Yap's ENV, only their own child env.
21
- ENV.keys.each do |key|
22
- if key =~ /^(rbenv_|rvm_)/i
23
- ENV.delete(key)
34
+ # Delete all RBENV/RVM environment variables
35
+ # Once we're booted, we don't want them being inherited
36
+ # by other child processes since those children cannot
37
+ # modify Yap's ENV, only their own child env.
38
+ ENV.keys.each do |key|
39
+ if key =~ /^(rbenv_|rvm_)/i
40
+ ENV.delete(key)
41
+ end
24
42
  end
25
- end
26
43
 
27
- require "term/ansicolor"
28
- require "pry"
29
- require "yap"
44
+ require "term/ansicolor"
45
+ require "pry"
46
+ require "yap"
30
47
 
31
- STDOUT.sync = true
32
- Yap.run_shell
48
+ STDOUT.sync = true
49
+ Yap.run_shell
50
+ end
@@ -1,5 +1,5 @@
1
1
  module Yap
2
2
  module Shell
3
- VERSION = "0.4.8"
3
+ VERSION = "0.4.9"
4
4
  end
5
5
  end
data/yap-shell.gemspec CHANGED
@@ -28,11 +28,11 @@ Gem::Specification.new do |spec|
28
28
  |you just installed it for. For example, with rbenv I use the below
29
29
  |alias in my ~/.profile file:
30
30
  |
31
- | alias yap='env -i PATH=$PATH RUBYOPT="-rubygems -EUTF-8" HOME=$HOME sh -c "rbenv local 2.2.3 && yap"'
31
+ | alias yap='rbenv local 2.2.3 && yap'
32
32
  |
33
33
  |If you are interested in tracing yap's execution you can add the DEBUG and TREEFELL_OUT options:
34
34
  |
35
- | alias yap-debug='env -i DEBUG=* TREEFELL_OUT=/tmp/yap-debug.log PATH=$PATH RUBYOPT="-rubygems -EUTF-8" HOME=$HOME sh -c "rbenv local 2.2.3 && yap"'
35
+ | alias yap-debug='rbenv local 2.2.3 ; DEBUG=* TREEFELL_OUT=/tmp/yap-debug.log yap'
36
36
  |
37
37
  |Then, `source ~/.profile` or reload your shell. Now you can finally run:
38
38
  |
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yap-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Dennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-14 00:00:00.000000000 Z
11
+ date: 2016-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry-byebug
@@ -231,17 +231,15 @@ post_install_message: "\nGreetings forward-thinking traveler!\n\nLet's waste no
231
231
  this is my beta's beta. Yap has many cool ideas. I dare\nsay some of those made
232
232
  it into this very release.\n\n\e[033mLastly\e[0m, create an alias to the yap executable
233
233
  using the ruby version\nyou just installed it for. For example, with rbenv I use
234
- the below\nalias in my ~/.profile file:\n\n alias yap='env -i PATH=$PATH RUBYOPT=\"-rubygems
235
- -EUTF-8\" HOME=$HOME sh -c \"rbenv local 2.2.3 && yap\"'\n\nIf you are interested
236
- in tracing yap's execution you can add the DEBUG and TREEFELL_OUT options:\n\n alias
237
- yap-debug='env -i DEBUG=* TREEFELL_OUT=/tmp/yap-debug.log PATH=$PATH RUBYOPT=\"-rubygems
238
- -EUTF-8\" HOME=$HOME sh -c \"rbenv local 2.2.3 && yap\"'\n\nThen, `source ~/.profile`
239
- or reload your shell. Now you can finally run:\n\n yap\n\nYou know your tooling
240
- better than me. If you need things to go a little\ndifferently than above you go
241
- right ahead. If any questions arise don't\nhesitate to holler over at Github. I
242
- may not always be home, but there will\nalways be a cozy textarea with dozens of
243
- emoji friends waiting to hear your\nthoughts. All day. All night.\n\nUntil the next
244
- update: Happy coding!\n\nSincerely,\n\n \e[51mThe Lagniappe (Yap) Shell\e[0m\n\n\e[033mP.S.\e[0m
234
+ the below\nalias in my ~/.profile file:\n\n alias yap='rbenv local 2.2.3 && yap'\n\nIf
235
+ you are interested in tracing yap's execution you can add the DEBUG and TREEFELL_OUT
236
+ options:\n\n alias yap-debug='rbenv local 2.2.3 ; DEBUG=* TREEFELL_OUT=/tmp/yap-debug.log
237
+ yap'\n\nThen, `source ~/.profile` or reload your shell. Now you can finally run:\n\n
238
+ \ yap\n\nYou know your tooling better than me. If you need things to go a little\ndifferently
239
+ than above you go right ahead. If any questions arise don't\nhesitate to holler
240
+ over at Github. I may not always be home, but there will\nalways be a cozy textarea
241
+ with dozens of emoji friends waiting to hear your\nthoughts. All day. All night.\n\nUntil
242
+ the next update: Happy coding!\n\nSincerely,\n\n \e[51mThe Lagniappe (Yap) Shell\e[0m\n\n\e[033mP.S.\e[0m
245
243
  If you have ideas for loading other than the hard-coded\nalias, do tell, right over
246
244
  here:\n\n \e[1mhttp://github.com/zdennis/yap-shell/issues\e[0m\n\n\e[033mP.P.S.\e[0m
247
245
  OSX support? YES! Linux? I assume YES! Windows? Um...\n\n"