Method: PryTheme.create

Defined in:
lib/pry-theme.rb

.create(config = {}, &block) ⇒ Object

Creates a new Pry Theme theme.

Examples:

my_theme = PryTheme.create name: 'my-theme', color_model: 8 do
  author name: 'John Doe', email: '[email protected]'
  description 'My first theme'

  define_theme do
    class_variable 'red'
    integer 'black'
    method 'white', 'red'
    symbol bg: 'yellow'

    string do
      content 'blue', 'black'
    end
  end
end

my_theme.definition.class_variable.foreground(true) #=> "red"
my_theme.definition.string.content.background(true) #=> "black"

Options Hash (config):

  • :name (String) — default: 'prytheme-\d+'

    The name of the theme. It must be no longer than 18 characters

  • :color_model (Integer) — default: 256

    The number of colours available in the theme that is being created. Besides 256, valid arguments are ‘8` and `16`

See Also:



85
86
87
# File 'lib/pry-theme.rb', line 85

def create(config = {}, &block)
  Theme.new(config, &block)
end