Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a MacRuby-friendly regex syntax #432

Closed
wants to merge 2 commits into from

2 participants

@willglynn

require "sass" currently fails under MacRuby (#431). We can detect MacRuby and use a regex syntax that it likes better, just as we currently use different regexes for 1.8 and 1.9.

@willglynn willglynn referenced this pull request in play/play
Closed

iTunes 10.6.3 breaks play #178

@nex3 nex3 closed this pull request from a commit
@willglynn willglynn Add a MacRuby-friendly regex syntax.
Closes #431
Closes #432
a92a6ab
@nex3 nex3 closed this in a92a6ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +2 −0  lib/sass/scss/rx.rb
  2. +7 −0 lib/sass/util.rb
View
2  lib/sass/scss/rx.rb
@@ -51,6 +51,8 @@ def self.quote(str, flags = 0)
UNICODE = /\\#{H}{1,6}[ \t\r\n\f]?/
s = if Sass::Util.ruby1_8?
'\200-\377'
+ elsif Sass::Util.macruby?
+ '\u0080-\uD7FF\uE000-\uFFFD\U00010000-\U0010FFFF'
else
'\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{10000}-\u{10FFFF}'
end
View
7 lib/sass/util.rb
@@ -465,6 +465,13 @@ def ruby1_8?
def ruby1_8_6?
ruby1_8? && Sass::Util::RUBY_VERSION[2] < 7
end
+
+ # Whether or not this is running under MacRuby.
+ #
+ # @return [Boolean]
+ def macruby?
+ RUBY_ENGINE == 'macruby'
+ end
# Checks that the encoding of a string is valid in Ruby 1.9
# and cleans up potential encoding gotchas like the UTF-8 BOM.
Something went wrong with that request. Please try again.