maphosts 0.0.1 → 0.2

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. checksums.yaml +4 -4
  2. data/bin/maphosts +9 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d39079162ebdbf9644a0a27ebbd45c5e88eccf7
4
- data.tar.gz: a1a5c28e6db974fa6fe451280224af3bdd3ed151
3
+ metadata.gz: a34ba472dfe74a7a8151dd6e5f7b36e54b68ce9f
4
+ data.tar.gz: 555bfe87e654bd8d74e860e9bd88651bcd67f493
5
5
  SHA512:
6
- metadata.gz: 2c5bb2f159cc9f3978bead0e5412a39fc38f76f2d20e1437f39a767af58c8494f42205de37bc2b50e60b28fc7417d9c6b17bee3dabe812e36ba9b131d751671f
7
- data.tar.gz: a335998391852ad36d49c589087f29e939377e64f53760d14022ab7787b53a8c7db3ed712c08a1453411675897adc6f63c46537ea7698dab0d7166e77d7348bf
6
+ metadata.gz: b27a3e211cead3ea991c6249f8cf6b67caf68b9615ea9229b8c3a9713503087698c16a527b2e5bcb8c480f0a65708364ae72a1b2b7ca1db587a850f16e84017b
7
+ data.tar.gz: d8d30918e4f0d289471e5caeb2b213d11ff163b90abe15d78e985b75873d3b8a0035c5c8510ca9c285c88a95222fcb9051f8dea84524602e3bd671a2812e3731
data/bin/maphosts CHANGED
@@ -6,7 +6,7 @@ hostsfile_path = '/etc/hosts'
6
6
  ip = '127.0.0.1'
7
7
  verbose = false
8
8
 
9
- OptionParser.new do |options|
9
+ option_parser = OptionParser.new do |options|
10
10
  options.banner = "Usage: #{File.basename(__FILE__)} hosts..."
11
11
 
12
12
  options.on "-t", "--to IP" do |value|
@@ -20,7 +20,14 @@ OptionParser.new do |options|
20
20
  options.on "-v", "--verbose" do
21
21
  verbose = true
22
22
  end
23
- end.parse!
23
+ end
24
+
25
+ begin
26
+ option_parser.parse!
27
+ rescue OptionParser::MissingArgument => e
28
+ STDERR.puts e.message
29
+ exit 1
30
+ end
24
31
 
25
32
 
26
33
  if !File.exists?(hostsfile_path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maphosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Scholten