magento_remote 0.1.4 → 0.1.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 +8 -8
- data/lib/magento_remote/magento_mech.rb +3 -1
- data/lib/magento_remote/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTE2NTAzYzM2YWY3MWYyY2U1YzA0MmU0YTZiMzMzMDJlYzk4MTRiMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmFjZTA1ZTcxZmU0ZDg3OTI2OGMxMGE1NmZlMzM0OTQ4OTJmOWMzOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTI3YmYxNjZlYjM2ZWUzMzZjYzI4MTZiNTI2NzRmMjNjYjYyYWU5MDVkNjIz
|
10
|
+
NDAzZDk5NGZhZDhkOTI1NDA1ZTUzNWVhNmE4YTMxNzY0ODNjMGViNjFhMzYx
|
11
|
+
ODJlNmU5Y2IxNDlhODQ2ZGY3ZTIxYzFmOTNiZmZiNTI3YjYzZDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzE0NTI1ZTA3NWQ0NjdkODI4ZWZkNDY4ZTQ5YjE2ZDE4NDQzZTdiYjg5ODNi
|
14
|
+
OTQ2YjAyZmNmZTc5YTdmNzEwOGY0ODJjNjZjN2IwOGJmMGU5ODIwODEzOGRm
|
15
|
+
YThlZWQyNjFjNDQ0ZWE0NWI5YzQzOTc4YTkzZmUyMTkwYmEyMjE=
|
@@ -23,6 +23,7 @@ class MagentoMech
|
|
23
23
|
@mech = Mechanize.new
|
24
24
|
@mech.user_agent = 'RawBot, Felix sends the Mech.'
|
25
25
|
@base_uri = base_uri
|
26
|
+
@mech.agent.allowed_error_codes = [429]
|
26
27
|
end
|
27
28
|
|
28
29
|
# Log to given file (-like object).
|
@@ -67,6 +68,7 @@ class MagentoMech
|
|
67
68
|
# Try to be a bit clever and early find out whether article
|
68
69
|
# is out of stock.
|
69
70
|
if add_to_cart(product_id, qty)
|
71
|
+
# to_i
|
70
72
|
return qty
|
71
73
|
end
|
72
74
|
num_ordered = 0
|
@@ -101,7 +103,7 @@ class MagentoMech
|
|
101
103
|
def login_with username, password
|
102
104
|
login_page = @mech.get("#{@base_uri}/customer/account/login/")
|
103
105
|
|
104
|
-
form = login_page.form_with(:action =>
|
106
|
+
form = login_page.form_with(:action => '#', :method => 'POST')
|
105
107
|
form.fields.find{|f| f.name == 'login[username]'}.value = username
|
106
108
|
form.fields.find{|f| f.name == 'login[password]'}.value = password
|
107
109
|
@mech.submit(form)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magento_remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Wolfsteller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|