Skip to content

Instantly share code, notes, and snippets.

@fernandes
Last active June 13, 2016 16:04
Show Gist options
  • Save fernandes/5b8450d8e06e95b86a3e8845698b07e0 to your computer and use it in GitHub Desktop.
Save fernandes/5b8450d8e06e95b86a3e8845698b07e0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'blade' is installed as part of a gem, and
# this file is here to facilitate running it.
#
# Put this file on bin/blade
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "rubygems"
require "bundler/setup"
# Initialize rails application
require_relative File.join('..', 'config/application.rb')
Rails.application.initialize!
# Initialize Rails assets paths...
paths = Rails.application.assets.paths
cwd = `pwd`.chomp + "/"
paths = paths.map { |x| x.gsub(cwd, '') }
# ...and concatenate with specified on .blade.yml
blade_config = YAML::load_file(File.join(__dir__, '..', '.blade.yml'))
paths.concat(blade_config["load_paths"])
Blade.initialize!(interface: 'runner', load_paths: paths)
load Gem.bin_path("blade", "blade")
# Don't worry about rails assets paths, will be added on bin/blade
load_paths:
- test/javascripts/src
- test/javascripts/vendor
logical_paths:
- application.js
- test.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment