{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef/pulls/comments/31980754","id":31980754,"diff_hunk":"@@ -877,142 +877,144 @@ def after_created\n       nil\n     end\n \n-    # Provider lookup and naming\n-    class<<self\n-      #\n-      # The DSL name of this resource (e.g. `package` or `yum_package`)\n-      #\n-      # @return [String] The DSL name of this resource.\n-      #\n-      # @deprecated Use resource_name instead.\n-      #\n-      def dsl_name\n-        Chef::Log.deprecation \"Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.\"\n-        if name\n-          name = self.name.split('::')[-1]\n-          convert_to_snake_case(name)\n-        end\n+    #\n+    # The DSL name of this resource (e.g. `package` or `yum_package`)\n+    #\n+    # @return [String] The DSL name of this resource.\n+    #\n+    # @deprecated Use resource_name instead.\n+    #\n+    def self.dsl_name\n+      Chef::Log.deprecation \"Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.\"\n+      if name\n+        name = self.name.split('::')[-1]\n+        convert_to_snake_case(name)\n       end\n+    end\n \n-      #\n-      # The display name of this resource type, for printing purposes.\n-      #\n-      # This also automatically calls \"provides\" to provide DSL with the given\n-      # name.\n-      #\n-      # @param value [Symbol] The desired name of this resource type (e.g.\n-      #   `execute`).\n-      #\n-      # @return [Symbol] The name of this resource type (e.g. `:execute`).\n-      #\n-      def resource_name(value=NULL_ARG)\n-        if value != NULL_ARG\n-          @resource_name = value.to_sym\n-          provides self.resource_name\n-        end\n-        # Backcompat: set resource name for classes in Chef::Resource automatically\n-        if !@resource_name && self.name\n-          chef, resource, class_name, *extra = self.name.split('::')\n-          if chef == 'Chef' && resource == 'Resource' && extra.size == 0\n-            @resource_name = convert_to_snake_case(self.name.split('::')[-1])\n+    #\n+    # The display name of this resource type, for printing purposes.\n+    #\n+    # This also automatically calls \"provides\" to provide DSL with the given\n+    # name.\n+    #\n+    # resource_name defaults to your class name.\n+    #\n+    # Call `resource_name nil` to remove the resource name (and any\n+    # corresponding DSL).\n+    #\n+    # @param value [Symbol] The desired name of this resource type (e.g.\n+    #   `execute`), or `nil` if this class is abstract and has no resource_name.\n+    #\n+    # @return [Symbol] The name of this resource type (e.g. `:execute`).\n+    #\n+    def self.resource_name(name=NULL_ARG)\n+      # Setter\n+      if name != NULL_ARG\n+        remove_canonical_dsl\n+\n+        # Set the resource_name and call provides\n+        if name\n+          name = name.to_sym\n+          # If our class is not already providing this name, provide it.\n+          if !Chef::ResourceResolver.list(name).include?(self)\n+            provides name, canonical: true\n           end\n+          @resource_name = name\n+        else\n+          @resource_name = nil\n         end\n-        @resource_name\n-      end\n-      alias :resource_name= :resource_name\n-\n-      #\n-      # Use the class name as the resource name.\n-      #\n-      # Munges the last part of the class name from camel case to snake case,\n-      # and sets the resource_name to that:\n-      #\n-      # A::B::BlahDBlah -> blah_d_blah\n-      #\n-      def use_automatic_resource_name\n-        automatic_name = convert_to_snake_case(self.name.split('::')[-1])\n-        resource_name automatic_name\n-      end\n-\n-      #\n-      # The module where Chef should look for providers for this resource.\n-      # The provider for `MyResource` will be looked up using\n-      # `provider_base::MyResource`.  Defaults to `Chef::Provider`.\n-      #\n-      # @param arg [Module] The module containing providers for this resource\n-      # @return [Module] The module containing providers for this resource\n-      #\n-      # @example\n-      #   class MyResource < Chef::Resource\n-      #     provider_base Chef::Provider::Deploy\n-      #     # ...other stuff\n-      #   end\n-      #\n-      # @deprecated Use `provides` on the provider, or `provider` on the resource, instead.\n-      #\n-      def provider_base(arg=nil)\n-        if arg\n-          Chef::Log.deprecation(\"Resource.provider_base is deprecated and will be removed in Chef 13. Use provides on the provider, or provider on the resource, instead.\")\n+      else\n+        # set resource_name automatically if it's not set","path":"lib/chef/resource.rb","position":124,"original_position":124,"commit_id":"d795db97bb8a79b179cd2f61355f04a856df3bd8","original_commit_id":"d795db97bb8a79b179cd2f61355f04a856df3bd8","user":{"login":"jdmundrawala","id":27443,"avatar_url":"https://avatars.githubusercontent.com/u/27443?v=3","gravatar_id":"","url":"https://api.github.com/users/jdmundrawala","html_url":"https://github.com/jdmundrawala","followers_url":"https://api.github.com/users/jdmundrawala/followers","following_url":"https://api.github.com/users/jdmundrawala/following{/other_user}","gists_url":"https://api.github.com/users/jdmundrawala/gists{/gist_id}","starred_url":"https://api.github.com/users/jdmundrawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdmundrawala/subscriptions","organizations_url":"https://api.github.com/users/jdmundrawala/orgs","repos_url":"https://api.github.com/users/jdmundrawala/repos","events_url":"https://api.github.com/users/jdmundrawala/events{/privacy}","received_events_url":"https://api.github.com/users/jdmundrawala/received_events","type":"User","site_admin":false},"body":"I was going to ask if this is the place where the automagic happens, but it seems you've left a comment to tell me that","created_at":"2015-06-09T03:35:51Z","updated_at":"2015-06-09T03:35:51Z","html_url":"https://github.com/chef/chef/pull/3495#discussion_r31980754","pull_request_url":"https://api.github.com/repos/chef/chef/pulls/3495","_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/comments/31980754"},"html":{"href":"https://github.com/chef/chef/pull/3495#discussion_r31980754"},"pull_request":{"href":"https://api.github.com/repos/chef/chef/pulls/3495"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/3495","id":37055304,"html_url":"https://github.com/chef/chef/pull/3495","diff_url":"https://github.com/chef/chef/pull/3495.diff","patch_url":"https://github.com/chef/chef/pull/3495.patch","issue_url":"https://api.github.com/repos/chef/chef/issues/3495","number":3495,"state":"open","locked":false,"title":"Remove use_automatic_resource_name, make resource_name automatic","user":{"login":"jkeiser","id":654882,"avatar_url":"https://avatars.githubusercontent.com/u/654882?v=3","gravatar_id":"","url":"https://api.github.com/users/jkeiser","html_url":"https://github.com/jkeiser","followers_url":"https://api.github.com/users/jkeiser/followers","following_url":"https://api.github.com/users/jkeiser/following{/other_user}","gists_url":"https://api.github.com/users/jkeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeiser/subscriptions","organizations_url":"https://api.github.com/users/jkeiser/orgs","repos_url":"https://api.github.com/users/jkeiser/repos","events_url":"https://api.github.com/users/jkeiser/events{/privacy}","received_events_url":"https://api.github.com/users/jkeiser/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-05T18:03:05Z","updated_at":"2015-06-09T03:35:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7935af840d3a94841f0b9f15e43473fae631969","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef/pulls/3495/commits","review_comments_url":"https://api.github.com/repos/chef/chef/pulls/3495/comments","review_comment_url":"https://api.github.com/repos/chef/chef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef/issues/3495/comments","statuses_url":"https://api.github.com/repos/chef/chef/statuses/d795db97bb8a79b179cd2f61355f04a856df3bd8","head":{"label":"chef:jk/automatic-automatic-name","ref":"jk/automatic-automatic-name","sha":"d795db97bb8a79b179cd2f61355f04a856df3bd8","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":108278,"name":"chef","full_name":"chef/chef","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":false,"url":"https://api.github.com/repos/chef/chef","forks_url":"https://api.github.com/repos/chef/chef/forks","keys_url":"https://api.github.com/repos/chef/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef/teams","hooks_url":"https://api.github.com/repos/chef/chef/hooks","issue_events_url":"https://api.github.com/repos/chef/chef/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef/events","assignees_url":"https://api.github.com/repos/chef/chef/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef/tags","blobs_url":"https://api.github.com/repos/chef/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef/languages","stargazers_url":"https://api.github.com/repos/chef/chef/stargazers","contributors_url":"https://api.github.com/repos/chef/chef/contributors","subscribers_url":"https://api.github.com/repos/chef/chef/subscribers","subscription_url":"https://api.github.com/repos/chef/chef/subscription","commits_url":"https://api.github.com/repos/chef/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef/merges","archive_url":"https://api.github.com/repos/chef/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef/downloads","issues_url":"https://api.github.com/repos/chef/chef/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef/releases{/id}","created_at":"2009-01-15T20:40:48Z","updated_at":"2015-06-08T18:04:39Z","pushed_at":"2015-06-08T22:47:06Z","git_url":"git://github.com/chef/chef.git","ssh_url":"git@github.com:chef/chef.git","clone_url":"https://github.com/chef/chef.git","svn_url":"https://github.com/chef/chef","homepage":"http://www.chef.io/chef/","size":166125,"stargazers_count":3657,"watchers_count":3657,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1487,"mirror_url":null,"open_issues_count":440,"forks":1487,"open_issues":440,"watchers":3657,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"8d4e9d44995d6f7de5a0b681616ed8241e39ece3","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":108278,"name":"chef","full_name":"chef/chef","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":false,"url":"https://api.github.com/repos/chef/chef","forks_url":"https://api.github.com/repos/chef/chef/forks","keys_url":"https://api.github.com/repos/chef/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef/teams","hooks_url":"https://api.github.com/repos/chef/chef/hooks","issue_events_url":"https://api.github.com/repos/chef/chef/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef/events","assignees_url":"https://api.github.com/repos/chef/chef/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef/tags","blobs_url":"https://api.github.com/repos/chef/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef/languages","stargazers_url":"https://api.github.com/repos/chef/chef/stargazers","contributors_url":"https://api.github.com/repos/chef/chef/contributors","subscribers_url":"https://api.github.com/repos/chef/chef/subscribers","subscription_url":"https://api.github.com/repos/chef/chef/subscription","commits_url":"https://api.github.com/repos/chef/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef/merges","archive_url":"https://api.github.com/repos/chef/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef/downloads","issues_url":"https://api.github.com/repos/chef/chef/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef/releases{/id}","created_at":"2009-01-15T20:40:48Z","updated_at":"2015-06-08T18:04:39Z","pushed_at":"2015-06-08T22:47:06Z","git_url":"git://github.com/chef/chef.git","ssh_url":"git@github.com:chef/chef.git","clone_url":"https://github.com/chef/chef.git","svn_url":"https://github.com/chef/chef","homepage":"http://www.chef.io/chef/","size":166125,"stargazers_count":3657,"watchers_count":3657,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1487,"mirror_url":null,"open_issues_count":440,"forks":1487,"open_issues":440,"watchers":3657,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/3495"},"html":{"href":"https://github.com/chef/chef/pull/3495"},"issue":{"href":"https://api.github.com/repos/chef/chef/issues/3495"},"comments":{"href":"https://api.github.com/repos/chef/chef/issues/3495/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef/pulls/3495/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef/pulls/3495/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef/statuses/d795db97bb8a79b179cd2f61355f04a856df3bd8"}}}}