mobilize-base 1.1.03 → 1.1.04
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.
@@ -47,7 +47,7 @@ module Mobilize
|
|
47
47
|
|
48
48
|
#email management - used to make sure not too many emails get used at the same time
|
49
49
|
def Gdrive.slot_worker_by_path(path)
|
50
|
-
working_slots = Mobilize::Resque.jobs('working').map{|j| j['gdrive_slot'] if j['gdrive_slot']}.compact
|
50
|
+
working_slots = Mobilize::Resque.jobs('working').map{|j| j['gdrive_slot'] if (j and j['gdrive_slot'])}.compact
|
51
51
|
Gdrive.workers.sort_by{rand}.each do |w|
|
52
52
|
unless working_slots.include?([w['name'],Gdrive.domain].join("@"))
|
53
53
|
Mobilize::Resque.set_worker_args_by_path(path,{'gdrive_slot'=>[w['name'],Gdrive.domain].join("@")})
|
@@ -65,7 +65,7 @@ module Mobilize
|
|
65
65
|
#only give the user edit permissions if they're the ones
|
66
66
|
#creating it
|
67
67
|
target_sheet = Gsheet.find_or_create_by_path(target_path,gdrive_slot)
|
68
|
-
target_sheet.spreadsheet.update_acl(user.email,"writer") unless target_sheet.spreadsheet.acl_entry(user.email).role=="owner"
|
68
|
+
target_sheet.spreadsheet.update_acl(user.email,"writer") unless target_sheet.spreadsheet.acl_entry(user.email).ie{|e| e and e.role=="owner"}
|
69
69
|
target_sheet.delete_sheet1
|
70
70
|
end
|
71
71
|
target_sheet.merge(temp_sheet,user.name)
|
@@ -56,7 +56,7 @@ module Mobilize
|
|
56
56
|
|
57
57
|
#Resque workers and methods to find
|
58
58
|
def Resque.find_worker_by_path(path)
|
59
|
-
Resque.workers('working').select{|w| w.job and
|
59
|
+
Resque.workers('working').select{|w| w.job.ie{|j| j and j['payload'] and j['payload']['args'].first == path}}.first
|
60
60
|
end
|
61
61
|
|
62
62
|
def Resque.set_worker_args_by_path(path,args)
|
@@ -91,7 +91,7 @@ module Mobilize
|
|
91
91
|
#only give the user edit permissions if they're the ones
|
92
92
|
#creating it
|
93
93
|
jobs_sheet = Gsheet.find_or_create_by_path(r.path,gdrive_slot)
|
94
|
-
unless jobs_sheet.spreadsheet.acl_entry(r.user.email).role=="owner"
|
94
|
+
unless jobs_sheet.spreadsheet.acl_entry(r.user.email).ie{|e| e and e.role=="owner"}
|
95
95
|
jobs_sheet.spreadsheet.update_acl(r.user.email,"writer")
|
96
96
|
end
|
97
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobilize-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.04
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
239
|
version: '0'
|
240
240
|
segments:
|
241
241
|
- 0
|
242
|
-
hash:
|
242
|
+
hash: -2157829484572255156
|
243
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
244
|
none: false
|
245
245
|
requirements:
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
version: '0'
|
249
249
|
segments:
|
250
250
|
- 0
|
251
|
-
hash:
|
251
|
+
hash: -2157829484572255156
|
252
252
|
requirements: []
|
253
253
|
rubyforge_project: mobilize-base
|
254
254
|
rubygems_version: 1.8.24
|