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

merb-gen

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merb-gen

  • 1.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

==== merb-gen

merb-gen is a part of the Merb More package. It provides application, plugin, and component generators for Merb.

==== Usage

To generate directory structure for a new merb app, run merb-gen app <app-name>. For instance, merb-gen app foo would create a new foo merb stack application inside of the foo directory. Merb stack sets up commonly used Merb and DataMapper gems to quickly get you started.

Use merb-gen core to generate minimal merb-core application with full layout. Use merb-gen flat to generate a flattened application (very simple directory structure) and merb-gen very-flat to generate a single file application.

To generate a new merb plugin, run merb-gen plugin <plugin_name>.

To see what generators are available, run merb-gen generators.

==== Custom generators

There are two ways of adding generators, depending on how the generators are intended to be used. The first way is by adding adding the generator via Merb.add_generators, and specifying the location of any generators.

Merb.add_generators File.join(File.dirname(__FILES__), 'generators', 'my_generator.rb')

This method has some advantages:

  • it allows you to load generators only when your plugin is required in the application
  • it allows you to load generators from inside the application itself

However, it also has a disadvantage: it is impossible this way to add generators whether the plugin is loaded or not, just by virtue of the gem being installed. This is where the second way comes in: A 'Generators' file is added to the root of the project (like a Rakefile), it should look something like this:

scope "merb-gen" do
  Merb.add_generators File.join(File.dirname(__FILES__), 'generators', 'my_generator.rb')
end

FAQs

Package last updated on 11 Jul 2010

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