diff --git a/lib/generators/web_hook_generator.rb b/lib/generators/mandrill/mandrill_generator.rb similarity index 94% rename from lib/generators/web_hook_generator.rb rename to lib/generators/mandrill/mandrill_generator.rb index 5b7ee2f..d45fba3 100644 --- a/lib/generators/web_hook_generator.rb +++ b/lib/generators/mandrill/mandrill_generator.rb @@ -3,7 +3,7 @@ module Mandrill module Rails module Generators - class WebHookGenerator < ::Rails::Generators::Base + class MandrillGenerator < ::Rails::Generators::NamedBase namespace 'mandrill' desc 'Generates a controller and routes for Mandrill web hooks.' argument :name, type: :string @@ -14,7 +14,7 @@ class WebHookGenerator < ::Rails::Generators::Base class_option :controller, type: :boolean, default: true, desc: 'Creates a controller for web hooks' - source_root File.expand_path("../templates", __FILE__) + source_root File.expand_path("../../templates", __FILE__) def initialize(args, *options) args[0] = args[0].dup if args[0].is_a?(String) && args[0].frozen? diff --git a/spec/generators/web_hook_generator_spec.rb b/spec/generators/mandrill_generator_spec.rb similarity index 98% rename from spec/generators/web_hook_generator_spec.rb rename to spec/generators/mandrill_generator_spec.rb index a9da919..98c325c 100644 --- a/spec/generators/web_hook_generator_spec.rb +++ b/spec/generators/mandrill_generator_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' require 'generator_spec' -require 'generators/web_hook_generator' +require 'generators/mandrill/mandrill_generator' -describe Mandrill::Rails::Generators::WebHookGenerator, type: :generator do +describe Mandrill::Rails::Generators::MandrillGenerator, type: :generator do destination File.expand_path("../../tmp", __FILE__) before do