Sha256: a04e2da4ddba4f170c53a1530e99577497990aa76c49ae009d9a572c0b96f2c2

Contents?: true

Size: 689 Bytes

Versions: 4

Compression:

Stored size: 689 Bytes

Contents

class RespondersInstallGenerator < Rails::Generators::Base
  def self.source_root
    @_source_root ||= File.expand_path("..", __FILE__)
  end

  desc "Creates an initializer with default responder configuration and copy locale file"

  def create_responder_initializer
    create_file "config/initializers/responders.rb", <<-FILE
class ApplicationResponder < ActionController::Responder
  include Responders::FlashResponder
  include Responders::HttpCacheResponder
end

ApplicationController.respond_to :html
ApplicationController.responder = ApplicationResponder
    FILE
  end

  def copy_locale
    copy_file "../responders/locales/en.yml", "config/locales/responders.en.yml"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
responders-0.6.0 lib/generators/responders_install_generator.rb
responders-0.5.5 lib/generators/responders_install_generator.rb
responders-0.5.4 lib/generators/responders_install_generator.rb
responders-0.5.3 lib/generators/responders_install_generator.rb