Sha256: 066798be6f221371bbf95f9441d8230f0ada603751b8b25eecb9a8dcba591168

Contents?: true

Size: 336 Bytes

Versions: 5

Compression:

Stored size: 336 Bytes

Contents

require 'js'

module RSpec
  module Support
    class Source
      # Allow to use embedded sources
      def self.from_file(path)
        source = JS[:Opal].JS[:file_sources].JS[path]
        source ||= JS[:Opal].JS[:file_sources].JS["./#{path}"]
        source ||= File.read(path)
        new(source, path)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-rspec-1.1.0.alpha3 lib-opal/opal/rspec/fixes/rspec/support/source.rb
opal-rspec-1.1.0.alpha2 lib-opal/opal/rspec/fixes/rspec/support/source.rb
opal-rspec-1.1.0.alpha1 lib-opal/opal/rspec/fixes/rspec/support/source.rb
opal-rspec-1.0.0 lib-opal/opal/rspec/fixes/rspec/support/source.rb
opal-rspec-1.0.0.alpha1 lib-opal/opal/rspec/fixes/rspec/support/source.rb