0
我有一个Gemfile作为rails应用程序的一部分,我将其转换为gem。如何编写Gemspec,当宝石的主类名称不同时?
gem "jruby-openssl", "0.7.4"
gem "nokogiri"
gem 'xml-simple', :require => 'xmlsimple'
gem "httpclient"
我怎样写的.gemspec文件,我从这个创造宝石? 我写的gemspec看起来像这样。
Gem::Specification.new do |s|
s.name = "my_gem"
s.platform = Gem::Platform::RUBY
s.authors = [""]
s.email = [""]
s.homepage = ""
s.summary = %q{MyGem}
s.description = %q{MyGem}
s.files = Dir["{app,lib,config,public,db}/**/*"] + ["Rakefile", "Gemfile"]
s.require_paths = ["lib"]
s.add_dependency 'nokogiri', '>= 1.5.0'
s.add_dependency('xml-simple')
s.add_dependency 'httpclient'
end
然而,xmlsimple对象不叫,因为,附加依赖不能采取相同的参数作为一个普通宝石的呼叫。 如何编写gemspec来调用xmlsimple,就像它在Gemfile中完成一样?