nunes 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +15 -7
  3. data/Changelog.md +8 -0
  4. data/Gemfile +1 -1
  5. data/README.md +2 -3
  6. data/Rakefile +10 -0
  7. data/lib/nunes.rb +12 -0
  8. data/lib/nunes/adapter.rb +4 -2
  9. data/lib/nunes/instrumentable.rb +1 -1
  10. data/lib/nunes/subscriber.rb +5 -2
  11. data/lib/nunes/subscribers/action_controller.rb +51 -24
  12. data/lib/nunes/subscribers/action_mailer.rb +2 -2
  13. data/lib/nunes/subscribers/action_view.rb +5 -2
  14. data/lib/nunes/subscribers/active_job.rb +2 -3
  15. data/lib/nunes/subscribers/active_record.rb +4 -1
  16. data/lib/nunes/version.rb +1 -1
  17. data/script/test +10 -13
  18. data/test/controller_instrumentation_test.rb +47 -5
  19. data/test/helper.rb +5 -1
  20. data/test/instrumentable_test.rb +27 -3
  21. data/test/job_instrumentation_test.rb +11 -8
  22. data/test/mailer_instrumentation_test.rb +5 -1
  23. data/test/namespaced_controller_instrumentation_test.rb +7 -7
  24. data/test/namespaced_job_instrumentation_test.rb +33 -0
  25. data/test/namespaced_mailer_instrumentation_test.rb +35 -0
  26. data/test/namespaced_model_instrumentation_test.rb +55 -0
  27. data/test/nunes_test.rb +8 -0
  28. data/test/{rails_app → rails_app_4.2.5}/.gitignore +0 -0
  29. data/test/{rails_app → rails_app_4.2.5}/Rakefile +0 -0
  30. data/test/{rails_app → rails_app_4.2.5}/app/assets/images/rails.png +0 -0
  31. data/test/{rails_app → rails_app_4.2.5}/app/assets/javascripts/application.js +0 -0
  32. data/test/{rails_app → rails_app_4.2.5}/app/assets/stylesheets/application.css +0 -0
  33. data/test/{rails_app → rails_app_4.2.5}/app/controllers/admin/posts_controller.rb +2 -7
  34. data/test/{rails_app → rails_app_4.2.5}/app/controllers/application_controller.rb +0 -0
  35. data/test/{rails_app → rails_app_4.2.5}/app/controllers/posts_controller.rb +1 -7
  36. data/test/{rails_app → rails_app_4.2.5}/app/helpers/application_helper.rb +0 -0
  37. data/test/rails_app_4.2.5/app/jobs/spam/detector_job.rb +11 -0
  38. data/test/{rails_app → rails_app_4.2.5}/app/jobs/spam_detector_job.rb +0 -0
  39. data/test/{rails_app → rails_app_4.2.5}/app/mailers/.gitkeep +0 -0
  40. data/test/rails_app_4.2.5/app/mailers/admin/post_mailer.rb +13 -0
  41. data/test/{rails_app → rails_app_4.2.5}/app/mailers/post_mailer.rb +0 -0
  42. data/test/{rails_app → rails_app_4.2.5}/app/models/.gitkeep +0 -0
  43. data/test/rails_app_4.2.5/app/models/admin/post.rb +5 -0
  44. data/test/{rails_app → rails_app_4.2.5}/app/models/post.rb +0 -0
  45. data/test/{rails_app/app/views → rails_app_4.2.5/app/views/admin}/post_mailer/created.text.erb +0 -0
  46. data/test/{rails_app → rails_app_4.2.5}/app/views/admin/posts/index.html.erb +0 -0
  47. data/test/{rails_app → rails_app_4.2.5}/app/views/layouts/application.html.erb +0 -0
  48. data/test/rails_app_4.2.5/app/views/post_mailer/created.text.erb +1 -0
  49. data/test/{rails_app → rails_app_4.2.5}/app/views/posts/_post.html.erb +0 -0
  50. data/test/{rails_app → rails_app_4.2.5}/app/views/posts/index.html.erb +0 -0
  51. data/test/{rails_app → rails_app_4.2.5}/config.ru +0 -0
  52. data/test/{rails_app → rails_app_4.2.5}/config/application.rb +0 -0
  53. data/test/{rails_app → rails_app_4.2.5}/config/boot.rb +0 -0
  54. data/test/{rails_app → rails_app_4.2.5}/config/database.yml +0 -0
  55. data/test/{rails_app → rails_app_4.2.5}/config/environment.rb +0 -0
  56. data/test/{rails_app → rails_app_4.2.5}/config/environments/development.rb +0 -0
  57. data/test/{rails_app → rails_app_4.2.5}/config/environments/production.rb +0 -0
  58. data/test/{rails_app → rails_app_4.2.5}/config/environments/test.rb +0 -0
  59. data/test/{rails_app → rails_app_4.2.5}/config/initializers/backtrace_silencers.rb +0 -0
  60. data/test/{rails_app → rails_app_4.2.5}/config/initializers/force_test_schema_load.rb +0 -0
  61. data/test/{rails_app → rails_app_4.2.5}/config/initializers/inflections.rb +0 -0
  62. data/test/{rails_app → rails_app_4.2.5}/config/initializers/mime_types.rb +0 -0
  63. data/test/{rails_app → rails_app_4.2.5}/config/initializers/secret_token.rb +0 -0
  64. data/test/{rails_app → rails_app_4.2.5}/config/initializers/session_store.rb +0 -0
  65. data/test/{rails_app → rails_app_4.2.5}/config/initializers/wrap_parameters.rb +0 -0
  66. data/test/{rails_app → rails_app_4.2.5}/config/locales/en.yml +0 -0
  67. data/test/{rails_app → rails_app_4.2.5}/config/routes.rb +0 -0
  68. data/test/{rails_app → rails_app_4.2.5}/config/secrets.yml +0 -0
  69. data/test/{rails_app → rails_app_4.2.5}/db/migrate/20130417154459_create_posts.rb +0 -0
  70. data/test/{rails_app → rails_app_4.2.5}/db/schema.rb +0 -0
  71. data/test/{rails_app → rails_app_4.2.5}/db/seeds.rb +0 -0
  72. data/test/{rails_app → rails_app_4.2.5}/lib/assets/.gitkeep +0 -0
  73. data/test/{rails_app → rails_app_4.2.5}/lib/tasks/.gitkeep +0 -0
  74. data/test/{rails_app → rails_app_4.2.5}/public/404.html +0 -0
  75. data/test/{rails_app → rails_app_4.2.5}/public/422.html +0 -0
  76. data/test/{rails_app → rails_app_4.2.5}/public/500.html +0 -0
  77. data/test/{rails_app → rails_app_4.2.5}/public/favicon.ico +0 -0
  78. data/test/{rails_app → rails_app_4.2.5}/public/index.html +0 -0
  79. data/test/{rails_app → rails_app_4.2.5}/public/robots.txt +0 -0
  80. data/test/{rails_app → rails_app_4.2.5}/script/rails +0 -0
  81. data/test/rails_app_5.0.0/.gitignore +21 -0
  82. data/test/rails_app_5.0.0/Gemfile +48 -0
  83. data/test/rails_app_5.0.0/README.md +24 -0
  84. data/test/rails_app_5.0.0/Rakefile +6 -0
  85. data/test/rails_app_5.0.0/app/assets/config/manifest.js +3 -0
  86. data/test/rails_app_5.0.0/app/assets/images/.keep +0 -0
  87. data/test/rails_app_5.0.0/app/assets/images/rails.png +0 -0
  88. data/test/rails_app_5.0.0/app/assets/javascripts/application.js +13 -0
  89. data/test/rails_app_5.0.0/app/assets/javascripts/cable.js +13 -0
  90. data/test/rails_app_5.0.0/app/assets/javascripts/channels/.keep +0 -0
  91. data/test/rails_app_5.0.0/app/assets/stylesheets/application.css +15 -0
  92. data/test/rails_app_5.0.0/app/channels/application_cable/channel.rb +4 -0
  93. data/test/rails_app_5.0.0/app/channels/application_cable/connection.rb +4 -0
  94. data/test/rails_app_5.0.0/app/controllers/admin/posts_controller.rb +14 -0
  95. data/test/rails_app_5.0.0/app/controllers/application_controller.rb +3 -0
  96. data/test/rails_app_5.0.0/app/controllers/concerns/.keep +0 -0
  97. data/test/rails_app_5.0.0/app/controllers/posts_controller.rb +22 -0
  98. data/test/rails_app_5.0.0/app/helpers/application_helper.rb +2 -0
  99. data/test/rails_app_5.0.0/app/jobs/application_job.rb +2 -0
  100. data/test/rails_app_5.0.0/app/jobs/spam/detector_job.rb +11 -0
  101. data/test/rails_app_5.0.0/app/jobs/spam_detector_job.rb +9 -0
  102. data/test/rails_app_5.0.0/app/mailers/admin/post_mailer.rb +13 -0
  103. data/test/rails_app_5.0.0/app/mailers/application_mailer.rb +4 -0
  104. data/test/rails_app_5.0.0/app/mailers/post_mailer.rb +11 -0
  105. data/test/rails_app_5.0.0/app/models/admin/post.rb +5 -0
  106. data/test/rails_app_5.0.0/app/models/application_record.rb +3 -0
  107. data/test/rails_app_5.0.0/app/models/concerns/.keep +0 -0
  108. data/test/rails_app_5.0.0/app/models/post.rb +2 -0
  109. data/test/rails_app_5.0.0/app/views/admin/post_mailer/created.text.erb +1 -0
  110. data/test/rails_app_5.0.0/app/views/admin/posts/index.html.erb +5 -0
  111. data/test/rails_app_5.0.0/app/views/layouts/application.html.erb +14 -0
  112. data/test/rails_app_5.0.0/app/views/layouts/mailer.html.erb +13 -0
  113. data/test/rails_app_5.0.0/app/views/layouts/mailer.text.erb +1 -0
  114. data/test/rails_app_5.0.0/app/views/post_mailer/created.text.erb +1 -0
  115. data/test/rails_app_5.0.0/app/views/posts/_post.html.erb +1 -0
  116. data/test/rails_app_5.0.0/app/views/posts/index.html.erb +5 -0
  117. data/test/rails_app_5.0.0/bin/bundle +3 -0
  118. data/test/rails_app_5.0.0/bin/rails +9 -0
  119. data/test/rails_app_5.0.0/bin/rake +9 -0
  120. data/test/rails_app_5.0.0/bin/setup +34 -0
  121. data/test/rails_app_5.0.0/bin/spring +15 -0
  122. data/test/rails_app_5.0.0/bin/update +29 -0
  123. data/test/rails_app_5.0.0/config.ru +5 -0
  124. data/test/rails_app_5.0.0/config/application.rb +15 -0
  125. data/test/rails_app_5.0.0/config/boot.rb +3 -0
  126. data/test/rails_app_5.0.0/config/cable.yml +9 -0
  127. data/test/rails_app_5.0.0/config/database.yml +25 -0
  128. data/test/rails_app_5.0.0/config/environment.rb +5 -0
  129. data/test/rails_app_5.0.0/config/environments/development.rb +54 -0
  130. data/test/rails_app_5.0.0/config/environments/production.rb +86 -0
  131. data/test/rails_app_5.0.0/config/environments/test.rb +42 -0
  132. data/test/rails_app_5.0.0/config/initializers/application_controller_renderer.rb +6 -0
  133. data/test/rails_app_5.0.0/config/initializers/assets.rb +11 -0
  134. data/test/rails_app_5.0.0/config/initializers/backtrace_silencers.rb +7 -0
  135. data/test/rails_app_5.0.0/config/initializers/cookies_serializer.rb +5 -0
  136. data/test/rails_app_5.0.0/config/initializers/filter_parameter_logging.rb +4 -0
  137. data/test/rails_app_5.0.0/config/initializers/force_test_schema_load.rb +3 -0
  138. data/test/rails_app_5.0.0/config/initializers/inflections.rb +16 -0
  139. data/test/rails_app_5.0.0/config/initializers/mime_types.rb +4 -0
  140. data/test/rails_app_5.0.0/config/initializers/new_framework_defaults.rb +24 -0
  141. data/test/rails_app_5.0.0/config/initializers/session_store.rb +3 -0
  142. data/test/rails_app_5.0.0/config/initializers/wrap_parameters.rb +14 -0
  143. data/test/rails_app_5.0.0/config/locales/en.yml +23 -0
  144. data/test/rails_app_5.0.0/config/puma.rb +47 -0
  145. data/test/rails_app_5.0.0/config/routes.rb +12 -0
  146. data/test/rails_app_5.0.0/config/secrets.yml +22 -0
  147. data/test/rails_app_5.0.0/config/spring.rb +6 -0
  148. data/test/rails_app_5.0.0/db/migrate/20160812134213_create_posts.rb +9 -0
  149. data/test/rails_app_5.0.0/db/schema.rb +21 -0
  150. data/test/rails_app_5.0.0/db/seeds.rb +7 -0
  151. data/test/rails_app_5.0.0/lib/assets/.keep +0 -0
  152. data/test/rails_app_5.0.0/lib/tasks/.keep +0 -0
  153. data/test/rails_app_5.0.0/log/.keep +0 -0
  154. data/test/rails_app_5.0.0/public/404.html +67 -0
  155. data/test/rails_app_5.0.0/public/422.html +67 -0
  156. data/test/rails_app_5.0.0/public/500.html +66 -0
  157. data/test/rails_app_5.0.0/public/apple-touch-icon-precomposed.png +0 -0
  158. data/test/rails_app_5.0.0/public/apple-touch-icon.png +0 -0
  159. data/test/rails_app_5.0.0/public/favicon.ico +0 -0
  160. data/test/rails_app_5.0.0/public/robots.txt +5 -0
  161. data/test/rails_app_5.0.0/test/controllers/.keep +0 -0
  162. data/test/rails_app_5.0.0/test/fixtures/.keep +0 -0
  163. data/test/rails_app_5.0.0/test/fixtures/files/.keep +0 -0
  164. data/test/rails_app_5.0.0/test/helpers/.keep +0 -0
  165. data/test/rails_app_5.0.0/test/integration/.keep +0 -0
  166. data/test/rails_app_5.0.0/test/mailers/.keep +0 -0
  167. data/test/rails_app_5.0.0/test/models/.keep +0 -0
  168. data/test/rails_app_5.0.0/test/test_helper.rb +10 -0
  169. data/test/rails_app_5.0.0/vendor/assets/javascripts/.keep +0 -0
  170. data/test/rails_app_5.0.0/vendor/assets/stylesheets/.keep +0 -0
  171. data/test/support/adapter_test_helpers.rb +17 -2
  172. metadata +295 -100
@@ -0,0 +1,21 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ /tmp/*
17
+ !/log/.keep
18
+ !/tmp/.keep
19
+
20
+ # Ignore Byebug command history file.
21
+ .byebug_history
@@ -0,0 +1,48 @@
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 'sqlite3'
8
+ # Use Puma as the app server
9
+ gem 'puma', '~> 3.0'
10
+ # Use SCSS for stylesheets
11
+ gem 'sass-rails', '~> 5.0'
12
+ # Use Uglifier as compressor for JavaScript assets
13
+ gem 'uglifier', '>= 1.3.0'
14
+ # Use CoffeeScript for .coffee assets and views
15
+ gem 'coffee-rails', '~> 4.2'
16
+ # See https://github.com/rails/execjs#readme for more supported runtimes
17
+ # gem 'therubyracer', platforms: :ruby
18
+
19
+ # Use jquery as the JavaScript library
20
+ gem 'jquery-rails'
21
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
22
+ gem 'turbolinks', '~> 5'
23
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
24
+ gem 'jbuilder', '~> 2.5'
25
+ # Use Redis adapter to run Action Cable in production
26
+ # gem 'redis', '~> 3.0'
27
+ # Use ActiveModel has_secure_password
28
+ # gem 'bcrypt', '~> 3.1.7'
29
+
30
+ # Use Capistrano for deployment
31
+ # gem 'capistrano-rails', group: :development
32
+
33
+ group :development, :test do
34
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
35
+ gem 'byebug', platform: :mri
36
+ end
37
+
38
+ group :development do
39
+ # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
40
+ gem 'web-console'
41
+ gem 'listen', '~> 3.0.5'
42
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
43
+ gem 'spring'
44
+ gem 'spring-watcher-listen', '~> 2.0.0'
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]
@@ -0,0 +1,24 @@
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
+ * ...
@@ -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,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -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,14 @@
1
+ class Admin::PostsController < ApplicationController
2
+ def index
3
+ @posts = Post.all
4
+
5
+ respond_to do |format|
6
+ format.html { render }
7
+ format.json { render :json => @posts }
8
+ end
9
+ end
10
+
11
+ def new
12
+ head :forbidden
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,22 @@
1
+ class PostsController < ApplicationController
2
+ def index
3
+ @posts = Post.all
4
+ end
5
+
6
+ def some_data
7
+ data = Rails.root.join('app', 'assets', 'images', 'rails.png').read
8
+ send_data data, filename: 'rails.png', type: 'image/png'
9
+ end
10
+
11
+ def some_file
12
+ send_file Rails.root.join('app', 'assets', 'images', 'rails.png')
13
+ end
14
+
15
+ def some_redirect
16
+ redirect_to posts_path
17
+ end
18
+
19
+ def some_boom
20
+ raise "boom!"
21
+ end
22
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,11 @@
1
+ module Spam
2
+ class DetectorJob < ApplicationJob
3
+ queue_as :default
4
+
5
+ def perform(*posts)
6
+ posts.detect do |post|
7
+ post.title.include?("Buy watches cheap!")
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class SpamDetectorJob < ApplicationJob
2
+ queue_as :default
3
+
4
+ def perform(*posts)
5
+ posts.detect do |post|
6
+ post.title.include?("Buy watches cheap!")
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ module Admin
2
+ class PostMailer < ApplicationMailer
3
+ default from: "from@example.com"
4
+
5
+ def created
6
+ mail to: "to@example.org"
7
+ end
8
+
9
+ def receive(email)
10
+ # do something
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,11 @@
1
+ class PostMailer < ApplicationMailer
2
+ default from: "from@example.com"
3
+
4
+ def created
5
+ mail to: "to@example.org"
6
+ end
7
+
8
+ def receive(email)
9
+ # do something
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Admin
2
+ class Post < ApplicationRecord
3
+ self.table_name = "posts"
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,2 @@
1
+ class Post < ApplicationRecord
2
+ end
@@ -0,0 +1,5 @@
1
+ <h1>Admin Posts</h1>
2
+
3
+ <% @posts.each do |post| %>
4
+ <%= render 'posts/post', post: post %>
5
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RailsApp</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
+ <%= yield %>
13
+ </body>
14
+ </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
+ <%= post.title %>
@@ -0,0 +1,5 @@
1
+ <h1>Posts</h1>
2
+
3
+ <% @posts.each do |post| %>
4
+ <%= render 'post', post: post %>
5
+ <% end %>
@@ -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,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../config/application', __dir__)
8
+ require_relative '../config/boot'
9
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ 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