Class: Updater

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/maplibre-gl/updater.rb

Constant Summary collapse

BASE_URL =

Base assets storage URL TODO: Change this to Maplibre API or source

'https://api.tiles.mapbox.com/mapbox-gl-js'.freeze

Instance Method Summary collapse

Instance Method Details

#updateObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/maplibre-gl/updater.rb', line 14

def update
  self.destination_root = 'app/assets'

  get File.join(BASE_URL, "v#{MaplibreGl::Rails::VERSION::STRING}/maplibre-gl-dev.js"), 'javascripts/maplibre-gl.js'
  get File.join(BASE_URL, "v#{MaplibreGl::Rails::VERSION::STRING}/maplibre-gl.css"), 'stylesheets/maplibre-gl.css'

  inside destination_root do
    run('sass-convert -F css -T scss stylesheets/maplibre-gl.css stylesheets/maplibre-gl.scss')
  end

  remove_file 'stylesheets/maplibre-gl.css'

end