lib/gem2rpm.rb in gem2rpm-0.11.1 vs lib/gem2rpm.rb in gem2rpm-0.11.2
- old
+ new
@@ -9,11 +9,11 @@
require 'gem2rpm/template'
module Gem2Rpm
extend Gem2Rpm::TemplateHelpers
- Gem2Rpm::VERSION = "0.11.1"
+ Gem2Rpm::VERSION = "0.11.2"
class Exception < RuntimeError; end
class DownloadUrlError < Exception; end
OPEN_MODE = # :nodoc:
@@ -39,12 +39,12 @@
end
download_path
end
- def Gem2Rpm.convert(fname, template=RUBYGEM_TEMPLATE, out=$stdout,
- nongem=true, local=false, doc_subpackage = true)
+ def Gem2Rpm.convert(fname, template, out=$stdout, nongem=true, local=false,
+ doc_subpackage = true)
package = Gem2Rpm::Package.new(fname)
# Deprecate, kept just for backward compatibility.
format = Gem2Rpm::Format.new(package)
spec = Gem2Rpm::Specification.new(package.spec)
config = Gem2Rpm::Configuration.instance.to_default
@@ -80,13 +80,16 @@
end
packager
end
- RUBYGEM_TEMPLATE = Template.new(File.join(Template::default_location, "#{Distro.nature.to_s}.spec.erb"))
- VAGRANT_PLUGIN_TEMPLATE = begin
+ def self.rubygem_template
+ Template.new(File.join(Template::default_location, "#{Distro.nature.to_s}.spec.erb"))
+ end
+
+ def self.vagrant_plugin_template
file = File.join(Template::default_location, "#{Distro.nature.to_s}-vagrant-plugin.spec.erb")
- Template.new(file) if File.exist? file
+ Template.new(file)
end
end
# Local Variables: