Giter Club home page Giter Club logo

rsgem's Issues

Raise a warning if user does not have a git user set

Why

Gemspec authors config will be empty if the user has not set their git config user.name (or email) , hence making executables (like rubocop) to fail at runtime

What

Raise a warning when the user does not have a git user name, and update the gemspec with a temporary author name, so that the tasks can continue to work properly

Configure CI

Why

We want to provide CI configuration out of the box

What

Update the CI configuration file to provide the basic structure needed.

Notes

Make sure to leave a comment in the file to update with the correct Code Climate ID

Improve CLI output

Why

All CLI gems have a proper CLI output to allow users know what's going on while executing a command.

What

Update the output of the new command to better display information of what's going on.
Nice to have, some colors.

Add cache config for Github Actions

Why

We want to leverage from Github Actions configurations and cache all dependencies.

What

Update both this project GH Actions config and the one delivered in the support folder so that Github Actions can cache the dependencies when running the tests.

Add new rubocop cop defaults

What

Add the following configurations to the default rubocop file:

  • Layout/SpaceAroundMethodCallOperator
  • Lint/RaiseException
  • Lint/StructNewOverride
  • Style/ExponentialNotation

Add a verbosity configuration to the context

Why

We want to provide a clean output to the final user but allow him to see the steps if he desires so

What

Create a configuration attribute in the context object. That attribute should be used to check whether to print something into the standard output or not

Add rake task for code analysis

Why

We want to build top quality projects with static code analysis tools in place by default

What

Add the rake task to run both Reek and Rubocop

Rename gem to be RSGem

Why

We want to have a real and rememberable name for the gem. It's usage would be:

$ rsgem new NAME

What

Update the gem's name to be RSGem

Add code coverage configuration

Why

We want to generate the gem with the default configuration for code coverage in the spec helper file.

What

Add the code coverage call in the main spec helper file, so that running the tests also generate the coverage.

Update license to use Rootstrap instead of system user name

Why

We want to have Rootstrap legal name by default in license files, as we do in every other OSS project.

What

Update the license file to have Rootstrap name in the copyright section.

Example

The MIT License (MIT)

Copyright (c) 2020 Rootstrap

Permission is hereby granted, ...

Create CLI

Why

We want users to be able to call this gem's functionality via a command line interface app

What

Create the CLI app to use this gem.

Notes

The gem Thor looks promising

Return an error if bundler is not present in the system

Why

We want to let the user know that bundler was not found in the system when trying to create the gem.

What

Add the exception: true option to the Kernel#system call and rescue the error to display a message to the end user.

Update the files bundled by default

Why

We don't want final users to have all the files from the project

What

Update the gemspec file to have a minimal config like:

  s.files         = Dir["{app,config,lib}/**/*", "CHANGELOG.md", "MIT-LICENSE", "README.md"]
  s.require_paths = ["lib"]

Add an option to create gem for Rails

Why

Given we want to ease the start of the development of a gem, we also want to provide the more appropriate defaults for gems that target Rails applications.

What

Investigate the basic structure of a gem targeting a Rails application.
Add the option to the CLI and the tasks needed to fulfil this.
You can also include a link in the readme if there's a good guide to develop gems for Rails apps.

Notes

https://guides.rubyonrails.org/plugins.html

Remove gems from Gemfile

Why

We want to follow the tech guides regarding gem development

What

Remove the gems specified in the Gemfile after the project is created

Add option to add FactoryBot

Why

We want to allow new gems to use Factory Bot when requested

What

Add the FactoryBot dependency to the Rootstrap::Gem#create method. Make sure it's only added when specified by the user

Generation process is frozen in macOS

Steps to reproduce

  1. rvm use 2.6.5
  2. gem install bundler
  3. gem install rsgem
  4. cd Documents/rootsrap
  5. rsgem new foo

Expected

foo gem folder is created correctly

Actual

Process is frozen without any output

Error when working with system's ruby

Steps to reproduce

  1. Linux
  2. No ruby version manager
  3. gem install bundler
  4. gem install rsgem
  5. rsgem new some_name

Expected

Works correctly

Actual

Traceback (most recent call last):
	9: from /usr/local/bin/rsgem:23:in `<main>'
	8: from /usr/local/bin/rsgem:23:in `load'
	7: from /var/lib/gems/2.7.0/gems/rsgem-0.1.2/exe/rsgem:7:in `<top (required)>'
	6: from /var/lib/gems/2.7.0/gems/dry-cli-0.6.0/lib/dry/cli.rb:67:in `call'
	5: from /var/lib/gems/2.7.0/gems/dry-cli-0.6.0/lib/dry/cli.rb:114:in `perform_registry'
	4: from /var/lib/gems/2.7.0/gems/rsgem-0.1.2/lib/rsgem/cli/commands/new.rb:29:in `call'
	3: from /var/lib/gems/2.7.0/gems/rsgem-0.1.2/lib/rsgem/gem.rb:12:in `create'
	2: from /var/lib/gems/2.7.0/gems/rsgem-0.1.2/lib/rsgem/gem.rb:59:in `create_gem'
	1: from /var/lib/gems/2.7.0/gems/rsgem-0.1.2/lib/rsgem/tasks/create_gem.rb:13:in `create'
/var/lib/gems/2.7.0/gems/rsgem-0.1.2/lib/rsgem/tasks/create_gem.rb:13:in ``': No such file or directory - bundle (Errno::ENOENT)

Run bundle install before running rubocop in new project

Steps to reproduce

  1. Using a ruby version without any gems installed in the system
  2. Install bundler
  3. Run gem install rsgem
  4. Run rsgem new testing

Expected

testing gem is created successfully

Actual

An error appears:

Could not find gem 'reek' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)

Notes

Install local dependencies before running rubocop in the new project

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.