rack-test 0.8.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +10 -0
- data/README.md +1 -1
- data/lib/rack/test/uploaded_file.rb +11 -2
- data/lib/rack/test/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1ef918ca1ef466e983de48748ac507cde298bce
|
4
|
+
data.tar.gz: 5b51e1abc057e78f5e6a2c651c5b2f20ec1b6049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70ee9fa76cb6d0174fb88169adc3a854aea6d86da94ee058cb64500ee881b9fcfd8e863f55557d286e6c4458ebc0e67189cbeb78cdab877e3d7b4c06d2e8251d
|
7
|
+
data.tar.gz: 116d2337e1daa6852b23172766817b5c17864ec95db124fb50b441a5ab65fd32d755b2605cfcbb4832fd8891d28c98e888389cd9b689b4308d08d2909ddb4b55
|
data/History.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
|
+
## 0.8.2 / 2017-11-21
|
2
|
+
|
3
|
+
* Bug fixes:
|
4
|
+
* Bugfix for `UploadedFile.new` unintended API breakage.
|
5
|
+
(Per Lundberg #210)
|
6
|
+
|
1
7
|
## 0.8.0 / 2017-11-20
|
2
8
|
|
9
|
+
* Known Issue
|
10
|
+
* In `UploadedFile.new`, when passing e.g. a `Pathname` object,
|
11
|
+
errors can be raised (eg. `ArgumentError: Missing original_filename
|
12
|
+
for IO`, or `NoMethodError: undefined method 'size'`) See #207, #209.
|
3
13
|
* Minor enhancements
|
4
14
|
* Add a required_ruby_version of >= 2.2.2, similar to rack 2.0.1.
|
5
15
|
(Samuel Giddins #194)
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
require 'tempfile'
|
2
1
|
require 'fileutils'
|
2
|
+
require 'pathname'
|
3
|
+
require 'tempfile'
|
3
4
|
|
4
5
|
module Rack
|
5
6
|
module Test
|
@@ -18,8 +19,16 @@ module Rack
|
|
18
19
|
# The content type of the "uploaded" file
|
19
20
|
attr_accessor :content_type
|
20
21
|
|
22
|
+
# Creates a new UploadedFile instance.
|
23
|
+
#
|
24
|
+
# @param content [IO, Pathname, String, StringIO] a path to a file, or an {IO} or {StringIO} object representing the
|
25
|
+
# file.
|
26
|
+
# @param content_type [String]
|
27
|
+
# @param binary [Boolean] an optional flag that indicates whether the file should be open in binary mode or not.
|
28
|
+
# @param original_filename [String] an optional parameter that provides the original filename if `content` is an IO
|
29
|
+
# object.
|
21
30
|
def initialize(content, content_type = 'text/plain', binary = false, original_filename: nil)
|
22
|
-
if content.respond_to?(:read)
|
31
|
+
if content.respond_to?(:read) && (content.is_a?(IO) || content.is_a?(StringIO))
|
23
32
|
initialize_from_io(content, original_filename)
|
24
33
|
else
|
25
34
|
initialize_from_file_path(content)
|
data/lib/rack/test/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Helmkamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
183
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.6.
|
184
|
+
rubygems_version: 2.6.14
|
185
185
|
signing_key:
|
186
186
|
specification_version: 4
|
187
187
|
summary: Simple testing API built on Rack
|