降低宝石依赖性(Degrade a Gem Dependencies)
twitter.gemspec文件是
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'twitter/version' Gem::Specification.new do |spec| spec.add_dependency 'faraday', ['~> 0.8', '< 0.10'] spec.add_dependency 'multi_json', '~> 1.0' spec.add_dependency 'simple_oauth', '~> 0.2' spec.add_development_dependency 'bundler', '~> 1.0' spec.authors = ["John Nunemaker", "Wynn Netherland", "Erik Michaels-Ober", "Steve Richert", "Steve Agalloco"] spec.cert_chain = ['certs/sferik.pem'] spec.description = %q{A Ruby interface to the Twitter API.} spec.email = ['nunemaker@gmail.com', 'wynn.netherland@gmail.com', 'sferik@gmail.com', 'steve.richert@gmail.com', 'steve.agalloco@gmail.com'] spec.files = %w(.yardopts CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md Rakefile twitter.gemspec) spec.files += Dir.glob("lib/**/*.rb") spec.files += Dir.glob("spec/**/*") spec.homepage = 'http://sferik.github.com/twitter/' spec.licenses = ['MIT'] spec.name = 'twitter' spec.require_paths = ['lib'] spec.required_rubygems_version = '>= 1.3.5' #spec.signing_key = File.expand_path("~/.gem/private_key.pem") if $0 =~ /gem\z/ spec.summary = spec.description spec.test_files = Dir.glob("spec/**/*") spec.version = Twitter::Version end我想降低依赖关系faraday 0.8到0.7我怎么能这样做帮助我
twitter.gemspec file is
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'twitter/version' Gem::Specification.new do |spec| spec.add_dependency 'faraday', ['~> 0.8', '< 0.10'] spec.add_dependency 'multi_json', '~> 1.0' spec.add_dependency 'simple_oauth', '~> 0.2' spec.add_development_dependency 'bundler', '~> 1.0' spec.authors = ["John Nunemaker", "Wynn Netherland", "Erik Michaels-Ober", "Steve Richert", "Steve Agalloco"] spec.cert_chain = ['certs/sferik.pem'] spec.description = %q{A Ruby interface to the Twitter API.} spec.email = ['nunemaker@gmail.com', 'wynn.netherland@gmail.com', 'sferik@gmail.com', 'steve.richert@gmail.com', 'steve.agalloco@gmail.com'] spec.files = %w(.yardopts CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md Rakefile twitter.gemspec) spec.files += Dir.glob("lib/**/*.rb") spec.files += Dir.glob("spec/**/*") spec.homepage = 'http://sferik.github.com/twitter/' spec.licenses = ['MIT'] spec.name = 'twitter' spec.require_paths = ['lib'] spec.required_rubygems_version = '>= 1.3.5' #spec.signing_key = File.expand_path("~/.gem/private_key.pem") if $0 =~ /gem\z/ spec.summary = spec.description spec.test_files = Dir.glob("spec/**/*") spec.version = Twitter::Version endI want to degrade dependencies faraday 0.8 to 0.7 how can i do this plase help me
最满意答案
如果您只想要0.7树中的最新补丁,则只需将法拉第线更改为:
spec.add_dependency 'faraday', '~> 0.7.0'或者,如果需要,您可以指定特定版本:
spec.add_dependency 'faraday', '0.7.1'有关更多信息,我建议您阅读有关Gemfiles的Bundler页面http://bundler.io/v1.3/gemfile.html
If you just want the latest patch in the 0.7 tree, you just need to change the faraday line to this:
spec.add_dependency 'faraday', '~> 0.7.0'Or you can specify a specific version if you want:
spec.add_dependency 'faraday', '0.7.1'For more information I'd recommend reading the Bundler page about Gemfiles http://bundler.io/v1.3/gemfile.html
更多推荐
发布评论