landrush-ip 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OTRkYWM4YjI0NmRlYzhhNTE0NjU1NmZlZDM0ODM5NGIxMDFlYTIyYQ==
5
- data.tar.gz: !binary |-
6
- YjJkYzdhNTJiZTgxNmQxZjg0NjcxOGUwYTJmN2ExMzYyM2Y5Y2I5ZQ==
2
+ SHA1:
3
+ metadata.gz: 09eecec1535f102c4f647f8e27ef4fc8982b07cf
4
+ data.tar.gz: 5c774918db94ea510b72faaa92e0fa333c4f959d
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MzIyNGUyZmUwMDJiMTQ2YTliMDE1YmQyOTJlZjBjOGUyMGI5YzNlZDVkNWQ0
10
- MDgyMDE3NGI0ZjQwMWQ3ODZlNTFhZmNkOTM3NmY1YTAzMGM1ZWFmN2NiNGJj
11
- MDMwYzYyNzQzNWY3Nzk3ZDdlZmRhMGVkZWMyMjAyZDkwODkxYTU=
12
- data.tar.gz: !binary |-
13
- NTVlZjRmMmU4YWVlZTE3NTg4OTZmZjE1YjBhY2I1YjhkMDMyOGUxMTI0ZGMz
14
- YzVjZWE4ODE0YzhiMmE0ZDk0ODRhYmEzMzQzMzM1M2NmZjRjNWMzZjQ0ZDY1
15
- YmU0ZDhmMDFkZDYwMTU1YmY3MTM5MTA2NTdhZDQxYTdjZjFiODI=
6
+ metadata.gz: d442da212d812e505075f4bca308d8492a6a1afa2a3d8ccdd51b13d8b183a98baf86bdec0dccb00aff6ac8fd86af8ec880895efa7db5d270efcf3a3b881948f9
7
+ data.tar.gz: 098c4845fe272f88325aab306df9b939d8d3e5f93eaef48d932cc6f9768c75d91b1167a0e01839fa1c9ddca8a2128549218125db5bbc4d364deb26ebea0252f3
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # LandrushIp
2
2
 
3
- [![Build Status](https://travis-ci.org/Werelds/landrush-ip.svg?branch=master)](https://travis-ci.org/Werelds/landrush-ip)
3
+ [![Build Status](https://travis-ci.org/vagrant-landrush/landrush-ip.svg?branch=master)](https://travis-ci.org/vagrant-landrush/landrush-ip)
4
4
 
5
5
  This gem is a capability plugin for Vagrant, used in Landrush (but perfectly usable outside Landrush).
6
6
 
@@ -20,9 +20,7 @@ Once we're happy with the functionality and mechanics, this will be expanded to
20
20
 
21
21
  ## Usage
22
22
 
23
- When used with Landrush, it will automatically be activated and install itself.
24
-
25
- Without Landrush, one has to enable it explicitly via `landrush_ip.override` if auto-installation is desired.
23
+ When `landrush_ip_get` is called, the necessary binary will automatically be installed. Alternatively, one can explicitly force automatic installation `landrush_ip.auto_install` if desired.
26
24
 
27
25
  Other plugins can use the provided capabilities to check if it is installed and/or install it.
28
26
 
@@ -73,7 +71,7 @@ By default, it returns the output in TSV (Tab Separated Values) format.
73
71
  The JSON and YAML formats output objects and hashes respectively, that have a `name`, `ipv4` and `ipv6` key.
74
72
 
75
73
  No filtering is done with any of the formats, so any interface that has no assigned IP will still show up.
76
- It's left up to consumer to filter that out.
74
+ It's left up to consumers to filter that out.
77
75
  Same goes for the order in which they are returned, they are returned as returned by the OS.
78
76
 
79
77
  The following examples are all from OS X (Darwin)
@@ -152,7 +150,7 @@ A `Vagrantfile` is present to run the plugin in if you so desire.
152
150
 
153
151
  ## Contributing
154
152
 
155
- Bug reports and pull requests are welcome on GitHub at https://github.com/Werelds/landrush-ip.
153
+ Bug reports and pull requests are welcome on GitHub at https://github.com/vagrant-landrush/landrush-ip.
156
154
  This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
157
155
 
158
156
  ## License
@@ -11,16 +11,12 @@ module LandrushIp
11
11
  @machine.guest.capability(:landrush_ip_installed)
12
12
  end
13
13
 
14
- def override?
15
- @machine.config.landrush_ip.override
16
- end
17
-
18
- def enabled?
19
- override? || (@machine.config.key('landrush') && @machine.config.landrush.enabled)
14
+ def auto_install?
15
+ @machine.config.landrush_ip.auto_install
20
16
  end
21
17
 
22
18
  def install
23
- @env[:ui].warn I18n.t('vagrant.config.landrush_ip.not_installed')
19
+ @env[:ui].info I18n.t('vagrant.config.landrush_ip.not_installed')
24
20
 
25
21
  raise Vagrant::LandrushIp::Error, :cannot_install unless @machine.guest.capability(:landrush_ip_install)
26
22
  end
@@ -31,11 +27,11 @@ module LandrushIp
31
27
  @machine = env[:machine]
32
28
 
33
29
  # Auto install in one of 2 cases:
34
- # - landrush-ip is forcibly enabled via the override setting
30
+ # - landrush-ip is forcibly enabled via the auto_install setting
35
31
  # - Landrush is installed and enabled
36
- install if enabled? && !installed?
32
+ install if auto_install? && !installed?
37
33
 
38
- @env[:ui].info I18n.t('vagrant.config.landrush_ip.not_enabled') unless enabled?
34
+ @env[:ui].info I18n.t('vagrant.config.landrush_ip.not_enabled') unless auto_install?
39
35
  end
40
36
  end
41
37
  end
@@ -6,6 +6,8 @@ module LandrushIp
6
6
  module Linux
7
7
  module LandrushIpGet
8
8
  def self.landrush_ip_get(machine)
9
+ machine.guest.capability(:landrush_ip_install) unless machine.guest.capability(:landrush_ip_installed)
10
+
9
11
  result = ''
10
12
  machine.communicate.execute(command) do |type, data|
11
13
  result << data if type == :stdout
@@ -6,6 +6,8 @@ module LandrushIp
6
6
  module Windows
7
7
  module LandrushIpGet
8
8
  def self.landrush_ip_get(machine)
9
+ machine.guest.capability(:landrush_ip_install) unless machine.guest.capability(:landrush_ip_installed)
10
+
9
11
  result = ''
10
12
  machine.communicate.execute(command) do |type, data|
11
13
  result << data if type == :stdout
@@ -5,27 +5,42 @@ require 'vagrant/util/template_renderer'
5
5
  module LandrushIp
6
6
  class Config < Vagrant.plugin('2', :config)
7
7
  attr_accessor :override
8
+ attr_accessor :auto_install
8
9
 
9
10
  DEFAULTS = {
10
- override: false
11
+ auto_install: false
11
12
  }.freeze
12
13
 
13
14
  def initialize
14
15
  @override = UNSET_VALUE
15
- @logger = Log4r::Logger.new('vagrantplugins::landruship::config')
16
+ @auto_install = UNSET_VALUE
17
+ @logger = Log4r::Logger.new('vagrantplugins::landruship::config')
16
18
  end
17
19
 
18
20
  def default_options(new_values = {})
19
- @default_options = {} if @default_options == UNSET_VALUE
21
+ @default_options = DEFAULTS if @default_options == UNSET_VALUE
20
22
  @default_options.merge! new_values
21
23
  end
22
24
 
23
- def override?
24
- @override
25
+ def auto_install?
26
+ # Keeping override for backward compatibility
27
+ @auto_install || @override == true
25
28
  end
26
29
 
27
30
  def finalize!
28
- @default_options = {} if @default_options == UNSET_VALUE
31
+ DEFAULTS.each do |name, value|
32
+ if instance_variable_get('@' + name.to_s) == UNSET_VALUE
33
+ instance_variable_set '@' + name.to_s, value
34
+ end
35
+ end
36
+ end
37
+
38
+ def validate(machine)
39
+ if @override != UNSET_VALUE
40
+ machine.env.ui.warn I18n.t('vagrant.config.landrush_ip.not_enabled')
41
+ end
42
+
43
+ nil
29
44
  end
30
45
  end
31
46
  end
@@ -1,3 +1,3 @@
1
1
  module LandrushIp
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
@@ -2,8 +2,10 @@ en:
2
2
  vagrant:
3
3
  config:
4
4
  landrush_ip:
5
- not_enabled: "Landrush IP override not enabled and Landrush was not found, nothing to do."
5
+ not_enabled: "Automatic installation for Landrush IP not enabled"
6
6
  not_installed: "Landrush IP not installed in guest yet (or it's an outdated version). Installing now."
7
+ warnings:
8
+ override: "landrush_ip.override is deprecated and will be removed in the next major version. Please use landrush_ip.auto_install instead."
7
9
  errors:
8
10
  unsupported_arch: "Unsupported architecture"
9
11
  cannot_install: "Unable to install landrush-ip"
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: landrush-ip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Werelds
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description:
@@ -64,17 +64,17 @@ require_paths:
64
64
  - lib
65
65
  required_ruby_version: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ! '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ! '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.4.3
77
+ rubygems_version: 2.4.8
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Capability plugin for Vagrant that allows more fine grained control over