Like NewGem, but way simpler, leaves no traces, extremely minimal boiler plate. Automatically handles extensions for Rack, Yard, Sinatra, etc correctly.
Inspired by Steve Klabnik's Making Ruby Gems.
Only point where it is opinionated: It sets up RSpec. But all you have to do if you don't like that, is changing a single line in the generated Rakefile.
Feel free to contribute.
gemerate GEM_NAME
Simpe example:
$ gemerate foo
...
$ tree foo
foo
βββ Gemfile
βββ License
βββ README.md
βββ Rakefile
βββ foo.gemspec
βββ lib
β βββ foo
β β βββ version.rb
β βββ foo.rb
βββ spec
βββ foo_spec.rb
3 directories, 8 files
For an extension:
$ gemerate rack-foo
...
$ tree rack-foo/
rack-foo/
βββ Gemfile
βββ License
βββ README.md
βββ Rakefile
βββ lib
β βββ rack
β β βββ foo
β β β βββ version.rb
β β βββ foo.rb
β βββ rack-foo.rb
βββ rack-foo.gemspec
βββ spec
βββ rack_foo_spec.rb
4 directories, 9 files
Per default, rack-foo.gemspec
will automatically depend on rack
and
lib/rack/foo.rb
will require rack
.
bundle gem
is fine, but just too little boilerplate, here is what is
different:
- A
rake test
is ready to go. - The gemspec does not include shell-outs, file list is not generic (this is a feature!)
- Less TODOs all over the place you have to remove
- No rubbish in the
.gitignore
- Includes rake task to update files/authors/e-mails from git and version from lib (similar to what Sinatra/Tilt/sinatra-contrib and so on do)
- Internally, the version is not a string to avoid alphanumerical comparison (similar to what Rails does)
- You can do
QUICK=1 bundle install
to avoid fetching from RubyForge - Some logic to generate better boilerplate for extensions (Rack middleware, Sinatra extensions, ...) has been added.
Apart from that, it's pretty much the same. Oh, wait, and it works without bundler.
gem install gemerator