Sha256: 1b6ad6618987faffd82459d219ef593842369441dea2314ed05c972ddd8c9833

Contents?: true

Size: 1021 Bytes

Versions: 13

Compression:

Stored size: 1021 Bytes

Contents

module FlashRailsMessages
  module Generators
    class InstallGenerator < Rails::Generators::Base
      desc 'FlashRailsMessages initializer'
      source_root File.expand_path('../templates', __FILE__)
      class_option :bootstrap, type: :boolean, desc: 'Use Bootstrap in flash alerts.'
      class_option :foundation, type: :boolean, desc: 'Use Foundation in flash alerts.'

      def install_info
        return if options.bootstrap? || options.foundation?
        puts 'FlashRailsMessages supports Bootstrap and Zurb Foundation 3. If you want '\
          'a configuration that is compatible with one of these frameworks, then please ' \
          're-run this generator with --bootstrap or --foundation as an option.'
      end

      def install_initializer
        if options.bootstrap?
          template 'config/initializers/flash_rails_messages_bootstrap.rb'
        elsif options.foundation?
          template 'config/initializers/flash_rails_messages_foundation.rb'
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
flash_rails_messages-2.3.0 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-2.2.0 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-2.1.0 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-2.0.0 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-1.0.2 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-1.0.1 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-1.0.0 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-0.1.4 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-0.1.3 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-0.1.2 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-0.1.1 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-0.1.0 lib/generators/flash_rails_messages/install_generator.rb
flash_rails_messages-0.0.8 lib/generators/flash_rails_messages/install_generator.rb