umanni-multipart-post 0.0.0.2 → 0.0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,26 +1,7 @@
1
1
  module FileUploadIO
2
- def self.new(file_path, content_type)
2
+ def self.new(file_path, content_type, file_content = nil)
3
3
  raise ArgumentError, "File content type required" unless content_type
4
- file_io = File.open(file_path, "rb")
5
- file_io.instance_eval(<<-EOS, __FILE__, __LINE__)
6
- def content_type
7
- "#{content_type}"
8
- end
9
-
10
- def file_name
11
- "#{File.basename(file_path)}"
12
- end
13
-
14
- def file_size
15
- "#{File.size(file_path)}".to_i
16
- end
17
- EOS
18
- file_io
19
- end
20
-
21
- def self.new(file_path, content_type, file_content)
22
- raise ArgumentError, "File content type required" unless content_type
23
- File.open(file_path, "w") {|f| f << file_content}
4
+ File.open(file_path, "w") {|f| f << file_content} unless file_content.blank?
24
5
  file_io = File.open(file_path, "rb")
25
6
  file_io.instance_eval(<<-EOS, __FILE__, __LINE__)
26
7
  def content_type
@@ -14,7 +14,7 @@ module MultiPart
14
14
  end
15
15
 
16
16
  def self.pre
17
- 2 #nil
17
+ 3 #nil
18
18
  end
19
19
 
20
20
  def self.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umanni-multipart-post
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.2
4
+ version: 0.0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: