<comf>
... produces an "Invalid Identifier" http response due to null values being passed to the endpoint instead of the data.
Ancient has quit [Ping timeout: 264 seconds]
<n_blownapart>
hi if you have if, elsif, elsif, else logic, technically which expressions get an end keyword. if if and else are one statement, it seems to me that elsif blah and elsif blahblah would be two separate statements.
econerd4ever has quit [Remote host closed the connection]
<comf>
jhass: That worked! Thanks.
econerd4ever has joined #ruby
<n_blownapart>
that is excellent. jhass thanks. the doors of perception are cleansed.
robustus has quit [Ping timeout: 250 seconds]
hatzopoulos has joined #ruby
<comf>
jhass: Is there a tool like wrk which can work with curl?
<jhass>
what does wrk do?
<comf>
Many concurrent http requests
<n_blownapart>
I knew it was simpler than my convoluted approach ^
<comf>
For stress testing anything http.
robustus|Off has joined #ruby
<comf>
jhass: It was an improvement over `ab` - Apache Bench
robustus|Off is now known as robustus
msmith_ has quit [Remote host closed the connection]
<jhass>
curl does has a api for dispatching many requests called curl multi, but I know no cli tool that exposes it (never looked, so there very well might be)
<jhass>
the typhoeus gem exposes it in an easy ruby api though
n_blownapart has quit []
maletor has joined #ruby
econerd4ever has quit [Ping timeout: 258 seconds]
linojon has joined #ruby
<comf>
jhass: Looks great.
adriancb has quit [Remote host closed the connection]
<jhass>
it's called hydra in the typhoeus gem
adriancb has joined #ruby
eind has joined #ruby
<jhass>
note that curl multi is optimized to dispatch many requests though, not to stress the server
echooo has joined #ruby
n_blownapart has joined #ruby
livingstn has quit []
Takle has joined #ruby
s00pcan has quit [Ping timeout: 240 seconds]
arescorpio has quit [Excess Flood]
adriancb has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby
pzula has joined #ruby
pzula has quit [Client Quit]
pzula has joined #ruby
Shazaum has quit [Quit: This computer has gone to sleep]
<n_blownapart>
I know this is wrong but I have questions re: logical statements. can I use the and keyword between two if statements, such as on lines 8 and 12 here? thanks: http://pastie.org/9745886
mrsolo has quit [Quit: This computer has gone to sleep]
<jhass>
please make it a habit to always indent properly
tkuchiki has joined #ruby
<n_blownapart>
the else statement should be lined up with the first if statement, right jhass?
<jhass>
and you simply do if h[k] == 1 && v.size >= 3
dalai` is now known as dalai
disKounted has joined #ruby
eat_multi has quit [Read error: Connection reset by peer]
<jhass>
you suddenly add indentation between ll 6, 7 for example
kireevco1 has joined #ruby
<jhass>
also make it a habit to avoid single letter variable names
<zenspider>
I believe this has been mentioned multiple times already
<jhass>
variables should describe your data, not your datastructure
mikepack has joined #ruby
marr has quit [Ping timeout: 264 seconds]
kireevco has quit [Ping timeout: 244 seconds]
<n_blownapart>
I tried that, read up on it, and thought && was a boolean option only. ll 6,7 ? oh I indent too early? got it. not the datastructure? that is interesting jhass thank you. thanks zenspider
<jhass>
"boolean option only" what are you talking about?
WillAmes has joined #ruby
nkumari has quit [Remote host closed the connection]
<n_blownapart>
I thought && was for boolean expressions, not logical ones. jhass
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
what's the difference between a "boolean expression" and a "logical expression"
<pipework>
jhass: some fun joke about Mr.Spock probably
siso has joined #ruby
<n_blownapart>
sorry I'm reading up on precedence and subtleties between the two. jhass
<zenspider>
some ppl believe (and I think they're full of shit) that you should use and/or only for branching logic: x if a and b
<sevenseacat>
i dont use and/or out of habit
<jhass>
n_blownapart: precedence is the only difference between &&/|| and and/or
<zenspider>
and you should use &&/|| for assignment and other things.
Georg3 has joined #ruby
<zenspider>
&&/|| looks so wrong
<jhass>
it has the precedence rules more people are used to from other languages though
jenrzzz has quit [Ping timeout: 265 seconds]
<jhass>
I'm one of the person that uses &&/|| for value and and/or for side effects, which means I never use and/or
jenrzzz has joined #ruby
nkumari has joined #ruby
<n_blownapart>
interesting. much appreciated all. ^
<pipework>
jhass: That must make for some really interesting code, using OO and having no side effects.
<jhass>
hm?
<jhass>
I said that I don't use and/or for side effects, not that I write side effect free code
pzula has quit [Quit: Lost terminal]
<zenspider>
oh. right. one of the cases they're trying to avoid is x = a and a.b. which is decidedly different from x = a && a.b
<pipework>
That's not what it seemed to read.
<n_blownapart>
one thing is, to learn oop, I need to do it *constantly* or I forget everything.
<jhass>
I don't follow you even after rereading what I wrote, but then it's past 2 am here
<pipework>
"I'm one of the person that uses &&/|| for value and and/or for side effects, which means I never use and/or" sounds like you use and/or for side effects and that you never end up actually using them.
nkumari has quit [Remote host closed the connection]
kireevco1 has quit [Ping timeout: 265 seconds]
<jhass>
yes, how would that result in writing side effect free code?
<jhass>
if x = some_method
<jhass>
boom, side effect
<jhass>
no and/or
<n_blownapart>
this bloke avdi grimm has a long article on it. can't wait to finally get basic ruby.
mbrumbelow has joined #ruby
<pipework>
jhass: How is that a side effect? I'm confused. :(
<jhass>
you never know what some_method does on the side
<pipework>
If you went on to do other things, I guess, depending on how some_method behaves.
konsolebox has quit [Ping timeout: 265 seconds]
<pipework>
Not knowing doesn't make it a side effect though.
rylev has quit [Remote host closed the connection]
<n_blownapart>
jhass: is that like if you're doing a shallow clone vs. a deep clone, stuff is changed or unchanged inadvertently?
<pipework>
So calling a method that might not modify state and applying the result to a local is a side effect?
nkumari has quit [Remote host closed the connection]
<jhass>
potentially. I should clarify that I meant I use them to signal what I care about, the value or the side effect
<jhass>
if I care about the side effect, I use the expression for control flow
dcunit3d has quit [Ping timeout: 258 seconds]
<jhass>
which I avoid for logic expressions
<pipework>
Yeah, I don't think you're quite right about what makes it a side effect. If it's observable outside of the function or expression or modifies some state that makes it so that you can't replace the function/expression with the return of that function or expression.
dc has quit [Ping timeout: 255 seconds]
renderful has quit [Ping timeout: 240 seconds]
<n_blownapart>
holy smokes
<pipework>
Assigning the result of a method call to a local within the expression/function and then doing other stuff doesn't necessarily mean that it's a side effect.
<jhass>
didn't mean it means that, but it can
<pipework>
Yeah it can, but doesn't necessarily mean it does.
<jhass>
point is that avoiding and/or results in side effect free code, which you implied I would have claimed
hamakn has quit [Remote host closed the connection]
<pipework>
Your example was confusing, but I think I get your point about it. I don't quite feel like your preferential use of and/or fits what I like, but it makes sense to me.
<jhass>
*does not
<zenspider>
avoiding and/or results in side-effect free code?
<jhass>
sorry, I should go to bed :/
<zenspider>
hah
Soda has joined #ruby
<pipework>
Like when people use `do_something and return`
<jhass>
yeah, I hate that :P
<waxjar>
gotta keep that line count down
<jhass>
but when I would do it for whatever reason I'd use and/or for it
<zenspider>
I'm quite ok with `return if do_something`
<jhass>
while I use ||/&& to signal that I care about the value
<zenspider>
I don't like the and form because it feels like perl
<jhass>
^
<pipework>
I don't really care about whether I feel like I'm writing perl. What I dislike about and/or is that people have differing opinions on it.
<pipework>
So I tend to not use it because I give exactly 0 fucks about arguing about the use of and/or
georgedr_ has joined #ruby
<zenspider>
heh. I tend to use them and walk away from anyone who tries to argue about something I give 0 fucks about :)
<waxjar>
&& and || are more intuitive anyway, imo
<n_blownapart>
<< starts another brilliant conversation.
<n_blownapart>
seriously
<n_blownapart>
I learned a lot . thanks!
<zenspider>
I'm too old to give a fuck about religious arguments. besides, emacs is superior. :P
<sevenseacat>
oh no you di'nt
<pipework>
waxjar: I don't know, someone saying that something is more intuitive doesn't really sound like a great argument.
<pipework>
Like, have you performed a lot of tests and had your tests and data vetted by others?
<n_blownapart>
sevenseacat: yup.
davasaurous has quit [Remote host closed the connection]
<waxjar>
obviously not
<pipework>
zenspider: I liked having a job where I was encouraged to tell other developers to fuck off and go do productive things instead of whining about and/or
<jhass>
pipework: as I said earlier their precedence rules are more what you're used to from other languages, I think that's a quite valid argument for more intuitive
<zenspider>
yup yup
georgedrummond has quit [Ping timeout: 265 seconds]
deric_skibotn has quit [Ping timeout: 265 seconds]
<zenspider>
sign that there is a good mgr somewhere nearby who's allergic to unproductive bullshit
magicien has quit [Ping timeout: 245 seconds]
fandi has quit [Remote host closed the connection]
konsolebox has joined #ruby
n_blownapart has quit []
<pipework>
jhass: Yeah. That might make sense for a group that comes from other languages.
<pipework>
Though I'm not entirely convinced that a person would take as well to &&/|| though.
<waxjar>
even for someone new to programming x = 1 or 2 would be very confusing
<jhass>
^ ++
JCii8 has joined #ruby
<pipework>
I don't know that I agree off the bat.
atomical has joined #ruby
<jhass>
might be dream memory, but I think I recall two or three newcomers here tripping over something similar
<pipework>
I think that `do_something if this? and that?` is pretty nice, but I lack the data to say whether it's intuitive.
ghostmoth has quit [Quit: ghostmoth]
<jhass>
but then if foo.bar? baz && blub happens too, mmh
<pipework>
&& requires learning that it's different from &, whereas if you spoke English, my guess is that the word makes more sense without having to go learn anything about it.
<jhass>
so that cancels out I guess
<waxjar>
that example is pretty intuitive i'd say, it's just the precedence rules for and and or that aren't very intuitive imo
georgedr_ has quit [Remote host closed the connection]
<pipework>
Yeah, the precedence is that part that I don't think people would intuit because you have to learn it and it likely wouldn't come from prior knowledge. Whereas the same is true about the meanings of && and ||
JCii8_ has quit [Ping timeout: 244 seconds]
<pipework>
But to learn the precedence difference you'd have to use && and ||, otherwise to avoid that you'd just use parenthesis.
<pipework>
parentheses?
<jhass>
parens!
<jhass>
:P
<pipework>
parentxeses! SJW! Tumblr!
mkyurchev has quit [Read error: Connection reset by peer]
<waxjar>
yeah, true. it'd have been best to have and or with && and || precedence :P
adriancb has joined #ruby
<pipework>
If you could never come in contact with the other if you chose one, I don't think it would matter, but I doubt that you'd be able to.
<jhass>
waxjar: I think crystal still does that
CpuID has quit [Ping timeout: 272 seconds]
russt has quit [Quit: russt]
konsolebox has quit [Ping timeout: 244 seconds]
hamakn has joined #ruby
<jhass>
ah, no, they just dropped and/or
oleo__ has joined #ruby
<waxjar>
that looks a lot like ruby :o
<jhass>
:)
bmichelsen has joined #ruby
<pipework>
I think that's the point.
<jhass>
except, it's like, fast ;P
Joufflu has quit [Read error: Connection reset by peer]
<pipework>
However for JRuby, iirc it's often near C or sometimes at C once things are well jit'd
fuhgeddaboudit has quit [Ping timeout: 264 seconds]
oleo is now known as Guest85724
charlenopires has joined #ruby
<jhass>
pipework: dunno, I don't like such general claims much, it always depends on what you're doing
<pipework>
klmlfl: This isn't reddit, don't steal posts and claim them as your own.
samuel02 has joined #ruby
duncannz has quit [Remote host closed the connection]
Guest85724 has quit [Ping timeout: 255 seconds]
<pipework>
jhass: That's generally what people say when they don't like the bechmarks. I think everyone who takes benchmarks is aware that they're not really indicative of how they fare in the real world.
<klmlfl>
Go to reddit and find out who posted it pipehead
<pipework>
klmlfl: Days ago?
georgedrummond has joined #ruby
<waxjar>
crystal looks very interesting
<klmlfl>
sure'
<jhass>
diamonds: install ruby-dev package
jjasonclark has joined #ruby
<cleopatra>
hey
<klmlfl>
anyways, i came here to ask a question about array manipulation
<diamonds>
thanks jhass
<klmlfl>
lets says i have an array arr
<cleopatra>
who recommended me a good book about ruby
<klmlfl>
arr = [arr, 1, 2, 3]
gccostabr has joined #ruby
georgedr_ has joined #ruby
<klmlfl>
is there any way arr can be updated to have a value and arr[0] not updated with that value
<jhass>
klmlfl: that question isn't clear at all. My wild guess is you want Array#concat
charlenopires has quit [Ping timeout: 258 seconds]
<waxjar>
you'll have to duplicate the array using arr.dup or arr.clone before you put it in itself
<klmlfl>
ah
<jhass>
mh, actually do you?
<pipework>
klmlfl: Can you show us the example code that shows what you mean?
mkyurchev has quit [Remote host closed the connection]
<pipework>
Works on 2.0.0p451
<waxjar>
ah wait, only if the two ranges aren't the same
<eam>
what does one do with a non-iterable range?
<jhass>
>> def ; *2; end; "ho"
* jhass
slaps eval-in__
<eam>
no unicode :(
<pipework>
No younicode
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
georgedrummond has joined #ruby
georgedrummond has quit [Remote host closed the connection]
wsmoak has quit [Quit: wsmoak]
<zenspider>
pipework: umm... might be able to do a flipflop op?
<zenspider>
but... I can't think of how/why
Tab_ has quit [Read error: Connection reset by peer]
amystephen has quit [Quit: amystephen]
dopie has quit [Remote host closed the connection]
Xiti has quit [Quit: Xiti]
<pipework>
zenspider: Oh. Hm. I thought flipflop was only available inside an if/unless condition. That's an interesting thought though. Maybe so you could be lazy on two ranges based on the result of the last iteration? Hm.
<pipework>
I wonder why this works.
<waxjar>
eam: bounds-checking?
<jhass>
I bet only to make people wonder
arup_r has joined #ruby
<pipework>
I should have asked Matz to explain that at rubyconf.
<waxjar>
though for that particular Range that makes little sense :P
claptor has joined #ruby
maximski has joined #ruby
<zenspider>
good DNS server tho
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charlenopires has joined #ruby
rshetty has quit [Remote host closed the connection]
TDJACR has joined #ruby
asterite1 has joined #ruby
NoNMaDDeN has joined #ruby
fuhgeddaboudit has joined #ruby
sski has quit [Remote host closed the connection]
lucyinthesky has joined #ruby
sski has joined #ruby
jjasonclark has quit [Quit: jjasonclark]
asterite1 has quit [Client Quit]
asterite1 has joined #ruby
<klmlfl>
so in the case: a[a,1] ; a.push 2 ; can a[0] somehow not include 2?
<Scripore>
I'm getting a "comparison of Fixnum with nil failed (ArgumentError)" error at line 44
<sevenseacat>
well either array[pick] or secret_num is nil
<sevenseacat>
*secret_number
<Scripore>
is it because I need to attach .to_i to them?
<sevenseacat>
no.
<sevenseacat>
nil.
<Scripore>
running them on irb outputs a number but they both return nil
<Scripore>
okay
charlenopires has joined #ruby
georgedrummond has quit [Ping timeout: 264 seconds]
ebbflowgo has quit [Quit: ebbflowgo]
<Scripore>
actually, they're both returning a number when I use pry to check the return on secret_number and array[pick]
sailias has joined #ruby
<sevenseacat>
for that iteration of the loop maybe
<Scripore>
oh, I didn't think of that. thanks. gonna check again.
charlenopires has quit [Ping timeout: 264 seconds]
Tab_ has quit [Read error: Connection reset by peer]
kiyote23 has joined #ruby
karmatr0n has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
mrsolo has quit [Quit: This computer has gone to sleep]
karmatr0n has quit [Remote host closed the connection]
njs126 has joined #ruby
dc has joined #ruby
mrsolo has joined #ruby
dualz has joined #ruby
<dualz>
hey guys
charlenopires has joined #ruby
charlenopires has left #ruby [#ruby]
dcunit3d has joined #ruby
evanjs has quit [Remote host closed the connection]
radic has quit [Ping timeout: 255 seconds]
radic has joined #ruby
arup_r has quit [Quit: Leaving.]
martin_work has joined #ruby
CorySimmons has joined #ruby
davasaurous has quit [Remote host closed the connection]
Trynemjoel has quit [Ping timeout: 265 seconds]
VBlizzard has quit [Ping timeout: 244 seconds]
Blizzy has quit [Ping timeout: 244 seconds]
Trynemjoel has joined #ruby
Xiti has quit [Ping timeout: 240 seconds]
maestrojed has joined #ruby
havenwood has joined #ruby
tus has quit [Ping timeout: 272 seconds]
ebbflowgo has joined #ruby
RTG` has joined #ruby
gregf has quit [Read error: Connection reset by peer]
<hephaestus_rg>
thanks pipework
hephaestus_rg has quit [Quit: leaving]
lemur has quit [Remote host closed the connection]
mrsolo has quit [Quit: This computer has gone to sleep]
bigmac_ has joined #ruby
hatzopoulos has quit [Quit: Leaving]
lemur has joined #ruby
oo_ has joined #ruby
tus has joined #ruby
mrsolo has joined #ruby
ohaibbq has quit [Ping timeout: 240 seconds]
Rampages_afk has joined #ruby
davasaurous has joined #ruby
samuel02 has joined #ruby
lewix has quit [Read error: Connection reset by peer]
lemur has quit [Ping timeout: 245 seconds]
MartynKeigher has joined #ruby
lewix has joined #ruby
jonr22 has joined #ruby
peeja_ has joined #ruby
Xiti has joined #ruby
braincrash has quit [Quit: bye bye]
yeticry_ has joined #ruby
<MartynKeigher>
hey all.. i have ONE query that i would like to run against several "clientid's" in a database. what is the best to achieve that via ruby?
freerobby has joined #ruby
zenspider_ has joined #ruby
matti_ has joined #ruby
kke_ has joined #ruby
<MartynKeigher>
each client ID ties to a client NAME, and i would like to inject my ID into the query and pull the result (using data-id="clientname"), into some tiles on dashboard
<MartynKeigher>
is this possible? thanks
lucyinthesky has joined #ruby
bascht1 has joined #ruby
devyn_ has joined #ruby
lsc has joined #ruby
rainfyre_ has joined #ruby
tjbiddle_ has joined #ruby
oo_ has quit [Ping timeout: 240 seconds]
raldu_ has joined #ruby
queequeg2 has joined #ruby
maZtah_ has joined #ruby
pasv has joined #ruby
govg has quit [Quit: leaving]
CpuID has joined #ruby
pasv is now known as Guest59594
pen has joined #ruby
samuel02 has quit [Ping timeout: 265 seconds]
bkutil__ has joined #ruby
braincrash has joined #ruby
tekmaster has joined #ruby
jonr22 has quit [Ping timeout: 255 seconds]
jonathanwallace_ has joined #ruby
Rampages has quit [Read error: Connection reset by peer]
ebbflowgo has quit [Ping timeout: 264 seconds]
yeticry has quit [Ping timeout: 264 seconds]
Zackio has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Ping timeout: 264 seconds]
kke has quit [Ping timeout: 264 seconds]
SirFunk has quit [Ping timeout: 264 seconds]
peeja has quit [Ping timeout: 264 seconds]
maZtah has quit [Ping timeout: 264 seconds]
zenspider has quit [Read error: Connection reset by peer]
samsquanch has quit [Ping timeout: 264 seconds]
rainfyre has quit [Ping timeout: 264 seconds]
jbw has quit [Ping timeout: 264 seconds]
maxmanders has quit [Ping timeout: 264 seconds]
matti has quit [Ping timeout: 264 seconds]
Sp4rKy has quit [Ping timeout: 264 seconds]
blackjid has quit [Ping timeout: 264 seconds]
bascht has quit [Ping timeout: 264 seconds]
raldu has quit [Ping timeout: 264 seconds]
devyn has quit [Ping timeout: 264 seconds]
Cork has quit [Ping timeout: 264 seconds]
Schmidt has quit [Ping timeout: 264 seconds]
Guest27310 has quit [Ping timeout: 264 seconds]
billy_ran_away_ has quit [Ping timeout: 264 seconds]
udoprog has quit [Ping timeout: 264 seconds]
dogetime has quit [Ping timeout: 264 seconds]
t_mmyv has quit [Ping timeout: 264 seconds]
queequeg1 has quit [Ping timeout: 264 seconds]
nateberkopec has quit [Ping timeout: 264 seconds]
az7ar_away has quit [Ping timeout: 264 seconds]
sn0wb1rd has quit [Ping timeout: 264 seconds]
galeido has quit [Ping timeout: 264 seconds]
Kilo`byte has quit [Ping timeout: 264 seconds]
jonathanwallace has quit [Ping timeout: 264 seconds]
Platini has quit [Ping timeout: 264 seconds]
tekacs has quit [Ping timeout: 264 seconds]
ping-pong has quit [Ping timeout: 264 seconds]
hendricius has quit [Ping timeout: 264 seconds]
bkutil has quit [Ping timeout: 264 seconds]
ctrlrsf has quit [Ping timeout: 264 seconds]
Riking has quit [Ping timeout: 264 seconds]
peeja_ is now known as peeja
tekmaster is now known as tekacs
matti_ is now known as matti
adriancb has quit [Read error: Connection reset by peer]
jonathanwallace_ is now known as jonathanwallace
tyll has quit [Ping timeout: 264 seconds]
malcolmva has quit [Ping timeout: 264 seconds]
adriancb has joined #ruby
sn0wb1rd has joined #ruby
kloeri has quit [Read error: Connection reset by peer]
unCork has joined #ruby
udoprog has joined #ruby
hendricius has joined #ruby
tekacs is now known as Guest45628
jbw has joined #ruby
martin_work has quit [Quit: martin_work]
unCork is now known as Cork
kloeri has joined #ruby
maZtah_ is now known as maZtah
tyll has joined #ruby
vlad_starkov has joined #ruby
blackjid has joined #ruby
mosez has quit [Ping timeout: 264 seconds]
maxmanders has joined #ruby
mosez has joined #ruby
ping-pong has joined #ruby
Riking has joined #ruby
dogetime has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
Platini has joined #ruby
Kilo`byte has joined #ruby
rshetty has joined #ruby
SirFunk has joined #ruby
Beoran_ has quit [Ping timeout: 264 seconds]
billy_ran_away has joined #ruby
Sp4rKy has joined #ruby
linojon has quit [Quit: linojon]
NoNMaDDeN has quit [Remote host closed the connection]
msmith_ has joined #ruby
msmith_ has quit [Remote host closed the connection]
mloveless has quit [Read error: Connection reset by peer]
gccostabr has quit [Quit: ZZZzzz…]
mloveless has joined #ruby
galeido has joined #ruby
Scripore has quit [Read error: Connection reset by peer]
Scripore has joined #ruby
dseitz has joined #ruby
Zackio has joined #ruby
adriancb has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
_1_Jona503 has joined #ruby
pen has quit []
JBreit has left #ruby ["Leaving"]
_1_Jona503 has quit [Read error: Connection reset by peer]
mkyurchev has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tjbiddle_ has quit [Quit: tjbiddle_]
amystephen has joined #ruby
malcolmva has joined #ruby
byprdct has quit [Read error: Connection reset by peer]
toretore has quit [Quit: This computer has gone to sleep]
byprdct has joined #ruby
Beoran_ has joined #ruby
anaeem1 has joined #ruby
anaeem1 has quit [Remote host closed the connection]
anaeem1 has joined #ruby
testcore has quit [Ping timeout: 250 seconds]
airdeluxe has joined #ruby
ndrei has joined #ruby
karmatr0n has joined #ruby
lewix has quit [Remote host closed the connection]
bluOxigen has joined #ruby
rshetty has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
elaptics`away is now known as elaptics
adriancb has joined #ruby
mloveless has quit [Ping timeout: 258 seconds]
nkumari has joined #ruby
davasaur_ has joined #ruby
georgedrummond has joined #ruby
freerobby has quit [Quit: Leaving.]
mrsolo has quit [Quit: This computer has gone to sleep]
davasaurous has quit [Ping timeout: 272 seconds]
adriancb has quit [Remote host closed the connection]
oo_ has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
georgedrummond has quit [Ping timeout: 264 seconds]
blueOxigen has joined #ruby
npgm has joined #ruby
gccostabr has joined #ruby
<npgm>
hi I'm interested in doing something with the first element of an array
<npgm>
but I want to access it via some structure similar to each
uber_hulk has joined #ruby
melik_____ has quit [Quit: (null)]
timonv_ has joined #ruby
<jhass>
.first.tap do |first_item| ?
bluOxigen has quit [Ping timeout: 264 seconds]
fabrice31 has joined #ruby
mary5030 has quit [Ping timeout: 265 seconds]
anarang has joined #ruby
kiyote23 has quit [Remote host closed the connection]
<npgm>
jhass: perfect, thank you
nkumari has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
timonv_ has quit [Ping timeout: 265 seconds]
lewix has joined #ruby
rshetty has joined #ruby
aspires has joined #ruby
fabrice31 has quit [Ping timeout: 272 seconds]
disKounted has joined #ruby
KC9YDN has quit [Quit: Condenadme, no importa, la Historia me absolverá. - Fidel Castro]
diamonds has quit [Ping timeout: 255 seconds]
greenbagels has joined #ruby
havenwood has quit [Remote host closed the connection]
lewix has quit [Read error: Connection reset by peer]
ekinmur has joined #ruby
synergyz has quit [Remote host closed the connection]
lewix has joined #ruby
eind has quit [Remote host closed the connection]
adriancb has joined #ruby
nkumari has joined #ruby
ekinmur has quit [Remote host closed the connection]
ekinmur has joined #ruby
ekinmur has quit [Remote host closed the connection]
yfeldblum has joined #ruby
nkumari has quit [Remote host closed the connection]
ekinmur has joined #ruby
psy has joined #ruby
ekinmur has quit [Max SendQ exceeded]
ekinmur has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
Takle has joined #ruby
CorySimmons has quit [Quit: Bye!]
fedexo has joined #ruby
Morkel has joined #ruby
goshdarnyou has quit [Quit: Connection closed for inactivity]
jusmyth has joined #ruby
Takle has quit [Ping timeout: 272 seconds]
kyb3r_ has joined #ruby
gccostabr has quit [Quit: ZZZzzz…]
mloveless has joined #ruby
galeido has quit [Ping timeout: 250 seconds]
jusmyth has left #ruby [#ruby]
duncannz has joined #ruby
lucyinthesky has left #ruby ["Leaving"]
MartynKeigher has quit [Ping timeout: 265 seconds]
KC9YDN has joined #ruby
sdwrage has quit [Ping timeout: 240 seconds]
mesamoo has joined #ruby
devoldmx has joined #ruby
kiyote23 has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
arup_r has joined #ruby
Romance has joined #ruby
devoldmx has quit [Ping timeout: 258 seconds]
JCii8_ has quit [Read error: Connection reset by peer]
JCii8_ has joined #ruby
aspires has quit []
yfeldblum has quit [Ping timeout: 255 seconds]
mbrumbelow has quit [Quit: mbrumbelow]
georgedrummond has joined #ruby
nkumari has joined #ruby
mbrumbelow has joined #ruby
NoNMaDDeN has joined #ruby
duncannz has quit [Remote host closed the connection]
comf has quit [Quit: [BX] We drink more beers than Norm on Cheers!]
yokel has quit [Ping timeout: 240 seconds]
georgedrummond has quit [Ping timeout: 250 seconds]
rshetty has quit [Remote host closed the connection]
devoldmx has joined #ruby
garbanotas has quit [Read error: Connection reset by peer]
gkra has joined #ruby
davasaur_ has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
grubles has quit [Quit: leaving]
garbanotas has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JCii8__ has joined #ruby
Takle has joined #ruby
oo_ has joined #ruby
xymbol has quit [Ping timeout: 245 seconds]
mrsolo has left #ruby ["Leaving"]
nisstyre has joined #ruby
xymbol has joined #ruby
JohnBat26 has joined #ruby
Tab has joined #ruby
klmlfl has quit [Remote host closed the connection]
JCii8_ has quit [Ping timeout: 258 seconds]
hgl has left #ruby ["Bye"]
gkra has quit [Remote host closed the connection]
Tab is now known as Guest74039
gkra has joined #ruby
spastorino has quit [Quit: Connection closed for inactivity]
nkumari has quit [Remote host closed the connection]
Takle has quit [Ping timeout: 265 seconds]
ctrlrsf has joined #ruby
davedev24_ has quit []
Abhijit has joined #ruby
adriancb has quit [Remote host closed the connection]
echevemaster has quit [Remote host closed the connection]
nrsk has joined #ruby
fgo_ has quit [Ping timeout: 258 seconds]
Guest74039 has quit [Read error: Connection reset by peer]
mloveless has quit [Remote host closed the connection]
mjuszczak has joined #ruby
cajone has joined #ruby
nkumari has joined #ruby
uber_hulk has quit [Quit: brb]
lucyinthesky has joined #ruby
aces1up has joined #ruby
konsolebox has quit [Remote host closed the connection]
<aces1up>
if you had to delete a mass amount of file remotely.. could I script this with say perhaps sftp? possibly slow, or can I script via ssh connection somehow?
<aces1up>
i'm thinking of scripting a ssh client somehow.
xkhwtf has joined #ruby
xkhwtf has left #ruby [#ruby]
havenwood has joined #ruby
lxsameer has joined #ruby
melik_____ has quit [Remote host closed the connection]
mjuszczak has quit [Client Quit]
melik______ has joined #ruby
lolmaus has joined #ruby
kiyote23 has quit [Remote host closed the connection]
marcdel has joined #ruby
goshdarnyou has joined #ruby
lucyinthesky has quit [Quit: I am thankful for... the fake i love you -]
bigkevmcd has quit [Ping timeout: 256 seconds]
aces1up has quit []
rshetty has joined #ruby
oo_ has quit [Remote host closed the connection]
nrsk has quit [Ping timeout: 256 seconds]
oo_ has joined #ruby
byprdct has quit [Quit: by]
tagrudev has joined #ruby
fabrice31 has joined #ruby
shortCircuit__ has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
marcdel has quit []
nkumari has quit [Remote host closed the connection]
georgedrummond has joined #ruby
fabrice31 has quit [Ping timeout: 264 seconds]
uber_hulk has joined #ruby
sinkensabe has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
diegoviola has quit [Quit: WeeChat 1.0.1]
lewix has quit [Remote host closed the connection]
ekinmur has quit []
georgedrummond has quit [Ping timeout: 256 seconds]
nrsk has joined #ruby
mjuszczak has joined #ruby
NoNMaDDeN has quit [Remote host closed the connection]
valeriansaliou has quit [Quit: Be back later ...]
bMalum has joined #ruby
charlenopires has joined #ruby
nrsk has quit [Client Quit]
nrsk has joined #ruby
melik_______ has joined #ruby
Spami has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
fgo_ has joined #ruby
mloveless has joined #ruby
oleo__ has quit [Quit: Verlassend]
melik______ has quit [Ping timeout: 244 seconds]
charlenopires has quit [Ping timeout: 264 seconds]
ghr has joined #ruby
tkuchiki has quit [Ping timeout: 255 seconds]
samuel02 has joined #ruby
sinanislekdemir has joined #ruby
iamdoo2 has joined #ruby
craigp has joined #ruby
fgo_ has quit [Ping timeout: 240 seconds]
samuel02 has quit [Remote host closed the connection]
samuel02 has joined #ruby
testcore has joined #ruby
galeido has joined #ruby
noop has joined #ruby
ghr has quit [Ping timeout: 258 seconds]
karmatr0n has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
boombadaroomba has joined #ruby
phutchin1 has quit [Ping timeout: 244 seconds]
omosoj has joined #ruby
fandi has joined #ruby
jonr22 has joined #ruby
Kricir has joined #ruby
galeido has quit [Ping timeout: 264 seconds]
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
apeiros has quit [Ping timeout: 250 seconds]
<omosoj>
'lo?
galeido has joined #ruby
boombadaroomba has quit [Ping timeout: 272 seconds]
bal1 has joined #ruby
jonr2219 has joined #ruby
jenrzzz has joined #ruby
jonr22_ has joined #ruby
jonr22 has quit [Ping timeout: 258 seconds]
codecop has joined #ruby
Photism has joined #ruby
jonr22_ has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
jonr2219 has quit [Ping timeout: 245 seconds]
govg has joined #ruby
Xeago has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
Xeago_ has joined #ruby
Takle has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr2219 has joined #ruby
greenbagels has quit [Ping timeout: 244 seconds]
greenbagels has joined #ruby
Xeago has quit [Ping timeout: 256 seconds]
samuel02 has quit [Remote host closed the connection]
mjuszczak has quit []
jonr2219 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
Xeago_ has quit [Remote host closed the connection]
disKounted has quit []
charlenopires has joined #ruby
jonr22 has quit [Remote host closed the connection]
galeido has quit [Quit: galeido]
jonr22 has joined #ruby
aganov has joined #ruby
doev has joined #ruby
NoNMaDDeN has joined #ruby
jonr22 has quit [Remote host closed the connection]
jonr22 has joined #ruby
charlenopires has quit [Ping timeout: 250 seconds]
galeido has joined #ruby
sski has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 1.0.1]
krz has joined #ruby
sski has joined #ruby
jonr22 has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
jonr22 has joined #ruby
<bMalum>
I have a small problem with my Gem File — i cant spilt the Module in /lib Folder - because i cant access the class … can some Pros from u have a look on my Gist?
SCHAAP137 has quit [Remote host closed the connection]
jonr22 has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
jonr2219 has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
oo_ has quit [Remote host closed the connection]
galeido has quit [Ping timeout: 250 seconds]
oo_ has joined #ruby
sski has quit [Ping timeout: 255 seconds]
rshetty has quit [Remote host closed the connection]
Takle has quit [Ping timeout: 272 seconds]
kamilc__ has joined #ruby
krzkrz has joined #ruby
krz has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
nfk has joined #ruby
clauswitt has joined #ruby
timonv_ has joined #ruby
roolo has joined #ruby
phutchins has quit [Ping timeout: 255 seconds]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
Abhijit has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
timonv_ has quit [Ping timeout: 264 seconds]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
NoNMaDDeN has quit [Remote host closed the connection]
ht__th has joined #ruby
roolo has quit [Ping timeout: 272 seconds]
aces1up has joined #ruby
<aces1up>
if i have an integer of say 10000 how could i loop through it and get a per batch of 1000
<aces1up>
so for instance it would be something like 10000.each( 1000 ) do | start, end |
Takle has joined #ruby
<aces1up>
so i can get the start and end indexes of that batch.
greenbagels has quit [Read error: Connection reset by peer]
<twistedpixels>
you could use a for loop?
jonr22 has quit [Remote host closed the connection]
georgedrummond has joined #ruby
jonr22 has joined #ruby
Takle_ has quit [Ping timeout: 272 seconds]
<aces1up>
twistedpixels what would that look like? was looking to batch it and create a range that i could do work on,.
<twistedpixels>
well I don't know ruby syntax for for loops, but it would be a for loop with an if statement or two that would catch the specific numbers your looking for and store it in a variable
<twistedpixels>
but there could very well be a better way to do it
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
<twistedpixels>
I just started learning ruby pretty recently
<twistedpixels>
most of my code knowledge is in c++
<aces1up>
bummer could use a good answer. no worrie.s
<twistedpixels>
yeah sorry man
<twistedpixels>
I just wanted to give something, cause noone else seemed like they were around lol
<ddv>
if you know c++ then you know how to use for in ruby, try each_cons aces1up
<ddv>
(1..10).each_cons(3) {|a| p a}
rocknrollmarc has joined #ruby
frozon has joined #ruby
<twistedpixels>
ddv, if I saw the syntax I could make one I'd guess
<twistedpixels>
just don't know it off hand
georgedrummond has quit [Ping timeout: 272 seconds]
ta_ has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
georgedrummond has joined #ruby
mary5030 has joined #ruby
bigkevmcd has joined #ruby
<dts>
is there a ruby equivalent to pythons twisted?
<sevenseacat>
depends on what twisted is
jonr2219 has joined #ruby
<ddv>
dts: eventmachine
<dts>
ty
timonv_ has joined #ruby
<dts>
sevenseacat, i havent really used it but its essentially a huge networking library that is apparently much better implemented than pythons standard socket lib
jonr22_ has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
mary5030 has quit [Ping timeout: 256 seconds]
siso has quit [Ping timeout: 272 seconds]
georgedrummond has quit [Ping timeout: 264 seconds]
jonr22 has quit [Ping timeout: 250 seconds]
<aces1up>
dts i've been using eventmachine awhile, kicks ass for scraping.
<dts>
scraping?
<aces1up>
got it scaled pretty good across multiple server i scrape a couple mil pages a day.
<dts>
ah... scraping
<dts>
web pages
<aces1up>
yeh mostly financial info. and real estate data for clients.
Eiam has joined #ruby
frozon has quit [Ping timeout: 264 seconds]
<dts>
tbh i dont actually need it. some guy in #crystal-lang asked if ruby has an equivalent to twisted and if it was being ported to crystal
fabrice31 has joined #ruby
jonr2219 has quit [Ping timeout: 244 seconds]
<dts>
i actually dont even know ruby yet
<aces1up>
twisted is just asynch IO library right?
<dts>
i believe so yes
renderful has joined #ruby
jonr22_ has quit [Remote host closed the connection]
<aces1up>
dts hrmm well eventmachine is the same thing in ruby.. I think it has been around longer too.
jonr22 has joined #ruby
ghr has joined #ruby
braincra- has joined #ruby
parabolize has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
uber_hulk has quit [Ping timeout: 240 seconds]
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
phutchins has joined #ruby
renderful has quit [Ping timeout: 258 seconds]
decoponio has joined #ruby
melik_______ has quit [Quit: (null)]
ghr has quit [Ping timeout: 258 seconds]
braincrash has quit [Ping timeout: 255 seconds]
josephndenton has joined #ruby
omosoj has quit [Quit: leaving]
mkaesz has joined #ruby
enape_101 has quit [Ping timeout: 240 seconds]
jonr2219 has quit [Read error: Connection reset by peer]
Scripore has quit [Ping timeout: 244 seconds]
jonr22 has joined #ruby
phutchins has quit [Ping timeout: 244 seconds]
kamilc__ has quit [Quit: Leaving...]
jonr22 has quit [Remote host closed the connection]
jonr22 has joined #ruby
samuel02 has joined #ruby
stoffus has joined #ruby
timonv_ has quit [Remote host closed the connection]
nisstyre has quit [Ping timeout: 265 seconds]
Dopagod has joined #ruby
WormDr1nk has joined #ruby
Channel6 has quit [Quit: Leaving]
jonr2219 has joined #ruby
Guest59594 is now known as pasv^_^
bayed has joined #ruby
suffice has quit [Ping timeout: 245 seconds]
jonr2219 has quit [Read error: Connection reset by peer]
jonr2219 has joined #ruby
jonr22 has quit [Ping timeout: 256 seconds]
suffice has joined #ruby
claudiuinberlin has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
samuel02 has quit [Remote host closed the connection]
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
charlenopires has joined #ruby
lemur has joined #ruby
jonr2219 has quit [Remote host closed the connection]
jonr22 has joined #ruby
echooo1 has joined #ruby
andikr has joined #ruby
echooo has quit [Ping timeout: 258 seconds]
antgel has joined #ruby
livathinos has joined #ruby
charlenopires has quit [Ping timeout: 264 seconds]
jonr2219 has joined #ruby
craigp has quit [Remote host closed the connection]
jonr22 has quit [Ping timeout: 255 seconds]
Kricir has quit [Remote host closed the connection]
Aswebb has joined #ruby
dain has joined #ruby
antgel has quit [Quit: leaving]
jonr22 has joined #ruby
antgel has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
last_staff has joined #ruby
quimrstorres has joined #ruby
josephndenton has quit [Ping timeout: 255 seconds]
joonty has joined #ruby
samuel02 has joined #ruby
dain has quit [Remote host closed the connection]
samuel02 has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
joonty has quit [Client Quit]
jonr22 has quit [Read error: Connection reset by peer]
samuel02 has joined #ruby
jonr22 has joined #ruby
codecop has quit [Remote host closed the connection]
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
Photism_ has joined #ruby
relix has joined #ruby
Photism has quit [Read error: Connection reset by peer]
nisstyre has joined #ruby
patrick99e99 has quit [Ping timeout: 255 seconds]
jonr22 has quit [Remote host closed the connection]
jonr22 has joined #ruby
jonr22 has quit [Remote host closed the connection]
jonr22 has joined #ruby
ctp has joined #ruby
moritzs has joined #ruby
uber_hulk has joined #ruby
jonr22 has quit [Remote host closed the connection]
jonr2219 has joined #ruby
psy has quit [Remote host closed the connection]
jonr2219 has quit [Remote host closed the connection]
jonr22 has joined #ruby
georgedrummond has joined #ruby
kenndel has joined #ruby
goshdarnyou has quit [Quit: Connection closed for inactivity]
psy has joined #ruby
iamjarvo has joined #ruby
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
JCii8__ has quit [Ping timeout: 240 seconds]
dumdedum has joined #ruby
timonv_ has joined #ruby
georgedr_ has joined #ruby
georgedrummond has quit [Ping timeout: 272 seconds]
VBlizzard has joined #ruby
Blizzy has joined #ruby
abuzze has quit [Remote host closed the connection]
abuzze has joined #ruby
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
sk87 has joined #ruby
olivier_bK has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr2219 has joined #ruby
ta has joined #ruby
ta has quit [Remote host closed the connection]
amystephen has quit [Quit: amystephen]
ta has joined #ruby
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
bMalum has quit [Quit: bMalum]
ringarin has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
maasha has joined #ruby
jonr22 has joined #ruby
oo_ has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
kaspertidemann has joined #ruby
rshetty has joined #ruby
Akagi201 has joined #ruby
lolmaus has joined #ruby
jheg has joined #ruby
quimrstorres has quit [Remote host closed the connection]
ringarin has quit [Read error: Connection reset by peer]
<maasha>
mojn
jonr22 has quit [Remote host closed the connection]
Ilof has quit [Quit: leaving]
jonr22 has joined #ruby
dfas has joined #ruby
jheg has quit [Client Quit]
Timgauthier has joined #ruby
jonr22 has quit [Remote host closed the connection]
moritzs has quit [Ping timeout: 244 seconds]
oo_ has quit [Ping timeout: 240 seconds]
jonr22 has joined #ruby
anaeem___ has joined #ruby
anaeem___ has quit [Remote host closed the connection]
ghr has joined #ruby
anaeem1 has quit [Ping timeout: 240 seconds]
anaeem___ has joined #ruby
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
michael_mbp has quit [Excess Flood]
kamilc__ has joined #ruby
kamilc__ has quit [Client Quit]
bmichelsen has quit [Quit: ZZZzzz…]
Seich has quit [Ping timeout: 258 seconds]
brendenb has quit [Ping timeout: 258 seconds]
jonr2219 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
michael_mbp has joined #ruby
C0deMaver1ck has quit [Ping timeout: 258 seconds]
C0deMaver1ck has joined #ruby
C0deMaver1ck is now known as Guest10833
Romance has quit [Ping timeout: 258 seconds]
jonr2219 has joined #ruby
tkuchiki has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
tylersmith has quit [Ping timeout: 258 seconds]
fedexo has quit [Ping timeout: 265 seconds]
Eiam has quit [Quit: (╯°□°)╯︵ ǝpouǝǝɹɟ]
brendenb has joined #ruby
adriancb has joined #ruby
tylersmith has joined #ruby
rylev has joined #ruby
sevenseacat has quit [Quit: Leaving.]
Seich has joined #ruby
tkuchiki has quit [Read error: Connection reset by peer]
rylev has quit [Client Quit]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
Romance has joined #ruby
Romance has joined #ruby
charlenopires has joined #ruby
adriancb has quit [Ping timeout: 264 seconds]
unshadow has joined #ruby
<unshadow>
How would I define this in ruby : a = 0x0002
jonr2219 has joined #ruby
jonr22 has quit [Ping timeout: 250 seconds]
Timgauthier is now known as timgauthier_away
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
havenwood has quit [Remote host closed the connection]
charlenopires has quit [Ping timeout: 265 seconds]
<unshadow>
but... is that the same value as 0x0002 ?
joonty has joined #ruby
<unshadow>
shuldent it be 0b002 or something ?
lkba has quit [Ping timeout: 255 seconds]
Jake232 has joined #ruby
jonr2219 has quit [Remote host closed the connection]
jonr22 has joined #ruby
lkba has joined #ruby
kiyote23 has joined #ruby
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
Seich has quit [Ping timeout: 258 seconds]
AlexRussia has joined #ruby
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
georgedr_ has quit [Remote host closed the connection]
kaspertidemann has quit []
Nightmare has quit [Ping timeout: 258 seconds]
<canton7>
unshadow, not sure what you're asking...
dexteryy has joined #ruby
Seich has joined #ruby
rshetty has quit [Remote host closed the connection]
kiyote23 has quit [Ping timeout: 264 seconds]
<canton7>
unshadow, the number 2 is a number. it can be written on paper in many ways, in many bases. but underneath it's just a number: if you have 5 biscuits on your desk, it doesn't matter how you write down that there are 5 biscuits, or what base you use. there are still 5 of thenm
jonr22 has quit [Remote host closed the connection]
tylersmith has quit [Ping timeout: 258 seconds]
jonr22 has joined #ruby
valeriansaliou has joined #ruby
<unshadow>
nm... just read on hexadecimal integers :)
tylersmith has joined #ruby
Tab has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<unshadow>
0x6400 = 25600 for example, not 6400
Tab is now known as Guest81974
<unshadow>
Only now realsing that XD
<canton7>
hex 6400 is deciaml 24500, yes
<canton7>
*decimal
LBRapid has quit [Ping timeout: 258 seconds]
abuzze_ has joined #ruby
LBRapid has joined #ruby
Nightmare has joined #ruby
theotherstupidgu has quit [Quit: Lost terminal]
unshadow has quit [Quit: leaving]
Seich has quit [Ping timeout: 258 seconds]
jonr22 has quit [Ping timeout: 240 seconds]
brendenb has quit [Ping timeout: 258 seconds]
abuzze has quit [Ping timeout: 255 seconds]
Guest10833 has quit [Ping timeout: 258 seconds]
Guest81974 has quit [Quit: Leaving]
Seich has joined #ruby
Takle has quit [Read error: No route to host]
Areessell has quit [Ping timeout: 256 seconds]
Tab_ has joined #ruby
Takle has joined #ruby
brendenb has joined #ruby
C0deMaver1ck_ has joined #ruby
abuzze_ has quit [Remote host closed the connection]
<kl_>
Inside Foo::Bar::Baz, how can I reference Foo::Bar::Quux, without typing out Foo::Bar again?
juni0r has joined #ruby
<jhass>
shortCircuit__: well of course they are, |a,b| defines the block parameters
blueOxigen has quit [Ping timeout: 264 seconds]
<kl_>
I was hoping to refer to a sibling constant without starting back at the root namespace
<shortCircuit__>
I can't figure what is the utility of the code
<jhass>
shortCircuit__: it automatically creates a 2 level nested hash on access
skroon has joined #ruby
<skroon>
i've got an array of hashes, and now I want to only select all of the hashes that have a value where qid == 1 what is a good ruby function to use for this? #map #select ?
<n3phos>
jhass, i didn't mean it like that, i joined ruby because rails didn't exist so thx for forwarding me to the right channel
<jhass>
shortCircuit__: so you can just a[:a][:b][:c] = :d
<shortCircuit__>
oh
<shortCircuit__>
yeah they wrote like this
amacou has quit [Remote host closed the connection]
MrPopinjay has left #ruby ["WeeChat 0.3.8"]
JCii8__ has joined #ruby
<jhass>
>> module A; module B; C = :c; class D; def foo; C; end; end; end; end; A::B::D.new.foo # seems to work kl_
tkuchiki has quit [Remote host closed the connection]
RyanV has joined #ruby
Aswebb has quit [Remote host closed the connection]
Aswebb has joined #ruby
elico has quit [Quit: Leaving.]
<skroon>
jhass: but, i've got an array of hashes, so i'm confused how todo the syntax
lkba has joined #ruby
<jhass>
array.select {|hash| hash[:qid] == 1 }
<skroon>
ahhhh :)
<skroon>
thanks
<jhass>
don't actually use array and hash as variable names though
fabrice31 has quit [Remote host closed the connection]
mloveless has quit [Remote host closed the connection]
<workmad3>
kl_: it'll depend on how you opened the Foo::Bar::Baz module when writing the code for referencing Foo::Bar::Quux (because ruby has some slight oddities around lexical constant lookup)
Aswebb has quit [Ping timeout: 256 seconds]
jonr22 has joined #ruby
<shortCircuit__>
I have ghost in my rails app
charlenopires has joined #ruby
Aswebb has joined #ruby
n008f4g_ has joined #ruby
<Areessell>
`class Foo::Thing < Foo::Bar; end` is not the same as `module Foo; class Thing < Bar; end; end` when it comes to scopes, as workmad3 pointed out
fxn has joined #ruby
<shortCircuit__>
oh sorry forget it, I forgot I was running tests
bmichelsen has joined #ruby
<Areessell>
The scope you define a class within, not as, defines the scope it looks up within
<workmad3>
Areessell: constant scopes, not other scopes (worth making the distinction)
bluOxigen has joined #ruby
<Areessell>
I think it's annoying but I'm well beyond used to it by now
<fxn>
hi, looking for confirmation (or rebuttal!) that there's no API to ask if an optional keyword argument was actually passed
<skroon>
jhass: I would like to construct a new multidimensional array actually, I want to filter my raw data and then group things and add those grouped data in a new structure. I would know how todo that all with temp variables etc :-) but was wondering if maybe that's possible with map, select, filter, etc?
tkuchiki has joined #ruby
fandi has quit [Ping timeout: 265 seconds]
sinkensabe has quit []
<fxn>
have some methods doing options.slice(:foo, :bar) that wouldn't have equivalent rewritten using keyword arguments
charlenopires has quit [Ping timeout: 240 seconds]
olivier_bK has quit [Ping timeout: 256 seconds]
<workmad3>
kl_: https://gist.github.com/workmad3/840937e05850016baa40 a gist showing the difference (and showing you how Module.nesting differs too... Module.nesting shows you the current lexical scope used for constant lookup)
<jhass>
skroon: it probably is possible, but hard to get specific with such a vague description ;)
<skroon>
jhass: yeah i'm sorry :)
Abhijit has joined #ruby
jonr22 has quit [Ping timeout: 272 seconds]
mbrumbelow has joined #ruby
<jhass>
fxn: that's not unique to optional keyword arguments though, you don't know for regular optional arguments either
<fxn>
jhass: I am rewriting methods that receive hashes, old-school kwargs you know
<workmad3>
fxn: provide sensible defaults for optionar kwargs?
<workmad3>
fxn: or use **kwargs to capture optionals and see if they're present?
<fxn>
workmad3: yeah, but then I loose the explicit naming, which is what I am after
<skroon>
jhass: basically I want to group did: together
<workmad3>
fxn: well, if it's optional, it has a default value... so just make use of the default value and don't care whether it was passed in or not ;)
<workmad3>
fxn: if someone passes in the default value explicitly, it shouldn't make a change to the behaviour of the method, tbh
<jhass>
skroon: .group_by {|hash| hash[:did] }.values if I got that right
<fxn>
workmad3: nope, if the key is not present it has a meaning in my situation, it means certain query param was not sent, and no validations would run, non-setting != setting to nil
<workmad3>
fxn: default doesn't have to == nil
<fxn>
workmad3: I know, there's no other default
<workmad3>
fxn: not even 'whatever: :not_passed'? :P
<fxn>
workmad3: my situation is: if you pass the key, an assignment must happen, if you do not pass the key, the assignment should not happen
antgel has quit [Ping timeout: 264 seconds]
valeriansaliou has quit [Quit: Be back later ...]
<workmad3>
fxn: right... then your situation isn't a kwargs situation, it's a hash situation (from the sounds of things)
<fxn>
agreed
<workmad3>
fxn: or a clunky workaround where you default the kwarg to a symbol that means 'no value was passed in here' ;)
<workmad3>
fxn: and then test for it
GeorgesLeYeti has joined #ruby
<fxn>
yep
oo_ has quit [Remote host closed the connection]
antgel has joined #ruby
<skroon>
jhass: cool, is it also possible to group on multiple things? like I want group both on qid and did, so all shoulds be in a "seperate" array, hopefully not too vague again :)
fabrice31 has joined #ruby
<jhass>
something like .group_by {|hash| hash.values_at(:qid, :did) }.values should work
apeiros has joined #ruby
jusmyth has joined #ruby
agjacome has joined #ruby
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shortCircuit__>
can modules have protected methods?
<shortCircuit__>
module Authenticable protected def generate_hash end end
<jhass>
yes
<jhass>
I never use protected methods in ruby though
<shortCircuit__>
why? In rails most of the places I see use some protected model methods
<skroon>
jhass: and can group_all also return an array instead of a hash?
<jhass>
skroon: guess why I call .values on the hash
anaeem1 has joined #ruby
<jhass>
shortCircuit__: in ruby I tend to work with as flat hierarchies as possible, so protected is of little, and for me in fact of no use
St_Marx has joined #ruby
<shortCircuit__>
ohk
* apeiros
has the same experience re protected methods
<_bart>
but I have a question about this statement: "in fact we wouldn't check each adjacent pair each rotation, rather collect the adjacent pairs in a set and check at the end, very similiar items would end up adjacent in a number of the rotations but only need to be checked once"
quimrstorres has quit [Remote host closed the connection]
<_bart>
how do I sort the array of simhashes so that the Hamming distance of adjacent pairs is as low as possible?
<workmad3>
shortCircuit__: 'protected' in ruby also doesn't work like 'protected' in something like java
<skroon>
ahhh I forgot the .values at the end :)
<skroon>
thanks
<workmad3>
shortCircuit__: in fact, 'private' in ruby is pretty much what 'protected' in java does, and 'protected' in ruby is really more like 'friend' in C++
jusmyth has quit [Quit: Leaving.]
<shortCircuit__>
oh
<shortCircuit__>
I have to read it
<workmad3>
shortCircuit__: I've yet to see 'protected' in any serious ruby code...
<shortCircuit__>
:O
<shortCircuit__>
wait
tylersmith has quit [Ping timeout: 258 seconds]
Seich has joined #ruby
kobain has joined #ruby
anaeem1 has quit [Remote host closed the connection]
kobain has quit [Max SendQ exceeded]
tylersmith has joined #ruby
kobain has joined #ruby
fantazo has joined #ruby
kobain has quit [Max SendQ exceeded]
iamdoo2 has quit []
RyanV has quit [Quit: (null)]
kobain has joined #ruby
anaeem1 has joined #ruby
kobain has quit [Max SendQ exceeded]
kobain has joined #ruby
<shortCircuit__>
workmad3 : https://gist.github.com/aghosh47/9cc97c9412860bb7e72c all the module Authenticable codes were in user model, I moved them to lib/authenticable.rb . Although the tests fail saying let(:user) { FactoryGirl.create(:user) } NoMethodError: undefined method `encrypt . the protected in the module should be private?
kobain has quit [Max SendQ exceeded]
gaussblurinc11 has joined #ruby
gaussblurinc1 has quit [Read error: Connection reset by peer]
anaeem1 has quit [Remote host closed the connection]
renderful has joined #ruby
<workmad3>
shortCircuit__: you missed the test code and the stack trace out of there
<workmad3>
shortCircuit__: also, please don't use SHA1 for passwords... SHA1 is classed as broken nowadays and its use is not recommended
kobain has joined #ruby
anaeem1 has joined #ruby
<workmad3>
shortCircuit__: BCrypt or SCrypt are generally recommended for password hashing
kamilc__ has joined #ruby
<shortCircuit__>
Oh, ok, As I am given the task to clean up the code, I will do whatever is best.
kobain has quit [Max SendQ exceeded]
<workmad3>
shortCircuit__: if it's already in use, you can't just change the hash algorithm though :(
kobain has joined #ruby
<shortCircuit__>
But won't that break when the user would .
<shortCircuit__>
yeah :)
DLSteve has quit [Max SendQ exceeded]
<workmad3>
shortCircuit__: you'd need to do a migration of the password hash to a new form on their next sign in (which is when you'll next have their password available)
Soda has quit [Remote host closed the connection]
kobain has quit [Client Quit]
fandi has quit [Remote host closed the connection]
<shortCircuit__>
ok, I will talk to the person in charge about this
<workmad3>
shortCircuit__: still waiting for the rest of the code btw :P
<shortCircuit__>
pasting
<workmad3>
shortCircuit__: and the full error trace
<workmad3>
shortCircuit__: ah, ok, I see the problem now
<workmad3>
shortCircuit__: 'include Authenticatable' only adds the module instance methods to the class as instance methods... it does not insert the module class methods into the class as class methods
agjacome has quit [Quit: leaving]
phutchins has joined #ruby
<workmad3>
shortCircuit__: so your 'def self.encrypt(...)' is only exposed as Authenticatable.encrypt, not as User.encrypt
<shortCircuit__>
oh
krisquigley has quit [Remote host closed the connection]
<shortCircuit__>
I thought self would be doing the User.encrypt.
Xeago has joined #ruby
Alina-malina has quit [Read error: Connection reset by peer]
krisquigley has joined #ruby
<shortCircuit__>
Then I have to pass that call to the Authenticable.encrypt
<workmad3>
shortCircuit__: because none of the methods in the Payable module are module methods, they're all instance methods that will be mixed into a class
Spami has joined #ruby
robustus|Off is now known as robustus
echooo has joined #ruby
<shortCircuit__>
I mean the self doesn't cause problems here like in the previous case
fabrice31 has quit [Remote host closed the connection]
tkuchiki has quit [Read error: Connection reset by peer]
Xeago has quit [Remote host closed the connection]
quimrstorres has joined #ruby
echooo1 has joined #ruby
<shortCircuit__>
so In the previous case, I can make one module inside the module and put the def self. methods in it and then in User model say extend Authenticable::ModuleName
mkaesz has quit [Remote host closed the connection]
mkaesz has joined #ruby
moritzs has joined #ruby
maximski has joined #ruby
maximski has quit [Max SendQ exceeded]
fabrice31 has joined #ruby
agjacome has joined #ruby
echooo has quit [Ping timeout: 240 seconds]
maximski has joined #ruby
DaniG2k has joined #ruby
<workmad3>
shortCircuit__: yes you can
giuseppesolinas has quit [Quit: This computer has gone to sleep]
quimrstorres has quit [Remote host closed the connection]
<_bart>
"in the likely case that B << n the entire algorithm will still be under O(n^2)"
tobago has joined #ruby
<_bart>
but I don't understand how that'd work
<apeiros>
tl;dr
<_bart>
tl;dr: he sorts the integers, checks for pairs, rotates it bitwise to the left, and then checks again.
<_bart>
and does so again B times (the amount of bits in the hash/integer). So for example, rotate left 32 times.
<apeiros>
I'm sorry, it's too much to help with while at work
thsig_ has joined #ruby
<_bart>
what I don't know is how sorting the integer representation of the hashes relates to the low bitwise hamming distance pairs ending up next to each other.
<_bart>
that's ok
doodlehaus has joined #ruby
cleopatra has quit [Ping timeout: 250 seconds]
dangerousdave has joined #ruby
krisquigley has joined #ruby
thsig has quit [Ping timeout: 258 seconds]
samuel02 has joined #ruby
freerobby has quit [Quit: Leaving.]
arup_r has joined #ruby
anarang has quit [Quit: Leaving]
arup_r has quit [Remote host closed the connection]
gaussblurinc1 has quit [Read error: Connection reset by peer]
<workmad3>
havenwood: although I think it would be nicer if it took a block to allow you to specify what you want the frequency of e.g. [1,2,4,5,3,4,5].frequencies(&:even?) or [obj1, obj2, obj3, obj4].frequencies{|obj| obj.attr1 - obj.attr2}...
quimrstorres has joined #ruby
emmesswhy has joined #ruby
nvdpl has quit [Quit: Quit...]
xymbol_ has joined #ruby
moritzs has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fantazo has joined #ruby
<tirengarfio>
any idea jhass ?
dangerousdave has joined #ruby
xymbol_ has quit [Client Quit]
emmesswhy has quit [Read error: Connection reset by peer]
quimrstorres has quit [Remote host closed the connection]
quimrstorres has joined #ruby
emmesswhy has joined #ruby
livathin_ has quit [Remote host closed the connection]
heyimwill has quit [Ping timeout: 258 seconds]
supersym has joined #ruby
alem0lars has quit [Ping timeout: 265 seconds]
rdark has quit [Ping timeout: 265 seconds]
<jhass>
tirengarfio: yes, answer my question
govg has quit [Quit: leaving]
<tirengarfio>
I have used gem install compass --no-ri --no-rdoc
<tirengarfio>
jhass,
rdark has joined #ruby
<jhass>
and that throws the error you've shown?
Hobogrammer has quit [Ping timeout: 265 seconds]
<tirengarfio>
yes
<tirengarfio>
no
jbw has joined #ruby
<tirengarfio>
I mean the command to install compass doesn't throw any message
econerd4_ has quit [Remote host closed the connection]
econerd4ever has joined #ruby
econerd4ever has quit [Read error: Connection reset by peer]
heyimwill has joined #ruby
rpag has joined #ruby
LBRapid has quit [Ping timeout: 258 seconds]
econerd4ever has joined #ruby
Takle has quit [Read error: Connection reset by peer]
Takle has joined #ruby
LBRapid has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
<tirengarfio>
jhass, Im using a php framework that generate this type of commands: '/usr/bin/ruby' '/usr/local/bin/compass' 'compile' '/tmp' '--boring' '--config' '/tmp/assetic_compassGOZ5DV' '--sass-dir' '' '--css-dir' '' '/tmp/assetic_compassyNuojF.scss'
diamonds has joined #ruby
diamonds has joined #ruby
<jhass>
gosh
<jhass>
work on your copy pasting
<jhass>
those html entities are annoying as hell
Aswebb has quit [Remote host closed the connection]
<jhass>
make a gist with the output of gem env and /usr/bin/ruby -v please
rocknrollmarc has quit [Ping timeout: 264 seconds]
DLSteve has quit [Read error: Connection reset by peer]
<jhass>
which gem install then installed compass to
<jhass>
then you try to invoke it by calling _the other_ ruby
Photism has quit [Quit: Leaving]
C0deMaver1ck has joined #ruby
C0deMaver1ck is now known as Guest15604
<havenwood>
tirengarfio: It is quite normal to have one or more system Rubies in addition to those managed by RVM. RVM lets you either use system as default or one of your RVM Rubies, your choice.
antgel has quit [Ping timeout: 264 seconds]
<havenwood>
tirengarfio: You can uninstall whatever you like. Or just switch between them.
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
ta has quit [Remote host closed the connection]
<tirengarfio>
jhass, I have run "rvm --default use 2.0.0" but I still get the error
gregf has joined #ruby
toretore has joined #ruby
<jhass>
you probably still call the other ruby
<jhass>
/usr/bin/ruby is your system ruby, now look at gem env again
<havenwood>
tirengarfio: install compass with the Ruby you're using?
<shevy>
you guys apply scientific calculations
<havenwood>
tirengarfio: what Ruby do you want to be using?
<jhass>
tirengarfio: ignore havenwood, use ruby you installed compass for
<havenwood>
or ignore me
brendenb has joined #ruby
<jhass>
havenwood: we're at basic not being able to read command outputs and comparing paths issues
<havenwood>
jhass: i'm curious what Ruby tirengarfio means to be using
<shevy>
2.0.0 something
<jhass>
my bet is that he found that command somewhere and blindly copy pasted it
supersym has joined #ruby
<jhass>
he doesn't mean anything
<havenwood>
shevy: seems there're at least two 2.0.0's involved
amystephen has quit [Quit: amystephen]
<shevy>
tirengarfio wants to use all ruby versions at the same time!
klmlfl has quit [Ping timeout: 244 seconds]
Abhijit has quit [Ping timeout: 245 seconds]
<tirengarfio>
Im still confused..
<rpag>
tirengarfio be like halp, and jhass be like naoooo
<havenwood>
tirengarfio: ignoring me didn't help?
<havenwood>
:P
<jhass>
you're still not saying anything beyond "I don't understand" and "I'm confused"
<havenwood>
sometimes it does
<shevy>
tirengarfio you need to type more quickly man!
<jhass>
we don't magically know your thoughts to break through the confusion
<tirengarfio>
I have uninstalled and installed compass again, being 2.0.0 the used version
<tirengarfio>
:)
<shevy>
and now compass works
<tirengarfio>
Im getting the same error
antgel has joined #ruby
<rpag>
tirengarfio, are you near a window?
<jhass>
because you're using the same command
<tirengarfio>
/home/tirengarfio/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'compass' (>= 0) among 14 total gem(s)
<jhass>
this is nothing that "went wrong"
<jhass>
it's you not understanding basic things about what paths and files are
<ddv>
you got to admire jhass's persistence
<shevy>
tirengarfio ok so you did not install it with the right ruby
<jhass>
and what $PATH is
<havenwood>
rpag: defenestration as pebkac solution?
<jhass>
so redoing the same faulty steps of course results in the same error
<jhass>
no matter how often you try
<jhass>
computers are good at doing the same stuff over and over again
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
it won't magically start working
tobago has quit [Remote host closed the connection]
<rpag>
havenwood, you know me too well
garbanotas has quit [Read error: Connection reset by peer]
<shevy>
jhass hey on windows it can
<shevy>
switch on switch off switch on switch off a couple times
<tirengarfio>
maybe I should uninstall ruby and start from the beginning, that would help me
garbanotas has joined #ruby
<rpag>
good idea
<jhass>
no, on windows just nobody understand the determinism behind it, it doesn't fit into a human head
<shevy>
the first eight times it does not want to boot but then BAMMM out of nowhere, it boots!
<jhass>
tirengarfio: it's not needed
giuseppesolinas has joined #ruby
<jhass>
you just need to understand your issue
<jhass>
it's really simple
<shevy>
tirengarfio YES - keep it simple. use one ruby version
<jhass>
you just need to look at what you're doing
<jhass>
and look at the output of gem env
<jhass>
and what /usr/bin/ruby -v vs ruby -v gives
<shevy>
look tirengarfio - don't confuse yourself. stay simple. use one ruby. compile from source
<kl>
ddv: good work
<ddv>
lol
adriancb has joined #ruby
mkaesz has joined #ruby
<tirengarfio>
I have removed /usr/bin/compass and /usr/local/bin/compass since where related to a "bad" compass installed
tagrudev has quit [Remote host closed the connection]
<shevy>
aha
<shevy>
so you had two versions!
<jhass>
three
<tirengarfio>
Then I have reinstall compass, gem install compass. and after which compass I get "/home/tirengarfio/.rvm/gems/ruby-2.0.0-p598/bin/compass"
<shevy>
thought you are out of it already jhass ;)
<jhass>
yeah, I'm ignoring him, just answered you
<shevy>
tirengarfio AHA THERE IS THE THIRD ONE
<shevy>
tirengarfio let's add a fourth and a fifth for good measure
<havenwood>
tirengarfio: It's a colon-separated list of directories where the system goes to look for commands. Running just `compass` will find the first compass in your PATH or if there isn't one it'll error.
<shevy>
there tirengarfio - we have to repeat what havenwood wrote
<shevy>
"Running just `compass` will find the first compass in your PATH"
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<shevy>
so look at $PATH! echo $PATH !
<tirengarfio>
don't be bad please.., I think that if I create a symlink (/usr/bin/compass) to that file, my problems would be solved, right?
giuseppesolinas has joined #ruby
<shevy>
in principle yes
<havenwood>
:O
Kricir has quit [Ping timeout: 256 seconds]
* havenwood
backs away slowly
<shevy>
haha
<shevy>
tirengarfio we drive them away! go us!
<shevy>
they are agents of order
<shevy>
we are agents of chaos
timonv_ has joined #ruby
arya_ching has joined #ruby
<shevy>
really ... didn't you want the joker to win against the dark knight?
<havenwood>
shevy: haha
doodlehaus has quit [Remote host closed the connection]
livathinos has quit [Remote host closed the connection]
JCii8__ has joined #ruby
airdeluxe has quit [Quit: Leaving]
cleopatra has quit [Quit: Saliendo]
cleopatra has joined #ruby
<havenwood>
tirengarfio: If you did say `/usr/fake/ls` it wouldn't look in PATH for the first `ls`, it'd just use the one you said.
cleopatra has quit [Client Quit]
<jhass>
shevy: you're under the eristic illusion
cleopatra has joined #ruby
<tirengarfio>
this is my echo $PATH output: /home/tirengarfio/.rvm/gems/ruby-2.0.0-p598/bin:/home/tirengarfio/.rvm/gems/ruby-2.0.0-p598@global/bin:/home/tirengarfio/.rvm/rubies/ruby-2.0.0-p598/bin:/home/tirengarfio/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
livathinos has joined #ruby
brendenb has quit [Ping timeout: 258 seconds]
<ddv>
I never saw jhass losing his patience
doodlehaus has joined #ruby
<tirengarfio>
now that I have created the symlink, should I add /usr/local/bin/compass to $PATH?
<shevy>
ah ah ah every .rvm gets an entry there
<jhass>
sorry, but it's so stupid simple
tjbiddle has quit [Quit: tjbiddle]
<jhass>
ddv: he just refuses to look at what he executes
<shevy>
oha
<shevy>
<tirengarfio> don't be bad please.., I think that if I create a symlink (/usr/bin/compass)
<shevy>
<tirengarfio> now that I have created the symlink, should I add /usr/local/bin/compass to $PATH?
noop has quit [Ping timeout: 272 seconds]
<shevy>
the paths changed suddenly!
<ddv>
:)
Guest15604 has quit [Ping timeout: 258 seconds]
<shevy>
here is what we will do:
<tirengarfio>
ok, sorry, sorry, I meant /usr/local/bin/compass
<shevy>
we will add a symlink that will point to itself!
<jhass>
fuck it
last_staff has joined #ruby
JCii8_ has quit [Ping timeout: 258 seconds]
<jhass>
tirengarfio: remove those silly symlinks
<shevy>
ddv he can't resist to help
<jhass>
and just don't call your system ruby
<jhass>
/usr/bin/ruby compass -> compass
<jhass>
/usr/bin/ruby _is wrong_
eind has joined #ruby
<tirengarfio>
jhass, ok, I have remove it, now what?
<jhass>
it's not the ruby you installed compass for
giuseppesolinas has quit [Quit: This computer has gone to sleep]
brendenb has joined #ruby
<jhass>
now read everything I wrote before replying
<shevy>
lol
<borkdude>
I have written a function that gets called by carrierwave process, like this: https://www.refheap.com/94115, but if I don't call save_image in it explicitly, the upload is not saved as the cropped image, but as the original image :-s
<jhass>
reading, working with computers is about reading stuff, not just skimming over it all the time. learn it
C0deMaver1ck_ has joined #ruby
<borkdude>
what could I be missing
<jhass>
borkdude: #RubyOnRails guys might have more experience with carrierwave issues
<borkdude>
jhass thanks
<tirengarfio>
jhass, "it's not the ruby you installed compass for" but I reinstalled gem
<jhass>
fuck
fgo_ has quit [Ping timeout: 255 seconds]
<havenwood>
zombie turkeys
<jhass>
*scrolls up to copy paste your command for you*
<ddv>
borkdude: you are probably saving the uncropped image, double check
<workmad3>
jhass: tech support is about dealing with people who should never be allowed near a keyboard...
<jhass>
workmad3: this isn't tech support, I would act differently ;)
<jhass>
jhass, Im using a php framework that generate this type of commands: '/usr/bin/ruby'
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has joined #ruby
timonv_ has quit [Remote host closed the connection]
<apeiros>
IMO Range#inspect should include ()
<eam>
a=".."..".."; 3.times{a=a..a};a
<eam>
>> a=".."..".."; 3.times{a=a..a};a
<eval-in__>
eam => ".."..".."..".."..".."..".."..".."..".."..".."..".."..".."..".."..".."..".."..".."..".."..".." (https://eval.in/227220)
brendenb has quit [Ping timeout: 258 seconds]
Seich has quit [Ping timeout: 258 seconds]
aganov has quit [Quit: Leaving]
rodfersou has quit [Ping timeout: 272 seconds]
renderful has quit [Ping timeout: 258 seconds]
uber_hulk has quit [Read error: Connection reset by peer]
diamonds has quit [Ping timeout: 255 seconds]
brendenb has joined #ruby
Seich has joined #ruby
<leitz>
Ruby-newbie question. Run a script that required lib/class_y. Have written lib/class_x that inherits class_y and uses "require class_y" in the code. Changing the script in the parent direcoty to call ClassX says it can't find class_y's file.
<leitz>
If that makes sense.
enape_101 has quit [Read error: Connection reset by peer]
<epitron>
eam: :D
enape_101 has joined #ruby
<epitron>
apeiros: how come? doesn't it only need () for glitches like this?
<epitron>
or do you like copy-pasting inspects?
rshetty has joined #ruby
<jhass>
leitz: not too much, remove the abstractions and show code and error in a gist
<jhass>
havenwood: and the class name is Imperal_Marine, wanted to go over the style note once we fixed his error ;)
hao has joined #ruby
<jhass>
leitz: ruby -v ?
<leitz>
jhass, I love following style once I know it.
<epitron>
apeiros: hmmm.. maybe it should put () around it if the range is nested in some other expression
<leitz>
Don't gag: 1.8.7
<epitron>
that would make sense in an array
zumbi has quit [Ping timeout: 255 seconds]
freerobby has joined #ruby
<epitron>
although, to me, [1..2, 3..4] looks nice
<jhass>
leitz: okay, please update
* leitz
goes to fix file names before he forgets.
<havenwood>
epitron: ha, nice
<jhass>
1.8 is past end of life and out of support
<apeiros>
epitron: and how'd inspect know whether it's nested?
<jhass>
leitz: it's old and you shouldn't learn the language on it
<epitron>
apeiros: binding_of_caller :D
<epitron>
jk jk..
<apeiros>
epitron: an object in general doesn't know whether it is nested in another object (and wouldn't make sense either as it could be contained in multiple)
mloveless has joined #ruby
<leitz>
jhass, my goals are to learn ruby for work, which uses 1.8.7.
<epitron>
apeiros: it could probably do it in pp, since pp uses some kind of DSL
<havenwood>
leitz: are they not switching, soon?
<rpag>
18 4 life
<apeiros>
epitron: an external serializer can, yes.
<leitz>
havenwood, nope. I'm a server guy, not a real programmer. I use what's on the boxes.
<apeiros>
but then we're no longer speaking about Range#inspect ;-)
* epitron
externally serializes apeiros
<epitron>
apeiros: i'm having trouble thinking of a specific case where a naked range looks wrong
<havenwood>
epitron: at a dinner party?
rkalfane has joined #ruby
<epitron>
:O
<epitron>
cover yourself up, love
* epitron
adds ()
<havenwood>
decorum restored!
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<epitron>
we can all see what's in the () though
<havenwood>
ain't that so
arya_ching has quit []
<epitron>
such false decorum
<jhass>
leitz: so ruby 1.8 unfortunately has . (the current directory) in the default load path, which is the reason your examples work at all but also confusing as you've just experienced. Later ruby versions fix that issue by removing . from the default load path
<jhass>
leitz: I would suggest you ignore that . is in your load path and properly setup your load path instead
xymbol_ has quit [Quit: Be back later ...]
klmlfl has joined #ruby
<epitron>
good old 1.8
<jhass>
for example if you do ruby -Ilib foo.rb with lib/bar.rb existing, in foo.rb you can do 'require "bar"' and in lib/baz.rb you can do 'require "bar"', just like you expect
mloveless has quit [Ping timeout: 255 seconds]
Techguy305 has quit [Ping timeout: 255 seconds]
fabrice31 has quit [Remote host closed the connection]
<jhass>
an alternative would be doing $LOAD_PATH << File.expand_path("../lib", __FILE__) before doing any requires to achieve the same effect
<apeiros>
"." in load path is unreliable
<jhass>
the third alternative is using require_relative instead of require which is relative to the current file instead of the current working directory
<apeiros>
remember, its *working directory*, not relative to the requiring file.
<havenwood>
but not in 1.8
chu has joined #ruby
<apeiros>
and nothing guarantees you from where a script is run
felipedvorak has joined #ruby
<apeiros>
proper loadpath best, IMO
<epitron>
alias require_relative load
doodlehaus has quit [Remote host closed the connection]
Phrohdoh has joined #ruby
<apeiros>
and the entity responsible for setting up load path is the executable
hao has quit [Quit: Leaving]
<havenwood>
epitron: then you break all that fine code that detects 1.9+ by checking if #require_relative exists >.>
<epitron>
:D
<Phrohdoh>
This is RoR related; but can someone help me identify why my post data isn't being updated with this code? https://gist.github.com/Phrohdoh/96b5e78b61c989a7d2db the flash message is shown successfully.
fabrice31 has joined #ruby
<epitron>
havenwood: do people actually do that?
<havenwood>
epitron: i've seen it at least once, maybe only once
<jhass>
Phrohdoh: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ help
<epitron>
havenwood: ONCE TOO MANY
<Phrohdoh>
Sweet, thanks
felipedvorak341 has joined #ruby
felipedvorak has quit [Disconnected by services]
Advocation has quit [Quit: Advocation]
Phrohdoh has left #ruby [#ruby]
<epitron>
or join #RubyOnRailsOffNickserv
<epitron>
aww
St_Marx has quit [Quit: WeeChat 0.4.2]
felipedvorak341 has quit [Remote host closed the connection]
<havenwood>
there should be a rails channel to help people get into the rails channel
Scripore has quit [Ping timeout: 264 seconds]
<epitron>
snide remarks aren't the same without someone to be confused by them
St_Marx has joined #ruby
<epitron>
havenwood: seriously
sdwrage has joined #ruby
klmlfl has quit [Ping timeout: 240 seconds]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<epitron>
chanserv has a feature for that, doesn't it?
<epitron>
it can bounce non-identified people to another channel automatically?
banister has joined #ruby
<havenwood>
epitron: dunno
<epitron>
i think #python has that
Timgauthier is now known as timgauthier_away
<epitron>
it shoves you into ##python if you're not idented
fabrice31 has quit [Ping timeout: 250 seconds]
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fgo_ has joined #ruby
Timgauthier has joined #ruby
siaw has joined #ruby
<havenwood>
so #rubyonrails could bump to #rubyonfails until you auth, aha
<workmad3>
epitron: he ran away from #rubyonrails before he got an answer too
<siaw>
in irb, why is the return value of ‘puts “Hello”’ give nil?
<workmad3>
siaw: because 'puts' always returns nil
<banister>
workmad3 sup work-dogg
<workmad3>
hey fiend-man
<havenwood>
siaw: it just has no return value, so: nil
<siaw>
workmad3: why?
<banister>
epitron sup jaseppy
<workmad3>
siaw: because it does
Xeago has joined #ruby
<havenwood>
siaw: everything returns, when no value of import, nil
<banister>
siaw its job is to write shit to the screen not to return a value
<siaw>
if i do x = 5, the return valus is 5
<leitz>
jhass, I tried the $LOAD_PATH << bit in the imperial_marine, not seeing a fix.
<siaw>
that’s ok, but puts i understand is a method on SELF
<jhass>
leitz: which file exactly? did you update the require statements?
<Phrohdoh>
Oh you're right that is rails, sorry :/
moritzs has joined #ruby
<jhass>
or actually you call it on the model I think
rustshaman has quit [Read error: Connection reset by peer]
<jhass>
while having it defined in the controller
<Phrohdoh>
Today is my first day with ruby so I don't quite get the terms yet, unfortunately.
<jhass>
post is your model
<jhass>
app/models/post.rb
<Phrohdoh>
ah the actual class stuff
<jhass>
everything is an object in ruby, so everything has a class ;)
<Phrohdoh>
well of course
tastycode has quit [Ping timeout: 264 seconds]
<Phrohdoh>
I come from C# btw so this split logic is... different
Advocation has joined #ruby
siaw has left #ruby [#ruby]
<jhass>
C# is not object oriented?
<Phrohdoh>
It is, but everything usually goes in a single file
<jhass>
MVC is just a design pattern
<Phrohdoh>
everything related to that type
fedexo has joined #ruby
<jhass>
you can do it in any OO language
<Phrohdoh>
mhm
<Phrohdoh>
So I want timestamp_string defined on the model not the controller, right?
<jhass>
yeah
last_staff has quit [Ping timeout: 258 seconds]
<jhass>
since you call it on an instance of it
tastycode has joined #ruby
<fxn>
Phrohdoh: in most apps, that's also the convention, though technically not required, in large libs like Rails class/module reopening is used
arup_r has joined #ruby
<fxn>
Phrohdoh: in most apps, one file has one class and that's it
<Phrohdoh>
I don't even know what that is, but I'll keep it in mind.
xymbol_ has quit [Quit: Be back later ...]
devoldmx has joined #ruby
<Phrohdoh>
Worked like a charm. Thanks jhass.
<Phrohdoh>
shevy: I just realized your joke was aimed at me :|
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Phrohdoh>
bye bye, I'll probably be back
Phrohdoh has left #ruby [#ruby]
dangerousdave has joined #ruby
rshetty has quit [Remote host closed the connection]
<leitz>
If the parent class sets a constant does the child class have access to it?
xymbol_ has joined #ruby
dogetime has left #ruby [#ruby]
<fxn>
leitz: yes, constant lookup follows the ancestor chain
<fxn>
unless you do something unusual like const_get(:FOO, false)
<fxn>
of course it has to reach that point, for bar constant names nesting is checking first, in case of name collision parent namespace wins over ancestor
<banister>
leitz you can't just show the backtrace, if you have to show some code
<leitz>
the make_imperial_marine script is pretty much a clone of the chargen script.
msgodf has quit [Ping timeout: 240 seconds]
enape_101 has quit [Ping timeout: 265 seconds]
<jhass>
leitz: your child class overrides initialize while never calling the parent ones or initializing @stats itself, so it's nil
<leitz>
banister, didn't the gist have the code links? I'm new enough to know know just which parts are the relevant ones.
<banister>
leitz no it didnt
<jhass>
this are called instance variables though, not constants
<leitz>
Ah, I thought couldn't find the STAT_NAMES array.
<leitz>
banister, sorry. I'm still figuring out gists as well.
<jhass>
foo[bar] = baz is actually a method call
<jhass>
foo.[]=(bar, baz)
<banister>
jhass how did u get that when there's 0 mention of a @stats ivar in the backtrace? :)
<jhass>
@stats is nil, and nil does not have the []= method, thus your error
enape_101 has joined #ruby
tvw has quit []
<jhass>
banister: i looked at the code
Abhijit has joined #ruby
* leitz
needs to go learn how to initialize additional stuff and not blast everything else.
<banister>
jhass oh you mean you copy and pasted those links :)
<jhass>
super calls the parent method
<jhass>
banister: had them open from earlier :P
<banister>
k00
anaeem1_ has joined #ruby
ringaring has quit [Read error: Connection reset by peer]
adriancb has joined #ruby
nkumari has joined #ruby
mjmac has joined #ruby
<leitz>
Yup, super. Woot!
tastycode has quit [Quit: tastycode]
apeiros has joined #ruby
ta has joined #ruby
konsolebox has quit [Ping timeout: 258 seconds]
timonv_ has joined #ruby
AFKGeek has joined #ruby
moritzs has quit [Read error: Connection reset by peer]
kwatz has joined #ruby
kwatz is now known as destructure
ndrei has quit [Ping timeout: 240 seconds]
tastycode has joined #ruby
Avahey has quit [Quit: Connection closed for inactivity]
freerobby has quit [Quit: Leaving.]
nkumari has quit [Remote host closed the connection]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sailias1 has joined #ruby
tastycode has quit [Client Quit]
mloveless has joined #ruby
sailias has quit [Ping timeout: 264 seconds]
Spami has quit [Quit: This computer has gone to sleep]
sailias1 has quit [Read error: Connection reset by peer]
Spami has joined #ruby
sailias has joined #ruby
Spami has quit [Remote host closed the connection]
chabier has quit [Remote host closed the connection]
nastri has quit [Remote host closed the connection]
codehotter has joined #ruby
<codehotter>
I have a yaml file and I want a single property defined in there, how do I do that? I don't want to deserialize it into a ruby object entirely
rdark has quit [Quit: leaving]
konsolebox has joined #ruby
mloveless has quit [Ping timeout: 250 seconds]
rdark has joined #ruby
<jhass>
you basically have to do it properly
<epitron>
if the property name is unique, you can just grep it
avril14th has quit [Remote host closed the connection]
wsmoak has quit [Quit: wsmoak]
AFKGeek has quit [Remote host closed the connection]
<user_01>
ddv: code repositories (svn) is not why i need redmine.
ghr has joined #ruby
bharanim has left #ruby [#ruby]
<ddv>
user_01, still using svn 2014?
<ddv>
+in
<jhass>
user_01: there's #redmine
<user_01>
ddv: no. i am always using git. this is a passenger thing that’s why i came here. :/
chrishough has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
<user_01>
maybe permission problem. no problems while using redmine but i dont like the output on the command line.
<jhass>
there also is #passenger
<user_01>
really?
<user_01>
nice.
agjacome has joined #ruby
<jhass>
user_01: /msg alis help
<user_01>
actually i just chmod 644 the passenger.list file and this fixed it.
<leitz>
Generic OOP question. If you have several different children classes that will inherit from the same parent but either override or not use a (method, attribute), should the (method,attribute) be in the parent or just implemented in each child as needed?
<jhass>
leitz: do you ever instantiate the parent?
<leitz>
jhass, yes. However, it would not be with the (method, attribute)
ghr has quit [Ping timeout: 255 seconds]
<jhass>
is there a sensible/useful implementation in the parent possible
<jhass>
?
rkalfane has joined #ruby
<leitz>
jhass, yes. This is coding for a game (Traveller). and 99% of the time a character goes into some military or similar service. The Imperial_Marine class is an example of a Character doing that.
<jhass>
btw ImperialMarine
<jhass>
Imperial_Marine looks silly :P
<leitz>
However, you can have a Character with basic stats but none of the changes.
<jhass>
leitz: so, if there's a common implementation for most of the childs you put it into the parent, regardless if the parent uses it or not and only overrie it in the childs that have a different implementation
rdark has quit [Quit: leaving]
jjasonclark has quit [Quit: jjasonclark]
Shazaum has quit [Quit: This computer has gone to sleep]
<jhass>
on a case by case basis ymmv, there rarely a clear do and don'ts in object oriented design
jheg has joined #ruby
linojon has joined #ruby
<leitz>
Example; 4 of the 6 possible career paths don't use rank at all. So should the rank methods and attributes go into the parent?
<leitz>
An instantiated parent would not have a rank, either.
<jhass>
you would likely want to extract the common functionality into a module and include that
<leitz>
I think the "module" concept is a bit beyond my skill.
<_aeris_>
TypeError: no implicit conversion of nil into String
freerobby has joined #ruby
keen___ has quit [Read error: Connection reset by peer]
aces1up has quit []
phutchins has joined #ruby
marr has quit [Ping timeout: 250 seconds]
luksaur has quit [Quit: Leaving]
keen___ has joined #ruby
<jhass>
how about ssl_context = OpenSSL::SSL::SSLContext.new method || OpenSSL::SSL:SSLContext::DEFAULT_PARAMS[:ssl_version]
timonv_ has joined #ruby
pchellovod has joined #ruby
<leitz>
Is there a way to set a variable with a maximum in the set? That is x = rand(y) + 3 with a max of 6?
<jhass>
_aeris_: always initialize with the default and ssl_context.ssl_version = method if method
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<jhass>
*or ^
patrick99e99 has quit [Ping timeout: 264 seconds]
<jhass>
leitz: you didn't describe what "the set" is
kirun has joined #ruby
tvw has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
<leitz>
Sorry, it's just setting a varialbe with a different maximum.
xMopxShell has quit [Ping timeout: 255 seconds]
<leitz>
Long day so far, my brain is starting to melt.
bayed has quit [Quit: Connection closed for inactivity]
chabier has joined #ruby
<jhass>
x = [x, 6].min ? still not sure I get you
<leitz>
In this case, there are 8 enlisted ranks and 6 officer ranks. Rank is based on number of terms but can be modifed. So the goal is "roll high, if you get higher, set it to the max."
pchellovod has left #ruby ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
maroloccio has quit [Quit: WeeChat 1.0]
jottr has quit [Ping timeout: 240 seconds]
<jhass>
so ^ or x = 6 if x > 6
boombadaroomba has joined #ruby
xMopxShell has joined #ruby
<leitz>
I like the first one, looks more like idomatic ruby. :)
<cleopatra>
hohoho
chabier has quit [Ping timeout: 250 seconds]
Takle has quit [Read error: Connection reset by peer]
Aswebb has quit [Remote host closed the connection]
Guest37730 has joined #ruby
Aswebb has joined #ruby
FooMunki has quit [Read error: No route to host]
Kilo`byte has joined #ruby
FooMunki has joined #ruby
nkumari has quit [Remote host closed the connection]
Aswebb_ has joined #ruby
nkumari has joined #ruby
kl has joined #ruby
Takle_ has quit [Remote host closed the connection]
sdwrage has quit [Quit: This computer has gone to sleep]
freerobby has joined #ruby
Aswebb has quit [Ping timeout: 258 seconds]
Guest37730 has quit [Client Quit]
<leitz>
Is there a certain prefix for a varialbe used only in a class method?
enape_101 has quit [Ping timeout: 264 seconds]
<jhass>
mmh, actually there are no class methods
<leitz>
Is it a class "thingy" then?
Aswebb_ has quit [Ping timeout: 264 seconds]
Advocation has joined #ruby
<jhass>
this probably gotta be a bit confusing at this stage but here it comes: a class is an instance of the class Class. "class methods" are instance methods unique to this single instance of the Class
Guest75776 is now known as BLuEGoD
Hobogrammer has joined #ruby
<eam>
if you don't want anyone else to mess with your variables prefix them with a non-breaking space
<jhass>
klass = Class.new; def klass.foo; end; klass.fo
<jhass>
o
jjasonclark has joined #ruby
<jhass>
so, your class is actually an instance (=an object) and "class methods" are instance methods. Hence you can use instance variables
<leitz>
So what is klass.foo"
<leitz>
?
<jhass>
they will belong to your class instance, not to instances of your class
<jhass>
the correct term is singleton method, but I wanted to avoid introducing singleton classes right now ;)
thsig_ has joined #ruby
<jhass>
they're still instance methods
<leitz>
In instance method foo I use a varialbe that's only used within foo. Is there a prefix for that sort of variable?
<leitz>
Isn't the @foo variable in instance method klass.foo useable outside of klass.foo but still inside klass?
<jhass>
both times same example, just different names
sdwrage has joined #ruby
Xchris has joined #ruby
<Xchris>
hi
Aswebb has joined #ruby
<jhass>
so, to summarize: classes are instances, they can have instance variables, those instance variables live in different scope than the instance variables of your instance methods
Dev_R3d has quit [Quit: Quitte]
aspiers has joined #ruby
aerook has quit [Quit: Page closed]
Denommus has joined #ruby
hiyosi has joined #ruby
<Denommus>
...
<jhass>
,,,
timonv_ has quit [Remote host closed the connection]
<tejas-manohar>
it's also in my gemfile and i've done 'bundle' so we're in good shape on having it installed :)
<tejas-manohar>
i'm on ruby 2.1.5 -- any ideas on that error?
brendenb has joined #ruby
charlenopires has joined #ruby
Xeago has joined #ruby
gregf has joined #ruby
kl has quit [Ping timeout: 240 seconds]
thsig has quit [Remote host closed the connection]
hydrozen has joined #ruby
SpikeMaster has joined #ruby
<tejas-manohar>
guys any idea on that ruby gem installation failure?
<eam>
shevy: /win 11
dalai has left #ruby [#ruby]
<leitz>
I know I've seen this before but my brian is to fried to remember. upp = "1A2B3C" and upp[0] comes back as "49". What am I forgetting?
<eam>
what, how did that happen
dangerousdave has joined #ruby
<jhass>
tejas-manohar: sounds like a bug in the gem, open an issue
<eam>
leitz: ruby 1.8 vs newer
uber_hulk has quit [Quit: leaving]
dangerousdave has quit [Client Quit]
<tejas-manohar>
jhass: sure making issue, till thats resolved -- do u know any alternatives to rerun?
<eam>
behavior of [] on String changed from returning the ordinal ascii value to returning the character substring
<jhass>
Ctrl+C, Up, Enter
<jhass>
leitz: you just found another reason why 1.8 is crap ;)
charlenopires has quit [Ping timeout: 265 seconds]
<shevy>
leitz your brian is fried?
<hydrozen>
Style question here. Does the ruby community usually puts a blank line after the first line of a class/module definition? I advocate the first style in this gist but one of my coworker says the 2nd style is more readable... https://gist.github.com/hydrozen/65cef32238e9c2f58da0
kl has joined #ruby
<hydrozen>
I prefer to see more code in a screen fold and so I avoid uncessary line breaks..
<shevy>
so what is what there
<tejas-manohar>
jhass: nice one
<shevy>
I see lots of comments
<leitz>
shevy, I don't get to code a lot but had today off. Have been going for about 8 hours straight
<jhass>
hydrozen: I do first style too
<eam>
put a semicolon on any empty line
TDJACR has quit [Read error: Connection reset by peer]
<shevy>
don't mind eam, perl ruined him
<tejas-manohar>
which mongo orm do u guys use w/ ruby
<eam>
this line intentionally left blank, but now it no longer is :(
<tejas-manohar>
what about sql odm
<shevy>
hydrozen I put a newline after a module, but I also indent the first class on the same level, and end the module definition with "end; end"
<hydrozen>
ok
<hydrozen>
god I hate arguing about style stuff
Advocation has quit [Quit: Advocation]
<shevy>
actually I think most people will put a newline after a module
<hydrozen>
yet its rather important..
<shevy>
"module Rack
<shevy>
# The Rac"
<hydrozen>
I’m ready to live with some whitespace after a module def or something
<shevy>
one newline was swallowed there
<shevy>
I always like to quote rack for style guides
<hydrozen>
but the blank lines at the end between the "end"
<hydrozen>
thats pretty pointless
<shevy>
what blank lines at the end
benzrf is now known as benzrf|offline
<hydrozen>
in that gist, line 27-31
<hydrozen>
its pointless blank lines
Advocation has joined #ruby
<shevy>
oh yeah
<shevy>
that's why I don't have code like that
linojon has joined #ruby
<hydrozen>
I’m not sure I’d do "end; end" as you do though
<eam>
put module Foo; class Bar on the same line
<shevy>
I think the main reason for me using just one indent level was that I became too lazy to indent twice, when the main functionality was only to namespace a project properly (under a Module) anyway
<hydrozen>
but yeah, very subjective I guess
<SpikeMaster>
i prefer less whitespace. But wouldn't care if style guide said to add whitespace.
vyorkin has quit [Ping timeout: 258 seconds]
<shevy>
hydrozen ah that is simple too - putting the end on different lines does not make sense if I already break the normal indent-level
<hydrozen>
shevy: yeah indeed
<shevy>
at least on that paste it is consistent
<leitz>
upp[3].chr..to_i(16)
phrozen77 has joined #ruby
phrozen77 has quit [Changing host]
<shevy>
even if verbose :)
<shevy>
I even tried to do stuff like this: def foo_bla; @foo *2; end all on one line
<SpikeMaster>
for lines 27-31 i'd stronly argue for less whitespace. For lines 2-3 i woudlnt' really care either way.
<shevy>
but it conflicted with the rest of my code, so I changed back to not use ; there
<hydrozen>
I think rubocop with its default settings will complain about blank lines after module/class
<waxjar>
i do that if i have a lot of very similar short methods
<hydrozen>
but its configurable..
dangerousdave has joined #ruby
<waxjar>
and i dont want to define them dynamically so they get documented properly
<hydrozen>
but im afraid my coworker is hard to convince to change his style so i’ll probably just bite the bullet
<hydrozen>
:(
<eam>
hydrozen: introduce something even worse, then compromise
<hydrozen>
his argument was that "if you do put a blank line after your module/class definition, why do you have blank lines around your "private" keyword?
<shevy>
rubocop loves to complain
<hydrozen>
which i think is a completely other thing
<eam>
hydrozen: tell him fine, but he has to indent the blank lines to the appropriate level
<shevy>
hydrozen well you could use private for each individual method too :)))
<shevy>
def foo
<hydrozen>
that was meant to be "if you dont"
<shevy>
end; private :foo
shredding has joined #ruby
samuel02 has joined #ruby
Notte has joined #ruby
Advocation has quit [Quit: Advocation]
portiad has joined #ruby
startupality has quit [Ping timeout: 245 seconds]
startupality_ has joined #ruby
lemur has joined #ruby
hiyosi has joined #ruby
portiad has quit [Remote host closed the connection]
portiad has joined #ruby
C0deMaver1ck_ has quit [Ping timeout: 258 seconds]
Techguy305 has joined #ruby
C0deMaver1ck_ has joined #ruby
<SpikeMaster>
do you use emacs? You could have the trailing "end"s visually appear in your style while actually containing whitespace.
<SpikeMaster>
get to see what you like, but please the whitespace lovers.
marr has joined #ruby
Techguy305 has quit [Client Quit]
jrvlima has joined #ruby
eind has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
18VABN6T6 has joined #ruby
hiyosi has quit [Ping timeout: 265 seconds]
Jackneill has quit [Remote host closed the connection]
giuseppesolinas has quit [Read error: Connection reset by peer]
giuseppesolinas has joined #ruby
<kaspergrubbe>
Oh, our plan is to expose the api on production environment, we have external developers that work with it
<tejas-manohar>
kaspergrubbe: you guys use 'rspec' or 'rspec-rails'
thsig has joined #ruby
<tejas-manohar>
kaspergrubbe: oh yeah but some parts i assume u dont wanna expose?
_5kg has quit [Ping timeout: 250 seconds]
<kaspergrubbe>
we will expose it behind an admin login :)
<kaspergrubbe>
we use rspec-rails
<tejas-manohar>
kaspergrubbe: ahh
dcunit3d has joined #ruby
vyorkin has joined #ruby
ringarin has quit [Ping timeout: 256 seconds]
<tejas-manohar>
kaspergrubbe: rails 4 rite?
<kaspergrubbe>
Not yet :( But we are getting there
reinaldob has quit [Remote host closed the connection]
<tejas-manohar>
kaspergrubbe: oh ok, if u went on rails 4 would u still use rspec-rails or just rspec?
<tejas-manohar>
kaspergrubbe: btw thanks for all help, im pretty inexperienced in rails
astav has joined #ruby
quimrstorres has quit [Remote host closed the connection]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kaspergrubbe>
why would you use core rspec for rails? The helpers in rspec-rails is built for rails testing
baroof has joined #ruby
thsig_ has joined #ruby
<tejas-manohar>
kaspergrubbe: true yeah, whats the pt of ur test server? why dont you just deploy to production if all tests pass?
<kaspergrubbe>
Its a bit smoother. Circleci runs specs on all our branches, and when we merge our change into master, the spec-suite is run again, and deployed if passed
_5kg has joined #ruby
<kaspergrubbe>
The last part is called 'Continuous integration', and I was a bit afraid of it in the beginning, but I really like it now.
<shevy>
wow you really caught kaspergrubbe's attention man
<tejas-manohar>
lol
<tejas-manohar>
kaspergrubbe: yeah makes sense, you know any alternatives to this circleci just trying to investigate how the industry is?
ohaibbq has quit [Remote host closed the connection]
jrvlima has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tejas-manohar>
travisci?
thsig has quit [Ping timeout: 264 seconds]
<kaspergrubbe>
travis is nice, there is also https://www.shippable.com/ but I found their product a bit brittle
nisstyre has joined #ruby
nisstyre has quit [Changing host]
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tejas-manohar>
kaspergrubbe: and jenkins? codeship?
<kaspergrubbe>
I have no experience with those. Codeship looks interesting.
jimms has joined #ruby
SHyx0rmZ has quit [Remote host closed the connection]
<tejas-manohar>
kaspergrubbe: you guys use better_errors?
razieliyo has joined #ruby
<tejas-manohar>
if so keep that on test as well as development or no?
havenwood has quit [Remote host closed the connection]
cleopatra has quit [Ping timeout: 264 seconds]
<kaspergrubbe>
I don't think it makes sense to run it in test. But we have looked at it, but I think there was some integration issues we needed to resolve it before using it
<kaspergrubbe>
I use it on other projects
vyorkin has quit [Ping timeout: 255 seconds]
moritzs has joined #ruby
chabier has quit [Remote host closed the connection]
baroof has quit [Quit: Page closed]
klmlfl has quit [Remote host closed the connection]
olivier_bK has joined #ruby
luriv_ has joined #ruby
FooMunki has quit [Quit: FooMunki]
sski has joined #ruby
TPBallbag has quit []
reinaldob has joined #ruby
luriv has quit [Ping timeout: 264 seconds]
moshe has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
thsig_ has quit [Remote host closed the connection]
Takle has quit [Read error: Connection reset by peer]
aspiers has quit [Ping timeout: 264 seconds]
Takle has joined #ruby
<shevy>
test test test
ptrrr_ has joined #ruby
ptrrr has quit [Read error: Connection reset by peer]
ptrrr_ is now known as ptrrr
karmatr0n has joined #ruby
timonv_ has quit [Remote host closed the connection]