Sha256: e73c4d1fec64c6c343b103b4a913e31efa11e8881a20220122a60ef69251235a

Contents?: true

Size: 441 Bytes

Versions: 10

Compression:

Stored size: 441 Bytes

Contents

class Importmap::Reloader
  delegate :execute_if_updated, :execute, :updated?, to: :updater

  def reload!
    import_map_paths.each { |path| Rails.application.importmap.draw(path) }
  end

  private
    def updater
      @updater ||= config.file_watcher.new(import_map_paths) { reload! }
    end

    def import_map_paths
      config.paths["config/importmap.rb"].existent
    end

    def config
      Rails.application.config
    end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
importmap-rails-0.8.2 lib/importmap/reloader.rb
importmap-rails-0.8.1 lib/importmap/reloader.rb
importmap-rails-0.8.0 lib/importmap/reloader.rb
importmap-rails-0.7.6 lib/importmap/reloader.rb
importmap-rails-0.7.5 lib/importmap/reloader.rb
importmap-rails-0.7.4 lib/importmap/reloader.rb
importmap-rails-0.7.3 lib/importmap/reloader.rb
importmap-rails-0.7.2 lib/importmap/reloader.rb
importmap-rails-0.7.1 lib/importmap/reloader.rb
importmap-rails-0.7.0 lib/importmap/reloader.rb