fmrest-core 0.13.0 → 0.13.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3df4def4688541f93d0c0ab3cdf2ec4aa61424cf5304d668190e270b5d8a98e
4
- data.tar.gz: e1e7935827cb2720ea008b6f563ee24881c12d9d437f81163101796a7bc4d781
3
+ metadata.gz: 53d29a0e4e2956b66ae0054f5f4fd355115a9889fab57dae36506b37f5d68cf2
4
+ data.tar.gz: b4228ee457a91c8e1b1f217678c66d7d86a23e5b8dd6420120904e801b61224d
5
5
  SHA512:
6
- metadata.gz: 3cf8c4fb66bb25d6a78e794572b243b2afaad2fabed94f73fb499776d4227b0a90b0fa9bf7068dce0f8cdac9d13c70302aed142e73d62c818ae6ad4c28f23600
7
- data.tar.gz: c58374f6976087b957c6dd1689b1db447e99490c6f141effc2a2f14540f81bac1c7bf79dc4beec62d437dce4385d704f53bffc919a26d5ad38a660bb763f6fe2
6
+ metadata.gz: 3b0909eaef29e7ba596aa469ef62eccf60f7e73ab33fb3e2ab5d88b4fce1d96d15fd3ebcb3404eb767d15ccfd262713c0b190af0cff51bbd5a72f7c9bf31f134
7
+ data.tar.gz: 56ab9b3d5a8ebc11ca44c04c1200b6bfdff8c49da0aa767be74965d1df11b0fcb836d88dcff7d4a954585cb54ac316c15d6a7b71a5306e6b62cab1d2562d04e9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Changelog
2
2
 
3
+ ### 0.13.1
4
+
5
+ * Fix downloading of container field data from FMS19+
6
+
3
7
  ### 0.13.0
4
8
 
5
9
  * Split `fmrest` gem into `fmrest-core` and `fmrest-spyke`. `fmrest` becomes a
data/README.md CHANGED
@@ -496,6 +496,7 @@ the following Ruby implementations:
496
496
  * Ruby 2.5
497
497
  * Ruby 2.6
498
498
  * Ruby 2.7
499
+ * Ruby 3.0
499
500
 
500
501
  ## Gem development
501
502
 
@@ -45,18 +45,23 @@ module FmRest
45
45
  proxy: proxy_options || FmRest.default_connection_settings[:proxy]
46
46
  )
47
47
 
48
- # Requesting the container URL with no cookie set will respond with a
49
- # redirect and a session cookie
50
- cookie_response = conn.get url
48
+ openuri_options =
49
+ faraday_connection_to_openuri_options(conn).merge(redirect: false)
51
50
 
52
- unless cookie = cookie_response.headers["Set-Cookie"]
53
- raise FmRest::ContainerFieldError, "Container field's initial request didn't return a session cookie, the URL may be stale (try downloading it again immediately after retrieving the record)"
54
- end
51
+ begin
52
+ url.open(openuri_options)
53
+ rescue OpenURI::HTTPRedirect => e
54
+ unless cookie = e.io.metas.dig("set-cookie", 0)
55
+ raise FmRest::ContainerFieldError, "Container field's initial request didn't return a session cookie, the URL may be stale (try downloading it again immediately after retrieving the record)"
56
+ end
55
57
 
56
- # Now request the URL again with the proper session cookie using
57
- # OpenURI, which wraps the response in an IO object which also responds
58
- # to #content_type
59
- url.open(faraday_connection_to_openuri_options(conn).merge("Cookie" => cookie))
58
+ url = URI(e.io.meta["location"])
59
+
60
+ # Now request the URL again with the proper session cookie using
61
+ # OpenURI, which wraps the response in an IO object which also responds
62
+ # to #content_type
63
+ url.open(openuri_options.merge("Cookie" => cookie))
64
+ end
60
65
  end
61
66
 
62
67
  # Handles the core logic of uploading a file into a container field
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FmRest
4
- VERSION = "0.13.0"
4
+ VERSION = "0.13.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fmrest-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Carbajal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-11 00:00:00.000000000 Z
11
+ date: 2021-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.2.3
111
+ rubygems_version: 3.0.6
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: FileMaker Data API client using Faraday, core library