string-scrub 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9eb9dbb53755095ddf297dcadd31df955a8d40aa
4
- data.tar.gz: ff3692ef538237cfe5cd8da80136744b933102e5
3
+ metadata.gz: 5136d86081d9c7b732a907671f4fb7874b7ab9d7
4
+ data.tar.gz: 964b8e63c9eeb557efb7071d4d6aac1403e46478
5
5
  SHA512:
6
- metadata.gz: 367c9b6389befefdf01757bed6b0cf8e6e6100155a0a5ca886299be886391f78d48765b7d3e6bd13555805d620a51d57e643e1e2fc735297492be5c03b6bffa2
7
- data.tar.gz: c76f4019b64dcdd6794124015351b6109ffd1fb247a5b36ea4e9aaef4fa5c6c58732a47f2c01ddf68c3b0aefc6cbb8d28964e4c57815c76f06317127b95abf52
6
+ metadata.gz: cef5c319a86f45e5942919190ee8bdad7c30ce06e3eb60e9ea135771ff4b4a4550177ff6f3adca736c6ffcac2bcced879c35ecc69877433144795135810f18ce
7
+ data.tar.gz: bd27d6d703d63ac05370ee350891995232f9a7213026105770b8f73b6d79ff773b628bb348d0715385271b0764d3b1621f59b68318c87a1ce324b6b8a985a0d6
data/.gitignore CHANGED
@@ -14,7 +14,7 @@ rdoc
14
14
  test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
- ext/string/*.o
18
- ext/string/Makefile
19
- ext/string/*.bundle
20
- ext/string/*.so
17
+ *.o
18
+ Makefile
19
+ *.bundle
20
+ *.so
@@ -1,3 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.0
3
+ - 2.0.0
4
+ before_script: ruby ext/string/extconf.rb; make
5
+ script: bundle exec ruby test/test_scrub.rb
@@ -1,2 +1,3 @@
1
1
  require 'mkmf'
2
+ have_func("rb_str_scrub")
2
3
  create_makefile('string/scrub')
@@ -1,6 +1,8 @@
1
1
  #include <ruby.h>
2
2
  #include <ruby/encoding.h>
3
3
 
4
+ #ifndef HAVE_RB_STR_SCRUB
5
+
4
6
  #ifndef TRUE
5
7
  #define TRUE 1
6
8
  #endif
@@ -175,7 +177,7 @@ str_scrub0(int argc, VALUE *argv, VALUE str)
175
177
  if (!rep7bit_p) cr = ENC_CODERANGE_VALID;
176
178
  }
177
179
  else {
178
- repl = rb_yield(rb_enc_str_new(p1, clen, enc));
180
+ repl = rb_yield(rb_enc_str_new(p, clen, enc));
179
181
  repl = str_compat_and_valid(repl, enc);
180
182
  rb_str_buf_cat(buf, RSTRING_PTR(repl), RSTRING_LEN(repl));
181
183
  if (ENC_CODERANGE(repl) == ENC_CODERANGE_VALID)
@@ -358,9 +360,13 @@ str_scrub_bang(int argc, VALUE *argv, VALUE str)
358
360
  return str;
359
361
  }
360
362
 
363
+ #endif
364
+
361
365
  void
362
366
  Init_scrub(void)
363
367
  {
368
+ #ifndef HAVE_RB_STR_SCRUB
364
369
  rb_define_method(rb_cString, "scrub", rb_str_scrub, -1);
365
370
  rb_define_method(rb_cString, "scrub!", str_scrub_bang, -1);
371
+ #endif
366
372
  }
@@ -3,7 +3,7 @@ lib = File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "string-scrub"
6
- spec.version = "0.0.1"
6
+ spec.version = "0.0.2"
7
7
  spec.authors = ["SHIBATA Hiroshi"]
8
8
  spec.email = ["shibata.hiroshi@gmail.com"]
9
9
  spec.summary = %q{String#scrub for Ruby 2.0.0}
@@ -1,6 +1,6 @@
1
1
  # coding: US-ASCII
2
2
  require 'test/unit'
3
- require_relative '../ext/string/scrub'
3
+ require_relative '../scrub'
4
4
 
5
5
  class TestScrub < Test::Unit::TestCase
6
6
  module AESU
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string-scrub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIBATA Hiroshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-01 00:00:00.000000000 Z
11
+ date: 2013-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,7 +47,6 @@ extensions:
47
47
  extra_rdoc_files: []
48
48
  files:
49
49
  - ".gitignore"
50
- - ".rspec"
51
50
  - ".travis.yml"
52
51
  - Gemfile
53
52
  - LICENSE.txt
@@ -77,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
76
  version: '0'
78
77
  requirements: []
79
78
  rubyforge_project:
80
- rubygems_version: 2.1.10
79
+ rubygems_version: 2.2.0
81
80
  signing_key:
82
81
  specification_version: 4
83
82
  summary: String#scrub for Ruby 2.0.0
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color