Class: NotifierGenerator

Inherits:
Genosaurus
  • Object
show all
Defined in:
lib/mack-notifier/notifier_generator/notifier_generator.rb

Overview

Generates the necessary files for a basic notifier.

Example:

rake generate:notifier name=welcome_email

generates the following files:

app/notifiers/welcome_email.rb
app/notifiers/templates/welcome_email/text.erb
app/notifiers/templates/welcome_email/html.erb
test/unit/welcome_email_spec.rb # => if using RSpec
test/unit/welcome_email_test.rb # => if using Test::Unit::TestCase

Instance Method Summary collapse

Instance Method Details

#class_nameObject

:nodoc:



19
20
21
# File 'lib/mack-notifier/notifier_generator/notifier_generator.rb', line 19

def class_name # :nodoc:
  param(:name).camelcase
end

#file_nameObject

:nodoc:



15
16
17
# File 'lib/mack-notifier/notifier_generator/notifier_generator.rb', line 15

def file_name # :nodoc:
  param(:name).underscore.downcase
end