Class: Inliner::FilenameManager
- Inherits:
-
Object
- Object
- Inliner::FilenameManager
- Defined in:
- lib/ffi-inliner/inliner.rb
Instance Method Summary collapse
- #base_fn ⇒ Object
- #cached? ⇒ Boolean
- #exists? ⇒ Boolean
-
#initialize(mod, code) ⇒ FilenameManager
constructor
A new instance of FilenameManager.
- #so_fn ⇒ Object
Constructor Details
#initialize(mod, code) ⇒ FilenameManager
Returns a new instance of FilenameManager.
38 39 40 41 |
# File 'lib/ffi-inliner/inliner.rb', line 38 def initialize(mod, code) @mod = mod.name.gsub('::', '__') @code = code end |
Instance Method Details
#base_fn ⇒ Object
48 49 50 |
# File 'lib/ffi-inliner/inliner.rb', line 48 def base_fn File.join(Inliner.directory, "#{@mod}_#{(Digest::MD5.new << @code).to_s[0, 4]}") end |
#cached? ⇒ Boolean
42 43 44 |
# File 'lib/ffi-inliner/inliner.rb', line 42 def cached? exists? end |
#exists? ⇒ Boolean
45 46 47 |
# File 'lib/ffi-inliner/inliner.rb', line 45 def exists? File.exists?(c_fn) end |
#so_fn ⇒ Object
54 55 56 |
# File 'lib/ffi-inliner/inliner.rb', line 54 def so_fn "#{base_fn}#{LIB_EXT}" end |