vagrant-dotvm 0.35.1 → 0.36.0.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 336e192619e99879601a32c6b2418cde622d5c82
4
- data.tar.gz: 9578adb1b4a083e3836b5b47680391c85758e541
3
+ metadata.gz: 8778abd0fffaad0ecf7e19bd9f0161bf4e936d06
4
+ data.tar.gz: 7e108b5794e48293442d5368f77ea5c5356bb0d8
5
5
  SHA512:
6
- metadata.gz: 34a78839690fe2454f18283c2dccdb8ca12eee9bc182735568b59a01679875ee431681ad879707c3371643177aa09d2dc6c9ac76ac36fea3769c637198e4ab38
7
- data.tar.gz: 6cbb28e95b70cde53d685151181ec2a65c8941229d08612c893ae51edc08975d307d72c7d3b7916b30d44fba5f2c0b5013696019e9b160cc35da26e4d8e51356
6
+ metadata.gz: b4039d0bd6379ec0a7ad09897e9284cd91227f8d0f0892e8c78160cd8ffe66a454d32e3d466b9f057b1c2447f429d3c16e34b8d893b75be3bcd10beffe3d859a
7
+ data.tar.gz: 694570ceb77c4e7a80645f7c7c4351350d23ce79efb37b9498a8a49a4b3c301ee9b11790c1f367f5510fa4c78bd3cd859f54a1a5e66a29a78b87ff29a9d9017b
@@ -3,6 +3,7 @@ module VagrantPlugins
3
3
  module Config
4
4
  # Exception signaling error in configuration
5
5
  class InvalidConfigError < ArgumentError
6
+ attr_accessor :file
6
7
  end
7
8
  end
8
9
  end
@@ -7,10 +7,16 @@ module VagrantPlugins
7
7
  end
8
8
 
9
9
  def inject(vc)
10
- init_instance
11
- load_options
12
- load_projects
13
- Injector::Instance.inject @instance, vc
10
+ begin
11
+ init_instance
12
+ load_options
13
+ load_projects
14
+ Injector::Instance.inject @instance, vc
15
+ rescue VagrantPlugins::Dotvm::Config::InvalidConfigError => e
16
+ raise Vagrant::Errors::VagrantError.new, "DotVM: #{e.file}: #{e.message}"
17
+ rescue Psych::SyntaxError => e
18
+ raise Vagrant::Errors::VagrantError.new, "DotVM: #{e.file}: Syntax error, line #{e.line}, #{e.problem}"
19
+ end
14
20
  end
15
21
 
16
22
  private
@@ -19,7 +25,7 @@ module VagrantPlugins
19
25
  result = {}
20
26
 
21
27
  Dir[path].each do |fname|
22
- yaml = YAML.load(File.read(fname)) || {}
28
+ yaml = YAML.load_file(fname) || {}
23
29
  yaml.each do |name, value|
24
30
  fail "Variable #{name} already exists." if result.key? name
25
31
  result[name] = value
@@ -38,7 +44,7 @@ module VagrantPlugins
38
44
  def load_options
39
45
  Dir["#{@path}/options/*.yaml"].each do |file|
40
46
  @instance.options = Replacer.new
41
- .on(YAML.load(File.read(file)) || {})
47
+ .on(YAML.load_file(file) || {})
42
48
  .using(@instance.variables)
43
49
  .result
44
50
  end
@@ -64,18 +70,21 @@ module VagrantPlugins
64
70
  )
65
71
 
66
72
  Dir["#{dir}/machines/*.yaml"].each do |file|
67
- begin
68
- yaml = Replacer.new
69
- .on(YAML.load(File.read(file)) || [])
70
- .using(@instance.variables.merge(project.variables))
71
- .result
73
+ yaml = Replacer.new
74
+ .on(YAML.load_file(file) || [])
75
+ .using(@instance.variables.merge(project.variables))
76
+ .result
72
77
 
78
+ begin
73
79
  yaml.each do |machine_yaml|
74
80
  machine = project.new_machine
75
81
  machine.populate machine_yaml
76
82
  end
77
83
  rescue VagrantPlugins::Dotvm::Config::InvalidConfigError => e
78
- raise Vagrant::Errors::VagrantError.new, "DotVM: #{file}: #{e.message}"
84
+ # add filename to exception so we can display
85
+ # nice error message later.
86
+ e.file = file
87
+ raise e
79
88
  end
80
89
  end
81
90
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Dotvm
3
- VERSION = '0.35.1'
3
+ VERSION = '0.36.0.pre'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dotvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.35.1
4
+ version: 0.36.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Magosa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,9 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ">="
106
+ - - ">"
107
107
  - !ruby/object:Gem::Version
108
- version: '0'
108
+ version: 1.3.1
109
109
  requirements: []
110
110
  rubyforge_project:
111
111
  rubygems_version: 2.4.5.1