azeroth 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/README.md +1 -1
- data/azeroth.gemspec +22 -19
- data/bin/test +7 -0
- data/config/check_specs.yml +1 -0
- data/config/yardstick.yml +1 -1
- data/lib/azeroth.rb +5 -0
- data/lib/azeroth/resourceable.rb +20 -5
- data/lib/azeroth/resourceable/class_methods.rb +21 -0
- data/lib/azeroth/routes_builder.rb +16 -1
- data/lib/azeroth/version.rb +1 -1
- data/spec/controllers/documents_controller_spec.rb +256 -0
- data/spec/dummy/.ruby-version +1 -0
- data/spec/dummy/Rakefile +9 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/javascripts/channels/.keep +0 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +6 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +6 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/documents_controller.rb +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +4 -0
- data/spec/dummy/app/jobs/application_job.rb +4 -0
- data/spec/dummy/app/mailers/application_mailer.rb +6 -0
- data/spec/dummy/app/models/application_record.rb +5 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/{support → dummy}/app/models/document.rb +0 -0
- data/spec/dummy/app/views/documents/edit.html +1 -0
- data/spec/dummy/app/views/documents/index.html +1 -0
- data/spec/dummy/app/views/documents/new.html +1 -0
- data/spec/dummy/app/views/documents/show.html +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +5 -0
- data/spec/dummy/bin/rails +6 -0
- data/spec/dummy/bin/rake +6 -0
- data/spec/dummy/bin/setup +40 -0
- data/spec/dummy/bin/update +35 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/config/application.rb +34 -0
- data/spec/dummy/config/boot.rb +7 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +65 -0
- data/spec/dummy/config/environments/production.rb +108 -0
- data/spec/dummy/config/environments/test.rb +49 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +10 -0
- data/spec/dummy/config/initializers/assets.rb +16 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +13 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/inflections.rb +18 -0
- data/spec/dummy/config/initializers/mime_types.rb +6 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +17 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +37 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/{support → dummy/db}/schema.rb +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/storage/.keep +0 -0
- data/spec/spec_helper.rb +9 -1
- metadata +186 -9
- data/spec/support/app/serializers/serializer.rb +0 -12
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.5.0
|
data/spec/dummy/Rakefile
ADDED
@@ -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
|
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
|
+
*/
|
File without changes
|
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 @@
|
|
1
|
+
<%= yield %>
|
data/spec/dummy/bin/rake
ADDED
@@ -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
|
data/spec/dummy/bin/yarn
ADDED
@@ -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,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,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,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
|