sf-dropbox-ext 0.2.6 → 0.2.7

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
2
  SHA256:
3
- metadata.gz: 931c2c4d55011f21d2f84280cb2bd595c04b7dfd3d3bd6dda228f025d0ee3d96
4
- data.tar.gz: 0763d93dcdcb3a6fa174521abecdd5f454d1077ba76c8dea3d844dea45d93140
3
+ metadata.gz: bc80619e7f47a87c08c2321b161adac440c0af13b9f163c6a78019e60e8474b1
4
+ data.tar.gz: cfcab0a3e84f7484015eb2b9dbad15a92cfbbe769fa6ef9a2bda10d698583f1f
5
5
  SHA512:
6
- metadata.gz: 612e01b3011985fd690967a318ea87cbf72d66037e0a05657c859debe3fdc25af69798881311b4b8b2bb4580de3e1eda0dd147b35b1bbd5da25d3c33bf8ce2c4
7
- data.tar.gz: 3bee864b40262687d307136686bdd3a1c9750fb02e8fa8118f850dff0e9bf364cbd1aa385d6fb67f05d04df9cd8b220ae9c35450dc430a263eee55e0f0f4bead
6
+ metadata.gz: 8899066d56b639b657561d37da1ecfe77080d07439941b1fb96bd52ea1902896f1eb08f936836c346c3a4affcfb9b9e7da1de692b3a1d49bbea67f97af9daaf3
7
+ data.tar.gz: e6d7a4f8e9952f2261f94d101542758b38b25e3838f52a3da888cecaa540f9af94caefb9ac27d93b0350e565ca802339d45e2aad9609537b32144ee31d7d2404
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sf-dropbox-ext (0.2.6)
4
+ sf-dropbox-ext (0.2.7)
5
5
  dropbox-sdk-v2
6
6
  rails (~> 5)
7
7
 
@@ -73,7 +73,7 @@ GEM
73
73
  http_parser.rb (0.6.0)
74
74
  i18n (1.8.5)
75
75
  concurrent-ruby (~> 1.0)
76
- loofah (2.6.0)
76
+ loofah (2.7.0)
77
77
  crass (~> 1.0.2)
78
78
  nokogiri (>= 1.5.9)
79
79
  mail (2.7.1)
@@ -84,11 +84,11 @@ GEM
84
84
  mimemagic (0.3.5)
85
85
  mini_mime (1.0.2)
86
86
  mini_portile2 (2.4.0)
87
- minitest (5.14.1)
88
- nio4r (2.5.2)
87
+ minitest (5.14.2)
88
+ nio4r (2.5.3)
89
89
  nokogiri (1.10.10)
90
90
  mini_portile2 (~> 2.4.0)
91
- public_suffix (4.0.5)
91
+ public_suffix (4.0.6)
92
92
  rack (2.2.3)
93
93
  rack-test (1.1.0)
94
94
  rack (>= 1.0, < 3)
@@ -1,6 +1,4 @@
1
1
  DropboxExt::Engine.routes.draw do
2
- post "items/sync" => "items#sync"
3
-
4
2
  # dropbox config
5
3
  get "auth_redirect" => "dropbox#auth_complete"
6
4
 
@@ -1,3 +1,3 @@
1
1
  module DropboxExt
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
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.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Standard File
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2020-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -56,7 +56,6 @@ files:
56
56
  - app/assets/stylesheets/dropbox_ext/application.css
57
57
  - app/controllers/dropbox_ext/application_controller.rb
58
58
  - app/controllers/dropbox_ext/dropbox_controller.rb
59
- - app/controllers/dropbox_ext/items_controller.rb
60
59
  - app/helpers/dropbox_ext/application_helper.rb
61
60
  - app/helpers/dropbox_ext/dropbox_helper.rb
62
61
  - app/helpers/dropbox_ext/encryption_helper.rb
@@ -1,63 +0,0 @@
1
- require_dependency "dropbox_ext/application_controller"
2
-
3
- module DropboxExt
4
- class ItemsController < ApplicationController
5
-
6
- def dropbox
7
- if @dropbox
8
- return @dropbox
9
- end
10
-
11
- require 'dropbox'
12
- @dropbox = Dropbox::Client.new(params[:dbt])
13
- end
14
-
15
- def sync_decrypt_file
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
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
-
32
- end
33
-
34
- end
35
-
36
- def sync
37
- items = params[:items]
38
- auth_params = params[:auth_params]
39
-
40
- if items && items.length > 0
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"})
46
- end
47
-
48
- self.sync_decrypt_file()
49
-
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
- )
60
- end
61
-
62
- end
63
- end