What is RubyGems used for?

What is RubyGems used for?

according to the aforementioned topic Since I've been going to see making packages for myself in python, I had an idea that I would like to try some Ruby gems. I found that the method of making and uploading it to rubygems.org is very easy. How to do it? Well,

first of all, let me know. If anyone wants to push their own gems up, check first whether the name that we will use is repeated or not. In the example, I have already used this name. Therefore, this name is no longer valid. I need to find another name. To check, go to rubygems.org and search for the name. The name you can't find is a name that hasn't been created yet.

????????????? Alt Text ???????????????

/lib/random_num.rb will be the main file to run random_num.gemspec It is a file for setting various configs such as versions of gems, descriptions,

we will try to create a random_number.rb file.

????????????? Alt Text ???????????????

As short as this is simple enough, name the method rd , take 2 digits, random numbers from x to y e.g. 1..10 will randomly get 5,1,2,2 or whatever.

Let's look at random_number. gem-spec

????????????? Alt Text ???????????????
????????????? Alt Text ???????????????

Should have to build through , try testing in irb to see if it works?

????????????? Alt Text ???????????????
????????????? Alt Text ???????????????
????????????? Alt Text ???????????????

For your_user_name put your own username, after running it must also enter password.

Then we will push our gem.

????????????? Alt Text ???????????????

For your_user_name put your own username, after running it must also enter password.

Then we will push our gem.

????????????? Alt Text ???????????????

要查看或添加评论,请登录

Swiftlet的更多文章

社区洞察

其他会员也浏览了