meskyanichi has quit [Remote host closed the connection]
<Eric___>
:) I am trying to create a method that will take a course code (example: ENG140Y1) and return the 3 letter course designator (i.e. "ENG")
meskyanichi has joined #ruby
<Eric___>
so I did this: def select_designator(coursecode)
<Eric___>
@coursecode = coursecode
<Eric___>
@coursecode[0,3] = designator
felipesabino has joined #ruby
CaptainJet has joined #ruby
<Eric___>
is that anywhere near correct?
danieldocki has quit [Ping timeout: 255 seconds]
_nitti has quit [Ping timeout: 264 seconds]
aajjbb has quit [Ping timeout: 272 seconds]
Jesterman81 has joined #ruby
<headius>
chord: a lot of those benchmarks are not typical application cases
DaZ has joined #ruby
<headius>
and a lot of them could be written in much better ways
seanstickle has joined #ruby
adkron has joined #ruby
<chord>
headius: aren't those benchmarks typically using variables in a purely statically typed way, so the jit should easily be able to see just optimize for the static typed case
<Eric___>
with what I put I keep getting "undefined local variable or method `designator'", but I was under the impression that you don't need to declare vars in ruby
<Eric___>
(fwiw I am kinda new to programming and I'm trying to write a program to select my courses so that I can maximize course overlap lol.)
Jesterman81 has quit [Client Quit]
<headius>
chord: well, we could look at a specific example, perhaps?
<headius>
they often do work out to mostly static code, but that doesn't mean they're well-written
aajjbb has joined #ruby
<headius>
performing close to C++ is perhaps a bit too tall an order for any Ruby impl, since Ruby's a very allocation and GC-heavy language in any case
<headius>
the C++ versions of those benchmarks tend to avoid all allocation and are often just C with objects
pyr0commie has quit [Remote host closed the connection]
<chord>
headius: presumably the same type of code structure is used for all the languages, so they are all equally badly written, are you saying thats wrong?
pyr0commie has joined #ruby
<headius>
you should have a look at them…the different language versions are very different
jjbohn has joined #ruby
piotr_ has quit [Ping timeout: 272 seconds]
<headius>
some of the python ones use numpy…talk about a cheat
<Eric___>
(also I hope I'm in the right channel for this question)
<chord>
headius: ok then maybe I can restate my question as jit'ed dynamically typed like JRuby vs statically typed, garbage collected, compiled language
iamjarvo has joined #ruby
<chord>
headius: is there any paper that looks at this concretely
<chord>
headius: and says dynamic jit'ed can get really close
ikaros has quit [Quit: Ex-Chat]
alexspeller has joined #ruby
ebobby has quit [Quit: Lost terminal]
felipesabino has quit [Remote host closed the connection]
felipesabino has joined #ruby
PetePorty has joined #ruby
PetePorty has quit [Changing host]
PetePorty has joined #ruby
gordon1775|2 has joined #ruby
kirun has quit [Quit: Client exiting]
danneu2 has joined #ruby
eurythmmia has joined #ruby
PetePorty has quit [Remote host closed the connection]
danneu1 has quit [Read error: Connection reset by peer]
cousine has quit [Remote host closed the connection]
Dario_ has joined #ruby
<eurythmmia>
Hey Folks; I'm new at ruby. I'd like to create a module and alias some of the methods provided within that module, but when I try, I get a message stating that there is no such method. I have a short example with output pasted here (http://www.pastebin.ca/2294766). I appreciate any assistance.
rellin has quit [Ping timeout: 250 seconds]
Dario_ has quit [Ping timeout: 265 seconds]
<headius>
chord: well…the JVM (or the most successful implementations of it) itself is largely dynamically typed internally
phelps has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<headius>
we don't do anything magical in JRuby other than plug directly into the JVM JIT (which isn't a tracing JIT by the way, but that's not really important here)
lolcathost has quit [Ping timeout: 244 seconds]
ttt has joined #ruby
<kenneth>
eurythmmia: not sure, but i think alias_method is meant for instance methods in classes.
<headius>
there's lots of papers about how different JVMs optimize code, and they apply as well to dynlangs like JRuby now that we can teach the JIT how dyncalls work
danneu2 has quit [Ping timeout: 265 seconds]
mahmoudimus has joined #ruby
ewag has quit [Ping timeout: 264 seconds]
<headius>
a recent benchmark put a pure-Ruby rbtree impl up against a Java-based JRuby extension, and the pure Ruby version is only about 2x slower
<headius>
that gap will continue to narrow
daniel_hinojosa has quit [Quit: Leaving.]
<eurythmmia>
kenneth: thanks. I've thought about that too; but if it were the case that it wouldn't work when requiring a file containing a module, then module_alias_chain wouldn't work either (which is the case here, but not in general, from what I've seen)
fyolnish has quit [Remote host closed the connection]
ttt has quit [Ping timeout: 276 seconds]
medik has quit [Quit: Leaving]
<eurythmmia>
kenneth: ... although, that gives me another idea. Hold on and I'll let you know how I fare.
moshee has joined #ruby
alexspeller has quit [Ping timeout: 252 seconds]
aajjbb has quit [Ping timeout: 255 seconds]
d2dchat has joined #ruby
nanothief has joined #ruby
<eurythmmia>
That didn't work either. Back to the internet to find an answer.
Nisstyre has quit [Read error: Connection reset by peer]
jjbohn has quit [Quit: Leaving...]
w400z has joined #ruby
miskander has joined #ruby
tjbiddle_ has joined #ruby
lolcathost has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
elico has joined #ruby
jjbohn has joined #ruby
pyr0commie has quit [Remote host closed the connection]
elico has quit [Client Quit]
tjbiddle has quit [Ping timeout: 264 seconds]
tjbiddle_ is now known as tjbiddle
agarie has quit [Remote host closed the connection]
madhadron has left #ruby [#ruby]
daniel_- has joined #ruby
aajjbb has joined #ruby
<eurythmmia>
kenneth: if I don't prefix my method names with the module name, everything works well (https://gist.github.com/4333483). I only run into trouble when I do try to prefix (to prevent trampling method names at runtime).
nat2610 has left #ruby [#ruby]
slainer68 has quit [Remote host closed the connection]
jon_than_ has quit [Read error: Operation timed out]
miskander has quit [Quit: miskander]
gordon1775|2 has quit [Read error: Connection reset by peer]
whomp has joined #ruby
daniel_- has quit [Client Quit]
<whomp>
is there any way to modify a file using the ruby -ne?
<Divinite>
Yes
<Divinite>
Modifyfile -ne filename
Spaceghostc2c has quit [Excess Flood]
mercwithamouth has joined #ruby
yewton_ is now known as yewton
xAndy is now known as xandy
etank has quit [Ping timeout: 245 seconds]
thams has quit [Read error: Connection reset by peer]
yshh has joined #ruby
felipesabino has quit [Ping timeout: 272 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
thams has joined #ruby
etank has joined #ruby
jjbohn has quit [Quit: Leaving...]
Spaceghostc2c has joined #ruby
cr3 has joined #ruby
jjbohn has joined #ruby
chussenot has quit [Quit: chussenot]
Jake232 has joined #ruby
philips_ has quit [Excess Flood]
alexspeller has joined #ruby
gordon1775 has joined #ruby
<cr3>
hi folks, is there a preference between calling File.readable? or File::readable?
<Divinite>
Yes
<Divinite>
You do
<Divinite>
File.::.readable?
dmiller has joined #ruby
<Divinite>
See, pyramid
jlast has joined #ruby
DrShoggoth has joined #ruby
main has quit [Read error: Operation timed out]
<cr3>
Divinite: of course! how about .:.:., bridge!
<Divinite>
Excellent cr3!
<Divinite>
That conforms to RC82638
philips_ has joined #ruby
taoru has joined #ruby
<cr3>
Divinite: that's the ruby art rfc, right?
adeponte has quit [Remote host closed the connection]
<Divinite>
Precisely!
miskander has joined #ruby
<Divinite>
Has to be simple but poignant!
dougireton has quit [Quit: Leaving.]
dmerrick has quit [Quit: dmerrick]
luckyruby has quit [Remote host closed the connection]
gabrielrotbart has quit [Remote host closed the connection]
zooz_ has quit [Quit: Leaving IRC]
jimeh has quit [Quit: Computer has gone to sleep.]
tjbiddle_ has joined #ruby
gordon1775 has quit [Ping timeout: 264 seconds]
fyolnish has joined #ruby
<havenn>
cr3: .
ngoldman has quit [Remote host closed the connection]
tjasko__ has joined #ruby
tjbiddle has quit [Ping timeout: 272 seconds]
tjbiddle_ is now known as tjbiddle
Vert has joined #ruby
<cr3>
havenn: thanks!
cr3 has quit [Quit: leaving]
Jasko has quit [Ping timeout: 264 seconds]
johnmilton has quit [Remote host closed the connection]
aajjbb has quit [Ping timeout: 256 seconds]
samphippen has joined #ruby
mmitchell has joined #ruby
t_hash has joined #ruby
tjbiddle_ has joined #ruby
lenovodroid has quit [Ping timeout: 260 seconds]
chessguy has quit [Remote host closed the connection]
dazonic has joined #ruby
jjbohn has quit [Quit: Leaving...]
tjbiddle__ has joined #ruby
alexspeller has quit [Ping timeout: 252 seconds]
tjbiddle has quit [Ping timeout: 256 seconds]
tjbiddle__ is now known as tjbiddle
berserkr has joined #ruby
tjbiddle_ has quit [Ping timeout: 264 seconds]
jarjar_prime has quit [Quit: Sleep time.]
v0n has joined #ruby
aajjbb has joined #ruby
dawkirst_2 has quit [Ping timeout: 244 seconds]
robbyoconnor is now known as r0bby
ttt has joined #ruby
dawkirst_ has joined #ruby
r0bby is now known as robbyoconnor
Nimsical has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
mrsolo has quit [Quit: Leaving]
swex_ has joined #ruby
<dazonic>
I've got about 10 sites on a VPS, all small brochure sites, built with Brochure gem so they're Rack apps (https://github.com/sstephenson/brochure)… I've deployed with unicorn and nginx, basically copying the Railscast (http://railscasts.com/episodes/293-nginx-unicorn). They run VERY SLOW though, I've got a few big rails apps on the server that run way faster. Should I stick with unicorn? Anyone got any speed tips?
ttt has quit [Ping timeout: 276 seconds]
zeade has quit [Quit: Leaving.]
dawkirst_ has quit [Ping timeout: 248 seconds]
xnm has joined #ruby
mahmoudimus has joined #ruby
blazes816 has quit [Quit: blazes816]
swex has quit [Ping timeout: 264 seconds]
xyzodiac has joined #ruby
brianpWins has quit [Quit: brianpWins]
tyfighter has quit [Quit: tyfighter]
Kruppe has joined #ruby
pxjorge has quit [Ping timeout: 246 seconds]
cakehero has joined #ruby
twoism has quit [Remote host closed the connection]
moos3 has quit [Quit: Computer has gone to sleep.]
<fivetwentysix>
!!nil == !!false => true
<fivetwentysix>
:-)
v0n has quit [Ping timeout: 272 seconds]
<fivetwentysix>
but if you're actually writing code like that, you're doing it wrong :-)
<slash_nick>
run: bar = false; foo = bar == 'blah'; foo #=> false
<slash_nick>
<- being an occam's razor nazi
* slash_nick
shows himself out
slash_nick has quit [Quit: leaving]
<fivetwentysix>
Pop Quiz: "a = true of false" what does a ==?
<fivetwentysix>
How about "a = false or true"
aapzak has quit [Ping timeout: 255 seconds]
crackfu has quit [Quit: Leaving...]
<DerkTheDaring>
if* ?
Diger_s has joined #ruby
<fivetwentysix>
a = false or true; b = false || true; a == b => ?
<DerkTheDaring>
in that case nil
alexspeller has quit [Ping timeout: 252 seconds]
jfl0wers has quit [Quit: jfl0wers]
<DerkTheDaring>
the second case is true
<DerkTheDaring>
:)
<havenn>
fivetwentysix: precedence of `or` is less than `=` :)
<fivetwentysix>
yep
<fivetwentysix>
thought that was interesting
aapzak has joined #ruby
<fivetwentysix>
ugh i have to write some more working code
<fivetwentysix>
I can never be bothered to test javascript
Ivis has quit []
<fivetwentysix>
anyone else suffer the same problem?
evilsushi has joined #ruby
evilsushi has quit [Changing host]
evilsushi has joined #ruby
<reactormonk>
how do I code str(hex(int( in ruby? input would be "16777223"
<reactormonk>
(that's python)
<fivetwentysix>
thats not valid python
<fivetwentysix>
is it?
<havenn>
reactormonk: What's the output?
<DerkTheDaring>
"16777223".to_i.hex.to_s ?
<rismoney>
one more operator question - to cure my rspec
hackerdude has quit [Remote host closed the connection]
<havenn>
"16777223".hex.to_s #=> "376926755"
<rismoney>
if has_address != has_subnetmask != is_ip <- can i not do a 3 way like this?
* fivetwentysix
wonders if he should switch from vim to something else after 2 years of doing vim
<havenn>
fivetwentysix: What options would you consider? Emacs??
radic has joined #ruby
<fivetwentysix>
havenn: not sure, don't even know what else is there
mmitchell has quit [Remote host closed the connection]
<fivetwentysix>
havenn: maybe build my own ruby IDE in rails :D
hackerdude has joined #ruby
<DerkTheDaring>
I used to use emacs a lot, but then I switched to vim
<reactormonk>
havenn, no idea...
<fivetwentysix>
DerkTheDaring: that happened to some of the guys here at work, they saw me on vim and switched lol
<DerkTheDaring>
I kind of did like having EVERYTHING at my fingertips in emacs though haha
<reactormonk>
havenn, 0x3200007
imami|afk is now known as banseljaj
Marco has quit [Ping timeout: 272 seconds]
Diger_s has quit [Ping timeout: 250 seconds]
<DerkTheDaring>
fivetwentysix: lol yeah vim is nice, I've gotten pretty comfortable with it, macvim and iterm2 suits me nicely when not on ubuntu haha
radic_ has quit [Ping timeout: 264 seconds]
gyre007 has joined #ruby
aedorn has joined #ruby
alexim has joined #ruby
aharris6 has joined #ruby
berserkr has quit [Quit: Leaving.]
rohit_ has joined #ruby
alexim has quit [Client Quit]
devbug has joined #ruby
Diger_s has joined #ruby
<devbug>
How can I express this inline? when foo case "A" .join('_') case "B" .join('::') end
Playground is now known as Catnaroek
<fivetwentysix>
I have 200 scenarios and 50 specs in my current application :-)
<fivetwentysix>
is that a strange ratio of integration vs unit tests?
Vert has joined #ruby
gyre007 has quit [Ping timeout: 272 seconds]
dmiller has quit [Remote host closed the connection]
mmitchell has joined #ruby
<aedorn>
Is there a way to get the last method's explicit return value? Or some way to capture a return out of a block without interrupting the method chain?
<aedorn>
havenn: Kind of ... but slightly different
waxjar has quit [Quit: i am waxjar, hear me roar]
<aedorn>
Basically it's similar to def something █ do_something; yield; ensure; do_something if {that yield returned true}; end
skaczor has quit [Ping timeout: 272 seconds]
<aedorn>
I guess that looks a bit complicated on a single line
deadalus has quit [Quit: Once more into the fray, Into the last good fight I'll ever know, Live and die on this day, Live and die on this day]
cr3 has quit [Quit: leaving]
banjara has joined #ruby
<fivetwentysix>
adorn sounds like bad code
<fivetwentysix>
write tests :-)
spathi_ has quit [Remote host closed the connection]
<fivetwentysix>
easiest way is to create a variable outside of the block, assign it in the block, and return it after the block
<aedorn>
Well, it's terrible code... but to fix it I'd have to rewrite a few thousand lines. Since I need a fix by tomorrow morning that's a bit out of the question so I have to do something cleverly stupid
<havenn>
aedorn: Hrmm, I wonder if something like: def something █ block.call.tap do |value|; do something if value; end;end
danneu has quit [Ping timeout: 252 seconds]
breakingthings has quit []
mockra has joined #ruby
<aedorn>
havenn: Tried that one... doesn't work either. I guess explicit returns are a bit too aggressive to jump out of the method
ebouchut has joined #ruby
<havenn>
aedorn: mmm
<aedorn>
fivetwentysix: Only reason I can't do a variable assignment is that would be *a lot* of blocks to change. It's a bit ridiculous
<rismoney>
how can i write if a != b !=c ? I tried if a !=b && b !=c but I don't think it works quite right
<fivetwentysix>
aedorn: like i said… bad code lol
nwertman has quit [Quit: Lost terminal]
tjbiddle has quit [Read error: Connection reset by peer]
a_a_g has quit [Quit: Leaving.]
<aedorn>
fivetwentysix: it is... sadly I wrote it. Just .. bad legacy design, short dead lines, no tests, etc .. it's a poster child for what never to do. Ever. =)
tjbiddle has joined #ruby
joofsh has quit [Remote host closed the connection]
jonahR has joined #ruby
<aedorn>
rismoney: a != b && b != c does work.. Why do you think it doesn't?
devbug has left #ruby ["To the moon!"]
joeycarmello has quit [Remote host closed the connection]
rellin has quit [Ping timeout: 265 seconds]
evilsushi has left #ruby [#ruby]
<fivetwentysix>
there's no reason not to start testing
<fivetwentysix>
aedorn: even on short deadlines, tests can do wonders to improve productivity
<rismoney>
trying again
sayan has joined #ruby
<fivetwentysix>
break out the stuff you want to test into a module, include it into the class you're testng
<fivetwentysix>
g
<fivetwentysix>
require that module include it in a dummy class and unit test it
Diger_s has quit [Ping timeout: 250 seconds]
joeycarmello has joined #ruby
browndawg has left #ruby [#ruby]
sayan has quit [Client Quit]
sayan has joined #ruby
kiyoura has quit [Quit: Leaving]
webguynow has quit []
<aedorn>
I certainly don't disagree... and I do write tests for anything I touch now. It just wasn't built that way to begin with. I'm certainly paying for it today, though.
Diger_s has joined #ruby
dmiller has joined #ruby
Fezzler has quit [Quit: Leaving]
<havenn>
I'm banging my head on 30,000s lines of test-less and comment-less Ruby code that is very 'clever'...
<havenn>
Kinda wish I did write it, so I had some inkling of what might be happening. >.>
<aedorn>
havenn: it's not mine! =)
moos3 has quit [Quit: Computer has gone to sleep.]
danneu has joined #ruby
axl_ has quit [Quit: axl_]
bairui has quit [Quit: WeeChat 0.4.0-dev]
danneu has quit [Ping timeout: 252 seconds]
jfl0wers has joined #ruby
DerkTheDaring has quit [Remote host closed the connection]
axl_ has joined #ruby
alexspeller has quit [Ping timeout: 252 seconds]
benlieb has quit [Quit: benlieb]
danneu has joined #ruby
Diger_s has quit [Ping timeout: 250 seconds]
yshh_ has joined #ruby
jfl0wers has quit [Client Quit]
yshh has quit [Read error: Connection reset by peer]
benlieb has joined #ruby
axl__ has joined #ruby
axl_ has quit [Ping timeout: 244 seconds]
axl__ is now known as axl_
joeycarmello has quit [Remote host closed the connection]
Diger_s has joined #ruby
ttt has joined #ruby
sandGorgon has joined #ruby
Shamgar has quit [Read error: Connection reset by peer]
sandGorgon1 has joined #ruby
haylon has joined #ruby
hackerdude has quit [Remote host closed the connection]
<haylon>
If I wanted to create an array and assign it integers and char characters, would I be able to do this? tempCipher1 = Array.new[](1..52, LJ, BJ)
<rismoney>
is this right foo = bar == 'blah' || bar == 'dummy' ?
Godd2 has joined #ruby
<rismoney>
nm. got it with parens
rakl has joined #ruby
<havenn>
rismoney: you don't need the second bar==: foo = bar == ('blah' || 'dummy')
gyre007 has joined #ruby
beneggett has joined #ruby
<havenn>
rismoney: Or just: foo = %w[blah dummy].include? bar
<rismoney>
hmm
yacks has quit [Quit: Leaving]
<haylon>
havenn: thank you for the initialization of the array. Now I am running into a different error. count = tempCipher1.index(count) + 1. The error says Undefined method '+' for nil:NilClass (NoMethodError)
gyre007 has quit [Ping timeout: 272 seconds]
<havenn>
temp_cipher1.count + 1
<havenn>
haylon: btw, Ruby convention is to name variables in snake_case and classes and modules in CamelCase.
eurythmmia has quit [Remote host closed the connection]
alexspeller has joined #ruby
sayan has joined #ruby
lenodroid has joined #ruby
lenovodroid has quit [Read error: Connection reset by peer]
cousine has joined #ruby
atmosx has joined #ruby
oxman has joined #ruby
SeySayux_ has quit [Read error: Connection reset by peer]
Villadelfia has quit [Read error: Connection reset by peer]
<oxman>
I try to make a DSL, and for a clean DSL I should use instance_exec, but its seems not recommanded, so why Rails use it ?
<hoelzro>
oxman: where did you read that it isn't recommended?
banjara has joined #ruby
danneu1 has joined #ruby
<oxman>
I found lots of blog said it should not be used in most case, and pass the object to the block with yield sef is better
topek has left #ruby [#ruby]
browndawg has joined #ruby
<Divinite>
oxman: You're doing it wrong!
<oxman>
hum ?
<hoelzro>
oxman: passing self explicitly is probably cleaner and less magical
<Divinite>
oxman: Don't trust aytone.
<Divinite>
*anyone
<oxman>
Divinite i'm here for that ;)
chussenot has joined #ruby
<Divinite>
Is anyone here able to write a small script for me quickly?
ner0x has joined #ruby
<Divinite>
Considering I crack the funnies all the time. Looking at you shevy, you dirty Jentile lol
danneu1 has quit [Ping timeout: 252 seconds]
jonathanwallace has quit [Ping timeout: 252 seconds]
carloslopes has joined #ruby
lenodroid has quit [Read error: Connection reset by peer]
lenodroid has joined #ruby
sailias has quit [Quit: Leaving.]
Dario_ has joined #ruby
banjara has quit [Ping timeout: 252 seconds]
jjbohn has joined #ruby
lenodroid has quit [Read error: Connection reset by peer]
jkarayusuf has joined #ruby
geekbri has joined #ruby
eka has joined #ruby
vlad_starkov has joined #ruby
nanothief has quit [Ping timeout: 256 seconds]
greengriminal has joined #ruby
polymar has joined #ruby
v0n has joined #ruby
tjasko__ has joined #ruby
polymar has quit [Remote host closed the connection]
tommyvyo has joined #ruby
MathNEET has quit [Quit: Leaving.]
eka has quit [Ping timeout: 264 seconds]
diece has joined #ruby
browndawg has left #ruby [#ruby]
Mon_Ouie has joined #ruby
enroxorz-work has joined #ruby
Jasko has quit [Ping timeout: 272 seconds]
jhchabran has quit [Remote host closed the connection]
hybRis has joined #ruby
invisime has joined #ruby
krawchyk has joined #ruby
bluOxigen has joined #ruby
hamed_r has quit [Quit: Leaving]
<hybRis>
Hi guys, I am a semi-experienced php developer and am looking to get into ruby & rails dev. I did the interactive tutorials, railsforzombies and whatever the related ruby one is but feel like i need a more solid foundation. is there any book someone recommends for getting into rails and goes through the required ruby stuff as well? everything i've found seems to be one or the other
<hoelzro>
hybRis: I don't know about Rails, but as far as Ruby goes, I will recommend the excellent "The Ruby Programming Language"
Divinite has quit [Quit: Divinite has left :(]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
krawchyk has quit [Remote host closed the connection]
rakuN has quit [Remote host closed the connection]
<Xeago>
from what I have seen, it is recommended to learn ruby a tiny bit, and then rails (not ruby)
<Xeago>
quote: "It feels like a different language"
jhchabran has joined #ruby
browndawg has joined #ruby
a_a_g has quit [Quit: Leaving.]
joofsh has joined #ruby
krawchyk has joined #ruby
kil0byte has quit [Ping timeout: 256 seconds]
ms__ has joined #ruby
sandGorgon1 has quit [Ping timeout: 272 seconds]
sandGorgon has quit [Ping timeout: 272 seconds]
kil0byte has joined #ruby
Spami has joined #ruby
<Spami>
hello
graeme has joined #ruby
lkba has quit [Ping timeout: 255 seconds]
sayan has quit [Read error: Connection reset by peer]
bluenemo has quit [Quit: Verlassend]
mockra has joined #ruby
diece has left #ruby [#ruby]
GoGoGarrett has joined #ruby
miskander has joined #ruby
nari_ has quit [Ping timeout: 252 seconds]
rondale_sc has joined #ruby
miskander has quit [Client Quit]
clocKwize has quit [Quit: clocKwize]
eka has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
jjbohn has quit [Quit: Leaving...]
mockra has quit [Ping timeout: 265 seconds]
jjbohn has joined #ruby
ltsstar has quit [Quit: ltsstar]
solidoodlesuppor has joined #ruby
thatguycraig has joined #ruby
jrajav has joined #ruby
alejandro_ has quit [Remote host closed the connection]
<alexspeller>
No, render :json => "success" just renders a page with nothing but "success"
<alexspeller>
which is not valid json
<alexspeller>
I just checkd
<alexspeller>
That's what it does
jenrzzz has joined #ruby
<alexspeller>
You need to either do this: render :success, nothing: true
<alexspeller>
That well render nothing with 200 response code, that's what you should do if you don't want any value apart from the fact that it worked
ms__ has quit [Quit: Quitte]
<alexspeller>
or if you have a value, you can do:
<alexspeller>
render json: {foo: "bar"}
<alexspeller>
And return a value
<Spami>
alexspeller, but then how can I check on the javascript side with only a 200 response code ?
lenovodroid has joined #ruby
<alexspeller>
You have an action, that can either fail or not, and that's the only output right?
<alexspeller>
So if it worked, render 200 response
danneu1 has quit [Ping timeout: 252 seconds]
jjbohn has quit [Quit: Leaving...]
<alexspeller>
If it didn't, return with a different response code that's a failure
<_sillymarkets>
if i leave the rescue block in, it catches every connection as "Connection Reset by Peer"... if comment it out, the entire loop succesfully connects and runs commands on each device, I cant figure out why the rescue isnt working
axl_ has joined #ruby
Rollabunna has joined #ruby
Rollabunna has quit [Remote host closed the connection]
lusory has joined #ruby
axl_ has quit [Client Quit]
miskander has joined #ruby
<alexspeller>
_sillymarkets: your rescue block applies to the begin structure, I think you have some confusion over the rescue and the end while bit
taoru has quit [Remote host closed the connection]
adamnbowen has joined #ruby
<_sillymarkets>
alexspeller : Im trying to get it to apply to the begin structure, I thought thats what was happening... if it fails on connect, i - 1, and retry the loop (effectively going to the next device connection on the list)
frem has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
<alexspeller>
This makes more sense, although you'll have to check it's still doing what you want to: https://gist.github.com/4337187
<alexspeller>
See how there are two begins, one for the while loop and one for the exception/rescue block
<_sillymarkets>
oh okay, i see what you are saying
Morkel has quit [Quit: Morkel]
thmzlt has joined #ruby
Uranio has joined #ruby
<alexspeller>
And remember, if there is no begin with a rescue, it applies to the whole method
hybRis has quit [Quit: Leaving]
<_sillymarkets>
okay
pu22l3r_ has quit [Remote host closed the connection]
<R3dy>
There are a dozen or more code snipets on the internet claiming to do exactly what I am trying to do
<R3dy>
which is send an email with a base64 encoded image in the body of the message
<R3dy>
none of them seem to acctually work
<R3dy>
so naturally I assume the problem is with my email server
<R3dy>
blocking images perhaps
<R3dy>
except I can send myself an email with an embeded image using a client
_nitti has joined #ruby
sayan has joined #ruby
clooth has joined #ruby
mmitchell has joined #ruby
MrSnakeOil has quit [Quit: MrSnakeOil]
cakehero has joined #ruby
willob has joined #ruby
zommi has left #ruby [#ruby]
jonathanwallace has joined #ruby
clocKwize has quit [Quit: clocKwize]
arkiver has quit [Ping timeout: 244 seconds]
hashpuppy has joined #ruby
<hashpuppy>
can i do module Admin::MyModule instead of module Admin; module MyModule?
<banisterfiend>
hashpuppy: probably
miskander has quit [Quit: miskander]
<alexspeller>
hashpuppy: only if module Admin is already defined elsewhere and is loaded prior to that definition
<hashpuppy>
that's right. thanks
samphippen has quit [Quit: Computer has gone to sleep.]
Guest25886 has joined #ruby
<banisterfiend>
hashpuppy: it also depends on whether you intend to write a method that uses constants defined in MyModule
<banisterfiend>
defined in Admin i mean
<banisterfiend>
if you do, then opening the module with Admin::MyModule won't work very well
chussenot has quit [Quit: chussenot]
sriehl has joined #ruby
failshell has joined #ruby
kil0byte_ has quit [Remote host closed the connection]
PragCypher has joined #ruby
pxjorge has quit [Quit: Leaving]
<failshell>
hello. i have the following JSON: http://pastebin.ca/2294936. I can't seem to figure out how to extract only the line tht has lpi-mongodb-03 in it, to extract the _id key
<failshell>
anyone can help?
malcolmva has quit [Ping timeout: 264 seconds]
<hoelzro>
failshell: what code do you have so far to solve this issue?
lkba has joined #ruby
<failshell>
none that works
<failshell>
i can easily extract one key
<failshell>
i tried using a regex to match the line
joshman_ has joined #ruby
rippa has joined #ruby
IrishGringo has joined #ruby
niklasb has joined #ruby
nateberkopec has joined #ruby
<hoelzro>
failshell: have you tried just loading the JSON using a JSON parser?
keymone has joined #ruby
tagrudev has quit [Remote host closed the connection]
<failshell>
a case of not enough coffeine
<failshell>
silly me
skaflem has left #ruby [#ruby]
Gue______ has joined #ruby
nomenkun has quit [Remote host closed the connection]
main has quit [Ping timeout: 250 seconds]
stoffus has quit [Quit: The computer fell asleep]
_nitti has quit [Remote host closed the connection]
DerkTheDaring has joined #ruby
jlast has joined #ruby
<DerkTheDaring>
Hey, quick question if anyone is around
<jkarayusuf>
more or less the splat is doing Array(value).flatten
C0deMaver1ck has joined #ruby
slainer68 has joined #ruby
<DerkTheDaring>
jkarayusuf: Thank you
thmzlt has joined #ruby
<Xeago>
thanks
mikecmpbll has joined #ruby
tfittsy has joined #ruby
<rismoney>
do i have this wrong - is_ip = is_type == ('ipaddress' || 'ip') does this mean if is_type eq 'ipaddress' or is_type eq 'ip' then is_ip = true ?
<Xeago>
rismoney: yes
mvangala has quit [Read error: Connection reset by peer]
<Xeago>
is_ip will always be false
<Xeago>
unless is_type = true
mvangala has joined #ruby
<Xeago>
as ('ipaddress' || 'ip') #=> true
Shamgar has quit [Ping timeout: 250 seconds]
<Xeago>
wait!
<rismoney>
doesn't seem to work in my rspec ;)
<Xeago>
scratch that
<Xeago>
('ipaddress' || 'ip') #=> 'ipaddress'
<Xeago>
so it is the same as is_type == 'ipaddress'
Shamgar has joined #ruby
graeme has quit [Quit: graeme]
dr_bob has joined #ruby
<rismoney>
let me try
miskander has joined #ruby
miskander has quit [Client Quit]
qwerxy has joined #ruby
huoxito has joined #ruby
natewalck has joined #ruby
<natewalck>
Morning
<natewalck>
What is the best way to get the differences between two arrays, either way
alex__c2022 has joined #ruby
<oqa>
nate: b - a
<natewalck>
right
<natewalck>
but what about a - b
<natewalck>
I want to know the differences in that direction as well
<oqa>
(b-a) + (a-b) maybe
miskander has joined #ruby
maesbn has quit [Remote host closed the connection]
Playground has joined #ruby
jgrevich has joined #ruby
<natewalck>
hrmm
<natewalck>
my problem may also be a sort issue
wallerdev has quit [Quit: wallerdev]
<natewalck>
the items are not in the same order, so I get interesting results
<oqa>
"may also be" sounds interesting
Steve1UK has joined #ruby
mvangala_ has joined #ruby
<shevy>
eeks
<shevy>
lisp!
<natewalck>
blah = ["a", "b"] bleh = ["b", "a"]
<rismoney>
xeago, strangely - this works for me... is_fs = (is_type == 'fileshare') || (is_type =='fs')
<Xeago>
rismoney: I wouldn't call that strange
mvangala has quit [Read error: Connection reset by peer]
<oqa>
natewalck: - ignores order
<natewalck>
oqa: on 1.8.7 as well?
<oqa>
I think so
<oqa>
it just looks at the items
<rismoney>
xeagi - but this doesn't do the same thing -- is_fs = is_type == ('fileshare' || 'fs') doesn't
earthquake has quit [Read error: Operation timed out]
<oqa>
natewalck: if you're worried about the order, you'll anyways need to figure out what is the right way to order the lists if a & b are in different order
<rismoney>
why is fileshare a true'th value if it is nil (imho)
<natewalck>
I also realized
manizzle has quit [Ping timeout: 260 seconds]
<natewalck>
I'm working with ObjC arrays, not ruby arrays
<Xeago>
('fileshare' || 'fs') 'fileshare' is a string
<natewalck>
which may explain the funkyness
<natewalck>
I should probably convert them to ruby arrays
<rismoney>
yes
judd7_ has joined #ruby
<rismoney>
oh...
<oqa>
natewalck: out of curiosity, how are you using objc arrays in ruby?
<rismoney>
i get it xeago!
<natewalck>
oqa: I am reading settings from a plist and comparing them to another plist's contents
<natewalck>
if there is a server listed in one but not the other, or vice versa, I want to run a process
<rismoney>
and because its a logical or, if fileshare is string and true'th it will eval to true
mmitchell has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
<natewalck>
when I manually create an array in irb and do the subtract, it works fine
<natewalck>
but when I do it with the ObjC arrays, it does not....
<Xeago>
rismoney: actually it will eval to 'fileshare'
weasels is now known as otters
<oqa>
natewalck: I guess that depends on how smart the layer is between ruby and objc
<natewalck>
apparently not very :)
<natewalck>
I'm trying to use to_ary
jekotia has joined #ruby
judd7_ has quit [Client Quit]
<natewalck>
doesn't seem to be doing what I think it should
carloslopes has quit [Remote host closed the connection]
<oqa>
what are the objects in the arrays?
judd7_ has joined #ruby
carloslopes has joined #ruby
<oqa>
- won't work if the objects do not behave in a friendly way
<natewalck>
they are servers in FQDN form
judd7_ has quit [Client Quit]
vlad_sta_ has joined #ruby
<natewalck>
strings
<natewalck>
I believe
<rismoney>
xeago - right
<rismoney>
coolio
vlad_sta_ has quit [Client Quit]
<natewalck>
oqa: let me give you a better example of the weirdness I've encountered
<natewalck>
I have server_list1 = ["server01.company.com", server02.company.com"]
zigomir has quit [Read error: Connection reset by peer]
<natewalck>
but server_list1 - server_list2 returns both entries
vlad_starkov has quit [Ping timeout: 255 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
zigomir has joined #ruby
<oqa>
you're missing "s
<oqa>
;)
<sifi|workd>
natewalck: yeah, it works fine on my system
<natewalck>
sifi|workd: using ObjC?
Spami has quit [Ping timeout: 272 seconds]
<natewalck>
or native ruby arrays?
<natewalck>
It works when I am working with native ruby arrays
vlad_starkov has joined #ruby
<sifi|workd>
natewalck: sorry, native ruby arrays
<natewalck>
when I am using ObjC arrays, it behaves as I described :(
Spami has joined #ruby
<bean>
this is #ruby not #objc ?
<natewalck>
bean: its osx/cocoa
<natewalck>
a ruby module
<natewalck>
(gem?)
<sifi|workd>
Are you talking about MacRuby?
fjfish has joined #ruby
adelgado has joined #ruby
<bean>
no, RubyCocoa apparently.
<natewalck>
yea, RubyCocoa
<natewalck>
I'm using it for reading plists
postmodern has quit [Quit: Leaving]
<sifi|workd>
I haven't touched that yet. GL.
<bean>
natewalck: you do know there is just a plist gem, right?
<natewalck>
bean: yea, I am writing this so it works without any external dependancies
ltsstar has joined #ruby
<natewalck>
I wonder if the Plist gem handles binary plists
<bean>
o.o and osx/cocoa isn't an external dependancy?
tjbiddle has joined #ruby
<natewalck>
bean: nope, built in to OS X
vlad_starkov has quit [Ping timeout: 252 seconds]
<bean>
1.9.3-p327 :001 > require 'osx/cocoa'
<bean>
LoadError: cannot load such file -- osx/cocoa
<natewalck>
external as in something I don't need to install along with my script
francisfish has quit [Ping timeout: 264 seconds]
<natewalck>
are you on OS X?
<bean>
yes sir.
<natewalck>
version?
Villadelfia has joined #ruby
<natewalck>
oh
<natewalck>
you are using a non-standard ruby version
<adelgado>
newb here: I have a call to a model that looks something like class.find(id).many_children.max_by( &:id ). The max_by is the wrong way to get to the right child. What would kind of syntax do I have available to me to select a child based on a value returned in the class.find(id) call? Do I have to break it up into two statements?
<natewalck>
OS X ships with 1.8.7
<natewalck>
you installed 1.9.3 it looks like
<bean>
natewalck: the majority of people that care about ruby on OSX will have done some sort of RVM install of something better than 1.8
<bean>
1.8 is old and jank, 1.9+ is new and awesome
<natewalck>
bean: I am managing client machines
SeySayux has joined #ruby
<natewalck>
so I need it to just work
<natewalck>
without upgrading ruby, managing the default version, etc
<natewalck>
plus, I can hand this to anyone running 10.8 and it will work
<natewalck>
probably 10.6 through 10.8
carloslopes has quit [Remote host closed the connection]
<bean>
natewalck: can I see the objc part, then? I'll see what I can make of it.
JohnBat26 has quit [Remote host closed the connection]
lenovodroid has quit [Read error: Connection reset by peer]
failshell has quit [Quit: Lost terminal]
<natewalck>
I can tell you what I am loading it with
<adelgado>
natewalck: I kind of went through that yesterday. I wanted to keep 1.8.7. Once I went into xcode and installed the command line tools, gem and other utils started working fine, too.
fyolnish has quit [Remote host closed the connection]
JohnBat26 has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
mark_locklear has quit [Read error: Connection reset by peer]
<havenn>
nipar: I'd recommend slogging some of the way through some of Ruby Koans, even if it doesn't make a lot of sense first pass. (Maybe after TryRuby.org?): http://koans.heroku.com/
gregorg_taf has joined #ruby
gregorg has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
ToTo has joined #ruby
mikeg has joined #ruby
rburton- has joined #ruby
maletor has joined #ruby
Uranio has quit [Quit: WeeChat 0.3.8]
banisterfiend has joined #ruby
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
lenovodroid has quit [Read error: Connection reset by peer]
Goles has quit [Ping timeout: 264 seconds]
Astral has joined #ruby
Astral is now known as Guest97488
codezombie has joined #ruby
JohnBat26 has joined #ruby
Guest97488 is now known as Astral___
Hanmac1 is now known as Hanmac
Astral__ has quit [Ping timeout: 246 seconds]
dankest is now known as dankest|away
dankest|away is now known as dankest
arturaz has quit [Ping timeout: 272 seconds]
IrishGringo has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
Xeago has quit []
percival_ has quit [Ping timeout: 246 seconds]
Xeago has joined #ruby
tessi has quit [Ping timeout: 246 seconds]
kenneth has quit [Quit: kenneth]
tessi has joined #ruby
blueoxigen has joined #ruby
fmcgeough has joined #ruby
DanBoy has joined #ruby
noxoc has quit [Quit: noxoc]
lenovodroid has joined #ruby
brianpWins has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
jkarayusuf has quit [Remote host closed the connection]
turtlehat has joined #ruby
mmitchell has quit [Read error: Connection reset by peer]
<Kuifje>
don't be fooled by the pastebin! use the recyclebin
rakuN has joined #ruby
<rking>
Tumulte: Oh, you'll need a -dev package
<shevy>
InitializeMagick() in -lMagick++... no
friskd has joined #ruby
<shevy>
Tumulte I think your libMagick++.so is not complete or not existing. sometimes there could be a bogus error, cascading down, often when a .h file is missing
<shevy>
GNU autoconfigure really sucks, it must die one day
<rking>
Tumulte: ImageMagick-devel
browndawg1 has left #ruby [#ruby]
rdark has quit [Quit: "beertime"]
gregorg_taf has quit [Read error: Connection reset by peer]
willob has quit [Remote host closed the connection]
<JustAWife016>
i think he expects correct code from me... because he always gets geeky gifts from me.. but this time i have no chance to do it on myself
<rking>
sleep 1 until Date.today == Date.parse('2012-03-23'); Coupon.new(for: 'you!')
<JustAWife016>
thats why im here
madhadron has left #ruby [#ruby]
<slash_nick>
aw
<hoelzro>
I like rking's suggestion there; it's a more correct version of what I wrote
<Tumulte>
rking: searching this error doesn't give me much neither
gyre007 has quit [Remote host closed the connection]
<JustAWife016>
&& or and
matip_ has joined #ruby
<matip_>
Hello
<shevy>
loop { sleep 1; if Date.today == Date.parse('2012-03-23'); husband.go(:to =>'Conference'); break; end }
akemrir has quit [Ping timeout: 246 seconds]
<matip_>
what interactive shell do you use?
<shevy>
matip_ irb
<matip_>
irb is pretty basic, there should be something better
<shevy>
you want an interactive vim-like editor for ruby!
<JustAWife016>
shevy, the other one looks (just for me) greater :-)
Goles has quit [Quit: Computer has gone to sleep.]
hoelzro|away is now known as hoelzro
<shevy>
JustAWife016 ok but look at it again
<shevy>
this part:
<shevy>
"break &&husband.go"
rondale-sc has quit [Quit: WeeChat 0.3.9.2]
<shevy>
you dont see that in code really, if at all then this instead:
<shevy>
"break && husband.go"
<matip_>
I want something... like...
<JustAWife016>
yes i did it like this, but i was typing to fast
<JustAWife016>
ok, then i have it...
Dario_ has joined #ruby
<slash_nick>
Yay
<JustAWife016>
thanks a lot
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<matip_>
irb doesn't have code autocomplete, that says all about it
<JustAWife016>
i will tell my husband, that you worked hours to help me
<shevy>
matip_, what do you mean with code autocomplete... Readline completion proc works, even for methods
<shevy>
require 'irb/completion'
<matip_>
if I write a = [] and then "a.", I want a list of methods
<matip_>
for example
<JustAWife016>
byebye
<eka>
matip_: shevy: try pry
<shevy>
that works fine here matip_
<matip_>
really? o.o
<shevy>
go start irb, do require 'irb/completion' then the code you showed
<shevy>
yes
JustAWife016 has quit [Quit: irc2go]
<matip_>
ah, you have to require irb/completion
<shevy>
though you may need Readline, I am not sure... perhaps not hmm
jonathanwallace has quit [Ping timeout: 252 seconds]
<matip__>
something like that ^
<matip__>
for Ruby
<shevy>
perhaps the vim guys allow you to replace shell scripts with ruby scripts
<shevy>
I mean it would have the functionality
<shevy>
just feed that data from ruby to zsh
bean has quit [Read error: Connection reset by peer]
<shevy>
sorry
<shevy>
I meant zsh, not vim
bean has joined #ruby
<matip__>
lol, no... it's totally different
<matip__>
zsh can help me with the ruby params
<matip__>
but I mean... to discover methods and so on
<matip__>
it must be a ruby interpreter
<hoelzro>
or hooked up to one
rburton- has joined #ruby
krawchyk_ has joined #ruby
<matip__>
I don't think zsh can help in this case. it doesn't know anything about ruby's syntax
roychri has quit [Read error: Connection reset by peer]
<aedorn>
xiki+vim?
<hoelzro>
matip__: isn't that up to the completion plugin?
<rburton->
xiki is nice I was hanging out with craig bright guy
ryanf_ has joined #ruby
<shevy>
but ruby could feedback that information to zsh
<matip__>
well, I never seen anything like that
<matip__>
have you?
<shevy>
no
<matip__>
I've *
<shevy>
but I use bash
<shevy>
I was too lazy to learn zsh
<matip__>
haha
<matip__>
you should
<shevy>
I tried, but the thing is
<shevy>
I dont need what zsh gives me
daniel_hinojosa has joined #ruby
<shevy>
I dont use shell scripts, I use ruby scripts
<shevy>
my prompt shows only the current working directory
ryanf_ has quit [Client Quit]
<TTilus>
pry will eventually become The Ruby Shell
<shevy>
and I will use bash only until I have finished a shell replacement one day
Godd2 has joined #ruby
<TTilus>
its already almost there
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
ryanf_ has joined #ruby
<shevy>
matip__, I dont think those extensions should be tied to any one shell either... I want bash to use RPROMPT too for instance
ryanf has quit [Quit: leaving]
krawchyk has quit [Ping timeout: 244 seconds]
<stevechiagozie>
matip__ pry gets about as close to zsh completion as you're gonna get right now. check out http://vimeo.com/26391171
Steppen has joined #ruby
audy has joined #ruby
<audy>
how do I get lazy Enumerable#zip like Python's itertools.izip ?
<audy>
I know about #Enumerable.lazy.zip in 2.0 but I need this to work in 1.8.7
PragCypher has quit [Quit: Leaving]
gregorg_taf has joined #ruby
`gregorg` has quit [Read error: Connection reset by peer]
thmzlt has quit [Remote host closed the connection]
daganu has joined #ruby
daniel_hinojosa has quit [Ping timeout: 256 seconds]
LouisGB has quit [Ping timeout: 256 seconds]
Goles has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
cousine has quit [Remote host closed the connection]
_sillymarkets_ has joined #ruby
F1skr has joined #ruby
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
_sillymarkets has quit [Ping timeout: 245 seconds]
_64k has joined #ruby
Godd2 has quit [Ping timeout: 245 seconds]
_64k has quit [Client Quit]
axl_ has quit [Quit: axl_]
shevy2 has joined #ruby
Divinite has joined #ruby
gregorg_taf has joined #ruby
`gregorg` has quit [Read error: Connection reset by peer]
friskd has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
eldariof has quit []
shevy has quit [Ping timeout: 244 seconds]
t_hash has joined #ruby
friskd has quit [Client Quit]
a_a_g has quit [Quit: Leaving.]
ryanf has joined #ruby
gordon1775 has joined #ruby
daniel_hinojosa has joined #ruby
lenovodroid has quit [Remote host closed the connection]
thams has quit [Quit: thams]
grzywacz has joined #ruby
ryanf_ has quit [Ping timeout: 265 seconds]
chrismcg is now known as zz_chrismcg
havenn has quit [Remote host closed the connection]
nomenkun has joined #ruby
Goles has joined #ruby
Russell^^ has joined #ruby
havenn has joined #ruby
darthdeus has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
gregorg_taf has joined #ruby
wermel has quit [Remote host closed the connection]
aarkerio has joined #ruby
simontol has quit [Quit: Ex-Chat]
<aarkerio>
hi! how can I debug a ruby.rb script ? I mean, how can I print an array or an object
daniel_hinojosa has quit [Ping timeout: 255 seconds]
<speakingcode>
puts
<aarkerio>
I tried: puts debugger(myRubyObject)
havenn has quit [Ping timeout: 250 seconds]
caveat- has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
alex__c2022_ has joined #ruby
jonathanwallace has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
i_s has joined #ruby
dougireton has joined #ruby
Goles has joined #ruby
<green_leaf>
shevy: What is "opts" in this example? I get the block in the curly brackets, but are we also passing parameters to a lambda? ( @something ||= ->(opts) {raise NotImplemented })
<green_leaf>
or anyone...
blaxter has quit [Quit: foo]
aarkerio has left #ruby ["Leaving"]
alex__c2022 has quit [Ping timeout: 265 seconds]
alex__c2022_ is now known as alex__c2022
thmzlt has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
gregorg_taf has joined #ruby
pyr0commie has joined #ruby
nik_-_ has joined #ruby
thmzlt has quit [Remote host closed the connection]
iamjarvo has joined #ruby
thmzlt has joined #ruby
Steppen has left #ruby ["Leaving"]
arturaz has joined #ruby
carloslopes has quit [Remote host closed the connection]
darthdeus has quit [Read error: Connection reset by peer]
<audy>
enum_for
<audy>
aapzak p object works too
<audy>
aapzak it calls inspect
otters has quit [Ping timeout: 260 seconds]
<apeiros_>
green_leaf: yes, it's the params
<apeiros_>
green_leaf: `foo ->(bar) { …code… }` is equivalent to the older (still valid) syntax: `foo proc { |bar| … code… }`
<banisterfiend>
apeiros_: r u a -> sympathiser
krawchyk_ has quit [Remote host closed the connection]
<green_leaf>
apeiros_: that makes sense now... thanks.
<apeiros_>
banisterfiend: not yet. I use it in pry, e.g. with benchmarks
gregorg_taf has quit [Read error: Connection reset by peer]
`gregorg` has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
<shevy>
apeiros_ hehe
<apeiros_>
JDubs: you mist a shevyism
<apeiros_>
*missed
lenovodroid has joined #ruby
<JDubs>
what is a shevyism lol
cantonic_ has joined #ruby
<Divinite>
Hahahahahahha
<Divinite>
It's where shevy forgets he's in #ruby
<Divinite>
And posts his most fanciful dreams
<Divinite>
^JDubs
<shevy>
heyyyyy
<shevy>
someone else here wanted chaining first :(
<Divinite>
Heya shevy
cantonic has quit [Ping timeout: 250 seconds]
cantonic_ is now known as cantonic
<shevy>
I am merely guilty of the whipping
<JDubs>
wtf
<JDubs>
shevy is into bdsm eh?
banisterfiend has quit [Remote host closed the connection]
<Divinite>
JDubs: It appears
<Divinite>
That or he's an actor
<JDubs>
Well...We all have weird things...I like to have either http://heyyeyaaeyaaaeyaeyaa.com/ or lookatmyhorsemyhorseisamazing.com playing in the background looping lol
doodlehaus has quit [Remote host closed the connection]
<JDubs>
xD
Eiam has joined #ruby
_sillymarkets_ has quit [Ping timeout: 245 seconds]
LBRapid has quit [Quit: Farewell.]
BadProphet has quit [Remote host closed the connection]
dougireton has joined #ruby
<shevy>
JDubs nah not really
_alejandro has joined #ruby
<shevy>
JDubs it's the mere thought alone
<shevy>
I can forever say skydiving seems awesome, but I am never going to do it myself :(
<shevy>
or writing C code is awesome...
nomenkun has quit [Remote host closed the connection]
Blue_Ice has quit [Ping timeout: 260 seconds]
bwlang has joined #ruby
arturaz has quit [Remote host closed the connection]
<JDubs>
shevy: why don't you try the things you think would be awesome?
xnm has quit [Ping timeout: 252 seconds]
nomenkun has joined #ruby
<JDubs>
shevy: YOLO amirite? lol
<shevy>
JDubs nah, too conservative. motorcycles look cool too, especially the heavy ones, but I don't fancy a crash with them, so I will never get one
gregorg_taf has quit [Read error: Connection reset by peer]
`gregorg` has joined #ruby
mrsolo has joined #ruby
kirun has quit [Quit: Client exiting]
<JDubs>
shevy: I've had 4 motorcycles, they really aren't that dangerous...wear proper safety gear and ride defensively
alex__c2022 has quit [Remote host closed the connection]
* slash_nick
squints at the line between fantasy and reality
<Divinite>
shevy: Just walk on the nearest street, grab the hottest girl, and do whatever you want
<Divinite>
Lol
alex__c2022 has joined #ruby
<JDubs>
shevy: why are you afraid to live bro?
sailias has quit [Quit: Leaving.]
<Divinite>
^that
<JDubs>
shevy: get out there and enjoy life man
<JDubs>
if you live near me ill take you out for a beer man
<JDubs>
where you from?
piotr_ has joined #ruby
<Divinite>
Haha
dankest|away is now known as dankest
skrite has joined #ruby
<blazes816>
see shevy this chan seems to be full of guys wanting to date you
xnm has joined #ruby
<slash_nick>
lol
LouisGB has joined #ruby
<aedorn>
Life is scary.. it's full of things that'll kill you.
<JDubs>
blazes816 lol...
tommyvyo has quit [Quit: Computer has gone to sleep.]
<shevy>
JDubs I dunno, I think the days of high risk are kinda over :(
miskander has joined #ruby
<JDubs>
shevy: how old are you? you talk like you are 90...
<shevy>
JDubs 4 motorcycles omg
banisterfiend has joined #ruby
<JDubs>
shevy: how. old. are. you.
sepp2k has quit [Remote host closed the connection]
gordon1775 has quit [Read error: Connection reset by peer]
<aedorn>
sirecote: If you must use Windows, then yes. Well... at least it used to be pretty damn decent. I'm sure it still is
<shevy>
bit too old for most things :(
chessguy has joined #ruby
SJr has quit [Ping timeout: 264 seconds]
<sirecote>
aedorn: thanks, the joys of working in a windows shop
<apeiros_>
waxjar: what brackets?
<bean>
sirecote: protest and install a linux VM
<apeiros_>
waxjar: brackets are []
<waxjar>
ah, *parenthesis
<apeiros_>
you probably mean parens, but still, which ones?
<shevy>
waxjar hmm good question
<waxjar>
the ones around gsub!s arguments apeiros_
<apeiros_>
ah, method call
<havenn>
waxjar: Interesting that if you remove the space following '/' it works. Odd parsing.
<shevy>
the gsub vs gsub() ones
<apeiros_>
waxjar: 5 / 6
<apeiros_>
/ can be a method call too
<sirecote>
bean: infrastructure guys don't want to support it unfortunately...
<shevy>
seems like a simple enough answer :)
<waxjar>
ah, makes sense
mikeg has quit [Disconnected by services]
<apeiros_>
and probably because your regex starts with a space…
<sirecote>
they won't even let us dual boot our desktops :s
<apeiros_>
try what happens with '/\x20' instead of '/ '
<bean>
sirecote: ah, this is not a solution for just you? I'm an infrastructure guy and I say people cna do what they want as long as I dont have to fix it
Maniacal has joined #ruby
ossareh has joined #ruby
<apeiros_>
bean: had that agreement with our infrastructure guys. worked pretty well for both sides :)
sepp2k has joined #ruby
<bean>
agreed.
<waxjar>
that works wonderfully apeiros_, thanks
<bean>
i occasionally help w/ VMs and shit breaking, but most of the time it's "i dunno, reinstall it, i didnt install it"
<apeiros_>
waxjar: also %r{…} would probably work
<sirecote>
bean: yeah i think that's the method we'll go down when we move pitch the idea to move it off windows
<bean>
my shop was 90% windows 5 years ago
<bean>
we're down to 2 windows servers, and 2 windows PCs
thmzlt has quit [Remote host closed the connection]
<sirecote>
bean: nice, baby steps for us hah
gregorg_taf has quit [Read error: Connection reset by peer]
<bean>
its def a process but very worth it
<aedorn>
we're pro Microsoft here. Even use Microsoft Online Services for email. (it breaks every other day)
* bean
is coming to you LIVE from a macbook air
`gregorg` has joined #ruby
slainer68 has joined #ruby
<shevy>
hmmm
Astral__ has joined #ruby
<shevy>
bean, I imagine you wear italian clothes
<bean>
far from it
davejacobs has joined #ruby
ltsstar has quit [Quit: ltsstar]
marr has joined #ruby
zerserker has joined #ruby
Astral_ has quit [Ping timeout: 256 seconds]
Kuifje has quit [Ping timeout: 248 seconds]
gregorg_taf has joined #ruby
`gregorg` has quit [Read error: Connection reset by peer]
<shevy>
hmmm
<shevy>
jeans + macbook air then
Neomex has joined #ruby
Neomex has quit [Client Quit]
<aedorn>
Near everyone at rubyconf used a macbook. I felt displaced booting up linux in the presence of all those glowing apples
hashpuppy has quit [Quit: hashpuppy]
jkarayusuf has quit [Remote host closed the connection]
<bean>
shevy: jeans, macbook air, tshirt from local college's basketball team
<bean>
so, you win
Astral has joined #ruby
samuel02 has quit [Remote host closed the connection]
kirun has joined #ruby
Astral is now known as Guest90211
tvw has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
gregorg_taf has joined #ruby
twoism has quit [Read error: Connection reset by peer]
w|t has quit [Quit: No Ping reply in 150 seconds.]
twoism has joined #ruby
Astral__ has quit [Ping timeout: 265 seconds]
ebouchut has joined #ruby
Iszak has quit []
aldodelgado has joined #ruby
ebouchut has quit [Client Quit]
beiter has quit [Quit: beiter]
answer_42 has quit [Ping timeout: 276 seconds]
w|t has joined #ruby
w|t has joined #ruby
w|t has quit [Changing host]
d2dchat has quit [Remote host closed the connection]
Iuz has quit [Read error: Connection timed out]
Iuz has joined #ruby
<the_jeebster>
are there any asynchronous callbacks in ruby?
Iuz has joined #ruby
Iuz has quit [Changing host]
sriehl has quit [Remote host closed the connection]
thmzlt has joined #ruby
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
<shevy>
bean hey cool... at least you support a local team
Goles has quit [Quit: Computer has gone to sleep.]
<bean>
haha yep
<shevy>
I always cheered for the opponents ;)
bent has joined #ruby
mengu has quit [Quit: Konversation terminated!]
rakuN has quit [Remote host closed the connection]
tommyvyo_ has joined #ruby
rondale_sc has left #ruby [#ruby]
ner0x has quit [Quit: Leaving]
mark_locklear has quit [Read error: Connection reset by peer]
havenn has quit [Read error: Connection reset by peer]
_alejandro has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
rondale_sc has quit [Client Quit]
havenn has joined #ruby
davejacobs has quit [Quit: leaving]
dougireton has quit [Quit: Leaving.]
spathi has joined #ruby
w|t_ has joined #ruby
nomenkun_ has joined #ruby
`gregorg` has quit [Read error: Connection reset by peer]
gregorg_taf has joined #ruby
w|t has quit [Read error: No route to host]
bigmcq77 has joined #ruby
dougireton has joined #ruby
_sillymarkets has joined #ruby
aldodelgado has quit [Quit: aldodelgado]
nomenkun has quit [Ping timeout: 246 seconds]
dmerrick has quit [Ping timeout: 264 seconds]
francisfish has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 246 seconds]
w|t_ has quit [Quit: No Ping reply in 150 seconds.]
w|t has joined #ruby
Iuz has quit [Read error: Connection timed out]
<the_jeebster>
if I have two arrays of integers and I need to multiple each value at the proper index of each array together, what's the most efficient way of performing this calculation?
Iuz has joined #ruby
dawkirst_ has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
thecreators has joined #ruby
chussenot has joined #ruby
havenn has quit [Read error: No route to host]
havenn has joined #ruby
<hoelzro>
the_jeebster: sounds like zip
sn0wb1rd has quit [Quit: sn0wb1rd]
<the_jeebster>
hoelzro: yikes, looks hair either way to go about it
<the_jeebster>
a = [1, 2, 3] b = [1,2,3] need to be able to do a[0] * b[0] etc.
w|t has quit [Client Quit]
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
w|t has joined #ruby
asteve has quit [Quit: Computer has gone to sleep.]
thatguycraig has quit [Quit: Leaving.]
billy_ran_away has quit [Ping timeout: 255 seconds]
jrochkind has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
billy_ran_away has joined #ruby
gregorg_taf has joined #ruby
`gregorg` has quit [Read error: Connection reset by peer]
pcarrier has joined #ruby
woolite64 has quit [Ping timeout: 260 seconds]
`gregorg` has joined #ruby
dbrgn has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
gregorg_taf has quit [Read error: Connection reset by peer]
abrausch has joined #ruby
<banisterfiend>
the_jeebster: i = []; a.zip(b) { |v1, v2| i << v1 * v2 }
<dbrgn>
is there a way to get a list of all classes defined in the current file? something similar to locals() in python...
<apeiros_>
a.zip(b).map(&:*)
woolite64 has joined #ruby
<apeiros_>
the_jeebster: also use ; to create valid one-line code in irc
<apeiros_>
(; instead of newline)
<apeiros_>
oh, &:* noworky? :(
elico has joined #ruby
<apeiros_>
gah, well, then a.zip(b).map { |x,y| x*y }
<oz>
nope :)
<apeiros_>
why ever &:* fails
atno has quit [Ping timeout: 260 seconds]
<banisterfiend>
apeiros_: nice
<oz>
because it's called with an array, and map's expansion is not done
elico has quit [Remote host closed the connection]
<oz>
smthg like that I guess
jenrzzz has joined #ruby
<apeiros_>
yeah, probably single object yielded
darthdeus has quit [Quit: Leaving...]
<apeiros_>
so it tries [a,b].*()
<apeiros_>
instead of a.*(b)
Iuz has quit [Read error: Connection timed out]
nomenkun_ has quit [Remote host closed the connection]
Iuz has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
<oz>
it'd be nice though :)
gregorg_taf has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
`gregorg` has quit [Read error: Connection reset by peer]
<slash_nick>
banisterfiend: yeah, but i did NOT read what whoever was trying to get
<banisterfiend>
slash_nick: well your code results in:
<slash_nick>
just [a,b].*() instead of a.*(b)
<banisterfiend>
[21] pry(main)> [a,b].inject(&:*)
<banisterfiend>
TypeError: can't convert Array into Integer
<banisterfiend>
:P
<banisterfiend>
slash_nick: looks alluring though
<slash_nick>
lol... I tried with [1,2] instead of [a,b]
* slash_nick
just wants to participate, sheesh
<oz>
in that case, "1*2" is even shorter :)
thams has quit [Quit: thams]
Banistergalaxy has joined #ruby
<slash_nick>
oz, but [1,2,3,4,5,6].inject(:*) is shorter than __
Banistergalaxy has quit [Client Quit]
<oz>
you're right :)
<dorei>
from C, I urlencode a wchar_t *, and then post it to sinatra, at sinatra side, is there a way after urldecoding, to convert the wchar_t * into a Ruby String?
Banistergalaxy has joined #ruby
larissa has joined #ruby
atmosx has joined #ruby
mkillebrew has quit [Read error: Connection reset by peer]
gregorg_taf has quit [Read error: Connection reset by peer]
`gregorg` has joined #ruby
<oz>
dorei: what do you get after urldecoding? :)
<dorei>
it depends
<dorei>
if the original string was not unicode
<dorei>
i get a \0 inserted after every second char
<dorei>
i guess that's what wchar is
iamjarvo has quit [Quit: Leaving.]
flip_digits has joined #ruby
mengu has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<oz>
well wchar are *usually* unicode, but there is no guarantee of that iirc
<oz>
and ruby 1.9 strings' encoding defaults to UTF-8
cdt_ has quit [Ping timeout: 272 seconds]
<oz>
"string".encoding # => #<Encoding:UTF-8>
mkillebrew has joined #ruby
<ryanf>
oz: that is actually not true in general
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<ryanf>
it's usually true in irb or whatever, I think because of locale maybe?
<ryanf>
but string literals in scripts are just ascii unless you include a magic comment
<slash_nick>
(&:/win 3
<slash_nick>
hilarious
<ryanf>
I think that might be different in ruby 2.0 though
maletor has joined #ruby
generalissimo has joined #ruby
Xeago has quit [Remote host closed the connection]
doodlehaus has quit [Remote host closed the connection]
Averna has joined #ruby
<oz>
ryanf: er, yup I assumed the world was using a rather common locale :p
atno has joined #ruby
<JDubs>
good night guys
<JDubs>
o/
<ryanf>
oz: yeah, my point is that that's true of the console but not of scripts
<ryanf>
no matter what your locale is, string literals in scripts are always US-ASCII unless you have a magic comment
<dorei>
okie
<dorei>
is there a way to convert utf-8 into utf-16?
<gbchaosmaster>
'Night JDubs
<dorei>
or rather, not convert
<gbchaosmaster>
\o
mmitchell has joined #ruby
thecreators has quit [Quit: thecreators]
<dorei>
my string is utf-16, how every my_string.encoding shows utf-8
havenn_ has joined #ruby
<apeiros_>
ryanf: wasn't there some env variable which could change that too? (horrible idea IMO)
havenn has quit [Ping timeout: 252 seconds]
jlast has quit [Ping timeout: 244 seconds]
<rismoney>
i love when rspec passes. wohoo :)
gregorg_taf has joined #ruby
`gregorg` has quit [Read error: Connection reset by peer]
joeycarmello has quit [Remote host closed the connection]
dorei has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
whomp has joined #ruby
mele- has joined #ruby
jonathanwallace has joined #ruby
jeffreybaird has joined #ruby
SJr has quit [Ping timeout: 250 seconds]
jonathanwallace has quit [Client Quit]
Spami has joined #ruby
dougireton has joined #ruby
<iamjarvo>
kk, so i want to create an fnm file from data that i have and I am trying to figure out ho wot convert to the fnm file format. I am not sure about what maps to to what to create the file
gregorg_taf has quit [Read error: Connection reset by peer]
aaronmacy1 has joined #ruby
aaronmacy has quit [Read error: Connection reset by peer]
__BigO__ has quit [Remote host closed the connection]
dougireton has quit [Quit: Leaving.]
xhoy has quit [Read error: Operation timed out]
miskander has quit [Quit: miskander]
`gregorg` has quit [Read error: Connection reset by peer]
gregorg_taf has joined #ruby
willob has quit [Quit: Leaving.]
bigmcq77 has quit [Quit: Computer has gone to sleep.]
clooth has quit [Quit: clooth]
sqbell has joined #ruby
jonathanwallace has joined #ruby
fir_ed has joined #ruby
jonathanwallace has quit [Client Quit]
ViperMaul|_ has quit [Ping timeout: 248 seconds]
jonathanwallace has joined #ruby
jjang has joined #ruby
pwelch has joined #ruby
pwelch has quit [Client Quit]
thmzlt has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 248 seconds]
lenovodroid has quit [Ping timeout: 260 seconds]
gregorg_taf has quit [Read error: Connection reset by peer]
`gregorg` has joined #ruby
Divinite has quit [Ping timeout: 252 seconds]
kirun has quit [Quit: Client exiting]
jenrzzz has joined #ruby
frem has quit [Quit: Computer has gone to sleep.]
friskd has joined #ruby
<JDubs>
Anyone used rhomobile to make an adroid app?
thmzlt has joined #ruby
Divinite has joined #ruby
sqbell has quit [Quit: leaving]
jonathanwallace has quit [Client Quit]
jamesaxl has joined #ruby
izltd has joined #ruby
izltd has left #ruby [#ruby]
`gregorg` has quit [Read error: Connection reset by peer]
gregorg_taf has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
pyx has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
pyx has quit [Client Quit]
Siphonblast has joined #ruby
pu22l3r has quit [Remote host closed the connection]
sealeaf1 has joined #ruby
<sealeaf1>
Hi, I'm trying to dynamically create an attribute on an object, but I'm getting an undefined method error
<sealeaf1>
I'm doing object.x = "hello", but it's giving me undefined method x
<sealeaf1>
Is there a different way to do this in Ruby?
<JDubs>
What might cause an error like this: "unable to convert "\x93" from ASCII-8BIT to UTF-8 for lib/extensions/pdf-writer/pdf/writer/object/page.rb, skipping
<JDubs>
"
gregorg_taf has quit [Read error: Connection reset by peer]
<JDubs>
sealeaf1 you could write a no_method method to turn whatever method is given into an accessor I suppose
<JDubs>
that's the only idea I have, because I'm new to ruby
`gregorg` has joined #ruby
<sealeaf1>
JDubs: Thanks.
banisterfiend has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 255 seconds]
kuzushi has quit [Ping timeout: 252 seconds]
zerserker has quit [Ping timeout: 260 seconds]
anachronistic has quit [Quit: anachronistic]
nateberkopec has quit [Quit: Leaving...]
_nitti has joined #ruby
Axsuul has joined #ruby
whomp has joined #ruby
hydrozen has joined #ruby
_nitti has quit [Client Quit]
<hydrozen>
How would you proceed to calculate a digest for the content of a directory? you tar the directory and calculate a md5 or sha-1? Will that give the same results on different machines/platforms?
dawkirst_ has joined #ruby
<atmosx>
hydrozen: absolutely yes
freeayu has joined #ruby
<hydrozen>
are there some special options i should pass to tar? I'm trying on 2 machines and getting different md5
axl_ has quit [Quit: axl_]
<atmosx>
hydrozen: otherwise there would be no point in using hashes for data integrity check
<atmosx>
hydrozen: on the same file?
JDubs has quit [Remote host closed the connection]
<hydrozen>
i'm taring a directory with directories in it and files
otters has quit [Ping timeout: 255 seconds]
<hydrozen>
and doing that operaration on 2 machines gave 2 tars that seem different