This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
@tile = Tile.find_by_zoom_and_lat_and_lon(params["zoom"], params["lat"], params["lon"]) | |
@tile.create_tiles_dir_and_url | |
@tile.send_later(:destroy_tiles_dir, "#{RAILS_ROOT}/public/#{@tile.url}") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tile < ActiveRecord::Base | |
attr_accessible :url, :file, :lon, :lat, :zoom, :url_params | |
def destroy_tiles_dir(path) | |
system("sleep(2)") | |
system("rm #{path}") | |
end | |
def create_tiles_dir_and_url | |
tiles_dir = "/static_tiles/"+UUID.generate | |
self.url = tiles_dir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% title "Tile" %> | |
<p> | |
<%=image_tag @tile.url+'/'[email protected] %> | |
</p> | |
<p> | |
<%= link_to "View All", tiles_path %> | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% title "Tile" %> | |
<p> | |
<%=image_tag @tile.url+'/'[email protected] %> | |
</p> | |
<p> | |
<%= link_to "View All", tiles_path %> | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* \.(gif|jpg|png|jpeg)${ | |
return 403 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir.pwd | |
# => "/Users/sabman/Documents/03_current_projects/kashi-georuby/ruby/spatial_adapter" | |
$: << './lib' | |
require "rubygems" | |
require "active_record" | |
require 'spatial_adapter/sqlite3.rb' | |
#load 'spatial_adapter/sqlite3.rb' # if testing changes | |
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "spatial_adapter.sqlite3") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file 'Gemfile', <<-GEMS | |
source 'http://gemcutter.org' | |
gem "rails", "3.0.0.beta3" | |
gem "bson_ext" | |
gem "mongoid", "2.0.0.beta4" | |
gem "haml", "3.0.0.rc.2" | |
gem "compass", "0.10.0.rc4" | |
gem "inherited_resources" | |
group :test do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file 'Gemfile', <<-GEMS | |
source 'http://gemcutter.org' | |
gem "rails", "3.0.0.beta4" | |
gem "bson_ext" | |
gem "mongoid", "2.0.0.beta4" | |
gem "haml", "3.0.0.rc.2" | |
gem "compass", "0.10.0.rc4" | |
gem "inherited_resources" | |
group :test do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Swig <Formula | |
url 'http://downloads.sourceforge.net/sourceforge/swig/swig-2.0.0.tar.gz' | |
homepage 'http://www.swig.org/' | |
md5 '36ee2d9974be46a9f0a36460af928eb9' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}" | |
system "make" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Gdal <Formula | |
url 'http://download.osgeo.org/gdal/gdal-1.7.2.tar.gz' | |
homepage 'http://www.gdal.org/' | |
md5 '05351f8cb61761ae579667e24a297fe6' | |
def options | |
[ | |
['--with-pg', "Include PostgreSQL support."], |