vagrant-ghost 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/vagrant-ghost/command.rb +40 -12
- data/lib/vagrant-ghost/plugin.rb +1 -1
- data/lib/vagrant-ghost/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00e6088d25f9a6bb0f8263c070bc193e1cb6de56
|
4
|
+
data.tar.gz: 7280630cbdd5046a72a6c09d65d8fce5671e5955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0947cc9714545dcc268d7c387f46a8c57ad86fa45e4408522c7d807fef878c85bf820cd1cde34530434670f9cc38ef8a32ba3cf8708dcebd8525f653211ad2c
|
7
|
+
data.tar.gz: ddf2b6047cbdb3268bfde3ddf62df23c0c6518b336a9dbad3db932a4b832d93dd4824333f561bc706dc0d79d632b265f6ef3b4a48c50f77dc92813c08ee4842d
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Vagrant::Ghost
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/vagrant-ghost.svg)](http://badge.fury.io/rb/vagrant-ghost)
|
4
|
+
|
3
5
|
This plugin adds an entry to your /etc/hosts file on the host system.
|
4
6
|
|
5
7
|
On **up**, **resume** and **reload** commands, it tries to add the information, if its not already in your hosts file. If it needs to be added, you will be asked for an administrator password, since it uses sudo to edit the file.
|
@@ -25,7 +27,11 @@ At the moment, the only things you need, are the hostname and a :private_network
|
|
25
27
|
This ip and the hostname will be used for the entry in the /etc/hosts file.
|
26
28
|
|
27
29
|
## Changelog
|
28
|
-
|
30
|
+
|
31
|
+
### 0.1.1
|
32
|
+
* Update the CLI to a "primary" command
|
33
|
+
* Make sure help doesn't try to fire a host update
|
34
|
+
|
29
35
|
### 0.1.0
|
30
36
|
* Initial release
|
31
37
|
|
@@ -3,19 +3,13 @@ module VagrantPlugins
|
|
3
3
|
class Command < Vagrant.plugin('2', :command)
|
4
4
|
include Ghost
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
o.banner = 'Usage: vagrant ghost [vm-name]'
|
10
|
-
o.separator ''
|
11
|
-
|
12
|
-
o.on('--provider provider', String, 'Update machines with the specific provider.') do |provider|
|
13
|
-
options[:provider] = provider
|
14
|
-
end
|
15
|
-
end
|
6
|
+
def self.synopsis
|
7
|
+
'manages hosts files internally and externally'
|
8
|
+
end
|
16
9
|
|
17
|
-
|
18
|
-
options
|
10
|
+
def execute
|
11
|
+
cmd, cmd_args, argv, options = parse_args
|
12
|
+
cmd && cmd_args or return nil
|
19
13
|
|
20
14
|
@ui = @env.ui
|
21
15
|
|
@@ -47,6 +41,40 @@ module VagrantPlugins
|
|
47
41
|
|
48
42
|
false
|
49
43
|
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def parse_args
|
48
|
+
options = {}
|
49
|
+
opts = OptionParser.new do |o|
|
50
|
+
o.banner = 'Usage: vagrant ghost [vm-name]'
|
51
|
+
o.separator ''
|
52
|
+
|
53
|
+
o.on('-h', '--help', 'Print this help') do
|
54
|
+
safe_puts(opts.help)
|
55
|
+
end
|
56
|
+
|
57
|
+
o.on('--provider provider', String, 'Update machines with the specific provider.') do |provider|
|
58
|
+
options[:provider] = provider
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
argv = split_main_and_subcommand(@argv.dup)
|
63
|
+
exec_args, cmd, cmd_args = argv[0], argv[1], argv[2]
|
64
|
+
|
65
|
+
# show help
|
66
|
+
if !cmd || exec_args.any? { |a| a == '-h' || a == '--help' }
|
67
|
+
safe_puts(opts.help)
|
68
|
+
return nil
|
69
|
+
end
|
70
|
+
|
71
|
+
options[:provider] ||= @env.default_provider
|
72
|
+
|
73
|
+
# remove extra "--" arge added by Vagrant
|
74
|
+
cmd_args.delete_if { |a| a == '--' }
|
75
|
+
|
76
|
+
return cmd, cmd_args, parse_options(opts), options
|
77
|
+
end
|
50
78
|
end
|
51
79
|
end
|
52
80
|
end
|
data/lib/vagrant-ghost/plugin.rb
CHANGED