/dev-ruby/fakefs/files/fakefs-0.4.0-ruby193-advise.patch
Patch | 42 lines | 38 code | 4 blank | 0 comment | 0 complexity | f658304df8eee13a08aebaf110319297 MD5 | raw file
Possible License(s): Apache-2.0, AGPL-1.0, LGPL-2.1, MIT, CC-BY-SA-3.0, LGPL-2.0, Unlicense, AGPL-3.0, CC0-1.0, BSD-3-Clause, GPL-2.0, LGPL-3.0, MPL-2.0-no-copyleft-exception, GPL-3.0
- commit 332735b52720466ca8eb9e089cc42f128d54b644
- Author: Lukas Oberhuber <lukaso@gmail.com>
- Date: Tue Dec 20 09:19:05 2011 +0000
- Add advise function to File which is in ruby 1.9.3. As it is only a hint to the
- os in some cases, the function does nothing.
- diff --git a/lib/fakefs/file.rb b/lib/fakefs/file.rb
- index 5684ede..ebc3ff8 100644
- --- a/lib/fakefs/file.rb
- +++ b/lib/fakefs/file.rb
- @@ -392,6 +392,11 @@ module FakeFS
- end
- end
-
- + if RUBY_VERSION >= "1.9.3"
- + def advise(advice, offset=0, len=0)
- + end
- + end
- +
- private
-
- def check_modes!
- diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb
- index 0f34950..1d5bf7a 100644
- --- a/test/fakefs_test.rb
- +++ b/test/fakefs_test.rb
- @@ -1861,4 +1861,14 @@ class FakeFSTest < Test::Unit::TestCase
- end
- end
- end
- +
- + if RUBY_VERSION >= "1.9.3"
- + def test_advise
- + File.open("foo", 'w') do |f|
- + assert_nothing_raised do
- + f.advise(:normal, 0, 0)
- + end
- + end
- + end
- + end
- end