Module: MagikkuHelpers
- Included in:
- MagikkuFFI
- Defined in:
- lib/magikku/convenience.rb
Instance Method Summary collapse
-
#check_syntax(fname, params = {}) ⇒ Object
A convenience method for checking syntax of magicdb files.
-
#compile(fname, params = {}) ⇒ Object
A convenience method for compiling magicdb files.
-
#file(fname, params = {}) ⇒ Object
A convenience method for identifying file contents.
-
#string(buf, params = {}) ⇒ Object
A convenience method for identifying string contents.
Instance Method Details
#check_syntax(fname, params = {}) ⇒ Object
A convenience method for checking syntax of magicdb files.
Note: syntax errors and warnings may be displayed on stderr.
14 15 16 17 18 19 20 21 |
# File 'lib/magikku/convenience.rb', line 14 def check_syntax(fname, params={}) m=new(params) begin return m.check_syntax(fname) ensure m.close() end end |
#compile(fname, params = {}) ⇒ Object
A convenience method for compiling magicdb files.
34 35 36 37 38 39 40 41 |
# File 'lib/magikku/convenience.rb', line 34 def compile(fname, params={}) m=new(params) begin return m.compile(fname) ensure m.close() end end |
#file(fname, params = {}) ⇒ Object
A convenience method for identifying file contents
53 54 55 56 57 58 59 60 |
# File 'lib/magikku/convenience.rb', line 53 def file(fname, params={}) m=new(params) begin return m.file(fname) ensure m.close() end end |
#string(buf, params = {}) ⇒ Object
A convenience method for identifying string contents
72 73 74 75 76 77 78 79 |
# File 'lib/magikku/convenience.rb', line 72 def string(buf, params={}) m=new(params) begin return m.string(buf) ensure m.close() end end |