browse-everything 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +93 -44
- data/.gitignore +4 -2
- data/.rubocop.yml +12 -0
- data/.rubocop_todo.yml +0 -5
- data/.tool-versions +2 -0
- data/CONTRIBUTING.md +22 -0
- data/Gemfile +41 -30
- data/README.md +66 -32
- data/Rakefile +9 -1
- data/app/assets/javascripts/browse_everything/behavior.js +29 -23
- data/app/assets/javascripts/browse_everything.js +1 -1
- data/bin/rails +14 -0
- data/browse-everything.gemspec +13 -11
- data/lib/browse_everything/driver/base.rb +1 -0
- data/lib/browse_everything/driver/dropbox.rb +5 -2
- data/lib/browse_everything/driver/file_system.rb +15 -2
- data/lib/browse_everything/engine.rb +10 -3
- data/lib/browse_everything/version.rb +1 -1
- data/lib/browse_everything.rb +1 -1
- data/spec/dummy_test_app/Rakefile +6 -0
- data/spec/dummy_test_app/app/assets/config/manifest.js +3 -0
- data/spec/dummy_test_app/app/assets/images/.keep +0 -0
- data/spec/dummy_test_app/app/assets/javascripts/application.js +25 -0
- data/spec/dummy_test_app/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy_test_app/app/assets/javascripts/channels/.keep +0 -0
- data/spec/dummy_test_app/app/assets/stylesheets/application.scss +18 -0
- data/spec/dummy_test_app/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy_test_app/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy_test_app/app/controllers/application_controller.rb +3 -0
- data/spec/dummy_test_app/app/controllers/concerns/.keep +0 -0
- data/spec/{support → dummy_test_app}/app/controllers/file_handler_controller.rb +0 -0
- data/spec/dummy_test_app/app/helpers/application_helper.rb +2 -0
- data/spec/dummy_test_app/app/jobs/application_job.rb +2 -0
- data/spec/dummy_test_app/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy_test_app/app/models/application_record.rb +3 -0
- data/spec/dummy_test_app/app/models/concerns/.keep +0 -0
- data/spec/dummy_test_app/app/views/file_handler/index.html.erb +10 -0
- data/spec/{support → dummy_test_app}/app/views/file_handler/main.html.erb +6 -3
- data/spec/dummy_test_app/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy_test_app/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy_test_app/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy_test_app/bin/bundle +3 -0
- data/spec/dummy_test_app/bin/rails +4 -0
- data/spec/dummy_test_app/bin/rake +4 -0
- data/spec/dummy_test_app/bin/setup +38 -0
- data/spec/dummy_test_app/bin/update +29 -0
- data/spec/dummy_test_app/bin/yarn +11 -0
- data/spec/dummy_test_app/config/application.rb +27 -0
- data/spec/dummy_test_app/config/boot.rb +5 -0
- data/spec/dummy_test_app/config/browse_everything_providers.yml +25 -0
- data/spec/dummy_test_app/config/cable.yml +10 -0
- data/spec/dummy_test_app/config/database.yml +25 -0
- data/spec/dummy_test_app/config/environment.rb +5 -0
- data/spec/dummy_test_app/config/environments/development.rb +54 -0
- data/spec/dummy_test_app/config/environments/production.rb +91 -0
- data/spec/dummy_test_app/config/environments/test.rb +42 -0
- data/spec/dummy_test_app/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy_test_app/config/initializers/assets.rb +14 -0
- data/spec/dummy_test_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy_test_app/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy_test_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy_test_app/config/initializers/inflections.rb +16 -0
- data/spec/dummy_test_app/config/initializers/mime_types.rb +4 -0
- data/spec/dummy_test_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy_test_app/config/locales/en.yml +33 -0
- data/spec/dummy_test_app/config/puma.rb +56 -0
- data/spec/dummy_test_app/config/routes.rb +9 -0
- data/spec/dummy_test_app/config/secrets.yml +32 -0
- data/spec/dummy_test_app/config/spring.rb +6 -0
- data/spec/dummy_test_app/config.ru +5 -0
- data/spec/dummy_test_app/lib/assets/.keep +0 -0
- data/spec/dummy_test_app/log/.keep +0 -0
- data/spec/dummy_test_app/package.json +5 -0
- data/spec/dummy_test_app/public/404.html +67 -0
- data/spec/dummy_test_app/public/422.html +67 -0
- data/spec/dummy_test_app/public/500.html +66 -0
- data/spec/dummy_test_app/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy_test_app/public/apple-touch-icon.png +0 -0
- data/spec/dummy_test_app/public/favicon.ico +0 -0
- data/spec/dummy_test_app/tmp/.gitkeep +0 -0
- data/spec/features/select_files_spec.rb +1 -0
- data/spec/spec_helper.rb +2 -27
- data/tasks/ci.rake +1 -1
- metadata +175 -76
- data/karma.conf.js +0 -71
- data/spec/javascripts/behavior_spec.js +0 -7
- data/spec/javascripts/helpers/jasmine-jquery.js +0 -838
- data/spec/javascripts/helpers/jquery.js +0 -11008
- data/spec/javascripts/karma_spec.rb +0 -16
- data/spec/support/app/views/file_handler/index.html.erb +0 -6
- data/spec/test_app_templates/Gemfile.extra +0 -18
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -112
data/bin/rails
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
+
# installed from the root of your application.
|
4
|
+
|
5
|
+
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
+
ENGINE_PATH = File.expand_path('../lib/browse_everything/engine', __dir__)
|
7
|
+
APP_PATH = File.expand_path('../spec/dummy_test_app/config/application', __dir__)
|
8
|
+
|
9
|
+
# Set up gems listed in the Gemfile.
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
11
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
12
|
+
|
13
|
+
require 'rails/all'
|
14
|
+
require 'rails/engine/commands'
|
data/browse-everything.gemspec
CHANGED
@@ -15,29 +15,30 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.license = 'Apache 2'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split(/\000/)
|
18
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
19
|
spec.require_paths = ['lib']
|
21
20
|
|
22
21
|
spec.add_dependency 'addressable', '~> 2.5'
|
23
22
|
spec.add_dependency 'aws-sdk-s3'
|
24
|
-
spec.add_dependency 'dropbox_api', '>= 0.1.
|
25
|
-
spec.add_dependency 'google-
|
26
|
-
spec.add_dependency '
|
27
|
-
spec.add_dependency '
|
28
|
-
spec.add_dependency 'rails', '>= 4.2', '< 7.0'
|
23
|
+
spec.add_dependency 'dropbox_api', '>= 0.1.20'
|
24
|
+
spec.add_dependency 'google-apis-drive_v3'
|
25
|
+
spec.add_dependency 'googleauth', '>= 0.6.6', '< 2.0'
|
26
|
+
spec.add_dependency 'rails', '>= 4.2', '< 7.1'
|
29
27
|
spec.add_dependency 'ruby-box'
|
30
28
|
spec.add_dependency 'signet', '~> 0.8'
|
31
29
|
spec.add_dependency 'typhoeus'
|
32
30
|
|
33
|
-
|
31
|
+
# Development dependencies include dependencies necessary for running
|
32
|
+
# the dummy test app at ./spec/dummy_test_app
|
33
|
+
|
34
|
+
spec.add_development_dependency 'bixby', '~> 5.0'
|
35
|
+
spec.add_development_dependency 'bootstrap', "~> 4.0" # we do not support bootstrap 5
|
34
36
|
spec.add_development_dependency 'bundler', '>= 1.3'
|
35
37
|
spec.add_development_dependency 'capybara'
|
36
|
-
spec.add_development_dependency 'coveralls'
|
37
|
-
spec.add_development_dependency 'engine_cart', '~> 2.0'
|
38
38
|
spec.add_development_dependency 'factory_bot_rails'
|
39
|
-
spec.add_development_dependency '
|
39
|
+
spec.add_development_dependency 'jquery-rails'
|
40
40
|
spec.add_development_dependency 'pry-byebug'
|
41
|
+
spec.add_development_dependency 'puma'
|
41
42
|
spec.add_development_dependency 'rails-controller-testing'
|
42
43
|
spec.add_development_dependency 'rake'
|
43
44
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
@@ -45,9 +46,10 @@ Gem::Specification.new do |spec|
|
|
45
46
|
spec.add_development_dependency 'rspec-rails'
|
46
47
|
spec.add_development_dependency 'rspec_junit_formatter'
|
47
48
|
spec.add_development_dependency 'rubocop-rspec'
|
49
|
+
spec.add_development_dependency 'sass-rails'
|
48
50
|
spec.add_development_dependency 'selenium-webdriver'
|
49
|
-
spec.add_development_dependency 'simplecov'
|
50
51
|
spec.add_development_dependency 'sqlite3'
|
52
|
+
spec.add_development_dependency 'turbolinks'
|
51
53
|
spec.add_development_dependency 'webdrivers'
|
52
54
|
spec.add_development_dependency 'webmock'
|
53
55
|
end
|
@@ -124,11 +124,14 @@ module BrowseEverything
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def auth_link(url_options)
|
127
|
-
authenticator.authorize_url redirect_uri: redirect_uri(url_options)
|
127
|
+
authenticator.auth_code.authorize_url redirect_uri: redirect_uri(url_options)
|
128
128
|
end
|
129
129
|
|
130
130
|
def connect(params, _data, url_options)
|
131
|
-
|
131
|
+
built_redirect_uri = redirect_uri(url_options)
|
132
|
+
token_code = params[:code]
|
133
|
+
|
134
|
+
auth_bearer = authenticator.auth_code.get_token(token_code, redirect_uri: built_redirect_uri)
|
132
135
|
self.token = auth_bearer.token
|
133
136
|
end
|
134
137
|
|
@@ -9,13 +9,17 @@ module BrowseEverything
|
|
9
9
|
|
10
10
|
def validate_config
|
11
11
|
raise BrowseEverything::InitializationError, 'FileSystem driver requires a :home argument' if config[:home].blank?
|
12
|
+
|
13
|
+
unless config[:home].start_with?("/") || config[:allow_relative_home] == true
|
14
|
+
raise BrowseEverything::InitializationError, 'FileSystem driver :home argument must be absolute unless :allow_relative_home is set'
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
# Retrieve the contents of a directory
|
15
19
|
# @param path [String] the path to a file system resource
|
16
20
|
# @return [Array<BrowseEverything::FileEntry>]
|
17
21
|
def contents(path = '')
|
18
|
-
real_path = File.join(
|
22
|
+
real_path = File.join(home_path, path)
|
19
23
|
values = if File.directory?(real_path)
|
20
24
|
make_directory_entry real_path
|
21
25
|
else
|
@@ -55,6 +59,15 @@ module BrowseEverything
|
|
55
59
|
|
56
60
|
private
|
57
61
|
|
62
|
+
def home_path
|
63
|
+
@home_path ||= if config[:allow_relative_home] == true
|
64
|
+
# expand relative to Rails.root, mainly test CI use-case
|
65
|
+
File.expand_path(config[:home], Rails.root)
|
66
|
+
else
|
67
|
+
config[:home]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
58
71
|
# Construct an array of FileEntry objects for the contents of a
|
59
72
|
# directory
|
60
73
|
# @param real_path [String] path to the file system directory
|
@@ -65,7 +78,7 @@ module BrowseEverything
|
|
65
78
|
end
|
66
79
|
|
67
80
|
def make_pathname(path)
|
68
|
-
Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(
|
81
|
+
Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(home_path))
|
69
82
|
end
|
70
83
|
|
71
84
|
def file_size(path)
|
@@ -2,8 +2,15 @@
|
|
2
2
|
|
3
3
|
module BrowseEverything
|
4
4
|
class Engine < ::Rails::Engine
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
# As of Rails 7, sprockets is optional in Rails. If you don't have sprockets-rails
|
6
|
+
# installed, you don't have a config.assets. Without sprockets, you may
|
7
|
+
# or may not be able to figure out how to get browse-everything JS and CSS to load,
|
8
|
+
# but we should at least let you load the engine and try, so we don't try
|
9
|
+
# to configure sprockets unless it is installed...
|
10
|
+
if config.respond_to?(:assets)
|
11
|
+
config.assets.paths << config.root.join('vendor', 'assets', 'javascripts')
|
12
|
+
config.assets.paths << config.root.join('vendor', 'assets', 'stylesheets')
|
13
|
+
config.assets.precompile += %w[browse_everything.js browse_everything.css]
|
14
|
+
end
|
8
15
|
end
|
9
16
|
end
|
data/lib/browse_everything.rb
CHANGED
@@ -55,7 +55,7 @@ module BrowseEverything
|
|
55
55
|
begin
|
56
56
|
config_file_content = File.read(value)
|
57
57
|
config_file_template = ERB.new(config_file_content)
|
58
|
-
config_values = YAML.safe_load(config_file_template.result, [Symbol])
|
58
|
+
config_values = YAML.safe_load(config_file_template.result, permitted_classes: [Symbol])
|
59
59
|
@config = ActiveSupport::HashWithIndifferentAccess.new config_values
|
60
60
|
@config.deep_symbolize_keys
|
61
61
|
rescue Errno::ENOENT
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
|
14
|
+
// We want to test with turbolinks, which our code also requires rails-ujs to deal with:
|
15
|
+
|
16
|
+
//= require rails-ujs
|
17
|
+
//= require turbolinks
|
18
|
+
|
19
|
+
// Actual stack required for current browse-everything JS
|
20
|
+
|
21
|
+
//= require jquery3
|
22
|
+
//= require bootstrap
|
23
|
+
//= require browse_everything
|
24
|
+
|
25
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
+
//
|
4
|
+
//= require action_cable
|
5
|
+
//= require_self
|
6
|
+
//= require_tree ./channels
|
7
|
+
|
8
|
+
(function() {
|
9
|
+
this.App || (this.App = {});
|
10
|
+
|
11
|
+
App.cable = ActionCable.createConsumer();
|
12
|
+
|
13
|
+
}).call(this);
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
16
|
+
|
17
|
+
@import "bootstrap";
|
18
|
+
@import "browse_everything/browse_everything_bootstrap4";
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-body">
|
3
|
+
<a href="main" class="btn btn-large btn-primary" role="button">Enter Test App (Turbolinks)</a>
|
4
|
+
|
5
|
+
<%# this doesn't REALLY test no Turbolinks, as there will still be a `window.Turbolinks` object,
|
6
|
+
and a `turbolinks:load` event. It just tests as if the page we are navigating to were the FIRST
|
7
|
+
page loaded under turbolinks %>
|
8
|
+
<a href="main" class="btn btn-large btn-primary" role="button" data-turbolinks="false" data-no-turbolink>Enter Test App (No Turbolinks)</a>
|
9
|
+
</div>
|
10
|
+
</div>
|
@@ -14,9 +14,12 @@
|
|
14
14
|
|
15
15
|
<script>
|
16
16
|
$(document).on('turbolinks:load', function() {
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
// Have to make sure onReady is ALSO passed, in case it's first load.
|
18
|
+
$(function() {
|
19
|
+
$('#browse-btn').browseEverything()
|
20
|
+
.done(function(data) { $('#status').html(data.length.toString() + " items selected") })
|
21
|
+
.cancel(function() { window.alert('Canceled!') });
|
22
|
+
});
|
20
23
|
});
|
21
24
|
</script>
|
22
25
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a starting point to setup your application.
|
15
|
+
# Add necessary setup steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
# Install JavaScript dependencies if using Yarn
|
22
|
+
# system('bin/yarn')
|
23
|
+
|
24
|
+
|
25
|
+
# puts "\n== Copying sample files =="
|
26
|
+
# unless File.exist?('config/database.yml')
|
27
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
28
|
+
# end
|
29
|
+
|
30
|
+
puts "\n== Preparing database =="
|
31
|
+
system! 'bin/rails db:setup'
|
32
|
+
|
33
|
+
puts "\n== Removing old logs and tempfiles =="
|
34
|
+
system! 'bin/rails log:clear tmp:clear'
|
35
|
+
|
36
|
+
puts "\n== Restarting application server =="
|
37
|
+
system! 'bin/rails restart'
|
38
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a way to update your development environment automatically.
|
15
|
+
# Add necessary update steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
puts "\n== Updating database =="
|
22
|
+
system! 'bin/rails db:migrate'
|
23
|
+
|
24
|
+
puts "\n== Removing old logs and tempfiles =="
|
25
|
+
system! 'bin/rails log:clear tmp:clear'
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system! 'bin/rails restart'
|
29
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
VENDOR_PATH = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(VENDOR_PATH) do
|
4
|
+
begin
|
5
|
+
exec "yarnpkg #{ARGV.join(" ")}"
|
6
|
+
rescue Errno::ENOENT
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative 'boot'
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
require "browse_everything"
|
7
|
+
|
8
|
+
# Since we don't actually have an app-specific Gemfile,
|
9
|
+
# Some development dependencies listed in .gemspec need to be required here,
|
10
|
+
# that would ordinarily be auto-required by being in a Gemfile instead of gemspec.
|
11
|
+
require 'bootstrap'
|
12
|
+
require 'sprockets/railtie'
|
13
|
+
require 'jquery-rails'
|
14
|
+
require 'turbolinks'
|
15
|
+
|
16
|
+
module Dummy
|
17
|
+
class Application < Rails::Application
|
18
|
+
# ~Initialize configuration defaults for originally generated Rails version.~
|
19
|
+
# Changed to: For currently running Rails version, eg 5.2 or 7.0:
|
20
|
+
config.load_defaults Rails::VERSION::STRING.to_f
|
21
|
+
|
22
|
+
# Settings in config/environments/* take precedence over those specified here.
|
23
|
+
# Application configuration should go into files in config/initializers
|
24
|
+
# -- all .rb files in that directory are automatically loaded.
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#
|
2
|
+
# To make browse-everything aware of a provider, uncomment the info for that provider and add your API key information.
|
3
|
+
# The file_system provider can be a path to any directory on the server where your application is running.
|
4
|
+
#
|
5
|
+
file_system:
|
6
|
+
allow_relative_home: true
|
7
|
+
home: ./
|
8
|
+
# dropbox:
|
9
|
+
# client_id: YOUR_DROPBOX_APP_KEY
|
10
|
+
# client_secret: YOUR_DROPBOX_APP_SECRET
|
11
|
+
# download_directory: tmp/
|
12
|
+
# box:
|
13
|
+
# client_id: YOUR_BOX_CLIENT_ID
|
14
|
+
# client_secret: YOUR_BOX_CLIENT_SECRET
|
15
|
+
# google_drive:
|
16
|
+
# client_id: YOUR_GOOGLE_API_CLIENT_ID
|
17
|
+
# client_secret: YOUR_GOOGLE_API_CLIENT_SECRET
|
18
|
+
# s3:
|
19
|
+
# bucket: YOUR_AWS_S3_BUCKET
|
20
|
+
# response_type: signed_url # set to :public_url for public urls or :s3_uri for an s3://BUCKET/KEY uri
|
21
|
+
# expires_in: 14400 # for signed_url response_type, number of seconds url will be valid for.
|
22
|
+
# app_key: YOUR_AWS_S3_KEY # :app_key, :app_secret, and :region can be specified
|
23
|
+
# app_secret: YOUR_AWS_S3_SECRET # explicitly here, or left out to use system-configured
|
24
|
+
# region: YOUR_AWS_S3_REGION # defaults.
|
25
|
+
# See https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,54 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
16
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
config.cache_store = :memory_store
|
20
|
+
config.public_file_server.headers = {
|
21
|
+
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
|
22
|
+
}
|
23
|
+
else
|
24
|
+
config.action_controller.perform_caching = false
|
25
|
+
|
26
|
+
config.cache_store = :null_store
|
27
|
+
end
|
28
|
+
|
29
|
+
# Don't care if the mailer can't send.
|
30
|
+
config.action_mailer.raise_delivery_errors = false
|
31
|
+
|
32
|
+
config.action_mailer.perform_caching = false
|
33
|
+
|
34
|
+
# Print deprecation notices to the Rails logger.
|
35
|
+
config.active_support.deprecation = :log
|
36
|
+
|
37
|
+
# Raise an error on page load if there are pending migrations.
|
38
|
+
config.active_record.migration_error = :page_load
|
39
|
+
|
40
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
41
|
+
# This option may cause significant delays in view rendering with a large
|
42
|
+
# number of complex assets.
|
43
|
+
config.assets.debug = true
|
44
|
+
|
45
|
+
# Suppress logger output for asset requests.
|
46
|
+
config.assets.quiet = true
|
47
|
+
|
48
|
+
# Raises error for missing translations
|
49
|
+
# config.action_view.raise_on_missing_translations = true
|
50
|
+
|
51
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
52
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
53
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
54
|
+
end
|