Skip to content

Commit 812b21f

Browse files
committed
Add dummy app for tests
1 parent 0bcf1f2 commit 812b21f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1057
-87
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
/pkg/
77
/spec/reports/
88
/tmp/
9+
/spec/dummy/log
10+
/spec/dummy/tmp
11+
.env
912

1013
# rspec failure tracking
1114
.rspec_status

CODE_OF_CONDUCT.md

-74
This file was deleted.

Gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ source "https://rubygems.org"
22

33
# Specify your gem's dependencies in rails_api_logger.gemspec
44
gemspec
5+
6+
group :development, :test do
7+
gem "minitest"
8+
end

README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,10 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
214214
## Contributing
215215

216216
Bug reports and pull requests are welcome on GitHub at https://github.com/renuo/rails_api_logger.
217-
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
218-
the [code of conduct](https://github.com/renuo/rails_api_logger/blob/main/CODE_OF_CONDUCT.md).
217+
This project is intended to be a safe, welcoming space for collaboration.
218+
219+
Try to be a decent human being while interacting with other people.
219220

220221
## License
221222

222223
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
223-
224-
## Code of Conduct
225-
226-
Everyone interacting in the RailsApiLogger project's codebases, issue trackers, chat rooms and mailing lists is
227-
expected to follow the [code of conduct](https://github.com/renuo/rails_api_logger/blob/main/CODE_OF_CONDUCT.md).

Rakefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
require "bundler/setup"
14
require "bundler/gem_tasks"
2-
require "rspec/core/rake_task"
5+
require "rake/testtask"
36

4-
RSpec::Core::RakeTask.new(:spec)
7+
APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
8+
load "rails/tasks/engine.rake"
9+
load "rails/tasks/statistics.rake"
510

611
task default: :spec

bin/rails

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
# This command will automatically be run when you run "rails" with Rails gems
5+
# installed from the root of your application.
6+
7+
ENGINE_ROOT = File.expand_path('..', __dir__)
8+
ENGINE_PATH = File.expand_path('../lib/rails_api_logger/engine', __dir__)
9+
APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__)
10+
11+
# Set up gems listed in the Gemfile.
12+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
13+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
14+
15+
require 'rails/all'
16+
require 'rails/engine/commands'

lib/rails_api_logger/engine.rb

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class RailsApiLogger
2+
class Engine < ::Rails::Engine
3+
isolate_namespace RailsApiLogger
4+
5+
config.generators do |g|
6+
g.test_framework :rspec
7+
end
8+
end
9+
end

lib/rails_api_logger/version.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
class RailsApiLogger
4+
VERSION = "0.9.0"
5+
end

rails_api_logger.gemspec

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
require_relative "lib/rails_api_logger/version"
2+
13
Gem::Specification.new do |spec|
24
spec.name = "rails_api_logger"
3-
spec.version = "0.9.0"
5+
spec.version = RailsApiLogger::VERSION
46
spec.authors = ["Alessandro Rodi"]
57
spec.email = ["[email protected]"]
68

@@ -23,9 +25,7 @@ Gem::Specification.new do |spec|
2325
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
2426
spec.require_paths = ["lib"]
2527

26-
spec.add_dependency "railties", ">= 4.1.0"
27-
spec.add_dependency "activerecord", ">= 4.1.0"
28-
spec.add_dependency "actionpack", ">= 4.1.0"
28+
spec.add_dependency "rails", ">= 6.0.0"
2929
spec.add_dependency "nokogiri"
3030
spec.add_dependency "zeitwerk", ">= 2.0.0"
3131

@@ -34,5 +34,6 @@ Gem::Specification.new do |spec|
3434
spec.add_development_dependency "standard", "~> 1.31"
3535
spec.add_development_dependency "rake", "~> 12.0"
3636
spec.add_development_dependency "rspec", "~> 3.0"
37+
spec.add_development_dependency "rspec-rails", "~> 7.1.0"
3738
spec.add_development_dependency "rack"
3839
end

spec/dummy/Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# frozen_string_literal: true

spec/dummy/Rakefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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 will automatically be available to Rake.
5+
6+
require_relative "config/application"
7+
8+
Rails.application.load_tasks
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//= link_tree ../images
2+
//= link_tree ../../javascript .js
3+
//= link_directory ../stylesheets .css
4+
//= link rails_api_logger_manifest.js
5+

spec/dummy/app/assets/images/.keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -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+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
module ApplicationCable
4+
class Channel < ActionCable::Channel::Base
5+
end
6+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
module ApplicationCable
4+
class Connection < ActionCable::Connection::Base
5+
end
6+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Api::BooksController < ApplicationController
2+
def index
3+
render json: Book.all
4+
end
5+
6+
def create
7+
head :no_content
8+
end
9+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
class ApplicationController < ActionController::Base
4+
end

spec/dummy/app/controllers/concerns/.keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
class HomeController < ApplicationController
4+
layout "layouts/application"
5+
6+
def index
7+
end
8+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
module ApplicationHelper
4+
end
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2+
import "controllers"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Application } from "@hotwired/stimulus"
2+
3+
const application = Application.start()
4+
5+
// Configure Stimulus development experience
6+
application.debug = false
7+
window.Stimulus = application
8+
9+
export { application }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Controller } from "@hotwired/stimulus"
2+
3+
export default class extends Controller {
4+
connect() {
5+
this.element.textContent = "Hello World!"
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Import and register all your controllers from the importmap via controllers/**/*_controller
2+
import { application } from "controllers/application"
3+
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
4+
eagerLoadControllersFrom("controllers", application)
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
class ApplicationJob < ActiveJob::Base
4+
# Automatically retry jobs that encountered a deadlock
5+
# retry_on ActiveRecord::Deadlocked
6+
7+
# Most jobs are safe to ignore if the underlying records are no longer available
8+
# discard_on ActiveJob::DeserializationError
9+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
class ApplicationMailer < ActionMailer::Base
4+
default from: "[email protected]"
5+
layout "mailer"
6+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
class ApplicationRecord < ActiveRecord::Base
4+
primary_abstract_class
5+
end

spec/dummy/app/models/concerns/.keep

Whitespace-only changes.
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<p>
2+
<%= t('first_paragraph') %>
3+
</p>
4+
5+
<button><%= t('buttons.very.much.nested.value') %></button>
6+
7+
<p><%= t('second_paragraph') %></p>
8+
9+
<button><%= t('buttons.very.much.nested.only_german') %></button>
10+
<button><%= t('buttons.very.much.nested.only_english') %></button>
11+
<button><%= t('buttons.very.much.nested.only_italian') %></button>
12+
13+
<p>
14+
'date.formats.short' => <%= t('date.formats.short') %>
15+
</p>
16+
<p>
17+
'date.formats.default' => <%= t('date.formats.default') %>
18+
</p>
19+
<p>
20+
'time.formats.default' => <%= t('time.formats.default') %>
21+
</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Dummy</title>
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<%= csrf_meta_tags %>
7+
<%= csp_meta_tag %>
8+
9+
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css" async="true" defer="true">
10+
<%= javascript_importmap_tags %>
11+
</head>
12+
13+
<body>
14+
<header>
15+
<nav>
16+
<%=link_to t('locales.german'), root_path(locale: :de) %>
17+
<%=link_to t('locales.english'), root_path(locale: :en) %>
18+
<%=link_to t('locales.italian'), root_path(locale: :it) %>
19+
</nav>
20+
</header>
21+
<main>
22+
<%= yield %>
23+
</main>
24+
</body>
25+
</html>
Original file line numberDiff line numberDiff line change
@@ -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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= yield %>

spec/dummy/bin/rails

+6
Original file line numberDiff line numberDiff line change
@@ -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"

spec/dummy/bin/rake

+6
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)