Sha256: 42857fb5ec29b55e8284552d4a516d9040db4500ad1c907d95338b3911fd582f
Contents?: true
Size: 929 Bytes
Versions: 16
Compression:
Stored size: 929 Bytes
Contents
module ReactiveRuby class ComponentLoader attr_reader :v8_context private :v8_context def initialize(v8_context) unless v8_context raise ArgumentError.new('Could not obtain ExecJS runtime context') end @v8_context = v8_context end def load(file = components) return true if loaded? !!v8_context.eval(opal(file)) end def load!(file = components) return true if loaded? self.load(file) ensure raise "No react.rb components found in #{components}.rb" unless loaded? end def loaded? !!v8_context.eval('Opal.React') end private def components # Make this configurable at some point 'components' end def opal(file) Opal::Processor.load_asset_code(assets, file) rescue # What exception is being caught here? end def assets ::Rails.application.assets end end end
Version data entries
16 entries across 16 versions & 2 rubygems