e_plat 0.4.4 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1f621f479c0a566e9fafdc11e156345ad172ba623a3049b5f64fb67db915f04
4
- data.tar.gz: 67b1a319ed52a56d5004c6cf5e164eafb602003db6c1855e2eb57e6e6ba3f8bb
3
+ metadata.gz: 7940bc3d4b8d6b21b3ac8b36eba083a7cfea37fabd1161bca997c47338038b9b
4
+ data.tar.gz: 1d8ce726804d61e44f5b1c5e9675309219cfc03619b6bb7be3733cbd1f683e9e
5
5
  SHA512:
6
- metadata.gz: e1fe8a237089d3528670cdc40f107e994a32f4bf10f3877af0758f7365a80a39bfe96e7f61c3fb464ed19b0f9a0e280e1c304f56e5e06c9ac5476577e02f18f1
7
- data.tar.gz: 4964a6ab6ef2fcec16cefd24ed792db0e717f1baea0db72b3a8f687d9e1705fe6c9d89b6f07664395563a80f66dfc3660eb9fb6d7ec872fa2a494cb551f2aef5
6
+ metadata.gz: 04c6492c9a0d3d79769e5223c6b16ba1672a088cc5ff7baa9a94e942c555b9e0b6134881c96db1f8f7cb5bc32cff70d97a796e1725a6a6a998d69835a50a6dd6
7
+ data.tar.gz: 6355bcf307dbe5d0ef1fe660510f142390ee01a7e0a0e45fe1fc2b3379a00b28350b5b5151625dde045e0e73b2ac74ead4e591d6539afffd1d76f0d239a24b12
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
 
@@ -0,0 +1,9 @@
1
+ module EPlat
2
+ class Current < ActiveSupport::CurrentAttributes
3
+ attribute :e_plat_session
4
+
5
+ def e_plat_session
6
+ super || raise("EPlat session has not been initialized.")
7
+ end
8
+ end
9
+ end
@@ -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)
@@ -85,7 +85,7 @@ module EPlat
85
85
  private
86
86
 
87
87
  def client
88
- Current.e_plat_session
88
+ EPlat::Current.e_plat_session
89
89
  end
90
90
 
91
91
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module EPlat
2
- VERSION = "0.4.4"
2
+ VERSION = "0.5.0"
3
3
  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
4
+ version: 0.5.0
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-09 00:00:00.000000000 Z
11
+ date: 2024-01-11 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
data/lib/current.rb DELETED
@@ -1,7 +0,0 @@
1
- class Current < ActiveSupport::CurrentAttributes
2
- attribute :e_plat_session
3
-
4
- def e_plat_session
5
- super || raise("EPlat session has not been initialized.")
6
- end
7
- end