myrails 4.0.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/myrails.rb +366 -167
  3. data/lib/myrails/templates/capistrano/config/deploy/templates/maintenance/index.html +41 -0
  4. data/lib/myrails/templates/capistrano/config/deploy/templates/monit.conf.erb +4 -0
  5. data/lib/myrails/templates/capistrano/config/deploy/templates/nginx.conf.erb +69 -0
  6. data/lib/myrails/templates/capistrano/config/deploy/templates/unicorn.rb.erb +26 -0
  7. data/lib/myrails/templates/capistrano/config/deploy/templates/unicorn_init.sh.erb +71 -0
  8. data/lib/myrails/templates/capistrano/lib/capistrano/tasks/maintenance.rake +16 -0
  9. data/lib/myrails/templates/capistrano/lib/capistrano/tasks/monit.rake +64 -0
  10. data/lib/myrails/templates/capistrano/lib/capistrano/tasks/nginx.rake +68 -0
  11. data/lib/myrails/templates/capistrano/lib/capistrano/tasks/unicorn.rake +114 -0
  12. data/lib/myrails/templates/{assets → rails/app/assets/javascripts}/application.js +0 -1
  13. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets}/animate.scss +0 -0
  14. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets}/application.css.sass +0 -2
  15. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/cerulean.scss +0 -0
  16. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/cosmo.scss +0 -0
  17. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/cyborg.scss +0 -0
  18. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/darkly.scss +0 -0
  19. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/flatly.scss +0 -0
  20. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/journal.scss +0 -0
  21. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/lumen.scss +0 -0
  22. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/paper.scss +0 -0
  23. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/readable.scss +0 -0
  24. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/sandstone.scss +0 -0
  25. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/simplex.scss +0 -0
  26. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/slate.scss +0 -0
  27. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/spacelab.scss +0 -0
  28. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/superhero.scss +0 -0
  29. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/united.scss +0 -0
  30. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/yeti.scss +0 -0
  31. data/lib/myrails/templates/{assets → rails/app/assets/stylesheets}/will_paginate.scss +0 -0
  32. data/lib/myrails/templates/rails/{controller.rb → app/controllers/controller.rb} +0 -0
  33. data/lib/myrails/templates/rails/{namespace_controller.rb → app/controllers/namespace_controller.rb} +0 -0
  34. data/lib/myrails/templates/rails/{application_helper.rb → app/helpers/application_helper.rb} +0 -0
  35. data/lib/myrails/templates/{mailer → rails/app/mailers}/dev_mail_interceptor.rb +0 -0
  36. data/lib/myrails/templates/{mailer → rails/app/mailers}/sendgrid.rb +0 -0
  37. data/lib/myrails/templates/rails/{model.rb → app/models/model.rb} +0 -0
  38. data/lib/myrails/templates/rails/{namespace_model.rb → app/models/namespace_model.rb} +0 -0
  39. data/lib/myrails/templates/rails/{pundit.rb → app/policies/pundit.rb} +0 -0
  40. data/lib/myrails/templates/{presenters → rails/app/presenters}/base.rb +0 -0
  41. data/lib/myrails/templates/{presenters → rails/app/presenters}/presenter.rb +0 -0
  42. data/lib/myrails/templates/{presenters → rails/app/presenters}/presenter_config.rb +0 -0
  43. data/lib/myrails/templates/{presenters → rails/app/presenters}/presenter_spec.rb +0 -0
  44. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_error_messages.html.haml +0 -0
  45. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_footer.html.haml +0 -0
  46. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_info_messages.html.haml +0 -0
  47. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_nav.html.haml +0 -0
  48. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_success_message.html.haml +0 -0
  49. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/application.html.haml +0 -0
  50. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed-with-address-and-phones.scss +0 -0
  51. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed-with-contact-form.scss +0 -0
  52. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed-with-search.scss +0 -0
  53. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed.scss +0 -0
  54. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed-with-address-and-phones.html.haml +0 -0
  55. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed-with-contact-form.html.haml +0 -0
  56. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed-with-search.html.haml +0 -0
  57. data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed.html.haml +0 -0
  58. data/lib/myrails/templates/rails/app/views/layout/material/_detailed_pagination.html.haml +4 -0
  59. data/lib/myrails/templates/rails/app/views/layout/material/_error_messages.html.haml +9 -0
  60. data/lib/myrails/templates/rails/app/views/layout/material/_footer.html.haml +24 -0
  61. data/lib/myrails/templates/rails/app/views/layout/material/_info_messages.html.haml +14 -0
  62. data/lib/myrails/templates/rails/app/views/layout/material/_nav.html.haml +27 -0
  63. data/lib/myrails/templates/rails/app/views/layout/material/_simple_pagination.html.haml +2 -0
  64. data/lib/myrails/templates/rails/app/views/layout/material/_success_message.html.haml +7 -0
  65. data/lib/myrails/templates/rails/app/views/layout/material/application.html.haml +19 -0
  66. data/lib/myrails/templates/rails/app/views/layout/material/mailer.html.haml +246 -0
  67. data/lib/myrails/templates/rails/app/views/layout/material/mailer.text.haml +1 -0
  68. data/lib/myrails/templates/rails/config/application.example.yml +40 -0
  69. data/lib/myrails/templates/spec/controller.rb +123 -0
  70. data/lib/myrails/templates/{rspec → spec}/factory.rb +1 -1
  71. data/lib/myrails/templates/spec/feature.rb +8 -0
  72. data/lib/myrails/templates/{rspec → spec}/files.rb +0 -0
  73. data/lib/myrails/templates/spec/helper.rb +2 -0
  74. data/lib/myrails/templates/{rspec → spec}/model.rb +0 -0
  75. data/lib/myrails/templates/{rspec → spec}/pundit.rb +0 -0
  76. data/lib/myrails/templates/{rspec → spec}/request.rb +0 -0
  77. data/lib/myrails/templates/{rspec → spec}/request_shared_example.rb +0 -0
  78. data/lib/myrails/templates/{rspec → spec}/shared_example.rb +0 -0
  79. data/lib/myrails/templates/{rspec → spec/support/configs}/database_cleaner.rb +0 -0
  80. data/lib/myrails/templates/{rspec → spec/support/configs}/devise.rb +1 -1
  81. data/lib/myrails/templates/spec/support/configs/factory_bot.rb +3 -0
  82. data/lib/myrails/templates/{rspec → spec/support/configs}/mailer.rb +0 -0
  83. data/lib/myrails/templates/{rspec → spec/support/configs}/shoulda_matchers.rb +0 -0
  84. data/lib/myrails/templates/{rspec → spec/support/configs}/silence_backtrace.rb +0 -0
  85. data/lib/myrails/templates/spec/support/helpers/javascript.rb +12 -0
  86. data/lib/myrails/templates/spec/support/helpers/mailer.rb +9 -0
  87. data/lib/myrails/templates/spec/support/shared_examples/requires_authentication.rb +14 -0
  88. data/lib/myrails/templates/spec/support/shared_examples/requires_authorization.rb +16 -0
  89. data/lib/myrails/templates/spec/support/shared_examples/supports_file_type.rb +25 -0
  90. data/lib/myrails/version.rb +1 -1
  91. metadata +91 -68
  92. data/lib/myrails/templates/initializers/application_vars.rb +0 -2
  93. data/lib/myrails/templates/rails/application.yml +0 -19
  94. data/lib/myrails/templates/rspec/controller.rb +0 -98
  95. data/lib/myrails/templates/rspec/factory_girl.rb +0 -3
  96. data/lib/myrails/templates/rspec/javascript.rb +0 -8
  97. data/lib/myrails/templates/rspec/router.rb +0 -7
@@ -1,2 +0,0 @@
1
- # Load application ENV vars and merge with existing ENV vars. Loaded here so can use values in initializers.
2
- ENV.update YAML.load_file('config/application.yml')[Rails.env] rescue {}
@@ -1,19 +0,0 @@
1
- # use: ENV['email']
2
- # Add code to place file in config/initializers
3
- # Load application ENV vars and merge with existing ENV vars. Loaded here so can use values in initializers.
4
- # ENV.update YAML.load_file('config/application.yml')[Rails.env] rescue {}
5
- defaults: &defaults
6
- email: dev@example.com
7
- secret: mypassword
8
-
9
- development:
10
- <<: *defaults
11
-
12
- test:
13
- <<: *defaults
14
- email: test@example.com
15
-
16
- production:
17
- <<: *defaults
18
- email: info@example.com
19
- secret: mypassword
@@ -1,98 +0,0 @@
1
- require 'rails_helper'
2
-
3
- # Does this controller require authentication?
4
- describe <%= options[:name].pluralize.camelize %>Controller do
5
- # let(:user) {create :user}
6
- let(:<%= options[:name].pluralize %>) {[]}
7
- let(:<%= options[:name].singularize %>) {create :<%= options[:name].singularize %>}
8
-
9
- # before {sign_in user}
10
-
11
- describe 'GET index' do
12
- before do
13
- 3.times {<%= options[:name].pluralize %> << create(:<%= options[:name].singularize %>)}
14
- get :index
15
- end
16
-
17
- it 'sets @<%= options[:name].pluralize %>' do
18
- expect(assigns[:<%= options[:name].pluralize %>]).to eq <%= options[:name].pluralize %>
19
- end
20
- end
21
-
22
- describe 'GET show' do
23
- before {get :show, params: {id: <%= options[:name].singularize %>.id}}
24
-
25
- it 'sets @<%= options[:name].singularize %>' do
26
- expect(assigns[:<%= options[:name].singularize %>]).to eq <%= options[:name].singularize %>
27
- end
28
- end
29
-
30
- describe 'GET new' do
31
- before {get :new}
32
-
33
- it 'sets @<%= options[:name].singularize %>' do
34
- expect(assigns[:<%= options[:name].singularize %>]).to be_a_new <%= options[:name].singularize.camelize %>
35
- end
36
- end
37
-
38
- describe 'POST create' do
39
- context 'successful create' do
40
- before {post :create, params: {<%= options[:name].singularize %>: attributes_for(:<%= options[:name].singularize %>)}}
41
-
42
- subject(:<%= options[:name].first %>){assigns[:<%= options[:name].singularize %>]}
43
-
44
- it 'redirects to :show'
45
- it 'sets @<%= options[:name].singularize %>'
46
- it 'sets flash[:success]'
47
- it 'tags the current_user as creator'
48
- end
49
-
50
- context 'unsuccessful create' do
51
- before {post :create, params: {<%= options[:name].singularize %>: attributes_for(:<%= options[:name].singularize %>, attr: nil)}}
52
-
53
- it 'renders :new template'
54
- it 'sets @<%= options[:name].singularize %>'
55
- it 'sets flash[:error]'
56
- end
57
- end
58
-
59
- describe 'GET edit' do
60
- before {get :edit, params: {id: <%= options[:name].singularize %>.id}}
61
-
62
- it 'sets @<%= options[:name].singularize %>' do
63
- expect(assigns[:<%= options[:name].singularize %>]).to eq <%= options[:name].singularize %>
64
- end
65
- end
66
-
67
- describe 'PUT/PATCH update' do
68
- context 'successful update' do
69
- before {put :update, params: {id: <%= options[:name].singularize %>.id, <%= options[:name].singularize %>: attributes_for(:<%= options[:name].singularize %>)}}
70
-
71
- subject(:<%= options[:name].first %>) {assigns[:<%= options[:name].singularize %>]}
72
-
73
- it 'redirects to :show'
74
- it 'sets @<%= options[:name].singularize %>'
75
- it 'sets flash[:success]'
76
- it 'tags current_user as updater'
77
- end
78
-
79
- context 'unsuccessful update' do
80
- before {put :update, params: {id: <%= options[:name].singularize %>.id, <%= options[:name].singularize %>: attributes_for(:<%= options[:name].singularize %>, attr: nil)}}
81
-
82
- it 'renders :edit template'
83
- it 'sets @<%= options[:name].singularize %>'
84
- it 'sets flash[:error]'
85
- end
86
- end
87
-
88
- describe 'DELETE destroy' do
89
- before {delete :destroy, params: {id: <%= options[:name].singularize %>.id}}
90
-
91
- it 'redirects to :index' do
92
- expect(response).to redirect_to <%= options[:name].pluralize %>_path
93
- end
94
- it 'sets @<%= options[:name].singularize %>'
95
- it 'deletes @<%= options[:name].singularize %>'
96
- it 'sets flash[success]'
97
- end
98
- end
@@ -1,3 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include FactoryGirl::Syntax::Methods
3
- end
@@ -1,8 +0,0 @@
1
- module JavascriptHelper
2
- # Basecamp trix uses hidden input to populate its editor
3
- def fill_in_trix_editor(id, value)
4
- find(:xpath, "//*[@id='#{id}']", visible: false).set(value)
5
- end
6
- end
7
-
8
- # Example of use in feature test: fill_in_trix_editor("blog_comment_body_trix_input_blog_comment_#{blog_comment.id}", "some text")
@@ -1,7 +0,0 @@
1
- # Controller test doesn't seem to use default url option when redirecting to an associated record. Uses http://test.com. This is an attmept to unify this and capybara which uses http://www.example.com.
2
- # Add this method to the before action of any controller specs that needed it. Found it useful to use this when using shared examples.
3
- RSpec.configure do |config|
4
- config.before :each, type: :controller do
5
- @request.host = 'localhost:3000'
6
- end
7
- end