Commit 208497b 1 parent deda470 commit 208497b Copy full SHA for 208497b
File tree 5 files changed +33
-8
lines changed
5 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
This project uses [ Semantic Versioning] ( http://semver.org ) .
4
4
5
+ ## 2.1.16
6
+
7
+ * Support non-US-ASCII files when using ` ignore_on_server `
8
+
9
+ Fixes https://github.com/laurilehmijoki/s3_website/issues/102
10
+
5
11
## 2.1.15
6
12
7
13
* Support non-US-ASCII files when using ` max_age `
Original file line number Diff line number Diff line change 1
1
module S3Website
2
- VERSION = '2.1.15 '
2
+ VERSION = '2.1.16 '
3
3
end
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ package s3.website
3
3
object Ruby {
4
4
lazy val rubyRuntime = org.jruby.Ruby .newInstance() // Instantiate heavy object
5
5
6
- def rubyRegexMatches (text : String , regex : String ) =
7
- rubyRuntime.evalScriptlet(
8
- s """
9
- !!Regexp.new(' $regex').match(' $text') # Use !! to force a boolean conversion
10
- """
11
- ).toJava(classOf [Boolean ]).asInstanceOf [Boolean ]
6
+ def rubyRegexMatches (text : String , regex : String ) = {
7
+ val z = rubyRuntime.evalScriptlet(
8
+ s """ # encoding: utf-8
9
+ !!Regexp.new(' $regex').match(' $text') """
10
+ )
11
+ z.toJava(classOf [Boolean ]).asInstanceOf [Boolean ]
12
+ }
13
+
12
14
}
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ object Config {
157
157
def erbEval (erbString : String , yamlConfigPath : String ): Try [String ] = Try {
158
158
val erbStringWithoutComments = erbString.replaceAll(" ^\\ s*#.*" , " " )
159
159
rubyRuntime.evalScriptlet(
160
- s """
160
+ s """ |# encoding: utf-8
161
161
|require 'erb'
162
162
|
163
163
|str = <<-ERBSTR
Original file line number Diff line number Diff line change @@ -338,6 +338,13 @@ class S3WebsiteSpec extends Specification {
338
338
push
339
339
noDeletesOccurred must beTrue
340
340
}
341
+
342
+ " support non-US-ASCII files" in new AllInSameDirectory with EmptySite with MockAWS with DefaultRunMode {
343
+ setS3Files(S3File (" tags/笔记/test.html" , " " ))
344
+ config = " ignore_on_server: tags/笔记/test.html"
345
+ push
346
+ noDeletesOccurred must beTrue
347
+ }
341
348
}
342
349
343
350
"""
@@ -354,6 +361,16 @@ class S3WebsiteSpec extends Specification {
354
361
push
355
362
noDeletesOccurred must beTrue
356
363
}
364
+
365
+ " support non-US-ASCII files" in new AllInSameDirectory with EmptySite with MockAWS with DefaultRunMode {
366
+ setS3Files(S3File (" tags/笔记/test.html" , " " ))
367
+ config = """
368
+ |ignore_on_server:
369
+ | - tags/笔记/test.html
370
+ """ .stripMargin
371
+ push
372
+ noDeletesOccurred must beTrue
373
+ }
357
374
}
358
375
359
376
" max-age in config" can {
You can’t perform that action at this time.
0 commit comments