myrails 4.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/myrails.rb +366 -167
- data/lib/myrails/templates/capistrano/config/deploy/templates/maintenance/index.html +41 -0
- data/lib/myrails/templates/capistrano/config/deploy/templates/monit.conf.erb +4 -0
- data/lib/myrails/templates/capistrano/config/deploy/templates/nginx.conf.erb +69 -0
- data/lib/myrails/templates/capistrano/config/deploy/templates/unicorn.rb.erb +26 -0
- data/lib/myrails/templates/capistrano/config/deploy/templates/unicorn_init.sh.erb +71 -0
- data/lib/myrails/templates/capistrano/lib/capistrano/tasks/maintenance.rake +16 -0
- data/lib/myrails/templates/capistrano/lib/capistrano/tasks/monit.rake +64 -0
- data/lib/myrails/templates/capistrano/lib/capistrano/tasks/nginx.rake +68 -0
- data/lib/myrails/templates/capistrano/lib/capistrano/tasks/unicorn.rake +114 -0
- data/lib/myrails/templates/{assets → rails/app/assets/javascripts}/application.js +0 -1
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets}/animate.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets}/application.css.sass +0 -2
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/cerulean.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/cosmo.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/cyborg.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/darkly.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/flatly.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/journal.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/lumen.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/paper.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/readable.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/sandstone.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/simplex.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/slate.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/spacelab.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/superhero.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/united.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets/bootstrap}/bootstrap_themes/yeti.scss +0 -0
- data/lib/myrails/templates/{assets → rails/app/assets/stylesheets}/will_paginate.scss +0 -0
- data/lib/myrails/templates/rails/{controller.rb → app/controllers/controller.rb} +0 -0
- data/lib/myrails/templates/rails/{namespace_controller.rb → app/controllers/namespace_controller.rb} +0 -0
- data/lib/myrails/templates/rails/{application_helper.rb → app/helpers/application_helper.rb} +0 -0
- data/lib/myrails/templates/{mailer → rails/app/mailers}/dev_mail_interceptor.rb +0 -0
- data/lib/myrails/templates/{mailer → rails/app/mailers}/sendgrid.rb +0 -0
- data/lib/myrails/templates/rails/{model.rb → app/models/model.rb} +0 -0
- data/lib/myrails/templates/rails/{namespace_model.rb → app/models/namespace_model.rb} +0 -0
- data/lib/myrails/templates/rails/{pundit.rb → app/policies/pundit.rb} +0 -0
- data/lib/myrails/templates/{presenters → rails/app/presenters}/base.rb +0 -0
- data/lib/myrails/templates/{presenters → rails/app/presenters}/presenter.rb +0 -0
- data/lib/myrails/templates/{presenters → rails/app/presenters}/presenter_config.rb +0 -0
- data/lib/myrails/templates/{presenters → rails/app/presenters}/presenter_spec.rb +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_error_messages.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_footer.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_info_messages.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_nav.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/_success_message.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/application.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed-with-address-and-phones.scss +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed-with-contact-form.scss +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed-with-search.scss +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/css/footer-distributed.scss +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed-with-address-and-phones.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed-with-contact-form.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed-with-search.html.haml +0 -0
- data/lib/myrails/templates/{layout → rails/app/views/layout/bootstrap}/footers/footer-distributed.html.haml +0 -0
- data/lib/myrails/templates/rails/app/views/layout/material/_detailed_pagination.html.haml +4 -0
- data/lib/myrails/templates/rails/app/views/layout/material/_error_messages.html.haml +9 -0
- data/lib/myrails/templates/rails/app/views/layout/material/_footer.html.haml +24 -0
- data/lib/myrails/templates/rails/app/views/layout/material/_info_messages.html.haml +14 -0
- data/lib/myrails/templates/rails/app/views/layout/material/_nav.html.haml +27 -0
- data/lib/myrails/templates/rails/app/views/layout/material/_simple_pagination.html.haml +2 -0
- data/lib/myrails/templates/rails/app/views/layout/material/_success_message.html.haml +7 -0
- data/lib/myrails/templates/rails/app/views/layout/material/application.html.haml +19 -0
- data/lib/myrails/templates/rails/app/views/layout/material/mailer.html.haml +246 -0
- data/lib/myrails/templates/rails/app/views/layout/material/mailer.text.haml +1 -0
- data/lib/myrails/templates/rails/config/application.example.yml +40 -0
- data/lib/myrails/templates/spec/controller.rb +123 -0
- data/lib/myrails/templates/{rspec → spec}/factory.rb +1 -1
- data/lib/myrails/templates/spec/feature.rb +8 -0
- data/lib/myrails/templates/{rspec → spec}/files.rb +0 -0
- data/lib/myrails/templates/spec/helper.rb +2 -0
- data/lib/myrails/templates/{rspec → spec}/model.rb +0 -0
- data/lib/myrails/templates/{rspec → spec}/pundit.rb +0 -0
- data/lib/myrails/templates/{rspec → spec}/request.rb +0 -0
- data/lib/myrails/templates/{rspec → spec}/request_shared_example.rb +0 -0
- data/lib/myrails/templates/{rspec → spec}/shared_example.rb +0 -0
- data/lib/myrails/templates/{rspec → spec/support/configs}/database_cleaner.rb +0 -0
- data/lib/myrails/templates/{rspec → spec/support/configs}/devise.rb +1 -1
- data/lib/myrails/templates/spec/support/configs/factory_bot.rb +3 -0
- data/lib/myrails/templates/{rspec → spec/support/configs}/mailer.rb +0 -0
- data/lib/myrails/templates/{rspec → spec/support/configs}/shoulda_matchers.rb +0 -0
- data/lib/myrails/templates/{rspec → spec/support/configs}/silence_backtrace.rb +0 -0
- data/lib/myrails/templates/spec/support/helpers/javascript.rb +12 -0
- data/lib/myrails/templates/spec/support/helpers/mailer.rb +9 -0
- data/lib/myrails/templates/spec/support/shared_examples/requires_authentication.rb +14 -0
- data/lib/myrails/templates/spec/support/shared_examples/requires_authorization.rb +16 -0
- data/lib/myrails/templates/spec/support/shared_examples/supports_file_type.rb +25 -0
- data/lib/myrails/version.rb +1 -1
- metadata +91 -68
- data/lib/myrails/templates/initializers/application_vars.rb +0 -2
- data/lib/myrails/templates/rails/application.yml +0 -19
- data/lib/myrails/templates/rspec/controller.rb +0 -98
- data/lib/myrails/templates/rspec/factory_girl.rb +0 -3
- data/lib/myrails/templates/rspec/javascript.rb +0 -8
- data/lib/myrails/templates/rspec/router.rb +0 -7
@@ -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,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
|