From 5612dfa4dfae362f16cc8e748157b6fefdd28da3 Mon Sep 17 00:00:00 2001 From: Isaac Sloan Date: Mon, 19 Feb 2018 20:53:47 -0700 Subject: [PATCH] initial code --- src/compiled_license.cr | 16 ++++++++++++---- src/compiled_license/licenses.cr | 11 +++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 src/compiled_license/licenses.cr diff --git a/src/compiled_license.cr b/src/compiled_license.cr index a1b1272..4a55552 100644 --- a/src/compiled_license.cr +++ b/src/compiled_license.cr @@ -1,6 +1,14 @@ -require "./compiled_license/*" +require "./compiled_license/version" -# TODO: Write documentation for `CompiledLicense` -module CompiledLicense - # TODO: Put your code here +module Compiled + module License + def self.display + {{ run("../compiled_license/licenses.cr").stringify }} + end + end +end + +if ARGV[0]? && ARGV[0]? == "--license" + puts Amber::Support::Licenses.display + exit 0 end diff --git a/src/compiled_license/licenses.cr b/src/compiled_license/licenses.cr new file mode 100644 index 0000000..4299fff --- /dev/null +++ b/src/compiled_license/licenses.cr @@ -0,0 +1,11 @@ +licenses = String.build do |s| + Dir.glob("./lib/*/LICENSE", "./lib/*/license").each do |path| + s.puts path.match(/^\.\/lib\/([^\/]+)\//).try(&.[1]).to_s.capitalize + s.puts "================================================================================" + s.puts File.read(path) + s.puts "================================================================================" + s.puts "\n\n" + end +end + +puts licenses