apeiros_ changed the topic of #ruby to: Ruby 2.1.2; 2.0.0-p481; 1.9.3-p545: http://ruby-lang.org || Paste >3 lines of text on http://gist.github.com || this channel is logged at http://irclog.whitequark.org, other public logging is prohibited
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
kireevco has quit [Quit: Leaving.]
<Authenticator> When calling Open3.capture3(cmd) where cmd is ['p4','fstat',file1, file2], I get a SystemStackError when cmd.length > ~100_000... When I rescue the error and check caller it's never got anything in it, unlike when I rescue def x ; x ; end and caller is ~9500 entries long. What's going on?
kireevco has joined #ruby
banjara1 has joined #ruby
kireevco has quit [Remote host closed the connection]
<shevy> sleepee \o/
kireevco has joined #ruby
kireevco has quit [Client Quit]
<^conner> alex2, everything in Ruby is an object... even classes... so you may not really want to look at everything but try this in irb bjectSpace.each_object.each {|x| p x }
postmodern has quit [Quit: Leaving]
kireevco has joined #ruby
<sleepee> thanks shevy. its exactly what i was looking for. its got links to the rdocs, which is perfect.
<shevy> hehe
<^conner> alex2, or ObjectSpace.each_object.each {|x| p x.class }
pwh has joined #ruby
banjara has quit [Ping timeout: 252 seconds]
<alex2> ^conner: Nice
toastynerd has quit [Ping timeout: 252 seconds]
<alex2> ^conner: there is no map :(
<^conner> alex2, do you mean a perl style map? There is Hash#map
<alex2> ObjectSpace.collect { |object| object.class }.uniq
frem_ has joined #ruby
yubrew has joined #ruby
irvingprime has joined #ruby
<^conner> alex2, your missing a method call there
banjara1 has quit [Ping timeout: 252 seconds]
<alex2> ObjectSpace.collect { |object| object.class }.uniq.methods.flatten
Arkaniad has joined #ruby
<alex2> ^conner: which
<^conner> ObjectSpace.each_object returns an interator
<sleepee> just gem installed pry. so far i'm liking the pretty colors.
<^conner> your trying to call the #collect method on a class name
dodosan has joined #ruby
<^conner> I doubt that class implements the #collect method
gigetoo has joined #ruby
<^conner> alex2, your probably looking for ObjectSpace.each_object.collect { |object| object.class }.uniq
d34th4ck3r has joined #ruby
ddv has quit [Ping timeout: 245 seconds]
<^conner> alex2, make sense?
<shevy> sleepee colours can be enabled in irb too; gem install wirble; also have a look at awesome_print though I dont like that it has so many colours haha
djbkd has quit [Remote host closed the connection]
x1337807x has quit [Ping timeout: 240 seconds]
brandonjmckay has joined #ruby
redondos has quit [Excess Flood]
armyriad has quit [Ping timeout: 260 seconds]
maestrojed has quit [Quit: Computer has gone to sleep.]
yubrew has quit [Ping timeout: 240 seconds]
redondos has joined #ruby
armyriad has joined #ruby
<sleepee> good call. just looked at wirble's rdoc. tab-completion and save history can come in handy.
<sleepee> i'm gem installing like crazy today
<alex2> ^conner: many many thanks
<alex2> ObjectSpace.each_object.collect { |object| object.class }.uniq.map { |_class| _class.methods }.flatten.uniq.join ' '
<alex2> :)
endash has quit [Quit: endash]
GriffinHeart has joined #ruby
x1337807x has joined #ruby
zorak has quit [Ping timeout: 265 seconds]
brandonjmckay has quit [Client Quit]
jhulten has quit [Remote host closed the connection]
ddv has joined #ruby
pwh has quit []
danman has quit [Quit: danman]
happytux has quit [Quit: ChatZilla 0.9.90.1-rdmsoft [XULRunner 22.0/20130619132145]]
hgl has joined #ruby
djbkd has joined #ruby
djbkd has quit [Remote host closed the connection]
GriffinHeart has quit [Ping timeout: 245 seconds]
armyriad has quit [Ping timeout: 264 seconds]
x1337807x has quit [Client Quit]
djbkd has joined #ruby
armyriad has joined #ruby
IceDragon has quit [Ping timeout: 255 seconds]
IcyDragon has joined #ruby
jhulten has joined #ruby
stantona_ has joined #ruby
<iLeoable> Guys... I just built ruby from source
<alex2> ^conner: i doubt, but is there a way to for keywords ?
<iLeoable> ruby-1.9.3-p547
<^conner> alex2, I don't understand the question
<iLeoable> When I run any ruby command it says Segmentation fault
WilfredTheGreat has joined #ruby
gregf has joined #ruby
amargherio has joined #ruby
<timgauthier> shevy, learning German has me constantly capitalizing my Nouns.
stantona has quit [Ping timeout: 264 seconds]
testcore has quit [Quit: BitchX: shaken, not stirred]
marr has quit [Ping timeout: 252 seconds]
<shevy> timgauthier haha
<iLeoable> GUYS I need serious help!!
<timgauthier> like, even in English
<shevy> timgauthier english is so much simpler than german
<timgauthier> iLeoable segfault error, reinstall windows
<timgauthier> shevy i agree, but i still have to pass a german test so eh...
<iLeoable> I'm using Linux, and I can't I am using a shared server
stantona_ has quit [Ping timeout: 260 seconds]
j_mcnally has quit [Ping timeout: 240 seconds]
<shevy> timgauthier do you know this german word: Donaudampfschifffahrtsgesellschaft -> http://de.wikipedia.org/wiki/Donaudampfschifffahrtsgesellschaft?title=Donaudampfschifffahrtsgesellschaft&redirect=no - it was when austria was still an empire in central europe, they even had a fleet (lol) steam-engine powered ships!
<alex2> ^conner: collect keywords, true|false, global variables $stdin, ARGV, etc.
_djbkd has joined #ruby
<timgauthier> haha i've heard of that shevy
<iLeoable> I'm just going to use rvm
<baweaver> Anyone have luck getting pry-remote_em to work on a non-local ip?
<^conner> alex2, I'm still not following... sorry
<iLeoable> screw this...
<shevy> iLeoable there can be many reasons for a segfault
<alex2> ^conner: :(
<toretore> schifffahrt tsk tsk
<timgauthier> shevy i'm reinventing the wheel
<iLeoable> I've installed it not that long ago though. I uninstalled it and now it doesn't work
<toretore> schiffahrt
<iLeoable> Dreamhost comes with ruby 1.8 by default
zorak has joined #ruby
saarinen has quit [Quit: saarinen]
<shevy> timgauthier yeah
<shevy> iLeoable that is painful, we are all past 2.x now
<timgauthier> shevy i am building the RSVP form for my wedding and i was going to use a service, but i'm not super happy with it. so i'm building it in html myself
<alex2> ^conner: i have to sleep
<alex2> Have a good night
<shevy> damn
<shevy> wedding
<alex2> ^^
NukePuppy has joined #ruby
<timgauthier> yea bro
<^conner> alex2, goodnight
armyriad has quit [Ping timeout: 255 seconds]
<alex2> :-)
<shevy> it'll change you!
alex2 has quit [Quit: WeeChat 0.4.3]
armyriad has joined #ruby
<iLeoable> I know right! All of the docs are outdated from Dreamhost
djbkd has quit [Ping timeout: 245 seconds]
luksaur has quit [Quit: home]
bmurt has joined #ruby
_djbkd has quit [Ping timeout: 264 seconds]
doodlehaus has joined #ruby
b00stfr3ak has quit [Ping timeout: 260 seconds]
<shevy> timgauthier are you into rails?
Megtastique has joined #ruby
<timgauthier> not overly, i did a project (front end) in it once
dhaivat has quit [Quit: dhaivat]
acalewin has joined #ruby
<timgauthier> why shevy ?
zz_karupa is now known as karupa
dhaivat has joined #ruby
<shevy> timgauthier dunno
<shevy> it's still on my todo list to change my local cgi stuff into rails
djbkd has joined #ruby
<timgauthier> sweet
endash has joined #ruby
diegoviola has joined #ruby
moritzschaefer has quit [Ping timeout: 276 seconds]
zorak has quit [Ping timeout: 240 seconds]
xanandu has quit [Ping timeout: 240 seconds]
lw has quit [Quit: s]
nanoyak has quit [Quit: Computer has gone to sleep.]
armyriad has quit [Ping timeout: 240 seconds]
SilverKey has joined #ruby
armyriad has joined #ruby
fgo has joined #ruby
gattuso has quit [Ping timeout: 260 seconds]
armyriad has quit [Remote host closed the connection]
alexju has joined #ruby
endash has quit [Client Quit]
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gattuso has joined #ruby
<RubyPanther> rails sucks, I recommend cgic
reset has quit [Ping timeout: 252 seconds]
<timgauthier> write it in apple swift
djbkd has quit [Remote host closed the connection]
Newman_ has joined #ruby
<Newman_> Is there no longer a #rubyonrails channel?
<wallerdev> there is
<wallerdev> its named #rubyonrails
brandonjmckay has joined #ruby
brandonjmckay has quit [Read error: Connection reset by peer]
<Newman_> it says 0 users for me?
<wallerdev> you need to identify to nickserv to join
fgo has quit [Ping timeout: 240 seconds]
x1337807x has joined #ruby
alexju has quit [Remote host closed the connection]
razrunelord has joined #ruby
tyfighter has quit [Quit: tyfighter]
<Newman_> Ah ha! Thanks wallerdev, got it now :)
eka has joined #ruby
frogssgy is now known as frogsy
lemur has joined #ruby
x1337807x has quit [Read error: Connection reset by peer]
^conner has quit [Quit: Leaving]
x1337807x has joined #ruby
Gil has joined #ruby
dik_dak has joined #ruby
thepreacher has joined #ruby
Shidash has quit [Ping timeout: 240 seconds]
Zenigor has joined #ruby
doodlehaus has quit [Remote host closed the connection]
doodlehaus has joined #ruby
Zenigor has quit [Remote host closed the connection]
dhaivat has quit [Quit: dhaivat]
dhaivat has joined #ruby
jhulten has quit [Remote host closed the connection]
oo_ has joined #ruby
lemur has quit [Ping timeout: 252 seconds]
SilverKey has quit [Quit: Halted.]
charliesome has joined #ruby
razrunelord has quit [Remote host closed the connection]
Gil has quit [Ping timeout: 260 seconds]
razrunelord has joined #ruby
lethe has joined #ruby
shiggity_ has quit [Quit: shiggity_]
doodlehaus has quit [Ping timeout: 240 seconds]
moritzschaefer has joined #ruby
alexju has joined #ruby
zorak has joined #ruby
zkay11 has joined #ruby
pzula has joined #ruby
xanandu has joined #ruby
ner0x has joined #ruby
d34th4ck3r has quit [Quit: zzz]
mr_snowf1ake has joined #ruby
razrunelord has quit [Ping timeout: 245 seconds]
snath has quit [Ping timeout: 252 seconds]
doodlehaus has joined #ruby
superscott[8] has quit []
nfk has quit [Quit: yawn]
aspires has quit []
benlieb has joined #ruby
yubrew has joined #ruby
clickclack has joined #ruby
Shidash has joined #ruby
seanewest has left #ruby [#ruby]
anaeem1 has joined #ruby
mercwithamouth has joined #ruby
<Newman_> Can I ask a rails question in here? Didn't receive a reply in the #ror channel
banjara has joined #ruby
dhaivat has quit [Quit: dhaivat]
thepreacher has quit [Quit: Leaving]
terrell_t has joined #ruby
sleepee has quit [Quit: Leaving]
yubrew has quit [Ping timeout: 252 seconds]
anaeem1 has quit [Ping timeout: 264 seconds]
dhaivat has joined #ruby
doodlehaus has quit [Remote host closed the connection]
Lucky__ has joined #ruby
banjara has quit [Ping timeout: 240 seconds]
terrellt has quit [Ping timeout: 240 seconds]
doodlehaus has joined #ruby
Lucky__ has quit [Client Quit]
<shevy> Newman_ you can try but most people here won't know rails
pasties has joined #ruby
arrubin has joined #ruby
<Newman_> Oh ok
terrell_t has quit [Ping timeout: 255 seconds]
<shevy> so rails-specific questions here will probably go unanswered, you may have more luck with ruby-centric questions
<Newman_> I've been trying to google my answer but not exactly sure what I should be searching for. Basically I have two scaffolds: players & messages. Players has a bunch of info (name, position, etc) - what is the best practice for being able to access this stuff in the messages view?
<Newman_> Totally understand :)
nowthatsamatt has quit [Quit: nowthatsamatt]
amclain has joined #ruby
lyanchih has joined #ruby
doodlehaus has quit [Ping timeout: 255 seconds]
snath has joined #ruby
Arkaniad has quit [Ping timeout: 240 seconds]
lw has joined #ruby
jonno11 has quit [Quit: Textual IRC Client: www.textualapp.com]
kaspergrubbe has quit [Remote host closed the connection]
Lucky__ has joined #ruby
ehc has quit [Quit: ehc]
lyanchih_ has joined #ruby
dhaivat has quit [Quit: dhaivat]
meatherly has joined #ruby
lyanchih has quit [Ping timeout: 240 seconds]
lyanchih_ is now known as lyanchih
<frem_> Newman_: what is the relationship between player and messages?
<Newman_> messages belongs_to players and players has_many
lethjakman has quit [Ping timeout: 252 seconds]
mjsmith2 has joined #ruby
<Newman_> I've tried calling something like this inside views/messages/index - > message.player.playerID
<Newman_> but I get undefined method 'playerID'
<frem_> I usually just put @player in the controller, to be explicit about what the view will be accessing.
rkazak has joined #ruby
<frem_> Newman_: is playerID an attribute you added? the default would be more like message.player.id
<Newman_> In the message_controller I put @players = Player.all
baroquebobcat has joined #ruby
carlyle has quit [Remote host closed the connection]
<rkazak> gooday!
<Newman_> I added it, it's a string in the schema
<Newman_> I should say, it's in the table under players & its classified as a string
dhaivat has joined #ruby
lw has quit [Quit: s]
papercode has quit [Quit: WeeChat 0.4.3]
d34th4ck3r has joined #ruby
<frem_> So a message belongs to a single player?
<Newman_> correct
<Newman_> and a player has_many messages
endash has joined #ruby
dodosan has quit []
Hanmac1 has joined #ruby
<Newman_> Basically I can't seem to find a way to access a variety of params/vars from one view in another view
sski has joined #ruby
tkuchiki has joined #ruby
djbkd has joined #ruby
robustus has quit [Ping timeout: 264 seconds]
doodlehaus has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
mjsmith2 has quit [Remote host closed the connection]
mjsmith2 has joined #ruby
rm_ has quit [Remote host closed the connection]
robustus has joined #ruby
rm_ has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
Vivekananda has joined #ruby
doodlehaus has quit [Ping timeout: 240 seconds]
Hobogrammer_ has quit [Ping timeout: 240 seconds]
gregf has quit [Quit: WeeChat 0.4.3]
chrisseaton has quit [Ping timeout: 252 seconds]
endash has quit [Quit: endash]
qwyeth has joined #ruby
rm_ has quit [Ping timeout: 252 seconds]
goleldar has quit [Remote host closed the connection]
predator217 has quit [Ping timeout: 255 seconds]
momomomomo has quit [Quit: momomomomo]
predator117 has joined #ruby
radic has quit [Ping timeout: 240 seconds]
carlyle has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
radic has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
moritzschaefer has quit [Ping timeout: 276 seconds]
dhaivat has quit [Quit: dhaivat]
MatthewsFace has joined #ruby
carlyle has joined #ruby
dhaivat has joined #ruby
fgo has joined #ruby
jeregrine_ has quit [Quit: Connection closed for inactivity]
carlyle has quit [Read error: Connection reset by peer]
meatherly has quit [Remote host closed the connection]
<wallerdev> have you guys seen swift?
<wallerdev> looks like it has blocks kinda like ruby
phoo1234567 has quit [Quit: Leaving]
<benzrf> it looks like it's trying to be scala but more conservative
sepp2k has quit [Read error: Connection reset by peer]
<benzrf> from the brief flashes of it i've seen
<benzrf> :I
<benzrf> it looks to have a few half-implemented versions of some of haskell's nice features
dhaivat has quit [Client Quit]
<benzrf> i am sure people will go nuts for them now that theyre not Scary FP(tm)
<wallerdev> idk it looks pretty cool to me
NinoScript has joined #ruby
<wallerdev> and you can use it instead of obj-c which has been showing its age
fgo has quit [Ping timeout: 255 seconds]
<benzrf> tru dar
<benzrf> *dat
<benzrf> i mean
<benzrf> it does have sum types
<benzrf> and that's gr8
Megtastique has quit []
<wallerdev> yeah ill definitely check out the book on it
<wallerdev> maybe write my next mac app in it
Shidash has quit [Ping timeout: 265 seconds]
<wallerdev> anyway just exciting to see a new language introduced that may actually have real adoptoin
carlyle has joined #ruby
<shevy> is that an elitist language
<shevy> like, it runs only on apple
djbkd has quit [Remote host closed the connection]
<wallerdev> uhh
timonv has joined #ruby
balazs has joined #ruby
<wallerdev> it probably realistically only runs on apple devices
<wallerdev> since i think its the same as obj-c
Shidash has joined #ruby
krz has joined #ruby
<wallerdev> but iim not sure i havent read too much about it yet
newUser1234 has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
Takle has quit [Remote host closed the connection]
newUser1234 has quit [Read error: Connection reset by peer]
WilfredTheGreat has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
newUser1234 has joined #ruby
frem_ has quit [Ping timeout: 252 seconds]
newUser1234 has quit [Read error: Connection reset by peer]
Gil has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
mercwithamouth has quit [Ping timeout: 252 seconds]
carlyle has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
Hanmac has joined #ruby
newUser1234 has joined #ruby
chrisseaton has joined #ruby
Hobogrammer has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
carlyle has quit [Read error: Connection reset by peer]
timonv has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
<benzrf> swift could potentially be nice
Hanmac1 has quit [Ping timeout: 252 seconds]
newUser1234 has joined #ruby
<benzrf> but it looks like its gonna be proprietary
<benzrf> thx apple
newUser1234 has quit [Read error: Connection reset by peer]
Spami has quit [Quit: This computer has gone to sleep]
doodlehaus has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
<toretore> the real meat is yet to be revealed - the concurrency primitives
Gil has quit [Ping timeout: 252 seconds]
hamakn has quit [Remote host closed the connection]
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
diegovio1 has joined #ruby
diegovio1 is now known as diegovio1a
gorpon has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
doodlehaus has quit [Remote host closed the connection]
danman has joined #ruby
doodlehaus has joined #ruby
bmurt has quit []
<renier_> hey, so this is really weird. anyone as seen this? https://gist.github.com/renier/9d23ead9a36ba2939d18
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
<renier_> I require 'rubocop'. Then refer to Rubocop, and get a NameError
doodleha_ has joined #ruby
doodlehaus has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
<shevy> renier_ perhaps the author was an idiot
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
<renier_> shevy, perhaps it is a bug on that rubocop version 0.23.0, yes
<renier_> I'll check.
<shevy> module Rubocop
<shevy> the module has this name though
<shevy> so I guess the author was not an idiot
<shevy> that might leave the user as idiot though! :-)
newUser1_ has joined #ruby
Takle has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
<renier_> shevy, I'm fine with either possibility. I just want to figure out this odd thing
danman has quit [Ping timeout: 265 seconds]
<renier_> module changed name to RuboCop, camel case
<shevy> huh
carlyle has joined #ruby
SCommette has joined #ruby
iwat has joined #ruby
<shevy> how annoying
<renier_> yea
renier_ is now known as renier
doodleha_ has quit [Remote host closed the connection]
iwat has quit [Quit: iwat]
rm_ has joined #ruby
doodlehaus has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
lobstah has left #ruby ["And if your head explodes with dark forbodings too..."]
learner has joined #ruby
GriffinHeart has joined #ruby
wallerdev has quit [Quit: wallerdev]
Takle has quit [Remote host closed the connection]
diegovio1a has quit [Quit: WeeChat 0.4.3]
kireevco has quit [Read error: Connection reset by peer]
kireevco has joined #ruby
banjara has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
doodlehaus has quit [Ping timeout: 265 seconds]
hamakn has joined #ruby
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
newUser1234 has joined #ruby
irvingprime has quit [Quit: Leaving]
newUser1234 has quit [Read error: Connection reset by peer]
GriffinHeart has quit [Ping timeout: 276 seconds]
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
<rkazak> Hmm, that name clash is going to be confusing :)
newUser1234 has joined #ruby
aspires has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
newUser1_ has quit [Ping timeout: 252 seconds]
banjara has quit [Ping timeout: 252 seconds]
newUser1234 has joined #ruby
b00stfr3ak has joined #ruby
carlyle_ has joined #ruby
<rkazak> I meant the swift stuff, it also reminds me of BASIC…
deric_skibotn has quit [Ping timeout: 252 seconds]
carlyle has quit [Ping timeout: 255 seconds]
newUser1_ has joined #ruby
carlyle_ has quit [Read error: Connection reset by peer]
phracker has quit [Quit: Textual IRC Client: www.textualapp.com]
phracker has joined #ruby
pontiki has joined #ruby
toastynerd has joined #ruby
<agent_white> Reminds me of a _swift_ kick in the nuts
<agent_white> The feeling experienced when you realize how much you just paid for an Apple computer.
<shevy> lol
maestrojed has joined #ruby
<shevy> no agent_white they will get defensive about it
<shevy> "good quality has its price"
<shevy> noone admits to making a mistake
<pontiki> hi all
<shevy> pontiki!!!
newUser1234 has quit [Ping timeout: 240 seconds]
carlyle has joined #ruby
lmickh has quit [Remote host closed the connection]
qwyeth has quit [Ping timeout: 240 seconds]
<agent_white> "Nono it's not a _swift kick_, it's a iSwift kick to the nuts. "
maestrojed has quit [Client Quit]
<agent_white> pontiki: Heya! \o
<pontiki> o/ agent_white
carlyle has quit [Read error: Connection reset by peer]
<benzrf> hello rubyers
<agent_white> Heya benzrf
agent_white has quit [Quit: brb]
phinfonet has quit []
meatherly has joined #ruby
carlyle has joined #ruby
linguini has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
x1337807x has quit [Ping timeout: 252 seconds]
newUser1_ has quit [Read error: Connection reset by peer]
My_Hearing has joined #ruby
thepreacher has joined #ruby
meatherly has quit [Read error: Connection reset by peer]
meatherl_ has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
Mon_Ouie has quit [Ping timeout: 264 seconds]
agent_white has joined #ruby
wallerdev has joined #ruby
carlyle has joined #ruby
wallerdev has quit [Client Quit]
razrunelord has joined #ruby
mikesplain has joined #ruby
meatherl_ has quit [Ping timeout: 276 seconds]
kenneth has joined #ruby
carlyle_ has joined #ruby
b00stfr3ak has quit [Ping timeout: 240 seconds]
carlyle has quit [Ping timeout: 255 seconds]
wallerdev has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
carlyle_ has quit [Read error: Connection reset by peer]
aspires has quit []
danijoo has joined #ruby
SCommette has quit [Quit: SCommette]
carlyle has joined #ruby
danman has joined #ruby
razrunelord has quit [Ping timeout: 260 seconds]
SCommette has joined #ruby
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Cache_Money has joined #ruby
chipotle has quit [Quit: cya]
carlyle has quit [Read error: Connection reset by peer]
rezzack has quit [Quit: Leaving.]
danman has quit [Client Quit]
Kricir has quit [Remote host closed the connection]
radic has quit [Ping timeout: 252 seconds]
radic has joined #ruby
carlyle has joined #ruby
pzula has quit [Ping timeout: 252 seconds]
carlyle has quit [Read error: Connection reset by peer]
mikesplain has quit []
rm_ has quit [Remote host closed the connection]
duggiefresh has joined #ruby
benlieb has quit [Quit: benlieb]
rm_ has joined #ruby
Newman_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iLeoable has quit [Quit: Page closed]
newUser1234 has quit [Read error: Connection reset by peer]
aspires has joined #ruby
newUser1234 has joined #ruby
maximski has joined #ruby
subbyyy has quit [Ping timeout: 264 seconds]
thepreacher has quit [Quit: Leaving]
cpruitt has joined #ruby
fgo has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
rm_ has quit [Ping timeout: 252 seconds]
aspires has quit [Ping timeout: 240 seconds]
mikesplain has joined #ruby
mikesplain has quit [Client Quit]
newUser1234 has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
carlyle has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
dhaivat has joined #ruby
rm_ has joined #ruby
carlyle has joined #ruby
fgo has quit [Ping timeout: 240 seconds]
aspires has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
Gil has joined #ruby
djbkd has quit [Remote host closed the connection]
carlyle has joined #ruby
NukePuppy has quit [Ping timeout: 252 seconds]
yubrew has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
baroquebobcat has quit [Read error: No route to host]
carlyle has quit [Read error: Connection reset by peer]
dik_dak has quit [Quit: Leaving]
baroquebobcat has joined #ruby
carlyle has joined #ruby
Gil has quit [Ping timeout: 255 seconds]
djbkd has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
yubrew has quit [Ping timeout: 255 seconds]
djbkd has quit [Remote host closed the connection]
gbchaosmaster has joined #ruby
robman_ has quit [Quit: Connection closed for inactivity]
rkazak has quit [Quit: rkazak]
fgo has joined #ruby
datafirm has quit [Quit: Computer has gone to sleep.]
datafirm has joined #ruby
datafirm has quit [Client Quit]
datafirm has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
badhatter has quit [Ping timeout: 265 seconds]
tylersmith has joined #ruby
Kricir has joined #ruby
cpruitt has quit [Quit: cpruitt]
mikemac has joined #ruby
subbyyy has joined #ruby
datafirm has quit [Ping timeout: 260 seconds]
crazymykl has quit [Ping timeout: 252 seconds]
gigetoo has joined #ruby
maximski has quit []
carlyle_ has joined #ruby
carlyle_ has quit [Read error: Connection reset by peer]
Kricir_ has joined #ruby
Kricir has quit [Ping timeout: 240 seconds]
banjara has joined #ruby
dhaivat has quit [Quit: dhaivat]
axisys has quit [Changing host]
axisys has joined #ruby
carlyle has joined #ruby
aspiers_ has quit [Ping timeout: 260 seconds]
mikesplain has joined #ruby
braincrash has quit [Quit: bye bye]
carlyle has quit [Read error: Connection reset by peer]
lw has joined #ruby
Kricir_ has quit [Ping timeout: 255 seconds]
<shevy> dumdedum
<shevy> how can learning rails be fun
<timgauthier> it isn't
<timgauthier> neither is js or jquery :|
<timgauthier> i started a civil war when i asked how to do something fairly simple.
carlyle has joined #ruby
banjara has quit [Ping timeout: 265 seconds]
chrisseaton has quit []
<shevy> lol
tacos1de has quit [Ping timeout: 272 seconds]
<shevy> well
<shevy> js is another language
<shevy> rails is still ruby
<timgauthier> i was given some advice, the first of which is that javascript sucks :P
<shevy> I think I need to learn rails in short pulses, otherwise it would bore me too much
carlyle has quit [Read error: Connection reset by peer]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> javascript indeed sucks, unfortunately there is no alternative for browsers
braincrash has joined #ruby
Takle has joined #ruby
<timgauthier> haha
<timgauthier> learn apples new swift language in between
carlyle has joined #ruby
<pontiki> heh, jquery is still js; many wars on that :)
tacos1de has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
subbyyy has quit [Ping timeout: 255 seconds]
mary5030 has joined #ruby
Takle has quit [Ping timeout: 245 seconds]
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
thomasxie has joined #ruby
meatherly has joined #ruby
duggiefresh has quit []
stantona has joined #ruby
carlyle has joined #ruby
subbyyy has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
glenfe has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
jamto11 has quit [Remote host closed the connection]
meatherly has quit [Ping timeout: 245 seconds]
Cache_Money has joined #ruby
shiggity_ has joined #ruby
carlyle has joined #ruby
jackjackdrpr has quit [Ping timeout: 240 seconds]
clickclack has left #ruby [#ruby]
<shiggity_> whats a good solution for cases where I have a class variable becoming a shared state across class methods?
<shiggity_> Is changing it to a class instance variable any better?
benzrf is now known as benzrf|offline
stantona has quit [Ping timeout: 240 seconds]
MoistVonLipwig has joined #ruby
mikesplain has quit [Ping timeout: 240 seconds]
MoistVonLipwig has left #ruby [#ruby]
carlyle has quit [Read error: Connection reset by peer]
St_Marx has quit [Remote host closed the connection]
sptx00 has quit [Remote host closed the connection]
end_guy has quit [Write error: Broken pipe]
Boohbah has quit [Write error: Broken pipe]
tacos1de has quit [Write error: Broken pipe]
feature_creep has quit [Quit: feature_creep]
diegovio1 has joined #ruby
carlyle has joined #ruby
diegoviola has quit [Ping timeout: 260 seconds]
carlyle has quit [Read error: Connection reset by peer]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
<shevy> avoiding class variables is always good
<ari-_-e> shiggity_: huh?
<shiggity_> I have a class Thing, with a stack of stuff @stack
<shevy> shiggity_ if you can change them to instance variables anyway then you probably had no good reason to use class variables in the first place
carlyle has joined #ruby
<shiggity_> my methods in that class just pick up @stack and do stuff with it and leave it for the next thing to touch it
<shevy> that's an instance variable
<shiggity_> one @?
<ari-_-e> @stack would be an instance variable
<shiggity_> kk
<ari-_-e> yes
<shiggity_> so then its that
<shevy> class variable is @@
sambao21 has joined #ruby
Arkaniad has joined #ruby
<shiggity_> ah, so thats what I mean.
<shevy> >> class Foo; @@bar = 5; def foo; puts @@bar; end; end; Foo.new.foo
<eval-in_> shevy => 5 ... (https://eval.in/158044)
<shiggity_> Is @@stack preferable?
<shevy> as written above
<shevy> <shevy> avoiding class variables is always good
<ari-_-e> shiggity_: preferable for what?
carlyle has quit [Read error: Connection reset by peer]
rhys has joined #ruby
<shevy> hehe
timonv has joined #ruby
<shiggity_> Ah ok so it doesn’t expose that var up the chain?
<shiggity_> preferable for clean code, OO code
<ari-_-e> shiggity_: what chain?
<shiggity_> Looking at Shevy’s example
<ari-_-e> shiggity_: it depends on what you want to do...
<shiggity_> Yeah… I hear ya
<ari-_-e> still not sure what chain you mean
St_Marx has joined #ruby
aspires has quit []
<shevy> ari-_-e class variables leak into subclasses
shack4 has joined #ruby
<shevy> and why am I always getting nick uppercased :(
<shiggity_> i suck at using irc, its my fault :)
Boohbah has joined #ruby
<shack4> anyone here program ruby on a mac?
<shiggity_> <— this guy
tacos1de has joined #ruby
aspires has joined #ruby
oo_ has quit [Remote host closed the connection]
<shack4> is there anything besides sublime that you use, prefereably free?
carlyle has joined #ruby
timonv has quit [Ping timeout: 260 seconds]
<shiggity_> sublime is my preferred. textwrangler has its uses too.
<shack4> is that free?
<shiggity_> yeah
lw has quit [Quit: s]
banjara has joined #ruby
tectonic has quit []
<shevy> shack4 I still use bluefish 1.0.7
<shevy> it's hard to change
<gbchaosmaster> Vim anyone?
<shevy> when I was young
<shevy> and innocent
carlyle has quit [Ping timeout: 255 seconds]
<shevy> but it messed with my brain
<shevy> I felt like a robot
<shevy> :ggajkghGKEUHGO§5789151hjklg
<shevy> oops
<shevy> I accidentally cleared the xchat buffer for #ruby lol
mjsmith2 has quit [Remote host closed the connection]
shevy has left #ruby ["I'll be back ... maybe"]
yohanobs_ has joined #ruby
fgo has quit [Remote host closed the connection]
carlyle has joined #ruby
yohanobs__ has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
Gil has joined #ruby
yohanobs_ has quit [Ping timeout: 240 seconds]
<timgauthier> haha
brunops has quit [Quit: leaving]
<timgauthier> i hate atom.io because it still doesn't let me close tags in any way
GriffinHeart has joined #ruby
<timgauthier> c'mon, textmate and sublime BOTH do it
crazymykl has joined #ruby
gorpon has quit [Ping timeout: 255 seconds]
shiggity_ has quit [Quit: shiggity_]
mikemac has quit [Quit: Konversation terminated!]
<pontiki> EMACS SUCKERS
end_guy has joined #ruby
Kricir has joined #ruby
<pontiki> but xcode is included on the mac
d34th4ck3r has quit [Quit: d34th4ck3r]
<pontiki> it's not super horrible to code in, kind of like eclipse
dhaivat has joined #ruby
carlyle has joined #ruby
Gil has quit [Ping timeout: 264 seconds]
agent_white has quit [Quit: baibai]
carlyle has quit [Read error: Connection reset by peer]
d34th4ck3r has joined #ruby
zkay11 has quit [Quit: Leaving.]
kenneth has joined #ruby
GriffinHeart has quit [Ping timeout: 252 seconds]
carlyle has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
toastynerd has quit [Remote host closed the connection]
kireevco has quit [Quit: Leaving.]
n_blownapart has joined #ruby
toastynerd has joined #ruby
tectonic has joined #ruby
brunops has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<n_blownapart> pastie.org/9252177 sorry very odd these two methods don't return the last to be iterated over (the words 'name' and 'ago') how can that be?
carlyle has joined #ruby
d34th4ck3r has quit [Quit: zzz]
<pontiki> yeah, it'd be great if you showed the output and what you were expecting
lyanchih has quit [Quit: lyanchih]
<n_blownapart> my bad pontiki output here: http://pastie.org/9252181
tanmay_ has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
<ari-_-e> n_blownapart: you print before you add to the hash...
aspires has quit []
<pontiki> you are printing transformed at the beginning
sski has quit [Remote host closed the connection]
brain_shim has quit [Ping timeout: 276 seconds]
<ari-_-e> n_blownapart: also you're talking about printing, not returning
sambao21 has joined #ruby
<n_blownapart> pontiki: hmm, why does it populate the hash except for the last iterated word? ari-_-e
<timgauthier> pontiki the new update to xcode WILL show the output of code?
<timgauthier> oh nm i misread
<ari-_-e> n_blownapart: because you print before you add to the hash...
<pontiki> n_blownapart: you haven't shon the hash at the end of either loop
carlyle has joined #ruby
<n_blownapart> haven't what? pontiki
<pontiki> shown
<pontiki> sorry
<ari-_-e> n_blownapart: all of this stuff happens in a set order
oo_ has joined #ruby
<ari-_-e> all you need to do is look at your code and figure out what order things are happening in
carlyle has quit [Read error: Connection reset by peer]
<ari-_-e> there's no mystery or magic to it
ehc has joined #ruby
robbyoconnor has joined #ruby
<n_blownapart> ari-_-e: could you elaborate? it seems the operation is stopped dead in its tracks. so it creates the hash and prints it except for the last element. why?
tectonic has quit [Ping timeout: 252 seconds]
<pontiki> n_blownapart: it has NOT stopped
<pontiki> it completes just fine
<ari-_-e> n_blownapart: why do you think it stops?
<pontiki> you just haven't printed the final value
<ari-_-e> n_blownapart: look
carlyle has joined #ruby
<ari-_-e> n_blownapart: do the loop in your head
<ari-_-e> n_blownapart: and pay attention to what is happening when
fgo has joined #ruby
<ari-_-e> this program is entirely deterministic
<ari-_-e> the operations happen in a specific order
carlyle has quit [Read error: Connection reset by peer]
x1337807x has joined #ruby
<n_blownapart> ari-_-e: sorry the way I do it in my head is most likely unfounded.
brunops has quit [Ping timeout: 252 seconds]
x1337807x has quit [Max SendQ exceeded]
<ari-_-e> n_blownapart: well, go through it here
<n_blownapart> I don't understand what you are asking. ^
<pontiki> then step through it with a debugger
tectonic has joined #ruby
oo_ has quit [Ping timeout: 264 seconds]
x1337807x has joined #ruby
brunops has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<n_blownapart> pontiki: I would love to know how to use pry. where would I put binding.pry ?
<pontiki> right at the very top
<n_blownapart> kay
<pontiki> require 'pry'; binding.pry
carlyle has joined #ruby
<n_blownapart> pontiki: one sec
<ari-_-e> n_blownapart: you had this exact same problem a few days ago, if I remember correctly
<n_blownapart> ari-_-e: well the block arguments sequence confused me but I have that straight now.
toastynerd has quit [Remote host closed the connection]
<ari-_-e> you were having trouble with the order that things were happening in
carlyle has quit [Read error: Connection reset by peer]
<ari-_-e> n_blownapart: tell me this:
<ari-_-e> n_blownapart: if I set i = 0
<ari-_-e> and then I print i
<ari-_-e> and then I set i = 5
<ari-_-e> what would be printed?
rezzack has joined #ruby
meatherly has joined #ruby
carlyle has joined #ruby
brain_shim has joined #ruby
<n_blownapart> ari-_-e: 5
<ari-_-e> n_blownapart: why?
<n_blownapart> because the initial assignment is overwritten
carlyle has quit [Read error: Connection reset by peer]
<pontiki> wwwwwwow
<ari-_-e> pontiki: :-/
<ari-_-e> n_blownapart: ok
<ari-_-e> n_blownapart: I set i = 0
<ari-_-e> n_blownapart: what is i?
tectonic has quit []
brain_shim has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
<n_blownapart> i points to zero
<ari-_-e> ok
<ari-_-e> n_blownapart: now I print i
meatherly has quit [Ping timeout: 265 seconds]
<ari-_-e> n_blownapart: what have I just printed?
duncannz has joined #ruby
lethjakman has joined #ruby
<n_blownapart> the value of i, what was assigned to it.
<ari-_-e> n_blownapart: which was...?
XenoWolf has quit [Ping timeout: 264 seconds]
<n_blownapart> 0
<ari-_-e> n_blownapart: ok
XenoWolf has joined #ruby
<ari-_-e> n_blownapart: now I set i = 5
<ari-_-e> have I printed anything else?
<n_blownapart> no
<ari-_-e> right
tjr9898__ has joined #ruby
dhaivat has quit [Quit: dhaivat]
<ari-_-e> things happen in a very specific order
<ari-_-e> based on how you have written your code
<pontiki> does the 0 that got printed change to a 5?
razrunelord has joined #ruby
<ari-_-e> things that come later do not effect things that are happening now
sski has joined #ruby
anaeem1 has joined #ruby
carlyle has quit [Ping timeout: 255 seconds]
run_kmc has joined #ruby
run_kmc is now known as Guest37287
banjara has quit [Quit: Leaving.]
<n_blownapart> I don't follow. why would 4 or 5 words receive the same treatment and not the last if each element of the array is 'iterated over' and returned in a hash.?
dhaivat has joined #ruby
<ari-_-e> n_blownapart: how are you thinking that the output is produced?
neersighted has joined #ruby
<ari-_-e> n_blownapart: what line produces the output that you see?
<n_blownapart> ari-_-e: this would be guesswork but...
carlyle has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
razrunelord has quit [Ping timeout: 252 seconds]
<ari-_-e> it shouldn't be guesswork
<n_blownapart> in the first inject method, line 10 'transformed' returns the value of the block.
lethjakman has quit [Ping timeout: 240 seconds]
<ari-_-e> n_blownapart: were you ever told what "puts" does?
aspires has joined #ruby
toastynerd has joined #ruby
<n_blownapart> sorry ari-_-e wait that would be line 6. puts is print with a return of nil
<ari-_-e> n_blownapart: ruby script do not automatically print anything
<n_blownapart> yeah puts is what prints the line, but in the first method line 6 is necessary because in inject the return value must be there on line 6
<ari-_-e> n_blownapart: only things that are explicitly printed are printed
razrunelord has joined #ruby
<ari-_-e> n_blownapart: ok, what does the return value do?
toastynerd has quit [Read error: No route to host]
<ari-_-e> n_blownapart: also, I'll ask again: what produces the output that you see?
toastynerd has joined #ruby
sski has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
<n_blownapart> ari-_-e: well, the return value gets you out of the block, and apparently inscribes little strange outputs somewhere in the top level
yfeldblum has quit [Ping timeout: 260 seconds]
<ari-_-e> n_blownapart: what would you say the "puts" lines do?
sski has joined #ruby
oo_ has joined #ruby
badhatter has joined #ruby
badhatter has joined #ruby
__class__ has quit [Ping timeout: 252 seconds]
<n_blownapart> it prints output but the actual return value is nil.
comma8 has quit [Quit: Leaving]
<ari-_-e> n_blownapart: again, nothing is printed unless it is explicitly printed
<ari-_-e> n_blownapart: tell me about return values
comma8 has joined #ruby
<ari-_-e> n_blownapart: what happens to return values?
<ari-_-e> do they get printed?
amargherio has quit [Remote host closed the connection]
<ari-_-e> n_blownapart: why is it relevant that the return value of puts is nil?
<n_blownapart> ari-_-e: let me think about thatj
arrubin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<n_blownapart> nil is an object. so and object is always returned in ruby I believe
<n_blownapart> an*
razrunelord has quit [Ping timeout: 240 seconds]
brain_shim has joined #ruby
<ari-_-e> yes, there is always a return value, that's true
kireevco has joined #ruby
<ari-_-e> but why is it relevant that puts returns nil?
<DEA7TH> Can I refactor this code to make it more concise and readable: https://gist.github.com/anonymous/42782e2cebcc36a18267
<DEA7TH> a,b,c are lists
<ari-_-e> n_blownapart: you're saying that as if it makes the puts unimportant
rkazak has joined #ruby
lw has joined #ruby
subbyyy_ has joined #ruby
<DEA7TH> c += {whichever's first element is smaller from a and b}.shift(1)
yubrew has joined #ruby
<DEA7TH> that's what I want ideally
sski has quit [Ping timeout: 264 seconds]
oo_ has quit [Ping timeout: 240 seconds]
mjsmith2 has joined #ruby
goleldar has joined #ruby
<n_blownapart> because a print operation just gets it to the screen. no not unimportant, but the output is separate from the printing of the output...?
<ari-_-e> n_blownapart: explain this separation to me
subbyyy has quit [Ping timeout: 240 seconds]
<pontiki> DEA7TH: you could use a ternary operator
mjsmith2_ has joined #ruby
<pontiki> c += a[0] < b[0] ? a.shift : b.shift
<n_blownapart> the actual output could be sent elsewhere, the puts method merely puts it to the screen and its own calling returns nil.
<RubyPanther> "actual?"
<n_blownapart> uh oh.
<ari-_-e> n_blownapart: ok, so which of those things are we seeing here: http://pastie.org/9252181# ?
<RubyPanther> print _is_ the actual output
<n_blownapart> RubyPanther: please wait.
mjsmith2 has quit [Ping timeout: 240 seconds]
yubrew has quit [Ping timeout: 255 seconds]
<RubyPanther> lol
<n_blownapart> lol is why johnny can't learn.
lxsameer has joined #ruby
kireevco has quit [Quit: Leaving.]
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<DEA7TH> pontiki: yeah I did that and it reduced it to a single line, but it looks kinda ugly?
<n_blownapart> well, yes that wouldn't print to screen without puts. ari-_-e
phracker has quit [Ping timeout: 240 seconds]
<DEA7TH> ah, my version is uglier than yours
ra4king has quit [Remote host closed the connection]
rman has joined #ruby
<ari-_-e> n_blownapart: your initial question was about that screen output
ra4king has joined #ruby
mjsmith2_ has quit [Ping timeout: 240 seconds]
SCommette has quit [Quit: SCommette]
Gil has joined #ruby
Guest37287 has quit [Quit: Textual IRC Client: www.textualapp.com]
phracker has joined #ruby
<n_blownapart> ari-_-e: you were asking me about the significance of puts returning nil.
mehlah has quit [Quit: Leaving...]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
ra4king has quit [Remote host closed the connection]
newUser1234 has quit [Read error: Connection reset by peer]
kireevco has joined #ruby
ra4king has joined #ruby
<ari-_-e> argh
lw has quit [Quit: s]
newUser1234 has joined #ruby
ra4king has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
<n_blownapart> puts is merely for printing the value, but it doesn't have a distinct operation on the code like a bang ! operation or similar. ari-_-e
IcyDragon has quit [Quit: Space~~~]
ra4king has joined #ruby
sailias has joined #ruby
absolutezeroff has joined #ruby
tylersmith has quit [Remote host closed the connection]
sailias has quit [Read error: Connection reset by peer]
Slavox is now known as Slavox|AFK
ra4king has quit [Remote host closed the connection]
tylersmith has joined #ruby
ra4king has joined #ruby
<ari-_-e> n_blownapart: what was the "actual" output that you were talking about?
diegovio1 is now known as diegoviola
oo_ has joined #ruby
rman is now known as rman_
shiggity_ has joined #ruby
<n_blownapart> by actual I meant that in the block there are functions that alter the initial array of strings, that are the 'crux' of the program. print just reflects what the block is doing in terms of operations.
Cache_Money has quit [Quit: Cache_Money]
<n_blownapart> ari-_-e: ^
bluOxigen has joined #ruby
Morkel has joined #ruby
anaeem1 has quit [Ping timeout: 252 seconds]
northfurr has joined #ruby
tylersmith has quit [Ping timeout: 260 seconds]
newUser1234 has quit [Read error: Connection reset by peer]
rman_ is now known as ramblinpeck
SCommette has joined #ruby
anaeem1_ has joined #ruby
newUser1234 has joined #ruby
ehc has quit [Quit: ehc]
_justin has joined #ruby
<ari-_-e> n_blownapart: I have to go
<n_blownapart> ari-_-e: shit sorry I was trying ruby*panther tripped me up.
<ari-_-e> you should go through the loop in your head and see which operations come before which other operations
<n_blownapart> when I can visualize that I will be far along thanks very much ari-_-e really...
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ari-_-e> n_blownapart: feel free to write it down
beneggett has joined #ruby
<n_blownapart> many thanks ari-_-e you have patience -- much appreciated.
<ari-_-e> n_blownapart: keep in mind how this: http://pastie.org/9252181# output is produced
aspires has quit []
oo__ has joined #ruby
kireevco has quit [Quit: Leaving.]
mr_snowf1ake has quit [Quit: Leaving]
rezzack has quit [Quit: Leaving.]
mois3x has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
rkazak has quit [Quit: rkazak]
newUser1234 has joined #ruby
Kricir has joined #ruby
cuppscakes has quit [Ping timeout: 264 seconds]
<n_blownapart> ari-_-e: yeah I will. pax
sski has joined #ruby
oo_ has quit [Ping timeout: 264 seconds]
aspires has joined #ruby
ari-_-e has quit [Quit: Leaving]
rurban_ has quit [Ping timeout: 240 seconds]
d34th4ck3r has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
Biohazard has quit [Ping timeout: 252 seconds]
oo__ has quit [Remote host closed the connection]
rurban_ has joined #ruby
eguim has quit [Ping timeout: 260 seconds]
Biohazard has joined #ruby
oo_ has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
lyanchih has joined #ruby
newUser1234 has joined #ruby
<shiggity_> does it make sense to wrap array.delete(i) in a ‘if array.include?(i)’
<shiggity_> Is that faster or not nesc/slower?
n_blownapart has quit [Remote host closed the connection]
kireevco has joined #ruby
shiggity_ has quit [Quit: shiggity_]
<ra4king> HELL YEAH!
<ra4king> I got my first ever Ruby CGI script running!
* ra4king is happy
trhodes- has joined #ruby
meatherly has joined #ruby
trhodes_ has quit [Ping timeout: 264 seconds]
aspires has quit []
cuppscakes has joined #ruby
tylersmith has joined #ruby
yfeldblum has joined #ruby
sinkensabe has joined #ruby
<pontiki> yay!
echevemaster has quit [Remote host closed the connection]
<pontiki> what sort of CGI?
SCommette has quit [Quit: SCommette]
newUser1234 has quit [Read error: Connection reset by peer]
n_blownapart has joined #ruby
fgo has quit [Remote host closed the connection]
ccolorado has joined #ruby
meatherly has quit [Ping timeout: 260 seconds]
newUser1234 has joined #ruby
blz37 has joined #ruby
VinDoKi has quit [Remote host closed the connection]
timonv has joined #ruby
shiggity_ has joined #ruby
<n_blownapart> pontiki hi if you're still on, thanks for the suggestion. I tried require 'pry' ; binding.pry . tomorrow's project. the color highlighting is very cool.
shiggity_ has left #ruby [#ruby]
jamto11 has joined #ruby
rkazak has joined #ruby
n_blownapart has quit [Remote host closed the connection]
ccolorado has left #ruby [#ruby]
yohanobs_ has joined #ruby
cuppscakes has quit [Quit: ZNC - http://znc.in]
yohanobs_ has quit [Read error: Connection reset by peer]
amclain has quit [Quit: Leaving]
timonv has quit [Ping timeout: 240 seconds]
yohanobs_ has joined #ruby
yohanobs__ has quit [Ping timeout: 240 seconds]
cuppscakes has joined #ruby
jamto11 has quit [Ping timeout: 252 seconds]
dhaivat has quit [Quit: dhaivat]
newUser1234 has quit [Read error: Connection reset by peer]
tagrudev has joined #ruby
aganov has joined #ruby
Burgestrand has joined #ruby
newUser1234 has joined #ruby
sski has quit [Remote host closed the connection]
sski has joined #ruby
toastynerd has quit [Remote host closed the connection]
razrunelord has joined #ruby
tectonic has joined #ruby
cuppscakes has quit [Ping timeout: 264 seconds]
lw has joined #ruby
dhaivat has joined #ruby
dhaivat has quit [Client Quit]
shack4 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
sski has quit [Ping timeout: 240 seconds]
toastynerd has joined #ruby
SCommette has joined #ruby
oo_ has quit [Remote host closed the connection]
Gil has quit [Remote host closed the connection]
razrunelord has quit [Ping timeout: 276 seconds]
oo_ has joined #ruby
aneong has joined #ruby
newUser1_ has joined #ruby
GriffinHeart has joined #ruby
tjr9898__ has quit [Remote host closed the connection]
tjr9898_ has joined #ruby
newUser1234 has quit [Ping timeout: 240 seconds]
mjsmith2 has joined #ruby
phansch has joined #ruby
<DEA7TH> What is the convention for indentation for a multi-line statement? for example
<DEA7TH> bool ? x :
tjr9898__ has joined #ruby
jack_rabbit has quit [Ping timeout: 245 seconds]
<DEA7TH> very_very_very_very_very_long_statement
<DEA7TH> I left 2 spaces before the second line, not sure if that's conventional though
<Burgestrand> DEA7TH: I wouldn’t go as far as say it’s a convention, but I see very very few ternary statements in Ruby overall.
fluve has joined #ruby
<Hanmac> DEA7TH: i think for that a If <> \n <> \n else \n <> \n end is better
djbkd has joined #ruby
mary5030 has joined #ruby
goleldar has quit [Remote host closed the connection]
jack_rabbit has joined #ruby
<DEA7TH> Even in the following code? if x.length <= 1 \n x \n else \n very_long_statement \n end
GriffinHeart has quit [Ping timeout: 255 seconds]
<Burgestrand> Yes.
<DEA7TH> ok, will do.
devdazed has quit [Ping timeout: 265 seconds]
JPascal has joined #ruby
<Burgestrand> Keep in mind it could be personal bias. I’m not a fan of ternary, so it’s possible I simply avoid seeing them. :)
mjsmith2 has quit [Ping timeout: 240 seconds]
<DEA7TH> still, if I want to do a multi-line statement - it doesn't have to be ternary operator, but anything with a high character count - how many spaces should I leave before the second line?
thomasxie has quit [Quit: Leaving.]
<DEA7TH> Burgestrand: I didn't like the ternary either, I was on the boundary of removing it anyway
tjr9898_ has quit [Ping timeout: 276 seconds]
<Burgestrand> DEA7TH: do you have an example of such a statement? Perhaps you could paste it on e.g. http://gist.github.com/
<pontiki> 2 space indent is part of the github ruby coding standards. many people follow them
devdazed has joined #ruby
sputnik13 has joined #ruby
pixie79 has quit []
mary5030 has quit [Ping timeout: 240 seconds]
dseitz has joined #ruby
Kricir has quit [Remote host closed the connection]
goleldar has joined #ruby
kies has quit [Ping timeout: 276 seconds]
<DEA7TH> I included two examples: one with ternary and one without. Actually I think I like the ternary version better, now that the really long statement is split into multiple lines
helios157 has joined #ruby
<DEA7TH> lines 14-16 - should I indent? I can put them all into a single line, but that'd take too much space and isn't very readable
penzur has joined #ruby
<DEA7TH> but the indentation looks a bit ugly as well
<Burgestrand> DEA7TH: I think I’d write it as your second example there. The ternary is indeed more dense, but in my opinion less clear.
<DEA7TH> likewise for line 2 to 3
ner0x has quit [Remote host closed the connection]
sski has joined #ruby
ari-_-e has joined #ruby
<Burgestrand> DEA7TH: I tend to indent additional e.g. .map {} on a new line, indented by 2 spaces to separate them from regular statements appearing on the next line.
<Burgestrand> DEA7TH: just like you’ve done.
whyy has joined #ruby
MatthewsFace has quit [Ping timeout: 252 seconds]
<DEA7TH> Burgestrand: so the second function seems already ok to you, no need to further refactor?
MatthewsFace has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<Burgestrand> DEA7TH: yeah. The chance of misinterpreting that code is tiny.
<penzur> hello
yfeldblum has joined #ruby
whyy has quit [Read error: Connection reset by peer]
<DEA7TH> hmm ok, I'll adopt that indentation principle then. I thought of it initially, but it seemed a bit odd
newUser1_ has quit [Read error: Connection reset by peer]
whyy has joined #ruby
nm has joined #ruby
<Burgestrand> I’m not a big fan of it either, but that’s mainly because of the stream processing-like code, and not because of the indentation. The other choice (for me) is having a really long line, which is worse. :)
lw has quit [Quit: s]
newUser1234 has joined #ruby
subraminion has joined #ruby
<DEA7TH> Burgestrand: Would you also use 2 spaces if instead, the really long line was a list? e.g. [1, 2, 3, \n 4, 5]
<DEA7TH> or any other construct which needs splitting separate two lines
JasmeetQA has joined #ruby
kireevco has quit [Quit: Leaving.]
<Burgestrand> DEA7TH: yeah, kind of https://github.com/Burgestrand/spotify/blob/master/lib/spotify/defines.rb#L10 — in that example though I also needed explicit grouping of the items, not just splitting the line.
tectonic has quit []
<Burgestrand> DEA7TH: looking at that example, it’s more about grouping than indenting.
fgo has joined #ruby
ccolorado has joined #ruby
<DEA7TH> Burgestrand: yeah I also do that with really long list, maybe I should've used a different example
<DEA7TH> Burgestrand: what about a really long function call? I guess
fluve has quit [Read error: Connection reset by peer]
<Burgestrand> DEA7TH: most of my lines tend to not be very long. :)
apeiros has quit [Remote host closed the connection]
<DEA7TH> Burgestrand: yeah, maybe I should return when I have an example where 2-space indentation looks bad
apeiros has joined #ruby
Shidash has quit [Ping timeout: 240 seconds]
Gil has joined #ruby
kies has joined #ruby
alem0lars has joined #ruby
Shidash has joined #ruby
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
<ccolorado> How can I select a hash item ( key and value ) based on an expression, eg: callback(key) == true ?
kiri has joined #ruby
jack_rabbit has quit [Ping timeout: 255 seconds]
apeiros has quit [Ping timeout: 260 seconds]
claymore has joined #ruby
<ccolorado> I am trying to do this with a block maybe thats not the way to do it.
claymore has quit [Changing host]
claymore has joined #ruby
bal has joined #ruby
tacos1de has quit [Remote host closed the connection]
Bosox20051 has quit [Ping timeout: 264 seconds]
Shidash has quit [Ping timeout: 260 seconds]
kireevco has joined #ruby
kireevco has quit [Remote host closed the connection]
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<lxsameer> hey guys is there any free (libre) book about ruby around ?
Morkel_ has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bluOxigen has quit [Ping timeout: 252 seconds]
Morkel has quit [Ping timeout: 252 seconds]
Morkel_ is now known as Morkel
Shidash has joined #ruby
lyanchih has quit [Quit: lyanchih]
sski has quit [Remote host closed the connection]
sski has joined #ruby
<Burgestrand> ccolorado: key, value = hash.find { |key, value| … some code here … }
<Burgestrand> >> { a: 1, b: 2, c: 3, d: 4 }.find { |k, v| v == 3 }
<eval-in_> Burgestrand => [:c, 3] (https://eval.in/158082)
kireevco has joined #ruby
tylersmith has quit [Remote host closed the connection]
MatthewsFace has quit [Ping timeout: 265 seconds]
tylersmith has joined #ruby
<lxsameer> RubyPanther: any other title ?
MatthewsFace has joined #ruby
davedev24_ has quit []
<RubyPanther> lxsameer: there is a free beer version of the popular "pickaxe" book...
sambao21 has quit [Quit: Computer has gone to sleep.]
<lxsameer> RubyPanther: I want to translate a ruby book, so i need a libre title since i don't have money to buy the rights from author
bhaak has joined #ruby
tanmay_ has quit [Ping timeout: 252 seconds]
<lxsameer> thanks
sski has quit [Ping timeout: 264 seconds]
diegoviola has quit [Quit: WeeChat 0.4.3]
sigurding has joined #ruby
lyanchih has joined #ruby
<RubyPanther> lxsameer: "Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder."
tylersmith has quit [Ping timeout: 252 seconds]
<RubyPanther> ' "Substantive modification" is defined as a change to the semantic content of the document, and excludes mere changes in format or typographical corrections.'
<lxsameer> RubyPanther: which one it is belong to ?
<RubyPanther> Unclear to me where in that translation falls
doev has joined #ruby
<RubyPanther> lxsameer: That is the for Programming Ruby (pickaxe)
<lxsameer> RubyPanther: as i ask couple of publishers translation is like redistributing and publishing book
Macaveli has joined #ruby
<RubyPanther> Sure, but in this case you're allowed to republish, but not if there is "substantive" modifications
<RubyPanther> Also you have to list all your changes
<ari-_-e> also that edition of the pickaxe was written a rather long time ago and is for a rather old version of ruby
dc has joined #ruby
aneong has quit []
yubrew has joined #ruby
Macaveli has quit [Ping timeout: 252 seconds]
bigkevmcd has quit [Ping timeout: 252 seconds]
rghose1 has joined #ruby
bigkevmcd has joined #ruby
rkazak has left #ruby [#ruby]
<ccolorado> Burgestrand: I see thanks
gbchaosmaster has quit [Ping timeout: 276 seconds]
<ccolorado> I am trying to make a dynamic regular expresion , but I have been unable to use a variable inside it. https://eval.in/158086
yubrew has quit [Ping timeout: 252 seconds]
michael_lee has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
claymore has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
tectonic has joined #ruby
balazs has quit [Ping timeout: 264 seconds]
r0ok has quit [Quit: r0ok]
tacos1de has joined #ruby
<lethe> ccolorado: try this - Regexp.new("^#{myregex}.*", 'i')
claymore has joined #ruby
bluOxigen has joined #ruby
<Burgestrand> >> var = “Hello”; /^#{var}.*/i
<eval-in_> Burgestrand => undefined local variable or method `“Hello”' for main:Object (NameError) ... (https://eval.in/158090)
klaut has joined #ruby
SCommette has quit [Quit: SCommette]
<Burgestrand> >> /^#{“wat"}.*/i
<eval-in_> Burgestrand => /tmp/execpad-748cb70fb404/source-748cb70fb404:7: syntax error, unexpected keyword_end, expecting tSTRING_DEND (https://eval.in/158091)
<Burgestrand> Hah.
My_Hearing is now known as Mon_Ouie
<Burgestrand> Oh, weird quotes.
<Burgestrand> var = “Hello”; /^#{var}.*/i
<Burgestrand> Noo.
<Burgestrand> >> var = "Hello"; /^#{var}.*/i
<eval-in_> Burgestrand => /^Hello.*/i (https://eval.in/158093)
<Burgestrand> Yay!
<Burgestrand> ccolorado: ^ — keep in mind that if you want your string to be interpreted literally, you'll want to use Regexp.quote(string)
Kricir has joined #ruby
<Burgestrand> >> Regexp.quote("start.of.sentence")
<eval-in_> Burgestrand => "start\\.of\\.sentence" (https://eval.in/158095)
<ccolorado> I see my error now Regex != Regexp
<ccolorado> :(
atraylen2 has joined #ruby
atraylen has quit [Ping timeout: 240 seconds]
mois3x has quit [Quit: mois3x]
<Hanmac> Burgestrand: look “wat" did you see what is wrong at the " ? “ " look carefully if you see a difference
<Hanmac> >> /^#{"wat"}.*/i
<eval-in_> Hanmac => /^wat.*/i (https://eval.in/158098)
<Burgestrand> Hanmac: yeah, I noticed the weird quotes. OSX smart quotes weren't very smart.
Vivekananda has quit [Quit: Ex-Chat]
MatthewsFace has joined #ruby
kireevco has quit [Quit: Leaving.]
tessi has joined #ruby
mjsmith2 has joined #ruby
Kricir has quit [Ping timeout: 252 seconds]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
<ccolorado> thanks to everyone, I was stuck on that longer that i would like to admit
lemur has joined #ruby
kireevco has joined #ruby
<Hanmac> Burgestrand: yeah OSX ... solving problems that you would not have without OSX ;P
alem0lars has quit [Quit: Going AFK...]
goleldar has quit [Remote host closed the connection]
diegoviola has joined #ruby
vifino has joined #ruby
northfurr has quit [Quit: northfurr]
alem0lars has joined #ruby
<Burgestrand> Hanmac: I usually just turn this smarty-pants feature off. :)
jprovazn has joined #ruby
apeiros has joined #ruby
atraylen2 has quit [Ping timeout: 252 seconds]
mjsmith2 has quit [Ping timeout: 240 seconds]
yohanobs_ has quit [Remote host closed the connection]
ayaz has joined #ruby
andikr has joined #ruby
bal has quit [Quit: bal]
krandi has joined #ruby
newUser1_ has joined #ruby
djbkd has quit [Remote host closed the connection]
lemur has quit [Remote host closed the connection]
newUser1234 has quit [Ping timeout: 240 seconds]
bal has joined #ruby
alem0lars has quit [Quit: alem0lars]
sigurding has quit [Read error: Connection reset by peer]
relix has joined #ruby
Deele has joined #ruby
kyb3r_ has quit [Read error: Connection reset by peer]
newUser1_ has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
alem0lars has joined #ruby
klaut has quit [Remote host closed the connection]
MatthewsFace has quit [Quit: This computer has gone to sleep]
anaeem1_ has quit [Ping timeout: 252 seconds]
anaeem1_ has joined #ruby
benlieb has joined #ruby
phansch has quit [Ping timeout: 240 seconds]
phansch has joined #ruby
andikr has quit [Remote host closed the connection]
newUser1234 has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
thepreacher has joined #ruby
noop has joined #ruby
noop has quit [Remote host closed the connection]
noop has joined #ruby
toastynerd has quit [Remote host closed the connection]
sigurding has joined #ruby
Kricir has joined #ruby
SCommette has joined #ruby
Gil has quit [Remote host closed the connection]
SCommette has quit [Client Quit]
phansch_ has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
phansch has quit [Ping timeout: 245 seconds]
newUser1234 has joined #ruby
Kricir has quit [Ping timeout: 276 seconds]
mijicd has joined #ruby
doev has quit [Quit: Verlassend]
ninegrid has quit [Ping timeout: 252 seconds]
kireevco has quit [Quit: Leaving.]
fabrice31 has joined #ruby
p8952 has joined #ruby
coderhs has quit [Ping timeout: 240 seconds]
timonv has quit [Remote host closed the connection]
DEA7TH has quit [Ping timeout: 252 seconds]
meatherly has joined #ruby
XenoWolf_ has joined #ruby
newUser1_ has joined #ruby
XenoWolf has quit [Ping timeout: 265 seconds]
_tpavel has joined #ruby
anarang has joined #ruby
kilk__ has joined #ruby
newUser1234 has quit [Ping timeout: 240 seconds]
tectonic has quit []
kireevco has joined #ruby
Xeago has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
meatherly has quit [Ping timeout: 264 seconds]
newUser1_ has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
newUser1234 has joined #ruby
Takle has joined #ruby
ninegrid has joined #ruby
jamto11 has joined #ruby
MatthewsFace has joined #ruby
thepreacher has quit [Quit: Leaving]
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
klaut has joined #ruby
rampert has joined #ruby
GriffinHeart has joined #ruby
jamto11 has quit [Ping timeout: 265 seconds]
newUser1234 has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
oo_ has joined #ruby
GriffinHeart has quit [Ping timeout: 240 seconds]
yacks has joined #ruby
shredding has joined #ruby
akonny has joined #ruby
dumdedum has joined #ruby
toastynerd has joined #ruby
razrunelord has joined #ruby
Macaveli has joined #ruby
yacks has quit [Max SendQ exceeded]
spider-mario has joined #ruby
riotjones has joined #ruby
yacks has joined #ruby
d34th4ck3r has quit [Quit: zzz]
jackjackdrpr has joined #ruby
newUser1_ has joined #ruby
Takle has quit [Remote host closed the connection]
newUser1234 has quit [Read error: Connection reset by peer]
toastynerd has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
razrunelord has quit [Ping timeout: 240 seconds]
sk87 has joined #ruby
aspiers_ has joined #ruby
ninegrid has quit [Ping timeout: 240 seconds]
mjsmith2 has joined #ruby
ninegrid has joined #ruby
d34th4ck3r has joined #ruby
newUser1_ has quit [Read error: Connection reset by peer]
mjsmith2_ has joined #ruby
Doppp has quit [Quit: leaving]
newUser1234 has joined #ruby
Doppp has joined #ruby
wchun has quit [Quit: Leaving]
mjsmith2 has quit [Ping timeout: 240 seconds]
dANOKELOFF has joined #ruby
akonny has quit [Quit: akonny]
rdark has joined #ruby
mjsmith2_ has quit [Ping timeout: 240 seconds]
lyanchih has quit [Quit: lyanchih]
kireevco has quit [Quit: Leaving.]
Meatchicken has quit [Read error: Connection reset by peer]
lyanchih has joined #ruby
banister has joined #ruby
olivier_bK has joined #ruby
sski has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
Xeago has quit [Remote host closed the connection]
thepreacher has joined #ruby
Xeago has joined #ruby
phansch_ has quit [Quit: WeeChat 0.4.3]
bhaak has quit [Read error: Connection reset by peer]
hermanmunster has quit [Remote host closed the connection]
hermanmunster has joined #ruby
tjr9898__ has quit [Remote host closed the connection]
whyy has quit [Remote host closed the connection]
lemur has joined #ruby
tjr9898_ has joined #ruby
yacks has quit [Ping timeout: 252 seconds]
elaptics`away is now known as elaptics
LnL has quit [Read error: Connection reset by peer]
whyy has joined #ruby
kaspergrubbe has joined #ruby
mercerist has joined #ruby
Takle has joined #ruby
mikecmpbll has joined #ruby
nvrch has joined #ruby
kaspergr_ has joined #ruby
hermanmunster has quit [Ping timeout: 240 seconds]
Kricir has joined #ruby
ephemerian has joined #ruby
tessi has quit [Quit: Leaving]
lemur has quit [Ping timeout: 240 seconds]
tjr9898_ has quit [Ping timeout: 240 seconds]
whyy has quit [Ping timeout: 252 seconds]
xanandu has quit [Ping timeout: 276 seconds]
klaut has quit [Remote host closed the connection]
roolo has joined #ruby
tessi has joined #ruby
kaspergrubbe has quit [Ping timeout: 255 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
yacks has joined #ruby
bluenemo has quit [Quit: Verlassend]
Kricir has quit [Ping timeout: 240 seconds]
kaspergr_ has quit [Ping timeout: 240 seconds]
Takle has quit [Ping timeout: 255 seconds]
artmann_ has quit [Quit: No Ping reply in 180 seconds.]
obs has joined #ruby
thepreacher has quit [Quit: Leaving]
timonv has joined #ruby
rotor has quit [Ping timeout: 252 seconds]
kman has quit [Ping timeout: 255 seconds]
artmann has joined #ruby
yubrew has joined #ruby
sk87 has joined #ruby
kaspergrubbe has joined #ruby
Wolland has joined #ruby
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
tesuji has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
wallerdev has quit [Quit: wallerdev]
orthos has joined #ruby
brunops has quit [Ping timeout: 240 seconds]
Takle has joined #ruby
Wolland has quit [Remote host closed the connection]
reactormonk has quit [Ping timeout: 252 seconds]
lkba has quit [Ping timeout: 245 seconds]
lyanchih has quit [Quit: lyanchih]
lyanchih has joined #ruby
einarj has joined #ruby
reactormonk has joined #ruby
ylluminate has quit [Quit: Bye!]
Takle has quit [Remote host closed the connection]
rotor has joined #ruby
subraminion has quit [Quit: Computer has gone to sleep.]
Takle has joined #ruby
xcv has joined #ruby
hermanmunster has joined #ruby
buzzybron has joined #ruby
timonv has quit [Remote host closed the connection]
Guest54253 has quit [Changing host]
Guest54253 has joined #ruby
Guest54253 is now known as deepy
Rollabunna has joined #ruby
tvw has joined #ruby
jackjackdrpr has quit [Quit: Leaving.]
_justin has quit [Quit: _justin]
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
mercerist has quit [Quit: Computer has gone to sleep.]
toastynerd has joined #ruby
razrunelord has joined #ruby
kman has joined #ruby
claymore has quit [Ping timeout: 252 seconds]
Wolland has joined #ruby
benlieb has quit [Quit: benlieb]
Takle has quit [Remote host closed the connection]
Arkaniad has quit [Ping timeout: 252 seconds]
claymore has joined #ruby
alem0lars has quit [Quit: Going AFK...]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
benlieb has joined #ruby
toastynerd has quit [Ping timeout: 264 seconds]
Takle has joined #ruby
razrunelord has quit [Ping timeout: 276 seconds]
subraminion has joined #ruby
subraminion has quit [Remote host closed the connection]
mjsmith2 has joined #ruby
subraminion has joined #ruby
subraminion has quit [Remote host closed the connection]
fgo has quit [Remote host closed the connection]
subraminion has joined #ruby
marr has joined #ruby
sk87 has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
hd1 has joined #ruby
blueOxigen has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
mjsmith2 has quit [Ping timeout: 240 seconds]
bluOxigen has quit [Ping timeout: 240 seconds]
St_Marx has quit [Ping timeout: 272 seconds]
eguim has joined #ruby
newUser1234 has quit [Read error: Connection timed out]
benlieb has quit [Quit: benlieb]
AlexRussia has joined #ruby
DaniG2k has joined #ruby
mupkoo has joined #ruby
hd1 has left #ruby [#ruby]
iwat has joined #ruby
Arkaniad has joined #ruby
roolo has quit [Ping timeout: 240 seconds]
roolo has joined #ruby
alem0lars has joined #ruby
AlSquire has joined #ruby
lw has joined #ruby
Wolland has quit [Remote host closed the connection]
Wolland has joined #ruby
mupkoo has quit [Remote host closed the connection]
mupkoo has joined #ruby
yeticry has quit [Ping timeout: 245 seconds]
Wolland has quit [Ping timeout: 245 seconds]
nnu has joined #ruby
yeticry has joined #ruby
Kricir has joined #ruby
banjara has joined #ruby
_justin has joined #ruby
mupkoo has quit [Ping timeout: 240 seconds]
Takle has quit [Remote host closed the connection]
obs has quit [Remote host closed the connection]
Zai00 has joined #ruby
claymore has quit [Quit: Leaving]
keen_______ has joined #ruby
yubrew has joined #ruby
decoponio has joined #ruby
LekeFly has joined #ruby
sylver has joined #ruby
Kricir has quit [Ping timeout: 252 seconds]
klaut has joined #ruby
keen______ has quit [Ping timeout: 252 seconds]
LiohAu has joined #ruby
TwinkleHood has joined #ruby
anaeem1_ has quit [Read error: Connection reset by peer]
moritzschaefer has joined #ruby
ponga has joined #ruby
ponga has joined #ruby
ponga has quit [Changing host]
lw has quit [Quit: s]
fgo has joined #ruby
anaeem1_ has joined #ruby
sigurding has quit [Quit: sigurding]
akonny has joined #ruby
<sylver> hello guys, I have a newbie problem with instance variables. I'm subclassing StandardError and adding a variable to store the error code in it with "attr_reader :code; @code = 500". But when I try to access this variable with err.code I'm getting a NoMethodError: undefined method `code'. Where am I wrong ?
andrewlio has joined #ruby
yubrew has quit [Ping timeout: 260 seconds]
anaeem1_ has quit [Remote host closed the connection]
<gizmore> sylver: instance_variables are all private by default
<gizmore> you can make dem visibile by:
<gizmore> a) def code; @code; end
<gizmore> or
<gizmore> b) attr_reader :code
<canton7> ..which is what he said he did?
LiohAu has quit [Client Quit]
<sylver> gizmore: yep, as I said, I use attr_reader in my code
anaeem1_ has joined #ruby
<canton7> sylver, pastie?
<sylver> gizmore: that's where I don't understand what's wrong
<gizmore> sylver: maybe mixing obj and obj.class then?
JPascal has quit []
Shidash has quit [Ping timeout: 276 seconds]
anaeem1 has joined #ruby
anaeem1_ has quit [Read error: Connection reset by peer]
<gizmore> simple said: a class is just an object, which features #new ... you maybe try to access your var within a "static" method (a method within the classobject)
DouweM has joined #ruby
<canton7> sylver, pastie your code that's failing. otherwise we're just guessing
obs has joined #ruby
GriffinHeart has joined #ruby
lw has joined #ruby
<sylver> well basically I'm trying something like that : http://pastie.org/9252733 (raising the error in begin for the example, original code is more complex and across several files)
ClarusCogitatio_ has quit [Ping timeout: 252 seconds]
Wolland has joined #ruby
<Hanmac> sylver: line 3 is defines @code in the wrong instance
<gizmore> sylver: yeah, as i said :) you are trying to access the ex.class.code from via ex.code
<gizmore> the @code in your classobject is an instance var of the classobject, not the objects your classobject creates
ClarusCogitatio has joined #ruby
<gizmore> try def initialize; @code = 500; end
d34th4ck3r has quit [Quit: zzz]
<gizmore> initialize is called on .new
<sylver> oh ok, I've misunderstand the documentation
<gizmore> it took me some time to understand and then some more time to disobey class_variables with @@
<sylver> so as the rescue create an instance of the error class, I must define my variable in the initialize method in order to access it ?
GriffinHeart has quit [Ping timeout: 252 seconds]
<gizmore> you can create your instancevar anytime anywhere
<gizmore> until then the reader would return nil
<Hanmac> gizmore: use def initialize(*); @code = 500; end because of the parameters
fauzanqadri has joined #ruby
frosgy has joined #ruby
<gizmore> * you can create your instancevar anytime anywhere inside an instance_method *
<sylver> ok
<Hanmac> gizmore: instance variables can only created "nearly" anywhere i mean yeah they can be created inside classes but for sample not in Fixnum
<gizmore> using def initialize is probably not the best idea. It is only nice on classes that don´t inherit from other classes :)
<sylver> in my case I only need to define it once, it never changes. Maybe I should do a constant instead ?
robbyoconnor has quit [Ping timeout: 240 seconds]
<gizmore> Hanmac: class Fixnum; def foo; @haha = 4; end - does not work?
daxroc has joined #ruby
<daxroc> Morning all
<Hanmac> gizmore: "RuntimeError: can't modify frozen Fixnum"
<daxroc> What is ${...} used for?
<gizmore> sylver: your @code looks lite it´s crying for normal int like you do already :)
<Hanmac> gizmore:
<Hanmac> >> class Fixnum; def foo; @haha = 4; end;end; 4.foo
<eval-in_> Hanmac => can't modify frozen Fixnum (RuntimeError) ... (https://eval.in/158158)
<Hanmac> 19>> class Fixnum; def foo; @haha = 4; end;end; 4.foo
<eval-in_> Hanmac => 4 (https://eval.in/158159)
jamto11 has joined #ruby
<gizmore> sylver: but you could define constants like HTTP_CREATED = 201;
p8952 has quit [Ping timeout: 260 seconds]
<Hanmac> gizmore: is a new change in 2.0 that fixnum cant have instance variables anymore
frogsy has quit [Ping timeout: 240 seconds]
coderhs has joined #ruby
<Hanmac> daxroc: can you show us a sample where its used?
<gizmore> interesting. Thanks a lot Hanmac
<daxroc> I've seen code like ${ABC::xyzAbc:: string ::.}
<Hanmac> daxroc: are you sure its not %{} ?
<Hanmac> >> %{abc def xyz}
fauzanqadri has quit [Read error: Connection reset by peer]
<eval-in_> Hanmac => "abc def xyz" (https://eval.in/158160)
<daxroc> Hanmac: I'm sure it's in plain ruby files too
<gizmore> >> $("String").replace('a').to_sym
<eval-in_> gizmore => /tmp/execpad-e1f384ac1804/source-e1f384ac1804:2: `$(' is not allowed as a global variable name ... (https://eval.in/158161)
<Hanmac> daxroc: show us a sample please
gr33n7007h has joined #ruby
<sylver> k, following your advices, here's a new one http://pastie.org/9252772 I can access the code variables outside but if I subclass my subclass,
mercerist has joined #ruby
<sylver> I have the original variable value, and can't override it in the new subclass
jamto11 has quit [Ping timeout: 265 seconds]
<Hanmac> sylver: you defined it in the class again
sigurding has joined #ruby
<sylver> Hanmac: Since it's already defined in the parent class, how can I change its value ? I must do it in an initialized method in each subclass ?
frobrob has joined #ruby
<Hanmac> yep otherwise you only define them in the class itself
duncannz has quit [Ping timeout: 265 seconds]
<Hanmac> or use some kind of @code = class.instance_variable_get(:@code) inside the base class, then you can use your code in the sub classes
toastynerd has joined #ruby
phansch has joined #ruby
Trynemjoel has joined #ruby
p8952 has joined #ruby
lw has quit [Quit: s]
<daxroc> Hanmac: never mind it was a string to be interpreted by an external application... I thought it was referencing some internal ruby library ...
<daxroc> Appreciate it
toastynerd has quit [Ping timeout: 252 seconds]
<daxroc> <- PEBCAC
<Hanmac> AH ... could be erb or haml
<daxroc> just one of those days cant even the the term right
mariappp has joined #ruby
mariappp has quit [Client Quit]
mehlah has joined #ruby
hgl has quit [Ping timeout: 255 seconds]
paolooo has joined #ruby
nfk has joined #ruby
oo_ has quit [Remote host closed the connection]
paolooo has quit [Client Quit]
hgl has joined #ruby
mercerist has quit [Quit: Computer has gone to sleep.]
RyanV has joined #ruby
oo_ has joined #ruby
sigurding has quit [Ping timeout: 276 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
mercerist has joined #ruby
<sylver> many thanks for your help guys, it's now working
workmad3 has joined #ruby
lkba has joined #ruby
karupa is now known as zz_karupa
diegoviola has quit [Quit: WeeChat 0.4.3]
diegoviola has joined #ruby
penzur has quit [Quit: wadiwasi]
sk87 has joined #ruby
Morkel has quit [Quit: Morkel]
kyb3r_ has joined #ruby
charliesome has joined #ruby
Burgestrand has quit [Ping timeout: 252 seconds]
kilk__ has quit [Remote host closed the connection]
tanmay_ has joined #ruby
alem0lars has quit [Quit: Going AFK...]
Burgestrand has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
xcv has quit []
AlexRussia has joined #ruby
yubrew has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
dEPy has joined #ruby
Kricir has joined #ruby
vinleod has joined #ruby
fgo has quit [Remote host closed the connection]
Takle has joined #ruby
yubrew has quit [Ping timeout: 264 seconds]
Kricir has quit [Ping timeout: 260 seconds]
paolooo has joined #ruby
JPascal has joined #ruby
rghose1 has quit [Ping timeout: 252 seconds]
paolooo has quit [Client Quit]
anaeem___ has joined #ruby
incomplete has joined #ruby
incomplete has quit [Read error: Connection reset by peer]
Takle has quit [Ping timeout: 252 seconds]
movedx_ has joined #ruby
<movedx_> Can you safely pop/delete elements from an array whilst looping over said array?
GriffinHeart has joined #ruby
anaeem1 has quit [Ping timeout: 255 seconds]
anaeem___ has quit [Read error: Connection reset by peer]
<Wolland> what is "safely"
DouweM has quit [Quit: Leaving...]
<movedx_> It can't be done at all in Python. Most languages can't handle it. Can Ruby?
chipotle has joined #ruby
meatherly has joined #ruby
<Wolland> there are methods that will remove an item from array and return it, either from start/end of the array or by index
<Wolland> pop, shift, delete_at, etc
mercwithamouth has joined #ruby
fabrice31 has quit [Remote host closed the connection]
<movedx_> I just want to use delete(). I have a large array of items and I want to loop over it, find items that do not match a pattern, and remove them.
<matti> movedx_: What's wrong with delete_if?
<Wolland> you can use delete_if
<Wolland> or keep_if
<Wolland> or intersect in some cases
anaeem1 has joined #ruby
<movedx_> Hmm.
<movedx_> So many ways to do things.
subbyyy_ has quit [Ping timeout: 265 seconds]
<Wolland> [1,2,3].delete_if {|x| x>2}
Takle has joined #ruby
moritzschaefer has quit [Ping timeout: 252 seconds]
meatherly has quit [Ping timeout: 264 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<movedx_> Indeed.
<movedx_> Thank you.
<Wolland> np
<movedx_> Ruby is wonderful due to its flexibility and powerful, built-in features; Ruby is frustrating due to its flexibility and built-in features ;)
<Hanmac> movedx_: also interesting:
<Hanmac> >> [1,2,3,4,5,6].partition(&:even?)
<eval-in_> Hanmac => [[2, 4, 6], [1, 3, 5]] (https://eval.in/158179)
diegoviola has quit [Quit: WeeChat 0.4.3]
mupkoo has joined #ruby
Takle_ has joined #ruby
agjacome has joined #ruby
<movedx_> >> [a,b,c,d,e,4,5,6,f,g,h].partition(&:!=~/[0-9]/)
<eval-in_> movedx_ => /tmp/execpad-a3b3a88a2c18/source-a3b3a88a2c18:2: syntax error, unexpected '~', expecting ')' ... (https://eval.in/158180)
<movedx_> hmm
GriffinHeart has quit [Remote host closed the connection]
iwat has quit [Remote host closed the connection]
Takle has quit [Ping timeout: 240 seconds]
<Wolland> [1,2,3] & [1,2] => [1, 2] (intersect and return common values)
workmad3 has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
dEPy has quit [Quit: Lingo - http://lingoirc.com]
maximski has joined #ruby
<movedx_> It's all very cool. I just prefer less magic and more understanding/safety. I'm glad I am getting the chance to learn Ruby :)
<banister> swift is really nice
iwat has joined #ruby
<banister> movedx_ magic is just something you dont yet understand :)
fabrice31 has joined #ruby
_justin has quit [Quit: _justin]
<gr33n7007h> >> p = proc { |n| n.is_a? Integer }; ['a','b','c','d','e',4,5,6,'f','g','h'].partition(&p)
<eval-in_> gr33n7007h => [[4, 5, 6], ["a", "b", "c", "d", "e", "f", "g", "h"]] (https://eval.in/158183)
<matti> Magic in Ruby?
<matti> movedx_: Want magic? Go learn Scala.
GriffinHeart has joined #ruby
<movedx_> gr33n7007h: Nice. Sadly I am not actually trying to do that - I just wanted to see if I could use a regex. delete_if is working I believe.
gigetoo has quit [Read error: Connection reset by peer]
<matti> Coffee time.
robert_ has quit [Ping timeout: 245 seconds]
<apeiros> movedx_: [*"A".."Z"].grep(/[aeiou]/i)
<apeiros> >> [*"A".."Z"].grep(/[aeiou]/i)
<eval-in_> apeiros => ["A", "E", "I", "O", "U"] (https://eval.in/158187)
<gr33n7007h> movedx_, ah, ok ;)
sski has quit [Remote host closed the connection]
gigetoo has joined #ruby
sski has joined #ruby
_justin has joined #ruby
trampi has joined #ruby
toastynerd has joined #ruby
razrunelord has joined #ruby
<krz> how do i find out if int is muliple of 500?
<banister> krz % 500 == 0
DouweM has joined #ruby
WishBoy has joined #ruby
jrhe has joined #ruby
sski has quit [Ping timeout: 252 seconds]
<krz> im doing soimething like CSV.foreach("#{Rails.root}/user_profiles.csv") do |row| is it possible to do these in batches
<apeiros> krz: each_slice
<apeiros> if CSV.foreach returns an enumerator itself, you can simply chain. if not, you'll need CSV.enum_for(:foreach, …).each_slice
sigurding has joined #ruby
toastynerd has quit [Ping timeout: 245 seconds]
RyanV has quit [Quit: Lingo - http://lingoirc.com]
mjsmith2 has joined #ruby
razrunelord has quit [Ping timeout: 255 seconds]
workmad3 has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
Zai00 has quit [Quit: Zai00]
workmad3 has quit [Client Quit]
nvrch has quit [Quit: nvrch]
Hanmac has quit [Quit: Leaving.]
nvrch has joined #ruby
venkatk_ has joined #ruby
mjsmith2 has quit [Ping timeout: 240 seconds]
cina has joined #ruby
Hanmac has joined #ruby
fgo has joined #ruby
<krz> apeiros: https://gist.github.com/fa3e81cdb0927c6cdf03 it stops at 7 records
<krz> stops=stalls=doesnt continue
<krz> high CPU
buzzybron has left #ruby [#ruby]
venkatk_ has quit [Client Quit]
danijoo has quit [Read error: Connection reset by peer]
danijoo_ has joined #ruby
<krz> any ideas?
yfeldblum has quit [Ping timeout: 276 seconds]
mijicd has quit [Remote host closed the connection]
Takle_ has quit [Remote host closed the connection]
alem0lars has joined #ruby
alem0lars has quit [Client Quit]
mijicd has joined #ruby
akonny has quit [Read error: Connection reset by peer]
akonny has joined #ruby
ponga has quit [Remote host closed the connection]
cina has quit [Ping timeout: 265 seconds]
sk87 has joined #ruby
ponga has joined #ruby
ponga has quit [Changing host]
ponga has joined #ruby
Wolland has quit [Remote host closed the connection]
Wolland has joined #ruby
yubrew has joined #ruby
lyanchih has quit [Quit: lyanchih]
ponga has quit [Ping timeout: 264 seconds]
lyanchih has joined #ruby
timonv has joined #ruby
Wolland has quit [Ping timeout: 265 seconds]
GriffinHeart has quit [Remote host closed the connection]
bigkevmcd has quit [Ping timeout: 252 seconds]
bigkevmcd has joined #ruby
shredding has quit [Quit: shredding]
yubrew has quit [Ping timeout: 276 seconds]
kaspergrubbe has quit [Ping timeout: 240 seconds]
shredding has joined #ruby
lyanchih has quit [Ping timeout: 276 seconds]
kaspergrubbe has joined #ruby
Kricir has joined #ruby
sski has joined #ruby
dANOKELO_ has joined #ruby
fauzanqadri has joined #ruby
doodlehaus has joined #ruby
nvrch has quit [Quit: nvrch]
dANOKELOFF has quit [Ping timeout: 252 seconds]
doodlehaus has quit [Client Quit]
roolo has quit [Quit: Leaving...]
tanmay_ has quit [Ping timeout: 240 seconds]
moritzschaefer has joined #ruby
Kricir has quit [Ping timeout: 260 seconds]
tanmay_ has joined #ruby
wald0 has joined #ruby
rm__ has joined #ruby
St_Marx has joined #ruby
doev has joined #ruby
yfeldblum has joined #ruby
yfeldblu_ has joined #ruby
meatherly has joined #ruby
rm_ has quit [Ping timeout: 240 seconds]
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
kyb3r_ has quit [Read error: Connection reset by peer]
GriffinHeart has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
ghr has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
rm__ has quit [Remote host closed the connection]
<apeiros> krz: no. but for that code, it makes absolutely no sense to do it in batches.
rm_ has joined #ruby
yfeldblu_ has quit [Ping timeout: 260 seconds]
<apeiros> also, each_slice gives you not *one* row. it gives you 100 rows (since you do each_slice(100))
whyy has joined #ruby
meatherly has quit [Ping timeout: 265 seconds]
ponga has joined #ruby
claymore has joined #ruby
GriffinHeart has quit [Ping timeout: 255 seconds]
trampi has quit [Ping timeout: 264 seconds]
rm_ has quit [Ping timeout: 260 seconds]
Xeago_ has joined #ruby
whyy has quit [Ping timeout: 276 seconds]
jamto11 has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
wald0 has quit [Read error: Connection reset by peer]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nnu has quit [Quit: Lost terminal]
tjr9898_ has joined #ruby
Zai00 has joined #ruby
jamto11 has quit [Ping timeout: 276 seconds]
dwayhs has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
dANOKELO_ has quit [Ping timeout: 252 seconds]
dANOKELOFF has joined #ruby
trampi has joined #ruby
whyy has joined #ruby
dblessing has joined #ruby
why_away has joined #ruby
akonny has quit [Quit: akonny]
wald0 has joined #ruby
nvrch has joined #ruby
toastynerd has joined #ruby
razrunelord has joined #ruby
whyy has quit [Ping timeout: 240 seconds]
chipotle has quit [Ping timeout: 252 seconds]
Devanon has joined #ruby
nnu has joined #ruby
mjsmith2 has joined #ruby
toastynerd has quit [Ping timeout: 240 seconds]
razrunelord has quit [Ping timeout: 260 seconds]
KevinSjoberg has joined #ruby
claymore has quit [Ping timeout: 265 seconds]
JasmeetQA has quit [Read error: Connection reset by peer]
fayimora has joined #ruby
dwayhs has quit [Read error: Connection reset by peer]
mjsmith2 has quit [Ping timeout: 240 seconds]
moritzschaefer has quit [Ping timeout: 252 seconds]
dwayhs has joined #ruby
claymore has joined #ruby
feature_creep has joined #ruby
anaeem1 has quit [Read error: Connection reset by peer]
anaeem1__ has joined #ruby
phoo1234567 has joined #ruby
yacks has quit [Ping timeout: 255 seconds]
Takle has joined #ruby
yubrew has joined #ruby
helios157 has quit []
sambao21 has joined #ruby
phutchins has quit [Ping timeout: 255 seconds]
claymore has quit [Ping timeout: 252 seconds]
ldnunes has joined #ruby
ghr has quit []
ghr has joined #ruby
anaeem1__ has quit [Read error: Connection reset by peer]
anaeem1_ has joined #ruby
kiri has quit [Ping timeout: 255 seconds]
claymore has joined #ruby
yubrew has quit [Ping timeout: 255 seconds]
dwayhs has quit [Ping timeout: 252 seconds]
mengu has joined #ruby
mijicd has quit [Remote host closed the connection]
blueOxigen has quit [Ping timeout: 245 seconds]
bluOxigen has joined #ruby
Takle has quit [Remote host closed the connection]
Takle has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
kiri has joined #ruby
frobrob has quit [Ping timeout: 255 seconds]
kaspergrubbe has joined #ruby
Loaft has quit [Ping timeout: 240 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
nm has quit [Read error: Connection reset by peer]
dblessing has quit [Read error: Connection reset by peer]
dblessing has joined #ruby
chrisseaton has joined #ruby
yacks has joined #ruby
ner0x has joined #ruby
Kricir has joined #ruby
dangerousdave has joined #ruby
northfurr has joined #ruby
_justin has quit [Quit: _justin]
Kricir has quit [Ping timeout: 240 seconds]
doodlehaus has joined #ruby
yfeldblum has joined #ruby
yacks has quit [Ping timeout: 264 seconds]
LekeFly has quit [Quit: Textual IRC Client: www.textualapp.com]
anaeem___ has joined #ruby
anaeem1_ has quit [Ping timeout: 276 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
paulfm has joined #ruby
alem0lars has joined #ruby
why_away has quit [Remote host closed the connection]
ner0x has quit [Remote host closed the connection]
fauzanqadri has quit [Remote host closed the connection]
mark_locklear has joined #ruby
banister has quit [Quit: Textual IRC Client: www.textualapp.com]
Squarepy has joined #ruby
chrisseaton has quit [Ping timeout: 276 seconds]
bmurt has joined #ruby
banisterone has joined #ruby
benzrf|offline is now known as benzrf
Devanon has quit [Quit: WeeChat 0.4.3]
pzula has joined #ruby
himsin has joined #ruby
mjsmith2 has joined #ruby
roolo has joined #ruby
yacks has joined #ruby
troulouliou_dev has joined #ruby
whyy has joined #ruby
JPascal has quit []
why_away has joined #ruby
moritzschaefer has joined #ruby
mjsmith2 has quit [Remote host closed the connection]
mehlah has quit [Quit: Leaving...]
Nahra has joined #ruby
yacks has quit [Ping timeout: 265 seconds]
whyy has quit [Ping timeout: 240 seconds]
tkuchiki_ has joined #ruby
relix has joined #ruby
davedev24_ has joined #ruby
razrunelord has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
<kith> whats the most common lib for pdf generation thats pure ruby?
<apeiros> probably prawn
<apeiros> @ krz
<apeiros> gah
<apeiros> @ kith
<kith> thx will have a look at it
tkuchiki_ has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
learner has quit [Ping timeout: 245 seconds]
charliesome has joined #ruby
charliesome has quit [Client Quit]
KevinSjoberg has quit [Quit: Textual IRC Client: www.textualapp.com]
mehlah has joined #ruby
KevinSjoberg has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
KevinSjoberg has quit [Max SendQ exceeded]
razrunelord has quit [Ping timeout: 255 seconds]
dangerousdave has joined #ruby
moritzschaefer has quit [Ping timeout: 252 seconds]
shredding has quit [Ping timeout: 252 seconds]
yubrew has joined #ruby
shredding has joined #ruby
craigp has joined #ruby
learner has joined #ruby
OffTheRails has joined #ruby
newUser1234 has joined #ruby
yubrew has quit [Ping timeout: 255 seconds]
iwat has quit [Remote host closed the connection]
troulouliou_dev has quit [Remote host closed the connection]
trampi has quit [Quit: Bye]
trampi has joined #ruby
paulfm_ has joined #ruby
bluOxigen has quit [Ping timeout: 276 seconds]
paulfm has quit [Ping timeout: 240 seconds]
foooobear has joined #ruby
banjara has quit [Quit: Leaving.]
claymore has quit [Ping timeout: 264 seconds]
Fire-Dragon-DoL has joined #ruby
tier has joined #ruby
newUser1_ has joined #ruby
balazs has joined #ruby
Azulinho has joined #ruby
yfeldblum has joined #ruby
doev has quit [Ping timeout: 240 seconds]
northfurr has quit [Quit: northfurr]
claymore has joined #ruby
newUser1234 has quit [Ping timeout: 264 seconds]
hermanmunster has quit [Remote host closed the connection]
hermanmunster has joined #ruby
anaeem___ has quit [Remote host closed the connection]
pzula has quit [Ping timeout: 252 seconds]
alexju has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 264 seconds]
gregf has joined #ruby
banister has joined #ruby
zB0hs has joined #ruby
zB0hs has quit [Max SendQ exceeded]
Kricir has joined #ruby
hermanmunster has quit [Ping timeout: 240 seconds]
Kricir has quit [Read error: Connection reset by peer]
infinitone has joined #ruby
Takle has quit [Remote host closed the connection]
tier has quit [Remote host closed the connection]
Kricir has joined #ruby
JLT has joined #ruby
tkuchiki has joined #ruby
GriffinHeart has joined #ruby
momomomomo has joined #ruby
pwh has joined #ruby
dilated_dinosaur has joined #ruby
narendraj9 has joined #ruby
paulfm_ has quit [Read error: Connection reset by peer]
phutchins has joined #ruby
paulfm has joined #ruby
<JLT> I'm relatively new to Ruby but if I had a hash of hashes which is dynamically populated, is it possible I can do h["a"]["b"]["c"] = "d" even if h["a"] did not exist, or would I have to do h["a"] = {} h["a"]["b"] = {} h["a"]["b"]["c"] = "d" ? I can't define the hashes separately as they may or may not exist... so if I have to do it the latter method, I would have to check if the keys exist before creating it as an empty hash.
<JLT> but can I do it the former?w
mekajfire has quit [Ping timeout: 240 seconds]
CJNE has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
<JLT> and maybe can I check if h["a"]["b"]["c"] exists before attempting to delete it?
GriffinHeart has quit [Ping timeout: 240 seconds]
<benzrf> JLT: yes! you can do that!
<benzrf> def dynhash
<benzrf> Hash.new {|h, k| h[k] = dynhash}
<benzrf> end
Takle has joined #ruby
<benzrf> now make your hashes with dynhash ;-)
<benzrf> any keys you access that don't exist will call that block and retry
<benzrf> i.e., populate the key with a new dynhash
craigp has quit [Remote host closed the connection]
<benzrf> JLT: oh wait, you aren't creating the original hash?
craigp has joined #ruby
<apeiros> or without a def: Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }
craigp has quit [Read error: Connection reset by peer]
<JLT> um... well that's al lvery confusing to me. What I currently do is: h = {} then later on in the code I will add things to that hash.
pwh has quit []
<DaniG2k> someone had posted a line of code before
tier has joined #ruby
<DaniG2k> that separated an array of integers
<DaniG2k> into even and off
<DaniG2k> *odd
root_empire has joined #ruby
<DaniG2k> I thikn the code was using the partition method and took a symbol, :even?
<DaniG2k> something like that
<JLT> This is what I currently do in order to add (or update) a hash. http://pastebin.com/pDvVGsBJ of course that's all many lines of code if I simply only need line 8.
<DaniG2k> does anyone remember seeing this in here?
tanmay_ has quit [Quit: No Ping reply in 180 seconds.]
<apeiros> DaniG2k: yes
pwh has joined #ruby
tanmay_ has joined #ruby
<apeiros> >> (1..10).partition(&:even?)
<eval-in_> apeiros => [[2, 4, 6, 8, 10], [1, 3, 5, 7, 9]] (https://eval.in/158279)
<DaniG2k> that one±
<DaniG2k> !
<apeiros> short-hand for:
<DaniG2k> its freaking awesome
vpretzel has joined #ruby
<apeiros> >> (1..10).partition { |value| value.even? }
<JLT> wow that looks truly special.
<eval-in_> apeiros => [[2, 4, 6, 8, 10], [1, 3, 5, 7, 9]] (https://eval.in/158280)
<DaniG2k> yeah
<DaniG2k> i really like it
<JLT> I would have created an odd and even array, looped through the aray of numbers and performed a modulus of 2 to differentiate between even and odd.
ponga has quit [Ping timeout: 260 seconds]
<JLT> but that's just plenty more code.
Hawk555 has joined #ruby
<DaniG2k> JLT: that's not making use of Ruby's full beauty at all
<apeiros> >> (1..10).partition { |value| value % 2 == 0 } # works too, JLT
<eval-in_> apeiros => [[2, 4, 6, 8, 10], [1, 3, 5, 7, 9]] (https://eval.in/158281)
beneggett has quit [Ping timeout: 252 seconds]
mekajfire has joined #ruby
<apeiros> partition just expects a true/false return value and creates two arrays according to that
michael_lee has quit [Ping timeout: 264 seconds]
garndt has joined #ruby
thepreacher has joined #ruby
<DaniG2k> apeiros: why does it need &:even? instead of just :even?
michaelchum has joined #ruby
<DaniG2k> does & make it reference a method?
<banister> DaniG2k kind of
<JLT> Looks like & references the value?
<banister> no, it calls to_proc on :even?
Hawk555 has quit [Client Quit]
<banister> JLT DaniG2k google Symbol#to_proc
Hawk555 has joined #ruby
Xeago_ has quit [Remote host closed the connection]
wald0 has quit [Ping timeout: 265 seconds]
<JLT> bar(&:foo) = bar{|x| x.foo} from what I've seen
wald0 has joined #ruby
dilated_dinosaur has quit [Ping timeout: 252 seconds]
ponga has joined #ruby
<DaniG2k> so using a symbol is something like pointers in C ?
mercwithamouth has joined #ruby
<DaniG2k> references a specific object in memory
hamakn has quit [Remote host closed the connection]
<crome> JLT: no. its equal to bar.map { |x| x.foo }
<crome> oh sorry
dangerou_ has joined #ruby
<crome> I though you meant something else
<JLT> lol
<JLT> for what I want to do.. .fetch seems to work nicely.
<JLT> mmm maybe
Takle has quit [Remote host closed the connection]
JPascal has joined #ruby
dangerousdave has quit [Ping timeout: 276 seconds]
jamto11 has joined #ruby
Kricir has quit [Remote host closed the connection]
FooBar123 has joined #ruby
troulouliou_dev has joined #ruby
<JLT> mm ok maybe not.
toastynerd has joined #ruby
<apeiros> DaniG2k, JLT: it does two things. a) it tells ruby to treat the argument as a block, b) if the argument is not a Proc already, it is converted by calling to_proc (as banister said)
paulfm has quit []
jamto11 has quit [Ping timeout: 252 seconds]
Ankhers has joined #ruby
zorak has quit [Ping timeout: 240 seconds]
<apeiros> DaniG2k: a symbol is just a type of value. like integers and strings are a type of value.
cpruitt has joined #ruby
toastynerd has quit [Ping timeout: 252 seconds]
relix has quit [Read error: Connection reset by peer]
relix has joined #ruby
djcp has joined #ruby
paulfm has joined #ruby
alem0lars has quit [Quit: Going AFK...]
NukePuppy has joined #ruby
mjsmith2 has joined #ruby
Xeago has joined #ruby
JLT has quit [Quit: leaving]
duggiefresh has joined #ruby
jprovazn has quit [Quit: Leaving]
JasmeetQA has joined #ruby
<benzrf> DaniG2k: a symbol is really just an auto-interned string
<benzrf> which is also immutable
nnu has quit [Ping timeout: 276 seconds]
JPascal has quit [Ping timeout: 246 seconds]
foooobear has quit [Quit: Computer has gone to sleep.]
razrunelord has joined #ruby
yubrew has joined #ruby
<DaniG2k> I wonder how Matz came up with this shiz
jprovazn has joined #ruby
<apeiros> I don't think he was the one who came up with it
<apeiros> afaik symbols predate ruby
KobraKao has joined #ruby
<DaniG2k> oic
<apeiros> exposing them like this to the programmer might be a novel idea, but not sure.
lxsameer has quit [Quit: Leaving]
LiohAu has joined #ruby
Takle has joined #ruby
razrunelord has quit [Ping timeout: 252 seconds]
himsin has quit [Quit: himsin]
yubrew has quit [Ping timeout: 252 seconds]
<benzrf> le
fgo has quit [Remote host closed the connection]
<banister> DaniG2k they come from lisp iirc
why_away has quit [Ping timeout: 240 seconds]
djcp has left #ruby ["WeeChat 0.4.3"]
meatherly has joined #ruby
zorak has joined #ruby
SCommette has joined #ruby
rghose1 has joined #ruby
<rghose1> can sessions be managed with onniauth?
trampi has quit [Quit: Bye]
yakko has joined #ruby
mary5030 has joined #ruby
<benzrf> rghose1: what
vpretzel is now known as vpretzel|1445
phoo1234567 has quit [Remote host closed the connection]
<rghose1> um, omniauth provides callbacks for login right? we can add server tokens to be response as well. i was wondering if there is any callback for sessions
alexju has joined #ruby
gaboesquivel has joined #ruby
<rghose1> if the rails app can check for the session
LadyRainicorn has joined #ruby
yakko_ has quit [Ping timeout: 255 seconds]
LadyRainicorn has quit [Client Quit]
frosgy has quit [Quit: Leaving]
yfeldblum has joined #ruby
alem0lars has joined #ruby
ehc has joined #ruby
<Hanmac> rghose1: wouldnt #rubyonrails a better channel for that?
newUser1_ has quit [Remote host closed the connection]
<gaboesquivel> hi I usually write JS and I'm stuck with attributes[:attribute] --> undefined method .... how can I get nil instead of error ?
<apeiros> gaboesquivel: attributes itself is already nil?
orthos has quit [Quit: orthos]
<apeiros> if so: attributes && attributes[:attribute]
yfeldblum has quit [Ping timeout: 240 seconds]
snath has quit [Ping timeout: 276 seconds]
phoo1234567 has joined #ruby
nnu has joined #ruby
tjr9898_ has quit [Remote host closed the connection]
alem0lars has quit [Client Quit]
yacks has joined #ruby
kevind has joined #ruby
tjr9898_ has joined #ruby
Zenigor has joined #ruby
robertodecurnex has joined #ruby
<banister> apeiros do u like #try
mikesplain has joined #ruby
<gaboesquivel> apeiros
<gaboesquivel> this is how it looks like https://gist.github.com/gaboesquivel/29250eb034487f9ff0e8
<apeiros> banister: I use it, but I don't like it. I'd prefer a syntax-level construct.
<apeiros> (which has been suggested repeatedly, but got rejected)
shevy has joined #ruby
paulfm has quit []
nagger is now known as katlogic
<gaboesquivel> so that seems to me a regular array, but still get method undefined not nil if the attribute does not exist
<apeiros> banister: haven't seen it. but we use similar constructs here. sounds like another variant of the null-pattern
freerobby has joined #ruby
<apeiros> gaboesquivel: you should figure out why your group array contains nil values
<apeiros> assuming that's really where your error happens
<banister> apeiros kinda yap
<gaboesquivel> I'm ok with nil
<gaboesquivel> I just want to avoid the error
paulfm has joined #ruby
<gaboesquivel> attribute[:attr] || nil
<gaboesquivel> dunno
<apeiros> I translate that as "I'm fine not having a clue what happens"
<apeiros> yeah, that won't work if `attribute[:attr]` already raises.
Megtastique has joined #ruby
<gaboesquivel> I'm fetching from external api with active resource
<gaboesquivel> then saving to my db
<apeiros> and it's a bad idea anyway since you use it in a find_or_create
<gaboesquivel> but the external api already has nil
<apeiros> sounds awesome to find_or_create items with a nil id.
<apeiros> seriously, take a step back and think.
Kricir has joined #ruby
<gaboesquivel> the id is correct
<gaboesquivel> is an optional attr
sinkensabe has quit [Remote host closed the connection]
jobewan has joined #ruby
<gaboesquivel> that CAN BE nil
<apeiros> then you dont get the error you claim to get.
mikesplain has quit [Ping timeout: 252 seconds]
<apeiros> and/or doesn't happen where you said it would happen.
sinkensabe has joined #ruby
<gaboesquivel> did you read the gist ?
<gaboesquivel> it is the attribute[:other]
<apeiros> did you learn ruby?
OffTheRails has quit [Ping timeout: 240 seconds]
<DaniG2k> wow i joined the Python channel after not having entered it for years
<apeiros> if attribute[:id] doesn't raise a no method error, then neither will attribute[:whatever]
hamakn has joined #ruby
<DaniG2k> just by the title it sounds like that channel is populated by a ton of morons
<DaniG2k> NO LOL | NO EULER
<gaboesquivel> nope, I'm learning that's what I'm here asking for help
oo_ has quit [Remote host closed the connection]
<DaniG2k> pretentious people
pwh has quit []
JasmeetQA has quit [Ping timeout: 255 seconds]
JasmeetQA has joined #ruby
<gaboesquivel> missing javascript undefined ... :(
HashNuke has joined #ruby
FooBar123 has quit [Read error: Connection reset by peer]
<tobiasvl> javascript?
maximski has quit []
DouweM has quit [Quit: Leaving...]
<apeiros> javascript's undefined won't let you call methods on it either
sinkensabe has quit [Ping timeout: 252 seconds]
<apeiros> anyway, I think you do not have the error you said you had. it doesn't fit with the rest of the picture.
mikesplain has joined #ruby
<ari-_-e> DaniG2k: your off-the-cuff judgment sounds like the most reasoned and considered opinion I have ever heard
robert_ has joined #ruby
robert_ has joined #ruby
robert_ has quit [Changing host]
hakunin_ has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
vpretzel_ has joined #ruby
GeorgesLeYeti has joined #ruby
<GeorgesLeYeti> Hi
jamto11 has joined #ruby
robert_ has quit [Max SendQ exceeded]
lmickh has joined #ruby
robert_ has joined #ruby
<gaboesquivel> Is possible do this with ruby ? http://screencast.com/t/Rq0VEBIS
<GeorgesLeYeti> I want make a script to convert a srt to webvtt and there is only 1 big difference between theses 2 format.
<ari-_-e> DaniG2k: you say literally ONE message before leaving
<ari-_-e> *saw
<GeorgesLeYeti> I need to convert every sentence like 00:00:00,000 to 00:00:00.000
vpretzel|1445 has quit [Ping timeout: 240 seconds]
<GeorgesLeYeti> the coma is replaced by a point
Kotov has joined #ruby
failshell has joined #ruby
rayners has joined #ruby
sigurding has quit [Quit: sigurding]
end_guy has quit [Ping timeout: 272 seconds]
Boohbah has quit [Ping timeout: 272 seconds]
jonny_buu has joined #ruby
endash has joined #ruby
dmst has joined #ruby
Boohbah has joined #ruby
<ari-_-e> gaboesquivel: yes, that is possible - you would use a Hash for that
<shevy> DaniG2k did they finally overcome the python2 to python3 transition?
Kotov has quit [Killed (idoru (Spam is off topic on freenode.))]
dmst has quit []
SCommette has quit [Quit: SCommette]
tagrudev has quit [Remote host closed the connection]
TorpedoSkyline has joined #ruby
<gaboesquivel> alright thanks
dmst has joined #ruby
newUser1234 has joined #ruby
Arkaniad has quit [Ping timeout: 264 seconds]
Shidash has joined #ruby
r_rios has joined #ruby
end_guy has joined #ruby
lw has joined #ruby
tessi is now known as tessi_zz
badhatter has quit [Ping timeout: 264 seconds]
zenojis has quit [Ping timeout: 240 seconds]
tessi_zz is now known as tessi
<ari-_-e> gaboesquivel: but it should be noted that Javascript's behavior is decidedly less than ideal in this case - unless explicitly told to, languages should throw errors when trying to access something which doesn't exist
<ari-_-e> unfortunately instance variables work this way in ruby, but oh well
amargherio has joined #ruby
sinkensabe has joined #ruby
sailias has joined #ruby
badhatter has joined #ruby
badhatter has quit [Changing host]
badhatter has joined #ruby
fauzanqadri has joined #ruby
mjsmith2 has quit [Remote host closed the connection]
<ari-_-e> (as in they do not throw errors when accessing a nonexistent one)
<apeiros> ari-_-e: indeed an IMO regrettable choice.
zenojis has joined #ruby
Lucky__ has joined #ruby
ffranz has joined #ruby
enebo has joined #ruby
fgo has joined #ruby
<apeiros> banister: I also do like swifts idea of requiring nullable variables to be declared as such (I think I have seen this before swift too, though, but can't remember where)
<gaboesquivel> ari-_-e I'm fetching data from an external API with ActiveResource, that's the object type
<gaboesquivel> then trying to save data or update my db
<gaboesquivel> but one attr is null
<gaboesquivel> and I get that error, it is acceptable to be nil in my db
toastynerd has joined #ruby
jmurray has joined #ruby
<ari-_-e> gaboesquivel: it sounds like the attribute doesn't exist at all
claymore has quit [Ping timeout: 240 seconds]
fgo_ has joined #ruby
yubrew has joined #ruby
<gaboesquivel> thanks, I'll double check then
claymore has joined #ruby
gorpon has joined #ruby
<ari-_-e> if attribute[:whatever] throws an error, :whatever does not exist in that object
blassin has joined #ruby
<blassin> hello
<blassin> need some help handling bytes
<blassin> I now load a file with IO#binread
<blassin> and that gets me a lot of \xNN entries in an array
fgo has quit [Ping timeout: 240 seconds]
<blassin> how can I write a value in the array in the same form?
lw has quit [Ping timeout: 276 seconds]
apeiros has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
IceDragon has joined #ruby
<jxf> blassin: there is a corresponding method, IO.binwrite
apeiros has joined #ruby
anaeem1 has joined #ruby
<jxf> blassin: or do you mean that you just want to modify the array, not the file?
<blassin> just the array, yes
<blassin> it’s for an emulator project
toastynerd has quit [Ping timeout: 265 seconds]
fgo_ has quit [Ping timeout: 252 seconds]
<blassin> just want to be able to “write” to memory addresses and maintain their format
beneggett has joined #ruby
jprovazn has quit [Quit: Leaving]
<ari-_-e> \xNN is just the string literal syntax for a byte value...
subraminion has quit [Quit: Lingo - http://lingoirc.com]
SBoolean has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
jprovazn has joined #ruby
<jxf> blassin: "\xY" just means "a byte with the value Y", rather than the string "Y", so you could just insert Y at that position
lw has joined #ruby
<jxf> e.g. instead of \x50, write 50
<blassin> hmm ok
<blassin> so, 50 or \x50 is the same thing?
<ari-_-e> no
<shevy> >> \x50
<eval-in_> shevy => /tmp/execpad-a91c0e5ec08b/source-a91c0e5ec08b:2: syntax error, unexpected $undefined ... (https://eval.in/158305)
<shevy> >> "\x50"
<eval-in_> shevy => "P" (https://eval.in/158306)
paulfm has quit []
<blassin> ok, but for example “\x0f” gives me “\u000F”
<ari-_-e> blassin: do you want the integer values of the characters in the string?
Takle has quit [Remote host closed the connection]
jprovazn has quit [Client Quit]
IceDragon has quit [Ping timeout: 264 seconds]
claymore has quit [Ping timeout: 252 seconds]
<blassin> I want the byte values in the file - not sure what is the best way to do it
IceDragon has joined #ruby
<ari-_-e> blassin: there's String#codepoints
razrunelord has joined #ruby
<blassin> basically, the file is a program for an 80s architecture
apeiros has quit [Ping timeout: 264 seconds]
noop has quit [Ping timeout: 264 seconds]
<blassin> and it’s made up of consecutive bytes
<blassin> (like all files, sure)
<blassin> but I want to be able to write bytes back to it
banisterone has quit [Read error: Connection reset by peer]
_justin has joined #ruby
<blassin> and if I change [\x0f, \x11, \xc9] to [\x0f, 11, \xc9]
<blassin> it becomes corrupted
<blassin> am I making sense?
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ari-_-e> blassin: how do you get [\x0f, \x11, \xc9] ?
sinkensabe has quit [Remote host closed the connection]
<blassin> IO.binread-ing the file
claymore has joined #ruby
sinkensabe has joined #ruby
<jxf> blassin: "11" is a decimal value
<blassin> just an example
<ari-_-e> blassin: no, how do get this: "[\x0f, \x11, \xc9]" specifically
<blassin> excerpt: "\x05\x02\x00\x01,\x04,\x05\x1E\xEF\x01\n\r\xD4\x18 \x00\x10000210\x00B<\\\\\xCA\x00”
<ari-_-e> because that doesn't really make sense
<blassin> (yeah, sorry)
<ari-_-e> ok, that's not an array
<ari-_-e> that's a string
<blassin> yes, #binread returns a string
robertodecurnex is now known as r
<blassin> I’d like it to be an Array of byte values
bean has joined #ruby
Takle has joined #ruby
r is now known as Guest92028
sinkensabe has quit [Read error: Connection reset by peer]
<ari-_-e> blassin: there's #bytes or #codepoints - both should do the same thing in this case, but #bytes might be better
kaspergrubbe has quit [Ping timeout: 240 seconds]
<blassin> IO#binread(file…).bytes ?
sinkensabe has joined #ruby
<ari-_-e> yes
<blassin> will try that
paulfm has joined #ruby
Guest92028 is now known as robertoeduardode
<blassin> that gives me an array of numbers from 0-255
<ari-_-e> yes?
eka has joined #ruby
robertoeduardode is now known as redg
<jxf> blassin: that's what you wanted, right?
<blassin> so I can binwrite that array back, right?
lw has quit [Ping timeout: 240 seconds]
<blassin> to the same file?
razrunelord has quit [Ping timeout: 264 seconds]
<ari-_-e> looks like binwrite takes a string
TorpedoSkyline has joined #ruby
<blassin> write takes a string too
<blassin> is there a way to do a byte dump?
<blassin> maybe Marshal?
<jxf> use .pack('C*')
<blassin> cool!
<blassin> that is not very intuitive, or is it me>
<jxf> >> str = [67, 97, 102, 195, 169].pack('C*'); str.force_encoding('utf-8')
<eval-in_> jxf => "Café" (https://eval.in/158307)
<ari-_-e> I mean, you could modify the string in place too - you'll just need to do everything with strings
<blassin> since I need to do byte addresses, an array seems more useful
<jxf> blassin: the pack directives are pretty well documented: http://www.ruby-doc.org/core-2.1.2/Array.html#method-i-pack
JasmeetQA has quit [Ping timeout: 252 seconds]
<blassin> yeah, but they kinda suck :/ they feel arbitrary
yfeldblum has joined #ruby
<jxf> blassin: I agree that it's not intuitive, though -- you'd have to read the docs to know what to do
lw has joined #ruby
nateberkopec has joined #ruby
<benzrf> pack is from C isn't it
<blassin> thanks, guys! for all your help
lw has quit [Max SendQ exceeded]
<ari-_-e> benzrf: don't think so
trhodes- has quit [Ping timeout: 264 seconds]
<blassin> I think I can proceed now :D
_justin has quit [Quit: _justin]
blassin has left #ruby [#ruby]
blassin has joined #ruby
lw has joined #ruby
<ari-_-e> benzrf: probably perl or something
SCommette has joined #ruby
TorpedoSkyline has quit [Client Quit]
<jxf> benzrf: I'm pretty sure it's Perl, C doesn't have anything like #pack
<jxf> there's a pack pragma but that's for struct packing
<ari-_-e> it wouldn't really make sense in C, because C doesn't really have strings as such
<ari-_-e> there's no string type, anyway
<jxf> yeah, here's the docs on Perl's pack -- they're almost identical
sylver has quit [Ping timeout: 252 seconds]
TorpedoSkyline has joined #ruby
<jxf> speaking of stuff that Ruby should take from other languages... would love to get pattern matching in Ruby 3 someday :)
SCommette has quit [Client Quit]
<jxf> especially since it's 50 years old at this point
gorpon has quit [Ping timeout: 276 seconds]
Xeago has quit [Remote host closed the connection]
Macaveli has quit [Ping timeout: 252 seconds]
sdwrage has joined #ruby
trhodes_ has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
Xeago has joined #ruby
<benzrf> i knew perl had ItSANgo_
<benzrf> *iot
<benzrf> **it
<benzrf> i kind assumed perl got it from c or somethin
ixti has joined #ruby
CJNE is now known as CJNE|away
crazed- has joined #ruby
Sawbones has joined #ruby
JasmeetQA has joined #ruby
crazed- has quit [Remote host closed the connection]
SCommette has joined #ruby
crazed- has joined #ruby
anarang has quit [Quit: Leaving]
oo_ has joined #ruby
Arkaniad has joined #ruby
GriffinHeart has joined #ruby
Zenigor has quit [Remote host closed the connection]
mijicd has joined #ruby
tjr9898_ has quit [Remote host closed the connection]
gregf has quit [Quit: WeeChat 0.4.3]
crazedpsyc has quit [Quit: ZNC - http://znc.in]
crazed- is now known as crazedpsyc
mijicd has quit [Client Quit]
troulouliou_dev has joined #ruby
mijicd has joined #ruby
Zenigor has joined #ruby
acrussell has joined #ruby
acrussell has joined #ruby
feature_creep has quit [Ping timeout: 264 seconds]
stantona has joined #ruby
tjr9898_ has joined #ruby
jlast has quit [Remote host closed the connection]
GriffinHeart has quit [Ping timeout: 276 seconds]
jlast has joined #ruby
paulfm has quit []
bal has quit [Quit: bal]
tullyhansen has joined #ruby
stantona has quit [Read error: No route to host]
nvrch has quit [Ping timeout: 240 seconds]
aganov has quit [Remote host closed the connection]
stantona has joined #ruby
tanmay_ has quit [Ping timeout: 240 seconds]
kiri has quit [Quit: Leaving]
banisterone has joined #ruby
TwinkleHood has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
toastynerd has joined #ruby
nvrch has joined #ruby
paulfm has joined #ruby
rm_ has joined #ruby
rm_ has quit [Remote host closed the connection]
rm_ has joined #ruby
jlast has quit [Ping timeout: 260 seconds]
jlast has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kaspergrubbe has joined #ruby
qurve has joined #ruby
tullyhansen has quit [Quit: tullyhansen]
<qurve> What is the best way to declare a method in ruby that takes a string or a block (that is expected to return a string) as an argument? Basically I want to be able to do: my_method("Text") or my_method { "Text" }
baroquebobcat has quit [Quit: baroquebobcat]
<qurve> I'm writing a helper method to generate some HTML, in some cases the child content is simple text, in others it is more nested HTML.
<qurve> Would it just be something along the lines of: def my_method(text = nil, &block) and deciding which one takes priority?
CJNE|away has quit [Ping timeout: 240 seconds]
<qurve> (Only reason I don't like that style is because it is theoretically possible to pass both the argument and a block which is non-nonsensical)
fauzanqadri has quit [Ping timeout: 240 seconds]
dik_dak has joined #ruby
tier has quit [Remote host closed the connection]
claymore has quit [Ping timeout: 264 seconds]
lethe has quit [Remote host closed the connection]
Shidash has quit [Ping timeout: 240 seconds]
pzula has joined #ruby
jackneill has joined #ruby
zB0hs has joined #ruby
acrussell has left #ruby [#ruby]
claymore has joined #ruby
vpretzel_ is now known as vpretzel
sylver has joined #ruby
<benzrf> qurve: raise an ArgumentError if that happens
<benzrf> =)
<qurve> Yep, that's what I will do.
danshult_ has joined #ruby
<qurve> I was mostly just wondering if there was some way to declare it like def my_method(&block_or_value) ... and determine inside what was actually done, but that doesn't appear to be possible.
<benzrf> i should write a lib for annotating methods with argument checking stuff
<benzrf> does that already exist?
donnoc has joined #ruby
tier has joined #ruby
vinleod has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sputnik13 has joined #ruby
_justin has joined #ruby
fabrice31 has quit [Remote host closed the connection]
xcesariox has joined #ruby
tesuji has quit [Ping timeout: 245 seconds]
danshultz has quit [Ping timeout: 240 seconds]
sputnik13 has quit [Client Quit]
fabrice31 has joined #ruby
danman has joined #ruby
ayaz has quit [Quit: Textual IRC Client: www.textualapp.com]
sambao21 has joined #ruby
Burgestrand has quit [Quit: Burgestrand]
coderhs has quit [Ping timeout: 240 seconds]
sski has quit [Remote host closed the connection]
pzula has quit [Ping timeout: 252 seconds]
DEA7TH has joined #ruby
sski has joined #ruby
qurve has quit [Remote host closed the connection]
snath has joined #ruby
jespada has joined #ruby
fabrice31 has quit [Ping timeout: 252 seconds]
sigurding has joined #ruby
Eyes has quit [Quit: Leaving]
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
anaeem1 has quit [Read error: Connection reset by peer]
Eyes has joined #ruby
sinkensabe has quit [Remote host closed the connection]
sambao21 has quit [Client Quit]
sinkensabe has joined #ruby
tjr9898_ has quit [Remote host closed the connection]
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
anaeem1 has joined #ruby
vpretzel_ has joined #ruby
mikesplain has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tjr9898_ has joined #ruby
rm_ has quit [Ping timeout: 240 seconds]
IceDragon has quit [Ping timeout: 252 seconds]
sski has quit [Ping timeout: 264 seconds]
<shevy> wat
<shevy> come again
<shevy> type checks?
<shevy> possibly not at define-time
MatthewsFace has joined #ruby
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
segfalt has joined #ruby
sambao21 has joined #ruby
b00stfr3ak has joined #ruby
fgo has joined #ruby
sinkensabe has quit [Ping timeout: 264 seconds]
vpretzel has quit [Ping timeout: 276 seconds]
apeiros has joined #ruby
Eyes has quit [Remote host closed the connection]
IceDragon has joined #ruby
toastynerd has quit [Remote host closed the connection]
Eyes has joined #ruby
Soda has joined #ruby
_justin has quit [Quit: _justin]
sambao21 has quit [Client Quit]
Soda has quit [Remote host closed the connection]
bluOxigen has joined #ruby
fgo has quit [Ping timeout: 264 seconds]
Takle has quit [Remote host closed the connection]
dik_dak has quit [Ping timeout: 264 seconds]
creativeembassy has joined #ruby
sinkensabe has joined #ruby
stantona has quit [Remote host closed the connection]
CJNE|away has joined #ruby
sambao21 has joined #ruby
stantona has joined #ruby
treehug88 has joined #ruby
rm_ has joined #ruby
terrellt has joined #ruby
tharindu has joined #ruby
tharindu has quit [Client Quit]
vpretzel_ is now known as vpretzel
sambao21 has quit [Client Quit]
mikesplain has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
_justin has joined #ruby
stantona_ has joined #ruby
goleldar has joined #ruby
razrunelord has joined #ruby
terrell_t has joined #ruby
dANOKELOFF has quit []
iwat has joined #ruby
tylersmith has joined #ruby
stantona has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
sambao21 has joined #ruby
aspires has joined #ruby
subbyyy_ has joined #ruby
CJNE|away has quit [Ping timeout: 264 seconds]
stantona_ has quit [Remote host closed the connection]
ggangix has joined #ruby
Takle has joined #ruby
ggangix has left #ruby [#ruby]
blueOxigen has joined #ruby
terrellt has quit [Ping timeout: 240 seconds]
TorpedoSkyline has joined #ruby
bluOxigen has quit [Ping timeout: 240 seconds]
tylersmith has quit [Remote host closed the connection]
mikesplain has quit [Ping timeout: 264 seconds]
Sawbones has quit []
pwh has joined #ruby
jxf has quit [Ping timeout: 264 seconds]
terrell_t is now known as terrellt
razrunelord has quit [Ping timeout: 276 seconds]
tacos1de has quit [Ping timeout: 272 seconds]
tessi is now known as tessi_zz
yfeldblum has quit [Ping timeout: 240 seconds]
tacos1de has joined #ruby
postmodern has joined #ruby
claymore has quit [Quit: Leaving]
claymore has joined #ruby
thepreacher_ has joined #ruby
iwat has quit [Quit: iwat]
sambao21 has quit [Quit: Computer has gone to sleep.]
TorpedoSkyline has quit [Client Quit]
sinkensabe has quit [Remote host closed the connection]
mordof_work has joined #ruby
dik_dak has joined #ruby
tvw has quit []
stantona has joined #ruby
coderhs has joined #ruby
thepreacher has quit [Ping timeout: 255 seconds]
benzrf is now known as benzrf|offline
sambao21 has joined #ruby
vpretzel has quit [Ping timeout: 240 seconds]
stantona has quit [Remote host closed the connection]
stantona has joined #ruby
ziyadb has joined #ruby
GeoLeYeti has joined #ruby
stantona has quit [Read error: No route to host]
Kricir has quit [Remote host closed the connection]
maestrojed has joined #ruby
stantona has joined #ruby
rm_ has quit [Remote host closed the connection]
bluOxigen has joined #ruby
blueOxigen has quit [Ping timeout: 245 seconds]
mordof has quit [Disconnected by services]
mordof_work is now known as mordof
rm_ has joined #ruby
lmickh has quit [Read error: Connection reset by peer]
rm_ has quit [Read error: Connection reset by peer]
mordof1 has joined #ruby
mordof is now known as mordof_work
kevind_ has joined #ruby
rm_ has joined #ruby
GeorgesLeYeti has quit [Ping timeout: 252 seconds]
jhulten has joined #ruby
phantasm66 has joined #ruby
kevind_ has quit [Client Quit]
kevind has quit [Ping timeout: 260 seconds]
Megtastique has quit []
wallerdev has joined #ruby
baroquebobcat has joined #ruby
rampert has quit [Remote host closed the connection]
dumdedum has quit [Quit: foo]
paulfm has quit []
kireevco has joined #ruby
bmurt has quit []
bmurt has joined #ruby
ryanleesipes has joined #ruby
AlexRussia has quit [Ping timeout: 276 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
phansch has quit [Quit: WeeChat 0.4.3]
alem0lars has joined #ruby
paulfm has joined #ruby
Rollabunna has quit [Remote host closed the connection]
narendraj9 has quit [Quit: Connection closed for inactivity]
Slavox|AFK is now known as Slavox
varius has joined #ruby
banisterone has quit [Read error: Connection reset by peer]
lkba has quit [Ping timeout: 245 seconds]
danshultz has joined #ruby
Solnse has joined #ruby
duggiefresh has quit [Remote host closed the connection]
timfoo has quit [Ping timeout: 260 seconds]
donnoc has quit [Ping timeout: 252 seconds]
duggiefresh has joined #ruby
pietr0 has joined #ruby
apeiros has quit [Remote host closed the connection]
Kricir has joined #ruby
root_empire has quit [Quit: Ex-Chat]
Celm_ has joined #ruby
apeiros has joined #ruby
danshult_ has quit [Ping timeout: 264 seconds]
orthos has joined #ruby
Hobogrammer_ has joined #ruby
arrubin has joined #ruby
rippa has joined #ruby
lethjakman has joined #ruby
workmad3 has joined #ruby
makerop has joined #ruby
Celm__ has joined #ruby
<balazs> is the =~ operator really commutative in ruby ?
<makerop> what can I put into a set, so that when i do a .grep on it, it will always return true?
apeiros has quit [Ping timeout: 240 seconds]
duggiefresh has quit [Ping timeout: 264 seconds]
bhaak has joined #ruby
thepreacher_ has quit [Quit: Leaving]
phinfonet has joined #ruby
sailias has quit [Ping timeout: 240 seconds]
wati`` has joined #ruby
IcyDragon has joined #ruby
IceDragon has quit [Ping timeout: 252 seconds]
AlanMonger has joined #ruby
pzula has joined #ruby
<makerop> i need something, to put in there, that will return true every time, without caliing an if
Lucky__ has joined #ruby
alem0lars has quit [Quit: Going AFK...]
jonny_buu has quit [Quit: Leaving]
Celm_ has quit [Ping timeout: 240 seconds]
AlanMonger has quit [Client Quit]
<balazs> makerop: not sure what you're trying to achieve
centrx has joined #ruby
blueOxigen has joined #ruby
<balazs> isn't that like asking which string matches any regular expression ?
baroquebobcat has quit [Quit: baroquebobcat]
Slavox is now known as Slavox|AFK
<makerop> ya, I guess it is
<balazs> that's kind of a silly question, isn't it ?
creativeembassy has quit [Quit: FO SHO]
<centrx> >> require 'securerandom'; //.match(SecureRandom.hex)
<eval-in_> centrx => #<MatchData ""> (https://eval.in/158347)
<makerop> yes
bluOxigen has quit [Ping timeout: 240 seconds]
wookiehangover has quit [Ping timeout: 252 seconds]
<balazs> you can construct a regexp that cannot match anything
olivier_bK has quit [Ping timeout: 276 seconds]
<eam> balazs: howso?
LadyRainicorn has joined #ruby
wookiehangover has joined #ruby
<balazs> eam: like include multiple "end of string" symbols
<eam> two regexes can have no overlap in matches, but I'm not aware of a regular expression that matches no strings at all
jhass|off is now known as jhass
<eam> balazs: hm
Rainicorn has joined #ruby
KobraKao has quit [Remote host closed the connection]
wati`` has quit [Quit: wati``]
<eam> balazs: that's interesting, is that a peculiarity of the ruby "almost-pcre" engine?
<eam> real pcre doesn't work that way AFAIK
<Rainicorn> backt
LadyRainicorn has quit [Ping timeout: 240 seconds]
<balazs> eam: honestly I'm not an expert in that. but the original question was silly. there's no such string that matches any regexp
Xeago has quit [Ping timeout: 265 seconds]
<Rainicorn> lookbacks allow you to construct non matching expressions.
goleldar has quit [Remote host closed the connection]
<eam> balazs: totally agree: re that, but this other point you raised is curious
<eam> Rainicorn: example?
geggam has joined #ruby
<eam> balazs: I have a list of differences between pcre and ruby RE, they tend to bite me a lot
<eam> not well documented, as pcre is somewhat implementation defined
binaryhat has joined #ruby
DaniG2k has quit [Quit: leaving]
rm_ has quit [Remote host closed the connection]
<eam> I'm wondering if /$foo$/ not matching "$foo" is a bug
<balazs> eam: I'm coming from perl, so excuse if this is not a proper ruby regexp, but /^(a)\1b$/ will never match
toastynerd has joined #ruby
rm__ has joined #ruby
<balazs> nm
baroquebobcat has joined #ruby
<balazs> that was a brainfart
sambao21 has joined #ruby
jxf has joined #ruby
fgo has joined #ruby
<Rainicorn> >> /a(?<=b)/ =~ 'ab'
<eval-in_> Rainicorn => nil (https://eval.in/158361)
<Rainicorn> ^@eam
tier has quit [Ping timeout: 240 seconds]
rm__ has quit [Ping timeout: 264 seconds]
sdwrage has quit [Quit: Leaving]
AlexRussia has joined #ruby
Rainicorn is now known as LadyRainicorn
jimbow has joined #ruby
_tpavel has quit [Quit: Leaving]
sheperson has joined #ruby
<jimbow> would it be accurate to say that a method is a little program that performs a specific function and a library is a collection of different programs?
<LadyRainicorn> eam: /\$foo$/
<LadyRainicorn> jimbow: No.
<jimbow> why not?
nvrch has quit [Quit: nvrch]
Vivekananda has joined #ruby
frem_ has joined #ruby
yfeldblum has joined #ruby
kaspergr_ has joined #ruby
<eam> LadyRainicorn: great example, thanks
<LadyRainicorn> Independent programs don't generally share state (with exceptions).
mikesplain has joined #ruby
benzrf|offline is now known as benzrf
fgo has quit [Ping timeout: 245 seconds]
<eam> LadyRainicorn: re: /\$foo$/ -- that's different than PCRE
<eam> that's why I wonder if it's a bug
<LadyRainicorn> oh huh
tectonic has joined #ruby
sylver has quit [Ping timeout: 264 seconds]
<LadyRainicorn> I doubt it, /$foo$/ does match things.
Takle has quit [Ping timeout: 255 seconds]
maximski has joined #ruby
<LadyRainicorn> >> /$foo$/ =~ "\nfoo\n"
<eval-in_> LadyRainicorn => nil (https://eval.in/158362)
<eam> maybe this is because $ has different semantics in ruby re? I think it only matches lines rather than end of strings or something like that?
<LadyRainicorn> huhhh
tkuchiki has quit [Remote host closed the connection]
<eam> but I'm not sure /$foo$/ can match anything
kaspergrubbe has quit [Ping timeout: 255 seconds]
<LadyRainicorn> >> /$foo$/ =~ "x\nfoo\n"
<eval-in_> LadyRainicorn => nil (https://eval.in/158364)
<LadyRainicorn> That is odd.
<eam> in perl, /$foo$/ matches '$foo'
oo_ has quit [Remote host closed the connection]
<jhass> >> /$foo$/ =~ "x\n$foo\n"
<eval-in_> jhass => nil (https://eval.in/158365)
<jhass> hm
<jimbow> so what's the difference between using a library for io and writing the same io from scratch?
<LadyRainicorn> >> /x$y/ =~ "x\ny"
<eval-in_> LadyRainicorn => nil (https://eval.in/158366)
joelteon has quit [Disconnected by services]
<LadyRainicorn> huhwtf?
joelteon has joined #ruby
wldcordeiro has joined #ruby
troyready has joined #ruby
hgl has quit [Ping timeout: 264 seconds]
joelteon has quit [Remote host closed the connection]
<jhass> >> /$foo$/m =~ "x\n$foo\n"
<eval-in_> jhass => nil (https://eval.in/158367)
<LadyRainicorn> >> /x$y/ =~ "x\r\ny"
<eval-in_> LadyRainicorn => nil (https://eval.in/158368)
<jhass> okay, I give up :P
CJNE|away has joined #ruby
<balazs> /a^/ matches nothing, right
<LadyRainicorn> ok wtf is going on?
<LadyRainicorn> Did behaviour change?
<eam> weird, right?
<benzrf> balazs: no
coreypurcell_ has joined #ruby
duggiefresh has joined #ruby
<benzrf> > "wtf\na" =~ /a^/
<benzrf> >> "wtf\na" =~ /a^/
<eval-in_> benzrf => nil (https://eval.in/158372)
<benzrf> o wait
jimbow has quit [Quit: jimbow]
<benzrf> balazs: nvm >.<
<LadyRainicorn> balazs: Well it used to match "a\n"
<benzrf> >> "wtf\na" =~ /\n^/
<eval-in_> benzrf => 3 (https://eval.in/158373)
deric_skibotn has joined #ruby
<LadyRainicorn> ok wut
<LadyRainicorn> Why is $ not matching newline anymore
<LadyRainicorn> ?
b00stfr3ak has quit [Ping timeout: 240 seconds]
<LadyRainicorn> ohhh
<LadyRainicorn> huh
troulouliou_dev has quit [Quit: Leaving]
jlast has quit [Remote host closed the connection]
<LadyRainicorn> This is a change right?
jlast has joined #ruby
<jhass> 19>> /x$y/ =~ "x\ny"
<eval-in_> jhass => nil (https://eval.in/158374)
TorpedoSkyline has joined #ruby
<jhass> 19>> /x$y/m =~ "x\ny"
<eval-in_> jhass => nil (https://eval.in/158375)
chipotle has joined #ruby
<jhass> doesn't seem so, hmm
razrunelord has joined #ruby
b00stfr3ak has joined #ruby
<LadyRainicorn> so all of our concerns about $ matching in the middle of strings were unfounded?
mikecmpbll has quit [Ping timeout: 252 seconds]
Slavox|AFK is now known as Slavox
<jhass> no
<LadyRainicorn> I mean I never actually checked, but did everyone else also?
jlast_ has joined #ruby
CJNE|away has quit [Ping timeout: 245 seconds]
datafirm has joined #ruby
<jhass> >> /^ab$/ =~ "ef\nab\ngh"
jlast has quit [Read error: Connection reset by peer]
duggiefresh has quit [Ping timeout: 252 seconds]
banisterone has joined #ruby
<jhass> heh
lethe has joined #ruby
razrunelord has quit [Remote host closed the connection]
<jhass> >> /^ab$/ =~ "ef\nab\ngh"
<eval-in_> jhass => 3 (https://eval.in/158376)
apeiros has joined #ruby
mercerist has quit [Quit: Computer has gone to sleep.]
razrunelord has joined #ruby
razrunelord has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
mupkoo has quit [Remote host closed the connection]
blassin has quit [Quit: blassin]
datafirm has quit [Remote host closed the connection]
mupkoo has joined #ruby
Azulinho has quit [Ping timeout: 265 seconds]
datafirm has joined #ruby
dymv has joined #ruby
<jhass> it does match \n, but only at the end of match apparently
supa_ has joined #ruby
nateberkopec has joined #ruby
wallerdev has quit [Quit: wallerdev]
<LadyRainicorn> so that is odd
GriffinHeart has joined #ruby
<LadyRainicorn> >> /x$/ =~ "x\ny"
djbkd has joined #ruby
<eval-in_> LadyRainicorn => 0 (https://eval.in/158377)
omosoj has joined #ruby
benzrf is now known as benzrf|offline
<LadyRainicorn> That sounds like a bug then.
<eam> >> /$$/ =~ "\n\n"
<eval-in_> eam => 0 (https://eval.in/158378)
<eam> LadyRainicorn: agreed
<eam> >> /$a$/ =~ "\na\n"
<eval-in_> eam => nil (https://eval.in/158379)
<LadyRainicorn> yeah that
<LadyRainicorn> doesn't make sense.
<eam> IMO, should have PCRE semantics
kaspergr_ has quit [Remote host closed the connection]
<LadyRainicorn> Well $ makes sense anywhere really.
kaspergrubbe has joined #ruby
lethe has quit [Ping timeout: 255 seconds]
Takle has joined #ruby
shiggity_ has joined #ruby
Takle has quit [Read error: Connection reset by peer]
Takle has joined #ruby
omosoj has quit [Client Quit]
mupkoo has quit [Ping timeout: 260 seconds]
GriffinHeart has quit [Ping timeout: 260 seconds]
yfeldblum has quit [Remote host closed the connection]
alem0lars has joined #ruby
<eam> I just wish I didn't have to keep a list of subtle differences :)
<eam> always tempted to load up pcre bindings in ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
aspires has quit []
sambao21 has quit [Quit: Computer has gone to sleep.]
Xeago has joined #ruby
stantona has quit [Remote host closed the connection]
benzrf|offline is now known as benzrf
stantona has joined #ruby
trampi has joined #ruby
danshultz has quit [Remote host closed the connection]
danshultz has joined #ruby
pzula has quit [Ping timeout: 245 seconds]
<trampi> what is the easiest way to convert { a => b, c => d } to [{"name" => a, "other" => b}, { "name" => c, "other" => d}]?
aspires has joined #ruby
redondos has quit [Excess Flood]
aspiers_ has quit [Ping timeout: 276 seconds]
<benzrf> trampi: hash.map
elaptics is now known as elaptics`away
<wldcordeiro> If you're calling super can you pass in the method that you want to call like say super(create)
<wldcordeiro> Or does the keyword only work with the method of the same name?
<centrx> wldcordeiro, If you want to a call method, just call "create"
kilk__ has joined #ruby
<centrx> wldcordeiro, super is for calling the same method in the parent in the inheritance chain
<wldcordeiro> I'm trying to call a method of the same name.
redondos has joined #ruby
redondos has joined #ruby
redondos has quit [Changing host]
stantona has quit [Ping timeout: 252 seconds]
<jhass> then just super or super() if your override takes arguments but the parent doesn't
<trampi> benzrf: thanks. have not seen map on a hash on ruby-doc.org.
paulfm has quit []
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
sigurding has quit [Quit: sigurding]
danshultz has quit [Ping timeout: 245 seconds]
aneong has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
shredding has quit [Ping timeout: 240 seconds]
_justin has quit [Quit: _justin]
JasmeetQA has quit [Ping timeout: 264 seconds]
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_justin has joined #ruby
paulfm has joined #ruby
noob101 has quit [Ping timeout: 240 seconds]
sigurding has joined #ruby
rghose1 has quit [Ping timeout: 255 seconds]
<wldcordeiro> Here's what I'm trying to do jhass
maestrojed has joined #ruby
pzula has joined #ruby
<jhass> I don't understand at all what that should be doing
<wldcordeiro> Basically there's some repetitive code where I'm checking for some value and if it's there I want to call the super method
duggiefresh has joined #ruby
<jhass> use define_method
phlx has joined #ruby
phlx is now known as the_f0ster
treehug8_ has joined #ruby
<jhass> [:a, :b, :c].each do |method_name| define_method(method_name) {|param| super if param }; end is what I'd try, no idea if it actually works
wallerdev has joined #ruby
sinkensabe has joined #ruby
Takle has quit [Remote host closed the connection]
klaut has quit [Remote host closed the connection]
duggiefresh has quit [Client Quit]
GeoLeYeti is now known as GeorgesLeYeti
tectonic has quit []
treehug88 has quit [Ping timeout: 240 seconds]
tier has joined #ruby
treehug88 has joined #ruby
sailias has joined #ruby
tvw has joined #ruby
phansch has joined #ruby
krandi has quit [Remote host closed the connection]
treehug8_ has quit [Ping timeout: 252 seconds]
pwh has quit []
dhaivat has joined #ruby
Takle has joined #ruby
tier has quit [Ping timeout: 240 seconds]
jhulten has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
dik_dak has quit [Quit: Leaving]
tier has joined #ruby
tvw has quit []
pzula has quit [Ping timeout: 252 seconds]
saarinen has joined #ruby
momomomomo has joined #ruby
milkohol has joined #ruby
yakko has quit [Read error: Connection reset by peer]
dmst has quit []
sputnik13 has joined #ruby
sptx00 has joined #ruby
yakko has joined #ruby
jhulten has joined #ruby
Xeago has quit [Ping timeout: 276 seconds]
sputnik13 has quit [Client Quit]
Spami has joined #ruby
m8 has joined #ruby
sinkensabe has quit [Remote host closed the connection]
Gil has joined #ruby
mattstratton has joined #ruby
cdelo has joined #ruby
milkohol has quit [Client Quit]
sylver has joined #ruby
milkohol has joined #ruby
mattstratton has quit [Client Quit]
mattstratton has joined #ruby
alvaro_o has joined #ruby
nanoyak has joined #ruby
NinoScript has quit [Ping timeout: 255 seconds]
vpretzel has joined #ruby
stantona has joined #ruby
momomomomo has quit [Quit: momomomomo]
sheperson has quit [Ping timeout: 245 seconds]
james_d_h has joined #ruby
Zai00 has quit [Quit: Zai00]
<shevy> hmm
andrewjanssen has joined #ruby
<shevy> is there a simple way to re-attach a method from a .rb file (which has only this method and nothing else) to arbitrary namespace?
chipotle has quit [Quit: cya]
nanoyak has quit [Client Quit]
<shevy> my current workaround is to define it in a module, that has the same name as that method
coreypurcell_ has left #ruby [#ruby]
mengu has quit [Remote host closed the connection]
<shevy> so: module Foobar; def foobar
banjara has joined #ruby
<shevy> I'd love to be able to omit the module namespace and freely re-attach that method at runtime to any other module or class
GeorgesLeYeti has quit [Ping timeout: 264 seconds]
einarj has quit [Remote host closed the connection]
sheperson has joined #ruby
mehlah has quit [Quit: Leaving...]
alem0lars has quit [Quit: Going AFK...]
sylver has quit [Ping timeout: 276 seconds]
aneong has left #ruby [#ruby]
mocfive has joined #ruby
newUser1234 has quit [Ping timeout: 255 seconds]
brunops has joined #ruby
danshultz has joined #ruby
tectonic has joined #ruby
timfoo has joined #ruby
NinoScript has joined #ruby
djbkd has quit [Remote host closed the connection]
meatherly has quit []
SCommette has quit [Quit: SCommette]
Takle has quit [Remote host closed the connection]
go|dfish has quit [Ping timeout: 260 seconds]
tylersmith has joined #ruby
rm_ has joined #ruby
mikecmpbll has joined #ruby
carraroj has joined #ruby
fayimora has quit [Quit: Connection closed for inactivity]
dhaivat has quit [Quit: dhaivat]
go|dfish has joined #ruby
dhaivat has joined #ruby
b00stfr3ak has quit [Read error: Connection reset by peer]
cj____ has joined #ruby
nanoyak has joined #ruby
mehlah has joined #ruby
<the_f0ster> ruby is pass by value right? (even though the value is a reference to a copied obj?)
<jhass> no
cj____ has quit [Client Quit]
<centrx> "pass by value where the value is a reference" is the same as "pass by reference"
djbkd has joined #ruby
<centrx> or perhaps it is meaningless
aspires has quit []
aspires has joined #ruby
dhaivat has quit [Client Quit]
phantasm66 has quit [Quit: *poof*]
creativeembassy has joined #ruby
<the_f0ster> centrx: well not if it is a copy, then its still pass by value
<jhass> it's not
<jhass> the answer is just no
<the_f0ster> that's what I read.. it's pass by value but the value is a reference to a different object?
<jhass> it's pass by reference. period
<centrx> passed objects are not copied
<the_f0ster> unless it is referencing the actual original object, and not a copy
<the_f0ster> okay
mary5030_ has joined #ruby
b00stfr3ak has joined #ruby
<Sou|cutter> shevy: I don't understand - a method outside a namespace is still defined on Object right?
mupkoo has joined #ruby
i_s has joined #ruby
pzula has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CJNE|away has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
yfeldblum has joined #ruby
testcore has joined #ruby
rm_ has quit [Remote host closed the connection]
mupkoo has quit [Remote host closed the connection]
danshultz has quit [Read error: Connection reset by peer]
rm_ has joined #ruby
sambao21 has joined #ruby
mupkoo has joined #ruby
mary5030_ has quit [Remote host closed the connection]
danshultz has joined #ruby
mrsolo has joined #ruby
rdark has quit [Quit: leaving]
mary5030 has joined #ruby
akonny has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
CJNE|away has quit [Ping timeout: 245 seconds]
<wallerdev> that feel when you forget to --no-ri --no-rdoc
mikecmpbll has joined #ruby
sambao21 has quit [Client Quit]
benzrf is now known as benzrf|offline
sigurding has quit [Read error: Connection reset by peer]
sigurding has joined #ruby
rm_ has quit [Ping timeout: 252 seconds]
mupkoo has quit [Ping timeout: 240 seconds]
mengu has joined #ruby
Takle has joined #ruby
alem0lars has joined #ruby
supa_ has quit [Quit: leaving]
jvns has joined #ruby
roolo has quit [Quit: Leaving...]
rm_ has joined #ruby
klaas_ is now known as klaas
<jvns> is there an easy way to hack Ruby so that this code runs instead of throwing "ArgumentError: invalid date"? DateTime.strptime("0229233236", "%m%d%H%M%S")
SCommette has joined #ruby
<jvns> basically I'd like to convince Ruby that the current year is 2012
blackmesa has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
lw has quit [Ping timeout: 240 seconds]
badhatter has quit [Ping timeout: 264 seconds]
<centrx> jvns, One way would be to just add 2012 to the string and then parse it as though it had been there all along
andrewjanssen has joined #ruby
<jvns> so I can't change the code
<centrx> I am not sure what you are trying to do
aspires has quit []
<jvns> I'm working with some... legacy code
mengu__ has joined #ruby
<jvns> that I'd like to get to work without changing it
badhatter has joined #ruby
wati`` has joined #ruby
<centrx> You could monkey patch DateTime.strptime
akonny has quit [Quit: akonny]
<jvns> yes!
mengu has quit [Ping timeout: 240 seconds]
<centrx> class DateTime; def strptime; do_stuff; super; end; end
NinoScript has quit [Ping timeout: 240 seconds]
<jvns> excellent plan
<jvns> (well, terrible plan, but I'll try it)
<centrx> Monkey patch is a great plan for monkeying around
banisterone has quit [Read error: Connection reset by peer]
rm_ has quit [Ping timeout: 265 seconds]
banisterone has joined #ruby
sigurding has quit [Quit: sigurding]
coderhs has quit [Ping timeout: 265 seconds]
lw has joined #ruby
NinoScript has joined #ruby
<shevy> Sou|cutter yeah, it defaults to Object
<jvns> centrx: thanks =D
spider-mario has joined #ruby
<Sou|cutter> shevy: so you can't just pull it off of Object instead of the Module?
sambao21 has joined #ruby
<Sou|cutter> TBH I feel like it's better to attach to a module anyway, but I assume you have your reasons
cj___ has joined #ruby
aspires has joined #ruby
TorpedoSkyline has joined #ruby
combusean has joined #ruby
<shevy> hmm
<shevy> when we use method(), the resulting method will not reside in any namespace?
jottr has joined #ruby
<shevy> >> upcase = "cat".method(:upcase); upcase.class.ancestors
<eval-in_> shevy => [Method, Object, Kernel, BasicObject] (https://eval.in/158404)
<shevy> hmm
akonny has joined #ruby
<shevy> nope
<shevy> Object still seems to be a parent
Morkel has joined #ruby
AndChat|102836 has joined #ruby
sambao21 has quit [Client Quit]
kenneth has joined #ruby
kenneth has quit [Max SendQ exceeded]
<shevy> I guess a method in ruby can never be completely unbound
mupkoo has joined #ruby
kenneth has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
mengu__ has quit [Ping timeout: 252 seconds]
NinoScript has quit [Ping timeout: 252 seconds]
maestrojed has quit [Quit: Computer has gone to sleep.]
jprovazn has joined #ruby
banisterone has quit [Ping timeout: 252 seconds]
<makerop> if I have a set class, full of regex'es, is there anyway to return true if a string matches one of them?
subbyyy_ has quit [Ping timeout: 264 seconds]
<shevy> can you rebind a method at runtime to an object? like the above example of: my_method = "cat".method(:upcase)
JasmeetQA has joined #ruby
NinoScript has joined #ruby
<wallerdev> youd have to test all the regexes
Alina-malina has quit [Ping timeout: 276 seconds]
<centrx> makerop, set.any? { }
nateberkopec has quit [Quit: Leaving...]
<Sou|cutter> shevy: isn't that how partial mocks work?
<centrx> (Enumerable#any?)
<shevy> Sou|cutter partial mocks?
<Sou|cutter> shevy: when you mock a method on a real object (vs a double or whatever)
<makerop> centrx, that doest seen to work
<makerop> i keet true on all entries
<makerop> get*
<centrx> makerop, Show code
sigurding has joined #ruby
<wallerdev> lol wat
<makerop> its kind of convoluted; I have a web app, and an agent that gets config data from the web app
aspires has quit []
Rollabunna has joined #ruby
<wallerdev> * isnt even a valid regex is it
<makerop> the agent, is processing messages (10's of k's/second)
paulfm has quit []
<makerop> .* was what it should have been
<wallerdev> i think what they expected you to do was set.any? { |r| something =~ r }
<makerop> each message has a string in messdata['line']
maestrojed has joined #ruby
subbyyy_ has joined #ruby
<jhass> makerop: didn't I already tell you to use #{} two times?
fauzanqadri has joined #ruby
<Sou|cutter> shevy: I guess not quite. The binding part may be tricky
<centrx> makerop, The idea is: set.any? { |re| re.match(str) }
<makerop> jhass, ya, it works, but it's not what i need exactly
momomomomo has joined #ruby
mary5030_ has joined #ruby
sylver has joined #ruby
<jhass> why do you keep doing the thing you already experienced it won't work?
<shevy> Sou|cutter yeah, I think I never re-bound a method so far at runtime ...
paulfm has joined #ruby
<shevy> so I am a bit wondering about the practical use case of method()
stantona_ has joined #ruby
<centrx> I have not encountered one in the wild
<shevy> hehe
<shevy> I like the expression "in the wild"
CJNE|away has joined #ruby
stanton__ has joined #ruby
Rollabunna has quit [Ping timeout: 240 seconds]
makerop has left #ruby ["Leaving"]
mary5030 has quit [Ping timeout: 252 seconds]
JasmeetQA has quit [Read error: Connection reset by peer]
lkba has joined #ruby
<shevy> we even have method objects!
<shevy> hmm
<shevy> indeed
<shevy> object.method(@method_name)
stantona has quit [Ping timeout: 240 seconds]
<Sou|cutter> it's definitely used in mocking
lw has quit [Ping timeout: 252 seconds]
chipotle has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
abra has joined #ruby
wati`` has quit [Quit: wati``]
stantona_ has quit [Ping timeout: 276 seconds]
<shevy> can there be objects in ruby that won't have class Object as parent in their ancestor chain?
CJNE|away has quit [Quit: leaving]
lw has joined #ruby
subbyyy_ has quit [Ping timeout: 252 seconds]
rotor has quit [Ping timeout: 252 seconds]
moritzschaefer has joined #ruby
<jhass> yes, those that inherit directly from BasicObject
<apeiros> shevy: BasicObject
<centrx> Yeah, like "Your method is so stupid, it was unbound from its receiver and was never used again"
sigurding has quit [Ping timeout: 245 seconds]
soulcake has quit [Read error: Connection reset by peer]
WishBoy has quit [Remote host closed the connection]
benzrf|offline is now known as benzrf
<shevy> hmm
lw has quit [Max SendQ exceeded]
<shevy> the mother of all objects
soulcake has joined #ruby
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maximski has quit []
SCommette has quit [Quit: SCommette]
<centrx> Your mother method is so fat, it caused a stack overflow when we tried to unbind it.
ffranz has quit [Ping timeout: 264 seconds]
abra has quit [Client Quit]
lw has joined #ruby
brandonjmckay has joined #ruby
<shevy> it's weird that you can #unbind a class Method object; it can be rebound as then belonging to class UnboundMethod
x1337807x has joined #ruby
<shevy> and it's all rather restricted :(
<shevy> "Unbound methods can only be called after they are bound to an object. That object must be be a kind_of? the method's original class."
_justin has quit [Ping timeout: 252 seconds]
brandonjmckay has quit [Client Quit]
foooobear has joined #ruby
coderhs has joined #ruby
SCommette has joined #ruby
Celm__ has quit []
Xeago has joined #ruby
shinobi_one has joined #ruby
brandonjmckay has joined #ruby
jheg has joined #ruby
nateberkopec has joined #ruby
thumpba has joined #ruby
mijicd has quit [Remote host closed the connection]
Alina-malina has joined #ruby
aspires has joined #ruby
sigurding has joined #ruby
run_kmc has joined #ruby
run_kmc is now known as Guest33827
troyready has quit [Ping timeout: 276 seconds]
thumpba__ has quit [Ping timeout: 264 seconds]
Xeago has quit [Ping timeout: 252 seconds]
maximski has joined #ruby
katmandoo has joined #ruby
sambao21 has joined #ruby
foooobear has quit [Quit: Lingo - http://lingoirc.com]
maximski has quit [Max SendQ exceeded]
saarinen has quit [Quit: saarinen]
maximski has joined #ruby
saarinen has joined #ruby
gaboesquivel has quit [Remote host closed the connection]
Guest33827 is now known as run_kmc
jobewan has quit [Remote host closed the connection]
ffranz has joined #ruby
rotor has joined #ruby
Morkel_ has joined #ruby
klaut has joined #ruby
djbkd has quit [Remote host closed the connection]
Morkel has quit [Ping timeout: 260 seconds]
Morkel_ is now known as Morkel
redondo has quit [Ping timeout: 252 seconds]
Gil has quit [Remote host closed the connection]
jhulten has quit [Remote host closed the connection]
fgo_ has joined #ruby
obs has quit [Remote host closed the connection]
jhulten has joined #ruby
timonv has quit [Remote host closed the connection]
tjr9898_ has quit [Remote host closed the connection]
aspires has quit []
tjr9898_ has joined #ruby
razrunelord has joined #ruby
aspires has joined #ruby
klaut has quit [Ping timeout: 245 seconds]
GriffinHeart has joined #ruby
WormDrink has quit [Ping timeout: 276 seconds]
aspires has quit [Client Quit]
sinkensabe has joined #ruby
<mozzarella> guys I need help
gr33n7007h has quit [Ping timeout: 240 seconds]
fgo_ has quit [Ping timeout: 252 seconds]
troyready has joined #ruby
djbkd has joined #ruby
tjr9898__ has joined #ruby
<centrx> !help
nvmme has joined #ruby
aspires has joined #ruby
<mozzarella> yes help
<shevy> lol
<mozzarella> !ask
<shevy> !die
Gil has joined #ruby
<jhass> !jump
Gil has quit [Read error: Connection reset by peer]
<shevy> what do you need help with
<shevy> perl?
tjr9898_ has quit [Ping timeout: 252 seconds]
<jhass> php?
<mozzarella> I'm trying to install qtbindings but I get errors
Gil has joined #ruby
JokerDoomWork has joined #ruby
<shevy> aaaah
<shevy> it worked 10 years ago
brunops has quit [Ping timeout: 264 seconds]
<shevy> is that of any comfort to you?
GriffinHeart has quit [Ping timeout: 264 seconds]
Sawbones has joined #ruby
<shevy> where are you running extconf.rb anyway
<shevy> /home/sam/.rubies/ruby-2.1.1/bin/ruby extconf.rb
<shevy> what should do that
<shevy> I've never seen it run in the same directory as bin/ruby
<mozzarella> I'm installing cmake now
<shevy> cmake: command not found
nvmme has quit [Remote host closed the connection]
<shevy> don't get your hopes up
pzula has quit [Ping timeout: 240 seconds]
klaut has joined #ruby
LadyRainicorn has quit [Quit: Bye]
aspires has quit [Client Quit]
yacks has quit [Ping timeout: 255 seconds]
<shevy> it's basically a dead project
nanoyak has joined #ruby
yacks has joined #ruby
<mozzarella> nope still doesn't work
<mozzarella> how do I use Qt in ruby, then?
<shevy> yeah
<shevy> possibly by using ruby 1.8.7 and kde 3
<shevy> :-)
bluOxigen has joined #ruby
<shevy> I think there is also a project on github
<mozzarella> ;|
<mozzarella> how do you guys write GUI's? tk?
<jhass> shevy: qtbindings had a release in january, why so say it's dead?
<centrx> Shoes!
<shevy> jhass yeah, new authors
<shevy> mozzarella ruby-gnome
AlSquire has quit [Quit: This computer has gone to sleep]
<shevy> mozzarella let's test
<shevy> Anyone here using qtruby and has working code to show?
sambao21 has quit [Quit: Computer has gone to sleep.]
<mozzarella> ERROR: Could not find a valid gem 'QtRuby' (>= 0) in any repository
blueOxigen has quit [Ping timeout: 252 seconds]
tim has joined #ruby
aspires has joined #ruby
dangerou_ has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
AndChat|102836 has quit [Ping timeout: 264 seconds]
sylver has quit [Quit: leaving]
brunops has joined #ruby
tjr9898__ has quit [Remote host closed the connection]
fauzanqadri has quit [Remote host closed the connection]
flak has joined #ruby
tjr9898_ has joined #ruby
tim has left #ruby ["Leaving"]
frem_ has quit [Ping timeout: 276 seconds]
fauzanqadri has joined #ruby
spinagon has joined #ruby
Squarepy has quit [Quit: Leaving]
fauzanqadri has quit [Read error: Connection reset by peer]
WormDrink has joined #ruby
fauzanqadri has joined #ruby
tiwillia has joined #ruby
rippa has quit [Ping timeout: 264 seconds]
DrShoggoth has joined #ruby
vikfroberg has joined #ruby
<vikfroberg> Best book on TDD?
aspires has quit []
<mozzarella> who needs testing
flak has quit [Ping timeout: 260 seconds]
<centrx> >> :test
<eval-in_> centrx => :test (https://eval.in/158408)
razrunelord has quit [Remote host closed the connection]
aspires has joined #ruby
tier has quit [Remote host closed the connection]
razrunelord has joined #ruby
timgauthier has quit [Quit: Textual IRC Client: www.textualapp.com]
djbkd has quit [Remote host closed the connection]
redondo has joined #ruby
tier has joined #ruby
anything-at-all has joined #ruby
razrunelord has quit [Ping timeout: 255 seconds]
Shidash has joined #ruby
djbkd has joined #ruby
mary5030_ has quit [Remote host closed the connection]
subbyyy_ has joined #ruby
mary5030 has joined #ruby
Kricir has quit [Remote host closed the connection]
sheperson has quit [Ping timeout: 240 seconds]
maestrojed has quit [Quit: Computer has gone to sleep.]
tris has quit [Quit: Leaving]
shvelo has joined #ruby
sheperson has joined #ruby
hughlander has joined #ruby
sleepee has joined #ruby
orthos has quit [Quit: orthos]
tier has quit [Remote host closed the connection]
frem_ has joined #ruby
kirun has joined #ruby
meatherly has joined #ruby
hughlander has quit [Client Quit]
hughlander has joined #ruby
tier has joined #ruby
ffranz has quit [Quit: Leaving]
chipotle has quit [Quit: cya]
ffranz has joined #ruby
spinagon has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rippa has joined #ruby
wallerdev has quit [Ping timeout: 240 seconds]
jrhe has quit [Quit: Connection closed for inactivity]
meatherly has quit [Client Quit]
sigurding has quit [Quit: sigurding]
djbkd has quit [Remote host closed the connection]
benzrf is now known as benzrf|offline
lw has quit [Ping timeout: 264 seconds]
wallerdev has joined #ruby
echevemaster has joined #ruby
rezzack has joined #ruby
<AntelopeSalad> what's the least painful way to search for a string within a string and if it's found then return the matched string
toastynerd has quit [Remote host closed the connection]
maximski has quit []
troyready has quit [Ping timeout: 265 seconds]
<AntelopeSalad> .include? only returns a boolean and i think with .index i'd have to do some math with the length of the search term to determine when to start/stop
<centrx> str["str"]
<centrx> >> "string"["str"]
<eval-in_> centrx => "str" (https://eval.in/158409)
<AntelopeSalad> wow
maestrojed has joined #ruby
<AntelopeSalad> and that's why i ask questions, that saves so much time thanks
postmodern has quit [Ping timeout: 252 seconds]
ponga has quit []
aspires has quit []
lw has joined #ruby
trampi has quit [Quit: Page closed]
vikfroberg has quit [Quit: vikfroberg]
dhaivat has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
OffTheRails has joined #ruby
IcyDragon is now known as IceDragon
Notte has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
sinkensabe has joined #ruby
creativeembassy has quit [Quit: FO SHO]
devdazed has quit [Read error: Connection reset by peer]
<AntelopeSalad> centrx: it doesn't seem to work when i do foo[bar] and bar is a string variable , it throws a type error
mercwithamouth has quit [Ping timeout: 240 seconds]
devdazed has joined #ruby
saarinen has quit [Quit: saarinen]
Takle has quit [Remote host closed the connection]
<graft> AntelopeSalad: works for me, what's in foo?
<graft> why is that a behavior anyway?
<graft> >> x = "blah boo biggety"; y = "big"; x[y]
<eval-in_> graft => "big" (https://eval.in/158415)
sheperson has quit [Ping timeout: 265 seconds]
tier has quit [Remote host closed the connection]
<apeiros> AntelopeSalad: you've seen it working before. so clearly you do something wrong. if you want better error analysis, provide actually useful information.
sheperson has joined #ruby
<centrx> graft, It's short for String#slice
<graft> I was also shocked to find out that you can index into integers to get bit positions the other day...
fauzanqadri has quit []
<graft> >> 3[2]
<eval-in_> graft => 0 (https://eval.in/158417)
tjr9898_ has quit [Remote host closed the connection]
Takle has joined #ruby
varius has quit [Remote host closed the connection]
<apeiros> graft: still wish that would accept the same args as Array#[]
<apeiros> e.g. [-3,3] to get the 3 most significant bits
mary5030_ has joined #ruby
<AntelopeSalad> graft: a string , might be an issue elsewhere
aspires has joined #ruby
troyready has joined #ruby
stanton__ has quit [Remote host closed the connection]
<shevy> mozzarella come to ruby-gnome land man
stantona has joined #ruby
<shvelo> Ruby is love Ruby is life
mary503__ has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
creativeembassy has joined #ruby
tier has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
<shevy> \o/
<shevy> the sh-brothers are in da house
<balazs> is Array vs Enumerator in ruby the same as Array vs List in perl ?
<eam> there is no Array vs List in perl
VinDoKi has joined #ruby
chipotle has joined #ruby
postmodern has joined #ruby
<balazs> of course there is
* apeiros gets popcorn
<wallerdev> lol
<graft> in any case, no, array vs. enumerator is nothing like that
<balazs> but that's prolly offtopic here
mary5030_ has quit [Ping timeout: 276 seconds]
<graft> enumerator is a module that you can attach to any type that you can iterate over
Squarepy has joined #ruby
<graft> for example, an array
<eam> balazs: not in terms of a datatype, it's sometimes used to describe a language construct -- the ruby equivilent is splat
<eam> equivalent, even
chipotle has quit [Client Quit]
<apeiros> graft: Enumerator != Enumerable
dangerou_ has joined #ruby
<graft> oh! yeah, my bad
chipotle has joined #ruby
hughlander has quit [Quit: hughlander]
<graft> disregard, i suck cocks, etc.
<eam> a, b = b, a; ($a, $b) = ($b, $a); etc
<apeiros> poor animals, why'd you suck them? OO
<VinDoKi> dont play with ur food
coderhs has quit [Ping timeout: 252 seconds]
<VinDoKi> just eat it
fgo has joined #ruby
<graft> i'm a vegetarian
<segfalt> It's really too bad, because Qt is very nice to work with.
aspires has quit []
mary503__ has quit [Remote host closed the connection]
<graft> Qt?
dangerousdave has quit [Ping timeout: 276 seconds]
* segfalt is using IRCCloud, and sometimes it's 45 minutes behind for no reason and I respond to reallllly old messages.
mary5030 has joined #ruby
vosloco has quit [Ping timeout: 240 seconds]
orthos has joined #ruby
<wallerdev> irc is something that needs the cloud obviously
kireevco has quit [Quit: Leaving.]
<segfalt> everything is better with a little cloud, haven't you spoken to a marketing person today?
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mven has quit [Quit: Leaving]
vosloco has joined #ruby
aspires has joined #ruby
dymv has quit [Quit: Textual IRC Client: www.textualapp.com]
fgo has quit [Ping timeout: 252 seconds]
banjara has quit [Quit: Leaving.]
bfrog has joined #ruby
nvmme has joined #ruby
<bfrog> what would something like x ||= y mean
<jhass> x || x = y
timonv has joined #ruby
<bfrog> jhass: makes sense, thanks
danshultz has quit [Remote host closed the connection]
gaboesquivel has joined #ruby
danshultz has joined #ruby
<terrellt> Er, what
banjara has joined #ruby
<terrellt> Isn't it x = x || y?
sheperson has quit [Ping timeout: 240 seconds]
<jhass> no
<apeiros> bfrog: note that generally `a <op>= b` is short for `a = a <op> b`, but ||= and &&= are special cased
sheperson has joined #ruby
<apeiros> terrellt: ^
Kricir has joined #ruby
banjara has quit [Client Quit]
<jhass> || and && aren't really operands anyway
<shevy> is bgfrog short for bullfrog
<shevy> erm bfrog
<terrellt> (x || x) = 1 gives me a syntax error, like I'd expect.
<terrellt> OH
<jhass> since it's x || (x =1)
<terrellt> Ha
<terrellt> Right.
danshult_ has joined #ruby
<terrellt> Special case so that it doesn't even go through the operation of setting a value if it's set.
<jhass> which makes a lot of sense if you think about a.b ||= c
mary5030_ has joined #ruby
<jhass> that is a.b= being a method call
Sawbones has quit []
jackneill has quit [Read error: Connection reset by peer]
Takle has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 240 seconds]
danshultz has quit [Ping timeout: 240 seconds]
mary5030 has quit [Ping timeout: 255 seconds]
dhaivat has quit [Quit: dhaivat]
mary5030_ has quit [Remote host closed the connection]
<apeiros> can backfire, though:
<apeiros> >> h = Hash.new(0); h[:x] ||= 1; h
mary5030 has joined #ruby
<eval-in_> apeiros => {} (https://eval.in/158422)
<apeiros> would be {:x => 0} with the other expansion
<jhass> but then setting a hash default and doing ||= seems silly anyway
<apeiros> hey! don't question the sanity of my example!
shvelo has quit [Ping timeout: 252 seconds]
<jhass> sorry, too late
MatthewsFace has joined #ruby
<apeiros> I haven't seen it backfire, ever.
MatthewsFace has quit [Remote host closed the connection]
hughlander has joined #ruby
sheperson has quit [Quit: sheperson]
* shevy fires back!
r0ok has joined #ruby
Takle has joined #ruby
wallerdev has quit [Ping timeout: 245 seconds]
Stalkr_ has joined #ruby
Stalkr_ has quit [Changing host]
Stalkr_ has joined #ruby
coderhs has joined #ruby
razrunelord has joined #ruby
benzrf|offline is now known as benzrf
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Lutece has joined #ruby
djbkd has joined #ruby
hughlander has quit [Ping timeout: 276 seconds]
sleepee has quit [Quit: Leaving]
kaspergrubbe has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 0.4.3]
<Sou|cutter> I learned the hard way to use Hash.new { |h, k| h[k] = 0 }
<centrx> That's not necessary for Integers
saarinen has joined #ruby
pablovilas has joined #ruby
<Sou|cutter> It depends
wldcordeiro has quit [Quit: Leaving]
<Sou|cutter> honestly the important part is understanding the different hash initialization options
mercwithamouth has joined #ruby
papercode has joined #ruby
<Sou|cutter> but I'm off on a tangent
cgj_ has joined #ruby
yacks has quit [Quit: Leaving]
razrunelord has quit []
russt has joined #ruby
mupkoo has quit []
beneggett has joined #ruby
r_rios has quit [Ping timeout: 240 seconds]
wldcordeiro has joined #ruby
timonv has quit [Remote host closed the connection]
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
HashNuke has quit [Quit: Connection closed for inactivity]
datafirm_ has joined #ruby
datafirm has quit [Read error: Connection reset by peer]
aspiers_ has joined #ruby
cgj has quit [Ping timeout: 255 seconds]
beneggett has quit [Client Quit]
sinkensabe has quit [Remote host closed the connection]
luis__ has joined #ruby
decoponio has quit [Quit: Leaving...]
pablovilas has quit [Quit: Leaving]
vifino has quit [Quit: Me sais Laptop sleepy.]
luis__ is now known as KobraKao
dhaivat has joined #ruby
tectonic has quit []
TorpedoSkyline has joined #ruby
hughlander has joined #ruby
binaryhat has quit [Quit: Leaving]
sambao21 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
sinkensa_ has joined #ruby
jmurray has quit [Quit: jmurray]
baroquebobcat has quit [Quit: baroquebobcat]
jmurray has joined #ruby
JokerDoomWork has quit [Ping timeout: 240 seconds]
wallerdev has joined #ruby
sambao21 has quit [Client Quit]
wallerdev has quit [Client Quit]
wallerdev has joined #ruby
baroquebobcat has joined #ruby
Arkaniad has quit [Ping timeout: 276 seconds]
Kricir has joined #ruby
yfeldblum has quit [Remote host closed the connection]
Rollabunna has joined #ruby
sambao21 has joined #ruby
nvmme has quit [Quit: nvmme]
phutchins has quit [Ping timeout: 240 seconds]
nanoyak has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
yetanotherdave has joined #ruby
kaspergrubbe has joined #ruby
Kricir_ has joined #ruby
Kricir has quit [Ping timeout: 265 seconds]
vpretzel is now known as vpretzel|1445
Rollabunna has quit [Ping timeout: 240 seconds]
yubrew_ has joined #ruby
yfeldblum has joined #ruby
aspiers_ has quit [Ping timeout: 240 seconds]
sambao21 has quit [Ping timeout: 245 seconds]
yetanotherdave has quit [Quit: leaving]
yetanotherdave has joined #ruby
aspires has quit []
Takle has joined #ruby
x1337807x has joined #ruby
carraroj has joined #ruby
bluOxigen has quit [Ping timeout: 255 seconds]
yubrew has quit [Ping timeout: 264 seconds]
akonny has quit [Quit: akonny]
akonny has joined #ruby
yetanotherdave has quit [Client Quit]
yetanotherdave has joined #ruby
Valesk has joined #ruby
aspires has joined #ruby
toastynerd has joined #ruby
aspiers_ has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
lethe has joined #ruby
sinkensa_ has quit [Remote host closed the connection]
LnL has joined #ruby
aspires has quit [Client Quit]
kaspergrubbe has quit []
mercwithamouth has quit [Ping timeout: 240 seconds]
shiggity_ has quit [Quit: Leaving]
GriffinHeart has joined #ruby
lethe has quit [Ping timeout: 276 seconds]
KobraKao has quit [Ping timeout: 240 seconds]
GriffinHeart has quit [Ping timeout: 252 seconds]
fgo has joined #ruby
aspires has joined #ruby
gregf has joined #ruby
orthos has quit [Quit: orthos]
remery has left #ruby [#ruby]
Hawk555 has quit [Quit: Nettalk6 - www.ntalk.de]
aspires has quit [Client Quit]
fgo has quit [Ping timeout: 245 seconds]
pwh has joined #ruby
aspires has joined #ruby
<shevy> dumdedum
Wolland has joined #ruby
jmurray has quit [Quit: jmurray]
yetanotherdave has quit [Quit: Lost terminal]
paulfm has quit []
kyb3r_ has joined #ruby
Zenigor has quit [Remote host closed the connection]
anything-at-all has quit [Quit: anything-at-all]
aspires has quit []
hd1 has joined #ruby
Ankhers has quit [Remote host closed the connection]
* hd1 just fixed a compilation bug in ruby 2.1 on freebsd
danijoo_ has quit [Read error: Connection reset by peer]
<hd1> fixed in that got around and it seems to have worked
<hd1> anyone interested, pm me
danijoo has joined #ruby
hd1 has left #ruby [#ruby]
aspires has joined #ruby
Morkel has quit [Quit: Morkel]
WishBoy has joined #ruby
<shevy> show the bug here man
<shevy> you are like the last unicorn
<shevy> the last freebsd user on #ruby
<jhass> well
<jhass> he immediately left
mark_locklear has quit [Ping timeout: 240 seconds]
<shevy> lol
mehlah_ has joined #ruby
mehlah has quit [Read error: Connection reset by peer]
<shevy> what's with those shadow IRC people
alem0lars has quit [Quit: alem0lars]
TorpedoSkyline has quit [Ping timeout: 240 seconds]
LnL7 has joined #ruby
diegoviola has joined #ruby
aspires has quit [Client Quit]
Shidash has quit [Ping timeout: 252 seconds]
LnL has quit [Read error: Connection reset by peer]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TorpedoSkyline has joined #ruby
Kricir_ has quit [Remote host closed the connection]
jmurray has joined #ruby
sailias has quit [Quit: Leaving.]
aspires has joined #ruby
tectonic has joined #ruby
gaboesquivel has quit [Remote host closed the connection]
freezey has joined #ruby
SBoolean has quit [Remote host closed the connection]
jhulten has quit [Remote host closed the connection]
yetanotherdave has joined #ruby
jhulten has joined #ruby
hughlander has quit [Ping timeout: 252 seconds]
yetanotherdave has quit [Client Quit]
yetanotherdave has joined #ruby
redg has quit [Remote host closed the connection]
amargherio has quit [Write error: Broken pipe]
baroquebobcat has quit [Quit: baroquebobcat]
kireevco has joined #ruby
bmurt has quit []
freerobby has quit [Quit: Leaving.]
aspires has quit [Read error: Connection reset by peer]
zorak has quit [Ping timeout: 252 seconds]
jespada has quit [Quit: Leaving]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jprovazn has quit [Ping timeout: 252 seconds]
aspires has joined #ruby
baroquebobcat has joined #ruby
djbkd has quit [Remote host closed the connection]
zorak has joined #ruby
tier has quit []
Zai00 has joined #ruby
x1337807x has joined #ruby
relix has joined #ruby
jan1337z has quit [Quit: System is going down.]
combusean has quit [Ping timeout: 265 seconds]
creativeembassy has quit [Quit: FO SHO]
danshult_ has quit [Remote host closed the connection]
nemesit|znc has quit [Ping timeout: 252 seconds]
oz` has joined #ruby
djbkd has joined #ruby
dc has quit [Remote host closed the connection]
danshultz has joined #ruby
oz has quit [Read error: Connection reset by peer]
oz` is now known as oz
dwts has quit [Ping timeout: 252 seconds]
nevans has quit [Ping timeout: 252 seconds]
akonny has quit [Quit: akonny]
nevans has joined #ruby
KobraKao has joined #ruby
deavid has quit [Read error: Connection reset by peer]
deavid has joined #ruby
dwts has joined #ruby
MrSamuel has joined #ruby
gogiel_ has quit [Ping timeout: 240 seconds]
dblessing has quit [Quit: dblessing]
sptx00 has quit [Ping timeout: 272 seconds]
andrewjanssen has quit [Quit: Leaving...]
gogiel has joined #ruby
nemesit|znc has joined #ruby
aspires has quit []
sambao21 has joined #ruby
aspires has joined #ruby
frem_ has quit [Ping timeout: 245 seconds]
kirun has quit [Remote host closed the connection]
jonahR has joined #ruby
M-Technic is now known as Moo
Moo is now known as M-Technic
sptx00 has joined #ruby
ldnunes has quit [Quit: Leaving]
danshultz has quit [Ping timeout: 276 seconds]
St_Marx has quit [Quit: Ex-Chat]
jhulten_ has joined #ruby
andrewjanssen has joined #ruby
Zai00 has quit [Quit: Zai00]
aspires has quit [Client Quit]
thalweg has joined #ruby
mattt__ has joined #ruby
mattt__ has left #ruby [#ruby]
Sep1 has joined #ruby
St_Marx has joined #ruby
phansch has quit [Quit: WeeChat 0.4.3]
St_Marx has quit [Remote host closed the connection]
St_Marx has joined #ruby
freerobby has joined #ruby
jhulten has quit [Ping timeout: 260 seconds]
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
andrewjanssen has quit [Quit: Leaving...]
andrewjanssen has joined #ruby
cj___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dc has joined #ruby
Kaedenn1 has joined #ruby
<Kaedenn1> I'm dealing with customer support where we have a customer with a custom ruby script.
<Kaedenn1> I don't know ruby.
<Kaedenn1> The script invokes system() within a sub, within a for loop. If the system() call fails with 1, will that affect the exit status of the script? If so, how?
<ari-_-e> Kaedenn1: cool story
<Kaedenn1> The system() call is the last line in the sub.
orthos has joined #ruby
<ari-_-e> "sub"?
fgo has joined #ruby
<Kaedenn1> For NDA reasons I can't post the script anywhere.
doodlehaus has quit [Remote host closed the connection]
<Kaedenn1> Oh, sorry, a function. "def foo() end" thing. I'm mixing my terms.
doodlehaus has joined #ruby
<ari-_-e> no, calling system does not effect the calling processes
<ari-_-e> proces
<ari-_-e> process
dc has quit [Remote host closed the connection]
<ari-_-e> grr
alexju has quit [Remote host closed the connection]
<yxhuvud> well, depends on if the calling process actually look for how it went
<Kaedenn1> Okay. Without an explicit statement to terminate the program with an error code (i.e. "exit()" or so), how can a script exit with 1?
<yxhuvud> it can crash
<Kaedenn1> Lastly, the wrapper that invokes the script (an in-house piece of code that just does a fork-exec in C++) ignores the stdout and stderr of the spawned process. Is there a way in ruby to reassign stdout and stderr such that puts and friends can go to a file?
yakko has quit []
<Kaedenn1> I've expressed my frustration to a co-worker about this, and apparently he has no desire to change it.
nerium has joined #ruby
soulcake has quit [Ping timeout: 260 seconds]
<segfalt> c++ wrapper around ruby, solid.
mary5030_ has joined #ruby
<nerium> Is there a way to deploy using capistrano wtihout using gitub?
<Kaedenn1> Not a wrapper around ruby; we have hooks for executing arbitrary programs before and after our process runs.
<Kaedenn1> A customer has decided to write said arbitrary program in ruby.
fgo has quit [Ping timeout: 252 seconds]
<segfalt> but yes, $stdout.reopen('filename here')
<segfalt> same with $stderr
<segfalt> Kaedenn1: ^^
<Kaedenn1> Will that affect processes spawned with system()?
Kricir has joined #ruby
doodlehaus has quit [Ping timeout: 240 seconds]
<segfalt> I want to say yes, but I'm like 90% confident.
freggles has quit [Remote host closed the connection]
<Kaedenn1> That's encouraging enough for me.
<segfalt> Kaedenn1: just tested it, it does.
<Kaedenn1> Thank you!
<segfalt> np :)
<segfalt> uh
<segfalt> unix?
<segfalt> or similar, I hope. Who knows on Windows.
<Kaedenn1> Yes. Some sort of *nix
<segfalt> ok
<segfalt> :)
baroquebobcat has quit [Quit: baroquebobcat]
dc has joined #ruby
mary5030_ has quit [Remote host closed the connection]
jheg has quit [Ping timeout: 245 seconds]
cmhobbs has joined #ruby
<Kaedenn1> Will $stdout.reopen truncate or otherwise modify the file I point it at, or will it open it O_APPEND ?
baroquebobcat has joined #ruby
kireevco has quit [Quit: Leaving.]
andrewjanssen has quit [Quit: Leaving...]
mary5030 has quit [Ping timeout: 240 seconds]
sailias has joined #ruby
dc has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
mary5030 has joined #ruby
<segfalt> Kaedenn1: Docs say it can take (path, mode_str), so I assume $stdout.reopen('path', 'a') would append.
kireevco has joined #ruby
<segfalt> Alternatively it can take an IO, so you could fp = File.open('file', 'a') ; $stdout.reopen(fp)
Kricir has quit [Ping timeout: 245 seconds]
soulcake has joined #ruby
dc has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
Kricir has joined #ruby
aspires has joined #ruby
<Kaedenn1> segfalt: thank you much. I'm working with support on diagnosing the problems of the script. I wish I could just paste it somewhere but I can't because it's customer data.
jhass is now known as jhass|off
aspires has quit [Client Quit]
ixti has quit [Read error: Connection reset by peer]
<segfalt> Kaedenn1: no problem, been there before :)
treehug88 has quit []
timonv has joined #ruby
mary5030_ has joined #ruby
<Kaedenn1> How do I do something like: fp = File.open('/var/log/ZettaMirror/script-YYYY-MM-DD.log', 'a') where the YYYY, MM, and DD are strftime outputs?
mary5030 has quit [Read error: Connection reset by peer]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore> use strftime?
<Kaedenn1> I don't know ruby. I'm trying to give something that support can just paste to the customer.
<shevy> Kaedenn1 build up into a variable first
NukePuppy has quit [Ping timeout: 240 seconds]
<shevy> then pass that variable to File.open
jmurray has quit [Quit: jmurray]
<toretore> "/var/log/whatever/#{Time.now.strftime('%Y-%m-%d')}.log"
sambao21 has quit [Quit: Goodbye]
shinobi_one has quit [Quit: shinobi_one]
mary5030 has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
timonv has quit [Ping timeout: 245 seconds]
jottr has quit [Ping timeout: 240 seconds]
agent_white has joined #ruby
agent_white has quit [Client Quit]
frem_ has joined #ruby
agent_white has joined #ruby
mary5030_ has quit [Ping timeout: 252 seconds]
maestrojed has joined #ruby
chipotle has quit [Quit: cya]
andrewjanssen has joined #ruby
x1337807x has joined #ruby
Notte has quit []
nanoyak has quit [Quit: Computer has gone to sleep.]
sack_lunch has joined #ruby
<sack_lunch> hello all
djbkd has quit [Remote host closed the connection]
Fire-Dragon-DoL has joined #ruby
frem_ has quit [Ping timeout: 240 seconds]
<Kaedenn1> toretore: thank you!
MrSamuel has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
pdtpatr11k has joined #ruby
aspires has joined #ruby
<vosloco> Has anybody seen this error? I am using the rest-client gem. "OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version"
kilk__ has quit [Ping timeout: 245 seconds]
pdtpatr11k has quit [Client Quit]
NukePuppy has joined #ruby
aspires has quit [Client Quit]
coffeina has joined #ruby
lw has quit [Quit: s]
nanoyak has joined #ruby
aspires has joined #ruby
jmurray has joined #ruby
ccolorado has left #ruby [#ruby]
jlast_ has quit [Remote host closed the connection]
jlast has joined #ruby
aspires has quit [Client Quit]
nfk has quit [Quit: yawn]
MrSamuel has joined #ruby
devdazed has quit [Read error: Connection reset by peer]
mocfive has quit [Remote host closed the connection]
devdazed has joined #ruby
bean has quit [Quit: bean]
mijicd has joined #ruby
jhulten_ has quit [Remote host closed the connection]
jlast has quit [Ping timeout: 265 seconds]
michaelchum has quit [Quit: Connection closed for inactivity]
NukePuppy has quit [Ping timeout: 240 seconds]
JokerDoomWork has joined #ruby
OffTheRails has quit [Ping timeout: 240 seconds]
dc has quit [Remote host closed the connection]
aspires has joined #ruby
Rollabunna has joined #ruby
tectonic has quit []
Azulinho has joined #ruby
gaboesquivel has joined #ruby
Sep1 has quit [Quit: Leaving.]
dc has joined #ruby
Squarepy has quit [Quit: Leaving]
timgauthier has joined #ruby
milkohol has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
fgo has joined #ruby
dc has quit [Remote host closed the connection]
GriffinHeart has joined #ruby
Rollabunna has quit [Ping timeout: 260 seconds]
dhaivat has quit [Quit: dhaivat]
gaboesquivel has quit [Ping timeout: 264 seconds]
Nahra has quit [Remote host closed the connection]
Nahra has joined #ruby
djbkd has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
dangerou_ has quit [Ping timeout: 276 seconds]
dc has joined #ruby
mikesplain has quit [Ping timeout: 255 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dc has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 252 seconds]
GriffinHeart has quit [Ping timeout: 240 seconds]
rayners has quit [Remote host closed the connection]
sepp2k has joined #ruby
spider-mario has quit [Remote host closed the connection]
dseitz has joined #ruby
redondos has quit [Excess Flood]
jhulten has joined #ruby
dc has joined #ruby
KobraKao has quit [Ping timeout: 264 seconds]
cmhobbs has quit [Remote host closed the connection]
failshel_ has joined #ruby
arrubin has quit []
redondos has joined #ruby
redondos has quit [Changing host]
redondos has joined #ruby
enebo has quit [Quit: enebo]
tectonic has joined #ruby
ixti has joined #ruby
ghr has quit [Ping timeout: 255 seconds]
hamakn has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 245 seconds]
hamakn has joined #ruby
freerobby has joined #ruby
<shevy> dumdedum
arrubin has joined #ruby
failshell has quit [Ping timeout: 255 seconds]
sputnik13 has joined #ruby
failshel_ has quit [Ping timeout: 265 seconds]
charliesome has joined #ruby
claymore has quit [Quit: Leaving]
anaeem1 has quit [Remote host closed the connection]
ner0x has joined #ruby
linuxnewb2 has joined #ruby
freezey has quit []
<timgauthier> shevy!!
<timgauthier> i'm really more of a BMW guy
nateberkopec has quit [Quit: Leaving...]
combusean has joined #ruby
<shevy> bavaria is nice
nateberkopec has joined #ruby
<shevy> they should separate from rest of germany really
<timgauthier> yes
<timgauthier> yes they should
<timgauthier> like at the bottom of the ocean
<shevy> hehe
infinitone has quit [Ping timeout: 255 seconds]
<shevy> well they are famous for a few things... BMW ... beer ... hmm silly clothes and silly beards
aspires has quit []
<shevy> lol
<shevy> "26th International Alpine Beard Competition"
fgo has joined #ruby
<shevy> look at the food storage they hold in their beards
<shevy> timgauthier I can't seem to will myself to want to learn rails :(
<timgauthier> then don't
<timgauthier> learn python ;)
dc has quit [Remote host closed the connection]
<shevy> well
vpretzel|1445 has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
<shevy> I need a main language
<shevy> it could be ruby or it could be python
<shevy> but both kinda overlap slightly
<timgauthier> ya
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yetanotherdave> How about MIPS assembly
<shevy> do you really want me to replace ruby with python thusly!!!
freerobby has quit [Quit: Leaving.]
<shevy> don't think that is very useful yeltzooo
nateberkopec has quit [Client Quit]
bmurt has joined #ruby
orthos has quit [Quit: orthos]
krz has joined #ruby
<timgauthier> rails wasn't that hard when i tried to get it
<shevy> possibly
fgo has quit [Ping timeout: 255 seconds]
<shevy> but it seems so awfully boring :(
<timgauthier> yes for you maybe ;)
<banister> shevy learn swift
<timgauthier> apple swift
<timgauthier> to be specific
<banister> timgauthier rails is boring IMO too
joelteon has joined #ruby
<timgauthier> yes it is
gr33n7007h has joined #ruby
<timgauthier> i guess
Arkaniad has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benzrf> camping looks kinda fun
garndt has quit [Quit: Connection closed for inactivity]
Azulinho has quit [Ping timeout: 245 seconds]
<shevy> timgauthier well
<timgauthier> camping IS fun
<shevy> timgauthier if I could transition all of my local knowledge into something better then that would be very useful
<shevy> *knowledge base
<timgauthier> yeah Apple swift is supposidly Objective C without hte C
<shevy> it's a plethora of .cgi .rb .md and what not ... a few sqlite standalone files... hmm... a minor postgresql component for taxonomy data from organisms...
Spami has quit [Quit: This computer has gone to sleep]
<benzrf> timgauthier: it looks like a more conservative version of scala to mehlah_
<benzrf> *to me
SevenWolf has joined #ruby
lethjakman has quit [Quit: WeeChat 0.4.3]
enebo has joined #ruby
<Kaedenn1> Say a ruby script contains a syntax error or some other error causing the script to terminate abnormally. What exit code would be returned to the calling process?
pwh has quit []
toastynerd has quit [Remote host closed the connection]
<Kaedenn1> Does it depend on the specific kind of syntax/semantic error?
andrewjanssen has joined #ruby
VinDoKi has quit [Remote host closed the connection]
<kenichi> `Hash === obj` or `obj.is_a? Hash`
<kenichi> ?
lukec has joined #ruby
enebo has quit [Client Quit]
<shevy> Kaedenn1 should be all but 0
<Kaedenn1> shevy: I don't know what that means
<shevy> from within a .rb file it could be obtained via $?.exitstatus
<shevy> well
<shevy> you somehow need to capture it right?
<Kaedenn1> We're doing it via Linux native code, the C apis
<shevy> as in, however you run the script, you'll get back a value
<Kaedenn1> fork(), exec() which just so happens to be a ruby script, then wait() or waitpid()
dc has joined #ruby
coffeina has quit [Quit: Wychodzi]
SCommette has quit [Quit: SCommette]
kireevco has quit [Read error: Connection reset by peer]
klaut has quit [Remote host closed the connection]
kireevco has joined #ruby
mary5030 has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
<MrSamuel> Kaedenn1: the error code by default is 1
<MrSamuel> Kaedenn1: but anything non-zero should be considered an error
<Kaedenn1> MrSamuel: *THAT* solves our problem! Thank you! The script is exiting with 1 and we don't know why.
<Kaedenn1> It only exits with 1 when we run it through our product. When he runs it by hand it exits normally.
x1337807x has joined #ruby
mary5030 has joined #ruby
<MrSamuel> if ruby is dying because of an error it would normally print a backtrace
<Kaedenn1> There's no call to exit() or Kernel::exit() anywhere. We don't capture the stderr of the spawned process.
<Kaedenn1> So I told customer support to try the $stderr.reopen trick.
bhaak has quit [Ping timeout: 240 seconds]
mattstratton has joined #ruby
zB0hs has joined #ruby
<MrSamuel> Kaedenn1: sometimes in that case I just hardcode
moted has joined #ruby
<MrSamuel> STDERR.reopen(“/tmp/error.log”) at the top of the script
<MrSamuel> or something like that
<MrSamuel> it is usually better thought to have a good logging solution/error capture
Arkaniad has quit [Ping timeout: 240 seconds]
<Kaedenn1> $stderr.reopen("/var/log/ZettaMirror/pre-#{Time.now.strftime('%Y-%m-%d')}.txt", 'a')
moted has quit [Client Quit]
<Kaedenn1> I had support send that to the customer.
yubrew_ has quit [Remote host closed the connection]
stantona_ has joined #ruby
chipotle has joined #ruby
aspiers_ has quit [Ping timeout: 260 seconds]
stantona has quit [Ping timeout: 260 seconds]
Kricir has joined #ruby
stantona_ has quit [Ping timeout: 240 seconds]
ziyadb has quit [Quit: Connection closed for inactivity]
KobraKao has joined #ruby
tectonic has quit []
danman has quit [Quit: danman]
jamto11 has quit [Remote host closed the connection]
SCommette has joined #ruby
dc has quit [Remote host closed the connection]
<shevy> Kaedenn1 that customer is training you to learn ruby ;)
nateberkopec has joined #ruby
vpretzel|1445 has joined #ruby
jmurray has quit [Quit: jmurray]
geggam has quit [Quit: day_is_done]
mary5030_ has joined #ruby
datafirm_ has quit [Ping timeout: 252 seconds]
vpretzel_ has joined #ruby
mijicd has quit [Remote host closed the connection]
run_kmc has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
vpretzel|1445 has quit [Ping timeout: 252 seconds]
maestrojed has quit [Quit: Textual IRC Client: www.textualapp.com]
mary5030 has quit [Ping timeout: 264 seconds]
<shevy> what is http://rubydoc.info/gems/ using by default? rdoc?
<shevy> I need to change some of the default formatting
bmurt has quit []
bhaak has joined #ruby
chipotle has quit [Quit: cya]
orthos has joined #ruby
vpretzel_ has quit [Ping timeout: 260 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
lw has joined #ruby
aspires has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
baroquebobcat has joined #ruby
<timgauthier> holycrap... no wonder sketch is choking this file copied over from AI in a rediculously huge amount of paths
Spami has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
robbyoconnor has joined #ruby
Slavox is now known as Slavox|AFK
katmandoo has quit [Ping timeout: 264 seconds]
predator217 has joined #ruby
learner has quit [Ping timeout: 245 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stephenmac7_ has joined #ruby
iaj_ has joined #ruby
djbkd has quit [Remote host closed the connection]
vpretzel|1445 has joined #ruby
Gnubie_ has joined #ruby
predator117 has quit [Ping timeout: 245 seconds]
jericon has joined #ruby
Cope_ has joined #ruby
fluve has joined #ruby
stormy3_ has joined #ruby
chihhsin_wego has joined #ruby
ninegrid_ has joined #ruby
linuxnewb2 has quit [Quit: Leaving]
qqw_ has joined #ruby
ihme-TTilus has joined #ruby
DarKnesS1WolF has joined #ruby
qpok_ has joined #ruby
northfurr has joined #ruby
datafirm_ has joined #ruby
cpruitt has quit [Quit: cpruitt]
irvingprime has joined #ruby
djbkd has joined #ruby
irvingprime has quit [Client Quit]
rm_ has joined #ruby
Dingus has joined #ruby
nomadic_ has joined #ruby
mercerist has joined #ruby
genta0 has joined #ruby
Mars`` has joined #ruby
]42[ has joined #ruby
dc has joined #ruby
awkisopen_ has joined #ruby
thejoecarroll_ has joined #ruby
pgmcgee- has joined #ruby
RoryHughes_ has joined #ruby
Slavox|AFK is now known as Slavox
bio has joined #ruby
Dr3amc0dz has joined #ruby
Biohazard has quit [Write error: Broken pipe]
genta has quit [Write error: Broken pipe]
qqw has quit [Write error: Broken pipe]
chihhsin1wego has quit [Write error: Broken pipe]
nomadic has quit [Write error: Broken pipe]
justinmcp_ has quit [Write error: Broken pipe]
jericon_ has quit [Write error: Broken pipe]
onewheelskyward has quit [Write error: Broken pipe]
__main__ has quit [Write error: Broken pipe]
cschneid has quit [Write error: Broken pipe]
stormy3 has quit [Write error: Broken pipe]
iaj has quit [Write error: Broken pipe]
Kilo`byte has quit [Write error: Broken pipe]
Cope has quit [Write error: Broken pipe]
Gnubie__ has quit [Quit: No Ping reply in 180 seconds.]
awkisopen has quit [Excess Flood]
Azure has quit [Excess Flood]
pgmcgee has quit [Quit: ZNC - http://znc.in]
hl_ has joined #ruby
Dr3amc0d3r|away has quit [Excess Flood]
hl has quit [Quit: Quit]
ValicekB has quit [Remote host closed the connection]
thejoecarroll has quit [Quit: ZNC - http://znc.in]
stephenmac7 has quit [Quit: No Ping reply in 180 seconds.]
Mars` has quit [Remote host closed the connection]
Mars`` is now known as Mars`
[42] has quit [Quit: Gone...]
Cork has quit [Quit: .]
RoryHughes has quit [Quit: ZNC - http://znc.in]
DarKnesS_WolF has quit [Remote host closed the connection]
justinmcp has joined #ruby
onewheelskyward has joined #ruby
hl_ is now known as hl
awkisopen_ is now known as awkisopen
_main_ has joined #ruby
Kilo`byte has joined #ruby
Azure has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.3]
]42[ is now known as [42]
baroquebobcat has quit [Quit: baroquebobcat]
speakingcode has joined #ruby
snath has quit [Ping timeout: 264 seconds]
Cork has joined #ruby
eli has joined #ruby
_main_ is now known as __main__
NinoScript has quit [Quit: NinoScript]
dc has quit [Ping timeout: 240 seconds]
eli is now known as eli-oat
nerium has quit [Ping timeout: 252 seconds]
ryanleesipes has quit [Ping timeout: 252 seconds]
ninegrid has quit [Ping timeout: 252 seconds]
qpok has quit [Ping timeout: 252 seconds]
TTilus has quit [Ping timeout: 252 seconds]
eli-oat is now known as _eli
andrewjanssen has quit [Quit: Leaving...]
cschneid has joined #ruby
Olipro has quit [Ping timeout: 246 seconds]
andrewjanssen has joined #ruby
ValicekB_ has joined #ruby
andrewjanssen has quit [Client Quit]
fgo has joined #ruby
_eli has quit [Write error: Broken pipe]
Devanon has joined #ruby
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Olipro has joined #ruby
ValicekB_ is now known as ValicekB
linuxnewb2 has joined #ruby
james_d_h has quit [Ping timeout: 240 seconds]
krz has quit [Quit: WeeChat 0.4.3]
dc has joined #ruby
timonv has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
snath has joined #ruby
charliesome has joined #ruby
fgo has quit [Ping timeout: 276 seconds]
Devanon has quit [Quit: WeeChat 0.4.3]
jxf has quit [Ping timeout: 240 seconds]
dc has quit [Ping timeout: 252 seconds]
timonv has quit [Ping timeout: 252 seconds]
Devanon has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
postmodern has quit [Quit: Leaving]
hermanmunster has joined #ruby
oso96_2000 is now known as oso|away
djbkd has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
dc has joined #ruby
andrewlio has quit [Quit: Leaving.]
phoo1234567 has quit [Remote host closed the connection]
djbkd has joined #ruby
the_f0ster has quit [Ping timeout: 276 seconds]
dc_ has joined #ruby
dc has quit [Ping timeout: 260 seconds]
jonahR has quit [Quit: ¡Adios amigos, me fui para el carajo!]
MrSamuel has quit [Quit: MrSamuel]
nanoyak has joined #ruby
KobraKao has quit [Ping timeout: 252 seconds]
<gr33n7007h> Can someone point me to a little example of using Mutex and Queue for threading or pastebin a little code snippet?
<toretore> what do you want to know?
<gr33n7007h> I'm struggling to understand the whole concept
Adran has quit [Quit: Adran]
mercerist has quit [Read error: Connection reset by peer]
<toretore> well.. you understand what their purpose is, right?
mercerist has joined #ruby
badhatter has quit [Ping timeout: 265 seconds]
<shevy> gr33n7007h hah I am waiting for the same as well, I am too lazy to work out how to use a mutex
<toretore> preventing threads from executing a critical piece of code at the same time
<toretore> where critical mostly = doing something with a shared resource
SCommette has quit [Quit: SCommette]
ponga has joined #ruby
Adran has joined #ruby
<toretore> i may not be the right person to ask though, i'm quite new to threads myself
<toretore> and still struggle with some of these primitives
<gr33n7007h> toretore, Let me write a simple port scanner one sec
badhatter has joined #ruby
badhatter has quit [Changing host]
badhatter has joined #ruby
Riking has quit [Quit: ZNC - http://znc.sourceforge.net]
djbkd has quit [Remote host closed the connection]
Riking has joined #ruby
orthos has quit [Quit: orthos]
pietr0 has quit [Quit: pietr0]
vpretzel|1445 is now known as vpretzel
cpruitt has joined #ruby
james_d_h has joined #ruby
mikepack has joined #ruby
milkohol has joined #ruby
kavinder has joined #ruby
<gr33n7007h> Where would the mutex go in this https://gist.github.com/anonymous/d269e30f3e45aae37780
magicien has quit [Ping timeout: 240 seconds]
Wolland has quit [Remote host closed the connection]
<gr33n7007h> this is where i'm struggling
magicien has joined #ruby
Photism has quit [Read error: Connection reset by peer]
Wolland has joined #ruby
nanoyak has quit [Read error: Connection reset by peer]
phinfonet has quit [Ping timeout: 240 seconds]
nanoyak has joined #ruby
<toretore> it wouldn't, really
<toretore> you're not accessing a shared resource from within the thread
phinfonet has joined #ruby
<toretore> but imagine you were popping the port numbers off the array from inside the threads
GriffinHeart has joined #ruby
<toretore> then you'd need to protect it