Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coreymartella-dmd_generator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coreymartella-dmd_generator

  • 0.2.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DMD generators

One night at a Boston Ruby hackfest, I finally got sick of using the Rails default generators, and then having to twiddle them to meet my needs and tastes. This includes using things like:

  • shoulda
  • factory_girl
  • haml
  • blueprint
  • make_resourceful

The next morning, I was struck awake at 5am with the inspiration to start implementing it. dmd_generator is the result of this effort.

What you get

dmd_model

  • A new model that allows belongs_to and references field types
  • A migration for the model
  • Skip using --skip-migration
  • A factory defined with factory_girl
  • Skip using --skip-factory
  • A shoulda unit test with a few simple 'should's
Prereqs:

dmd_scaffold

  • Everything included in dmd_model
  • A controller, using make_resourceful
  • Choice of haml (default) or ERB
    • Specify which with the --templating option
  • A helper
Prereqs:
  • shoulda installed as a plugin
  • factory_girl gem installed
  • factory_girl_on_rails installed as a plugin
  • haml gem installed on the system, and the project has been hamlified using haml --rails
  • make_resourceful

Getting it

dmd_generator is available as a gem via GitHub. If you haven't done so already, you need to setup GitHub as a gem source:

$ gem sources -a http://gems.github.com

Now you can install it:

$ sudo gem install coreymartella-dmd_generator

Example usage

Usage is the same as the default Rails generators.

$ script/generate dmd_model post title:string author:belongs_to body:text published:boolean 
$ script/generate dmd_scaffold post title:string author:belongs_to body:text published:boolean

Configuring it

You can override the default values for templating by placing a .dmd_generator file in your home directory.

Here's an example .dmd_generator:

:templating: erb              # supported options: haml|erb

Developing it

Source is hosted on GitHub: http://github.com/technicalpickles/dmd_generator/tree/master

You can do the usual fork/commit cycle until you have something ready to share. Send pull requests my way.

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc