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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +93 -44
  3. data/.gitignore +4 -2
  4. data/.rubocop.yml +12 -0
  5. data/.rubocop_todo.yml +0 -5
  6. data/.tool-versions +2 -0
  7. data/CONTRIBUTING.md +22 -0
  8. data/Gemfile +41 -30
  9. data/README.md +66 -32
  10. data/Rakefile +9 -1
  11. data/app/assets/javascripts/browse_everything/behavior.js +29 -23
  12. data/app/assets/javascripts/browse_everything.js +1 -1
  13. data/bin/rails +14 -0
  14. data/browse-everything.gemspec +13 -11
  15. data/lib/browse_everything/driver/base.rb +1 -0
  16. data/lib/browse_everything/driver/dropbox.rb +5 -2
  17. data/lib/browse_everything/driver/file_system.rb +15 -2
  18. data/lib/browse_everything/engine.rb +10 -3
  19. data/lib/browse_everything/version.rb +1 -1
  20. data/lib/browse_everything.rb +1 -1
  21. data/spec/dummy_test_app/Rakefile +6 -0
  22. data/spec/dummy_test_app/app/assets/config/manifest.js +3 -0
  23. data/spec/dummy_test_app/app/assets/images/.keep +0 -0
  24. data/spec/dummy_test_app/app/assets/javascripts/application.js +25 -0
  25. data/spec/dummy_test_app/app/assets/javascripts/cable.js +13 -0
  26. data/spec/dummy_test_app/app/assets/javascripts/channels/.keep +0 -0
  27. data/spec/dummy_test_app/app/assets/stylesheets/application.scss +18 -0
  28. data/spec/dummy_test_app/app/channels/application_cable/channel.rb +4 -0
  29. data/spec/dummy_test_app/app/channels/application_cable/connection.rb +4 -0
  30. data/spec/dummy_test_app/app/controllers/application_controller.rb +3 -0
  31. data/spec/dummy_test_app/app/controllers/concerns/.keep +0 -0
  32. data/spec/{support → dummy_test_app}/app/controllers/file_handler_controller.rb +0 -0
  33. data/spec/dummy_test_app/app/helpers/application_helper.rb +2 -0
  34. data/spec/dummy_test_app/app/jobs/application_job.rb +2 -0
  35. data/spec/dummy_test_app/app/mailers/application_mailer.rb +4 -0
  36. data/spec/dummy_test_app/app/models/application_record.rb +3 -0
  37. data/spec/dummy_test_app/app/models/concerns/.keep +0 -0
  38. data/spec/dummy_test_app/app/views/file_handler/index.html.erb +10 -0
  39. data/spec/{support → dummy_test_app}/app/views/file_handler/main.html.erb +6 -3
  40. data/spec/dummy_test_app/app/views/layouts/application.html.erb +14 -0
  41. data/spec/dummy_test_app/app/views/layouts/mailer.html.erb +13 -0
  42. data/spec/dummy_test_app/app/views/layouts/mailer.text.erb +1 -0
  43. data/spec/dummy_test_app/bin/bundle +3 -0
  44. data/spec/dummy_test_app/bin/rails +4 -0
  45. data/spec/dummy_test_app/bin/rake +4 -0
  46. data/spec/dummy_test_app/bin/setup +38 -0
  47. data/spec/dummy_test_app/bin/update +29 -0
  48. data/spec/dummy_test_app/bin/yarn +11 -0
  49. data/spec/dummy_test_app/config/application.rb +27 -0
  50. data/spec/dummy_test_app/config/boot.rb +5 -0
  51. data/spec/dummy_test_app/config/browse_everything_providers.yml +25 -0
  52. data/spec/dummy_test_app/config/cable.yml +10 -0
  53. data/spec/dummy_test_app/config/database.yml +25 -0
  54. data/spec/dummy_test_app/config/environment.rb +5 -0
  55. data/spec/dummy_test_app/config/environments/development.rb +54 -0
  56. data/spec/dummy_test_app/config/environments/production.rb +91 -0
  57. data/spec/dummy_test_app/config/environments/test.rb +42 -0
  58. data/spec/dummy_test_app/config/initializers/application_controller_renderer.rb +8 -0
  59. data/spec/dummy_test_app/config/initializers/assets.rb +14 -0
  60. data/spec/dummy_test_app/config/initializers/backtrace_silencers.rb +7 -0
  61. data/spec/dummy_test_app/config/initializers/cookies_serializer.rb +5 -0
  62. data/spec/dummy_test_app/config/initializers/filter_parameter_logging.rb +4 -0
  63. data/spec/dummy_test_app/config/initializers/inflections.rb +16 -0
  64. data/spec/dummy_test_app/config/initializers/mime_types.rb +4 -0
  65. data/spec/dummy_test_app/config/initializers/wrap_parameters.rb +14 -0
  66. data/spec/dummy_test_app/config/locales/en.yml +33 -0
  67. data/spec/dummy_test_app/config/puma.rb +56 -0
  68. data/spec/dummy_test_app/config/routes.rb +9 -0
  69. data/spec/dummy_test_app/config/secrets.yml +32 -0
  70. data/spec/dummy_test_app/config/spring.rb +6 -0
  71. data/spec/dummy_test_app/config.ru +5 -0
  72. data/spec/dummy_test_app/lib/assets/.keep +0 -0
  73. data/spec/dummy_test_app/log/.keep +0 -0
  74. data/spec/dummy_test_app/package.json +5 -0
  75. data/spec/dummy_test_app/public/404.html +67 -0
  76. data/spec/dummy_test_app/public/422.html +67 -0
  77. data/spec/dummy_test_app/public/500.html +66 -0
  78. data/spec/dummy_test_app/public/apple-touch-icon-precomposed.png +0 -0
  79. data/spec/dummy_test_app/public/apple-touch-icon.png +0 -0
  80. data/spec/dummy_test_app/public/favicon.ico +0 -0
  81. data/spec/dummy_test_app/tmp/.gitkeep +0 -0
  82. data/spec/features/select_files_spec.rb +1 -0
  83. data/spec/spec_helper.rb +2 -27
  84. data/tasks/ci.rake +1 -1
  85. metadata +175 -76
  86. data/karma.conf.js +0 -71
  87. data/spec/javascripts/behavior_spec.js +0 -7
  88. data/spec/javascripts/helpers/jasmine-jquery.js +0 -838
  89. data/spec/javascripts/helpers/jquery.js +0 -11008
  90. data/spec/javascripts/karma_spec.rb +0 -16
  91. data/spec/support/app/views/file_handler/index.html.erb +0 -6
  92. data/spec/test_app_templates/Gemfile.extra +0 -18
  93. 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'
@@ -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.10'
25
- spec.add_dependency 'google-api-client', '~> 0.23'
26
- spec.add_dependency 'google_drive', '>= 2.1', "< 4"
27
- spec.add_dependency 'googleauth', '>= 0.6.6', '< 1.0'
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
- spec.add_development_dependency 'bixby', '~> 3.0'
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 'jasmine', '~> 2.3'
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
@@ -32,6 +32,7 @@ module BrowseEverything
32
32
  # @param subclass [Class] the class inheriting from BrowseEverything::Driver::Base
33
33
  def inherited(subclass)
34
34
  subclass.sorter = sorter
35
+ super
35
36
  end
36
37
  end
37
38
 
@@ -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
- auth_bearer = authenticator.get_token params[:code], redirect_uri: redirect_uri(url_options)
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(config[:home], path)
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(config[:home]))
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
- config.assets.paths << config.root.join('vendor', 'assets', 'javascripts')
6
- config.assets.paths << config.root.join('vendor', 'assets', 'stylesheets')
7
- config.assets.precompile += %w[browse_everything.js browse_everything.css]
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrowseEverything
4
- VERSION = '1.1.2'
4
+ VERSION = '1.2.0'
5
5
  end
@@ -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
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link application.css
3
+ //= link application.js
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);
@@ -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";
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
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
- $('#browse-btn').browseEverything()
18
- .done(function(data) { $('#status').html(data.length.toString() + " items selected") })
19
- .cancel(function() { window.alert('Canceled!') });
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,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+
7
+ <%= stylesheet_link_tag 'application', media: 'all' %>
8
+ <%= javascript_include_tag 'application' %>
9
+ </head>
10
+
11
+ <body>
12
+ <%= yield %>
13
+ </body>
14
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -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,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
@@ -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,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
10
+ channel_prefix: dummy_production
@@ -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,5 @@
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -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