ultra7 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b3d743cab74270eb2689c1d2f0bdfa870d34556
4
- data.tar.gz: ff87b1329b6d69f7152d27b7e015bdba3ef017c3
3
+ metadata.gz: f62703e25a0ab003dc3357a058cd477a2e06f641
4
+ data.tar.gz: 3f23a8005cd49ed42b90e6332b6eaee95840b733
5
5
  SHA512:
6
- metadata.gz: 914d2bc423738e3b25e14d1d51e8f10562a39a0b2f9fb07936075169b060c5032528944a4889d0480fbceb6935237a32f6e5fd2f0278dfe8dc03914cdd84dd99
7
- data.tar.gz: f0918fb057780da088754f04b4bcc560e678c10292e59bb5203698c95e1b1cdf6045163e3df9f04d6479ce0379cd5623c2dd75f0f1c3b964babaa310e0bef004
6
+ metadata.gz: 4bb714b90e0515d702ff2323d4d7f36512fe8b31f85b5d52b61f569958476d41354909d5cb637f2481a2dbbf4ffd70432c2e760c63ceb2ed6eadfdd9ba035fd2
7
+ data.tar.gz: 791973fca61789c8ad943c828e9174228a4c463fa2e6b4caee4d87e60808e8667fd595566017fe42c9530b40276601b76337e673be6a57fe3616b98511710f9b
data/README.md CHANGED
@@ -33,12 +33,12 @@ A UTF-7 MIME header decoder, plain and simple.
33
33
  puts Ultra7::MIME.decode_utf7('1 +- 1 = 2')
34
34
  => "1 + 1 = 2"
35
35
 
36
- # Decodes UTF-7, returning string with default encoding
36
+ # Decode a UTF-7 encoded string, returning string with default encoding
37
37
  puts Ultra7::MIME.decode_utf7('Hello, +ZeVnLIqe-')
38
38
  => "Hello, 日本語"
39
-
40
- # Decodes an actual Subject MIME header in UTF-7,
41
- # returning string with explicit UTF-8 encoding
39
+
40
+ # Decode a MIME encoded word, returning the decoded value
41
+ # as a string with explicit UTF-8 encoding
42
42
  subject = '=?unicode-1-1-utf-7?Q?+vDCy7A- +wMHQ3A- +xUy5vA-(+wuTTKA-)?='
43
43
  Ultra7::MIME.decode_utf7(subject, encoding: 'UTF-8')
44
44
  => "배달 상태 알림(실패)"
@@ -14,11 +14,14 @@ module Ultra7
14
14
  # hash, then the resulting string will use the default
15
15
  # `Encoding.default_external` encoding.
16
16
  #
17
- # @param [String] UTF-7 encoded text
17
+ # @param [String] text UTF-7 string or MIME encoded word
18
18
  # @param [Hash] options
19
- # @return [String] UTF-7 decoded value
20
- # @raise [ArgumentError] if text other than UTF-7 are passed in, or the given `encoding` cannot be found
21
- def self.decode_utf7(text, options={encoding: nil})
19
+ # @option options [String] :encoding the encoding for the decoded value
20
+ # @return [String] decoded value, using either
21
+ # `Encoding.default_external` or the given `:encoding`
22
+ # @raise [ArgumentError] if the encoding passed in is not UTF-7,
23
+ # or if the encoding for the decoded value is not valid
24
+ def self.decode_utf7(text, options={encoding: nil})
22
25
  # only deal with UTF-7 encoding
23
26
  text.scan(/=\?(.*)\?[q]\?/i).each {
24
27
  e = $1
@@ -7,7 +7,7 @@
7
7
  # It may be used as a mixin.
8
8
  module Ultra7
9
9
  # Version string for this Rubygem.
10
- VERSION = "0.3.0"
10
+ VERSION = "0.4.0"
11
11
  end
12
12
 
13
13
  # Copyright (c) 2014-2015, Brooke M. Fujita.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultra7
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke M. Fujita
@@ -17,7 +17,7 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - .yardopts
20
+ - ".yardopts"
21
21
  - CHANGELOG
22
22
  - LICENSE
23
23
  - README.md
@@ -34,18 +34,19 @@ require_paths:
34
34
  - lib
35
35
  required_ruby_version: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.9'
40
40
  required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - '>='
42
+ - - ">="
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 2.4.1
47
+ rubygems_version: 2.2.2
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: A UTF-7 MIME header decoder, plain and simple.
51
51
  test_files: []
52
+ has_rdoc: