Module: Roda::RodaPlugins::Sprockets::InstanceMethods

Includes:
Sprockets::Helpers
Defined in:
lib/roda/plugins/sprockets.rb

Instance Method Summary collapse

Instance Method Details

#opal_require(file) ⇒ Object

Require Opal assets



115
116
117
118
119
120
121
122
123
# File 'lib/roda/plugins/sprockets.rb', line 115

def opal_require file
  <<~END
    <script>
      Opal.loaded(typeof(OpalLoaded) === "undefined" ? [] : OpalLoaded);
      Opal.require(#{file.to_json});
    </script>
  END
  .gsub(/\s+/, ' ').chop
end

#sprockets_helpers_settingsObject

Overload of Sprockets::Helpers#sprockets_helpers_settings to support polyinstantiation



110
111
112
# File 'lib/roda/plugins/sprockets.rb', line 110

def sprockets_helpers_settings
  sprockets_options[:sprockets_helpers]
end

#sprockets_optionsObject



105
106
107
# File 'lib/roda/plugins/sprockets.rb', line 105

def sprockets_options
  self.class.sprockets_options
end