brick_ftp 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/console +2 -6
- data/brick_ftp.gemspec +1 -0
- data/lib/brick_ftp/configuration.rb +11 -0
- data/lib/brick_ftp/http_client.rb +4 -0
- data/lib/brick_ftp/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 198dc4d1f0e1e4e54d6fc3a657ff3f178bd29223
|
4
|
+
data.tar.gz: 9d7ec78b7a4962011c97452652cebbe1ab93c5ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa690b6d0c45c151e6d5f53de44313dbcbd1dc435fd866349cb724258f81d5fdafdc9e215b065e69b90e392d7c4633b14c24998cf62739dc404537366954f45f
|
7
|
+
data.tar.gz: c91092878c30d9d73e933dd2061c0a71dfd5b3764e213ebec3fefea835bb90bee7323a3aff3e3b0113fe9e6ee1f80b56c85441d3c59d6d80c198ca9ffab5dd2b
|
data/README.md
CHANGED
@@ -38,7 +38,7 @@ end
|
|
38
38
|
### Authentication
|
39
39
|
|
40
40
|
If you authenticate by API key, you set API key to configuration.
|
41
|
-
If you authenticate by session
|
41
|
+
If you authenticate by session cookie, you must authenticate by API.
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
# Authenticate and set authentication session to configuration.
|
data/bin/console
CHANGED
@@ -6,9 +6,5 @@ require "brick_ftp"
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
9
|
+
require "pry"
|
10
|
+
Pry.start
|
data/brick_ftp.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
25
25
|
spec.add_development_dependency "webmock", "~> 2.1"
|
26
26
|
spec.add_development_dependency "yard", "~> 0.9"
|
27
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
27
28
|
|
28
29
|
spec.add_dependency 'deep_hash_transform', '~> 1.0'
|
29
30
|
end
|
@@ -20,11 +20,22 @@ module BrickFTP
|
|
20
20
|
# Log formatter
|
21
21
|
# @return [Logger::Formatter]
|
22
22
|
attr_reader :log_formatter
|
23
|
+
# Open timeout
|
24
|
+
# @return [Integer]
|
25
|
+
attr_accessor :open_timeout
|
26
|
+
# Read timeout
|
27
|
+
# @return [Integer]
|
28
|
+
attr_accessor :read_timeout
|
29
|
+
|
30
|
+
DEFAULT_OPEN_TIMEOUT = 10
|
31
|
+
DEFAULT_READ_TIMEOUT = 30
|
23
32
|
|
24
33
|
def initialize
|
25
34
|
self.subdomain = ENV['BRICK_FTP_SUBDOMAIN']
|
26
35
|
self.api_key = ENV['BRICK_FTP_API_KEY']
|
27
36
|
self.session = nil
|
37
|
+
self.open_timeout = DEFAULT_OPEN_TIMEOUT
|
38
|
+
self.read_timeout = DEFAULT_READ_TIMEOUT
|
28
39
|
self.logger = Logger.new(STDOUT)
|
29
40
|
self.log_level = Logger::WARN
|
30
41
|
self.log_formatter = Logger::Formatter.new
|
@@ -12,6 +12,8 @@ module BrickFTP
|
|
12
12
|
end
|
13
13
|
|
14
14
|
case
|
15
|
+
when !error.is_a?(Hash)
|
16
|
+
super "#{response.code} #{response.message}"
|
15
17
|
when error.key?('http-code')
|
16
18
|
super "#{error['http-code']}: #{error['error']}"
|
17
19
|
when error.key?('errors')
|
@@ -28,6 +30,8 @@ module BrickFTP
|
|
28
30
|
@host = host || BrickFTP.config.api_host
|
29
31
|
@conn = Net::HTTP.new(@host, 443)
|
30
32
|
@conn.use_ssl = true
|
33
|
+
@conn.open_timeout = BrickFTP.config.open_timeout
|
34
|
+
@conn.read_timeout = BrickFTP.config.read_timeout
|
31
35
|
end
|
32
36
|
|
33
37
|
def get(path, params: {})
|
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.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- koshigoe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.9'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.10'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: deep_hash_transform
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
179
|
version: '0'
|
166
180
|
requirements: []
|
167
181
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.5.1
|
182
|
+
rubygems_version: 2.4.5.1
|
169
183
|
signing_key:
|
170
184
|
specification_version: 4
|
171
185
|
summary: BrickFTP's REST API client.
|