]> git.openstreetmap.org Git - chef.git/commitdiff
Use simple-mmap gem for tile expiry
authorTom Hughes <tom@compton.nu>
Wed, 29 Apr 2015 18:26:32 +0000 (19:26 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 29 Apr 2015 18:26:32 +0000 (19:26 +0100)
The mmap gem doesn't build with ruby 1.9 or newer.

cookbooks/tile/files/default/ruby/expire.rb
cookbooks/tile/recipes/default.rb

index f129e35104012a74a65540f6595151650b1f0efb..1392229e8ed8c8fe362f48978374e45aa972aa7b 100755 (executable)
@@ -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
index d51d9d3674fef34cccb9bcec9a1afac37be6383a..8d462414c2294594de4771d464fa5d6e70956d3c 100644 (file)
@@ -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"