降低宝石依赖性(Degrade a Gem Dependencies)

编程入门 行业动态 更新时间:2024-10-25 17:17:33
降低宝石依赖性(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 end

I 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

更多推荐

本文发布于:2023-08-04 15:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1417820.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:依赖性   Degrade   Dependencies   Gem

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!