iconv 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/Gemfile +14 -1
- data/README.md +18 -15
- data/ext/iconv/iconv.c +3 -3
- data/iconv.gemspec +2 -1
- data/lib/iconv.rb +1 -1
- data/lib/iconv/version.rb +2 -2
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ade5a248ad7f987695736e3ca42183dd22239a73
|
4
|
+
data.tar.gz: 99e537f2952a300717cfae04dac1be83b540b96d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b2429d50669f11196f317ce0100843a0b636ad828f01ea3370045a9165182b6e5bbbebfa15960ce267e64cdd5a7efa3465265e64f38beb60bd3cb59664c6aab
|
7
|
+
data.tar.gz: ddda802caed973d6c14d5974b3c5f88e18ce2d969aaeeea3a3668fa565a3dc4412cb56cb6be5fb232715833bb170f4db1eb78b9c372e085281af2e0971f2b80b
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,4 +2,17 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in iconv.gemspec
|
4
4
|
gemspec
|
5
|
-
|
5
|
+
|
6
|
+
if RUBY_VERSION < '1.9.3'
|
7
|
+
gem 'rake', '~> 10.0'
|
8
|
+
else
|
9
|
+
gem 'rake'
|
10
|
+
end
|
11
|
+
|
12
|
+
group :development, :test do
|
13
|
+
if RUBY_VERSION < '1.9'
|
14
|
+
gem 'test-unit', '~> 2.5'
|
15
|
+
else
|
16
|
+
gem 'test-unit'
|
17
|
+
end
|
18
|
+
end
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Iconv
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/
|
3
|
+
[![Build Status](https://travis-ci.org/ruby/iconv.svg)](https://travis-ci.org/ruby/iconv)
|
4
4
|
|
5
5
|
iconv wrapper, used to be ext/iconv
|
6
6
|
|
@@ -21,7 +21,9 @@ Which coding systems are available is platform-dependent.
|
|
21
21
|
|
22
22
|
Add this line to your application's Gemfile:
|
23
23
|
|
24
|
-
|
24
|
+
```ruby
|
25
|
+
gem 'iconv'
|
26
|
+
```
|
25
27
|
|
26
28
|
And then execute:
|
27
29
|
|
@@ -34,11 +36,11 @@ Or install it yourself as:
|
|
34
36
|
## Usage
|
35
37
|
|
36
38
|
1. Simple conversion between two charsets.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
2. Instantiate a new Iconv and use method Iconv#iconv
|
41
|
-
|
39
|
+
```ruby
|
40
|
+
converted_text = Iconv.conv('iso-8859-15', 'utf-8', text)
|
41
|
+
```
|
42
|
+
2. Instantiate a new `Iconv` and use method `Iconv#iconv`.
|
43
|
+
```ruby
|
42
44
|
cd = Iconv.new(to, from)
|
43
45
|
begin
|
44
46
|
input.each { |s| output << cd.iconv(s) }
|
@@ -46,23 +48,24 @@ Or install it yourself as:
|
|
46
48
|
ensure
|
47
49
|
cd.close
|
48
50
|
end
|
49
|
-
|
50
|
-
3. Invoke Iconv.open with a block.
|
51
|
-
|
51
|
+
```
|
52
|
+
3. Invoke `Iconv.open` with a block.
|
53
|
+
```ruby
|
52
54
|
Iconv.open(to, from) do |cd|
|
53
55
|
input.each { |s| output << cd.iconv(s) }
|
54
56
|
output << cd.iconv(nil)
|
55
57
|
end
|
56
|
-
|
58
|
+
```
|
57
59
|
4. Shorthand for (3).
|
58
|
-
|
60
|
+
```ruby
|
59
61
|
Iconv.iconv(to, from, *input.to_a)
|
62
|
+
```
|
60
63
|
|
61
64
|
## Attentions
|
62
65
|
|
63
|
-
Even if some
|
64
|
-
DON'T USE those
|
65
|
-
If you want to use those feature, use String#encode
|
66
|
+
Even if some extensions of implementation dependent are useful,
|
67
|
+
DON'T USE those extensions in libraries and scripts to widely distribute.
|
68
|
+
If you want to use those feature, use `String#encode`.
|
66
69
|
|
67
70
|
## Contributing
|
68
71
|
|
data/ext/iconv/iconv.c
CHANGED
@@ -124,8 +124,8 @@ rb_sys_fail_str(VALUE msg)
|
|
124
124
|
*
|
125
125
|
* == Attentions
|
126
126
|
*
|
127
|
-
* Even if some
|
128
|
-
* DON'T USE those
|
127
|
+
* Even if some extensions of implementation dependent are useful,
|
128
|
+
* DON'T USE those extensions in libraries and scripts to widely distribute.
|
129
129
|
* If you want to use those feature, use String#encode.
|
130
130
|
*/
|
131
131
|
|
@@ -1272,7 +1272,7 @@ iconv_failure_inspect(VALUE self)
|
|
1272
1272
|
void
|
1273
1273
|
Init_iconv(void)
|
1274
1274
|
{
|
1275
|
-
VALUE rb_cIconv = rb_define_class("Iconv",
|
1275
|
+
VALUE rb_cIconv = rb_define_class("Iconv", rb_cObject);
|
1276
1276
|
|
1277
1277
|
rb_define_alloc_func(rb_cIconv, iconv_s_allocate);
|
1278
1278
|
rb_define_singleton_method(rb_cIconv, "open", iconv_s_open, -1);
|
data/iconv.gemspec
CHANGED
@@ -10,11 +10,12 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["naruse@airemix.jp"]
|
11
11
|
gem.description = %q{iconv wrapper library}
|
12
12
|
gem.summary = %q{iconv wrapper library}
|
13
|
-
gem.homepage = "https://github.com/
|
13
|
+
gem.homepage = "https://github.com/ruby/iconv"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
16
|
gem.extensions = ['ext/iconv/extconf.rb']
|
17
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.required_ruby_version = '>= 1.8.7'
|
19
20
|
gem.require_paths = ["lib"]
|
20
21
|
end
|
data/lib/iconv.rb
CHANGED
data/lib/iconv/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
class Iconv
|
2
|
-
VERSION = "1.0.
|
1
|
+
class Iconv
|
2
|
+
VERSION = "1.0.5"
|
3
3
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iconv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NARUSE, Yui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: iconv wrapper library
|
14
14
|
email:
|
@@ -18,8 +18,8 @@ extensions:
|
|
18
18
|
- ext/iconv/extconf.rb
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- .gitignore
|
22
|
-
- .travis.yml
|
21
|
+
- ".gitignore"
|
22
|
+
- ".travis.yml"
|
23
23
|
- BSDL
|
24
24
|
- Gemfile
|
25
25
|
- LICENSE.txt
|
@@ -36,7 +36,7 @@ files:
|
|
36
36
|
- test/test_option.rb
|
37
37
|
- test/test_partial.rb
|
38
38
|
- test/utils.rb
|
39
|
-
homepage: https://github.com/
|
39
|
+
homepage: https://github.com/ruby/iconv
|
40
40
|
licenses: []
|
41
41
|
metadata: {}
|
42
42
|
post_install_message:
|
@@ -45,17 +45,17 @@ require_paths:
|
|
45
45
|
- lib
|
46
46
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
50
|
+
version: 1.8.7
|
51
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.
|
58
|
+
rubygems_version: 2.6.13
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: iconv wrapper library
|
@@ -64,4 +64,3 @@ test_files:
|
|
64
64
|
- test/test_option.rb
|
65
65
|
- test/test_partial.rb
|
66
66
|
- test/utils.rb
|
67
|
-
has_rdoc:
|