mincore 0.0.9.3.pre.3 → 0.0.9.3.pre.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d72758b7386c7e505f24513e9e471c82fa2e9ec
4
- data.tar.gz: 4310e0f660b169a3a52cef66223d9dd74d80e432
3
+ metadata.gz: e9f7ed3bda0a02591d38392a11fb0906562ca7a2
4
+ data.tar.gz: d8db4334abdcb06c931707fc75b4189df655dade
5
5
  SHA512:
6
- metadata.gz: 74ba53691e1c9b1cc0eea229c00c0f512078c8c0beac5d79bc74bdee4fd1cbbebaaa7583f600c70514719f784c6b6a5fac0432374c62d6351276ee91c3938047
7
- data.tar.gz: 613ae2de22b4aac0a1ea4aa6983b7593716d7aa49400edfe950e53bc3ed59a2f8acf31d0aca4f94298645236ecfb3fd2870494554f2a41fcd0270873fe0231d5
6
+ metadata.gz: 869372b716f6e29725ac8e9adc52b09085069d163be039cd2a91ee7353ab3ccd870689ae5e3334186d199f54b0d39f3166431f4df646fbc8f71d9acdb28b4dbc
7
+ data.tar.gz: fe5585b123880aa011ee2b27f387f3ff072cb6d5884debad296de87fcd3bdf953f50934673830380b7762c0ef3b6f67894edd0998720fb504f594d738a224963
data/README.md CHANGED
@@ -18,7 +18,8 @@ This project is heavily inspired from [Feh/nocache](http://github.com/Feh/nocach
18
18
  IMPORTANT
19
19
  =========
20
20
 
21
- Versions <= 0.0.9.2 have a buggy File.mincore(), 0.0.9.3 and upwards work.
21
+ Versions <= 0.0.9.2 have a buggy File.mincore().
22
+ Versions 0.0.9.3 and upwards work.
22
23
 
23
24
 
24
25
  Usage
data/bin/cachestats.rb CHANGED
@@ -7,6 +7,9 @@ filename=ARGV[0]
7
7
 
8
8
  retcode, pieces = File.mincore(filename)
9
9
 
10
+ puts "retcode=#{retcode}" if ENV["DEBUG"]
11
+ exit retcode unless retcode == 0
12
+
10
13
  cached=0
11
14
  pieces.each do |e|
12
15
  cached += 1 if e
data/lib/mincore.rb CHANGED
@@ -89,7 +89,6 @@ static VALUE _mincore(char *filename) {
89
89
  pageinfo_arr = rb_ary_new2(pages);
90
90
  for(i=0; i<pages; i++) {
91
91
  VALUE status = ((pageinfo[i] & 1)?Qtrue:Qfalse);
92
- // VALUE status = Qtrue;
93
92
  rb_ary_push(pageinfo_arr, status);
94
93
  }
95
94
 
@@ -171,10 +170,10 @@ C_CODE
171
170
  # ( filesize + PAGESIZE -1 ) / PAGESIZE
172
171
  #
173
172
  # @example Sample run - on a file of size 20KB
174
- # File.mincore("/path/to/important/file") #=> [true, true, true, false, false]
173
+ # File.mincore("/path/to/important/file") #=> [0, [true, true, true, false, false]]
175
174
  #
176
175
  # @param filename [String] file name
177
- # @return [Int] execution status
176
+ # @return [Int, Array] execution status and cache status array
178
177
  def self.mincore(filename)
179
178
  self._mincore(filename)
180
179
  end
data/mincore.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mincore'
3
- s.version = '0.0.9.3.pre.3'
3
+ s.version = '0.0.9.3.pre.4'
4
4
  s.date = '2013-11-19'
5
5
 
6
6
  s.homepage = 'http://github.com/noushi/ruby-mincore'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mincore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.3.pre.3
4
+ version: 0.0.9.3.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reda NOUSHI