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