- Remove usage of
File.exists?
that has been removed and replace withFile.exist?
.
- Ensures Unix line ending are used when generating env scripts
(
autoenv
andbash
).
-
Fixed indifferent access inside arrays. Array elements of type
Hash
are now converted toBag
instances (recursively). This fix the indifferent access ofBag
elements inside arrays.Fixes issue #27.
-
Permit numeric keys in bag. They are converted to symbol like others.
Fixes issue #26.
-
Removed old code that was switching YAML engine to
syck
when it was available.Fixes issue #14 again.
-
Fixed auto export variables on
vagrant provision
feature. The initial release is not working correctly. -
Changed how module shortcut is defined. The shortcut is now defined inside the class using it to avoid already defined warnings.
Fixes issue #24.
-
Added possibility to specify the script path where to generate the environment commands (export/unset) when using the
vagrant user env
command. -
Added possibility to automatically export variables on vagrant provision. This can be used by specifying
config.user.auto_export = <format>
in your Vagrantfile where can be one of:false
=> No auto export (default value).:autoenv
=> Export to autoenv script format.:script
=> Export to a bash script file.[:autoenv, :script]
=> export both format.
The default generated script path is "./nugrant2env.sh". You can change the default script name by specifying the configuration key
config.user.auto_export_script_path
in your Vagrantfile:config.user.auto_export_script_path = "./script/example.sh"
Contributed by @ruifil.
-
Fixed a bug when using some vagrant commands. The code to retrieve the Vagrantfile name was not accurate in respect to where it was copied. When the env variable
VAGRANT_VAGRANTFILE
is set, it then must be wrapped inside an array.Fixes issue #21.
-
Fixed a bug when using the plugin. A require clause was missing, it was working when doing commands but not when using Vagrant directly.
Fixes issue #20.
-
Fixed retrieval of current directory for
.vagrantuser
. The directory is now that same as the one of theVagrantfile
. Rules have been copied for Vagrant's one, hence, the behavior should be the same. -
Fixed bad implementation of config class
::Vagrant.plugin("2", :config)
wheremerge
was not implemented and was causing errors. Now, all objects (i.e.Config
,Bag
andParameters
implementsmerge
andmerge!
correctly). -
Added possibility to change array merge strategy. This can be used in Vagrant by doing
config.user.array_merge_strategy = <strategy>
where valid strategies are:- :replace => Replace current values by new ones
- :extend => Merge current values with new ones
- :concat => Append new values to current ones
-
Better handling in Vagrant of cases where the vagrant user file cannot be parsed correctly. This is now reported as an error in Vagrant an nicely displayed with the path of the offending file and the parser error message.
-
Better handling of how global Nugrant options are passed and handled. Everything is now located in the
Nugrant::Config
object and used by everything that need some configuration parameters. -
It is now possible to customize key error handling by passing an options hash with key
:key_error
and aProc
value. -
Improved command
vagrant user parameters
. The command now checks if restricted keys are used and prints a warning when it's the case. -
Added a new command
vagrant user restricted-keys
that prints the keys that are restricted, i.e. that cannot be accessed using method access syntax. -
Added possibility to specify merge strategy to use when merging two arrays together.
-
Removed deprecated
--script
argument fromvagrant user env
command. -
Support for Ruby <= 1.9.2 has been dropped. This is not a problem when using Nugrant as a Vagrant plugin. Use branch
1.x
if you can't upgrade to Ruby >= 1.9.3. -
Support for Vagrant 0.x has been dropped. This means that Nugrant 2.x will not load if installed in a Vagrant 0.x environment. Use branch
1.x
if you can't upgrade to Vagrant 1.x. -
Bag
andParameters
and Vagrant configuration objectconfig.user
are now Enumerable.This change has implications on the resolving process of the variables that are stored in the
Bag
when using the dot syntax(config.user.email)
in your code andVagrantfiles
. By using this syntax with version 2.0, some keys will collapse with the internal object's methods. In fact, it was already the case before but to a much smaller scope because object were not enumerable.The number of conflicts should be rather low because the restricted keys are not commonly used as parameter name. The list of the restricted keys is the following:
!, !=, !~, <=>, ==, ===, =~, [], __all, __current, __defaults, __id__, __send__, __system, __user, _detected_errors, _finalize!, all?, any?, chunk, class, clear!, clone, collect, collect_concat, compute_all!, compute_bags!, count, cycle, defaults, defaults=, define_singleton_method, detect, display, drop, drop_while, dup, each, each_cons, each_entry, each_slice, each_with_index, each_with_object, empty?, entries, enum_for, eql?, equal?, extend, finalize!, find, find_all, find_index, first, flat_map, freeze, frozen?, gem, grep, group_by, has?, hash, include?, inject, inspect, instance_eval, instance_exec, instance_of?, instance_variable_defined?, instance_variable_get, instance_variable_set, instance_variables, instance_variables_hash, is_a?, kind_of?, lazy, map, max, max_by, member?, merge, merge!, method, method_missing, methods, min, min_by, minmax, minmax_by, nil?, none?, object_id, one?, partition, private_methods, protected_methods, psych_to_yaml, public_method, public_methods, public_send, reduce, reject, remove_instance_variable, respond_to?, reverse_each, select, send, set_options, singleton_class, singleton_methods, slice_before, sort, sort_by, suppress_warnings, taint, tainted?, take, take_while, tap, to_a, to_enum, to_hash, to_json, to_s, to_set, to_yaml, to_yaml_properties, trust, untaint, untrust, untrusted?, validate, zip
-
The
Parameter
class has a new API. -
The
Bag
class has a new API.
- Fixed Vagrant
user
config class to make thehas?
method available to people using Vagrant. This considered has a bug fix because usinghas?
was not working anyway before.
- Fixed a superfluous warning message when using ruby >= 2.0.0 which is now the default when installing Vagrant >= 1.4.0 (at least on Windows).
-
Deprecated usage of
-s, --script
option for commandvagrant user env
. This was replaced by the more generic and extensible-f, --format FORMAT
option. The-s, --script
option will be removed in 2.0.
-
Now using minitest as our testing library.
-
Added a new command that can be used either standalone or via a small bash script to easily export environment variables from your currently set parameters. See GH-13.
-
Keys associated to a null value are considered as being missing by the merge process. It is still possible to define a null parameter, but it will be overridden by any parameter and will not override any. See GH-12.
-
Fixed output of command
vagrant user parameters
, the keys were serialized as symbol instead of string.
-
Now showing better error message to the end-user when a parameter cannot be found. The message displays which key could not be found. Moreover, we show the context within the Vagrantfile where we think the error occurred:
Nugrant: Parameter 'param' was not found, is it defined in your .vagrantuser file? Here where we think the error could be in your Vagrantfile: 1: Vagrant.configure("2") do |config| 2:>> puts config.user.param 3: end
See [GH-8] (#8).
-
Ensured that keys used within a
Bag
are always symbol. This make sure that it is possible to retrieve a value with any access method. See GH-9. -
Now using multi_json for JSON handling.
-
Rewrite completely classes
Parameters
andBag
. -
Reduced chances to have a parameter name collapsing with an implementation method.
-
Removed dependency on
deep_merge
. We do now perform our own merge. -
Added possibility to iterate through keys by using
.each
:config.user.local.each do |name, value| puts "Key #{name}: #{value}" end
-
Parameters
is not extending theBag
class anymore. -
Parameters
andBag
attributes and methods are now almost all prefixed with __ to reduce clashes to a minimum when accessing parameters with method-like syntax (i.e.parameters.git.master
instead ofparameters['git']['master']
)
-
Fixed a crash when
user
config value isnil
preventingvagrant user parameters
from working as expected. See GH-4. -
Fixed a bug preventing the version from being printed when doing
vagrant user -v
.
- For now on, this gem will follow semantic versioning.
- Refactored how Vagrant plugin is architectured.
- Now supporting Vagrant 1.1.x (Plugin version "2").
-
Renamed
ParameterBag
toBag
-
Cleanup
Bag
api -
Renamed method
has_param?
tohas_key?
inBag
-
Removed method
get_params
fromBag
-
Cleanup
Parameters
andParameterBag
interface -
The method
defaults
has been removed from the bag -
Setting defaults on
Parameters
now recompute the final bag -
Improved
vagrant user parameters
command -
Now using the exact config as seen by Vagrant, this includes defaults parameters
-
An option has been added to only see defaults parameters
-
Added travis configuration file
-
Added travis build status icon to readme
-
Fixed a bug when
.vagrantuser
file is empty or not a hash type -
Improved parameters command
-
The parameters command is now a proper subcommand
-
An option has been added to see system parameters
-
An option has been added to see user parameters
-
An option has been added to see project parameters
- Updated README file for installation via rubygems.org
-
Added a subcommand
parameters
for vagrant commanduser
-
Added a vagrant command
vagrant user subcommand [options]
- Fixed a bug with the new default values implementation
-
Introduced possibility to set default values
-
Introduced restricted keys (For now, restricted keys are [
defaults
]). -
Fixed a bug with system-wide parameters
- YAML is back as the default file format for parameters
- Fixed a bug on ruby 1.8.7 which doesn't have yaml included in its load path by default
- Introduced system-wide parameters file
-
JSON is now the default file format for parameters (due to problem with YAML)
-
It is now possible to store parameters in the JSON format