lib/gemsmith/gem/specification.rb in gemsmith-11.3.0 vs lib/gemsmith/gem/specification.rb in gemsmith-12.0.0
- old
+ new
@@ -20,10 +20,12 @@
def self.find_all name, requirement: Gem::Requirement.new.to_s
specification.find_all_by_name name, requirement
end
+ attr_reader :version
+
def initialize file_path
@file_path = file_path
@spec = self.class.specification.load file_path
validate
@version = Versionaire::Version @spec.version.to_s
@@ -47,28 +49,20 @@
def allowed_push_host
spec.metadata.fetch("allowed_push_host") { self.class.default_gem_host }
end
- def version_number
- version.to_s
- end
-
- def version_label
- version.label
- end
-
def package_file_name
- "#{name}-#{version_number}.gem"
+ "#{name}-#{version}.gem"
end
def package_path
File.join "pkg", package_file_name
end
private
- attr_reader :file_path, :spec, :version
+ attr_reader :file_path, :spec
def validate
return if spec.is_a?(self.class.specification)
fail(Errors::Specification, %(Unknown gem specification: "#{file_path}".))
end