Class: HMap::TargetVFSWriter
- Inherits:
-
Object
- Object
- HMap::TargetVFSWriter
- Defined in:
- lib/hmap/xc/target/target_vfs.rb
Instance Attribute Summary collapse
-
#entrys ⇒ Object
readonly
Returns the value of attribute entrys.
Instance Method Summary collapse
-
#initialize(entrys) ⇒ TargetVFSWriter
constructor
A new instance of TargetVFSWriter.
- #write!(path) ⇒ Object
Constructor Details
#initialize(entrys) ⇒ TargetVFSWriter
Returns a new instance of TargetVFSWriter.
111 112 113 |
# File 'lib/hmap/xc/target/target_vfs.rb', line 111 def initialize(entrys) @entrys = entrys end |
Instance Attribute Details
#entrys ⇒ Object (readonly)
Returns the value of attribute entrys.
109 110 111 |
# File 'lib/hmap/xc/target/target_vfs.rb', line 109 def entrys @entrys end |
Instance Method Details
#write!(path) ⇒ Object
115 116 117 118 119 120 121 122 123 |
# File 'lib/hmap/xc/target/target_vfs.rb', line 115 def write!(path) es = @entrys.map do |entry| VFS::FileCollectorEntry.new(entry.real_path, entry.virtual_path) end.uniq fc = VFS::FileCollector.new(es) pa = Pathname.new(path) pa.dirname.mkpath unless pa.exist? fc.write_mapping(pa) end |