Let's release a Ruby gem. To be precise, it was released last time in 2009, so it will be the first re-release in 11 years. For the gem release method, refer to the following. Reference: https://qiita.com/9sako6/items/72994b8b1c00af4e61fe
Previously released are below. In other words, you can still use it with gem install cutep.
With the disappearance of RubyForge, the homepage has disappeared and the source code can no longer be seen. Re-release on GitHub. I have the original file, but I decided to start with the same gem. Get the source code from the following.
Change the .gem extension to zip and unzip it. Then you will get data.tar.gz and metadata.gz. Unzip it to see the source.
% gem install bundler
% cd ~/dev
% bundle gem cutep -t
Creating gem 'cutep'...
Do you want to license your code permissively under the MIT license?
This means that any other developer or company will be legally allowed to use your code for free as long as they admit you created it. You can read more about the MIT license at https://choosealicense.com/licenses/mit. y/(n): y
MIT License enabled in config
Do you want to include a code of conduct in gems you generate?
Codes of conduct can increase contributions to your project by contributors who prefer collaborative, safe spaces. You can read more about the code of conduct at contributor-covenant.org. Having a code of conduct means agreeing to the responsibility of enforcing it, so be sure that you are prepared to do that. Be sure that your email address is specified as a contact in the generated code of conduct so that people know who to contact in case of a violation. For suggestions about how to enforce codes of conduct, see https://bit.ly/coc-enforcement. y/(n): y
Code of conduct enabled in config
create cutep/Gemfile
create cutep/lib/cutep.rb
create cutep/lib/cutep/version.rb
create cutep/cutep.gemspec
create cutep/Rakefile
create cutep/README.md
create cutep/bin/console
create cutep/bin/setup
create cutep/.gitignore
create cutep/.travis.yml
create cutep/.rspec
create cutep/spec/spec_helper.rb
create cutep/spec/cutep_spec.rb
create cutep/LICENSE.txt
create cutep/CODE_OF_CONDUCT.md
Initializing git repo in /Users/eto/dev/Day22_cutep/cutep
Gem 'cutep' was successfully created. For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html
% cd cutep
--It is automatically a git repository. Add this to GitHub. Reference: https://qiita.com/sodaihirai/items/caf8d39d314fa53db4db --New repository from + on the upper right of https://github.com/eto/. → Do not create README → Create --https://github.com/eto/cutep is created.
% git commit -m "Initialize repository"
% git remote add origin https://github.com/eto/cutep.git
% git push origin master
--If you look at https://github.com/eto/cutep again, you can see that the contents are complete.
--Match the source created by decompressing 1 above with the template created by bundler in 2 above. The version should be 1.1.0. --Here, there is a discrepancy that the gem name is cutep and the actual name is qp, so it was necessary to change it a little. % git commit -m "Adapt the old version 1.0.0 files." % git push origin master As, upload to github.
% bundle exec rake spec
It was roughly as shown on the page below, Reference: https://qiita.com/9sako6/items/72994b8b1c00af4e61fe
It was necessary to explicitly specify rubygems as follows. Has it changed? spec.metadata["allowed_push_host"] = "https://rubygems.org/"
I have a RubyGems.org account that I created earlier, so connect to it.
% curl -u eto https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
When asked for a password, enter the rubygems.org password.
% git push --set-upstream origin master
% rake release
1.1.0 has been released as follows. https://rubygems.org/gems/cutep
done!
Recommended Posts