module JekyllFoundationBuildingBlocks::Kits

Public Class Methods

install(key) click to toggle source
# File lib/jekyll-foundation-building-blocks/kits.rb, line 17
def self.install(key)
  kits = Util.fetch_json(KITS_JSON_URL)
  unless kits[key]
    Jekyll.logger.error "Could not find kit #{kit}"
    return 1
  end

  kits[key]['blocks'].each do |block|
    JekyllFoundationBuildingBlocks::Blocks.install(block['datakey'])
  end

  Jekyll.logger.info("installed kit: #{key}")
end
list() click to toggle source
# File lib/jekyll-foundation-building-blocks/kits.rb, line 9
def self.list
  Util.fetch_json(KITS_JSON_URL).each_with_index do |pair, i|
    key = pair[0]
    value = pair[1]
    Jekyll.logger.info "#{i})".green + " #{key}".cyan + ": #{value['total']} blocks"
  end
end