Sha256: 206bae2037b642145fafc4941c65763c5f35f8c43b36db811214d8ce97d53e11
Contents?: true
Size: 979 Bytes
Versions: 166
Compression:
Stored size: 979 Bytes
Contents
# frozen_string_literal: true require "active_support/encrypted_file" module Rails module Command module Helpers module Editor private def ensure_editor_available(command:) if ENV["EDITOR"].to_s.empty? say "No $EDITOR to open file in. Assign one like this:" say "" say %(EDITOR="mate --wait" #{command}) say "" say "For editors that fork and exit immediately, it's important to pass a wait flag," say "otherwise the credentials will be saved immediately with no chance to edit." false else true end end def catch_editing_exceptions yield rescue Interrupt say "Aborted changing file: nothing saved." rescue ActiveSupport::EncryptedFile::MissingKeyError => error say error.message end end end end end
Version data entries
166 entries across 153 versions & 12 rubygems