mmapscanner 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/ext/mmapscanner.c +2 -2
  2. data/spec/mmapscanner_spec.rb +12 -0
  3. metadata +20 -26
data/ext/mmapscanner.c CHANGED
@@ -269,8 +269,8 @@ static VALUE scan_sub(VALUE obj, VALUE re, int forward, int headonly, int sizeon
269
269
 
270
270
  ms->matched = 0;
271
271
  Check_Type(re, T_REGEXP);
272
- if (ms->pos >= ms->size)
273
- return Qnil;
272
+ if (ms->pos > ms->size)
273
+ return Qnil;
274
274
  if (TYPE(ms->data) == T_STRING)
275
275
  ptr = RSTRING_PTR(ms->data);
276
276
  else {
@@ -226,6 +226,10 @@ describe MmapScanner do
226
226
  m.size.should == 0
227
227
  m.to_s.should be_empty
228
228
  end
229
+ it '#scan(//) returns empty MmapScanner' do
230
+ m = MmapScanner.new('').scan(//)
231
+ m.size.should == 0
232
+ end
229
233
  end
230
234
  describe '#data' do
231
235
  it 'returns source object' do
@@ -249,6 +253,10 @@ describe MmapScanner do
249
253
  m.size.should == 0
250
254
  m.to_s.should be_empty
251
255
  end
256
+ it '#scan(//) returns empty MmapScanner' do
257
+ m = MmapScanner.new(src, 1020, 0).scan(//)
258
+ m.size.should == 0
259
+ end
252
260
  end
253
261
  describe '#data' do
254
262
  it 'returns source object' do
@@ -292,6 +300,10 @@ describe MmapScanner do
292
300
  m.size.should == 0
293
301
  m.to_s.should be_empty
294
302
  end
303
+ it '#scan(//) returns empty MmapScanner' do
304
+ m = MmapScanner.new(src, 1020, 0).scan(//)
305
+ m.size.should == 0
306
+ end
295
307
  end
296
308
  end
297
309
  end
metadata CHANGED
@@ -1,57 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mmapscanner
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.5
4
5
  prerelease:
5
- version: 0.3.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - TOMITA Masahiro
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-18 00:00:00 Z
12
+ date: 2011-09-30 00:00:00.000000000 Z
14
13
  dependencies: []
15
-
16
14
  description:
17
15
  email: tommy@tmtm.org
18
16
  executables: []
19
-
20
- extensions:
17
+ extensions:
21
18
  - ext/extconf.rb
22
19
  extra_rdoc_files: []
23
-
24
- files:
20
+ files:
25
21
  - README.md
26
22
  - ext/mmapscanner.c
27
23
  - spec/mmapscanner_spec.rb
28
24
  - ext/extconf.rb
29
25
  homepage: http://github.com/tmtm/mmapscanner
30
- licenses:
26
+ licenses:
31
27
  - Ruby's
32
28
  post_install_message:
33
29
  rdoc_options: []
34
-
35
- require_paths:
30
+ require_paths:
36
31
  - lib
37
- required_ruby_version: !ruby/object:Gem::Requirement
32
+ required_ruby_version: !ruby/object:Gem::Requirement
38
33
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
42
37
  version: 1.9.2
43
- required_rubygems_version: !ruby/object:Gem::Requirement
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
39
  none: false
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
49
44
  requirements: []
50
-
51
45
  rubyforge_project:
52
- rubygems_version: 1.8.6.1
46
+ rubygems_version: 1.8.10
53
47
  signing_key:
54
48
  specification_version: 3
55
49
  summary: MmapScanner like StringScanner but it use mmap(2)-ed data
56
- test_files:
50
+ test_files:
57
51
  - spec/mmapscanner_spec.rb