class RemoteResourceLoader

Public Instance Methods

cleanup() click to toggle source
# File lib/mapbox-rails/remote_resource_loader.rb, line 36
def cleanup
  self.destination_root = 'app/assets'
  remove_file 'stylesheets/mapbox.css'
end
convert() click to toggle source
# File lib/mapbox-rails/remote_resource_loader.rb, line 21
def convert
  self.destination_root = 'app/assets'
  inside destination_root do
    run('sass-convert -F css -T scss stylesheets/mapbox.css stylesheets/mapbox.scss')
    gsub_file 'stylesheets/mapbox.scss', 'url(images/layers.png)',          "image-url('layers.png')"
    gsub_file 'stylesheets/mapbox.scss', 'url(images/layers-2x.png)',       "image-url('layers-2x.png')"
    gsub_file 'stylesheets/mapbox.scss', 'url(images/marker-icon.png)',     "image-url('marker-icon.png')"
    gsub_file 'stylesheets/mapbox.scss', 'url(images/marker-icon-2x.png)',  "image-url('marker-icon-2x.png')"
    gsub_file 'stylesheets/mapbox.scss', 'url(images/marker-shadow.png)',   "image-url('marker-shadow.png')"
    gsub_file 'stylesheets/mapbox.scss', 'url(images/icons-000000@2x.png)', "image-url('icons-000000@2x.png')"
    gsub_file 'stylesheets/mapbox.scss', 'url(images/icons-ffffff@2x.png)', "image-url('icons-ffffff@2x.png')"
  end
end
fetch() click to toggle source
# File lib/mapbox-rails/remote_resource_loader.rb, line 7
def fetch
  self.destination_root = 'app/assets'
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/mapbox.uncompressed.js",      "javascripts/mapbox.js"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/mapbox.css",                  "stylesheets/mapbox.css"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/images/layers.png",           "images/layers.png"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/images/layers-2x.png",        "images/layers-2x.png"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/images/marker-icon.png",      "images/marker-icon.png"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/images/marker-icon-2x.png",   "images/marker-icon-2x.png"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/images/marker-shadow.png",    "images/marker-shadow.png"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/images/icons-000000@2x.png",  "images/icons-000000@2x.png"
  get "http://api.tiles.mapbox.com/mapbox.js/v#{Mapbox::Rails::MAPBOX_VERSION}/images/icons-ffffff@2x.png",  "images/icons-ffffff@2x.png"
end