social-avatar-proxy 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,7 @@ module SocialAvatarProxy
47
47
 
48
48
  # return a temporary file object
49
49
  def file
50
- AvatarFile.new(File.basename(remote_url)).tap do |file|
50
+ AvatarFile.new(File.basename(remote_url), encoding: body.encoding).tap do |file|
51
51
  begin
52
52
  file.write(body)
53
53
  file.content_type(content_type)
@@ -60,7 +60,7 @@ module SocialAvatarProxy
60
60
  end if exist?
61
61
  end
62
62
 
63
- private
63
+ private
64
64
  # request the remote file
65
65
  def response
66
66
  @response ||= RemoteFileResolver.new(remote_url).resolve
@@ -6,12 +6,12 @@ module SocialAvatarProxy
6
6
  class AvatarFile < SimpleDelegator
7
7
  attr_reader :file
8
8
 
9
- def initialize(path)
9
+ def initialize(path, options = {})
10
10
  if File.exist?(path)
11
11
  @file = File.new(path)
12
12
  mtime(file.mtime)
13
13
  else
14
- @file = Tempfile.new(path.gsub("/", "-"))
14
+ @file = Tempfile.new(path.gsub("/", "-"), options)
15
15
  end
16
16
  super(file)
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module SocialAvatarProxy
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social-avatar-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-06 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -189,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  segments:
191
191
  - 0
192
- hash: -284777560749383164
192
+ hash: -1807507186252043985
193
193
  required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements:
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  version: '0'
199
199
  segments:
200
200
  - 0
201
- hash: -284777560749383164
201
+ hash: -1807507186252043985
202
202
  requirements: []
203
203
  rubyforge_project:
204
204
  rubygems_version: 1.8.24