apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
c0rn has joined #ruby
cj3kim has joined #ruby
cantonic has quit [Quit: cantonic]
minijupe has quit [Quit: minijupe]
c0rn has quit [Ping timeout: 252 seconds]
c0rn has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
dhaskew has joined #ruby
jayrulez_ has quit [Remote host closed the connection]
<delinquentme>
it looks like it could be an array of hashes? but I need to build something like this .. and end up with that format in js
<offby1>
So: how is "throw" different from "raise"? My hunch is that they're pretty much the same, except a) Raise takes any object, and lets you catch by specifying a class; b) throw is somehow cheaper.
<offby1>
Discuss
Solnse has joined #ruby
<offby1>
delinquentme: looks like an array of hashes to me, all right
<offby1>
delinquentme: I just pasted that into my REPL, and (apart from having to add "0" before each decimal point), it "just worked".
Natch| has quit [Ping timeout: 245 seconds]
<offby1>
[{x: 0, y: 0.1}, {x: 0, y: 0.9}, {x: 2, y: 0.5}, {x: 2, y: 0.9}] to spell it all out.
ArtificialEX has quit [Read error: Connection reset by peer]
c0rn has quit [Ping timeout: 265 seconds]
c0rn has joined #ruby
nfk has quit [Quit: yawn]
yankov has quit [Read error: Connection reset by peer]
yankov_ has joined #ruby
iamjarvo has quit [Ping timeout: 244 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.8-dev)]
c0rn has quit [Ping timeout: 252 seconds]
c0rn has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
pdtpatrick has joined #ruby
<delinquentme>
offby1, i had no idea you can define hash keys without quotes?
<deryl>
that syntax he's using is 1.9 syntax
<offby1>
delinquentme: quotes are for strings; they have nothing to do with hashes.
perryh_away is now known as perryh
<offby1>
in older syntax, it'd be
<offby1>
[{:x => 0, :y => 0.1}, ... etc etc ]
<offby1>
pretty much the same thing; just put the colons at the front of the symbol's name, and put a => between each symbol and its associated value
savage- has quit [Remote host closed the connection]
ipoval has left #ruby [#ruby]
Natch| has joined #ruby
Zolrath has joined #ruby
td123 has joined #ruby
QaDeS has quit [Ping timeout: 245 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
cousine has quit [Remote host closed the connection]
c0rn has quit [Ping timeout: 252 seconds]
techhelp has joined #ruby
nlc has quit [Quit: Leaving]
c0rn has joined #ruby
novodinia has joined #ruby
hadronzoo has quit [Quit: hadronzoo]
novodinia has quit [Changing host]
novodinia has joined #ruby
odinswand has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
davidpk has quit [Quit: Computer has gone to sleep.]
rh1n0 has joined #ruby
sohocoke has quit [Quit: sohocoke]
vitoravelino`afk is now known as vitoravelino
SeySayux has quit [Read error: Operation timed out]
DJZuzu is now known as Azure
mahmoudimus has joined #ruby
hamfz_ has quit [Read error: Operation timed out]
Hanmac has quit [Ping timeout: 240 seconds]
QaDeS_ has quit [Quit: Ex-Chat]
Criztian has joined #ruby
Criztian has quit [Remote host closed the connection]
wmoxam has joined #ruby
Icehawk78 has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<Icehawk78>
Is there a way in my aprc or irbrc to tell awesome_print not to find and collect every single instance variable that exists on an object when it displays it?
kenperkins has joined #ruby
<Icehawk78>
I'm trying to do some stuff with mechanize in irb, and the output is entirely unreadable, but I'd prefer not to entirely disable ap
techhelp has joined #ruby
* offby1
stares blankly
<banisterfiend>
Icehawk78: i always thought ap was broken
<Icehawk78>
banisterfiend: I recently found out that the version I'd been using was over 1-2 years old, so this is "new to me" behavior, lol
<banisterfiend>
Icehawk78: u could just explicitly require the old version you're used to ;)
odinswand has quit [Quit:]
c0rn has quit [Ping timeout: 248 seconds]
ConstantineXVI has quit [Remote host closed the connection]
jpcody has joined #ruby
wmoxam has quit [Ping timeout: 256 seconds]
c0rn has joined #ruby
jpcody has quit [Read error: Connection reset by peer]
ivar has quit [Remote host closed the connection]
<Icehawk78>
banisterfiend: Might have to, but before I did that I figured I'd see if there was any existing manner to disable that and/or specify for custom objects I'm using/creating how to ap them
troessner_ has quit [Ping timeout: 245 seconds]
<banisterfiend>
Icehawk78: for your custom objects, just ovverride the #ai method iirc
<banisterfiend>
or awesome_inspect method
<banisterfiend>
i forget which
jpcody has joined #ruby
yugui is now known as yugui_zzz
<Icehawk78>
Oh, did not know that. Though I guess that won't help for something like mechanize.
elake has joined #ruby
<Icehawk78>
But for some of this stuff, that's good to know.
<banisterfiend>
Icehawk78: ruby's pretty_inspect / pretty_print stuff is great, i just use that
jpcody has quit [Read error: Connection reset by peer]
<banisterfiend>
that's what we use for pry and are pretty happy with it
jpcody has joined #ruby
sohocoke has joined #ruby
Hanmac has joined #ruby
etank has quit [Ping timeout: 272 seconds]
sohocoke has quit [Remote host closed the connection]
jpcody has quit [Read error: Connection reset by peer]
jpcody has joined #ruby
ivar has joined #ruby
jpcody has quit [Client Quit]
khakimov has joined #ruby
ConstantineXVI has joined #ruby
kaneda_ has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
bluenemo has quit [Remote host closed the connection]
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
c0rn has quit []
niku4i has joined #ruby
ivar has quit [Remote host closed the connection]
niku4i has quit [Remote host closed the connection]
kenperkins has quit [Quit: Computer has gone to sleep.]
wmoxam has joined #ruby
krz has quit [Quit: krz]
koobs has joined #ruby
Soul_Est has joined #ruby
<koobs>
Afternoon all, im looking for a variable or configure arg I can use when configure/compiling ruby to explicitly disable OpenSSL, any hints? (Ive looked for --{disable|without}--openssl ane HAVE_OSSL defines thus far)
<jpcody>
hey all, sorry i got kicked offline earlier. I'm having lots of trouble getting a gem built correctly for local development. as of now, I've created it with bundler, started writing it, and am trying to require it in pry. it shows up in `gem list`, but in pry/irb, i get "no such file to load" -- any idea what could cause this?
kenperkins has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
cordoval has joined #ruby
bubz has quit [Ping timeout: 245 seconds]
kenperkins has quit [Client Quit]
ermines has joined #ruby
digitalcakestudi has quit [Quit: Leaving.]
weasels has quit [Read error: Connection reset by peer]
elkng has joined #ruby
<xhh>
jpcody: maybe try "bundle exec irb"?
krz has joined #ruby
rboyd has joined #ruby
<jpcody>
unfortunately, the same thing. because the gem is only local, is it because my GEM_PATH doesn't know where to find it?
dhaskew has quit [Ping timeout: 246 seconds]
yugui_zzz is now known as yugui
<xhh>
jpcody: no idea then, you can use "gem list" and "gem content" to check where it is installed
eka has quit [Quit: Leaving]
kenperkins has joined #ruby
ConstantineXVI has joined #ruby
Constant_ has joined #ruby
savage- has joined #ruby
ConstantineXVI has quit [Read error: Connection reset by peer]
delinquentme has quit [Quit: Leaving]
remmy444 has joined #ruby
quesada__ has quit [Ping timeout: 246 seconds]
quesada__ has joined #ruby
sam113101 has quit [Remote host closed the connection]
xclite has quit [Remote host closed the connection]
<Icehawk78>
Is there any way to somehow tell Nokogiri that a specific site/page that I'm loading uses '<=' and '<' in text nodes, rather than '<'? I don't really know how I'd do that, and I'm not even sure of what I'd be looking for to know what to search for online.
ConstantineXVI has joined #ruby
kevinbond has quit [Quit: kevinbond]
fbernier has joined #ruby
yugui is now known as yugui_zzz
defendguin has joined #ruby
techhelp has joined #ruby
ConstantineXVI has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
baroquebobcat has joined #ruby
zeromodu_ is now known as zeromodulus
techhelp has quit [Ping timeout: 252 seconds]
kenperkins has quit [Quit: Computer has gone to sleep.]
macmartine has quit [Quit: macmartine]
amalvagomes has quit [Quit: amalvagomes]
macmartine has joined #ruby
Solnse has joined #ruby
Cache_Money has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
willyum has quit [Read error: Operation timed out]
davidpk has joined #ruby
amalvagomes has joined #ruby
Mon_Ouie has quit [Ping timeout: 276 seconds]
<ryanf>
Icehawk78: what happens when you try to parse it right now?
defendguin has quit [Quit: Leaving.]
Mon_Ouie has joined #ruby
<ryanf>
I think nokogiri lets you configure the parsing strategy to some extent, not sure if it would help though
kevinbond has joined #ruby
fbernier has quit [Ping timeout: 252 seconds]
wmoxam has quit [Ping timeout: 256 seconds]
Guedes_out has quit [Read error: Operation timed out]
lkba has quit [Ping timeout: 244 seconds]
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
baroquebobcat has joined #ruby
robdodson has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
Cache_Money has left #ruby ["Leaving"]
austinbv has joined #ruby
lkba has joined #ruby
<austinbv>
wtf happened to the ruby docs
baroquebobcat has quit [Quit: baroquebobcat]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
rboyd has joined #ruby
hadronzoo has quit [Ping timeout: 276 seconds]
kevinbond has quit [Quit: kevinbond]
Targen_ has joined #ruby
Targen has quit [Ping timeout: 244 seconds]
araujo has quit [Ping timeout: 240 seconds]
amalvagomes_ has joined #ruby
noganex has quit [Ping timeout: 246 seconds]
ciopte7__ has quit [Quit: ciopte7__]
noganex has joined #ruby
<Icehawk78>
ryanf: After a bit of fiddling, I was able to just do a gsub on the mechanize.page.content to fix the offending characters (luckily, they're always directly next to an open parentheses) because anytime nokogiri actually parsed the document, it essentially chopped everything from the <= to the > of whatever the next tag was, as well as removing the closing /> tag of what got eaten, while throwing up several exceptions.
amalvagomes has quit [Ping timeout: 244 seconds]
amalvagomes_ is now known as amalvagomes
<ryanf>
Icehawk78: were you parsing with Nokogiri() ?
<ryanf>
you might try Nokogiri::HTML()
<ryanf>
but I guess you've fixed it now
emmanuelux has quit [Read error: Connection reset by peer]
<Icehawk78>
ryanf: Eventually that's what I had to do - before I was just using the nokogiri hooks built into Mechanize, rather than explicitly calling to Nokogiri
<ryanf>
oh huh.
<Icehawk78>
But I had to Nokogiri::HTML() after the gsub pat
<Icehawk78>
*part
austinbv has quit [Quit: austinbv]
macmartine has quit [Quit: macmartine]
mahmoudimus has joined #ruby
<Icehawk78>
Otherwise it'd to the aforemention chomping and spewing of exceptions (as I'd likely expect, given that they presumably don't want to hardcode html tags into the parser)
Progster has quit [Ping timeout: 260 seconds]
deobald__ has quit [Ping timeout: 260 seconds]
macmartine has joined #ruby
araujo has joined #ruby
macmartine has quit [Client Quit]
strnx has quit [Ping timeout: 245 seconds]
Rickmasta has quit [Quit: Bye]
SeySayux has joined #ruby
kil0byte has quit [Remote host closed the connection]
xhh has quit [Quit: xhh]
ananthakumaran has joined #ruby
xhh has joined #ruby
strnx has joined #ruby
Rickmasta has joined #ruby
ciopte7_ has joined #ruby
shevy has quit [Ping timeout: 248 seconds]
techhelp has joined #ruby
Solnse has quit []
deobald__ has joined #ruby
austinbv has joined #ruby
austinbv has quit [Client Quit]
indian has quit [Remote host closed the connection]
kevinbond has joined #ruby
Karmaon is now known as Karmaon2
Karmaon2 is now known as Karmaon
araujo has quit [Quit: Leaving]
amalvagomes has quit [Quit: amalvagomes]
flak has joined #ruby
kevinbond has quit [Client Quit]
flak is now known as Guest58654
shevy has joined #ruby
robdodson has quit [Quit: robdodson]
rippa has quit [Ping timeout: 244 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
kevinbond has joined #ruby
wallerdev has quit [Quit: wallerdev]
Guest58654 has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rippa has joined #ruby
quest88 has quit [Quit: quest88]
BadAtom has joined #ruby
mucker has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
Ryan_V-01 has joined #ruby
austinbv has joined #ruby
<Ryan_V-01>
hi all. is there some best practice for when to use (or if ever to use) a 'for' block instead of an each block?
<bnagy>
never use for
<bnagy>
(tat's opinion)
banisterfiend has quit [Remote host closed the connection]
<bnagy>
for is there for recovering perl / python programmers, it's ruby methadone
<Ryan_V-01>
haha ok thats kind of what i was looking for. i remember when i first started out i saw someone doing it in some tutorial, but then someone told me not to so i hadn't done it since, but i was just wondering if it was because there was certain times when it was appropriate to use it (and maybe that wasn't one of them)
<Ryan_V-01>
bnagy i don't know if you remember before you were helping me out with reporting stuff
techhelp has quit [Quit: This computer has gone to sleep]
austinbv has quit [Quit: austinbv]
vitoravelino is now known as vitoravelino`afk
igotnolegs has quit [Quit: Computer has gone to sleep.]
<Ryan_V-01>
guess not? well, I ended up putting together something we talked about. in the end, I'm not going down this route but it was fun anyways. https://gist.github.com/2754853
austinbv has joined #ruby
yxhuvud has joined #ruby
austinbv has quit [Quit: austinbv]
andrewhl has quit [Quit: andrewhl]
defendguin has joined #ruby
banisterfiend has joined #ruby
Solnse has joined #ruby
andrewhl has joined #ruby
sparrovv has joined #ruby
<bnagy>
sry, internet is messed up here, I dropped out
<Ryan_V-01>
did u get those last messages?
<bnagy>
ah, that's nicer
<bnagy>
date_range logic looks a little twisty though
CheeToS has joined #ruby
<Ryan_V-01>
yeah, i was trying to not break the existing short term, then prob just do a rewrite once all the tests are solid
<Ryan_V-01>
…existing *code…
krz has quit [Quit: krz]
ermines has quit [Read error: Connection reset by peer]
m0dmd has quit [Quit: m0dmd]
altiouz has joined #ruby
otters has joined #ruby
deobald__ has quit [Ping timeout: 260 seconds]
adeponte has joined #ruby
austinbv has joined #ruby
kil0byte has joined #ruby
mucker has quit [Ping timeout: 250 seconds]
nirakara has joined #ruby
mucker has joined #ruby
nirakara has quit [Read error: Connection reset by peer]
looopy has joined #ruby
kevinbond has quit [Quit: kevinbond]
sparrovv has quit [Ping timeout: 252 seconds]
nirakara has joined #ruby
adeponte has quit [Remote host closed the connection]
austinbv has quit [Quit: austinbv]
defendguin has quit [Quit: Leaving.]
Alantas has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
vertroa has joined #ruby
mahmoudimus has joined #ruby
kil0byte has quit [Read error: Connection timed out]
kil0byte has joined #ruby
fowl has quit [Read error: Connection reset by peer]
ddv has joined #ruby
fowl has joined #ruby
Eldariof-ru has joined #ruby
SmoothSage has joined #ruby
Ryan_V-01 has quit [Quit: Ryan_V-01]
andrewhl has quit [Quit: andrewhl]
Morkel has joined #ruby
kevinbond has joined #ruby
jackiechan0 has joined #ruby
<jackiechan0>
hi there
banisterfiend has quit [Remote host closed the connection]
jackiechan0 has quit [Client Quit]
kil0byte has quit [Remote host closed the connection]
banisterfiend has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
nirakara has quit [Quit: This computer has gone to sleep]
kevinbond has quit [Quit: kevinbond]
nirakara has joined #ruby
sparrovv has joined #ruby
dhaskew has quit [Ping timeout: 246 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<bnagy>
nice. Jruby 1.7 with jre1.7u6 is 3x faster than mri 1.9.3p194 on some set cover stuff I'm doing
<bnagy>
that's... quite a lot
<shevy>
speed lover!
prtksxna has joined #ruby
<bnagy>
well, when it's free* yeah
<bnagy>
mri, without parallel 120s, jruby + parallel 9.79s
<bnagy>
not a bad afternoon's work
yankov_ has quit [Quit: yankov_]
<bnagy>
I want to test this on one of the 48 core boxes :D
kevinbond has joined #ruby
<bnagy>
also, I installed rbenv, finally. So shweeeet.
tomzx has quit [Ping timeout: 246 seconds]
eka has joined #ruby
jackiechan0 has joined #ruby
<jackiechan0>
hello
<jackiechan0>
anyone there?
mikepack has quit [Remote host closed the connection]
nikhil_ has joined #ruby
<jackiechan0>
nikhil_> hi
nirakara has quit [Ping timeout: 250 seconds]
<shevy>
jackiechan0 ciao
<jackiechan0>
shevy> hi there
<jackiechan0>
shevy> u busy?
<bnagy>
jackiechan0: if you've a question, just ask, you don't need to do a roll call first
<jackiechan0>
shevy> do u speak italian ?
<bnagy>
unless it's about metasploit ;)
<shevy>
jackiechan0 other than ciao no :(
<jackiechan0>
bnagy> shevy ok i'm learning the use of else
<shevy>
good
<shevy>
if foo
<jackiechan0>
(very basis sigh!)
<shevy>
do_thing
<shevy>
else
<shevy>
do_something_else
<shevy>
there you go!
<bnagy>
yeah, certain types of control flow can be really tricky without it
mohits has joined #ruby
<rking>
shevy: No "end"?? I suspect you're a Python spy in disguise. >=|
shruggar has joined #ruby
mohits has quit [Quit: Leaving.]
<shevy>
rking I wanna see end gone as an optional feature to the first shebang line
nikhil_ has quit [Ping timeout: 244 seconds]
<rking>
shevy: Me, too. =\
<shevy>
it's one of the few things I like in python
<rking>
shevy: There's a gem for it.
nirakara has joined #ruby
<shevy>
except that you must use :
<rking>
Me, too.
<shevy>
def foobar():
<shevy>
I still dont understand why they demand a :
<rking>
I don't know what that : is for in Python.
<rking>
Me, too.
<shevy>
yeah. I thought there is enough information from the indent level alone
kevinbond has quit [Quit: kevinbond]
<shevy>
I think I tried the gem a few years ago, but something didn't quite seem to work at that time for me
<rking>
But please don't ever ask me to defend Python's design decisions. I'm more likely to accept execution by rusty fork than do so.
<shevy>
hehe
<jackiechan0>
shevy> how can i use 2 if and 1 else ?
<shevy>
also I would advice to use a newline before the first if
<jackiechan0>
shevy> ident what?
<shevy>
your code
<shevy>
if x
<shevy>
do_this
<shevy>
that is indent
<jackiechan0>
shevy> i dunno what do you mean ident
<bnagy>
jackiechan0: I'd use a case statement there
<shevy>
see the ' '
<shevy>
indent. it means move to the ---> right
<shevy>
here this is indented
<shevy>
here this is indented
<shevy>
you see?
<jackiechan0>
shevy> ok that's new for me
<shevy>
jackiechan0 you forgot one "end" btw
<shevy>
with indent, it would have been instantly obvious
<jackiechan0>
shevy> i'm at the chapter 6 of that tutorial and i took the book that is bigger
<shevy>
the book that is bigger? :)
<shevy>
do you want to take the book that is biggest!!!
<shevy>
hehehe
<bnagy>
jackiechan0: you could use if elsif else in that example, but if you ever find yourself using more than one elsif then switch to a case statement
<jackiechan0>
shevy> yeah is there a complete version of Chris Pine learn to program that is more complete
<bnagy>
it's prettier and it deals with nil by throwing them away instead of converting them
<jackiechan0>
bnagy> shevy another question then i'll stop to bother: How can i add hashes # to multiple strings without prompting # for each ? i'm using gedit on ubuntu
<bnagy>
moshef: but it won't coerce the result to float
<shevy>
wait what
<shevy>
add a hash to ... what?
<moshef>
bnagy: so I need to to_f it?
nirakara has quit [Quit: This computer has gone to sleep]
<shevy>
"multiple strings"? add a hash to a string??
<moshef>
its very important to be precise, I can't have it convered 1.5 to 1 etc
<shevy>
this_is_a_string = "hi there"
<bnagy>
if you want to guarantee the result is a float
<jackiechan0>
shevy> # to string that i want to ignore, i don't want to put # for every all the time
<bnagy>
moshef: that can't happen, for addition
<shevy>
this_is_a_hash = { :a => "b" }
stanigator has quit [Client Quit]
<shevy>
sorry
<bnagy>
(1 + 1.5).class => Float
<shevy>
I have no idea what you want :)
<moshef>
bnagy: what can't happen? guarantee of float?
<jackiechan0>
shevy> ho do u call this '#' in english ?
moshef has quit [Quit: moshef]
<bnagy>
moshef: only time you need to convert to float beforehand is division
<shevy>
hmm I dont even know the german name right now O_O
<thomasfedb>
jackiechan0, we call that a hash, or a weave, or a mesh
<shevy>
Hanmac, help me out
<shevy>
op
<shevy>
"hashmark"
<shevy>
lol.... in german "das Doppelkreuz"
<bnagy>
don't they call it 'pound' in the US sometimes?
<thomasfedb>
yeah
liluo has joined #ruby
<thomasfedb>
they do that
phipes has quit [Quit: phipes]
<bnagy>
well at least Dopplekreuz makes sense
<shevy>
the german word is hilarious. double cross.
<jackiechan0>
shevy> anyway when i add # at the beginning of a string, the code will be ignored right?? if i have to add # to many strings i have to do it manually string by string, is there a way to select various string and add # to every one? did i make myself clear?
<Mon_Ouie>
Also sharp (as in C#)
<shevy>
jackiechan0 yes. ruby ignores what comes after a #
<bnagy>
jackiechan0: use an editor that is not retarded
<thomasfedb>
jackiechan0, a line of code is not a "string" it is a "line"
<jackiechan0>
thomasfedb> ok sorry i mean 'line o code'
<shevy>
jackiechan0, well yes you have to manually to that. but there is another way too
<shevy>
I think it is =begin
<jackiechan0>
shevy> which one
<shevy>
or something. I dont use it myself actually
<shevy>
I use # even on multiple lines
<bnagy>
yeah =begin on a line by itself, close with =end
<jackiechan0>
shevy> nad u add # manualli to every line ?
<shevy>
there you go jackiechan0 ^^^
diegok has quit [Remote host closed the connection]
<shevy>
yes jackiechan0
<bnagy>
good for rapidly commenting out large chunks
<shevy>
it is usually only 6-10 lines at max with #
pdtpatrick has quit [Quit: pdtpatrick]
<jackiechan0>
bnagy> shevy ok guys thanks for helping, keep studying i really like ruby!!! chris pine book it's great for n00b!!! thanks again
<shevy>
hmm
<shevy>
jackiechan0, do you know the poignant guide?
<batmanian>
shevy thanks, it was working for me too, but I had read somewhere that it is invalid, I thought maybe Ruby is not validating the syntax or if the article that I've read is wrong?
<shevy>
I dunno the article, but we now can be absolutely sure that (&:reverse?) is valid syntax and works too
<shevy>
I dont see many symbols with a "?" mark though
<shevy>
I find it a bit strange to use the ? there
<shevy>
it is as if someone is trying to use symbols in conditional logic :)
<shevy>
we could even write perhaps ... "puts 'Yup!' if delegate :image?"
yugui_zzz is now known as yugui
yugui is now known as yugui_zzz
rboyd has quit [Quit: rboyd]
asuka_ has quit [Ping timeout: 252 seconds]
asuka_ has joined #ruby
gtuckerkellogg has joined #ruby
dhaskew has joined #ruby
codebeaker has quit [Ping timeout: 246 seconds]
ryanf has quit [Quit: leaving]
mucker has quit [Read error: Connection reset by peer]
weasels has joined #ruby
otters has quit [Read error: Connection reset by peer]
weasels has quit [Changing host]
weasels has joined #ruby
ciopte7_ has quit [Quit: ciopte7_]
flip_digits has quit [Quit: Computer has gone to sleep.]
becom33 has joined #ruby
<becom33>
https://gist.github.com/2757492 in this I'm getting a ./lib/commands/help.rb:20:in `help': uninitialized constant Help::Helpset (NameError)
* becom33
anyone ?
<Hanmac>
becom33 read your line again, and then your error again ... do you notic something?
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
oponder has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ has joined #ruby
troessner_ has quit [Read error: Connection reset by peer]
greyEAX has joined #ruby
dhaskew_ has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
thecreators has joined #ruby
jbw has quit [Ping timeout: 246 seconds]
sparrovv has quit [Ping timeout: 240 seconds]
Tuxist has quit [Read error: Connection reset by peer]
azm has joined #ruby
<becom33>
Hanmac, no I don't get it :/
Tuxist has joined #ruby
Morkel has joined #ruby
oponder has quit [Remote host closed the connection]
<shevy>
becom33 it tells you THE CONSTANT DOES NOT EXIST
<shevy>
:)
<shevy>
becom33 Help::Helpset <-- at least one of these does not exist
<shevy>
or is not known. did you (a) include these and (b) do they really exist?
<shevy>
the logical answer to at least one question must be no
hadronzoo has quit [Quit: hadronzoo]
jbw has joined #ruby
<becom33>
shevy, wait
<Hanmac>
becom33 Helpset and HelpSet are NOT the same
<dangerousdave>
I have rescue block, how do i skip the rest of the loop iteration from with it? In c++ i would use continue, that didnt work
jimeh2 has quit [Ping timeout: 252 seconds]
tresk has joined #ruby
macer1 has joined #ruby
macer1 has quit [Changing host]
macer1 has joined #ruby
sparrovv has joined #ruby
Codif has quit [Remote host closed the connection]
deobald__ has joined #ruby
bluOxigen has joined #ruby
codebeaker has joined #ruby
nicoulaj has quit [Remote host closed the connection]
<banisterfiend>
dangerousdave: next
<dangerousdave>
cheers
ctp has joined #ruby
ctp has quit [Read error: Connection reset by peer]
nfk has joined #ruby
jimeh2 has joined #ruby
lateau has joined #ruby
jimeh2 has quit [Ping timeout: 276 seconds]
ronniy has joined #ruby
lateau has quit [Ping timeout: 245 seconds]
weasels has quit [Read error: Connection reset by peer]
ermines has joined #ruby
ermines has quit [Changing host]
ermines has joined #ruby
bluOxigen has quit [Ping timeout: 252 seconds]
netogallo has quit [Ping timeout: 260 seconds]
zastaph has joined #ruby
nirakara has joined #ruby
fridim_ has joined #ruby
dax has quit [Ping timeout: 619 seconds]
lateau has joined #ruby
dax has joined #ruby
Murr_ has joined #ruby
Murr_ has quit [Remote host closed the connection]
cha1tanya has joined #ruby
<jackiechan0>
hey there what means command=''
<Tasser>
jackiechan0, assign empty string to the variable command
<jackiechan0>
i have problem to undersatnd loops, i should do the 99 bottle exercize
<jackiechan0>
Tasser> tnx
<Tasser>
jackiechan0, which is quite obvious, I'd say
<jackiechan0>
Tasser> sorry i'm noob
telos has joined #ruby
<telos>
hi, i have built ruby from source (both directly and using rvm) and either way I am unable to use the digest/md5 library: digest/md5.so: undefined symbol: rb_Digest_MD5_Init
<telos>
any ideas?
<Tasser>
jackiechan0, doesn't inhibit you from thinking yourself
<shevy>
I would not know. I dont really spend much time with C
<shevy>
:)
<jackiechan0>
shevy> ok i was wrong
orealis has joined #ruby
<shevy>
but C is more fun than java for sure
<orealis>
SO.... I haven't touched programming since assembly back on amiga in the late 80's.... would ruby be a good thing to try and learn? I basically have been reset to n00b..
timonv has joined #ruby
<jackiechan0>
shevy> but the C that i could use now is the same from the K&R =
<jackiechan0>
?
<orealis>
or shoul I go all C#y?
<apeiros_>
orealis: we can't answer you which language you should learn - that depends on your context
<apeiros_>
but ruby is certainly a great language to learn
<orealis>
I'm bored and I need something to use my brain on...
<jackiechan0>
orealis> i'm learning it and i'm enjoying and i'm n00b to
* orealis
admits to liking graphics and isnt sure how suitable ruby is for that..
<orealis>
mysql error on that page
<orealis>
guess its down..
<shevy>
jackiechan0, kind of
<shevy>
orealis depends on your use case
<shevy>
orealis what you want to do with a programming language
<shevy>
for me, ruby works very well for everything
<orealis>
I have no idea atm..I'm fluent in 7 languages, none of them are programming ones.. need a change..
<orealis>
lets just make an idea
<orealis>
that..
<orealis>
i want to make a small basic fractal frame renderer
<shevy>
I write things down in todo lists. while I never get to finish anything, it helps create projects
<orealis>
would ruby work for that at all?
<shevy>
well, see. yeah it would. but a renderer sounds as if you are concerned about speed
<shevy>
anyone who cares for speed should use languages like C
<orealis>
waz afraid of that..
<orealis>
i mean I used to write it in pure asm.. back when I was a kid
<orealis>
but then I passed 30
<bnagy>
well you can inline the fractal bits
<orealis>
and most of my brainpower vanished
<shevy>
orealis my brainpower goes away too
<orealis>
so I was sorta dingling between C# and Ruby
<shevy>
i make up for that by writing only simple code
nirakara has quit [Quit: This computer has gone to sleep]
lateau has joined #ruby
<orealis>
so basically.. ruby is capable but slow?
<bnagy>
C# is kind of OK if you want to marray microsoft
<orealis>
kinda dont.. thats the problem
<bnagy>
*marry
<shevy>
orealis ruby is great. I use it since almost 8 years. if you need speed though, dont use ruby.
<orealis>
so its great but slow..
<bnagy>
or use C libs under the hood :)
<shevy>
do you need the speed?
<orealis>
not for learning of course
<shevy>
hehe
<orealis>
but if I ever become competent at ruby
<orealis>
thenI might wanna do stuff that needs speed..
<shevy>
well ruby is fairly easy to learn, once it makes "click" for you
<orealis>
or.. wishes for speed at least..
<shevy>
to grok ruby you have to understand the thinking philosophy
jcromartie has joined #ruby
<shevy>
it is like a simplified, instructive and creative kind of english
<orealis>
KISS?
<shevy>
I dont use that term
<orealis>
but you know what it means?
<shevy>
but simplicity is a good thing
<shevy>
yeah
<orealis>
ya...
<shevy>
ruby is also terse and succint
sbanwart has joined #ruby
<shevy>
that can be confusing when you look at other people's code
<shevy>
I still find it hard to understand other people's ruby code
nirakara has joined #ruby
<jackiechan0>
shevy> maybe i'm not that brilliant but this 99 bottle exercize makes me crazy, could i have a hint ?
<bnagy>
jackiechan0: what do you have so far?
<jackiechan0>
bnagy> i'm studying the Chris Pine book and i'm stuck to the 99 bottles exercize, i know that i can find tos of solutions over internet but i would like and hint to reach the solution by myself
<bnagy>
orealis: don't get the idea that ruby isn't a 'real' language, btw. With careful use of other code it's 'fast enough' for just about anything
<bnagy>
jackiechan0: yeah, and I asked what code you had written so far. Also I have no idea what the exercise is, but I can guess. :)
schaerli has joined #ruby
<shevy>
jackiechan0, use pastie.org upload your current code
mengu has quit [Remote host closed the connection]
<jackiechan0>
bnagy> ok ok tnx shevy
<orealis>
ya.. and it's not as if I expect I'll ever get any good at it.. just figured id check up ahead..
<bnagy>
orealis: but for rapid graphics stuff, you kind of picked on the weak point of most of the interpreted languages
<orealis>
ya.. you kinda need to write it at the bottom level for it to be truly fast
<shevy>
orealis, if brilliance does not work for you, hard work or writing [insert language here] code every day still brings everyone forward steadily. slowly perhaps, but steadily :)
lateau has quit [Ping timeout: 245 seconds]
<shevy>
you could hack on menuetOS if you still wanna write assembler code
<shevy>
and port ruby to it :P
<orealis>
I mean.. I "remember the good old days" of making vector tables and rasterbars and other crap in asm on amiga.. but that was the good old days..
<jackiechan0>
shevy> sorry for italian but makes the program much familiar to me bnagy
<shevy>
orealis I can barely sit up all night
<shevy>
these days when my body says it is tired, I go to bed
weasels has joined #ruby
<orealis>
I'm 36 and sick so I'm at home most of the time.. hence I sleep when I want to.. and stay up all night if I want to
<shevy>
jackiechan0 you dont use any conditional checks in that code
<jackiechan0>
i know that i have to set a loop but i dunno why
<becom33>
why only the last value pp from array ? https://gist.github.com/2757747 is it beacuse it creates a array everytime I call the method ?
<bnagy>
jackiechan0: yeah you're gonna want a loop of some kind :)
ermines has quit [Read error: Connection reset by peer]
<shevy>
orealis, k sickness is a problem, luckily I am not really sick. though I am nowhere near as close to the physical condition I was at ~18 either :(
<orealis>
so.. I use windows (yes you can b00 at me now)... should I just use that Ruby Installer thing then?
<shevy>
jackiechan0 the problem is, it is not only that you are missing a loop
<shevy>
jackiechan0, the problem is you are missing EVERYTHING that makes a programming language here ;)
<orealis>
shevy, i take a lot of meds that doesnt promote sleeping so.. yay..
kapowaz has joined #ruby
<apeiros_>
becom33: pp prints the whole array. and yes, because you reset it to an empty array everytime on input
<orealis>
its like a problem because my two .. "helplines" are opposed.... one is an awesome java programmer who loves ruby.. the other one is an awesome VC programmer who loves Java..
<shevy>
jackiechan0 the FIRST thing you have to do is - "How can I split this problem into smaller problems"
<shevy>
jackiechan0, no. I was way too lazy to do exercises when I cant see the solution to them ever
<jackiechan0>
shevy> i know that using what is wrote on the next chapter i'll be able to do that, but i want to do that with what i have got from the first 7 chapter of the book
<jackiechan0>
shevy> split
<jackiechan0>
shevy> ok
<shevy>
jackiechan0, yeah. smaller problems.
<jackiechan0>
shevy> as you saw i splitted the problem in 2 adding much variable
<shevy>
jackiechan0, what problem do you have to solve next with the 99 bottles
<shevy>
ok good
<jackiechan0>
shevy> but of course writing all the lines of the song isn't th solution
<shevy>
so you have two variables
<jackiechan0>
shevy> ok
<shevy>
var1= 99 and var2= 1
<jackiechan0>
shevy> 2 variable , yes i decided that two variables
<jackiechan0>
shevy> i have the third that is the var1 - va2
<shevy>
one solution . 99.downto(1)
<shevy>
var1.downto(var2)
<jackiechan0>
shevy> never heard .downto until this chapter
<shevy>
99.downto(1).each {|x| puts x }
<shevy>
jackiechan0, well then he put a silly exercise up
<jackiechan0>
shevy> too advanced, wait i'll watch the solution on the Chris Pine book
<shevy>
I told you, I skipped the exercise
<shevy>
it is not that advanced
<shevy>
it is almost pure english
<shevy>
like a COUNTDOWN
<shevy>
do you know what a countdown is!
<shevy>
when the rocket is launched
<shevy>
10
<shevy>
9
<shevy>
8
<shevy>
!!!!
<shevy>
and when we reached 0
<shevy>
it all explodes
<shevy>
:(
<orealis>
red rocket red rocket..
<bnagy>
jackiechan0: loops are covered in chapter 6, it seems
<shevy>
ohhh
<bnagy>
looks like you need to pay more attention
<jackiechan0>
bnagy> yeah
<shevy>
so he skipped chapter 6
<shevy>
bad jackiechan0 bad
<shevy>
no more youtube watching for your brain
<jackiechan0>
shevy> bnagy no no i'm studying Chapter 6, the exercize is from chapter 6
<shevy>
tresk dunno. can you get rid of the old folder?
<shevy>
it may store that old information somewhere... is that on windows?
fflush has joined #ruby
nari has quit [Ping timeout: 252 seconds]
<tresk>
shevy: yes. should I also uninstallthe deb pacvkages of the old 1.9.1, too?
<shevy>
ah debian?
<shevy>
I think both may actually use 1.9.1/ directory
<shevy>
it's not easy to make debian play together nicely with ruby
<tresk>
shevy: oh, I thought debian may the best os for that... but anyway I can't change it now
<Hanmac>
my ubuntu has no problem with that
berserkr has joined #ruby
<shevy>
tresk yeah listen to Hanmac, he knows those things well
<shevy>
is "bundle" from "bundler"?
<deryldoucette>
the gem is called bundler. the command is actually bundle
<tresk>
Hanmac: I have to install it on a vpc environment I can't change the OS, unfortuately
<Hanmac>
tresk debian and ubuntu use 1.9.1 folder for 1.9.2 and 1.9.3 too
lateau has joined #ruby
<shevy>
deryldoucette ah I see
<deryldoucette>
they all use 1.9.1 directories
<deryldoucette>
its to indicate abi compatibility versioning from what i was told in here before
<deryldoucette>
thats why you see like lib/ruby/1.9.1/ ect
<tresk>
Hanmac: Just to make my situation clear: I installed the 1.9.1 version via apt and installed the 1.9.2 via wget. Al went well so far.
moshee has quit [Ping timeout: 265 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<deryldoucette>
you're going to cause such problems for yourself letting non-packages overwrite packages.
<deryldoucette>
really wish people understood how their package managers worked before doing things like this.
<tresk>
deryldoucette: That's the reason why I explain it, bcause I think that was fundamentally wrong
<deryldoucette>
just a single core same-named lib gets deleted, then BOTH installs are fucked
<Hanmac>
tresk whats the version shown with "dpkg -s ruby1.9.1" ?
kil0byte has joined #ruby
<tresk>
Hanmac: Hmm, the package seams not to beinstalled?°!
dnyy has quit [Remote host closed the connection]
<deryldoucette>
tresk: if you want multiple versions sanely (and not have to package manage) then use rvm to manage multiple ruby installs. not to mention that debian, ubuntu, and a slew of others chop ruby up needlessly into upteen packages for no real gain except in complexity unless you'r win an embedded environment.
<Hanmac>
debian can manage multipble versions installed too, but only they own installed
<deryldoucette>
ruby, ri, rdoc, rib, etc.. its insane how many packages they make out of it
<banisterfiend>
deryldoucette: what's rib
<shevy>
Hanmac, how do they manage multiple versions?
<deryldoucette>
s/rib/irb/
<Hanmac>
update-alternatives
<shevy>
specifically of libraries
dhaskew_ has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
<deryldoucette>
banisterfiend: my spellchecker trying to be 'helpful'
<banisterfiend>
deryldoucette: haha ok
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
<banisterfiend>
deryldoucette: cos there is actually an irb-alternative called 'rib'
<deryldoucette>
Hanmac: and they chop ruby up into little pieces galore and their do it be installing ruby1.8 ruby1.9 and then symlinking, and you can't easily switch between versions
<deryldoucette>
banisterfiend: ahh didn't know that actually!
<deryldoucette>
s/their do it be/they do it by/
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
<Hanmac>
deryldoucette: you can with update-alternatives --config ruby
<tresk>
I'm confused as I browse through my aptitude
<shevy>
tresk, the thing is that the debian guys need to know how users are supposed to install that
<tresk>
I can find a 1.9.3 package now?!
<Hanmac>
tresk whats your debian version ?
<shevy>
they designed these programs, they need to tell people how to use it
<tresk>
and 1.9.1 isn't installed... Oh,I guess, I have a mess or going to have one
<tresk>
Squeeze
<shevy>
surely you can use dpkg to remove old versions before installing a new version
lateau has quit [Ping timeout: 245 seconds]
<deryldoucette>
Hanmac: I was a debian package maintainer. I'm familiar with the steps. and thats only half the steps involved. Doing rvm use 1.9.3-p125 or rvm use 1.9.2 is much easier and faster than the entirety of update-alternatives
<Hanmac>
tresk: so what does " apt-show-versions ruby1.9.1-full" shows you?
<tresk>
OK, step by step, shoudl I remove the manually installed version somehow?
<shevy>
I would remove all of ruby actually, then start anew
<deryldoucette>
tresk: you're going to find the 1.9.1 directory as i said because the directory is still used to denote version compatability
nari has joined #ruby
<deryldoucette>
as for the manual version, see in the Makefile if it has a make uninstall
<deryldoucette>
some do some don't
quesada__ is now known as urlwolf
<deryldoucette>
if it doesn't then you would have to rerun the make install and track what files it installs and where
<Hanmac>
tresk if you want ruby1.9.3 as package you need wheezy or sid
<deryldoucette>
then manually delete them yourselves
<tresk>
ok I begin withuninstalling the manuall thingy first
<deryldoucette>
nothing like telling someone to mix unstable packages into their stable packages tree (which is really the only reason you run Debian in the first place)
<deryldoucette>
otherwise you;'d be running ubuntu or debian testing
<tresk>
btw aptitude shows me an installed version ruby1.9.2 and rubygems1.9.1 ... maybe rubygems has to be version 1.9.2 too?
<shevy>
latest ruby .tar.bz2 release has version 1.8.23
<shevy>
if debian comes up with "rubygems1.9.1" then it perhaps is the rubygems version bundled into default ruby 1.9.1
<shevy>
dunno what that version is, but it's quite old
jcromartie has quit [Quit: jcromartie]
ananthakumaran has joined #ruby
<shevy>
tresk you can do "gem --version" though
<shevy>
hmm
<shevy>
or do they name rubygems1.9.1 even when one has installed ruby1.9.2 ???
<tresk>
that shows me a 1.3.7 .... argh, what a mess here :(
<shevy>
ok that is very old
<deryldoucette>
tresk: the best way for both box stability and your sanity is to either install the ruby you require, manually, under /usr/local using --prefix when you build it, or using rvm or rbenv and installing either under /usr/local as well or into $HOME and managing the ruby installs yourself. Debian makes a complete fucking mess of ruby as shevy has been trying to make you aware
<tresk>
but in aptitude it shows me rubygems package of 1.8 and 1.9.1 as installed... I have to revert evreything
<shevy>
yeah debian is making things more complicated than it ought to be
<deryldoucette>
basically just go back and uninstall all ruby*, rib*, rubygems*, rdoc*, and ri-* packages and then work with one of the community's ruby managers
ananthakumaran1 has quit [Ping timeout: 252 seconds]
<deryldoucette>
banisterfiend: I'm not a christian so the answer would be no
<shevy>
Hanmac probably knows how to install a fresh ruby from zero on debian
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
<deryldoucette>
banisterfiend: I believe in Science, not some unseeable vengeful believe-in-me-or-die I-have-all-power-but-wont-use-them-to-end-suffering deity
<shevy>
:)
<shevy>
at least science tries to actively find answers that can be checked
<deryldoucette>
or a more aptly put, I don't believe win a zombie, want to eat his flesh, or beg his forgiveness for my sins which only HE says are sins
<shevy>
(usually)
<banisterfiend>
deryldoucette: i dont think u read the page :P read it
amalvagomes has joined #ruby
<deryldoucette>
s/win/in/
<deryldoucette>
banisterfiend: since I'm not homosexual, also, the answer would STILL be no
<banisterfiend>
deryldoucette: hehe
<shevy>
it usually works only once or twice
<shevy>
then people get scared of banister's links
jimeh2 has joined #ruby
<deryldoucette>
i see why
<shevy>
hehehe
<shevy>
banisterfiend, did you scare RubyPanther too with links?
<banisterfiend>
shevy: i dont think so
<deryldoucette>
oh i think we did that enough to him in #rubyonrails :)
<shevy>
he hasnt said anything in like 5 weeks...
<deryldoucette>
banister would just had been the icing on the cake
<shevy>
been fun there on #ruby-lang
<deryldoucette>
he's pissed enough of us off we ganged up on him, everything from linkage to commentaries :)
<shevy>
but people who get banned, cant talk back anymore, so it gets boring again :(
<shevy>
hehehe
<deryldoucette>
oh he's not banned. least not in #rubyonrails
<deryldoucette>
can't talk for #ruby-lang
<shevy>
yeah but on #ruby-lang
<shevy>
#ruby is like 50% banned there ... :P
human_bot is now known as upasna
<shevy>
I am considering going the same route simply out of solidarity with them
<deryldoucette>
ahh. see i like on free node that you can perm quiet someone rather than ban. then at least they can still get some education from the channel even if they can't be pedantic assholes to the channel :)
<tresk>
ok no un/deinstall scripts available, so I install it again an show where it puts all the files
<deryldoucette>
s/free node/freenode/ thank you again spellchecker for helping me. NOT
ZachBeta has joined #ruby
nari has quit [Ping timeout: 244 seconds]
<deryldoucette>
tresk: yeah. though i'm truly surprised that ruby doesn't have a make uninstall portion to their Makefile
<shevy>
tresk it really should be trivial
<tresk>
deryldoucette: maybe they detect it's Debian and rm it first *g
<deryldoucette>
didn't notice that myself since i use RVM to manage my installs
schaerli has quit [Read error: Operation timed out]
<deryldoucette>
tresk: hehehe
<shevy>
tresk if you used --prefix then you know where it was installed. otherwise, it defaults to /usr/local so have a look there
<deryldoucette>
shevy: it *does*? i thought it defaulted to /usr tree
<shevy>
deryldoucette when he does compile from source without any specific prefix, than it will default to /usr/local always. it's part of the FHS too, in that /usr prefix is reserved for "system install", or whatever word they used
<deryldoucette>
shevy: Right. I know FHS2.x specifies that. and that debian and most distributions follow that. I didn't realize that ruby honoured the FHS since its a cross platform
<deryldoucette>
and OS boundary i think is what they call it (OS vs userland)
<shevy>
"Large software packages must not use a direct subdirectory under the /usr hierarchy."
<shevy>
from reading this, can you tell me what qualifies as a "large software package" and what does not?
<deryldoucette>
right
<deryldoucette>
KDE, emacs, rubymine, etc
<shevy>
deryldoucette yeah, I googled for 2.x because I was curious if the FHS would bring in new ideas
<shevy>
but it's kinda still the same strange thing...
lateau has joined #ruby
<deryldoucette>
and I have problems with that wording as well because it intimates that non-OS packages that are small can be installed under /usr which is dead wrong
<shevy>
one of the coolest things is... here is the standard, follow it.
<shevy>
and then:
<shevy>
"An exception is made for the X Window System because of considerable precedent and widely-accepted practice."
<shevy>
and then we name exceptions! ;)
<shevy>
that's like saying "if people dont follow it anyone, do whatever you want..."
<shevy>
*anyway
<deryldoucette>
ahh yeah, now that I'm ok with. they NAME the exceptions! :) rather than leaving it open to interpretation
<shevy>
hehe
<shevy>
hmm
<shevy>
could RVM be used for every software?
<deryldoucette>
well, because this isn't an RFC, its a standards definition. they don't HAVe to follow it, however, not doing so can result in serious breakage. But then again not following conventions has been known to cause serious breakage even in the ruby and rails communities
<shevy>
like ... install several libcurl versions with RVM
<deryldoucette>
yes
<shevy>
cool
<deryldoucette>
you'd have to adapt the core of course, but yes, it could
<deryldoucette>
i've been toying with that in my head for the last year :)
<shevy>
kinda cool. one could almost turn this into a package manager of some sorts
<shevy>
hmm I think I am going to install RVM
<deryldoucette>
yep. except for the fact that it doesn't really do security management, and I'm really not willing to put in security aspects beyond the md5sum checks, the .rvmrc md5 creation/management etc.
<shevy>
well, perhaps it could be optional plugins eventually. I'll just need to go about that slowly, my brain gets confused when it has to learn too many new things quickly
<deryldoucette>
i already have a problem with mpapis adding the .ruby-version, .versions.conf file additions because they bypass the security system in rvm (unless .rvmrc exists as well. .rvmrc *always* trumps and *always* triggers the security system) but I also understand the compatibility reasoning behind his move.
<shevy>
tresk that is an odd path
<shevy>
tresk I would usually assume that debian ruby will use /usr/lib instead
<shevy>
tresk, are you 100% sure that you only have /usr/local/lib/ruby/ and not /usr/lib/ruby/ as well?
<deryldoucette>
well, don't pick rvm1 apart too much, rvm2 will be based on wayne's SMF (https://smf.sh/) which will make RVM truly modular
nari has joined #ruby
cousine_ has joined #ruby
<deryldoucette>
yeah debian's ruby packages install under /usr/ not /usr/local
<shevy>
deryldoucette hmm. I think initially, I am just going to slowly test commands with RVM, and write these things down slowly in a local page
<deryldoucette>
they do honour the splitting
<shevy>
and once I done that, would I consider looking at the internals... but not before
<deryldoucette>
shevy: test what commands?
<shevy>
I really *am* slow :)
<shevy>
deryldoucette, all RVM related commands
<shevy>
rvm use ...
<shevy>
rvm ... hmm
<shevy>
that's about the only thing I know hehe
<deryldoucette>
see my rvm-test which is now part of rvm. its our testing framework. comment based testing (for now, until I finish testrunner)
<deryldoucette>
github.com/wayneeseguin/rvm-test
<shevy>
this tests all of the RVM commands?
<tresk>
shevy: yes youare right this folder exists too :(
<deryldoucette>
his repo is the definitive. i trashed my personal repo, bequeathed all rights to it to him, and am working on testrunner to make full suites of tests.
<deryldoucette>
shevy: its used TO test them yes
lateau has quit [Ping timeout: 248 seconds]
<deryldoucette>
we use rvm-test to test rvm with via travis before everything is pushed out
cousine has quit [Ping timeout: 246 seconds]
<shevy>
tresk well that is actually good, because now you know that whatever you installed, will be under /usr/local
<shevy>
tresk, so you could get rid of that with good old rm
<shevy>
:)
<tresk>
hehe, I go through it now ,)
fflush has quit [Ping timeout: 265 seconds]
<deryldoucette>
bbiaf. need a cig
<tresk>
firstI uninstall it via aptitde and then rm ,)
<shevy>
the /usr/local/lib/ruby/ should be killed and also /usr/local/bin/ruby* (and irb there too)
<shevy>
or
<shevy>
if you dont need /usr/local
<shevy>
you could remove it simply hehe
<shevy>
if a new program is compiled into /usr/local prefix, that directory will be created again
schaerli has joined #ruby
<shevy>
since /usr/local is local to the local superuser (or whoever else gets permissions to work in /usr/local hierarchy), the whole system will always work
<shevy>
as nothing system critical is installed there by default
<shevy>
the most important things usually end up in /bin and /sbin, then /usr/bin
ZachBeta has quit [Read error: Connection reset by peer]
arturaz has quit [Remote host closed the connection]
ZachBeta has joined #ruby
moshee has quit [Ping timeout: 248 seconds]
moshee has joined #ruby
nirakara has quit [Quit: This computer has gone to sleep]
ZachBeta has quit [Read error: Connection reset by peer]
schaerli has quit [Remote host closed the connection]
ananthakumaran has quit [Ping timeout: 244 seconds]
techhelp has joined #ruby
ananthakumaran has joined #ruby
seanstickle has joined #ruby
wvms has left #ruby [#ruby]
rushed has quit [Quit: rushed]
Eldariof27-ru has joined #ruby
schaerli has joined #ruby
heftig_ has joined #ruby
lateau has joined #ruby
macer1 has joined #ruby
<tresk>
so I purged evrything I could find related to ruby via aptitude. NOw yourecommend I install rvm and install ruby that way?
<seanstickle>
Yes
Eldariof59-ru has quit [Read error: Operation timed out]
kil0byte_ has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
heftig has quit [Ping timeout: 265 seconds]
drmegahertz has quit [Ping timeout: 240 seconds]
kil0byte has quit [Ping timeout: 248 seconds]
TheHunter_1039 has joined #ruby
lateau has quit [Ping timeout: 245 seconds]
ermines has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
pen has joined #ruby
cousine_ has quit [Remote host closed the connection]
weasels has quit [Read error: Connection reset by peer]
adambeynon has joined #ruby
mcwise has joined #ruby
Kwpolska_ is now known as Kwpolska
D3V1Lx has joined #ruby
<tresk>
takes some time to compile rvm ,)
<tresk>
It's installing the latest ruby deps by default? nice...
nari_ has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<tresk>
and as I understand it I can switch between different installed ruby versions by using rvm, that's very helpfull, I like it ,)
<deryldoucette>
just make absolutely sure you read all of the sub-menus under rvm.io/rvm/ BEFORE you attempt the install
<deryldoucette>
there are prerequisites, and things you need to do after the install as well. (BE SURE to read 'rvm requirements' once its installed and working BEFORE you install any rubies)
<tresk>
I read the doc which is shown while the rvm install process and I installed the missing libs
nari has quit [Ping timeout: 245 seconds]
* deryldoucette
drives me nuts when people half ass the installs and don't read the site and/or the help system.
altiouz has quit [Ping timeout: 256 seconds]
<deryldoucette>
bit.ly/rvm-help-intro
cousine has joined #ruby
looopy has quit [Remote host closed the connection]
niklasb has joined #ruby
pen has quit [Remote host closed the connection]
<deryldoucette>
ok, time to walk the pooch :)
macer1 has quit [Read error: No route to host]
ayumin has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
koobs has left #ruby [#ruby]
xhh has quit [Quit: xhh]
ZachBeta has joined #ruby
<tresk>
deryldoucette: It's a bit wired if they have a doc while the install process and they don't refer to the webpage again, just in casse you miss something. but thanks I'm on it
lateau has joined #ruby
keanehsiao has joined #ruby
keanehsiao_ has joined #ruby
<keanehsiao_>
hihi.
<keanehsiao_>
anybody use eventmachine?
<keanehsiao_>
if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007.
<sie>
Any idea why one would frown upon class << self; def in favor of def self.?
fr0gprince_mac has joined #ruby
<banisterfiend`>
sie: def self. can look cleaner
<shevy>
sie I think def self.foo is easier to read
<sie>
But if my class has singleton methods only?
<banisterfiend`>
sie: i only resort to class << self when i need to
sbanwart has quit [Ping timeout: 240 seconds]
<banisterfiend`>
sie: then you could use class << self, there's really no hard and fast rules on this.
<shevy>
sie well, if you have like some hundred methods then you would have to type less via class << self
<Hanmac>
sie then you should use moduele
<sie>
Hanmac, hmm, right.
wmoxam has joined #ruby
<Hanmac>
sie, if you use module, then module_function could suid you
mcwise has left #ruby ["I quit"]
<keanehsiao_>
anybody use event machine ? if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007. Abort trap: 6
<Hanmac>
ruby does not have an assignment operator, so you changed the variable with the reassignment
<sie>
How do I call def f from module A?
<jackiechan0>
Hanmac> i don't understand why var2 at the end of the chapter that i paste is always pointing to number 8
<jackiechan0>
Hanmac> sorry it's my 2nd day studying rub
<jackiechan0>
y
ananthakumaran has left #ruby [#ruby]
<Hanmac>
var1 = 8; var2 = var1; #>>> both variables point to the same object(reference)
gtuckerkellogg has joined #ruby
<Hanmac>
var1 = 'eight' # the var1 is changed, but var2 still points to the same objectreference as before
schaerli has quit [Remote host closed the connection]
cousine has quit [Remote host closed the connection]
<Hanmac>
jackiechan0 look at the text under the code lines and you will see
<jackiechan0>
Hanmac> Yes i go this, this means that once var2 is pointing to a string or a number (as in that case) also indirectly, it will point alway to that aswell it's not specified to point to another string or number? (anyway i'm trying some experiments=)
<shevy>
jackiechan0 numbers are implemented differently
<shevy>
jackiechan0, see:
<shevy>
"foo".object_id # => 70320365068120
<shevy>
"foo".object_id # => 70320365062760
<shevy>
5.object_id # => 11
<shevy>
5.object_id # => 11
digitalcakestudi has joined #ruby
<jackiechan0>
shevy> about what i saw in my experience a variable that is pointing to another variable still point to the first variable assigmente until is not specified to point to another string or number
<shevy>
but yeah, when you assign from variable to variable
altiouz has joined #ruby
<jackiechan0>
shevy> is that correct ?
<banisterfiend`>
jackiechan0: can u say shevy: instead of shevy>
<banisterfiend`>
jackiechan0: the > is kind of jarring
<shevy>
jackiechan0 the : is cooler than the >
<shevy>
jackiechan0, what IRC client do you use?
<jackiechan0>
banisterfiend` sorry i will change > with : in my xchat options
<shevy>
wheee
<shevy>
xchat! I use xchat too
<jackiechan0>
shevy i did change : to >
<shevy>
jackiechan0 for strings yes
<jackiechan0>
shevy my error
<jackiechan0>
shevy: :)
<shevy>
jackiechan0 x = "foo" # => "foo"; y = x # => "foo"; x = "bar" # => "bar"; y # => "foo"
<shevy>
I think I managed to confuse myself
<jackiechan0>
shevy: i'm confused too
<shevy>
yeah
<shevy>
I need to get out here for a while, it's getting too hot
elkng has quit [Ping timeout: 240 seconds]
<jackiechan0>
shevy: are u working if i can ask
kyktommy has joined #ruby
virunga has joined #ruby
<keanehsiao_>
anybody use event machine ? if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007. Abort trap: 6
jwbuurlage has quit [Quit: jwbuurlage]
relix has joined #ruby
vitoravelino`afk is now known as vitoravelino
elkng has joined #ruby
cordoval has joined #ruby
ayumin has quit [Remote host closed the connection]
Morkel has joined #ruby
jrist-afk has quit [Ping timeout: 245 seconds]
yannis has joined #ruby
D3V1Lx has quit [Quit: Few women admit their age. Few men act theirs.]
lateau has joined #ruby
kil0byte_ has quit [Read error: Operation timed out]
Shoobdidoo has joined #ruby
jwbuurlage has joined #ruby
kil0byte has joined #ruby
tomb_ has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
Shoobdidoo has quit [Client Quit]
td123 has joined #ruby
cousine has joined #ruby
cousine has quit [Remote host closed the connection]
lateau has quit [Ping timeout: 245 seconds]
Morkel has quit [Quit: Morkel]
cousine has joined #ruby
jrist-afk has joined #ruby
arturaz has quit [Ping timeout: 244 seconds]
gtuckerkellogg has joined #ruby
niku4i has joined #ruby
thone_ has quit [Read error: Connection reset by peer]
thone has joined #ruby
hadronzoo has joined #ruby
Jake232 has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
heftig_ has quit [Quit: leaving]
cousine_ has joined #ruby
Axsuul has quit [Ping timeout: 245 seconds]
heftig has joined #ruby
mneorr has quit [Remote host closed the connection]
schaerli has joined #ruby
ZachBeta has joined #ruby
<tresk>
Hmm I installed Ruby 1.9.3 now but do I need to use 'bundle install' anymore or should I install this via rvm?
<eam>
from what I understand, pollfds should be a contiguous array of size struct pollfd[3]
<eam>
and get_pointer(0) should return its start address
<tresk>
ok I'm afk for a while
nari_ has quit [Ping timeout: 256 seconds]
<eam>
burgestrand: when I run it, before I do anything at all I get: pointer is: #<FFI::Pointer address=(nil)>
emmanuelux has joined #ruby
<burgestrand>
eam: for MemoryPointer.new, the first argument is the size and the second is the count, so you should not need to multiply the count by the size of the struct
<burgestrand>
Should not be the cause of that weird pointer retrieval though
<eam>
got it, thx -- but that shouldn't matter, it'd just allocate a bit more memory
<eam>
yeah
<eam>
(fixed btw)
<eam>
I'm a little unclear on the syntax for addressing an array of structs with ffi -- found some assorted examples on lists
<eam>
but the thing that confuses me most is that pollfds is nil right off the bat
<burgestrand>
Well, I believe FFI clears the allocated memory, but that it shows nil instead of 0 confuses me
rippa has joined #ruby
<eam>
well, I'm asking for the pointer, not the memory pointed to
<eam>
that ought to be a valid addresss
<burgestrand>
You’re assuming the contents of the memory at offset 0 is a pointer, while it’s a struct that’s currently zeroed out AFAIk
<burgestrand>
Sorry, not assuming, getting :)
<eam>
ah, maybe I'm not understanding the utility of get_pointer
mpereira has joined #ruby
cordoval has quit [Quit: The fear of the Lord is the beggining of wisdom]
<eam>
how do I get a pointer to the memory structure?
<eam>
I'm trying to model the struct pollfd fds[] for poll(2)
<burgestrand>
eam: well, pollfds *is* a pointer to memory that can fit three structs, not three pointers to each struct
<eam>
right
<eam>
well, pollfds is a ruby VALUE
<eam>
does ffi accept it directly for arguments that are type :pointer ?
<burgestrand>
Yeah, but it has an address and as far as FFI goes it’s a pointer when passed as an argument
<burgestrand>
Yes :)
<eam>
oh great
<eam>
easy!
yankov has joined #ruby
<burgestrand>
So if you print it, you’ll see which address it points to
lateau has joined #ruby
<burgestrand>
eam: get_pointer(N) is mostly useful when you have an array of pointers and extract them individually
<eam>
burgestrand: yeah that was it -- ret = PollThing.poll(pollfds, pollfd_len, 4)
<eam>
is all I needed
<burgestrand>
Great \o/
<eam>
I found get_pointer(0) in an example of arrays of structs, looks like that was misleading
<eam>
thanks!
wmoxam has quit [Ping timeout: 248 seconds]
<eam>
burgestrand: btw, maybe you know this -- does ruby's IO layer really not expose poll()
<eam>
I dug around and could only find IO.select and eventmachine (which doesn't provide notifications, only an event framework)
<burgestrand>
eam: no idea, sorry
<eam>
I'm kinda wondering if I've overlooked something obvious
<eam>
ok
<burgestrand>
not that I know of, at least
<eam>
thanks again!
<burgestrand>
\o.
ZachBeta has quit [Quit: Computer has gone to sleep.]
andrewhl has joined #ruby
<fowl>
burgestrand, if you read a file like x = open('...').read
lateau has quit [Ping timeout: 260 seconds]
<fowl>
doesnt it stay open
<eam>
fowl: oh, I know this one - it does
<fowl>
that is what i figured
<fowl>
i usually do open('...', &:read)
seanstickle has quit [Quit: Nihil sub sole novum]
<eam>
if you attach a block it'll call close after the yield
Karmaon has quit [Quit: WeeChat 0.3.8-dev]
jayrulez has quit [Ping timeout: 248 seconds]
kenperkins has joined #ruby
Ontolog has joined #ruby
Karmaon has joined #ruby
<eam>
that behavior surprised the heck out of me, coming from Perl -- got really used to deterministic reference counted gc
<burgestrand>
Just use File.read instead, assuming you’re playing around with files
<fowl>
open-uri actually
<burgestrand>
Opening URIs should not need to be closed. It returns a StringIO, no?
<burgestrand>
Hm, I also wonder what happens to open file handles on GC. I’d expect ruby to close them, but maybe not…
<burgestrand>
(doesn’t hurt closing a StringIO if you want to be sure, btw)
bluenemo has quit [Remote host closed the connection]
<fowl>
i think you should still close them, or pass &:read
<burgestrand>
fowl: Yeah, always good practice to close either way. I know tempfiles are properly disposed of on GC, but I’m not sure about regular files (although I would assume so).
prtksxna has quit [Ping timeout: 260 seconds]
lateau has joined #ruby
macmartine has joined #ruby
<burgestrand>
Ah. They have an #autoclose? that can be toggled on or off.
<burgestrand>
(and it defaults to true)
<fowl>
ah interesting
<fowl>
no matter how much u know about ruby you'll still learn new things about it all the time
jwbuurlage has quit [Quit: jwbuurlage]
novodinia has joined #ruby
novodinia has quit [Client Quit]
Tolnaiz has joined #ruby
<burgestrand>
I wonder what the usecase for autoclose is…
<Mon_Ouie>
#unlink is the method that actually removes the tempfile (as opposed to just closing the IO object)
<burgestrand>
Anyway, always close your files explicitly even if they are closed on GC. You might run out of FDs before Ruby runs out of memory and clear the FDs for you.
<shevy>
I just realized something ...
<shevy>
wikis usually dont seem to have todo pages
mikeycgto has joined #ruby
jayrulez has joined #ruby
<shevy>
I search for the wiki of the trinity project page (this one tries to keep KDE 3 alive), to find out whether they have an IRC channel or not. the wiki shows no search result, so I must assume they dont have an IRC channel... would be nice if I could quickly report that, then move on
Eldariof-ru has joined #ruby
<shevy>
everyone should move to github. the issue tracker is really cool :P
<keanehsiao_>
anybody use event machine ? if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007. Abort trap: 6
mneorr has joined #ruby
lateau has quit [Quit: Leaving.]
LBRapid has quit [Quit: Computer has gone to sleep.]
Eldariof27-ru has quit [Ping timeout: 252 seconds]
tommyvyo has joined #ruby
jrgifford has joined #ruby
tommyvyo has quit [Client Quit]
berserkr has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
Osaka is now known as accually-kbar
accually-kbar is now known as accually-cool
accually-cool is now known as unlike-yy
unlike-yy is now known as k
k is now known as Guest55997
Guest55997 is now known as yy-pls
ZachBeta has joined #ruby
mneorr has joined #ruby
yy-pls is now known as Osaka
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Quintus_q has joined #ruby
Karmaon has quit [Read error: Connection reset by peer]
andrewhl has quit [Quit: andrewhl]
arcresu has joined #ruby
jwbuurlage has joined #ruby
arcresu has left #ruby [#ruby]
Jooles has joined #ruby
carloslopes has joined #ruby
<Jooles>
Hey everyone. I'm having an odd problem with ruby and Qt (I've also asked this in #Qt but I think it's more the ruby that's causing me grief) and was wondering if anyone could help. I had a class that worked fine and I've now split it into two; one which manages a set of the second which does not use anything from Qt and the second which inherits from Qt::Object because it uses signals and slots. The problem is that the second class behaves as though it
<Jooles>
I get the error "RPCConnection.rb:18:in `initialize': unresolved constructor call MsfRPCConnection (ArgumentError)"
ayumin has joined #ruby
<Jooles>
line 18 is line 7 in the paste
jwbuurlage has quit [Client Quit]
<offby1>
is there a shortcut to writing "def initialize(a, b, c, d) ; @a = a; @b = b; @c = c; @d = d; end" ?
<canton7>
offby1, @a, @b, @c, @d = a, b, c, d is used quite a lot
defendguin has joined #ruby
<offby1>
Jooles: no idea sorry
<offby1>
canton7: that is something of an improvement; thanks
khakimov has joined #ruby
<canton7>
Jooles, I don't know Qt at all, but does Qt::Object have a constructor? Does it take the arguments which your constructor takes?
<offby1>
I seem to recall in Python you could pretty much say "take my argument list and shove it into my dictionary" in one fell swoop.
<canton7>
offby1, it's not perfect I know, but it's the best I've seen
willyum has joined #ruby
<Hanmac>
canton7 an other way could be: "def initialize(*args) ; @a,@b,@c,@d = args; end"
mahmoudimus has joined #ruby
PragCypher has joined #ruby
<Jooles>
offby1: Thanks anyway. It's just wierd. canton7 yes and no in that order. Changing super to super() (ie with no arguments instead of just passing up the arguments for my constructor) changes the error to one about the call to connect having the wrong number of arguments (4 for 0)
<canton7>
Hanmac, that's true -- I hadn't seen that
jwbuurlage has joined #ruby
mahmoudimus has quit [Client Quit]
deryl has joined #ruby
<canton7>
Jooles, well calling just 'super' will pass the same arguments as were passed to your method, as you found out. super() explicitey passes no arguments
<canton7>
Jooles, and your connect method doesn't take any arguments, and you're passing it some, as Ruby pointed out
S2kx has joined #ruby
<Jooles>
Oh, bollocks it's so obvious. Thanks canton7. I so need to get more sleep
<canton7>
Jooles, haha! YeahI know that feeling
<offby1>
Hanmac: that's getting there!
deryl has quit [Read error: Connection reset by peer]
deryl has joined #ruby
keanehsiao has quit [Quit: Leaving...]
<offby1>
Random question: why is "square root" not a method on numbers? Instead it's a library function. i.e., I expected to be able to type "3.sqrt" but it turns out that I have to type "Math.sqrt(3)"
digitalcakestudi has quit [Read error: Operation timed out]
<shevy>
canton7 for a simple use case, it would indeed be shorter
<offby1>
canton7: thanks. I have actually been using Structs in some other contexts; they're handy.
<shevy>
canton7 what I wonder though... the parser would have to be changed for this I suppose. is this even possible to do?
<offby1>
(Actually, I suspect I've been using them simply because I don't really think in classes, and Structs are a way to avoid learning how :-)
khakimov has quit [Quit: Computer has gone to sleep.]
<offby1>
canton7: the last comment on that page is apt.
<canton7>
shevy, I have absolutely no idea. I hadn't even considered this until 10 minutes ago
Kiall has quit [Ping timeout: 272 seconds]
<shevy>
canton7 kk
<shevy>
:)
yannis has joined #ruby
* shevy
begins to whip canton7
<shevy>
think faster!
<canton7>
haha!
<canton7>
I'm thinking, I'm thinking
deryl has joined #ruby
deryl has quit [Client Quit]
<canton7>
personally I'd be in favour of something like this, but make it very clean and fairly limited. So anything remote complex gets handled the "traditional" way, and the new syntax is *just* used for straightforward simple assignments
Ontolog has joined #ruby
PragCypher has quit [Quit: Leaving]
Sou|cutter has quit [Quit: WeeChat 0.3.0]
<offby1>
maybe a new method on Object: set_attributes
<offby1>
although you'd still have to spell out their names
<canton7>
I was wondering about that. Is there a way to list the arguments passed to a method?
<offby1>
a leetle introspection maybe
<shevy>
sounds reasonable canton7
<shevy>
canton7 hmm... there is .arity ... I think in ruby 1.9.x something new or something changed there... not sure if it is possible to list all arguments to a method per se...
Karmaon has joined #ruby
<canton7>
apparently it's possible with ParseTree...
Ontolog has quit [Ping timeout: 244 seconds]
CheeToS has joined #ruby
ivar has joined #ruby
<shevy>
cool
<fowl>
canton7, def foo(a,b,c) end; p method(:foo).parameters
advorak has quit [Quit: This computer has gone to sleep]
<Hanmac>
PS: parameters does not so good work on C-functions
nlc has joined #ruby
<Mon_Ouie>
apeiros_: Something that could be useful would be restricting the parser to a specific type of literal (although you can just raise if the resulting object doesn't meet your requirement)
khakimov has joined #ruby
<apeiros_>
Mon_Ouie: pondered that too. I'll put it into the todos
<canton7>
fowl, thanks!
ZachBeta has quit [Quit: Computer has gone to sleep.]
ukwiz has quit [Quit: Leaving]
sejo has quit [Read error: Operation timed out]
<apeiros_>
hm, just noticed that it doesn't accept trailing comas in hashes/arrays
sejo has joined #ruby
Ontolog has joined #ruby
gokul has quit [Quit: Leaving]
<fowl>
didnt ruby 1.8 let you do def method(@var, @var,..)
telos has joined #ruby
<Mon_Ouie>
no, but it lets you do that with block arguments
robdodson has quit [Quit: robdodson]
tomb_ has joined #ruby
prtksxna has joined #ruby
advorak has joined #ruby
mneorr has quit [Remote host closed the connection]
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
Aziz_ has joined #ruby
<shevy>
I find that a bit ugly actually
altiouz has quit [Ping timeout: 244 seconds]
<shevy>
{|@foo,@bar|}
<shevy>
I dont like that
dhaskew has quit [Read error: Connection reset by peer]
<telos>
hi all, i've compiled ruby from source and i get this error when i try to use digest/md5: digest/md5.so: undefined symbol: rb_Digest_MD5_Init . i have libcrypto installed... any ideas how to troubleshoot this?
<telos>
i know that this symbol is available in libcrypto.so, so i'm at a loss as to why it is not being correctly linked into md5.so
altiouz has joined #ruby
telos is now known as t3los
<shevy>
apeiros_ whoa... that is some odd syntax... never saw |$foo| before
<shevy>
t3los pls dont change your nick after asking
<shevy>
t3los I already thought you quitted
<apeiros_>
shevy: you can put in anything there that's assignable - in 1.8, that is
<apeiros_>
iirc even proc { |obj.foo| } would work, if obj responts to foo=
azm has quit [Ping timeout: 250 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<shevy>
t3los did you try to go into ext/openssl ?
tommyvyo has joined #ruby
<t3los>
shevy, sorry, i'm trying to join #rvm but i've got issues with the server
<shevy>
ah
<shevy>
so you use RVM
<t3los>
shevy, i tried using the ordinary source too . same prob
<t3los>
shevy, , i can go into ext/digest, sure
<shevy>
oh
<shevy>
it is part of digest?
<t3los>
yeah, it's digest/md5 (and sha1 and sha2)
<shevy>
yeah I see it now
<shevy>
it has directories like md5/
<t3los>
yeah
Aziz_ has quit [Remote host closed the connection]
<t3los>
and they link to openssl's libcrypto
<shevy>
yeah openssl gives me problems too sometimes
<shevy>
do you know what openssl version you have?
<offby1>
t3los: my guess is that ruby's "configure" script didn't realize that you had openssl
advorak has quit [Read error: Connection reset by peer]
<offby1>
or perhaps you don't have the openssl -development- fies
<offby1>
files
advorak has joined #ruby
khakimov has joined #ruby
<t3los>
shevy, offby1 i have them and i've properly set C_INCLUDE_PATH, etc
Aziz_ has joined #ruby
<offby1>
t3los: if you paste your config.log that _might_ be useful
<t3los>
i have the latest version of openssl libraries and include files
<offby1>
(I'm assuming that ruby uses autoconf; I don't actually know)
Ontolog has quit [Remote host closed the connection]
<t3los>
i only have a confing.log for yaml, not for ruby
<offby1>
nuts
Aziz_ is now known as capsule
<t3los>
i have configure.log, though
<shevy>
t3los ok so you have openssl-1.0.1b ?
<shevy>
I have more openssl versions it seems :\
<shevy>
libssl.so.0.9.8 libssl.so.1.0.0
<shevy>
I am glad ruby found the right one for me though ;)
<t3los>
i have 1.0.0
matti has quit [Quit: 8-X]
<offby1>
t3los: might's well paste it. No guarantees, but sometimes it helps diagnosing this sort of thing
<t3los>
the latest stable version straight form openssl
<t3los>
shevy it finds everything.. e.g. have_library: checking for main() in -lcrypto... -------------------- yes
<matti>
shevy: ;]
tayy has joined #ruby
<t3los>
shevy, running your commands didn't produce a new md5.so though
<shevy>
t3los you tried "make" yet?
mdw has joined #ruby
<shevy>
compiling md5init.c
<shevy>
compiling md5ossl.c
<shevy>
linking shared-object digest/md5.so
<shevy>
that is what I get when I do make
<shevy>
it creates a md5.so file
<t3los>
inside digest/md5, yeah?
<t3los>
yes, ok i got that
<t3los>
but where is the md5.so
<offby1>
t3los: your "configure" doesn't even seem to be looking for openssl. Perhaps you need to explicitly tell it to do so, with a command-line switch. Perhaps try "./configure --help" and see if there's an option like "--with-openssl".
kevinbond has quit [Quit: kevinbond]
nlc has quit [Ping timeout: 246 seconds]
<t3los>
offby1, i think it's because it's only for an extension
<t3los>
offby1, so it doesn't appear in the base configure log
<t3los>
shevy, ok i got a new md5.so this time ( i had to make clean )
<t3los>
shevy, problem is, if I run nm ./src/ruby-1.9.3-p194/.ext/x86_64-linux/digest/md5.so | grep MD5
<t3los>
i find that the rb_Digest_MD5_Init etc symbols are unavailable (they have a U)
pangur has quit [Remote host closed the connection]
<canton7>
offby1, this is my best attempt so far, without doing hackyish stuff like set_trace_func: http://pastie.org/3940862
nlc has joined #ruby
<offby1>
interesting.
<offby1>
That's just above my pay grade, but I can get a sense of what you're doing
fbernier has quit [Ping timeout: 252 seconds]
austinbv has quit [Quit: austinbv]
foofoobar has joined #ruby
<shevy>
looks very hackish
<shevy>
what is it doing?
<canton7>
it is very hackish
<t3los>
shevy, in md5.h you see the definition of the rb_ macros only if RUBY is defined.. i wonder if this has something to do with it
<shevy>
t3los perhaps RVM
<shevy>
well, you could try a dry configure of a ruby
<shevy>
using --prefix
<shevy>
like
<shevy>
./configure --prefix=/opt/ruby
<canton7>
You define <some_method>_default. It defines method_missing, which checks whether <method_name>_default exists. If so, it grabs that methods argument names and uses them to assign class variables before calling that method
<shevy>
then make then make install and look if that ruby works with digest
<Mon_Ouie>
canton7: In method missing, you should use super, as opposed to aliasing
petercs has quit [Quit: Leaving.]
<canton7>
Mon_Ouie, good point
mlevin_ has quit [Quit: Computer has gone to sleep.]
<t3los>
shevy i tried that too and got the same result
adambeynon has quit [Quit: adambeynon]
* offby1
would be afraid to use that in production, given that he doesn't quite understand it
<shevy>
t3los hmm ok
ivar has quit [Remote host closed the connection]
<canton7>
offby1, yeah I wouldn't recommend it. It's just a bit of fun
Jooles has left #ruby ["Leaving"]
<offby1>
I could probably swing that kinda thing in perl or python, but my ruby-fu isn't (yet) up to that
ivar has joined #ruby
<shevy>
offby1, I dont understand that ruby code either
ivancv has joined #ruby
<offby1>
are there "obfuscated ruby" contests? If not, that's probably a good statement about the language :)
<ivancv>
¿Alguien de aquí habla español?
<canton7>
offby1, there's golf.. that's pretty close at times
wvms has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
ivar has quit [Remote host closed the connection]
<shevy>
ivancv no, habemos ingles!!!
<shevy>
that word is wrong... hablar ... hablo hables habl... gah, I think it is irregular
<Mon_Ouie>
(doesn't account for method visibility though)
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
LBRapid has joined #ruby
<canton7>
Mon_Ouie, I'm actually working on a solution which does something similar to that
<canton7>
basically a hackier version of yours, but using method_added to allow line 23 to go above line 20
ThatDudeGuy_ has joined #ruby
mdw has quit [Remote host closed the connection]
<Mon_Ouie>
I don't like the way this works, it looks a bit magic when you think about it
<canton7>
yeah, I'm none too keen on the approach either. I'm just procrastinaing
<canton7>
*procrastinating
<Mon_Ouie>
method_default do … end would work and not require hacks that check if the class gets closed/reopened
advorak has quit [Ping timeout: 244 seconds]
advorak has joined #ruby
mlevin_ has joined #ruby
adeponte has joined #ruby
rboyd has quit [Quit: rboyd]
mdw has joined #ruby
Progster has joined #ruby
vandemar has quit [Ping timeout: 245 seconds]
ivar has joined #ruby
ivar has quit [Remote host closed the connection]
bluenemo has quit [Remote host closed the connection]
<Veejay>
Which is faster, foo * 2 or foo << 1?
<Veejay>
Or is it the same in the end
<offby1>
please for the love of God just write foo * 2
<offby1>
don't be clever
austinbv has joined #ruby
<Veejay>
Right
<tresk>
Mmm, ruby 1.9.3 is running,but when I do a bundle install, I get only the ./vendor/bundle/ruby/1.9.1/... installed. How can I get the 1.9.3 version installed?
<apeiros_>
Veejay: theoretically << 1, but since method-call overhead is huge in ruby, you'll probably not be able to measure a significant difference
<Veejay>
You wouldn't want to be clever about anything anyway
Ontolog has joined #ruby
<Veejay>
apeiros_: Thanks
<Fraeon>
foo * 2 is just boring
<offby1>
Fraeon: boring is good, up to a point
<Fraeon>
I'm here to write high art, not make readable code
<offby1>
the "I instantly understand this code by just glancing at it" kind of boring is good.
<offby1>
but the "this code is so repetitive that I've fallen asleep while reading it" kind is bad.
* offby1
applies for a NEA grant for Fraeon
<offby1>
Fraeon: we'll have your code right in front of City HalL!
<offby1>
by the bus shelter
<offby1>
it'll engage the community and start a robust dialog
<RubyPanther>
You still have to be very careful choosing a math operator in Ruby.
<RubyPanther>
Yay! mRuby!!
sepp2k has joined #ruby
LBRapid has quit [Read error: Connection reset by peer]
timonv has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
foofoobar has quit [Quit: bb]
LBRapid has joined #ruby
<shevy>
RubyPanther I thought you are dead
<shevy>
RubyPanther you didnt write anything in like 5 weeks
alexim has quit [Ping timeout: 265 seconds]
<Hanmac>
offby1 to scare you more in ruby there is a difference between - 1 and -1
<shevy>
offby1 were you the assembler guy?
griffindy has quit [Quit: Computer has gone to sleep.]
<t3los>
shevy, well i ended up copying the md5.so and sha2.so intalled on the server (for ruby 1.8.7) to my local folder (for 1.9.3) and it seems to work...
austinbv has quit [Quit: austinbv]
<shevy>
t3los whoa!
<shevy>
you outsmarted ruby 1.9.3 !!!
<t3los>
shevy, i guess if i encounter a problem i can ask you to share your .so's with me :)
ThatDudeGuy_ has quit [Quit: ThatDudeGuy_]
<shevy>
t3los hehe sure
ThatDudeGuy_ has joined #ruby
<t3los>
i'm getting Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. yet i have execjs and therubyracer installed
<t3los>
any ideas?
sparrovv has quit [Ping timeout: 276 seconds]
tewecske has joined #ruby
<ThatDudeGuy_>
t3los: can you post the specific error message and your os?
Soda has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
adeponte has quit [Remote host closed the connection]
<riyonuk>
Can I use ruby to interface with mysql and php? I've got to use WordPress at work, and I'd like to write ruby scripts to replace files, update them, run sql, etc.
<td123>
riyonuk: how would you interface with php?
<riyonuk>
Just file replacement really.
<riyonuk>
Guess they could be text files, for all the script cares.
adambeynon has joined #ruby
<ThatDudeGuy_>
t3los: I've never run into that specific issue on linux, but as a sanity check can you run this under rib to make sure therubyracer is available: https://gist.github.com/2759143
<ThatDudeGuy_>
t3los: *irb
<td123>
riyonuk: you can run commands with php, so you can do run 'ruby ./script.rb files'
<td123>
riyonuk: you can also certainly interact with a sqldb from within ruby
<deryldoucette>
checkout railsforphp.com - its aimed at rails, but lots of whats there are usable with straight ruby as well.
<t3los>
ThatDudeGuy_, works
<rking>
So Debian's scripts are Perl-based, Gentoo's are Python-based. ____'s are Ruby-based?
griffindy has joined #ruby
<deryldoucette>
like you can use ActiveRecord with straight ruby, ActiveModel, ActiveSupport, mongodb etc etc
<shevy>
rking there was a distribution once called rubyX, later renamed to heretix, which was written in ruby but it died
<ThatDudeGuy_>
t3los: Hrm… so execjs really doesn't locate therubyracer. Could it be a set of incompatible versions?
<deryldoucette>
that site is for taking your php knowledge and mapping it to rails, but a lot of whats done in rails is really just straight ruby. unfortunately, many users don't realize that
<td123>
rking: what scripts are you talking about?
jgrevich has quit [Read error: No route to host]
<rking>
shevy: =(
CheeToS has quit [Ping timeout: 265 seconds]
<shevy>
rking, my old plan was to write a package manager in ruby for gobolinux
<rking>
td123: All the distro stuff. E.g. dpkg is Perly and portage is Pythonly.
<t3los>
ThatDudeGuy_, i'd be surprised, i just installed them using gem...
ermines is now known as otters
<shevy>
but sadly the main guys who drove gobolinux forward, started to work full time (they were students years ago) and no longer had much time, so it all kinda died
<t3los>
ThatDudeGuy_, i'm gonna try Node.js
<yxhuvud>
shevy: can't you rewrite gems to be more suited for distributing nonruby stuff instead? :)
cordoval has joined #ruby
<shevy>
yxhuvud, hmm
<ThatDudeGuy_>
t3los: lol, that should work too
<rking>
Oh yeah, we already have a distro tool: gem.
schaerli has quit [Ping timeout: 240 seconds]
<shevy>
gem works quite nice for ruby addons
<rking>
We just need to make a kernel, init, etc. gems.
<shevy>
yeah, but together it sounds like a lot of work
<rking>
Oh, a huge amount of work, and probably not worth it. I was only wondering if there was already something doing it.
<shevy>
you kinda need to start hacking, without thinking how long it may take
<rking>
Hehe
<t3los>
ThatDudeGuy_, it's incredible, i've spent 2 days trying to make a spree installation.. i haven't played with RoR since circa 2005. i'm amazed things are still so unpolished
<shevy>
yxhuvud, it may be easier to port machomebrew to linux
<offby1>
shevy: assembler? Not I
vandemar has joined #ruby
<shevy>
they have thousand of recipes available already
<shevy>
offby1 ok, there was some other guy here who wanted to learn ruby and said he wrote assembler code many years ago
looopy has joined #ruby
<ThatDudeGuy_>
t3los: I'm also coming back to rails for the first time in a long while, and the ecosystem has gotten *much* larger, but there are also a lot of rough edges that come along with that
rboyd has joined #ruby
jgrevich has joined #ruby
niklasb has quit [Ping timeout: 276 seconds]
<ThatDudeGuy_>
t3los: out of curiosity, what linux disco are you using? I've only recently built apps on ubuntu and mint and uncommenting 'gem "therubyracer"' in my Gemfile didn't cause any issues. I'd like to know what to watch out for
<ThatDudeGuy_>
*distro
<offby1>
shevy: scraping my logs: [Sun May 20 2012] <orealis> SO.... I haven't touched programming since assembly back on amiga in the late 80's.... would ruby be a good thing to try and learn? I basically have been reset to n00b..
ddv has quit [Quit: *poof*]
<shevy>
offby1 oh yeah
<shevy>
two guys with nicks starting with 'o'
<t3los>
ThatDudeGuy_, Debian 4.3.2-1.1
<shevy>
hard to separate who is who :)
<t3los>
ThatDudeGuy_, i dont' have admin rights though, so i'm doing it all myself in my home directory
<shevy>
ThatDudeGuy_, I am using Linux Disco 1.0 !!!
<shevy>
everyday I'm shuffling it
<t3los>
ThatDudeGuy_, and of course, node.js failed to compile... can't find SSL_select_next_proto, surely something wrong with my openssl install, even though it's the latest stable version
[Tritium] has joined #ruby
fr0gprince_ has quit [Ping timeout: 252 seconds]
<ThatDudeGuy_>
shevy: I so hope there's a distro named Linux Disco. Totally useless, but lots of flashing tiles
<shevy>
ThatDudeGuy_ LOL
<shevy>
ThatDudeGuy_ the <marquee> distribution!
<ThatDudeGuy_>
shevy: lol
<rking>
I was pretty impressed to find out that Firefox still honors <blink>
<ThatDudeGuy_>
t3los: that's a bummer. unfortunately I usually have bull-in-a-china-shop rights on my linux distros, so I'm not sure what issues crop up there
<[Tritium]>
it depends on the dtd
<rking>
[Tritium]: Aaha, that makes sense.
SmoothSage has quit [Ping timeout: 248 seconds]
<[Tritium]>
and if there is no dtd... any tag that ever existed is allowd...allowed?... or at least that is how it used to be.
techhelp has quit [Quit: This computer has gone to sleep]
carloslopes has quit [Quit: Leaving]
LBRapid has quit [Read error: Connection reset by peer]
fr0gprince_ has joined #ruby
yoklov has joined #ruby
indian has joined #ruby
deobald__ has joined #ruby
<t3los>
ThatDudeGuy_, incredible, doesn't even find mustang
schaerli has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ has joined #ruby
dhaskew_ is now known as dhaskew
<ThatDudeGuy_>
t3los: sorry, i'm not familiar with mustang. is that a java runtime?
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
netogallo has quit [Ping timeout: 245 seconds]
<t3los>
ThatDudeGuy_, yeah, once that's meant to be supported by execjs
nars has joined #ruby
willyum has quit [Ping timeout: 244 seconds]
snearch has quit [Quit: Verlassend]
kenperkins has quit [Quit: Computer has gone to sleep.]
kaspernj has joined #ruby
maletor has joined #ruby
<ThatDudeGuy_>
t3los: ahh, gotcha. it's still weird that execjs doesn't find therubyracer if you have no trouble loading it via "require 'therubyracer'". That's how execjs should be detecting it. Is there some way to debug execjs to see why it's failing?
<RubyPanther>
shevy: I was here, but mostly I was busy coding
kenperkins has joined #ruby
<t3los>
ThatDudeGuy_, it's line 50 in execjs/runtimes.rb .. the autodetect function
<RubyPanther>
but mRuby will change everything, this is going to be huge
<t3los>
ThatDudeGuy_, sorry it's been a while since i coded in ruby.. how can i call the autodetect function from within ruby?
schaerli has quit [Remote host closed the connection]
<t3los>
ThatDudeGuy_, it's a function of the Runtimes module which is nested in the ExecJS module
<ThatDudeGuy_>
t3los: I'm not sure… playing around with it now :)
cpruitt has quit [Quit: cpruitt]
mdw_ has joined #ruby
yannis has quit [Read error: Connection timed out]
mrbrdo has joined #ruby
<ThatDudeGuy_>
t3los: On my OSX machine, I was able to instantiate xr = ExecJS.::RubyRacerRuntime.new and call xr.available?
<ThatDudeGuy_>
t3los: which returned true in my case
<ThatDudeGuy_>
t3los: (after require 'execjs')
<t3los>
same here
griffindy has quit [Quit: Computer has gone to sleep.]
<mrbrdo>
ruby 1.9.3 isn't CoW friendly yet right?
mdw has quit [Ping timeout: 245 seconds]
<ThatDudeGuy_>
t3los: hmm… getting closer
netogallo has joined #ruby
mneorr has quit [Remote host closed the connection]
Elfix has quit [Ping timeout: 260 seconds]
<ThatDudeGuy_>
t3los: what about ExecJS::Runtimes.best_available
<t3los>
ThatDudeGuy_, i get #<ExecJS::RubyRacerRuntime:0x00000000f5bc70>
cpruitt has joined #ruby
savage- has quit [Remote host closed the connection]
banisterfiend` has quit [Read error: Connection reset by peer]
<ThatDudeGuy_>
t3los: Interesting. So execjs on its own can find an available runtime… what was your original error when running the app?
<t3los>
ThatDudeGuy_, ib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
<ThatDudeGuy_>
t3los: If ExecJS::Runtimes::auto detect returns a RubyRacerRuntime, then we can at least eliminate execjs as the issue
banisterfiend` has joined #ruby
<ThatDudeGuy_>
"ExecJS::Runtimes::auto_detect"
<ThatDudeGuy_>
t3los: My autocorrect is having issues… ExecJS::Runtimes.autodetect
<t3los>
ThatDudeGuy_, hmm i seem to have two versions of execjs. 1.4.0 and 1.3.2
jgrevich has quit [Ping timeout: 248 seconds]
<shevy>
RubyPanther you really think so about mRuby?
<ThatDudeGuy_>
t3los: If you modify your Gemfile to use a specific version, does that make a difference: gem "execjs", "~> 1.4.0"
ikaros has quit [Remote host closed the connection]
<RubyPanther>
shevy: I don't think it will become a new consumer phone platform, for example, but I think it could become the new platform for everything from consumer GPS units to federation tricorders. Oh yeah, and robots.
<ThatDudeGuy_>
RubyPanther: mRuby + sqlite seems like a powerful combination of ultra-portable, embeddable C libraries
bnagy has quit [Ping timeout: 252 seconds]
<shevy>
cool
<RubyPanther>
yeah, too big for arduino but perfect for raspberry pi
adeponte has joined #ruby
bnagy has joined #ruby
<RubyPanther>
if you want to build your RubyOS now is the time to start, you can have an mRuby kernel
jgrevich has joined #ruby
<t3los>
ThatDudeGuy_, i'm running spree install .. not sure exactly where the execjs requirements are specified
cdepue has quit [Remote host closed the connection]
Araxia_ has joined #ruby
<mrbrdo>
what's the point of mruby?
<t3los>
ThatDudeGuy_, but in any case, with 1.3.2 ExecJS::Runtimes.best_available works fine
<t3los>
ThatDudeGuy_, here, ExecJS::Runtimes.autodetect works fine too
niklasb has joined #ruby
<becom33>
on this Im getting a error http://pastie.org/3941422 .help.rb:25: warning: already initialized constant Debhelp
<ThatDudeGuy_>
t3los: Cool. So your system is working fine. I'm going to install spree to see how their system works. BRB
Elfix has joined #ruby
<shevy>
RubyPanther, I'll do the RubyOS in a reversed way. I'll improve the general toolset first
<shevy>
RubyPanther, since today in my pseudo shell, I can do "irc ruby" and it will connect me to ruby! all using ruby
<shevy>
I mean, #ruby here
<becom33>
shevy, can you give a second to look at my paste :/
<ThatDudeGuy_>
shevy: I like it. The bottom-up OS project. Start with the shell and work down to scheduling :)
<RubyPanther>
Well, that is the user environment not the operating environment. Both are important, to be sure.
<becom33>
shevy, its checking automatically on dir using DIR . well it doesnt have a another file . but I'll show you a git
<ThatDudeGuy_>
t3los: It looks like spree piggy-backs on a regular rails install. Do you have a Gemfile in your project root?
looopy has quit [Remote host closed the connection]
<t3los>
ThatDudeGuy_, i do
ph^ has quit [Remote host closed the connection]
<ThatDudeGuy_>
t3los: try uncommenting the line "# gem 'therubyracer', :platform => :ruby"
ronniy has quit [Remote host closed the connection]
<ThatDudeGuy_>
t3los: and running `bundle install`
<t3los>
ThatDudeGuy_, there wasn't a line like that but i added some requires and now it woroks
techhelp has joined #ruby
<t3los>
ThatDudeGuy_, i added execjs, therubyracer and mustang.. not sure which one sorted it out , but it's sorted!
<ThatDudeGuy_>
t3los: Rock on! Good luck with the app!
<t3los>
ThatDudeGuy_, cheers, thanks for your help
<ThatDudeGuy_>
t3los: no problemo
ViperMaul has quit [Ping timeout: 244 seconds]
mpereira has quit [Ping timeout: 252 seconds]
<Hanmac>
shevy the mruby c interface looks interesting :P
mikepack has joined #ruby
rippa has quit [Ping timeout: 245 seconds]
virunga has quit [Quit: Sto andando via]
seanstickle has joined #ruby
ViperMaul has joined #ruby
Chryson has quit [Ping timeout: 276 seconds]
tomb_ has quit [Quit: Computer has gone to sleep.]
Eldariof59-ru has quit []
maletor has quit [Quit: Computer has gone to sleep.]
Chryson has joined #ruby
<becom33>
shevy, http://pastie.org/3941422 in this paste . if I require this file in some other files . it will initialize everytime this file require right ?
looopy has joined #ruby
mikeycgto has quit [Ping timeout: 246 seconds]
<ThatDudeGuy_>
becom33: It will, assuming the $LOAD_PATH is the same between all of your other files.
<becom33>
ThatDudeGuy_, with out initializing the file in path I cant require this file to other module to do what I've in line 30
austinbv has joined #ruby
looopy has quit [Remote host closed the connection]
<becom33>
so everytime I read other file it initialize and it gives a warning
<becom33>
what can I do to fix that ?
sepp2k has quit [Remote host closed the connection]
moshee has quit [Ping timeout: 244 seconds]
quest88 has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
davidpk has joined #ruby
tewecske has quit [Read error: Connection timed out]
<ThatDudeGuy_>
becom33: Can you post an example of the way it's used in another file and the warning it give?
<ThatDudeGuy_>
*gives?
<becom33>
ThatDudeGuy_, sure
griffindy has joined #ruby
kaspernj has quit [Remote host closed the connection]
mneorr has joined #ruby
<shevy>
becom33, yes. require './lib/command_execution' <-- it will pull in all that is inside file command_execution.rb
<canton7>
(unless I've missed some part of your spec, which is reasonably likely)
looopy has joined #ruby
elkng has quit [Ping timeout: 252 seconds]
<apeiros_>
oy, discription -> description
ivar has joined #ruby
<canton7>
that was copy-pased from becom33 's gist *innocence*
kil0byte has joined #ruby
looopy has quit [Remote host closed the connection]
<ivancv>
Anyone know a how about configuring apache/nginx with passenger for better performance?
mdw has joined #ruby
* canton7
experience with passenger is poking various config options before realising that there's no way to stop the poor server from screaming for more ram, and shifting it to heroku
* apeiros_
switched to php
LBRapid has joined #ruby
<mrbrdo>
apeiros_ lol
mdw_ has quit [Ping timeout: 246 seconds]
sparrovv has joined #ruby
ddv has quit [Quit: *poof*]
ivar has quit [Ping timeout: 246 seconds]
austinbv has joined #ruby
ivar has joined #ruby
<becom33>
canton7, thanks I got the idea . it works
heisenmink has joined #ruby
<heisenmink>
How come you can run code outside of method definitions in classes?
Vendethiel has quit [Quit: je ne suis plus là, tqvu]
austinbv has quit [Client Quit]
cousine has joined #ruby
ivar has quit [Read error: Connection reset by peer]
<apeiros_>
heisenmink: that's how ruby works
<Hanmac>
heisenmink, because ruby is procedual too (or looks like that)
austinbv has joined #ruby
<apeiros_>
your class definition itself *is* code
austinbv has quit [Client Quit]
cousine has quit [Remote host closed the connection]
<heisenmink>
What's it called?
virunga has joined #ruby
<apeiros_>
I don't think there's a specific term for that
<heisenmink>
It is really a nice thing, but I just want to eliminate the mystery
digitalcakestudi has joined #ruby
ssand has quit [Quit: Leaving]
looopy has joined #ruby
<CannedCorn>
is it possible that rb_enc_get is the same as calling .encoding on a string yeah?
<CannedCorn>
I'm getting less specific results this way
<heisenmink>
how can I do 3.minutes and similar if the integer if the class doesn't contain those methods? or are they a part of ruby?
piotr_ has joined #ruby
ivar has joined #ruby
TandemAdam has joined #ruby
TandemAdam has quit [Read error: Connection reset by peer]
ella has quit [Ping timeout: 252 seconds]
<burgestrand>
heisenmink: you reopen the target class and add the methods. 3.minutes in particular is not part of ruby itself.
yxhuvud has quit [Ping timeout: 246 seconds]
looopy has quit [Remote host closed the connection]
andrewhl has joined #ruby
<heisenmink>
burgestrand, thanks. How is that done though? Integer.add_method :minutes, do .. end ?
<heisenmink>
is wrapping a class in a module declaration equivalent to defining it with a namespae like: class Namespaec::Banana ?
timonv has quit [Remote host closed the connection]
<burgestrand>
The final constant is named the same, but there are some differences. If you write class Namespace::Banana, it will raise an error if Namespace is not already defined.
fukushim_ has joined #ruby
jgrevich has quit [Ping timeout: 245 seconds]
jgrevich_ is now known as jgrevich
ivar has quit [Ping timeout: 265 seconds]
cordoval has left #ruby [#ruby]
fukushima has quit [Ping timeout: 276 seconds]
<mrbrdo>
I don't think Ruby has namespaces, it only has Modules
<Hanmac>
module are better then namespaces
<mrbrdo>
sure :)
<apeiros_>
modules are rubys namespaces.
<apeiros_>
(and classes are modules, and thus namespaces too)
techhelp has quit [Quit: This computer has gone to sleep]
<apeiros_>
s/classes are modules/Class inherits from Module/
<Hanmac>
and module are mixins too
jgrevich has quit [Quit: jgrevich]
sparrovv has quit [Ping timeout: 240 seconds]
mneorr has quit [Remote host closed the connection]
perlsyntax has joined #ruby
looopy has joined #ruby
looopy has quit [Remote host closed the connection]
skogis has quit [Ping timeout: 248 seconds]
willyum has joined #ruby
Vert has joined #ruby
banseljaj is now known as imami|afk
niklasb has quit [Ping timeout: 248 seconds]
visof has joined #ruby
perlsyntax has quit [Remote host closed the connection]
mikepack has quit [Remote host closed the connection]
mrwalker has joined #ruby
t3los has quit [Quit: leaving]
looopy has quit [Remote host closed the connection]
heisenmink has quit [Ping timeout: 248 seconds]
hadees has joined #ruby
tommyvyo has joined #ruby
Axsuul has joined #ruby
<macmartine>
How might I DRY this up? Notice the only difference is one gets event "in_future" while the other get those "in_past" https://gist.github.com/2759628
Tuxist has quit [Read error: Connection reset by peer]
<macmartine>
Thanks guys. Oh, I need a ,uniq?
niklasb has joined #ruby
<apeiros_>
Events.in_future(account.now).where(:account_id => accounts.map(&:id), :client_id => accounts.map(&:client_id)) # I *think* this should be correct
<apeiros_>
meh, s/Events/Event/
<apeiros_>
oh
<apeiros_>
each account has its own "now"?
<fowl>
u meant account_id: .., client_id: .. right?
<macmartine>
heftig: What is the .uniq for? I know what it does, but why is it needed here?
<heftig>
flat_map concatenates
wallerdev has joined #ruby
<heftig>
arr1 | arr2 also concatenates, then removes duplicates
<heftig>
uniq removes duplicates.
<macmartine>
ah. thanks, all
<apeiros_>
heftig: actually it removes duplicates while concatenating :-p
<apeiros_>
</nitpick>
<heftig>
wah wah wah
<apeiros_>
| doesn't ensure order either
<apeiros_>
(it will be in order due to the way it is implemented)
<heftig>
it's a union, but without the awesomeness that is Set
jimeh2 has quit [Quit: bye]
pangur has joined #ruby
netogallo has quit [Ping timeout: 248 seconds]
<CannedCorn>
guys where can i learn to make an external iterator in ruby
fukushim_ has quit [Ping timeout: 244 seconds]
<apeiros_>
so, literal_parser gem released.
visof has quit [Ping timeout: 246 seconds]
fukushima has joined #ruby
<pangur>
a=names.sort; a.each do |n| puts n displays rows of names. If I do a.each do |n| puts n[0] instead, it gives me rows of what look like ascii values. What I really want to do is to split a on a comma but it does not let me do that.
ZachBeta has quit [Quit: Computer has gone to sleep.]
<heftig>
first of all, eww 1.8 :( . use 1.9
* apeiros_
wonders how ruby should know that by n[0] pangur means "split by comma"
<heftig>
anyway, n.split(",")
<pangur>
Ah, it is n that I split rather than a.
<apeiros_>
and probably not "puts", unless by saying "split by comma" you meant "the part before the first comma"
<pangur>
THanks heftig :)
<apeiros_>
and if you meant that, then .split is incomplete.
<pangur>
I want to do split (', '), which is a comma and a space.
<heftig>
split(/,\s*/)
<pangur>
Is that what you mean?
jimeh has joined #ruby
<apeiros_>
pangur: no, I mean that you'll not get a string back from split
<apeiros_>
you'll get an array back
<apeiros_>
and while puts can deal with an array as argument, it's quite possibly not doing what you want
<heftig>
if you're not interested in what's after the comma, n[/^[^,]+/]
<pangur>
I am interested in what is after the comma - It is stuff like "MacLeod, Calum", so what you are saying is very useful to me.
<macmartine>
heftig: So, I only need that .uniq if multiple accounts can be associated with the same events, correct?
<heftig>
yes
pro has joined #ruby
<pro>
hello
<heftig>
macmartine: but given sane time handling, apeiros_' way is probably the best
<pro>
matchwinners += rps_game_winner(game[$i][0]) should increase matchwinner.size by 1 but it increases it by 2 because rps_game_winner returns 2 parts, how can i save them in one
<heftig>
<<
<heftig>
instead of +=
* pangur
is grateful for the help that he has received.
<pangur>
Thanks
mdw has quit [Remote host closed the connection]
<pro>
thanks
notjohn has joined #ruby
schovi has quit [Remote host closed the connection]
TheFuzzball has quit [Write error: Connection reset by peer]
ZachBeta has joined #ruby
TheFuzzball has joined #ruby
mengu has joined #ruby
<apeiros_>
pro: btw., the use of globals is not very pro.
mrwalker has quit [Remote host closed the connection]
* Hanmac
not use globals in any of his own stuff
piotr_ has quit [Remote host closed the connection]
<CannedCorn>
what is the best way to check if an object is enumerable?
<pangur>
http://fpaste.org/j6RJ/ is my attempt to sort by surname. There must be a neater/shorter way.
<pangur>
It works but it looks like a lot of effort for something very simple.
<burgestrand>
CannedCorn: you often don’t. You check for the existence of methods instead using respond_to?
wvms has left #ruby [#ruby]
<CannedCorn>
so, each might be a good one
<fowl>
pangur, i would break them into names like [ [Fred, Smith], [Burger, Stand] ] and sort by x[1]
<kinesis>
Hey how do i fix this (trying to generated random hex colors into an array) : http://pastebin.com/Wd67TcyC
<Hanmac>
CannedCorn: the C way would be object.is_a?(Enumerable), the ruby way would be object.respond_to?(:each)
<pangur>
Hanmac, I know about the csv module but wanted to learn how to do it "manually" too as it were :)
<CannedCorn>
burgestrand thanks
<fowl>
apeiros_, always forget about that
<apeiros_>
kinesis: got an answer?
<fowl>
names.sort_by { |n| n[/\S+$/] } looks a lot nicer
<pangur>
Thanks fowl
<apeiros_>
kinesis: Array#+ expects an Array as value (line 6)
<apeiros_>
use <<, or go with colors = Array.new(16) { …color… } directly
<pangur>
It just seemed to me to be so verbose - what I was doing - even though it worked. Thanks folks. Tomorrow, I shall try out these suggestions. It is heading towards midnight here in Paisley.
<apeiros_>
also that way of generating the number has a heavy bias against 0xffffff (%0x rounds down)
<apeiros_>
you should use rand(0x1000000) instead
pygospa has joined #ruby
pangur has quit [Remote host closed the connection]
cj3kim has joined #ruby
emet has joined #ruby
zastaph has quit []
dangerousdave has quit [Quit: Leaving...]
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
Foxandxss has joined #ruby
nfk has quit [Quit: yawn]
ZachBeta has quit [Quit: Computer has gone to sleep.]
nilg has quit [Ping timeout: 245 seconds]
looopy has quit [Remote host closed the connection]
andrewhl has quit [Quit: andrewhl]
dsimon has joined #ruby
seanstickle has quit [Quit: seanstickle]
Solnse has quit [Read error: No route to host]
virunga has quit [Quit: Sto andando via]
ChampS666 has quit [Ping timeout: 244 seconds]
riyonuk has quit [Read error: Connection reset by peer]
wvms has joined #ruby
riyonuk has joined #ruby
Ontolog has joined #ruby
ChampS666 has joined #ruby
ChampS666 has quit [Client Quit]
indian has quit [Read error: Connection reset by peer]
riyonuk has quit [Read error: Connection reset by peer]
becom33 has quit [Quit: Leaving]
<dsimon>
CannedCorn, only thing i can think of is that you can shave off one line by doing (hash[key] ||= []) << value
<dsimon>
i'm not sure if that's "better" though, just shorter
nari_ has joined #ruby
phipes has quit [Quit: phipes]
riyonuk has joined #ruby
Solnse has joined #ruby
indian has joined #ruby
indian has quit [Changing host]
indian has joined #ruby
telos has joined #ruby
<telos>
hi, when i run dispatch.fcgi for RoR from the terminal, i get a load error for 'fcgi', traced back to rack-1.4.1/lib/rack/handler/fastcgi.rb . but i have fcgi installed.. any ideas on how to debug this?