Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Aimonetti mattetti

View GitHub Profile
@mattetti
mattetti / gist:248
Created Jul 21, 2008 — forked from schacon/gist:1
my test fork!
View gist:248
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
View gist:5710
merb-gen app test
RubiGen::Scripts::Generate
undefined method `generator_scope' for Merb:Module
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/lib/merb-gen/base.rb:15:in `initialize'
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/app_generators/merb/merb_generator.rb:9:in `initialize'
/opt/local/lib/ruby/gems/1.8/gems/rubigen-1.3.2/lib/rubigen/lookup.rb:163:in `new'
/opt/local/lib/ruby/gems/1.8/gems/rubigen-1.3.2/lib/rubigen/lookup.rb:163:in `instance'
/opt/local/lib/ruby/gems/1.8/gems/rubigen-1.3.2/lib/rubigen/scripts/../scripts.rb:30:in `run'
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/lib/merb-gen.rb:19:in `run'
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/bin/merb-gen:72
View merb freezer
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
View i18n simple backend
| 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 |
View merb show routes merb -i
>> 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
View rake audit:routes
~ 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
View gist:7604
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"]
View gist:7620
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
View merb total dependencies
ependencies:
english
mongrel
erubis
json
mime-types
xml-simple
archive-tar-minitar
rubigen
rake
View ruby-search.ubiquity-command.js
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",