Module: EverydayPlugins::Loader

Defined in:
lib/everyday-plugins/plugin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.depend(*deps, &block) ⇒ Object



100
101
102
103
104
105
106
# File 'lib/everyday-plugins/plugin.rb', line 100

def self.depend(*deps, &block)
  met = deps.all? { |dep|
    matches = Gem::Specification.find_all_by_name(*dep)
    !(matches.nil? || matches.empty?)
  }
  block.call if met
end

Instance Method Details

#depend(*deps, &block) ⇒ Object



96
97
98
# File 'lib/everyday-plugins/plugin.rb', line 96

def depend(*deps, &block)
  EverydayPlugins::Loader.depend(*deps, &block)
end