def try_sources(*sources)
      segment =
        if sources.last.is_a?(Symbol)
          sources.pop
        else
          case self
          when Chef::Resource::Template
            :templates
          when Chef::Resource::CookbookFile
            :files
          else
            raise RuntimeError, "Please provide :templates or :files as last argument"
          end
        end
      sources.find do |source|
        if source =~ /::/
          ckbk, src = $`, $'
        else
          ckbk, src = cookbook_name, source
        end
        has_source?(src, segment, ckbk)
      end
    end
def try_sources(*sources)
      segment =
        if sources.last.is_a?(Symbol)
          sources.pop
        else
          case self
          when Chef::Resource::Template
            :templates
          when Chef::Resource::CookbookFile
            :files
          else
            raise RuntimeError, "Please provide :templates or :files as last argument"
          end
        end
      sources.find do |source|
        if source =~ /::/
          ckbk, src = $`, $'
        else
          ckbk, src = cookbook_name, source
        end
        has_source?(src, segment, ckbk)
      end
    end
For a list of sources, returns first source that exist
 @param [Array<String>] sources list of source (template source
     or cookbook file) names to look for. Source name can include
     a cookbook name, e.g. `"mysql::my.cnf.erb"`

     Last parameter can be a `:templates` or `:files` keword, to
     indicate what kind of source to look for. If it is ommitted,
     and method is called in a `template` or `cookbook_file`
     resource block, it is automatically guessed; otherwise,
     `RuntimeError` is raised.