Class: PryTheme::WhenStartedHook

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-theme/when_started_hook.rb

Overview

This is a hook to Pry. It executes upon Pry’s launch. The hook is responsible for bootstrapping Pry Theme.

Instance Method Summary collapse

Instance Method Details

#call(_, _, _) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/pry-theme/when_started_hook.rb', line 5

def call(_, _, _)
  recreate_user_themes_from_default_ones
  load_themes

  if File.exist?(theme_file)
    ThemeList.activate_theme(Pry.config.theme)
  else
    display_warning(_pry_) if Pry.config.theme
    ThemeList.activate_theme_intelligently
  end

  apply_config
end