Sha256: df6d05b88ee2aff70432a360b03d8a1b2cbd9d382f8b0c55065fd03c3f2fcdce
Contents?: true
Size: 984 Bytes
Versions: 13
Compression:
Stored size: 984 Bytes
Contents
# frozen_string_literal: true require "refinements/struct" module Hanamismith module Builders # Builds project skeleton console for object inspection and exploration. class Console < Rubysmith::Builders::Console using Refinements::Struct def call return false unless settings.build_console super builder.call(settings.merge(template_path: "%project_name%/bin/console.erb")) .replace(/require Bundler.root.+/, %(require "hanami/prepare")) add_irb_autocomplete true end private def add_irb_autocomplete with_template.insert_before "IRB.start", <<~CODE unless Hanami.env? :development, :test ENV["IRB_USE_AUTOCOMPLETE"] ||= "false" puts "IRB autocomplete disabled." end CODE end def with_template builder.call settings.merge(template_path: "%project_name%/bin/console.erb") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems