Chapter 09/circuit-oneops-1-master/components/cookbooks/artifact/providers/deploy.rb
# Returns the filename of the artifact being installed when the LWRP
# is called. Depending on how the resource is called in a recipe, the
# value returned by this method will change. If Chef::Artifact.from_nexus?, return the
# concatination of "artifact_id-version.extension" otherwise return the
# basename of where the artifact is located.
#
# @example
#   When: new_resource.artifact_location => "com.artifact:my-artifact:1.0.0:tgz"
#     artifact_filename => "my-artifact-1.0.0.tgz"
#   When: new_resource.artifact_location => "http://some-site.com/my-artifact.jar"
#     artifact_filename => "my-artifact.jar"
#
# @return [String] the artifacts filename
Returns the filename of the artifact being installed when the LWRP
is called. Depending on how the resource is called in a recipe, the
value returned by this method will change. If Chef::Artifact.from_nexus?, return the
concatination of "artifact_id-version.extension" otherwise return the
basename of where the artifact is located.
Returns the filename of the artifact being installed when the LWRP is called . Depending on how the resource is called in a recipe the value returned by this method will change . If Chef :: Artifact . from_nexus? return the concatination of " artifact_id - version . extension " otherwise return the basename of where the artifact is located .
def artifact_filename
  if Chef::Artifact.from_nexus?(new_resource.artifact_location)
    group_id, artifact_id, version, extension = artifact_location.split(":")
    unless extension
      extension = "jar"
    end
    "#{artifact_id}-#{version}.#{extension}"
  else
    ::File.basename(artifact_location)
  end
end
def artifact_filename if Chef :: Artifact . from_nexus? ( new_resource . artifact_location ) group_id , artifact_id , version , extension = artifact_location . split ( ":" ) unless extension extension = "jar" end "#{artifact_id}-#{version}.#{extension}" else :: File . basename ( artifact_location ) end end
Returns the filename of the artifact being installed when the LWRP
is called.
Returns the filename of the artifact being installed when the LWRP is called .
the artifacts filename
the artifacts filename
String
example
None