attorney 0.0.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +19 -3
  3. data/app/assets/config/attorney_manifest.js +2 -0
  4. data/app/assets/javascripts/attorney/application.js +16 -0
  5. data/app/assets/javascripts/attorney/form_errors.js +13 -0
  6. data/app/assets/javascripts/attorney/rich_editor.js +19 -0
  7. data/app/assets/stylesheets/attorney/application.css +16 -0
  8. data/app/controllers/attorney/admin/documents_controller.rb +49 -0
  9. data/app/controllers/attorney/application_controller.rb +5 -0
  10. data/app/controllers/attorney/documents_controller.rb +11 -0
  11. data/app/helpers/attorney/application_helper.rb +13 -0
  12. data/app/helpers/attorney/documents_helper.rb +11 -0
  13. data/app/jobs/attorney/application_job.rb +4 -0
  14. data/app/mailers/attorney/application_mailer.rb +6 -0
  15. data/app/models/attorney/application_record.rb +5 -0
  16. data/app/models/attorney/document.rb +19 -0
  17. data/app/views/attorney/admin/documents/_form.html.erb +49 -0
  18. data/app/views/attorney/admin/documents/edit.html.erb +3 -0
  19. data/app/views/attorney/admin/documents/index.html.erb +37 -0
  20. data/app/views/attorney/admin/documents/new.html.erb +3 -0
  21. data/app/views/attorney/admin/documents/show.html.erb +13 -0
  22. data/app/views/attorney/documents/show.html.erb +1 -0
  23. data/app/views/layouts/attorney/application.html.erb +25 -0
  24. data/config/routes.rb +9 -0
  25. data/db/migrate/20180205173208_create_attorney_documents.rb +13 -0
  26. data/lib/attorney.rb +12 -2
  27. data/lib/attorney/engine.rb +14 -0
  28. data/lib/attorney/version.rb +1 -1
  29. data/lib/tasks/attorney_tasks.rake +4 -0
  30. data/spec/controllers/attorney/admin/documents_controller_spec.rb +130 -0
  31. data/spec/controllers/attorney/documents_controller_spec.rb +26 -0
  32. data/spec/features/attorney/admin/documents_spec.rb +87 -0
  33. data/spec/features/attorney/documents_spec.rb +19 -0
  34. data/spec/helpers/documents_helper_spec.rb +21 -0
  35. data/spec/lib/attorney_spec.rb +6 -0
  36. data/spec/models/attorney/document_spec.rb +28 -0
  37. data/spec/rails_helper.rb +109 -0
  38. data/spec/spec_helper.rb +96 -0
  39. data/spec/support/capybara.rb +1 -0
  40. data/spec/support/dummy/rails5_0/Rakefile +6 -0
  41. data/spec/support/dummy/rails5_0/app/assets/config/manifest.js +5 -0
  42. data/spec/support/dummy/rails5_0/app/assets/images/.keep +0 -0
  43. data/spec/support/dummy/rails5_0/app/assets/javascripts/application.js +13 -0
  44. data/spec/support/dummy/rails5_0/app/assets/javascripts/cable.js +13 -0
  45. data/spec/support/dummy/rails5_0/app/assets/javascripts/channels/.keep +0 -0
  46. data/spec/support/dummy/rails5_0/app/assets/stylesheets/application.css +15 -0
  47. data/spec/support/dummy/rails5_0/app/channels/application_cable/channel.rb +4 -0
  48. data/spec/support/dummy/rails5_0/app/channels/application_cable/connection.rb +4 -0
  49. data/spec/support/dummy/rails5_0/app/controllers/application_controller.rb +3 -0
  50. data/spec/support/dummy/rails5_0/app/controllers/concerns/.keep +0 -0
  51. data/spec/support/dummy/rails5_0/app/helpers/application_helper.rb +2 -0
  52. data/spec/support/dummy/rails5_0/app/jobs/application_job.rb +2 -0
  53. data/spec/support/dummy/rails5_0/app/mailers/application_mailer.rb +4 -0
  54. data/spec/support/dummy/rails5_0/app/models/application_record.rb +3 -0
  55. data/spec/support/dummy/rails5_0/app/models/concerns/.keep +0 -0
  56. data/spec/support/dummy/rails5_0/app/views/layouts/application.html.erb +15 -0
  57. data/spec/support/dummy/rails5_0/app/views/layouts/mailer.html.erb +13 -0
  58. data/spec/support/dummy/rails5_0/app/views/layouts/mailer.text.erb +1 -0
  59. data/spec/support/dummy/rails5_0/bin/bundle +3 -0
  60. data/spec/support/dummy/rails5_0/bin/rails +4 -0
  61. data/spec/support/dummy/rails5_0/bin/rake +4 -0
  62. data/spec/support/dummy/rails5_0/bin/setup +34 -0
  63. data/spec/support/dummy/rails5_0/bin/update +29 -0
  64. data/spec/support/dummy/rails5_0/config.ru +5 -0
  65. data/spec/support/dummy/rails5_0/config/application.rb +15 -0
  66. data/spec/support/dummy/rails5_0/config/boot.rb +5 -0
  67. data/spec/support/dummy/rails5_0/config/cable.yml +9 -0
  68. data/spec/support/dummy/rails5_0/config/database.yml +25 -0
  69. data/spec/support/dummy/rails5_0/config/environment.rb +5 -0
  70. data/spec/support/dummy/rails5_0/config/environments/development.rb +54 -0
  71. data/spec/support/dummy/rails5_0/config/environments/production.rb +86 -0
  72. data/spec/support/dummy/rails5_0/config/environments/test.rb +42 -0
  73. data/spec/support/dummy/rails5_0/config/initializers/application_controller_renderer.rb +8 -0
  74. data/spec/support/dummy/rails5_0/config/initializers/assets.rb +11 -0
  75. data/spec/support/dummy/rails5_0/config/initializers/backtrace_silencers.rb +7 -0
  76. data/spec/support/dummy/rails5_0/config/initializers/cookies_serializer.rb +5 -0
  77. data/spec/support/dummy/rails5_0/config/initializers/filter_parameter_logging.rb +4 -0
  78. data/spec/support/dummy/rails5_0/config/initializers/inflections.rb +16 -0
  79. data/spec/support/dummy/rails5_0/config/initializers/mime_types.rb +4 -0
  80. data/spec/support/dummy/rails5_0/config/initializers/new_framework_defaults.rb +26 -0
  81. data/spec/support/dummy/rails5_0/config/initializers/session_store.rb +3 -0
  82. data/spec/support/dummy/rails5_0/config/initializers/wrap_parameters.rb +14 -0
  83. data/spec/support/dummy/rails5_0/config/locales/en.yml +23 -0
  84. data/spec/support/dummy/rails5_0/config/puma.rb +47 -0
  85. data/spec/support/dummy/rails5_0/config/routes.rb +3 -0
  86. data/spec/support/dummy/rails5_0/config/secrets.yml +22 -0
  87. data/spec/support/dummy/rails5_0/config/spring.rb +6 -0
  88. data/spec/support/dummy/rails5_0/db/schema.rb +24 -0
  89. data/spec/support/dummy/rails5_0/lib/assets/.keep +0 -0
  90. data/spec/support/dummy/rails5_0/log/.keep +0 -0
  91. data/spec/support/dummy/rails5_0/public/404.html +67 -0
  92. data/spec/support/dummy/rails5_0/public/422.html +67 -0
  93. data/spec/support/dummy/rails5_0/public/500.html +66 -0
  94. data/spec/support/dummy/rails5_0/public/apple-touch-icon-precomposed.png +0 -0
  95. data/spec/support/dummy/rails5_0/public/apple-touch-icon.png +0 -0
  96. data/spec/support/dummy/rails5_0/public/favicon.ico +0 -0
  97. data/spec/support/dummy/rails5_1/Rakefile +6 -0
  98. data/spec/support/dummy/rails5_1/app/assets/config/manifest.js +5 -0
  99. data/spec/support/dummy/rails5_1/app/assets/images/.keep +0 -0
  100. data/spec/support/dummy/rails5_1/app/assets/javascripts/application.js +13 -0
  101. data/spec/support/dummy/rails5_1/app/assets/javascripts/cable.js +13 -0
  102. data/spec/support/dummy/rails5_1/app/assets/javascripts/channels/.keep +0 -0
  103. data/spec/support/dummy/rails5_1/app/assets/stylesheets/application.css +15 -0
  104. data/spec/support/dummy/rails5_1/app/channels/application_cable/channel.rb +4 -0
  105. data/spec/support/dummy/rails5_1/app/channels/application_cable/connection.rb +4 -0
  106. data/spec/support/dummy/rails5_1/app/controllers/application_controller.rb +4 -0
  107. data/spec/support/dummy/rails5_1/app/controllers/concerns/.keep +0 -0
  108. data/spec/support/dummy/rails5_1/app/helpers/application_helper.rb +2 -0
  109. data/spec/support/dummy/rails5_1/app/jobs/application_job.rb +2 -0
  110. data/spec/support/dummy/rails5_1/app/mailers/application_mailer.rb +4 -0
  111. data/spec/support/dummy/rails5_1/app/models/application_record.rb +3 -0
  112. data/spec/support/dummy/rails5_1/app/models/concerns/.keep +0 -0
  113. data/spec/support/dummy/rails5_1/app/views/layouts/mailer.html.erb +13 -0
  114. data/spec/support/dummy/rails5_1/app/views/layouts/mailer.text.erb +1 -0
  115. data/spec/support/dummy/rails5_1/app/views/layouts/main.html.erb +15 -0
  116. data/spec/support/dummy/rails5_1/bin/bundle +3 -0
  117. data/spec/support/dummy/rails5_1/bin/rails +4 -0
  118. data/spec/support/dummy/rails5_1/bin/rake +4 -0
  119. data/spec/support/dummy/rails5_1/bin/setup +38 -0
  120. data/spec/support/dummy/rails5_1/bin/update +29 -0
  121. data/spec/support/dummy/rails5_1/bin/yarn +11 -0
  122. data/spec/support/dummy/rails5_1/config.ru +5 -0
  123. data/spec/support/dummy/rails5_1/config/application.rb +18 -0
  124. data/spec/support/dummy/rails5_1/config/boot.rb +5 -0
  125. data/spec/support/dummy/rails5_1/config/cable.yml +10 -0
  126. data/spec/support/dummy/rails5_1/config/database.yml +25 -0
  127. data/spec/support/dummy/rails5_1/config/environment.rb +5 -0
  128. data/spec/support/dummy/rails5_1/config/environments/development.rb +54 -0
  129. data/spec/support/dummy/rails5_1/config/environments/production.rb +91 -0
  130. data/spec/support/dummy/rails5_1/config/environments/test.rb +42 -0
  131. data/spec/support/dummy/rails5_1/config/initializers/application_controller_renderer.rb +8 -0
  132. data/spec/support/dummy/rails5_1/config/initializers/assets.rb +14 -0
  133. data/spec/support/dummy/rails5_1/config/initializers/attorney.rb +1 -0
  134. data/spec/support/dummy/rails5_1/config/initializers/backtrace_silencers.rb +7 -0
  135. data/spec/support/dummy/rails5_1/config/initializers/cookies_serializer.rb +5 -0
  136. data/spec/support/dummy/rails5_1/config/initializers/filter_parameter_logging.rb +4 -0
  137. data/spec/support/dummy/rails5_1/config/initializers/inflections.rb +16 -0
  138. data/spec/support/dummy/rails5_1/config/initializers/mime_types.rb +4 -0
  139. data/spec/support/dummy/rails5_1/config/initializers/wrap_parameters.rb +14 -0
  140. data/spec/support/dummy/rails5_1/config/locales/en.yml +33 -0
  141. data/spec/support/dummy/rails5_1/config/puma.rb +56 -0
  142. data/spec/support/dummy/rails5_1/config/routes.rb +3 -0
  143. data/spec/support/dummy/rails5_1/config/secrets.yml +32 -0
  144. data/spec/support/dummy/rails5_1/config/spring.rb +6 -0
  145. data/spec/support/dummy/rails5_1/db/schema.rb +24 -0
  146. data/spec/support/dummy/rails5_1/lib/assets/.keep +0 -0
  147. data/spec/support/dummy/rails5_1/log/.keep +0 -0
  148. data/spec/support/dummy/rails5_1/package.json +5 -0
  149. data/spec/support/dummy/rails5_1/public/404.html +67 -0
  150. data/spec/support/dummy/rails5_1/public/422.html +67 -0
  151. data/spec/support/dummy/rails5_1/public/500.html +66 -0
  152. data/spec/support/dummy/rails5_1/public/apple-touch-icon-precomposed.png +0 -0
  153. data/spec/support/dummy/rails5_1/public/apple-touch-icon.png +0 -0
  154. data/spec/support/dummy/rails5_1/public/favicon.ico +0 -0
  155. data/spec/support/helpers/auth.rb +12 -0
  156. data/spec/support/shoulda_matchers.rb +8 -0
  157. data/vendor/assets/javascripts/attorney/bootstrap.bundle.min.js +7 -0
  158. data/vendor/assets/stylesheets/attorney/bootstrap.min.css +7 -0
  159. metadata +401 -28
  160. data/.gitignore +0 -13
  161. data/.rspec +0 -3
  162. data/.travis.yml +0 -5
  163. data/Gemfile +0 -6
  164. data/LICENSE.txt +0 -21
  165. data/README.md +0 -39
  166. data/attorney.gemspec +0 -25
  167. data/bin/console +0 -14
  168. data/bin/setup +0 -8
@@ -0,0 +1,96 @@
1
+ # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16
+ RSpec.configure do |config|
17
+ # rspec-expectations config goes here. You can use an alternate
18
+ # assertion/expectation library such as wrong or the stdlib/minitest
19
+ # assertions if you prefer.
20
+ config.expect_with :rspec do |expectations|
21
+ # This option will default to `true` in RSpec 4. It makes the `description`
22
+ # and `failure_message` of custom matchers include text for helper methods
23
+ # defined using `chain`, e.g.:
24
+ # be_bigger_than(2).and_smaller_than(4).description
25
+ # # => "be bigger than 2 and smaller than 4"
26
+ # ...rather than:
27
+ # # => "be bigger than 2"
28
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
29
+ end
30
+
31
+ # rspec-mocks config goes here. You can use an alternate test double
32
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
33
+ config.mock_with :rspec do |mocks|
34
+ # Prevents you from mocking or stubbing a method that does not exist on
35
+ # a real object. This is generally recommended, and will default to
36
+ # `true` in RSpec 4.
37
+ mocks.verify_partial_doubles = true
38
+ end
39
+
40
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
41
+ # have no way to turn it off -- the option exists only for backwards
42
+ # compatibility in RSpec 3). It causes shared context metadata to be
43
+ # inherited by the metadata hash of host groups and examples, rather than
44
+ # triggering implicit auto-inclusion in groups with matching metadata.
45
+ config.shared_context_metadata_behavior = :apply_to_host_groups
46
+
47
+ # The settings below are suggested to provide a good initial experience
48
+ # with RSpec, but feel free to customize to your heart's content.
49
+ =begin
50
+ # This allows you to limit a spec run to individual examples or groups
51
+ # you care about by tagging them with `:focus` metadata. When nothing
52
+ # is tagged with `:focus`, all examples get run. RSpec also provides
53
+ # aliases for `it`, `describe`, and `context` that include `:focus`
54
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
55
+ config.filter_run_when_matching :focus
56
+
57
+ # Allows RSpec to persist some state between runs in order to support
58
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
59
+ # you configure your source control system to ignore this file.
60
+ config.example_status_persistence_file_path = "spec/examples.txt"
61
+
62
+ # Limits the available syntax to the non-monkey patched syntax that is
63
+ # recommended. For more details, see:
64
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
65
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
66
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
67
+ config.disable_monkey_patching!
68
+
69
+ # Many RSpec users commonly either run the entire suite or an individual
70
+ # file, and it's useful to allow more verbose output when running an
71
+ # individual spec file.
72
+ if config.files_to_run.one?
73
+ # Use the documentation formatter for detailed output,
74
+ # unless a formatter has already been configured
75
+ # (e.g. via a command-line flag).
76
+ config.default_formatter = "doc"
77
+ end
78
+
79
+ # Print the 10 slowest examples and example groups at the
80
+ # end of the spec run, to help surface which specs are running
81
+ # particularly slow.
82
+ config.profile_examples = 10
83
+
84
+ # Run specs in random order to surface order dependencies. If you find an
85
+ # order dependency and want to debug it, you can fix the order by providing
86
+ # the seed, which is printed after each run.
87
+ # --seed 1234
88
+ config.order = :random
89
+
90
+ # Seed global randomization in this process using the `--seed` CLI option.
91
+ # Setting this allows you to use `--seed` to deterministically reproduce
92
+ # test failures related to randomization by passing the same `--seed` value
93
+ # as the one that triggered the failure.
94
+ Kernel.srand config.seed
95
+ =end
96
+ end
@@ -0,0 +1 @@
1
+ Capybara.javascript_driver = :webkit
@@ -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,5 @@
1
+
2
+ //= link_tree ../images
3
+ //= link_directory ../javascripts .js
4
+ //= link_directory ../stylesheets .css
5
+ //= link attorney_manifest.js
@@ -0,0 +1,13 @@
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
+ //= 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,15 @@
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
+ */
@@ -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
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+
7
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
+ </head>
10
+
11
+ <body>
12
+ <%= "Rails #{Rails.version} layout" %>
13
+ <%= yield %>
14
+ </body>
15
+ </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,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,34 @@
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
+ # puts "\n== Copying sample files =="
22
+ # unless File.exist?('config/database.yml')
23
+ # cp 'config/database.yml.sample', 'config/database.yml'
24
+ # end
25
+
26
+ puts "\n== Preparing database =="
27
+ system! 'bin/rails db:setup'
28
+
29
+ puts "\n== Removing old logs and tempfiles =="
30
+ system! 'bin/rails log:clear tmp:clear'
31
+
32
+ puts "\n== Restarting application server =="
33
+ system! 'bin/rails restart'
34
+ 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,5 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
@@ -0,0 +1,15 @@
1
+ require_relative 'boot'
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "attorney"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+ end
14
+ end
15
+
@@ -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,9 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
@@ -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: 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=172800'
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