Sha256: d5ee154e99c286ca8dc1c4c9c2d4c2975d68deb359f9ff7868cfb39234e95de1

Contents?: true

Size: 756 Bytes

Versions: 13

Compression:

Stored size: 756 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

13 entries across 13 versions & 1 rubygems

Version Path
maily-0.12.3 lib/generators/maily/install_generator.rb
maily-0.12.2 lib/generators/maily/install_generator.rb
maily-0.12.1 lib/generators/maily/install_generator.rb
maily-0.12.0 lib/generators/maily/install_generator.rb
maily-0.11.0 lib/generators/maily/install_generator.rb
maily-0.10.1 lib/generators/maily/install_generator.rb
maily-0.10.0 lib/generators/maily/install_generator.rb
maily-0.9.1 lib/generators/maily/install_generator.rb
maily-0.9.0 lib/generators/maily/install_generator.rb
maily-0.8.2 lib/generators/maily/install_generator.rb
maily-0.8.1 lib/generators/maily/install_generator.rb
maily-0.8.0 lib/generators/maily/install_generator.rb
maily-0.7.2 lib/generators/maily/install_generator.rb