lib/java/artifact.rb in buildr-0.22.0 vs lib/java/artifact.rb in buildr-1.0.0
- old
+ new
@@ -160,10 +160,11 @@
# * It will always return a new specs hash.
def to_hash(spec)
if spec.respond_to?(:to_spec)
to_hash spec.to_spec
elsif Hash === spec
+ rake_check_options spec, :id, :group, :type, :classifier, :version
# Sanitize the hash and check it's valid.
spec = ARTIFACT_ATTRIBUTES.inject({}) { |h, k| h[k] = spec[k].to_s if spec[k] ; h }
fail "Missing group identifier for #{spec.inspect}" if spec[:group].blank?
fail "Missing artifact identifier for #{spec.inspect}" if spec[:id].blank?
fail "Missing version for #{spec.inspect}" if spec[:version].blank?
@@ -254,10 +255,10 @@
#
# Returns the path to the local repository.
#
# The default path is .m2/repository relative to the home directory.
def local()
- @local ||= ENV["local_repo"] || File.join(ENV["HOME"], ".m2/repository")
+ @local ||= ENV["local_repo"] || File.join(Gem::user_home, ".m2/repository")
end
# :call-seq:
# local = path
#