Compare commits

..

15 commits

Author SHA1 Message Date
00fc5c46bb Update 'README.md' 2022-02-06 19:53:31 +00:00
993eae03d5 Update 'README.md' 2022-02-06 19:52:37 +00:00
d1d8104ab4 added automatic version fetching 2021-10-23 13:42:39 +02:00
59f49d2f92 updated version 2021-10-23 12:56:54 +02:00
d02b58c655 fixed typo 2021-10-23 12:55:14 +02:00
e3bd2f268c updated readme 2021-10-23 12:23:54 +02:00
88e6e0de7a updated readme 2021-10-23 12:23:24 +02:00
2bd7f722d0 updated usage 2021-10-23 12:20:18 +02:00
22ab96d7d0 rewrite 2021-10-23 12:17:50 +02:00
Isaac Sloan
ba052e31f8 Bumped version number to v1.0.0. 2021-05-12 14:35:57 -07:00
Isaac Sloan
307ab40b44
Update README.md 2018-04-02 22:03:14 -06:00
Isaac Sloan
cdca2f5832
Update README.md 2018-04-02 21:59:18 -06:00
Isaac Sloan
65207213db
Update README.md 2018-04-02 21:59:00 -06:00
Isaac Sloan
759e503f08
Update README.md 2018-04-02 21:58:44 -06:00
Isaac Sloan
f287c2c8c9 Bumped version number to v0.1.3. 2018-04-02 21:42:09 -06:00
8 changed files with 41 additions and 41 deletions

View file

@ -1 +0,0 @@
language: crystal

View file

@ -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 ## Installation
@ -9,24 +12,28 @@ Add this to your application's `shard.yml`:
```yaml ```yaml
dependencies: dependencies:
compiled_license: compiled_license:
github: elorest/compiled_license git: https://git.dergrimm.net/dergrimm/compiled_license.git
``` ```
## Usage ## Usage
```crystal ```crystal
require "compiled_license" require "compiled_license"
puts CompiledLicense::LICENSES
``` ```
TODO: Write usage instructions here Compile and run
## Development ```
$ crystal build src/testapp.cr
TODO: Write development instructions here $ testapp
# Returns all licenses to stdout
```
## Contributing ## 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) 2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature') 3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature) 4. Push to the branch (git push origin my-new-feature)
@ -35,3 +42,4 @@ TODO: Write development instructions here
## Contributors ## Contributors
- [elorest](https://github.com/elorest) Isaac Sloan - creator, maintainer - [elorest](https://github.com/elorest) Isaac Sloan - creator, maintainer
- [grimmigerFuchs](https://git.dergrimm.net/dergrimm) - contributor

View file

@ -1,13 +1,15 @@
name: compiled_license name: compiled_license
version: 0.1.2 version: 2.0.0
authors: authors:
- Isaac Sloan <isaac@isaacsloan.com> - Isaac Sloan <isaac@isaacsloan.com>
- grimmigerFuchs <dominic.grimm@gmail.com>
crystal: 0.24.1 crystal: 1.2.1
license: MIT license: MIT
dependencies: dependencies:
cry: version:
github: elorest/cry github: unn4m3d/version
version: 0.1.1

View file

@ -1,14 +1,15 @@
require "./spec_helper" require "spec"
require "../src/compiled_license"
describe CompiledLicense do describe CompiledLicense do
licenses = {{ run("../src/compiled_license/licenses.cr").stringify }} licenses = CompiledLicense::LICENSES
it "should return string" do it "should return string" do
(licenses.size > 20).should be_true (licenses.size > 20).should be_true
end end
it "should include license of current file" do it "should include license of current file" do
licenses.should contain("Compiled_license") licenses.should contain("compiled_license")
end end
it "should contain name of author from license file" do it "should contain name of author from license file" do

View file

@ -1,2 +0,0 @@
require "spec"
require "../src/compiled_license"

View file

@ -1,14 +1,7 @@
require "./compiled_license/version" require "version"
module Compiled module CompiledLicense
module License VERSION = Version.fetch
def self.display
{{ run("./compiled_license/licenses.cr").stringify }}
end
end
end
if ARGV[0]? && ARGV[0]? == "--licenses" LICENSES = {{ run("./compiled_license/licenses.cr").stringify }}
puts Compiled::License.display
exit 0
end end

View file

@ -1,19 +1,21 @@
licenses = String.build do |s| DELIMITER = "================================================================================"
LICENSES = String.build do |s|
if File.exists?("./LICENSE") if File.exists?("./LICENSE")
s.puts Dir.current.split("/").last.capitalize s.puts Dir.current.split("/").last
s.puts "================================================================================" s.puts DELIMITER
s.puts File.read("./LICENSE") s.puts File.read("./LICENSE")
s.puts "================================================================================" s.puts DELIMITER
s.puts "\n\n" s.puts "\n\n"
end end
Dir.glob("./lib/*/LICENSE", "./lib/*/license").each do |path| Dir.glob("./lib/*/LICENSE", "./lib/*/license").each do |path|
s.puts path.match(/^\.\/lib\/([^\/]+)\//).try(&.[1]).to_s.capitalize s.puts path.match(/^\.\/lib\/([^\/]+)\//).try(&.[1]).to_s
s.puts "================================================================================" s.puts DELIMITER
s.puts File.read(path) s.puts File.read(path)
s.puts "================================================================================" s.puts DELIMITER
s.puts "\n\n" s.puts "\n\n"
end end
end end
puts licenses puts LICENSES

View file

@ -1,3 +0,0 @@
module CompiledLicense
VERSION = "0.1.2"
end