Module: Lightning

Defined in:
lib/lightning.rb,
lib/lightning/util.rb,
lib/lightning/bolt.rb,
lib/lightning/config.rb,
lib/lightning/builder.rb,
lib/lightning/version.rb,
lib/lightning/function.rb,
lib/lightning/commands.rb,
lib/lightning/generator.rb,
lib/lightning/generators.rb,
lib/lightning/completion.rb,
lib/lightning/commands_util.rb,
lib/lightning/commands/core.rb,
lib/lightning/completion_map.rb

Defined Under Namespace

Modules: Builder, Commands, CommandsUtil, Generators, Util Classes: Bolt, Completion, CompletionMap, Config, Function, Generator

Constant Summary

VERSION =
'0.3.2'

Class Attribute Summary

Class Method Summary

Class Attribute Details

+ (Config) config

Contains all user configuration

Returns:

  • (Config) — Contains all user configuration

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

def config
  @config ||= Config.new
end

+ (Hash) functions

Maps function names to Function objects

Returns:

  • (Hash) — Maps function names to Function objects

29
30
31
# File 'lib/lightning.rb', line 29

def functions
  @functions ||= create_functions
end

Class Method Details

+ (Hash) bolts

Maps bolt names to Bolt objects

Returns:

  • (Hash) — Maps bolt names to Bolt objects

24
25
26
# File 'lib/lightning.rb', line 24

def bolts
  @bolts ||= Hash.new {|h,k| h[k] = Bolt.new(k) }
end

+ (String) dir

Directory for most of lightning’s files, ~/.lightning

Returns:

  • (String) — Directory for most of lightning’s files, ~/.lightning

34
35
36
37
38
39
40
# File 'lib/lightning.rb', line 34

def dir
  @dir ||= begin
    require 'fileutils'
    FileUtils.mkdir_p File.join(home, '.lightning')
    File.join(home, '.lightning')
  end
end

+ (String) home

User’s home directory, ~

Returns:

  • (String) — User’s home directory, ~

43
44
45
# File 'lib/lightning.rb', line 43

def home
  @home ||= Util.find_home
end