Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
Adman65 joined #ruby
chiel joined #ruby
<chiel>
hey guys, what is the recommended library for yaml, within ruby?
<heftig>
notbrent: sort the endpoints before you create a range
<heftig>
notbrent: 3..1 makes no sense
friskd joined #ruby
<heftig>
chiel: the standard library contains yaml, which uses either Psych (default) or Syck
<chiel>
heftig: ah okay, cool. Time to sniff up some documentation, then. :)
<felipegb>
notbrent, try reverse_each
<ryanf>
nah, that doesn't work still
<ryanf>
oh
<ryanf>
I guess you mean (1..3).reverse_each
<felipegb>
yeah
LittleBill902 joined #ruby
iocor joined #ruby
<notbrent>
thanks guys, that helps
tmart joined #ruby
skinnymuch joined #ruby
rsampaio joined #ruby
zedUNDginger joined #ruby
rsampaio joined #ruby
ziggles joined #ruby
eerdogan_ joined #ruby
friskd joined #ruby
rsampaio joined #ruby
jtrudeau joined #ruby
mytec joined #ruby
dasfugufish joined #ruby
rsampaio joined #ruby
Ballresin joined #ruby
<Ballresin>
New to ruby, trying to get it installed and running on CentOS, but RubyGems is giving me an error when running Setup.rb.
ryanf joined #ruby
aj910martin joined #ruby
aj910martin left #ruby
<cableray>
Ballresin: Use rvm?
<cableray>
rvm.beginrecueend.com
<Ballresin>
I see that… investigating.
<Ballresin>
Looks (to a newb) like ruby moves all of the ugly out of the language, and into the install.
Banistergalaxy joined #ruby
peterwald joined #ruby
tayy joined #ruby
cbuxton joined #ruby
tayy_ joined #ruby
macmartine joined #ruby
yekta joined #ruby
apeiros_ joined #ruby
aj910martin joined #ruby
igotnolegs joined #ruby
xol joined #ruby
looopy joined #ruby
robinhoode joined #ruby
Ballresin left #ruby
ikaros joined #ruby
lupine_85 joined #ruby
Targen joined #ruby
tayy joined #ruby
araujo joined #ruby
robotmay joined #ruby
aj910martin joined #ruby
ryanf joined #ruby
rushed joined #ruby
LittleBill902 joined #ruby
sullx joined #ruby
nokada_ joined #ruby
sdavis joined #ruby
res0nat0r joined #ruby
n0kada joined #ruby
looopy joined #ruby
aj910martin joined #ruby
LittleBill902 joined #ruby
nokada___ joined #ruby
steph021 joined #ruby
savage- joined #ruby
nokada joined #ruby
zedUNDginger joined #ruby
sythe joined #ruby
chessguy joined #ruby
brianherman joined #ruby
nokada__ joined #ruby
ikaros joined #ruby
nokada___ joined #ruby
sdavis joined #ruby
elevenarms joined #ruby
Skaag joined #ruby
yekta joined #ruby
Draco_ joined #ruby
dhruvasagar joined #ruby
Draco_ joined #ruby
LittleBill902 joined #ruby
ira joined #ruby
looopy joined #ruby
<ira>
hey
dotnull joined #ruby
nanoyak joined #ruby
aj910martin joined #ruby
nokada_ joined #ruby
nokada_ joined #ruby
nokada__ joined #ruby
ryanf_ joined #ruby
GreaseMonkey joined #ruby
looopy joined #ruby
dyer joined #ruby
nokada_ joined #ruby
dankest joined #ruby
thone joined #ruby
EYES_ joined #ruby
crescendo_ joined #ruby
sdavis joined #ruby
jay_zawrotny joined #ruby
IrishGringo joined #ruby
nokada__ joined #ruby
gregorz joined #ruby
nanoyak joined #ruby
tayy_ joined #ruby
jbmsegundo joined #ruby
sdavis joined #ruby
ira joined #ruby
sdavis joined #ruby
looopy joined #ruby
gischy joined #ruby
zedUNDginger joined #ruby
ryanf joined #ruby
skinnymuch joined #ruby
sorin joined #ruby
closedbracket joined #ruby
x0F_ joined #ruby
jbmsegundo joined #ruby
Asher joined #ruby
Skaag joined #ruby
tshauck joined #ruby
dankest joined #ruby
rbright joined #ruby
rbright joined #ruby
rsampaio joined #ruby
gayasentinel joined #ruby
Know1edge joined #ruby
rpowell joined #ruby
aj910martin joined #ruby
elliottcable joined #ruby
Draco_ joined #ruby
randym joined #ruby
amacgregor joined #ruby
tayy joined #ruby
dankest joined #ruby
tmart joined #ruby
mxweas_ joined #ruby
LittleBill902 joined #ruby
LittleBill902 joined #ruby
LittleBill902 joined #ruby
aj910martin joined #ruby
pen joined #ruby
sdavis joined #ruby
mateusprado joined #ruby
macmartine joined #ruby
Beoran__ joined #ruby
mxweas_ joined #ruby
LittleBill902 joined #ruby
xol joined #ruby
prtksxna joined #ruby
Draco_ joined #ruby
xol joined #ruby
mateusprado left #ruby
mateusprado joined #ruby
h4mz1d joined #ruby
Doppp joined #ruby
Doppp left #ruby
__class__ joined #ruby
otakutomo joined #ruby
looopy joined #ruby
LittleBill902 joined #ruby
kuzushi joined #ruby
rpowell joined #ruby
disappearedng joined #ruby
<disappearedng>
If I want to map :<label> to a bunch of objects, what do I do?
<ryanf>
use a hash
<ryanf>
h = {:label => [obj1, obj2, obj3]}
BrianJ joined #ruby
<disappearedng>
? what do yo umean ryanf
<disappearedng>
cool didn't know that could work
<ryanf>
I don't know, if that isn't the answer, you could reword the question to be more specific
<austinbv>
zedUNDginger: the point is more to teach people how to thing with tests, not to take advantage of the ruby library
<austinbv>
most the people I work with don't know ruby and I like that because then instead of focusing on syntax they focus on the idea of how to test
bluOxigen joined #ruby
akem joined #ruby
<RubyPanther>
testing is for QA monkeys
xpot joined #ruby
<zedUNDginger>
RubyPanther: oh hey buddy i heard you got banned from #ruby-lang is that true?
<swarles>
Can anyone explain to me what I am doing wrong with passing the block?
<ryanf>
@@_@@
<ryanf>
you don't want a comma there
<ryanf>
you might have to put parens around 'test' too
<ryanf>
but blocks aren't part of the arg list, they're after it
<swarles>
oh, ok
<ryanf>
unrelatedly, you probably want ivars instead of class vars
michael_mbp_ joined #ruby
<shevy>
@@_@@ <--- should become class var syntax
<shevy>
then noone would use them anymore
<swarles>
oh, im aiming to make the perl sub {} type declaration so you can so things like shift and unshift, so, unless there is a way to get the id of the Proc it is called from then i dont know of a better way :< i suppose i could make each an a=object, but i was aiming for the subs to just be declared
<shevy>
sub {} just makes a function in perl or?
<swarles>
yeah
<swarles>
but its like using a splat for the arguments list in the def. you can use shift to pull arguments
<swarles>
subroutine(arg1, arg2, arg3); using shift inside its definition would return arg1 and calling it again would return arg2 and so on
<spinagon>
just use splat?
<ryanf>
swarles: you can just define a method with *args and then do args.shift if you want to
yxhuvud joined #ruby
<shevy>
a perl convert :)
<swarles>
oh, well i feel silly ^-^
michael_mbp_ joined #ruby
michael_mbp joined #ruby
michael_mbp_ joined #ruby
Skaag joined #ruby
peterwald left #ruby
Telling joined #ruby
michael_mbp_ joined #ruby
Dreamer3 joined #ruby
xol joined #ruby
pen joined #ruby
My_Hearing joined #ruby
Asher joined #ruby
michael_mbp_ joined #ruby
wyhaines joined #ruby
_bat joined #ruby
angerman joined #ruby
adambeynon joined #ruby
michael_mbp_ joined #ruby
Aaaarg joined #ruby
michael_mbp_ joined #ruby
rpowell joined #ruby
tvo joined #ruby
tvo joined #ruby
rpowell joined #ruby
Skaag_ joined #ruby
michael_mbp_ joined #ruby
pantsman joined #ruby
pantsman joined #ruby
Skaag_ joined #ruby
randym joined #ruby
jorum joined #ruby
LouisJB joined #ruby
apeiros_ joined #ruby
randym_ joined #ruby
senny joined #ruby
pen joined #ruby
gener1c joined #ruby
<gener1c>
hey , i made a little script and i want to find out howmuch b/w it consumes in one run
<gener1c>
is there an easy way to do it?
EddieBluh joined #ruby
<Seventoes>
iptraf
tatsuya_o joined #ruby
<gener1c>
ok
<gener1c>
is that a ruby lib or a util
<gener1c>
ok installing it
pen joined #ruby
Indian joined #ruby
Manhose_ joined #ruby
prtksxna joined #ruby
ikaros joined #ruby
<Seventoes>
nope, just a command line tool
<Seventoes>
unrelated to ruby
iband joined #ruby
<gener1c>
well i have several ips
<gener1c>
and each ip has several connections that close
<gener1c>
for each get request it makes a new connection
<gener1c>
over http
samxor joined #ruby
maxok joined #ruby
voxel joined #ruby
fermo joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
otakutomo joined #ruby
xol joined #ruby
pencilcheck joined #ruby
Tuxist joined #ruby
aidan joined #ruby
<aidan>
Can I ask heroku questions in here? Where am I supposed to store static files permanently on heroku?
eldariof joined #ruby
<Seventoes>
#heroku i think
<aidan>
Yeah, that channel is useless :/
raincole joined #ruby
<aidan>
I think I may give up on Heroku.
<Seventoes>
usually static files go in public/
Manhose joined #ruby
Locke23rus joined #ruby
<apeiros_>
Seventoes: in rails, they nowadays go to app/assets
<Seventoes>
ah
iocor joined #ruby
voxel joined #ruby
tobago joined #ruby
rpowell joined #ruby
Manhose_ joined #ruby
Asher joined #ruby
adambeynon joined #ruby
Manhose joined #ruby
robotmay joined #ruby
voxel joined #ruby
senny joined #ruby
voxel joined #ruby
Foxgirl3 joined #ruby
voxel joined #ruby
pencilcheck joined #ruby
zmanfx joined #ruby
pen_ joined #ruby
voxel joined #ruby
derailed joined #ruby
<derailed>
quick question: Is there a specific framework dedicated for building rest API's in RUBY? That has OAUTH out of the box?
xol joined #ruby
Adman65 joined #ruby
sdavis joined #ruby
philcrissman joined #ruby
Mchl joined #ruby
chessguy joined #ruby
flexd joined #ruby
flexd joined #ruby
pen_isident joined #ruby
Manhose joined #ruby
ph^ joined #ruby
kirun joined #ruby
grekko joined #ruby
flexd joined #ruby
tayy joined #ruby
sdavis joined #ruby
flexd joined #ruby
zastaph joined #ruby
pen_isident_ joined #ruby
moshef joined #ruby
shevy joined #ruby
poindontcare joined #ruby
skammer joined #ruby
Draco_ joined #ruby
tayy joined #ruby
kennethreitz joined #ruby
Tuxi joined #ruby
lupine_85 joined #ruby
RomD` joined #ruby
tk__ joined #ruby
Mighty_ joined #ruby
mengu joined #ruby
austinbv joined #ruby
Targen joined #ruby
mateusprado joined #ruby
emmanuelux joined #ruby
skammer joined #ruby
Sliker joined #ruby
tayy joined #ruby
amacgregor joined #ruby
Draco_ joined #ruby
mateusprado left #ruby
skydiver joined #ruby
Jake232 joined #ruby
skydiver left #ruby
mikepack joined #ruby
tayy_ joined #ruby
sdavis joined #ruby
tayy joined #ruby
sdavis joined #ruby
burgestrand joined #ruby
<pen>
is it possible to use pg gem and convert the results from exec to yaml?
<pen>
or json?
chiel left #ruby
sdavis joined #ruby
bosphorus joined #ruby
<apeiros_>
pen: sure
<pen>
apeiros_: how?
<pen>
got some errors
<pen>
what gem do I need to require?
<apeiros_>
the json gem for json, and no gem for yaml (you can use the yaml gem to get the newest version of psych, though)
<apeiros_>
and of course some gem to interface pg
<apeiros_>
probably ruby-pg
<pen>
apeiros_: yea, that's that one i'm using, gem pg
skammer joined #ruby
malkomalko joined #ruby
Indian joined #ruby
trivol joined #ruby
kartouch joined #ruby
zedUNDginger joined #ruby
BrianJ joined #ruby
Cervajz joined #ruby
Russell^^ joined #ruby
heftig joined #ruby
chessguy joined #ruby
Cervajz joined #ruby
sdavis joined #ruby
Targen joined #ruby
Lord-Harlot joined #ruby
CannedCorn joined #ruby
bier joined #ruby
bier|tp joined #ruby
burgestrand joined #ruby
fermo joined #ruby
advorak joined #ruby
tayy joined #ruby
jorum joined #ruby
Jake232 joined #ruby
igel joined #ruby
LouisJB_ joined #ruby
<igel>
Hiya. Is there a visitor pattern library for file systems?
<igel>
That is: I want to be called for each file somewhere in a subtree of my file system.
countskm joined #ruby
<apeiros_>
o0
<apeiros_>
you want Dir::glob ?
savage- joined #ruby
Jake232 joined #ruby
tmart joined #ruby
<apeiros_>
igel?
eeadc joined #ruby
flip_digits joined #ruby
<igel>
apeiros_: yes, you're right, that's what I want.
Jake232 joined #ruby
chessguy joined #ruby
<shevy>
omg
<shevy>
IT IS A SWISS INVASION!!!
<shevy>
Igel, Hase, Schildkr�te
<igel>
We don't invade. We invite others, to join our confederation.
<countskm>
igel - is it true before becoming a citizen the whole neighborhood interviews you?
mickn joined #ruby
memiux joined #ruby
austinbv joined #ruby
<igel>
countskm: They keep changing those rules. And they may depend on where you live. But yes, it does happen that your village gets to vote on your citizenship application.
<countskm>
thought that was interesting - i guess if u are living w/ them u should have a vote :-)
<Norrin>
sounds like "pattern recognition" in silicon valley
dcarper joined #ruby
<apeiros_>
oh, igel is indeed in CH
<shevy>
yeah
<_axx>
can someone tell me, what class << self mean in a module? :)
skim1776 joined #ruby
<shevy>
I am sure he is tasked with defending the land using his spikes
<apeiros_>
_axx: it means "open the eigenclass of self", everywhere
<apeiros_>
not just in a module
<skim1776>
are there any other package management systems in ruby rather than rubygems?
<apeiros_>
and "self" can be any variable, really
<_axx>
apeiros_: thank you!
<apeiros_>
hm, s/eigenclass/singleton_class/, after all, it seems ruby-core settled on that term
atmosx joined #ruby
atmosx left #ruby
<countskm>
i prefer casper the ghost
sdavis joined #ruby
felipegb joined #ruby
closedbracket joined #ruby
fritzthecat_ joined #ruby
skim1776 left #ruby
pantsman joined #ruby
pantsman joined #ruby
bpfh joined #ruby
dagnachewa joined #ruby
jonathanrwallace joined #ruby
sdavis joined #ruby
iband joined #ruby
pace_t_zulu joined #ruby
<pace_t_zulu>
hi all
<pace_t_zulu>
i have an array of strings
<rippa>
congrats
<pace_t_zulu>
is there a good one liner to prepend a "#" to each string in the array?
<pace_t_zulu>
rippa: thanks
Aaaarg joined #ruby
<yfeldblum>
array_of_strings.map{|s| "##{s}"}
<pace_t_zulu>
yfeldblum: thanks, seriously though
<yfeldblum>
?
<pace_t_zulu>
yfeldblum: and that will return the same array but with a "#" in front of each string ...
<rippa>
it will return new array
<apeiros_>
igel: you don't see or just don't respond to private messages?
<rippa>
with a "#" in start of each string
<pace_t_zulu>
yfeldblum: i was remarking on the fact that i was seriously thanking you ... as opposed to my sarcastic thanks to rippa's sarcastic congrats
<igel>
apeiros_: i see them, but i'm not sure how to respond in private in lime chat.
<yfeldblum>
ah
<pace_t_zulu>
rippa: thank you ... not sarcastically this time :D
<apeiros_>
igel: you click there, and send as if you were in a channel
<yfeldblum>
that will return a new array containing new strings; it will not update the existing array nor update the existing strings
<pace_t_zulu>
yfeldblum: that bot is live in #unbuntu
<cantonic>
apeiros: i have created datepicker fields for minDate and maxDate and want to update HighCharts via Ajax… well it is more complicated than I thought...
benja-M-__ joined #ruby
sorin joined #ruby
<cantonic>
apeiros_: May I ask where you are using HighCharts? cause you said "WE use it"
sdavis joined #ruby
<apeiros_>
in the company I work for
macmartine joined #ruby
IrishGringo joined #ruby
Spockz joined #ruby
<shevy>
swiss chocolate on rails!!!
<cantonic>
apeiros_: I assume that you have integrated it with Rails. Is there any example on how you did it?
<apeiros_>
cantonic: not public code, sorry
<cantonic>
apeiros_: oh i see. no problem :)
jonathanrwallace joined #ruby
_bat joined #ruby
beakerman joined #ruby
TheNumb joined #ruby
jonathanrwallace joined #ruby
cassarani joined #ruby
<cassarani>
hi all - I have a hash, like { foo: foo, bar: bar }, and I need to call to_json on it to send it off over the network
<cassarani>
however, bar is already a JSON string
<cassarani>
is there any way I can say "leave bar alone"? sort of like html_safe in Rails
<cassarani>
short of calling JSON.parse obviously, which I'd like to avoid
trivol joined #ruby
<apeiros_>
cassarani: def bar.to_json; self; end; end # something like that might work
<cassarani>
wow, eigenclass.. that's clever!
<cassarani>
that's really clever.
* apeiros_
does the clever-dance
<cassarani>
let's see..
<cassarani>
except it doesn't seem to work.. unless the string is being copied at some point
<apeiros_>
seems you need to define it as to_json(*), not just to_json
<apeiros_>
work here…
<cassarani>
didn't know it took options
<cassarani>
by the way you do have one `end` too many in that line of code, don't you?
<apeiros_>
you may be using one of the many different json implementations. afaik there's quite a couple of 'em around
<cassarani>
I'm just using the one that comes with Ruby 1.9.2 and Rails 3.1.1
<cassarani>
or 3.1.0 in fact
<cassarani>
anyway I think it is working, I just got confused
<cassarani>
because I kept seeing escaped quotes and I thought that meant it hadn't worked but of course if it hadn't then it would have had double escaped quotes
<Mon_Ouie>
Use both puts and p in those cases
<Mon_Ouie>
So you can compare
<apeiros_>
you can make it clean: module JSON::Safe; def to_json; self; end; end; class String; def json_safe; extend JSON::Safe; end; end
<cassarani>
yeah I'm using puts message.inspect right now
<cassarani>
I'll try them both
dbgster joined #ruby
<apeiros_>
so now you can do: {foo: bar.json_safe}.to_json
<shevy>
sometimes I'd wish code would be alive
<shevy>
that way I could stab a knife at it
<cassarani>
apeiros_: that's actually quite neat
<apeiros_>
shevy: you don't. it'd hit you with a stick all the time!
<shevy>
hmm
<apeiros_>
gotta go
<cassarani>
I'd love to be able to say json = blahblah(...).json_safe
<apeiros_>
cya guys
<cassarani>
thanks a lot for the help
<shevy>
json blah?
<apeiros_>
shevy.blah? # => true
<apeiros_>
:-p
<shevy>
you have to go!
<shevy>
let me take over #ruby ...
<shevy>
HI EVERYONE
<apeiros_>
there you go…
<shevy>
Today we shall learn more about ...
<shevy>
lambda
<shevy>
I expect the class to google useful information on lambda, and share it with the rest of the class on #ruby
sdavis joined #ruby
pace_t_zulu left #ruby
Brozilla joined #ruby
<zastaph>
whats the best page that explains map and its possibilities? perhaps visually
<Amirh>
I downloaded gem. Then I installed it.(sudo ruby setup.rb). after that I wanted to install rails.(sudo gem install rails). when I click Enter. nothing would happen unless the cursor shifted to a line below.
<zastaph>
i get thats what map does, but it does it in many ways :)
<shevy>
zastaph I am not sure what you mean with many ways, it just applies what is inside the {} on each element
jbpros joined #ruby
Guest69322 joined #ruby
james_cotterill joined #ruby
<zastaph>
think I got it :)
adeponte joined #ruby
dcarper joined #ruby
sriprasanna joined #ruby
poisonarms_ joined #ruby
<zastaph>
but still can't quite figure what I want to acheive.. I have a "types" table with id and name .. 0 = "generic", 1 = "ruby", 2 = "rails" .. so if say I have another table that use that as foreign key .. languages.type_id .. in my code I would like to write: if (language.type_id = types[:rails]) instead of = types[2] .. using symbolize_keys! and dynamically retrieving the values from db
<zastaph>
sqlite3
<zastaph>
so something like @types = db.execute("SELECT * FROM types").map ...
james_cotterill joined #ruby
jrist joined #ruby
josemota joined #ruby
huxleyd joined #ruby
poisonarms_ joined #ruby
Russell^^ joined #ruby
moshef joined #ruby
burgestrand joined #ruby
Guest69322 left #ruby
<poisonarms_>
Anyone know a decent site to find job postings for Ruby?
sdavis joined #ruby
Amirh joined #ruby
jbmsegundo joined #ruby
<cassarani>
poisonarms_: where are you based?
<poisonarms_>
cassarani: I'm in VA, but I'd prefer seeing jobs anywhere at all, relocating isn't a problem for a great job.
<cassarani>
also, since you're based in the States I'd recommend Top Ruby Jobs, too http://toprubyjobs.com/
<poisonarms_>
Thanks.
<cassarani>
Amirh: huh?
<yann2>
hello! I have two hashes and am looking for a solution to join them together... any idea how I could do that? google is not helping, or I'm using the wrong keywords :(
<Amirh>
cassarani: I want to work with rails but localhost dosen't work
<poisonarms_>
Amirh: Perhaps you want the channel #ror
<Amirh>
poisonarms_: thans
djdb joined #ruby
bpfh joined #ruby
<cassarani>
yann2: Hash#merge
<cassarani>
assuming that's what you're asking
<yann2>
mmmh, that might be it, thanks
tayy_ joined #ruby
jtrudeau joined #ruby
sdavis joined #ruby
mdel joined #ruby
kirun_ joined #ruby
sdavis joined #ruby
sdavis joined #ruby
sdavis joined #ruby
steph021 joined #ruby
steph021 joined #ruby
sdavis joined #ruby
sdavis joined #ruby
sdavis joined #ruby
sythe joined #ruby
sdavis joined #ruby
EddieBluh joined #ruby
sorin joined #ruby
jasim joined #ruby
tightwork joined #ruby
samhans joined #ruby
<tightwork>
Hi. Newb quest Could someone tell me exactly what I am getting returned here .. when I do @posts.new and get @params = {"var" => foo} @other ={"var1"=>foo1} ? How can I access params.var and other.var1 ? This appears to be an array of instance variables.
<jasim>
@tightwork The question isn't very clear to me. What is @posts? Is it some kind of an ActiveRecord array?
<jasim>
@tightwork Try @params["var"] (considering @params is a Hash)
<tightwork>
Yes, I did ask in #RubyOnRails, no reply :-D
<josemota>
hey guys, why do I get an `uninitialized constant Article::ERB` in this code? http://pastie.org/2929458
akem joined #ruby
<jasim>
@josemota You've included ERB as a Gem I presume?
samhans left #ruby
awesome joined #ruby
awesome_ joined #ruby
<tightwork>
jasim: I get NoMethodError Exception: You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[] ... btw I'm doing this from rdb of the running program.
<jasim>
@josemota require 'erb' might work. But if this is a project that uses Bundler, include it in Gemfile and you're set.
<josemota>
jasim: It did work before I started messing with Bundler.
<josemota>
let me check that.
<jasim>
@tightwork What code gave you this error?
<tightwork>
jasim: @params['response_reason_text'] I can @order.auth and get: #<ActiveMerchant::Billing::Response:0x7f335ea16c68 @params={"response_reason_text"=>"A duplicate transaction has been submitted.", ...
<josemota>
@jasim I should put the erb gem in the Gemfile right=
<josemota>
?
<josemota>
because I get an error when `bundle install`ing
dotnull joined #ruby
<jasim>
@josemota Ouch, I think I made a mistake. ERB is a part of core Ruby
<josemota>
@jasim true.
<josemota>
should I just require it from somewhere?
<jasim>
@josemota I think doing an explicit require 'erb' above the Article class should do it.
<jasim>
@josemota Yes.
<josemota>
jasim: ok. thank you very much! have a good one.
Morkel joined #ruby
<jasim>
@tightwork If you are trying to use @params from inside an IRB terminal, it would raise the error.
<jasim>
@tightwork params in Rails is usually given by the controller.
<tightwork>
mmm
<jasim>
@tightwork Also I've never used ActiveMerchant so I might be missing something.
zenergi joined #ruby
sdwrage joined #ruby
Knodi joined #ruby
tatsuya_o joined #ruby
beakerma_ joined #ruby
ohookins joined #ruby
notbrent joined #ruby
axl_ joined #ruby
tomzx joined #ruby
atmosx joined #ruby
savage- joined #ruby
tshauck joined #ruby
<raz>
can anyone think of a way to hash a class-body to later verify whether the class has been modified? (methods changed or such)
sdwrage joined #ruby
luckyruby joined #ruby
<atmosx>
raz if you convert the entire class body in a raw its easy
lolsuper_ joined #ruby
lolsuper_ joined #ruby
amacgregor_ joined #ruby
iocor joined #ruby
canuck3141 joined #ruby
poisonarms_ left #ruby
luckyrub_ joined #ruby
james_cotterill joined #ruby
kaneda joined #ruby
tatsuya_o joined #ruby
apeiros_ joined #ruby
lkba joined #ruby
ryanf joined #ruby
skim1776 joined #ruby
jbpros joined #ruby
ohookins joined #ruby
<atmosx>
any1 alive?
<atmosx>
how do I tell optparse to handle the options at the end of a command line ? (not hte flags)
cyri_ joined #ruby
closedbracket joined #ruby
dasfugufish joined #ruby
luckyruby joined #ruby
<ohookins>
hi, i want to test a ruby script which has directives in the top scope, but without them being called when i require the file in my rspec test
<ohookins>
is there a way to do this?
luckyrub_ joined #ruby
<ryanf>
atmosx: I think those remain in ARGV after you use optparse, don't they? you probably need to handle them yourself
zbrown joined #ruby
<atmosx>
ryanf: hmm yes, they do. Thanks
<atmosx>
I'm getting a bit paranoid with optparse and multiple option handling...
<atmosx>
heh I can find pictures of police beating journalists because they are doing their jobs outside the Greek parliament
<atmosx>
shellox: you don't pay me, believe me. You pay your bankers indirectly.
<shellox>
there is a good creme, so the pepper spray doesnt hurt that much
<shellox>
atmosx: this whole EU turned into crap
<raz>
i love the green sushi sauce
<atmosx>
shellox: I agree, but the country who profited the most is Germany, out of this EU crap :-)
<raz>
pepper spray can't faze me
Jb joined #ruby
<shellox>
atmosx: sure, because we are an export country
<yfeldblum>
sorry, that's what happens when a group of countries vote themselves into socialism
<atmosx>
shellox: add to that, the fact that you country defaulted 3 times in the past century and get away with it twice, especially the 3rd without paying aything and you have an 'economic miracle'
<atmosx>
shellox: yes, and because someone gets credit to buy your products from your banks
<atmosx>
yfeldblum: id youf self, and define socialism...
kedare joined #ruby
<raz>
someone tell those fucktards that i WOULD buy the movies if they'd let me
<atmosx>
raz: because we all like them too!
<shellox>
quartz sand handshoe, yay!
<raz>
shellox: free hugs!
<atmosx>
raz: same here, … really :-(
<atmosx>
ah too bored to continue optarsing...
<raz>
atmosx: and it's not like a days difference. the stuff is on the bay months before apple gets it.
<yfeldblum>
the EU is the latest result of the European countries shifting in their political outlooks, over the centuries, towards a secular collectivism and statism
<atmosx>
I don't get it either to tell you the truth, although I use demonoid and other private torrents
<atmosx>
statism?
<atmosx>
yfeldblum: really? is that what the crisis is about, statism?
<atmosx>
yfeldblum: So, you don't have an example of free market economy right?
<shellox>
here a video
<shellox>
security portects police and police attack them
igotnolegs joined #ruby
<atmosx>
shellox: hahah cool
JumpMast3r joined #ruby
<atmosx>
everybody seems to love the police these days
<shellox>
it turned into sport :)
<shellox>
to hunt the police
<shellox>
no respect for them
Dyscrete joined #ruby
<atmosx>
oh fuck them, they're considered criminals in Greece. They put police officers on protestor lines to cause accidents and justify their attacks on unarmed people
<atmosx>
and they are not even good at propaganda anymore
<shellox>
atmosx: thats sick..
Radar_ joined #ruby
<shellox>
the cops attacked the hells angels in germany in 2006, because they thought they was hooligans
<atmosx>
Well, we have a special force which goes against rioters, which is composed of largely fascists or mentaly unstable personel. Otherwise you don't choose a position where your job is to beat up people. Often women and aged people.
<atmosx>
So, in Greece being a police officer these days means having very specific friends because no one wants you near.
awesome_ joined #ruby
dotnull joined #ruby
jgrimes joined #ruby
<shellox>
atmosx: we should build an anti cop website :P
<ReachingFarr>
So one of my projects has a class with a class method called `rule`. When I try and use Rake to run my test cases I get this error: `WARNING: DSL method Class#rule called at <file:line>` Does anyone know how to get Rake to stop auto loading this Rake::DSL module?
tschundeee joined #ruby
Boohbah joined #ruby
Boohbah joined #ruby
emmanuelux joined #ruby
sdavis joined #ruby
rickmasta joined #ruby
<pen>
how do I do ruby one line if else?
sdwrage joined #ruby
james_cotterill joined #ruby
<Mon_Ouie>
if a then b else c end
<Mon_Ouie>
a ? b : c
<Mon_Ouie>
Or stop hating new-lines
awesome__ joined #ruby
marcuspat joined #ruby
<pen>
Mon_Ouie: a ? b : c doesn't work, ruby complains something with keyword_end
<pen>
Mon_Ouie: I did this d = (a ? b : c)
<Mon_Ouie>
That works fine
<pen>
but I don't know why it is not working for me
<tightwork>
Dyscrete: I think either adobe streaming server or h264 over rtsp
<Mon_Ouie>
end is a keyword, it can't be used as a variable name
<Mon_Ouie>
Use something like stop instead
<pen>
Mon_Ouie: oh
<Dyscrete>
tightwork: thanks, does this stream in chunks?
<pen>
Mon_Ouie: lame
libertyp1ime joined #ruby
<pen>
yea forgot about that :\
<Mon_Ouie>
Also I'd just do start = … if params[:start]
<Mon_Ouie>
And drop the redundant to_s
<tightwork>
Dyscrete: I believe so. Rather than like youtube where it loads the entire video whether you play it or not.
<Dyscrete>
yes thanks, just what I was looking for
ph^ joined #ruby
Silker joined #ruby
AngerNESS joined #ruby
AngerNESS joined #ruby
<cantonic>
hey guys. i have a format problem. i have @browsers which contains => #<OrderedHash {"Safari"=>1, "Firefox"=>1}> and I need to output it in this format: [["Firefox",1], ["Safari",1]]
<cantonic>
how can I achieve that?
<cantonic>
I already tried @browsers.to_a and @browsers.to_a.to_json but they seem not doing what I want
trivol joined #ruby
dv310p3r joined #ruby
canuck3141 joined #ruby
<Dyscrete>
@browsers.to_h.to_a
<Dyscrete>
may work
skim1776 left #ruby
Balgan joined #ruby
<cantonic>
Dyscrete: @browsers.to_h raises a NoMethodError
<cantonic>
Dyscrete: @browsers is already a hash
bpfh joined #ruby
Sliker joined #ruby
<cantonic>
the problem is that i need it for a jquery graph (called HighCharts). and it needs the data to be printed like [["foo",4],["bar",5]]
<apeiros_>
which is often not what you want when you want to look at datastructures.
<cantonic>
apeiros_: also tried .inspect but is not working :(
<cantonic>
i will try to_json again...
<apeiros_>
cantonic: ever considered it might html-unsafe chars in it?
Axsuul joined #ruby
<apeiros_>
you see if you use html to output raw stuff you should escape it…
<cantonic>
apeiros_: when doing to_json it should escape automatically
<apeiros_>
cantonic: NO
<apeiros_>
you're getting a RUBY OBJECT back
<apeiros_>
even from to_json
<apeiros_>
and json is NOT html either
<cantonic>
look what I get when doing to_a.to_json: [["Firefox",1],["Safari",1]]
Sliker_ joined #ruby
ethndbst joined #ruby
<Dyscrete>
it's quotes are encodd
<Dyscrete>
encoded
<Dyscrete>
for html
<cantonic>
apeiros_; i actually need that for HighCharts (yeah, still struggling around ;) ) and i have other data for visitors for example where I just did a to_json and it worked. But the data for visitors only contain Integers like [[223423423, 3],[352452, 6]] and so on
<cantonic>
Dyscrete: how can i avoid that?
<apeiros_>
if you emit it to html, you do not want to avoid that
<apeiros_>
you want it to be that way
<apeiros_>
because that way the browser can display it correctly
muzzle_fuzzle joined #ruby
<cantonic>
apeiros_: no, that is not how i need it. that breaks my chart becuase of the " in there
daidoji joined #ruby
mxweas_ joined #ruby
<cantonic>
i know what you mean and you are right. there in my case to_json is not the correct function
<Dyscrete>
cantonic
<muzzle_fuzzle>
hi there , could someone help me please? i have tried to run siriproxy on windows, and now i have a problem in my gem file or i dont know :/ this is what i get when i would "bundle install" https://gist.github.com/1398073
<Dyscrete>
are you printing it through erb or something?
<cantonic>
Dyscrete: yes
<cantonic>
it is a js.erb where i am using it
ohookins left #ruby
<moshee>
why not to_a.to_s
<Dyscrete>
<%= raw @browsers %>
<Dyscrete>
or <%= raw @browsers.to_a.to_json.to_s %>
bosphorus joined #ruby
marknyc joined #ruby
<cantonic>
moshee: i tried. that just returns Firefox1Safari1
felipegb joined #ruby
<cantonic>
Dyscrete: hmm… that raw method is new to me. let me try...
marknyc joined #ruby
Jake232 joined #ruby
jay_zawrotny joined #ruby
<moshee>
your object is OrderedHash, not Hash
<moshee>
could be some weird things
<Dyscrete>
erb automatically escapes with h, to protect you from XSS and such
mickn joined #ruby
<Dyscrete>
moshee: I mentioned that, but it has the same result with to_a on a hash
<moshee>
oh
_bat joined #ruby
<cantonic>
YES! <%= raw @browsers.to_a.to_json.to_s %> works :)
<cantonic>
but the chart is still not displayed :D haha
p1d_ joined #ruby
gregorz joined #ruby
<cantonic>
thank you very much guys for your help and your patience!
<Dyscrete>
anytime cantonic ;)
LittleBill902 joined #ruby
<cantonic>
i hoped so much that this formatting stuff prevented the chart from being displayed but FAIL :D
burgestrand joined #ruby
_whitelogger joined #ruby
Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
austinbv_ joined #ruby
IrishGringo joined #ruby
dagnachewa joined #ruby
ikaros joined #ruby
sdwrage joined #ruby
macmartine joined #ruby
RubyIdiot joined #ruby
burgestrand1 joined #ruby
stepnem joined #ruby
iamjarvo joined #ruby
<sythe>
No space left on device - /tmp/RackRewindableInput20111127-506720-1q47vyh.lock
<sythe>
Can anyone help?
<sythe>
I know that I still have enough space
sepp2k1 joined #ruby
sdavis joined #ruby
RubyIdiot left #ruby
xybre joined #ruby
felipegb joined #ruby
rgrinberg joined #ruby
ryanf joined #ruby
sdavis joined #ruby
<shevy>
sythe sounds like a faulty error message then
<sythe>
....
<shevy>
checked the permissions too?
<sythe>
How can I fix it?
<sythe>
I get it in conjunction with a 500 error
Knodi joined #ruby
<sythe>
(chiliproject, aka Redmine)
sdavis joined #ruby
<sythe>
Could I have run out of inodes?
vmatiyko left #ruby
<shevy>
hehe
<sythe>
What?
<sythe>
(Yeah, I know that I'm a noob)
<shevy>
"I have run out of inodes" never heard that one before