This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
if saved = @act.add_participant(@current_person) | |
flash[:notice] = _('You are now participating in this action!') | |
else | |
flash[:notice] = @act.errors.full_messages.first | |
end | |
respond_to do |format| | |
format.html { redirect_to(@act) } | |
format.xml { head :ok } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title = content_tag(:h3, "#{_("Tags")}:", :class => "tags") | |
title << content_tag(:ul, links.map { |link| content_tag :li, link }, :class => "tags") | |
content_tag :div, title, :class => "tags" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
ATENÇÃO: os links estão ordenados alfabeticamente. Siga esta nomenclatura ao adicionar o seu. | |
--> | |
<h2>#horaextra</h2> | |
<ul id="blogroll"> | |
<li><a href="http://tapajos.me/?utm_campaign=horaextra">Marcos Tapajós</a></li> | |
<li><a href="http://rafael.adm.br/?utm_campaign=horaextra">Rafael Lima</a></li> | |
<li><a href="http://rafael.tauil.com.br/?utm_campaign=horaextra">Rafael Tauil</a></li> | |
<li><a href="http://ramonpage.com/?utm_campaign=horaextra">Ramon Bispo</a></li> | |
<li><a href="http://mergulhao.info/?utm_campaign=horaextra">Sylvestre Mergulhão</a></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// 1. Write a class to support the following code: | |
var Person = function(name) { | |
this.name = name; | |
} | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...F | |
Failures: | |
1) Task | |
Failure/Error: it { should have_scope(:by_due_at).order("due_at desc") } | |
Expected :by_due_at when called on Task scope to SELECT `tasks`.* FROM `tasks` ORDER BY due_at desc, got SELECT `tasks`.* FROM `tasks` ORDER BY due_at desc | |
# spec/models/task_spec.rb:9 | |
# spec/models/task_spec.rb:3 | |
Finished in 0.066 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.9.2@ideas mergulhao@darkstar:~/Desenvolvimento/ideas(master)$ rake stats | |
(in /Users/mergulhao/Desenvolvimento/ideas) | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Controllers | 97 | 83 | 2 | 10 | 5 | 6 | | |
| Helpers | 15 | 13 | 0 | 3 | 0 | 2 | | |
| Models | 74 | 58 | 1 | 12 | 12 | 2 | | |
| Libraries | 41 | 37 | 0 | 1 | 0 | 35 | | |
| Model specs | 253 | 231 | 0 | 1 | 0 | 229 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a token by looping and ensuring does not already exist. | |
def generate_token(column) | |
loop do | |
token = Devise.friendly_token | |
break token unless to_adapter.find_first({ column => token }) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3.0.10' | |
gem 'rake', '0.8.7' | |
gem 'mysql2', '~> 0.2.11' | |
group :development, :test do | |
gem 'integration', :git => 'git://github.com/mergulhao/integration.git' | |
gem 'rspec-rails', '2.6.1' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
railsapps@webby5973:~$ sudo gem list -r rails | |
*** REMOTE GEMS *** | |
ERROR: http://rubygems.org/ does not appear to be a repository | |
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) | |
too many connection resets (http://rubygems.org/yaml) | |
railsapps@webby5973:~$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alguém tem algum benchmark real de uma app que *em produção* apresentou ganho de performance ao migrar para ruby 1.9? A gente que gosta de tecnologia quer estar sempre no "cutting edge", mas ainda não vi nenhum bench convincente, posso apenas não ter procurado direito. Todas as minhas apps até hoje rodam em 1.8, exceto algumas estão rodando no Heroku, que estão no 1.9. | |
Segue a instalação do ruby 1.9 usando pacotes nativos do Ubuntu. Reparem que apesar do nome do pacote, a versão instalada é a 1.9.2, como pode ser visto no final. | |
==================================== | |
railsapps@webby5973:~$ sudo apt-get install ruby1.9.1-full | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following packages were automatically installed and are no longer required: |
OlderNewer