Module: Consular

Defined in:
lib/consular.rb,
lib/consular/dsl.rb,
lib/consular/cli.rb,
lib/consular/core.rb,
lib/consular/version.rb

Defined Under Namespace

Classes: CLI, Core, DSL

Constant Summary collapse

VERSION =
"1.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_editorObject

Returns the value of attribute default_editor


12
13
14
# File 'lib/consular.rb', line 12

def default_editor
  @default_editor
end

.global_path(path = nil) ⇒ String

Returns the global script path. If not set, defaults to ~/.config/consular


45
46
47
# File 'lib/consular.rb', line 45

def global_path
  @global_path
end

Class Method Details

.add_core(klass) ⇒ Object

Add a core to Consular.

Examples:

Consular.add_core Consular::Cores::OSX

32
33
34
# File 'lib/consular.rb', line 32

def add_core(klass)
  cores << klass
end

.configure(&block) {|_self| ... } ⇒ Object

Configure Consular options.

Examples:


Consular.configure do |c|
  c.global_path    = '~/.consular'
  c.default_editor = 'vim'
end

Yields:

  • (_self)

Yield Parameters:

  • _self (Consular)

    the object that the method was called on


63
64
65
# File 'lib/consular.rb', line 63

def configure(&block)
  yield self
end

.coresArray<Core>

Returns all avaialble cores.


19
20
21
# File 'lib/consular.rb', line 19

def cores
  @cores ||= []
end