[英]Update ruby gem version with new changings
I have developed a gem for learning purposes and push it to https://rubygems.org/gems/combination-pairs . 我已经开发了用于学习目的的gem,并将其推送到https://rubygems.org/gems/combination-pairs 。 Now I want to do some changes in the code of the gem.
现在,我想对gem的代码进行一些更改。 Means I want to update my same gem but with different version.
表示我想更新相同的gem,但版本不同。 How can we do the same??
我们该怎么做?
Follow these steps to update your ruby gem with changes: 请按照以下步骤通过更改来更新您的红宝石宝石:
lib/combination/pairs/ version.rb
file by following the Semantic Versioning Guidelines . lib/combination/pairs/ version.rb
文件中的gem 版本 。 Let's say you change the version of your gem to 0.0.2
0.0.2
bundle install
command in your gem's working directory to install all the gem dependencies. bundle install
命令以安装所有gem依赖项。 And finally, run the task rake release
which will create tag v0.1.2
and build and push combination-pairs-0.0.2.gem
to Rubygems. 最后,运行任务
rake release
,该rake release
将创建标签v0.1.2
并将build combination-pairs-0.0.2.gem
并将其推入Rubygems。 This task is available to you as I see that you have the following line in the Rakefile
您可以执行此任务,因为我看到您在
Rakefile
有以下行
require "bundler/gem_tasks"
You can double check the list of available rake tasks
by executing the command 您可以通过执行以下命令来仔细检查可用的
rake tasks
列表
rake -T
NOTE: 注意:
Just for your reference, check out this awesome Railscasts by Ryan Bates: New Gem with Bundler 仅供参考,请查看Ryan Bates撰写的《 Railscasts: Bundler的新宝石》。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.