azeroth 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/README.md +1 -1
  4. data/azeroth.gemspec +22 -19
  5. data/bin/test +7 -0
  6. data/config/check_specs.yml +1 -0
  7. data/config/yardstick.yml +1 -1
  8. data/lib/azeroth.rb +5 -0
  9. data/lib/azeroth/resourceable.rb +20 -5
  10. data/lib/azeroth/resourceable/class_methods.rb +21 -0
  11. data/lib/azeroth/routes_builder.rb +16 -1
  12. data/lib/azeroth/version.rb +1 -1
  13. data/spec/controllers/documents_controller_spec.rb +256 -0
  14. data/spec/dummy/.ruby-version +1 -0
  15. data/spec/dummy/Rakefile +9 -0
  16. data/spec/dummy/app/assets/config/manifest.js +3 -0
  17. data/spec/dummy/app/assets/images/.keep +0 -0
  18. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  19. data/spec/dummy/app/assets/javascripts/cable.js +13 -0
  20. data/spec/dummy/app/assets/javascripts/channels/.keep +0 -0
  21. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  22. data/spec/dummy/app/channels/application_cable/channel.rb +6 -0
  23. data/spec/dummy/app/channels/application_cable/connection.rb +6 -0
  24. data/spec/dummy/app/controllers/application_controller.rb +4 -0
  25. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  26. data/spec/dummy/app/controllers/documents_controller.rb +7 -0
  27. data/spec/dummy/app/helpers/application_helper.rb +4 -0
  28. data/spec/dummy/app/jobs/application_job.rb +4 -0
  29. data/spec/dummy/app/mailers/application_mailer.rb +6 -0
  30. data/spec/dummy/app/models/application_record.rb +5 -0
  31. data/spec/dummy/app/models/concerns/.keep +0 -0
  32. data/spec/{support → dummy}/app/models/document.rb +0 -0
  33. data/spec/dummy/app/views/documents/edit.html +1 -0
  34. data/spec/dummy/app/views/documents/index.html +1 -0
  35. data/spec/dummy/app/views/documents/new.html +1 -0
  36. data/spec/dummy/app/views/documents/show.html +1 -0
  37. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  38. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  39. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  40. data/spec/dummy/bin/bundle +5 -0
  41. data/spec/dummy/bin/rails +6 -0
  42. data/spec/dummy/bin/rake +6 -0
  43. data/spec/dummy/bin/setup +40 -0
  44. data/spec/dummy/bin/update +35 -0
  45. data/spec/dummy/bin/yarn +11 -0
  46. data/spec/dummy/config.ru +7 -0
  47. data/spec/dummy/config/application.rb +34 -0
  48. data/spec/dummy/config/boot.rb +7 -0
  49. data/spec/dummy/config/cable.yml +10 -0
  50. data/spec/dummy/config/database.yml +25 -0
  51. data/spec/dummy/config/environment.rb +7 -0
  52. data/spec/dummy/config/environments/development.rb +65 -0
  53. data/spec/dummy/config/environments/production.rb +108 -0
  54. data/spec/dummy/config/environments/test.rb +49 -0
  55. data/spec/dummy/config/initializers/application_controller_renderer.rb +10 -0
  56. data/spec/dummy/config/initializers/assets.rb +16 -0
  57. data/spec/dummy/config/initializers/backtrace_silencers.rb +13 -0
  58. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  59. data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
  60. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  61. data/spec/dummy/config/initializers/inflections.rb +18 -0
  62. data/spec/dummy/config/initializers/mime_types.rb +6 -0
  63. data/spec/dummy/config/initializers/wrap_parameters.rb +17 -0
  64. data/spec/dummy/config/locales/en.yml +33 -0
  65. data/spec/dummy/config/puma.rb +37 -0
  66. data/spec/dummy/config/routes.rb +5 -0
  67. data/spec/dummy/config/spring.rb +8 -0
  68. data/spec/dummy/config/storage.yml +34 -0
  69. data/spec/{support → dummy/db}/schema.rb +0 -0
  70. data/spec/dummy/lib/assets/.keep +0 -0
  71. data/spec/dummy/package.json +5 -0
  72. data/spec/dummy/public/404.html +67 -0
  73. data/spec/dummy/public/422.html +67 -0
  74. data/spec/dummy/public/500.html +66 -0
  75. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  76. data/spec/dummy/public/apple-touch-icon.png +0 -0
  77. data/spec/dummy/public/favicon.ico +0 -0
  78. data/spec/dummy/storage/.keep +0 -0
  79. data/spec/spec_helper.rb +9 -1
  80. metadata +186 -9
  81. data/spec/support/app/serializers/serializer.rb +0 -12
@@ -0,0 +1 @@
1
+ ruby-2.5.0
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
4
+ # for example lib/tasks/capistrano.rake, and they
5
+ # will automatically be available to Rake.
6
+
7
+ require_relative 'config/application'
8
+
9
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
File without changes
@@ -0,0 +1,15 @@
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 rails-ujs
14
+ //= require activestorage
15
+ //= 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,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,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApplicationCable
4
+ class Channel < ActionCable::Channel::Base
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApplicationCable
4
+ class Connection < ActionCable::Connection::Base
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationController < ActionController::Base
4
+ end
File without changes
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class DocumentsController < ApplicationController
4
+ include Azeroth::Resourceable
5
+
6
+ resource_for :document
7
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApplicationHelper
4
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationJob < ActiveJob::Base
4
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationMailer < ActionMailer::Base
4
+ default from: 'from@example.com'
5
+ layout 'mailer'
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationRecord < ActiveRecord::Base
4
+ self.abstract_class = true
5
+ end
File without changes
File without changes
@@ -0,0 +1 @@
1
+ edit page
@@ -0,0 +1 @@
1
+ index page
@@ -0,0 +1 @@
1
+ new page
@@ -0,0 +1 @@
1
+ show page
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag 'application', media: 'all' %>
9
+ <%= javascript_include_tag 'application' %>
10
+ </head>
11
+
12
+ <body>
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 @@
1
+ <%= yield %>
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ APP_PATH = File.expand_path('../config/application', __dir__)
5
+ require_relative '../config/boot'
6
+ require 'rails/commands'
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../config/boot'
5
+ require 'rake'
6
+ Rake.application.run
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'fileutils'
5
+ # rubocop:disable Style/MixinUsage
6
+ include FileUtils
7
+ # rubocop:enable Style/MixinUsage
8
+
9
+ # path to your application root.
10
+ APP_ROOT = File.expand_path('..', __dir__)
11
+
12
+ def system!(*args)
13
+ system(*args) || abort("\n== Command #{args} failed ==")
14
+ end
15
+
16
+ chdir APP_ROOT do
17
+ # This script is a starting point to setup your application.
18
+ # Add necessary setup steps to this file.
19
+
20
+ puts '== Installing dependencies =='
21
+ system! 'gem install bundler --conservative'
22
+ system('bundle check') || system!('bundle install')
23
+
24
+ # Install JavaScript dependencies if using Yarn
25
+ # system('bin/yarn')
26
+
27
+ # puts "\n== Copying sample files =="
28
+ # unless File.exist?('config/database.yml')
29
+ # cp 'config/database.yml.sample', 'config/database.yml'
30
+ # end
31
+
32
+ puts "\n== Preparing database =="
33
+ system! 'bin/rails db:setup'
34
+
35
+ puts "\n== Removing old logs and tempfiles =="
36
+ system! 'bin/rails log:clear tmp:clear'
37
+
38
+ puts "\n== Restarting application server =="
39
+ system! 'bin/rails restart'
40
+ end
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'fileutils'
5
+ # rubocop:disable Style/MixinUsage
6
+ include FileUtils
7
+ # rubocop:enable Style/MixinUsage
8
+
9
+ # path to your application root.
10
+ APP_ROOT = File.expand_path('..', __dir__)
11
+
12
+ def system!(*args)
13
+ system(*args) || abort("\n== Command #{args} failed ==")
14
+ end
15
+
16
+ chdir APP_ROOT do
17
+ # This script is a way to update your development environment automatically.
18
+ # Add necessary update steps to this file.
19
+
20
+ puts '== Installing dependencies =='
21
+ system! 'gem install bundler --conservative'
22
+ system('bundle check') || system!('bundle install')
23
+
24
+ # Install JavaScript dependencies if using Yarn
25
+ # system('bin/yarn')
26
+
27
+ puts "\n== Updating database =="
28
+ system! 'bin/rails db:migrate'
29
+
30
+ puts "\n== Removing old logs and tempfiles =="
31
+ system! 'bin/rails log:clear tmp:clear'
32
+
33
+ puts "\n== Restarting application server =="
34
+ system! 'bin/rails restart'
35
+ end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ APP_ROOT = File.expand_path('..', __dir__)
5
+ Dir.chdir(APP_ROOT) do
6
+ exec 'yarnpkg', *ARGV
7
+ rescue Errno::ENOENT
8
+ warn 'Yarn executable was not detected in the system.'
9
+ warn 'Download Yarn at https://yarnpkg.com/en/docs/install'
10
+ exit 1
11
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is used by Rack-based servers to start the application.
4
+
5
+ require_relative 'config/environment'
6
+
7
+ run Rails.application
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'boot'
4
+
5
+ require 'rails'
6
+ # Pick the frameworks you want:
7
+ require 'active_model/railtie'
8
+ require 'active_job/railtie'
9
+ require 'active_record/railtie'
10
+ require 'active_storage/engine'
11
+ require 'action_controller/railtie'
12
+ require 'action_mailer/railtie'
13
+ require 'action_view/railtie'
14
+ require 'action_cable/engine'
15
+ require 'sprockets/railtie'
16
+ # require "rails/test_unit/railtie"
17
+
18
+ Bundler.require(*Rails.groups)
19
+ require 'azeroth'
20
+
21
+ module Dummy
22
+ class Application < Rails::Application
23
+ # Initialize configuration defaults for originally generated Rails version.
24
+ config.load_defaults 5.2
25
+
26
+ # Settings in config/environments/* take precedence
27
+ # over those specified here.
28
+ # Application configuration can go into files
29
+ # in config/initializers
30
+ # -- all .rb files in that directory are automatically
31
+ # loaded after loading
32
+ # the framework and any gems in your application.
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
5
+
6
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
7
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_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,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Load the Rails application.
4
+ require_relative 'application'
5
+
6
+ # Initialize the Rails application.
7
+ Rails.application.initialize!
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over
5
+ # those in config/application.rb.
6
+
7
+ # In the development environment your application's code is reloaded on
8
+ # every request. This slows down response time but is perfect for development
9
+ # since you don't have to restart the web server when you make code changes.
10
+ config.cache_classes = false
11
+
12
+ # Do not eager load code on boot.
13
+ config.eager_load = false
14
+
15
+ # Show full error reports.
16
+ config.consider_all_requests_local = true
17
+
18
+ # Enable/disable caching. By default caching is disabled.
19
+ # Run rails dev:cache to toggle caching.
20
+ if Rails.root.join('tmp', 'caching-dev.txt').exist?
21
+ config.action_controller.perform_caching = true
22
+
23
+ config.cache_store = :memory_store
24
+ config.public_file_server.headers = {
25
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}"
26
+ }
27
+ else
28
+ config.action_controller.perform_caching = false
29
+
30
+ config.cache_store = :null_store
31
+ end
32
+
33
+ # Store uploaded files on the local file system
34
+ # (see config/storage.yml for options)
35
+ config.active_storage.service = :local
36
+
37
+ # Don't care if the mailer can't send.
38
+ config.action_mailer.raise_delivery_errors = false
39
+
40
+ config.action_mailer.perform_caching = false
41
+
42
+ # Print deprecation notices to the Rails logger.
43
+ config.active_support.deprecation = :log
44
+
45
+ # Raise an error on page load if there are pending migrations.
46
+ config.active_record.migration_error = :page_load
47
+
48
+ # Highlight code that triggered database queries in logs.
49
+ config.active_record.verbose_query_logs = true
50
+
51
+ # Debug mode disables concatenation and preprocessing of assets.
52
+ # This option may cause significant delays in view rendering with a large
53
+ # number of complex assets.
54
+ config.assets.debug = true
55
+
56
+ # Suppress logger output for asset requests.
57
+ config.assets.quiet = true
58
+
59
+ # Raises error for missing translations
60
+ # config.action_view.raise_on_missing_translations = true
61
+
62
+ # Use an evented file watcher to asynchronously detect changes in source code,
63
+ # routes, locales, etc. This feature depends on the listen gem.
64
+ # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
65
+ end