paraxial 1.4.4 → 1.4.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/lib/paraxial/checker.rb +1 -0
- data/lib/paraxial/free_tier.rb +12 -2
- data/lib/paraxial/version.rb +1 -1
- 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: e50a89bbe7acfcde6a930484e7b5677610c32b362fdd637065dfe83a87cdb63a
|
4
|
+
data.tar.gz: 1704c13f2d06ba9acab0e9ebd4ff26a5e0921bd399adb23e1b85ee9116e9e1ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab969b9f63404b14bfa56ac8460edbaf28d0ecc82a540035538140a45edf1ad19b27dd641c78bad1dff3f8c5d8822ac60f91a8f2d9d164324106a803c5c8271e
|
7
|
+
data.tar.gz: 4fb2cb21157c34ec9bda2946dcd4fe05aab39d47a33aeb831e8c09b774f5cce70bfce40d4394c680ac69955d25ad53495095db4d6474ab058d256c1fc5de3db4
|
data/lib/paraxial/checker.rb
CHANGED
data/lib/paraxial/free_tier.rb
CHANGED
@@ -7,7 +7,7 @@ module Paraxial
|
|
7
7
|
attr_reader :is_free_tier
|
8
8
|
|
9
9
|
def initialize
|
10
|
-
@is_free_tier =
|
10
|
+
@is_free_tier = false
|
11
11
|
check_free_tier_status
|
12
12
|
end
|
13
13
|
|
@@ -22,7 +22,17 @@ module Paraxial
|
|
22
22
|
r = Net::HTTP.post(uri, body.to_json, headers)
|
23
23
|
result = JSON.parse(r.body)
|
24
24
|
# Assume the API response contains a field `free_tier` (true/false)
|
25
|
-
|
25
|
+
# Response Body: {"error":"api_key not valid"}
|
26
|
+
if result['free_tier'] == true
|
27
|
+
puts "[Paraxial] Free tier site, some functionality is disabled"
|
28
|
+
@is_free_tier = true
|
29
|
+
elsif result['free_tier'] == false
|
30
|
+
puts "[Paraxial] Account active, all features available"
|
31
|
+
@is_free_tier = false
|
32
|
+
else
|
33
|
+
puts "[Paraxial] Account check failed, some functionality is disabled"
|
34
|
+
@is_free_tier = true
|
35
|
+
end
|
26
36
|
rescue StandardError => e
|
27
37
|
# Handle any errors (network issues, parsing errors, etc.)
|
28
38
|
puts "Error fetching free tier status: #{e.message}"
|
data/lib/paraxial/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paraxial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Lubas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|