Compare commits
15 commits
Author | SHA1 | Date | |
---|---|---|---|
Dominic Grimm | 00fc5c46bb | ||
Dominic Grimm | 993eae03d5 | ||
Dominic Grimm | d1d8104ab4 | ||
Dominic Grimm | 59f49d2f92 | ||
Dominic Grimm | d02b58c655 | ||
Dominic Grimm | e3bd2f268c | ||
Dominic Grimm | 88e6e0de7a | ||
Dominic Grimm | 2bd7f722d0 | ||
Dominic Grimm | 22ab96d7d0 | ||
ba052e31f8 | |||
307ab40b44 | |||
cdca2f5832 | |||
65207213db | |||
759e503f08 | |||
f287c2c8c9 |
|
@ -1 +0,0 @@
|
|||
language: crystal
|
24
README.md
24
README.md
|
@ -1,6 +1,9 @@
|
|||
# compiled_license
|
||||
# Compiled License
|
||||
|
||||
TODO: Write a description here
|
||||
*A fork of [elorest's library](https://github.com/elorest/compiled_license).*
|
||||
|
||||
Compiles the licences of all shards used in project into binary.
|
||||
This allows you to legally distribute binaries without having to package the licenses files from the shards.
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -9,24 +12,28 @@ Add this to your application's `shard.yml`:
|
|||
```yaml
|
||||
dependencies:
|
||||
compiled_license:
|
||||
github: elorest/compiled_license
|
||||
git: https://git.dergrimm.net/dergrimm/compiled_license.git
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```crystal
|
||||
require "compiled_license"
|
||||
|
||||
puts CompiledLicense::LICENSES
|
||||
```
|
||||
|
||||
TODO: Write usage instructions here
|
||||
Compile and run
|
||||
|
||||
## Development
|
||||
|
||||
TODO: Write development instructions here
|
||||
```
|
||||
$ crystal build src/testapp.cr
|
||||
$ testapp
|
||||
# Returns all licenses to stdout
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork it ( https://github.com/elorest/compiled_license/fork )
|
||||
1. Fork it ( https://github.com/grimmigerFuchs/compiled_license/fork )
|
||||
2. Create your feature branch (git checkout -b my-new-feature)
|
||||
3. Commit your changes (git commit -am 'Add some feature')
|
||||
4. Push to the branch (git push origin my-new-feature)
|
||||
|
@ -35,3 +42,4 @@ TODO: Write development instructions here
|
|||
## Contributors
|
||||
|
||||
- [elorest](https://github.com/elorest) Isaac Sloan - creator, maintainer
|
||||
- [grimmigerFuchs](https://git.dergrimm.net/dergrimm) - contributor
|
||||
|
|
10
shard.yml
10
shard.yml
|
@ -1,13 +1,15 @@
|
|||
name: compiled_license
|
||||
version: 0.1.2
|
||||
version: 2.0.0
|
||||
|
||||
authors:
|
||||
- Isaac Sloan <isaac@isaacsloan.com>
|
||||
- grimmigerFuchs <dominic.grimm@gmail.com>
|
||||
|
||||
crystal: 0.24.1
|
||||
crystal: 1.2.1
|
||||
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
cry:
|
||||
github: elorest/cry
|
||||
version:
|
||||
github: unn4m3d/version
|
||||
version: 0.1.1
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
require "spec"
|
||||
require "../src/compiled_license"
|
|
@ -1,14 +1,7 @@
|
|||
require "./compiled_license/version"
|
||||
require "version"
|
||||
|
||||
module Compiled
|
||||
module License
|
||||
def self.display
|
||||
{{ run("./compiled_license/licenses.cr").stringify }}
|
||||
end
|
||||
end
|
||||
end
|
||||
module CompiledLicense
|
||||
VERSION = Version.fetch
|
||||
|
||||
if ARGV[0]? && ARGV[0]? == "--licenses"
|
||||
puts Compiled::License.display
|
||||
exit 0
|
||||
LICENSES = {{ run("./compiled_license/licenses.cr").stringify }}
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
module CompiledLicense
|
||||
VERSION = "0.1.2"
|
||||
end
|
Loading…
Reference in a new issue