xref: /minix3/external/bsd/file/dist/magic/magdir/ruby (revision 835f6802383ea18ff9311123031e44be87fb502a)
1*835f6802SDirk Vogt
2ef01931fSBen Gras#------------------------------------------------------------------------------
3*835f6802SDirk Vogt# $File: ruby,v 1.5 2010/07/21 16:47:17 christos Exp $
4*835f6802SDirk Vogt# ruby:  file(1) magic for Ruby scripting language
5ef01931fSBen Gras# URL:  http://www.ruby-lang.org/
6ef01931fSBen Gras# From: Reuben Thomas <rrt@sc3d.org>
7ef01931fSBen Gras
8ef01931fSBen Gras# Ruby scripts
9*835f6802SDirk Vogt0	search/1/w	#!\ /usr/bin/ruby	Ruby script text executable
10*835f6802SDirk Vogt!:mime text/x-ruby
11*835f6802SDirk Vogt0	search/1/w	#!\ /usr/local/bin/ruby	Ruby script text executable
12*835f6802SDirk Vogt!:mime text/x-ruby
13ef01931fSBen Gras0	search/1	#!/usr/bin/env\ ruby	Ruby script text executable
14*835f6802SDirk Vogt!:mime text/x-ruby
15ef01931fSBen Gras0	search/1	#!\ /usr/bin/env\ ruby	Ruby script text executable
16*835f6802SDirk Vogt!:mime text/x-ruby
17*835f6802SDirk Vogt
18*835f6802SDirk Vogt# What looks like ruby, but does not have a shebang
19*835f6802SDirk Vogt# (modules and such)
20*835f6802SDirk Vogt# From: Lubomir Rintel <lkundrak@v3.sk>
21*835f6802SDirk Vogt0	regex		\^[\ \t]*require[\ \t]'[A-Za-z_/]+'
22*835f6802SDirk Vogt>0	regex		include\ [A-Z]|def\ [a-z]|\ do$
23*835f6802SDirk Vogt>>0	regex		\^[\ \t]*end([\ \t]*[;#].*)?$		Ruby script text
24*835f6802SDirk Vogt!:mime	text/x-ruby
25*835f6802SDirk Vogt0	regex		\^[\ \t]*(class|module)[\ \t][A-Z]
26*835f6802SDirk Vogt>0	regex		(modul|includ)e\ [A-Z]|def\ [a-z]
27*835f6802SDirk Vogt>>0	regex		\^[\ \t]*end([\ \t]*[;#].*)?$		Ruby module source text
28*835f6802SDirk Vogt!:mime	text/x-ruby
29