Method: RemoteResourceLoader#convert

Defined in:
lib/mapbox-rails/remote_resource_loader.rb

#convertObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# 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/[email protected])', "image-url('[email protected]')"
    gsub_file 'stylesheets/mapbox.scss', 'url(images/[email protected])', "image-url('[email protected]')"
  end
end