Sha256: 278f047b0bc5b19ca3286f078850b472ec6efcf61b9336a479252f6fe27a401d
Contents?: true
Size: 898 Bytes
Versions: 2
Compression:
Stored size: 898 Bytes
Contents
# frozen_string_literal: true require "refinements/struct" module Hanamismith module Builders module Rack # Builds project skeleton. class Attack < Rubysmith::Builders::Abstract using Refinements::Struct def call add_configuration add_middleware configuration end private def add_configuration template_path = "%project_name%/config/initializers/rack_attack.rb.erb" builder.call(configuration.merge(template_path:)).render end def add_middleware builder.call(configuration.merge(template_path: "%project_name%/config/app.rb.erb")) .insert_after(/require/, %(\nrequire_relative "initializers/rack_attack"\n)) .insert_before(/environment/, " config.middleware.use Rack::Attack\n\n") end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hanamismith-0.38.0 | lib/hanamismith/builders/rack/attack.rb |
hanamismith-0.37.0 | lib/hanamismith/builders/rack/attack.rb |