sf-dropbox-ext 0.2.1 → 0.2.6

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
- SHA1:
3
- metadata.gz: e3f70d6b223c219467137db7749bf008e11ba649
4
- data.tar.gz: 3a5e306ef99e0d2d18f4135b74ad5d10cf72f978
2
+ SHA256:
3
+ metadata.gz: 931c2c4d55011f21d2f84280cb2bd595c04b7dfd3d3bd6dda228f025d0ee3d96
4
+ data.tar.gz: 0763d93dcdcb3a6fa174521abecdd5f454d1077ba76c8dea3d844dea45d93140
5
5
  SHA512:
6
- metadata.gz: d2406db3ccd873f19058d42ef5744749cfe779cb1336cc95d68a4a37d905fe9f5ce3369b3577bd11d730edcfe7e5b31334f35198f56be4fe84f75d36d6a1169f
7
- data.tar.gz: 23b2cfb3034e3d00d5dbdec70a2a4bde9cf79288352d7853080d39cad8dafd0aa647a8a358becc0b4d6a213d6fda73f3238775bd4ac34ce5a3747760a91c0d7a
6
+ metadata.gz: 612e01b3011985fd690967a318ea87cbf72d66037e0a05657c859debe3fdc25af69798881311b4b8b2bb4580de3e1eda0dd147b35b1bbd5da25d3c33bf8ce2c4
7
+ data.tar.gz: 3bee864b40262687d307136686bdd3a1c9750fb02e8fa8118f850dff0e9bf364cbd1aa385d6fb67f05d04df9cd8b220ae9c35450dc430a263eee55e0f0f4bead
@@ -1,130 +1,139 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sf-dropbox-ext (0.1.3)
4
+ sf-dropbox-ext (0.2.6)
5
5
  dropbox-sdk-v2
6
- rails (~> 5.0.1)
6
+ rails (~> 5)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (5.0.1)
12
- actionpack (= 5.0.1)
13
- nio4r (~> 1.2)
14
- websocket-driver (~> 0.6.1)
15
- actionmailer (5.0.1)
16
- actionpack (= 5.0.1)
17
- actionview (= 5.0.1)
18
- activejob (= 5.0.1)
11
+ actioncable (5.2.4.3)
12
+ actionpack (= 5.2.4.3)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailer (5.2.4.3)
16
+ actionpack (= 5.2.4.3)
17
+ actionview (= 5.2.4.3)
18
+ activejob (= 5.2.4.3)
19
19
  mail (~> 2.5, >= 2.5.4)
20
20
  rails-dom-testing (~> 2.0)
21
- actionpack (5.0.1)
22
- actionview (= 5.0.1)
23
- activesupport (= 5.0.1)
24
- rack (~> 2.0)
25
- rack-test (~> 0.6.3)
21
+ actionpack (5.2.4.3)
22
+ actionview (= 5.2.4.3)
23
+ activesupport (= 5.2.4.3)
24
+ rack (~> 2.0, >= 2.0.8)
25
+ rack-test (>= 0.6.3)
26
26
  rails-dom-testing (~> 2.0)
27
27
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.0.1)
29
- activesupport (= 5.0.1)
28
+ actionview (5.2.4.3)
29
+ activesupport (= 5.2.4.3)
30
30
  builder (~> 3.1)
31
- erubis (~> 2.7.0)
31
+ erubi (~> 1.4)
32
32
  rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
- activejob (5.0.1)
35
- activesupport (= 5.0.1)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
+ activejob (5.2.4.3)
35
+ activesupport (= 5.2.4.3)
36
36
  globalid (>= 0.3.6)
37
- activemodel (5.0.1)
38
- activesupport (= 5.0.1)
39
- activerecord (5.0.1)
40
- activemodel (= 5.0.1)
41
- activesupport (= 5.0.1)
42
- arel (~> 7.0)
43
- activesupport (5.0.1)
37
+ activemodel (5.2.4.3)
38
+ activesupport (= 5.2.4.3)
39
+ activerecord (5.2.4.3)
40
+ activemodel (= 5.2.4.3)
41
+ activesupport (= 5.2.4.3)
42
+ arel (>= 9.0)
43
+ activestorage (5.2.4.3)
44
+ actionpack (= 5.2.4.3)
45
+ activerecord (= 5.2.4.3)
46
+ marcel (~> 0.3.1)
47
+ activesupport (5.2.4.3)
44
48
  concurrent-ruby (~> 1.0, >= 1.0.2)
45
- i18n (~> 0.7)
49
+ i18n (>= 0.7, < 2)
46
50
  minitest (~> 5.1)
47
51
  tzinfo (~> 1.1)
48
- addressable (2.5.0)
49
- public_suffix (~> 2.0, >= 2.0.2)
50
- arel (7.1.4)
51
- builder (3.2.3)
52
- concurrent-ruby (1.0.4)
53
- domain_name (0.5.20161129)
52
+ addressable (2.7.0)
53
+ public_suffix (>= 2.0.2, < 5.0)
54
+ arel (9.0.0)
55
+ builder (3.2.4)
56
+ concurrent-ruby (1.1.7)
57
+ crass (1.0.6)
58
+ domain_name (0.5.20190701)
54
59
  unf (>= 0.0.5, < 1.0.0)
55
60
  dropbox-sdk-v2 (0.0.3)
56
61
  http (~> 2.0)
57
- erubis (2.7.0)
58
- globalid (0.3.7)
59
- activesupport (>= 4.1.0)
60
- http (2.2.1)
62
+ erubi (1.9.0)
63
+ globalid (0.4.2)
64
+ activesupport (>= 4.2.0)
65
+ http (2.2.2)
61
66
  addressable (~> 2.3)
62
67
  http-cookie (~> 1.0)
63
68
  http-form_data (~> 1.0.1)
64
69
  http_parser.rb (~> 0.6.0)
65
70
  http-cookie (1.0.3)
66
71
  domain_name (~> 0.5)
67
- http-form_data (1.0.1)
72
+ http-form_data (1.0.3)
68
73
  http_parser.rb (0.6.0)
69
- i18n (0.8.0)
70
- loofah (2.0.3)
74
+ i18n (1.8.5)
75
+ concurrent-ruby (~> 1.0)
76
+ loofah (2.6.0)
77
+ crass (~> 1.0.2)
71
78
  nokogiri (>= 1.5.9)
72
- mail (2.6.4)
73
- mime-types (>= 1.16, < 4)
74
- method_source (0.8.2)
75
- mime-types (3.1)
76
- mime-types-data (~> 3.2015)
77
- mime-types-data (3.2016.0521)
78
- mini_portile2 (2.1.0)
79
- minitest (5.10.1)
80
- nio4r (1.2.1)
81
- nokogiri (1.7.0.1)
82
- mini_portile2 (~> 2.1.0)
83
- public_suffix (2.0.5)
84
- rack (2.0.1)
85
- rack-test (0.6.3)
86
- rack (>= 1.0)
87
- rails (5.0.1)
88
- actioncable (= 5.0.1)
89
- actionmailer (= 5.0.1)
90
- actionpack (= 5.0.1)
91
- actionview (= 5.0.1)
92
- activejob (= 5.0.1)
93
- activemodel (= 5.0.1)
94
- activerecord (= 5.0.1)
95
- activesupport (= 5.0.1)
96
- bundler (>= 1.3.0, < 2.0)
97
- railties (= 5.0.1)
79
+ mail (2.7.1)
80
+ mini_mime (>= 0.1.1)
81
+ marcel (0.3.3)
82
+ mimemagic (~> 0.3.2)
83
+ method_source (1.0.0)
84
+ mimemagic (0.3.5)
85
+ mini_mime (1.0.2)
86
+ mini_portile2 (2.4.0)
87
+ minitest (5.14.1)
88
+ nio4r (2.5.2)
89
+ nokogiri (1.10.10)
90
+ mini_portile2 (~> 2.4.0)
91
+ public_suffix (4.0.5)
92
+ rack (2.2.3)
93
+ rack-test (1.1.0)
94
+ rack (>= 1.0, < 3)
95
+ rails (5.2.4.3)
96
+ actioncable (= 5.2.4.3)
97
+ actionmailer (= 5.2.4.3)
98
+ actionpack (= 5.2.4.3)
99
+ actionview (= 5.2.4.3)
100
+ activejob (= 5.2.4.3)
101
+ activemodel (= 5.2.4.3)
102
+ activerecord (= 5.2.4.3)
103
+ activestorage (= 5.2.4.3)
104
+ activesupport (= 5.2.4.3)
105
+ bundler (>= 1.3.0)
106
+ railties (= 5.2.4.3)
98
107
  sprockets-rails (>= 2.0.0)
99
- rails-dom-testing (2.0.2)
100
- activesupport (>= 4.2.0, < 6.0)
101
- nokogiri (~> 1.6)
102
- rails-html-sanitizer (1.0.3)
103
- loofah (~> 2.0)
104
- railties (5.0.1)
105
- actionpack (= 5.0.1)
106
- activesupport (= 5.0.1)
108
+ rails-dom-testing (2.0.3)
109
+ activesupport (>= 4.2.0)
110
+ nokogiri (>= 1.6)
111
+ rails-html-sanitizer (1.3.0)
112
+ loofah (~> 2.3)
113
+ railties (5.2.4.3)
114
+ actionpack (= 5.2.4.3)
115
+ activesupport (= 5.2.4.3)
107
116
  method_source
108
117
  rake (>= 0.8.7)
109
- thor (>= 0.18.1, < 2.0)
110
- rake (12.0.0)
111
- sprockets (3.7.1)
118
+ thor (>= 0.19.0, < 2.0)
119
+ rake (13.0.1)
120
+ sprockets (4.0.2)
112
121
  concurrent-ruby (~> 1.0)
113
122
  rack (> 1, < 3)
114
- sprockets-rails (3.2.0)
123
+ sprockets-rails (3.2.1)
115
124
  actionpack (>= 4.0)
116
125
  activesupport (>= 4.0)
117
126
  sprockets (>= 3.0.0)
118
- thor (0.19.4)
119
- thread_safe (0.3.5)
120
- tzinfo (1.2.2)
127
+ thor (1.0.1)
128
+ thread_safe (0.3.6)
129
+ tzinfo (1.2.7)
121
130
  thread_safe (~> 0.1)
122
131
  unf (0.1.4)
123
132
  unf_ext
124
- unf_ext (0.0.7.2)
125
- websocket-driver (0.6.5)
133
+ unf_ext (0.0.7.7)
134
+ websocket-driver (0.7.3)
126
135
  websocket-extensions (>= 0.1.0)
127
- websocket-extensions (0.1.2)
136
+ websocket-extensions (0.1.5)
128
137
 
129
138
  PLATFORMS
130
139
  ruby
@@ -133,4 +142,4 @@ DEPENDENCIES
133
142
  sf-dropbox-ext!
134
143
 
135
144
  BUNDLED WITH
136
- 1.13.6
145
+ 1.17.2
@@ -13,19 +13,24 @@ module DropboxExt
13
13
  end
14
14
 
15
15
  def sync_decrypt_file
16
- existing = dropbox.search("", "decrypt")
17
-
18
- if existing.length > 0
19
- file = existing[0]
20
- days_old = (Time.now - file.client_modified).to_i / (24 * 60 * 60)
21
- if days_old < 14
22
- return
16
+ begin
17
+ existing = dropbox.search("", "decrypt")
18
+
19
+ if existing.length > 0
20
+ file = existing[0]
21
+ days_old = (Time.now - file.client_modified).to_i / (24 * 60 * 60)
22
+ if days_old < 14
23
+ return
24
+ end
23
25
  end
26
+
27
+ require 'open-uri'
28
+ content = open('https://raw.githubusercontent.com/standardfile/decrypt-html-page/master/decrypt.html').read
29
+ dropbox.upload("/decrypt.html", content, {:mode => "overwrite"})
30
+ rescue
31
+
24
32
  end
25
-
26
- require 'open-uri'
27
- content = open('https://raw.githubusercontent.com/standardfile/decrypt-html-page/master/decrypt.html').read
28
- dropbox.upload("/decrypt.html", content, {:mode => "overwrite"})
33
+
29
34
  end
30
35
 
31
36
  def sync
@@ -33,16 +38,25 @@ module DropboxExt
33
38
  auth_params = params[:auth_params]
34
39
 
35
40
  if items && items.length > 0
36
- items.each do |item|
37
- payload = { "items" => [item]}
38
- payload["auth_params"] = auth_params if auth_params != nil
39
- dropbox.upload("/data/#{item[:content_type]}-#{item[:uuid]}.txt", "#{JSON.pretty_generate(payload.as_json)}", {:mode => "overwrite"})
40
- end
41
+ payload = { "items" => items }
42
+ payload["auth_params"] = auth_params if auth_params != nil
43
+ folder = "/#{Time.current.year}/#{DateTime.now.strftime("%B")}"
44
+ filename = "#{DateTime.now.strftime("%B %d, %Y").sub(',', '')}.txt"
45
+ dropbox.upload("#{folder}/#{filename}", "#{JSON.pretty_generate(payload.as_json)}", {:mode => "overwrite"})
41
46
  end
42
47
 
43
48
  self.sync_decrypt_file()
44
49
 
45
50
  render :json => {:success => true}
51
+ rescue Dropbox::ApiError, Dropbox::ClientError => _e
52
+ render(
53
+ json: {
54
+ error: {
55
+ message: 'Could not sync item to Dropbox. Please verify your integration.'
56
+ }
57
+ },
58
+ status: :bad_request
59
+ )
46
60
  end
47
61
 
48
62
  end
@@ -18,6 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.files = `git ls-files`.split("\n")
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency "rails", "~> 5.0.1"
21
+ s.add_dependency "rails", "~> 5"
22
22
  s.add_dependency "dropbox-sdk-v2"
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module DropboxExt
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sf-dropbox-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Standard File
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2020-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.1
19
+ version: '5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.1
26
+ version: '5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dropbox-sdk-v2
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -91,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.4.8
94
+ rubygems_version: 3.0.3
96
95
  signing_key:
97
96
  specification_version: 4
98
97
  summary: Summary of DropboxExt.