vagrant-address 0.3 → 0.3.1
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.
- checksums.yaml +4 -4
- data/lib/command.rb +8 -0
- data/lib/errors.rb +16 -0
- data/lib/locales/en.yml +7 -0
- data/lib/vagrant-address.rb +13 -0
- data/vagrant-address.gemspec +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9532d82f2ba884ea5beed44743dce59fbfac60f
|
4
|
+
data.tar.gz: 4ad550b1168684267084304d269cb9890d7143ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b81f0fbb7ae8eb82b03143fd1f3473a2c2240aa106166020a7b639f5fff44f9063e1d338c1fb0a2793c2c819582eac9c59e2f448dceec1694d339043498bbf6
|
7
|
+
data.tar.gz: de777fa3c408a5d6edb103f614e05bcdcfaef6c0bca5db390812824e053b172b4bd0071ff6c55245253deebcdef184684d13299c47299981f732f11c8a6d7d2b
|
data/lib/command.rb
CHANGED
@@ -16,6 +16,14 @@ module VagrantPlugins
|
|
16
16
|
|
17
17
|
with_target_vms(argv, {:single_target=>true}) do |machine|
|
18
18
|
ip = machine.provider.capability(:public_address)
|
19
|
+
|
20
|
+
if machine.state.id != :running
|
21
|
+
raise ::VagrantPlugins::CommandAddress::Errors::NotRunning
|
22
|
+
end
|
23
|
+
if ip == nil
|
24
|
+
raise ::VagrantPlugins::CommandAddress::Errors::Unknown
|
25
|
+
end
|
26
|
+
|
19
27
|
message = ENV['TEAMCITY_VERSION'] ? "##teamcity[setParameter name='env.VAGRANT_ADDRESS' value='#{ip}']" : ip
|
20
28
|
@env.ui.info(message)
|
21
29
|
end
|
data/lib/errors.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module CommandAddress
|
3
|
+
module Errors
|
4
|
+
class AddressError < Vagrant::Errors::VagrantError
|
5
|
+
error_namespace("vagrant_address.errors")
|
6
|
+
end
|
7
|
+
|
8
|
+
class NotRunning < AddressError
|
9
|
+
error_key(:not_running)
|
10
|
+
end
|
11
|
+
class Unknown < AddressError
|
12
|
+
error_key(:unknown)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/locales/en.yml
ADDED
data/lib/vagrant-address.rb
CHANGED
@@ -2,6 +2,8 @@ require "vagrant"
|
|
2
2
|
|
3
3
|
module VagrantPlugins
|
4
4
|
module CommandAddress
|
5
|
+
autoload :Errors, File.expand_path("../errors", __FILE__)
|
6
|
+
|
5
7
|
class Plugin < Vagrant.plugin("2")
|
6
8
|
name "address"
|
7
9
|
description <<-DESC
|
@@ -10,8 +12,19 @@ module VagrantPlugins
|
|
10
12
|
|
11
13
|
command("address", primary: false) do
|
12
14
|
require_relative "command"
|
15
|
+
init!
|
13
16
|
Command
|
14
17
|
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def self.init!
|
22
|
+
return if defined?(@_init)
|
23
|
+
I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)
|
24
|
+
I18n.reload!
|
25
|
+
@_init = true
|
26
|
+
end
|
27
|
+
|
15
28
|
end
|
16
29
|
end
|
17
30
|
end
|
data/vagrant-address.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-address
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kuzmin
|
@@ -52,6 +52,8 @@ files:
|
|
52
52
|
- README.md
|
53
53
|
- Rakefile
|
54
54
|
- lib/command.rb
|
55
|
+
- lib/errors.rb
|
56
|
+
- lib/locales/en.yml
|
55
57
|
- lib/vagrant-address.rb
|
56
58
|
- vagrant-address.gemspec
|
57
59
|
homepage: https://github.com/mkuzmin/vagrant-address
|