Sha256: ac21edc85c03663d3d84660abe80f465176a9432c1c267b79ae565322903a121

Contents?: true

Size: 350 Bytes

Versions: 1

Compression:

Stored size: 350 Bytes

Contents

module Humpyard
  module UriParser
    class AssetsUriParser
      def self.substitute content, options = {}
        content.gsub(/humpyard:\/\/asset\/([0-9]*)/) do |uri| 
          begin
            "#{options[:prefix]}#{Asset.find($1).url}#{options[:postfix]}"  
          rescue
            ''
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
humpyard-0.0.1 lib/humpyard/uri_parser/assets_uri_parser.rb