本文介绍了Ruby:如何写一个 gem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 Ruby 编写一个包并将其作为 gem 提供.
有哪些工具、步骤和陷阱?
是否有任何好的教程、截屏视频等可以帮助您学习如何做到这一点?

I'd like to write a package for Ruby and make it available as a gem.
What are the tools, steps and pitfalls ?
Are there any good tutorials, screencasts, etc., which helped you learning how to do it ?

推荐答案

Rubygems.org's Guides 是其中之一编写自己的 gem 的最佳资源.

Rubygems.org's Guides is one of the best resources for writing your own gem.

如果您在应用中使用 Bundler,您可能需要查看 Ryan Bigg 的 和 Railscast 关于使用 Bundler 创建 gems.

If you're using Bundler in your app, you might want to look at Ryan Bigg's guide to Developing a RubyGem using Bundler and the Railscast on creating gems with Bundler.

如果您对帮助您编写 gem 的工具感兴趣:

If you're interested in tools to help you write gems:

  • Jeweler - Opinionated tool for creating and managing Rubygem projects. There's also a Gemcutter and Jeweler Railscast.
  • Hoe - From the guys at seattlrb.
  • gem-this adds a bunch of helpful rake tasks.

一些教程/指南:

  • Creating Your First Gem
  • Using bundler and rvm to build a rubygem - Using bundler and rvm to create a gem
  • Gem Packaging: Best Practices
  • Ruby Gem Recipe - Intro guide to creating a gem using bundler and jeweler
  • How to build a ruby gem and host it on gemcutter - tutorial using echoe and gemcutter
  • The Truth About Gemspecs - goes over gemspecs and tips for dealing with them
  • Packaging with RubyGems - a quickstart guide for Jeweler
  • gem that - James Adam - reviews tools that help build gems (hoe, newgem, echoe, gemhub, jeweler, gem this)
  • Using Gemcutter's Api from the Commandline
  • New Gem with Bundler – Sample Rakefile - Useful rakefile for deploying and publishing a gem
  • Let's Write a Gem
  • How To Build A Ruby Gem With Bundler, Test-Driven Development, Travis CI And Coveralls, Oh My!

这篇关于Ruby:如何写一个 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 05:13