Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ae8e62dfc40b
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: de0755a93875
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Aug 1, 2015

  1. Copy the full SHA
    f642f90 View commit details
  2. Merge pull request #1036 from bebac/fix-sprockets-root-with-special-c…

    …hars
    
    Fix calculation of sprockets logical path if root path contains regex characters
    elia committed Aug 1, 2015
    Copy the full SHA
    de0755a View commit details
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/opal/sprockets/processor.rb
3 changes: 2 additions & 1 deletion lib/opal/sprockets/processor.rb
Original file line number Diff line number Diff line change
@@ -27,7 +27,8 @@ def evaluate(context, locals, &block)
# In Sprockets 3 logical_path has an odd behavior when the filename is "index"
# thus we need to bake our own logical_path
filename = context.respond_to?(:filename) ? context.filename : context.pathname.to_s
logical_path = filename.gsub(%r{^#{context.root_path}/?(.*?)#{sprockets_extnames_regexp}}, '\1')
root_path_regexp = Regexp.escape(context.root_path)
logical_path = filename.gsub(%r{^#{root_path_regexp}/?(.*?)#{sprockets_extnames_regexp}}, '\1')

compiler_options = self.compiler_options.merge(file: logical_path)