Sha256: 9e83771d28ec5de8a2d0181de5f7070a5cbc5648ea848d43f6f3e716bfc7777a

Contents?: true

Size: 614 Bytes

Versions: 3

Compression:

Stored size: 614 Bytes

Contents

require 'rails/generators'

module Buoys
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)

    class_option :template

    def create_files
      copy_file 'buoys.en.yml', 'config/locales/buoys.en.yml'
      copy_file 'breadcrumbs.rb', 'config/buoys/breadcrumbs.rb'

      if %(haml slim).include?(template_type = options[:template])
        copy_file "_buoys.html.#{template_type}", "app/views/breadcrumbs/_buoys.html.#{template_type}"
      else
        copy_file '_buoys.html.erb', 'app/views/breadcrumbs/_buoys.html.erb'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
buoys-0.5.0 lib/generators/buoys/install_generator.rb
buoys-0.4.0 lib/generators/buoys/install_generator.rb
buoys-0.3.0 lib/generators/buoys/install_generator.rb