Skip to content

Commit b9fc90d

Browse files
author
Gogs
committed
Upgrade Ruby/Rails version and store save path for documents in config file
1 parent 43f1341 commit b9fc90d

6 files changed

Lines changed: 141 additions & 101 deletions

File tree

Gemfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ source 'https://rubygems.org'
22

33

44
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5-
gem 'rails', '4.2.7.1'
5+
gem 'rails', '5.2.3'
66
# Use sqlite3 as the database for Active Record
77
gem 'sqlite3'
88
gem 'mysql2', '~> 0.3.18'
99
# Use SCSS for stylesheets
1010
gem 'sass-rails', '~> 5.0'
1111
# Use Uglifier as compressor for JavaScript assets
1212
gem 'uglifier', '>= 1.3.0'
13-
# Use CoffeeScript for .coffee assets and views
14-
gem 'coffee-rails', '~> 4.1.0'
1513
# See https://github.com/rails/execjs#readme for more supported runtimes
1614
# gem 'therubyracer', platforms: :ruby
1715

@@ -27,6 +25,7 @@ gem 'sdoc', '~> 0.4.0', group: :doc
2725
# Use ActiveModel has_secure_password
2826
gem 'bcrypt', '~> 3.1.7'
2927
gem 'jwt'
28+
gem 'config'
3029

3130
# Use Unicorn as the app server
3231
# gem 'unicorn'

Gemfile.lock

Lines changed: 133 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,155 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actionmailer (4.2.7.1)
5-
actionpack (= 4.2.7.1)
6-
actionview (= 4.2.7.1)
7-
activejob (>= 4.2.11)
4+
actioncable (5.2.3)
5+
actionpack (= 5.2.3)
6+
nio4r (~> 2.0)
7+
websocket-driver (>= 0.6.1)
8+
actionmailer (5.2.3)
9+
actionpack (= 5.2.3)
10+
actionview (= 5.2.3)
11+
activejob (= 5.2.3)
812
mail (~> 2.5, >= 2.5.4)
9-
rails-dom-testing (~> 1.0, >= 1.0.5)
10-
actionpack (4.2.7.1)
11-
actionview (= 4.2.7.1)
12-
activesupport (= 4.2.7.1)
13-
rack (~> 1.6)
14-
rack-test (~> 0.6.2)
15-
rails-dom-testing (~> 1.0, >= 1.0.5)
13+
rails-dom-testing (~> 2.0)
14+
actionpack (5.2.3)
15+
actionview (= 5.2.3)
16+
activesupport (= 5.2.3)
17+
rack (~> 2.0)
18+
rack-test (>= 0.6.3)
19+
rails-dom-testing (~> 2.0)
1620
rails-html-sanitizer (~> 1.0, >= 1.0.2)
17-
actionview (4.2.11.1)
18-
activesupport (= 4.2.7.1)
21+
actionview (5.2.3)
22+
activesupport (= 5.2.3)
1923
builder (~> 3.1)
20-
erubis (~> 2.7.0)
21-
rails-dom-testing (~> 1.0, >= 1.0.5)
22-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
23-
activejob (4.2.11)
24-
activesupport (= 4.2.7.1)
25-
globalid (>= 0.3.0)
26-
activemodel (4.2.7.1)
27-
activesupport (= 4.2.7.1)
28-
builder (~> 3.1)
29-
activerecord (4.2.7.1)
30-
activemodel (= 4.2.7.1)
31-
activesupport (= 4.2.7.1)
32-
arel (~> 6.0)
33-
activesupport (4.2.7.1)
34-
i18n (~> 0.7)
35-
json (>= 1.7.7)
24+
erubi (~> 1.4)
25+
rails-dom-testing (~> 2.0)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27+
activejob (5.2.3)
28+
activesupport (= 5.2.3)
29+
globalid (>= 0.3.6)
30+
activemodel (5.2.3)
31+
activesupport (= 5.2.3)
32+
activerecord (5.2.3)
33+
activemodel (= 5.2.3)
34+
activesupport (= 5.2.3)
35+
arel (>= 9.0)
36+
activestorage (5.2.3)
37+
actionpack (= 5.2.3)
38+
activerecord (= 5.2.3)
39+
marcel (~> 0.3.1)
40+
activesupport (5.2.3)
41+
concurrent-ruby (~> 1.0, >= 1.0.2)
42+
i18n (>= 0.7, < 2)
3643
minitest (~> 5.1)
37-
thread_safe (~> 0.3, >= 0.3.4)
3844
tzinfo (~> 1.1)
39-
arel (6.0.4)
40-
bcrypt (3.1.12)
45+
arel (9.0.0)
46+
bcrypt (3.1.13)
4147
binding_of_caller (0.8.0)
4248
debug_inspector (>= 0.0.1)
4349
builder (3.2.3)
44-
byebug (10.0.2)
45-
coffee-rails (4.1.1)
46-
coffee-script (>= 2.2.0)
47-
railties (>= 4.0.0, < 5.1.x)
48-
coffee-script (2.4.1)
49-
coffee-script-source
50-
execjs
51-
coffee-script-source (1.12.2)
52-
concurrent-ruby (1.0.5)
50+
byebug (11.0.1)
51+
concurrent-ruby (1.1.5)
52+
config (2.0.0)
53+
activesupport (>= 4.2)
54+
deep_merge (~> 1.2, >= 1.2.1)
55+
dry-schema (~> 1.0)
5356
crass (1.0.4)
5457
debug_inspector (0.0.3)
55-
erubis (2.7.0)
58+
deep_merge (1.2.1)
59+
dry-configurable (0.8.3)
60+
concurrent-ruby (~> 1.0)
61+
dry-core (~> 0.4, >= 0.4.7)
62+
dry-container (0.7.2)
63+
concurrent-ruby (~> 1.0)
64+
dry-configurable (~> 0.1, >= 0.1.3)
65+
dry-core (0.4.8)
66+
concurrent-ruby (~> 1.0)
67+
dry-equalizer (0.2.2)
68+
dry-inflector (0.1.2)
69+
dry-initializer (3.0.1)
70+
dry-logic (1.0.2)
71+
concurrent-ruby (~> 1.0)
72+
dry-core (~> 0.2)
73+
dry-equalizer (~> 0.2)
74+
dry-schema (1.3.1)
75+
concurrent-ruby (~> 1.0)
76+
dry-configurable (~> 0.8, >= 0.8.3)
77+
dry-core (~> 0.4)
78+
dry-equalizer (~> 0.2)
79+
dry-initializer (~> 3.0)
80+
dry-logic (~> 1.0)
81+
dry-types (~> 1.0)
82+
dry-types (1.1.1)
83+
concurrent-ruby (~> 1.0)
84+
dry-container (~> 0.3)
85+
dry-core (~> 0.4, >= 0.4.4)
86+
dry-equalizer (~> 0.2, >= 0.2.2)
87+
dry-inflector (~> 0.1, >= 0.1.2)
88+
dry-logic (~> 1.0, >= 1.0.2)
89+
erubi (1.8.0)
5690
execjs (2.7.0)
57-
ffi (1.9.25)
58-
globalid (0.4.1)
91+
ffi (1.11.1)
92+
globalid (0.4.2)
5993
activesupport (>= 4.2.0)
60-
i18n (0.9.5)
94+
i18n (1.6.0)
6195
concurrent-ruby (~> 1.0)
62-
jbuilder (2.7.0)
96+
jbuilder (2.9.1)
6397
activesupport (>= 4.2.0)
64-
multi_json (>= 1.2)
65-
jquery-rails (4.3.3)
98+
jquery-rails (4.3.5)
6699
rails-dom-testing (>= 1, < 3)
67100
railties (>= 4.2.0)
68101
thor (>= 0.14, < 2.0)
69102
json (1.8.6)
70-
jwt (2.1.0)
103+
jwt (2.2.1)
71104
loofah (2.2.3)
72105
crass (~> 1.0.2)
73-
nokogiri (>= 1.8.5)
74-
mail (2.7.0)
106+
nokogiri (>= 1.5.9)
107+
mail (2.7.1)
75108
mini_mime (>= 0.1.1)
76-
mini_mime (1.0.1)
77-
mini_portile2 (2.3.0)
109+
marcel (0.3.3)
110+
mimemagic (~> 0.3.2)
111+
method_source (0.9.2)
112+
mimemagic (0.3.3)
113+
mini_mime (1.0.2)
114+
mini_portile2 (2.4.0)
78115
minitest (5.11.3)
79-
multi_json (1.13.1)
80116
mysql2 (0.3.21)
81-
nokogiri (1.8.5)
82-
mini_portile2 (~> 2.3.0)
83-
rack (1.6.11)
84-
rack-test (0.6.3)
85-
rack (>= 1.6.11)
86-
rails (4.2.7.1)
87-
actionmailer (= 4.2.7.1)
88-
actionpack (= 4.2.7.1)
89-
actionview (= 4.2.7.1)
90-
activejob (>= 4.2.11)
91-
activemodel (= 4.2.7.1)
92-
activerecord (= 4.2.7.1)
93-
activesupport (= 4.2.7.1)
94-
bundler (>= 1.3.0, < 2.0)
95-
railties (= 4.2.7.1)
96-
sprockets-rails
97-
rails-deprecated_sanitizer (1.0.3)
98-
activesupport (>= 4.2.0.alpha)
99-
rails-dom-testing (1.0.9)
100-
activesupport (>= 4.2.0, < 5.0)
101-
nokogiri (>= 1.8.5)
102-
rails-deprecated_sanitizer (>= 1.0.1)
117+
nio4r (2.4.0)
118+
nokogiri (1.10.3)
119+
mini_portile2 (~> 2.4.0)
120+
rack (2.0.7)
121+
rack-test (1.1.0)
122+
rack (>= 1.0, < 3)
123+
rails (5.2.3)
124+
actioncable (= 5.2.3)
125+
actionmailer (= 5.2.3)
126+
actionpack (= 5.2.3)
127+
actionview (= 5.2.3)
128+
activejob (= 5.2.3)
129+
activemodel (= 5.2.3)
130+
activerecord (= 5.2.3)
131+
activestorage (= 5.2.3)
132+
activesupport (= 5.2.3)
133+
bundler (>= 1.3.0)
134+
railties (= 5.2.3)
135+
sprockets-rails (>= 2.0.0)
136+
rails-dom-testing (2.0.3)
137+
activesupport (>= 4.2.0)
138+
nokogiri (>= 1.6)
103139
rails-html-sanitizer (1.0.4)
104-
loofah (~> 2.2, >= 2.2.3)
105-
railties (4.2.7.1)
106-
actionpack (= 4.2.7.1)
107-
activesupport (= 4.2.7.1)
140+
loofah (~> 2.2, >= 2.2.2)
141+
railties (5.2.3)
142+
actionpack (= 5.2.3)
143+
activesupport (= 5.2.3)
144+
method_source
108145
rake (>= 0.8.7)
109-
thor (>= 0.18.1, < 2.0)
110-
rake (12.3.1)
146+
thor (>= 0.19.0, < 2.0)
147+
rake (12.3.3)
111148
rb-fsevent (0.10.3)
112-
rb-inotify (0.9.10)
113-
ffi (>= 0.5.0, < 2)
149+
rb-inotify (0.10.0)
150+
ffi (~> 1.0)
114151
rdoc (4.3.0)
115-
sass (3.5.7)
152+
sass (3.7.4)
116153
sass-listen (~> 4.0.0)
117154
sass-listen (4.0.0)
118155
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -126,44 +163,46 @@ GEM
126163
sdoc (0.4.2)
127164
json (~> 1.7, >= 1.7.7)
128165
rdoc (~> 4.0)
129-
spring (2.0.2)
130-
activesupport (>= 4.2)
166+
spring (2.1.0)
131167
sprockets (3.7.2)
132168
concurrent-ruby (~> 1.0)
133169
rack (> 1, < 3)
134170
sprockets-rails (3.2.1)
135171
actionpack (>= 4.0)
136172
activesupport (>= 4.0)
137173
sprockets (>= 3.0.0)
138-
sqlite3 (1.3.13)
139-
thor (0.20.0)
174+
sqlite3 (1.4.1)
175+
thor (0.20.3)
140176
thread_safe (0.3.6)
141-
tilt (2.0.8)
177+
tilt (2.0.9)
142178
turbolinks (5.2.0)
143179
turbolinks-source (~> 5.2)
144180
turbolinks-source (5.2.0)
145181
tzinfo (1.2.5)
146182
thread_safe (~> 0.1)
147-
uglifier (4.1.18)
183+
uglifier (4.1.20)
148184
execjs (>= 0.3.0, < 3)
149185
web-console (2.3.0)
150186
activemodel (>= 4.0)
151187
binding_of_caller (>= 0.7.2)
152188
railties (>= 4.0)
153189
sprockets-rails (>= 2.0, < 4.0)
190+
websocket-driver (0.7.1)
191+
websocket-extensions (>= 0.1.0)
192+
websocket-extensions (0.1.4)
154193

155194
PLATFORMS
156195
ruby
157196

158197
DEPENDENCIES
159198
bcrypt (~> 3.1.7)
160199
byebug
161-
coffee-rails (~> 4.1.0)
200+
config
162201
jbuilder (~> 2.0)
163202
jquery-rails
164203
jwt
165204
mysql2 (~> 0.3.18)
166-
rails (= 4.2.7.1)
205+
rails (= 5.2.3)
167206
sass-rails (~> 5.0)
168207
sdoc (~> 0.4.0)
169208
spring
@@ -173,4 +212,4 @@ DEPENDENCIES
173212
web-console (~> 2.0)
174213

175214
BUNDLED WITH
176-
1.13.6
215+
1.17.3

app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base
99
before_action :authorize_request
1010
attr_reader :current_user
1111

12-
skip_before_filter :verify_authenticity_token
12+
skip_before_action :verify_authenticity_token
1313

1414
private
1515

app/controllers/documents_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def create
1616
@file_name = nil
1717
else
1818
@file_name = SecureRandom.uuid + '.pdf'
19-
File.open('/var/www/html/everydocs-web/files/' + @file_name, 'w+b') {|f| f.write(@file.read)}
19+
File.open(Settings.document_folder + @file_name, 'w+b') {|f| f.write(@file.read)}
2020
end
2121

2222
@folder = params[:folder].blank? ? nil : Folder.find(params[:folder])
@@ -44,7 +44,7 @@ def show
4444

4545
# GET /documents/file/:id
4646
def download
47-
send_file '/var/www/html/everydocs-web/files/' + @document.document_url, :type=>"application/pdf", :x_sendfile=>true
47+
send_file Settings.document_folder + @document.document_url, :type=>"application/pdf", :x_sendfile=>true
4848
end
4949

5050
# PUT /documents/:id

config/application.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Application < Rails::Application
2121
# config.i18n.default_locale = :de
2222

2323
# Do not swallow errors in after_commit/after_rollback callbacks.
24-
config.active_record.raise_in_transactional_callbacks = true
24+
# config.active_record.raise_in_transactional_callbacks = true
25+
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
2526
end
2627
end

config/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
document_folder: /var/everydocs-files/

0 commit comments

Comments
 (0)