class File

Public Class Methods

is_chef_metadata?(filepath) click to toggle source

Determine if the given filepath points to a Chef metadata file

@param [#to_s] filepath

@return [Boolean]

# File lib/mb/core_ext/file.rb, line 8
def is_chef_metadata?(filepath)
  return false unless exists?(filepath)
  filename = basename(filepath)
  filename == MB::CookbookMetadata::RUBY_FILENAME || filename == MB::CookbookMetadata::JSON_FILENAME
end
is_mb_plugin?(filepath) click to toggle source

Determine if the given filepath points to a motherbrain plugin file

@param [#to_s] filepath

@return [Boolean]

# File lib/mb/core_ext/file.rb, line 19
def is_mb_plugin?(filepath)
  return false unless exists?(filepath)
  basename(filepath) == MB::Plugin::PLUGIN_FILENAME
end