Skip to content

.irbrc and .irb_history advice could be improved. #474

@lgarron

Description

@lgarron

I found a .irb_history file in my home dir. xdg-ninja helpfully told me:

[irb history]: /Users/lgarron/.irb_history

  In Ruby versions 2.7 or later, add the following to your .irbrc:

    IRB.conf[:HISTORY_FILE] ||= File.join(ENV["XDG_DATA_HOME"], "irb", "history")

  For prior versions, set $IRBRC

However, it didn't tell me where to put the .irbrc. (Is the "For prior versions, set $IRBRC" part is even accurate?)

I had to look up what to do for .irbrc, and it turns out you can put it at ~/.config/irb/irbrc and irb will use it.

However, xdg-ninja's advice does not mention that:

[irb history]: /Users/lgarron/.irbrc

  Export the following environment variable:

    export IRBRC="$XDG_CONFIG_HOME/irb/irbrc"

I think it would be useful to:

  • For .irbrc: Mention that you can move the .irbc file to ~/.config/irb/irbrc (or $XDG_CONFIG_HOME/irb/irbrc) without setting an env var.
  • For .irb_history: Either mention the same info for creating .irbrc, or include some reference to info about .irbrc that can be followed (e.g. a link).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions