sudow 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/exe/sudow +17 -3
  4. data/lib/sudow/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97da629a5d5e2e74f4c9fd6846ae12f1c85281afc37bfc4d81dc80c83569cb30
4
- data.tar.gz: 97cbd96e0b0913a7f87a2b20b03a0350d556b322508734f29917929378276520
3
+ metadata.gz: 0e7f817c33593a78e80c364f071948d9114e4b3549d33a30a222e637098e403f
4
+ data.tar.gz: b99a72109cdb49da7039464441c54505da80053d8463d7c787d5de9aed139d59
5
5
  SHA512:
6
- metadata.gz: 95b851451ea580a5d113e38fb4d5d9feed53c8ae719be99db2cc0afe21fd7a3e2803917afc18045d80173d62914df24c3dd1906e63eff5586d432e5e2dd8d46e
7
- data.tar.gz: 20a64066d093393d3c21a5320b8102450c36e10a5fe7cb1482b89b562e01d8b9b0744e991e887f82e53f0ba5f02821fbcbbfa91e8cc38d560a0a22b3fdb764c6
6
+ metadata.gz: 2e8e31dfaa754237ce4f4a9eed6661e3dc8ef2b0d04083c68e9007b54d39bfa926aac724f99f691c80b2c4d9167639d0f074d30c0b51df0693135c77e77a50be
7
+ data.tar.gz: 24123a62cbd819477b43eaffae23d527a4c156dcff2db16302ceab9b8e4d568f706422970af301e1f323197f2d84e454b7a125cddf3494893d94617fe6c5ba05
data/README.md CHANGED
@@ -25,8 +25,6 @@ $ sudow gem install ...
25
25
  sudo /usr/local/ruby2.5.1/bin/gem install ...
26
26
  Fetching: ...
27
27
 
28
- *This command bypass the security mechanism called secure_path.*
29
- *You need to know the risk before use.*
30
28
  ```
31
29
 
32
30
  ## Contributing
data/exe/sudow CHANGED
@@ -9,7 +9,9 @@ if ARGV == []
9
9
  puts
10
10
  puts 'sudow - sudo wrapper to avoid secure_path.'
11
11
  puts
12
- puts 'Usage: sudow command args...'
12
+ puts 'Usage: sudow [-E] command args...'
13
+ puts
14
+ puts '-E preserve existing environment variables'
13
15
  puts
14
16
  puts '$ which gem'
15
17
  puts '/usr/local/ruby2.5.1/bin/gem'
@@ -18,7 +20,12 @@ if ARGV == []
18
20
  puts 'sudo: gem: command not found'
19
21
  puts
20
22
  puts '$ sudow gem install ...'
21
- puts 'sudo /usr/local/ruby2.5.1/bin/gem install ...'
23
+ puts 'sudo /usr/local/ruby2.5.1/bin/gem install ...'
24
+ puts 'Fetching: ...'
25
+ puts
26
+ puts '$ export http_proxy=http://proxy.example.com:8080/'
27
+ puts '$ sudow -E gem install ...'
28
+ puts 'sudo -E /usr/local/ruby2.5.1/bin/gem install ...'
22
29
  puts 'Fetching: ...'
23
30
  puts
24
31
  puts '*This command bypass the security mechanism called secure_path.*'
@@ -27,13 +34,20 @@ if ARGV == []
27
34
  exit 1
28
35
  end
29
36
 
37
+ if ARGV[0] == '-E'
38
+ flag = '-E'
39
+ ARGV.shift
40
+ else
41
+ flag = ''
42
+ end
43
+
30
44
  cmd = ARGV.shift
31
45
  fullpath = `which #{cmd}`.strip
32
46
  if fullpath == ''
33
47
  puts "#{cmd} not found."
34
48
  exit 1
35
49
  end
36
- sudo_cmd = "sudo #{fullpath} #{ARGV.join(' ')}"
50
+ sudo_cmd = "sudo #{flag} #{fullpath} #{ARGV.join(' ')}"
37
51
 
38
52
  puts sudo_cmd
39
53
  exec sudo_cmd
data/lib/sudow/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sudow
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sudow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - s3fxn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-09 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler