Module: PryTheme
- Defined in:
- lib/pry-theme.rb,
lib/pry-theme/hex.rb,
lib/pry-theme/rgb.rb,
lib/pry-theme/term.rb,
lib/pry-theme/color.rb,
lib/pry-theme/theme.rb,
lib/pry-theme/config.rb,
lib/pry-theme/preview.rb,
lib/pry-theme/commands.rb,
lib/pry-theme/definition.rb,
lib/pry-theme/theme_list.rb,
lib/pry-theme/color_table.rb,
lib/pry-theme/declaration.rb,
lib/pry-theme/formattable.rb,
lib/pry-theme/basic_editor.rb,
lib/pry-theme/colors/color8.rb,
lib/pry-theme/colors/color16.rb,
lib/pry-theme/colors/color256.rb,
lib/pry-theme/when_started_hook.rb
Defined Under Namespace
Modules: Formattable, ThemeList Classes: BasicEditor, Color, Color16, Color256, Color8, ColorTable, Config, HEX, Preview, RGB, TERM, Theme, WhenStartedHook
Constant Summary collapse
- VERSION_FILE =
The VERSION file must be in the root directory of the library.
File.('../../VERSION', __FILE__)
- VERSION =
File.exist?(VERSION_FILE) ? File.read(VERSION_FILE).chomp : '(could not find VERSION file)'
- ROOT =
The root path of Pry Theme source code.
File.(File.dirname(__FILE__))
- CONFIG_DIR =
The path of the directory with Pry configuration files.
File.join(ENV['HOME'], '.pry')
- DEF_THEMES_DIR =
The path of the default Pry Theme themes.
File.join(ROOT, '..', 'themes')
- USER_THEMES_DIR =
The path where the user should keep their themes.
File.join(CONFIG_DIR, 'themes')
- PT_EXT =
Every Pry Theme file must end with this extension.
'.prytheme.rb'
- PTC =
Pry Theme Collection.
'https://api.github.com/repos/kyrylo/pry-theme-collection/contents/'
- SHORTENER =
The default URL shortener (used for listing themes from PTC).
'http://is.gd/create.php?format=simple&url='
- ThemeError =
Raised when something goes wrong with Pry Theme themes. It’s a general exception for everything that comes into collision in theme files.
Class.new(StandardError)
- Command =
Class.new
Class Method Summary collapse
-
.color_const(color) ⇒ Class
The class, which corresponds to the given
color
. -
.create(config = {}, &block) ⇒ Object
Creates a new Pry Theme theme.
-
.tput_colors ⇒ Integer
The number of supported terminal colours.
Class Method Details
.color_const(color) ⇒ Class
Returns the class, which corresponds to the given color
.
99 100 101 |
# File 'lib/pry-theme.rb', line 99 def color_const(color) const_get(:"Color#{ color }") end |
.create(config = {}, &block) ⇒ Object
Creates a new Pry Theme theme.
85 86 87 |
# File 'lib/pry-theme.rb', line 85 def create(config = {}, &block) Theme.new(config, &block) end |
.tput_colors ⇒ Integer
Returns the number of supported terminal colours. Always equal to 16 on Windows.
91 92 93 94 95 |
# File 'lib/pry-theme.rb', line 91 def tput_colors `tput colors`.to_i rescue Errno::ENOENT 16 end |