string-scrub 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -4
- data/.travis.yml +3 -1
- data/ext/string/extconf.rb +1 -0
- data/ext/string/scrub.c +7 -1
- data/string-scrub.gemspec +1 -1
- data/test/test_scrub.rb +1 -1
- metadata +3 -4
- data/.rspec +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5136d86081d9c7b732a907671f4fb7874b7ab9d7
|
4
|
+
data.tar.gz: 964b8e63c9eeb557efb7071d4d6aac1403e46478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef5c319a86f45e5942919190ee8bdad7c30ce06e3eb60e9ea135771ff4b4a4550177ff6f3adca736c6ffcac2bcced879c35ecc69877433144795135810f18ce
|
7
|
+
data.tar.gz: bd27d6d703d63ac05370ee350891995232f9a7213026105770b8f73b6d79ff773b628bb348d0715385271b0764d3b1621f59b68318c87a1ce324b6b8a985a0d6
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/ext/string/extconf.rb
CHANGED
data/ext/string/scrub.c
CHANGED
@@ -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(
|
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
|
}
|
data/string-scrub.gemspec
CHANGED
@@ -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.
|
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}
|
data/test/test_scrub.rb
CHANGED
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.
|
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-
|
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.
|
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