text: // Generated by CoffeeScript 1.9.1
  (function() {
    var ShioriLoader;
  
    ShioriLoader = (function() {
      function ShioriLoader() {}
  
      ShioriLoader.shiori_detectors = [];
  
      ShioriLoader.shiories = {};
  
      ShioriLoader.detect_shiori = function(fs, dirpath) {
        var iterate;
        iterate = function(index) {
          return new Promise(function(resolve, reject) {
            var detector;
            detector = ShioriLoader.shiori_detectors[index];
            if (detector != null) {
              return resolve(detector(fs, dirpath, ShioriLoader.shiories).then(function(shiori) {
                if (shiori != null) {
                  return shiori;
                } else {
                  return iterate(index + 1);
                }
              }));
            } else {
              return reject(new Error("unknown SHIORI subsystem"));
            }
          });
        };
        return iterate(0);
      };
  
      ShioriLoader.get_shiori = function(fs, shiori_name) {
        return new Promise(function(resolve, reject) {
          return resolve(new ShioriLoader.shiories[shiori_name](fs));
        });
      };
  
      return ShioriLoader;
  
    })();
  
    if ((typeof module !== "undefined" && module !== null ? module.exports : void 0) != null) {
      module.exports = ShioriLoader;
    } else {
      this.ShioriLoader = ShioriLoader;
    }
  
  }).call(this);
  