Skip to content

Instantly share code, notes, and snippets.

View carlosbrando's full-sized avatar

Carlos Brando carlosbrando

View GitHub Profile
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
class MessagesBuilder
def initialize
@description = nil
@failure = nil
end
def description(arg = nil, &block)
@description = arg || block
end
# Should prepare a formatted link in the following format:
# <li><a href="#"><span>Texto</span></a></li>
#
def menu_item(text, url)
span = content_tag(:span, text)
link = link_to(span, url, options_for(url))
content_tag(:li, link)
end
1)
ArgumentError in 'Admin::ProductOptionTypesController GET index should == [#<Discount id: 14, value: 344, on_percentage: true, active: true, discountable_id: 7, discountable_type: "Product", starting_on: "2009-05-20 18:47:12", ending_on: "2009-05-22 18:47:12", created_at: "2009-05-21 18:47:12", updated_at: "2009-05-21 18:47:12">]'
Cannot yield from a Proc type filter. The Proc must take two arguments and execute #call on the second argument.
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:168:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:225:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:629:in `run_before_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:615:in `call_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_control
[carlosbrando:remarkable(master)]$ rake pre_commit
(in /Users/carlosbrando/Projects/github/remarkable)
cd /Users/carlosbrando/Projects/github/remarkable/remarkable
(in /Users/carlosbrando/Projects/github/remarkable/remarkable)
=> remarkable: rake spec
/Library/Ruby/Site/1.8/rubygems.rb:805:in `report_activate_error': Could not find RubyGem svenfuchs-i18n (>= 0) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:243:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:50:in `gem'
from /Users/carlosbrando/Projects/github/remarkable/remarkable/spec/../lib/remarkable/i18n.rb:68
[carlosbrando:remarkable(master)]$ rake pre_commit
(in /Users/carlosbrando/Projects/github/remarkable)
cd /Users/carlosbrando/Projects/github/remarkable/remarkable
(in /Users/carlosbrando/Projects/github/remarkable/remarkable)
=> remarkable: rake spec
Exemplo desativado: não deve conter os valores fornecidos
Example disabled: single contain
Example disabled: should contain the given values
Example disabled: should not contain the given values
Rails::Initializer.run do |config|
# ...
# Configure generators values. Many other options are available, be sure to
# check the documentation.
config.generators do |g|
g.orm :active_record
g.template_engine :erb
g.test_framework :test_unit, :fixture => true
# Exemplo do uso de rotas polimórficas para gerar a URL à partir
# da classe de um modelo
polymorphic_url(Comment) # é equivalente ao comments_url()
# => "http://example.com/comments"
(rdb:1) p "; "
SyntaxError Exception: compile error
/opt/local/lib/ruby/gems/1.8/gems/sociably-0.0.1/lib/sociably/renderable.rb:16: unterminated string meets end of file
(rdb:1) p "uma string normal"
"uma string normal"
(rdb:1) p "uma string com o sinal de ;"
SyntaxError Exception: compile error
/opt/local/lib/ruby/gems/1.8/gems/sociably_helpers-0.0.1/lib/helpers/javascript_helper.rb:86: unterminated string meets end of file