esa 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +5 -4
- data/lib/esa/api_methods.rb +7 -3
- data/lib/esa/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: b157f828f920f7a07b5dfea5b1fc91263d42c597
|
4
|
+
data.tar.gz: 26121241f403dc6684de01be7aaf5df12c738d19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dac405ce86eb6037cc029451159b5a701d71192a80746b5828c492551b68079903ec4f99a73266a78d33f6d8cf48378722091c2f47a5355351935ba6b9d2799
|
7
|
+
data.tar.gz: 5d3051d1a94f7f8b76644586dac627a13793d7495e6fa7ed18b6f4415069e94b2ec57eb87ce96148cff2d10cfeb68dac22a71147720d4a0834090b164fbb40aa
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 1.9.0 (2017-08-02)
|
2
|
+
- add: [Enable to set headers for remote url on #upload_attachment by nownabe · Pull Request #26 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/26)
|
3
|
+
|
4
|
+
## 1.8.0 (2017-02-25)
|
5
|
+
- add: [Add batch_move_category API by fukayatsu · Pull Request #25 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/25)
|
6
|
+
|
1
7
|
## 1.7.0 (2016-08-16)
|
2
8
|
- add: [Support signed_url API by fukayatsu · Pull Request #24 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/24)
|
3
9
|
- fix: [Fix a typo by ksss · Pull Request #23 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/23)
|
data/README.md
CHANGED
@@ -130,10 +130,11 @@ client.tags
|
|
130
130
|
#=> GET /v1/teams/foobar/tags
|
131
131
|
|
132
132
|
# Upload Attachment(beta)
|
133
|
-
client.upload_attachment('/Users/foo/Desktop/foo.png')
|
134
|
-
client.upload_attachment(File.open('/Users/foo/Desktop/foo.png'))
|
135
|
-
client.upload_attachment('http://example.com/foo.png')
|
136
|
-
client.upload_attachment(['http://example.com/foo.png', cookie_str])
|
133
|
+
client.upload_attachment('/Users/foo/Desktop/foo.png') # Path
|
134
|
+
client.upload_attachment(File.open('/Users/foo/Desktop/foo.png')) # File
|
135
|
+
client.upload_attachment('http://example.com/foo.png') # Remote URL
|
136
|
+
client.upload_attachment(['http://example.com/foo.png', cookie_str]) # Remote URL + Cookie
|
137
|
+
client.upload_attachment(['http://example.com/foo.png', headers_hash]) # Remote URL + Headers
|
137
138
|
|
138
139
|
# Signed url for secure upload(beta)
|
139
140
|
client.signed_url('uploads/p/attachments/1/2016/08/16/1/foobar.png')
|
data/lib/esa/api_methods.rb
CHANGED
@@ -169,14 +169,18 @@ module Esa
|
|
169
169
|
end
|
170
170
|
|
171
171
|
def file_from(path_or_file_or_url)
|
172
|
-
path_or_file_or_url,
|
172
|
+
path_or_file_or_url, headers_or_cookie = *path_or_file_or_url if path_or_file_or_url.is_a?(Array)
|
173
173
|
|
174
174
|
if path_or_file_or_url.respond_to?(:read)
|
175
175
|
path_or_file_or_url
|
176
176
|
elsif path_or_file_or_url.is_a?(String) && HTTP_REGEX.match(path_or_file_or_url)
|
177
177
|
remote_url = path_or_file_or_url
|
178
|
-
headers =
|
179
|
-
|
178
|
+
headers =
|
179
|
+
if headers_or_cookie
|
180
|
+
headers_or_cookie.is_a?(Hash) ? headers_or_cookie : { Cookie: headers_or_cookie }
|
181
|
+
else
|
182
|
+
{}
|
183
|
+
end
|
180
184
|
response = send_simple_request(:get, remote_url, nil, headers)
|
181
185
|
raise RemoteURLNotAvailableError, "#{remote_url} is not available." unless response.status == 200
|
182
186
|
PathStringIO.new(File.basename(remote_url), response.body)
|
data/lib/esa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02
|
11
|
+
date: 2017-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
238
|
version: '0'
|
239
239
|
requirements: []
|
240
240
|
rubyforge_project:
|
241
|
-
rubygems_version: 2.
|
241
|
+
rubygems_version: 2.6.11
|
242
242
|
signing_key:
|
243
243
|
specification_version: 4
|
244
244
|
summary: esa API v1 client library, written in Ruby
|