What's the best practices in code reuse between different Ruby projects?

guys!

I'm a software developer with Java background and I'm starting some projects using a Ruby web framework (Padrino/Sinatra).

In my java projects, I usually had some "common" projects whose classes where used in several projects. For instance, I had a central authentication service, and a shared database that stored the user profiles. All my projects that used this service shared some models mapped to the user profile database.

So, despite the framework, orm lib etc., what's the best way of sharing code across several Ruby projects?

Answers


Besides this, ruby's gems is one of the best way of reusing common parts of code. Gems have names, version numbers, and descriptions and therefore you can easily maintain up-to-date versions of these libraries, install and uninstall, manage your computer’s local installations of gems using the gem command, available from the command line. Gems became standard with Ruby 1.9, but before you have to use require 'rubygems' line in the scripts. There are several tools that help create them, for example, bundler. Bundler not only tool for gem creation, but an awesome application's dependencies manager.


Need Your Help

How do I upgrade strawberry perl without wiping \perl\site\lib\ and \perl\site\bin\?

perl strawberry-perl

I downloaded the 5.12.3 installer to upgrade my 5.12.1 installation. After installing 5.12.3, my previously installed cpan modules are gone. Is this expected behavior? Should I be backing up my lib...

invalid context 0x0 for drawing line graph

objective-c graph cgcontext linegraph

I have to draw a line .I use the below code.My actual need is to draw lines from points that are present in an NSMutableArray

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.