initial code
This commit is contained in:
parent
592d0c5b7f
commit
5612dfa4df
2 changed files with 23 additions and 4 deletions
|
@ -1,6 +1,14 @@
|
||||||
require "./compiled_license/*"
|
require "./compiled_license/version"
|
||||||
|
|
||||||
# TODO: Write documentation for `CompiledLicense`
|
module Compiled
|
||||||
module CompiledLicense
|
module License
|
||||||
# TODO: Put your code here
|
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
|
end
|
||||||
|
|
11
src/compiled_license/licenses.cr
Normal file
11
src/compiled_license/licenses.cr
Normal file
|
@ -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
|
Loading…
Reference in a new issue