nugrant 2.1.2 → 2.1.4

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.
Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +23 -23
  3. data/.travis.yml +15 -10
  4. data/CHANGELOG.md +347 -338
  5. data/CONTRIBUTORS.md +7 -5
  6. data/Gemfile +13 -13
  7. data/README.md +601 -601
  8. data/lib/nugrant/bag.rb +264 -264
  9. data/lib/nugrant/config.rb +201 -201
  10. data/lib/nugrant/helper/bag.rb +38 -38
  11. data/lib/nugrant/helper/env/exporter.rb +195 -195
  12. data/lib/nugrant/helper/env/namer.rb +47 -47
  13. data/lib/nugrant/helper/parameters.rb +12 -12
  14. data/lib/nugrant/helper/stack.rb +86 -86
  15. data/lib/nugrant/mixin/parameters.rb +178 -178
  16. data/lib/nugrant/parameters.rb +29 -29
  17. data/lib/nugrant/vagrant/errors.rb +35 -35
  18. data/lib/nugrant/vagrant/v2/action/auto_export.rb +45 -45
  19. data/lib/nugrant/vagrant/v2/action.rb +17 -17
  20. data/lib/nugrant/vagrant/v2/command/env.rb +118 -118
  21. data/lib/nugrant/vagrant/v2/command/parameters.rb +153 -153
  22. data/lib/nugrant/vagrant/v2/command/restricted_keys.rb +64 -64
  23. data/lib/nugrant/vagrant/v2/command/root.rb +95 -95
  24. data/lib/nugrant/vagrant/v2/config/user.rb +29 -29
  25. data/lib/nugrant/vagrant/v2/helper.rb +96 -96
  26. data/lib/nugrant/vagrant/v2/plugin.rb +34 -34
  27. data/lib/nugrant/version.rb +3 -3
  28. data/lib/nugrant.rb +31 -31
  29. data/locales/en.yml +24 -24
  30. data/locales/fr.yml +24 -24
  31. data/nugrant.gemspec +32 -32
  32. data/test/lib/nugrant/helper/env/test_exporter.rb +238 -238
  33. data/test/lib/nugrant/helper/test_bag.rb +16 -16
  34. data/test/lib/nugrant/helper/test_parameters.rb +17 -17
  35. data/test/lib/nugrant/helper/test_stack.rb +152 -152
  36. data/test/lib/nugrant/test_bag.rb +450 -450
  37. data/test/lib/nugrant/test_config.rb +201 -201
  38. data/test/lib/nugrant/test_parameters.rb +438 -438
  39. data/test/lib/test_helper.rb +3 -3
  40. data/test/resources/README.md +52 -52
  41. data/test/resources/json/params_current_1.json +6 -6
  42. data/test/resources/json/params_current_2.json +29 -29
  43. data/test/resources/json/params_user_nil_values.json +9 -9
  44. data/test/resources/vagrantfiles/v2.auto_export +13 -13
  45. data/test/resources/vagrantfiles/v2.bag_inside_array +15 -15
  46. data/test/resources/vagrantfiles/v2.defaults_mixed_string_symbols +18 -18
  47. data/test/resources/vagrantfiles/v2.defaults_null_values_in_vagrantuser +23 -23
  48. data/test/resources/vagrantfiles/v2.defaults_using_string +18 -18
  49. data/test/resources/vagrantfiles/v2.defaults_using_symbol +18 -18
  50. data/test/resources/vagrantfiles/v2.empty +2 -2
  51. data/test/resources/vagrantfiles/v2.fake +29 -29
  52. data/test/resources/vagrantfiles/v2.missing_parameter +3 -3
  53. data/test/resources/vagrantfiles/v2.real +22 -22
  54. data/test/resources/yaml/params_array.yml +5 -5
  55. data/test/resources/yaml/params_boolean.yml +1 -1
  56. data/test/resources/yaml/params_combinations.yml +72 -72
  57. data/test/resources/yaml/params_current_1.yml +4 -4
  58. data/test/resources/yaml/params_current_2.yml +23 -23
  59. data/test/resources/yaml/params_defaults_at_root.yml +1 -1
  60. data/test/resources/yaml/params_defaults_not_at_root.yml +2 -2
  61. data/test/resources/yaml/params_list.yml +2 -2
  62. data/test/resources/yaml/params_numeric_key.yml +3 -3
  63. data/test/resources/yaml/params_simple.yml +1 -1
  64. data/test/resources/yaml/params_system_1.yml +4 -4
  65. data/test/resources/yaml/params_system_2.yml +25 -25
  66. data/test/resources/yaml/params_unix_eol.yml +3 -3
  67. data/test/resources/yaml/params_user_1.yml +4 -4
  68. data/test/resources/yaml/params_user_2.yml +23 -23
  69. data/test/resources/yaml/params_user_nil_values.yml +5 -5
  70. data/test/resources/yaml/params_windows_eol.yml +3 -3
  71. metadata +12 -13
data/CHANGELOG.md CHANGED
@@ -1,338 +1,347 @@
1
- # 2.1.2 (January 12th, 2015)
2
-
3
- * Fixed indifferent access inside arrays. Array elements of type `Hash`
4
- are now converted to `Bag` instances (recursively). This fix the
5
- indifferent access of `Bag` elements inside arrays.
6
-
7
- Fixes [issue #27](https://github.com/maoueh/nugrant/issues/27).
8
-
9
- # 2.1.1 (December 2nd, 2014)
10
-
11
- * Permit numeric keys in bag. They are converted to symbol
12
- like others.
13
-
14
- Fixes [issue #26](https://github.com/maoueh/nugrant/issues/26).
15
-
16
- * Removed old code that was switching YAML engine to `syck` when
17
- it was available.
18
-
19
- Fixes [issue #14](https://github.com/maoueh/nugrant/issues/14) again.
20
-
21
- * Fixed auto export variables on `vagrant provision` feature. The
22
- initial release is not working correctly.
23
-
24
- * Changed how module shortcut is defined. The shortcut is now defined
25
- inside the class using it to avoid already defined warnings.
26
-
27
- Fixes [issue #24](https://github.com/maoueh/nugrant/issues/24).
28
-
29
- # 2.1.0 (November 1st, 2014)
30
-
31
- * Added possibility to specify the script path where to generate
32
- the environment commands (export/unset) when using the
33
- `vagrant user env` command.
34
-
35
- * Added possibility to automatically export variables on vagrant provision.
36
- This can be used by specifying `config.user.auto_export = <format>` in
37
- your Vagrantfile where <format> can be one of:
38
-
39
- * `false` => No auto export (default value).
40
- * `:autoenv` => Export to [autoenv](https://github.com/kennethreitz/autoenv) script format.
41
- * `:script` => Export to a bash script file.
42
- * `[:autoenv, :script]` => export both format.
43
-
44
- The default generated script path is "./nugrant2env.sh". You can change
45
- the default script name by specifying the configuration key `config.user.auto_export_script_path`
46
- in your Vagrantfile:
47
-
48
- config.user.auto_export_script_path = "./script/example.sh"
49
-
50
- Contributed by [@ruifil](https://github.com/ruifil).
51
-
52
- # 2.0.2 (July 13th, 2014)
53
-
54
- * Fixed a bug when using some vagrant commands. The code to retrieve
55
- the Vagrantfile name was not accurate in respect to where it was
56
- copied. When the env variable `VAGRANT_VAGRANTFILE` is set, it
57
- then must be wrapped inside an array.
58
-
59
- Fixes [issue #21](https://github.com/maoueh/nugrant/issues/21).
60
-
61
- # 2.0.1 (July 10th, 2014)
62
-
63
- * Fixed a bug when using the plugin. A require clause was missing,
64
- it was working when doing commands but not when using Vagrant
65
- directly.
66
-
67
- Fixes [issue #20](https://github.com/maoueh/nugrant/issues/20).
68
-
69
- # 2.0.0 (July 9th, 2014)
70
-
71
- * Fixed retrieval of current directory for `.vagrantuser`. The directory
72
- is now that same as the one of the `Vagrantfile`. Rules have been
73
- copied for Vagrant's one, hence, the behavior should be the same.
74
-
75
- * Fixed bad implementation of config class `::Vagrant.plugin("2", :config)`
76
- where `merge` was not implemented and was causing errors. Now, all objects
77
- (i.e. `Config`, `Bag` and `Parameters` implements `merge` and `merge!`
78
- correctly).
79
-
80
- * Added possibility to change array merge strategy. This can
81
- be used in Vagrant by doing `config.user.array_merge_strategy = <strategy>`
82
- where valid strategies are:
83
-
84
- * :replace => Replace current values by new ones
85
- * :extend => Merge current values with new ones
86
- * :concat => Append new values to current ones
87
-
88
- * Better handling in Vagrant of cases where the vagrant user
89
- file cannot be parsed correctly. This is now reported
90
- as an error in Vagrant an nicely displayed with the path
91
- of the offending file and the parser error message.
92
-
93
- * Better handling of how global Nugrant options are passed and
94
- handled. Everything is now located in the `Nugrant::Config`
95
- object and used by everything that need some configuration
96
- parameters.
97
-
98
- * It is now possible to customize key error handling by passing
99
- an options hash with key `:key_error` and a `Proc` value.
100
-
101
- * Improved command `vagrant user parameters`. The command now checks if
102
- restricted keys are used and prints a warning when it's the case.
103
-
104
- * Added a new command `vagrant user restricted-keys` that prints the keys that
105
- are restricted, i.e. that cannot be accessed using method access
106
- syntax.
107
-
108
- * Added possibility to specify merge strategy to use when merging
109
- two arrays together.
110
-
111
- ### Backward Incompatibilities
112
-
113
- * Removed deprecated `--script` argument from `vagrant user env` command.
114
-
115
- * Support for Ruby <= 1.9.2 has been dropped. This is not a problem when using
116
- Nugrant as a Vagrant plugin. Use branch `1.x` if you can't upgrade to
117
- Ruby >= 1.9.3.
118
-
119
- * Support for Vagrant 0.x has been dropped. This means that Nugrant 2.x will not
120
- load if installed in a Vagrant 0.x environment. Use branch `1.x` if you can't
121
- upgrade to Vagrant 1.x.
122
-
123
- * `Bag` and `Parameters` and Vagrant configuration object `config.user` are now
124
- [Enumerable](http://ruby-doc.org/core-2.0.0/Enumerable.html).
125
-
126
- This change has implications on the resolving process of the variables
127
- that are stored in the `Bag` when using the dot syntax `(config.user.email)`
128
- in your code and `Vagrantfiles`. By using this syntax with version 2.0, some keys
129
- will collapse with the internal object's methods. In fact, it was already the
130
- case before but to a much smaller scope because object were not enumerable.
131
-
132
- The number of conflicts should be rather low because the restricted keys
133
- are not commonly used as parameter name. The list of the restricted keys
134
- is the following:
135
-
136
- !, !=, !~, <=>, ==, ===, =~, [], __all, __current, __defaults,
137
- __id__, __send__, __system, __user, _detected_errors, _finalize!,
138
- all?, any?, chunk, class, clear!, clone, collect, collect_concat,
139
- compute_all!, compute_bags!, count, cycle, defaults, defaults=,
140
- define_singleton_method, detect, display, drop, drop_while, dup,
141
- each, each_cons, each_entry, each_slice, each_with_index,
142
- each_with_object, empty?, entries, enum_for, eql?, equal?, extend,
143
- finalize!, find, find_all, find_index, first, flat_map, freeze,
144
- frozen?, gem, grep, group_by, has?, hash, include?, inject,
145
- inspect, instance_eval, instance_exec, instance_of?,
146
- instance_variable_defined?, instance_variable_get,
147
- instance_variable_set, instance_variables, instance_variables_hash,
148
- is_a?, kind_of?, lazy, map, max, max_by, member?, merge, merge!,
149
- method, method_missing, methods, min, min_by, minmax, minmax_by,
150
- nil?, none?, object_id, one?, partition, private_methods,
151
- protected_methods, psych_to_yaml, public_method, public_methods,
152
- public_send, reduce, reject, remove_instance_variable, respond_to?,
153
- reverse_each, select, send, set_options, singleton_class,
154
- singleton_methods, slice_before, sort, sort_by, suppress_warnings,
155
- taint, tainted?, take, take_while, tap, to_a, to_enum, to_hash,
156
- to_json, to_s, to_set, to_yaml, to_yaml_properties, trust, untaint,
157
- untrust, untrusted?, validate, zip
158
-
159
- * The `Parameter` class has a new API.
160
-
161
- * The `Bag` class has a new API.
162
-
163
- # 1.4.2 (January 11th, 2014)
164
-
165
- * Fixed Vagrant `user` config class to make the `has?` method
166
- available to people using Vagrant. This considered has a bug
167
- fix because using `has?` was not working anyway before.
168
-
169
- # 1.4.1 (December 15th, 2013)
170
-
171
- * Fixed a superfluous warning message when using ruby >= 2.0.0 which is now the
172
- default when installing Vagrant >= 1.4.0 (at least on Windows).
173
-
174
- # 1.4.0 (November 28th, 2013)
175
-
176
- * Adding support to export to an [autoenv](https://github.com/kennethreitz/autoenv)
177
- file. See [GH-13](https://github.com/maoueh/nugrant/issues/13).
178
-
179
- * Deprecated usage of `-s, --script` option for command
180
- `vagrant user env`. This was replaced by the more generic
181
- and extensible `-f, --format FORMAT` option. The
182
- `-s, --script` option will be removed in 2.0.
183
-
184
- # 1.3.0 (November 19th, 2013)
185
-
186
- * Now using [minitest](https://github.com/seattlerb/minitest) as our
187
- testing library.
188
-
189
- * Added a new command that can be used either standalone or via
190
- a small bash script to easily export environment variables
191
- from your currently set parameters. See
192
- [GH-13](https://github.com/maoueh/nugrant/issues/13).
193
-
194
- * Keys associated to a null value are considered as being missing
195
- by the merge process. It is still possible to define a null
196
- parameter, but it will be overridden by any parameter and will not
197
- override any. See [GH-12](https://github.com/maoueh/nugrant/issues/12).
198
-
199
- * Fixed output of command `vagrant user parameters`, the keys were
200
- serialized as symbol instead of string.
201
-
202
- # 1.2.0 (October 24th, 2013)
203
-
204
- * Now showing better error message to the end-user when a parameter
205
- cannot be found. The message displays which key could not be found.
206
- Moreover, we show the context within the Vagrantfile where we think
207
- the error occurred:
208
-
209
- ```
210
- Nugrant: Parameter 'param' was not found, is it defined in
211
- your .vagrantuser file? Here where we think the error
212
- could be in your Vagrantfile:
213
-
214
- 1: Vagrant.configure("2") do |config|
215
- 2:>> puts config.user.param
216
- 3: end
217
- ```
218
-
219
- See [GH-8] (https://github.com/maoueh/nugrant/issues/8).
220
-
221
- * Ensured that keys used within a `Bag` are always symbol. This make
222
- sure that it is possible to retrieve a value with any access method.
223
- See [GH-9](https://github.com/maoueh/nugrant/issues/9).
224
-
225
- * Now using [multi_json](https://rubygems.org/gems/multi_json)
226
- for JSON handling.
227
-
228
- # 1.1.0 (May 17th, 2013)
229
-
230
- * Rewrite completely classes `Parameters` and `Bag`.
231
- * Reduced chances to have a parameter name collapsing with an
232
- implementation method.
233
-
234
- * Removed dependency on `deep_merge`. We do now perform
235
- our own merge.
236
-
237
- * Added possibility to iterate through keys by using
238
- `.each`:
239
-
240
- ```
241
- config.user.local.each do |name, value|
242
- puts "Key #{name}: #{value}"
243
- end
244
- ```
245
-
246
- ### Backward Incompatibilities
247
-
248
- * `Parameters` is not extending the `Bag` class anymore.
249
-
250
- * `Parameters` and `Bag` attributes and methods are now almost
251
- all prefixed with __ to reduce clashes to a minimum when
252
- accessing parameters with method-like syntax
253
- (i.e. `parameters.git.master` instead of `parameters['git']['master']`)
254
-
255
- # 1.0.1 (April 9th, 2013)
256
-
257
- * Fixed a crash when `user` config value is `nil` preventing `vagrant user parameters`
258
- from working as expected. See [GH-4](https://github.com/maoueh/nugrant/issues/4).
259
-
260
- * Fixed a bug preventing the version from being printed when doing `vagrant user -v`.
261
-
262
- # 1.0.0 (March 21th, 2013)
263
-
264
- * For now on, this gem will follow semantic versioning.
265
- * Refactored how Vagrant plugin is architectured.
266
- * Now supporting Vagrant 1.1.x (Plugin version "2").
267
-
268
- # 0.0.14
269
-
270
- * Renamed `ParameterBag` to `Bag`
271
-
272
- * Cleanup `Bag` api
273
- * Renamed method `has_param?` to `has_key?` in `Bag`
274
- * Removed method `get_params` from `Bag`
275
-
276
- # 0.0.13
277
-
278
- * Cleanup `Parameters` and `ParameterBag` interface
279
- * The method `defaults` has been removed from the bag
280
- * Setting defaults on `Parameters` now recompute the final bag
281
-
282
- * Improved `vagrant user parameters` command
283
- * Now using the exact config as seen by Vagrant, this includes defaults parameters
284
- * An option has been added to only see defaults parameters
285
-
286
- # 0.0.12
287
-
288
- * Added travis configuration file
289
-
290
- * Added travis build status icon to readme
291
-
292
- * Fixed a bug when `.vagrantuser` file is empty or not a hash type
293
-
294
- * Improved parameters command
295
- * The parameters command is now a proper subcommand
296
- * An option has been added to see system parameters
297
- * An option has been added to see user parameters
298
- * An option has been added to see project parameters
299
-
300
- # 0.0.11
301
-
302
- * Updated README file for installation via rubygems.org
303
-
304
- # 0.0.10
305
-
306
- * Added a subcommand `parameters` for vagrant command `user`
307
-
308
- * Added a vagrant command `vagrant user subcommand [options]`
309
-
310
- # 0.0.9
311
-
312
- * Fixed a bug with the new default values implementation
313
-
314
- # 0.0.8
315
-
316
- * Introduced possibility to set default values
317
-
318
- * Introduced restricted keys (For now, restricted keys are [`defaults`]).
319
-
320
- * Fixed a bug with system-wide parameters
321
-
322
- # 0.0.7
323
-
324
- * YAML is back as the default file format for parameters
325
-
326
- # 0.0.6
327
-
328
- * Fixed a bug on ruby 1.8.7 which doesn't have yaml included in its load path by default
329
-
330
- # 0.0.5
331
-
332
- * Introduced system-wide parameters file
333
-
334
- # 0.0.4
335
-
336
- * JSON is now the default file format for parameters (due to problem with YAML)
337
-
338
- * It is now possible to store parameters in the JSON format
1
+ # 2.1.4 (November 12th, 2024)
2
+
3
+ * Remove usage of `File.exists?` that has been removed and replace with `File.exist?`.
4
+
5
+ # 2.1.3 (February 24th, 2016)
6
+
7
+ * Ensures Unix line ending are used when generating env scripts
8
+ (`autoenv` and `bash`).
9
+
10
+ # 2.1.2 (January 12th, 2015)
11
+
12
+ * Fixed indifferent access inside arrays. Array elements of type `Hash`
13
+ are now converted to `Bag` instances (recursively). This fix the
14
+ indifferent access of `Bag` elements inside arrays.
15
+
16
+ Fixes [issue #27](https://github.com/maoueh/nugrant/issues/27).
17
+
18
+ # 2.1.1 (December 2nd, 2014)
19
+
20
+ * Permit numeric keys in bag. They are converted to symbol
21
+ like others.
22
+
23
+ Fixes [issue #26](https://github.com/maoueh/nugrant/issues/26).
24
+
25
+ * Removed old code that was switching YAML engine to `syck` when
26
+ it was available.
27
+
28
+ Fixes [issue #14](https://github.com/maoueh/nugrant/issues/14) again.
29
+
30
+ * Fixed auto export variables on `vagrant provision` feature. The
31
+ initial release is not working correctly.
32
+
33
+ * Changed how module shortcut is defined. The shortcut is now defined
34
+ inside the class using it to avoid already defined warnings.
35
+
36
+ Fixes [issue #24](https://github.com/maoueh/nugrant/issues/24).
37
+
38
+ # 2.1.0 (November 1st, 2014)
39
+
40
+ * Added possibility to specify the script path where to generate
41
+ the environment commands (export/unset) when using the
42
+ `vagrant user env` command.
43
+
44
+ * Added possibility to automatically export variables on vagrant provision.
45
+ This can be used by specifying `config.user.auto_export = <format>` in
46
+ your Vagrantfile where <format> can be one of:
47
+
48
+ * `false` => No auto export (default value).
49
+ * `:autoenv` => Export to [autoenv](https://github.com/kennethreitz/autoenv) script format.
50
+ * `:script` => Export to a bash script file.
51
+ * `[:autoenv, :script]` => export both format.
52
+
53
+ The default generated script path is "./nugrant2env.sh". You can change
54
+ the default script name by specifying the configuration key `config.user.auto_export_script_path`
55
+ in your Vagrantfile:
56
+
57
+ config.user.auto_export_script_path = "./script/example.sh"
58
+
59
+ Contributed by [@ruifil](https://github.com/ruifil).
60
+
61
+ # 2.0.2 (July 13th, 2014)
62
+
63
+ * Fixed a bug when using some vagrant commands. The code to retrieve
64
+ the Vagrantfile name was not accurate in respect to where it was
65
+ copied. When the env variable `VAGRANT_VAGRANTFILE` is set, it
66
+ then must be wrapped inside an array.
67
+
68
+ Fixes [issue #21](https://github.com/maoueh/nugrant/issues/21).
69
+
70
+ # 2.0.1 (July 10th, 2014)
71
+
72
+ * Fixed a bug when using the plugin. A require clause was missing,
73
+ it was working when doing commands but not when using Vagrant
74
+ directly.
75
+
76
+ Fixes [issue #20](https://github.com/maoueh/nugrant/issues/20).
77
+
78
+ # 2.0.0 (July 9th, 2014)
79
+
80
+ * Fixed retrieval of current directory for `.vagrantuser`. The directory
81
+ is now that same as the one of the `Vagrantfile`. Rules have been
82
+ copied for Vagrant's one, hence, the behavior should be the same.
83
+
84
+ * Fixed bad implementation of config class `::Vagrant.plugin("2", :config)`
85
+ where `merge` was not implemented and was causing errors. Now, all objects
86
+ (i.e. `Config`, `Bag` and `Parameters` implements `merge` and `merge!`
87
+ correctly).
88
+
89
+ * Added possibility to change array merge strategy. This can
90
+ be used in Vagrant by doing `config.user.array_merge_strategy = <strategy>`
91
+ where valid strategies are:
92
+
93
+ * :replace => Replace current values by new ones
94
+ * :extend => Merge current values with new ones
95
+ * :concat => Append new values to current ones
96
+
97
+ * Better handling in Vagrant of cases where the vagrant user
98
+ file cannot be parsed correctly. This is now reported
99
+ as an error in Vagrant an nicely displayed with the path
100
+ of the offending file and the parser error message.
101
+
102
+ * Better handling of how global Nugrant options are passed and
103
+ handled. Everything is now located in the `Nugrant::Config`
104
+ object and used by everything that need some configuration
105
+ parameters.
106
+
107
+ * It is now possible to customize key error handling by passing
108
+ an options hash with key `:key_error` and a `Proc` value.
109
+
110
+ * Improved command `vagrant user parameters`. The command now checks if
111
+ restricted keys are used and prints a warning when it's the case.
112
+
113
+ * Added a new command `vagrant user restricted-keys` that prints the keys that
114
+ are restricted, i.e. that cannot be accessed using method access
115
+ syntax.
116
+
117
+ * Added possibility to specify merge strategy to use when merging
118
+ two arrays together.
119
+
120
+ ### Backward Incompatibilities
121
+
122
+ * Removed deprecated `--script` argument from `vagrant user env` command.
123
+
124
+ * Support for Ruby <= 1.9.2 has been dropped. This is not a problem when using
125
+ Nugrant as a Vagrant plugin. Use branch `1.x` if you can't upgrade to
126
+ Ruby >= 1.9.3.
127
+
128
+ * Support for Vagrant 0.x has been dropped. This means that Nugrant 2.x will not
129
+ load if installed in a Vagrant 0.x environment. Use branch `1.x` if you can't
130
+ upgrade to Vagrant 1.x.
131
+
132
+ * `Bag` and `Parameters` and Vagrant configuration object `config.user` are now
133
+ [Enumerable](http://ruby-doc.org/core-2.0.0/Enumerable.html).
134
+
135
+ This change has implications on the resolving process of the variables
136
+ that are stored in the `Bag` when using the dot syntax `(config.user.email)`
137
+ in your code and `Vagrantfiles`. By using this syntax with version 2.0, some keys
138
+ will collapse with the internal object's methods. In fact, it was already the
139
+ case before but to a much smaller scope because object were not enumerable.
140
+
141
+ The number of conflicts should be rather low because the restricted keys
142
+ are not commonly used as parameter name. The list of the restricted keys
143
+ is the following:
144
+
145
+ !, !=, !~, <=>, ==, ===, =~, [], __all, __current, __defaults,
146
+ __id__, __send__, __system, __user, _detected_errors, _finalize!,
147
+ all?, any?, chunk, class, clear!, clone, collect, collect_concat,
148
+ compute_all!, compute_bags!, count, cycle, defaults, defaults=,
149
+ define_singleton_method, detect, display, drop, drop_while, dup,
150
+ each, each_cons, each_entry, each_slice, each_with_index,
151
+ each_with_object, empty?, entries, enum_for, eql?, equal?, extend,
152
+ finalize!, find, find_all, find_index, first, flat_map, freeze,
153
+ frozen?, gem, grep, group_by, has?, hash, include?, inject,
154
+ inspect, instance_eval, instance_exec, instance_of?,
155
+ instance_variable_defined?, instance_variable_get,
156
+ instance_variable_set, instance_variables, instance_variables_hash,
157
+ is_a?, kind_of?, lazy, map, max, max_by, member?, merge, merge!,
158
+ method, method_missing, methods, min, min_by, minmax, minmax_by,
159
+ nil?, none?, object_id, one?, partition, private_methods,
160
+ protected_methods, psych_to_yaml, public_method, public_methods,
161
+ public_send, reduce, reject, remove_instance_variable, respond_to?,
162
+ reverse_each, select, send, set_options, singleton_class,
163
+ singleton_methods, slice_before, sort, sort_by, suppress_warnings,
164
+ taint, tainted?, take, take_while, tap, to_a, to_enum, to_hash,
165
+ to_json, to_s, to_set, to_yaml, to_yaml_properties, trust, untaint,
166
+ untrust, untrusted?, validate, zip
167
+
168
+ * The `Parameter` class has a new API.
169
+
170
+ * The `Bag` class has a new API.
171
+
172
+ # 1.4.2 (January 11th, 2014)
173
+
174
+ * Fixed Vagrant `user` config class to make the `has?` method
175
+ available to people using Vagrant. This considered has a bug
176
+ fix because using `has?` was not working anyway before.
177
+
178
+ # 1.4.1 (December 15th, 2013)
179
+
180
+ * Fixed a superfluous warning message when using ruby >= 2.0.0 which is now the
181
+ default when installing Vagrant >= 1.4.0 (at least on Windows).
182
+
183
+ # 1.4.0 (November 28th, 2013)
184
+
185
+ * Adding support to export to an [autoenv](https://github.com/kennethreitz/autoenv)
186
+ file. See [GH-13](https://github.com/maoueh/nugrant/issues/13).
187
+
188
+ * Deprecated usage of `-s, --script` option for command
189
+ `vagrant user env`. This was replaced by the more generic
190
+ and extensible `-f, --format FORMAT` option. The
191
+ `-s, --script` option will be removed in 2.0.
192
+
193
+ # 1.3.0 (November 19th, 2013)
194
+
195
+ * Now using [minitest](https://github.com/seattlerb/minitest) as our
196
+ testing library.
197
+
198
+ * Added a new command that can be used either standalone or via
199
+ a small bash script to easily export environment variables
200
+ from your currently set parameters. See
201
+ [GH-13](https://github.com/maoueh/nugrant/issues/13).
202
+
203
+ * Keys associated to a null value are considered as being missing
204
+ by the merge process. It is still possible to define a null
205
+ parameter, but it will be overridden by any parameter and will not
206
+ override any. See [GH-12](https://github.com/maoueh/nugrant/issues/12).
207
+
208
+ * Fixed output of command `vagrant user parameters`, the keys were
209
+ serialized as symbol instead of string.
210
+
211
+ # 1.2.0 (October 24th, 2013)
212
+
213
+ * Now showing better error message to the end-user when a parameter
214
+ cannot be found. The message displays which key could not be found.
215
+ Moreover, we show the context within the Vagrantfile where we think
216
+ the error occurred:
217
+
218
+ ```
219
+ Nugrant: Parameter 'param' was not found, is it defined in
220
+ your .vagrantuser file? Here where we think the error
221
+ could be in your Vagrantfile:
222
+
223
+ 1: Vagrant.configure("2") do |config|
224
+ 2:>> puts config.user.param
225
+ 3: end
226
+ ```
227
+
228
+ See [GH-8] (https://github.com/maoueh/nugrant/issues/8).
229
+
230
+ * Ensured that keys used within a `Bag` are always symbol. This make
231
+ sure that it is possible to retrieve a value with any access method.
232
+ See [GH-9](https://github.com/maoueh/nugrant/issues/9).
233
+
234
+ * Now using [multi_json](https://rubygems.org/gems/multi_json)
235
+ for JSON handling.
236
+
237
+ # 1.1.0 (May 17th, 2013)
238
+
239
+ * Rewrite completely classes `Parameters` and `Bag`.
240
+ * Reduced chances to have a parameter name collapsing with an
241
+ implementation method.
242
+
243
+ * Removed dependency on `deep_merge`. We do now perform
244
+ our own merge.
245
+
246
+ * Added possibility to iterate through keys by using
247
+ `.each`:
248
+
249
+ ```
250
+ config.user.local.each do |name, value|
251
+ puts "Key #{name}: #{value}"
252
+ end
253
+ ```
254
+
255
+ ### Backward Incompatibilities
256
+
257
+ * `Parameters` is not extending the `Bag` class anymore.
258
+
259
+ * `Parameters` and `Bag` attributes and methods are now almost
260
+ all prefixed with __ to reduce clashes to a minimum when
261
+ accessing parameters with method-like syntax
262
+ (i.e. `parameters.git.master` instead of `parameters['git']['master']`)
263
+
264
+ # 1.0.1 (April 9th, 2013)
265
+
266
+ * Fixed a crash when `user` config value is `nil` preventing `vagrant user parameters`
267
+ from working as expected. See [GH-4](https://github.com/maoueh/nugrant/issues/4).
268
+
269
+ * Fixed a bug preventing the version from being printed when doing `vagrant user -v`.
270
+
271
+ # 1.0.0 (March 21th, 2013)
272
+
273
+ * For now on, this gem will follow semantic versioning.
274
+ * Refactored how Vagrant plugin is architectured.
275
+ * Now supporting Vagrant 1.1.x (Plugin version "2").
276
+
277
+ # 0.0.14
278
+
279
+ * Renamed `ParameterBag` to `Bag`
280
+
281
+ * Cleanup `Bag` api
282
+ * Renamed method `has_param?` to `has_key?` in `Bag`
283
+ * Removed method `get_params` from `Bag`
284
+
285
+ # 0.0.13
286
+
287
+ * Cleanup `Parameters` and `ParameterBag` interface
288
+ * The method `defaults` has been removed from the bag
289
+ * Setting defaults on `Parameters` now recompute the final bag
290
+
291
+ * Improved `vagrant user parameters` command
292
+ * Now using the exact config as seen by Vagrant, this includes defaults parameters
293
+ * An option has been added to only see defaults parameters
294
+
295
+ # 0.0.12
296
+
297
+ * Added travis configuration file
298
+
299
+ * Added travis build status icon to readme
300
+
301
+ * Fixed a bug when `.vagrantuser` file is empty or not a hash type
302
+
303
+ * Improved parameters command
304
+ * The parameters command is now a proper subcommand
305
+ * An option has been added to see system parameters
306
+ * An option has been added to see user parameters
307
+ * An option has been added to see project parameters
308
+
309
+ # 0.0.11
310
+
311
+ * Updated README file for installation via rubygems.org
312
+
313
+ # 0.0.10
314
+
315
+ * Added a subcommand `parameters` for vagrant command `user`
316
+
317
+ * Added a vagrant command `vagrant user subcommand [options]`
318
+
319
+ # 0.0.9
320
+
321
+ * Fixed a bug with the new default values implementation
322
+
323
+ # 0.0.8
324
+
325
+ * Introduced possibility to set default values
326
+
327
+ * Introduced restricted keys (For now, restricted keys are [`defaults`]).
328
+
329
+ * Fixed a bug with system-wide parameters
330
+
331
+ # 0.0.7
332
+
333
+ * YAML is back as the default file format for parameters
334
+
335
+ # 0.0.6
336
+
337
+ * Fixed a bug on ruby 1.8.7 which doesn't have yaml included in its load path by default
338
+
339
+ # 0.0.5
340
+
341
+ * Introduced system-wide parameters file
342
+
343
+ # 0.0.4
344
+
345
+ * JSON is now the default file format for parameters (due to problem with YAML)
346
+
347
+ * It is now possible to store parameters in the JSON format