There are no reviews yet. Be the first to send feedback to the community and the maintainers!
= FileMagic Library Binding == VERSION This documentation refers to filemagic version 0.7.3 == DESCRIPTION FileMagic extension module. See also libmagic(3), file(1) and magic(4). === Constants <tt>MAGIC_NONE</tt>:: No flags <tt>MAGIC_DEBUG</tt>:: Turn on debugging <tt>MAGIC_SYMLINK</tt>:: Follow symlinks <tt>MAGIC_COMPRESS</tt>:: Check inside compressed files <tt>MAGIC_DEVICES</tt>:: Look at the contents of devices <tt>MAGIC_MIME</tt>:: Return a mime string <tt>MAGIC_CONTINUE</tt>:: Return all matches, not just the first <tt>MAGIC_CHECK</tt>:: Print warnings to stderr === Methods <tt>file(filename)</tt>:: Returns a textual description of the contents of the filename argument <tt>buffer(string)</tt>:: Returns a textual description of the contents of the string argument <tt>check(filename)</tt>:: Checks the validity of entries in the database file passed in as filename <tt>compile(filename)</tt>:: Compiles the database file passed in as filename <tt>load(filename)</tt>:: Loads the database file passed in as filename <tt>close()</tt>:: Closes the magic database and frees any memory allocated === Synopsis require 'filemagic' p FileMagic::VERSION # => "0.7.3" p FileMagic::MAGIC_VERSION # => "5.39" p FileMagic.new.flags # => [] FileMagic.open(:mime) { |fm| p fm.flags # => [:mime_type, :mime_encoding] p fm.file(__FILE__) # => "text/plain; charset=us-ascii" p fm.file(__FILE__, true) # => "text/plain" fm.flags = [:raw, :continue] p fm.flags # => [:continue, :raw] } fm = FileMagic.new p fm.flags # => [] mime = FileMagic.mime p mime.flags # => [:mime_type, :mime_encoding] === Environment The environment variable +MAGIC+ can be used to set the default magic file name. === Installation Install the gem: sudo gem install ruby-filemagic The file(1) library and headers are required: Debian/Ubuntu:: +libmagic-dev+ Fedora/SuSE:: +file-devel+ Alpine:: <tt>libmagic file file-dev</tt> Gentoo:: +sys-libs/libmagic+ OS X:: <tt>brew install libmagic</tt> === Build native extension rake docker💎 native Requires Docker[https://docker.com] to be installed. == LINKS Homepage:: https://www.darwinsys.com/file/ Documentation:: https://blackwinter.github.io/ruby-filemagic Source code:: https://github.com/blackwinter/ruby-filemagic RubyGem:: https://rubygems.org/gems/ruby-filemagic Travis CI:: https://travis-ci.org/blackwinter/ruby-filemagic == AUTHORS * Travis Whitton <mailto:[email protected]> (Original author) * Jens Wille <mailto:[email protected]> == CREDITS * Martin Carpenter <mailto:[email protected]> for Ruby 1.9.2 compatibility and other improvements. * Pavel Lobashov (@ShockwaveNN) for Dockerfile to build cross-compiled Windows extension (pull request #26). == COPYING The filemagic extension library is copywrited free software by Travis Whitton <[email protected]>. You can redistribute it under the terms specified in the COPYING file of the Ruby distribution. == WARRANTY THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
unicode
Unicode normalization library. (Mirror of Yoshida-san's code base to maintain the RubyGem.)brice
Extra cool IRb goodness for the masses.wadl
Ruby client for the Web Application Description Language.rb-gsl
Ruby interface to the GNU Scientific Library [Ruby 2.x and GSL 1.16 compatible fork of the gsl gem]cmess
Assist with handling messed up encodings.nuggets
Some extensions to the Ruby programming language.libcdb-ruby
Ruby bindings for CDB Constant Databases.dotme
The dotfile managertwitter2jabber
Twitter-to-Jabber gateway.imapget
Get IMAP mails.rss2mail
Send RSS feeds as e-mail.athena
Convert database files to various formats.scratch
Scripts & snippetshen
Just another project helper that integrates with Rake.apache_secure_download
Apache module providing secure downloading functionality, just like Mongrel Secure Download does for mongrel.blackwinter.github.com
My GitHub homepageapache_image_resizer
Apache module providing image resizing functionality.pms
Poor Man's Searchpage_rank
PageRank implementation for Ruby.keyword-expansion
Firefox add-on to expand keywords in bookmark URLs.flattendb
Flatten relational databases.added_methods
Watches for added methods and records them.ontopia-topicmaps
Query topic maps with Ontopia.mediawiki-testwiki
Provides pre-configured MediaWiki wikis as Docker images.libxml-ext
LibXML Ruby extensionsontopia-tldr
Tolog Document Retrieval with Ontopia.cyclops
A command-line option parser.lsi4r
Latent semantic indexing for Ruby.rdk_lab
Tooling for the Semantic MediaWiki implementation of the German art history encyclopedia.midos
A Ruby client for MIDOS databases.birds
Experimental information retrieval system for bibliographic data.current_gem
Gem plugin that maintains symlinks to the most recent versions of installed RubyGems.sinatra-bells
Sinatra with some more bells and whistles.solr-response-digester
Add unique digest to Solr response header.solr4r
A Ruby client for Apache Solr.bismas
A Ruby client for BISMAS databases.docker_helper
Control the Docker command-line client from Ruby.turtle_reader
A convenience wrapper for reading RDF Turtle data.mysql_parser
A parser for MySQL DDL statements.hal4r
Hyperspace analogue to language for Ruby.Love Open Source and this site? Check out how you can help us