Now uses weird-crystal-base.

master
Luka Vandervelden 2019-11-09 11:40:33 +01:00
parent c8228e95f7
commit 4fbc7a1928
3 changed files with 4 additions and 36 deletions

View File

@ -8,6 +8,8 @@ authors:
# Short description of package
dependencies:
weird-crystal-base:
git: https://git.karchnu.fr/WeirdOS/weird-crystal-base
specparser:
git: https://git.karchnu.fr/WeirdOS/recipes-parser

View File

@ -1,34 +0,0 @@
require "colorize"
class Weird::Context
# FIXME: Use log files.
# FIXME: def log(), that puts stuff as-is in the logs.
def debug(text)
STDERR.puts ":: #{text}".colorize(:cyan)
STDERR.flush
end
def info(text)
STDOUT
.<<(":: ".colorize(:blue))
.<<(text.colorize(:white))
.<<("\n")
STDOUT.flush
end
def title(text)
STDOUT
.<<("|> ".colorize(:blue).bright)
.<<(text.colorize(:white).bright)
.<<("\n")
STDOUT.flush
end
def warning(text)
STDERR.puts ":: #{text}".colorize(:yellow)
STDERR.flush
end
def error(text)
STDERR.puts "!! #{text}".colorize(:red)
STDERR.flush
end
end

View File

@ -3,13 +3,13 @@ require "uuid"
require "file_utils"
require "uri"
require "../io.cr"
require "weird-crystal-base"
require "./weird.cr"
require "./configuration.cr"
require "./repository.cr"
class Package::Context < Weird::Context
class Package::Context < Weird::Base
property root = "/"
# Stores informations about already installed packages, their