class ChefCLI::Policyfile::ComparisonBase::Local
Attributes
policyfile_lock_relpath[R]
Public Class Methods
new(policyfile_lock_relpath)
click to toggle source
# File lib/chef-cli/policyfile/comparison_base.rb, line 34 def initialize(policyfile_lock_relpath) @policyfile_lock_relpath = policyfile_lock_relpath end
Public Instance Methods
lock()
click to toggle source
# File lib/chef-cli/policyfile/comparison_base.rb, line 42 def lock raise LockfileNotFound, "Expected lockfile at #{policyfile_lock_relpath} does not exist" unless File.exist?(policyfile_lock_relpath) raise LockfileNotFound, "Expected lockfile at #{policyfile_lock_relpath} cannot be read" unless File.readable?(policyfile_lock_relpath) FFI_Yajl::Parser.parse(IO.read(policyfile_lock_relpath)) rescue FFI_Yajl::ParseError => e raise MalformedLockfile, "Invalid JSON in lockfile at #{policyfile_lock_relpath}:\n #{e.message}" end
name()
click to toggle source
# File lib/chef-cli/policyfile/comparison_base.rb, line 38 def name "local:#{policyfile_lock_relpath}" end