Thoughts on development, design and the world we live in.

Making a javascript asset rails gem with jeweler.

By Curtis Jennings Schofield in Rails, Ruby, Uncategorized. Posted on July 25th

Step one)

Use the Jeweler gem.

Seriously this is a brilliant piece of work. It allows you to concentrate on building your gem.

Step two)

Create a file for bundler to load

I am using ‘_’ as a convention for filenames as ClassName to class_name
has been a convention in the rails community and the ruby community for a
long while. I have seen ‘-’ as well I prefer ‘_’ as ctags will interpret
‘something-thing’ as ‘something minus thing’ and i won’t get tab complete
in my editor.

This file’s name needs to match the name of your gem (gem_name) with ‘.rb’ after it

This file will need to require your engine

Step three)

Create a file namespaced to the gem_name directory with a the filename ‘engine’

This file will hold the following code

Step four)

create a directory

Step five)

modify the Rakefile Summary and Description and commit your changes

Step six)

release your gem

Step seven)

include your gem in your rails application’s Gemfile

Step eight)

require any asset files you need from the gem in application.js

Step nine)

send a message to [email protected] telling me that you got it working

Post a Comment

Your email is never shared. Required fields are marked *