简体   繁体   English

用新的变化更新红宝石宝石版本

[英]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: 请按照以下步骤通过更改来更新您的红宝石宝石:

  1. Keep testing your code and make the required changes in your gem code (locally) 继续测试您的代码,并在本地代码中进行必要的更改
  2. Once you are done with Step 1, update the version of your gem in lib/combination/pairs/ version.rb file by following the Semantic Versioning Guidelines . 完成第1步后,请按照语义版本控制指南更新lib/combination/pairs/ version.rb文件中的gem 版本 Let's say you change the version of your gem to 0.0.2 假设您将gem的版本更改为0.0.2
  3. Next, run bundle install command in your gem's working directory to install all the gem dependencies. 接下来,在gem的工作目录中运行bundle install命令以安装所有gem依赖项。
  4. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM