sapience 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/lib/sapience/extensions/grape/middleware/logging.rb +4 -11
  4. data/lib/sapience/extensions/grape/notifications.rb +4 -1
  5. data/lib/sapience/extensions/grape/request_format_helper.rb +12 -0
  6. data/lib/sapience/version.rb +1 -1
  7. data/sapience.gemspec +1 -1
  8. metadata +3 -115
  9. data/test_apps/grape/.gitignore +0 -41
  10. data/test_apps/grape/.rspec +0 -1
  11. data/test_apps/grape/.simplecov +0 -25
  12. data/test_apps/grape/Appraisals +0 -9
  13. data/test_apps/grape/Gemfile +0 -31
  14. data/test_apps/grape/Rakefile +0 -8
  15. data/test_apps/grape/config.ru +0 -5
  16. data/test_apps/grape/gemfiles/grape_0.16.2.gemfile +0 -26
  17. data/test_apps/grape/gemfiles/grape_0.16.2.gemfile.lock +0 -140
  18. data/test_apps/grape/gemfiles/grape_0.17.0.gemfile +0 -25
  19. data/test_apps/grape/gemfiles/grape_0.17.0.gemfile.lock +0 -138
  20. data/test_apps/grape/lib/ping/api.rb +0 -21
  21. data/test_apps/grape/lib/ping.rb +0 -3
  22. data/test_apps/grape/spec/lib/ping/api_spec.rb +0 -81
  23. data/test_apps/grape/spec/spec_helper.rb +0 -26
  24. data/test_apps/rails/.gitignore +0 -37
  25. data/test_apps/rails/.rspec +0 -1
  26. data/test_apps/rails/.ruby-version +0 -1
  27. data/test_apps/rails/.simplecov +0 -25
  28. data/test_apps/rails/Gemfile +0 -48
  29. data/test_apps/rails/README.md +0 -24
  30. data/test_apps/rails/Rakefile +0 -12
  31. data/test_apps/rails/app/assets/config/manifest.js +0 -2
  32. data/test_apps/rails/app/assets/images/.keep +0 -0
  33. data/test_apps/rails/app/assets/javascripts/posts.js +0 -2
  34. data/test_apps/rails/app/assets/stylesheets/application.css +0 -15
  35. data/test_apps/rails/app/assets/stylesheets/posts.css +0 -4
  36. data/test_apps/rails/app/assets/stylesheets/scaffold.css +0 -84
  37. data/test_apps/rails/app/channels/application_cable/channel.rb +0 -4
  38. data/test_apps/rails/app/channels/application_cable/connection.rb +0 -4
  39. data/test_apps/rails/app/controllers/application_controller.rb +0 -3
  40. data/test_apps/rails/app/controllers/concerns/.keep +0 -0
  41. data/test_apps/rails/app/controllers/posts_controller.rb +0 -59
  42. data/test_apps/rails/app/helpers/application_helper.rb +0 -2
  43. data/test_apps/rails/app/helpers/posts_helper.rb +0 -2
  44. data/test_apps/rails/app/jobs/application_job.rb +0 -2
  45. data/test_apps/rails/app/jobs/test_job.rb +0 -12
  46. data/test_apps/rails/app/mailers/application_mailer.rb +0 -4
  47. data/test_apps/rails/app/models/application_record.rb +0 -3
  48. data/test_apps/rails/app/models/concerns/.keep +0 -0
  49. data/test_apps/rails/app/models/post.rb +0 -3
  50. data/test_apps/rails/app/models/user.rb +0 -3
  51. data/test_apps/rails/app/views/layouts/application.html.erb +0 -13
  52. data/test_apps/rails/app/views/layouts/mailer.html.erb +0 -13
  53. data/test_apps/rails/app/views/layouts/mailer.text.erb +0 -1
  54. data/test_apps/rails/app/views/posts/_form.html.slim +0 -18
  55. data/test_apps/rails/app/views/posts/edit.html.slim +0 -8
  56. data/test_apps/rails/app/views/posts/index.html.slim +0 -25
  57. data/test_apps/rails/app/views/posts/new.html.slim +0 -5
  58. data/test_apps/rails/app/views/posts/show.html.slim +0 -15
  59. data/test_apps/rails/app/workers/test_worker.rb +0 -17
  60. data/test_apps/rails/bin/bundle +0 -3
  61. data/test_apps/rails/bin/rails +0 -4
  62. data/test_apps/rails/bin/rake +0 -4
  63. data/test_apps/rails/bin/setup +0 -34
  64. data/test_apps/rails/bin/sneakers +0 -10
  65. data/test_apps/rails/bin/update +0 -29
  66. data/test_apps/rails/config/application.rb +0 -25
  67. data/test_apps/rails/config/boot.rb +0 -3
  68. data/test_apps/rails/config/cable.yml +0 -9
  69. data/test_apps/rails/config/database.yml +0 -24
  70. data/test_apps/rails/config/environment.rb +0 -5
  71. data/test_apps/rails/config/environments/development.rb +0 -49
  72. data/test_apps/rails/config/environments/production.rb +0 -78
  73. data/test_apps/rails/config/environments/test.rb +0 -42
  74. data/test_apps/rails/config/initializers/application_controller_renderer.rb +0 -6
  75. data/test_apps/rails/config/initializers/backtrace_silencers.rb +0 -7
  76. data/test_apps/rails/config/initializers/cookies_serializer.rb +0 -5
  77. data/test_apps/rails/config/initializers/filter_parameter_logging.rb +0 -4
  78. data/test_apps/rails/config/initializers/inflections.rb +0 -16
  79. data/test_apps/rails/config/initializers/mime_types.rb +0 -4
  80. data/test_apps/rails/config/initializers/new_framework_defaults.rb +0 -24
  81. data/test_apps/rails/config/initializers/session_store.rb +0 -3
  82. data/test_apps/rails/config/initializers/sneakers.rb +0 -14
  83. data/test_apps/rails/config/initializers/wrap_parameters.rb +0 -14
  84. data/test_apps/rails/config/locales/en.yml +0 -23
  85. data/test_apps/rails/config/puma.rb +0 -45
  86. data/test_apps/rails/config/routes.rb +0 -3
  87. data/test_apps/rails/config/sapience_example.yml +0 -24
  88. data/test_apps/rails/config/secrets.yml +0 -22
  89. data/test_apps/rails/config.ru +0 -5
  90. data/test_apps/rails/db/migrate/20160812092236_create_users.rb +0 -13
  91. data/test_apps/rails/db/migrate/20160902141445_create_posts.rb +0 -17
  92. data/test_apps/rails/db/schema.rb +0 -37
  93. data/test_apps/rails/db/seeds.rb +0 -7
  94. data/test_apps/rails/lib/assets/.keep +0 -0
  95. data/test_apps/rails/lib/external_sneaker.rb +0 -46
  96. data/test_apps/rails/lib/tasks/.keep +0 -0
  97. data/test_apps/rails/lib/tasks/sneakers.rake +0 -21
  98. data/test_apps/rails/public/404.html +0 -67
  99. data/test_apps/rails/public/422.html +0 -67
  100. data/test_apps/rails/public/500.html +0 -66
  101. data/test_apps/rails/public/apple-touch-icon-precomposed.png +0 -0
  102. data/test_apps/rails/public/apple-touch-icon.png +0 -0
  103. data/test_apps/rails/public/favicon.ico +0 -0
  104. data/test_apps/rails/public/robots.txt +0 -5
  105. data/test_apps/rails/spec/controllers/posts_controller_spec.rb +0 -7
  106. data/test_apps/rails/spec/factories/posts.rb +0 -7
  107. data/test_apps/rails/spec/factories/users.rb +0 -8
  108. data/test_apps/rails/spec/fixtures/sapience.yml +0 -15
  109. data/test_apps/rails/spec/integration/sapience_spec.rb +0 -14
  110. data/test_apps/rails/spec/jobs/test_job_spec.rb +0 -36
  111. data/test_apps/rails/spec/models/post_spec.rb +0 -14
  112. data/test_apps/rails/spec/rails_helper.rb +0 -45
  113. data/test_apps/rails/spec/requests/posts_spec.rb +0 -44
  114. data/test_apps/rails/spec/routing/posts_routing_spec.rb +0 -37
  115. data/test_apps/rails/spec/spec_helper.rb +0 -16
  116. data/test_apps/rails/spec/views/posts/edit.html.slim_spec.rb +0 -17
  117. data/test_apps/rails/spec/views/posts/index.html.slim_spec.rb +0 -17
  118. data/test_apps/rails/spec/views/posts/new.html.slim_spec.rb +0 -17
  119. data/test_apps/rails/spec/views/posts/show.html.slim_spec.rb +0 -14
  120. data/test_apps/rails/spec/workers/test_worker_spec.rb +0 -41
  121. data/test_apps/rails/vendor/assets/stylesheets/.keep +0 -0
@@ -1,138 +0,0 @@
1
- PATH
2
- remote: ../../..
3
- specs:
4
- sapience (1.0.10)
5
- concurrent-ruby (~> 1.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activesupport (5.0.0.1)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (~> 0.7)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- appraisal (2.1.0)
16
- bundler
17
- rake
18
- thor (>= 0.14.0)
19
- axiom-types (0.1.1)
20
- descendants_tracker (~> 0.0.4)
21
- ice_nine (~> 0.11.0)
22
- thread_safe (~> 0.3, >= 0.3.1)
23
- builder (3.2.2)
24
- byebug (9.0.6)
25
- coderay (1.1.1)
26
- coercible (1.0.0)
27
- descendants_tracker (~> 0.0.1)
28
- concurrent-ruby (1.0.2)
29
- descendants_tracker (0.0.4)
30
- thread_safe (~> 0.3, >= 0.3.1)
31
- diff-lcs (1.2.5)
32
- docile (1.1.5)
33
- dogstatsd-ruby (2.0.0)
34
- enumerable-lazy (0.0.2)
35
- equalizer (0.0.11)
36
- faraday (0.9.2)
37
- multipart-post (>= 1.2, < 3)
38
- fuubar (2.2.0)
39
- rspec-core (~> 3.0)
40
- ruby-progressbar (~> 1.4)
41
- grape (0.17.0)
42
- activesupport
43
- builder
44
- hashie (>= 2.1.0)
45
- multi_json (>= 1.3.2)
46
- multi_xml (>= 0.5.2)
47
- mustermann19 (~> 0.4.3)
48
- rack (>= 1.3.0)
49
- rack-accept
50
- virtus (>= 1.0.0)
51
- hashie (3.4.6)
52
- i18n (0.7.0)
53
- ice_nine (0.11.2)
54
- json (2.0.2)
55
- method_source (0.8.2)
56
- minitest (5.9.1)
57
- multi_json (1.12.1)
58
- multi_xml (0.5.5)
59
- multipart-post (2.0.0)
60
- mustermann19 (0.4.4)
61
- enumerable-lazy
62
- pry (0.10.4)
63
- coderay (~> 1.1.0)
64
- method_source (~> 0.8.1)
65
- slop (~> 3.4)
66
- pry-byebug (3.4.0)
67
- byebug (~> 9.0)
68
- pry (~> 0.10)
69
- puma (3.6.0)
70
- rack (2.0.1)
71
- rack-accept (0.4.5)
72
- rack (>= 0.4)
73
- rack-test (0.6.3)
74
- rack (>= 1.0)
75
- racksh (1.0.0)
76
- rack (>= 1.0)
77
- rack-test (>= 0.5)
78
- rake (11.3.0)
79
- rspec (3.5.0)
80
- rspec-core (~> 3.5.0)
81
- rspec-expectations (~> 3.5.0)
82
- rspec-mocks (~> 3.5.0)
83
- rspec-core (3.5.4)
84
- rspec-support (~> 3.5.0)
85
- rspec-expectations (3.5.0)
86
- diff-lcs (>= 1.2.0, < 2.0)
87
- rspec-support (~> 3.5.0)
88
- rspec-its (1.2.0)
89
- rspec-core (>= 3.0.0)
90
- rspec-expectations (>= 3.0.0)
91
- rspec-mocks (3.5.0)
92
- diff-lcs (>= 1.2.0, < 2.0)
93
- rspec-support (~> 3.5.0)
94
- rspec-support (3.5.0)
95
- ruby-progressbar (1.8.1)
96
- sentry-raven (2.0.2)
97
- faraday (>= 0.7.6, < 0.10.x)
98
- simplecov (0.12.0)
99
- docile (~> 1.1.0)
100
- json (>= 1.8, < 3)
101
- simplecov-html (~> 0.10.0)
102
- simplecov-html (0.10.0)
103
- simplecov-json (0.2)
104
- json
105
- simplecov
106
- slop (3.6.0)
107
- thor (0.19.1)
108
- thread_safe (0.3.5)
109
- tzinfo (1.2.2)
110
- thread_safe (~> 0.1)
111
- virtus (1.0.5)
112
- axiom-types (~> 0.1)
113
- coercible (~> 1.0)
114
- descendants_tracker (~> 0.0, >= 0.0.3)
115
- equalizer (~> 0.0, >= 0.0.9)
116
-
117
- PLATFORMS
118
- ruby
119
-
120
- DEPENDENCIES
121
- activesupport
122
- appraisal
123
- byebug
124
- dogstatsd-ruby
125
- fuubar
126
- grape (= 0.17.0)
127
- pry-byebug
128
- puma (~> 3.0)
129
- racksh
130
- rspec
131
- rspec-its
132
- sapience!
133
- sentry-raven
134
- simplecov
135
- simplecov-json
136
-
137
- BUNDLED WITH
138
- 1.13.2
@@ -1,21 +0,0 @@
1
- require "grape"
2
- require "grape/api"
3
- require "sapience/grape"
4
- require "active_support/notifications"
5
-
6
- module Ping
7
- class API < ::Grape::API
8
- format :json
9
- use Sapience::Extensions::Grape::Middleware::Logging, logger: Grape::API.logger
10
- prefix :api
11
-
12
- route :any, "*path" do
13
- error!({ error: "No route found", status: 404 }, 404)
14
- end
15
-
16
- desc "Returns pong."
17
- get :ping do
18
- { ping: "PONG" }
19
- end
20
- end
21
- end
@@ -1,3 +0,0 @@
1
- module Ping
2
- require_relative "ping/api"
3
- end
@@ -1,81 +0,0 @@
1
- require "spec_helper"
2
- require "rack/test"
3
-
4
- describe Ping::API do
5
- include Rack::Test::Methods
6
-
7
- def app
8
- Ping::API
9
- end
10
-
11
- context "GET /api/ping" do
12
- let(:logger) { Grape::API.logger }
13
-
14
- specify do
15
- get "/api/ping", {}, "CONTENT-TYPE" => "application/json"
16
- expect(last_response.body).to match(/PONG/)
17
- end
18
-
19
- describe "ActiveSupport::Notifications" do
20
- let(:metrics) { Sapience.metrics }
21
- let(:tags) { %w(method:get format:json path:/api/ping status:200) }
22
- before do
23
- Sapience.configure { |c| c.app_name = "grape" }
24
- Sapience.add_appender(:datadog)
25
- end
26
- specify do
27
- expect(metrics).to receive(:increment).with("grape.request", tags: tags)
28
- expect(metrics).to receive(:timing).with("grape.request.time", kind_of(Float), tags: tags)
29
- get "/api/ping"
30
- end
31
- end
32
-
33
- it "logs something" do
34
- expect(logger).to receive(:info).with(
35
- method: "GET",
36
- request_path: "/api/ping",
37
- format: "json",
38
- status: 200,
39
- class_name: "Ping::API",
40
- action: "index",
41
- host: "example.org",
42
- ip: "127.0.0.1",
43
- ua: nil,
44
- tags: [],
45
- params: {},
46
- runtimes: a_hash_including(
47
- total: kind_of(Float),
48
- view: kind_of(Float),
49
- db: kind_of(Float),
50
- ),
51
- )
52
-
53
- get "/api/ping", {}, "CONTENT-TYPE" => "application/json"
54
- end
55
-
56
- context "no routes defined" do
57
- it "logs something" do
58
- expect(logger).to receive(:info).with(
59
- method: "GET",
60
- request_path: "/api/404",
61
- format: "json",
62
- status: 404,
63
- class_name: "Ping::API",
64
- action: "index",
65
- host: "example.org",
66
- ip: "127.0.0.1",
67
- ua: nil,
68
- tags: [],
69
- params: {},
70
- runtimes: a_hash_including(
71
- total: kind_of(Float),
72
- view: kind_of(Float),
73
- db: kind_of(Float),
74
- ),
75
- )
76
-
77
- get "/api/404", {}, "CONTENT-TYPE" => "application/json"
78
- end
79
- end
80
- end
81
- end
@@ -1,26 +0,0 @@
1
- require "simplecov"
2
- $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
3
- require "sapience/grape"
4
- require "rspec/its"
5
- require "ping"
6
- require "pry"
7
-
8
- RSpec.configure do |config|
9
- config.expect_with :rspec do |expectations|
10
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
11
- end
12
-
13
- config.mock_with :rspec do |mocks|
14
- mocks.verify_partial_doubles = true
15
- end
16
-
17
- config.shared_context_metadata_behavior = :apply_to_host_groups
18
- config.filter_run_when_matching :focus
19
- config.example_status_persistence_file_path = "spec/examples.txt"
20
- config.default_formatter = "doc" if config.files_to_run.one?
21
- config.order = :random
22
- Kernel.srand config.seed
23
- config.before(:each) do
24
- Sapience.reset!
25
- end
26
- end
@@ -1,37 +0,0 @@
1
- *.rbc
2
- capybara-*.html
3
- /log
4
- /tmp
5
- /db/*.sqlite3
6
- /db/*.sqlite3-journal
7
- /public/system
8
- /coverage/
9
- /spec/tmp
10
- **.orig
11
- rerun.txt
12
- pickle-email-*.html
13
-
14
- # dotenv
15
- # TODO Comment out this rule if environment variables can be committed
16
- .env
17
-
18
- ## Environment normalization:
19
- /.bundle
20
- /vendor/bundle
21
-
22
- # these should all be checked in to normalize the environment:
23
- # Gemfile.lock, .ruby-version, .ruby-gemset
24
-
25
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
26
- .rvmrc
27
-
28
- # if using bower-rails ignore default bower_components path bower.json files
29
- /vendor/assets/bower_components
30
- *.bowerrc
31
- bower.json
32
-
33
- # Ignore pow environment settings
34
- .powenv
35
-
36
- # Ignore Byebug command history file.
37
- .byebug_history
@@ -1 +0,0 @@
1
- test_apps/rails/../../.rspec
@@ -1 +0,0 @@
1
- 2.3.1
@@ -1,25 +0,0 @@
1
- require "simplecov-json"
2
-
3
- coverage_dir = '../../coverage/rails'
4
- FileUtils.rm_rf coverage_dir
5
-
6
- SimpleCov.coverage_dir coverage_dir
7
- SimpleCov.command_name "rails"
8
- SimpleCov.maximum_coverage_drop 1
9
- SimpleCov.formatters = [
10
- SimpleCov::Formatter::HTMLFormatter,
11
- SimpleCov::Formatter::JSONFormatter,
12
- ]
13
- SimpleCov.start do
14
- profiles.delete(:root_filter)
15
- filters.clear
16
- add_filter do |src|
17
- if src.filename =~ %r{sapience\-rb|\/usr\/src\/app/}
18
- src.filename.include?("test_apps/rails")
19
- else
20
- true
21
- end
22
- end
23
-
24
- add_group "Sapience", "../"
25
- end
@@ -1,48 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
-
4
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
- gem "rails", "~> 5.0.0"
6
- # Use sqlite3 as the database for Active Record
7
- gem "pg"
8
- # Use Puma as the app server
9
- gem "puma", "~> 3.0"
10
- # Use Redis adapter to run Action Cable in production
11
- # gem 'redis', '~> 3.0'
12
- # Use ActiveModel has_secure_password
13
- # gem 'bcrypt', '~> 3.1.7'
14
-
15
- # Use Capistrano for deployment
16
- # gem 'capistrano-rails', group: :development
17
- gem "sapience", path: "../..", require: "sapience/rails"
18
- gem "sentry-raven"
19
- gem "dogstatsd-ruby"
20
- gem "active_model_serializers"
21
- gem "sneakers"
22
- gem "slim-rails"
23
-
24
- group :development, :test do
25
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
26
- gem "byebug", platform: :mri
27
- # gem "pry-nav"
28
- gem "pry-byebug", platform: :mri
29
- gem "rspec-rails"
30
- gem "factory_girl_rails"
31
- end
32
-
33
- group :development do
34
- # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
35
- gem "web-console"
36
- gem "listen", "~> 3.0.5"
37
- end
38
-
39
- group :test do
40
- gem "rspec-its"
41
- gem "rails-controller-testing"
42
- gem "simplecov"
43
- gem "simplecov-json"
44
- gem "fuubar"
45
- end
46
-
47
- # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
48
- gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
@@ -1,24 +0,0 @@
1
- # README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
@@ -1,12 +0,0 @@
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
- require_relative "config/application"
4
-
5
- Rails.application.load_tasks
6
-
7
- require "sneakers/tasks"
8
-
9
- require "rspec/core/rake_task"
10
- RSpec::Core::RakeTask.new(:spec)
11
-
12
- task default: [:spec]
@@ -1,2 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../stylesheets .css
File without changes
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,15 +0,0 @@
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
- */
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,84 +0,0 @@
1
- body {
2
- background-color: #fff;
3
- color: #333;
4
- }
5
-
6
- body, p, ol, ul, td {
7
- font-family: verdana, arial, helvetica, sans-serif;
8
- font-size: 13px;
9
- line-height: 18px;
10
- margin: 33px;
11
- }
12
-
13
- pre {
14
- background-color: #eee;
15
- padding: 10px;
16
- font-size: 11px;
17
- }
18
-
19
- a {
20
- color: #000;
21
- }
22
-
23
- a:visited {
24
- color: #666;
25
- }
26
-
27
- a:hover {
28
- color: #fff;
29
- background-color: #000;
30
- }
31
-
32
- th {
33
- padding-bottom: 5px;
34
- }
35
-
36
- td {
37
- padding-bottom: 7px;
38
- padding-left: 5px;
39
- padding-right: 5px;
40
- }
41
-
42
- div.field,
43
- div.actions {
44
- margin-bottom: 10px;
45
- }
46
-
47
- #notice {
48
- color: green;
49
- }
50
-
51
- .field_with_errors {
52
- padding: 2px;
53
- background-color: red;
54
- display: table;
55
- }
56
-
57
- #error_explanation {
58
- width: 450px;
59
- border: 2px solid red;
60
- padding: 7px;
61
- padding-bottom: 0;
62
- margin-bottom: 20px;
63
- background-color: #f0f0f0;
64
- }
65
-
66
- #error_explanation h2 {
67
- text-align: left;
68
- font-weight: bold;
69
- padding: 5px 5px 5px 15px;
70
- font-size: 12px;
71
- margin: -7px;
72
- margin-bottom: 0;
73
- background-color: #c00;
74
- color: #fff;
75
- }
76
-
77
- #error_explanation ul li {
78
- font-size: 12px;
79
- list-style: square;
80
- }
81
-
82
- label {
83
- display: block;
84
- }
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery with: :exception
3
- end
File without changes
@@ -1,59 +0,0 @@
1
- class PostsController < ApplicationController
2
- before_action :set_post, only: [:show, :edit, :update, :destroy]
3
-
4
- # GET /posts
5
- def index
6
- @posts = Post.all
7
- end
8
-
9
- # GET /posts/1
10
- def show
11
- end
12
-
13
- # GET /posts/new
14
- def new
15
- @post = Post.new
16
- end
17
-
18
- # GET /posts/1/edit
19
- def edit
20
- end
21
-
22
- # POST /posts
23
- def create
24
- @post = Post.new(post_params)
25
-
26
- if @post.save
27
- redirect_to @post, notice: "Post was successfully created."
28
- else
29
- render :new
30
- end
31
- end
32
-
33
- # PATCH/PUT /posts/1
34
- def update
35
- if @post.update(post_params)
36
- redirect_to @post, notice: "Post was successfully updated."
37
- else
38
- render :edit
39
- end
40
- end
41
-
42
- # DELETE /posts/1
43
- def destroy
44
- @post.destroy
45
- redirect_to posts_url, notice: "Post was successfully destroyed."
46
- end
47
-
48
- private
49
-
50
- # Use callbacks to share common setup or constraints between actions.
51
- def set_post
52
- @post = Post.find(params[:id])
53
- end
54
-
55
- # Only allow a trusted parameter "white list" through.
56
- def post_params
57
- params.require(:post).permit(:title, :body, :author_id)
58
- end
59
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module PostsHelper
2
- end
@@ -1,2 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- end
@@ -1,12 +0,0 @@
1
- require "application_job"
2
- require_relative "../../../../spec/support/file_helper"
3
-
4
- class TestJob < ApplicationJob
5
- VERIFICATION_FILE = Rails.root.join("tmp/test_job.verified")
6
- queue_as :test_queue
7
- include FileHelper
8
-
9
- def perform
10
- create_file(VERIFICATION_FILE)
11
- end
12
- end
@@ -1,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: "from@example.com"
3
- layout "mailer"
4
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
File without changes
@@ -1,3 +0,0 @@
1
- class Post < ApplicationRecord
2
- belongs_to :author, class_name: User, inverse_of: :posts
3
- end
@@ -1,3 +0,0 @@
1
- class User < ApplicationRecord
2
- has_many :posts, inverse_of: :author
3
- end