Class: Dir
- Inherits:
-
Object
- Object
- Dir
- Defined in:
- lib/mb/core_ext/dir.rb
Class Method Summary collapse
-
.has_chef_metadata?(path) ⇒ Boolean
Check if the given directory contains a Chef metadata file.
-
.has_mb_file?(path) ⇒ Boolean
Check if the given directory contains a motherbrain plugin file.
-
.has_mb_plugin?(path) ⇒ Boolean
Check if the given directory contains a cookbook with a motherbrain plugin.
Class Method Details
.has_chef_metadata?(path) ⇒ Boolean
Check if the given directory contains a Chef metadata file
32 33 34 35 |
# File 'lib/mb/core_ext/dir.rb', line 32 def (path) File.exist?(File.join(path, MB::CookbookMetadata::RUBY_FILENAME)) || File.exist?(File.join(path, MB::CookbookMetadata::JSON_FILENAME)) end |
.has_mb_file?(path) ⇒ Boolean
Check if the given directory contains a motherbrain plugin file
22 23 24 |
# File 'lib/mb/core_ext/dir.rb', line 22 def has_mb_file?(path) File.exist?(File.join(path, MB::Plugin::PLUGIN_FILENAME)) end |
.has_mb_plugin?(path) ⇒ Boolean
Check if the given directory contains a cookbook with a motherbrain plugin
9 10 11 12 13 14 |
# File 'lib/mb/core_ext/dir.rb', line 9 def has_mb_plugin?(path) return false unless exists?(path) return false unless has_mb_file?(path) return false unless (path) true end |