Sha256: e9c9f6a7dbe14f98b7dc162da9d2cfcddb8bb5a10ee091f39903f29031475710
Contents?: true
Size: 444 Bytes
Versions: 5
Compression:
Stored size: 444 Bytes
Contents
require 'rails/generators' module DynamicMenu class MenuGenerator < Rails::Generators::Base source_root File.expand_path('../templates',__FILE__) def generate_menu @args[0] =~ /(.+):.+/i file = $1 dir = "app/menus/#{file}" Dir.mkdir(dir) unless File.exists?(dir) @args[0] =~ /.+:(.+)/i @menu_name = $1 template "menu.rb", "app/menus/#{file}/#{@menu_name}.rb" end end end
Version data entries
5 entries across 5 versions & 1 rubygems