This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/source_maps.rb | |
if Rails.env.development? | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def compile script, options | |
script = script.read if script.respond_to?(:read) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Ruby-ish Regex class for Swift, inspired by Matt Thompson's Swift Regex extension: https://gist.github.com/mattt/2099ee21bbfbebaa94a3 | |
// | |
// Use Regex class: (returns captured string arrays instead of Bool) | |
// | |
// if m = Regexp(pattern:"tuple\\(([^,]+),\\s*([^,]+)\\s*\\)").match("tuple(1.0, 2.0)") { | |
// m[0][0] is "tuple(1.0, 2.0)" | |
// m[0][1] is "1.0" | |
// m[0][2] is "2.0" | |
// } |