apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p362: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
sailias has quit [Ping timeout: 248 seconds]
Nisstyre has joined #ruby
mneorr has quit [Ping timeout: 276 seconds]
ossareh has joined #ruby
adeponte has quit [Remote host closed the connection]
<Spooner> platzhirsch : No, you don't ned to do that, since rubygems will do it for you. You will need to start it manually (if testing) with: ruby -Ilib bin/command
emergion has quit [Ping timeout: 264 seconds]
jds has quit [Remote host closed the connection]
adeponte has joined #ruby
dankest has quit [Quit: Leaving...]
mjolk has quit [Quit: Leaving]
the_hack has joined #ruby
gyre007 has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
nari has quit [Ping timeout: 248 seconds]
tomzx has quit [Quit: tomzx]
viuo has quit [Ping timeout: 276 seconds]
S1kx has quit [Ping timeout: 240 seconds]
_carloslopes has joined #ruby
<platzhirsch> Spooner: ah ok, so -l[library directory] ?
carloslopes has quit [Read error: Connection reset by peer]
fourq has quit [Ping timeout: 264 seconds]
<Spooner> Not -l (lower L), -I (capital i).
LouisGB has quit [Ping timeout: 256 seconds]
<platzhirsch> i for include
szck has quit [Quit: Leaving.]
<Spooner> No idea.
<lupine> protip for the year: don't have web services that receive yaml
matchaw_ has quit [Ping timeout: 260 seconds]
AxonetBE has left #ruby [#ruby]
viuo has joined #ruby
zastern has quit [Remote host closed the connection]
_carloslopes has quit [Remote host closed the connection]
Russell^^ has quit [Quit: Russell^^]
dougireton has quit [Quit: Leaving.]
x0F has quit [Read error: Connection reset by peer]
fir_ed has quit [Ping timeout: 248 seconds]
x0F has joined #ruby
miskander has quit [Quit: miskander]
AndIrc_65 has joined #ruby
rburton- has quit [Quit: Linkinus - http://linkinus.com]
ossareh has quit [Ping timeout: 255 seconds]
r3nrut has joined #ruby
segv-_ has quit [Quit: segv-_]
katherinem13 has quit [Remote host closed the connection]
gridaphobe has joined #ruby
c3vin has joined #ruby
katherinem13 has joined #ruby
daniel_- has joined #ruby
pyx has joined #ruby
mneorr has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
pyx has quit [Client Quit]
Takehiro has joined #ruby
matchaw_ has joined #ruby
joofsh has quit [Remote host closed the connection]
jjang_ has joined #ruby
miphe has quit [Quit: Leaving]
gpato has joined #ruby
digitalsanctum has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
freeayu__ has joined #ruby
jpfuentes2 has joined #ruby
carloslopes has joined #ruby
jjang has quit [Ping timeout: 276 seconds]
stunrr has joined #ruby
Maniacal has quit [Quit: Leaving]
stunrr has quit [Client Quit]
breakingthings has joined #ruby
szck1 has joined #ruby
horofox_ has joined #ruby
stim371 has quit [Quit: stim371]
brianpWins has quit [Quit: brianpWins]
pkrnj has joined #ruby
Takehiro has quit [Ping timeout: 248 seconds]
horofox has quit [Ping timeout: 244 seconds]
jromine has quit [Remote host closed the connection]
horofox_ is now known as horofox
emmanuelux has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 246 seconds]
Nisstyre has quit [Ping timeout: 255 seconds]
flip_digits has joined #ruby
_46bit has joined #ruby
radic has quit [Quit: Verlassend]
jds has joined #ruby
slainer68 has quit [Remote host closed the connection]
S1kx has joined #ruby
slainer68 has joined #ruby
sealeaf has joined #ruby
<sealeaf> how do you check if something is an instance of a class?
luckyruby has quit [Remote host closed the connection]
the_hack has quit [Quit: Computer has gone to sleep.]
radic has joined #ruby
slainer68 has quit [Remote host closed the connection]
tjbiddle_ has joined #ruby
jrist-doctor is now known as jrist
stkowski has quit [Quit: stkowski]
xnm has joined #ruby
baroquebobcat has quit [Ping timeout: 248 seconds]
<blazes816> sealeaf: the_var.is_a?(String)
tjbiddle has quit [Ping timeout: 248 seconds]
<sealeaf> blazes816: thanks
ossareh has joined #ruby
ajones has left #ruby [#ruby]
tjbiddle_ has quit [Ping timeout: 248 seconds]
_46bit has left #ruby [#ruby]
stkowski has joined #ruby
<RubNoob> Gate have you seen a rails page not load a specific css file in some instances but not others?
Vert has joined #ruby
<RubNoob> Gate I'm having an issue where sometimes when I click a link, it brings me to a page and the styling is correct (loads the css), but in other cases, the css page isn't loaded
dankest has joined #ruby
r3nrut has quit [Ping timeout: 256 seconds]
adkron has joined #ruby
main has quit [Ping timeout: 255 seconds]
havenn has quit [Read error: Connection reset by peer]
mercwithamouth has joined #ruby
nycjv321 has joined #ruby
<nycjv321> " invalid byte sequence in UTF-8 (ArgumentError)" What does this mean? trynig to make a simple regex in Ruby
woolite64 has quit []
jds has quit [Ping timeout: 256 seconds]
<nycjv321> hmmm im doing something wrong
Takehiro has joined #ruby
ryanf has quit [Ping timeout: 276 seconds]
yshh has joined #ruby
karasawa has joined #ruby
hotovson has quit [Remote host closed the connection]
blazes816 has quit [Quit: blazes816]
<Gate> RubNoob: have you looked in your log to see if there is a corresponding error when it is missing?
slonimsky_1234 has joined #ruby
Goles has joined #ruby
IrishGringo has joined #ruby
<RubNoob> Gate yes, actually, there are no errors on the server side, but the browser is reporting a 500 error when attempting to get stylsheets from the server
<RubNoob> @Gate and it's not consistent, sometimes its one stylesheet, other times its a different one and the first one loaded just fine
<RubNoob> Gate it is very confusing
dr_neek has joined #ruby
Goles has quit [Client Quit]
<Gate> RubNoob: I presume you are on a recent version of rails? (3.*)
`brendan has joined #ruby
<RubNoob> Gate yes, 3.2.8
Takehiro has quit [Ping timeout: 246 seconds]
<Gate> RubNoob: same version I was on a few weeks ago :)
<RubNoob> oh, should I update?
rismoney has quit [Ping timeout: 244 seconds]
<Gate> RubNoob: definitely, there have been several major security fixes. However it probably won't solve your current problem.
<RubNoob> Gate yea, I can't see how it would given I can't find anything specific to this error in this release
<Gate> RubNoob: well, the problem your having is in a big moving part that I don't believe has been updated recently called the Asset Pipeline (forgive me if you know this already)
<RubNoob> Gate yea, so I know of the asset pipeline, but not enough to know whether there is a specific issue with this
d2dchat has joined #ruby
<Gate> There are things that I can imagine causing your problem, but I'm baffled by the fact that they are intermittent
slonimsky_1234 has left #ruby [#ruby]
slonimsky_1234 has joined #ruby
<Gate> RubNoob: I would track down your apache logs (or whatever server you are seeing) and see if you can find out more information about the 500
<RubNoob> Gate ok, thanks for the info
<Gate> RubNoob: GL, I'll be away for a while, but I'll check back here later tonight.
ryanf has joined #ruby
sepp2k has quit [Remote host closed the connection]
freakazoid0223 has quit [Quit: Leaving]
<RubNoob> Gate it actually happens on a page refresh
<RubNoob> strange
AndIrc_65 has quit [Read error: Connection reset by peer]
taoru has joined #ruby
slonimsky_1234 has quit [Quit: slonimsky_1234]
naquad has quit [Ping timeout: 260 seconds]
<nycjv321> why would I get this error when trying to do a regex in ruby? in `=~': invalid byte sequence in UTF-8 (ArgumentError) against a line in a block?
slainer68 has joined #ruby
<nycjv321> im looping over an input file with each line as "line"
baroquebobcat has joined #ruby
<nycjv321> I think Iknow why
tomzx has joined #ruby
<Spooner> nycjv321 : Because you are using an invalid byte sequence in the string. We'd have to see the regexp to know exactly what is causing the pain.
IcyDragon has joined #ruby
<nycjv321> The regex is "/.*/i" I think I know why. Line one has this "??+"
IceDragon has quit [Ping timeout: 248 seconds]
mmitchell has joined #ruby
<nycjv321> what solves this is setting the position past the first four bytes. But the question is... is this normal?
carloslopes has quit [Remote host closed the connection]
<Spooner> nycjv321: I'm guessing those aren't question marks, but just displayed as such.
<Spooner> "??+".force_encoding("UTF-8") =~ /.*/i is fine.
<nycjv321> spooner 'zacky
<nycjv321> ah force_encoding is a good idea!
<Quadlex> Time to buy a new laptop bag
miskander has joined #ruby
<Quadlex> Ouch... Mission Workshop bags are gorgeous but pricy
slainer68 has quit [Ping timeout: 246 seconds]
marr has quit [Ping timeout: 246 seconds]
tomzx has quit [Quit: tomzx]
mengu has quit [Quit: Leaving]
dmerrick has quit [Quit: dmerrick]
<Spooner> nycjv321 : Forcing it to ASCII might help. No idea.
naquad has joined #ruby
neurotech has joined #ruby
fyolnish has joined #ruby
<shevy2> the joy of encoding - welcome to ruby 1.9
johnmilton has quit [Remote host closed the connection]
ryanh has quit [Quit: Computer has gone to sleep.]
speakingcode has quit [Disconnected by services]
wroathe has quit [Ping timeout: 252 seconds]
zeade has quit [Quit: Leaving.]
Xeago has quit [Remote host closed the connection]
<nfk> shevy2, we were dissing ruby 1.9 for that in an unrelated channel just 5 hours ago
<nfk> also, did you know that rails acts in really weird ways if one of the parent folders (not part of the rails project) contains UTF-8 characters?
<nfk> i learned it the hard way
szck1 has quit [Quit: Leaving.]
baroquebobcat has quit [Quit: baroquebobcat]
TomyLobo has quit [Read error: Operation timed out]
banisterfiend is now known as banister`sleep
gridaphobe has quit [Ping timeout: 276 seconds]
hybris has joined #ruby
MissionCritical has quit [Read error: Connection reset by peer]
mrsolo has quit [Quit: Leaving]
nfk has quit [Quit: yawn]
timbobot112233 has joined #ruby
Spooner has quit []
stkowski has quit [Quit: stkowski]
lolcathost has quit [Ping timeout: 260 seconds]
lolcathost has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
slonimsky has joined #ruby
<nycjv321> if my pattern is something like /Track Number/ and my input string is something like blahblahblah Track Number abasdhahsdhlasd any reason why it wouldn't find any matches?
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
doug has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
<doug> gotta two dimensional array, would like to find the shortest (textually) way to iterate over it. the loop innards has to have the current indices as well as the current value within the array...
<doug> ary.each_with_index {...each_with_index { ... } } being one way
<doug> was hoping there was something that didn't look like two loops
SCommette has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
x82_nicole has joined #ruby
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
flaccid has joined #ruby
<flaccid> hey guys in ruby how do i get the home directory of a specific user?
ephemerian has quit [Quit: Leaving.]
woolite64 has joined #ruby
Sgeo_ has joined #ruby
TomyLobo has joined #ruby
<nycjv321> flaccid: get output of pwd?
<flaccid> nycjv321: its not for the current user
<nycjv321> flaccid: ah for a specific user
platzhirsch has quit [Read error: Connection reset by peer]
MissionCritical has joined #ruby
beilabs has quit [Disconnected by services]
beilabs_ has joined #ruby
timbobot112233 has joined #ruby
sealeaf has left #ruby [#ruby]
timbobot112233 has quit [Remote host closed the connection]
brandon_ has joined #ruby
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
<flaccid> i'm not sure if Dir.home is in ruby 1.8
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
* Kovensky is pretty sure one should just use 1.9
<flaccid> not in my control
<Kovensky> rbenv? :>
elaptics`away has quit [Ping timeout: 260 seconds]
<flaccid> not in my control
timbobot112233 has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
<postmodern> flaccid, Gem.user_home
tcurdt has joined #ruby
<flaccid> postmodern: thanks. how do i do that for a given user ?
Pip has quit [Ping timeout: 248 seconds]
timbobot112233 has joined #ruby
<flaccid> postmodern: it does not take any arguments
elaptics`away has joined #ruby
timbobot112233 has quit [Remote host closed the connection]
pvh___ has quit [Quit: Connection closed for inactivity]
icole has quit [Remote host closed the connection]
slonimsky has quit [Quit: slonimsky]
<flaccid> this is a pretty weird limitation of ruby it seems
timbobot112233 has joined #ruby
pcarrier has quit []
tcurdt has quit [Client Quit]
ttt has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
slonimsky has joined #ruby
jonahR has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
<postmodern> flaccid, ah no idea
<postmodern> flaccid, ruby has an Etc library in stdlib
taoru_ has joined #ruby
freeayu has joined #ruby
szck has joined #ruby
jduan1981 has quit [Ping timeout: 265 seconds]
joeycarmello has quit [Remote host closed the connection]
freeayu has quit [Remote host closed the connection]
nari has joined #ruby
doug has left #ruby [#ruby]
timbobot112233 has quit [Remote host closed the connection]
timbobot112233 has joined #ruby
<nycjv321> anyone familiar with regex?
<flaccid> its going to be easiest to do `echo ~#{node['backup']['backup_user']}`.strip
timbobot112233 has quit [Remote host closed the connection]
<nycjv321> I thought I was but apparently I don't know how to use them in Ruby can I pastebin some code and someone take a look why its not matching anything in my input text?
taoru has quit [Ping timeout: 244 seconds]
pencilcheck has quit [Remote host closed the connection]
slonimsky has left #ruby [#ruby]
horofox has quit [Quit: horofox]
timbobot112233 has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
berserkr has quit [Quit: Leaving.]
<Norrin> click standard types on the left. regex is 60% down the page
<nycjv321> Norrin: I'm reading "The Ruby Programming Language" right now
<nycjv321> u know what let me break this problem down
guns has joined #ruby
* nycjv321 calms down
szck has quit [Ping timeout: 260 seconds]
Hanmac1 has joined #ruby
dankest has quit [Quit: Leaving...]
Hanmac has quit [Ping timeout: 264 seconds]
TheFuzzball has quit [Quit: Computer has gone to sleep.]
slainer68 has joined #ruby
squidBits has quit [Quit: whoops]
the_jeebster has quit [Quit: Leaving.]
fermion has quit [Ping timeout: 246 seconds]
dankest has joined #ruby
dangsos has joined #ruby
<dangsos> how do I turn a 16 character string into a 24 character hash based on that string?
cisco has joined #ruby
slainer68 has quit [Ping timeout: 264 seconds]
ossareh has quit [Ping timeout: 256 seconds]
taoru_ has quit [Remote host closed the connection]
taoru has joined #ruby
cisco1 has joined #ruby
<ryanf> >> require 'digest/md5'; puts Digest::MD5.hexdigest("hello")[0..23]
<eval-in> ryanf: Output: "5d41402abc4b2a76b9719d91\n" (http://eval.in/6216)
szck has joined #ruby
<ryanf> I guess whether md5 is ok probably depends on what you're using it for though?
<graft> dang beat me to the punch
cisco has quit [Ping timeout: 255 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
lucaspiller___ has quit [Quit: Connection closed for inactivity]
depassion has joined #ruby
cisco1 is now known as cisco
TheDeadSerious_ has quit [Quit: Connection closed for inactivity]
blazes816 has joined #ruby
<dangsos> ryanf: thanks!
wroathe has joined #ruby
szck1 has joined #ruby
szck1 has quit [Read error: Connection reset by peer]
szck has quit [Read error: Connection reset by peer]
sent-hil has joined #ruby
sent-hil is now known as Guest72306
Drakevr has quit [Ping timeout: 264 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
Guest72306 is now known as senthil
senthil has quit [Client Quit]
senthil has joined #ruby
jjang_ has quit [Remote host closed the connection]
<nycjv321> if im reading from a line why would ruby add extra spaces to a text file?
senthil has quit [Client Quit]
<nycjv321> like e.g. the line is "Cluster" but puts line outputs "C l u s t e r"
nathancahill has joined #ruby
yfeldblum has quit [Ping timeout: 256 seconds]
wroathe has quit [Ping timeout: 260 seconds]
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
flip_digits has joined #ruby
rburton- has joined #ruby
RubNoob has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<nycjv321> ah
* nycjv321 explodes I see why the encoding on the text stream was totally screwed up
alvaro_o_ has quit [Quit: Ex-Chat]
voodoofish430 has quit [Quit: Leaving.]
kaichanvong___ has quit [Quit: Connection closed for inactivity]
mockra has quit [Remote host closed the connection]
flaccid has left #ruby ["Konversation terminated!"]
<dangsos> ryanf: does that digest appended with [0..23] do a digest 24 times or does it just cut it to 24 characters?
cjs226 has joined #ruby
<Boohbah> dangsos: no, it does one digest on the string "hello" and outputs characters 0..23
joofsh has joined #ruby
tchebb has quit [Ping timeout: 248 seconds]
tchebb has joined #ruby
rburton- has quit [Quit: Leaving...]
jbw has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby
jimeh has joined #ruby
timbobot112233 has quit [Ping timeout: 244 seconds]
SCommette has quit [Quit: SCommette]
dankest is now known as dankest|away
hybris has quit [Quit: hybris]
cisco has quit [Ping timeout: 244 seconds]
jonathanwallace has joined #ruby
zz_pacbard is now known as pacbard
brianpWins has joined #ruby
<SEToChan> i have to select data for some page of table and also i need to know fuull count of records so i can build pagination
<SEToChan> how can i do this?
jimeh has quit [Ping timeout: 260 seconds]
<SEToChan> this is how i select data http://pastebin.com/amXRE7Uh
mmitchell has quit [Remote host closed the connection]
<SEToChan> but i aslo need somehow select count without limits
<SEToChan> and i'm very new in ruby and rails (
medik has quit [Quit: medik]
<breakingthings> #ruby pls, what's the prettiest way to make a ? method
<breakingthings> that just involves, say a single conditional.
<ebobby> def equals? (x); self == x; end
<breakingthings> :d
jbw has joined #ruby
<breakingthings> nice and all, but I'm afraid I was looking for an arbitrary argument, not a comparison to the object
<breakingthings> say… if thing.coolness > 50
<ebobby> i just gave you an example, im pretty sure you can work your way up from there, or it may be that I understood your question incorrectly
lolcathost has quit [Ping timeout: 248 seconds]
DrShoggoth has joined #ruby
cisco has joined #ruby
karasawa has quit [Ping timeout: 240 seconds]
rezzack has quit [Quit: Leaving.]
<breakingthings> ebobby: I am wondering if there's a better way than if (condition) { true }; false
lolcathost has joined #ruby
<jpfuentes2> do you mean using the ternary operator ?
<jpfuentes2> value = thing.coolness > 50 ? :this_value_if_true : "this_value_if_false"
<ebobby> the condition returns its value itself
<breakingthings> right
<ebobby> if it is a ? method then you mean a predicate, then oyu mean you return true or false
<breakingthings> that's what I was looking for
<breakingthings> thanks
<breakingthings> I just felt like I was being stupid and I was
<ebobby> we all are
<ebobby> at some point or another
kumarat9pm has joined #ruby
<nycjv321> is it possible to seek a file based on line instead of byte?
SCommette has joined #ruby
<ebobby> nycjv321: although I am not sure if you can do that or not, why don't you simply read the file into an array and use the index for whatever you need?
Myconix has quit [Read error: Connection reset by peer]
<nycjv321> I'm trying to make a parser
<ebobby> although there are some disadvantages to what I am proposing of course.
<nycjv321> so for example line 3 may be the beginning of an object definition but lines 4, 5, 6 may contain attributes
gyre007 has quit [Remote host closed the connection]
<jpfuentes2> what are you parsing?
<jpfuentes2> ruby code ?
<nycjv321> jpfuentes2 : output of another app which is poorly formated
<nycjv321> object and attributes are my way of describing parts of the output. Okay what i am trying to do is make a parse for the output of MKVInfo
LennyLinux has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 265 seconds]
<nycjv321> ultimately I want to generate output for needed syntax to extract files from cli instead of having to read the man page I want my app to say "To extract audio and vidio use this command 'blah'
<nycjv321> also I want to organize the files into objects/attributes for learning purposes e.g. output to xml, json just for fun
<nycjv321> organize the output*
kevinykchan has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
xemu has quit [Quit: Nettalk6 - www.ntalk.de]
joeycarmello has joined #ruby
karasawa has joined #ruby
xsdg has quit [Ping timeout: 252 seconds]
<JoeHazzers> how can i get an alphabetically sorted directory listing?
quest88 has joined #ruby
xsdg has joined #ruby
kumarat9pm has quit [Quit: Leaving.]
joeycarmello has quit [Ping timeout: 265 seconds]
<nycjv321> jpfuentes2: what do u think of the idea?
DatumDrop has quit [Remote host closed the connection]
zeade has joined #ruby
rburton- has joined #ruby
tvsutton has left #ruby [#ruby]
d2dchat has quit [Remote host closed the connection]
maletor has joined #ruby
SCommette has quit [Quit: SCommette]
<blazes816> JoeHazzers: Dir["./*"].sort
nathancahill has quit [Quit: nathancahill]
* JoeHazzers facedesks
<JoeHazzers> blazes816: thanks, it's late
SCommette has joined #ruby
<blazes816> haha np
cyong has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
gabrielrotbart has joined #ruby
karasawa has quit [Ping timeout: 244 seconds]
miskander has quit [Quit: miskander]
dankest|away has quit [Quit: Leaving...]
quest88 has quit [Quit: quest88]
ryanf has quit [Ping timeout: 248 seconds]
ttt has quit [Remote host closed the connection]
kumarat9pm has joined #ruby
kingfishr has joined #ruby
pcarrier has joined #ruby
kingfishr has quit [Client Quit]
roadt has joined #ruby
dougireton has joined #ruby
<nycjv321> ebobby: your suggestion about putting it in an array = genius, thanks!
dankest has joined #ruby
gyre007 has joined #ruby
<ebobby> nycjv321: you are welcome
SCommette has quit [Quit: SCommette]
johnmilton has joined #ruby
ttt has joined #ruby
guest181 is now known as rakl
gyre007 has quit [Ping timeout: 248 seconds]
cespare is now known as cespare|home
cespare|home is now known as cespare_
cespare_ is now known as cespare
dougireton has quit [Quit: Leaving.]
dwnichols has quit [Ping timeout: 265 seconds]
ttt has quit [Ping timeout: 245 seconds]
tjbiddle has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
karasawa has joined #ruby
TomyLobo has quit [Quit: Standby mode...]
ebobby has quit [Quit: Lost terminal]
wroathe has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
pacbard is now known as zz_pacbard
_alejandro has joined #ruby
dankest has quit [Quit: Leaving...]
jduan1981 has joined #ruby
ryanf has joined #ruby
aapzak has quit [Ping timeout: 264 seconds]
aapzak has joined #ruby
havenn has joined #ruby
macmartine has joined #ruby
sailias has joined #ruby
ttt has joined #ruby
ner0x has quit [Quit: Leaving]
havenn has quit [Ping timeout: 255 seconds]
_hemanth_ has quit [Read error: Connection reset by peer]
sailias has quit [Client Quit]
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
sailias has joined #ruby
verbad has joined #ruby
hemanth_ has joined #ruby
Umren|2 has quit [Ping timeout: 252 seconds]
tommyvyo has joined #ruby
Dann1 has joined #ruby
Dann1 has quit [Remote host closed the connection]
Dann1 has joined #ruby
_hemanth_ has joined #ruby
maletor has joined #ruby
subbyyy has quit [Ping timeout: 240 seconds]
mockra has joined #ruby
matled has quit [Ping timeout: 252 seconds]
IcyDragon has quit [Quit: Space~~~]
slainer68 has joined #ruby
greenarrow has quit [Quit: IRC is just multiplayer notepad]
slainer68 has quit [Ping timeout: 260 seconds]
macmartine has quit [Ping timeout: 246 seconds]
Umren has joined #ruby
pnkbst has quit [Ping timeout: 255 seconds]
mercwithamouth has quit [Ping timeout: 255 seconds]
mercwithamouth has joined #ruby
jonahR has quit [Quit: jonahR]
x82_nicole has quit [Quit: Computer has gone to sleep.]
DatumDrop has joined #ruby
dougireton has joined #ruby
havenn has joined #ruby
<aquagrunty> just wanted to say
<aquagrunty> i just officially switched my language preference from python to ruby
<aquagrunty> <3
<aquagrunty> the ability to override attributes with methods totally got me
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
DatumDrop has quit [Ping timeout: 240 seconds]
m104 has joined #ruby
jonahR has joined #ruby
Umren has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
tjbiddle has quit [Quit: tjbiddle]
toekutr has joined #ruby
QKO has quit [Read error: Operation timed out]
baroquebobcat has joined #ruby
QKO has joined #ruby
havenn has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
havenn has joined #ruby
joofsh has quit [Remote host closed the connection]
nycjv321 has quit [Remote host closed the connection]
radic has quit [Read error: Operation timed out]
Dann1 has quit [Ping timeout: 264 seconds]
cyong has quit [Quit: Leaving.]
havenn has quit [Ping timeout: 255 seconds]
Liothen has joined #ruby
alexy has joined #ruby
matled has joined #ruby
xsdg has quit [Ping timeout: 255 seconds]
pskosinski has quit [Quit: Learn Life's Little Lessons]
xsdg has joined #ruby
verbad has quit []
<ryanf> aquagrunty: I'm pretty sure you can do that in python
kenneth has quit [Quit: kenneth]
<dangsos> ryanf: don't give him a reason to leave...ruby needs fanboys
jenrzzz has joined #ruby
nonmadden has joined #ruby
dougireton has quit [Quit: Leaving.]
radic has joined #ruby
pkrnj has quit [Ping timeout: 240 seconds]
quest88 has joined #ruby
wiiw has joined #ruby
macmartine has joined #ruby
<wiiw> 1.next => 2 , and how to find the prev method ? 1.prev => 0
<wiiw> '1'.next => '2' , and how to find the prev method ? '1'.prev => '0'
macmartine has quit [Client Quit]
flyinprogramer has joined #ruby
opettaja has joined #ruby
<flyinprogramer> https://gist.github.com/4490672 <-- tl;dc - how do mongoid matchers work??
<wiiw> ruby-doc.org can't find the Antonym
retro|cz has joined #ruby
rubyasker has joined #ruby
<rubyasker> Hello
jrist is now known as jrist-afk
<rubyasker> my_other_hash = {}; my_hash.each do |id, value| my_other_hash[id] = value[:foo] end; {bar: my_hash};
<rubyasker> is there any syntax to do that in one line?
GoGoGarrett has quit [Remote host closed the connection]
<yfeldblum> flyinprogramer, probably, mongoid checks whether the hash key is a special object that Symbol#gte returns, and then reconstructs a new Hash with a value of {"$gte" => value}
breakingthings has quit []
<rubyasker> my_hash = {a: {foo: 1}, b: {foo: 2}, c: {foo: 3}}; ...; puts my_other_hash.inspect #=> {:a=>1, :b=>2, :c=>3}
daidoji has joined #ruby
<flyinprogramer> yfeldblum: ok - that makes sense
dougireton has joined #ruby
wroathe has quit [Ping timeout: 256 seconds]
<rubyasker> I know it doesn't work but... something like: {bar: my_hash.map {|id, value| value[:foo]}}
pkrnj has joined #ruby
<aquagrunty> ryanf: yeah you can
dangsos has quit [Quit: Lost terminal]
<aquagrunty> but it's not NEARLY as elegant
<rubyasker> aquagrunty, how?
<aquagrunty> overriding .__getattr__
<aquagrunty> ugh
<rubyasker> yeah... ugh!
<aquagrunty> like you can make a hash of all the attributes you want to override and make them () a function
wiiw is now known as iGoog
<aquagrunty> so it's not horrible
<aquagrunty> but i like def i_used_to_be_an_attribute
<aquagrunty> better
brandon|work has quit [Ping timeout: 246 seconds]
iGoog has left #ruby [#ruby]
<rubyasker> I can write a function too and hide all the code, yes
<rubyasker> but I didn't want :P
<aquagrunty> rubyasker: thats fine
<aquagrunty> my current business needs require unlimited abstraction
<aquagrunty> i work for an airline, i'm trying to start a new underlying framework for the whole thing
<aquagrunty> because my god our systems suck
<rubyasker> lol
<aquagrunty> i was lamenting here yesterday
<rubyasker> require './app.rb' \n do_it_all true
<rubyasker> the ultimate abstraction
<aquagrunty> about how the entire loyalty database written using transact SQL statements only
<aquagrunty> imagine that
<aquagrunty> an entire application
<aquagrunty> built using SQL statements
yfeldblum has quit [Ping timeout: 248 seconds]
<rubyasker> is that the case in the system the airline is using?
<aquagrunty> yeah
<rubyasker> ohh
<huoxito> odd question, is there a way to know if a class calls a method? without setting new attributes in this method or doing some other hacky stuff
<aquagrunty> what do you mean? class calls a method?
<huoxito> like
<aquagrunty> set an attribute in the function @trigger = true and then test for that using another public method?
<huoxito> class Test; def hey; end; end;
<huoxito> class Test; hey; end;
<aquagrunty> how to tell if what you're calling is an attribute or a method?
<huoxito> There's no way to know if the class Test calls the class method 'hey'
<huoxito> sorry
<huoxito> class Test; def self.hey; end; end;
<huoxito> yes that's another good question, it's just not possible
<aquagrunty> are talking about breaking encapsulation?
<huoxito> I'll give the force_ssl method example in Rails
<huoxito> Is there a way to check in a test if a given class call that class method
<huoxito> ?
kenneth has joined #ruby
<rubyasker> I would say you can compare the functions
<aquagrunty> using a class variable and setting that variable to true when you hit the method?
<rubyasker> but I didn't try it
<rubyasker> like in: hey == Foo::hey
cheese1756 has quit [Ping timeout: 252 seconds]
dwu1 has joined #ruby
<huoxito> aquagrunty, but then I'd have to change the method implementation
<aquagrunty> can't you override and call the super class or something?
Takehiro has joined #ruby
<huoxito> sure I can override
<aquagrunty> sorry i'm a bit new to the language, still building my first major app
<huoxito> but I didn't want to
<aquagrunty> coming from python
kenneth has quit [Client Quit]
nonmadden has quit [Ping timeout: 260 seconds]
<huoxito> Same here almost
<huoxito> 1 year of ruby
<aquagrunty> uh
<aquagrunty> 2 weeks
<shevy2> huoxito cool
icole has joined #ruby
mercwithamouth has quit [Ping timeout: 244 seconds]
<aquagrunty> i love the onion layering effect of ruby
<shevy2> huoxito hmm perhaps via caller() ? you could look at the call trace
<aquagrunty> i can override whatever the hell i want >:3
<shevy2> aquagrunty, yeah but there is no simple way to restore to the earlier code :(
<shevy2> lemme change nick quickly
shevy2 is now known as shevy
<aquagrunty> aw
<shevy> aaah better
<aquagrunty> bw use a DVCS if you don't already
<aquagrunty> like hg
<aquagrunty> (mercurial)
<aquagrunty> it has saved my ass so many times
<aquagrunty> being able to rollback to old versions of software
<aquagrunty> without fucking everything up
<rubyasker> can you pass functions as parameters or manipulate them without executing the code?
<aquagrunty> ?
<rubyasker> I know it can be done for lambdas, but what about class methods?
<rubyasker> def test(val); val+1; end; def foo(bar); bar.call 123; end
<aquagrunty> do class methods exist outside of their scope?
<rubyasker> how you call foo using test?
<aquagrunty> modules are like classes from what i understand, but for functional "defs"
<shevy> rubyasker what
<shevy> dont you have a pastie please
<shevy> aha
maletor has quit [Quit: Computer has gone to sleep.]
<shevy> rubyasker, you can pass a proc into a method as argument
yfeldblum has joined #ruby
<shevy> I think it is via &name_here
<rubyasker> let me show you in JS: function test(val) {return val+1} function foo(bar) {return bar.call(123)}
<rubyasker> foo(test) -> 124
<rubyasker> (not tested code ^ :P)
<shevy> so test() increments by one
chriskk has quit [Quit: chriskk]
<shevy> and foo... can't you call test() inside directly? anyway, I think you want a proc there, for bar
<shevy> I think the syntax would be foo(&bar)... hmm lemme look up...
<aquagrunty> i think what you're looking for are pointers
<aquagrunty> and yes, & sounds like it
<rubyasker> not necessarily.. you don't need pointers in JS ;)
<aquagrunty> idk though i haven't needed to use a pointer yet
<aquagrunty> year rubyasker because in js
<aquagrunty> objects are not called unless you explicitly define ()
<aquagrunty> so you can pass dead objects around, essentially
<rubyasker> yep, that's the reason it doesn't work as in JS unless you do something else
<rubyasker> like adding & or whatever it needs
<aquagrunty> C is the same way
<aquagrunty> i think
<aquagrunty> except they have ** and *
cheese1756 has joined #ruby
<shevy> hmm I cant find the proper syntax
<rubyasker> it can be done with lambdas
rippa has joined #ruby
<rubyasker> but the challenge was to use any "normal" function
flyinprogramer has quit [Quit: flyinprogramer]
jgrevich has joined #ruby
<aquagrunty> there it is
<aquagrunty> rubyasker: it's "method"
<aquagrunty> i believe
lolcathost has quit [Ping timeout: 265 seconds]
<aquagrunty> maybe?
ananthakumaran has joined #ruby
<rubyasker> when I said function I meant a function.... outside any of your classes
<rubyasker> (it's probably a method of another object to which everything defined belongs.. I don't know)
<rubyasker> I found it!!
quest88 has quit [Quit: quest88]
<rubyasker> def foo(v); v+1; end; def bar(func); func.call(10); end; bar(method(:foo)) #11
<rubyasker> :)
<shevy> ah
<shevy> the method() method
toekutr has quit [Remote host closed the connection]
<shevy> aptly named
SCommette has joined #ruby
flyinprogramer has joined #ruby
<rubyasker> what's the name of the object to which everything belongs?
<shevy> never saw that in actual code before btw
<rubyasker> in other words, what's the class of the object of foo in the example above?
<shevy> rubyasker, not sure... class Object is the main one I think
x82_nicole has joined #ruby
<shevy> but it is somehow special
<shevy> I forgot the explanation for it hahaha
<shevy> toplevel? hmm
<rubyasker> no, it's the upper class in the OOP hierarchy.. it's not the same
<rubyasker> I guess it's Binding or something like that
Pip has joined #ruby
<shevy> I very much like your code rubyasker
<shevy> I am gonna memorize it
<rubyasker> it's not Binding, I just checked
<rubyasker> it's pretty useful :P
<shevy> y.class # => Method
<shevy> I have methods as classes now!
<shevy> insanity
<shevy> I am gonna rip apart all the objects, then I reassemble them method by method
<rubyasker> what's y?
<rubyasker> ah, method(:foo).class I guess
<rubyasker> it's weird, check that:
<shevy> I just assigned it
<shevy> y = method(:foo)
<shevy> I like short names
karasawa has quit [Ping timeout: 276 seconds]
<rubyasker> method(:foo).class => Method Method.methods.include? :foo => false
<shevy> y.call 5 # => 6
<shevy> so hilarious
<rubyasker> o.o
<shevy> uhm
<shevy> what is .methods
<rubyasker> the list of defined methods? :P
<shevy> pp Method.methods.size # 516
<shevy> hmm but in what context?
<shevy> methods in modules dont count?
<shevy> hmm
<shevy> seems to be the case
<shevy> lemme check for Object.bla methods
kiyoura has quit [Quit: Leaving]
<shevy> aha
<shevy> pp Method.methods.size;def Object.hi; puts 'hi'; end; pp Method.methods.size
<shevy> incremented by +1
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
flyinprogramer has quit [Quit: flyinprogramer]
<shevy> rubyasker, are you really "new" to ruby? you seem to know way too much already :P
Pip has quit [Ping timeout: 265 seconds]
m104 has quit [Quit: Be back later]
<shevy> I learned two things already... method(:bla).call and Method.methods
karasawa has joined #ruby
<rubyasker> two weeks or so
<shevy> then you are very fast at learning
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<shevy> aquagrunty, go learn from rubyasker
<shevy> in 4 weeks aquagrunty will be a ruby veteran with that speed
<rubyasker> lol
m104 has joined #ruby
<rubyasker> use pry, shevy
<rubyasker> using its auto-completion is an awesome way to learn and discover new methods
m104 has quit [Client Quit]
<rubyasker> or even to read the documentation of them ;)
lolcathost has joined #ruby
<shevy> hmm via string.scan I can return all matches
<shevy> but is there a way to return all starting and end positions of all matches?
<aquagrunty> i looove scan
<aquagrunty> oh man
<aquagrunty> i never have to "import re" again
<shevy> like string = "abcabcabc"; # return all "bc" here, start and end positions
gabrielrotbart has quit [Remote host closed the connection]
<aquagrunty> <3
<shevy> hehe aquagrunty
<aquagrunty> because re.match is probably the stupidest looking regex call i've ever seen
<shevy> that you have to import it kinda sucks indeed
kumarat9pm has left #ruby [#ruby]
<aquagrunty> yeah what the hell
<SirFunk> is there any way to do Net::Http over a local socket?
<aquagrunty> what program *doesn't* use regex
<shevy> I would not mind something like import in ruby though
<shevy> a way to load or import something into a new namespace would be nice
<shevy> or, to get rid of the namespace too
<aquagrunty> isn't everything an object?
_46bit has joined #ruby
<shevy> yeah but it resides in a namespace, or?
<aquagrunty> object.now i have a tail do
<shevy> module Foo; class Bar; end; end
<shevy> I am not sure how to move Bar outside of Foo
<aquagrunty> Module.cool_new_function do
<rubyasker> shevy, what about require or include :P?
<shevy> rubyasker yeah, toplevel include might work
_46bit has left #ruby [#ruby]
<rubyasker> <shevy> like string = "abcabcabc"; # return all "bc" here, start and end positions
<aquagrunty> i have to say the guy who made ruby is pretty much a genius
maletor has joined #ruby
<rubyasker> you mean you want to get the numbers 1 and whatever the last number is?
<rubyasker> [1, 10]
<rubyasker> for example?
<shevy> rubyasker, yeah but for all matches :(
<rubyasker> uh?
<rubyasker> ah, like [[1,3], [5,7], etc]
<shevy> yeah
<shevy> like you have a DNA string and find substrings in it
<rubyasker> hint: you know the length, you only need the start
<shevy> hmmm for all the matches?
<rubyasker> in this case it's always "bc"
<shevy> well I suppose I could loop through
<rubyasker> which has length 2
<shevy> yeah
<rubyasker> so you only need to know where it starts
<rubyasker> for every match
<shevy> true, good point
<aquagrunty> loops are the ruby way
<shevy> so I indeed only need to know all start positions
<shevy> :)
<aquagrunty> :D
<aquagrunty> i think
blazes816 has quit [Quit: blazes816]
<shevy> I love iterators
<shevy> only blocks are cooler
<aquagrunty> btw
sailias has quit [Quit: Leaving.]
<shevy> aquagrunty, here you can see matz in action https://github.com/mruby/mruby last commit one hour ago, he must be awake in japan right now!
Takehiro has quit [Remote host closed the connection]
ossareh has joined #ruby
quest88 has joined #ruby
ossareh has quit [Ping timeout: 240 seconds]
gokul has joined #ruby
slainer68 has joined #ruby
generalissimo has joined #ruby
ossareh has joined #ruby
johnmilton has quit [Quit: Leaving]
jgrevich_ has joined #ruby
slainer68 has quit [Ping timeout: 244 seconds]
jgrevich has quit [Ping timeout: 255 seconds]
jgrevich_ is now known as jgrevich
andrewhl has joined #ruby
<aquagrunty> shevy: it looks like he's doing a lot of pulling which is awesome
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<aquagrunty> so it's kind of a big community project huh
theRoUS has joined #ruby
lolcathost has joined #ruby
epitron has joined #ruby
opettaja has quit [Remote host closed the connection]
<shevy> dunno
<shevy> I dont know C so I cant help
eldariof has joined #ruby
<aquagrunty> i'm so glad i never need to touch C again :D
<aquagrunty> the code behind ruby is quite elegant itself though
<rubyasker> > str = "abcabcabc"; regexp = /bc/; s=-2; while ((s = (str[s..-1] =~ regexp || str.length)+s+3) < str.length) do puts s; end
<rubyasker> 1
<rubyasker> 4
<rubyasker> 7
anannie has quit [Ping timeout: 246 seconds]
<rubyasker> shevy, don't try this at home lol
<rubyasker> you don't even need to set s=-2 at the beginning: while ((s = (str[(s || -2)..-1] =~ regexp || str.length)+(s||-2)+3) < str.length) do puts s; end
opettaja has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
<shevy> cool
<shevy> I suppose there is no way via one regex alone or?
<rubyasker> (it is just for fun, DON'T use it)
<rubyasker> I don't think so
h4mz1d has joined #ruby
Hanmac has joined #ruby
<rubyasker> you mean without iterating?
generalissimo has quit [Remote host closed the connection]
pnkbst has joined #ruby
tagrudev has joined #ruby
hackerdude has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
gardnan has joined #ruby
mockra has joined #ruby
headius has joined #ruby
FroMaster has joined #ruby
<Hanmac> rubyasker can you repeat the question? i missed it
<rubyasker> what question?
<rubyasker> shevy's question?
baroquebobcat has quit [Quit: baroquebobcat]
<Hanmac> yeah i missed it because of my late login
<rubyasker> > p = -2; "abcaaaabcabc".scan(/(.*?)bc/).map {|preffix| p += preffix.length + 2}
<rubyasker> => [1, 4, 7]
<rubyasker> shevy, there you have a better approach
<FroMaster> I just setup a ubuntu/ruby development environment and want to use the rails-prelaunch-signup app tutorial but use a prexisting git repository that my partner started working on. How do i git the existing repo? (i'm new to git/ruby but not to web development so confused on where to start)
toekutr has joined #ruby
DrCode has quit [Quit: ZNC - http://znc.in]
<Hanmac> FroMaster: git clone repositoryadress [dirname] where dirname is optional
mmokrysz has joined #ruby
fred909 has quit [Read error: Operation timed out]
<rubyasker> err, wait. you need a .flatten before .map: p = -2; "abcaaabcabc".scan(/(.*?)bc/).flatten.map {|preffix| p += preffix.length+2} => [1, 6, 9]
mmokrysz has left #ruby [#ruby]
<rubyasker> :)
<rubyasker> Hanmac, the idea was to return all the beginning positions of the substring "bc" in "abcaaaabcabc"
<rubyasker> do you know any method to do so easily?
gavinhughes has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jonahR has quit [Quit: jonahR]
SCommette has quit [Quit: SCommette]
DrCode has joined #ruby
<rubyasker> well, time to sleep. see you
Nisstyre has joined #ruby
havenn has joined #ruby
tonini has joined #ruby
rburton- has quit [Quit: Linkinus - http://linkinus.com]
quest88 has quit [Quit: quest88]
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
naquad has quit [Quit: ZNC - http://znc.in]
moshee has quit [Remote host closed the connection]
huoxito has quit [Quit: Leaving]
tonini has quit [Read error: Connection reset by peer]
<Hanmac> shevy i may found an more generic way
mneorr has quit [Remote host closed the connection]
tonini has joined #ruby
mneorr has joined #ruby
gpato has quit [Ping timeout: 260 seconds]
clocKwize has joined #ruby
<Hanmac> >> p "abcaaaabcabc".to_enum(:scan,/(.*?)(bc)/).with_object([nil]).map {|(preffix,match),i| i[0]||= -match.length; i[0]+= preffix.length + match.length}
<eval-in> Hanmac: Output: "[1, 7, 10]\n" (http://eval.in/6217)
Pip has joined #ruby
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
nathancahill has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
cardoni has joined #ruby
gardnan has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
daidoji has quit []
mneorr has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
headius has quit [Quit: headius]
maletor has joined #ruby
guns has quit [Quit: guns]
havenn has quit [Ping timeout: 248 seconds]
znake has joined #ruby
znake has quit [Remote host closed the connection]
robustus has quit [Ping timeout: 276 seconds]
gavinhughes has quit [Remote host closed the connection]
zommi has joined #ruby
tonini has quit [Remote host closed the connection]
rakl has quit [Quit: sleeping]
tonini has joined #ruby
robustus has joined #ruby
slainer68 has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
mneorr has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
gardnan has joined #ruby
gardnan has quit [Remote host closed the connection]
blaxter has joined #ruby
dhruvasagar has joined #ruby
opettaja has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 248 seconds]
dhruvasagar has quit [Client Quit]
dhruvasagar has joined #ruby
h4mz1d has quit [Ping timeout: 260 seconds]
bbloom has joined #ruby
bbloom has left #ruby [#ruby]
tommyvyo has joined #ruby
mockra has quit [Remote host closed the connection]
browndawg has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
gokul has quit [Remote host closed the connection]
cisco has quit [Ping timeout: 260 seconds]
generali_ has joined #ruby
dougireton has quit [Quit: Leaving.]
generali_ has quit [Remote host closed the connection]
generalissimo has joined #ruby
moshee has joined #ruby
LouisGB has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
cisco has joined #ruby
kevinykchan has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
vlad_starkov has joined #ruby
whitedawg has joined #ruby
dougireton has joined #ruby
dougireton has quit [Client Quit]
jgrevich has quit [Quit: jgrevich]
lolcathost has quit [Ping timeout: 260 seconds]
pencilcheck has joined #ruby
dr_bob has joined #ruby
andrewhl has quit [Remote host closed the connection]
workmad3 has joined #ruby
pencilcheck has quit [Remote host closed the connection]
zeade has quit [Quit: Leaving.]
locriani has joined #ruby
locriani has quit [Remote host closed the connection]
mafolz has joined #ruby
moshee has quit [Ping timeout: 256 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<fuzai> What am I doing wrong with my elsif?
lolcathost has joined #ruby
<Hanmac> fuzai its the "i"
<fuzai> oh wow ha
<fuzai> i'm sorry
<fuzai> thank you
agarie has quit [Remote host closed the connection]
piotr_ has joined #ruby
nomenkun has joined #ruby
taoru_ has joined #ruby
taoru_ has quit [Remote host closed the connection]
lolcathost has quit [Ping timeout: 276 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
taoru has quit [Ping timeout: 248 seconds]
DrCode has quit [Remote host closed the connection]
the_hack has joined #ruby
DrCode has joined #ruby
adeponte has quit [Remote host closed the connection]
taoru has joined #ruby
filipe has joined #ruby
Morkel has joined #ruby
moshee has quit [Ping timeout: 252 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
jduan1981 has quit [Quit: jduan1981]
megha has joined #ruby
brianpWins has quit [Quit: brianpWins]
lolcathost has joined #ruby
the_hack has quit [Quit: Computer has gone to sleep.]
workmad3 has joined #ruby
zigomir has joined #ruby
lolcathost has quit [Client Quit]
the_hack has joined #ruby
aganov has joined #ruby
the_hack has quit [Client Quit]
havenn has joined #ruby
ViPi has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
timonv_ has joined #ruby
answer_42 has joined #ruby
timonv has quit [Read error: Connection reset by peer]
x82_nicole has quit [Quit: Computer has gone to sleep.]
noxoc has joined #ruby
segv- has joined #ruby
lolcathost has joined #ruby
segv- has quit [Client Quit]
mahmoudimus has joined #ruby
noxoc has quit [Quit: noxoc]
whowantstolivefo has joined #ruby
generalissimo has quit [Remote host closed the connection]
timonv_ has quit [Remote host closed the connection]
marr has joined #ruby
WilfredTheGreat has joined #ruby
adeponte has joined #ruby
nomenkun has quit [Remote host closed the connection]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
sn0wb1rd has joined #ruby
jds has joined #ruby
wreckimnaked has joined #ruby
<fuzai> http://pastie.org/5653239 if message.content looks like "/userids 1" how could I extract that number into a variable?
toekutr has quit [Read error: Connection reset by peer]
serhart has quit [Quit: Leaving.]
nomenkun has joined #ruby
mneorr has quit [Remote host closed the connection]
Spami has quit [Quit: Leaving]
distax has left #ruby ["Leaving"]
gyre007 has joined #ruby
Elhu has joined #ruby
<ddd> (message.content.split(' ', 2))[1]
<ddd> don't need the , 2
stan has joined #ruby
gyre007 has quit [Ping timeout: 264 seconds]
samuel02 has joined #ruby
<fuzai> I just figured it out with message.content.include
<fuzai> thank you
<fuzai> :)
<ddd> np
stetho has joined #ruby
whowantstolivefo has quit [Ping timeout: 248 seconds]
<fuzai> is there a simple way to put a command on a timer that doesn't block the code?
<xybre> Okay I know I'm missing something obvious here, but I'm basically just trying to convert a large number into a base64 string.
<xybre> I can do number.to_s(32) to get it in base 32, and I can call Base64.encode64 on a string to convert its bytes to base 64, but nothing that bridges that gap.
<ddd> Like Base64.encode(ver_with_large_num.to_s) like that
<ddd> ?
<ddd> nm
jochu has joined #ruby
<xybre> That will encode the string representation of the integer, not the bits.
<xybre> And by "string" I really just mean "text".
main has joined #ruby
<xybre> If I could convert an integer to a bit string, I could base64 encode it.
jochu has left #ruby ["Leaving"]
jimeh has joined #ruby
chriskk has joined #ruby
TheFuzzball has joined #ruby
nicobrevin1 has joined #ruby
jds has quit [Remote host closed the connection]
koderde has quit [Quit: Leaving]
krz has joined #ruby
buibex has joined #ruby
tomzx has joined #ruby
<shevy> guys
<shevy> is it possible to use ruby webrick to serve ruby .cgi pages?
zarubin has quit [Ping timeout: 264 seconds]
TheFuzzball has quit [Quit: Computer has gone to sleep.]
clocKwize has quit [Quit: clocKwize]
blacktulip has joined #ruby
hoelzro|away is now known as hoelzro
clocKwize has joined #ruby
apeiros_ has joined #ruby
<xybre> (number.size*8).times.inject(String.new) { |string, index| string << number[index] }.reverse
<xybre> I think thats the best way to get a bitstring from an integer in Ruby.
slainer68 has joined #ruby
elaptics`away is now known as elaptics
tem has quit [Read error: Connection reset by peer]
main has quit [Remote host closed the connection]
<Mon_Ouie> Use Array#pack
reactormonk has quit [Ping timeout: 248 seconds]
main has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie> e.g. [some_number].pack "I"
<xybre> But now Base64 completely implodes, argh.
ephemerian has joined #ruby
<Mon_Ouie> See the documentation for possible formats you can use
JonnieCache has quit [Ping timeout: 248 seconds]
<xybre> I'll check it out
whitedawg has quit [Quit: Leaving.]
_46bit has joined #ruby
_46bit has left #ruby [#ruby]
<xybre> [117].pack 'Q' #=> "u\x00\x00\x00\x00\x00\x00\x00"
whitedawg has joined #ruby
<xybre> That seems.. wrong.
clooth has joined #ruby
the_hack has joined #ruby
<Mon_Ouie> It's not. 'u'.ord == 117
Spooner has joined #ruby
<Mon_Ouie> The rest is just null because the number fits in a single byte
<xybre> Ahh
<xybre> That was the hangup. And I was thinking the u was Ruby's string encoding.
reactormonk has joined #ruby
Vainoharhainen has joined #ruby
<grn> Has anyone used the rubypython gem? Does it degrade performance?
Spooner has quit [Quit: Leaving]
topriddy has joined #ruby
Spooner has joined #ruby
<topriddy> how is ruby naming conventions like? trying to get the patterns
<topriddy> newbie ruby coming from well defined naming conventions in Java
clooth has quit [Ping timeout: 276 seconds]
<heftig> variables_and_methods, ClassNames, OTHER_CONSTANTS
<Spooner> topriddy, my_var my_method, MyClass, MyModule, MY_CONSTANT
<Mon_Ouie> snake_case for variable and method names, CamelCase for constants (including class and method names). Some people prefer SHOUTING_CASE for constants that aren't class names.
<ddd> Ruby enforces some naming conventions. If an identifier starts with a capital letter, it is a constant. If it starts with a dollar sign ($), it is a global variable. If it starts with @, it is an instance variable. If it starts with @@, it is a class variable. Method names, however, are allowed to start with capital letters. This can lead to confusion.
<ddd> see http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/ if you're coming from other languages
gyre008 has quit [Remote host closed the connection]
workmad3 has joined #ruby
buscon has joined #ruby
<topriddy> thanks. succint
<topriddy> only Class Names take the camel notation
<topriddy> ddd: enforces is going too far. i doubt it does
<heftig> topriddy: it does.
<topriddy> well the first part isn't true. "If an identifier starts with a capital letter"
<heftig> it's true.
<topriddy> wow!!
<topriddy> so i can't do AGE = 10 and later do AGE = 50
<heftig> you can reassign constants, but you get a warning
<ddd> topriddy: try using @Variable and see what ruby does. Try using using $ as anything but a global. yes. it does enforce its rules
<topriddy> heftig: seen. not principle of least surprise coming from another language. thanks for pointing that out. thanks ddd
Xabarus has joined #ruby
dr_bob1 has joined #ruby
jimeh_ has joined #ruby
taoru_ has joined #ruby
slainer6_ has joined #ruby
dr_neek_ has joined #ruby
Morkel_ has joined #ruby
kevinykchan has quit [Remote host closed the connection]
<topriddy> i'm in chapter two of Little book of Ruby, and they haven't point it out yet explicitly. I finished some short interactive learn ruby tutorial. No explicit mention too!
io_syl has quit [Quit: Computer has gone to sleep.]
Pip has quit [Ping timeout: 260 seconds]
woolite644 has joined #ruby
<ddd> work it :)
<Spooner> topriddy, If nothing surprised you coming from another language, you might as well stay in the other language :)
<topriddy> loool
taoru_ has quit [Remote host closed the connection]
<topriddy> O_O
matchaw__ has joined #ruby
* topriddy whispers i didn't coin that term
piotr__ has joined #ruby
* topriddy back to reading…boss mustn't catch me reading ruby @ work in any case. Java Shop
<Spooner> Meaning that if it is the same, then there is no reason to move (not that you should go away :D).
<xybre> Ruby isn't based on Java.
<workmad3> topriddy: you could claim you're doing jruby ;)
<blaxter> thanks lord
<xybre> Ruby has other languages where sigils do mean something specific.
eka_ has joined #ruby
rdark has joined #ruby
<topriddy> i know…its influenced by perl
wmoxam_ has joined #ruby
<workmad3> perl and smalltalk
<xybre> Uhm, kinda, but its really smalltalk.
dwu2 has joined #ruby
<topriddy> is the phrase - Ruby is a dynamic language correct?
<workmad3> topriddy: yes
taoru_ has joined #ruby
<topriddy> or the classification of : Dynamic Languages => Python, Ruby,
My_Hearing has joined #ruby
<xybre> It's freakishly dynamic.
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
digifiv5e_ has joined #ruby
<ddd> topriddy: btw, a shitload of good links for ruby. http://iwanttolearnruby.com/ :-) regardless of skill level, you'll find something there to entertain and educate
<workmad3> xybre: there's a lot of perl philosophy in ruby, IMO, even if there isn't a large amount of perl syntax crossover :)
<hoelzro> do_this if that
<hoelzro> that's perlish
<topriddy> ddd: i just need to dig in some basics, then move to rails to properly appreciate it more. might use ruby for mainly OS admin tasks, scripting, and prototype and fun web apps initially
<hoelzro> not to mention the regex syntax, and regexes being 1st class citizens
<workmad3> topriddy: well, python and ruby aren't the only dynamic languages ;)
<hoelzro> and $!
<ddd> rails has nothing to do with 'appreciating' ruby
chussenot has joined #ruby
<hoelzro> or pretty much everything on this page: http://ruby.wikia.com/wiki/Special_variable
<workmad3> topriddy: but yes, in the static/dynamic typing axis of comparison, ruby is definitely on the dynamic side
<topriddy> ddd: i'm not going to be doing desktop apps in ruby
<xybre> Rails is just a framework. I had to explain this to a friend of mine, he kept saying "I know Rails isn't Ruby"
<hoelzro> althought $" in Ruby and Perl have very different meanings
<ddd> rails is just an framework written in ruby, used on top of ruby to create web applications. there's whole worlds out there that you can build and never once touch rails
<topriddy> so using the web app framework, rails, would allow me point to something i did in ruby vis a vis rails
<topriddy> ddd: or would you suggest a cool work to do ?
<workmad3> hoelzro: ok, I'm now schooled, there are more explicit perlisms is the syntax than I thought ;)
<ddd> shoes, green shoes, (couple others that integrate with Qt, but I don't remember the names)
<workmad3> hoelzro: but I know that my perl is quite basic, so not that surprising I didn't spot much
<hoelzro> workmad3: I think it takes a Perl coder like myself to see it all ;)
reactormonk has quit [*.net *.split]
jimeh has quit [*.net *.split]
slainer68 has quit [*.net *.split]
piotr_ has quit [*.net *.split]
Morkel has quit [*.net *.split]
taoru has quit [*.net *.split]
Mon_Ouie has quit [*.net *.split]
dr_bob has quit [*.net *.split]
tagrudev has quit [*.net *.split]
Nisstyre has quit [*.net *.split]
dwu1 has quit [*.net *.split]
yfeldblum has quit [*.net *.split]
Liothen has quit [*.net *.split]
_hemanth_ has quit [*.net *.split]
roadt has quit [*.net *.split]
DrShoggoth has quit [*.net *.split]
tchebb has quit [*.net *.split]
jbw has quit [*.net *.split]
woolite64 has quit [*.net *.split]
dr_neek has quit [*.net *.split]
matchaw_ has quit [*.net *.split]
TomRone has quit [*.net *.split]
wmoxam has quit [*.net *.split]
icco has quit [*.net *.split]
moted has quit [*.net *.split]
digifiv5e has quit [*.net *.split]
Zolrath has quit [*.net *.split]
eka has quit [*.net *.split]
bjeanes has quit [*.net *.split]
fumbe has quit [*.net *.split]
eka_ is now known as eka
Morkel_ is now known as Morkel
jimeh_ is now known as jimeh
dr_neek_ is now known as dr_neek
jds has joined #ruby
<xybre> I think Ruby pulls a lot of the good things from perl.. and a few bad things as well.
_hemanth_ has joined #ruby
My_Hearing is now known as Mon_Ouie
<workmad3> topriddy: you can pick an arena and decide what tools and applications you want to try to create there with ruby
<ddd> topriddy: point i'm making is that ruby is 100% usable real-world even if rails were to suddenly be blown out of existence, never to have ever been implemented. there are also frameworks like ramaze that do the same thing but far lighter, etc.
Solnse has joined #ruby
<ddd> and there's what workmad3 just suggested as well
nari has quit [Ping timeout: 245 seconds]
<hoelzro> the most important thing that Ruby brings in from Perl is TIMTOWTDI
<workmad3> hoelzro: definitely :)
<Spooner> ddd well, as someone trawling for Ruby contracts at the moment, I'm seeing 50 RoR things for every anything-else Ruby thing.
<workmad3> hoelzro: and I really hated the python attitude of reversing that :)
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
<hoelzro> same
adambeynon has joined #ruby
<hoelzro> that's pretty much why I stick with Perl
<hoelzro> although I have made a 2013 goal of using Ruby more
<workmad3> I like rails ;)
<hoelzro> it's hard, though
* Hanmac thinks that he should put *@yahoo.com on this spam list ...
<topriddy> workmad3: windows applications? its easier just using the .NET or Java ecosystem for that. So web and admin task or say server are the realms
<ddd> Spooner: how does that make ruby any less usable just because right now rails contracts are pervasive?
<Hanmac> workmad3 i only like rails while i am sitting in a train
tchebb has joined #ruby
<topriddy> on to learning, from above. I don't understand how/why class/methods can be constants>?
<topriddy> Mon_Ouie: snake_case for variable and method names, CamelCase for constants (including class and method names). Some people prefer SHOUTING_CASE for constants that aren't class names.
<topriddy> [10:33am]
<topriddy> ^^
<Mon_Ouie> I meant class and module names*
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
allsystemsarego has joined #ruby
<Mon_Ouie> class Foo; end; Foo.new
<topriddy> but a class can be modified in rib right?
<topriddy> irb*
<Mon_Ouie> There, when you create the class Foo, you actually created a constant name "Foo"
nathanie0221 has joined #ruby
nathanie0221 has quit [Client Quit]
Paradox has quit [Ping timeout: 244 seconds]
<Mon_Ouie> A constant means that you can't (or shouldn't, really) change the object it refers to
<topriddy> oh okay. thought it was some new magical concept. thanks
<Mon_Ouie> Not that you can't modify stuff within that object
moted has joined #ruby
<topriddy> i mean one can inject or modify methods of a Class in irb
<Spooner> ddd It doesn't strictly, but it does mean that to get Ruby work you effectively need Rails. Doesn't mean you can't do work without Rails though (and no reason, for example, you can't automate tasks in a Java workplace with Ruby, for example).
<xybre> 2You can always freeze an object if you don't want to change the object itself
<workmad3> topriddy: you can reopen a class
<hoelzro> can you freeze a class?
<hoelzro> I hadn't thought about that before.
<Spooner> ddd Though I'm hoping I find some way around it. Rails just doesn't appeal too much.
<Mon_Ouie> You can indeed
<Mon_Ouie> And yes, it prevents you from defining new methods
megha has quit [Quit: WeeChat 0.3.9.2]
yfeldblum has joined #ruby
<hoelzro> that...is...awesome.
<xybre> Spooner: A lot of job listings lie. Most of the last 3 projects I've worked on had very little Rails and was mostly pure Ruby development. Some places just use Rails because its a buzzword, or gives structure to their projects.
reactormonk has joined #ruby
Nisstyre has joined #ruby
<workmad3> Mon_Ouie: does it prevent you from defining new methods on the singleton class of instances?
<Mon_Ouie> Not sure about that
fumbe has joined #ruby
tagrudev has joined #ruby
* workmad3 goes away to try
<Mon_Ouie> Yep, that too
jbw has joined #ruby
DrShoggoth has joined #ruby
<Spooner> xybre, You give me some hope. Thanks!
<hoelzro> workmad3: I would bet not
<workmad3> hoelzro: aha, you can
roadt has joined #ruby
jacktrick has joined #ruby
<topriddy> xybre: what would you rather use for web apps then?
<Mon_Ouie> Really? I got a runtime error when I tried
francisfish has joined #ruby
<Spooner> xybre, I'm also realising that some language-neutral (I need to be able to do X and just want an exe I can click on) projects might be well-suited to Ruby. I've been meaning to try contracting for a while, but only just got off my arse...
<ddd> Spooner: i guess it depends on which 'market' you're applying in. there are many scientific and medical markets you can get ruby work in that have nothing to do with rails. (like the US national labs use ruby, NASA has internal jobs open for ruby programmers (wish i could get one. I have family that works at Johnson, JPL, and Ames Research Center, but nooo, can't get me one. thanks Uncle Thomas)
<topriddy> meanwhile, anyone knows Java here? @@class_variable is same as static variables in Java right?
<workmad3> >> class Foo; end; Foo.freeze; a = Foo.new; class << a; def bar; end; end; a.bar
<eval-in> workmad3: Output: "" (http://eval.in/6220)
<workmad3> >> class Foo; end; Foo.freeze; a = Foo.new; class << a; def bar; puts "hi"; end; end; a.bar
<eval-in> workmad3: Output: "hi\n" (http://eval.in/6221)
<Mon_Ouie> Ah, I misread what you were saying
<xybre> Spooner: if you're doing anything other than just a basic website, you'll need backend systems which have very little to do with Rails. And most places have at least one Sinatra app because its just plain faster than Rails.
<Mon_Ouie> I thought you meant the singleton class of the class itself
<ddd> Spooner: but you're correct insofar as the current commerical mass markets
<workmad3> ah, no, I was wondering if you could still extend instances
<Spooner> topriddy, @@var is deprecated. You won't see it used in decent code. Look up "class instance variables" instead.
<workmad3> so you could still make changes to specific local objects without polluting or messing around with the entire class structure
noxoc has joined #ruby
nemesit has joined #ruby
<Spooner> ddd Yeah, I am interested in Sintatra stuff (Or even Rails as a service rather than building web sites). I'm just feeling my way really.
jds has quit [Ping timeout: 240 seconds]
<workmad3> topriddy: @@vars aren't quite the same as static vars in java, iirc my java correctly
etank has quit [Ping timeout: 260 seconds]
<xybre> topriddy: Rails is fine in my opinion. Its not perfect, but I've not used anything that was overall better. Sinatra is nice, but its uber minimal and lacks a load of features. I'd probably suggest Merb if it hadn't been eaten by Rails.
<xybre> @@vars are weird, they're straight from smalltalk.
d2dchat has joined #ruby
<ddd> Spooner: don't feel bad. I completely stepped away from anything rails, just to focus on pure ruby apps, only to come back to rails because its what puts food on the table and quickly
<workmad3> topriddy: the difference is that only one @@var exists for the entire class hierarchy from the base class it is first defined in down
arturaz has joined #ruby
<workmad3> topriddy: so if you make a change to an @@var anywhere, it is reflected across the entire hierarchy
dwu2 has quit [Quit: Leaving.]
<topriddy> just like static class var members in java
<Spooner> workmad3, Not strictly true. It depends on the order each class references it whether there are one or more different @@vars.
vlad_starkov has quit [Remote host closed the connection]
<workmad3> topriddy: I thought in java a static var in a parent class wasn't shared across all classes derived from it
<Hanmac> Spooner @@vars are not deprecated from the ruby devs, but i currently see no usage for it
<topriddy> workmad3: hmm…true. (got to check again) X_x
<Mon_Ouie> Pretty sure they are in C++ (then again, C++)
<Spooner> Hanmac, Yes, OK, sorry, they aren't officially deprecated. There is just a better way and "noone" uses them any more (Rubymine shouts at me when I try to use one :D).
<workmad3> topriddy: so that if you changed the static var in a derived class, that change isn't visible across all other derived classes from the parent class
<workmad3> Mon_Ouie: yeah, well in C++, class definitions are more memory layout than anything else
<workmad3> Mon_Ouie: C++ is also the only language I know where you can actually do object slicing :)
<xybre> @@vars are useful for a very narrow set of things, if you're not careful, they can bite you though.
<workmad3> @@vars would be better described as inheritance-hierarchy variables
<fuzai> So if I can use array.include? "string" to find if a value exists in an array, how to I remove it?
<workmad3> as that's then more descriptive of the actual scope of the damn things
nemesit|osx has joined #ruby
<Spooner> fuzai, Array.delete "string"
<topriddy> is there a concept of loading a file to irb? say i define some classes/methods/functions in a file and want to call/use from irb . i think i did this either in haskell/python (mixing things up these days…never learned any too deeply)
<fuzai> thank you :)
<workmad3> topriddy: require
<topriddy> from irb???
<workmad3> topriddy: yep
fyolnish has quit [Ping timeout: 240 seconds]
<topriddy> thanks
<Spooner> fuzai, http://www.ruby-doc.org/core-1.9.3/Array.html is your best friend.
<workmad3> topriddy: require is just a method that loads and executes a ruby source file ;)
<workmad3> topriddy: after checking if the file has already been loaded that is
<topriddy> thats what i need
<topriddy> :)
<workmad3> there's also load, which doesn't check if the file has already been loaded
berserkr has joined #ruby
<Mon_Ouie> workmad3: Actually, static variables are shared in Java: http://pastie.org/5653487
nemesit has quit [Ping timeout: 255 seconds]
<Spooner> workmad3, And eval File.read :D
<workmad3> Mon_Ouie: ah, my bad
<workmad3> I don't use java much :)
chussenot has quit [Quit: chussenot]
Xeago has joined #ruby
<workmad3> Mon_Ouie: oh, what you can do in java but can't in ruby though, is shadow the parent static var with one in the derived class
gyre007 has joined #ruby
gyre007 has quit [Read error: Connection reset by peer]
timonv has joined #ruby
gyre007 has joined #ruby
<Mon_Ouie> Indeed
adeponte has quit [Remote host closed the connection]
<Spooner> workmad3, Except you can, if you define the @@var in the child before it is defined in the parent (for example if you have something like def frog; @@frog ||= []; end and it gets called on the child class first).
<workmad3> Spooner: ok mr smart :P
<workmad3> Spooner: that sounds more like a bug of an implementation optimisation though ;)
timmow has joined #ruby
<Spooner> workmad3, I think it is one of the major reasons @@vars are not used.
karasawa has quit [Ping timeout: 252 seconds]
bapa has quit [Read error: Connection reset by peer]
<topriddy> workmad3: just tried the require command. its not checking in the "relative directory" from where i launched irb from
<workmad3> topriddy: that's because . isn't on the load path by default
<topriddy> workmad3: might have to give a full path :(
<Spooner> topriddy, require_relative
<workmad3> topriddy: just do 'require "./..." ' in irb
greenarrow has joined #ruby
bapa has joined #ruby
<topriddy> require ./myapp.rb
<topriddy> ?
<topriddy> above doesn't work. says ***wrong number of arguments
<workmad3> require "./myapp.rb"
<topriddy> oh in quotes.
<workmad3> or just require "./myapp"
<workmad3> yeah, it's just a method call remember ;)
JonnieCache has joined #ruby
<workmad3> and it takes a string
<Spooner> Or require_relative "myapp.rb"
<topriddy> oh true. treated it like an os command.
ber has joined #ruby
<workmad3> Spooner: I don't think that works in irb
akemrir has joined #ruby
<Spooner> workmad3, Oh yeah, crap.
<workmad3> but yes, in normal rb files, you'd want to do require_relative, or ensure your load path is correct (something that things like rails and rubygems do for you)
<workmad3> preferably, you should ensure your load path is correct, otherwise you're coupling your code to the relative position of two files
alexy has quit [Ping timeout: 276 seconds]
karasawa has joined #ruby
<JonnieCache> PATCH ALL THE RAILS!
<Xeago> JonnieCache: ?
<JonnieCache> quickly before the the sky falls in
Solnse has quit [Ping timeout: 260 seconds]
<topriddy> workmad3: meanwhile, your tips work too well :D
<workmad3> topriddy: it's important to not do require "./whatever" in normal code files ;)
<workmad3> topriddy: as '.' is dependent on the launch location, not the file location
<topriddy> workmad3: okay. noted sensei :D
Elhu has quit [Ping timeout: 252 seconds]
<topriddy> workmad3: require_relative instead?
chussenot has joined #ruby
inffcs00 has joined #ruby
ViPi has quit [Quit: Computer has gone to sleep.]
<workmad3> topriddy: the best solution is to make sure your application root code directories are in the ruby $LOAD_PATH
<workmad3> topriddy: if you use require_relative, you just coupled that file's fs position to another file's fs position
<workmad3> topriddy: you can't move either of them without changing the require_relative line
<topriddy> one more thing, how do you guys know all the method names of a class/type/var also available lib functions??? In java there is IDE/Intellisense/Code Completion. There is also a detailed java doc
woolite644 has quit []
ruby_date has joined #ruby
<workmad3> topriddy: some_obj.methods
<ruby_date> hello
<topriddy> in irb
<workmad3> topriddy: yeah ;)
<workmad3> topriddy: >> p [].methods
<workmad3> >> p [].methods
<eval-in> workmad3: Output: "[:inspect, :to_s, :to_a, :to_ary, :frozen?, :==, :eql?, :hash, :[], :[]=, :at, :fetch, :first, :last, :concat, :<<, :push, :pop, :shift, :unshift, :insert, :each, :each_index, :reverse_each, :length, : ..." (http://eval.in/6251)
akl_ has joined #ruby
<ruby_date> how can i reverse this expression? Date.ordinal(2012, n).to_time.to_i
<topriddy> and to know the doc of a particular method? how to use it? intellisense in java tells you a lot on how to use the method, args, args ordering , return type etc
<Spooner> topriddy, Use pry gem rather than vanilla irb. It makes that sort of inquiry a lot easier to read.
<topriddy> >> 2 + 2
<eval-in> topriddy: Output: "" (http://eval.in/6252)
<ddd> iirc, isn't it @some_obj.methods(true) just to see instance methods only?
<hoelzro> topriddy: you can use ri for that
* topriddy bleh
<ruby_date> >> Date.ordinal(2012, 1).to_time.to_i
<eval-in> ruby_date: Output: "/tmp/execpad-672810e43320/source-672810e43320:1:in `<main>': uninitialized constant Date (NameError)\n" (http://eval.in/6253)
<ddd> i forget actually and just usually call .methods
<hoelzro> or introspection methods
<Spooner> topriddy, And it gives direct access to docs with show-doc Array#delete
<ruby_date> Date.ordinal(2012, 1).to_time.to_i => 1325361600
<workmad3> ddd: .methods(true) is for not showing inherited methods, iirc
<ruby_date> so i need to get Date.ordinal object from 1325361600
<ruby_date> how can i do it?
Elhu has joined #ruby
br4ndon has joined #ruby
<ddd> workmad3: ahh
<workmad3> ddd: SomeClass.instance_methods is also an option
TheFuzzball has joined #ruby
greg5green has joined #ruby
<workmad3> topriddy: the intellisense capabilities in ruby are not the same as in java (or rather, they're similar to what you can get in java if you start messing around with lots and lots of reflection)
<topriddy> Spooner: i don't know what pry gem means. i just launch irb from mac bash. ***covers face***
<ddd> github.com/pry/pry
<Spooner> topriddy, gem install pry THEN just "pry" instead of "irb"
<ddd> github.com/pry/pry/wiki
<topriddy> okay
* topriddy downloading
<ddd> the README for the project will show you how to make pry the default even when you call 'irb'
<topriddy> ddd: is that a good thing?
tomzx has quit [Quit: tomzx]
Elhu has quit [Client Quit]
<ddd> um, yeah
<workmad3> ddd: is it something other than a bash alias? :)
<ddd> workmad3: yes ;)
<Spooner> ruby_date, Time.at(1325361600).to_date
<Spooner> (though that looks like it doesn't account for time zones on the return trip).
Elhu has joined #ruby
slainer6_ is now known as slainer68
<ruby_date> Spooner: oh, thanks a lot
<sie> Proc is simply a class for passing around blocks, correct?
ruby_date has quit [Quit: leaving]
<ddd> actually I dont' see it there anymore, so, just add https://gist.github.com/e0ad5dcf53f786c228cc to your ~/.irbrc and it will cause pry to launch within irb's session. then just read pry's docs on how to use it. does everything irb does and more. pretty simple to use :)
wallerdev has quit [Quit: wallerdev]
RagingDave has joined #ruby
<Spooner> sie proc/lambda are not quite the same as blocks, but in a general sense, yes.
pcboy_ has quit [Remote host closed the connection]
horofox has joined #ruby
vlad_starkov has joined #ruby
topriddy_ has joined #ruby
topriddy_ has quit [Read error: Connection reset by peer]
<Hanmac> an block itself is not a proc ... like when you only do yield with an do ... end as block, it does not create proc objects, but when you do &block eigher as parameter in the method or as parameter for the method, it does create Proc objects
topriddy has quit [Remote host closed the connection]
topriddy has joined #ruby
nicobrevin1 has quit [Ping timeout: 265 seconds]
karasawa has quit [Read error: Connection reset by peer]
<Spooner> ddd, I actually prefer to keep irb and pry separate. Pry can take 5s longer to load on Windows :/
<ddd> hehe, yet another reason i won't waste my time with windows
cisco has quit [Quit: Leaving.]
<Hanmac> hm pry is also a liitle bit slower with loading on linux too
<Muz> There's a known issue with 'require' being poorly performant on Windows and a fix for it, but I can't seem to find it right now.
<ddd> not had that problem on debian testing, ubuntu 12.04, or mac osx ML
<Muz> I wouldn't be surprised if it was related to this though.
malkomalko has joined #ruby
<Spooner> It is, but it makes enough difference in Windows if I just want to quickly test a one-liner (irb) or start a longer session (pry)
<Spooner> Muz 1.9.3 is massively faster at requiring.
<Spooner> *on Windows.
<Muz> Ah, it probably nods towards that patch in 1.9.3
<Spooner> I would have said 10s slower in 1.9.2 :D
<ddd> that could be another reason. i don't touch anything 1.8.7. everything i work on is some patchlevel of 1.9.3
<Muz> I can't recall if it's slow because of NTFS or if it'd still occur with a different FS.
karasawa has joined #ruby
topriddy has quit [Ping timeout: 276 seconds]
<Muz> (Such as exFAT)
samuel02 has quit [Remote host closed the connection]
<Spooner> Not sure. I think the 1.9.2->1.9.3 speedup was just optimising some super-dumb code, not OS-specific.
ber is now known as berkes
akl_ has quit [Remote host closed the connection]
<Muz> Thats the badger
<Muz> "The work of this project has already been merged into Ruby 2.0 and soon will be backported into Ruby 1.9.3."
topriddy has joined #ruby
<Muz> Not sure which patchlevel release it made its way into though.
<topriddy> God bless the person that mentioned pry…it is SWEET!!
<topriddy> i like the colourings there
rippa has joined #ruby
<topriddy> wish i could just even edit my program there and somehow output some classes to file or get my program in a file afterwards
<Spooner> You might want to install ruby-doc too, since that gives you access to all the standard docs (like Array/String, etc). Save some time by installing pry-full and you get a whole sack of crazy :)
Guest59463 has quit [Read error: Connection reset by peer]
Guest59463 has joined #ruby
pcarrier has quit []
<Spooner> topriddy, You can edit in pry. Just can't magically dump the current state of stuff you've build in the REPL
<topriddy> heh. trade off
horofox has quit [Quit: horofox]
<Spooner> Sorry, I mean you can edit source files in pry and re-load them.
<topriddy> Spooner: using TextMate2 for file editing atm. would have loved something cooler. Like someone cool Mac Ruby dev settings
<workmad3> topriddy: you could also ask banister what his colour scheme is and use that in your editor ;)
sepp2k has joined #ruby
<topriddy> i have ruby-doc --- yet to read how to use it though. Left Little Book Ruby and now reading PickAxe
<workmad3> topriddy: also, vim is a decent choice for a ruby editor with plenty of support
horofox has joined #ruby
horofox has quit [Client Quit]
<workmad3> (or emacs, if you're that way inclined :P )
<Spooner> topriddy, I use Rubymine IDE, but it isn't free except for opensource development (and sublime text for tiny scripts).
<topriddy> workmad3: i would need a decent vim .vimrc for ruby then i think. and some tips. i don't mind using vim
<ddd> I use RubyMine myself, but ther eis also Aptana Studio 3 which is another IDE like it, but is free
<ddd> They also offer RadRails
stetho has quit [Quit: stetho]
<workmad3> topriddy: I use the vimified .vimrc (poorly) with a few customisations and extra packages :)
<Spooner> ddd thanks, I'll try Aptana
<ddd> sublime text2, radrails, vim, textmate on the mac, whole bunch of editors and ides
<topriddy> workmad3: please share .vimrc for ruby custom editing. and the extra packages….would stick to TextMate2 for a while more though.
tonini has quit [Remote host closed the connection]
<Spooner> You don't need more than that really.
<Spooner> Anything past notepad is fine :)
<ddd> wow, in order for RubyMine to update my address on the license, they have to 'refund my order and reprocess it' in order to change my address??
<ddd> also sent them 3 emails with the change of address in them, but they want *another* email with the new address? really?
<workmad3> topriddy: ok, I use https://github.com/zaiste/vimified
<workmad3> topriddy: and then add this file as ~/.vim/after.vimrc https://gist.github.com/4492296
Guedes_out is now known as Guedes
<topriddy> after.vimrc is an actual file.
<workmad3> topriddy: I'm not exactly a stellar vim user though :)
fermion has joined #ruby
pcarrier has joined #ruby
<topriddy> workmad3: thanks. same here. but some guy i introduced to programming some 3years ago, decided not to go with java but ruby (because of some asterix telephony software PBX on linux which supported it), now he;s so cool and productive in ruby. knows vim. If my student can learn it, i can too :D
<topriddy> appreciate all of you much ***hugs***
<workmad3> :)
<hoelzro> topriddy: what resources are you using to learn Ruby?
akl_ has joined #ruby
<topriddy> hoelzro: have read some several short tutorials, first: learn ruby (interactive online tutorial - pretty short), an old copy of (Little Book of Ruby - stopped at end of chapter 2), now i want to use PickAxe
tmi_ has joined #ruby
<hoelzro> topriddy: if you're looking for a book and willing to spend a bit of money, I highly recommend "The Ruby Programming Language"
<hoelzro> it's a fantastic book
<workmad3> hoelzro: that's the pickaxe ;)
<workmad3> oh wait sorre
kevinfagan has joined #ruby
dwu1 has joined #ruby
<workmad3> getting programming ruby and ruby programming language mixed up
<hoelzro> I would bet that at least 20% of my messages to this channel are recommendations for that book
<hoelzro> I should become an affiliate =)
<JonnieCache> the one with the birds on the front
<JonnieCache> is the one you want :)
<hoelzro> yup
<JonnieCache> the pickaxe is good too though
<workmad3> either would be good I suspect :)
<workmad3> either way, I'd probably suggest that you pick a project to do in ruby now, get some more immersive learning done
<JonnieCache> definitely
<workmad3> or start solving project euler problems, do some katas in ruby...
<topriddy> goal is to know enough fundamentals to do scripting and OS admin and then play with Rails or any reasoning web app to do a fun web app
<workmad3> something to start immersing yourself in the language rather than just reading reams of text :)
the_hack has quit [Quit: Computer has gone to sleep.]
<Spooner> And remember to Ruby.learn, not learn Ruby ;)
<topriddy> other than Web projects, and simple admin one time scripts, i can't really think of what to use Ruby for. Same can be said for Python
<workmad3> Spooner: how about Languages.learn :ruby ;)
carloslopes has joined #ruby
<topriddy> but i'm fine….
<workmad3> topriddy: full-on configuration management ;)
<hoelzro> I like person.learn :ruby
<workmad3> topriddy: e.g. chef
<JonnieCache> languages.each(&:learn)
<workmad3> topriddy: I believe there are a few in here doing games in ruby atm too
<Spooner> Yeah, I write games. They suck ;)
<workmad3> topriddy: but basically, you can use ruby for pretty much any general task
<workmad3> Spooner: I didn't say anyone wrote *good* games in ruby :P
emergion has joined #ruby
Takehiro has joined #ruby
fir_ed has joined #ruby
<wreckimnaked> games in ruby, that's something new
<grzywacz> trolololo
<workmad3> topriddy: I've mostly stayed in the web-app sphere since I learned ruby (because that's where my job is now), and it's definitely the most visible aspect
the_hack has joined #ruby
jenrzzz has quit [Remote host closed the connection]
<topriddy> even desktop apps are preferable windows or java. programming devices too, e.g POS, Printers, etc. most apis come with java/windows dlls
<workmad3> topriddy: yeah, but you can use jruby on the JVM
moted has quit [Ping timeout: 244 seconds]
chriskk has quit [Quit: chriskk]
<topriddy> "and deal with its own issues". :D
<topriddy> really, i think i have gotten a better view…i should go off and study now. thanks all again
lolcathost has quit [Ping timeout: 260 seconds]
gregoryigelmund has joined #ruby
kjellski has joined #ruby
inffcs00 has quit [Ping timeout: 240 seconds]
jacktrick has quit [Quit: Leaving]
znake has joined #ruby
a_a_g has joined #ruby
inffcs00 has joined #ruby
Guest59463 has quit [Read error: Connection reset by peer]
Guest59463 has joined #ruby
pcarrier has quit []
Mon_Ouie has quit [Ping timeout: 256 seconds]
RagingDave has quit [Quit: Ex-Chat]
pcboy_ has joined #ruby
nathancahill has quit [Quit: nathancahill]
the_hack has quit [Quit: Computer has gone to sleep.]
s0ber has joined #ruby
sie has quit [Ping timeout: 265 seconds]
znake has quit [Quit: znake]
dwu1 has quit [Read error: Connection reset by peer]
joschi_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
nemesit|osx has quit [Quit: Linkinus - http://linkinus.com]
nemesit has joined #ruby
lolcathost has joined #ruby
joschi_ has joined #ruby
fir_ed has quit [Ping timeout: 260 seconds]
joschi_ has quit [Client Quit]
rippa has quit [Ping timeout: 240 seconds]
hotovson has joined #ruby
joschi_ has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
joschi_ has quit [Client Quit]
joschi_ has joined #ruby
karasawa has quit [Ping timeout: 260 seconds]
whitedawg1 has joined #ruby
horofox has joined #ruby
karasawa has joined #ruby
the_hack has joined #ruby
whitedawg has quit [Ping timeout: 265 seconds]
sanukcm has joined #ruby
fir_ed has joined #ruby
fyolnish has joined #ruby
yshh has quit [Remote host closed the connection]
icole has quit [Remote host closed the connection]
elico has joined #ruby
tvw has joined #ruby
wreckimnaked has quit [Ping timeout: 252 seconds]
elico has quit [Client Quit]
ViPi has joined #ruby
joschi_ is now known as joschi
<Hanmac> i read that they found just another critical bug in rails :P
mavenastic has joined #ruby
<Spooner> Hanmac Rails ails!
<Hanmac> maybe they where to fast on the curved line? :P
pcarrier has joined #ruby
<workmad3> Hanmac: is that the one that they fixed yesterday? or another one?
etank has joined #ruby
<Hanmac> "CVE-2013-0156" it should be the fixed one
<workmad3> yeah, that's the one that was announced yesterday
<workmad3> and fixed
<mavenastic> list
browndawg has left #ruby [#ruby]
clocKwize has quit [Quit: clocKwize]
includex has joined #ruby
chussenot has quit [Quit: chussenot]
horofox has quit [Quit: horofox]
wermel has joined #ruby
pcboy_ has quit [Remote host closed the connection]
koderde has joined #ruby
banister`sleep has quit [Ping timeout: 265 seconds]
nari has joined #ruby
craigp has joined #ruby
craigp has quit [Client Quit]
fir_ed has quit [Ping timeout: 260 seconds]
buibex has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
chussenot has joined #ruby
MxG has joined #ruby
TomyLobo has joined #ruby
banister`sleep has joined #ruby
WilfredTheGreat has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
clocKwize has joined #ruby
nkr has joined #ruby
endre has joined #ruby
nicobrevin1 has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
maycon has joined #ruby
maycon has quit [Changing host]
maycon has joined #ruby
dustint has joined #ruby
<fuzai> Whats the easist way to make a script restart itself?
<Xeago> I don't know if it is easy, but if you run a file $0 is the filename(or path?) you can pass that into the interpreter
<fuzai> what about useing exec?
<fuzai> and doind a exec "./filename"
<fuzai> doing
gregoryigelmund has quit [Quit: Leaving...]
<Xeago> no idea, I use daemonizers or launchd on osx
<Xeago> and just let it quit it, it will be restarted again
<Spooner> exec $0 should do it.
<fuzai> Thank you Spooner :)
dscastro has joined #ruby
dscastro has left #ruby ["Leaving..."]
<Spooner> $0 is the file initially run, __FILE__ is the current file, if that matters.
sie has joined #ruby
baphled has joined #ruby
charliesome has joined #ruby
Pip has joined #ruby
banister_ has joined #ruby
<topriddy> hi workmad3 - still around?
dhruvasagar has joined #ruby
<topriddy> just installed vilified….my system now looks very retarded :(
buibex has joined #ruby
<topriddy> vimified
hotovson has quit [Read error: Connection reset by peer]
banister`sleep has quit [Ping timeout: 260 seconds]
hotovson has joined #ruby
<workmad3> topriddy: oh?
<topriddy> workmad3: forgotten how to get screenshot on mac so i can share
<charliesome> topriddy: cmd shift 4
<Xeago> cmd+shift+4
d2dchat has quit [Ping timeout: 252 seconds]
<topriddy> i'll lodge a complaint on their site later on…github/community…not sure if i had a previous setting that is messing it up
<Xeago> add ctrl to copy into clipboard
the_hack has quit [Ping timeout: 252 seconds]
fir_ed has joined #ruby
blaxter has quit [Ping timeout: 246 seconds]
dr_bob1 has quit [Quit: Leaving.]
yacks has quit [Quit: Leaving]
sie has quit [Ping timeout: 260 seconds]
browndawg has joined #ruby
dr_bob has joined #ruby
browndawg has quit [Max SendQ exceeded]
<topriddy> please see…happened after i installed vimified on mac bash
Xeago_ has joined #ruby
Xeago is now known as Guest91394
Guest91394 has quit [Killed (rajaniemi.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
<topriddy> same happens trying to edit ruby code created through textmate2
hotovson has quit [Read error: Connection reset by peer]
hotovson has joined #ruby
chussenot_ has joined #ruby
niklasb has joined #ruby
Proshot has joined #ruby
taoru_ has quit [Remote host closed the connection]
browndawg has joined #ruby
chussenot has quit [Ping timeout: 260 seconds]
chussenot_ is now known as chussenot
JohnBat26 has joined #ruby
the_hack has joined #ruby
Pip has quit [Ping timeout: 264 seconds]
fir_ed has quit [Ping timeout: 260 seconds]
lolcathost is now known as Playground
* Hanmac point finger and laughs about mac users
timonv has quit [Remote host closed the connection]
* csmrfx Are you sure it is not the pythonists that are pointing the finger at ruby windows, ruby mac and debian rubygem users?
<csmrfx> (and laughing))
bhavesh_a_p has joined #ruby
clooth has joined #ruby
<ddd> Captain Chuckles ;)
haxrbyt__ has quit [Ping timeout: 260 seconds]
<bhavesh_a_p> in ruby 'data members' means variables, objects ....?
<banister_> bhavesh_a_p: what epression is never used but it will mean instance variables
<banister_> 'data members' is a C++ term
<banister_> that expression*
<banister_> c++ "data members + member functions" --> ruby "instance variables + methods"
haxrbyte has joined #ruby
<bhavesh_a_p> actually I just read that in ruby methods are default public & data members are private
<bhavesh_a_p> <banister_> thanks
haxrbyte_ has joined #ruby
hamed_r has joined #ruby
Virunga has joined #ruby
wreckimnaked has joined #ruby
<topriddy> what??
Nisstyre has quit [Ping timeout: 244 seconds]
<banister_> bhavesh_a_p: yeah that's true
* topriddy sighs…back to textmate2 for now.
<banister_> bhavesh_a_p: but it's more extreme, ivars are not only 'private', it's impossible to make them public
nicobrevin1 has quit [Ping timeout: 244 seconds]
<banister_> if you want to access them u have to do it through a method
<bhavesh_a_p> hm
<ddd> banister_: i was mentally arguing against that statement until i realised duh, getter/setter is *exactly* that (dumbass me)
<bhavesh_a_p> or we can make it public using like attr_accessor
<ddd> bhavesh_a_p: still a method actually
c3vin has quit [Ping timeout: 240 seconds]
<Hanmac> its possible to get instance variables without an attr getter, with obj.instance_variable_get(:@abc)
<bhavesh_a_p> :) right
<ddd> its just a dynamic way of creating the methods
<ddd> Hanmac: does that bypass mass-assignment (iirc thats rails specific)
<ddd> ?
<fuzai> Is there somthing like tidy for ruby code?
haxrbyte has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Ping timeout: 248 seconds]
browndawg has quit [Ping timeout: 240 seconds]
<topriddy> Hanmac: you should help…not laugh :|
horofox_ has joined #ruby
<ddd> the mass assignment being rails specific, not the method you mentioned
<Hanmac> ddd i think yes, because it the instance_variable_set method does assign the variable directly and ignore all possible get or set methods
<ddd> got it. thanks
<Hanmac> same goes for instance_eval {}
dwnichols has joined #ruby
nwertman_ has joined #ruby
<banister_> Hanmac: that's a method too
nwertman has quit [Ping timeout: 260 seconds]
yshh has joined #ruby
<ddd> other than shitloads of typing, what would be insane about using that and not opening vars to mass-assignment? i mean i know that'd be a bucketload of extra typing easily solved by attr_accessible, but would it be a safer way? or am i missing something in the details of m-a?
chussenot has quit [Quit: chussenot]
<Hanmac> >> class A; def abc; p "getter called"; return @abc;end; def abc=(value);p "setter called"; @abc = value; end; end; a = A.new; p a.abc; a.abc = 4; p a.instance_eval {@abc}; a.instance_eval {@abc = 5}
<eval-in> Hanmac: Output: "\"getter called\"\nnil\n\"setter called\"\n4\n" (http://eval.in/6259)
browndawg has joined #ruby
a_a_g has quit [Quit: Leaving.]
<ddd> i mean i realize people wuld look at me insanely for typing it out like that when there's a shortcut, however, i fail to see why that would be an unsafe thing to do
<Hanmac> ddd i dont know your called "mass-assignment" because it may reails specific and i didt see it before
sepp2k has quit [Quit: Leaving.]
<ddd> Hanmac: vars are by default blocked from being assigned unless they are marked with attr_accessible in rails. just the mere fact of them existing (they are dynamically created from AR fields on a record) doesn't allow them to be assigned with the security change in rails (early 3.x iirc)
<apeiros_> s/vars/attributes/
<apeiros_> (you can't block vars)
<ddd> apeiros_: you're right. i should have stated it that way. thank you
<ddd> they're synonymous in my head
<Hanmac> yeah when ivars attack they are unblockable :D
* apeiros_ protector of semantic details
<ddd> heheh
ttt has quit [Remote host closed the connection]
yacks has joined #ruby
yshh has quit [Ping timeout: 260 seconds]
xemu has joined #ruby
cantonic has quit [Quit: cantonic]
Nisstyre has joined #ruby
tmi__ has joined #ruby
<topriddy> does anyone else use vimified on mac vim successfuly? during installation the only thing that failed was vim-slim requiring a github password
<workmad3> topriddy: I do... but I use macvim through the terminal
adkron has quit [Ping timeout: 255 seconds]
<topriddy> workmad3: i don't have macvim. how do i get that?
<Xeago> macvim through terminal, mind explaining?
tmi_ has quit [Ping timeout: 260 seconds]
<Xeago> you mean the vim from macvim?
<workmad3> Xeago: yeah
<workmad3> Xeago: so it's the macvim build, but in terminal rather than GUI mode
<apeiros_> oh, Xeago - sorry about monday, was already sleeping - but tonight?
<Xeago> apeiros_: maybe, depends what time office closes
<Xeago> haven't played since 2012-10
<Xeago> workmad3: ctrlp vs command-t
geekbri has joined #ruby
c3vin has joined #ruby
<Xeago> workmad3: have you set it up that it looks in /Applications/MacVim.app/wherever/the/dir/lives
pcboy_ has joined #ruby
<workmad3> Xeago: ctrlp... command-t requires too much effort to set up
timonv has joined #ruby
samuel02 has joined #ruby
<Xeago> I find it quite easy to setup, how is the performance/
<Xeago> it is a few steps, which is annoying if vim doesn't have ruby
<Xeago> but if it has ruby, it is all shiny stuff
<apeiros_> Xeago: I played a bit, but still bronze (even though I win ~4 out of 5 games, but probably I just don't play enough)
<Xeago> aight, cool!
<Xeago> I got a new b.net code since the patch tho
<topriddy> workmad3: do you remember having to provide github username/password while installing vimified? i'm using the lazy-man installation instruction
mmitchell has joined #ruby
<workmad3> no, if that happens with vundler it's normally a sign that there's an incorrect repo name there
<topriddy> i didn't install bundler….do i need too?
<apeiros_> Xeago: pm, hope it's ok :)
grzywacz has quit [Quit: :wq]
<topriddy> thought vimified was a layer on vundler according to wiki tho
dwnichols has quit [Ping timeout: 264 seconds]
baphled has quit [Ping timeout: 264 seconds]
Pip has joined #ruby
<Xeago> bah, the top of a cucumber tastes like crap
mjolk has joined #ruby
bjeanes has joined #ruby
TomRone has joined #ruby
<kapowaz> wanted: help with analysing an exception stack trace (from foreman, running rake-pipeline-web-filters): https://gist.github.com/9934816225557afbe287
mark_locklear has joined #ruby
<topriddy> workmad3: would file in an issue
<kapowaz> okay, solved it, in the unlikely event anyone was looking at it ;)
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
krawchyk has joined #ruby
subbyyy has joined #ruby
fteem has joined #ruby
lkba has joined #ruby
samphippen has joined #ruby
distax has joined #ruby
distax has left #ruby ["Leaving"]
kevinfagan has quit [Remote host closed the connection]
cantonic has joined #ruby
elico has joined #ruby
griffindy has joined #ruby
jeffreybaird has joined #ruby
bhavesh_a_p has quit [Quit: Leaving]
Uranio has joined #ruby
mmitchell has quit [Remote host closed the connection]
aflynn_ has joined #ruby
zv470 has joined #ruby
inokenty has joined #ruby
tommyvyo has joined #ruby
d2dchat has joined #ruby
rvmeier has joined #ruby
mrdtt has joined #ruby
mrdtt has quit [Client Quit]
wendallsan has joined #ruby
jtharris has joined #ruby
amaya_the has joined #ruby
invisime has joined #ruby
the_hack has quit [Quit: Computer has gone to sleep.]
joofsh has joined #ruby
the_hack has joined #ruby
tonytonyjan has quit [Ping timeout: 260 seconds]
iPhoneMRZ has joined #ruby
iPhoneMRZ has quit [Client Quit]
jjbohn has joined #ruby
chussenot has joined #ruby
tagrudev has quit [Read error: Connection reset by peer]
_alejandro has quit [Remote host closed the connection]
megha has joined #ruby
AltGrendel has joined #ruby
_alejandro has joined #ruby
tagrudev has joined #ruby
willob has joined #ruby
Nisstyre has quit [Ping timeout: 256 seconds]
buibex has quit [Remote host closed the connection]
clocKwize has quit [Quit: clocKwize]
banister_ has quit [Ping timeout: 256 seconds]
_alejandro has quit [Ping timeout: 240 seconds]
banister`sleep has joined #ruby
willob has quit [Read error: Connection reset by peer]
nu7hatch has joined #ruby
lkba has quit [Ping timeout: 276 seconds]
villadelfia has quit [Read error: Operation timed out]
villadelfia has joined #ruby
buibex has joined #ruby
ttt has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
sie has joined #ruby
jerius has joined #ruby
subbyyy has quit [Ping timeout: 252 seconds]
jpfuentes2 has joined #ruby
itnomad has quit [Ping timeout: 276 seconds]
buibex has quit [Remote host closed the connection]
ttt has quit [Ping timeout: 276 seconds]
maxmanders has quit [Quit: leaving]
maxmande_ has joined #ruby
danieldocki has joined #ruby
DrShoggoth has quit [Quit: Leaving]
Nisstyre has joined #ruby
szck has joined #ruby
AltGrendel has quit [Quit: Leaving.]
maxmande_ has left #ruby [#ruby]
csgui has joined #ruby
slainer6_ has joined #ruby
maxmanders has joined #ruby
xAndy is now known as xandy
GoGoGarrett has joined #ruby
mikecmpbll has joined #ruby
PragCypher has joined #ruby
sayan has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
slainer68 has quit [Ping timeout: 246 seconds]
sailias has joined #ruby
willob has joined #ruby
chussenot has quit [Ping timeout: 252 seconds]
ner0x has joined #ruby
malkomalko has quit [Remote host closed the connection]
cisco has joined #ruby
cisco has quit [Client Quit]
rubyasker has quit [Quit: Leaving]
nu7hatch has left #ruby [#ruby]
Playground has quit [Ping timeout: 255 seconds]
xandy is now known as xAndy
topriddy has quit [Ping timeout: 240 seconds]
horofox_ has quit [Quit: horofox_]
obryan has joined #ruby
spanner has joined #ruby
thatguycraig has joined #ruby
thatguycraig has quit [Max SendQ exceeded]
thatguycraig has joined #ruby
chussenot has joined #ruby
rismoney has joined #ruby
lolcathost has joined #ruby
xerxas has quit [Quit: Connection closed for inactivity]
jonahR has joined #ruby
stevechiagozie has joined #ruby
Nisstyre has quit [Ping timeout: 255 seconds]
v0n has joined #ruby
mmitchell has joined #ruby
fermion has quit [Read error: Connection reset by peer]
niklasb has quit [Ping timeout: 265 seconds]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
mavenastic has quit [Quit: Page closed]
tommyvyo[cloud]_ has quit [Quit: Connection closed for inactivity]
jpfuentes2 has joined #ruby
tommyvyo[cloud]_ has joined #ruby
main has quit [Ping timeout: 246 seconds]
main has joined #ruby
kjellski has quit [Quit: This computer has gone to sleep]
mmitchell has quit [Remote host closed the connection]
solidoodlesuppor has joined #ruby
jrist-afk is now known as jrist
tmi__ has quit [Quit: tmi__]
main has quit [Max SendQ exceeded]
main has joined #ruby
Nisstyre has joined #ruby
dougireton has joined #ruby
judesamp has joined #ruby
ananthakumaran has joined #ruby
blaxter has joined #ruby
F1skr has joined #ruby
berkes has quit [Quit: Ex-Chat]
enroxorz-work has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
segv- has joined #ruby
<shevy> is it very helpful to define private for classes in ruby?
<shevy> it seems to reduce freedom
Takehiro has quit [Remote host closed the connection]
stopbit has joined #ruby
lkba has joined #ruby
<hoelzro> I would create public methods as part of the API that users are encouraged to use/extend, and private methods for methods that may change or go away
chussenot has quit [Quit: chussenot]
beiter has joined #ruby
<banister`sleep> check out this kick-ass exception driven development workflow http://showterm.io/8237209fdadaebd7862d9
luckyruby has joined #ruby
megha has quit [Quit: WeeChat 0.3.9.2]
<shevy> hoelzro ah ok, so it becomes an element of public API design
spanner has quit [Read error: Connection reset by peer]
dougireton has quit [Quit: Leaving.]
Guest25886 has joined #ruby
scrapcode has joined #ruby
nkts has joined #ruby
xbayrockx has quit []
haxrbyte_ has quit [Remote host closed the connection]
spanner has joined #ruby
jds_ has joined #ruby
quest88 has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
<hoelzro> shevy: for me, yes
xeviox has joined #ruby
<hoelzro> banister`sleep: very Smalltalky
jonathanwallace has joined #ruby
<banister`sleep> hoelzro: that's the ultimate idea ;)
<banister`sleep> getting there, slowly
<xeviox> hi guys, I have string like "%VARIABLE%\nValue\n\n%VARIABLE..."
<hoelzro> =)
mercwithamouth has joined #ruby
<xeviox> how can I extract value of a specific variable?
<hoelzro> xeviox: you mean getting the value of a Ruby variable by name?
<xeviox> hoelzro: no, out from the string I posted
judesamp_ has joined #ruby
<hoelzro> oh, I see what you mean
<csmrfx> Whats a nice, clean ruby-webdriver project I should steal code from?
ExxKA has joined #ruby
kjellski has joined #ruby
judesamp_ has quit [Client Quit]
judesamp_ has joined #ruby
<scrapcode> "NoMethodError: undefined method `p' for main:Object" I'm trying to replicate "print_r" in php in RubyFiddle.com to play with hashes and "map" for better understanding. Is it just fiddles fault that this method doesn't exist?
<xeviox> I thought of using my_string[..., 1] with a regex that creates two groups (first variable name, second the value), but I don't know how to do this
cantonic has quit [Read error: Connection reset by peer]
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
headius has joined #ruby
cantonic has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
headius has quit [Client Quit]
jds_ has quit [Ping timeout: 252 seconds]
judesamp has quit [Ping timeout: 245 seconds]
judesamp_ is now known as judesamp
headius has joined #ruby
mmitchell has joined #ruby
invisime has left #ruby [#ruby]
browndawg has quit [Quit: Leaving.]
<hoelzro> ah, another thing Ruby inherited from Perl: __END__/DATA
buibex has joined #ruby
whitedawg1 has quit [Quit: Leaving.]
jblack_ has quit [Ping timeout: 252 seconds]
greenarrow has quit [Ping timeout: 256 seconds]
greenarrow has joined #ruby
Nisstyre has quit [Ping timeout: 260 seconds]
<JonnieCache> every time i remember that feature im thankful hardly anyone knows about it
<JonnieCache> imagine if the rails lot had got excited about that feature 5 years ago. imagine the mess we'd be in haha
RagingDave has joined #ruby
elico has quit [Ping timeout: 276 seconds]
<xeviox> is it possible to use string[...] with a variable?
jlast has joined #ruby
quest88 has quit [Quit: quest88]
<xeviox> e. g. my_string[[a-z]] with my_sting[first-last]
<shevy> xeviox, use a regex + match group
fourq has joined #ruby
scrapcode has left #ruby [#ruby]
<xeviox> shevy: how can I build a regex with variables?
<xeviox> and is it usable with string[...]
<shevy> xeviox string support regex
elico has joined #ruby
<shevy> "abcdef"[/cd/] # => "cd"
<shevy> "abcdef"[/cdxx/] # => nil
pu22l3r has joined #ruby
<xeviox> shevy: is it possible to use a variable instead of "cd" ?
<Hanmac> >> p "abcdef"["cd"]
JMcAfreak has joined #ruby
<eval-in> Hanmac: Output: "\"cd\"\n" (http://eval.in/6260)
<xeviox> ok
<xeviox> thanks
stevechiagozie has quit [Quit: Textual IRC Client: www.textualapp.com]
ExxKA has quit [Quit: This computer has gone to sleep]
stevechiagozie has joined #ruby
<shevy> xeviox yes
<shevy> just as in any other regex too
<shevy> regex = "abc" # => "abc"; string = 'foo bar abc' # => "foo bar abc"
<shevy> string.match(regex)
<shevy> # => #<MatchData "abc">
<shevy> matchdata = string.match(regex) # => #<MatchData "abc">; matchdata[0] # => "abc"
<shevy> damn, forgot to kill one newline :\
<shevy> anyway, in a regex like /blablabla/, you can use /#{name_of_variable_here}/
nateberkopec has joined #ruby
ExxKA has joined #ruby
<xeviox> thanks, helped me a lot!! :D
Spami has joined #ruby
thillux has joined #ruby
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
kjellski has quit [Quit: This computer has gone to sleep]
digitalsanctum has joined #ruby
<shevy> the more people using ruby, the better for all of us here :P
ananthakumaran has quit [Quit: Leaving.]
miskander has joined #ruby
miskander has quit [Client Quit]
Nisstyre has joined #ruby
dougireton has joined #ruby
`Kevin has joined #ruby
fourq has left #ruby [#ruby]
ExxKA has quit [Read error: Connection reset by peer]
ExxKA has joined #ruby
niklasb has joined #ruby
eldariof has quit [Ping timeout: 244 seconds]
Takehiro has joined #ruby
neurotech has quit [Remote host closed the connection]
philcrissman has joined #ruby
elico has quit [Ping timeout: 260 seconds]
cdt has joined #ruby
elico has joined #ruby
<Hanmac> the less people using rails, the better for all of us here :P
megha has joined #ruby
zv470 has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
mjolk has quit [Quit: Leaving]
_nitti has joined #ruby
akemrir has quit [Quit: WeeChat 0.3.9.2]
rippa has joined #ruby
Takehiro has quit [Ping timeout: 240 seconds]
arturaz has quit [Read error: Connection reset by peer]
Zolrath has joined #ruby
bean has joined #ruby
<sie> Hanmac, Exactly why?
answer_42 has quit [Ping timeout: 276 seconds]
<sie> Is it possible to get sprinkle to shut up about output and put in some log?
karl____ has joined #ruby
dustint has quit [Remote host closed the connection]
<Hanmac> because then less people would anov us about rails and then we need to point them to the right channel ...
elico has quit [Ping timeout: 252 seconds]
<ner0x> https://github.com/rafaelfranca/node This actually kind of pisses me off.
<ner0x> Hanmac: Rails is a double edge sword.
<csmrfx> sie: you can pipe output to a file if nothing else
<sie> Hanmac, Oh, come on.
fermion has joined #ruby
<sie> csmrfx, Well yeah, I guess I simply don't like how sprinkle does things.
LouisGB has quit [Ping timeout: 256 seconds]
<csmrfx> well, I dont even know what sprinkle is and how you use it and where it outputs
<sie> ner0x, Oh, really, why?
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<ner0x> sie: Brings a lot of people to the language.
<ner0x> sie: Unfortunately you also get what you get with any mainstream framework/language, newbs by the hundreds.
rondale_sc has joined #ruby
philcrissman has quit [Remote host closed the connection]
<csmrfx> look guys
<JonnieCache> it brings more money to the jobs though :)
<csmrfx> you clearly havent patrolled ##javascript or similar
<csmrfx> ##ruby is a small side alley shop with very low traffic
tmi_ has joined #ruby
<csmrfx> if rails bothers you, just do what ##javascript did with !jquery
<csmrfx> (an irc macro that tells people that this is not a rails channel and where to go)
luckyruby has quit [Remote host closed the connection]
<ericwood> autokick people who mention rails
<csmrfx> lol
<ericwood> you have to rule with an iron fist, or else nobody will learn
<ner0x> I have no problem with rails.
ericwood was kicked from #ruby by apeiros_ [you mentioned rails :-p]
* apeiros_ snickers
zommi has quit [Quit: Leaving.]
ericwood has joined #ruby
<ericwood> damn
<apeiros_> ;-p
<csmrfx> ha-ha
<Pip> :D
<apeiros_> you could #ruby-without-rails
<apeiros_> or #rubyoffrails
<ericwood> #rubyoffdarailz
<Hanmac> #rubyonmonorails
dustint has joined #ruby
danieldocki has quit [Read error: Connection reset by peer]
<csmrfx> #rubyonair
llaskin has joined #ruby
tmi_ has quit [Client Quit]
<Pip> damn
<Hanmac> #rubyoncrack ;D
<shevy> #rubydavidhasslehoffiscooler
<llaskin> is the require syntax different between 1.8.7 and 1.9.3 for example "require 'lib/Portal/Setup.rb'" worked in 1.8.7 and doesn't work in 1.9.3
ExxKA has quit [Quit: This computer has gone to sleep]
nfk has joined #ruby
<ericwood> require_relative is what you want
<shevy> llaskin they took out "./" from the path, I think, and added require_relative
<llaskin> so it shoudl be require_relative ?
<llaskin> ok
<csmrfx> llaskin: you need require rubygems?
speakingcode has joined #ruby
<shevy> llaskin or you install your project into ruby SITEDIR
<ericwood> not in 1.9
<shevy> require 'foobar'
<ericwood> require rubygems was phased out iirc???
<csmrfx> oh, its the wrong way around for that
tagrudev has quit [Remote host closed the connection]
<Pip> #ruby-wet-bed
rismoney has left #ruby [#ruby]
dustint has quit [Remote host closed the connection]
nari has quit [Ping timeout: 240 seconds]
niklasb has quit [Ping timeout: 248 seconds]
Akinsola has joined #ruby
<apeiros_> ericwood: correct
<ericwood> good.
dustint has joined #ruby
<ericwood> I always hated that
<ericwood> but anyways, require_relative is what you want
<JonnieCache> nooo
<apeiros_> IMO require_relative = instafail
<apeiros_> (with some rather rare exceptions)
<ericwood> not in my experience
<JonnieCache> just add the right dirs to the load path
<apeiros_> it means you haven't understood $LOAD_PATH
<shevy> I hate require_relative
<ericwood> that's stupid, require_relative is awesome
* ericwood feels cornered all of a sudden :|
<apeiros_> ericwood: in 99.9% of all cases, you have a lib dir, and that's installed - it already IS in load path
buibex has quit [Remote host closed the connection]
<workmad3> ericwood: it couples files together
<workmad3> ericwood: nastily so
<apeiros_> so a plain require would work just fine
<ericwood> hmmm okay
<shevy> ericwood well, I can avoid it if I can use require a project
<apeiros_> the only case where it doesn't is during development
gansbrest has quit [Quit: Ex-Chat]
<apeiros_> because during development, your thingy is not installed
nemesit has quit [Ping timeout: 240 seconds]
<Akinsola> new
<Akinsola> here
ananthakumaran has joined #ruby
<shevy> it has extra word, so a bunch of require 'bla' looks different than require_relative 'bla'
slainer6_ is now known as slainer68
<shevy> it annoys me visually :(
davidd12 has joined #ruby
marr has quit []
postmodern has quit [Quit: Leaving]
<shevy> matz should have called it "import" :P
<apeiros_> welcome here, Akinsola. On a sidenote, you're allowed to write more than 1 word per message ;-p
<Pip> I just wrote a program in Ruby that keeps asking you if you wet bed; and it won't stop until you say "yes"
<shevy> Pip are you really using ruby ...
rismoney has joined #ruby
<Pip> I use recursion
Akinsola has left #ruby [#ruby]
<Pip> shevy, define really
_nitti has quit [Remote host closed the connection]
<apeiros_> Pip: so it'll stop too if I say 'no' often enough
<shevy> as in WROTE something really ;)
<apeiros_> (well, it'll stop violently…)
<Pip> let me share it
locriani has joined #ruby
<shevy> ok
dustint has quit [Remote host closed the connection]
davidd12 has quit [Remote host closed the connection]
yonahw has quit [Ping timeout: 260 seconds]
rondale_sc has quit [Remote host closed the connection]
jekotia has joined #ruby
<llaskin> shevy: so you have to specify the folder name? so instead of require 'lib/Portal/Setup.rb' I should say require_relative 'trunk/lib/Portal/Setup.rb' ?
SCommette has joined #ruby
dougireton has quit [Quit: Leaving.]
<shevy> llaskin I do not use require_relative. but as far as I know, you can just give the file path to require_relative, if you want to use it
sepp2k has joined #ruby
<llaskin> its still spitting up
<shevy> llaskin the alternative is to setup a proper project directory structure, with a lib/ directory, then install that somehow, like via setup.rb
<ericwood> will ruby automagically know to check lib/ ?
<llaskin> C:/SVN/rubymine_checkout/lib/Portal/Setup.rb:1:in `require_relative': cannot load such file -- C:/SVN/rubymine_checkout/lib/Portal/lib/File.rb (LoadError)
<shevy> and when you then do: require 'foobar', you also have a file called foobar.rb that can call your other files in your project
<karl____> Pip: try gets.to_s.chomp.downcase ?
<shevy> aha so you are a windows guy ;<
<llaskin> hah
<llaskin> also i think i just figred out when i reread that
<shevy> hmm
<shevy> have you tried to leave out C: ?
<Pip> karl____, No need to put to_s there
<Pip> gets does get string
<shevy> anywy, it should work from within irb llaskin
<shevy> even on windows
<apeiros_> llaskin: require 'Portal/Setup' should do it
x82_nicole has joined #ruby
<apeiros_> since lib should be in $LOAD_PATH
nomenkun has quit [Remote host closed the connection]
fteem has quit [Read error: No route to host]
<llaskin> lmfoa yes i did
<shevy> Pip your script even works
<shevy> I am impressed
fteem has joined #ruby
<llaskin> it actually is working this way: require_relative '../Portal/Setup'
<Pip> lol
dustint has joined #ruby
<apeiros_> you're doing something wrong then
<apeiros_> how do you start the executable?
<shevy> llaskin see now I am beginning to hate require_relative even more
elico has joined #ruby
LouisGB has joined #ruby
tomask has joined #ruby
<shevy> I can not remember ever having to do: require '../
* apeiros_ assumes `ruby bin/whatever`
scruple has joined #ruby
<csmrfx> #in ruby code (adding directory to $LOAD_PATH
horofox_ has joined #ruby
<csmrfx> $:.unshift File.join( %w{ /lib mylib } )
<apeiros_> nah, just `ruby -Ilib bin/whatever`
swex has joined #ruby
<apeiros_> no need to pollute code for development-time only things
danieldocki has joined #ruby
whitedawg has joined #ruby
<csmrfx> heh, there are other ways but can't paste em from here
danieldocki has quit [Client Quit]
swex_ has quit [Ping timeout: 264 seconds]
lolcathost has quit [Ping timeout: 252 seconds]
danieldocki has joined #ruby
<csmrfx> or, perhaps in your Daddy-ruby-file:
<csmrfx> $:.unshift File.dirname(__FILE__)
<apeiros_> if you really have to: lib_dir = File.expand_path('../../lib', __FILE__); $LOAD_PATH.unshift(lib_dir) if File.directory?(lib_dir)
<Hanmac> manipulating loadpathi itself is not an good idea when you dont know that you do
* apeiros_ prefers absolute paths in $LOAD_PATH
<apeiros_> Hanmac: +1
<apeiros_> as is using require_relative…
<Hanmac> require_relative should be safe to use
<apeiros_> it's bad coupling.
<ericwood> why is he right and I'm wrong?
<ericwood> not fair
whitedawg has quit [Client Quit]
<apeiros_> he's wrong too, if that makes you feel better :)
<ericwood> nope
<apeiros_> require_relative (except for some rare cases) = instafail
speakingcode has quit [Quit: leaving]
<ericwood> for simple use I think require_relative is The Right Way™
adamjleonard has joined #ruby
<apeiros_> use lib + plain require.
<apeiros_> ericwood: never if "lib" is part of the path.
<ericwood> but will the lib dir already be known by ruby?
* Hanmac has skilled in Rightness and has an +1Right-Club
carloslopes has quit [Remote host closed the connection]
<apeiros_> ericwood: again, on anything that is installed: yes.
<ericwood> woooo
GoGoGarr_ has joined #ruby
<ericwood> okay, apeiros_ is right, then
<apeiros_> and when you're working/developing the thing, you can add it through -I
<Hanmac> ericwood: only if you installed it as gem with an currect gemspec
<ericwood> sorry, Hanmac
browndawg has joined #ruby
<ericwood> oh
<ericwood> well that seems like a lot of trouble
<Pip> What's the factorial of 3000 ?
<ericwood> Pip: too large
<apeiros_> Pip: range + inject
asteve has joined #ruby
GoGoGarrett has quit [Ping timeout: 260 seconds]
zigomir has quit [Quit: zigomir]
<apeiros_> and yeah, it's 9131 chars long, so not pasting here.
staafl has joined #ruby
elico has quit [Read error: Connection reset by peer]
carloslopes has joined #ruby
<apeiros_> (2..3000).inject(:*)
jds_ has joined #ruby
<ericwood> >> (2..5).inject(:*)
<eval-in> ericwood: Output: "" (http://eval.in/6266)
berserkr has quit [Quit: Leaving.]
<ericwood> :(
joshman_ has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
carloslopes has quit [Remote host closed the connection]
<sie> >> (2..5).inject(:*).to_s
<eval-in> sie: Output: "" (http://eval.in/6267)
<sie> mwat
<xeviox> is it possible to print a list of all members of an object?
<ericwood> works in irb
<sie> ericwood, indeed
<apeiros_> >> p (2..5).inject(:*)
<eval-in> apeiros_: Output: "120\n" (http://eval.in/6268)
<apeiros_> you have to print something to stdout
ananthakumaran has joined #ruby
<sie> ah, pfft
<ericwood> I figured it'd function like irb does
<ericwood> lame
<apeiros_> and yeah, using rv would be nice
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<Hanmac> apeiros_ i think "3000!" is to big for ruby ... i see an inaccuracy at the end of the number ...
judesamp has left #ruby [#ruby]
<ericwood> xeviox: by members do you mean methods and instance variables/
<ericwood> I guess I'm confused as to that terminology
<xeviox> when I define a "getter" with def desc @desc end , why isn't it possible to access it with "my_object.desc" ?
<apeiros_> Hanmac: it's not
<apeiros_> took <1s here
<xeviox> ericwood: yes
<ericwood> xeviox: check out http://www.ruby-doc.org/core-1.9.3/Object.html if you haven't already
<apeiros_> Hanmac: and the result being a Bignum means it's 100% accurate
<ericwood> .methods and .instance_variables is what you want
<apeiros_> xeviox: it should? paste your code
<ericwood> xeviox: don't define a method for "getters", use attr_reader :desc instead
<ericwood> this ain't no java
<Hanmac> apeiros_ so the 748 zeros at the end are normal?
<apeiros_> attr_reader :desc is just meta-programming for `def desc; @desc; end`, which he already did if I understood him right…
<xeviox> erichmenge: yes
<apeiros_> Hanmac: happens with numbers which have 9131 digits
<ericwood> right, but it's The Ruby Way™ and it makes things nicer on the eyes :D
<erichmenge> xeviox: wut?
jds_ has quit [Ping timeout: 276 seconds]
topriddy has joined #ruby
<apeiros_> Hanmac: also happens with numbers which have 2, 5, 10 and multiples thereof many times as a factor in them
<ericwood> erichmenge: I think he meant me :P
<shevy> too many erics
huoxito has joined #ruby
<shevy> one of you must perish!
<apeiros_> /kick random eric
<ericwood> xeviox: what you posted should work...we need example code!
ananthakumaran has quit [Ping timeout: 256 seconds]
<Hanmac> apeiros_ i tryed with bigdecimal too:
<erichmenge> My first name is spelled the cool way though.
buibex has joined #ruby
<Hanmac> >> require "bigdecimal"; BigDecimal(2).step(BigDecimal(3000)).inject(:*)
<eval-in> Hanmac: Output: "" (http://eval.in/6270)
<apeiros_> Hanmac: hu?
dr_bob has quit [Quit: Leaving.]
<topriddy> hi...at the risk of sounding like an idiot...i want to ask if one can pass unique code_blocks to a method in a single_call, and how one would differentiate them with the yield method
<apeiros_> (2..3000).inject(:*) # this works perfectly fine
jduan1981 has joined #ruby
<xeviox> code: http://pastebin.com/W6yRKt4w , error: `name': wrong number of arguments (0 for 1) (ArgumentError)
<shevy> topriddy yield always accesses the block you gave to a method, you can check if a block was given, via "yield if block_given?"
<xeviox> "pkt.to_s" works fine ..
<ericwood> xeviox: you really, really, need to use attr_accessor and attr_reader
<shevy> topriddy I do not know what you mean with "in a single_call"
<Hanmac> yeah and its the same as the result of BigDecimal ... (but for a moment i thought that big decimal is more currect)
rismoney has left #ruby [#ruby]
dr_bob has joined #ruby
<apeiros_> Hanmac: with Bignum you either get an accurate result or no result at all. it's not a float.
<xeviox> ericwood: I check already, as you might recognized I'm new to ruby :(
<Hanmac> xeviox: there is no method overloading, so your secound method overwrites the first one, and setter methods does have an "=" at the end
<topriddy> shevy: call_block { code_block_1} {code_block_2}
<ericwood> xeviox: this isn't like java, you redefined url
<topriddy> something like that
fteem has quit [Read error: Connection timed out]
<shevy> hehe
<shevy> apeiros_ once wanted to have multiple blocks to a method
<topriddy> shevy: what have seen though is. call_block{code_block_1}
<ericwood> xeviox: the issue is that you can't define methods with the same names and different numbers of arguments and expect them to all be unique
fteem has joined #ruby
<apeiros_> shevy: "once"?
<shevy> topriddy, yeah, only one block is allowed :(
<apeiros_> I still do. and halsbe does have that.
<shevy> hehehe
<topriddy> not like i want it. I wondering if its possible, since i am learning syntax.
<ericwood> xeviox: take a look at attr_reader and attr_accessor and use those to define your getters and setters instead
<apeiros_> well, technically, blocks are ordinary arguments there.
<xeviox> ah ok thanks!!
<apeiros_> {…} is a code literal there
Kuifje has joined #ruby
<xeviox> ericwood: I'll do :) thanks
Kuifje has joined #ruby
Kuifje has quit [Changing host]
<ericwood> xeviox: you're a java programmer, aren't you? :P
buscon has quit [Quit: Leaving]
<xeviox> ericwood: yes ^^
<Hanmac> rtopriddy: you cant pass multible blocks without converting them with proc or lamba into real parameters
<shevy> topriddy, you need to use halsbe one day then :P not sure why matz did not want more than one block, or perhaps the ruby parser would get confused, or some other syntax has to be changed
<apeiros_> topriddy: you can come close to it using stabby-lambda syntax
<ericwood> xeviox: luckily you don't have to type as much for simple things like this in ruby :P
<xeviox> ericwood: it's always the problem when coming from another language, you may right the new one, but you right it in the style of the one you're coming from :(
<apeiros_> topriddy: foo a: ->{ …code… }, b: ->{ …code… }
_nitti has joined #ruby
speakingcode has joined #ruby
<Hanmac> >> def abc;end pr = proc{}; abc(&pr) {}
<eval-in> Hanmac: Output: "/tmp/execpad-35e6fbaedff3/source-35e6fbaedff3:1: syntax error, unexpected tIDENTIFIER, expecting $end\ndef abc;end pr = proc{}; abc(&pr) {}\n ^\n" (http://eval.in/6271)
<ericwood> xeviox: no worries, The Ruby Way™ is easy to pick up and quite sane
jduan1981 has quit [Quit: jduan1981]
<Hanmac> >> def abc;end; pr = proc{}; abc(&pr) {}
<eval-in> Hanmac: Output: "/tmp/execpad-0f8d4bf1fb57/source-0f8d4bf1fb57:1: both block arg and actual block given\n" (http://eval.in/6272)
<speakingcode> does ruby have a 'literal' syntax for hashes, similar to json in javascript?
<apeiros_> speakingcode: {}
<speakingcode> damn that was fast. thanks!
nwertman_ has quit [Ping timeout: 244 seconds]
<shevy> ericwood there is more than one ruby way!
<apeiros_> speakingcode: {'foo' => 12}, alternatively (symbol keys only!) {foo: 12}
<speakingcode> how do you do the values? "key" : "value" ?
<speakingcode> oh ok
<speakingcode> =>
<speakingcode> sweet
<apeiros_> {foo: 12} is equivalent to {:foo => 12}, you can't mix the two syntaxes.
<shevy> the innards of the ruby parser must be scary
<csmrfx> >> { 2: "bar" }
<eval-in> csmrfx: Output: "/tmp/execpad-c3766d88ee35/source-c3766d88ee35:1: syntax error, unexpected ':', expecting tASSOC\n{ 2: \"bar\" }\n ^\n/tmp/execpad-c3766d88ee35/source-c3766d88ee35:1: syntax error, unexpected '}', expecting $end\n{ 2: \"bar\" }\n ^\n" (http://eval.in/6273)
<csmrfx> 8o
<csmrfx> ;)
<apeiros_> shevy: they are.
<apeiros_> parse.y, enjoy the ride
<topriddy> please dont scare me away with Proc/lambda or stabby-lambda yet. i am a java programmer X_x
<Hanmac> apeiros_
<Hanmac> >> { "foo" => 12, foo: 13}
<eval-in> Hanmac: Output: "" (http://eval.in/6274)
<Hanmac> >> p { "foo" => 12, foo: 13}
<csmrfx> And you thought metacircular-self-evaluating parsers were scary?
<eval-in> Hanmac: Output: "/tmp/execpad-a8e7785b0930/source-a8e7785b0930:1: syntax error, unexpected tASSOC, expecting '}'\np { \"foo\" => 12, foo: 13}\n ^\n" (http://eval.in/6275)
<xeviox> oh man I'm an idiot
<csmrfx> cool, me too!
<apeiros_> wtf? when did that happen?
<xeviox> no it's also clear why "class.field = value" didn't work ..
<shevy> topriddy well you dont have to use stabby lambda, in fact, you can use 20% of ruby and be more productive that way!
<apeiros_> ok, I retract my statement - you *can* mix the syntaxes.
<xeviox> *now
<Hanmac> huch ... "{ "foo" => 12, foo: 13}" works on irb but "p { "foo" => 12, foo: 13}" works not :D
* apeiros_ is pretty sure that wasn't always the case
<apeiros_> Hanmac: that's due to p{}
<apeiros_> you need parens there
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
<apeiros_> it's considered to be a block
<shevy> ewwww parens
<topriddy> its a lil weird that the whole single data type for arrays arent single types unlike most c-like languages. Even Haskell (i think). But then in Ruby everything is an object...guess its just an array object
<Hanmac> ah okay
<Hanmac> >> p({ "foo" => 12, foo: 13})
<eval-in> Hanmac: Output: "{\"foo\"=>12, :foo=>13}\n" (http://eval.in/6276)
<shevy> ewww my eyes, this is lispified ruby for sure
<Hanmac> but as you can see, both syntaxes can be mixed
<speakingcode> topriddy you coming from java?
elico has joined #ruby
<shevy> I dont like mixing syntaxes!
<eregon> >> p "foo" => 12, foo: 13
<eval-in> eregon: Output: "{\"foo\"=>12, :foo=>13}\n" (http://eval.in/6277)
<shevy> oh
<ericwood> mixing types in arrays is great
<shevy> so you can omit the {} there too, haha hilarious
<Hanmac> eregon: yeah free the parameters :D
<ericwood> A++++ would code again
<eregon> :)
<apeiros_> fascinating, it worked in 1.9.2 too
<shevy> ruby must be easily as good for golfing as perl is
<apeiros_> I wonder why I was under the impression that the two styles were not mixable
<ericwood> pretend they are
<shevy> apeiros_ perhaps because your brain likes to keep things simple
<ericwood> it's for the best
<csmrfx> shevy: surely you've seen rubykoans
<shevy> I feel not comfortable mixing syntaxes at all
<topriddy> yeah...java
<shevy> keep it all simple, for the sake of the kittens
generalissimo has joined #ruby
<csmrfx> I love it how ruby isn't made for autistic mathematicians suffering from OCD with Aspergers
benlieb has joined #ruby
hamed_r has quit [Quit: Leaving]
<speakingcode> topriddy: me too, by way of javascript tho. don't worry, once you have some good places to apply it, it's nice. just don't abuse it :-) it works great with the duck typing
csgui has quit [Quit: csgui]
<Hanmac> csmrfx what means 0CD?
maletor has joined #ruby
<csmrfx> Obsessive-Compulsive-Disorder
* Hanmac is an aspi
<csmrfx> ok no offense intended, just used metaphors to illustrate Haskell
buibex has quit [Ping timeout: 276 seconds]
ryanjh has joined #ruby
* Xeago is an aspi too
* ericwood is an ADDi
<Hanmac> i havend see haskell yet, but ruby feels "natural"
<ericwood> haskell doesn't feel natural
<ericwood> unless you're a lambda calculastitician
<Xeago> haskell is dark magic
<Sgeo_> "natural" is entirely dependent on what you're used to
<Xeago> seen that in ##crypto did not understand a thing
Spami has quit [Quit: Leaving]
<ericwood> I was pretty decent with haskell for small things, but I never truly grokked monads
<Hanmac> Xeago: than you havend seen what i did with C/C++/Ruby combined :P ... that what i would call "black magic"
<Sgeo_> I've been immersed in Python for a while, so omitting parens to mean "get the method itself" is natural to me, and that doesn't work in Ruby
<ericwood> it was good practice in functional programming, though, and made me a better ruby programmer
<Xeago> Hanmac: I agree, the code I seen you paste here I also call black magic :)
Guest59463 is now known as Astralum
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
elico has quit [Ping timeout: 260 seconds]
<Sgeo_> Hey, does Ruby have delimited continuations? I've heard that callcc is going away, but I've read that delimited is generally better, so...
jgarvey has joined #ruby
<Hanmac> Sgeo_ if you want the method use the Method :method :P .... like in [].method(:join) or Array.instance_method(:join)
timonv has quit [Read error: Connection reset by peer]
<ericwood> >> p [].method(:join)
<eval-in> ericwood: Output: "#<Method: Array#join>\n" (http://eval.in/6278)
<ericwood> neat
main has quit [Ping timeout: 240 seconds]
<apeiros_> Method#source_location and #owner are also nice
<ericwood> >> p &[].method(:join)
<eval-in> ericwood: Output: "" (http://eval.in/6279)
<apeiros_> but you may want to use pry right way
csgui has joined #ruby
<Hanmac> i often use Dir["*"].map(&File.method(:size)).inject(:+)
<apeiros_> in pry, `$ [].join` gives you the implementation, and `? [].join` gives you the docs
Spami has joined #ruby
<Hanmac> >> p Dir["*"]
<eval-in> Hanmac: Output: "[\"input-c89964a8dbdf\", \"output-c89964a8dbdf\", \"source-c89964a8dbdf\"]\n" (http://eval.in/6280)
<Hanmac> >> p Dir["*"].map(&File.method(:size)).inject(:+)
<eval-in> Hanmac: Output: "46\n" (http://eval.in/6281)
atno has quit [Read error: Connection reset by peer]
cascalheira has joined #ruby
atno has joined #ruby
sayan has quit [Read error: Connection reset by peer]
mwlang has joined #ruby
Umren has joined #ruby
inffcs00 has quit [Remote host closed the connection]
lobak_ has joined #ruby
lobak has quit [Read error: Connection reset by peer]
<mwlang> what is the technique of reversing the domain name and using it as a hierarchical tree (a la Java) called? i.e. com.example.library_name
<mwlang> and is there a good Ruby gem/library for working with domains this way?
buibex has joined #ruby
carloslopes has joined #ruby
sanukcm has quit [Quit: Leaving]
<Hanmac> do you want to use it for ruby gems or do you only need a function that reverse the string?
pencilcheck has joined #ruby
<ericwood> >> "foo".reverse
<eval-in> ericwood: Output: "" (http://eval.in/6284)
<ericwood> >> puts "foo".reverse
<eval-in> ericwood: Output: "oof\n" (http://eval.in/6285)
woolite64 has joined #ruby
<ericwood> that's more like it :)
<ericwood> mwlang: I doubt there is, you could probably roll that yourself pretty easily
buibex has quit [Remote host closed the connection]
<mwlang> I'm wanting to key off the domains -- parsing a log file of domains
<Hanmac> >> p "library_name.example.com".split(".").reverse.join(".")
<eval-in> Hanmac: Output: "\"com.example.library_name\"\n" (http://eval.in/6286)
<ericwood> split on ".", reverse, prepend "com"
<mwlang> and I want to go tld at first level, then domain base at next, then leaf node is the "www', "ads", etc.
hashpuppy has quit [Quit: hashpuppy]
<mwlang> its going to be quite large, so I figured general to specific is a good organizational structure and then I thought, "I bet somebody else has done this already"
baroquebobcat has joined #ruby
buibex has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<speakingcode> if you have am ethod that takes a class as a parameter, is the convention to capitalize or lowercase the paramaeter name?
madwilliamflint has joined #ruby
<speakingcode> like def callSomethingOnAClass(someclass) someclass.something
dr_bob has quit [Quit: Leaving.]
Kovensky is now known as Ninomiya-kun
Ninomiya-kun is now known as Kovensky
<mwlang> ok, I'll roll it myself -- I knew about reverse, just thinking about splitting off the "http://" and any trailing sub folders (which themselves will become keys.
emocakes has joined #ruby
<mwlang> speakingcode: I think the convention is to call that parameter "klass" -- at least that's what I see in many cases
francisfish has quit [Read error: Connection reset by peer]
<bean> mwlang: if you end up doing anything cool with it, you should open source it
topriddy has quit [Quit: Leaving.]
<mwlang> bean: is there an interest in this?
francisfish has joined #ruby
<Hanmac> mwlang:
<Hanmac> >> h={};"com.example.library_name".split(".").inject(h){|h,k|h[k] = {}};h
<eval-in> Hanmac: Output: "" (http://eval.in/6287)
<bean> mwlang: just sounds like an interesting thing.
<Hanmac> >> h={};"com.example.library_name".split(".").inject(h){|h,k|h[k] = {}}; p h
<eval-in> Hanmac: Output: "{\"com\"=>{\"example\"=>{\"library_name\"=>{}}}}\n" (http://eval.in/6288)
<bean> >> h={};"com.example.library_name".split(".").inject(h){|h,k|h[k] = {}}; p h.inspect
<eval-in> bean: Output: "\"{\\\"com\\\"=>{\\\"example\\\"=>{\\\"library_name\\\"=>{}}}}\"\n" (http://eval.in/6289)
<mwlang> Hanmac: Nice. You just saved me 30 mins.
dr_bob has joined #ruby
fteem has quit [Read error: Connection timed out]
banister`sleep has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 255 seconds]
<lupine> who knew self.class could be so expensive?
<mwlang> change split(".") to split(/\.\//) and I'm done.
banister`sleep has joined #ruby
DatumDrop has joined #ruby
<xeviox> as far as I've understand "attr_accessor" generates the method "attribut()" and "attribut=()" can someone explain why it is possible to use it like "object.attribute = value" (with a space)?
JMcAfreak has quit [Quit: leaving]
haxrbyte has joined #ruby
<chiel> it's a ruby thing (that's about all i know, haha)
<Hanmac> xeviox because its black magic
hoelzro is now known as hoelzro|away
<chiel> it's a bit like how you can define [] and []= methods
JMcAfreak has joined #ruby
<chiel> they provide obj[:key] = value and such
<Hanmac> xeviox "3 == 4" is also magic, its parsed as "3.==(4)"
matled has quit [Remote host closed the connection]
<speakingcode> hmm klass seems really vague in my use. i suppose a meaningful name with _class or _klass on the end would be okay. thanks mwlang
matled has joined #ruby
banister`sleep has quit [Ping timeout: 246 seconds]
v0n has quit [Quit: WeeChat 0.3.9.2]
v0n has joined #ruby
jduan1981 has joined #ruby
<xeviox> ok thanks
itnomad has joined #ruby
haxrbyte has quit [Remote host closed the connection]
macmartine has joined #ruby
<xeviox> so "class.attribute = value" gets parsed to "class.attribute= value" ?
haxrbyte has joined #ruby
francisfish has quit [Remote host closed the connection]
<lupine> yes
<speakingcode> xeviox: class or object?
Guest0223 has joined #ruby
<xeviox> speakingcode: sorry object
<lupine> strange things happen if you do, say, def foo=(a, b) then try to do something like foo = *[a,b]
<speakingcode> i may be wrong but i think a class var is accessed with ::
<lupine> but that's the basic idea
<lupine> speakingcode, you can use . for either
chussenot has joined #ruby
banister`sleep has joined #ruby
<lupine> so today, I'm mostly wrestling with *extremely* unperformant contractor code
<lupine> ordinarily, knocking 100 seconds off runtime would be a job well done and off home early. today, it's the tip of the sodding iceberg
<Guest0223> hi
<Guest0223> where is everyone from
<Guest0223> anyone from uk ?
<lupine> moi
<chiel> lies, you're clearly french!
Guest0223 has quit [Client Quit]
<lupine> nein
samphippen has quit [Quit: Computer has gone to sleep.]
<chiel> :D
nkts has quit [Remote host closed the connection]
<workmad3> lupine: you're a member of UK royalty, right?
<lupine> "let's call this method and some other ones - all slow - 21,761,269 times just to populate a poxy qt treeview, eh?"
<lupine> workmad3, I hope not
blazes816 has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
<workmad3> lupine: just you're claiming to be UK and talking german...
<lupine> if I am, I'll have to put myself up against a wall when the revolution comes
elux has joined #ruby
<workmad3> lupine: and my massive knowledge of UK royalty (garnered from being british and therefore means 'practically no knowledge at all') reveals that the royal family is of german origin currently :)
<lupine> they are indeed
megha has quit [Quit: WeeChat 0.3.9.2]
<workmad3> lupine: besides... why would we want to throw the royals up against the wall? I'd much rather get clegg and cameron there :P
<workmad3> lupine: the royals are just amusing
<lupine> if only
timonv has joined #ruby
the_hack has quit [Quit: Leaving...]
maletor has joined #ruby
vlad_starkov has joined #ruby
voodoofish has quit [Ping timeout: 245 seconds]
<chiel> any of you ever made a cap script for unicorn?
bluOxigen has joined #ruby
<chiel> i've not really looked into it much yet, but was looking to use unicorn in production
blazes816 has quit [Remote host closed the connection]
dougireton has joined #ruby
jgrevich has joined #ruby
judesamp has joined #ruby
pu22l3r has quit [Remote host closed the connection]
amaya_the has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
sailias has quit [Quit: Leaving.]
pskosinski has joined #ruby
rvmeier has quit [Ping timeout: 246 seconds]
blazes816 has joined #ruby
dougireton has quit [Client Quit]
cibs has quit [Ping timeout: 245 seconds]
aganov has quit [Quit: aganov]
tomask has quit [Quit: Leaving]
horofox_ has quit [Quit: horofox_]
ananthakumaran has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
stevechiagozie has joined #ruby
stevechiagozie has quit [Client Quit]
voodoofish has joined #ruby
<JonnieCache> the royals are just ornament
jeffreybaird has quit [Ping timeout: 246 seconds]
<JonnieCache> they can be exiled when the revoltion comes :)
<JonnieCache> there are others who have higher wall-priority
dr_bob has quit [Quit: Leaving.]
jjbohn has quit [Quit: Linkinus - http://linkinus.com]
stevechiagozie has joined #ruby
jeffreybaird has joined #ruby
apeiros_ has joined #ruby
<f0ster> What is the difference between ruby-debug and debugger ?
jjbohn has joined #ruby
<JonnieCache> ruby-debug is old and broken
<JonnieCache> debugger is new, working, and nicely designed
clocKwize has joined #ruby
<JonnieCache> debugger is based on nice new apis which are only in 1.9
a_a_g has joined #ruby
<JonnieCache> its about 100x faster
stevechiagozie has quit [Read error: Connection reset by peer]
stevechiagozie has joined #ruby
<JonnieCache> (i made that number up)
stan has quit [Ping timeout: 276 seconds]
Morkel has quit [Quit: Morkel]
<f0ster> hmm, how can I Be sure which I am using. I am actually using rails, but I did something like 'rails console --debugger'
<f0ster> but in the mist of following bad guidance from blogs yesterday i installed both debugger and ruby-debug-19-base
* lupine makes a note to avoid trying to polish turds in the future
slainer68 has quit [Remote host closed the connection]
<fuzai> http://pastie.org/5655828 When I use this piece of code when the sleep function is executed the main loop blocks. Is there a way to sleep without blocking the main loop?
<lupine> I've got a bunch of WSAPI-based models, and a bunch of Qt TreeView models, and a giant contractor-made turd right in the middle of the two for propagating changes in one to t'other
wallerdev has joined #ruby
<lupine> This ends. Here.
zph has joined #ruby
<f0ster> JonnieCache: isnt there some way I can set a breakpoint in my code from irb/(rails console) without editting my code ?
cardoni has quit [Quit: cardoni]
answer_42 has joined #ruby
<JonnieCache> f0ster:
<JonnieCache> f0ster: yeah
<f0ster> I cant find any documentation :/
<JonnieCache> i think when you use rails console --debugger it tries to load ruby-debug
<JonnieCache> i suggest you install pry-rails and pry-debugger into your project
ngoldman has joined #ruby
<JonnieCache> and do it all though the pry console. that can do everything youre asking
slainer68 has joined #ruby
andrewhl has joined #ruby
strtok has quit [Ping timeout: 255 seconds]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
<f0ster> I thought rails would be easy to use but whenever I encounter a simple task its always 'install yet another gem'
joeycarmello has joined #ruby
<lupine> it's generally faster than writing it yourself
carloslopes has joined #ruby
mneorr has joined #ruby
wroathe has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
<JonnieCache> the alternative to installing another gem is for all this stuff to be built into rails
<JonnieCache> and god knows it doesnt need anything else built in
<f0ster> just seems like a pretty basic requirement, debugging
berserkr has joined #ruby
<f0ster> shouldnt have to install a 4th and 5th party gem to achieve it
<lupine> maybe if rails were an IDE, you'd have a point
<lupine> but it's a web framework, not an IDE
<f0ster> true, but ruby has debugging built in
<JonnieCache> not really
<lupine> if that were true you wouldn't be installing extra gems, now
<workmad3> f0ster: the rails server in dev mode exposes a debugging port to connect a debugger to, I believe
clocKwize has quit [Quit: clocKwize]
<f0ster> sorry perhaps I was mislead
<lupine> various rails IDEs come with magic debugger integration
dmiller has quit [Quit: WeeChat 0.3.9.2]
<workmad3> f0ster: but rails isn't going to provide the actual debugger to connect to that for you
baphled has joined #ruby
<f0ster> so apparently ruby-debug and debugger are useless with rails console/irb, and I should get pry and pry debug
dmerrick has joined #ruby
dmiller has joined #ruby
stim371 has joined #ruby
samphippen has joined #ruby
<workmad3> f0ster: and many people don't like to set up debuggers through remote debugging ports (which tends to be what IDEs do for you), and so you have tools like ruby-debug and pry-debugger to allow different methods of debugging through console or terminals
<f0ster> I guess I'm jsut nervous about installing dependency's left and right for problems in the future
<xeviox> what is the preferred way for attr_accessors ? put all into a single line or one line per attribute?
<clooth> Just wanted to come and say how I've missed you. (ruby)
nwertman has joined #ruby
<f0ster> workmad3: do you use an ide ?
<apeiros_> xeviox: if you can tell me how you document them on a single line…
<workmad3> f0ster: no
<xeviox> apeiros_: ok ^^ thanks
Elhu has quit [Quit: Computer has gone to sleep.]
<JonnieCache> f0ster: the rails world loves lots of crazy dependencies, youd better get used to it ;)
<workmad3> f0ster: I use vim, and tend to do debugging through watching test failures and isolating (when required) with printlines and exception traces rather than a breakpoint debugger
<JonnieCache> thats one of its biggest problems
<xeviox> apeiros_: ruby code is so expressive, it mostly doesn't need some documentation :P
<f0ster> JonnieCache: before I Really knew rails at all (2 years ago) I had to migrate a 4 year old rails app at work and it was like DLL hell
DatumDrop has quit [Remote host closed the connection]
<f0ster> granted that was before rvm et. all but
<workmad3> JonnieCache: I have no idea what you mean...
nwertman has quit [Client Quit]
<workmad3> JonnieCache: this rails app I'm working on atm only has 168 gem dependencies...
<f0ster> JonnieCache: I Guess I should do better test driven development
<JonnieCache> f0ster: now we have bundler which basically solves that problem
<JonnieCache> youre right it was a bit like DLL hell back then
<JonnieCache> but now its actually very good
* workmad3 recalls the rack 1.1 craziness
AltGrendel has joined #ruby
<f0ster> so bundler will export all the dependencies so you dont run into the same problem, you just need the same version of rails and ruby on the other machine ?
joeycarmello has quit [Remote host closed the connection]
* workmad3 shudders
<workmad3> f0ster: you don't even need the same version of rails, the rails gem is also managed by bundler :)
<f0ster> however it happened, I was running down specific versions of mysql header files to get the right versions of the gems for AR to compile
<JonnieCache> f0ster: only the same version of ruby
Dwarf has joined #ruby
<f0ster> ah
<workmad3> f0ster: you basically just need ruby (same version and patchlevel is generally advised), rubygems (preferably latest) and bundler installed
fermion has quit [Quit: P]
* f0ster nods
<JonnieCache> it locks all the dependencies, resolves conflicts, optimises version numbers within limits and so on
<workmad3> f0ster: and then bundle install - voila, all the same versions of the gems are installed :)
<f0ster> well if I'm committing to ruby anyways I might as well try pry
fermion has joined #ruby
<f0ster> how does bundle relate to the Gemfile
<lupine> well, development and production environments are very different
<JonnieCache> the gemfile is the main thing bundler deals with
stim371 has quit [Quit: stim371]
<workmad3> bundler is the thing that reads the Gemfile, works out a dependency graph to provision your app with and records that in Gemfile.lock
<lupine> all my ruby applications - and dependencies - are in .deb packages on production
<lupine> but I use gems and rvm in development
<f0ster> ahh
<JonnieCache> f0ster: pry is great i recommended it to you not because its essential for debugging but just because its very very useful in general
<workmad3> it'll then set up the environment so that those gems are the only ones available during the ruby process
ananthakumaran has quit [Quit: Leaving.]
krz has quit [Quit: krz]
<f0ster> great, thanks for all the input :)
<f0ster> I try to avoid rails related questions here but its always a wash which channel will be more responsive
eldariof has joined #ruby
davidd12 has joined #ruby
<workmad3> f0ster: one of the nice things about bundler is that it really is more of a provisioner... if you need to override a gem with a different implementation (e.g. a fork of a specific gem version with a patch in it) then you can tell bundler where to get the gem from (github repo, filesystem path or a different gem repo) and bundler will use that
<f0ster> ahh
<f0ster> I have to read up on the tools I have, just many pieces in motion
alvaro_o has joined #ruby
<f0ster> I'm already using rvm too so hopefully i wont inadvertantely mess something up lol
fermion has quit [Client Quit]
<workmad3> it's generally pretty easy to reset if something does mess up, especially with gemfiles
jonahR_ has joined #ruby
fermion has joined #ruby
<JonnieCache> f0ster: yeah there are a lot of moving parts i can sympathise with that
mmitchell has quit [Remote host closed the connection]
<workmad3> mess up a gemfile and accidentally updated to versions that break? easy, just revert your Gemfile.lock in the source control and it's undone
<JonnieCache> thats modern web development in general though
skepti has quit [Quit: Leaving]
<workmad3> as opposed to the pre-bundler version of working out which gems just updated manually and gem uninstalling them until you get back to a working solution...
csgui has quit [Quit: csgui]
arkiver has joined #ruby
mercwithamouth has quit [Ping timeout: 260 seconds]
gyre007 has quit [Remote host closed the connection]
<workmad3> and yeah, the rails stack has, over the years I've been using it, definitely fractured into more pieces that you need to get a handle on... I could probably argue that each piece is simpler to master, but there's definitely more of them :)
<workmad3> and it might be simpler to master the dozen or so parts of the environment, but it's still more to get a handle on when first learning than rails 2.3 was
jonahR has quit [Ping timeout: 265 seconds]
jonahR_ is now known as jonahR
miskander has joined #ruby
<JonnieCache> a lot depends how how much you already know from other languages
miskander has quit [Client Quit]
<JonnieCache> it must be insanely indimitading for true newbies to development to come into rails now
<Xeago> yup
<Xeago> even for me
<Xeago> rails is scary
<JonnieCache> having to learn rvm, git, bundler and so on, THEN learn rails itself
<f0ster> so what should I know about gemsets in relation to gemfiles and bundler ?
<Xeago> rvm, I'd say that is not an issue for rails?
ryanjh has quit [Quit: Computer has gone to sleep.]
<Xeago> if you are lucky you have a recent version of ruby already
browndawg has quit [Ping timeout: 260 seconds]
vlad_starkov has quit [Remote host closed the connection]
<workmad3> f0ster: you can pretty much safely ignore gemsets when using bundler
<f0ster> workmad3: well I have rvm, so curious what I need to know if anything
<workmad3> f0ster: they were a workaround at the time that rvm was released (which was before bundler was really hitting big time) to roughly the same problem
timonv has quit [Remote host closed the connection]
<f0ster> ahh
jjbohn has quit [Quit: Leaving...]
<workmad3> f0ster: in essence, a gemset is simply a distinct gem repository, so you could have a gemset with all the gems for a project in it
<f0ster> but rvm also does ruby versioning.. a
brianpWins has joined #ruby
<f0ster> Ahh
zeade has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
<workmad3> f0ster: and switch between gemsets to activate different projects, without having gem activation conflicts or weird breakages because a gem's dependency didn't specify an exact version
<f0ster> okay
c0rn has joined #ruby
c0rn has quit [Client Quit]
daniel_-_ has joined #ruby
s1n4 has joined #ruby
daniel_-_ has quit [Client Quit]
daniel_-_ has joined #ruby
* f0ster tinkers with pry
mercwithamouth has joined #ruby
daniel_-_ has quit [Client Quit]
slainer68 has quit [Remote host closed the connection]
c0rn has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
jjbohn has joined #ruby
matled has quit [Ping timeout: 265 seconds]
cantonic has quit [Quit: cantonic]
nomenkun has joined #ruby
<Eiam> JonnieCache: ha, yes its pretty wild
<Eiam> I had to jump into working on a rails app with knowing 0 ruby, rvm, bundler, gems etc
cardoni has joined #ruby
francisfish has joined #ruby
<Eiam> i still barely know them, but I know enough to do usually what I need to do. i hate whenever I run into problems with bundler, gemfiles or rvm which are by far the largest dev timesinks I have
timonv has joined #ruby
<JonnieCache> you learn so much so fast though. im so glad i taught myself all this stuff in uni. they didnt teach me any of that stuff in the courses haha
cdt has quit [Ping timeout: 260 seconds]
<Eiam> I had some bug in passenger phusion + rvm that look me 2 days to figure out
<Eiam> ended up just uninstalling RVM
<JonnieCache> theres a whole generation of developers thats now addicted to DRY, TDD and best practices/workflow in general because of rails
<Eiam> because I couldn't find a solution that would work with rv enabled
<JonnieCache> and thats a very good thing i think
baphled has quit [Ping timeout: 240 seconds]
ngoldman_ has joined #ruby
moted has joined #ruby
<csmrfx> Because of rails?
<csmrfx> Kinda overstating it
<Eiam> ^
<Eiam> its just general programming atmosphere right now from where I stand
<Eiam> its popular
AlbireoX has quit [Remote host closed the connection]
<Eiam> it'll fade and something else will replace it
jduan1981 has quit [Quit: jduan1981]
<csmrfx> Majority of the ones using DRY and TDD would probably be using something that starts with "java"
<csmrfx> makes rails look marginal
<csmrfx> just part of the wave yanno
AlbireoX has joined #ruby
ViPi has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
<Eiam> the wheel of time turns and programming languages & best practices come and pass, leaving memories that become legend. legend fades to myth and even myth is long forgotten when the age that gave it birth comes again
<banister`sleep> Eiam: lol, you just watched the hobbit?
xeviox is now known as xeviox|awy
alex__c2022 has joined #ruby
includex has quit [Quit: Leaving...]
<Eiam> banister`sleep: certrainly not, is he stealing stuff from robert jordan?
xeviox|awy is now known as xeviox
ngoldman has quit [Ping timeout: 265 seconds]
<banister`sleep> Eiam: jsut the "legend turns into myth" thing
<Eiam> cause the eye of the world came out in 1990 which is quite awhile before the hobbit movie was released
greg- has joined #ruby
<banister`sleep> Eiam: haha, but the hobbit book came out ago ;)
<csmrfx> but when did hobbit-the-book come out
kpshek has joined #ruby
maxmanders has quit [Remote host closed the connection]
jeffreybaird has joined #ruby
<Eiam> banister`sleep: I'm not sure I want to say that because the hobbit movie did something that its present in the book
timonv has quit [Remote host closed the connection]
<Eiam> certainly tolkiens hier would vehenmently disagree with that sentiment =)
<Eiam> heir
<Eiam> vehemently
<csmrfx> ok, typoists, start your spell checkers!
<Eiam> dunno why my auto correct was barfing on me =(
AlbireoX has quit [Ping timeout: 248 seconds]
mercwithamouth has quit [Ping timeout: 252 seconds]
<Eiam> so you said the movie, which I compared against. I have not read the hobbit book in a very very long time so I don't know if it also contains something similiar or not. It may well, given tolkiens general creation of the high fantasy genre
<Eiam> despite authoring some of the most boring books I've ever read. anyway we are totall off track now =)
jds_ has joined #ruby
arkiver has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 260 seconds]
cardoni has quit [Ping timeout: 252 seconds]
davidd12 has quit [Remote host closed the connection]
<csmrfx> Those books are not boring, it's just your attention span is so short
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<Eiam> yeah I managed to read 8 wheel of time books totallying 8000 pages
<csmrfx> I wonder what would _why program to this discussion
<Eiam> but i've got a terrible attention span
<ged> Does anyone have a feel for whether it's acceptable/desired to use -rpath for Ruby extensions to ensure it loads the same version of the library it's linking against at gem-install time?
PragCypher has quit [Read error: No route to host]
benlieb has quit [Quit: benlieb]
adamjleonard has quit [Quit: Linkinus - http://linkinus.com]
jeffreybaird has quit [Client Quit]
workmad3 has joined #ruby
jonahR has quit [Ping timeout: 240 seconds]
[1]c3vin has joined #ruby
PragCypher has joined #ruby
Hanmac has joined #ruby
<Eiam> csmrfx: tolkien was clearly interested in creating languages & cultures, entire worlds. much of that process and detail is incredibly boring information unless you happen to be into fake history and fake languages that basically no one speaks. none of those are interesting to me
karamorf has joined #ruby
jds_ has quit [Ping timeout: 240 seconds]
<csmrfx> ged you mean '-r'?
c3vin has quit [Ping timeout: 240 seconds]
[1]c3vin is now known as c3vin
<karamorf> what does $_ do in Ruby? is it just like Perl?
<Eiam> same thing it does in bash
mockra has joined #ruby
adeponte has joined #ruby
Guedes has quit [Excess Flood]
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
tenmilestereo has joined #ruby
jblack has joined #ruby
<Eiam> irb has something similiar as well, ruby-1.9.2-p0: > 1+1;
<Eiam> > x=_;
osaut has joined #ruby
<f0ster> JonnieCache: is there some easy way to show the stack trace in pry-debugger ?
Vainoharhainen has quit [Quit: Leaving...]
<csmrfx> Eiam: fake languages, like ruby?
a_a_g has quit [Read error: Connection reset by peer]
<csmrfx> looks like you painted yourself into a corner there
<Eiam> csmrfx: no, fake languages like elvish =)
<Eiam> or whatever the hell its called
a_a_g has joined #ruby
<Eiam> it serves no purpose, ruby has a purpose
<csmrfx> I'm pretty sure no-one *speaks* ruby
<Eiam> DRY, make programming fun. it has hundreds of thousands of users
<ged> csmrfx: Isn't that --relocatable?
tatsuya_o has joined #ruby
<Eiam> csmrfx: programming langauges are spoken in written form
Drakevr has joined #ruby
<csmrfx> ged: are you compiling ruby, or interpreting ruby code?
Drakevr has joined #ruby
Drakevr has quit [Changing host]
karamorf has quit [Quit: Lost terminal]
krawchyk_ has joined #ruby
adkron has joined #ruby
<csmrfx> Eiam: programming languages are "fake" and are not even meant to be spoken, are basically not spoken
<havenn> Quenya is a nice Elvish language for poetry: http://www.youtube.com/watch?v=6de_SbVUVfA
<ged> csmrfx: Neither: writing an extconf.rb for a Ruby extension.
<Eiam> csmrfx: have not painted myself anywhere. programming languages are indeed communicated. yes, they are invented and often people invent ones that are mostly worthless or simply prove some particular point, they languish in disuse and dissapear
<Eiam> much like tolkiens languages
<eka> afaik tolkien based itself in the sanskrit language that he liked so much
<csmrfx> Eiam: just going by what you said, you said it, not me
chussenot has quit [Quit: chussenot]
<Eiam> csmrfx: you took the word spoken and translated it to audible, but spoken can just as easily mean communicated
<ged> csmrfx: I want to ensure the shared library it links against at compile time is the same one it loads at runtime.
kpshek has quit []
<csmrfx> s/said/wrote/
chrismcg is now known as zz_chrismcg
<Eiam> i'm not going to get into a word nit pick over it. tolkiens language only has value because he has such a culture around him. look at tons of other languages with more ostensible value (esperanto?) than 'elvish' and they languish
<csmrfx> ged: I do not know how to ensure that
<csmrfx> I think you are at the mercy of path
<csmrfx> I know of --disable-rpath but that would be the opposite, I guess
<Eiam> tolkien was not a good author, his stories were not engaging to the majority of his audience. he invented a genre and its a wonderful genre, and he had some great concepts. his books sucked.
noxoc has quit [Quit: noxoc]
<karl____> please take it to #tolkien
<Eiam> anyway, done on that topic
<ged> csmrfx: Well, -rpath adds directories to the dynamic linker's runtime search path, but I've never used it before.
<csmrfx> Eiam: and Elvis was not popular, and lives in Helsinki
squidBits has joined #ruby
krawchyk has quit [Ping timeout: 265 seconds]
<ged> But so many people have trouble with multiple installed versions of this library, I was thinking -rpath could help.
kdavh has joined #ruby
<jpfuentes2> <csmrfx> Eiam: programming languages are "fake" and are not even meant to be spoken, are basically not spoken
<csmrfx> ged: ever seen that "--with-libname-here" business?
AltGrendel has left #ruby [#ruby]
DrCode has quit [Ping timeout: 276 seconds]
<Gate> jpfuentes2: yeah, but that code largely doesn't work on close inspection.
blueOxigen has joined #ruby
<jpfuentes2> what do you doesn't *work* ?
a_a_g has quit [Quit: Leaving.]
mwlang has quit [Quit: mwlang]
ThaDick has joined #ruby
<ged> csmrfx: Like --with-openssl-dir=/usr/lib ?
<Eiam> jpfuentes2: as was pointed out, hes basically invented a sublanguage and stuffed it inside 'love'. thats a cool attribute of ruby and how we get so many DSL. I don't think that proves anything however.
bluOxigen has quit [Ping timeout: 256 seconds]
<jpfuentes2> Eiam that is me, btw
<csmrfx> ged: sometiems those also have lib version or some parameters, maybe thats what you want
shevy2 has joined #ruby
io_syl has joined #ruby
<Gate> jpfuentes2: %w(i n c r e d i b l y).zip(*"wonderful") #=> NoMethodError: undefined method `each' for "wonderful":String
<Eiam> jpfuentes2: well, cool article. I wouldn't go around speaking to anyone like that however. =)
<jpfuentes2> what version of ruby are you using, gate ?
<ged> csmrfx: Nah, that's for people *installing* the library. It doesn't affect the extension at runtime.
<Gate> just saying, its awesome, but its taking literary licence with code.
<jpfuentes2> works for me on 1.9.3
<f0ster> I have an object created like, "#<WorkTeamAvailability id: 106, day_of_week: 0, work_team_id: 27, start_time: "2000-01-01 14:00:00"", I get an error when I try to do something like, this_object.start_time, saying it is an undefined method? the exception said the object was an ActiveRecord::Relation
akl_ has quit [Ping timeout: 256 seconds]
<jpfuentes2> ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.1]
<jpfuentes2> jfuentes a-letter-to-Augsta $ ruby letter.rb
<jpfuentes2> Augusta, we <3 you!
<ged> So people will do: --with-openssl-dir=/usr/local, which will let the gem install okay, but then if their linker doesn't look in /usr/local/lib when the extension is loaded, it can load one from /usr/lib, and that's the problem I'm trying to mitigate.
<Eiam> jpfuentes2: does't work for me in 1.9.3-p0
<Eiam> same error
<jpfuentes2> why are you using p0 ? : )
<csmrfx> Text is not "spoken" language
<csmrfx> it is "written". FYI.
<Eiam> jpfuentes2: I don't update without cause =p
<jpfuentes2> pretty sure there are security issues w/ p0
<jpfuentes2> that would be a good cause
<Gate> jpfuentes2: doesn't work with p286 or p362 either
<Eiam> csmrfx: : to make known in writing : state
<Eiam> : to use or be able to use in speaking <speaks Spanish>
<Eiam> 3
<Eiam> 4
<Eiam> : to indicate by other than verbal means
<csmrfx> cute letter 8) <3 <2
judesamp has quit [Quit: judesamp]
<Eiam> speaking has nothing to do with text
<Eiam> many a poems have spoke to me =)
<Gate> Now you could assume that he added methods to base classes, but what are we, barbarians?
shevy has quit [Ping timeout: 265 seconds]
DrCode has joined #ruby
<karl____> please take this to #pedantry
<Eiam> err speaking always have to do with verbal
<Gate> heh, I hadn't noticed the link to love.rb
<csmrfx> Ok, speaking has nothing to do with text, written things are the same as "spoken", Tolkien was a shitty author, and... what else Eiam
tjbiddle has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
mercwithamouth has joined #ruby
<csmrfx> no, wait, "I dont care", actually
<Eiam> csmrfx: I corrected that statement in the next line sheesh =P you do enjoy pedantry don't you
<Gate> jpfuentes2: my fault, he *does* add methods to String and Array to make this work.
alvaro_o has joined #ruby
tjbiddle has quit [Remote host closed the connection]
<jpfuentes2> yeah, it's definitely a working program
<jpfuentes2> i'm surprised it doesn't work in the other high versions of 1.9.3 though
<jpfuentes2> i'll check 'em out
<Gate> jpfuentes2: I was just trying that small snipped sans his monkey-patching. I didn't realize he was injecting methods on to string. I have no doubt it will work with the monkeypatches.
<jpfuentes2> btw, gate, that "he" is me
apeiros_ has quit [Remote host closed the connection]
tjbiddle has joined #ruby
<csmrfx> like We::Wish.we_could { ... } would work without a module etc
pcarrier has quit [Read error: Connection reset by peer]
<jpfuentes2> right, there's a lot of different ways to make the program work
osaut_ has joined #ruby
jeffreybaird has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
<jpfuentes2> some of my choices were made as a way to display the intricacies of the language
kidoz has joined #ruby
<jpfuentes2> because my intention was to use it as a learning exercise with my daughter one day when she has enough ruby under her belt too understand the esoteric bits of the language
<Gate> jpfuentes2: Ah, well then. My apologies. It is an awesome poem BTW.
<csmrfx> Whats always_be: ?
<jpfuentes2> thanks
havenn has quit [Remote host closed the connection]
<jpfuentes2> always_be: is the ruby 1.9.3 hash syntax
<Gate> jpfuentes2: I just saw the string/array zip and tried it out on its own and hadn't looked to see your monkeypatch which makes it work fine.
workmad3 has quit [Ping timeout: 244 seconds]
<csmrfx> oh, right
<jpfuentes2> instead of :my_symbol => value, you can use my_symbol: value
ossareh has quit [Ping timeout: 265 seconds]
<jpfuentes2> agh, right, gate
<csmrfx> why not:
osaut has quit [Ping timeout: 260 seconds]
osaut_ is now known as osaut
<jpfuentes2> yeah you can git clone the repo and `ruby letter.rb`
a_a_g has joined #ruby
<jpfuentes2> that should work as it requires the love.rb support file : )
<csmrfx> hm, nm
<Hanmac> Gate jpfuentes2 String does loose the each method .. so you need to specifiy what you want to iterate ... so its each_char.zip( ... )
<csmrfx> I am way too tired to write code
andrewhl has quit [Remote host closed the connection]
<jpfuentes2> %w(i n c) => array
<csmrfx> I think I will go work on the *non-spoken* and -written language
ryanjh has joined #ruby
<jpfuentes2> not a string
<Gate> Which would detract from the point of the poem by injecting poorly contexted words
<Hanmac> oh
<jpfuentes2> so i you don't need an each/each_char .. you just need Array#zip
<Hanmac> jpfuentes its about the "wonderful"
<jpfuentes2> but i had to modify String#each => self.chars so that i could splat the wonderful string like so *"wonderful!"
jblack has quit [Ping timeout: 248 seconds]
<jpfuentes2> String#chars gives an array of each character, which allows that to be passed to zip appropriately
<csmrfx> btw why "wincredibly zip wonderful"?
<csmrfx> ;)
<f0ster> having trouble accessing an attribute on my model, seems really straight forward if anyone can help: https://gist.github.com/4495480
<jpfuentes2> %w() is a convenient way to make an array without all the quoting
<jpfuentes2> it also put emphasis on "incredible"
<jpfuentes2> by putting spacing b/t each letter
<csmrfx> I mean, why not ditch the non-english when it was done elsewhere
<jpfuentes2> i n c r e d i b l e VS incredible => stands out more
<Hanmac> f0ster : #rubyonrails
<csmrfx> wincredible zip wonderful is what it reads now
Rix is now known as NullByte
<jpfuentes2> where do you see something different ?
ThaDick has quit [Quit: zzzZZZ ...]
mneorr has quit [Remote host closed the connection]
<csmrfx> lol you need to take off your coders hat and look at it as any person would to get what I mean
<jpfuentes2> ahhh, right
<jpfuentes2> that's noise to them though
<jpfuentes2> they just see it as "i n c r e d i b l e"
<csmrfx> anyway, nice poem, almost finished ;) I'm going to eat some rye bread now
<jpfuentes2> so the get the point that i emphasized that word
<csmrfx> *you* do, they see a w + incredibly + zip + ...
rakl has joined #ruby
jtharris has quit [Quit: WeeChat 0.3.9.2]
<jpfuentes2> yeah, my wife knows 0 programming and she got it : )
Dann1 has joined #ruby
Dann1 has quit [Remote host closed the connection]
Dann1 has joined #ruby
Solnse has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
benlieb has joined #ruby
arietis has joined #ruby
rdark has quit [Quit: leaving]
tatsuya_o has quit [Remote host closed the connection]
hukl has joined #ruby
* pskosinski <3 sinatra
jonathanwallace has quit [Ping timeout: 256 seconds]
<Hanmac> the singer or the ruby gem?
ThaDick has joined #ruby
geekbri_ has joined #ruby
<banister`sleep> Hanmac: i hear that you hang round german jazz clubs eying up all the boys and sipping cocacola
sn0wb1rd has joined #ruby
geekbri_ has quit [Remote host closed the connection]
kpshek has joined #ruby
bluenemo has quit [Remote host closed the connection]
geekbri_ has joined #ruby
hackerdude has joined #ruby
geekbri has quit [Read error: Connection reset by peer]
<f0ster> is there someway I can check an object type in irb/pry ?
a_a_g has quit [Read error: Connection reset by peer]
<banister`sleep> f0ster: obj.class
s1n4 has quit [Ping timeout: 276 seconds]
<f0ster> ty banister`sleep
<csmrfx> ri Object.class
a_a_g has joined #ruby
maxmanders has joined #ruby
<banister`sleep> csmrfx: stop suggesting 'ri' it's a primitive tool elipsed by the shining light that is pry
<banister`sleep> :D jk
<banister`sleep> eclipsed*
emocakes has quit [Quit: emocakes]
<csmrfx> banister`sleep: yaa
<csmrfx> yaa
<csmrfx> I dont hav install pry
<banister`sleep> csmrfx: install now or i have you arrested by the secret police
* csmrfx only uses debian so only gems hav use is copypasted into /usr/lib
pu22l3r has joined #ruby
<csmrfx> "What you mean missing mkmf!!?!"
<csmrfx> banister`sleep: it saves me from having to test half-aced gems from weirdos online
karasawa has quit [Ping timeout: 252 seconds]
<csmrfx> f0ster: there is also .is_a? kind_of?
<f0ster> csmrfx: okay
<whitequark> headius: how did you implement __id__ within JVM?
wmoxam_ is now known as wmoxam
<banister`sleep> whitequark: i didnt know you hung out here, recently joined?
wmoxam has quit [Changing host]
wmoxam has joined #ruby
judesamp has joined #ruby
kpshek has quit []
<Hanmac> shevy2 i need you, i found an SEGFAULT in nokogiri
<whitequark> banister`sleep: yeah
judesamp has left #ruby [#ruby]
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
emocakes has joined #ruby
ryanjh has quit [Quit: Computer has gone to sleep.]
danneu has joined #ruby
rwilcox has joined #ruby
fred909 has joined #ruby
ossareh has joined #ruby
sailias has joined #ruby
DrCode has quit [Remote host closed the connection]
kdavh has quit [Remote host closed the connection]
arabi has joined #ruby
emocakes has quit [Client Quit]
<arabi> I am a newbie ... I have some doubts regarding modules .....
kdavh has joined #ruby
eregon has quit [Ping timeout: 248 seconds]
<arabi> 1. Why puts classes inside module .. as I know module is for method sharing
<arabi> 2. Why wanna put modules inside class
ryanjh has joined #ruby
<Hanmac> arabi 1&2 its like namespaces in C++
<arabi> please help
eregon has joined #ruby
<arabi> I don't know C++ :(
<whitequark> banister`sleep: oh I thought it was #jruby
nemesit has joined #ruby
<banister`sleep> haha
<arabi> Hanmac, can you give me some resource covering the topics with good examples
<banister`sleep> whitequark: meaning you dont actually want to be on #ruby or you just typed into the wrong window?
patronus1 has quit [Ping timeout: 256 seconds]
<whitequark> banister`sleep: wrong window
<whitequark> I've nothing against #ruby
shiroginne_ has quit [Quit: Connection closed for inactivity]
<arabi> whether I wanna learn namespace of C++ prior to learnig ruby ???
<Hanmac> arabi: like then you have two gems, "a" and "b", when both define Color classes you cant put them in a toplevel space because the methods would overwrite eachother ... thats why you define the classes as A::Color and B::Color
ebouchut has joined #ruby
<arabi> Hanmac, give me some time to think about your reply thanks :)
patronus_ has joined #ruby
kdavh_ has joined #ruby
kdavh has quit [Ping timeout: 256 seconds]
elico has joined #ruby
joeycarmello has joined #ruby
ebouchut has quit [Client Quit]
karasawa has joined #ruby
<arabi> Hanmac, thanks ... i got something from you lemme read PickAxe again and come back later .. have a nice time
arabi has quit [Quit: Leaving]
kdavh_ has quit [Remote host closed the connection]
mame1 has joined #ruby
megha has joined #ruby
mame0 has quit [Ping timeout: 248 seconds]
cantonic has joined #ruby
katzekintosh has joined #ruby
FroMaster2 has joined #ruby
jds_ has joined #ruby
<Eiam> Hanmac: I have a bunch of classes that belong to a top level project, putting them in a module keeps it organized. The module has 4 classes in it that are all related to the module topic, but do different things
<Eiam> Hanmac: wrong person =)
<Eiam> ^ arabi
niceume has joined #ruby
<Eiam> oh he left
FroMaster has quit [Ping timeout: 265 seconds]
Axsuul has quit [Ping timeout: 265 seconds]
_nitti has quit [Remote host closed the connection]
niceume has quit [Client Quit]
strtok has joined #ruby
cantonic has quit [Ping timeout: 248 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
jds_ has quit [Ping timeout: 244 seconds]
JohnBat26 has joined #ruby
voodoofish430 has joined #ruby
DrCode has joined #ruby
akl_ has joined #ruby
<Hanmac> i need an Nokogiri user, is someone there?
samphippen has joined #ruby
main has joined #ruby
<danneu> Hanmac: depends on the question
<Hanmac> danneu try to read from an XML file while $DEBUG is true
blueOxigen has quit [Ping timeout: 248 seconds]
jrist is now known as jrist-afk
samphippen has quit [Client Quit]
ingy has joined #ruby
llaskin1 has joined #ruby
ingy has left #ruby [#ruby]
mercwithamouth has quit [Ping timeout: 256 seconds]
Spami has quit [Quit: This computer has gone to sleep]
llaskin has quit [Ping timeout: 240 seconds]
jerius has quit [Ping timeout: 240 seconds]
<Hanmac> danneu did something happen?
Neomex has joined #ruby
bluOxigen has joined #ruby
jduan1981 has joined #ruby
<ericwood> so what's the nokogiri question?
patronus_ has quit [Ping timeout: 240 seconds]
LouisGB has quit [Read error: Connection reset by peer]
nicobrevin1 has joined #ruby
jerius has joined #ruby
nathancahill has joined #ruby
<shevy2> Hanmac eh I dont do XML
shevy2 is now known as shevy
<danneu> Hanmac: no, what is supposed to happen?
<Hanmac> ericwood: $DEBUG = true; Nokogiri::XML(File.read("pathtoanxmlfile"))
graft has quit [Ping timeout: 265 seconds]
<shevy> it's like smoking. some things should better be quit
<ericwood> Hanmac: that looks correct
<ericwood> what's not working?
<Hanmac> ericwood, try it, its hard to describe
wreckimnaked has quit [Ping timeout: 252 seconds]
<danneu> Nothing unusual happens for me
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
<Hanmac> huch ... it crashs for me
<ericwood> >> require 'nokogiri'
<eval-in> ericwood: Output: "" (http://eval.in/6290)
<ericwood> >> require 'nokogiri'; $DEBUG = true
<eval-in> ericwood: Output: "" (http://eval.in/6291)
<ericwood> ;p
ThaDick has quit [Quit: zzzZZZ ...]
<ericwood> array index out of bounds?
<ericwood> granted, this was in a rails app since I had that open
patronus_ has joined #ruby
Russell^^ has joined #ruby
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
kirun has joined #ruby
Russell^^ has quit [Client Quit]
Coolhand|laptop has joined #ruby
francisfish has quit [Remote host closed the connection]
<Hanmac> ericwood you cant use nokogiri with eval-in ...
Coolhand|laptop has quit [Remote host closed the connection]
<ericwood> I know, I was joking :P
<ericwood> it'd be stupid if you could :D
<ericwood> how does it handle infinite loops?
noxoc has joined #ruby
Amnesia has joined #ruby
<Amnesia> question
<Amnesia> sprintf("%8s", 'blablablablablablabla1'), why does that return the entire string, instead of the first 8 chars?
jduan1981_ has joined #ruby
<ericwood> you'd be better off with "asdfasdfasdfsad".first(8)
<Amnesia> sprintf should still work right?
<ericwood> I guess
<ericwood> >> sprintf("%8s", '123457890')
<eval-in> ericwood: Output: "" (http://eval.in/6297)
<ericwood> >> puts sprintf("%8s", '123457890')
<eval-in> ericwood: Output: "123457890\n" (http://eval.in/6298)
<Amnesia> the reason I'm using sprintf, is because sometimes the given string is smaller as 8 chars
<Hanmac> you need: "%.8s"
<ericwood> >> puts "1234".first(8)
<eval-in> ericwood: Output: "/tmp/execpad-0aa58877d3f4/source-0aa58877d3f4:1:in `<main>': undefined method `first' for \"1234\":String (NoMethodError)\n" (http://eval.in/6299)
<ericwood> oh...
<Amnesia> Hanmac: thx
<Hanmac> >> puts sprintf("%.8s", '123457890')
<eval-in> Hanmac: Output: "12345789\n" (http://eval.in/6300)
jduan1981 has quit [Ping timeout: 264 seconds]
<Amnesia> what does the dot stand for?
piotr__ has quit [Ping timeout: 260 seconds]
jduan1981_ is now known as jduan1981
gridaphobe has joined #ruby
tobiasvl has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
Russell^^ has joined #ruby
<ericwood> I guess sprintf is the cleanest solution for this
a_a_g has joined #ruby
Russell^^ has quit [Client Quit]
clooth has quit [Read error: Connection reset by peer]
<tobiasvl> Find.find(path) do |file| p file end # this should be recursive, right? it's not here, any clue why?
<Dann1> I can't Regexp to save my life.
Amnesia has left #ruby [#ruby]
clooth has joined #ruby
kenneth has joined #ruby
<kenneth> hey, have kind of a silly problem
<ericwood> tobiasvl: does File have a find method? I don't see it in the docs
<Spooner> Dann1, Good job your life doesn't depend on regexps then :(
<kenneth> i'm writing a piece of rack middleware. rack represents its responses as [status, hash_of_headers, body]
mrsolo has joined #ruby
<tobiasvl> ericwood: not File, but Find does: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/find/rdoc/Find.html
<Dann1> But my hobbies do D:
elux has quit [Quit: Bye!]
<Dann1> Halp?
<kenneth> hash_of_headers is a ruby hash of headers. i'm trying to set two cookies in a response, which requires two Set-Cookie headers
<kenneth> hashes can only contain a key once… seems like something somebody will have had a problem with before. what to do?
elaptics is now known as elaptics`away
jtharris has joined #ruby
_nitti_ has joined #ruby
nemesit has quit [Ping timeout: 246 seconds]
<Dann1> I'm trying to (don't laugh) create a regexp for swears and their possible manipulated versions (e.g. sh*t -> sh****t)
Solnse has quit []
<tobiasvl> Dann1: what's sh****t? "sheeeet"? clay davis style
<Spooner> So you don't want "sheet" or "sheep tent"
<Dann1> Yeah, that sort of sh*t
<Dann1> I want the former, but not the latter
<eka> Dann1: there are stop words lists and bad words lists… you can use that… search google
<Dann1> Will it work in other search engine 8)
fermion has quit [Quit: P]
<Dann1> j/k
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
Coolhand|laptop has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
tatsuya_o has joined #ruby
maxmanders has quit []
<Spooner> kenneth, As a complete and wild guess try, { "Set-Cookie" => ["first", "second"] }
sn0wb1rd has joined #ruby
timmow has quit [Quit: is having a nap]
Russell^^ has joined #ruby
tmi_ has joined #ruby
piotr_ has joined #ruby
chriskk has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
maxmanders has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Russell^^ has quit [Client Quit]
kirun has quit [Ping timeout: 245 seconds]
DrCode has quit [Remote host closed the connection]
_nitti_ has quit [Ping timeout: 256 seconds]
maxmanders has quit [Client Quit]
staafl_alt has joined #ruby
osaut has quit [Quit: osaut]
staafl has quit [Ping timeout: 240 seconds]
maxmanders has joined #ruby
Russell^^ has joined #ruby
buibex has quit [Remote host closed the connection]
reset has joined #ruby
Russell^^ has quit [Client Quit]
rippa has quit [Ping timeout: 240 seconds]
Russell^^ has joined #ruby
Russell^^ has quit [Client Quit]
a_a_g has quit [Quit: Leaving.]
woolite64 has quit []
mmitchell has joined #ruby
woolite64 has joined #ruby
akl_ has quit [Read error: Connection timed out]
cantonic has joined #ruby
macmartine has joined #ruby
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
gpato has joined #ruby
cascalheira has quit [Quit: Leaving...]
Rym has joined #ruby
ebouchut has joined #ruby
zwevans has joined #ruby
ThaDick has joined #ruby
mvangala_ has joined #ruby
digifiv5e_ is now known as digifiv5e
digifiv5e has quit [Changing host]
digifiv5e has joined #ruby
daslicious has quit [Ping timeout: 246 seconds]
daslicious_ is now known as daslicious
kirun has joined #ruby
noxoc has quit [Ping timeout: 256 seconds]
mvangala has quit [Ping timeout: 245 seconds]
staafl_alt has quit [Ping timeout: 255 seconds]
noxoc has joined #ruby
ngoldman_ has quit [Remote host closed the connection]
<Dann1> http://i.imgur.com/drrz8.png Why isn't it goddamnit
jds_ has joined #ruby
pkrnj has joined #ruby
<oz> :)
<Spooner> Dann1, You've made us all look at swears! I'm telling on you!
DrShoggoth has joined #ruby
<ThaDick> Trying to google this to no avail, was wondering if there is a tool/script that will convert all files in a ruby app to pdf? I know this is a horrible scenario, but the boss gets what the boss wants.
<ThaDick> Sorry convert should be parse to pdf
krawchyk_ has quit [Remote host closed the connection]
whit537 has joined #ruby
<ThaDick> parse -> output to pdf
<ThaDick> :)
nwertman has joined #ruby
<Spooner> There are plenty of pdf gems, ThaDick
<whit537> Hey all, how do I install https://github.com/ddollar/foreman from source?
<Dann1> o.o
<whit537> Neither of the recommended install options give me the -e feature, afaict.
<Dann1> is it a gem?
timonv has joined #ruby
nathancahill has quit [Read error: Connection reset by peer]
<whit537> Yes, but ...
<Dann1> Oh
<whit537> `gem install foreman` gives me 0.60.2, which doesn't have -e afaict.
<ThaDick> Yeah, I know there are plenty of pdf gems, but I was looking for something more specific … Something that would automate the process of identifying all files within the the application, then converting them to pdf … I guess I can just roll my own
<Spooner> whit537, gem build foreman.gemspec && gem install foreman.gemspec
nathancahill has joined #ruby
<whit537> Thanks Spooner, trying that ...
<Spooner> Oops, last should be foreman-whatever.gem
Russell^^ has joined #ruby
dasmo has joined #ruby
sailias has quit [Quit: Leaving.]
<whit537> Uh-oh, looks like it wants to build 0.60.2.
<Spooner> whit537, Do you know you can use github source directly in a Gemfile?
<whit537> I've heard rumors. :)
jds_ has quit [Ping timeout: 248 seconds]
<Spooner> whit537, https://github.com/ddollar/foreman/blob/master/lib/foreman/version.rb - that is what it is...you can't magic up a new version :D
Russell^^ has quit [Client Quit]
<Dann1> Spooner, about what I just linked, any idea why it won't detect newlines?
<whit537> Well, I had assumed `gem install foreman` was installing an older version, for whatever reason.
<whit537> Alright, hmm ...
<Spooner> whit537, What makes you believe in a -e ?
<whit537> The man page.
<whit537> And an ack of the source.
* whit537 finding it again in source ...
zwevans has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Umren has quit [Read error: Connection reset by peer]
danieldocki has quit [Quit: Linkinus - http://linkinus.com]
<whit537> Hmmm ...
<Spooner> Dann1, Notepad++?
Rym has quit [Quit: Rym]
<Dann1> YES
<Dann1> NOT SUBLIME TEXT
<Dann1> :3
<whit537> Huzzah!
<whit537> Spooner: It is an option to the start subcommand, not foreman itself.
<Spooner> I moved to sublime recently, I must admit, mainly because I'm using Linux more and don't want a pure Windows thingie.
<whit537> $ foreman start -e foo.env
<whit537> Like that.
<Spooner> whit537, Aaaaah. Fair enough.
<whit537> Okay, thanks for the help. :)
<karl____> i'm doing nokogiri SAX parsing...can someone "read" out what this is doing: @state[:os] ||= {}
<Spooner> karl____, @state[:os] = {} if @state[:os].nil? (could be clearer, perhaps)
<Dann1> I'll be out for a bit now. Thanks for the minor help ^^
Dann1 has quit [Quit: Dann1]
<Spooner> Sorry, I remember having exactly the same problem in Notepad++ actually.
<Spooner> Don't remember if I resolved it :D
<xeviox> I have this code: http://pastebin.com/CmmAdwtY but when I run it with "./myapp -a /path/to/a/file" I always get "Missing parameter: One or more packages". Any idea what I'm doing wrong?
<timonv> karl____: @state[:os] || state[:os] = {}
Xeago has quit [Remote host closed the connection]
<timonv> It's slightly different ;-)
<karl____> Spooner; timonv THANK YOU!
<timonv> xeviox: is there a shebang there?
mneorr has joined #ruby
<Spooner> timonv, Not really. It would be written that way with: @state[:os] = state[:os] || {}
whit537 has left #ruby [#ruby]
<fuzai> Is there any kind of module for ruby that i could give a function a zip code and it will return a weather summary for the zip code in a string?
<timonv> which is different spooner
cantonic has quit [Quit: cantonic]
<timonv> Yours reassigns ;-)
Dann1 has joined #ruby
<timonv> xeviox: Also missing a require
Dann1 has quit [Client Quit]
<Spooner> Oh yeah, I wasn't reading yours right. It is just horrid though and not consistent with the other op= (it works for ||, but not anything else).
Rym has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
kzar has joined #ruby
tvw has quit [Remote host closed the connection]
havenn has joined #ruby
DrCode has joined #ruby
Nisstyre has quit [Ping timeout: 260 seconds]
toekutr has joined #ruby
_nitti has joined #ruby
krawchyk has joined #ruby
ThaDick has left #ruby [#ruby]
cascalheira has joined #ruby
maletor has joined #ruby
jjbohn has quit [Quit: Leaving...]
h4mz1d has joined #ruby
freakazoid0223 has joined #ruby
Coolhand|laptop_ has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
Coolhand|laptop has quit [Ping timeout: 265 seconds]
workmad3 has joined #ruby
sailias has joined #ruby
samphippen has joined #ruby
<xeviox> timonv: yes both, I just posted relevant part of the code ..
apeiros_ has joined #ruby
<xeviox> timonv: it must have something to do with the OptionParser
DrCode has quit [Remote host closed the connection]
thillux_ has joined #ruby
buibex has joined #ruby
Nisstyre has joined #ruby
Guest25886 has quit [Ping timeout: 260 seconds]
jrist-afk is now known as jrist
reset has quit [Quit: Leaving...]
thillux has quit [Ping timeout: 255 seconds]
Russell^^ has joined #ruby
NullByte is now known as Bulgaria
Rym has quit [Quit: Rym]
jeffreybaird has quit [Quit: jeffreybaird]
Russell^^ has quit [Client Quit]
jeffreybaird has joined #ruby
Russell^^ has joined #ruby
benlieb has quit [Quit: benlieb]
samuel02 has quit [Remote host closed the connection]
benlieb has joined #ruby
eldariof has quit []
Guest25886 has joined #ruby
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
timonv has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
answer_42 has quit [Remote host closed the connection]
cdt has joined #ruby
benlieb has quit [Ping timeout: 248 seconds]
fteem has joined #ruby
kirun has quit [Ping timeout: 240 seconds]
Dann1 has joined #ruby
h4mz1d has quit [Ping timeout: 256 seconds]
nomenkun has quit [Remote host closed the connection]
fermion has joined #ruby
wermel has quit [Remote host closed the connection]
fermion has quit [Client Quit]
Rym has joined #ruby
fermion has joined #ruby
Nisstyre-laptop has joined #ruby
nemesit has joined #ruby
tenmilestereo has quit [Quit: Leaving]
SpNg has left #ruby [#ruby]
<shevy> good short read
IrishGringo has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
<shevy> "You never understand a problem as good as in the moment you solve it."
pkrnj has quit [Quit: Computer has gone to sleep.]
greg- has quit [Quit: greg-]
<fuzai> if message.content =~ /command['trigger']/ Whats the correct way to put a variable between the //?
dr_neek has quit [Quit: dr_neek]
ryannielson has joined #ruby
mneorr_ has joined #ruby
<apeiros_> fuzai: #{}
<fuzai> oh ok
<ryannielson> Anyone have any recommendations for a markdown to html parser? Preferrably written in pure ruby and supporting some of the Github markdown features.
<apeiros_> ryannielson: maruku, not sure about pure ruby
<ericwood> redcarpet is what github uses, iirc
<apeiros_> mhm, I think redcarpet is good
<shevy> is funny though because "Multiple ways of doing the same thing only leads to confusion. It has no benefit."... if all you have a hammer, everything will look like a nail
icco has joined #ruby
<ericwood> I've used it before, it's teh awesomesauce
timonv has joined #ruby
<ryannielson> Ya, ideally looking for something without any dependencies on c libraries to ease installation and stuff. But if it's that good I may be able to budge.
mneorr has quit [Ping timeout: 256 seconds]
<ericwood> you'll be fine
DrCode has joined #ruby
_46bit has joined #ruby
digitalsanctum has quit [Remote host closed the connection]
<ryannielson> ericwood: Alrighty, I'll give it a shot. Thanks for the suggestions everyone.
<ericwood> anytime, have a good day
cardoni has joined #ruby
digitalsanctum has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<shevy> sex
karl_____ has joined #ruby
Guest25886 has quit [Quit: Guest25886]
<karl_____> is [string1,string2,string3].exists?(do something) legit?
blaxter has quit [Quit: foo]
karl____ has quit [Ping timeout: 245 seconds]
<karl_____> looks like no
<heftig> karl_____: what do you want to do?
ebouchut has quit [Quit: This computer has gone to sleep]
<karl_____> i want to fill an array with strings, and ask if a variable is equal to any elements of the array
<karl_____> if foo = ["a","b","c"] do something
<shevy> karl_____ hmm could try .any?
<heftig> .include?
<Hanmac> karl______ use .include? if you want check against == or use .any? if you need more generic
<shevy> ["abc","def","ghi"].any? {|e| e == 'def'} # => true
Nisstyre-laptop has quit [Remote host closed the connection]
jjbohn has joined #ruby
<shevy> karl_____ hey dont forget, = is assignment, == equality. in your example it looks strange :P
mackintosh has joined #ruby
<karl_____> shevy: sorry about that, i frequently screw up that
mackintosh is now known as rramsden
<shevy> yeah many do, in the blog entry I linked earlier, the guy reasons that = should mean equality as well
<karl_____> i'm not willing to support that argument
<shevy> I can understand that
<karl_____> just bad about typing examples without syntax highlighting
<shevy> though I am not sure how assignment should work then
<shevy> the language Io uses := for assignment and = for "update slot"
<shevy> I hate that :\
<shevy> but I like the idea behind Io
<Hanmac> any? has friends ... like all? , none? and one?
nyuszika7h has quit [Remote host closed the connection]
<Dann1> Hey guys
ryannielson has left #ruby [#ruby]
Russell^^ has quit [Quit: Russell^^]
nyuszika7h has joined #ruby
reset has joined #ruby
timonv has quit [Remote host closed the connection]
cdt has quit [Ping timeout: 256 seconds]
Russell^^ has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
<graft> anyone ever muck around with the sequel gem or such-like?
<Dann1> Is there a way to get batch commands executed whilst in IRB?
_46bit has left #ruby [#ruby]
<shevy> Hanmac did you use method(:name) before?
<graft> i'm trying to figure out a fast way to pull stuff from a mysql database into a ruby array
<Dann1> >> print("help\n" * 3)
<eval-in> Dann1: Output: "help\nhelp\nhelp\n" (http://eval.in/6304)
<shevy> I never used sequel
jjbohn has quit [Quit: Leaving...]
jeffreybaird has quit [Ping timeout: 248 seconds]
<shevy> Dann1 what is a "batch command"
<Dann1> Windowns bacth
<Dann1> batch*
<graft> it's simple and light, but it doesn't seem to be very fast... the rails 'pluck' command is much faster
<shevy> Dann1, this resides in a file?
<Dann1> The semi-retarded DOS programmind language
philcrissman has joined #ruby
<Dann1> Google it for god's sake :)
stim371 has joined #ruby
pkrnj has joined #ruby
<graft> you want to run dos commands in irb?
<Dann1> Yes, like color and title.
<Dann1> Mostly only those two.
<banister`sleep> donyou can run 'dos' commands in pry by prepending a '.' to your command
<banister`sleep> Dann1: i.e .dir
<havenn> Dann1: Use Pry and prefix your batch with a dot, or can't you just shell out with backticks like?: `dir`
jrist is now known as jrist-brb
geekbri_ has quit [Remote host closed the connection]
<havenn> Do system(), ``, exec and friends work with Windows? I've never tried?
<havenn> Dann1: What banister said though, cause Pry is awesome!
theRoUS has quit [Ping timeout: 240 seconds]
<Dann1> Ah
<Dann1> Pry it'll be :D
<Dann1> Oh mai glob
<Dann1> I can automate missing gem installs with this thing
ngoldman has joined #ruby
nemesit has quit [Remote host closed the connection]
<Dann1> 8D
LouisGB has joined #ruby
<Dann1> Also got win32console to get colours showing up
<Dann1> Pretty pretty DOS
sepp2k1 has joined #ruby
<grzywacz> Dann1, automate missing gem installs? sounds like you're going to backup a nice portion of the interwebs soon ;)
<Eiam> I have some performance problems with a ruby script I'm working on. Is there a good resource i can use to dig into whats causing my performance issues ?
Nisstyre has quit [Ping timeout: 240 seconds]
[Neurotic] has joined #ruby
fermion has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Dann1> ... now that I think of it
<Dann1> Darn
sepp2k has quit [Ping timeout: 260 seconds]
<Dann1> That would be hard
<Eiam> oh my I just realized, I think ruby is re-reading in a 7 meg file every time this method is called instead of.. keeping it cached in memory. =0
<Dann1> And pretty bad for my hard drive.
Rym has quit [Quit: Rym]
krawchyk has quit [Remote host closed the connection]
Russell^^ has quit [Ping timeout: 260 seconds]
jonathanwallace has joined #ruby
LouisGB has quit [Ping timeout: 276 seconds]
<apeiros_> Eiam: ruby does nothing you don't tell it to.
<apeiros_> it's a programming language, not an AI.
<Eiam> fuck i bet thats my biggest perf hit right there
<Eiam> hmm guess ill just load it once & pass it around
<Hanmac> shevy yes i do
<grzywacz> The file would normally be cached by the OS anyway.
<grzywacz> But you still have to parse it.
<swarley> does ruby have static variables? Like perl's `state' or whatever
thatguycraig has quit [Quit: Leaving.]
<Eiam> apeiros_: I always assume someone much smarter than me did something smart further down the stack
<swarley> Not if you're using File.read
<apeiros_> Eiam: assuming stuff in programming is a rather bad habbit.
cina has joined #ruby
<grzywacz> Eiam, but that wouldn't be smart. What if the file changed? Should you get the cached or the new version?
jonathanwallace has quit [Client Quit]
<swarley> not unless you need to detect a change lol.
<apeiros_> grzywacz: I guess that's the "much smarter" part - it'd magically know…
<swarley> and then you can lstat it to get change time
<Eiam> grzywacz: sure but thats also solvable, just checksum the file
<apeiros_> Eiam: yeah, and that costs no performance either…
<swarley> the lstat would probably be easier lol.
<Eiam> you can say "oh look I was asked to load a file I already just loaded, and it hasn't changed so, lets not do that work again"
<grzywacz> Reading the whole file to checksum it would surely be faster than reading the file every time.
<swarley> Because you can see the last time it was touched
<grzywacz> swarley, not guaranteed to be updated, eg on NFS.
<Dann1> http://puu.sh/1LIRY Hell yes
<apeiros_> checksums are fallible too
<swarley> uh, that's fundamentally stupid.
<Dann1> Thanks guys :D
<grzywacz> swarley, that's a fundamental optimization
<apeiros_> they only guarantee no false positives, but don't guarantee no false negatives.
samphippen has quit [Quit: Computer has gone to sleep.]
<swarley> File.atime(file)
<cina> Hi, the documentation says Time.wday returns 0..6 for weekdays. Is there any convinient constant/variable for accessing these numbers by name?
<grzywacz> Anyhow, it should be smarter/dumber than it is at this level.
<grzywacz> *shouldn't
<grzywacz> duh
<Eiam> okay so, lets take this case then. Clearly I'm reloading a file wAY more often that I need to be. Is there a set of performance tools that would have highlighted this particular stupid mistake?
<swarley> No
<apeiros_> Eiam: ruby-prof
<grzywacz> swarley, it's normal to mount filesystems with noatime, even local ones.
<Eiam> apeiros_: I've got that open right now
<swarley> That seems like an invitation to break things
h4mz1d has joined #ruby
<swarley> what about ctime?
<apeiros_> swarley: even if, point is that atime is not guaranteed
reset has quit [Quit: Leaving...]
<havenn> Eiam: Might want to look at ruby-prof (https://github.com/rdp/ruby-prof) or perftools (https://github.com/tmm1/perftools.rb) for performance profiling.
<apeiros_> so any generic caching system using it is brittle
<swarley> ≪ swarley ≫ what about ctime?
hotovson has quit [Remote host closed the connection]
jjbohn has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
clooth has quit [Quit: clooth]
Kuifje has quit [Ping timeout: 248 seconds]
jeffreybaird has joined #ruby
jonathanwallace has joined #ruby
CaptainKnots has quit [Quit: bazinga!]
<Hanmac> swarley ctime is the creation time, atime is the access time
rezzack has joined #ruby
<swarley> oh, I thought ctime was the actual change time
CaptainKnots has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
<Dann1> Woah
<Dann1> I actually thought you all meant 'crime'
<Dann1> Had me sitting here like 'what the hell is this'
<Eiam> okay code modified. once it fails again ill start it up & see how it does with the changes, then ruby-prof & see what else it shows if its still slow
<Hanmac> Dann1 yeah it its two :P
Nisstyre has joined #ruby
otters has quit [Ping timeout: 252 seconds]
matip has joined #ruby
Rym has joined #ruby
h4mz1d has quit [Ping timeout: 256 seconds]
zph has quit [Quit: Computer has gone to sleep.]
Coolhand|laptop_ has quit [Remote host closed the connection]
<Dann1> :3
johnmilton has joined #ruby
buibex has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 255 seconds]
<Dann1> Yessss
<Dann1> Bottesque
<Dann1> She worksss
<Dann1> Wait
carloslopes has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Dann1> Why won't she connect to the extra channel
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
elico has quit [Read error: No route to host]
asteve has quit [Quit: Computer has gone to sleep.]
wroathe has quit [Ping timeout: 248 seconds]
<fuzai> http://rubyweather.rubyforge.org/ from the howto, the function require_gem isn't defined so says ruby. Could anyone explaint o me what i have to do to make this work?
medik has joined #ruby
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
lolcathost has joined #ruby
zph has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
<Muz> fuzai: that example looks like it's from 2006. require_gem isn't needed anymore with recent versions of Ruby or Rubygems. You should be able to just 'require "gemnamehere"' in 1.9.X
<Muz> I wouldn't be surprised if that library is broken in otherways though given the age.
<fuzai> ok i'll just use the yahoo api instead
<fuzai> it looks newer
<apeiros_> require_gem is very old
<apeiros_> it has been removed back in 1.8.x, I think 1.8.4 or something
zph has quit [Client Quit]
solidresolve has quit [Remote host closed the connection]
<apeiros_> people used it wrongly… it was basically `gem *; require *` in one method
<apeiros_> and since you shouldn't have to use the `gem *` method…
* Muz recalls what's waiting for him at work tomorrow. That bastard 6 year old Rails app.
solidresolve has joined #ruby
xeviox has left #ruby ["Leaving"]
Zolrath has quit [Ping timeout: 260 seconds]
nemesit has joined #ruby
<Eiam> Muz: could be worse, could be some bastardized sproutcore + rails app mixed with jquery
andrewhl has joined #ruby
mark_locklear has quit [Remote host closed the connection]
zph has joined #ruby
<Muz> I don't think you full appreciate how overengineered and needlessly Enterprise this rails app is.
<Muz> *fully
<Eiam> I dunno, I work in "Enterprise"
<Eiam> although I wish my rails app were overengineered =)
<Eiam> it suffers from an extreme lack of…. engineering =)
Zolrath has joined #ruby
<shevy> Muz!
<shevy> you always do proper sentences on IRC
<Eiam> but it sure can solve problems ha ha
<shevy> you are my hero :)
<Muz> shevy: are you doing FOSDEM this year?
<shevy> I only do beer sessions
c3vin has quit [Ping timeout: 240 seconds]
<Eiam> shevy: well, generally its poor form to end a sentence in the word "is" so… there is that ;P
v0n has quit [Ping timeout: 256 seconds]
reset has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
marr has joined #ruby
<shevy> I mean the '.' Eiam
<shevy> :)
<Eiam> oh, psh
<shevy> Eiam you now on the other hand are a born IRC person... you hate the .
<Eiam> shevy: well I've been on IRC since the early 90s so… yeah
<llaskin1> has the functionality of "next" changed in 1.9.3 from 1.8.7
<aedorn> I have a sudden urge to make a "who has the best grammar on IRC" app.
<shevy> to idle to power makes people lazy
banister`sleep has quit [Read error: Connection reset by peer]
<shevy> yay aedorn
<Eiam> aedorn: how would you handle oxford commas, and other sometimes argued or accepted in some circles not accepted in otherisms of english?
<shevy> Eiam yeah, almost the same here, though more like the late 90s for me, with mIRC, I just find it interesting that some people use .
banister`sleep has joined #ruby
<shevy> like aedorn does too, I just realize
GoGoGarrett has joined #ruby
rondale_sc has joined #ruby
<shevy> what the kitten is an oxford comma
<shevy> is that an extra long comma?
beiter has quit [Quit: beiter]
<canton7> one, two, and three
<canton7> that last comma is from oxford
GoGoGarr_ has quit [Ping timeout: 256 seconds]
<shevy> aha
<fuzai> Wow 4 weather modules and none of them work :(
<shevy> never knew something like that even exists... I dont think anything like that exists in german
<shevy> fuzai fate of natural code decay :)
<Eiam> shevy: this is why the idea of someone writing an app to parse English (assumed, given its what we 'speak' here) amused me, given its many many rules, several of which are heavily argued both ways =)
jrist-brb is now known as jrist
<shevy> yeah Eiam
<shevy> I hate that colour does not work in CSS, only color does :(
twoism has joined #ruby
<canton7> yeah, all programming spellings are american
<canton7> urgh, but simplifies things
<shevy> a lot, yeah
<shevy> music notes have different words in the USA, as opposed to the UK
<shevy> and the US version is much, much simpler and more logical
<canton7> I'm always torn as to whether to give my function names english or american spellings :P
<canton7> US note name are also much longer!
jasond has joined #ruby
<aedorn> Eiam: Vote scale.
<shevy> I was taught british english so I still use that, but for consistency I would prefer if everyone would stick to the same
<Mon_Ouie> Also if you're writing an application that deals with french fries and chips… It's going to be pita :D
<canton7> (especially with things like initialize/initialise)
<shevy> la baguette
<shevy> yeah canton7
<shevy> damn
<shevy> I thought initialize is the UK variant :<
<canton7> nup
<canton7> interestingly, aluminum is the original, and aluminium is the bastardisation though :P
<shevy> hmm odd... in german, it is "aluminium"
<shevy> this is sometimes the problem with US english
jds_ has joined #ruby
<shevy> it seems so simplified that it can become incorrect
<banister`sleep> canton7: where did u learn that? (re aluminium)
<banister`sleep> canton7: got a link?
<canton7> banister`sleep, can't remember I'm afraid. The name was changed to aluminium to sound more in line with the other elements, iirc
<shevy> sorry I was wrong
<shevy> 1808, Sir Humphry Davy, called it "Aluminum", so it seems this one ought to be the correct variant
jjbohn has quit [Quit: Leaving...]
<fuzai> Could someone point me in the right direction, i'm trying to scrape data from a website that has the data I want hiding in a <p class=""> tag that has a unique class name
<canton7> ah, one article claims he started with aluminium, then went to aluminum, then back
<canton7> fuzai, nokogiri
<banister`sleep> canton7: Sir Humphry made a bit of a mess of naming this new element, at first spelling it alumium (this was in 1807) then changing it to aluminum, and finally settling on aluminium in 1812
<aedorn> All words are a bastardization, though. There's no longer who is right or wrong, but what is accepted and not.
<havenn> fuzai: +1 nokogiri
<canton7> banister`sleep, that's the one
samphippen has joined #ruby
_46bit has joined #ruby
<banister`sleep> canton7: alumium != aluminum ;)
daniel_- has quit [Ping timeout: 248 seconds]
<canton7> yeah, I misread oops
cina has quit [Ping timeout: 246 seconds]
<shevy> canton7 I've become a sucker for simplicity, less ambiguity, clear terms...
<canton7> aedorn, bastardisation was too strong a word
miphe has joined #ruby
<aedorn> canton7: I don't think. It's been used to describe American English for a century already. I think we're okay with it!
v0n has joined #ruby
cina has joined #ruby
<canton7> this one's from new scientist: languages primarily spoken as a second language tend to be simpler, as adults prefer stricter grammar rules and more logical languages. however, languages which are primarily spoken as a first language, and so are learnt in childhood, tend to have more obscure rules and irregularities, as it reduces ambiguity, which is what children prefer
sailias has quit [Quit: Leaving.]
Spami has quit [Quit: This computer has gone to sleep]
_46bit has quit [Read error: Connection reset by peer]
<heftig> hm. ambiguity? what about constructed languages like lojban?
jjbohn has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<shevy> naaah
mmokrysz has joined #ruby
<canton7> in the same vein, language from warmer counties, whose speakers would tend to use it outside, tend to be less efficient, but have more redundancy, giving better noise immunity. languages from colder places, whose speakers would use the language more indoors, tend to be more efficient
<shevy> dead languages must not count!
DrShoggoth has quit [Quit: Leaving]
<shevy> ruby is almost like simplified english, where you can communicate with a computer
rondale_sc has quit [Quit: rondale_sc]
pu22l3r has quit [Remote host closed the connection]
PragCypher has quit [Quit: Leaving]
kpshek has joined #ruby
<Dann1> > Python
<shevy> canton7, the part -> "as it reduces ambiguity, which is what children prefer" actually, I prefer less ambiguity too. but I also like being able to use different words (if they have a unique meaning)... the english languages has many more words than german, sometimes expressions "fit" much better when one can talk/think in english rather than in german
<shevy> Dann1 but you must indent in python
<shevy> it is more of a grammar nazi than ruby
<Dann1> u.u
<swarley> I'd argue that python is less readable than ruby
<shevy> it is like shouting "Yes Sir!" properly in python
<swarley> I like python and all
<Dann1> I have such a strong urge to go watch monty python
<shevy> swarley could be. except for "end". I don't think "end" gives a really needed readable advantage at all, in properly formatted, short code
<swarley> but, it's not as close to natural language as ruby
<swarley> shevy; it's needed unless ruby was to enforce indenture
<shevy> def spank_swarley(gimme_that_swarley_dude)
<shevy> gimme_that_swarley_dude.start_the_spanking
<shevy> see? ^^^ is better without the end!
pskosinski has joined #ruby
<shevy> yeah swarley ... but still
<shevy> I dont want to end the spanking *ever*
<swarley> lol.
<Eiam> apeiros_: indeed the read in was causing as expected massive slow down. thanks for the confirmation/clarification
clooth has joined #ruby
<Dann1> Good night everyone.
Hanmac has joined #ruby
<Dann1> __all__.bid_farewell
Dann1 has quit [Quit: Dann1]
<Eiam> swarley: I would disagree with that =) haha
<aedorn> Bounding elements always make text easier to read in the long run. So having 'end' is a benefit until you have multiples of it in a cluster.
Rym has quit [Quit: Rym]
artOfWar has joined #ruby
<shevy> oh god
<shevy> I hate __foo__ naming schemes
lolcathost has quit [Ping timeout: 252 seconds]
<artOfWar> I have a hash like {"object_id"=>"10151327573129919"}
<shevy> though I like to use _ as variable name
<canton7> oh, an actual question!
<shevy> YAY
elico has joined #ruby
<shevy> will it continue!
<artOfWar> now when I try to access object_id I'm getting the actual object_id
<Eiam> everyone quiet, lets see who can answer first..
<artOfWar> ....
<shevy> Eiam lol
<canton7> artOfWar, myHash['object_id']
<shevy> ok, he is getting to it slowly
<canton7> not myHash.object_id
<artOfWar> thanks canton7
<shevy> !!!
<artOfWar> thanks @canton7
<shevy> it was that simple!
<canton7> I win :)
<shevy> I thought he wanted to obtain some object from ObjectSpace
zph has quit [Quit: Computer has gone to sleep.]
_nitti_ has joined #ruby
<aedorn> I give that a 2 on the entertainment scale. I shall now go fold socks.
<shevy> objects with id 5, 163, 64977 - please step forward. object mating session will start in ten minutes
zph has joined #ruby
freakazoid0223 has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
malkomalko has joined #ruby
TheFuzzball has quit [Quit: Computer has gone to sleep.]
Pip has quit [Quit: Leaving]
stevechiagozie has joined #ruby
<Hanmac> shevy what are you planing to do with this fixnums?
zz_chrismcg is now known as chrismcg
fourq has joined #ruby
maxmanders has quit [Ping timeout: 265 seconds]
<shevy> Hanmac hmm no I'd like to fetch those objects... or perhaps have them always available, and restore them ... in a gameserver with many different objects
<shevy> ObjectSpace._id2ref
horofox has joined #ruby
<shevy> ewww... has a _ as part of its name...
joeycarmello has quit [Remote host closed the connection]
<Hanmac> yeah i know, i checked them
adkron has quit [Ping timeout: 276 seconds]
_nitti has quit [Ping timeout: 276 seconds]
<shevy> Hanmac is it possible to store all objects from a project, to disc, then load them up on game-startup again (in ruby)?
maxmanders has joined #ruby
zph has quit [Client Quit]
<shevy> *disk
<Hanmac> Marshal?
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
rwilcox has quit []
emmanuelux has joined #ruby
slainer68 has joined #ruby
<shevy> hmm
<shevy> will try
<Hanmac> hm no the rank is not high enough .. i think you need a Colonel :D
grzywacz has quit [Ping timeout: 256 seconds]
<Hanmac> shevy: information: there are objects that cant be marshalled ... you should keep that in mind
<shevy> :<
<Eiam> =0 I've been using marshal and appreciate its simplicity
Slivka has joined #ruby
<Eiam> but I need to do streaming now (appending to the file repeatedly) and yeah, marshal...
<Eiam> no workie for that
<Hanmac> all instances of IO,Binding,Proc, Hash with default_proc, and each normal object with has singleton methods
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
tommyvyo has quit [Remote host closed the connection]
<Hanmac> objects wich can be dumped while having singleton methods: true, false, nil, and each instance of Module or Class (but the singleton methods are not stored)
<pskosinski> http://www.ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Digest.html Why there is no method hexdigest in docs?
Goles has joined #ruby
maletor has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
jblack has joined #ruby
<aedorn> #hexdigest is part of Digest, not OpenSSL
maxmanders has quit [Ping timeout: 255 seconds]
griffindy has quit [Quit: Computer has gone to sleep.]
<pskosinski> Well… looks like is part of openssl too, for me works…
chrismcg is now known as zz_chrismcg
d2dchat has quit [Remote host closed the connection]
Xeago has joined #ruby
_nitti_ has quit [Remote host closed the connection]
haulbert has joined #ruby
jjbohn has quit [Quit: Leaving...]
gpato has quit [Ping timeout: 246 seconds]
<Hanmac> shevy is that a problem?
headius has quit [Quit: headius]
_46bit has left #ruby [#ruby]
<shevy> hmmm I am not sure yet
<shevy> one thing on my todo list is to build a MUD from scratch
_nitti has joined #ruby
<shevy> I started 5 years ago, then gave up after writing like 500 files, so much work...
banister`sleep has quit [Remote host closed the connection]
judesamp has joined #ruby
Neomex has quit [Quit: Neomex]
maxmanders has joined #ruby
jromine has joined #ruby
mmitchell has quit [Remote host closed the connection]
ry4nn has quit [Remote host closed the connection]
llaskin1 has left #ruby [#ruby]
Hanmac has quit [Ping timeout: 245 seconds]
banister`sleep has joined #ruby
<swarley> MUD?
haulbert has quit [Ping timeout: 246 seconds]
gyre008 has joined #ruby
gpato has joined #ruby
Guest73173 has quit [Ping timeout: 256 seconds]
kjellski has joined #ruby
jblack has quit [Ping timeout: 255 seconds]
ebobby has joined #ruby
willob has quit [Quit: Leaving.]
zph has joined #ruby
graft_ has joined #ruby
graft_ has quit [Changing host]
graft_ has joined #ruby
lolcathost has joined #ruby
julian-delphiki has joined #ruby
julian-delphiki is now known as bean
havenn has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
shtirlic has joined #ruby
bean has quit [Client Quit]
julian-delphiki has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
timonv has joined #ruby
chussenot has joined #ruby
chussenot has quit [Client Quit]
judesamp has left #ruby [#ruby]
cina has quit [Ping timeout: 256 seconds]
Goles has quit [Quit: Out.]
jerius has quit []
cina has joined #ruby
phantasm66 has quit [Quit: *sleeeep….]
havenn has quit [Ping timeout: 264 seconds]
brianpWins has quit [Quit: brianpWins]
emocakes has joined #ruby
nwertman has quit [Read error: Connection reset by peer]
_nitti has quit [Remote host closed the connection]
gpato has quit [Ping timeout: 244 seconds]
<fuzai> Could someone explain to me how to scape a div from an html file with a specific class name? I'm trying the examples here: http://ruby.bastardsbook.com/chapters/html-parsing/ but i'm not getting it
nwertman has joined #ruby
bean has joined #ruby
stkowski has joined #ruby
<ryanf> fuzai: did you try page.css(".class-name") ?
<fuzai> yea but the classname has a space in it
<fuzai> i'll try it again
timonv has quit [Ping timeout: 260 seconds]
miphe has quit [Remote host closed the connection]
TomRone has quit [Ping timeout: 260 seconds]
<Xeago> fuzai: a classname cannot have a space in it, it is a delimiter
<fuzai> oh ok
<Xeago> assuming it is html, right?
cina_ has joined #ruby
<fuzai> yea
<fuzai> i think i got it
<fuzai> but i have a ton of extra white space
cina has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
<fuzai> how would i use gsub to remove whitespaces longer then 2 characters?
<fuzai> i tried " asd ".gsub(/\w\w\w/, "") but no luck
io_syl has quit [Ping timeout: 248 seconds]
inokenty has quit [Remote host closed the connection]
thone_ has joined #ruby
<apeiros_> fuzai: \w is not whitespace, \s is
thone has quit [Read error: Operation timed out]
<apeiros_> and \s{2,} is 2 or more
<fuzai> yea i just read that :)
<fuzai> ah ok i was going to try \s\s
<fuzai> \s\s+
pcarrier has joined #ruby
<apeiros_> that'd be equivalent
<fuzai> Cool
<fuzai> :)
joshman_ has quit [Ping timeout: 240 seconds]
nicobrevin1 has quit [Ping timeout: 260 seconds]
io_syl has joined #ruby
IceDragon has joined #ruby
horofox has quit [Quit: horofox]
joshman_ has joined #ruby
<Xeago> actually \s{2,} compiles more efficiently in most implementations
GoGoGarrett has quit [Remote host closed the connection]
digitalsanctum has quit [Remote host closed the connection]
TomRone has joined #ruby
philcrissman has quit [Remote host closed the connection]
digitalsanctum has joined #ruby
horofox has joined #ruby
alanp_ has joined #ruby
<apeiros_> hu? why's that? I'd expect both compile to the same
nari has joined #ruby
havenn has joined #ruby
<apeiros_> (of course, that's a naive expectation)
cibs has quit [Ping timeout: 245 seconds]
joshman_ has quit [Quit: Computer has gone to sleep.]
ryanneufeld has joined #ruby
jonathanwallace has quit [Ping timeout: 252 seconds]
blacktulip has quit [Remote host closed the connection]
digitalsanctum has quit [Ping timeout: 248 seconds]
syamajala has joined #ruby
alanp has quit [Ping timeout: 276 seconds]
_46bit has joined #ruby
Glacer232 has joined #ruby
stopbit has quit [Quit: Leaving]
<Xeago> \s\s+ turns into atleast 2 checks, while \s{2,
pcarrier has quit []
<Xeago> turns into 1 check that eats consecutive characters
<Xeago> it doesn't remember/count/think about length
alanp_ is now known as alanp
pcarrier has joined #ruby
<apeiros_> hm
_46bit has left #ruby [#ruby]
Spami has quit [Quit: This computer has gone to sleep]
bean has quit [Quit: Textual IRC Client: www.textualapp.com]
syamajala has quit [Remote host closed the connection]
obryan has quit [Ping timeout: 255 seconds]
cibs has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
atmosx has quit [Remote host closed the connection]
zph has quit [Quit: Computer has gone to sleep.]
peregrine81 has joined #ruby
syamajala has joined #ruby
<Xeago> what does % usually represent in shells?
<Xeago> $ for user, # for root, % for?
jtharris has quit [Quit: WeeChat 0.3.9.2]
gabrielrotbart has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
benlieb has joined #ruby
benlieb has quit [Client Quit]
fir_ed has joined #ruby
nemesit has quit [Quit: Leaving...]
jjang has joined #ruby
kpshek has quit []
<oz> Xeago: zsh uses '%' like bash uses '$'
Xeago has quit [Remote host closed the connection]
syamajala has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby
syamajala has joined #ruby
hukl has quit [Quit: Linkinus - http://linkinus.com]
mneorr_ has quit [Remote host closed the connection]
Beoran_ has joined #ruby
thillux_ has quit [Remote host closed the connection]
kjellski has quit [Quit: This computer has gone to sleep]
alex__c2022 has quit [Quit: alex__c2022]
otters has joined #ruby
segv- has quit [Quit: segv-]
jjbohn has joined #ruby
Beoran__ has quit [Ping timeout: 264 seconds]
shtirlic has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
GoGoGarrett has joined #ruby
Astralum has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9.2]
clooth has quit [Quit: clooth]
MrTroll has joined #ruby
jjbohn has quit [Ping timeout: 256 seconds]
<MrTroll> sup peeps
pkrnj has joined #ruby
clooth has joined #ruby
jgarvey has quit [Quit: Leaving]
jlast has quit [Remote host closed the connection]
ryanjh has quit [Quit: Computer has gone to sleep.]
<MrTroll> what is ruby
* MrTroll is getting impatient
MrTroll has left #ruby [#ruby]
<fuzai> Ruby is a gem
atmosx has joined #ruby
dmiller1 has joined #ruby
serhart has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
<speakingcode> is there a method (probably owuld be part of enumerable i'm guessing) that takes two enumberables, a and b, and returns an enumerable that has all the elements which are in A but not in B..
<apeiros_> Array#-
<apeiros_> beware, set operation, means it will uniq the array
<speakingcode> err, is that a minus sign?
<apeiros_> yes
<speakingcode> k. that's fine. working on sets here so no dups anyway
<speakingcode> thankee
<apeiros_> Array#- is read "instance method `-` of class Array"
<apeiros_> # = instance method
<apeiros_> :: = class method
<speakingcode> k
dmiller has quit [Ping timeout: 265 seconds]
<apeiros_> (e.g. Time::now vs. Time#strftime)
joeycarmello has joined #ruby
<speakingcode> can i wrtie that as... array1 - arrayb
<apeiros_> yes
mmitchell has joined #ruby
niklasb has joined #ruby
yonahw has joined #ruby
<speakingcode> just out of curiosity, is there a version of that which doesn't uniq?
<aedorn> So I have to log procedures - as in, when a route is added we have to send a log message, or when it gets removed - another log message. Currently we just keep log messages within the methods. I'm thinking of using delegation to call the methods, and write the log lines by matching the method to a corresponding file with some text substitution. Is there a better means to do this than my plan?
wroathe has joined #ruby
fteem has quit [Ping timeout: 256 seconds]
Glacer232 has quit [Quit: Textual IRC Client: www.textualapp.com]
cina_ has quit [Ping timeout: 256 seconds]
mmitchell has quit [Ping timeout: 256 seconds]
xclite has quit [Remote host closed the connection]
friskd has joined #ruby
cascalheira has quit [Quit: Linkinus - http://linkinus.com]
solidoodlesuppor has quit [Remote host closed the connection]
_nitti has joined #ruby
slash_nick has joined #ruby
lolcathost has quit [Ping timeout: 256 seconds]
<slash_nick> how can I enforce a timeout using "loop do; end;"?
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
stim371 has quit [Quit: stim371]
<clooth> *sighs*
ryanf has quit [Ping timeout: 248 seconds]
poli has joined #ruby
<slash_nick> clooth: sounds like you need a break
<clooth> I really do, but no chance.
<clooth> My message wasn't directed at you btw ;)
ner0x has quit [Quit: Leaving]
<apeiros_> slash_nick: why do you insist on the wrong tool?
<apeiros_> until time_is_out …end
<apeiros_> oh, you're a crossposter. nvm.
<slash_nick> i'm confused already...k
<aedorn> doesn't loop do; end until .... work? Or was that begin; end until ...
<havenn> slash_nick: Put your loop inside a Timeout: Timeout.timeout(time_in_seconds_here) do; loop do end end
<havenn> I guess that is a bad use of exceptions.
<apeiros_> Timeout.timeout considered harmful
syamajala has quit [Remote host closed the connection]
<havenn> apeiros_: kk, yeah thought that seemed bad >.>
<slash_nick> I read that... it's just being used in a test scenario
<slash_nick> capybara is being an a-hole
cina has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
Takehiro has joined #ruby
<JohnTeddy> Is there a way to specify what index places in an array I want. So if I have an array = [1, 2, 3]; how can I just print 0 and 2, without doing array[0] + array[2]?
peregrine81 has quit [Quit: Goodbye.]
kiyoura has joined #ruby
<JohnTeddy> Can I put it all in the same argument, so array[0,2] or something?
allsystemsarego has quit [Quit: Leaving]
chriskk has quit [Ping timeout: 244 seconds]
<apeiros_> JohnTeddy: Array#values_at
sepp2k1 has quit [Remote host closed the connection]
fyolnish has quit [Remote host closed the connection]
<aedorn> array[x,y] does work also, at least in 1.9.
nari has quit [Ping timeout: 256 seconds]
<apeiros_> aedorn: no
jjbohn has joined #ruby
<aedorn> apeiros_: no?
<apeiros_> Array#[] only works for slices, but he wants discrete indices.
gyre008 has quit [Remote host closed the connection]
<apeiros_> Array#[] with 2 args is offset, length. the docs are pretty clear on that IMO.