e_plat 0.4.4 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/e_plat/current.rb +9 -0
- data/lib/e_plat/resource/base.rb +2 -2
- data/lib/e_plat/resource/collection.rb +1 -1
- data/lib/e_plat/resource/shop.rb +2 -1
- data/lib/e_plat/session.rb +3 -3
- data/lib/e_plat/version.rb +1 -1
- metadata +3 -3
- data/lib/current.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 638e434e4165189fd82401c63c5bc2b06ac758d04a60057482e4ee34e75ce77b
|
4
|
+
data.tar.gz: 6e7b5390abdc4c458c6247e29d74303a95223dcac4fc4fdedfa40a5d096c0fbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65f56da96c9d67f646b0b968e381c062f8438a9be0ff06a3b32c0a986e73ced372f8384ff5cc2c7477899407eb5b10134ac7185dd8c8b6bae6391d2f772e0a29
|
7
|
+
data.tar.gz: a395dc9d4cafc9071f62ad15497bc961ce91280da9e9f316fbe63ae6c73b3cec114bbca7858bb1d65d7c22335f0c9fd8a88d75fede8dd67608e957a9f612e519
|
data/README.md
CHANGED
@@ -83,7 +83,7 @@ EPlat is designed to let you mostly use it's universal interface, but then easil
|
|
83
83
|
event: :onload,
|
84
84
|
src: "https://preproduct.io/mini-script.js"
|
85
85
|
)
|
86
|
-
tag.name = "mini script" if Current.e_plat_session.bigcommerce?
|
86
|
+
tag.name = "mini script" if EPlat::Current.e_plat_session.bigcommerce?
|
87
87
|
tag.save
|
88
88
|
|
89
89
|
# ...when session is a Shopify store
|
@@ -582,7 +582,7 @@ Unfortunately it's in a Time Integer format. Haven't yet got dynamic conversion
|
|
582
582
|
# <%= link_to "previous products", "/", page_info: products.previous_page_info %>
|
583
583
|
# <%= link_to "Next products", "/", page_info: products.next_page_info %>
|
584
584
|
|
585
|
-
EPlat::Product.find(:all, params: {limit: 2, Current.e_plat_session.pagination_param => params['page_info'] })
|
585
|
+
EPlat::Product.find(:all, params: {limit: 2, EPlat::Current.e_plat_session.pagination_param => params['page_info'] })
|
586
586
|
```
|
587
587
|
|
588
588
|
|
data/lib/e_plat/resource/base.rb
CHANGED
@@ -30,7 +30,7 @@ module EPlat
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def client
|
33
|
-
Current.e_plat_session
|
33
|
+
EPlat::Current.e_plat_session
|
34
34
|
end
|
35
35
|
|
36
36
|
|
@@ -87,7 +87,7 @@ module EPlat
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def client
|
90
|
-
Current.e_plat_session
|
90
|
+
EPlat::Current.e_plat_session
|
91
91
|
end
|
92
92
|
|
93
93
|
def mapped?(attribute)
|
data/lib/e_plat/resource/shop.rb
CHANGED
@@ -10,12 +10,13 @@ module EPlat
|
|
10
10
|
prefix_options, query_options = split_options(options[:params])
|
11
11
|
path = (client.bigcommerce?) ? "/stores/#{ client.store_hash }/v2/store.json" : "#{ client.url_prefix }shop.json"
|
12
12
|
|
13
|
-
instantiate_record(format.decode(connection.get(path, headers).body), prefix_options)
|
13
|
+
instantiate_record(format.decode(connection.get(path, client.headers).body), prefix_options)
|
14
14
|
end
|
15
15
|
|
16
16
|
def current
|
17
17
|
find(1)
|
18
18
|
end
|
19
|
+
|
19
20
|
end
|
20
21
|
|
21
22
|
|
data/lib/e_plat/session.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
2
|
module EPlat
|
3
3
|
class Session
|
4
|
-
#the session is an instance of EPlat::Client made available via Rails Current::Attributes
|
4
|
+
#the session is an instance of EPlat::Client made available via Rails EPlat::Current::Attributes
|
5
5
|
|
6
6
|
def initialize(platform:, store_url:, api_token:, store_hash: nil)
|
7
|
-
Current.e_plat_session = EPlat::Client.new(
|
7
|
+
EPlat::Current.e_plat_session = EPlat::Client.new(
|
8
8
|
platform: platform,
|
9
9
|
store_url: store_url,
|
10
10
|
api_token: api_token,
|
@@ -13,7 +13,7 @@ module EPlat
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.clear!
|
16
|
-
Current.e_plat_session = nil
|
16
|
+
EPlat::Current.e_plat_session = nil
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
data/lib/e_plat/version.rb
CHANGED
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
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oliwoodsuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -207,12 +207,12 @@ files:
|
|
207
207
|
- lib/active_resource/connection_error.rb
|
208
208
|
- lib/active_resource/formats.rb
|
209
209
|
- lib/active_resource/schema.rb
|
210
|
-
- lib/current.rb
|
211
210
|
- lib/e_plat.rb
|
212
211
|
- lib/e_plat/client.rb
|
213
212
|
- lib/e_plat/client/default_request_args.rb
|
214
213
|
- lib/e_plat/client/platform_convenience_methods.rb
|
215
214
|
- lib/e_plat/connection.rb
|
215
|
+
- lib/e_plat/current.rb
|
216
216
|
- lib/e_plat/engine.rb
|
217
217
|
- lib/e_plat/errors/incorrect_type_error.rb
|
218
218
|
- lib/e_plat/errors/missing_migration_key_error.rb
|