brick_ftp 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -2
- data/brick_ftp.gemspec +1 -1
- data/lib/brick_ftp/http_client.rb +3 -4
- data/lib/brick_ftp/utils/chunk_io.rb +4 -3
- data/lib/brick_ftp/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5dcf804679ca2021ae7b9b7f61c6393f0860d11a9c0ccc8ed1a137876df12966
|
4
|
+
data.tar.gz: 23325b86c3fa88a5c4a2e41d6faaed43b4109a01b833b13c9ed40febda8166b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ab4c0708a65bcea55e8fd89381ef8cc9d4a315f93b7f3517c4c2fa1a2af14245ea19ccd4a92659bac6c410e704fd1217e4a793474c491601b44f0491140ec1
|
7
|
+
data.tar.gz: f9b3a6596f113e79cdc96d10b831476615372a813793236580bdeea7734c0219e6ced3501022da7ccac53b357b19fc27eb6dbb524199859838beeb7f21a5f094
|
data/CHANGELOG.md
CHANGED
@@ -2,17 +2,21 @@ Changelog
|
|
2
2
|
====
|
3
3
|
|
4
4
|
|
5
|
-
[
|
5
|
+
[0.8.3](https://github.com/koshigoe/brick_ftp/compare/v0.8.2...v0.8.3)
|
6
6
|
----
|
7
7
|
|
8
|
-
[Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.8.2...
|
8
|
+
[Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.8.2...v0.8.3)
|
9
9
|
|
10
10
|
### Enhancements:
|
11
11
|
|
12
|
+
- [#114](https://github.com/koshigoe/brick_ftp/pull/114) Allow to upload file using `StringIO`
|
13
|
+
|
12
14
|
### Fixed Bugs:
|
13
15
|
|
14
16
|
### Breaking Changes:
|
15
17
|
|
18
|
+
### Others
|
19
|
+
|
16
20
|
|
17
21
|
[0.8.2](https://github.com/koshigoe/brick_ftp/compare/v0.8.1...v0.8.2)
|
18
22
|
----
|
data/brick_ftp.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'pry', '~> 0.10'
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
28
|
+
spec.add_development_dependency 'rubocop', '~> 0.55.0'
|
29
29
|
spec.add_development_dependency 'simplecov', '~> 0.15'
|
30
30
|
spec.add_development_dependency 'webmock', '~> 2.1'
|
31
31
|
spec.add_development_dependency 'yard', '~> 0.9'
|
@@ -80,8 +80,7 @@ module BrickFTP
|
|
80
80
|
|
81
81
|
private
|
82
82
|
|
83
|
-
#
|
84
|
-
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
83
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
85
84
|
def request(method, path, params: {}, headers: {})
|
86
85
|
req = Net::HTTP.const_get(method.to_s.capitalize).new(path, headers)
|
87
86
|
req['User-Agent'] = USER_AGENT
|
@@ -99,7 +98,7 @@ module BrickFTP
|
|
99
98
|
case
|
100
99
|
when params.is_a?(Hash)
|
101
100
|
req.body = params.to_json unless params.empty?
|
102
|
-
when params.is_a?(IO)
|
101
|
+
when params.is_a?(IO) || params.is_a?(StringIO)
|
103
102
|
req.body_stream = params
|
104
103
|
req['Content-Length'] = params.size
|
105
104
|
end
|
@@ -122,7 +121,7 @@ module BrickFTP
|
|
122
121
|
logger.info message
|
123
122
|
end
|
124
123
|
end
|
125
|
-
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
124
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
126
125
|
|
127
126
|
def logger
|
128
127
|
BrickFTP.logger
|
@@ -9,8 +9,9 @@ module BrickFTP
|
|
9
9
|
|
10
10
|
# Wrap IO object.
|
11
11
|
#
|
12
|
-
# @param [IO] io an IO object.
|
12
|
+
# @param [IO, StringIO] io an IO object.
|
13
13
|
# @param [Integer] chunk_size Size of chunk.
|
14
|
+
# This option is ignored if `io` is `StringIO`.
|
14
15
|
#
|
15
16
|
def initialize(io, chunk_size: nil)
|
16
17
|
@io = io
|
@@ -20,12 +21,12 @@ module BrickFTP
|
|
20
21
|
# Iterate with chunked IO object.
|
21
22
|
#
|
22
23
|
# @yield [chunk] Give a chunk IO object to block.
|
23
|
-
# @yieldparam [
|
24
|
+
# @yieldparam [IO] chunk a chunked IO object.
|
24
25
|
#
|
25
26
|
def each(&block)
|
26
27
|
return enum_for(__method__) unless block
|
27
28
|
|
28
|
-
if chunk_size
|
29
|
+
if chunk_size && io.is_a?(IO)
|
29
30
|
each_chunk(&block)
|
30
31
|
else
|
31
32
|
whole(&block)
|
data/lib/brick_ftp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brick_ftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- koshigoe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.55.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.55.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: simplecov
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
version: '0'
|
268
268
|
requirements: []
|
269
269
|
rubyforge_project:
|
270
|
-
rubygems_version: 2.
|
270
|
+
rubygems_version: 2.7.3
|
271
271
|
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: BrickFTP's REST API client.
|