magentwo 0.1.91 → 0.2.00

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15cb810f21e6410e34b764567e40378ca481d8b2ba9133a6981a2b6738818c8a
4
- data.tar.gz: c5f1fe3851888baf2d6371e849fa44a87087c54ea91adcf574ed2ff79f384d3b
3
+ metadata.gz: 76974083e8a45ca5e56c3a28bd058475fc0044faa6f7d4ebb996e82c05a26570
4
+ data.tar.gz: 4a181b695e8764844e0088d533cf70e5b0f80fd8beb2b5dd3b3439d0a1b76e6c
5
5
  SHA512:
6
- metadata.gz: a18862fc3e2792a23539d840ffea2591d90c232ce17d2fa0d114707d759554bbd114bcd726c7d1a5bc13ce67bb4c9c7d482ff038d0e2e98ca4d55eaec4e6535c
7
- data.tar.gz: 49fca1ac96a80a6a3373f65340fd1e5bc8861fba62c3957b0bf6e2d4154c94ee90ecb5dd98a4e89265dd3e16acbca2104e8c2f76bbbd7813a17dc00cd6345863
6
+ metadata.gz: 43839b75be374f3594307f83d147e2fae9f0035737f6123d535a044dd64b173a7d7eacc468af17d19067d9225983da1e5a5ce77aedbf6ffd0efcd36217187111
7
+ data.tar.gz: 5008f94fee50fd43ad047508a78df4b25b3f122cea505b0c75006b20d0ab652bb7849784ace68ca029d0ad9571267156a4e17ea38a348b39d09a02460e8f12d0
data/lib/connection.rb CHANGED
@@ -57,11 +57,11 @@ module Magentwo
57
57
  end
58
58
 
59
59
  def post path, data
60
- request Net::HTTP::Put, path:path, data:data
60
+ request Net::HTTP::Post, path:path, data:data
61
61
  end
62
62
 
63
63
  def get path, query
64
64
  request Net::HTTP::Get, path:"#{path}?#{query}"
65
65
  end
66
66
  end
67
- end
67
+ end
data/lib/dataset.rb CHANGED
@@ -90,7 +90,7 @@ module Magentwo
90
90
  # Fetching
91
91
  ################
92
92
  def info
93
- result = self.model.get self.page(1, 1).to_query, {:meta_data => true}
93
+ result = self.model.get self.page(1, 1).to_query, :meta_data => true
94
94
  {
95
95
  :fields => result[:items]&.first&.keys,
96
96
  :total_count => result[:total_count]
data/lib/filter.rb CHANGED
@@ -10,7 +10,7 @@ module Magentwo
10
10
  def to_query idx, field:self.field, value:self.value
11
11
  [
12
12
  "searchCriteria[filter_groups][#{idx}][filters][0][field]=#{self.field}",
13
- "searchCriteria[filter_groups][#{idx}][filters][0][value]=#{URI::encode(self.value.to_s)}",
13
+ "searchCriteria[filter_groups][#{idx}][filters][0][value]=#{CGI.escape(self.value.to_s)}",
14
14
  "searchCriteria[filter_groups][#{idx}][filters][0][condition_type]=#{self.class.name.split("::").last.downcase}"]
15
15
  .join("&")
16
16
  end
@@ -24,7 +24,7 @@ module Magentwo
24
24
  def to_query idx
25
25
  [
26
26
  "searchCriteria[filter_groups][#{idx}][filters][0][field]=#{self.field}",
27
- "searchCriteria[filter_groups][#{idx}][filters][0][value]=#{URI::encode(self.value.map(&:to_s).join(","))}",
27
+ "searchCriteria[filter_groups][#{idx}][filters][0][value]=#{CGI.escape(self.value.map(&:to_s).join(","))}",
28
28
  "searchCriteria[filter_groups][#{idx}][filters][0][condition_type]=#{self.class.name.split("::").last.downcase}"]
29
29
  .join("&")
30
30
  end
@@ -141,7 +141,7 @@ module Magentwo
141
141
  end
142
142
  def to_query idx=nil
143
143
  #TODO api supports nested field selection e.g. items[address[street]]
144
- "fields=items[#{URI::encode(self.fields.map(&:to_s).join(","))}]"
144
+ "fields=items[#{CGI.escape(self.fields.map(&:to_s).join(","))}]"
145
145
  end
146
146
  end
147
147
  end
data/magentwo.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'magentwo'
3
- s.version = '0.1.91'
4
- s.date = '2019-01-17'
3
+ s.version = '0.2.00'
4
+ s.date = '2023-02-20'
5
5
  s.summary = "Magento 2 API Wrapper"
6
6
  s.description = "Provides a simple Ruby Interface to interact with the Magento 2 API"
7
7
  s.authors = ["André Mueß"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magentwo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.91
4
+ version: 0.2.00
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Mueß
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2023-02-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides a simple Ruby Interface to interact with the Magento 2 API
14
14
  email: andre.cux90@gmail.com
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.2.15
64
+ rubygems_version: 3.3.25
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Magento 2 API Wrapper