apimatic_core 0.3.13 → 0.3.15
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/lib/apimatic-core/utilities/file_helper.rb +15 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2f9e523e9f7ffa86fc1a0b5acabcd71237aaf11f1a183e93735335c9be6b286
|
4
|
+
data.tar.gz: 9f3a4153b5b3f20f64c3c77e9c74d77b36f8e164904d7cf210cf0d79f8f14626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 020e8b79567ac8ce82f2ddb2125a6471b27fd170cdf81765c53558210d36a9df10ebbb594e1a19d49e2b1a1ca379531aea2213bace0d54857dc70af69b3763dd
|
7
|
+
data.tar.gz: dc271a87f5a0e10d16add7364b7f6b22a34f743d173864a347a220d41273dd9bf2294ac3cdc7b5716af8905252f9da44af3aa792e6890ade4ea15068d8da896d
|
@@ -1,21 +1,27 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
require 'open-uri'
|
3
|
+
|
3
4
|
module CoreLibrary
|
4
|
-
# A utility for file
|
5
|
+
# A utility for file-specific operations.
|
5
6
|
class FileHelper
|
6
7
|
@cache = {}
|
7
8
|
|
8
|
-
# Class method which takes a URL, downloads the file (if not already downloaded
|
9
|
-
# for this test session) and returns the path
|
9
|
+
# Class method which takes a URL, downloads the file (if not already downloaded
|
10
|
+
# for this test session), and returns the file path.
|
10
11
|
# @param [String] url The URL of the required file.
|
12
|
+
# @return [Tempfile] The downloaded file.
|
11
13
|
def self.get_file(url)
|
12
|
-
|
13
|
-
@cache[url]
|
14
|
-
@cache[url]
|
15
|
-
@cache[url].write(URI.parse(url).open({ ssl_ca_cert: Certifi.where }).read)
|
14
|
+
if @cache.key?(url)
|
15
|
+
@cache[url].rewind
|
16
|
+
return @cache[url]
|
16
17
|
end
|
17
|
-
|
18
|
-
|
18
|
+
|
19
|
+
tempfile = Tempfile.new('APIMatic')
|
20
|
+
tempfile.binmode
|
21
|
+
tempfile.write(URI.parse(url).open(ssl_ca_cert: Certifi.where).read)
|
22
|
+
tempfile.flush
|
23
|
+
|
24
|
+
@cache[url] = tempfile
|
19
25
|
end
|
20
26
|
end
|
21
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apimatic_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- APIMatic Ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apimatic_core_interfaces
|