mailfactory-acd 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailfactory.rb +7 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd5c22dcb9829217553cb8cfc66edb342495913f
4
- data.tar.gz: 487f01301096879b20b0f7090075d27aeec88f2c
3
+ metadata.gz: 7944ba1c34653b3ef22ca177489516e4b9c743d4
4
+ data.tar.gz: 42206921b890dfa2c00acdd1956f6ea07a97aa07
5
5
  SHA512:
6
- metadata.gz: c8cc09ec8c971cc04ddc2a4a3675c13b17fe8bcaeb172f32221f6e1a04df7b353f733867c39ec03acd5336b22e047af4cef5fa9cd4a13535d2621b71f51740b9
7
- data.tar.gz: 4df58e799a254ee4a809e20abe0917c7688f164ba794d50a7c8085987b550ab8c29423d0c9db119e44c142a90495814e8e067c4750a3eba85ed0f7f26e7b8508
6
+ metadata.gz: 46d34ad603e9496e24d9da646d8cca4459d61df8357dfa8f1c3628677a805fe109fb3ddd0e20a0985ff616bd0ffec58fae1c6831ba2dcee49b19d58f780cb779
7
+ data.tar.gz: 89b194d5a70f2ca254faed154e7153ad3509ba212a0b3a8d08261da189690733fc385c43afab662ecf625c454fb7763b4ab352af2298604f46566b1b095bcb1b
data/lib/mailfactory.rb CHANGED
@@ -48,7 +48,7 @@ end
48
48
  # An easy class for creating a mail message
49
49
  class MailFactory
50
50
 
51
- VERSION = '1.4.0'
51
+ VERSION = '1.4.1'
52
52
 
53
53
  def initialize()
54
54
  @headers = Array.new()
@@ -278,13 +278,17 @@ class MailFactory
278
278
 
279
279
  if(type != nil)
280
280
  attachment['mimetype'] = type.to_s()
281
+ elsif(file['\n'])
282
+ attachment['mimetype'] = MIME::Types.type_for(emailfilename).to_s
281
283
  elsif(file.kind_of?(String) or file.kind_of?(Pathname))
282
284
  attachment['mimetype'] = MIME::Types.type_for(file.to_s()).to_s
283
285
  else
284
286
  attachment['mimetype'] = ''
285
287
  end
286
288
 
287
- if(file.kind_of?(String) or file.kind_of?(Pathname))
289
+ if(file['\n'])
290
+ attachment['attachment'] = file_encode(file)
291
+ elsif(file.kind_of?(String) or file.kind_of?(Pathname))
288
292
  # Open in rb mode to handle Windows, which mangles binary files opened in a text mode
289
293
  File.open(file.to_s(), "rb") { |fp|
290
294
  attachment['attachment'] = file_encode(fp.read())
@@ -462,4 +466,4 @@ protected
462
466
  end
463
467
  end
464
468
 
465
- end
469
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailfactory-acd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Powers