Class: Pah::Templates::RackDeflater

Inherits:
Pah::Template
  • Object
show all
Defined in:
lib/pah/templates/rack_deflater.rb

Instance Method Summary collapse

Methods inherited from Pah::Template

#ask_unless_test, #copy_static_file, #git_commit, #static_files, #will_you_like_to?

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/pah/templates/rack_deflater.rb', line 4

def call
  file = 'config/application.rb'
  inject = "\n\n    config.middleware.use Rack::Deflater"
  options = { after: /config\.i18n\.locale = :'.*'/, verbose: false }

  inject_into_file file, inject, options

  git add: 'config/application.rb'
  git_commit 'Add Rack::Deflater middleware.'
end