Sha256: 12e8e7eea96869f208f7806aa5453416730e462ea3185dbf4a95e7a4cace5377

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

require 'generators/haml/base.rb'

module Haml
  module Generators
    class MailerGenerator < Haml::Generators::Base
      argument :actions, :type => :array, :default => [], :banner => "method method"

      def create_view_folder
        empty_directory File.join("app/views", file_path)
      end

      def create_view_files
        actions.each do |action|
          @action, @path = action, File.join(file_path, action)
          template "view.text.haml", File.join("app/views", "#{@path}.text.haml")
        end
      end
    end
  end
end

Version data entries

3 entries across 2 versions & 2 rubygems

Version Path
sc_core-0.0.7 test/dummy/lib/generators/haml/mailer/mailer_generator.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/haml_rails-0.1.0/lib/generators/haml_rails/templates/mailer/mailer_generator.rb
haml_rails-0.1.0 lib/generators/haml_rails/templates/mailer/mailer_generator.rb