Sha256: 8269bfbea5342893a78620350900f95c549839b77746bd1d45b78e58cdf10713

Contents?: true

Size: 757 Bytes

Versions: 5

Compression:

Stored size: 757 Bytes

Contents

module Maily
  module Generators
    class InstallGenerator < Rails::Generators::Base
      desc 'Maily installation: route and initializer'
      source_root File.expand_path("../../templates", __FILE__)

      def install
        puts "==> Installing Maily components ..."
        generate_routing
        copy_initializer
        build_hooks
        puts "Ready! You can now access Maily at /maily"
      end

      private

      def generate_routing
        route "mount Maily::Engine, at: '/maily'"
      end

      def copy_initializer
        template 'initializer.rb', 'config/initializers/maily.rb'
      end

      def build_hooks
        create_file "lib/maily_hooks.rb" do
          Maily::Generator.run
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
maily-2.1.0 lib/generators/maily/install_generator.rb
maily-2.0.2 lib/generators/maily/install_generator.rb
maily-2.0.1 lib/generators/maily/install_generator.rb
maily-2.0.0 lib/generators/maily/install_generator.rb
maily-1.0.0 lib/generators/maily/install_generator.rb