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
Hello I am trying to install rails 3.0.0.beta3, when I run "gem install rails --pre" I get the following output: | |
Successfully installed rails-3.0.0.beta3 | |
1 gem installed | |
Installing ri documentation for rails-3.0.0.beta3... | |
ERROR: While executing gem ... (Errno::ENOENT) | |
No such file or directory - lib | |
When I run "rails -v" I get the following output |
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
CREATE TABLE IF NOT EXISTS `ofertas` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`id_parceiros` int(11) NOT NULL, | |
`data_inicio` datetime NOT NULL, | |
`data_termino` datetime NOT NULL, | |
`titulo` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | |
`destaques` text NOT NULL, | |
`regulamento` text NOT NULL, | |
`apresentacao` text NOT NULL, | |
`qtd_vendidos` int(4) DEFAULT NULL, |
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
function getValor($preco){ | |
$valor = explode("." , $preco); | |
$valor = implode($valor); | |
$valor = ereg_replace(",",".",$valor); | |
return $valor; | |
} | |
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
it "monta 8 itens" do | |
@gerador.should_receive(:monta_conteudo_item).with(instance_of(Item)).exactly(8).times | |
@gerador.gerar_html #linha 72 | |
end | |
Output: | |
monta 8 itens (FAILED - 1) | |
Failures: |
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
class PotenciaDeQuatro | |
attr_reader :valor | |
def initialize(valor) | |
@valor = valor | |
end | |
def succ | |
PotenciaDeQuatro.new(@valor*4) | |
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
class Classe | |
def initialize(hash) | |
hash.each do |chave, valor| | |
p "#{chave}: #{valor}" | |
end | |
end | |
end | |
c = Classe.new({:nome => "Enio", :sobrenome =>" Lopes"}) |
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
class Lala < AR::Base | |
def set_has_many_belongs_to_relation(ids) | |
relatio.collection_ids = ids | |
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
def teste(a) | |
p a.object_id | |
a = 20 | |
p a.object_id | |
end | |
b = 10 | |
teste b #=> 21\n41 | |
p b.object_id #=> 21 |
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
//egenda.js | |
var egenda = egenda || { | |
'construtores' : {}, | |
'comportamentos' : {} | |
}; | |
if(!('console' in window)){ | |
(function() { | |
var metodos = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", |
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
public static DocumentReader[] GetReaders() | |
{ | |
var db = new ReaderContainer(); | |
var readers = new List<DocumentReader>(); | |
foreach (var document in db.Documents) | |
{ | |
readers.Add(new DocumentReader(document)); | |
} | |
return readers.ToArray(); | |
} |
OlderNewer