Sha256: f62655fc2ae8c784cb6b557c0e56772d90e794879a24c223a8849d65d8135749

Contents?: true

Size: 599 Bytes

Versions: 4

Compression:

Stored size: 599 Bytes

Contents

require "svelte/handler"
require "svelte/helpers"

module Svelte
  class Railtie < ::Rails::Railtie
    initializer "svelte" do |app|
      `npm link #{Gem::Specification.find_by_name("actionview-svelte-handler").gem_dir} --save`
      `npm install --install-links`

      ActiveSupport.on_load :action_view do
        ActionView::Template.register_template_handler :svelte, Svelte::Handler
        ActionView::Base.send :include, Svelte::Helpers
      end

      ActionController::Base.class_eval <<-RUBY, __FILE__, __LINE__ + 1
        include Svelte::Variabilization
      RUBY
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
actionview-svelte-handler-0.8.1 lib/svelte/railtie.rb
actionview-svelte-handler-0.8.0 lib/svelte/railtie.rb
actionview-svelte-handler-0.7.0 lib/svelte/railtie.rb
actionview-svelte-handler-0.6.0 lib/svelte/railtie.rb