JasonKing-inline_attachment 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -94,3 +94,4 @@ Contributors
94
94
  * Jason King (JasonKing)
95
95
  * Matt Griffin (betamatt) - file:// and chaining cleanup
96
96
  * Logan Raarup (logandk) - pluginified
97
+ * Jeffrey Damick (jdamick) - bugfix
@@ -65,14 +65,15 @@ module ActionView
65
65
  basename = File.basename(file_path)
66
66
  ext = basename.split('.').last
67
67
  cid = Time.now.to_f.to_s + "#{basename}@inline_attachment"
68
- file = File.open(file_path, 'rb')
69
68
 
70
- @part_container.inline_attachment(:content_type => "image/#{ext}",
71
- :body => file.read,
72
- :filename => basename,
73
- :cid => "<#{cid}>",
74
- :disposition => "inline")
75
-
69
+ File.open(file_path, 'rb') do |file|
70
+ @part_container.inline_attachment(:content_type => "image/#{ext}",
71
+ :body => file.read,
72
+ :filename => basename,
73
+ :cid => "<#{cid}>",
74
+ :disposition => "inline")
75
+ end
76
+
76
77
  return "cid:#{cid}"
77
78
  end
78
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: JasonKing-inline_attachment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason King
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-29 00:00:00 -07:00
12
+ date: 2009-06-18 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency