puppet 5.0.1-x64-mingw32 → 5.1.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/lib/puppet/agent.rb +1 -0
  3. data/lib/puppet/defaults.rb +1 -1
  4. data/lib/puppet/functions.rb +6 -7
  5. data/lib/puppet/functions/all.rb +100 -0
  6. data/lib/puppet/functions/any.rb +105 -0
  7. data/lib/puppet/functions/defined.rb +3 -3
  8. data/lib/puppet/functions/new.rb +2 -1
  9. data/lib/puppet/functions/reduce.rb +31 -0
  10. data/lib/puppet/functions/tree_each.rb +200 -0
  11. data/lib/puppet/module.rb +30 -0
  12. data/lib/puppet/parser/functions/new.rb +67 -0
  13. data/lib/puppet/parser/functions/reduce.rb +31 -0
  14. data/lib/puppet/parser/relationship.rb +2 -2
  15. data/lib/puppet/parser/resource.rb +39 -10
  16. data/lib/puppet/parser/scope.rb +1 -1
  17. data/lib/puppet/pops/evaluator/access_operator.rb +11 -4
  18. data/lib/puppet/pops/evaluator/collector_transformer.rb +1 -1
  19. data/lib/puppet/pops/evaluator/evaluator_impl.rb +4 -4
  20. data/lib/puppet/pops/evaluator/relationship_operator.rb +1 -1
  21. data/lib/puppet/pops/evaluator/runtime3_converter.rb +3 -3
  22. data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -1
  23. data/lib/puppet/pops/loader/module_loaders.rb +1 -1
  24. data/lib/puppet/pops/loader/static_loader.rb +1 -2
  25. data/lib/puppet/pops/loaders.rb +1 -2
  26. data/lib/puppet/pops/lookup/context.rb +1 -1
  27. data/lib/puppet/pops/lookup/lookup_adapter.rb +2 -1
  28. data/lib/puppet/pops/model/ast.rb +440 -436
  29. data/lib/puppet/pops/model/factory.rb +140 -140
  30. data/lib/puppet/pops/pcore.rb +1 -2
  31. data/lib/puppet/pops/resource/param.rb +1 -1
  32. data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  33. data/lib/puppet/pops/serialization/from_data_converter.rb +0 -12
  34. data/lib/puppet/pops/time/timestamp.rb +29 -17
  35. data/lib/puppet/pops/types/annotatable.rb +2 -2
  36. data/lib/puppet/pops/types/annotation.rb +8 -8
  37. data/lib/puppet/pops/types/class_loader.rb +3 -3
  38. data/lib/puppet/pops/types/implementation_registry.rb +1 -1
  39. data/lib/puppet/pops/types/iterable.rb +2 -2
  40. data/lib/puppet/pops/types/p_binary_type.rb +2 -2
  41. data/lib/puppet/pops/types/p_init_type.rb +238 -0
  42. data/lib/puppet/pops/types/p_meta_type.rb +14 -11
  43. data/lib/puppet/pops/types/p_object_type.rb +15 -15
  44. data/lib/puppet/pops/types/p_sem_ver_range_type.rb +2 -2
  45. data/lib/puppet/pops/types/p_sem_ver_type.rb +2 -2
  46. data/lib/puppet/pops/types/p_sensitive_type.rb +2 -2
  47. data/lib/puppet/pops/types/p_timespan_type.rb +6 -6
  48. data/lib/puppet/pops/types/p_timestamp_type.rb +6 -2
  49. data/lib/puppet/pops/types/p_type_set_type.rb +10 -9
  50. data/lib/puppet/pops/types/ruby_generator.rb +6 -5
  51. data/lib/puppet/pops/types/ruby_method.rb +2 -2
  52. data/lib/puppet/pops/types/string_converter.rb +1 -1
  53. data/lib/puppet/pops/types/tree_iterators.rb +250 -0
  54. data/lib/puppet/pops/types/type_calculator.rb +13 -13
  55. data/lib/puppet/pops/types/type_factory.rb +26 -7
  56. data/lib/puppet/pops/types/type_formatter.rb +9 -4
  57. data/lib/puppet/pops/types/type_parser.rb +8 -3
  58. data/lib/puppet/pops/types/type_set_reference.rb +2 -2
  59. data/lib/puppet/pops/types/types.rb +168 -109
  60. data/lib/puppet/provider/package/gem.rb +10 -9
  61. data/lib/puppet/provider/package/pip.rb +12 -3
  62. data/lib/puppet/provider/package/yum.rb +9 -1
  63. data/lib/puppet/resource/capability_finder.rb +30 -11
  64. data/lib/puppet/type/file.rb +21 -13
  65. data/lib/puppet/util/execution.rb +67 -14
  66. data/lib/puppet/util/suidmanager.rb +1 -0
  67. data/lib/puppet/version.rb +1 -1
  68. data/locales/puppet.pot +130 -66
  69. data/man/man5/puppet.conf.5 +1 -1
  70. data/spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt +1 -0
  71. data/spec/integration/parser/collection_spec.rb +40 -1
  72. data/spec/shared_contexts/types_setup.rb +41 -2
  73. data/spec/unit/agent_spec.rb +11 -0
  74. data/spec/unit/file_bucket/dipper_spec.rb +13 -4
  75. data/spec/unit/functions/all_spec.rb +97 -0
  76. data/spec/unit/functions/any_spec.rb +109 -0
  77. data/spec/unit/functions/hiera_spec.rb +5 -0
  78. data/spec/unit/functions/new_spec.rb +66 -0
  79. data/spec/unit/functions/tree_each_spec.rb +444 -0
  80. data/spec/unit/module_spec.rb +29 -0
  81. data/spec/unit/pops/serialization/serialization_spec.rb +2 -2
  82. data/spec/unit/pops/serialization/to_from_hr_spec.rb +2 -2
  83. data/spec/unit/pops/types/iterable_spec.rb +9 -9
  84. data/spec/unit/pops/types/p_init_type_spec.rb +285 -0
  85. data/spec/unit/pops/types/p_object_type_spec.rb +8 -8
  86. data/spec/unit/pops/types/p_sensitive_type_spec.rb +4 -0
  87. data/spec/unit/pops/types/p_timespan_type_spec.rb +14 -0
  88. data/spec/unit/pops/types/p_timestamp_type_spec.rb +19 -1
  89. data/spec/unit/pops/types/p_type_set_type_spec.rb +2 -2
  90. data/spec/unit/pops/types/ruby_generator_spec.rb +9 -22
  91. data/spec/unit/pops/types/string_converter_spec.rb +2 -2
  92. data/spec/unit/pops/types/type_acceptor_spec.rb +2 -2
  93. data/spec/unit/pops/types/type_calculator_spec.rb +43 -38
  94. data/spec/unit/pops/types/type_factory_spec.rb +6 -6
  95. data/spec/unit/pops/types/type_formatter_spec.rb +6 -6
  96. data/spec/unit/pops/types/types_spec.rb +16 -4
  97. data/spec/unit/provider/package/gem_spec.rb +6 -6
  98. data/spec/unit/provider/package/pip_spec.rb +44 -23
  99. data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
  100. data/spec/unit/provider/package/yum_spec.rb +8 -0
  101. data/spec/unit/resource/capability_finder_spec.rb +4 -5
  102. data/spec/unit/type/file_spec.rb +19 -14
  103. data/spec/unit/util/execution_spec.rb +216 -82
  104. data/tasks/generate_ast_model.rake +10 -2
  105. metadata +15 -2
@@ -22,7 +22,7 @@ else
22
22
  ruby = Types::RubyGenerator.new.module_definition_from_typeset(ast_model)
23
23
 
24
24
  # Replace ref() constructs to known Pcore types with directly initialized types. ref() cannot be used
25
- # since it requires a parser (hen and egg problem)
25
+ # since it requires a parser (chicken-and-egg problem)
26
26
  ruby.gsub!(/^module Parser\nmodule Locator\n.*\nend\nend\nmodule Model\n/m, "module Model\n")
27
27
 
28
28
  # Remove generated RubyMethod annotations. The ruby methods are there now, no need to also have
@@ -34,7 +34,11 @@ else
34
34
  ruby.gsub!(/ref\('Array\[([0-9A-Za-z_]+)\]'\)/, 'Types::PArrayType.new(Types::P\1Type::DEFAULT)')
35
35
  ruby.gsub!(/ref\('Optional\[Array\[([0-9A-Za-z_]+)\]\]'\)/,
36
36
  'Types::POptionalType.new(Types::PArrayType.new(Types::P\1Type::DEFAULT))')
37
- ruby.gsub!(/ref\("Enum(\[[^\]]+\])"\)/, 'Types::PEnumType.new(\1)')
37
+ ruby.gsub!(/ref\('Enum(\[[^\]]+\])'\)/) do |match|
38
+ params = $1
39
+ params.gsub!(/\\'/, '\'')
40
+ "Types::PEnumType.new(#{params})"
41
+ end
38
42
 
39
43
  # Replace ref() constructs with references to _pcore_type of the types in the module namespace
40
44
  ruby.gsub!(/ref\('Puppet::AST::Locator'\)/, 'Parser::Locator::Locator19._pcore_type')
@@ -47,10 +51,14 @@ else
47
51
  # Remove the generated ref() method. It's not needed by this model
48
52
  ruby.gsub!(/ def self\.ref\(type_string\)\n.*\n end\n\n/, '')
49
53
 
54
+ # Add Program#current method for backward compatibility
55
+ ruby.gsub!(/(attr_reader :body\n attr_reader :definitions\n attr_reader :locator)/, "\\1\n\n def current\n self\n end")
56
+
50
57
  # Replace the generated registration with a registration that uses the static loader. This will
51
58
  # become part of the Puppet bootstrap code and there will be no other loader until we have a
52
59
  # parser.
53
60
  ruby.gsub!(/^Puppet::Pops::Pcore.register_implementations\((\[[^\]]+\])\)/, <<-RUBY)
61
+
54
62
  module Model
55
63
  @@pcore_ast_initialized = false
56
64
  def self.register_pcore_types
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.1.0
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-18 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -478,7 +478,9 @@ files:
478
478
  - lib/puppet/forge/repository.rb
479
479
  - lib/puppet/functions.rb
480
480
  - lib/puppet/functions/alert.rb
481
+ - lib/puppet/functions/all.rb
481
482
  - lib/puppet/functions/annotate.rb
483
+ - lib/puppet/functions/any.rb
482
484
  - lib/puppet/functions/assert_type.rb
483
485
  - lib/puppet/functions/binary_file.rb
484
486
  - lib/puppet/functions/break.rb
@@ -523,6 +525,7 @@ files:
523
525
  - lib/puppet/functions/step.rb
524
526
  - lib/puppet/functions/strftime.rb
525
527
  - lib/puppet/functions/then.rb
528
+ - lib/puppet/functions/tree_each.rb
526
529
  - lib/puppet/functions/type.rb
527
530
  - lib/puppet/functions/unique.rb
528
531
  - lib/puppet/functions/unwrap.rb
@@ -936,6 +939,7 @@ files:
936
939
  - lib/puppet/pops/types/implementation_registry.rb
937
940
  - lib/puppet/pops/types/iterable.rb
938
941
  - lib/puppet/pops/types/p_binary_type.rb
942
+ - lib/puppet/pops/types/p_init_type.rb
939
943
  - lib/puppet/pops/types/p_meta_type.rb
940
944
  - lib/puppet/pops/types/p_object_type.rb
941
945
  - lib/puppet/pops/types/p_runtime_type.rb
@@ -950,6 +954,7 @@ files:
950
954
  - lib/puppet/pops/types/ruby_generator.rb
951
955
  - lib/puppet/pops/types/ruby_method.rb
952
956
  - lib/puppet/pops/types/string_converter.rb
957
+ - lib/puppet/pops/types/tree_iterators.rb
953
958
  - lib/puppet/pops/types/type_acceptor.rb
954
959
  - lib/puppet/pops/types/type_asserter.rb
955
960
  - lib/puppet/pops/types/type_assertion_error.rb
@@ -2042,7 +2047,9 @@ files:
2042
2047
  - spec/unit/forge/module_release_spec.rb
2043
2048
  - spec/unit/forge/repository_spec.rb
2044
2049
  - spec/unit/forge_spec.rb
2050
+ - spec/unit/functions/all_spec.rb
2045
2051
  - spec/unit/functions/annotate_spec.rb
2052
+ - spec/unit/functions/any_spec.rb
2046
2053
  - spec/unit/functions/assert_type_spec.rb
2047
2054
  - spec/unit/functions/binary_file_spec.rb
2048
2055
  - spec/unit/functions/break_spec.rb
@@ -2077,6 +2084,7 @@ files:
2077
2084
  - spec/unit/functions/step_spec.rb
2078
2085
  - spec/unit/functions/strftime_spec.rb
2079
2086
  - spec/unit/functions/then_spec.rb
2087
+ - spec/unit/functions/tree_each_spec.rb
2080
2088
  - spec/unit/functions/type_spec.rb
2081
2089
  - spec/unit/functions/unique_spec.rb
2082
2090
  - spec/unit/functions/unwrap_spec.rb
@@ -2336,6 +2344,7 @@ files:
2336
2344
  - spec/unit/pops/types/enumeration_spec.rb
2337
2345
  - spec/unit/pops/types/iterable_spec.rb
2338
2346
  - spec/unit/pops/types/p_binary_type_spec.rb
2347
+ - spec/unit/pops/types/p_init_type_spec.rb
2339
2348
  - spec/unit/pops/types/p_object_type_spec.rb
2340
2349
  - spec/unit/pops/types/p_sem_ver_type_spec.rb
2341
2350
  - spec/unit/pops/types/p_sensitive_type_spec.rb
@@ -3312,7 +3321,9 @@ test_files:
3312
3321
  - spec/unit/forge/module_release_spec.rb
3313
3322
  - spec/unit/forge/repository_spec.rb
3314
3323
  - spec/unit/forge_spec.rb
3324
+ - spec/unit/functions/all_spec.rb
3315
3325
  - spec/unit/functions/annotate_spec.rb
3326
+ - spec/unit/functions/any_spec.rb
3316
3327
  - spec/unit/functions/assert_type_spec.rb
3317
3328
  - spec/unit/functions/binary_file_spec.rb
3318
3329
  - spec/unit/functions/break_spec.rb
@@ -3347,6 +3358,7 @@ test_files:
3347
3358
  - spec/unit/functions/step_spec.rb
3348
3359
  - spec/unit/functions/strftime_spec.rb
3349
3360
  - spec/unit/functions/then_spec.rb
3361
+ - spec/unit/functions/tree_each_spec.rb
3350
3362
  - spec/unit/functions/type_spec.rb
3351
3363
  - spec/unit/functions/unique_spec.rb
3352
3364
  - spec/unit/functions/unwrap_spec.rb
@@ -3606,6 +3618,7 @@ test_files:
3606
3618
  - spec/unit/pops/types/enumeration_spec.rb
3607
3619
  - spec/unit/pops/types/iterable_spec.rb
3608
3620
  - spec/unit/pops/types/p_binary_type_spec.rb
3621
+ - spec/unit/pops/types/p_init_type_spec.rb
3609
3622
  - spec/unit/pops/types/p_object_type_spec.rb
3610
3623
  - spec/unit/pops/types/p_sem_ver_type_spec.rb
3611
3624
  - spec/unit/pops/types/p_sensitive_type_spec.rb