Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Commit

Permalink
support Chef::Node::Attribute methods
Browse files Browse the repository at this point in the history
Chef::Node delegates to Chef::Node::Attribute through method_missing
without implementing respond_to_missing or even responds_to?, so we have
to hack it up here.

Also looks like I snuck in bumping the default chef version to 12.4.1 in
this commit.
  • Loading branch information
lamont-granquist committed Sep 10, 2015
1 parent 4b05245 commit 7a3d03b
Show file tree
Hide file tree
Showing 25 changed files with 2,625 additions and 25 deletions.
4 changes: 3 additions & 1 deletion chef_dsl_metadata/Rakefile
Expand Up @@ -19,14 +19,16 @@ def require_chef
end

def chef_dsl_methods
# FIXME: `default` is not valid (in Chef-12 anyway) in a recipe, you must use
# node.default so adding Chef::Node.public_instance_methods here seems wrong
(Chef::Node.public_instance_methods +
chef_dsl_module.included_modules.map do |mixin|
mixin.public_instance_methods
end).flatten.sort.uniq
end

def chef_node_methods
Chef::Node.public_instance_methods.flatten.sort.uniq
(Chef::Node.public_instance_methods + Chef::Node::Attribute.public_instance_methods).flatten.sort.uniq
end

def chef_resource_actions
Expand Down
117 changes: 116 additions & 1 deletion chef_dsl_metadata/chef_11.10.0.json
Expand Up @@ -156,56 +156,112 @@
"===",
"=~",
"[]",
"[]=",
"__id__",
"__send__",
"all?",
"any?",
"apply_expansion_attributes",
"assoc",
"attribute",
"attribute?",
"attributes",
"automatic",
"automatic=",
"automatic_attrs",
"automatic_attrs=",
"chef_environment",
"chef_environment=",
"chef_server_rest",
"chunk",
"class",
"class_from_file",
"clear",
"clone",
"collect",
"collect_concat",
"combined_default",
"combined_override",
"compare_by_identity",
"compare_by_identity?",
"construct_attributes",
"consume_attributes",
"consume_external_attrs",
"consume_run_list",
"convert_to_class_name",
"convert_to_snake_case",
"count",
"create",
"cycle",
"debug_value",
"default",
"default!",
"default=",
"default_attrs",
"default_attrs=",
"default_proc",
"default_proc=",
"default_unless",
"define_singleton_method",
"delete",
"delete_if",
"destroy",
"detect",
"display",
"display_hash",
"drop",
"drop_while",
"dup",
"each",
"each_attribute",
"each_cons",
"each_entry",
"each_key",
"each_pair",
"each_slice",
"each_value",
"each_with_index",
"each_with_object",
"empty?",
"entries",
"enum_for",
"env_default",
"env_default=",
"env_override",
"env_override=",
"environment",
"eql?",
"equal?",
"except",
"expand!",
"extend",
"fetch",
"filename_to_qualified_string",
"find",
"find_all",
"find_index",
"first",
"flat_map",
"flatten",
"for_json",
"force_default",
"force_default=",
"force_override",
"force_override=",
"freeze",
"from_file",
"frozen?",
"gem",
"grep",
"group_by",
"has_key?",
"has_value?",
"hash",
"immutablize",
"include?",
"include_attribute",
"index",
"inject",
"inspect",
"instance_eval",
"instance_exec",
Expand All @@ -214,30 +270,50 @@
"instance_variable_get",
"instance_variable_set",
"instance_variables",
"invert",
"is_a?",
"itself",
"keep_if",
"key",
"key?",
"keys",
"kind_of?",
"lazy",
"length",
"loaded_recipe",
"map",
"max",
"max_by",
"member?",
"merge",
"merge!",
"merged_attributes",
"method",
"method_missing",
"methods",
"min",
"min_by",
"minmax",
"minmax_by",
"name",
"nil?",
"node",
"none?",
"normal",
"normal=",
"normal_attrs",
"normal_attrs=",
"normal_unless",
"object_id",
"one?",
"override",
"override!",
"override=",
"override_attrs",
"override_attrs=",
"override_unless",
"parse_attribute_file_spec",
"partition",
"platform?",
"platform_family?",
"pretty_inspect",
Expand All @@ -251,13 +327,28 @@
"public_method",
"public_methods",
"public_send",
"rassoc",
"recipe?",
"recipe_list",
"recipe_list=",
"reduce",
"regular_update",
"regular_writer",
"rehash",
"reject",
"reject!",
"remove_instance_variable",
"replace",
"reset",
"reset_cache",
"reset_defaults_and_overrides",
"respond_to?",
"reverse_each",
"role?",
"role_default",
"role_default=",
"role_override",
"role_override=",
"run_context",
"run_context=",
"run_list",
Expand All @@ -266,34 +357,58 @@
"run_state",
"run_state=",
"save",
"select",
"select!",
"send",
"set",
"set_or_return",
"set_unless",
"set_unless?",
"set_unless_value_present=",
"shift",
"singleton_class",
"singleton_method",
"singleton_methods",
"size",
"slice_after",
"slice_before",
"slice_when",
"snake_case_basename",
"sort",
"sort_by",
"store",
"stringify_keys!",
"symbolize_keys",
"systemu",
"tag",
"tags",
"taint",
"tainted?",
"take",
"take_while",
"tap",
"to_a",
"to_enum",
"to_h",
"to_hash",
"to_json",
"to_s",
"to_set",
"to_yaml",
"to_yaml_properties",
"trust",
"untaint",
"untrust",
"untrusted?",
"update",
"update_from!",
"validate",
"value?",
"value_for_platform",
"value_for_platform_family"
"value_for_platform_family",
"values",
"values_at",
"zip"
],
"actions": {
"apt_package": [
Expand Down

0 comments on commit 7a3d03b

Please sign in to comment.