Module: Boxy

Defined in:
lib/boxy.rb,
lib/boxy/dsl.rb,
lib/boxy/brew.rb,
lib/boxy/mkdirs.rb,
lib/boxy/command.rb,
lib/boxy/luarock.rb,
lib/boxy/version.rb,
lib/boxy/defaulty.rb,
lib/boxy/homesick.rb,
lib/boxy/brew_cask.rb

Defined Under Namespace

Classes: BrewCaskHandler, BrewPackageHandler, Command, DefaultyHandler, Dsl, HomesickHandler, LuarockHandler, MkdirsHandler

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.install(commands) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/boxy.rb', line 18

def self.install(commands)
  ensure_homebrew_installed

  commands.each do |command|
    handler = @@handlers[command.type]
    with_clean_env do
      handler.install(command.name, command.options)
    end
  end
end

.load_commands(url) ⇒ Object



6
7
8
# File 'lib/boxy.rb', line 6

def self.load_commands(url)
  Boxy::Dsl.interpret(url).uniq
end

.register(type, handler) ⇒ Object



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

def self.register(type, handler)
  @@handlers ||= {}
  @@handlers[type] = handler
end

.validate(commands) ⇒ Object



10
11
12
13
14
15
# File 'lib/boxy.rb', line 10

def self.validate(commands)
  commands.map do |command|
    command.valid = !!@@handlers[command.type]
    command
  end
end