magic.cr 0.1.0
magic.cr
Crystal bindings to libmagic
.
Installation
-
Add the dependency to your
shard.yml
:dependencies: magic: github: naqvis/magic.cr
-
Run
shards install
Usage
require "magic"
# File Name
puts Magic.detect("README.md")
# File object
File.open("README.md") do |file|
puts Magic.detect(file)
end
# Contents
puts Magic.detect(File.read("README.md").to_slice)
Contributing
- Fork it (https://github.com/naqvis/magic.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Ali Naqvi - creator and maintainer
Repository
magic.cr
Owner
Statistic
- 6
- 0
- 0
- 1
- 0
- almost 4 years ago
- June 8, 2021
License
MIT License
Links
Synced at
Thu, 08 May 2025 17:15:51 GMT
Languages