From e0d3c6bf7ec57b43a0c0d32adcdec76ee0d59351 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Tue, 2 Mar 2021 10:34:40 +0100 Subject: [PATCH] test program new SpecParser API --- test.cr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test.cr b/test.cr index 89d4224..39f7c48 100644 --- a/test.cr +++ b/test.cr @@ -11,7 +11,7 @@ context.packaging_backend = "apk" recipes = [] of Package::Recipe -class SpecFileParser +class SpecParser def get_string?(id) : String? entry = self.assignments[id]? @@ -49,9 +49,9 @@ class SpecFileParser entry = assignments[id]? case entry - when SpecFileParser::ArrayContainer + when SpecParser::ArrayContainer entry.value - when SpecFileParser::StringContainer + when SpecParser::StringContainer entry.value.split(",") when Nil return nil @@ -62,7 +62,7 @@ class SpecFileParser end class Package::Recipe - def initialize(@context, specs : SpecFileParser) + def initialize(@context, specs : SpecParser) pp! specs @name = specs.get_string "name" @@ -120,10 +120,10 @@ end class Package::Context def read_recipe(filename : String) - specs = SpecFileParser.parse filename + specs = SpecParser.parse filename if specs.nil? - raise Exception.new "file could not be parsed" + raise ::Exception.new "file could not be parsed" end Recipe.new self, specs