本文简要介绍ruby语言中 Gem::Specification.required_ruby_version=
的用法。
用法
required_ruby_version=(req)
此 gem 所需的 Ruby 版本。 ruby 版本可以指定给patch-level:
$ ruby -v -e 'p Gem.ruby_version' ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0] #<Gem::Version "2.0.0.247">
也可以指定预发布。
用法:
# This gem will work with 1.8.6 or greater...
spec.required_ruby_version = '>= 1.8.6'
# Only with final releases of major version 2 where minor version is at least 3
spec.required_ruby_version = '~> 2.3'
# Only prereleases or final releases after 2.6.0.preview2
spec.required_ruby_version = '> 2.6.0.preview2'
# This gem will work with 2.3.0 or greater, including major version 3, but lesser than 4.0.0
spec.required_ruby_version = '>= 2.3', '< 4'
相关用法
- Ruby Specification.required_ruby_version用法及代码示例
- Ruby Specification.requirements用法及代码示例
- Ruby Specification.require_paths=用法及代码示例
- Ruby Specification.rdoc_options用法及代码示例
- Ruby Specification.file_name用法及代码示例
- Ruby Specification.extra_rdoc_files用法及代码示例
- Ruby Specification.platform=用法及代码示例
- Ruby Specification.license=用法及代码示例
- Ruby Specification.extensions用法及代码示例
- Ruby Specification.name用法及代码示例
- Ruby Specification.homepage用法及代码示例
- Ruby Specification.executables用法及代码示例
- Ruby Specification.dependent_gems用法及代码示例
- Ruby Specification.authors=用法及代码示例
- Ruby Specification.description用法及代码示例
- Ruby Specification.add_development_dependency用法及代码示例
- Ruby Specification.authors用法及代码示例
- Ruby Specification.author=用法及代码示例
- Ruby Specification.email用法及代码示例
- Ruby Specification.metadata用法及代码示例
- Ruby Specification.spec_name用法及代码示例
- Ruby Specification.licenses=用法及代码示例
- Ruby Specification.bindir用法及代码示例
- Ruby Specification.summary用法及代码示例
- Ruby Specification.post_install_message用法及代码示例
注:本文由纯净天空筛选整理自ruby-lang.org大神的英文原创作品 Specification.required_ruby_version=。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。