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/lib/nugrant.rb CHANGED
@@ -1,31 +1,31 @@
1
- require 'pathname'
2
- require 'nugrant/config'
3
- require 'nugrant/parameters'
4
-
5
- # 1.8 Compatibility check
6
- unless defined?(KeyError)
7
- class KeyError < IndexError
8
- end
9
- end
10
-
11
- module Nugrant
12
- def self.setup_i18n()
13
- I18n.load_path << File.expand_path("locales/en.yml", Nugrant.source_root)
14
- I18n.reload!
15
- end
16
-
17
- def self.source_root
18
- @source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
19
- end
20
- end
21
-
22
- if defined?(Vagrant)
23
- Nugrant.setup_i18n()
24
-
25
- case
26
- when defined?(Vagrant::Plugin::V2)
27
- require 'nugrant/vagrant/v2/plugin'
28
- else
29
- raise RuntimeError, "Vagrant [#{Vagrant::VERSION}] is not supported by Nugrant."
30
- end
31
- end
1
+ require 'pathname'
2
+ require 'nugrant/config'
3
+ require 'nugrant/parameters'
4
+
5
+ # 1.8 Compatibility check
6
+ unless defined?(KeyError)
7
+ class KeyError < IndexError
8
+ end
9
+ end
10
+
11
+ module Nugrant
12
+ def self.setup_i18n()
13
+ I18n.load_path << File.expand_path("locales/en.yml", Nugrant.source_root)
14
+ I18n.reload!
15
+ end
16
+
17
+ def self.source_root
18
+ @source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
19
+ end
20
+ end
21
+
22
+ if defined?(Vagrant)
23
+ Nugrant.setup_i18n()
24
+
25
+ case
26
+ when defined?(Vagrant::Plugin::V2)
27
+ require 'nugrant/vagrant/v2/plugin'
28
+ else
29
+ raise RuntimeError, "Vagrant [#{Vagrant::VERSION}] is not supported by Nugrant."
30
+ end
31
+ end
data/locales/en.yml CHANGED
@@ -1,24 +1,24 @@
1
- en:
2
- nugrant:
3
- vagrant:
4
- errors:
5
- parameter_not_found: |-
6
- Nugrant: Parameter '%{key}' was not found, is it defined in
7
- your .vagrantuser file? Here where we think the error
8
- could be in your Vagrantfile:
9
-
10
- %{context}
11
-
12
- If you think the parameter '%{key}' should have been found, don't
13
- hesitate to fill an issue @ https://github.com/maoueh/nugrant/issues.
14
-
15
- parse_error: |-
16
- Nugrant: Vagrant user file could not be parsed correctly,
17
- the file is probably in an invalid state.
18
-
19
- File: %{filename}
20
- Error: %{error}
21
-
22
- If you think this is an error, don't hesitate to fill an
23
- issue @ https://github.com/maoueh/nugrant/issues.
24
-
1
+ en:
2
+ nugrant:
3
+ vagrant:
4
+ errors:
5
+ parameter_not_found: |-
6
+ Nugrant: Parameter '%{key}' was not found, is it defined in
7
+ your .vagrantuser file? Here where we think the error
8
+ could be in your Vagrantfile:
9
+
10
+ %{context}
11
+
12
+ If you think the parameter '%{key}' should have been found, don't
13
+ hesitate to fill an issue @ https://github.com/maoueh/nugrant/issues.
14
+
15
+ parse_error: |-
16
+ Nugrant: Vagrant user file could not be parsed correctly,
17
+ the file is probably in an invalid state.
18
+
19
+ File: %{filename}
20
+ Error: %{error}
21
+
22
+ If you think this is an error, don't hesitate to fill an
23
+ issue @ https://github.com/maoueh/nugrant/issues.
24
+
data/locales/fr.yml CHANGED
@@ -1,24 +1,24 @@
1
- en:
2
- nugrant:
3
- vagrant:
4
- errors:
5
- parameter_not_found: |-
6
- Nugrant: Le paramètre '%{key}' n'a pu être trouvé, est-il définie
7
- dans votre fichier .vagrantuser ? Voici où nous pensons que l'erreur
8
- se trouve dans votre fichier Vagrantfile:
9
-
10
- %{context}
11
-
12
- Si vous croyez que le paramètre '%{key}' devrait être trouvé, n'hésitez
13
- pas à rapporter le problème @ https://github.com/maoueh/nugrant/issues.
14
-
15
- parse_error: |-
16
- Nugrant: Le fichier de paramètres Vagrant n'a pu être lu correctement,
17
- le fichier contient probablement une erreur de syntaxe.
18
-
19
- File: %{filename}
20
- Error: %{error}
21
-
22
- Si vous croyez que ceci est un bug, n'hésitez pas à rapporter le
23
- problème @ https://github.com/maoueh/nugrant/issues.
24
-
1
+ en:
2
+ nugrant:
3
+ vagrant:
4
+ errors:
5
+ parameter_not_found: |-
6
+ Nugrant: Le paramètre '%{key}' n'a pu être trouvé, est-il définie
7
+ dans votre fichier .vagrantuser ? Voici où nous pensons que l'erreur
8
+ se trouve dans votre fichier Vagrantfile:
9
+
10
+ %{context}
11
+
12
+ Si vous croyez que le paramètre '%{key}' devrait être trouvé, n'hésitez
13
+ pas à rapporter le problème @ https://github.com/maoueh/nugrant/issues.
14
+
15
+ parse_error: |-
16
+ Nugrant: Le fichier de paramètres Vagrant n'a pu être lu correctement,
17
+ le fichier contient probablement une erreur de syntaxe.
18
+
19
+ File: %{filename}
20
+ Error: %{error}
21
+
22
+ Si vous croyez que ceci est un bug, n'hésitez pas à rapporter le
23
+ problème @ https://github.com/maoueh/nugrant/issues.
24
+
data/nugrant.gemspec CHANGED
@@ -1,32 +1,32 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
-
5
- require 'nugrant/version'
6
-
7
- Gem::Specification.new do |gem|
8
- gem.name = "nugrant"
9
- gem.version = Nugrant::VERSION
10
- gem.authors = ["Matthieu Vachon"]
11
- gem.email = ["matthieu.o.vachon@gmail.com"]
12
- gem.homepage = "https://github.com/maoueh/nugrant"
13
- gem.summary = "Library to handle user specific parameters from various location."
14
- gem.description = <<-EOF
15
- Nugrant is a library to easily handle parameters that need to be
16
- injected into an application via different sources (system, user,
17
- project, defaults).
18
-
19
- Nugrant can also be directly used as a Vagrant plugin. By activating
20
- this gem with Vagrant, it will be possible to define user specific
21
- parameters that will be injected directly into the Vagrantfile. This
22
- is useful if you need to share a Vagrantfile to multiple developers
23
- but would like to customize some parameters for each user differently.
24
- EOF
25
-
26
- gem.files = `git ls-files`.split($/)
27
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
28
- gem.test_files = gem.files.grep(%r{^(test/lib)/})
29
- gem.require_paths = ["lib"]
30
-
31
- gem.add_dependency "multi_json", "~> 1.8"
32
- end
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'nugrant/version'
6
+
7
+ Gem::Specification.new do |gem|
8
+ gem.name = "nugrant"
9
+ gem.version = Nugrant::VERSION
10
+ gem.authors = ["Matthieu Vachon"]
11
+ gem.email = ["matthieu.o.vachon@gmail.com"]
12
+ gem.homepage = "https://github.com/maoueh/nugrant"
13
+ gem.summary = "Library to handle user specific parameters from various location."
14
+ gem.description = <<-EOF
15
+ Nugrant is a library to easily handle parameters that need to be
16
+ injected into an application via different sources (system, user,
17
+ project, defaults).
18
+
19
+ Nugrant can also be directly used as a Vagrant plugin. By activating
20
+ this gem with Vagrant, it will be possible to define user specific
21
+ parameters that will be injected directly into the Vagrantfile. This
22
+ is useful if you need to share a Vagrantfile to multiple developers
23
+ but would like to customize some parameters for each user differently.
24
+ EOF
25
+
26
+ gem.files = `git ls-files`.split($/)
27
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
28
+ gem.test_files = gem.files.grep(%r{^(test/lib)/})
29
+ gem.require_paths = ["lib"]
30
+
31
+ gem.add_dependency "multi_json", "~> 1.8"
32
+ end