e_plat 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/e_plat/type_coercer.rb +1 -1
- data/lib/e_plat/version.rb +1 -1
- data/lib/e_plat.rb +10 -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: e1f621f479c0a566e9fafdc11e156345ad172ba623a3049b5f64fb67db915f04
|
4
|
+
data.tar.gz: 67b1a319ed52a56d5004c6cf5e164eafb602003db6c1855e2eb57e6e6ba3f8bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1fe8a237089d3528670cdc40f107e994a32f4bf10f3877af0758f7365a80a39bfe96e7f61c3fb464ed19b0f9a0e280e1c304f56e5e06c9ac5476577e02f18f1
|
7
|
+
data.tar.gz: 4964a6ab6ef2fcec16cefd24ed792db0e717f1baea0db72b3a8f687d9e1705fe6c9d89b6f07664395563a80f66dfc3660eb9fb6d7ec872fa2a494cb551f2aef5
|
data/README.md
CHANGED
@@ -44,6 +44,9 @@ You can configure which platform APIs are used by updating the EPlat config: <br
|
|
44
44
|
EPlat.config.shopify_api_version = "2024-01"
|
45
45
|
EPlat.config.bigcommerce_api_version = "v3"
|
46
46
|
EPlat.config.woocommerce_api_version = "v3"
|
47
|
+
|
48
|
+
# EPlat.api_display_name.shopify #=> "2024-01" # presents as the platform would display in URL paths
|
49
|
+
# EPlat.config.shopify_api_version #=> "2024_01" # coerced interally for creating constants
|
47
50
|
```
|
48
51
|
<br>
|
49
52
|
|
data/lib/e_plat/type_coercer.rb
CHANGED
data/lib/e_plat/version.rb
CHANGED
data/lib/e_plat.rb
CHANGED
@@ -32,7 +32,16 @@ module EPlat
|
|
32
32
|
SUPPORTED_BIGCOMMERCE_API_VERSIONS.include?(v) ? v : raise(ArgumentError, "Bigcommerce API version #{value} is not supported")
|
33
33
|
end)
|
34
34
|
|
35
|
-
setting(:woocommerce_api_version, default: "v3",
|
35
|
+
setting(:woocommerce_api_version, default: "v3", constructor: ->(value) { value.downcase.gsub("v", "") })
|
36
|
+
|
37
|
+
def self.api_display_name
|
38
|
+
apis = Struct.new(:shopify, :bigcommerce, :woocommerce)
|
39
|
+
apis.new(
|
40
|
+
shopify: config.shopify_api_version&.dasherize, # "2024-01"
|
41
|
+
bigcommerce: "v#{config.bigcommerce_api_version}", # "v3"
|
42
|
+
woocommerce: "v#{config.woocommerce_api_version}" # "v3"
|
43
|
+
)
|
44
|
+
end
|
36
45
|
|
37
46
|
class Error < StandardError; end
|
38
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: e_plat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oliwoodsuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|