Sha256: f335cff3222335297c853e08b6682584b1b2a0a79b19ae9af44ba11623f1c932
Contents?: true
Size: 994 Bytes
Versions: 15
Compression:
Stored size: 994 Bytes
Contents
class Dir class << self # Check if the given directory contains a cookbook with a motherbrain plugin # # @param [#to_s] path # the directory path # # @return [Boolean] def has_mb_plugin?(path) return false unless exists?(path) return false unless has_mb_file?(path) return false unless has_chef_metadata?(path) true end # Check if the given directory contains a motherbrain plugin file # # @param [#to_s] path # the directory path # # @return [Boolean] def has_mb_file?(path) File.exist?(File.join(path, MB::Plugin::PLUGIN_FILENAME)) end # Check if the given directory contains a Chef metadata file # # @param [#to_s] path # the directory path # # @return [Boolean] def has_chef_metadata?(path) File.exist?(File.join(path, MB::CookbookMetadata::RUBY_FILENAME)) || File.exist?(File.join(path, MB::CookbookMetadata::JSON_FILENAME)) end end end
Version data entries
15 entries across 15 versions & 1 rubygems