lib/gumdrop/data_providers/yamldoc.rb in gumdrop-1.0.1 vs lib/gumdrop/data_providers/yamldoc.rb in gumdrop-1.0.2
- old
+ new
@@ -1,8 +1,15 @@
module Gumdrop::Data
- class YAMLDocDataProvider < YAMLandJSONDataProvider
+ class YAMLDocDataProvider < Provider
extension :yamldoc
+
+ def available?
+ require 'yaml'
+ true
+ rescue LoadError
+ false
+ end
def data_for(filepath)
yamldoc= Gumdrop::Util::YamlDoc.new File.read(filepath), true
supply_data yamldoc.data
end