Giter VIP home page Giter VIP logo

rails-template's Issues

[BUG] Use .env.local and .env.test

IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.

Before we start...:

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Expected behavior:

Create a Rails app using this template.
Add ENV to the .env.sample file.
And be able to run the app with foreman or docker.

Actual behavior:

Running a newly created app (based on this template) does not run in docker or foreman.

Steps to reproduce:

  1. I create a rails app using this template.
  2. I add a few ENV entries into the .env.sample file.
  3. Then I run the setup script.
  4. Then I try to run the app in docker or with foreman.
  5. But the app does fails to run.

Context and environment:

From this issue: fastruby/dotenv_validator#46
And this PR: fastruby/dotenv_validator#51

The issue was that foreman and docker-compose would automatically parse any .env files present in the project and populate the environment variables before the Rails app could run, but with no treatment of comments and blank spaces. As a result, when dotenv parsed the file, since the variables would already be populated by docker, it would not change them and, because of this, dotenv_validator validated environment variables that included any blank spaces or comments present in the .env files.

This caused dotenv_validator to fail even for environment variables that should pass.

More details can be found in the changes to the README of dotenv_validator here. After this change we can now successfully run the app in docker and locally with foreman without dotenv_validator failing.

We want to make these changes:
Add this to .gitignore

.env.local
.env.test

Add to bin/setup

unless File.exist?(".env.local")
  cp ".env.sample", ".env.local"
  system! "ln -s .env.local .env.test"
end

I will abide by the [code of conduct] (CODE_OF_CONDUCT.md)

As an OmbuLabs / FastRuby.io developer, I'd like to be able to pick which style guide to use in my new Rails application

Why

As a developer
I want to be able to pick the style guide
So that I can save time implementing it in my project

Acceptance Criteria

Scenario: 
Given that we have three style guides (no style guide (Rails's default), OmbuLabs, or FastRuby.io)
When I start creating a new Rails project
Then I want to be able to pick the style guide for my project

Notes:

It would be great if there is a little dialogue that is presented to the user or an option to pick the style guide.

For example:

rails new foo
> Which style guide do you want to use? (rails/fastruby/ombulabs -- default: ombulabs)
> fastruby
> Cool, using fastruby style guide for project foo.

Or:

rails new foo --styleguide=fastruby
> Cool, using fastruby style guide for project foo.

[BUG] Rails already adds capybara and other gems

Version, Branch, or Commit:

Main branch

Expected behavior:

The template shouldn't add gems that are already in the Gemfile

Actual behavior:

The generation of the app fails because Capybara is defined twice (one by default and one added by the remplate)

Steps to reproduce:

Using rails 6.1.4.1

Run rails new PROJECT_NAME -m https://raw.githubusercontent.com/fastruby/rails-template/main/template.rb and you should see this error

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: capybara (>= 3.26) and capybara (>= 2.15). Bundler cannot continue.

 #  from ../PROJECT_NAME/Gemfile:64
 #  -------------------------------------------
 #  group :test do
 >    gem "capybara", ">= 2.15"
 #    gem "selenium-webdriver"
 #  -------------------------------------------

I will abide by the [code of conduct] (CODE_OF_CONDUCT.md)

[BUG] : Missing default .env.sample

IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.

Before we start...:

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Version, Branch, or Commit:

main @ ef2dd6b

Expected behavior:

I run bin/setup after creating a new rails app and expect it to run smoothly.

Actual behavior:

Please include a detailed description of the actual behavior of the application.
I run bin/setup and see an error related to the .env.sample file.

I think the bin/setup file needs to be updated to create an empty .env.sample file if it does not exist.

Steps to reproduce:

How do I achieve this behavior? Use the following format to provide a step-by-step guide:

  1. Step 1: Add the railsrc file to my system
  2. Step 2: Run rails new projectname
  3. Step 3: See the following error:

: No such file or directory @ rb_sysopen - .env.sample (Errno::ENOENT)

I will abide by the [code of conduct] (CODE_OF_CONDUCT.md)

[BUG] Template fails when running `next bundle install`

Version, Branch, or Commit:

Main branch

Expected behavior:

The generator should complete execution with the app with correct dual booting setup.

Actual behavior:

The generator fails when running next bundle install with this error:

         run    next bundle install from "."
The git source https://github.com/rails/rails.git is not yet checked out. Please run `bundle install` before trying to start your application

Steps to reproduce:

Create a new rails app using the template.

I will abide by the [code of conduct] (CODE_OF_CONDUCT.md)

[BUG] Reek missing `detectors` key

IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.

Before we start...:

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Version, Branch, or Commit:

Inform what version, branch, commit of the project you are using.

Expected behavior:

  1. Create a new project with this template
  2. Run bin/setup
  3. Commit changes without any errors or problems

Actual behavior:

When I try to commit after running the bin/setup script I see an error message:
reek key 'Attribute:' is undefined.

According to the documentation over here:
https://github.com/troessner/reek/blob/master/docs/Reek-4-to-Reek-5-migration.md#reek-4-to-reek-5-migration

Reek 5 now requires a detectors key for standalone detectors.

So I think we just need to update the .reek.yml file.

Steps to reproduce:

How do I achieve this behavior? Use the following format to provide a step-by-step guide:

  1. Step 1: I use the template to create a new project
  2. Step 2: I run bin/setup
  3. Step: 3: I try to commit all changes
  4. Step 4: I see an error message reek key 'Attribute:' is undefined.

Context and environment:

Provide any relevant information about your setup (Customize the list accordingly based on what info is relevant to this project)

  1. Version of the software the issue is being opened for. Reek 5
  2. Ruby version: 3.01

I will abide by the [code of conduct] (CODE_OF_CONDUCT.md)

[BUG] Stop spring at the end of the process

IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.

Before we start...:

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Version, Branch, or Commit:
25026e8

Expected behavior:

It should terminate all the related processes.

Actual behavior:

We have lingering process from the newly generated Rails app.

Steps to reproduce:
1: Run rails new test-app --rc=./rails-template/.railsrc -m ./rails-template/template.rb from the parent directory of rails-template
2. ps aux | grep ruby lists few running processes

I will abide by the [code of conduct] (CODE_OF_CONDUCT.md)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.