Sha256: 3ff93c138b89629565fd2116bc1fc8517f0e2c6aae92b20b5d6d072cfe230d0f
Contents?: true
Size: 546 Bytes
Versions: 14
Compression:
Stored size: 546 Bytes
Contents
require 'json' # A Backend implementation capable of reading JSON syntax class Puppet::Pops::Binder::Hiera2::JsonBackend < Puppetx::Puppet::Hiera2Backend def read_data(module_dir, source) begin source_file = File.join(module_dir, "#{source}.json") JSON.parse(File.read(source_file)) rescue Errno::ENOTDIR # This is OK, the file doesn't need to be present. Return an empty hash {} rescue Errno::ENOENT # This is OK, the file doesn't need to be present. Return an empty hash {} end end end
Version data entries
14 entries across 14 versions & 1 rubygems