gphotos 0.1.3.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gphotos/gphotos.rb +17 -6
- data/lib/gphotos/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc8126bd61916aa2609a4f0e08881eac077511d2
|
4
|
+
data.tar.gz: f7db8abf57da883e9e5dad6992a8f769ae7fb3a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c05df275baa76322fc761f077a1bdfbb9fde0ffbd435e7822d57014326bf6e66e9a7293b8a6e0d6bbe8c1b0d814315238396d0fadeb28dbde7d5863b73c37e4
|
7
|
+
data.tar.gz: bd777e11f348838be46099659031fe14e6a69c95cb8f05fe04893e38bca8de9e9b773acd85b983920bfd7219580e393c37112851aa001a4a5230ede28405285d
|
data/lib/gphotos/gphotos.rb
CHANGED
@@ -9,6 +9,7 @@ module Gphotos
|
|
9
9
|
prefs = {"profile" => {"managed_default_content_settings" => {"images" => 2}}}
|
10
10
|
@driver = Selenium::WebDriver.for(:chrome, :args => ["--user-data-dir=#{user_data_dir}"], :prefs => prefs)
|
11
11
|
@driver.manage.timeouts.implicit_wait = options[:page_timeout]
|
12
|
+
@wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
12
13
|
@wait_upload = Selenium::WebDriver::Wait.new(:timeout => options[:upload_timeout])
|
13
14
|
@workaround_applied = false
|
14
15
|
login(email, passwd, passwd_exec)
|
@@ -21,17 +22,27 @@ module Gphotos
|
|
21
22
|
return
|
22
23
|
end
|
23
24
|
|
24
|
-
element =
|
25
|
-
|
26
|
-
|
25
|
+
element = nil
|
26
|
+
|
27
|
+
begin
|
28
|
+
@wait.until do
|
29
|
+
element = @driver.find_element(:css => 'input[type="email"]')
|
30
|
+
element.displayed?
|
31
|
+
end
|
32
|
+
rescue Selenium::WebDriver::Error::TimeOutError
|
33
|
+
else
|
34
|
+
element.send_keys(email + "\n")
|
35
|
+
end
|
27
36
|
|
28
37
|
if !passwd and passwd_exec
|
29
38
|
passwd = %x{#{passwd_exec}}.strip
|
30
39
|
end
|
31
40
|
|
32
|
-
|
33
|
-
|
34
|
-
|
41
|
+
@wait.until do
|
42
|
+
element = @driver.find_element(:css => 'input[type="password"]')
|
43
|
+
element.displayed?
|
44
|
+
end
|
45
|
+
element.send_keys(passwd + "\n")
|
35
46
|
|
36
47
|
@driver.find_element(:css => 'input[type="file"]')
|
37
48
|
end
|
data/lib/gphotos/version.rb
CHANGED