string-scrub 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.travis.yml +2 -2
- data/LICENSE.txt +56 -22
- data/README.md +13 -5
- data/Rakefile +9 -0
- data/ext/string/extconf.rb +1 -1
- data/lib/string-scrub.rb +1 -1
- data/string-scrub.gemspec +4 -3
- data/test/test_scrub.rb +2 -2
- metadata +41 -12
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NzQzODk4Y2IyZGRiZjNjMzdhZWU3MjI1MWRiMDJkOGE1MTcwMTRjZA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c6b4af304d0d621ddafdb733f75c27d6d90c6090
|
4
|
+
data.tar.gz: 4493cd55f8e555a69a58be37e6841cfa83e93e8b
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
M2E1MWE2YmM4NTBkZTczYTg1ZDg4N2UwNDI5YTJmNWUzNjdiMGEyMjNhMjQ5
|
11
|
-
YTNmNWU3OTI5ZmM5ZmM2NWRiYmUzMjk4YjZlMjljMDQ1MTMxYmE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NGU1MjEyMDQxNmMzMGQwNDg2M2IzN2JiOWI4MzVmNjNmOWNiODEyMGY5OWE5
|
14
|
-
M2I3ZDJhNjgyNjFkYTBjODlmNDRhM2U3NTQzNTZlNTU3MTE0YTc1MTk2YTZj
|
15
|
-
MTdjOGFhNWMyYWE5ZDYxZjkyN2NmMWFmZmM2YTVjZDhhYzliN2U=
|
6
|
+
metadata.gz: 798e56b62db478a46f51420dc5a2e2f3a3fd5a2056482720f06d50d7aae70d3666a0f9d8e9e76d6c996e2582fe765b199c248e3c8f6b7005424f561420762a2a
|
7
|
+
data.tar.gz: d1c47f5ddd0a88a31f526ad56b5ca6b43d17905a8690744a17e229a4502bb394c8bf3c3ab778616bfc8985689458d43154a3ac181b54d2314674de4bc3716fcc
|
data/.travis.yml
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,22 +1,56 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c) give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
data/README.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
# String#scrub
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/string-scrub.png)](http://badge.fury.io/rb/string-scrub)
|
4
|
+
[![Build Status](https://secure.travis-ci.org/hsbt/string-scrub.png)](http://travis-ci.org/hsbt/string-scrub)
|
5
|
+
|
6
|
+
String#scrub for Ruby 2.0.0 and 1.9.3
|
7
|
+
|
8
|
+
## What does the scrub method do?
|
9
|
+
If the given string contains an invalid byte sequence then that invalid byte sequence is replaced with the [unicode replacement character](http://www.fileformat.info/info/unicode/char/0fffd/index.htm) (�) and a new string is returned.
|
10
|
+
|
11
|
+
You may also set a replacement character of your choice by passing that character to the method.
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
See [testcase](https://github.com/hsbt/string-scrub/blob/master/test/test_scrub.rb)
|
4
16
|
|
5
17
|
## Installation
|
6
18
|
|
@@ -16,10 +28,6 @@ Or install it yourself as:
|
|
16
28
|
|
17
29
|
$ gem install string-scrub
|
18
30
|
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
see [testcase](https://github.com/hsbt/string-scrub/blob/master/test/test_scrub.rb)
|
22
|
-
|
23
31
|
## Contributing
|
24
32
|
|
25
33
|
1. Fork it
|
data/Rakefile
CHANGED
data/ext/string/extconf.rb
CHANGED
data/lib/string-scrub.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require 'string/scrub'
|
1
|
+
require 'string/scrub.so'
|
data/string-scrub.gemspec
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
|
4
3
|
Gem::Specification.new do |spec|
|
5
4
|
spec.name = "string-scrub"
|
6
|
-
spec.version = "0.0.
|
5
|
+
spec.version = "0.0.4"
|
7
6
|
spec.authors = ["SHIBATA Hiroshi"]
|
8
|
-
spec.email = ["
|
7
|
+
spec.email = ["hsbt@ruby-lang.org"]
|
9
8
|
spec.summary = %q{String#scrub for Ruby 2.0.0 and 1.9.3}
|
10
9
|
spec.description = %q{String#scrub for Ruby 2.0.0 and 1.9.3}
|
11
10
|
spec.homepage = "https://github.com/hsbt/string-scrub"
|
@@ -21,4 +20,6 @@ Gem::Specification.new do |spec|
|
|
21
20
|
|
22
21
|
spec.add_development_dependency "bundler"
|
23
22
|
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency 'rake-compiler'
|
24
|
+
spec.add_development_dependency "test-unit"
|
24
25
|
end
|
data/test/test_scrub.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# coding: US-ASCII
|
2
2
|
require 'test/unit'
|
3
|
-
require_relative '../scrub'
|
3
|
+
require_relative '../lib/string-scrub'
|
4
4
|
|
5
5
|
class TestScrub < Test::Unit::TestCase
|
6
6
|
module AESU
|
@@ -21,7 +21,7 @@ class TestScrub < Test::Unit::TestCase
|
|
21
21
|
assert_equal("\uFFFD\uFFFD\uFFFD", u("\x80\x80\x80").scrub)
|
22
22
|
assert_equal("\uFFFDA", u("\xF4\x80\x80A").scrub)
|
23
23
|
|
24
|
-
#
|
24
|
+
# examples in Unicode 6.1.0 D93b
|
25
25
|
assert_equal("\x41\uFFFD\uFFFD\x41\uFFFD\x41",
|
26
26
|
u("\x41\xC0\xAF\x41\xF4\x80\x80\x41").scrub)
|
27
27
|
assert_equal("\x41\uFFFD\uFFFD\uFFFD\x41",
|
metadata
CHANGED
@@ -1,53 +1,81 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SHIBATA Hiroshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake-compiler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '0'
|
41
69
|
description: String#scrub for Ruby 2.0.0 and 1.9.3
|
42
70
|
email:
|
43
|
-
-
|
71
|
+
- hsbt@ruby-lang.org
|
44
72
|
executables: []
|
45
73
|
extensions:
|
46
74
|
- ext/string/extconf.rb
|
47
75
|
extra_rdoc_files: []
|
48
76
|
files:
|
49
|
-
- .gitignore
|
50
|
-
- .travis.yml
|
77
|
+
- ".gitignore"
|
78
|
+
- ".travis.yml"
|
51
79
|
- Gemfile
|
52
80
|
- LICENSE.txt
|
53
81
|
- README.md
|
@@ -67,19 +95,20 @@ require_paths:
|
|
67
95
|
- lib
|
68
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
97
|
requirements:
|
70
|
-
- -
|
98
|
+
- - ">="
|
71
99
|
- !ruby/object:Gem::Version
|
72
100
|
version: 1.9.3
|
73
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
102
|
requirements:
|
75
|
-
- -
|
103
|
+
- - ">="
|
76
104
|
- !ruby/object:Gem::Version
|
77
105
|
version: '0'
|
78
106
|
requirements: []
|
79
107
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.4.2
|
81
109
|
signing_key:
|
82
110
|
specification_version: 4
|
83
111
|
summary: String#scrub for Ruby 2.0.0 and 1.9.3
|
84
112
|
test_files:
|
85
113
|
- test/test_scrub.rb
|
114
|
+
has_rdoc:
|