Class: EPM::Compile
- Inherits:
-
Object
- Object
- EPM::Compile
- Defined in:
- lib/epm/compile.rb
Instance Method Summary collapse
- #compile ⇒ Object
- #compile_lll ⇒ Object
- #compile_mutan ⇒ Object
- #compile_serpent ⇒ Object
-
#initialize(file, settings = {}) ⇒ Compile
constructor
A new instance of Compile.
Constructor Details
#initialize(file, settings = {}) ⇒ Compile
Returns a new instance of Compile.
5 6 7 8 |
# File 'lib/epm/compile.rb', line 5 def initialize file, settings={} @file = EPM::FileHelpers.file_guard file @settings = settings end |
Instance Method Details
#compile ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/epm/compile.rb', line 10 def compile if @file if File.extname(@file) == '.lll' return compile_lll elsif File.extname(@file) == ('.mu' || '.mut') return compile_mutan elsif File.extname(@file) == ('.se' || '.ser') return compile_serpent end end end |
#compile_lll ⇒ Object
22 23 24 25 26 27 |
# File 'lib/epm/compile.rb', line 22 def compile_lll contract = `#{@settings["path-to-lllc"]} #{@file}` contract.chomp! contract = EPM::HexData.hex_guard contract return contract end |