vagrant-tart 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c396d57625272e20fa44038feb071add4d80fc19de6cf17e8339a46bdaef72ea
4
- data.tar.gz: ff2b337cb649360c7d451b721fb8c836e75e1e549fe282ca1a79307f7da36471
3
+ metadata.gz: 7304968aeaf2c309ef4e77a350054f83fb24d6119518e2372639ac27f51b3c73
4
+ data.tar.gz: 7baed83d857caeb259d10798500493e69bbf6267234dca7789e8654576a6ad8f
5
5
  SHA512:
6
- metadata.gz: 0bab80c64715d5292521cba50edbcbdae81c7cbe50ed42bb28bcb4a5e4169660688ddf8d4dfb903f0d65eaf861df47f5af91982ca15b4b348654be97cce4b51a
7
- data.tar.gz: 0267bb6950b5eb82c7ec11c0d2c7dedfc4d753353f372189033500709a3f3a8841090b09b9998d761718a04ceaa0b4864218316149dad08d4a96782d947b0702
6
+ metadata.gz: 6a9a0510aa5cf86519e744de29182bfd3feccd0545314b170ec955c505414bd16d77046dbbbb085d75d004be4db60cb3377effa3ffb66ddc309f6dffb6b78f97
7
+ data.tar.gz: cf738b29374eda9c4884c6c03dd58ae6fd96383ba44b9f31d19695397f71497a9fab1a4e94a7d01098f3611a3c2940cdd737326827bad115349f76c917ba74db
@@ -25,7 +25,7 @@ module VagrantPlugins
25
25
  return @app.call(env) if instance.nil? || instance.vagrant_state == :running
26
26
 
27
27
  env[:ui].output(I18n.t("vagrant_tart.messages.configuring_instance", name: name))
28
- driver.set(name, "cpu", config.cpu)
28
+ driver.set(name, "cpus", config.cpus)
29
29
  driver.set(name, "memory", config.memory)
30
30
  driver.set(name, "disk", config.disk)
31
31
  driver.set(name, "display", config.display)
@@ -14,11 +14,13 @@ module VagrantPlugins
14
14
  action_root = Pathname.new(File.expand_path("action", __dir__))
15
15
  autoload :CreateInstance, action_root.join("create_instance")
16
16
  autoload :DeleteInstance, action_root.join("delete_instance")
17
+ autoload :ForwardPorts, action_root.join("forward_ports")
17
18
  autoload :GetState, action_root.join("get_state")
18
19
  autoload :Login, action_root.join("login")
19
20
  autoload :PullImage, action_root.join("pull_image")
20
21
  autoload :StartInstance, action_root.join("start_instance")
21
22
  autoload :StopInstance, action_root.join("stop_instance")
23
+ autoload :SuspendInstance, action_root.join("suspend_instance")
22
24
 
23
25
  # Vargrant action "destroy".
24
26
  def self.action_destroy
@@ -26,7 +28,7 @@ module VagrantPlugins
26
28
  b.use ConfigValidate
27
29
 
28
30
  b.use Call, IsState, :not_created do |env1, b1|
29
- raise Errors::InstanceNotCreatedError if env1[:result]
31
+ raise Errors::InstanceNotCreatedError if env1[:result]
30
32
 
31
33
  b1.use Call, DestroyConfirm do |env2, b2|
32
34
  if env2[:result]
@@ -22,7 +22,7 @@ module VagrantPlugins
22
22
  attr_accessor :name
23
23
 
24
24
  # @return [Integer] Number of CPUs
25
- attr_accessor :cpu
25
+ attr_accessor :cpus
26
26
  # @return [Integer] Memory size in MB
27
27
  attr_accessor :memory
28
28
  # @return [Integer] Disk storage size in GB
@@ -48,7 +48,7 @@ module VagrantPlugins
48
48
  @image = UNSET_VALUE
49
49
  @name = UNSET_VALUE
50
50
 
51
- @cpu = UNSET_VALUE
51
+ @cpus = UNSET_VALUE
52
52
  @memory = UNSET_VALUE
53
53
  @disk = UNSET_VALUE
54
54
  @gui = UNSET_VALUE
@@ -67,7 +67,7 @@ module VagrantPlugins
67
67
  @image = nil if @image == UNSET_VALUE
68
68
  @name = nil if @name == UNSET_VALUE
69
69
 
70
- @cpu = 1 if @cpu == UNSET_VALUE
70
+ @cpus = 1 if @cpus == UNSET_VALUE
71
71
  @memory = 1024 if @memory == UNSET_VALUE
72
72
  @disk = 10 if @disk == UNSET_VALUE
73
73
  @gui = false if @gui == UNSET_VALUE
@@ -92,10 +92,10 @@ module VagrantPlugins
92
92
  # Check that the GUI flag is a valid boolean
93
93
  errors << I18n.t("vagrant_tart.config.gui_invalid") unless @gui == true || @gui == false
94
94
 
95
- # Check that CPU is a valid number and between 1 and the maximum available CPUs
95
+ # Check that CPUs is a valid number and between 1 and the maximum available CPUs
96
96
  max_cpus = Etc.nprocessors
97
- unless (@cpu.is_a? Integer) && @cpu >= 1 && @cpu <= max_cpus
98
- errors << I18n.t("vagrant_tart.config.cpu_invalid", max_cpus: max_cpus)
97
+ unless (@cpus.is_a? Integer) && @cpus >= 1 && @cpus <= max_cpus
98
+ errors << I18n.t("vagrant_tart.config.cpus_invalid", max_cpus: max_cpus)
99
99
  end
100
100
 
101
101
  # Check that memory is a valid number and between 1 and the maximum available memory
@@ -6,7 +6,7 @@ module VagrantPlugins
6
6
  # Represents the result of a Tart 'get' operation.
7
7
  class GetResult
8
8
  # @return [Integer] The number of CPUs of the machine.
9
- attr_accessor :cpu
9
+ attr_accessor :cpus
10
10
  # @return [Integer] The size of the machine's disk.
11
11
  attr_accessor :disk
12
12
  # @return [Boolean] Whether the machine is running.
@@ -25,7 +25,7 @@ module VagrantPlugins
25
25
  # Initialize the result from raw data.
26
26
  # @param [Hash] data The raw data.
27
27
  def initialize(data)
28
- @cpu = data["CPU"]
28
+ @cpus = data["CPU"]
29
29
  @disk = data["Disk"]
30
30
  @running = data["Running"]
31
31
  @memory = data["Memory"]
@@ -26,7 +26,6 @@ module VagrantPlugins
26
26
  # Register the provider.
27
27
  provider(:tart, box_optional: true, parallel: true) do
28
28
  setup_i18n
29
-
30
29
  require_relative "provider"
31
30
  Provider
32
31
  end
@@ -127,7 +127,7 @@ module VagrantPlugins
127
127
  # Map the key to the correct switch
128
128
  switch = nil
129
129
  case key
130
- when "cpu"
130
+ when "cpus"
131
131
  switch = "--cpu"
132
132
  when "memory"
133
133
  switch = "--memory"
@@ -4,6 +4,6 @@ module VagrantPlugins
4
4
  # Top level module for the Tart provider plugin.
5
5
  module Tart
6
6
  # Current version of the Tart provider plugin.
7
- VERSION = "0.0.2"
7
+ VERSION = "0.0.3"
8
8
  end
9
9
  end
data/locales/en.yml CHANGED
@@ -8,8 +8,8 @@ en:
8
8
 
9
9
  gui_invalid: |-
10
10
  Configuration must specify a valid GUI setting (true or false)
11
- cpu_invalid: |-
12
- Configuration must specify a valid CPU count (between 1 and %{max_cpus})
11
+ cpus_invalid: |-
12
+ Configuration must specify a valid CPUs count (between 1 and %{max_cpus})
13
13
  memory_invalid: |-
14
14
  Configuration must specify a valid memory size (between 1 and %{max_memory} MB)
15
15
  disk_invalid: |-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-tart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Etiemble
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-05 00:00:00.000000000 Z
11
+ date: 2024-06-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Allows Vagrant to manage Tart virtual machines.
14
14
  email: