fmrest-core 0.26.0 → 0.26.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/fmrest/v1/container_fields.rb +5 -1
- data/lib/fmrest/v1/dates.rb +4 -4
- data/lib/fmrest/v1/token_session.rb +7 -6
- data/lib/fmrest/version.rb +1 -1
- data/lib/fmrest.rb +7 -6
- 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: 47bbc3a1dd60de769f11e2e95034ff7e2a88374553251ea5f210b5328551999a
|
4
|
+
data.tar.gz: a96c1503865da0c440e4ee4516ebb156d4bef6e39d800fced6ad2110cb8b4264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc5bc00c7e9122511fac018624f5ac8a5faf2102f78cb0ad350e3366fc56cbbb91a32af7975aeee74400c7ade2c456190c5ce2abdf7ba1ef24d7f2830944a037
|
7
|
+
data.tar.gz: 1eabd5a9c384b7ee398cbae514d350d96eb3c4d7e62e358f005ebcc174da27ed561e08399a2efb6c138a1a7b697921c496f90091ba7ecc7469fca15014fb745f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -588,7 +588,7 @@ FM Data API reference: https://help.claris.com/en/data-api-guide/
|
|
588
588
|
|
589
589
|
The latest fmrest-ruby is
|
590
590
|
[tested against](https://github.com/beezwax/fmrest-ruby/actions?query=workflow%3ACI)
|
591
|
-
Ruby 3.0 through 3.3
|
591
|
+
Ruby 3.0 through 3.3, and Rails (ActiveSupport) 6.1 through 7.1.
|
592
592
|
|
593
593
|
## Gem development
|
594
594
|
|
@@ -55,7 +55,11 @@ module FmRest
|
|
55
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
56
|
end
|
57
57
|
|
58
|
-
url =
|
58
|
+
url = if e.io.meta["location"].match(/\Ahttps?:/)
|
59
|
+
URI(e.io.meta["location"])
|
60
|
+
else
|
61
|
+
URI.join("#{url.scheme}://#{url.host}:#{url.port}", e.io.meta["location"])
|
62
|
+
end
|
59
63
|
|
60
64
|
# Now request the URL again with the proper session cookie using
|
61
65
|
# OpenURI, which wraps the response in an IO object which also responds
|
data/lib/fmrest/v1/dates.rb
CHANGED
@@ -71,10 +71,10 @@ module FmRest
|
|
71
71
|
|
72
72
|
# Do we have ActiveSupport's TimeZone?
|
73
73
|
time = if time.respond_to?(:in_time_zone)
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
time.in_time_zone(zone || ::Time.zone)
|
75
|
+
else
|
76
|
+
time.localtime
|
77
|
+
end
|
78
78
|
|
79
79
|
Rational(time.utc_offset, 86400) # seconds in one day (24*60*60)
|
80
80
|
end
|
@@ -101,12 +101,13 @@ module FmRest
|
|
101
101
|
# Strip the host part to just the hostname (i.e. no scheme or port)
|
102
102
|
host = @settings.host!
|
103
103
|
host = URI(host).hostname if host =~ /\Ahttps?:\/\//
|
104
|
-
identity_segment =
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
104
|
+
identity_segment =
|
105
|
+
if fmid_token = @settings.fmid_token
|
106
|
+
require "digest"
|
107
|
+
Digest::SHA256.hexdigest(fmid_token)
|
108
|
+
else
|
109
|
+
@settings.username!
|
110
|
+
end
|
110
111
|
"#{host}:#{@settings.database!}:#{identity_segment}"
|
111
112
|
end
|
112
113
|
end
|
data/lib/fmrest/version.rb
CHANGED
data/lib/fmrest.rb
CHANGED
@@ -40,12 +40,13 @@ module FmRest
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def logger
|
43
|
-
@logger ||=
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
@logger ||=
|
44
|
+
if defined?(Rails)
|
45
|
+
Rails.logger
|
46
|
+
else
|
47
|
+
require "logger"
|
48
|
+
Logger.new($stdout)
|
49
|
+
end
|
49
50
|
end
|
50
51
|
|
51
52
|
# Shortcut for `FmRest::V1.escape_find_operators`
|
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.26.
|
4
|
+
version: 0.26.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:
|
11
|
+
date: 2024-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|