-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put IRB configuration file under XDG Base Directory
Until now, I have used the famous Rubiest configuration file as it is, but I created a new one based on it. See also: - https://github.com/k0kubun/dotfiles/blob/38d8bb44e88b52719fa8d0c91131ae21d2201596/config/.irbrc - https://ruby-doc.org/3.2.2/stdlibs/irb/IRB.html - https://wiki.archlinux.org/title/XDG_Base_Directory#Partial
- Loading branch information
1 parent
b7d4503
commit 66c4150
Showing
4 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
autoload :Base64, 'base64' | ||
autoload :CGI, 'cgi' | ||
autoload :CSV, 'csv' | ||
autoload :Digest, 'digest' | ||
autoload :ERB, 'erb' | ||
autoload :FileUtils, 'fileutils' | ||
autoload :JSON, 'json' | ||
autoload :Pathname, 'pathname' | ||
autoload :Psych, 'psych' | ||
autoload :Ripper, 'ripper' | ||
autoload :SecureRandom, 'securerandom' | ||
autoload :Shellwords, 'shellwords' | ||
autoload :StringIO, 'stringio' | ||
autoload :URI, 'uri/generic' # `autoload :URI, 'uri'` breaks Rails | ||
autoload :YAML, 'yaml' | ||
autoload :Zlib, 'zlib' | ||
|
||
IRB.conf[:USE_AUTOCOMPLETE] = false | ||
IRB.conf[:SAVE_HISTORY] = 1000 | ||
IRB.conf[:HISTORY_FILE] = File.join(ENV['XDG_DATA_HOME'], 'irb', 'history') | ||
if defined?(IRB::Color) # just for consistency | ||
clear = "\e[0m" | ||
bold = "\e[1m" | ||
green = "\e[32m" | ||
blue = "\e[34m" | ||
cyan = "\e[36m" | ||
IRB.conf[:PROMPT][:DEFAULT] = { | ||
PROMPT_I: "#{cyan}#{bold}%N#{clear}(#{green}#{bold}%m#{clear})[#{blue}%02n#{clear}:%i]> ", | ||
PROMPT_N: "#{cyan}#{bold}%N#{clear}(#{green}#{bold}%m#{clear})[#{blue}%02n#{clear}:%i]> ", | ||
PROMPT_S: "#{cyan}#{bold}%N#{clear}(#{green}#{bold}%m#{clear})[#{blue}%02n#{clear}:%i]%l ", | ||
PROMPT_C: "#{cyan}#{bold}%N#{clear}(#{green}#{bold}%m#{clear})[#{blue}%02n#{clear}:%i]* ", | ||
RETURN: "=> %s\n", | ||
} | ||
end |