mail-iso-2022-jp 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,5 +5,5 @@ gem "mail", ">= 2.2.5"
5
5
  group :test do
6
6
  gem "rake"
7
7
  gem "bundler"
8
- gem "actionmailer", "~> 3.1.0"
8
+ gem "actionmailer", "~> 3.0.0"
9
9
  end
@@ -1,16 +1,18 @@
1
1
  # coding:utf-8
2
2
 
3
+ require 'mail'
3
4
  require 'base64'
4
5
 
5
6
  module Mail
6
7
  WAVE_DASH = "〜" # U+301C
7
8
  FULLWIDTH_TILDE = "~" # U+FF5E
9
+ NKF_OPTIONS = "--oc=CP50220 -xj"
8
10
 
9
11
  class Message
10
12
  def process_body_raw_with_iso_2022_jp_encoding
11
13
  if @charset.to_s.downcase == 'iso-2022-jp'
12
14
  @body_raw.gsub!(/#{WAVE_DASH}/, FULLWIDTH_TILDE)
13
- @body_raw = NKF.nkf('--oc=CP50220 -xj', @body_raw)
15
+ @body_raw = NKF.nkf(NKF_OPTIONS, @body_raw)
14
16
  end
15
17
  process_body_raw_without_iso_2022_jp_encoding
16
18
  end
@@ -40,7 +42,7 @@ module Mail
40
42
  def initialize_with_iso_2022_jp_encoding(value = nil, charset = 'utf-8')
41
43
  if charset.to_s.downcase == 'iso-2022-jp'
42
44
  value.gsub!(/#{WAVE_DASH}/, FULLWIDTH_TILDE)
43
- value = NKF.nkf('--oc=CP50220 -xj', value)
45
+ value = NKF.nkf(NKF_OPTIONS, value)
44
46
  if RUBY_VERSION >= '1.9'
45
47
  value.force_encoding('ascii-8bit')
46
48
  value = b_value_encode(value)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-iso-2022-jp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-11-20 00:00:00.000000000 Z
13
+ date: 2011-11-21 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mail
17
- requirement: &13859280 !ruby/object:Gem::Requirement
17
+ requirement: &19552660 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: 2.2.5
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *13859280
25
+ version_requirements: *19552660
26
26
  description: A patch that provides 'mail' gem with iso-2022-jp conversion capability.
27
27
  email: hermes@oiax.jp
28
28
  executables: []
@@ -32,8 +32,8 @@ files:
32
32
  - README.md
33
33
  - Gemfile
34
34
  - Rakefile
35
- - lib/mail-iso-2022-jp.rb
36
35
  - lib/mail-iso-2022-jp/patches.rb
36
+ - lib/mail-iso-2022-jp.rb
37
37
  homepage: http://github.com/kuroda/mail-iso-2022-jp
38
38
  licenses: []
39
39
  post_install_message: