Another great railscast, I've been wondering how to make a gem and this was really straight forward! Thanks!
Watching you 'just paste in some code' made me remember why generators are cool :)
Protip: if you want to distribute command-line executables with your gem, like the "rake" or "rails" command, then put them in <code>bin/</code> folder. Hoe, and I think Echoe, automatically package them up as executables, which is sexy.
there has never been enough talk about publishing gems. Thanks ryan for adding to a lacking topic. btw - I sure like how echoe is not required as a dependency.
@drnic good point about generators, and thanks for the protip. I did paste a lot of code in this episode, but the majority of it is specific to the project. The only thing I feel needs generating is the Rakefile, and even that has a lot of project-specific settings in it.
A generator is very much a personal preference, but I encourage everyone to try the existing ones out there or make your own as needed. For me copy & pasting the Rakefile content from an existing one is easy enough.
Thankyou for this tutorial, I just made my first Ruby Gem - a gem for accessing the Google Translation API, currently hosted @ github: http://github.com/bdude/rosettastone/tree/master
@David, there already is spam protection in place behind the scenes which has been working really well (it's blocking an amazing amount of spam). As far as I can tell, the spam you were seeing (now deleted) was from an actual human and not a spam bot.
Ryan. Thx for your great screencasts.
Your plugin has a clear (hard) dependency on ActiveRecord. But you do not declare anything in your gem. Can you do that with echoe ? (so uniquify cannot be installed unless activerecord is already installed on the host). Do you recommend to explicit dependencies in gems ?
@Ryan,
Thanks for this very useful screencast.
Should Rakefile really be uploaded to github, as it seems like it wont' be used by either github or the final user of the gem?
Shouldn't your gem be named "ryanb-uniquify" instead, as this will be the final folder in "ruby\lib\ruby\gems\1.8\gems" (plus version, of course)?
Clarifying my previous post: after generating the gem, if you install it locally by running "gem install pkg\<gem-name>-<version>.gem", you end up with a distinct folder name in "...\ruby\lib\ruby\gems\1.8\gems" when compared to installing it from the git repository (as github always seems to add an owner prefix to the gem name provided in .gemspec file).
But of course adding the owner prefix yourself doesn't solve the issue, as github will still add the owner prefix to whatever gem name you supply to it.
@Laurent, good question, I prefer to only use dependencies where I have a "require" statement which loads that gem. Here there is no "require 'activerecord'" line because I expect the developer to load this environment how he desires. He may have edge rails frozen, in that case ActiveRecord is not loaded from a gem and there's really no gem dependency.
If I had other gem dependencies outside of Rails then I would likely add those.
@Cassiano, it's important the Rakefile be in the git repository so anyone else who clones/forks the repo can regenerate the gem after making changes.
Also the gem name should not contain your username prefix as GitHub will add this when it generates the gem using your gemspec.
@Ryan,
Thanks for the Rakefile explanation.
Regarding the naming problem, my intent is to have a local gem that installs exactly the same as the remote (gihub's) one, such that running:
gem install pkg\ryanb-uniquify-0.1.0.gem
or
gem install ryanb-uniquify --source http://gems.github.com
would yield the same installation.
But the only way I can do it is by manually adding the username prefix to my *local* copy of Rakefile and regenerating the gem via the "rake install" task.
The Rakefile would then be restored to its original state before running the "rake build_gemspec" task and committing it to git.
I don't think you are supposed to ignore the Manifest file on github.
Ryan B. You make the world a better place. I can always find great content here and for your main focus to be sharing info rather than promoting info, it shows you have lot of character. Your mom should be proud.
load my gem in github but...
ERROR: could not find gem redvex-ar_cache locally or in a repository
can you help me?
This is the url on github
http://github.com/redvex/ar_cache/tree/master
Ok... github told me that my gem mill Manifest file, maybe you should correct the post, becouse in it you told us to add Manifest file in .gitignore
Try Hawaii this coming summer and i will assure everyone will enjoy it.
Another reason that I would regard joining a political party to be such a valuable thing is that dramatically positive and liberating experience.
High quality Cisco, HP, IBM, Oracle and other Certification exmas training materials are provided here at Pass4sure Pass4sure helps you on your way to your certifications
Your plugin has a clear (hard) dependency on ActiveRecord. But you do not declare anything in your gem. Can you do that with echoe ? (so uniquify cannot be installed unless activerecord is already installed on the host). Do you recommend to explicit dependencies in gems ?
<a href="http://www.xspyz.com">Torrent downloads</a>
I really appreciate it,thanks for your wonderful post.
Thanks for your sharing.
It's so kind of you.I have got a useful information from you.
There are something that i found a long time ago.
I have looking for like this resource. finally i got from your site. thanks alot
thankful for your nice nice information. i really waiting for this resource.
Here we have new style Coach Handbags.All the Coach purses are good quality and lower price.A fashion Coach Outlet is dreamed by the fashion females.Welcome to our store discountbagshop.com.I am sure you will find one for yourself.
I want to say that I dont think Ive read anything so true in a long time. Youve got a lot of great ideas, a great deal of perspective. I think that you definitely have something important to say and Im gonna back it 110%, man. Good job keeping this subject alive and interesting!
Here we have new style Coach Handbags.All the Coach purses are good quality and lower price.A fashion Coach Outlet is dreamed by the fashion females. Cool I tried it and it works.
Took me awhile to read all the comments, but I really love the article. It proved to be very useful to me and I am sure to all the commenters here! It's always nice when you can not only be informed, but also entertained! I'm sure you had fun writing this article. Comfortably, the article is really the sweetest on this precious topic.
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets
Discount Wholesale Electronics, Wholesale Cell Phones, Electronic Gadgets and More from the Best Dropship Wholesaler
this [url=http://www.auto-ok-erlangen.com]P90x extreme home fitness program[/url] can give you perfect shape and transform your life
this [url=http://www.rosetta-stone-shop.org]Rosetta Stone Spanish (Latin America)[/url]can improve yourself and highten your languages level
[url=http://www.itunes-gift-card.org]itunes gift card,itunes code[/url]
A generator is very much a personal preference, but I encourage everyone to try the existing ones out there or make your own as needed. For me copy & pasting the Rakefile content from an existing one is easy enough.
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets






