zscan 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/ext/zscan.c CHANGED
@@ -328,7 +328,7 @@ static VALUE zscan_zero_or_one(int argc, VALUE* argv, VALUE self) {
328
328
  REQUIRE_BLOCK;
329
329
  volatile VALUE a = Qnil;
330
330
  volatile VALUE r;
331
- rb_scan_args(argc, argv, "01", &a);
331
+ rb_scan_args(argc, argv, "01", (VALUE*)&a);
332
332
  if (a == Qnil) {
333
333
  a = rb_ary_new();
334
334
  }
@@ -349,7 +349,7 @@ static VALUE zscan_zero_or_more(int argc, VALUE* argv, VALUE self) {
349
349
  volatile VALUE r;
350
350
  long backpos;
351
351
  P;
352
- rb_scan_args(argc, argv, "01", &a);
352
+ rb_scan_args(argc, argv, "01", (VALUE*)&a);
353
353
  if (a == Qnil) {
354
354
  a = rb_ary_new();
355
355
  }
@@ -377,7 +377,7 @@ static VALUE zscan_one_or_more(int argc, VALUE* argv, VALUE self) {
377
377
  if (RTEST(r)) {
378
378
  long backpos;
379
379
  P;
380
- rb_scan_args(argc, argv, "01", &a);
380
+ rb_scan_args(argc, argv, "01", (VALUE*)&a);
381
381
  if (a == Qnil) {
382
382
  a = rb_ary_new();
383
383
  }
data/lib/zscan.rb CHANGED
@@ -3,7 +3,7 @@ require_relative "zscan/bspec"
3
3
  require "date"
4
4
 
5
5
  class ZScan
6
- VERSION = '2.0.3'
6
+ VERSION = '2.0.4'
7
7
 
8
8
  def initialize s, dup=false
9
9
  if s.encoding.ascii_compatible?
data/rakefile CHANGED
@@ -2,7 +2,7 @@ require_relative "generate/generate"
2
2
  Dir.chdir __dir__
3
3
  version_re = /\d+(\.\d+)*/
4
4
  version = `command grep 'VERSION =' lib/zscan.rb`[version_re]
5
- gem_files = Dir.glob('{rakefile,zscan.gemspec,readme.md,**/*.{rb,h,c,inc},ext/pack/COPYING*}')
5
+ gem_files = Dir.glob('{rakefile,zscan.gemspec,readme.md,**/*.{rb,h,c,inc},ext/pack/COPYING*}') - Dir.glob('ext/pack/{pack.c,internal.h}')
6
6
  gem_package = "zscan-#{version}.gem"
7
7
  generate_src = [__FILE__, *Dir.glob('generate/*')]
8
8
 
@@ -12,10 +12,18 @@ task :default => [:gen, :test, gem_package]
12
12
  desc "build and test"
13
13
  task :test => 'ext/Makefile' do
14
14
  sh "make -C ext"
15
- sh "rspec"
15
+ sh "ruby spec/*.rb"
16
16
  end
17
17
 
18
- file 'ext/Makefile' do
18
+ desc "clean"
19
+ task :clean do
20
+ if File.exist?('ext/Makefile')
21
+ sh "cd ext && make clean"
22
+ end
23
+ sh "rm -f ext/pack/pack.c ext/pack/internal.h ext/Makefile zscan*.gem"
24
+ end
25
+
26
+ file 'ext/Makefile' => ['ext/extconf.rb', 'ext/pack/pack-25.c', 'ext/pack/pack-23.c'] do
19
27
  Dir.chdir 'ext' do
20
28
  sh "ruby extconf.rb"
21
29
  end
data/readme.md CHANGED
@@ -205,7 +205,6 @@ Thought of that but the API can be quirky... It's way beyond a string scanner.
205
205
  ## Build
206
206
 
207
207
  ```bash
208
- gem ins rspec
209
208
  rake gen
210
209
  rake
211
210
  ```
@@ -213,7 +212,7 @@ rake
213
212
  ## License
214
213
 
215
214
  ```
216
- Copyright (C) 2013 by Zete Lui (BSD)
215
+ Copyright (C) 2013 by Zete Lui (MIT)
217
216
 
218
217
  Permission is hereby granted, free of charge, to any person obtaining a copy of
219
218
  this software and associated documentation files (the "Software"), to deal in
@@ -48,7 +48,7 @@ describe 'ZScan binary scanning methods' do
48
48
 
49
49
  a = [2, 4.0]
50
50
  z = ZScan.new a.pack('cf')
51
- assert_equal nil, z.scan_bytes(s)
51
+ assert_nil z.scan_bytes(s)
52
52
  assert_equal 0, z.pos
53
53
  end
54
54
  end
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,2 @@
1
1
  require_relative "../lib/zscan"
2
- require 'rspec/autorun'
3
- RSpec.configure do |config|
4
- config.expect_with :stdlib
5
- config.before :all do
6
- # GC.stress = true
7
- end
8
- end
2
+ require 'minitest/autorun'
data/zscan.gemspec CHANGED
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "zscan"
3
- s.version = "2.0.3" # version mapped from zscan.rb, don't change here
3
+ s.version = "2.0.4" # version mapped from zscan.rb, don't change here
4
4
  s.author = "Zete Lui"
5
5
  s.homepage = "https://github.com/luikore/zscan"
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.summary = "improved string scanner"
8
8
  s.description = "improved string scanner, respects anchors and lookbehinds, supports codepoint positioning"
9
9
  s.required_ruby_version = ">=1.9.2"
10
- s.licenses = ['BSD']
10
+ s.licenses = ['MIT']
11
11
 
12
12
  s.files = Dir.glob('{rakefile,zscan.gemspec,readme.md,**/*.{rb,h,c,inc},ext/pack/COPYING*}')
13
13
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zscan
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zete Lui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-12 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: improved string scanner, respects anchors and lookbehinds, supports codepoint
14
14
  positioning
@@ -18,36 +18,40 @@ extensions:
18
18
  - ext/extconf.rb
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - rakefile
22
- - zscan.gemspec
23
- - readme.md
24
21
  - benchmark/one-or-more.rb
25
22
  - benchmark/vs-strscan.rb
26
23
  - benchmark/vs-unpack.rb
24
+ - ext/bspec.c
25
+ - ext/bspec_exec.inc
26
+ - ext/bspec_init.inc
27
27
  - ext/extconf.rb
28
+ - ext/pack/COPYING
29
+ - ext/pack/COPYING.ja
30
+ - ext/pack/internal-23.h
31
+ - ext/pack/internal-25.h
32
+ - ext/pack/internal.h
33
+ - ext/pack/pack-23.c
34
+ - ext/pack/pack-25.c
35
+ - ext/pack/pack.c
36
+ - ext/zscan.c
37
+ - ext/zscan.h
28
38
  - generate/bspec.rb
39
+ - generate/bspec_exec.inc
40
+ - generate/bspec_init.inc
29
41
  - generate/generate.rb
30
- - lib/zscan/bspec.rb
31
42
  - lib/zscan.rb
43
+ - lib/zscan/bspec.rb
44
+ - rakefile
45
+ - readme.md
32
46
  - spec/binary_scan_spec.rb
33
47
  - spec/combinator_spec.rb
34
48
  - spec/spec_helper.rb
35
49
  - spec/typed_scan_spec.rb
36
50
  - spec/zscan_spec.rb
37
- - ext/pack/internal.h
38
- - ext/zscan.h
39
- - ext/bspec.c
40
- - ext/pack/pack.c
41
- - ext/zscan.c
42
- - ext/bspec_exec.inc
43
- - ext/bspec_init.inc
44
- - generate/bspec_exec.inc
45
- - generate/bspec_init.inc
46
- - ext/pack/COPYING
47
- - ext/pack/COPYING.ja
51
+ - zscan.gemspec
48
52
  homepage: https://github.com/luikore/zscan
49
53
  licenses:
50
- - BSD
54
+ - MIT
51
55
  metadata: {}
52
56
  post_install_message:
53
57
  rdoc_options: []
@@ -55,19 +59,18 @@ require_paths:
55
59
  - lib
56
60
  required_ruby_version: !ruby/object:Gem::Requirement
57
61
  requirements:
58
- - - '>='
62
+ - - ">="
59
63
  - !ruby/object:Gem::Version
60
64
  version: 1.9.2
61
65
  required_rubygems_version: !ruby/object:Gem::Requirement
62
66
  requirements:
63
- - - '>='
67
+ - - ">="
64
68
  - !ruby/object:Gem::Version
65
69
  version: '0'
66
70
  requirements: []
67
71
  rubyforge_project:
68
- rubygems_version: 2.0.3
72
+ rubygems_version: 2.6.13
69
73
  signing_key:
70
74
  specification_version: 4
71
75
  summary: improved string scanner
72
76
  test_files: []
73
- has_rdoc: false