Sha256: 2624e3fa32b0a7197c4948132c4d021a543c29e342c309c42d5c297982ee2a47
Contents?: true
Size: 570 Bytes
Versions: 5
Compression:
Stored size: 570 Bytes
Contents
module RobotVim class InputFile def self.path_for(input, &block) if File.exists?(input) yield_existing_file_path(input, block) else yield_on_demand_file_path(input, block) end end def self.yield_existing_file_path(input, block) block.call(input) end def self.yield_on_demand_file_path(input, block) file_name = FileNameGenerator.generate File.open(file_name, "w+") do |file| file << input end block.call(file_name) ensure File.delete(file_name) end end end
Version data entries
5 entries across 5 versions & 1 rubygems