landrush-ip 0.2.3 → 0.2.7

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
+ SHA256:
3
+ metadata.gz: 5aaf87c61386a28a73fb39682cfabdd9b014d04d267c307bb9210c8027c93310
4
+ data.tar.gz: 47cc6cab95f68cdf23d91a7398a784b9374aa69ad01b2df0a6644a13268c144a
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: de7ae592d0936290141e9e51b4a09e838b3eed6d62836514416cbeb9d3825fb08978c486dffa61561c43a71769ea33a8daf60b292700b036ee26fc30ea21fa39
7
+ data.tar.gz: 743894ff2e4929cf52742af799c73f478c81ec95727796fa454ca95775847e079d71177cebcf8a9f1f62e7e52fb207074e7cba459162f8756f2bf2baa692252c
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
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
@@ -9,6 +9,8 @@ module LandrushIp
9
9
  'landrush-ip-linux_amd64'
10
10
  elsif uname =~ /(arm)/i
11
11
  'landrush-ip-linux_arm'
12
+ elsif uname =~ /(aarch64)/i
13
+ 'landrush-ip-linux_arm64'
12
14
  elsif uname =~ /(i386|i686)/i
13
15
  'landrush-ip-linux_386'
14
16
  else
File without changes
File without changes
@@ -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
File without changes
File without changes
File without changes
@@ -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
File without changes
@@ -51,7 +51,7 @@ module LandrushIp
51
51
  end
52
52
 
53
53
  if defined?(VagrantPlugins::ProviderLibvirt)
54
- hook.after(VagrantPlugins::ProviderLibvirt::Action::CreateNetworks, Action::Install, :provision)
54
+ hook.after(VagrantPlugins::ProviderLibvirt::Action::CreateNetworkInterfaces, Action::Install, :provision)
55
55
  end
56
56
 
57
57
  if defined?(HashiCorp::VagrantVMwarefusion)
@@ -1,3 +1,3 @@
1
1
  module LandrushIp
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.7'.freeze
3
3
  end
data/lib/landrush-ip.rb CHANGED
File without changes
data/locales/en.yml CHANGED
@@ -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"
Binary file
Binary file
Binary file
Binary file
Binary file
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.7
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: 2022-04-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:
@@ -52,6 +52,7 @@ files:
52
52
  - util/dist/landrush-ip-linux_386
53
53
  - util/dist/landrush-ip-linux_amd64
54
54
  - util/dist/landrush-ip-linux_arm
55
+ - util/dist/landrush-ip-linux_arm64
55
56
  - util/dist/landrush-ip-windows_386.exe
56
57
  - util/dist/landrush-ip-windows_amd64.exe
57
58
  homepage: https://github.com/Werelds/landrush-ip
@@ -64,17 +65,16 @@ require_paths:
64
65
  - lib
65
66
  required_ruby_version: !ruby/object:Gem::Requirement
66
67
  requirements:
67
- - - ! '>='
68
+ - - ">="
68
69
  - !ruby/object:Gem::Version
69
70
  version: '0'
70
71
  required_rubygems_version: !ruby/object:Gem::Requirement
71
72
  requirements:
72
- - - ! '>='
73
+ - - ">="
73
74
  - !ruby/object:Gem::Version
74
75
  version: '0'
75
76
  requirements: []
76
- rubyforge_project:
77
- rubygems_version: 2.4.3
77
+ rubygems_version: 3.1.2
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Capability plugin for Vagrant that allows more fine grained control over