simonmenke-hosts 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. data/bin/hosts +8 -0
  2. data/lib/hosts/version.rb +1 -1
  3. metadata +1 -1
data/bin/hosts CHANGED
@@ -63,4 +63,12 @@ protected
63
63
 
64
64
  end
65
65
 
66
+ begin
67
+ File.open('/etc/hosts', 'a+') {|f|}
68
+ rescue
69
+ system "sudo #{$0} #{ARGV.join(' ')}"
70
+ exit(0)
71
+ end
72
+
73
+ ARGV << "list" if ARGV.empty?
66
74
  Hosts.start
data/lib/hosts/version.rb CHANGED
@@ -2,7 +2,7 @@ module Hosts #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simonmenke-hosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke