diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ffc7b6a..0000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: crystal diff --git a/shard.yml b/shard.yml index 9208c08..58a9060 100644 --- a/shard.yml +++ b/shard.yml @@ -3,7 +3,8 @@ version: 1.0.0 authors: - Isaac Sloan + - grimmigerFuchs -crystal: "> 0.24.1, < 1.1.0" +crystal: 1.20.1 license: MIT diff --git a/spec/compiled_license_spec.cr b/spec/compiled_license_spec.cr index cb3364c..0d7e535 100644 --- a/spec/compiled_license_spec.cr +++ b/spec/compiled_license_spec.cr @@ -1,14 +1,15 @@ -require "./spec_helper" +require "spec" +require "../src/compiled_license" describe CompiledLicense do - licenses = {{ run("../src/compiled_license/licenses.cr").stringify }} + licenses = CompiledLicense::LICENSES it "should return string" do (licenses.size > 20).should be_true end it "should include license of current file" do - licenses.should contain("Compiled_license") + licenses.should contain("compiled_license") end it "should contain name of author from license file" do @@ -17,6 +18,6 @@ describe CompiledLicense do it "should contain more than one license" do delimiter = "\n\n" - (licenses.split(delimiter).size > 1).should be_true + (licenses.split(delimiter).size > 1).should be_true end end diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr deleted file mode 100644 index 999c873..0000000 --- a/spec/spec_helper.cr +++ /dev/null @@ -1,2 +0,0 @@ -require "spec" -require "../src/compiled_license" diff --git a/src/compiled_license.cr b/src/compiled_license.cr index bd3852a..bc26aea 100644 --- a/src/compiled_license.cr +++ b/src/compiled_license.cr @@ -1,14 +1,5 @@ -require "./compiled_license/version" +module CompiledLicense + VERSION = {{ `shards version`.stringify.chomp }} -module Compiled - module License - def self.display - {{ run("./compiled_license/licenses.cr").stringify }} - end - end -end - -if ARGV[0]? && ARGV[0]? == "--licenses" - puts Compiled::License.display - exit 0 + LICENSES = {{ run("./compiled_license/licenses.cr").stringify }} end diff --git a/src/compiled_license/licenses.cr b/src/compiled_license/licenses.cr index d72e2ad..4f5765e 100644 --- a/src/compiled_license/licenses.cr +++ b/src/compiled_license/licenses.cr @@ -1,19 +1,21 @@ -licenses = String.build do |s| +DELIMITER = "================================================================================" + +LICENSES = String.build do |s| if File.exists?("./LICENSE") - s.puts Dir.current.split("/").last.capitalize - s.puts "================================================================================" + s.puts Dir.current.split("/").last + s.puts DELIMITER s.puts File.read("./LICENSE") - s.puts "================================================================================" + s.puts DELIMITER s.puts "\n\n" end Dir.glob("./lib/*/LICENSE", "./lib/*/license").each do |path| - s.puts path.match(/^\.\/lib\/([^\/]+)\//).try(&.[1]).to_s.capitalize - s.puts "================================================================================" + s.puts path.match(/^\.\/lib\/([^\/]+)\//).try(&.[1]).to_s + s.puts DELIMITER s.puts File.read(path) - s.puts "================================================================================" + s.puts DELIMITER s.puts "\n\n" end end -puts licenses +puts LICENSES diff --git a/src/compiled_license/version.cr b/src/compiled_license/version.cr deleted file mode 100644 index 2c264a8..0000000 --- a/src/compiled_license/version.cr +++ /dev/null @@ -1,3 +0,0 @@ -module CompiledLicense - VERSION = "1.0.0" -end