gphotos 0.1.1 → 0.1.2
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 +4 -4
- data/lib/gphotos/app.rb +7 -4
- data/lib/gphotos/gphotos.rb +5 -4
- data/lib/gphotos/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca60cae44396023d5a11ffbe51ff0d84df3116a5
|
|
4
|
+
data.tar.gz: 6853345ab48a18e8087a073b005d01a4ebebadd2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31f8ab4fae2816860c6fceabcfc46e0fdd66193dc3192a134a34992096c328adc7cc90d407cdf2c7b42b3bdd41a5ba55dd87f1dadc1332336b73c2c71eb61cfb
|
|
7
|
+
data.tar.gz: 5f1abec0b1187080289f88188fb64158e38b3b2419bfdd419666c3a07de5a6039dbdc251ad5859a0eb4cd632a3f3d9441b4ba907d7ed80ba43b8b6b7f24dfd33
|
data/lib/gphotos/app.rb
CHANGED
|
@@ -79,10 +79,13 @@ module Gphotos
|
|
|
79
79
|
|
|
80
80
|
puts 'upload:'
|
|
81
81
|
uploaded, skipped, not_exist = gphotos.upload(files) do |file, status|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
case status
|
|
83
|
+
when :uploading
|
|
84
|
+
print "#{file} ..."
|
|
85
|
+
when :skipped, :not_exist
|
|
86
|
+
puts "\b\b\b(#{status})"
|
|
87
|
+
when :uploaded
|
|
88
|
+
puts "\b\b\b "
|
|
86
89
|
end
|
|
87
90
|
end
|
|
88
91
|
|
data/lib/gphotos/gphotos.rb
CHANGED
|
@@ -5,7 +5,7 @@ module Gphotos
|
|
|
5
5
|
class Gphotos
|
|
6
6
|
|
|
7
7
|
def initialize(email, passwd, passwd_exec, options = {})
|
|
8
|
-
options = {:page_timeout => 20, :upload_timeout =>
|
|
8
|
+
options = {:page_timeout => 20, :upload_timeout => 7200 }.merge(options)
|
|
9
9
|
profile = Selenium::WebDriver::Chrome::Profile.new
|
|
10
10
|
profile['profile.managed_default_content_settings.images'] = 2
|
|
11
11
|
@driver = Selenium::WebDriver.for(:chrome, :profile => profile)
|
|
@@ -62,14 +62,15 @@ module Gphotos
|
|
|
62
62
|
not_exist = []
|
|
63
63
|
result = ''
|
|
64
64
|
files.each do |file|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
block.call(file, :uploading)
|
|
66
|
+
full_path = File.expand_path(file)
|
|
67
|
+
if !File.file?(full_path)
|
|
67
68
|
not_exist.push(file)
|
|
68
69
|
block.call(file, :not_exist)
|
|
69
70
|
next
|
|
70
71
|
end
|
|
71
72
|
current_result = ''
|
|
72
|
-
element.send_keys(
|
|
73
|
+
element.send_keys(full_path)
|
|
73
74
|
@wait.until do
|
|
74
75
|
alert = @driver.find_element(:css => 'div[role="alert"]')
|
|
75
76
|
begin
|
data/lib/gphotos/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gphotos
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Zhong Jianxin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-01-
|
|
11
|
+
date: 2017-01-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|