Sha256: 810a31ac471ea02edd1f3b221149c87303ad3db101108d6092d87f44d0eb76f9

Contents?: true

Size: 957 Bytes

Versions: 1

Compression:

Stored size: 957 Bytes

Contents

# module Opal::Rails::OpalContext
#   attr_accessor :opal_config
# end
# 
# module Opal::Rails::SprocketsConfig
#   def self.included(base)
#     base.alias_method_chain :asset_environment, :opal_config
#   end
# 
#   def asset_environment_with_opal_config(app, *args)
#     env = asset_environment_without_opal_config(app, *args)
#     env.context_class.extend(Opal::Rails::OpalContext)
#     env.context_class.opal_config = app.config.opal
#     env
#   end
# end
# 
# begin
#   # Before sprockets was extracted from rails
#   require 'sprockets/railtie'
#   module Sprockets
#     class Railtie < ::Rails::Railtie
#       include Opal::Rails::SprocketsConfig
#     end
#   end
# rescue LoadError
#   # After sprockets was extracted into sprockets-rails
#   require 'sprockets/rails/railtie'
#   module Sprockets
#     module Rails
#       class Railtie < ::Rails::Railtie
#         include Opal::Rails::SprocketsConfig
#       end
#     end
#   end
# end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-rails-0.0.1.a lib/opal/rails/monkey_patches.rb