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
<disappearedng> wait that didn't work
<disappearedng> {:to_s => [1, 2,3] }
<ryanf> oh
<ryanf> are you looking for [1,2,3].map(&:to_s) ?
<disappearedng> ah yeah thanks
<disappearedng> def stringify_tags(lotags) lotags.map!(&:label)
gayasentinel joined #ruby
<disappearedng> so quick question, when I do map! do I actually mutatue whatever passes in the arguments? aka stringify_tags(@foo.tags)
mikepack joined #ruby
<disappearedng> or in functions in ruby function arguments are duplicated and pointed to another function stack
araujo joined #ruby
austinbv joined #ruby
<ryanf> map! will actually mutate the object
<ryanf> if you did lotags = lotags.map(&:label) it wouldn't leak though
<austinbv> I cannot figure out why the test at line 26 won't pass anyone have any idea https://gist.github.com/1397084
<zedUNDginger> austinbv: you didnt give the definition of List#equals
<austinbv> it's aliased
<austinbv> sorry that should have been in the gist
nanoyak joined #ruby
<austinbv> alias :equals :==
<zedUNDginger> austinbv: what's your native language?
<zedUNDginger> "campairing" is lolz
<austinbv> oh sorry it was a speed pair with bad internet
<austinbv> english, I just suck at it I guess
<austinbv> and actually! I didn't write that spec :P
<austinbv> 2 letters off thats an excusable mistype
<zedUNDginger> austinbv: it shoudl also be (0...size) or (0..(size - 1))
<austinbv> I think it should be size -1 but both fail
<austinbv> using a remote machine with bad internet is sucky
<zedUNDginger> austinbv: what is set? an array?
michael_mbp_ joined #ruby
<austinbv> yeah simple array I was trying to teach someone TDD
<austinbv> so we made a simple array wrapper that could do some unique stuff
<zedUNDginger> austinbv: then why not just go: set == list.set ?
<austinbv> I showed them how alias works
<austinbv> it just passed my :w weren't going through
<disappearedng> Hey for many to many do I have to manually create a table myself?
<austinbv> I have been tutoring students at my school on how to use TDD
<austinbv> and why they should
tuttlem joined #ruby
<austinbv> so I start with simple stuff they learn in datastructures and move up from there
<austinbv> disappearedng: for rails?
<disappearedng> yeah
discypher joined #ruby
<austinbv> rails g migration CreateUsersProductsJoinTable user_id:integer product_id:integer
discypher left #ruby
<austinbv> idk if that will actually create the full migration
<zedUNDginger> austinbv: or at least: set.zip(list) { |e1, e2| return false if e1 != e2 }; true
<zedUNDginger> *or at least: set.zip(list.set) { |e1, e2| return false if e1 != e2 }; true
apeiros_ joined #ruby
<austinbv> I like only using primitive stuff for teaching TDD zedUNDginger
<austinbv> since ruby has no traditional for loop I use Array#each with size
<austinbv> just like you would with a for loop
Lytol joined #ruby
Draco_ joined #ruby
<austinbv> disappearedng: you may need this in your migration https://gist.github.com/1397103
mxweas_ joined #ruby
<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?
jbmsegundo joined #ruby
JumpMast3r joined #ruby
adeponte joined #ruby
ryo84 joined #ruby
otakutomo joined #ruby
mengu joined #ruby
brownies joined #ruby
rippa joined #ruby
booginga joined #ruby
moshef joined #ruby
xol joined #ruby
michael_mbp joined #ruby
<swarles> can I use code blocks in a way like this? http://hpaste.org/54554
spinagon joined #ruby
<Mon_Ouie> return [name, block]
<ryanf> yeah, block is already a Proc
<swarles> oh
<swarles> ok, thanks. Wasn't sure how it was handled
michael_mbp_ joined #ruby
Hellojere joined #ruby
michael_mbp_ joined #ruby
jbpros joined #ruby
nanoyak joined #ruby
Seisatsu joined #ruby
moshef_ joined #ruby
xol joined #ruby
moshef joined #ruby
stepnem joined #ruby
<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
JStoker joined #ruby
aidan left #ruby
<yfeldblum> array_of_strings.each{|s| s.insert(0, "#")}
<pace_t_zulu> and the other thing i'm trying to do is test if a string exists in an array of strings ... with a one liner ... here is what i've got
<apeiros_> s[0,0] = '#'
<yfeldblum> that will update the existing strings
<yfeldblum> array_of_strings.include?(string_to_check)
<pace_t_zulu> yfeldblum: ty
<pace_t_zulu> helpful channel :)
<yfeldblum> easy questions :P
<yfeldblum> stdlib API docs - http://rubydoc.info/stdlib
<pace_t_zulu> yfeldblum: ty
<apeiros_> alternatively: ri, a tool in your shell
RomD`` joined #ruby
<apeiros_> advantages of ri: works offline too and is always the one matching your installed ruby
Aaaarg joined #ruby
bosphorus joined #ruby
enikar joined #ruby
<pace_t_zulu> would anyone here find a Tumblr class useful ... or think a tumblr gem would be worthwhile?
jonathanrwallace joined #ruby
<shevy> pace_t_zulu yea
<shevy> if it is simple to use
<apeiros_> pace_t_zulu: https://rubygems.org/gems/tumblr - seems like there is already at least one
cantonic joined #ruby
bpfh joined #ruby
<cantonic> hey guys. i need to get the today's date in this format: Fri, 28 Oct 2011 00:00:00 UTC +00:00
<apeiros_> that doesn't mean that you shouldn't publish yours, though :)
<cantonic> i tried Date.today but that brings this format: Sun, 27 Nov 2011
emptyflask joined #ruby
<pace_t_zulu> apeiros_: i think the one i've got is really simple
<apeiros_> cantonic: isn't that rfc822 format?
<cantonic> apeiros_: honestly spoken i have no clue sir :)
<pace_t_zulu> it's not comprehensive ... just simple
<cantonic> i also tried Date.today.to_time and that brings Sun Nov 27 00:00:00 +0100 2011
<apeiros_> cantonic: require 'time'; Time.now.rfc822
<shevy> pace_t_zulu hmm not sure how to use that
<pace_t_zulu> shevy: this is where it's used
<cantonic> apeiros_: thank you! That brings "Sun, 27 Nov 2011 17:32:37 +0100"
<pace_t_zulu> instantiated on line 23
<cantonic> but again nothing with "UTC" in it
<apeiros_> cantonic: you sure that should be in it?
<pace_t_zulu> posts on lines 51 54 and 57
<apeiros_> it sounds moronic to use a format so close to a standard but yet not being that format…
<pace_t_zulu> shevy: ^^
<cantonic> apeiros_: hmm… i got your point. maybe my bug is somewhere else. i will search through it… thank you for your patience sir :)
<shevy> pace_t_zulu well yeah hmm
eighty4 joined #ruby
<shevy> def initialize(email,password,generator)
<shevy> I can guess email and password
<shevy> no idea about generator
<apeiros_> cantonic: if you're sure about the format, how about Time.now.strftime("%a, %d %b %Y %H:%M:%S UTC %z") ?
<pace_t_zulu> shevy: it's in the tumblr api
<cantonic> apeiros_: you are right. that wasn't really needed
<cantonic> Time.now.at_midnight works fine
dch4pm4n joined #ruby
eldariof joined #ruby
Morkel joined #ruby
<cantonic> apeiros_: Actually I need the date for HighCharts… it is quite complicated to get those stats working...
<apeiros_> cantonic: the js lib?
<cantonic> apeiros_: right. you know it?
<apeiros_> sure. we use it.
<cantonic> really? oh cool. I am struggling arround for 4 days now… :D
<pace_t_zulu> yfeldblum: here is where i used your advice ... https://bitbucket.org/binarymutant/unbotu/src/da9ae3c6d83b/unbotu.rb ... lines 33 and 45 ... thank you again :)
<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_> yes
Lord-Harlot joined #ruby
<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
sdavis joined #ruby
Hachima joined #ruby
notbrent joined #ruby
thepix joined #ruby
LittleBill902 joined #ruby
LittleBill902 joined #ruby
Jake232 joined #ruby
eldariof joined #ruby
<shevy> with .map you iterate through your array
iamjarvo joined #ruby
<shevy> ['a', 'b', 'c'].map {|c| c.capitalize } # => ['A', 'B', 'C']
trivol joined #ruby
Amirh joined #ruby
LittleBill902 joined #ruby
<Amirh> hi
<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> err what's VA?
<cassarani> is that a US state?
<poisonarms_> Yes
tayy joined #ruby
<cassarani> have you tried GitHub jobs? http://jobs.github.com/
<poisonarms_> I have not, but I'll take a look.
<Amirh> localhost:3000 doesn't work for me.
sdavis joined #ruby
yann2 joined #ruby
<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...
tomzx joined #ruby
<shellox> omg, police vs demonstrants @ castor transport http://www.ndr.de/regional/niedersachsen/heide/castor1035_v-contentgross.jpg
<raz> shellox: they need to relax more
<shellox> the police here got so brutal as in the usa
<shellox> they also attacked me on a football match :/
<atmosx> shellox: here == Germany ?
<atmosx> wow
<raz> brutal?
<raz> they're chill
<atmosx> football == soccer?
<shellox> atmosx: germany -> soccer ;)
<raz> look how he gently paints the violent protesters
<atmosx> I'm from Greece actually, so… brutallity is the norm the last few years...
<shellox> atmosx: ah, the country we pay for..
<atmosx> shellox: I could argue quite the opposite...
<shellox> copy paste fail
<raz> that's not an attack
<shellox> this one
<raz> they play catch
<atmosx> shellox: in Germany?
<shellox> atmosx: yep, because of the castor transport
<raz> heh
<raz> that looks like mighty fun tho doesn't it
<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
derailed joined #ruby
<raz> blech
<atmosx> someone = { 'Italy', 'Greece', 'Portugal', 'Spain' }
<raz> why do all movies appear on piratebay before itunes
<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?
<yfeldblum> central banks are a product of statism
<atmosx> and what is the alternative?
<shellox> raz: see this agressive demonstrant? http://www.spiegel.de/fotostrecke/fotostrecke-75588-15.html
<atmosx> Goldman Sachs?
<raz> shellox: he scares the shit out of the poor cops with his combat-snuggie
<shellox> sure :P
<shellox> the police attacked the security, who was for the football match too
<raz> and they only have these pesky sticks for self defense
<raz> it's a tragedy
<shellox> security vs police, really impressive
<raz> give them AK47s!
<shellox> maybe i should buy a weapon :P
sepp2k joined #ruby
<shellox> else i got killed by the cops?
<yfeldblum> goldman sachs is likewise a product of statism, not a product of the free market
<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
<shellox> and then the police had to run :P
jbw joined #ruby
<raz> being a cop can be tough cookies..
<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
<shellox> hehe :)
sdwrage joined #ruby
vmatiyko joined #ruby
ReachingFarr joined #ruby
<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
<Mon_Ouie> assuming a, b, and c are defined
<Mon_Ouie> What's the exact error?
<pen> syntax error, unexpected keyword_end, expecting '}'
<pen> I was just testing for a value to be nil
<pen> if it is nil then assign nil
<pen> if not, apply a function
<pen> somehow it always give me this error
manizzle joined #ruby
<Mon_Ouie> ruby -e 'a,b,c=0,1,2; d = (a ? b : c); p d'
<Mon_Ouie> Then you're not using the code you showed above?
<Dyscrete> that puts 2?
c9s joined #ruby
<Dyscrete> what is the point
<Mon_Ouie> 1
<pen> d = (a ? b : nil) actually
<Dyscrete> a=0?
<pen> a should be nil or non-nil
<Mon_Ouie> that's just a complete example
<pen> it's params[:key]
GreaseMonkey joined #ruby
GreaseMonkey joined #ruby
<pen> if key exists
<pen> it should return
<pen> if not it should return nil right?
<Mon_Ouie> Show the code you are running
<Dyscrete> ah
<Dyscrete> 0 evaluates to true
<Dyscrete> durr
<Mon_Ouie> Yes, only nil and false are considered as false
<pen> start = (params[:start] ? Time.at(params[:start].to_f).strftime('%F %T.%6N').to_s : nil
thecreators joined #ruby
<pen> )
<pen> I miss this one paranthesis
<Mon_Ouie> Syntax OK
<Mon_Ouie> according to ruby -ce
<pen> hmm
Fezzler joined #ruby
s0ber_ joined #ruby
<pen> that's just weird
<Mon_Ouie> pastie the whole method at least
<pen> Mon_Ouie: it is inside sinatra though
<Mon_Ouie> So?
<pen> part of a routing action, I don't know how much that would help, because it can stand out its own
<pen> I mean
<pen> I only have a couple more lines just like that, but this line gives me error first
<Dyscrete> have a very questionable question
<Dyscrete> what is the fastest way to stream video?
<Dyscrete> in HD
<tightwork> Is everything in a state of turmoil as everything intends to move to ruby 1.9.0 ?
<pen> and i'm only returning the values into json
<pen> so
<Mon_Ouie> Doesn't matter; the error isn't on that line, it is probably caused by a previous error
<pen> Mon_Ouie: this is the first line of the action:
<pen> logger.info "in data"
<pen> it works
<Mon_Ouie> Just like forgetting to close a string would result into an error long after the point where it should have been closed
<pen> so what's the problem?
<pen> and the line I showed is after that line
notbrent joined #ruby
Dyscrete left #ruby
<Mon_Ouie> That's still not enough to reproduce a syntax error
Dyscrete joined #ruby
<Mon_Ouie> There; see the syntax highlighting? ;)
<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]]
Amirh joined #ruby
<Amirh> I caanot run the server in my first ror app : http://codepad.org/l9HPnJp9
<moshee> cantonic, @browsers.map { |k, v| [k, v] }
<Dyscrete> cantonic, what version of ruby are you using?
<Dyscrete> because @browsers.to_a; should work if it was a hash
<cantonic> Dyscrete: REE
<Dyscrete> ahh
<cantonic> Ruby Enterprise Edition
<cantonic> Dyscrete: in development i use 1.8.7
<cantonic> sorry, wrong. i use ree in development too i just saw :)
<Dyscrete> { "Safari" => 1, "Firefox" => 1 }.to_a # => [["Safari", 1], ["Firefox", 1]]
canuck31_ joined #ruby
iocor joined #ruby
skammer joined #ruby
Silker joined #ruby
<indigo_> I thought he needed it in a string
<indigo_> So @browsers.to_a.to_s
<cantonic> let me try it with to_s
<cantonic> atm i get {&quot;Firefox&quot;:1,&quot;Safari&quot;:1}
<indigo_> But moshee's solution worked as well
<Dyscrete> to_json should work..
<cantonic> indigo_: it is weird but it doesnt :(
<cantonic> Dyscrete: already tried to_json
<apeiros_> cantonic: so what do you get on to_a.to_json?
<cantonic> wait, i will create a pastebin for that...
<shellox> can i do the following:
<shellox> case x
<Dyscrete> to_json would work..
<shellox> when "foo" || "bar"
<shellox> puts "stuff"
<shellox> else
<apeiros_> shellox: remember, >3 lines go to a pastie
<shellox> apeiros_: man..
<shellox> apeiros_: 5 lines ;)
<shellox> :P
<Dyscrete> to json works
<cantonic> ok, this is my method: http://pastebin.com/qfEHz2wm
p1d joined #ruby
<Dyscrete> { "Safari" => 1, "Firefox" => 1 }.to_a.to_json # => "[[\"Safari\",1],[\"Firefox\",1]]"
<apeiros_> cantonic: maybe I'm blind - but I don't see there what you get for .to_a.to_json…
Brozilla joined #ruby
ReachingFarr left #ruby
<cantonic> @browsers return Safari1Firefox1
conor_ireland joined #ruby
<cantonic> now i will try to_a.to_json
<apeiros_> cantonic: p @browser
<apeiros_> or rather: p @brower.to_a.to_json
<apeiros_> and show us what you get
<cantonic> apeiros_: ok. one moment
<Dyscrete> @browsers.to_a.to_json is working fine
<Dyscrete> cantonic: that's right
<cantonic> what is that "nil" there?? to_a seems doing what i want
<cantonic> one moment please
<Dyscrete> that's p
<Dyscrete> in IRB, p returns nil
<cantonic> ah ok. thx Dyscrete :)
<Dyscrete> np
<apeiros_> cantonic: so what made you think it didn't work?
<cantonic> apeiros_: because in my html template it gets rendered like like this: Firefox1Safari1
<apeiros_> cantonic: learn about inspect
<apeiros_> often/normally printing stuff uses to_s
<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: [[&quot;Firefox&quot;,1],[&quot;Safari&quot;,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 &quot; 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
<sythe> ...
<sythe> Or blocks
<sythe> Or whatever
sdavis joined #ruby
<shevy> wtf
wyhaines joined #ruby
<shevy> IUsed
<shevy> IFree
<sythe> ??
<shevy> APPLE IN THE HOUSE
<shevy> IPhone
benja-M- joined #ruby
sdavis joined #ruby
Evixion` joined #ruby