Class: File
- Inherits:
-
Object
- Object
- File
- Defined in:
- lib/mb/core_ext/file.rb
Class Method Summary collapse
-
.is_chef_metadata?(filepath) ⇒ Boolean
Determine if the given filepath points to a Chef metadata file.
-
.is_mb_plugin?(filepath) ⇒ Boolean
Determine if the given filepath points to a motherbrain plugin file.
Class Method Details
.is_chef_metadata?(filepath) ⇒ Boolean
Determine if the given filepath points to a Chef metadata file
8 9 10 11 12 |
# File 'lib/mb/core_ext/file.rb', line 8 def (filepath) return false unless exists?(filepath) filename = basename(filepath) filename == MB::CookbookMetadata::RUBY_FILENAME || filename == MB::CookbookMetadata::JSON_FILENAME end |
.is_mb_plugin?(filepath) ⇒ Boolean
Determine if the given filepath points to a motherbrain plugin file
19 20 21 22 |
# 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 |