From a87a77befc04eff017f61fdd815097906ca3b6e0 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 29 Apr 2015 19:26:32 +0100 Subject: [PATCH] Use simple-mmap gem for tile expiry The mmap gem doesn't build with ruby 1.9 or newer. --- cookbooks/tile/files/default/ruby/expire.rb | 4 ++-- cookbooks/tile/recipes/default.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbooks/tile/files/default/ruby/expire.rb b/cookbooks/tile/files/default/ruby/expire.rb index f129e3510..1392229e8 100755 --- a/cookbooks/tile/files/default/ruby/expire.rb +++ b/cookbooks/tile/files/default/ruby/expire.rb @@ -5,7 +5,7 @@ require "proj4" require "xml/libxml" require "set" require "time" -require "mmap" +require "simple-mmap" module Expire # projection object to go from latlon -> spherical mercator @@ -164,7 +164,7 @@ module Expire # open the cache def initialize(filename) - @cache = Mmap.new(filename) + @cache = SimpleMmap::FileWindow.open(filename) throw "Unexpected format" unless @cache[0..3].unpack("l").first == 1 throw "Unexpected ID size" unless @cache[4..7].unpack("l").first == 8 diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index d51d9d367..8d462414c 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -403,7 +403,7 @@ package "libxml2-dev" gem_package "proj4rb" gem_package "libxml-ruby" -gem_package "mmap" +gem_package "simple-mmap" remote_directory "/usr/local/lib/site_ruby" do source "ruby" -- 2.39.5