clearly not a photograph, it’s a painting which should be an indicator as to how old it actually is. Nobody gets painted anymore, this is obviously from pre-photograph technology.
grow and sometimes conventions at greenfield don’t scale well Where do we put extractions that help DRY our code? What about common object patterns, where do these go?
helpers/, mailers/, models/ Monday, March 26, 12 You have the freedom to app and remove whatever directories you want. All Rails cares about is if the constants are loaded. The directories that are generated when you create a new rails app are good common sense suggestions, not hard rules
strategies/ Monday, March 26, 12 I’ve been putting my mixins and strategies into these directories, as long as you follow the underscore to camelcase convention Rails will auto require the files
is that the gem name needs to match the require name, the gem name has nothing to do with what you are requiring at all. There could be more than one files with ‘active_record’ in the load path and Rubygems will just require the first one it happens to find... let’s demonstrate that by doing something *very* stupid
RAILS!’ $ rails c Monday, March 26, 12 Not something you should do, most likely no good use case for doing this but it does a good job of demonstrating what is happening under the hood which is good to understand
and they don’t require you to conform to the file and class name convention that is required for anything in Rails’ autoload path. But just dumping any code in here is *BAD*? Why? Because you are most likely working with a team of people and there should be conventions on how your app is organized. It is important.
has a secret to hide, but unfortunately he isn’t a very good actor so he can’t hide it very well. Nonetheless he doesn’t want to tell you his secret, but I will. It turns out that Keanu has been getting major cred in the Ruby community by releasing TONS of gems. How does he do it so easily? Let’s see.
"~/.rvm/gems/ruby-1.9.2/gems/method_source-0.7.0/lib", "~/.rvm/gems/ruby-1.9.2/gems/jquery-rails-2.0.0/lib", "~/.rvm/gems/ruby-1.9.2/gems/coffee-rails-3.2.2/lib", "~/.rvm/gems/ruby-1.9.2/gems/railties-3.2.1/lib", "~/.rvm/gems/ruby-1.9.2/gems/thor-0.14.6/lib", "~/.rvm/gems/ruby-1.9.2/gems/rdoc-3.12/lib", "~/.rvm/gems/ruby-1.9.2/gems/json-1.6.5/ext/json/ext", "~/.rvm/gems/ruby-1.9.2/gems/json-1.6.5/ext", "~/.rvm/gems/ruby-1.9.2/gems/json-1.6.5/lib", "~/.rvm/gems/ruby-1.9.2/gems/rack-ssl-1.3.2/lib", "~/.rvm/gems/ruby-1.9.2/gems/coffee-script-2.2.0/lib", "~/.rvm/gems/ruby-1.9.2/gems/execjs-1.3.0/lib", "~/.rvm/gems/ruby-1.9.2/gems/coffee-script-source-1.2.0/lib", "~/.rvm/gems/ruby-1.9.2/gems/coderay-1.0.5/lib", "~/.rvm/gems/ruby-1.9.2/gems/activeresource-3.2.1/lib", "~/.rvm/gems/ruby-1.9.2/gems/activerecord-3.2.1/lib", "~/.rvm/gems/ruby-1.9.2/gems/tzinfo-0.3.31/lib", "~/.rvm/gems/ruby-1.9.2/gems/arel-3.0.0/lib", Monday, March 26, 12 This is prepended to your load path after the environment loads up So now that our lib directory is exposed to the load path, we can treat it like the lib directory in a gem.
• Patrick Robertson kicked some ass • He still has not extracted into a Gem https://github.com/bostonrb/bostonrb/blob/master/lib/boston_rb_calendar.rb Monday, March 26, 12 This makes Keanu Reeves sad But that’s ok Keanu!, his code is in a great spot to be extracted into a gem. Or at the very least, for someone else to extract it and take all of the credit. Let’s take a look at what he’s done