Coder Social home page Coder Social logo

ordinare's Introduction

ordinare

Build Status Gem Version codecov PRs Welcome FOSSA Status Open Source Helpers

Ordinare sorts gems in your Gemfile alphabetically

ordinare GIF

In order to install the gem, do:

$ gem install ordinare

Usage ⛏️

Position yourself inside Rails project with Gemfile and do:

$ ordinare

And that's it! Ordinare will sort your Gemfile and overwrite your current Gemfile.

If you don't want ordinare to overwrite your Gemfile, see Don't overwrite Gemfile.

NOTE: be sure to do $ bundle install after ordinare sorts your Gemfile just to make sure everything is OK.

Love for the gem groups ❤️

If you're using something along these lines in your Gemfile:

...

group :test do
  gem "webmock"
  gem "cucumber-rails"
end

group :development do
  gem "byebug"
  gem "spring"
do

...

ordinare will consider groups inside your Gemfile and will sort gems inside those groups, not messing them up.

Love for the comment groups 💚

If you're organizing your gems using comments in similar fashion:

...

# Auth
gem "devise"
gem "oauth2"

# Assets
gem "sprockets"
gem "sprockets-es6"
gem "pusher"

...

ordinare will sort gems below your comments, treating them as groups (e.g. "Auth" group and "Assets" group).

Advanced usage ⚒️

Pass in path to Gemfile

You can pass in path to your gemfile:

$ ordinare --path my_awesome_project/Gemfile

And that's it! You can find your ordered Gemfile at my_awesome_project/Gemfile.

Don't overwrite Gemfile

Ordinare has an option that will make Gemfile.ordinare instead of overwriting your original Gemfile.

Just call ordinare like this:

$ ordinare --no-overwrite

And that's it! You can find your ordered Gemfile at Gemfile.ordinare.

Check if Gemfile is sorted

There is an option to check your Gemfile to see if it's sorted. This will not overwrite nor create a new sorted Gemfile.

Call ordinare like this:

ordinare --check

And that's it, ordinare will inform your whether your Gemfile is sorted properly or not. This can be useful on some CI server where you check if Gemfile is sorted.

Contributing ✍️

Any suggestions and improvements are more than welcome 🙇‍♂️.

If you'd like to contribute, you can check CONTRIBUTING.md

License

FOSSA Status

ordinare's People

Contributors

codetriage-readme-bot avatar dependabot[bot] avatar fossabot avatar nikolalsvk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ordinare's Issues

What about --check option?

It will be useful after using it once to check that Gemfile is ordered. You can add check task and run it with rubocop and tests on CI.
WDYT?

bad value for range (ArgumentError)

$ ordinare, the following exception is raised.

/Users/richard/.gem/ruby/2.3.1/gems/ordinare-0.2.5/lib/ordinare.rb:39:in `block in sort': bad value for range (ArgumentError)
	from /Users/richard/.gem/ruby/2.3.1/gems/ordinare-0.2.5/lib/ordinare.rb:38:in `each'
	from /Users/richard/.gem/ruby/2.3.1/gems/ordinare-0.2.5/lib/ordinare.rb:38:in `sort'
	from /Users/richard/.gem/ruby/2.3.1/gems/ordinare-0.2.5/bin/ordinare:8:in `<top (required)>'
	from /Users/richard/.gem/ruby/2.3.1/bin/ordinare:22:in `load'
	from /Users/richard/.gem/ruby/2.3.1/bin/ordinare:22:in `<main>'
	from /Users/richard/.gem/ruby/2.3.1/bin/ruby_executable_hooks:15:in `eval'
	from /Users/richard/.gem/ruby/2.3.1/bin/ruby_executable_hooks:15:in `<main>'

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.