Hacker News new | ask | show | jobs
by bradleyland 5121 days ago
Probably the biggest downside is that you'll incorrectly assume that some parts of Rails are actually part of Ruby. Then you'll miss them when they're not there and possibly feel a small amount of sadness. Oh the humanity! :)

The big one is ActiveSupport. There are many extensions to common Ruby objects like String, Enumerable, Hash, etc. For example. In Rails, you'll use something like this quite frequently:

    some_string_var.parameterize
The parameterize method is part of ActiveSupport::Inflector. As you start to write Ruby outside of Rails, you'll come across occasions where you'd really like to use ActiveSupport methods like these, but fortunately, RubyGems and Bundler make that easy.

EDIT: My last paragraph isn't clear enough that you can use ActiveSupport outside of Rails by simply adding the gem to your Gemfile and requiring it in the relevant location. The downside is that you create a dependency. If you are writing ad hoc scripts, this can be an annoyance, but if you package all your scripts as a Gem using something like Thor, dependencies won't be a problem.

2 comments

Thanks. I was expecting somebody to mention this. What I am currently doing is investigating most of the code I use, be it methods, classes, and so on. It takes me off of the main task, but I think based on what you experienced its a good thing. I have a folder for rails source code in my editor and I usually just hang out there. ;) Hopefully this will mitigate the problem.
Any gem can use ActiveSupport as a dependency, just like Rails does
Added a clarification edit. Thanks!