vendor/gems/ziya-2.1.7/lib/ziya/maps/base.rb
def inflate( clazz, theme, instance=nil )
      class_name  = clazz.to_s.gsub( /Ziya::Maps/, '' ).ziya_underscore.gsub( /\//, '' )      
      class_name += '_map' unless class_name.match( /.?_map$/ ) 
      begin
        file_name = "#{theme}/#{class_name}"
        file_name = "#{theme}/#{instance}" unless instance.nil?
        Ziya.logger.debug ">>> Ziya attempt to load map stylesheet file '#{file_name}"        
        yml = IO.read( "#{file_name}.yml" )
        processed = erb_render( yml )
# puts ">>> Processed yaml", processed        
        load = YAML::load( processed )
        Ziya.logger.debug ">>> ZiYa [loading map styles] -- #{file_name}.yml"
# puts load.inspect        
        return load
      rescue SystemCallError => boom
        Ziya.logger.debug "ERROR #{boom}"
        ; # ignore if no style file...
      rescue => bang
        Ziya.logger.debug ">>> ZiYa -- Error encountered loading map file `#{file_name} -- #{bang}" 
        bang.backtrace.each { |l| Ziya.logger.debug( l ) }
      end
      nil
    end
# load yaml file associated with class if any
load yaml file associated with class if any
load yaml file associated with class if any
def inflate( clazz, theme, instance=nil )
      class_name  = clazz.to_s.gsub( /Ziya::Maps/, '' ).ziya_underscore.gsub( /\//, '' )      
      class_name += '_map' unless class_name.match( /.?_map$/ ) 
      begin
        file_name = "#{theme}/#{class_name}"
        file_name = "#{theme}/#{instance}" unless instance.nil?
        Ziya.logger.debug ">>> Ziya attempt to load map stylesheet file '#{file_name}"        
        yml = IO.read( "#{file_name}.yml" )
        processed = erb_render( yml )
        load = YAML::load( processed )
        Ziya.logger.debug ">>> ZiYa [loading map styles] -- #{file_name}.yml"
        return load
      rescue SystemCallError => boom
        Ziya.logger.debug "ERROR #{boom}"
        ; 
      rescue => bang
        Ziya.logger.debug ">>> ZiYa -- Error encountered loading map file `#{file_name} -- #{bang}" 
        bang.backtrace.each { |l| Ziya.logger.debug( l ) }
      end
      nil
    end
def inflate ( clazz , theme , instance = nil ) class_name = clazz . to_s . gsub ( / Ziya::Maps / , '' ) . ziya_underscore . gsub ( / \/ / , '' ) class_name += '_map' unless class_name . match ( / .?_map$ / ) begin file_name = "#{theme}/#{class_name}" file_name = "#{theme}/#{instance}" unless instance . nil? Ziya . logger . debug ">>> Ziya attempt to load map stylesheet file '#{file_name}" yml = IO . read ( "#{file_name}.yml" ) processed = erb_render ( yml ) load = YAML :: load ( processed ) Ziya . logger . debug ">>> ZiYa [loading map styles] -- #{file_name}.yml" return load rescue SystemCallError => boom Ziya . logger . debug "ERROR #{boom}" ; rescue => bang Ziya . logger . debug ">>> ZiYa -- Error encountered loading map file `#{file_name} -- #{bang}" bang . backtrace . each { | l | Ziya . logger . debug ( l ) } end nil end
load yaml file associated with class if any
load yaml file associated with class if any
# puts ">>> Processed yaml", processed         # puts load.inspect         # ignore if no style file...
clazz
theme
instance