Sha256: 22e7213c68f2ad710bc309b694e3934a302a188a6ca7b559754ea6e391ae48e5

Contents?: true

Size: 952 Bytes

Versions: 19

Compression:

Stored size: 952 Bytes

Contents

# frozen_string_literal: true

class Proscenium::SideLoad
  module EnsureLoaded
    def self.included(child)
      child.class_eval do
        append_after_action do
          if Proscenium::Current.loaded
            if Proscenium::Current.loaded[:js].present?
              raise NotIncludedError, 'There are javascripts to be side loaded, but they have not ' \
                                      'been included. Did you forget to add the ' \
                                      '`#side_load_javascripts` helper in your views?'
            end

            if Proscenium::Current.loaded[:css].present?
              raise NotIncludedError, 'There are stylesheets to be side loaded, but they have not ' \
                                      'been included. Did you forget to add the ' \
                                      '`#side_load_stylesheets` helper in your views?'
            end
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
proscenium-0.9.1-x86_64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.9.1-aarch64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.9.1-arm64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.9.1-x86_64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.9.0-x86_64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.9.0-aarch64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.9.0-arm64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.9.0-x86_64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.8.2-x86_64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.8.2-aarch64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.8.2-arm64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.8.2-x86_64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.8.0-aarch64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.8.0-arm64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.8.0-x86_64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.7.0-x86_64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.7.0-aarch64-linux lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.7.0-arm64-darwin lib/proscenium/side_load/ensure_loaded.rb
proscenium-0.7.0-x86_64-darwin lib/proscenium/side_load/ensure_loaded.rb