run-as-root 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/run-as-root.rb +4 -3
  3. metadata +3 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1
1
+ 0.1.1
@@ -1,7 +1,8 @@
1
1
  def whoami_root(cmd)
2
- `#{cmd}`.strip.chomp == 'root'
3
- $stderr.puts $run_as_root_msg || 'You need to be root to run this command.'
4
- exit $run_as_root_exit_code || 1
2
+ if `#{cmd}`.strip.chomp != 'root'
3
+ $stderr.puts $run_as_root_msg || 'You need to be root to run this command.'
4
+ exit $run_as_root_exit_code || 1
5
+ end
5
6
  end
6
7
 
7
8
  ['/usr/bin/whoami', '/bin/whoami'].each do |w|
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run-as-root
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- version: "0.1"
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Sergio Rubio