Skip to content

Instantly share code, notes, and snippets.

View mattetti's full-sized avatar

Matt Aimonetti mattetti

View GitHub Profile
Objectives:
- being able to start a merb app without anything installed but Ruby
- being able to easily update a merb app to a newer version
- being able to run different versions of a merb app on the same server
- being able to use merb plugins in a frozen environment
dependencies: {"merb-gen"=>["rubigen"], "merb-core"=>["erubis", "rake", "json_pure", "rspec", "rack", "hpricot", "mime-types"], "extlib"=>["rake", "json_pure", "rspec"], "merb_sequel"=>["sequel", "sequel_model"], "merb_stories"=>["rspec"]}
dependencies (1 level deep): {"sequel"=>["assistance", "sequel_core"], "erubis"=>["abstract"], "sequel_model"=>["assistance", "sequel_core"], "rubigen"=>["activesupport"]}
dependencies (2 levels deep): {"sequel_core"=>["metaid", "RubyInline", "ParseTree", "ruby2ruby"]}
total: ["ParseTree", "RubyInline", "abstract", "activesupport", "assistance", "erubis", "hpricot", "json_pure", "metaid", "mime-types", "rack", "rake", "rspec", "rubigen", "ruby2ruby", "sequel", "sequel_core", "sequel_model"]
ependencies:
english
mongrel
erubis
json
mime-types
xml-simple
archive-tar-minitar
rubigen
rake
| simple backend using #translate | Ruby hash | #1/#2 |
--------------------------------------------------------------------------------------------------
lookup with locale given x100000 | 3.560 | 0.061 | 58.54x |
| no key | key with scope | hash key being nil | #1/#3 |
----------------------------------------------------------------------------------------------------
lookup with no key given x100000 | 1.422 | 3.577 | 0.045 | 31.77x |
>> merb.show_routes
==== Named routes
Helper : delete_artist_photo
HTTP method: GET
Route : /artists/:artist_id/photos/:id/delete
Params : {:action=>"\"index\"", :artist_id=>"path1", :id=>"path2"}
Helper : delete_artist_category
HTTP method: GET
Route : /artists/:artist_id/categories/:id/delete
~ Loaded DEVELOPMENT Environment...
~ loading gem 'merb_activerecord' ...
~ loading gem 'activerecord' ...
~ loading gem 'merb_activerecord' ...
~ Connecting to database...
~ Compiling routes...
"merb paginate for AR"
~ Using 'share-nothing' cookie sessions (4kb limit per client)
Named Routes
artist_photos: /artists/:artist_id/photos
specs = {}
elements = %w[ merb extlib merb-core merb-more merb-action-args merb-assets merb-builder merb-cache merb-freezer merb-gen merb-haml merb-mailer merb-parts merb_activerecord merb_helpers merb_sequel merb_param_protection merb_test_unit merb_stories]
elements.each do |name|
dependency = Gem::Dependency.new name, nil
Gem.source_index.search(dependency).each do |spec|
specs[spec.full_name] = spec
end
end
CmdUtils.CreateCommand(
{
name: "ruby",
takes: {"function": noun_arb_text},
icon: "http://ruby-doc.org/favicon.ico",
homepage: "http://jackndempsey.blogspot.com",
author: {name: "Jack Dempsey", email: "jack.dempsey@gmail.com"},
license: "MPL,GPL",
description: "Search ruby functions documentation",
help: "Select a ruby function",
require File.join( File.dirname(__FILE__), '..', "spec_helper" )
describe Client do
it "should have a valid factory" do
Factory.build(:client).should be_valid
end
it "should not be valid without a name" do
Factory.build(:client, :name => nil).should_not be_valid
class Client
include DataMapper::Resource
property :id, Integer, :serial => true
property :name, String
property :email, String
property :city, String, :lazy => true
property :zip_code, String, :field => 'postal_code', :lazy => true
property :phone, String, :lazy => true
property :address, String, :lazy => true