Class: Inliner::Compilers::Compiler
- Inherits:
-
Object
- Object
- Inliner::Compilers::Compiler
- Defined in:
- lib/ffi-inliner/inliner.rb
Instance Attribute Summary collapse
-
#progname ⇒ Object
readonly
Returns the value of attribute progname.
Class Method Summary collapse
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(fm = nil, libraries = nil) ⇒ Compiler
constructor
A new instance of Compiler.
Constructor Details
#initialize(fm = nil, libraries = nil) ⇒ Compiler
Returns a new instance of Compiler.
70 71 72 73 74 |
# File 'lib/ffi-inliner/inliner.rb', line 70 def initialize(fm = nil, libraries = nil) @fm = fm @libraries = libraries @progname = cmd.split.first end |
Instance Attribute Details
#progname ⇒ Object (readonly)
Returns the value of attribute progname.
61 62 63 |
# File 'lib/ffi-inliner/inliner.rb', line 61 def progname @progname end |
Class Method Details
.check_and_create(fm = nil, libraries = nil) ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'lib/ffi-inliner/inliner.rb', line 62 def self.check_and_create(fm = nil, libraries = nil) compiler = new(fm, libraries) unless compiler.exists? raise "Can't find compiler #{compiler.class}" else compiler end end |
Instance Method Details
#compile ⇒ Object
75 76 77 |
# File 'lib/ffi-inliner/inliner.rb', line 75 def compile raise "Compile error! See #{@fm.log_fn}" unless system(cmd) end |