puppet 5.3.7-universal-darwin → 5.4.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/CONTRIBUTING.md +42 -29
- data/README.md +8 -6
- data/ext/cert_inspector +2 -2
- data/ext/envpuppet +1 -1
- data/ext/gentoo/init.d/puppetmaster +4 -4
- data/ext/ips/puppet-agent +11 -11
- data/ext/ips/puppet-master +11 -11
- data/ext/puppet-test +1 -2
- data/ext/redhat/client.init +2 -2
- data/ext/redhat/logrotate +1 -1
- data/ext/solaris/smf/puppet +11 -11
- data/ext/solaris/smf/svc-puppetd +5 -5
- data/ext/solaris/smf/svc-puppetmasterd +5 -5
- data/ext/windows/service/daemon.rb +1 -1
- data/install.rb +2 -3
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application/cert.rb +1 -3
- data/lib/puppet/application/describe.rb +0 -1
- data/lib/puppet/application/device.rb +12 -99
- data/lib/puppet/application/filebucket.rb +32 -11
- data/lib/puppet/application/lookup.rb +1 -11
- data/lib/puppet/application/script.rb +261 -0
- data/lib/puppet/configurer.rb +3 -4
- data/lib/puppet/configurer/plugin_handler.rb +26 -9
- data/lib/puppet/context.rb +1 -1
- data/lib/puppet/datatypes.rb +213 -0
- data/lib/puppet/datatypes/error.rb +21 -0
- data/lib/puppet/datatypes/impl/error.rb +40 -0
- data/lib/puppet/defaults.rb +51 -20
- data/lib/puppet/environments.rb +17 -0
- data/lib/puppet/error.rb +17 -0
- data/lib/puppet/etc.rb +2 -2
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +1 -1
- data/lib/puppet/face/config.rb +45 -0
- data/lib/puppet/face/epp.rb +3 -3
- data/lib/puppet/face/help/action.erb +3 -0
- data/lib/puppet/face/module/build.rb +1 -0
- data/lib/puppet/face/module/generate.rb +5 -0
- data/lib/puppet/face/module/install.rb +1 -0
- data/lib/puppet/face/module/search.rb +6 -2
- data/lib/puppet/face/module/uninstall.rb +1 -0
- data/lib/puppet/face/module/upgrade.rb +1 -0
- data/lib/puppet/face/parser.rb +0 -1
- data/lib/puppet/face/plugin.rb +1 -3
- data/lib/puppet/feature/base.rb +1 -1
- data/lib/puppet/feature/bolt.rb +3 -0
- data/lib/puppet/file_bucket/dipper.rb +1 -2
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system/uniquefile.rb +2 -2
- data/lib/puppet/forge.rb +6 -0
- data/lib/puppet/functions.rb +70 -88
- data/lib/puppet/functions/all.rb +6 -2
- data/lib/puppet/functions/annotate.rb +1 -1
- data/lib/puppet/functions/any.rb +7 -3
- data/lib/puppet/functions/contain.rb +6 -0
- data/lib/puppet/functions/convert_to.rb +32 -0
- data/lib/puppet/functions/defined.rb +0 -3
- data/lib/puppet/functions/each.rb +10 -6
- data/lib/puppet/functions/filter.rb +16 -10
- data/lib/puppet/functions/find_file.rb +0 -1
- data/lib/puppet/functions/include.rb +6 -0
- data/lib/puppet/functions/map.rb +12 -9
- data/lib/puppet/functions/module_directory.rb +41 -0
- data/lib/puppet/functions/new.rb +1 -4
- data/lib/puppet/functions/regsubst.rb +1 -1
- data/lib/puppet/functions/require.rb +6 -0
- data/lib/puppet/generate/type.rb +1 -1
- data/lib/puppet/gettext/config.rb +2 -2
- data/lib/puppet/gettext/stubs.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +0 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +6 -2
- data/lib/puppet/indirector/file_server.rb +1 -1
- data/lib/puppet/indirector/node/ldap.rb +19 -3
- data/lib/puppet/indirector/request.rb +10 -6
- data/lib/puppet/indirector/rest.rb +11 -12
- data/lib/puppet/info_service/class_information_service.rb +1 -1
- data/lib/puppet/interface/action.rb +11 -0
- data/lib/puppet/interface/action_builder.rb +8 -0
- data/lib/puppet/interface/option_manager.rb +1 -1
- data/lib/puppet/loaders.rb +2 -0
- data/lib/puppet/module.rb +6 -2
- data/lib/puppet/module_tool/applications/builder.rb +4 -0
- data/lib/puppet/module_tool/applications/installer.rb +3 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -0
- data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +3 -0
- data/lib/puppet/module_tool/installed_modules.rb +1 -1
- data/lib/puppet/module_tool/metadata.rb +0 -1
- data/lib/puppet/network/authstore.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
- data/lib/puppet/network/http/connection.rb +1 -9
- data/lib/puppet/network/http/factory.rb +0 -3
- data/lib/puppet/network/http/webrick.rb +1 -0
- data/lib/puppet/network/rights.rb +1 -1
- data/lib/puppet/node.rb +53 -0
- data/lib/puppet/node/environment.rb +1 -1
- data/lib/puppet/parameter/boolean.rb +1 -1
- data/lib/puppet/parser.rb +1 -0
- data/lib/puppet/parser/abstract_compiler.rb +36 -0
- data/lib/puppet/parser/ast/branch.rb +1 -1
- data/lib/puppet/parser/ast/pops_bridge.rb +8 -52
- data/lib/puppet/parser/compiler.rb +4 -54
- data/lib/puppet/parser/functions.rb +0 -1
- data/lib/puppet/parser/functions/create_resources.rb +6 -0
- data/lib/puppet/parser/functions/fqdn_rand.rb +6 -2
- data/lib/puppet/parser/functions/inline_template.rb +6 -0
- data/lib/puppet/parser/functions/new.rb +47 -32
- data/lib/puppet/parser/functions/realize.rb +6 -0
- data/lib/puppet/parser/functions/return.rb +1 -22
- data/lib/puppet/parser/functions/reverse_each.rb +1 -1
- data/lib/puppet/parser/functions/scanf.rb +1 -1
- data/lib/puppet/parser/functions/sha256.rb +5 -0
- data/lib/puppet/parser/functions/tag.rb +6 -0
- data/lib/puppet/parser/functions/tagged.rb +6 -0
- data/lib/puppet/parser/functions/template.rb +5 -0
- data/lib/puppet/parser/scope.rb +28 -4
- data/lib/puppet/parser/script_compiler.rb +118 -0
- data/lib/puppet/parser/type_loader.rb +1 -1
- data/lib/puppet/pops.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +38 -4
- data/lib/puppet/pops/evaluator/closure.rb +12 -4
- data/lib/puppet/pops/evaluator/compare_operator.rb +4 -4
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +13 -0
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +38 -10
- data/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +2 -3
- data/lib/puppet/pops/functions/dispatch.rb +6 -5
- data/lib/puppet/pops/functions/function.rb +2 -2
- data/lib/puppet/pops/issues.rb +34 -2
- data/lib/puppet/pops/loader/base_loader.rb +10 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +7 -0
- data/lib/puppet/pops/loader/loader.rb +21 -2
- data/lib/puppet/pops/loader/loader_paths.rb +180 -30
- data/lib/puppet/pops/loader/module_loaders.rb +202 -33
- data/lib/puppet/pops/loader/puppet_plan_instantiator.rb +84 -0
- data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +9 -9
- data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +40 -0
- data/lib/puppet/pops/loader/runtime3_type_loader.rb +6 -1
- data/lib/puppet/pops/loader/static_loader.rb +23 -8
- data/lib/puppet/pops/loader/task_instantiator.rb +69 -0
- data/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -0
- data/lib/puppet/pops/loaders.rb +122 -11
- data/lib/puppet/pops/lookup/data_dig_function_provider.rb +1 -1
- data/lib/puppet/pops/lookup/interpolation.rb +1 -1
- data/lib/puppet/pops/lookup/lookup_adapter.rb +0 -1
- data/lib/puppet/pops/model/ast.pp +3 -0
- data/lib/puppet/pops/model/ast.rb +34 -1
- data/lib/puppet/pops/model/factory.rb +30 -3
- data/lib/puppet/pops/model/model_label_provider.rb +1 -0
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -1
- data/lib/puppet/pops/model/tree_dumper.rb +1 -1
- data/lib/puppet/pops/parser/code_merger.rb +2 -2
- data/lib/puppet/pops/parser/egrammar.ra +44 -15
- data/lib/puppet/pops/parser/eparser.rb +1687 -1571
- data/lib/puppet/pops/parser/epp_support.rb +1 -3
- data/lib/puppet/pops/parser/evaluating_parser.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +2 -2
- data/lib/puppet/pops/parser/lexer2.rb +4 -4
- data/lib/puppet/pops/parser/lexer_support.rb +2 -2
- data/lib/puppet/pops/parser/locatable.rb +1 -1
- data/lib/puppet/pops/parser/locator.rb +7 -13
- data/lib/puppet/pops/parser/parser_support.rb +3 -3
- data/lib/puppet/pops/parser/slurp_support.rb +0 -3
- data/lib/puppet/pops/pcore.rb +45 -0
- 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/abstract_reader.rb +4 -0
- data/lib/puppet/pops/serialization/abstract_writer.rb +6 -0
- data/lib/puppet/pops/serialization/extension.rb +1 -0
- data/lib/puppet/pops/serialization/from_data_converter.rb +64 -10
- data/lib/puppet/pops/serialization/json_path.rb +2 -1
- data/lib/puppet/pops/serialization/object.rb +3 -4
- data/lib/puppet/pops/serialization/serializer.rb +2 -1
- data/lib/puppet/pops/serialization/to_data_converter.rb +7 -3
- data/lib/puppet/pops/time/timespan.rb +1 -1
- data/lib/puppet/pops/types/iterable.rb +38 -9
- data/lib/puppet/pops/types/p_init_type.rb +1 -1
- data/lib/puppet/pops/types/p_meta_type.rb +4 -0
- data/lib/puppet/pops/types/p_object_type.rb +146 -14
- data/lib/puppet/pops/types/p_object_type_extension.rb +218 -0
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +0 -1
- data/lib/puppet/pops/types/p_sem_ver_type.rb +10 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +0 -1
- data/lib/puppet/pops/types/p_uri_type.rb +190 -0
- data/lib/puppet/pops/types/puppet_object.rb +15 -1
- data/lib/puppet/pops/types/ruby_generator.rb +46 -54
- data/lib/puppet/pops/types/string_converter.rb +22 -1
- data/lib/puppet/pops/types/type_acceptor.rb +1 -1
- data/lib/puppet/pops/types/type_calculator.rb +13 -4
- data/lib/puppet/pops/types/type_factory.rb +29 -5
- data/lib/puppet/pops/types/type_formatter.rb +67 -4
- data/lib/puppet/pops/types/type_parser.rb +92 -4
- data/lib/puppet/pops/types/type_with_members.rb +43 -0
- data/lib/puppet/pops/types/types.rb +212 -80
- data/lib/puppet/pops/validation/checker4_0.rb +10 -6
- data/lib/puppet/pops/validation/tasks_checker.rb +60 -0
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +6 -1
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/provider.rb +18 -8
- data/lib/puppet/provider/augeas/augeas.rb +3 -4
- data/lib/puppet/provider/exec.rb +0 -2
- data/lib/puppet/provider/group/groupadd.rb +25 -1
- data/lib/puppet/provider/group/windows_adsi.rb +7 -4
- data/lib/puppet/provider/mount.rb +25 -8
- data/lib/puppet/provider/nameservice.rb +9 -4
- data/lib/puppet/provider/nameservice/directoryservice.rb +3 -3
- data/lib/puppet/provider/nameservice/objectadd.rb +13 -24
- data/lib/puppet/provider/nameservice/pw.rb +14 -14
- data/lib/puppet/provider/package/appdmg.rb +0 -1
- data/lib/puppet/provider/package/apple.rb +0 -1
- data/lib/puppet/provider/package/gem.rb +2 -2
- data/lib/puppet/provider/package/macports.rb +2 -2
- data/lib/puppet/provider/package/pkg.rb +3 -0
- data/lib/puppet/provider/package/pkgdmg.rb +0 -1
- data/lib/puppet/provider/package/portage.rb +0 -1
- data/lib/puppet/provider/package/yum.rb +23 -8
- data/lib/puppet/provider/package/zypper.rb +2 -2
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
- data/lib/puppet/provider/service/init.rb +1 -0
- data/lib/puppet/provider/service/launchd.rb +6 -7
- data/lib/puppet/provider/service/redhat.rb +3 -2
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +3 -2
- data/lib/puppet/provider/user/openbsd.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +7 -1
- data/lib/puppet/provider/user/useradd.rb +36 -6
- data/lib/puppet/provider/user/windows_adsi.rb +1 -1
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -4
- data/lib/puppet/provider/zfs/zfs.rb +23 -3
- data/lib/puppet/provider/zpool/zpool.rb +1 -1
- data/lib/puppet/reference/configuration.rb +0 -2
- data/lib/puppet/reference/type.rb +0 -1
- data/lib/puppet/resource.rb +1 -2
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/resource/status.rb +0 -1
- data/lib/puppet/resource/type.rb +4 -4
- data/lib/puppet/resource/type_collection.rb +1 -1
- data/lib/puppet/settings/base_setting.rb +1 -1
- data/lib/puppet/settings/environment_conf.rb +0 -1
- data/lib/puppet/settings/ini_file.rb +66 -12
- data/lib/puppet/ssl/certificate_authority.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +2 -2
- data/lib/puppet/ssl/certificate_revocation_list.rb +2 -1
- data/lib/puppet/ssl/certificate_signer.rb +11 -0
- data/lib/puppet/ssl/host.rb +2 -2
- data/lib/puppet/syntax_checkers/base64.rb +1 -1
- data/lib/puppet/transaction.rb +37 -14
- data/lib/puppet/transaction/report.rb +3 -1
- data/lib/puppet/type.rb +17 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +5 -4
- data/lib/puppet/type/file.rb +3 -3
- data/lib/puppet/type/file/checksum.rb +7 -1
- data/lib/puppet/type/file/checksum_value.rb +4 -3
- data/lib/puppet/type/group.rb +3 -0
- data/lib/puppet/type/k5login.rb +101 -0
- data/lib/puppet/type/macauthorization.rb +1 -1
- data/lib/puppet/type/mount.rb +6 -2
- data/lib/puppet/type/tidy.rb +6 -4
- data/lib/puppet/type/user.rb +26 -39
- data/lib/puppet/type/yumrepo.rb +9 -0
- data/lib/puppet/type/zfs.rb +4 -0
- data/lib/puppet/util.rb +8 -15
- data/lib/puppet/util/character_encoding.rb +2 -2
- data/lib/puppet/util/checksums.rb +82 -1
- data/lib/puppet/util/errors.rb +0 -2
- data/lib/puppet/util/filetype.rb +2 -2
- data/lib/puppet/util/json_lockfile.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +10 -1
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/network_device/cisco/device.rb +5 -5
- data/lib/puppet/util/network_device/config.rb +2 -3
- data/lib/puppet/util/platform.rb +13 -0
- data/lib/puppet/util/plist.rb +4 -4
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +2 -2
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc2.rb +1 -1
- data/lib/puppet/util/reference.rb +8 -1
- data/lib/puppet/util/windows/adsi.rb +18 -15
- data/lib/puppet/util/windows/principal.rb +6 -7
- data/lib/puppet/util/windows/process.rb +1 -1
- data/lib/puppet/util/windows/registry.rb +2 -2
- data/lib/puppet/util/windows/sid.rb +7 -62
- data/lib/puppet/vendor/deep_merge/README.md +2 -2
- data/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
- data/lib/puppet/vendor/semantic_puppet/locales/config.yaml +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +874 -0
- data/locales/ja/puppet.po +140 -163
- data/locales/puppet.pot +940 -597
- data/man/man5/puppet.conf.5 +16 -91
- data/man/man8/puppet-agent.8 +2 -6
- data/man/man8/puppet-apply.8 +2 -2
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +11 -33
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +4 -22
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +2 -11
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/application/lookup_spec.rb +0 -21
- data/spec/integration/parser/compiler_spec.rb +18 -0
- data/spec/integration/parser/script_compiler_spec.rb +113 -0
- data/spec/integration/provider/mount_spec.rb +2 -0
- data/spec/integration/type/file_spec.rb +11 -3
- data/spec/integration/util/windows/adsi_spec.rb +1 -86
- data/spec/integration/util/windows/principal_spec.rb +1 -10
- data/spec/shared_contexts/checksum.rb +4 -1
- data/spec/shared_contexts/digests.rb +46 -1
- data/spec/shared_contexts/types_setup.rb +8 -3
- data/spec/unit/agent_spec.rb +2 -2
- data/spec/unit/application/cert_spec.rb +5 -17
- data/spec/unit/application/device_spec.rb +2 -96
- data/spec/unit/application/filebucket_spec.rb +18 -4
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -32
- data/spec/unit/configurer_spec.rb +3 -3
- data/spec/unit/datatypes_spec.rb +304 -0
- data/spec/unit/defaults_spec.rb +41 -20
- data/spec/unit/face/config_spec.rb +46 -1
- data/spec/unit/face/epp_face_spec.rb +7 -3
- data/spec/unit/face/module/search_spec.rb +11 -0
- data/spec/unit/face/parser_spec.rb +2 -2
- data/spec/unit/file_bucket/dipper_spec.rb +12 -1
- data/spec/unit/forge/module_release_spec.rb +70 -0
- data/spec/unit/functions/break_spec.rb +34 -2
- data/spec/unit/functions/contain_spec.rb +1 -0
- data/spec/unit/functions/convert_to_spec.rb +22 -0
- data/spec/unit/functions/epp_spec.rb +5 -0
- data/spec/unit/functions/include_spec.rb +15 -0
- data/spec/unit/functions/module_directory_spec.rb +43 -0
- data/spec/unit/functions/new_spec.rb +14 -14
- data/spec/unit/functions/require_spec.rb +2 -0
- data/spec/unit/functions/shared.rb +12 -0
- data/spec/unit/functions/step_spec.rb +1 -1
- data/spec/unit/functions4_spec.rb +49 -4
- data/spec/unit/indirector/catalog/compiler_spec.rb +3 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +148 -94
- data/spec/unit/indirector/node/ldap_spec.rb +15 -12
- data/spec/unit/indirector/rest_spec.rb +0 -43
- data/spec/unit/interface/action_spec.rb +33 -0
- data/spec/unit/module_tool/applications/builder_spec.rb +7 -0
- data/spec/unit/module_tool/applications/installer_spec.rb +8 -0
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +8 -0
- data/spec/unit/module_tool/applications/upgrader_spec.rb +6 -0
- data/spec/unit/network/http/connection_spec.rb +1 -1
- data/spec/unit/network/http/factory_spec.rb +28 -35
- data/spec/unit/parser/compiler_spec.rb +0 -8
- data/spec/unit/parser/environment_compiler_spec.rb +36 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +9 -0
- data/spec/unit/parser/functions/inline_template_spec.rb +7 -0
- data/spec/unit/parser/functions/realize_spec.rb +9 -0
- data/spec/unit/parser/functions/tag_spec.rb +7 -0
- data/spec/unit/parser/functions/tagged_spec.rb +25 -0
- data/spec/unit/parser/functions/template_spec.rb +8 -0
- data/spec/unit/parser/scope_spec.rb +19 -0
- data/spec/unit/pops/evaluator/conditionals_spec.rb +1 -1
- data/spec/unit/pops/loaders/loader_spec.rb +516 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +11 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +43 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +15 -7
- data/spec/unit/pops/model/model_spec.rb +5 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +15 -0
- data/spec/unit/pops/parser/locator_spec.rb +20 -0
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +33 -0
- data/spec/unit/pops/parser/parse_calls_spec.rb +28 -0
- data/spec/unit/pops/parser/parse_conditionals_spec.rb +12 -0
- data/spec/unit/pops/parser/parse_plan_spec.rb +48 -0
- data/spec/unit/pops/serialization/packer_spec.rb +8 -0
- data/spec/unit/pops/serialization/serialization_spec.rb +30 -0
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +31 -0
- data/spec/unit/pops/types/error_spec.rb +207 -0
- data/spec/unit/pops/types/p_init_type_spec.rb +98 -0
- data/spec/unit/pops/types/p_object_type_spec.rb +275 -10
- data/spec/unit/pops/types/p_uri_type_spec.rb +191 -0
- data/spec/unit/pops/types/ruby_generator_spec.rb +82 -44
- data/spec/unit/pops/types/task_spec.rb +353 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +76 -5
- data/spec/unit/pops/types/type_formatter_spec.rb +31 -13
- data/spec/unit/pops/types/type_parser_spec.rb +13 -1
- data/spec/unit/pops/types/types_spec.rb +60 -0
- data/spec/unit/pops/validator/validator_spec.rb +76 -0
- data/spec/unit/provider/group/groupadd_spec.rb +77 -1
- data/spec/unit/provider/group/pw_spec.rb +4 -4
- data/spec/unit/provider/group/windows_adsi_spec.rb +22 -79
- data/spec/unit/provider/mount_spec.rb +18 -5
- data/spec/unit/provider/nameservice_spec.rb +5 -5
- data/spec/unit/provider/package/dnf_spec.rb +2 -2
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +3 -0
- data/spec/unit/provider/package/yum_spec.rb +40 -0
- data/spec/unit/provider/service/launchd_spec.rb +2 -1
- data/spec/unit/provider/service/redhat_spec.rb +5 -0
- data/spec/unit/provider/service/systemd_spec.rb +1 -1
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/openbsd_spec.rb +2 -2
- data/spec/unit/provider/user/pw_spec.rb +14 -14
- data/spec/unit/provider/user/user_role_add_spec.rb +19 -2
- data/spec/unit/provider/user/useradd_spec.rb +188 -22
- data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
- data/spec/unit/provider/zfs/zfs_spec.rb +55 -1
- data/spec/unit/provider_spec.rb +48 -0
- data/spec/unit/puppet_pal_2pec.rb +1005 -0
- data/spec/unit/puppet_pal_spec.rb +11 -0
- data/spec/unit/settings/ini_file_spec.rb +313 -2
- data/spec/unit/ssl/certificate_request_spec.rb +42 -1
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +2 -1
- data/spec/unit/transaction/report_spec.rb +1 -0
- data/spec/unit/transaction_spec.rb +112 -21
- data/spec/unit/type/file/checksum_spec.rb +20 -0
- data/spec/unit/type/file_spec.rb +8 -0
- data/spec/unit/type/group_spec.rb +8 -0
- data/spec/unit/type/k5login_spec.rb +22 -1
- data/spec/unit/type/scheduled_task_spec.rb +15 -0
- data/spec/unit/type/user_spec.rb +11 -1
- data/spec/unit/type/yumrepo_spec.rb +5 -0
- data/spec/unit/util/checksums_spec.rb +3 -3
- data/spec/unit/util/log/destinations_spec.rb +14 -0
- data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
- data/spec/unit/util/plist_spec.rb +3 -3
- data/spec/unit/util/windows/adsi_spec.rb +27 -31
- data/spec/unit/util/windows/sid_spec.rb +15 -86
- data/spec/unit/util_spec.rb +17 -3
- data/tasks/manpages.rake +1 -1
- metadata +218 -180
- data/lib/puppet/bindings.rb +0 -148
- data/lib/puppet/configurer/downloader_factory.rb +0 -44
- data/spec/unit/configurer/downloader_factory_spec.rb +0 -129
@@ -123,7 +123,7 @@ module EppSupport
|
|
123
123
|
# The scanner supports
|
124
124
|
# * scanning text until <%, <%-, <%=
|
125
125
|
# * while scanning text:
|
126
|
-
# * tokens <%% and %%> are translated to <% and
|
126
|
+
# * tokens <%% and %%> are translated to <% and %>, respectively, and is returned as text.
|
127
127
|
# * tokens <%# and %> (or ending with -%>) and the enclosed text is a comment and is not included in the returned text
|
128
128
|
# * text following a comment that ends with -%> gets trailing whitespace (up to and including a line break) trimmed
|
129
129
|
# and this whitespace is not included in the returned text.
|
@@ -201,8 +201,6 @@ module EppSupport
|
|
201
201
|
if s.end_with? "<%"
|
202
202
|
@mode = :error
|
203
203
|
@issue = Issues::EPP_UNBALANCED_EXPRESSION
|
204
|
-
else
|
205
|
-
mode = :epp
|
206
204
|
end
|
207
205
|
return s
|
208
206
|
|
@@ -10,7 +10,7 @@ module Puppet::Pops::Parser::InterpolationSupport
|
|
10
10
|
|
11
11
|
# This is the starting point for a double quoted string with possible interpolation
|
12
12
|
# The structure mimics that of the grammar.
|
13
|
-
# The logic is explicit (where the former implementation used parameters/
|
13
|
+
# The logic is explicit (where the former implementation used parameters/structures) given to a
|
14
14
|
# generic handler.
|
15
15
|
# (This is both easier to understand and faster).
|
16
16
|
#
|
@@ -221,7 +221,7 @@ module Puppet::Pops::Parser::InterpolationSupport
|
|
221
221
|
|
222
222
|
def transform_to_variable(token)
|
223
223
|
token_name = token[0]
|
224
|
-
if [:NUMBER, :NAME, :WORD].include?(token_name) || self.class::KEYWORD_NAMES[token_name]
|
224
|
+
if [:NUMBER, :NAME, :WORD].include?(token_name) || self.class::KEYWORD_NAMES[token_name] || @taskm_keywords[token_name]
|
225
225
|
t = token[1]
|
226
226
|
ta = t.token_array
|
227
227
|
[:VARIABLE, self.class::TokenValue.new([:VARIABLE, ta[1], ta[2]], t.offset, t.locator)]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# The Lexer is
|
1
|
+
# The Lexer is responsible for turning source text into tokens.
|
2
2
|
# This version is a performance enhanced lexer (in comparison to the 3.x and earlier "future parser" lexer.
|
3
3
|
#
|
4
4
|
# Old returns tokens [:KEY, value, { locator = }
|
@@ -513,7 +513,6 @@ class Lexer2
|
|
513
513
|
scn.pos = before
|
514
514
|
invalid_number = scn.peek(after - before) unless invalid_number
|
515
515
|
end
|
516
|
-
length = scn.pos - before
|
517
516
|
assert_numeric(invalid_number, before)
|
518
517
|
scn.pos = before + 1
|
519
518
|
lex_error(Issues::ILLEGAL_NUMBER, {:value => invalid_number})
|
@@ -523,12 +522,11 @@ class Lexer2
|
|
523
522
|
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
524
523
|
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '_'].each do |c|
|
525
524
|
@selector[c] = lambda do
|
526
|
-
|
527
525
|
scn = @scanner
|
528
526
|
before = scn.pos
|
529
527
|
value = scn.scan(PATTERN_BARE_WORD)
|
530
528
|
if value && value =~ PATTERN_NAME
|
531
|
-
emit_completed(KEYWORDS[value] || [:NAME, value.freeze, scn.pos - before], before)
|
529
|
+
emit_completed(KEYWORDS[value] || @taskm_keywords[value] || [:NAME, value.freeze, scn.pos - before], before)
|
532
530
|
elsif value
|
533
531
|
emit_completed([:WORD, value.freeze, scn.pos - before], before)
|
534
532
|
else
|
@@ -663,6 +661,8 @@ class Lexer2
|
|
663
661
|
:after => nil,
|
664
662
|
:line_lexical_start => 0
|
665
663
|
}
|
664
|
+
# Use of --tasks introduces the new keyword 'plan'
|
665
|
+
@taskm_keywords = Puppet[:tasks] ? { 'plan' => [:PLAN, 'plan', 4] }.freeze : EMPTY_HASH
|
666
666
|
end
|
667
667
|
|
668
668
|
# Scans all of the content and returns it in an array
|
@@ -135,7 +135,7 @@ module LexerSupport
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def to_s
|
138
|
-
# This format is very compact and is intended for debugging output from racc
|
138
|
+
# This format is very compact and is intended for debugging output from racc parser in
|
139
139
|
# debug mode. If this is made more elaborate the output from a debug run becomes very hard to read.
|
140
140
|
#
|
141
141
|
"'#{self[:value]} #{@token_array[0]}'"
|
@@ -204,7 +204,7 @@ module LexerSupport
|
|
204
204
|
|
205
205
|
def get_bom(content)
|
206
206
|
# get 5 bytes as efficiently as possible (none of the string methods works since a bom consists of
|
207
|
-
# illegal characters on most platforms, and there is no get_bytes(n).
|
207
|
+
# illegal characters on most platforms, and there is no get_bytes(n). Explicit calls are faster than
|
208
208
|
# looping with a lambda. The get_byte returns nil if there are too few characters, and they
|
209
209
|
# are changed to spaces
|
210
210
|
MM.new(
|
@@ -43,11 +43,7 @@ class Locator
|
|
43
43
|
def char_offset(byte_offset)
|
44
44
|
end
|
45
45
|
|
46
|
-
# Returns the length measured in number of characters from the given start and end
|
47
|
-
def char_length(offset, end_offset)
|
48
|
-
end
|
49
|
-
|
50
|
-
# Returns the length measured in number of characters from the given start and end byte offseta
|
46
|
+
# Returns the length measured in number of characters from the given start and end byte offset
|
51
47
|
def char_length(offset, end_offset)
|
52
48
|
end
|
53
49
|
|
@@ -164,8 +160,6 @@ class Locator
|
|
164
160
|
class AbstractLocator < Locator
|
165
161
|
attr_accessor :line_index
|
166
162
|
attr_accessor :string
|
167
|
-
attr_accessor :prev_offset
|
168
|
-
attr_accessor :prev_line
|
169
163
|
attr_reader :string
|
170
164
|
attr_reader :file
|
171
165
|
|
@@ -255,19 +249,19 @@ class Locator
|
|
255
249
|
|
256
250
|
# Returns the line number (first line is 1) for the given offset
|
257
251
|
def line_for_offset(offset)
|
258
|
-
if prev_offset == offset
|
252
|
+
if @prev_offset == offset
|
259
253
|
# use cache
|
260
|
-
return prev_line
|
254
|
+
return @prev_line
|
261
255
|
end
|
262
256
|
if line_nbr = ary_bsearch_i(line_index, offset)
|
263
257
|
# cache
|
264
|
-
prev_offset = offset
|
265
|
-
prev_line = line_nbr
|
258
|
+
@prev_offset = offset
|
259
|
+
@prev_line = line_nbr
|
266
260
|
return line_nbr
|
267
261
|
end
|
268
262
|
# If not found it is after last
|
269
263
|
# clear cache
|
270
|
-
prev_offset = prev_line = nil
|
264
|
+
@prev_offset = @prev_line = nil
|
271
265
|
return line_index.size
|
272
266
|
end
|
273
267
|
end
|
@@ -328,7 +322,7 @@ class Locator
|
|
328
322
|
string.byteslice(0, byte_offset).length
|
329
323
|
end
|
330
324
|
|
331
|
-
# Returns the length measured in number of characters from the given start and end byte
|
325
|
+
# Returns the length measured in number of characters from the given start and end byte offset
|
332
326
|
def char_length(offset, end_offset)
|
333
327
|
string.byteslice(offset, end_offset - offset).length
|
334
328
|
end
|
@@ -91,7 +91,7 @@ class Parser
|
|
91
91
|
#
|
92
92
|
def on_error(token,value,stack)
|
93
93
|
if token == 0 # denotes end of file
|
94
|
-
value_at = 'end of
|
94
|
+
value_at = 'end of input'
|
95
95
|
else
|
96
96
|
value_at = "'#{value[:value]}'"
|
97
97
|
end
|
@@ -121,7 +121,7 @@ class Parser
|
|
121
121
|
file = lexer.file
|
122
122
|
end
|
123
123
|
file = nil unless file.is_a?(String) && !file.empty?
|
124
|
-
raise Puppet::ParseErrorWithIssue.new(error, file, line, pos, nil,
|
124
|
+
raise Puppet::ParseErrorWithIssue.new(error, file, line, pos, nil, Issues::SYNTAX_ERROR.issue_code)
|
125
125
|
end
|
126
126
|
|
127
127
|
# Parses a String of pp DSL code.
|
@@ -219,7 +219,7 @@ class Parser
|
|
219
219
|
# Create a synthetic NOOP token at EOF offset with 0 size. The lexer does not produce an EOF token that is
|
220
220
|
# visible to the grammar rules. Creating this token is mainly to reuse the positioning logic as it
|
221
221
|
# expects a token decorated with location information.
|
222
|
-
|
222
|
+
_, token = @lexer.emit_completed([:NOOP,'',0], locator.string.bytesize)
|
223
223
|
loc(no_op, token)
|
224
224
|
# Program with a Noop
|
225
225
|
program = Factory.PROGRAM(no_op, [], locator)
|
@@ -45,9 +45,6 @@ module SlurpSupport
|
|
45
45
|
# Copy from old lexer - can do much better
|
46
46
|
def slurp_uqstring
|
47
47
|
scn = @scanner
|
48
|
-
last = scn.matched
|
49
|
-
ignore = true
|
50
|
-
|
51
48
|
str = slurp(scn, @lexing_context[:uq_slurp_pattern], @lexing_context[:escapes], :ignore_invalid_escapes)
|
52
49
|
|
53
50
|
# Terminator may be a single char '$', two characters '${', or empty string '' at the end of intput.
|
data/lib/puppet/pops/pcore.rb
CHANGED
@@ -38,6 +38,51 @@ module Pcore
|
|
38
38
|
add_alias('Pcore::MemberName', TYPE_MEMBER_NAME, loader)
|
39
39
|
add_alias('Pcore::TypeName', TYPE_QUALIFIED_REFERENCE, loader)
|
40
40
|
add_alias('Pcore::QRef', TYPE_QUALIFIED_REFERENCE, loader)
|
41
|
+
|
42
|
+
if Puppet[:tasks]
|
43
|
+
add_object_type('Task', <<-PUPPET, loader)
|
44
|
+
{
|
45
|
+
attributes => {
|
46
|
+
# Fully qualified name of the task
|
47
|
+
name => { type => Pattern[/\\A[a-z][a-z0-9_]*(?:::[a-z][a-z0-9_]*)*\\z/] },
|
48
|
+
|
49
|
+
# Full path to executable
|
50
|
+
executable => { type => String },
|
51
|
+
|
52
|
+
# Task description
|
53
|
+
description => { type => Optional[String], value => undef },
|
54
|
+
|
55
|
+
# Puppet Task version
|
56
|
+
puppet_task_version => { type => Integer, value => 1 },
|
57
|
+
|
58
|
+
# Type, description, and sensitive property of each parameter
|
59
|
+
parameters => {
|
60
|
+
type => Optional[Hash[
|
61
|
+
Pattern[/\\A[a-z][a-z0-9_]*\\z/],
|
62
|
+
Struct[
|
63
|
+
Optional[description] => String,
|
64
|
+
Optional[sensitive] => Boolean,
|
65
|
+
type => Type]]],
|
66
|
+
value => undef
|
67
|
+
},
|
68
|
+
|
69
|
+
# Type, description, and sensitive property of each output
|
70
|
+
output => {
|
71
|
+
type => Optional[Hash[
|
72
|
+
Pattern[/\\A[a-z][a-z0-9_]*\\z/],
|
73
|
+
Struct[
|
74
|
+
Optional[description] => String,
|
75
|
+
Optional[sensitive] => Boolean,
|
76
|
+
type => Type]]],
|
77
|
+
value => undef
|
78
|
+
},
|
79
|
+
|
80
|
+
supports_noop => { type => Boolean, value => false },
|
81
|
+
input_method => { type => String, value => 'both' },
|
82
|
+
}
|
83
|
+
}
|
84
|
+
PUPPET
|
85
|
+
end
|
41
86
|
Types::TypedModelObject.register_ptypes(loader, ir)
|
42
87
|
|
43
88
|
@type = create_object_type(loader, ir, Pcore, 'Pcore', nil)
|
@@ -11,7 +11,7 @@ def self.register_ptypes(loader, ir)
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class ResourceTypeImpl
|
14
|
-
# Make instances of this class directly
|
14
|
+
# Make instances of this class directly creatable from the Puppet Language
|
15
15
|
# as object.
|
16
16
|
#
|
17
17
|
include Puppet::Pops::Types::PuppetObject
|
@@ -170,6 +170,10 @@ class AbstractReader
|
|
170
170
|
# are written as binary data.
|
171
171
|
read_payload(data) { |ep| Types::PBinaryType::Binary.new(ep.read) }
|
172
172
|
end
|
173
|
+
|
174
|
+
register_type(Extension::URI) do |data|
|
175
|
+
read_payload(data) { |ep| URI(ep.read) }
|
176
|
+
end
|
173
177
|
end
|
174
178
|
end
|
175
179
|
end
|
@@ -202,6 +202,12 @@ class AbstractWriter
|
|
202
202
|
build_payload { |ep| ep.write(o.to_s) }
|
203
203
|
end
|
204
204
|
end
|
205
|
+
|
206
|
+
URI.scheme_list.values.each do |uri_class|
|
207
|
+
register_type(Extension::URI, uri_class) do |o|
|
208
|
+
build_payload { |ep| ep.write(o.to_s) }
|
209
|
+
end
|
210
|
+
end
|
205
211
|
end
|
206
212
|
|
207
213
|
def to_s
|
@@ -1,5 +1,57 @@
|
|
1
1
|
module Puppet::Pops
|
2
2
|
module Serialization
|
3
|
+
class Builder
|
4
|
+
def initialize(values)
|
5
|
+
@values = values
|
6
|
+
@resolved = true
|
7
|
+
end
|
8
|
+
|
9
|
+
def [](key)
|
10
|
+
@values[key]
|
11
|
+
end
|
12
|
+
|
13
|
+
def []=(key, value)
|
14
|
+
@values[key] = value
|
15
|
+
@resolved = false if value.is_a?(Builder)
|
16
|
+
end
|
17
|
+
|
18
|
+
def resolve
|
19
|
+
unless @resolved
|
20
|
+
@resolved = true
|
21
|
+
if @values.is_a?(Array)
|
22
|
+
@values.each_with_index { |v, idx| @values[idx] = v.resolve if v.is_a?(Builder) }
|
23
|
+
elsif @values.is_a?(Hash)
|
24
|
+
@values.each_pair { |k, v| @values[k] = v.resolve if v.is_a?(Builder) }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
@values
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class ObjectHashBuilder < Builder
|
32
|
+
def initialize(instance)
|
33
|
+
super({})
|
34
|
+
@instance = instance
|
35
|
+
end
|
36
|
+
|
37
|
+
def resolve
|
38
|
+
@instance._pcore_init_from_hash(super)
|
39
|
+
@instance
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class ObjectArrayBuilder < Builder
|
44
|
+
def initialize(instance)
|
45
|
+
super({})
|
46
|
+
@instance = instance
|
47
|
+
end
|
48
|
+
|
49
|
+
def resolve
|
50
|
+
@instance.send(:initialize, *super.values)
|
51
|
+
@instance
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
3
55
|
# Class that can process the `Data` produced by the {ToDataConverter} class and reassemble
|
4
56
|
# the objects that were converted.
|
5
57
|
#
|
@@ -137,9 +189,16 @@ module Serialization
|
|
137
189
|
end
|
138
190
|
|
139
191
|
def build(value, &block)
|
140
|
-
|
141
|
-
|
142
|
-
|
192
|
+
vx = Builder.new(value)
|
193
|
+
@current[@key] = vx unless @current.nil?
|
194
|
+
with_value(vx, &block) if block_given?
|
195
|
+
vx.resolve
|
196
|
+
end
|
197
|
+
|
198
|
+
def build_object(builder, &block)
|
199
|
+
@current[@key] = builder unless @current.nil?
|
200
|
+
with_value(builder, &block) if block_given?
|
201
|
+
builder.resolve
|
143
202
|
end
|
144
203
|
|
145
204
|
def pcore_type_hash_to_value(pcore_type, value)
|
@@ -148,14 +207,9 @@ module Serialization
|
|
148
207
|
if value.empty?
|
149
208
|
build(pcore_type.create)
|
150
209
|
elsif pcore_type.implementation_class.respond_to?(:_pcore_init_from_hash)
|
151
|
-
|
152
|
-
@current._pcore_init_from_hash(with_value({}) { value.each_pair { |key, elem| with(key) { convert(elem) } } })
|
153
|
-
end
|
210
|
+
build_object(ObjectHashBuilder.new(pcore_type.allocate)) { value.each_pair { |key, elem| with(key) { convert(elem) } } }
|
154
211
|
else
|
155
|
-
|
156
|
-
args = with_value([]) { value.values.each_with_index { |elem, idx| with(idx) { convert(elem) }}}
|
157
|
-
@current.send(:initialize, *args)
|
158
|
-
end
|
212
|
+
build_object(ObjectArrayBuilder.new(pcore_type.allocate)) { value.each_pair { |key, elem| with(key) { convert(elem) } } }
|
159
213
|
end
|
160
214
|
elsif value.is_a?(String)
|
161
215
|
build(pcore_type.create(value))
|
@@ -47,7 +47,8 @@ module JsonPath
|
|
47
47
|
#
|
48
48
|
def resolve(context, path)
|
49
49
|
factory = @parser.parse_string(path)
|
50
|
-
resolve_any(factory.model.body, context, path)
|
50
|
+
v = resolve_any(factory.model.body, context, path)
|
51
|
+
v.is_a?(Builder) ? v.resolve : v
|
51
52
|
end
|
52
53
|
|
53
54
|
def resolve_any(ast, context, path)
|
@@ -9,8 +9,7 @@ module Serialization
|
|
9
9
|
class ObjectReader
|
10
10
|
include InstanceReader
|
11
11
|
|
12
|
-
def read(impl_class, value_count, deserializer)
|
13
|
-
type = impl_class._pcore_type
|
12
|
+
def read(type, impl_class, value_count, deserializer)
|
14
13
|
(names, types, required_count) = type.parameter_info(impl_class)
|
15
14
|
max = names.size
|
16
15
|
unless value_count >= required_count && value_count <= max
|
@@ -25,7 +24,7 @@ class ObjectReader
|
|
25
24
|
Types::TypeAsserter.assert_instance_of(nil, ptype, arg) { "#{type.name}[#{names[index]}]" } unless arg == :default
|
26
25
|
else
|
27
26
|
attr = type[names[index]]
|
28
|
-
raise Serialization::SerializationError, _("Missing default value for %{type_name}[%{name}]") % { type_name: type.name, name: names[index] } unless attr.value?
|
27
|
+
raise Serialization::SerializationError, _("Missing default value for %{type_name}[%{name}]") % { type_name: type.name, name: names[index] } unless attr && attr.value?
|
29
28
|
args << attr.value
|
30
29
|
end
|
31
30
|
end
|
@@ -43,7 +42,7 @@ class ObjectWriter
|
|
43
42
|
|
44
43
|
def write(type, value, serializer)
|
45
44
|
impl_class = value.class
|
46
|
-
(names,
|
45
|
+
(names, _, required_count) = type.parameter_info(impl_class)
|
47
46
|
args = names.map { |name| value.send(name) }
|
48
47
|
|
49
48
|
# Pop optional arguments that are default
|
@@ -108,7 +108,8 @@ module Serialization
|
|
108
108
|
value.instance_of?(SemanticPuppet::VersionRange),
|
109
109
|
value.instance_of?(Time::Timestamp),
|
110
110
|
value.instance_of?(Time::Timespan),
|
111
|
-
value.instance_of?(Types::PBinaryType::Binary)
|
111
|
+
value.instance_of?(Types::PBinaryType::Binary),
|
112
|
+
value.is_a?(URI)
|
112
113
|
push_written(value)
|
113
114
|
@writer.write(value)
|
114
115
|
when value.instance_of?(Array)
|