src/main/scala/s3/website/Ruby.scala in s3_website-2.1.15 vs src/main/scala/s3/website/Ruby.scala in s3_website-2.1.16
- old
+ new
@@ -1,12 +1,14 @@
package s3.website
object Ruby {
lazy val rubyRuntime = org.jruby.Ruby.newInstance() // Instantiate heavy object
- def rubyRegexMatches(text: String, regex: String) =
- rubyRuntime.evalScriptlet(
- s"""
- !!Regexp.new('$regex').match('$text') # Use !! to force a boolean conversion
- """
- ).toJava(classOf[Boolean]).asInstanceOf[Boolean]
+ def rubyRegexMatches(text: String, regex: String) = {
+ val z = rubyRuntime.evalScriptlet(
+ s"""# encoding: utf-8
+ !!Regexp.new('$regex').match('$text')"""
+ )
+ z.toJava(classOf[Boolean]).asInstanceOf[Boolean]
+ }
+
}