puppet 5.0.1-universal-darwin → 5.1.0-universal-darwin
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.
- checksums.yaml +4 -4
- data/lib/puppet/agent.rb +1 -0
- data/lib/puppet/defaults.rb +1 -1
- data/lib/puppet/functions.rb +6 -7
- data/lib/puppet/functions/all.rb +100 -0
- data/lib/puppet/functions/any.rb +105 -0
- data/lib/puppet/functions/defined.rb +3 -3
- data/lib/puppet/functions/new.rb +2 -1
- data/lib/puppet/functions/reduce.rb +31 -0
- data/lib/puppet/functions/tree_each.rb +200 -0
- data/lib/puppet/module.rb +30 -0
- data/lib/puppet/parser/functions/new.rb +67 -0
- data/lib/puppet/parser/functions/reduce.rb +31 -0
- data/lib/puppet/parser/relationship.rb +2 -2
- data/lib/puppet/parser/resource.rb +39 -10
- data/lib/puppet/parser/scope.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +11 -4
- data/lib/puppet/pops/evaluator/collector_transformer.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +4 -4
- data/lib/puppet/pops/evaluator/relationship_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +3 -3
- data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -1
- data/lib/puppet/pops/loader/module_loaders.rb +1 -1
- data/lib/puppet/pops/loader/static_loader.rb +1 -2
- data/lib/puppet/pops/loaders.rb +1 -2
- data/lib/puppet/pops/lookup/context.rb +1 -1
- data/lib/puppet/pops/lookup/lookup_adapter.rb +2 -1
- data/lib/puppet/pops/model/ast.rb +440 -436
- data/lib/puppet/pops/model/factory.rb +140 -140
- data/lib/puppet/pops/pcore.rb +1 -2
- data/lib/puppet/pops/resource/param.rb +1 -1
- data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/lib/puppet/pops/serialization/from_data_converter.rb +0 -12
- data/lib/puppet/pops/time/timestamp.rb +29 -17
- data/lib/puppet/pops/types/annotatable.rb +2 -2
- data/lib/puppet/pops/types/annotation.rb +8 -8
- data/lib/puppet/pops/types/class_loader.rb +3 -3
- data/lib/puppet/pops/types/implementation_registry.rb +1 -1
- data/lib/puppet/pops/types/iterable.rb +2 -2
- data/lib/puppet/pops/types/p_binary_type.rb +2 -2
- data/lib/puppet/pops/types/p_init_type.rb +238 -0
- data/lib/puppet/pops/types/p_meta_type.rb +14 -11
- data/lib/puppet/pops/types/p_object_type.rb +15 -15
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +2 -2
- data/lib/puppet/pops/types/p_sem_ver_type.rb +2 -2
- data/lib/puppet/pops/types/p_sensitive_type.rb +2 -2
- data/lib/puppet/pops/types/p_timespan_type.rb +6 -6
- data/lib/puppet/pops/types/p_timestamp_type.rb +6 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +10 -9
- data/lib/puppet/pops/types/ruby_generator.rb +6 -5
- data/lib/puppet/pops/types/ruby_method.rb +2 -2
- data/lib/puppet/pops/types/string_converter.rb +1 -1
- data/lib/puppet/pops/types/tree_iterators.rb +250 -0
- data/lib/puppet/pops/types/type_calculator.rb +13 -13
- data/lib/puppet/pops/types/type_factory.rb +26 -7
- data/lib/puppet/pops/types/type_formatter.rb +9 -4
- data/lib/puppet/pops/types/type_parser.rb +8 -3
- data/lib/puppet/pops/types/type_set_reference.rb +2 -2
- data/lib/puppet/pops/types/types.rb +168 -109
- data/lib/puppet/provider/package/gem.rb +10 -9
- data/lib/puppet/provider/package/pip.rb +12 -3
- data/lib/puppet/provider/package/yum.rb +9 -1
- data/lib/puppet/resource/capability_finder.rb +30 -11
- data/lib/puppet/type/file.rb +21 -13
- data/lib/puppet/util/execution.rb +67 -14
- data/lib/puppet/util/suidmanager.rb +1 -0
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +130 -66
- data/man/man5/puppet.conf.5 +1 -1
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt +1 -0
- data/spec/integration/parser/collection_spec.rb +40 -1
- data/spec/shared_contexts/types_setup.rb +41 -2
- data/spec/unit/agent_spec.rb +11 -0
- data/spec/unit/file_bucket/dipper_spec.rb +13 -4
- data/spec/unit/functions/all_spec.rb +97 -0
- data/spec/unit/functions/any_spec.rb +109 -0
- data/spec/unit/functions/hiera_spec.rb +5 -0
- data/spec/unit/functions/new_spec.rb +66 -0
- data/spec/unit/functions/tree_each_spec.rb +444 -0
- data/spec/unit/module_spec.rb +29 -0
- data/spec/unit/pops/serialization/serialization_spec.rb +2 -2
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +2 -2
- data/spec/unit/pops/types/iterable_spec.rb +9 -9
- data/spec/unit/pops/types/p_init_type_spec.rb +285 -0
- data/spec/unit/pops/types/p_object_type_spec.rb +8 -8
- data/spec/unit/pops/types/p_sensitive_type_spec.rb +4 -0
- data/spec/unit/pops/types/p_timespan_type_spec.rb +14 -0
- data/spec/unit/pops/types/p_timestamp_type_spec.rb +19 -1
- data/spec/unit/pops/types/p_type_set_type_spec.rb +2 -2
- data/spec/unit/pops/types/ruby_generator_spec.rb +9 -22
- data/spec/unit/pops/types/string_converter_spec.rb +2 -2
- data/spec/unit/pops/types/type_acceptor_spec.rb +2 -2
- data/spec/unit/pops/types/type_calculator_spec.rb +43 -38
- data/spec/unit/pops/types/type_factory_spec.rb +6 -6
- data/spec/unit/pops/types/type_formatter_spec.rb +6 -6
- data/spec/unit/pops/types/types_spec.rb +16 -4
- data/spec/unit/provider/package/gem_spec.rb +6 -6
- data/spec/unit/provider/package/pip_spec.rb +44 -23
- data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +8 -0
- data/spec/unit/resource/capability_finder_spec.rb +4 -5
- data/spec/unit/type/file_spec.rb +19 -14
- data/spec/unit/util/execution_spec.rb +216 -82
- data/tasks/generate_ast_model.rake +10 -2
- 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 (
|
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\(
|
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
|
4
|
+
version: 5.1.0
|
5
5
|
platform: universal-darwin
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -408,7 +408,9 @@ files:
|
|
408
408
|
- lib/puppet/forge/repository.rb
|
409
409
|
- lib/puppet/functions.rb
|
410
410
|
- lib/puppet/functions/alert.rb
|
411
|
+
- lib/puppet/functions/all.rb
|
411
412
|
- lib/puppet/functions/annotate.rb
|
413
|
+
- lib/puppet/functions/any.rb
|
412
414
|
- lib/puppet/functions/assert_type.rb
|
413
415
|
- lib/puppet/functions/binary_file.rb
|
414
416
|
- lib/puppet/functions/break.rb
|
@@ -453,6 +455,7 @@ files:
|
|
453
455
|
- lib/puppet/functions/step.rb
|
454
456
|
- lib/puppet/functions/strftime.rb
|
455
457
|
- lib/puppet/functions/then.rb
|
458
|
+
- lib/puppet/functions/tree_each.rb
|
456
459
|
- lib/puppet/functions/type.rb
|
457
460
|
- lib/puppet/functions/unique.rb
|
458
461
|
- lib/puppet/functions/unwrap.rb
|
@@ -866,6 +869,7 @@ files:
|
|
866
869
|
- lib/puppet/pops/types/implementation_registry.rb
|
867
870
|
- lib/puppet/pops/types/iterable.rb
|
868
871
|
- lib/puppet/pops/types/p_binary_type.rb
|
872
|
+
- lib/puppet/pops/types/p_init_type.rb
|
869
873
|
- lib/puppet/pops/types/p_meta_type.rb
|
870
874
|
- lib/puppet/pops/types/p_object_type.rb
|
871
875
|
- lib/puppet/pops/types/p_runtime_type.rb
|
@@ -880,6 +884,7 @@ files:
|
|
880
884
|
- lib/puppet/pops/types/ruby_generator.rb
|
881
885
|
- lib/puppet/pops/types/ruby_method.rb
|
882
886
|
- lib/puppet/pops/types/string_converter.rb
|
887
|
+
- lib/puppet/pops/types/tree_iterators.rb
|
883
888
|
- lib/puppet/pops/types/type_acceptor.rb
|
884
889
|
- lib/puppet/pops/types/type_asserter.rb
|
885
890
|
- lib/puppet/pops/types/type_assertion_error.rb
|
@@ -1972,7 +1977,9 @@ files:
|
|
1972
1977
|
- spec/unit/forge/module_release_spec.rb
|
1973
1978
|
- spec/unit/forge/repository_spec.rb
|
1974
1979
|
- spec/unit/forge_spec.rb
|
1980
|
+
- spec/unit/functions/all_spec.rb
|
1975
1981
|
- spec/unit/functions/annotate_spec.rb
|
1982
|
+
- spec/unit/functions/any_spec.rb
|
1976
1983
|
- spec/unit/functions/assert_type_spec.rb
|
1977
1984
|
- spec/unit/functions/binary_file_spec.rb
|
1978
1985
|
- spec/unit/functions/break_spec.rb
|
@@ -2007,6 +2014,7 @@ files:
|
|
2007
2014
|
- spec/unit/functions/step_spec.rb
|
2008
2015
|
- spec/unit/functions/strftime_spec.rb
|
2009
2016
|
- spec/unit/functions/then_spec.rb
|
2017
|
+
- spec/unit/functions/tree_each_spec.rb
|
2010
2018
|
- spec/unit/functions/type_spec.rb
|
2011
2019
|
- spec/unit/functions/unique_spec.rb
|
2012
2020
|
- spec/unit/functions/unwrap_spec.rb
|
@@ -2266,6 +2274,7 @@ files:
|
|
2266
2274
|
- spec/unit/pops/types/enumeration_spec.rb
|
2267
2275
|
- spec/unit/pops/types/iterable_spec.rb
|
2268
2276
|
- spec/unit/pops/types/p_binary_type_spec.rb
|
2277
|
+
- spec/unit/pops/types/p_init_type_spec.rb
|
2269
2278
|
- spec/unit/pops/types/p_object_type_spec.rb
|
2270
2279
|
- spec/unit/pops/types/p_sem_ver_type_spec.rb
|
2271
2280
|
- spec/unit/pops/types/p_sensitive_type_spec.rb
|
@@ -3242,7 +3251,9 @@ test_files:
|
|
3242
3251
|
- spec/unit/forge/module_release_spec.rb
|
3243
3252
|
- spec/unit/forge/repository_spec.rb
|
3244
3253
|
- spec/unit/forge_spec.rb
|
3254
|
+
- spec/unit/functions/all_spec.rb
|
3245
3255
|
- spec/unit/functions/annotate_spec.rb
|
3256
|
+
- spec/unit/functions/any_spec.rb
|
3246
3257
|
- spec/unit/functions/assert_type_spec.rb
|
3247
3258
|
- spec/unit/functions/binary_file_spec.rb
|
3248
3259
|
- spec/unit/functions/break_spec.rb
|
@@ -3277,6 +3288,7 @@ test_files:
|
|
3277
3288
|
- spec/unit/functions/step_spec.rb
|
3278
3289
|
- spec/unit/functions/strftime_spec.rb
|
3279
3290
|
- spec/unit/functions/then_spec.rb
|
3291
|
+
- spec/unit/functions/tree_each_spec.rb
|
3280
3292
|
- spec/unit/functions/type_spec.rb
|
3281
3293
|
- spec/unit/functions/unique_spec.rb
|
3282
3294
|
- spec/unit/functions/unwrap_spec.rb
|
@@ -3536,6 +3548,7 @@ test_files:
|
|
3536
3548
|
- spec/unit/pops/types/enumeration_spec.rb
|
3537
3549
|
- spec/unit/pops/types/iterable_spec.rb
|
3538
3550
|
- spec/unit/pops/types/p_binary_type_spec.rb
|
3551
|
+
- spec/unit/pops/types/p_init_type_spec.rb
|
3539
3552
|
- spec/unit/pops/types/p_object_type_spec.rb
|
3540
3553
|
- spec/unit/pops/types/p_sem_ver_type_spec.rb
|
3541
3554
|
- spec/unit/pops/types/p_sensitive_type_spec.rb
|