microwave 11.400.3 → 11.400.4
Sign up to get free protection for your applications and to get access to all the features.
- data/distro/README +2 -0
- data/distro/arch/etc/conf.d/chef-client.conf +5 -0
- data/distro/arch/etc/conf.d/chef-expander.conf +8 -0
- data/distro/arch/etc/conf.d/chef-server-webui.conf +10 -0
- data/distro/arch/etc/conf.d/chef-server.conf +10 -0
- data/distro/arch/etc/conf.d/chef-solr.conf +8 -0
- data/distro/arch/etc/rc.d/chef-client +90 -0
- data/distro/arch/etc/rc.d/chef-expander +78 -0
- data/distro/arch/etc/rc.d/chef-server +78 -0
- data/distro/arch/etc/rc.d/chef-server-webui +78 -0
- data/distro/arch/etc/rc.d/chef-solr +78 -0
- data/distro/common/html/chef-client.8.html +145 -0
- data/distro/common/html/chef-expander.8.html +164 -0
- data/distro/common/html/chef-expanderctl.8.html +146 -0
- data/distro/common/html/chef-server-webui.8.html +185 -0
- data/distro/common/html/chef-server.8.html +182 -0
- data/distro/common/html/chef-shell.1.html +286 -0
- data/distro/common/html/chef-solo.8.html +191 -0
- data/distro/common/html/chef-solr.8.html +165 -0
- data/distro/common/html/knife-bootstrap.1.html +241 -0
- data/distro/common/html/knife-client.1.html +219 -0
- data/distro/common/html/knife-configure.1.html +170 -0
- data/distro/common/html/knife-cookbook-site.1.html +241 -0
- data/distro/common/html/knife-cookbook.1.html +384 -0
- data/distro/common/html/knife-data-bag.1.html +238 -0
- data/distro/common/html/knife-environment.1.html +267 -0
- data/distro/common/html/knife-exec.1.html +134 -0
- data/distro/common/html/knife-index.1.html +125 -0
- data/distro/common/html/knife-node.1.html +250 -0
- data/distro/common/html/knife-role.1.html +200 -0
- data/distro/common/html/knife-search.1.html +288 -0
- data/distro/common/html/knife-ssh.1.html +156 -0
- data/distro/common/html/knife-status.1.html +128 -0
- data/distro/common/html/knife-tag.1.html +137 -0
- data/distro/common/html/knife.1.html +315 -0
- data/distro/common/man/man1/chef-shell.1 +220 -0
- data/distro/common/man/man1/knife-bootstrap.1 +201 -0
- data/distro/common/man/man1/knife-client.1 +99 -0
- data/distro/common/man/man1/knife-configure.1 +88 -0
- data/distro/common/man/man1/knife-cookbook-site.1 +145 -0
- data/distro/common/man/man1/knife-cookbook.1 +345 -0
- data/distro/common/man/man1/knife-data-bag.1 +136 -0
- data/distro/common/man/man1/knife-environment.1 +178 -0
- data/distro/common/man/man1/knife-exec.1 +43 -0
- data/distro/common/man/man1/knife-index.1 +29 -0
- data/distro/common/man/man1/knife-node.1 +134 -0
- data/distro/common/man/man1/knife-role.1 +88 -0
- data/distro/common/man/man1/knife-search.1 +280 -0
- data/distro/common/man/man1/knife-ssh.1 +79 -0
- data/distro/common/man/man1/knife-status.1 +29 -0
- data/distro/common/man/man1/knife-tag.1 +43 -0
- data/distro/common/man/man1/knife.1 +285 -0
- data/distro/common/man/man8/chef-client.8 +104 -0
- data/distro/common/man/man8/chef-expander.8 +97 -0
- data/distro/common/man/man8/chef-expanderctl.8 +62 -0
- data/distro/common/man/man8/chef-server-webui.8 +155 -0
- data/distro/common/man/man8/chef-server.8 +147 -0
- data/distro/common/man/man8/chef-solo.8 +158 -0
- data/distro/common/man/man8/chef-solr.8 +122 -0
- data/distro/common/markdown/README +3 -0
- data/distro/common/markdown/man1/chef-shell.mkd +195 -0
- data/distro/common/markdown/man1/knife-bootstrap.mkd +141 -0
- data/distro/common/markdown/man1/knife-client.mkd +103 -0
- data/distro/common/markdown/man1/knife-configure.mkd +70 -0
- data/distro/common/markdown/man1/knife-cookbook-site.mkd +123 -0
- data/distro/common/markdown/man1/knife-cookbook.mkd +263 -0
- data/distro/common/markdown/man1/knife-data-bag.mkd +121 -0
- data/distro/common/markdown/man1/knife-environment.mkd +151 -0
- data/distro/common/markdown/man1/knife-exec.mkd +42 -0
- data/distro/common/markdown/man1/knife-index.mkd +30 -0
- data/distro/common/markdown/man1/knife-node.mkd +130 -0
- data/distro/common/markdown/man1/knife-role.mkd +85 -0
- data/distro/common/markdown/man1/knife-search.mkd +180 -0
- data/distro/common/markdown/man1/knife-ssh.mkd +69 -0
- data/distro/common/markdown/man1/knife-status.mkd +36 -0
- data/distro/common/markdown/man1/knife-tag.mkd +39 -0
- data/distro/common/markdown/man1/knife.mkd +213 -0
- data/distro/common/markdown/man8/chef-client.mkd +74 -0
- data/distro/common/markdown/man8/chef-expander.mkd +82 -0
- data/distro/common/markdown/man8/chef-expanderctl.mkd +58 -0
- data/distro/common/markdown/man8/chef-server-webui.mkd +121 -0
- data/distro/common/markdown/man8/chef-server.mkd +121 -0
- data/distro/common/markdown/man8/chef-solo.mkd +107 -0
- data/distro/common/markdown/man8/chef-solr.mkd +89 -0
- data/distro/debian/etc/default/chef-client +4 -0
- data/distro/debian/etc/default/chef-expander +8 -0
- data/distro/debian/etc/default/chef-server +9 -0
- data/distro/debian/etc/default/chef-server-webui +9 -0
- data/distro/debian/etc/default/chef-solr +8 -0
- data/distro/debian/etc/init.d/chef-client +210 -0
- data/distro/debian/etc/init.d/chef-expander +176 -0
- data/distro/debian/etc/init.d/chef-server +122 -0
- data/distro/debian/etc/init.d/chef-server-webui +123 -0
- data/distro/debian/etc/init.d/chef-solr +176 -0
- data/distro/debian/etc/init/chef-client.conf +17 -0
- data/distro/debian/etc/init/chef-expander.conf +17 -0
- data/distro/debian/etc/init/chef-server-webui.conf +17 -0
- data/distro/debian/etc/init/chef-server.conf +17 -0
- data/distro/debian/etc/init/chef-solr.conf +17 -0
- data/distro/redhat/etc/init.d/chef-client +121 -0
- data/distro/redhat/etc/init.d/chef-expander +104 -0
- data/distro/redhat/etc/init.d/chef-server +112 -0
- data/distro/redhat/etc/init.d/chef-server-webui +112 -0
- data/distro/redhat/etc/init.d/chef-solr +104 -0
- data/distro/redhat/etc/logrotate.d/chef-client +8 -0
- data/distro/redhat/etc/logrotate.d/chef-expander +8 -0
- data/distro/redhat/etc/logrotate.d/chef-server +8 -0
- data/distro/redhat/etc/logrotate.d/chef-server-webui +8 -0
- data/distro/redhat/etc/logrotate.d/chef-solr +8 -0
- data/distro/redhat/etc/sysconfig/chef-client +15 -0
- data/distro/redhat/etc/sysconfig/chef-expander +7 -0
- data/distro/redhat/etc/sysconfig/chef-server +14 -0
- data/distro/redhat/etc/sysconfig/chef-server-webui +14 -0
- data/distro/redhat/etc/sysconfig/chef-solr +8 -0
- data/distro/windows/service_manager.rb +164 -0
- data/lib/chef/api_client.rb +205 -0
- data/lib/chef/api_client/registration.rb +126 -0
- data/lib/chef/application.rb +225 -0
- data/lib/chef/application/agent.rb +18 -0
- data/lib/chef/application/apply.rb +160 -0
- data/lib/chef/application/client.rb +340 -0
- data/lib/chef/application/knife.rb +183 -0
- data/lib/chef/application/solo.rb +263 -0
- data/lib/chef/application/windows_service.rb +230 -0
- data/lib/chef/applications.rb +5 -0
- data/lib/chef/checksum/storage.rb +18 -0
- data/lib/chef/checksum/storage/filesystem.rb +56 -0
- data/lib/chef/chef_fs.rb +11 -0
- data/lib/chef/chef_fs/command_line.rb +232 -0
- data/lib/chef/chef_fs/file_pattern.rb +312 -0
- data/lib/chef/chef_fs/file_system.rb +358 -0
- data/lib/chef/chef_fs/file_system/base_fs_dir.rb +47 -0
- data/lib/chef/chef_fs/file_system/base_fs_object.rb +121 -0
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_entry.rb +109 -0
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +31 -0
- data/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +84 -0
- data/lib/chef/chef_fs/file_system/cookbook_dir.rb +188 -0
- data/lib/chef/chef_fs/file_system/cookbook_file.rb +78 -0
- data/lib/chef/chef_fs/file_system/cookbook_subdir.rb +54 -0
- data/lib/chef/chef_fs/file_system/cookbooks_dir.rb +68 -0
- data/lib/chef/chef_fs/file_system/data_bag_dir.rb +78 -0
- data/lib/chef/chef_fs/file_system/data_bag_item.rb +59 -0
- data/lib/chef/chef_fs/file_system/data_bags_dir.rb +66 -0
- data/lib/chef/chef_fs/file_system/file_system_entry.rb +90 -0
- data/lib/chef/chef_fs/file_system/file_system_error.rb +31 -0
- data/lib/chef/chef_fs/file_system/file_system_root_dir.rb +31 -0
- data/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb +31 -0
- data/lib/chef/chef_fs/file_system/nodes_dir.rb +47 -0
- data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +40 -0
- data/lib/chef/chef_fs/file_system/not_found_error.rb +31 -0
- data/lib/chef/chef_fs/file_system/rest_list_dir.rb +84 -0
- data/lib/chef/chef_fs/file_system/rest_list_entry.rb +123 -0
- data/lib/chef/chef_fs/knife.rb +77 -0
- data/lib/chef/chef_fs/path_utils.rb +64 -0
- data/lib/chef/client.rb +556 -0
- data/lib/chef/config.rb +354 -0
- data/lib/chef/cookbook/chefignore.rb +66 -0
- data/lib/chef/cookbook/cookbook_collection.rb +45 -0
- data/lib/chef/cookbook/cookbook_version_loader.rb +171 -0
- data/lib/chef/cookbook/file_system_file_vendor.rb +56 -0
- data/lib/chef/cookbook/file_vendor.rb +48 -0
- data/lib/chef/cookbook/metadata.rb +627 -0
- data/lib/chef/cookbook/remote_file_vendor.rb +84 -0
- data/lib/chef/cookbook/synchronizer.rb +216 -0
- data/lib/chef/cookbook/syntax_check.rb +183 -0
- data/lib/chef/cookbook_loader.rb +134 -0
- data/lib/chef/cookbook_site_streaming_uploader.rb +244 -0
- data/lib/chef/cookbook_uploader.rb +164 -0
- data/lib/chef/cookbook_version.rb +782 -0
- data/lib/chef/daemon.rb +172 -0
- data/lib/chef/data_bag.rb +145 -0
- data/lib/chef/data_bag_item.rb +214 -0
- data/lib/chef/digester.rb +73 -0
- data/lib/chef/dsl.rb +6 -0
- data/lib/chef/dsl/data_query.rb +71 -0
- data/lib/chef/dsl/include_attribute.rb +63 -0
- data/lib/chef/dsl/include_recipe.rb +45 -0
- data/lib/chef/dsl/platform_introspection.rb +218 -0
- data/lib/chef/dsl/recipe.rb +87 -0
- data/lib/chef/dsl/registry_helper.rb +59 -0
- data/lib/chef/encrypted_data_bag_item.rb +323 -0
- data/lib/chef/environment.rb +287 -0
- data/lib/chef/event_dispatch/base.rb +311 -0
- data/lib/chef/event_dispatch/dispatcher.rb +42 -0
- data/lib/chef/exceptions.rb +275 -0
- data/lib/chef/file_access_control.rb +75 -0
- data/lib/chef/file_access_control/unix.rb +216 -0
- data/lib/chef/file_access_control/windows.rb +310 -0
- data/lib/chef/file_cache.rb +220 -0
- data/lib/chef/formatters/base.rb +250 -0
- data/lib/chef/formatters/doc.rb +236 -0
- data/lib/chef/formatters/error_descriptor.rb +66 -0
- data/lib/chef/formatters/error_inspectors.rb +19 -0
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +111 -0
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +106 -0
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +146 -0
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +80 -0
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +125 -0
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +137 -0
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +117 -0
- data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +118 -0
- data/lib/chef/formatters/error_mapper.rb +85 -0
- data/lib/chef/formatters/minimal.rb +235 -0
- data/lib/chef/handler.rb +235 -0
- data/lib/chef/handler/error_report.rb +33 -0
- data/lib/chef/handler/json_file.rb +65 -0
- data/lib/chef/json_compat.rb +147 -0
- data/lib/chef/knife.rb +589 -0
- data/lib/chef/knife/bootstrap.rb +233 -0
- data/lib/chef/knife/bootstrap/archlinux-gems.erb +62 -0
- data/lib/chef/knife/bootstrap/centos5-gems.erb +62 -0
- data/lib/chef/knife/bootstrap/chef-full.erb +60 -0
- data/lib/chef/knife/bootstrap/fedora13-gems.erb +44 -0
- data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +53 -0
- data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +48 -0
- data/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb +46 -0
- data/lib/chef/knife/client_bulk_delete.rb +65 -0
- data/lib/chef/knife/client_create.rb +80 -0
- data/lib/chef/knife/client_delete.rb +46 -0
- data/lib/chef/knife/client_edit.rb +45 -0
- data/lib/chef/knife/client_list.rb +42 -0
- data/lib/chef/knife/client_reregister.rb +59 -0
- data/lib/chef/knife/client_show.rb +52 -0
- data/lib/chef/knife/configure.rb +170 -0
- data/lib/chef/knife/configure_client.rb +50 -0
- data/lib/chef/knife/cookbook_bulk_delete.rb +72 -0
- data/lib/chef/knife/cookbook_create.rb +447 -0
- data/lib/chef/knife/cookbook_delete.rb +151 -0
- data/lib/chef/knife/cookbook_download.rb +137 -0
- data/lib/chef/knife/cookbook_list.rb +47 -0
- data/lib/chef/knife/cookbook_metadata.rb +108 -0
- data/lib/chef/knife/cookbook_metadata_from_file.rb +44 -0
- data/lib/chef/knife/cookbook_show.rb +102 -0
- data/lib/chef/knife/cookbook_site_download.rb +109 -0
- data/lib/chef/knife/cookbook_site_install.rb +164 -0
- data/lib/chef/knife/cookbook_site_list.rb +62 -0
- data/lib/chef/knife/cookbook_site_search.rb +51 -0
- data/lib/chef/knife/cookbook_site_share.rb +114 -0
- data/lib/chef/knife/cookbook_site_show.rb +60 -0
- data/lib/chef/knife/cookbook_site_unshare.rb +56 -0
- data/lib/chef/knife/cookbook_site_vendor.rb +46 -0
- data/lib/chef/knife/cookbook_test.rb +94 -0
- data/lib/chef/knife/cookbook_upload.rb +295 -0
- data/lib/chef/knife/core/bootstrap_context.rb +106 -0
- data/lib/chef/knife/core/cookbook_scm_repo.rb +160 -0
- data/lib/chef/knife/core/generic_presenter.rb +204 -0
- data/lib/chef/knife/core/node_editor.rb +130 -0
- data/lib/chef/knife/core/node_presenter.rb +137 -0
- data/lib/chef/knife/core/object_loader.rb +112 -0
- data/lib/chef/knife/core/subcommand_loader.rb +112 -0
- data/lib/chef/knife/core/text_formatter.rb +86 -0
- data/lib/chef/knife/core/ui.rb +219 -0
- data/lib/chef/knife/data_bag_create.rb +93 -0
- data/lib/chef/knife/data_bag_delete.rb +51 -0
- data/lib/chef/knife/data_bag_edit.rb +94 -0
- data/lib/chef/knife/data_bag_from_file.rb +136 -0
- data/lib/chef/knife/data_bag_list.rb +46 -0
- data/lib/chef/knife/data_bag_show.rb +81 -0
- data/lib/chef/knife/delete.rb +39 -0
- data/lib/chef/knife/diff.rb +46 -0
- data/lib/chef/knife/download.rb +50 -0
- data/lib/chef/knife/environment_create.rb +53 -0
- data/lib/chef/knife/environment_delete.rb +45 -0
- data/lib/chef/knife/environment_edit.rb +45 -0
- data/lib/chef/knife/environment_from_file.rb +83 -0
- data/lib/chef/knife/environment_list.rb +42 -0
- data/lib/chef/knife/environment_show.rb +53 -0
- data/lib/chef/knife/exec.rb +86 -0
- data/lib/chef/knife/help.rb +103 -0
- data/lib/chef/knife/help_topics.rb +4 -0
- data/lib/chef/knife/index_rebuild.rb +134 -0
- data/lib/chef/knife/list.rb +109 -0
- data/lib/chef/knife/node_bulk_delete.rb +80 -0
- data/lib/chef/knife/node_create.rb +50 -0
- data/lib/chef/knife/node_delete.rb +47 -0
- data/lib/chef/knife/node_edit.rb +72 -0
- data/lib/chef/knife/node_from_file.rb +50 -0
- data/lib/chef/knife/node_list.rb +46 -0
- data/lib/chef/knife/node_run_list_add.rb +75 -0
- data/lib/chef/knife/node_run_list_remove.rb +48 -0
- data/lib/chef/knife/node_show.rb +73 -0
- data/lib/chef/knife/raw.rb +108 -0
- data/lib/chef/knife/recipe_list.rb +32 -0
- data/lib/chef/knife/role_bulk_delete.rb +70 -0
- data/lib/chef/knife/role_create.rb +55 -0
- data/lib/chef/knife/role_delete.rb +47 -0
- data/lib/chef/knife/role_edit.rb +48 -0
- data/lib/chef/knife/role_from_file.rb +56 -0
- data/lib/chef/knife/role_list.rb +43 -0
- data/lib/chef/knife/role_show.rb +54 -0
- data/lib/chef/knife/search.rb +159 -0
- data/lib/chef/knife/show.rb +32 -0
- data/lib/chef/knife/ssh.rb +463 -0
- data/lib/chef/knife/status.rb +119 -0
- data/lib/chef/knife/tag_create.rb +52 -0
- data/lib/chef/knife/tag_delete.rb +60 -0
- data/lib/chef/knife/tag_list.rb +47 -0
- data/lib/chef/knife/upload.rb +50 -0
- data/lib/chef/knife/user_create.rb +93 -0
- data/lib/chef/knife/user_delete.rb +46 -0
- data/lib/chef/knife/user_edit.rb +53 -0
- data/lib/chef/knife/user_list.rb +42 -0
- data/lib/chef/knife/user_reregister.rb +59 -0
- data/lib/chef/knife/user_show.rb +52 -0
- data/lib/chef/log.rb +39 -0
- data/lib/chef/mash.rb +225 -0
- data/lib/chef/mixin/checksum.rb +32 -0
- data/lib/chef/mixin/command.rb +164 -0
- data/lib/chef/mixin/command/unix.rb +220 -0
- data/lib/chef/mixin/command/windows.rb +76 -0
- data/lib/chef/mixin/convert_to_class_name.rb +65 -0
- data/lib/chef/mixin/create_path.rb +57 -0
- data/lib/chef/mixin/deep_merge.rb +168 -0
- data/lib/chef/mixin/deprecation.rb +100 -0
- data/lib/chef/mixin/enforce_ownership_and_permissions.rb +39 -0
- data/lib/chef/mixin/file_class.rb +46 -0
- data/lib/chef/mixin/from_file.rb +50 -0
- data/lib/chef/mixin/get_source_from_package.rb +42 -0
- data/lib/chef/mixin/language.rb +48 -0
- data/lib/chef/mixin/language_include_attribute.rb +35 -0
- data/lib/chef/mixin/language_include_recipe.rb +32 -0
- data/lib/chef/mixin/params_validate.rb +225 -0
- data/lib/chef/mixin/path_sanity.rb +67 -0
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +35 -0
- data/lib/chef/mixin/securable.rb +205 -0
- data/lib/chef/mixin/shell_out.rb +69 -0
- data/lib/chef/mixin/template.rb +140 -0
- data/lib/chef/mixin/why_run.rb +332 -0
- data/lib/chef/mixin/xml_escape.rb +140 -0
- data/lib/chef/mixins.rb +14 -0
- data/lib/chef/monkey_patches/dir.rb +36 -0
- data/lib/chef/monkey_patches/fileutils.rb +65 -0
- data/lib/chef/monkey_patches/net_http.rb +22 -0
- data/lib/chef/monkey_patches/numeric.rb +15 -0
- data/lib/chef/monkey_patches/object.rb +9 -0
- data/lib/chef/monkey_patches/regexp.rb +34 -0
- data/lib/chef/monkey_patches/string.rb +49 -0
- data/lib/chef/monkey_patches/tempfile.rb +64 -0
- data/lib/chef/nil_argument.rb +3 -0
- data/lib/chef/node.rb +509 -0
- data/lib/chef/node/attribute.rb +398 -0
- data/lib/chef/node/attribute_collections.rb +206 -0
- data/lib/chef/node/immutable_collections.rb +186 -0
- data/lib/chef/platform.rb +519 -0
- data/lib/chef/provider.rb +176 -0
- data/lib/chef/provider/breakpoint.rb +36 -0
- data/lib/chef/provider/cookbook_file.rb +113 -0
- data/lib/chef/provider/cron.rb +214 -0
- data/lib/chef/provider/cron/solaris.rb +56 -0
- data/lib/chef/provider/deploy.rb +475 -0
- data/lib/chef/provider/deploy/revision.rb +80 -0
- data/lib/chef/provider/deploy/timestamped.rb +32 -0
- data/lib/chef/provider/directory.rb +131 -0
- data/lib/chef/provider/env.rb +152 -0
- data/lib/chef/provider/env/windows.rb +75 -0
- data/lib/chef/provider/erl_call.rb +106 -0
- data/lib/chef/provider/execute.rb +68 -0
- data/lib/chef/provider/file.rb +328 -0
- data/lib/chef/provider/git.rb +260 -0
- data/lib/chef/provider/group.rb +158 -0
- data/lib/chef/provider/group/aix.rb +70 -0
- data/lib/chef/provider/group/dscl.rb +129 -0
- data/lib/chef/provider/group/gpasswd.rb +65 -0
- data/lib/chef/provider/group/groupadd.rb +96 -0
- data/lib/chef/provider/group/groupmod.rb +120 -0
- data/lib/chef/provider/group/pw.rb +93 -0
- data/lib/chef/provider/group/suse.rb +60 -0
- data/lib/chef/provider/group/usermod.rb +68 -0
- data/lib/chef/provider/group/windows.rb +79 -0
- data/lib/chef/provider/http_request.rb +119 -0
- data/lib/chef/provider/ifconfig.rb +214 -0
- data/lib/chef/provider/link.rb +132 -0
- data/lib/chef/provider/log.rb +54 -0
- data/lib/chef/provider/lwrp_base.rb +150 -0
- data/lib/chef/provider/mdadm.rb +92 -0
- data/lib/chef/provider/mount.rb +128 -0
- data/lib/chef/provider/mount/mount.rb +252 -0
- data/lib/chef/provider/mount/windows.rb +81 -0
- data/lib/chef/provider/ohai.rb +47 -0
- data/lib/chef/provider/package.rb +229 -0
- data/lib/chef/provider/package/apt.rb +147 -0
- data/lib/chef/provider/package/dpkg.rb +128 -0
- data/lib/chef/provider/package/easy_install.rb +136 -0
- data/lib/chef/provider/package/freebsd.rb +149 -0
- data/lib/chef/provider/package/ips.rb +101 -0
- data/lib/chef/provider/package/macports.rb +105 -0
- data/lib/chef/provider/package/pacman.rb +111 -0
- data/lib/chef/provider/package/portage.rb +138 -0
- data/lib/chef/provider/package/rpm.rb +121 -0
- data/lib/chef/provider/package/rubygems.rb +548 -0
- data/lib/chef/provider/package/smartos.rb +84 -0
- data/lib/chef/provider/package/solaris.rb +139 -0
- data/lib/chef/provider/package/yum-dump.py +307 -0
- data/lib/chef/provider/package/yum.rb +1255 -0
- data/lib/chef/provider/package/zypper.rb +144 -0
- data/lib/chef/provider/registry_key.rb +156 -0
- data/lib/chef/provider/remote_directory.rb +180 -0
- data/lib/chef/provider/remote_file.rb +141 -0
- data/lib/chef/provider/resource_update.rb +55 -0
- data/lib/chef/provider/route.rb +223 -0
- data/lib/chef/provider/ruby_block.rb +42 -0
- data/lib/chef/provider/script.rb +57 -0
- data/lib/chef/provider/service.rb +173 -0
- data/lib/chef/provider/service/arch.rb +113 -0
- data/lib/chef/provider/service/debian.rb +152 -0
- data/lib/chef/provider/service/freebsd.rb +175 -0
- data/lib/chef/provider/service/gentoo.rb +67 -0
- data/lib/chef/provider/service/init.rb +89 -0
- data/lib/chef/provider/service/insserv.rb +52 -0
- data/lib/chef/provider/service/invokercd.rb +35 -0
- data/lib/chef/provider/service/macosx.rb +144 -0
- data/lib/chef/provider/service/redhat.rb +77 -0
- data/lib/chef/provider/service/simple.rb +172 -0
- data/lib/chef/provider/service/solaris.rb +86 -0
- data/lib/chef/provider/service/systemd.rb +115 -0
- data/lib/chef/provider/service/upstart.rb +232 -0
- data/lib/chef/provider/service/windows.rb +163 -0
- data/lib/chef/provider/subversion.rb +214 -0
- data/lib/chef/provider/template.rb +120 -0
- data/lib/chef/provider/template_finder.rb +61 -0
- data/lib/chef/provider/user.rb +206 -0
- data/lib/chef/provider/user/dscl.rb +288 -0
- data/lib/chef/provider/user/pw.rb +113 -0
- data/lib/chef/provider/user/useradd.rb +144 -0
- data/lib/chef/provider/user/windows.rb +124 -0
- data/lib/chef/providers.rb +103 -0
- data/lib/chef/recipe.rb +135 -0
- data/lib/chef/reserved_names.rb +9 -0
- data/lib/chef/resource.rb +794 -0
- data/lib/chef/resource/apt_package.rb +43 -0
- data/lib/chef/resource/bash.rb +33 -0
- data/lib/chef/resource/breakpoint.rb +35 -0
- data/lib/chef/resource/chef_gem.rb +53 -0
- data/lib/chef/resource/conditional.rb +101 -0
- data/lib/chef/resource/cookbook_file.rb +52 -0
- data/lib/chef/resource/cron.rb +202 -0
- data/lib/chef/resource/csh.rb +33 -0
- data/lib/chef/resource/deploy.rb +403 -0
- data/lib/chef/resource/deploy_revision.rb +40 -0
- data/lib/chef/resource/directory.rb +65 -0
- data/lib/chef/resource/dpkg_package.rb +34 -0
- data/lib/chef/resource/easy_install_package.rb +57 -0
- data/lib/chef/resource/env.rb +63 -0
- data/lib/chef/resource/erl_call.rb +86 -0
- data/lib/chef/resource/execute.rb +132 -0
- data/lib/chef/resource/file.rb +96 -0
- data/lib/chef/resource/freebsd_package.rb +35 -0
- data/lib/chef/resource/gem_package.rb +53 -0
- data/lib/chef/resource/git.rb +46 -0
- data/lib/chef/resource/group.rb +83 -0
- data/lib/chef/resource/http_request.rb +65 -0
- data/lib/chef/resource/ifconfig.rb +149 -0
- data/lib/chef/resource/ips_package.rb +42 -0
- data/lib/chef/resource/link.rb +92 -0
- data/lib/chef/resource/log.rb +74 -0
- data/lib/chef/resource/lwrp_base.rb +127 -0
- data/lib/chef/resource/macports_package.rb +29 -0
- data/lib/chef/resource/mdadm.rb +105 -0
- data/lib/chef/resource/mount.rb +139 -0
- data/lib/chef/resource/ohai.rb +54 -0
- data/lib/chef/resource/package.rb +84 -0
- data/lib/chef/resource/pacman_package.rb +33 -0
- data/lib/chef/resource/perl.rb +33 -0
- data/lib/chef/resource/portage_package.rb +33 -0
- data/lib/chef/resource/python.rb +33 -0
- data/lib/chef/resource/registry_key.rb +86 -0
- data/lib/chef/resource/remote_directory.rb +126 -0
- data/lib/chef/resource/remote_file.rb +81 -0
- data/lib/chef/resource/route.rb +140 -0
- data/lib/chef/resource/rpm_package.rb +34 -0
- data/lib/chef/resource/ruby.rb +33 -0
- data/lib/chef/resource/ruby_block.rb +51 -0
- data/lib/chef/resource/scm.rb +151 -0
- data/lib/chef/resource/script.rb +63 -0
- data/lib/chef/resource/service.rb +178 -0
- data/lib/chef/resource/smartos_package.rb +36 -0
- data/lib/chef/resource/solaris_package.rb +36 -0
- data/lib/chef/resource/subversion.rb +37 -0
- data/lib/chef/resource/template.rb +76 -0
- data/lib/chef/resource/timestamped_deploy.rb +31 -0
- data/lib/chef/resource/user.rb +134 -0
- data/lib/chef/resource/yum_package.rb +63 -0
- data/lib/chef/resource_collection.rb +221 -0
- data/lib/chef/resource_collection/stepable_iterator.rb +124 -0
- data/lib/chef/resource_definition.rb +67 -0
- data/lib/chef/resource_definition_list.rb +38 -0
- data/lib/chef/resource_platform_map.rb +151 -0
- data/lib/chef/resource_reporter.rb +281 -0
- data/lib/chef/resources.rb +69 -0
- data/lib/chef/rest.rb +438 -0
- data/lib/chef/rest/auth_credentials.rb +57 -0
- data/lib/chef/rest/cookie_jar.rb +31 -0
- data/lib/chef/rest/rest_request.rb +229 -0
- data/lib/chef/role.rb +253 -0
- data/lib/chef/run_context.rb +214 -0
- data/lib/chef/run_context/cookbook_compiler.rb +280 -0
- data/lib/chef/run_list.rb +163 -0
- data/lib/chef/run_list/run_list_expansion.rb +191 -0
- data/lib/chef/run_list/run_list_item.rb +99 -0
- data/lib/chef/run_list/versioned_recipe_list.rb +68 -0
- data/lib/chef/run_lock.rb +90 -0
- data/lib/chef/run_status.rb +124 -0
- data/lib/chef/runner.rb +118 -0
- data/lib/chef/sandbox.rb +20 -0
- data/lib/chef/scan_access_control.rb +133 -0
- data/lib/chef/search/query.rb +65 -0
- data/lib/chef/shef/ext.rb +19 -0
- data/lib/chef/shell.rb +329 -0
- data/lib/chef/shell/ext.rb +593 -0
- data/lib/chef/shell/model_wrapper.rb +120 -0
- data/lib/chef/shell/shell_rest.rb +28 -0
- data/lib/chef/shell/shell_session.rb +298 -0
- data/lib/chef/shell_out.rb +13 -0
- data/lib/chef/streaming_cookbook_uploader.rb +201 -0
- data/lib/chef/tasks/chef_repo.rake +334 -0
- data/lib/chef/user.rb +182 -0
- data/lib/chef/util/file_edit.rb +132 -0
- data/lib/chef/util/windows.rb +56 -0
- data/lib/chef/util/windows/net_group.rb +101 -0
- data/lib/chef/util/windows/net_use.rb +121 -0
- data/lib/chef/util/windows/net_user.rb +198 -0
- data/lib/chef/util/windows/volume.rb +59 -0
- data/lib/chef/version.rb +23 -0
- data/lib/chef/version_class.rb +70 -0
- data/lib/chef/version_constraint.rb +116 -0
- data/lib/chef/win32/api.rb +364 -0
- data/lib/chef/win32/api/error.rb +921 -0
- data/lib/chef/win32/api/file.rb +535 -0
- data/lib/chef/win32/api/memory.rb +105 -0
- data/lib/chef/win32/api/process.rb +41 -0
- data/lib/chef/win32/api/psapi.rb +51 -0
- data/lib/chef/win32/api/security.rb +385 -0
- data/lib/chef/win32/api/system.rb +192 -0
- data/lib/chef/win32/api/unicode.rb +178 -0
- data/lib/chef/win32/error.rb +73 -0
- data/lib/chef/win32/file.rb +167 -0
- data/lib/chef/win32/file/info.rb +100 -0
- data/lib/chef/win32/handle.rb +55 -0
- data/lib/chef/win32/memory.rb +101 -0
- data/lib/chef/win32/process.rb +84 -0
- data/lib/chef/win32/registry.rb +382 -0
- data/lib/chef/win32/security.rb +508 -0
- data/lib/chef/win32/security/ace.rb +125 -0
- data/lib/chef/win32/security/acl.rb +101 -0
- data/lib/chef/win32/security/securable_object.rb +109 -0
- data/lib/chef/win32/security/security_descriptor.rb +93 -0
- data/lib/chef/win32/security/sid.rb +199 -0
- data/lib/chef/win32/security/token.rb +64 -0
- data/lib/chef/win32/unicode.rb +43 -0
- data/lib/chef/win32/version.rb +119 -0
- metadata +553 -3
@@ -0,0 +1,116 @@
|
|
1
|
+
# Author:: Seth Falcon (<seth@opscode.com>)
|
2
|
+
# Author:: Christopher Walters (<cw@opscode.com>)
|
3
|
+
# Copyright:: Copyright 2010-2011 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
require 'chef/version_class'
|
18
|
+
|
19
|
+
class Chef
|
20
|
+
class VersionConstraint
|
21
|
+
DEFAULT_CONSTRAINT = ">= 0.0.0"
|
22
|
+
STANDARD_OPS = %w(< > <= >=)
|
23
|
+
OPS = %w(< > = <= >= ~>)
|
24
|
+
PATTERN = /^(#{OPS.join('|')}) (.+)$/
|
25
|
+
|
26
|
+
attr_reader :op, :version
|
27
|
+
|
28
|
+
def initialize(constraint_spec=DEFAULT_CONSTRAINT)
|
29
|
+
case constraint_spec
|
30
|
+
when nil
|
31
|
+
parse(DEFAULT_CONSTRAINT)
|
32
|
+
when Array
|
33
|
+
parse_from_array(constraint_spec)
|
34
|
+
when String
|
35
|
+
parse(constraint_spec)
|
36
|
+
else
|
37
|
+
msg = "VersionConstraint should be created from a String. You gave: #{constraint_spec.inspect}"
|
38
|
+
raise Chef::Exceptions::InvalidVersionConstraint, msg
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def include?(v)
|
43
|
+
version = if v.respond_to? :version # a CookbookVersion-like object
|
44
|
+
Chef::Version.new(v.version.to_s)
|
45
|
+
else
|
46
|
+
Chef::Version.new(v.to_s)
|
47
|
+
end
|
48
|
+
do_op(version)
|
49
|
+
end
|
50
|
+
|
51
|
+
def inspect
|
52
|
+
"(#{@op} #{@version})"
|
53
|
+
end
|
54
|
+
|
55
|
+
def to_s
|
56
|
+
"#{@op} #{@version}"
|
57
|
+
end
|
58
|
+
|
59
|
+
def eql?(o)
|
60
|
+
o.class == self.class && @op == o.op && @version == o.version
|
61
|
+
end
|
62
|
+
alias_method :==, :eql?
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def do_op(other_version)
|
67
|
+
if STANDARD_OPS.include? @op
|
68
|
+
other_version.send(@op.to_sym, @version)
|
69
|
+
elsif @op == '='
|
70
|
+
other_version == @version
|
71
|
+
elsif @op == '~>'
|
72
|
+
if @missing_patch_level
|
73
|
+
(other_version.major == @version.major &&
|
74
|
+
other_version.minor >= @version.minor)
|
75
|
+
else
|
76
|
+
(other_version.major == @version.major &&
|
77
|
+
other_version.minor == @version.minor &&
|
78
|
+
other_version.patch >= @version.patch)
|
79
|
+
end
|
80
|
+
else # should never happen
|
81
|
+
raise "bad op #{@op}"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def parse_from_array(constraint_spec)
|
86
|
+
if constraint_spec.empty?
|
87
|
+
parse(DEFAULT_CONSTRAINT)
|
88
|
+
elsif constraint_spec.size == 1
|
89
|
+
parse(constraint_spec.first)
|
90
|
+
else
|
91
|
+
msg = "only one version constraint operation is supported, but you gave #{constraint_spec.size} "
|
92
|
+
msg << "['#{constraint_spec.join(', ')}']"
|
93
|
+
raise Chef::Exceptions::InvalidVersionConstraint, msg
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def parse(str)
|
98
|
+
@missing_patch_level = false
|
99
|
+
if str.index(" ").nil? && str =~ /^[0-9]/
|
100
|
+
# try for lone version, implied '='
|
101
|
+
@version = Chef::Version.new(str)
|
102
|
+
@op = "="
|
103
|
+
elsif PATTERN.match str
|
104
|
+
@op = $1
|
105
|
+
raw_version = $2
|
106
|
+
@version = Chef::Version.new(raw_version)
|
107
|
+
if raw_version.split('.').size == 2
|
108
|
+
@missing_patch_level = true
|
109
|
+
end
|
110
|
+
else
|
111
|
+
raise Chef::Exceptions::InvalidVersionConstraint, "'#{str}'"
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,364 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Seth Chisamore (<schisamo@opscode.com>)
|
3
|
+
# Author:: John Keiser (<jkeiser@opscode.com>)
|
4
|
+
# Copyright:: Copyright 2011 Opscode, Inc.
|
5
|
+
# License:: Apache License, Version 2.0
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'ffi'
|
21
|
+
require 'chef/reserved_names'
|
22
|
+
require 'chef/exceptions'
|
23
|
+
|
24
|
+
class Chef
|
25
|
+
module ReservedNames::Win32
|
26
|
+
module API
|
27
|
+
|
28
|
+
# Attempts to use FFI's attach_function method to link a native Win32
|
29
|
+
# function into the calling module. If this fails a dummy method is
|
30
|
+
# defined which when called, raises a helpful exception to the end-user.
|
31
|
+
def safe_attach_function(win32_func, *args)
|
32
|
+
begin
|
33
|
+
attach_function(win32_func.to_sym, *args)
|
34
|
+
rescue FFI::NotFoundError
|
35
|
+
define_method(win32_func.to_sym) do |*margs|
|
36
|
+
raise Chef::Exceptions::Win32APIFunctionNotImplemented, "This version of Windows does not implement the Win32 function [#{win32_func}]."
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# put shared stuff (like constants) for all raw Win32 API calls
|
42
|
+
def self.extended(host)
|
43
|
+
host.extend FFI::Library
|
44
|
+
host.extend Macros
|
45
|
+
|
46
|
+
host.ffi_convention :stdcall
|
47
|
+
|
48
|
+
# Windows-specific type defs (ms-help://MS.MSDNQTR.v90.en/winprog/winprog/windows_data_types.htm):
|
49
|
+
host.typedef :ushort, :ATOM # Atom ~= Symbol: Atom table stores strings and corresponding identifiers. Application
|
50
|
+
# places a string in an atom table and receives a 16-bit integer, called an atom, that
|
51
|
+
# can be used to access the string. Placed string is called an atom name.
|
52
|
+
# See: http://msdn.microsoft.com/en-us/library/ms648708%28VS.85%29.aspx
|
53
|
+
host.typedef :bool, :BOOL
|
54
|
+
host.typedef :bool, :BOOLEAN
|
55
|
+
host.typedef :uchar, :BYTE # Byte (8 bits). Declared as unsigned char
|
56
|
+
#CALLBACK: K, # Win32.API gem-specific ?? MSDN: #define CALLBACK __stdcall
|
57
|
+
host.typedef :char, :CHAR # 8-bit Windows (ANSI) character. See http://msdn.microsoft.com/en-us/library/dd183415%28VS.85%29.aspx
|
58
|
+
host.typedef :uint32, :COLORREF # Red, green, blue (RGB) color value (32 bits). See COLORREF for more info.
|
59
|
+
host.typedef :uint32, :DWORD # 32-bit unsigned integer. The range is 0 through 4,294,967,295 decimal.
|
60
|
+
host.typedef :uint64, :DWORDLONG # 64-bit unsigned integer. The range is 0 through 18,446,744,073,709,551,615 decimal.
|
61
|
+
host.typedef :ulong, :DWORD_PTR # Unsigned long type for pointer precision. Use when casting a pointer to a long type
|
62
|
+
# to perform pointer arithmetic. (Also commonly used for general 32-bit parameters that have
|
63
|
+
# been extended to 64 bits in 64-bit Windows.) BaseTsd.h: #host.typedef ULONG_PTR DWORD_PTR;
|
64
|
+
host.typedef :uint32, :DWORD32
|
65
|
+
host.typedef :uint64, :DWORD64
|
66
|
+
host.typedef :int, :HALF_PTR # Half the size of a pointer. Use within a structure that contains a pointer and two small fields.
|
67
|
+
# BaseTsd.h: #ifdef (_WIN64) host.typedef int HALF_PTR; #else host.typedef short HALF_PTR;
|
68
|
+
host.typedef :ulong, :HACCEL # (L) Handle to an accelerator table. WinDef.h: #host.typedef HANDLE HACCEL;
|
69
|
+
# See http://msdn.microsoft.com/en-us/library/ms645526%28VS.85%29.aspx
|
70
|
+
host.typedef :ulong, :HANDLE # (L) Handle to an object. WinNT.h: #host.typedef PVOID HANDLE;
|
71
|
+
# todo: Platform-dependent! Need to change to :uint64 for Win64
|
72
|
+
host.typedef :ulong, :HBITMAP # (L) Handle to a bitmap: http://msdn.microsoft.com/en-us/library/dd183377%28VS.85%29.aspx
|
73
|
+
host.typedef :ulong, :HBRUSH # (L) Handle to a brush. http://msdn.microsoft.com/en-us/library/dd183394%28VS.85%29.aspx
|
74
|
+
host.typedef :ulong, :HCOLORSPACE # (L) Handle to a color space. http://msdn.microsoft.com/en-us/library/ms536546%28VS.85%29.aspx
|
75
|
+
host.typedef :ulong, :HCURSOR # (L) Handle to a cursor. http://msdn.microsoft.com/en-us/library/ms646970%28VS.85%29.aspx
|
76
|
+
host.typedef :ulong, :HCONV # (L) Handle to a dynamic data exchange (DDE) conversation.
|
77
|
+
host.typedef :ulong, :HCONVLIST # (L) Handle to a DDE conversation list. HANDLE - L ?
|
78
|
+
host.typedef :ulong, :HDDEDATA # (L) Handle to DDE data (structure?)
|
79
|
+
host.typedef :ulong, :HDC # (L) Handle to a device context (DC). http://msdn.microsoft.com/en-us/library/dd183560%28VS.85%29.aspx
|
80
|
+
host.typedef :ulong, :HDESK # (L) Handle to a desktop. http://msdn.microsoft.com/en-us/library/ms682573%28VS.85%29.aspx
|
81
|
+
host.typedef :ulong, :HDROP # (L) Handle to an internal drop structure.
|
82
|
+
host.typedef :ulong, :HDWP # (L) Handle to a deferred window position structure.
|
83
|
+
host.typedef :ulong, :HENHMETAFILE #(L) Handle to an enhanced metafile. http://msdn.microsoft.com/en-us/library/dd145051%28VS.85%29.aspx
|
84
|
+
host.typedef :uint, :HFILE # (I) Special file handle to a file opened by OpenFile, not CreateFile.
|
85
|
+
# WinDef.h: #host.typedef int HFILE;
|
86
|
+
host.typedef :ulong, :HFONT # (L) Handle to a font. http://msdn.microsoft.com/en-us/library/dd162470%28VS.85%29.aspx
|
87
|
+
host.typedef :ulong, :HGDIOBJ # (L) Handle to a GDI object.
|
88
|
+
host.typedef :ulong, :HGLOBAL # (L) Handle to a global memory block.
|
89
|
+
host.typedef :ulong, :HHOOK # (L) Handle to a hook. http://msdn.microsoft.com/en-us/library/ms632589%28VS.85%29.aspx
|
90
|
+
host.typedef :ulong, :HICON # (L) Handle to an icon. http://msdn.microsoft.com/en-us/library/ms646973%28VS.85%29.aspx
|
91
|
+
host.typedef :ulong, :HINSTANCE # (L) Handle to an instance. This is the base address of the module in memory.
|
92
|
+
# HMODULE and HINSTANCE are the same today, but were different in 16-bit Windows.
|
93
|
+
host.typedef :ulong, :HKEY # (L) Handle to a registry key.
|
94
|
+
host.typedef :ulong, :HKL # (L) Input locale identifier.
|
95
|
+
host.typedef :ulong, :HLOCAL # (L) Handle to a local memory block.
|
96
|
+
host.typedef :ulong, :HMENU # (L) Handle to a menu. http://msdn.microsoft.com/en-us/library/ms646977%28VS.85%29.aspx
|
97
|
+
host.typedef :ulong, :HMETAFILE # (L) Handle to a metafile. http://msdn.microsoft.com/en-us/library/dd145051%28VS.85%29.aspx
|
98
|
+
host.typedef :ulong, :HMODULE # (L) Handle to an instance. Same as HINSTANCE today, but was different in 16-bit Windows.
|
99
|
+
host.typedef :ulong, :HMONITOR # (L) Рandle to a display monitor. WinDef.h: if(WINVER >= 0x0500) host.typedef HANDLE HMONITOR;
|
100
|
+
host.typedef :ulong, :HPALETTE # (L) Handle to a palette.
|
101
|
+
host.typedef :ulong, :HPEN # (L) Handle to a pen. http://msdn.microsoft.com/en-us/library/dd162786%28VS.85%29.aspx
|
102
|
+
host.typedef :long, :HRESULT # Return code used by COM interfaces. For more info, Structure of the COM Error Codes.
|
103
|
+
# To test an HRESULT value, use the FAILED and SUCCEEDED macros.
|
104
|
+
host.typedef :ulong, :HRGN # (L) Handle to a region. http://msdn.microsoft.com/en-us/library/dd162913%28VS.85%29.aspx
|
105
|
+
host.typedef :ulong, :HRSRC # (L) Handle to a resource.
|
106
|
+
host.typedef :ulong, :HSZ # (L) Handle to a DDE string.
|
107
|
+
host.typedef :ulong, :HWINSTA # (L) Handle to a window station. http://msdn.microsoft.com/en-us/library/ms687096%28VS.85%29.aspx
|
108
|
+
host.typedef :ulong, :HWND # (L) Handle to a window. http://msdn.microsoft.com/en-us/library/ms632595%28VS.85%29.aspx
|
109
|
+
host.typedef :int, :INT # 32-bit signed integer. The range is -2147483648 through 2147483647 decimal.
|
110
|
+
host.typedef :int, :INT_PTR # Signed integer type for pointer precision. Use when casting a pointer to an integer
|
111
|
+
# to perform pointer arithmetic. BaseTsd.h:
|
112
|
+
#if defined(_WIN64) host.typedef __int64 INT_PTR; #else host.typedef int INT_PTR;
|
113
|
+
host.typedef :int32, :INT32 # 32-bit signed integer. The range is -2,147,483,648 through +...647 decimal.
|
114
|
+
host.typedef :int64, :INT64 # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807
|
115
|
+
host.typedef :ushort, :LANGID # Language identifier. For more information, see Locales. WinNT.h: #host.typedef WORD LANGID;
|
116
|
+
# See http://msdn.microsoft.com/en-us/library/dd318716%28VS.85%29.aspx
|
117
|
+
host.typedef :uint32, :LCID # Locale identifier. For more information, see Locales.
|
118
|
+
host.typedef :uint32, :LCTYPE # Locale information type. For a list, see Locale Information Constants.
|
119
|
+
host.typedef :uint32, :LGRPID # Language group identifier. For a list, see EnumLanguageGroupLocales.
|
120
|
+
host.typedef :long, :LONG # 32-bit signed integer. The range is -2,147,483,648 through +...647 decimal.
|
121
|
+
host.typedef :int32, :LONG32 # 32-bit signed integer. The range is -2,147,483,648 through +...647 decimal.
|
122
|
+
host.typedef :int64, :LONG64 # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807
|
123
|
+
host.typedef :int64, :LONGLONG # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807
|
124
|
+
host.typedef :long, :LONG_PTR # Signed long type for pointer precision. Use when casting a pointer to a long to
|
125
|
+
# perform pointer arithmetic. BaseTsd.h:
|
126
|
+
#if defined(_WIN64) host.typedef __int64 LONG_PTR; #else host.typedef long LONG_PTR;
|
127
|
+
host.typedef :long, :LPARAM # Message parameter. WinDef.h as follows: #host.typedef LONG_PTR LPARAM;
|
128
|
+
host.typedef :pointer, :LPBOOL # Pointer to a BOOL. WinDef.h as follows: #host.typedef BOOL far *LPBOOL;
|
129
|
+
host.typedef :pointer, :LPBYTE # Pointer to a BYTE. WinDef.h as follows: #host.typedef BYTE far *LPBYTE;
|
130
|
+
host.typedef :pointer, :LPCOLORREF # Pointer to a COLORREF value. WinDef.h as follows: #host.typedef DWORD *LPCOLORREF;
|
131
|
+
host.typedef :pointer, :LPCSTR # Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.
|
132
|
+
# See Character Sets Used By Fonts. http://msdn.microsoft.com/en-us/library/dd183415%28VS.85%29.aspx
|
133
|
+
host.typedef :pointer, :LPCTSTR # An LPCWSTR if UNICODE is defined, an LPCSTR otherwise.
|
134
|
+
host.typedef :pointer, :LPCVOID # Pointer to a constant of any type. WinDef.h as follows: host.typedef CONST void *LPCVOID;
|
135
|
+
host.typedef :pointer, :LPCWSTR # Pointer to a constant null-terminated string of 16-bit Unicode characters.
|
136
|
+
host.typedef :pointer, :LPDWORD # Pointer to a DWORD. WinDef.h as follows: host.typedef DWORD *LPDWORD;
|
137
|
+
host.typedef :pointer, :LPHANDLE # Pointer to a HANDLE. WinDef.h as follows: host.typedef HANDLE *LPHANDLE;
|
138
|
+
host.typedef :pointer, :LPINT # Pointer to an INT.
|
139
|
+
host.typedef :pointer, :LPLONG # Pointer to an LONG.
|
140
|
+
host.typedef :pointer, :LPSECURITY_ATTRIBUTES # Pointer to SECURITY_ATTRIBUTES struct
|
141
|
+
host.typedef :pointer, :LPSTR # Pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
|
142
|
+
host.typedef :pointer, :LPTSTR # An LPWSTR if UNICODE is defined, an LPSTR otherwise.
|
143
|
+
host.typedef :pointer, :LPVOID # Pointer to any type.
|
144
|
+
host.typedef :pointer, :LPWORD # Pointer to a WORD.
|
145
|
+
host.typedef :pointer, :LPWSTR # Pointer to a null-terminated string of 16-bit Unicode characters.
|
146
|
+
host.typedef :long, :LRESULT # Signed result of message processing. WinDef.h: host.typedef LONG_PTR LRESULT;
|
147
|
+
host.typedef :pointer, :LPWIN32_FIND_DATA # Pointer to WIN32_FIND_DATA struct
|
148
|
+
host.typedef :pointer, :LPBY_HANDLE_FILE_INFORMATION # Point to a BY_HANDLE_FILE_INFORMATION struct
|
149
|
+
host.typedef :pointer, :PBOOL # Pointer to a BOOL.
|
150
|
+
host.typedef :pointer, :PBOOLEAN # Pointer to a BOOL.
|
151
|
+
host.typedef :pointer, :PBYTE # Pointer to a BYTE.
|
152
|
+
host.typedef :pointer, :PCHAR # Pointer to a CHAR.
|
153
|
+
host.typedef :pointer, :PCSTR # Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.
|
154
|
+
host.typedef :pointer, :PCTSTR # A PCWSTR if UNICODE is defined, a PCSTR otherwise.
|
155
|
+
host.typedef :pointer, :PCWSTR # Pointer to a constant null-terminated string of 16-bit Unicode characters.
|
156
|
+
host.typedef :pointer, :PDWORD # Pointer to a DWORD.
|
157
|
+
host.typedef :pointer, :PDWORDLONG # Pointer to a DWORDLONG.
|
158
|
+
host.typedef :pointer, :PDWORD_PTR # Pointer to a DWORD_PTR.
|
159
|
+
host.typedef :pointer, :PDWORD32 # Pointer to a DWORD32.
|
160
|
+
host.typedef :pointer, :PDWORD64 # Pointer to a DWORD64.
|
161
|
+
host.typedef :pointer, :PFLOAT # Pointer to a FLOAT.
|
162
|
+
host.typedef :pointer, :PHALF_PTR # Pointer to a HALF_PTR.
|
163
|
+
host.typedef :pointer, :PHANDLE # Pointer to a HANDLE.
|
164
|
+
host.typedef :pointer, :PHKEY # Pointer to an HKEY.
|
165
|
+
host.typedef :pointer, :PINT # Pointer to an INT.
|
166
|
+
host.typedef :pointer, :PINT_PTR # Pointer to an INT_PTR.
|
167
|
+
host.typedef :pointer, :PINT32 # Pointer to an INT32.
|
168
|
+
host.typedef :pointer, :PINT64 # Pointer to an INT64.
|
169
|
+
host.typedef :pointer, :PLCID # Pointer to an LCID.
|
170
|
+
host.typedef :pointer, :PLONG # Pointer to a LONG.
|
171
|
+
host.typedef :pointer, :PLONGLONG # Pointer to a LONGLONG.
|
172
|
+
host.typedef :pointer, :PLONG_PTR # Pointer to a LONG_PTR.
|
173
|
+
host.typedef :pointer, :PLONG32 # Pointer to a LONG32.
|
174
|
+
host.typedef :pointer, :PLONG64 # Pointer to a LONG64.
|
175
|
+
host.typedef :pointer, :PLUID # Pointer to a LUID.
|
176
|
+
host.typedef :pointer, :POINTER_32 # 32-bit pointer. On a 32-bit system, this is a native pointer. On a 64-bit system, this is a truncated 64-bit pointer.
|
177
|
+
host.typedef :pointer, :POINTER_64 # 64-bit pointer. On a 64-bit system, this is a native pointer. On a 32-bit system, this is a sign-extended 32-bit pointer.
|
178
|
+
host.typedef :pointer, :POINTER_SIGNED # A signed pointer.
|
179
|
+
host.typedef :pointer, :POINTER_UNSIGNED # An unsigned pointer.
|
180
|
+
host.typedef :pointer, :PSHORT # Pointer to a SHORT.
|
181
|
+
host.typedef :pointer, :PSIZE_T # Pointer to a SIZE_T.
|
182
|
+
host.typedef :pointer, :PSSIZE_T # Pointer to a SSIZE_T.
|
183
|
+
host.typedef :pointer, :PSTR # Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
|
184
|
+
host.typedef :pointer, :PTBYTE # Pointer to a TBYTE.
|
185
|
+
host.typedef :pointer, :PTCHAR # Pointer to a TCHAR.
|
186
|
+
host.typedef :pointer, :PTSTR # A PWSTR if UNICODE is defined, a PSTR otherwise.
|
187
|
+
host.typedef :pointer, :PUCHAR # Pointer to a UCHAR.
|
188
|
+
host.typedef :pointer, :PUHALF_PTR # Pointer to a UHALF_PTR.
|
189
|
+
host.typedef :pointer, :PUINT # Pointer to a UINT.
|
190
|
+
host.typedef :pointer, :PUINT_PTR # Pointer to a UINT_PTR.
|
191
|
+
host.typedef :pointer, :PUINT32 # Pointer to a UINT32.
|
192
|
+
host.typedef :pointer, :PUINT64 # Pointer to a UINT64.
|
193
|
+
host.typedef :pointer, :PULONG # Pointer to a ULONG.
|
194
|
+
host.typedef :pointer, :PULONGLONG # Pointer to a ULONGLONG.
|
195
|
+
host.typedef :pointer, :PULONG_PTR # Pointer to a ULONG_PTR.
|
196
|
+
host.typedef :pointer, :PULONG32 # Pointer to a ULONG32.
|
197
|
+
host.typedef :pointer, :PULONG64 # Pointer to a ULONG64.
|
198
|
+
host.typedef :pointer, :PUSHORT # Pointer to a USHORT.
|
199
|
+
host.typedef :pointer, :PVOID # Pointer to any type.
|
200
|
+
host.typedef :pointer, :PWCHAR # Pointer to a WCHAR.
|
201
|
+
host.typedef :pointer, :PWORD # Pointer to a WORD.
|
202
|
+
host.typedef :pointer, :PWSTR # Pointer to a null- terminated string of 16-bit Unicode characters.
|
203
|
+
# For more information, see Character Sets Used By Fonts.
|
204
|
+
host.typedef :ulong, :SC_HANDLE # (L) Handle to a service control manager database.
|
205
|
+
# See SCM Handles http://msdn.microsoft.com/en-us/library/ms685104%28VS.85%29.aspx
|
206
|
+
host.typedef :pointer, :SC_LOCK # Lock to a service control manager database. For more information, see SCM Handles.
|
207
|
+
host.typedef :ulong, :SERVICE_STATUS_HANDLE # (L) Handle to a service status value. See SCM Handles.
|
208
|
+
host.typedef :short, :SHORT # A 16-bit integer. The range is –32768 through 32767 decimal.
|
209
|
+
host.typedef :ulong, :SIZE_T # The maximum number of bytes to which a pointer can point. Use for a count that must span the full range of a pointer.
|
210
|
+
host.typedef :long, :SSIZE_T # Signed SIZE_T.
|
211
|
+
host.typedef :char, :TBYTE # A WCHAR if UNICODE is defined, a CHAR otherwise.TCHAR:
|
212
|
+
# http://msdn.microsoft.com/en-us/library/c426s321%28VS.80%29.aspx
|
213
|
+
host.typedef :char, :TCHAR # A WCHAR if UNICODE is defined, a CHAR otherwise.TCHAR:
|
214
|
+
host.typedef :uchar, :UCHAR # Unsigned CHAR (8 bit)
|
215
|
+
host.typedef :uint, :UHALF_PTR # Unsigned HALF_PTR. Use within a structure that contains a pointer and two small fields.
|
216
|
+
host.typedef :uint, :UINT # Unsigned INT. The range is 0 through 4294967295 decimal.
|
217
|
+
host.typedef :uint, :UINT_PTR # Unsigned INT_PTR.
|
218
|
+
host.typedef :uint32, :UINT32 # Unsigned INT32. The range is 0 through 4294967295 decimal.
|
219
|
+
host.typedef :uint64, :UINT64 # Unsigned INT64. The range is 0 through 18446744073709551615 decimal.
|
220
|
+
host.typedef :ulong, :ULONG # Unsigned LONG. The range is 0 through 4294967295 decimal.
|
221
|
+
host.typedef :ulong_long, :ULONGLONG # 64-bit unsigned integer. The range is 0 through 18446744073709551615 decimal.
|
222
|
+
host.typedef :ulong, :ULONG_PTR # Unsigned LONG_PTR.
|
223
|
+
host.typedef :uint32, :ULONG32 # Unsigned INT32. The range is 0 through 4294967295 decimal.
|
224
|
+
host.typedef :uint64, :ULONG64 # Unsigned LONG64. The range is 0 through 18446744073709551615 decimal.
|
225
|
+
host.typedef :pointer, :UNICODE_STRING # Pointer to some string structure??
|
226
|
+
host.typedef :ushort, :USHORT # Unsigned SHORT. The range is 0 through 65535 decimal.
|
227
|
+
host.typedef :ulong_long, :USN # Update sequence number (USN).
|
228
|
+
host.typedef :ushort, :WCHAR # 16-bit Unicode character. For more information, see Character Sets Used By Fonts.
|
229
|
+
# In WinNT.h: host.typedef wchar_t WCHAR;
|
230
|
+
#WINAPI: K, # Calling convention for system functions. WinDef.h: define WINAPI __stdcall
|
231
|
+
host.typedef :ushort, :WORD # 16-bit unsigned integer. The range is 0 through 65535 decimal.
|
232
|
+
host.typedef :uint, :WPARAM # Message parameter. WinDef.h as follows: host.typedef UINT_PTR WPARAM;
|
233
|
+
end
|
234
|
+
|
235
|
+
module Macros
|
236
|
+
|
237
|
+
###############################################
|
238
|
+
# winbase.h
|
239
|
+
###############################################
|
240
|
+
|
241
|
+
def LocalDiscard(pointer)
|
242
|
+
LocalReAlloc(pointer, 0, LMEM_MOVEABLE)
|
243
|
+
end
|
244
|
+
|
245
|
+
###############################################
|
246
|
+
# windef.h
|
247
|
+
###############################################
|
248
|
+
|
249
|
+
# Creates a WORD value by concatenating the specified values.
|
250
|
+
#
|
251
|
+
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms632663(v=VS.85).aspx
|
252
|
+
def MAKEWORD(low, high)
|
253
|
+
((low & 0xff) | (high & 0xff)) << 8
|
254
|
+
end
|
255
|
+
|
256
|
+
# Creates a LONG value by concatenating the specified values.
|
257
|
+
#
|
258
|
+
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms632660(v=vs.85).aspx
|
259
|
+
def MAKELONG(low, high)
|
260
|
+
((low & 0xffff) | (high & 0xffff)) << 16
|
261
|
+
end
|
262
|
+
|
263
|
+
# Retrieves the low-order word from the specified value.
|
264
|
+
#
|
265
|
+
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms632659(v=VS.85).aspx
|
266
|
+
def LOWORD(l)
|
267
|
+
l & 0xffff
|
268
|
+
end
|
269
|
+
|
270
|
+
# Retrieves the high-order word from the specified 32-bit value.
|
271
|
+
#
|
272
|
+
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms632657(v=VS.85).aspx
|
273
|
+
def HIWORD(l)
|
274
|
+
l >> 16
|
275
|
+
end
|
276
|
+
|
277
|
+
# Retrieves the low-order byte from the specified value.
|
278
|
+
#
|
279
|
+
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms632658(v=VS.85).aspx
|
280
|
+
def LOBYTE(w)
|
281
|
+
w & 0xff
|
282
|
+
end
|
283
|
+
|
284
|
+
# Retrieves the high-order byte from the given 16-bit value.
|
285
|
+
#
|
286
|
+
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms632656(v=VS.85).aspx
|
287
|
+
def HIBYTE(w)
|
288
|
+
w >> 8
|
289
|
+
end
|
290
|
+
|
291
|
+
###############################################
|
292
|
+
# winerror.h
|
293
|
+
###############################################
|
294
|
+
|
295
|
+
def IS_ERROR(status)
|
296
|
+
status >> 31 == 1
|
297
|
+
end
|
298
|
+
|
299
|
+
def MAKE_HRESULT(sev, fac, code)
|
300
|
+
sev << 31 | fac << 16 | code
|
301
|
+
end
|
302
|
+
|
303
|
+
def MAKE_SCODE(sev, fac, code)
|
304
|
+
sev << 31 | fac << 16 | code
|
305
|
+
end
|
306
|
+
|
307
|
+
def HRESULT_CODE(hr)
|
308
|
+
hr & 0xFFFF
|
309
|
+
end
|
310
|
+
|
311
|
+
def HRESULT_FACILITY(hr)
|
312
|
+
(hr >> 16) & 0x1fff
|
313
|
+
end
|
314
|
+
|
315
|
+
def HRESULT_FROM_NT(x)
|
316
|
+
x | 0x10000000 # FACILITY_NT_BIT
|
317
|
+
end
|
318
|
+
|
319
|
+
def HRESULT_FROM_WIN32(x)
|
320
|
+
if x <= 0
|
321
|
+
x
|
322
|
+
else
|
323
|
+
(x & 0x0000FFFF) | (7 << 16) | 0x80000000
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
def HRESULT_SEVERITY(hr)
|
328
|
+
(hr >> 31) & 0x1
|
329
|
+
end
|
330
|
+
|
331
|
+
def FAILED(status)
|
332
|
+
status < 0
|
333
|
+
end
|
334
|
+
|
335
|
+
def SUCCEEDED(status)
|
336
|
+
status >= 0
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
# Represents a 64-bit unsigned integer value.
|
341
|
+
#
|
342
|
+
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa383742(v=vs.85).aspx
|
343
|
+
def make_uint64(low, high)
|
344
|
+
low + (high * (2**32))
|
345
|
+
end
|
346
|
+
|
347
|
+
# http://blogs.msdn.com/b/oldnewthing/archive/2009/03/06/9461176.aspx
|
348
|
+
# January 1, 1601
|
349
|
+
WIN32_EPOC_MINUS_POSIX_EPOC = 116444736000000000
|
350
|
+
|
351
|
+
# Convert 64-bit FILETIME integer into Time object.
|
352
|
+
#
|
353
|
+
# FILETIME structure contains a 64-bit value representing the number
|
354
|
+
# of 100-nanosecond intervals since January 1, 1601 (UTC).
|
355
|
+
#
|
356
|
+
# http://msdn.microsoft.com/en-us/library/ms724284(VS.85).aspx
|
357
|
+
#
|
358
|
+
def wtime_to_time(wtime)
|
359
|
+
Time.at((wtime - WIN32_EPOC_MINUS_POSIX_EPOC) / 10000000)
|
360
|
+
end
|
361
|
+
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|