Closed voltechs closed 5 years ago
Thank you for the idea!
The answer for the question is very simple- I did not need to use it with out Rails and nobody asked about it before.
The gem is too small and it have too limited extension options, so doing second gem will be too much for this case (it add more hassle than gain). But the option 1 looks good.
Of course ActiveRecord
should be a dependency, but not the entire Rails.
Feel free to add a PR or I'll take a look on this or next weekend.
@voltechs I released version 1.0.0 of this gem, which does not require Rails.
@kvokka awesome. I'm a little swamped with work and other obligations at the moment, but I will try to make a PR if I can.
In my opinion,
rails
should not be a required dependency. Two approaches one could take for this.pp_sql.rb
) like:pp_sql-rails.gemspec
) calledpp_sql-rails
, which has a dependency onpp_sql
andrails
, and this is where you'd put the railtie injection bit.That way, folks who don't need all of
rails
(many gems just requireactive_record
, for example), and have the benefit of pretty printing sql, without the weight ofrails
! This also opens uppp_sql
for inclusion in other frameworks, such as Sinatra, or Hanami!Thanks for your work on
pp_sql
. I'm grateful someone has made this contribution.