popper 0.2.3 → 0.2.4

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: 8d72b676134f74105428764b68e8e4928d6d3760
4
- data.tar.gz: eafa29433cad37f8114cd5c53f05f65d084423df
3
+ metadata.gz: 72ac0486fff5d4f83876ef9886d1c28995406a2b
4
+ data.tar.gz: 74fb566a42ced8e653ec1fb4ba28351a703a51aa
5
5
  SHA512:
6
- metadata.gz: 88ab3d6b59149f0b25d5e49b4662b3cb11d5af4755921766e83270a07fa9be370e85b9104a0c11477100b46e98b3b688fa965d912d1e941b2072468ef5447ce0
7
- data.tar.gz: ed8a2e47a67f7cb51e1e945eee14a9de2c76b0554eb83fbc6dfaacea4a31c2e7e9e72501e8e66d8fb689b6cc8e1fec9d082b1b369026f3d65d8b47c9a8a5eb4d
6
+ metadata.gz: 4b38a249533f6104b875bf86abdcbaa9df13c890bc49fb30adc1048e33e28ba381d5c0fb45cdeb2efed7df4ee95831d06a3ba842c4af30a88e5730f5ccd05e2b
7
+ data.tar.gz: 18fc4142645cc586c61f9fa364159a03baa93423b96ffc88c9c5b734224607c4af96e73ee1711601131ecaeb625fcfa118b532819b4ec885b31ca8dd1211e7ca
@@ -6,7 +6,7 @@ module Popper::Action
6
6
  url = octkit.create_issue(
7
7
  @action_config.repo,
8
8
  mail.subject,
9
- mail.body
9
+ mail.utf_body
10
10
  )
11
11
  params["#{self.action}_url".to_sym] = url[:html_url] if url
12
12
  params
@@ -63,7 +63,7 @@ module Popper
63
63
  hash = self.send("global_default_#{name}")
64
64
  hash = hash.deep_merge(self.send("account_default_#{name}").to_h) if self.send("account_default_#{name}")
65
65
  hash = hash.deep_merge(self.rules.send(rule).send(name).to_h) if rules.send(rule).respond_to?(name.to_sym)
66
- AccountAttributes.new(hash)
66
+ AccountAttributes.new(Hash[hash.map {|k,v| [k.to_s.gsub(/^body$/, "utf_body").to_sym, v]}])
67
67
  end
68
68
  end
69
69
  end
@@ -99,12 +99,15 @@ class EncodeMail < Mail::Message
99
99
  Kconv.toutf8(self[:Subject].value) if self[:Subject]
100
100
  end
101
101
 
102
- def body
102
+ def utf_body
103
103
  if multipart?
104
- text_part.decoded.encode("UTF-8", charset) if text_part
105
- html_part.decoded.encode("UTF-8", charset) if html_part
104
+ if text_part
105
+ text_part.decoded.encode("UTF-8", charset)
106
+ elsif html_part
107
+ html_part.decoded.encode("UTF-8", charset)
108
+ end
106
109
  else
107
- super.decoded.encode("UTF-8", charset)
110
+ body.decoded.encode("UTF-8", charset)
108
111
  end
109
112
  end
110
113
  end
@@ -1,3 +1,3 @@
1
1
  module Popper
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: popper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama86