Sha256: 7bf4354769bdde669240733367b76944e8a7c7661a08d0f82f6cacd9c36c6e21
Contents?: true
Size: 726 Bytes
Versions: 2
Compression:
Stored size: 726 Bytes
Contents
# frozen_string_literal: true module Fixturizer module Serializers class Template attr_reader :data def initialize(data:, options: nil) @data = data @options = options end def apply raise "Abstract template, don't use" end def write_file(file, data) File.write(file, data) rescue Errno::EACCES puts "Error: Permission denied to write the file #{file}." rescue Errno::ENOSPC puts 'Error: No space left on the device.' rescue StandardError => e puts "Error: #{e.message}" end end end end Dir["#{File.dirname(__FILE__)}/*.rb"].each { |file| require file unless File.basename(file) == 'init.rb' }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fixturizer-0.4.4 | lib/fixturizer/serializers/init.rb |
fixturizer-0.4.3 | lib/fixturizer/serializers/init.rb |