postgarnet 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/postgarnet.rb +6 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a20076359cea5248f326df4b18f3506c328cc0e5784bdc09db9caad9882b49ac
4
- data.tar.gz: 932a12ba077441f69ad5cf74958998e43c05c9d411c256c327f65714c8c0942a
3
+ metadata.gz: 7010ec65a17bfc3174095b6d49d69ff530ff1a7a7163f193856b40f57b41cb15
4
+ data.tar.gz: b9891d52a12cfe49b17b4366168fdc8ba703cae38608eecec85dc0411de473a5
5
5
  SHA512:
6
- metadata.gz: 99d6b3b8f81fb870fe9baab7155a6634f7bc5f0f6828e6cf543b9cda88f788d408cd8981ca217bd518a425661ec6af1bdbbeb14deefee5f796bc93e9f1e89c3b
7
- data.tar.gz: 3535244da7d04081782d4258fb16c4f15e3dba474559e3a3b25a4c63a1fe32448fb453765eba7948294a96da951ec318515e52304aef5fccca09f3f8f77b842b
6
+ metadata.gz: 41c9502cc2467f4e62010a0fc781b1d5c9a5236bdb4fd0365ff206ae4de199c1a8c72e45a1ae9a0cc476ce6287c9a271a2dc5b4d30b3b24a3e57794060390fd8
7
+ data.tar.gz: 2b27134f3f98fa9375e53a6f5dc4a3b7b7e6de22c49ee728bcbc488dd5653240dc55ebf05560e0198b084f1bbb882b530c59caebaea59099ce1ded1be505cca0
data/lib/postgarnet.rb CHANGED
@@ -13,7 +13,7 @@ class TransactionError < StandardError
13
13
  end
14
14
 
15
15
  class Postgarnet
16
- @@version = "1.0.6"
16
+ @@version = "1.0.7"
17
17
 
18
18
  def initialize(username: nil, password: nil)
19
19
  @username, @password, @subject, @content, @recipient, @author = @username, @smtp = nil
@@ -86,7 +86,7 @@ class Postgarnet
86
86
  if value.nil?
87
87
  return @headers[key]
88
88
  else
89
- @headers[key] = value
89
+ @headers[key.downcase] = value
90
90
  end
91
91
  end
92
92
 
@@ -191,7 +191,10 @@ class Postgarnet
191
191
  end
192
192
 
193
193
  def create_msg
194
+ if @headers["content-type"] == "text/html"
195
+ @content = "<html><body>#{@content}</body></html>"
196
+ end
194
197
  headers = @headers.map { |key, value| "#{key}: #{value}" }.join("\n")
195
- return "From: #{@author} <#{@username}>\nTo: #{@recipient} <#{@recipient}>\nSubject: #{@subject}\n#{headers}\n\n<html><body>#{@content}</body></html>"
198
+ return "From: #{@author} <#{@username}>\nTo: #{@recipient} <#{@recipient}>\nSubject: #{@subject}\n#{headers}\n\n#{@content}"
196
199
  end
197
200
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postgarnet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - trulyursdelv