vmcilwain / myrails Goto Github PK
View Code? Open in Web Editor NEWA ruby gem to help quickly spin up a rails app and start coding
Home Page: https://rubygems.org/gems/myrails
License: MIT License
A ruby gem to help quickly spin up a rails app and start coding
Home Page: https://rubygems.org/gems/myrails
License: MIT License
Code should be:
config.before :each, type: :controller do
@request.host = 'localhost:3000'
end
end
if Rails.env.development?
require 'byebug/core'
Byebug.start_server 'localhost', ENV["BYEBUGPORT"].to_i
end
Just as with the bootstrap layout, there should be a material layout to choose from as well.
Add api authorization code. figure out a way to categorize it like what was don with the install code.
Need to move reload invocation from the monit task.
def note
@note = Note.find(params[:id]) %>
end
Capybara.app_host = "http://localhost:3000"
Capybara.server_host = "localhost"
Capybara.server_port = "3000"
Actions should only require the object
not object.id
All specs should have a subject
that points to the assigns
object
All specs should use is_expected.to
where possible
All specs should have flash specs already filled out
proxy_pass http://myapp;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on; # Optional
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
myrails controller --name admin/articles
generates code like:
let(:admin/articles) {[]}
let(:admin/article) {create :admin/article}
describe 'GET index' do
before do
3.times {admin/articles << create(:admin/article)}
get :index
end
it 'sets @admin/articles' do
expect(assigns[:admin/articles]).to eq admin/articles
end
end
Add action to generate capistrano setup including rake tasks, templates and notification.
It is reference Object instead of the passed in value in the find method.
This causes issues with authentication. Also remove any options that are set on the protect from forgery line in application controller.
config.include ActionView::RecordIdentifier, type: :feature
Adding the above line will allow use of record identifiers such as dom_id to be used in the feature spec.
capistrano should support a maintenance page when deploying.
Random set of erb tags show up after generating a controller.
This was a rails 5 change that needs to be added.
Add option to install figaro instead of dotenv. Be sure to check if one or the other has been installed before installing.
When choosing a css style the import statement in the application.css.sass
file is nested.
@import animate
@import spacelab
@import will_paginate
Upgrade activesupport gems get and get rid of deprecation warnings
Logout should be changed to sign_out for controller tests.
Dotenv is a better solution than rolling out your own at this point.
xpath has been problematic. Change it to use css instead.
Not able to rely on task description to execute task.
It will be helpful to generate rspec shared example boiler plate code.
something like
myrails install rspec
There should be an action to generate a generic rspec feature file. Something like:
myrails feature --name=directory/filename
Action should add the file with _.spec.rb
to the end of it in the sub directory specified in the spec/features directory.
If model is defined with snake case, The finder method should constanize the full word and not just the first word before the underscore.
$ myrails ui_install
create app/controllers/ui_controller.rb
create app/views/ui/index.html.haml
/Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions.rb:90:in action': wrong number of arguments (given 0, expected 1) (ArgumentError) from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/myrails-1.0.0/lib/myrails.rb:65:in
block in ui_install'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb:46:in initialize' from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb:30:in
new'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb:30:in insert_into_file' from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/myrails-1.0.0/lib/myrails.rb:61:in
ui_install'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in
invoke_command'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/myrails-1.0.0/lib/myrails.rb:399:in `<top (required)>'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/myrails-1.0.0/bin/myrails:3:in `require_relative'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/gems/myrails-1.0.0/bin/myrails:3:in `<top (required)>'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/bin/myrails:23:in `load'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/bin/myrails:23:in `<main>'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/lovell.m/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
The pundit rescue clause should be added above protect
Including pundit should happen just after the class declaration.
add_flash_types :..., :...
Do the same thing with rspec commands that you did with install commands. example:
myrails rspec feature directory/specfile
This makes for a cleaner experience.
path for ui is set to /ui
when it should be set to /ui/index
For .coffee files:
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
For .scss files:
// Place all the styles related to the organizations controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
Factory girl is being deprecated so its time to change it
This action should not rely on the gems_install action being ran first.
The following should be added to the application controller when the registration override option is used.
before_action :configure_permitted_parameters, if: :devise_controller?
Layout assumes a footer is created. Most likely css as well.
Change code to only insert footer render code if a footer is actually generated
Add code to generate rspec request file with boilerplate code
pundit install doesn't include pundit in the application controller.
Set them to ENV['DEFAULT_HOST']
. this should be set as a figaro/dotenv setting.
Capybara.app_host = "http://localhost:3000"
Capybara.server_host = "localhost"
Capybara.server_port = "3000"
Combine related tasks based on initial install order:
install gems
install application helper
combine:
install assets
install layout
install css
install footer
install ui
install pundit
combine:
install rspec
install rails_helper
install footnotes
git_init
Initial thought is to have option called nspace
that takes a path from app to handle nesting controllers when needed.
The namespace option should take of adding a top level controller for named controller to inherit from.
if namespace is admin with a controller of users then the following:
app
This should also be mimicked in the rspec file structure as well.
List of gems should not be hardcoded in the gem. The list should be moved to a separate file. Use the same format as whats in the code but read the file in place of the hard coded content.
There isn't a need to install a locked version of devise or any other gem.
Add config_env
action to auto_install
action.
After creating an api authentication setup, it should be added to this so that the setup can be automated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.