<shevy>
I more care about the end point than the steps towards it
<shevy>
and having to debug stuff always feels like a complete waste of time
<al2o3-cr>
shevy: bypass them depends., do you like coding?
uber_ has quit [Quit: bye]
<shevy>
not really
jsrn has quit [Ping timeout: 246 seconds]
<al2o3-cr>
shevy: Why not?
terlar has quit [Ping timeout: 255 seconds]
<al2o3-cr>
shevy: No story is perfect, without...
<shevy>
al2o3-cr because I feel that the end point is more important than the intermediary step. mankind in the future won't need to program the way we used to do it
<al2o3-cr>
shevy: you don't feel the love do you!
jsrn has joined #ruby
<VeryBewitching>
Code doesn't love.
<VeryBewitching>
It executes.
<VeryBewitching>
Well, hopefully it does anyway. ;)
<al2o3-cr>
VeryBewitching: very observbant
<shevy>
al2o3-cr yeah. I like the process of creating something that works
<al2o3-cr>
shevy: Why?
mistermocha has joined #ruby
<VeryBewitching>
If you look at the trend of how we're defining new languages to write code, we're moving away from an exclusive club of individuals who write all the code to languages that will allow anyone to do it.
freerobby has quit [Quit: Leaving.]
Azure has quit [Ping timeout: 255 seconds]
rbennacer has joined #ruby
<VeryBewitching>
In 30 - 40 years people will learn how to do it in elementary school.
<shevy>
al2o3-cr because that is the part that is creative
graffix has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
<al2o3-cr>
shevy: What does it give you?
graffix has joined #ruby
<shevy>
al2o3-cr which part
<al2o3-cr>
shevy: the creative part
mistermocha has quit [Ping timeout: 250 seconds]
<shevy>
al2o3-cr aaah. ideas! ideas build on ideas, you have to watch more Alan Kay lectures
<al2o3-cr>
Why, he's only made of what is everything, isn't he?
<shevy>
unless you can break the rules of the universe that's valid for everyone
devoldmx has quit [Ping timeout: 260 seconds]
markfletcher has joined #ruby
<al2o3-cr>
shevy: whatever you tink, Mr.
<al2o3-cr>
Ruby gives me satisfaction
freerobby has joined #ruby
<al2o3-cr>
understand the concepts or behold them
last_staff has quit [Quit: last_staff]
mistermocha has joined #ruby
Brando753 has quit [Excess Flood]
to_json has quit [Quit: Leaving.]
Brando753 has joined #ruby
jsrn has quit [Ping timeout: 240 seconds]
DenSchub has quit [Ping timeout: 246 seconds]
bMalum has quit [Quit: bMalum]
karapetyan has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 246 seconds]
bruno- has joined #ruby
jsrn has joined #ruby
DenSchub has joined #ruby
to_json has joined #ruby
to_json has joined #ruby
opensource_ninja has joined #ruby
h99h9h88 has quit [Remote host closed the connection]
trosborn has quit [Quit: trosborn]
Meeh has quit [Quit: No Ping reply in 180 seconds.]
mistermocha has joined #ruby
terlar has joined #ruby
bruno- has quit [Ping timeout: 265 seconds]
Meeh has joined #ruby
<Ox0dea>
VeryBewitching: Execution can be an act of love.
opensource_ninja has quit [Client Quit]
<Ox0dea>
shevy: For what other things is the destination more important than the journey for you?
<VeryBewitching>
Ox0dea: That statement can lead to some interesting philosophical discussion, but what the machine does is not emotional; our investment into the code is.
symm- has quit [Ping timeout: 244 seconds]
<Ox0dea>
VeryBewitching: Only meat can feel, yeah?
mag42c has quit [Quit: mag42c]
<VeryBewitching>
Ox0dea: That depends on the meat.
mistermocha has quit [Ping timeout: 240 seconds]
<Ox0dea>
VeryBewitching: But your position is that there are at present no non-meat feelers, yes?
<VeryBewitching>
Ox0dea: My position is that I have felt for code, I've never experienced code that has felt for me.
kalusn has joined #ruby
<VeryBewitching>
Ox0dea: I can't comment on other entities that I have not witnessed.
wnd has quit [Ping timeout: 260 seconds]
wnd has joined #ruby
<Ox0dea>
VeryBewitching: Then you confess to having no basis on which to conclude that the transistors don't derive some altruistic satisfaction in performing the work we give them.
<VeryBewitching>
Ox0dea: If I were to confess that, you would also have to confess to having no basis to determine that they do.
<VeryBewitching>
Ox0dea: We can talk about ideas, the abstract lands we visit in our mind when we're deep in our creations, but neither of us know what the logic gates can or cannot feel.
<VeryBewitching>
Ox0dea: Unless you've had meangingful conversations with a 64-bit processor lately :D
<al2o3-cr>
VeryBewitching: go suck a dummie or summat
<VeryBewitching>
al2o3-cr: I don't even know what you just said.
cashnguns has joined #ruby
markfletcher has left #ruby [#ruby]
<al2o3-cr>
VeryBewitching: it's a compliment
* VeryBewitching
shrugs.
<VeryBewitching>
If you say so :D
Azure has joined #ruby
<al2o3-cr>
tool
StevenXL has joined #ruby
<StevenXL>
Hi everyone.
<StevenXL>
I need to make a request to an API like so:
<StevenXL>
In that example, they use curl and the --data-binary option.
<havenwood>
al2o3-cr: Be nice.
<StevenXL>
How can I do effectively the same thing in Ruby?
saddad has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
kirun has quit [Remote host closed the connection]
c355E3B has quit [Quit: Connection closed for inactivity]
arooni has joined #ruby
mistermocha has quit [Ping timeout: 268 seconds]
l_tonz has quit [Remote host closed the connection]
saddad has joined #ruby
ElFerna has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
StevenXL: Are you sure you need to emulate `--data-binary`? That just does a POST without URL-encoding anything; that can be done with Net::HTTP#post and a plain-ol' String.
<shevy>
Ox0dea life, for instance
towski_ has quit [Remote host closed the connection]
skade has joined #ruby
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
shevy: Uh... what?
<StevenXL>
Ox0dea, I'm not sure. I can try it as you've suggested.
<StevenXL>
:-)
<StevenXL>
I'll be back.
<Ox0dea>
StevenXL: Godspeed.
<StevenXL>
toodles
DiCablo has joined #ruby
<al2o3-cr>
StevenXL: set the Content-Type to octet-stream
taylorrf has joined #ruby
<Ox0dea>
But consider not bothering.
tulak has quit [Remote host closed the connection]
markfletcher has joined #ruby
mistermocha has joined #ruby
<al2o3-cr>
bothered meh
hmsimha_ has quit [Ping timeout: 265 seconds]
Dakuan has joined #ruby
markfletcher has quit [Client Quit]
skade has quit [Ping timeout: 268 seconds]
arooni has quit [Ping timeout: 240 seconds]
BlackCoyote has quit [Remote host closed the connection]
Rollabunna has joined #ruby
sankaber has joined #ruby
weemsledeux has joined #ruby
<al2o3-cr>
jesus f c open links lee
DLSteve has joined #ruby
mag42c has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
but3k4 has joined #ruby
Dakuan has quit [Ping timeout: 264 seconds]
notnoyyyyy has quit [Ping timeout: 252 seconds]
ledestin has joined #ruby
rgtk has joined #ruby
rgtk has quit [Read error: No route to host]
Rollabunna has quit [Ping timeout: 244 seconds]
rgtk has joined #ruby
gguggi has quit [Ping timeout: 255 seconds]
mistermocha has joined #ruby
bubbys has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
DiCablo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JammyHammy has quit [Read error: Connection reset by peer]
<StevenXL>
Ox0dea, Do I have to create a uri object first?
<Ox0dea>
StevenXL: Shouldn't be necessary, no.
yfeldblum has quit [Ping timeout: 240 seconds]
rgtk has quit [Read error: No route to host]
to_json has quit [Quit: Leaving.]
mistermocha has quit [Ping timeout: 250 seconds]
rgtk has joined #ruby
<StevenXL>
but I do have to create a new Net:HTTP object. I was wondering if you could clarify on the path argument. Is that the full API endpoint, including auth keys, or the base?
<StevenXL>
I can try both.
s00pcan has quit [Ping timeout: 264 seconds]
yqt has quit [Ping timeout: 268 seconds]
<Ox0dea>
StevenXL: You do need a Net::HTTP instance, yes, and you construct one with a server and an optional port.
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
s00pcan has joined #ruby
<Ox0dea>
StevenXL: #post can be called several ways, but since you're supplying data (as the second argument) instead of name-value pairs, you'll have to include the query parameters in the path (the first argument).
<StevenXL>
ah got it!
<StevenXL>
that's what was confusing me.
rgtk has quit [Read error: No route to host]
<StevenXL>
I was passing them into Net::HTTP.new.
rgtk has joined #ruby
l_tonz has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
<StevenXL>
I get some kind of socket error. This is what my Net::HTTP instance looks like
<StevenXL>
Ox0dea, al2o3-cr I think I'm getting somewhere.
<StevenXL>
I'm getting this resposne now
d34th4ck3r has joined #ruby
<StevenXL>
#<Net::HTTPBadRequest 400 Bad Request readbody=true>
<al2o3-cr>
?code StevenXL
<ruboto>
StevenXL, We can't help you without your code, please post it to https://gist.github.com
<StevenXL>
I had to do this: http.verify_mode = OpenSSL::SSL::VERIFY_NONE
freerobby has quit [Quit: Leaving.]
mistermocha has quit [Ping timeout: 264 seconds]
<marahin>
Ox0dea, nah, I have a complicated hash I need to look upon, what I wrote was just an example of what I though would work and would be the easiest to implement
<marahin>
thank you very much for your help, I looked .select up and it works like a charm
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
marahin: Ah, all right, then. Happy to have helped.
rbennacer has quit [Remote host closed the connection]
rgtk has joined #ruby
<dorei>
is there some ruby testing framework where i could provide it with a set of inputs and a set of expected outputs ?
<Ox0dea>
al2o3-cr: StevenXL needs to send data along as well.
<Ox0dea>
dorei: Why not just replace with $stdin and $stdout with StringIO instances and do "regular" testing?
<Ox0dea>
-with
<al2o3-cr>
ah, should read more carefully
rgtk has quit [Read error: No route to host]
marr has quit [Ping timeout: 252 seconds]
<StevenXL>
hehe no worries. I couldn't have gotten this to work w/o both your helps
<StevenXL>
very grateful.
<StevenXL>
I should probably go home now.
<StevenXL>
It's late and getting cold.
<Ox0dea>
Pleasure meeting you.
rgtk has joined #ruby
<dorei>
Ox0dea: both rspec and minitest give me the impression that their philosophy is like one assertion/expectation per case
<StevenXL>
Same here Ox0dea. I will surely be back.
TheNet has joined #ruby
<Ox0dea>
dorei: And your IO is crazy enough as to not fit well within that model?
<Ox0dea>
StevenXL: Looking forward to it. :)
StevenXL has quit [Quit: Leaving]
<dorei>
Ox0dea: it's not IO, i'm refering to input in a more generic way
<al2o3-cr>
StevenXL: you'll become a Ruby ninja in no time :)
<Ox0dea>
dorei: Parameters, then?
<al2o3-cr>
he gone :(
rgtk has quit [Read error: Connection reset by peer]
baroquebobcat has joined #ruby
rgtk has joined #ruby
solocshaw has quit [Remote host closed the connection]
<dorei>
Ox0dea: let's say it's a method that adds two numbers, i think that both rspec/minitest promote something like doing a test that 2 + 3 is 5, i want something like: i give it100 pairs of numbers to added and 100 expected results
solocshaw has joined #ruby
Vile` has quit [Remote host closed the connection]
<Ox0dea>
dorei: Do you want to come up with those 100 numbers yourself?
rgtk has quit [Read error: No route to host]
<Ox0dea>
*100 pairs
Rennex has quit [Ping timeout: 240 seconds]
<dorei>
maybe, usually i already have that list
rgtk has joined #ruby
<Ox0dea>
dorei: Then you need only realize that the test frameworks are "just Ruby".
mistermocha has joined #ruby
<dorei>
of course
fedexo has quit [Remote host closed the connection]
<dorei>
i could enumerate my inputs and expect to much the enumerated outputs
<Ox0dea>
dorei: It's usually "fits to a T"; I was being cute.
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
<ScoppoTutteLeFig>
are you not cute Ox0dea?
zenguy_pc has joined #ruby
<al2o3-cr>
ScoppoTutteLeFig: 2121 do one
<ScoppoTutteLeFig>
?
<al2o3-cr>
clown
<ScoppoTutteLeFig>
al2o3-cr:
<ScoppoTutteLeFig>
?
rgtk has quit [Read error: No route to host]
l_tonz has quit [Ping timeout: 268 seconds]
<ScoppoTutteLeFig>
?
<ScoppoTutteLeFig>
al2o3-cr:
skade has joined #ruby
<ScoppoTutteLeFig>
robot?
rgtk has joined #ruby
l_tonz has joined #ruby
CVTJNII has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
<al2o3-cr>
Ox0dea: how'd you get the essid of AP using Fiddle?
rgtk has joined #ruby
<Ox0dea>
dorei: Gah, I've not found it yet, but I'm almost certain it was something Gary Bernhardt used in an episode of Destroy All Software.
<al2o3-cr>
Ox0dea: is it possible?
Dakuan has joined #ruby
Rennex has quit [Ping timeout: 260 seconds]
<Ox0dea>
al2o3-cr: Are you asking if libpcap is a thing?
kaskalu has joined #ruby
rgtk has quit [Read error: No route to host]
horsecowdog has joined #ruby
<al2o3-cr>
libpcap is a thing, do you know how?
rgtk has joined #ruby
<al2o3-cr>
would love to know :)
<Ox0dea>
al2o3-cr: There's good reason to suspect more than one function is involved, but Fiddle can wrap pretty much any C function, so why not give it a shot?
rgtk has quit [Read error: Connection reset by peer]
rgtk has joined #ruby
<Ox0dea>
As an aside, you should probably consider whether Ruby is the right tool here.
skade has quit [Ping timeout: 256 seconds]
Dakuan has quit [Read error: Connection reset by peer]
haraoka has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
Dakuan has joined #ruby
<al2o3-cr>
Ox0dea: well you could get it using raw sockets, but wondering how you would do it using fiddle
rgtk has joined #ruby
<al2o3-cr>
depending if your NIC supported monitor mode
radgeRayden has joined #ruby
mary5030 has joined #ruby
beast has joined #ruby
rakm has joined #ruby
rgtk_ has joined #ruby
rgtk has quit [Read error: No route to host]
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
rgtk_ has quit [Read error: No route to host]
rgtk has joined #ruby
Dakuan has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
<Ox0dea>
al2o3-cr: I would just shell out.
Contigi has joined #ruby
<Ox0dea>
"Ponies for courses", as they say.
mh_laakso has quit [Remote host closed the connection]
<ruby-lang070>
I have a question about methods, do you have a sec?
rgtk_ has quit [Read error: No route to host]
<havenwood>
ruby-lang070: Ask away.
rgtk has joined #ruby
rbennacer has joined #ruby
rgtk has quit [Read error: No route to host]
Glenny has joined #ruby
<ruby-lang070>
Ok, so I'm trying to understand why when I pass just a variable to a method and then change it inside the method and then call the variable after i've made the method call its value doesnt actually change from when before it was passed to the method, but if i pass a hash and modify it in a method and then call it after the method call then it is actually modified
<al2o3-cr>
So 0 isn't an integer? phaha i need to reAD
<ruby-lang070>
maybe i should make a gist haha
rgtk has joined #ruby
<havenwood>
ruby-lang070: Your text probably got cut off there.
mloy has quit [Remote host closed the connection]
<ruby-lang070>
ill make a gist
<havenwood>
ruby-lang070: :D
mloy has joined #ruby
duckpuppy has joined #ruby
<al2o3-cr>
scope baby, scope
<Ox0dea>
ruby-lang070: Array and Hash are essentially "reference types", if that helps you find literature on the matter.
mloy has left #ruby [#ruby]
<al2o3-cr>
Ox0dea: so are Strings, no?
<DN404>
its not scope technically
<Ox0dea>
It's got nothing to do with scope.
<havenwood>
al2o3-cr: What's zero divided by two?
rgtk has quit [Read error: No route to host]
<al2o3-cr>
I jumped the gun
rgtk has joined #ruby
<al2o3-cr>
havenwood: 5?
<havenwood>
al2o3-cr: (It's even.)
<al2o3-cr>
havenwood: 16 then
mattwildig has quit [Remote host closed the connection]
weemsledeux has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
al2o3-cr: 0.positive? #=> false
<Ox0dea>
ruby-lang070: Really, almost every value in Ruby is "mutable", and if you mutate the object passed into your method, the difference will be visible from outside.
<Ox0dea>
havenwood: You must have massive stores of troll food.
<havenwood>
Ox0dea: haha
<al2o3-cr>
havenwood: and your point is?
<havenwood>
al2o3-cr: Negative zero is not negative and zero is not positive.
<al2o3-cr>
0 is neither -/+ as i said
rgtk has quit [Read error: Connection reset by peer]
<ruby-lang070>
yea but that isn't true for variales
<ruby-lang070>
I would have to return the new value from the method and save it into the exsiting variable i want changed
<Ox0dea>
ruby-lang070: Hash#[]= mutates the receiver.
<al2o3-cr>
havenwood: and
rgtk_ has quit [Read error: No route to host]
<ruby-lang070>
Ok so I need to look into "mutates" correct?
rgtk has joined #ruby
<havenwood>
al2o3-cr: 0.abs2.zero? #=> true
<Ox0dea>
ruby-lang070: There are plenty of methods which mutate Strings as well; replace `name = new_name` with `name.upcase!` and observe the results.
<al2o3-cr>
havenwood: and!!!!
<ruby-lang070>
yea that would be a permanent change
<Ox0dea>
ruby-lang070: Right, because it mutates the receiver.
<Ox0dea>
`name = new_name` only reassigns the local variable.
<Ox0dea>
ruby-lang070: If you really do want to completely replace a String in-place, there's String#replace. :P
<al2o3-cr>
havenwood: what you try to prove?
<havenwood>
al2o3-cr: Zero things.
<ruby-lang070>
So If I just set the hash to equal another hash or whatever and didnt actually mutate it then it wouldd do nothing to the local hash correct?
<al2o3-cr>
thought so
bruce_lee2 has quit [Changing host]
bruce_lee2 has joined #ruby
bruce_lee2 is now known as bruce_lee
rgtk_ has joined #ruby
rgtk has quit [Read error: No route to host]
<havenwood>
al2o3-cr: Want more zero things?
<al2o3-cr>
havenwood: go ahead
<Ox0dea>
ruby-lang070: It would do nothing to the *external* Hash, but you've got the idea.
l_tonz has quit [Ping timeout: 255 seconds]
<havenwood>
al2o3-cr: I've got zero.
<ruby-lang070>
Yea I've got it now, Thank you Ox0dea and havenwood for your help
mary5030 has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
m3_del has quit [Ping timeout: 260 seconds]
mary5030 has joined #ruby
rgtk has joined #ruby
ruby-lang070 has quit [Ping timeout: 246 seconds]
<shevy>
Ox0dea ah nah, the above actually originated because it were nucleotides in DNA, so the strings I'd have had were ATACCGTCTG, hence why I used upcased chars in the question above as well
<al2o3-cr>
thats why they introduced refinements isn't?
skade has joined #ruby
l_tonz has quit [Ping timeout: 250 seconds]
<Ox0dea>
al2o3-cr: I think this should be in core.
<Ox0dea>
Then again, that's what we all say.
rgtk has quit [Read error: No route to host]
tlaxkit has quit [Quit: ¡Hasta luego!]
<al2o3-cr>
be nice
rgtk has joined #ruby
<shevy>
we should have a community extension on ruby or something
<Ox0dea>
al2o3-cr: I was self-deprecating, you fuckwad.
<Ox0dea>
<3
<Ox0dea>
shevy: Kinda like Facets?
Rollabunna has joined #ruby
<al2o3-cr>
Ox0dea: parden?
rgtk has quit [Read error: No route to host]
duckpuppy has quit [Ping timeout: 240 seconds]
rgtk has joined #ruby
ibouvousaime has quit [Ping timeout: 244 seconds]
<al2o3-cr>
Ox0dea: I misses 'would' jeez
<shevy>
Ox0dea yeah but integrated into ruby-core and with a stronger voting process
l_tonz has joined #ruby
<al2o3-cr>
Ox0dea: keyboard warrior
A124 has quit [Read error: Connection reset by peer]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
blackmesa has joined #ruby
Dakuan has joined #ruby
mag42c has quit [Quit: mag42c]
<Ox0dea>
al2o3-cr: I'm not to blame for your inability to proofread what would've been a three-word post.
rgtk has quit [Read error: No route to host]
skade has quit [Ping timeout: 246 seconds]
sp4rrow has joined #ruby
Rollabunna has quit [Ping timeout: 244 seconds]
uber has quit [Ping timeout: 240 seconds]
rgtk has joined #ruby
<al2o3-cr>
Ox0dea: yeah my fault
<Ox0dea>
al2o3-cr: <3
<al2o3-cr>
I can see how it would come across
rgtk has quit [Read error: No route to host]
A124 has joined #ruby
arescorpio has joined #ruby
<Ox0dea>
Precision matters.
favadi has joined #ruby
rgtk has joined #ruby
<al2o3-cr>
It does :)
<TheNet>
how do you guys order methods in your classes?
<TheNet>
such as alphabetically? or organized by type?
Dakuan has quit [Ping timeout: 264 seconds]
rgtk has quit [Read error: Connection reset by peer]
<Ox0dea>
TheNet: Real programmers use decent editors.
djbkd has quit [Remote host closed the connection]
rgtk has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
djbkd has joined #ruby
<Ox0dea>
To clarify, the order doesn't matter if your editor lets you jump to a given method definition with the stroke of a key.
patdohere has joined #ruby
<Ox0dea>
But keeping related things close to each other makes sense and usually happens naturally.
rgtk has quit [Read error: No route to host]
patdohere has quit [Max SendQ exceeded]
rgtk has joined #ruby
patdohere has joined #ruby
cmoney has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
cmoney has quit [Remote host closed the connection]
rgtk has joined #ruby
uber has joined #ruby
rgtk has quit [Read error: No route to host]
juanpablo__ has joined #ruby
rgtk has joined #ruby
aufi has joined #ruby
Feyn has joined #ruby
rgtk has quit [Read error: No route to host]
freerobby has joined #ruby
rgtk has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
freerobby has quit [Client Quit]
juanpablo__ has quit [Ping timeout: 268 seconds]
rgtk has quit [Read error: Connection reset by peer]
rgtk has joined #ruby
mikeharris22 has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk_ has joined #ruby
rgtk_ has quit [Read error: No route to host]
rgtk has joined #ruby
rgtk has quit [Read error: No route to host]
mikeharris22 has quit [Ping timeout: 240 seconds]
Feyn has quit [Ping timeout: 246 seconds]
rgtk has joined #ruby
mordocai has quit [Remote host closed the connection]
mordocai has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
fibbel has quit [Quit: fibbel]
l_tonz has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
bruno- has joined #ruby
s00pcan has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
aufi has quit [Ping timeout: 268 seconds]
tvw has quit [Ping timeout: 256 seconds]
rgtk has joined #ruby
TheNet has quit [Remote host closed the connection]
Vile` has quit [Remote host closed the connection]
moeabdol has joined #ruby
rgtk has quit [Read error: No route to host]
lkba has quit [Remote host closed the connection]
aibot has quit [Remote host closed the connection]
aibot has joined #ruby
moeabdol has quit [Client Quit]
bruno- has quit [Ping timeout: 246 seconds]
Vile` has joined #ruby
mattwildig has joined #ruby
saddad has joined #ruby
freerobby has joined #ruby
Yzguy has quit [Quit: Zzz...]
Feyn has joined #ruby
<Ox0dea>
> With which incentive ought I strive to attenuate the number of decibels I'm producing?
zenguy_pc has quit [Ping timeout: 246 seconds]
mistermocha has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mclee_ has quit [Ping timeout: 265 seconds]
TheNet has joined #ruby
mclee_ has joined #ruby
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
mistermocha has quit [Ping timeout: 244 seconds]
diegoaguilar has joined #ruby
markfletcher has joined #ruby
d34th4ck3r has quit [Quit: zzz]
mistermocha has joined #ruby
htmldrum has quit [Ping timeout: 256 seconds]
solocshaw has quit [Ping timeout: 240 seconds]
rbennacer has joined #ruby
dingus has joined #ruby
mistermocha has quit [Ping timeout: 260 seconds]
zenguy_pc has joined #ruby
rbennacer has quit [Ping timeout: 244 seconds]
<dingus>
Would anyone here be willing to help me figure out how to use map/reduce? I'm trying to merge an array of hashes containing identical keys, with the goal of condensing duplicate keys while keeping their values
devoldmx has joined #ruby
Oatmeal has quit [Ping timeout: 264 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has joined #ruby
<Ox0dea>
dingus: You won't need #reduce for this; #merge is a very powerful method.
<Ox0dea>
It takes multiple arguments *and* a block for handling merge conflicts.
iateadonut has joined #ruby
krz has quit [Ping timeout: 244 seconds]
<dingus>
@0xdea: I'm new to ruby and merge is way over my head. Mind taking a look at a code sample?
<Ox0dea>
dingus: I could just show you how to do it?
<dingus>
@0xdea: OK, that sounds good :)
TheNet has quit [Remote host closed the connection]
<dingus>
Ox0dea:
<Ox0dea>
dingus: Oh no! #merge *doesn't* take multiple arguments. :<
<Radar>
dingus: Show us what you've got and what you expect to have at the end of it.
<Ox0dea>
Radar: He's stated the requirements quite plainly?
<Radar>
Ox0dea: It'd be helpful to see some example input data and output just so that we know 100% that we have the right answer.
mistermocha has joined #ruby
gener1c_ has quit [Read error: Connection reset by peer]
saddad has quit [Read error: Connection reset by peer]
<Radar>
Ox0dea: see, your answer won't work
<Radar>
This is why I always ask for examples.
jhn has joined #ruby
<Ox0dea>
Radar: What, because it's doing addition? It was a demonstration.
krz has joined #ruby
<Ox0dea>
dingus: Here's what I hope is a clear demonstration of how #reduce works: https://eval.in/461375
braincras has quit [Quit: bye bye]
astrobun_ has joined #ruby
zipace has quit [Ping timeout: 255 seconds]
skade has quit [Ping timeout: 240 seconds]
jwaldrip has quit [Client Quit]
Dakuan has quit [Ping timeout: 244 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
hmsimha_ has quit [Ping timeout: 265 seconds]
mistermocha has quit [Remote host closed the connection]
mistermocha has joined #ruby
braincrash has joined #ruby
vigintas has joined #ruby
<Ox0dea>
Radar: You were right. I apologize.
mistermocha has quit [Remote host closed the connection]
<Ox0dea>
dingus: Status on your understanding of #reduce? :P
mistermocha has joined #ruby
haraoka has quit [Remote host closed the connection]
l_tonz has joined #ruby
mistermocha has quit [Remote host closed the connection]
mistermocha has joined #ruby
<dingus>
Ox0dea: i tried applying your example to my data but it looks like it's just looping through the array. can't figure out how to get it to do what i want
Bloomer has joined #ruby
<Ox0dea>
dingus: It does loop through the array, but it builds up a tally as it goes.
mary5030 has quit [Remote host closed the connection]
<Ox0dea>
The "tally" in your case is a Hash, but the principle is the same.
markfletcher has left #ruby [#ruby]
vigintas has quit [Ping timeout: 264 seconds]
mary5030 has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kp666 has joined #ruby
m3_del has joined #ruby
<dingus>
Ox0dea: How do I combine each score value by player key, though?
gix has quit [Ping timeout: 264 seconds]
Bloomer has quit [Remote host closed the connection]
Bloomer has joined #ruby
<Ox0dea>
dingus: What did you replace the 0 with in applying my example to your data?
towski_ has quit [Remote host closed the connection]
mary5030 has quit [Ping timeout: 240 seconds]
<dingus>
Ox0dea: I didn't replace it. I guess I don't understand how the code works...
gix has joined #ruby
<Ox0dea>
dingus: Oh, sorry; I did forget to explain that part. It's the initial value for the tally.
<Ox0dea>
That `+=` updates the tally, but it evalues to the result of the addition, and the last expression in the block is what becomes the new tally; that's why I had to stick that ostensibly unnecessary `tally` on that line by itself.
<Ox0dea>
There are #each_with_object and #with_object methods that do make it unnecessary, but then we'd've gotten into grouped block parameters and lost the thread.
<dingus>
Ox0dea: so there's an invisible assignment happening on the 'tally' line?
Rinzlit_ has quit [Ping timeout: 255 seconds]
<Ox0dea>
dingus: No, not in the sense you're thinking.
arescorpio has quit [Quit: Leaving.]
bruno- has quit [Ping timeout: 246 seconds]
<dingus>
Ox0dea: would you mind providing a similar example using with_object or each_with_object so I can compare?
arooni has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
darkf has joined #ruby
mistermocha has quit [Remote host closed the connection]
<Ox0dea>
In this case, it's just the block parameters getting swapped around and the extra line being unnecessaary.
htmldrum has joined #ruby
<Ox0dea>
The "grouped block parameters" I mentioned aren't there; those are apparently only applicable when the collection being reduced contains Arrays, not Hashes.
al2o3-cr has quit [Ping timeout: 252 seconds]
<Ox0dea>
>> [[1, 2], [3, 4], [5, 6]].each_with_object([]) { |(a, b), tally| tally << a + b }
<Ox0dea>
Radar: I hate it when software seems to have a mind of its own. :P
<Radar>
:)
<Ox0dea>
That's not to say I don't welcome our inevitable robot overlords, mind.
mary5030 has joined #ruby
beast has quit [Quit: Leaving]
yardenbar has quit [Ping timeout: 252 seconds]
weemsledeux has joined #ruby
rgtk has joined #ruby
dheeraj_t has left #ruby [#ruby]
Musashi007 has joined #ruby
mary5030 has quit [Ping timeout: 246 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgtk has quit [Ping timeout: 260 seconds]
justinweiss has quit [Remote host closed the connection]
DN404 has quit [Quit: goodbye]
justinweiss has joined #ruby
zenguy_pc has quit [Ping timeout: 250 seconds]
malcolmva has quit [Ping timeout: 260 seconds]
freerobby has quit [Quit: Leaving.]
kaskalu has quit [Quit: Leaving]
favadi has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
rbennacer has joined #ruby
zenguy_pc has joined #ruby
mattwildig has quit [Remote host closed the connection]
cwong_on_irc has joined #ruby
rbennacer has quit [Ping timeout: 256 seconds]
Musashi007 has quit [Quit: Musashi007]
malcolmva has joined #ruby
cwong_on_irc has quit [Client Quit]
northband has joined #ruby
northband has quit [Remote host closed the connection]
krz has joined #ruby
lxsameer has joined #ruby
mistermocha has quit [Ping timeout: 260 seconds]
vigintas has joined #ruby
northband has joined #ruby
houhouli_ has joined #ruby
houhoulis has quit [Ping timeout: 256 seconds]
haxrbyte has joined #ruby
haxrbyte_ has joined #ruby
baroquebobcat has joined #ruby
dingus has joined #ruby
vigintas has quit [Ping timeout: 240 seconds]
Dakuan has joined #ruby
haxrbyte has quit [Ping timeout: 240 seconds]
TheNet has quit [Remote host closed the connection]
krz has quit [Ping timeout: 250 seconds]
mndoci has joined #ruby
blackmesa has joined #ruby
m3_del has joined #ruby
djbkd has quit [Remote host closed the connection]
<northband>
I'm trying to port over some Python to Ruby and a certain item is confusing me. Curious if any fellow Rubyists would consider looking over a gist for me and help answer a couple questions.
roxtrongo has quit [Remote host closed the connection]
<dingus>
Ox0dea: I'm back with more questions!
trosborn has joined #ruby
Dakuan has quit [Ping timeout: 256 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
m3_del has quit [Ping timeout: 255 seconds]
northband has left #ruby [#ruby]
northband has joined #ruby
northband has quit [Quit: northband]
<Radar>
northband: sure, fire away
Xzanron has joined #ruby
<Radar>
just left :( too slow
<Ox0dea>
dingus: Your turn, then. :)
minimalism has quit [Quit: leaving]
northband_ has joined #ruby
krz has joined #ruby
arup_r has joined #ruby
arup_r is now known as Guest85623
Xeago has joined #ruby
northband_ has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
dhjondoh has joined #ruby
haxrbyte_ has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
TheNet has joined #ruby
Xeago has quit [Ping timeout: 252 seconds]
<dingus>
Ox0dea: is it possible to store additional variables inside the each_with_object block? let's say I wanted to calculate an average score per player
gener1c has quit [Ping timeout: 250 seconds]
gener1c has joined #ruby
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd has joined #ruby
nitrix-or-treat is now known as nitrix
pontiki has joined #ruby
<Ox0dea>
dingus: It's possible, but there's a better way.
<dingus>
Ox0dea: my instinct is to use a loop and compare a precalculated hash/array of games played per player with a precalculated hash/array of scores per player but that seems clunky
<Ox0dea>
dingus: Aye, that's a little clunky.
<dingus>
Ox0dea: what's the better way?
l_tonz has quit [Remote host closed the connection]
<Ox0dea>
dingus: Instead of tallying with addition, push each player's wins into an Array.
<dingus>
Ox0dea: then what?
<Ox0dea>
dingus: Then, like a good chef, you'll have all your ingredients ready.
gener1c_ has joined #ruby
gener1c has quit [Ping timeout: 252 seconds]
MVPhelp has quit [Ping timeout: 268 seconds]
mistermocha has joined #ruby
<dingus>
Ox0dea: i have one each_with_object block counting total score per player, and another counting games played per player. are you saying there's a way to do this in one go?
cwong_on_irc has joined #ruby
pepperbreath has joined #ruby
pepperbreath has left #ruby [#ruby]
<Ox0dea>
dingus: No, that's almost the opposite of what I was suggesting.
notnoyyyyy has joined #ruby
l_tonz has joined #ruby
<Ox0dea>
dingus: Observe what happens if you replace that `0` with `[]`.
gener1c has joined #ruby
l_tonz has quit [Remote host closed the connection]
<pontiki>
yesss, cooking metaphors :)
diegoviola has quit [Quit: WeeChat 1.3]
<Ox0dea>
Oh, sorry; you'll have to do a little more tweaking than that: https://eval.in/461407
mistermocha has quit [Ping timeout: 240 seconds]
cwong_on_irc has quit [Client Quit]
duncannz has joined #ruby
<Ox0dea>
dingus: But that's a really nice result, isn't it? You've got the number of games, the total wins, and the average falls out easily enough.
l_tonz has joined #ruby
gener1c_ has quit [Ping timeout: 246 seconds]
mployee8 has joined #ruby
Guest85623 has quit [Ping timeout: 240 seconds]
<mployee8>
Hello
rapidjammer has joined #ruby
dionysus69 has joined #ruby
cwong_on_irc has joined #ruby
<pontiki>
hi
<blubjr>
hi
trautwein has joined #ruby
trautwein has quit [Client Quit]
haxrbyte has quit [Ping timeout: 250 seconds]
timonv has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Remote host closed the connection]
Motoservo has quit [Quit: Shhh. I'm trying to get some sleep here.]
mistermocha has joined #ruby
arup_ has joined #ruby
<dingus>
Ox0dea: I changed my scores to floats and now I'm getting ``+': no implicit conversion of Float into Array (TypeError)`. Why does it stop working?
arup_ is now known as arup_r
<Ox0dea>
dingus: Why did you change your scores to floats?
<Ox0dea>
Better to convert one value than a bunch of 'em.
tagrudev has joined #ruby
<dingus>
Ox0dea: i'm playing around with various scenarios, e.g. a list of purchases and getting the average purchase price per customer
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
dingus: Fair enough. That error indicates you're trying to do some operation with a Float and an Array as the operands, and that tends not to go well.
mostlybadfly has quit [Quit: Connection closed for inactivity]
<Ox0dea>
You should debug-print the relevant values to determine where your assumptions have gone amiss.
juanpablo__ has joined #ruby
ohaibbq has quit [Quit: Leaving...]
devbug_ has joined #ruby
timonv has quit [Ping timeout: 265 seconds]
Motoservo has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
yardenbar has joined #ruby
arooni has joined #ruby
juanpablo__ has quit [Ping timeout: 252 seconds]
devbug has quit [Ping timeout: 272 seconds]
lubarch has joined #ruby
aganov has joined #ruby
jessemcgilallen has joined #ruby
mclee_ has joined #ruby
<dingus>
Ox0dea: I gave up on reduce for now and tried out zip instead :)
lubarch has quit [Client Quit]
Azulinho has joined #ruby
dingus has quit [Quit: Page closed]
devoldmx has quit [Remote host closed the connection]
Rollabunna has joined #ruby
lubarch has joined #ruby
mndoci has quit [Remote host closed the connection]
rlf has quit [Remote host closed the connection]
mndoci has joined #ruby
guest1241234 has quit [Quit: Connection closed for inactivity]
DoubleMalt has joined #ruby
Rollabunna has quit [Ping timeout: 268 seconds]
blackmesa has joined #ruby
m3_del has joined #ruby
peteykun has quit [Ping timeout: 240 seconds]
pocketprotector has joined #ruby
mndoci has quit [Ping timeout: 256 seconds]
finisherr has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 240 seconds]
arup_r has quit [Quit: Leaving]
pontiki has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
patdohere has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
m3_del has quit [Ping timeout: 255 seconds]
htmldrum has quit [Ping timeout: 246 seconds]
sandals has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jessemcgilallen has quit [Ping timeout: 252 seconds]
htmldrum has joined #ruby
Mon_Ouie has quit [Ping timeout: 265 seconds]
jessemcgilallen has joined #ruby
mployee8 has quit [Quit: Leaving]
mistermocha has quit [Remote host closed the connection]
htmldrum has quit [Ping timeout: 252 seconds]
lsmola has joined #ruby
lukaszes has joined #ruby
firstdayonthejob has joined #ruby
ta has quit [Remote host closed the connection]
trosborn has quit [Quit: trosborn]
VeryBewitching has quit [Quit: Konversation terminated!]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
kalusn has joined #ruby
Azulinho has quit [Ping timeout: 240 seconds]
trosborn has joined #ruby
rgtk has joined #ruby
purplexed- has quit [Ping timeout: 272 seconds]
peteykun has joined #ruby
jpfuentes2 has quit [Ping timeout: 250 seconds]
unsymbol has quit [Ping timeout: 250 seconds]
notnoyyyyy has quit [Ping timeout: 250 seconds]
<finisherr>
When a module has a method that looks like this: def self.method_name what is the receiver of the method?
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgtk has quit [Ping timeout: 260 seconds]
claw has quit [Ping timeout: 250 seconds]
claw has joined #ruby
notnoyyyyy has joined #ruby
unsymbol has joined #ruby
jpfuentes2 has joined #ruby
l_tonz has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<karapetyan>
hello, how to make regexp that get all characters before "/*" i'tried next .*\/\* but it takes all text "blahblahblah/*"
<djellemah>
finisherr: the module
zenguy_pc has quit [Ping timeout: 272 seconds]
<Ox0dea>
karapetyan: Are you parsing C?
<finisherr>
Cool
mistermocha has joined #ruby
<Ox0dea>
finisherr: Debug-printing `self` can provide great insight in times of confusion.
kalusn has quit [Remote host closed the connection]
<karapetyan>
Ox0dea: well, yes
<Ox0dea>
karapetyan: Really?
vondruch has quit [Quit: Ex-Chat]
<karapetyan>
no, i try to solve my daily kata )
<Ox0dea>
>> 'some c code /*'[/(.*)\/\*/, 1] # karapetyan
<karapetyan>
Ox0dea: what does mean [..., 1] ? the 1? in your regexp?
<Ox0dea>
karapetyan: Given a Regexp, it's basically just String#match, but you can provide a numeric second argument to pluck out a capture group.
<[spoiler]>
personally my advice is to use #match or #scan, if you need to extract shit from a string; i find them more readable than `#[/ohmygosh/]` even if its shorter and "clever-er"
<finisherr>
I remember about binding since it’s passed as a param to some ERB method
<finisherr>
but that’s all i remembered about it
<karapetyan>
thanks!
<Ox0dea>
It's not even about cleverness; that "English" can't also be noise is nonsense.
<[spoiler]>
11100 nice issue number, Ox0dea :D
towski_ has quit [Remote host closed the connection]
<[spoiler]>
karapetyan: what example? his example ought to work
<[spoiler]>
what is your code
mattwildig has quit [Ping timeout: 240 seconds]
<[spoiler]>
[side note: you shouldn't use regexp like this to parse code anyway]
<Ox0dea>
karapetyan: Is your kata to write a regular expression, or to write a Ruby program?
<karapetyan>
look, in understood that i can use somestring[regexp_here] and it's nice. also i read about #match / #scan. but anyway i have a problem with regexp
<karapetyan>
Ox0dea: a write a Ruby program. (but there no description how to write it. Use loops for parsing chars or regexp)
<Ox0dea>
I hope it catches fire.
<Ox0dea>
<3
<[spoiler]>
His kata? Is this some kind of karate company you work at? what
ibouvousaime has joined #ruby
<Ox0dea>
[spoiler]: A kata is like daily exercise for programming.
<[spoiler]>
is it
<karapetyan>
Ox0dea: thank you!
<Ox0dea>
karapetyan: No.
<Ox0dea>
[spoiler]: That's its modern definition, anyhow.
TheNet has quit [Remote host closed the connection]
<[spoiler]>
Oh
<[spoiler]>
I didn't know
<[spoiler]>
that is nice
<[spoiler]>
I should do that!
<karapetyan>
Ox0dea: why not?)
TheNet has joined #ruby
mistermocha has joined #ruby
<Ox0dea>
karapetyan: Because your eye(s?) is/are a plus sign, and symbols make [spoiler]'s head hurt.
lukaszes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<karapetyan>
ok, sorry then )
<Ox0dea>
So now you're a disemfaced mouth?
skade has quit [Quit: Computer has gone to sleep.]
<[spoiler]>
my wot now
<[spoiler]>
symbols make me head 'urt?
<Ox0dea>
> more readable than `#[/ohmygosh/]`
<Ox0dea>
That was clearly intended to be pejorative.
<[spoiler]>
LOL
bruno- has joined #ruby
vigintas has joined #ruby
<Ox0dea>
I've said it before: it's okay for code to look like code.
Musashi007 has joined #ruby
blackmesa has joined #ruby
m3_del has joined #ruby
<[spoiler]>
Ox0dea: the point was that [//,1] wasn't immediately obvious (to karapetyan, and I suppose that applies to other ruby new comers, too)
<[spoiler]>
newcomers*
mistermocha has quit [Ping timeout: 240 seconds]
stan has joined #ruby
<Ox0dea>
[spoiler]: Why should new knowledge be immediately obvious? Doesn't that undermine the foundations of exploratory learning?
ruurd has joined #ruby
ponga has joined #ruby
vigintas has quit [Ping timeout: 250 seconds]
trosborn has joined #ruby
bruno- has quit [Ping timeout: 265 seconds]
krz has quit [Ping timeout: 264 seconds]
skcin7 has joined #ruby
<[spoiler]>
Ox0dea: hmm. I guess you're right
SCHAAP137 has joined #ruby
lukaszes has joined #ruby
<Ox0dea>
Oops.
timonv has joined #ruby
<Ox0dea>
That was not my intention.
blackmesa has quit [Ping timeout: 250 seconds]
m3_del has quit [Ping timeout: 250 seconds]
notnoyyyyy has quit [Ping timeout: 244 seconds]
krz has joined #ruby
joonty has joined #ruby
trosborn has quit [Client Quit]
l_tonz has joined #ruby
<Ox0dea>
That is, I didn't mean to word it so convincingly; I had hoped you'd come back at me on it that I might solidify my ability to defend it.
notnoyyyyy has joined #ruby
diegoaguilar has quit [Ping timeout: 260 seconds]
colegatron has quit [Ping timeout: 240 seconds]
benlieb has quit [Quit: benlieb]
benlieb has joined #ruby
houhouli_ has quit [Remote host closed the connection]
dheeraj_t has joined #ruby
benlieb has quit [Client Quit]
<certainty>
moin
<[spoiler]>
certainty: yo \o
<certainty>
o/
trosborn has joined #ruby
dheeraj_t has quit [Ping timeout: 246 seconds]
mistermocha has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
<djellemah>
Ox0dea: it depends how different the new knowledge is to what you already know.
darkxploit has joined #ruby
jas02 has joined #ruby
mahlon_ has quit [Read error: Connection reset by peer]
roxtrongo has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
<Ox0dea>
djellemah: That's certainly the case, but the glad suffering of fools puts an egg in neither party's beer.
htmldrum has joined #ruby
vondruch has joined #ruby
riotjone_ has quit [Remote host closed the connection]
firstdayonthejob has quit [Ping timeout: 260 seconds]
Motoservo has quit [Quit: Shhh. I'm trying to get some sleep here.]
mistermocha has joined #ruby
<Ox0dea>
It's just unfathomably easy to find precisely the information one is looking for in our modern times; it's infuriating to watch people forsake that privilege.
<[spoiler]>
Oh yeah someone linked it the other day :D
Ulfalizer has joined #ruby
<Ox0dea>
Heh.
<[spoiler]>
it's beautiful
<Ox0dea>
<3
finisherr has quit [Quit: finisherr]
ta has joined #ruby
dopie has quit [Ping timeout: 264 seconds]
kiddorails has joined #ruby
<adaedra>
Bonjour
<`derpy>
moin
ruurd has quit [Read error: Connection reset by peer]
trosborn has joined #ruby
ruurd has joined #ruby
Hounddog has joined #ruby
iateadonut has quit [Quit: Leaving.]
lipoqil has joined #ruby
cwong_on_irc has joined #ruby
kies^ has quit [Ping timeout: 250 seconds]
SCHAAP137 has quit [Ping timeout: 240 seconds]
al2o3-cr has joined #ruby
darkxploit has quit [Ping timeout: 250 seconds]
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
astrobun_ has quit [Remote host closed the connection]
astrobun_ has joined #ruby
nfk|laptop has joined #ruby
gener1c_ has joined #ruby
skade has joined #ruby
gener1c has quit [Ping timeout: 256 seconds]
blue_deref has quit [Quit: bbn]
devoldmx has joined #ruby
djbkd has quit [Remote host closed the connection]
Rollabunna has joined #ruby
bruno- has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby
bruno- is now known as Guest46913
gener1c has joined #ruby
lubarch has quit [Quit: leaving]
devoldmx has quit [Ping timeout: 246 seconds]
gener1c_ has quit [Ping timeout: 255 seconds]
Rollabunna has quit [Ping timeout: 265 seconds]
SCHAAP137 has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
Guest46913 has quit [Ping timeout: 252 seconds]
ta has quit [Remote host closed the connection]
blackmesa has joined #ruby
m3_del has joined #ruby
bruno-_ has joined #ruby
trosborn has quit [Quit: trosborn]
machan has joined #ruby
darkxploit has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
akem has joined #ruby
bruno-_ has quit [Ping timeout: 240 seconds]
TheNet has quit [Remote host closed the connection]
m3_del has quit [Ping timeout: 252 seconds]
matcouto has joined #ruby
machan has quit [Read error: Connection reset by peer]
blackmesa has quit [Ping timeout: 268 seconds]
ruurd has joined #ruby
bruno-_ has joined #ruby
<yorickpeterse>
morning
vondruch has quit [Quit: Ex-Chat]
d34th4ck3r has quit [Quit: zzz]
kiddorails has quit [Remote host closed the connection]
bMalum has joined #ruby
bruno-_ has quit [Ping timeout: 255 seconds]
blackmesa has joined #ruby
bruno-_ has joined #ruby
peteykun has quit [Ping timeout: 250 seconds]
ta has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
jwaldrip has quit [Ping timeout: 256 seconds]
bruno-_ has quit [Ping timeout: 240 seconds]
Blaguvest has quit []
bruno- has joined #ruby
Azulinho has joined #ruby
ibouvousaime has quit [Ping timeout: 252 seconds]
ruurd has joined #ruby
gener1c has quit [Read error: Connection reset by peer]
Musashi007 has quit [Quit: Musashi007]
sepp2k has joined #ruby
astrobun_ has quit [Remote host closed the connection]
gener1c has joined #ruby
bruno- has quit [Ping timeout: 265 seconds]
<djellemah>
Ox0dea: It is possible to choose to not let people in-fury-ate you. Just let them run off your back like a duck typing. I have no idea where I learned that idiom :-p
<Ox0dea>
djellemah: That's arguably a metaphysical assertion, but I do realize that offense cannot be given. The bit about the duck is lost on me, I'm afraid.
riotjones has joined #ruby
rgtk has joined #ruby
ibouvousaime has joined #ruby
jordanloky has joined #ruby
jakko has joined #ruby
mark4 has joined #ruby
l_tonz has quit [Ping timeout: 255 seconds]
ruurd has quit [Read error: Connection reset by peer]
riotjones has quit [Ping timeout: 244 seconds]
baweaver has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
skade has joined #ruby
mndoci has joined #ruby
vondruch has joined #ruby
bigkevmcd has joined #ruby
lukaszes has joined #ruby
<djellemah>
Ox0dea: No worries - stoopid joke. Stopping now before I accumulate too much OT.
<adaedra>
I don't know Spanish well enough for that.
neanderslob has quit [Remote host closed the connection]
<vev_>
our project is innovative and it uses collaboration intelligence
<Ox0dea>
I hope it catches fire.
<yorickpeterse>
Ox0dea: calm down
<Ox0dea>
yorickpeterse: With what incentive do you propose I ought to strive to attenuate the quantity of decibels I'm producing?
<vev_>
if you want to know more about #libreidea i ll be there
<vev_>
if you are a motivated dev, you ll be very welcome :p
ruurd has joined #ruby
baweaver has quit [Ping timeout: 246 seconds]
<Xeago>
vev_: I am here because I feel welcome even when not motivated.
<yorickpeterse>
Ox0dea: don't be a cock
<Ox0dea>
yorickpeterse: Turn down for what!
<yorickpeterse>
vev_: and this isn't the right place to solicit work
<yorickpeterse>
errr s/work/devs
<yorickpeterse>
whatever
<adaedra>
Yeah, no work in this place.
<yorickpeterse>
that too
htmldrum has quit [Ping timeout: 240 seconds]
<yorickpeterse>
I'm just looking at a DB misbehave
<adaedra>
DBs can do something else?
<vev_>
and good ideas are welcome on libreidea.org
<vev_>
also research questions
vigintas has joined #ruby
<yorickpeterse>
vev_: you can stop advertising now
<vev_>
merci pour les infos scipy
<vev_>
and nltk
<adaedra>
hard time switching languages, eh?
<vev_>
scipy is not python?
haxrbyte has joined #ruby
TheNet has quit [Ping timeout: 252 seconds]
<vev_>
or is it compatible with ruby?
skade has joined #ruby
subscope has joined #ruby
<Ox0dea>
self.sides.send :orbit
karapetyan has joined #ruby
beauby has quit [Ping timeout: 272 seconds]
teclator has joined #ruby
zylogz80 has joined #ruby
trosborn has joined #ruby
krz has quit [Ping timeout: 255 seconds]
<adaedra>
:')
kirun has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
beauby has joined #ruby
vigintas has quit [Quit: vigintas]
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruurd has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
lipoqil has quit [Quit: Connection closed for inactivity]
eikood has quit [Ping timeout: 240 seconds]
fumduq has joined #ruby
trosborn has quit [Quit: trosborn]
mprelude has quit [Quit: WeeChat 1.3]
leafybas_ has joined #ruby
devoldmx has joined #ruby
vigintas has joined #ruby
tkuchiki has quit [Remote host closed the connection]
trosborn has joined #ruby
rapidjammer has quit []
vigintas has quit [Remote host closed the connection]
leafybasil has quit [Ping timeout: 268 seconds]
mprelude has joined #ruby
vigintas has joined #ruby
dionysus69 has quit [Quit: dionysus69]
devoldmx has quit [Ping timeout: 268 seconds]
symm- has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
<djellemah>
Ox0dea: for sha 840e6b630 using send def foo; foo; end I get SystemStackError: stack level too deep
Musashi007 has quit [Quit: Musashi007]
<Ox0dea>
djellemah: That's interesting.
<Ox0dea>
djellemah: How about `define_method(:foo, &:bar)`?
m3_del has joined #ruby
vigintas has quit [Ping timeout: 246 seconds]
favadi has joined #ruby
vigintas has joined #ruby
* djellemah
waits for gcc
ruurd has joined #ruby
<Ox0dea>
Yay, Gentoo. :P
<Ox0dea>
I'm rebuilding from scratch in case ccache managed to bork something.
htmldrum has joined #ruby
notnoyyyyy has quit [Quit: Tis but a scratch]
JammyHammy has joined #ruby
notnoyyyyy has joined #ruby
m3_del has quit [Ping timeout: 252 seconds]
moeabdol has joined #ruby
Ropeney has joined #ruby
tulak_ has joined #ruby
<djellemah>
Ox0dea: Yip, SEGV for define_method(:foo, &:bar)
<Ox0dea>
djellemah: It's weird, because actually invoking #to_proc "works": https://eval.in/461527
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
beauby has quit [Ping timeout: 272 seconds]
<Ox0dea>
But nobu has been doing some interesting things to optimize Symbol#to_proc (eliding bits and pieces of critical environment along the way, it seems).
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
syath has joined #ruby
mattwildig has quit [Ping timeout: 268 seconds]
subscope has joined #ruby
skade has quit [Ping timeout: 252 seconds]
colegatron has quit [Ping timeout: 252 seconds]
subscope has quit [Client Quit]
subscope has joined #ruby
Oatmeal has quit [Ping timeout: 240 seconds]
leafybasil has quit [Remote host closed the connection]
blackmesa has joined #ruby
Xeago has quit [Remote host closed the connection]
leafybasil has joined #ruby
vev_ has quit [Quit: Leaving, see you on libreidea]
vev_ has joined #ruby
krz has joined #ruby
leafybasil has quit [Ping timeout: 240 seconds]
leafybasil has joined #ruby
m3_del has joined #ruby
skade has joined #ruby
Xeago has joined #ruby
hanmac has joined #ruby
colegatron has joined #ruby
Oatmeal has joined #ruby
skade has quit [Client Quit]
m3_del has quit [Ping timeout: 240 seconds]
shredding has quit [Ping timeout: 255 seconds]
radgeRayden_ has joined #ruby
TheNet has quit [Ping timeout: 246 seconds]
blackmesa has quit [Ping timeout: 260 seconds]
vev_ has quit [Ping timeout: 260 seconds]
kalusn has quit [Remote host closed the connection]
radgeRayden has quit [Ping timeout: 246 seconds]
trosborn has joined #ruby
trosborn has quit [Client Quit]
ruurd has quit [Read error: Connection reset by peer]
marr has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
User458764 has joined #ruby
lacrymology has joined #ruby
<lacrymology>
I'm using rbenv and bundle, I've got the right version of ruby activated (with rbenv): ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
trosborn has joined #ruby
<lacrymology>
but bundle install says Your Ruby version is 2.2.3, but your Gemfile specified 2.1.5
ruurd has joined #ruby
trosborn has quit [Client Quit]
vev_ has joined #ruby
zotherstupidguy has joined #ruby
hemelskonijn has joined #ruby
roxtrongo has joined #ruby
zotherstupidguy has quit [Client Quit]
kalusn has joined #ruby
segfalt__ has joined #ruby
vev_ has quit [Max SendQ exceeded]
vev_ has joined #ruby
<havenwood>
lacrymology: Is Bundler installed on 2.1.5? Already rehashed?
<lacrymology>
havenwood: I might be using the system executable now that you mention it
mistermocha has joined #ruby
<lacrymology>
havenwood: gem install bundler died horribly
roxtrongo has quit [Ping timeout: 260 seconds]
houhoulis has joined #ruby
sgambino has joined #ruby
hemelskonijn has left #ruby ["Leaving"]
dopamean_ has quit [Ping timeout: 260 seconds]
<lacrymology>
/home/lacrymology/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rdoc/generator/markup.rb:135: [BUG] Segmentation fault at 0x00000000000000
ruurd has quit [Read error: Connection reset by peer]
jwaldrip has joined #ruby
gusTester has joined #ruby
djbkd has joined #ruby
nettoweb has joined #ruby
subscope has joined #ruby
<lacrymology>
is there a difference in gems between different versions of ruby? I'm having trouble making a project work and I wonder if it's because I installed the rails gem for a different version of ruby
gusTester has left #ruby [#ruby]
<apeiros>
lacrymology: some gems may require a specific ruby version
<apeiros>
so yes, depending on your setup, a different ruby may result in a different gem version
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
or do you mean if you have a ruby version manager? in that case: yes, the ruby version managers I'm aware of will keep gems separate for each ruby version it manages.
jwaldrip has quit [Ping timeout: 246 seconds]
ruurd has joined #ruby
Jardayn has joined #ruby
sdothum has joined #ruby
juanpablo__ has joined #ruby
<lacrymology>
apeiros: I'm using rbenv, and as far as I can tell I have the right version of ruby activated, but things won't work. I'm using 2.1.5 but gems are being installed in ~/.gem/ruby/2.2.0/, which raises a flag in my untrained eyes
Jerrod has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kfpratt has quit []
sandals has joined #ruby
ziprar has joined #ruby
p0wn3d__ has joined #ruby
nettoweb has joined #ruby
AMERICAN_PSYCHO has quit [Quit: Goodbye!]
colegatron has quit [Ping timeout: 240 seconds]
ruurd has quit [Read error: Connection reset by peer]
desmondhume has joined #ruby
gambl0re has quit [Ping timeout: 240 seconds]
DEA7TH has joined #ruby
gagrio has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
desmondhume has quit [Client Quit]
desmondhume has joined #ruby
Axy has quit [Ping timeout: 246 seconds]
akem has quit [Read error: No route to host]
babblebre has joined #ruby
akem has joined #ruby
uber has quit [Quit: bye]
Guest53 has joined #ruby
ruurd has joined #ruby
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
desmondhume has quit [Client Quit]
desmondhume has joined #ruby
desmondhume has quit [Client Quit]
desmondhume has joined #ruby
desmondhume has quit [Client Quit]
desmondhume has joined #ruby
nettoweb has quit [Ping timeout: 268 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ekleog has quit [Read error: Connection reset by peer]
odigity has joined #ruby
kfpratt has joined #ruby
<odigity>
One can check the gem namespace by searching on rubygems.org before naming one's gem, but how does one check the *module/class* namespace across all registered gems? How do I determine who (if anyone) is currently using a module/class named Repo?
ekleog has joined #ruby
<adaedra>
You pray everyone named their namespaces correctly
<desmondhume>
asd
<odigity>
I'd think rubydoc.info would be an appropriate place for a feature like that, since they parse all gem code...
<apeiros>
odigity: out of luck
mikeharris22 has joined #ruby
<apeiros>
there's no reasonable way to do so
supergeek has joined #ruby
<apeiros>
but IMO any gem which violates naming conventions deserves to be shot down.
timonv has joined #ruby
dopie has quit [Ping timeout: 250 seconds]
roxtrongo has joined #ruby
<apeiros>
so as long as your gem only uses the namespace its name suggest, the other party is to blame for any namespace-conflict
alexherbo2 has joined #ruby
pathrocle has joined #ruby
herbst has joined #ruby
<odigity>
apeiros, rubydoc.info parses all gem code to generate RDoc, and in the process encounters the vast majority of module and class names. It would be possible to add a search function to that if they'd be willing to accept such a contribution.
<herbst>
i need to create a unique list of domains, some have www some not, i need to keep it as it is. how do i do that?
<apeiros>
odigity: wrong
<apeiros>
it parses *some* gems. not all.
<herbst>
obviously www.example.com and example.com should be the same
<odigity>
apeiros, wouldn't it be fair to say it parses most gems?
<apeiros>
at least afaik it only parses gems on demand.
newdan has joined #ruby
colegatron has joined #ruby
<apeiros>
odigity: doesn't matter. your approach requires to have all gems. and you don't get that.
<odigity>
apeiros, yes, but if a gem is so unpopular that no one's looked at the docs on rdoc.info, than I'm less concerned about collision. the problem solves itself, as long as perfection is not the goal
<apeiros>
and IMO it doesn't matter anyway.
nettoweb has joined #ruby
<desmondhume>
herbst what do you mean?
bigkevmcd has quit [Ping timeout: 256 seconds]
ruurd has quit [Read error: Connection reset by peer]
<apeiros>
odigity: as said: as long as your gem only uses the namespace its name suggest, the other party is to blame for any namespace-conflict
<djellemah>
LOL at # If any parameters are empty, we freak out and yell at the user.
mistermocha has joined #ruby
<apeiros>
herbst: but www.example.com and example.com are not the same.
<odigity>
apeiros, I do generally stick to my gem's namespace. However, I'm currently building a command-line tool that, like Bundler and Vagrant, supports a ruby config file, and it'd be nice if uses only had to type Repo.config do |config| instead of DevProd::Repo.config do |config|
mistermocha has quit [Remote host closed the connection]
<herbst>
like i have ["hodor.example.com", "mimi.momo.com", "www.example.com", "example.com"] and would like to .uniq that list ignoring www. that the result is ["hodor.example.com", "mimi.momo.com", "www.example.com"]
dhjondoh has quit [Quit: dhjondoh]
<apeiros>
herbst: i.e. they don't need to point at the same server, and even if they point at the same IP, they might be different pages.
<desmondhume>
why keeping "www.example.com" instead of "example.com"?
<odigity>
apeiros, especially since the code is only loaded in the context of my tool, and I can test for collisions before deploying
andywojo has joined #ruby
<herbst>
desmondhume: i dont care actually, the first is ok
mistermocha has joined #ruby
<apeiros>
odigity: don't.
<apeiros>
odigity: include DevProd; Repo.config
CloCkWeRX has joined #ruby
<herbst>
apeiros: its a internal tool. all our www and non www behave the same
<apeiros>
herbst: then use a hash where you strip the www. for the keys.
roxtrongo has quit [Ping timeout: 250 seconds]
<odigity>
apeiros, not as pretty as Vagrantfile, which is "Vagrant.configure(2) do |config|". :)
<djellemah>
herbst: take a look at Enumerable#uniq - it takes a block
<apeiros>
and then .values
<djellemah>
or what apeiros said
<desmondhume>
maybe some regex
<herbst>
apeiros: djellemah: thanks both of you! i am sure one of that will work
<desmondhume>
ignoring the first www.
<odigity>
apeiros, I suppose I can just shorten it to DevProd.config; not as pretty as Repo.config, but short, and within my namespace.
nertzy has quit [Quit: This computer has gone to sleep]
<apeiros>
odigity: all better than violating namespaces :)
<odigity>
thanks for the feedback
Randroid has joined #ruby
<desmondhume>
apeiros answer looks good btw
CloCkWeRX has left #ruby [#ruby]
newdan has quit [Ping timeout: 268 seconds]
Randroid has quit [Client Quit]
<apeiros>
odigity: it coincidentally makes exploring code easier too, since it means you can infer from where some code stems
ruurd has joined #ruby
<odigity>
apeiros, true -- and I hate both inconsistency and magic
<apeiros>
with a plain `Repo.config` - a reader has no idea from which gem it is, given that there probably is no "repo" gem.
mistermo_ has joined #ruby
<odigity>
apeiros, thank you, that sold me. I'm now at peace.
<apeiros>
convinced another one! yay!
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<dgarstang>
In ruby, how can I test a variable, and if it's not set have it return false?
momomomomo has quit [Quit: momomomomo]
<adaedra>
&ri Object#defined?
<`derpy>
No results
<adaedra>
uh.
C0deMaver1ck has joined #ruby
dstarh has joined #ruby
<adaedra>
dgarstang: use `defined?`.
C0deMaver1ck is now known as Guest32509
<dgarstang>
adaedra: isn't false == defined?
druonysus has joined #ruby
pathrocl_ has quit []
<adaedra>
what?
<dgarstang>
adaedra: In python, I can just test it. if it's nil or false, the conditional returns false, if it's true, it returns true
pathrocle has joined #ruby
<adaedra>
`defined? a` will return nil if a variable is not defined.
<dgarstang>
adaedra: I want to put it in an if statement, so I need true/false
<adaedra>
if you want to test if its truthy or falsy (nil/false), just use it as boolean expression, i.e. `if a`
mattwildig has joined #ruby
<adaedra>
`if defined?(a)` works.
<dgarstang>
adaedra: doesn't work. if I don't define it first, and I test it, I get an error
ruurd has joined #ruby
<adaedra>
so if you want it to exist *and* be truthy, it would be `if defined?(a) && a`
m3_del has joined #ruby
<dgarstang>
adaedra: thanks
zenguy_pc has joined #ruby
frozenfoxx has left #ruby [#ruby]
mikolalysenko has joined #ruby
TheNet has joined #ruby
bMalum_ has joined #ruby
bMalum has quit [Ping timeout: 272 seconds]
bMalum_ is now known as bMalum
Phil-Work has quit [Remote host closed the connection]
m3_del has quit [Ping timeout: 240 seconds]
eminencehc has joined #ruby
diegoaguilar has joined #ruby
Renich has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Channel6 has quit [Ping timeout: 240 seconds]
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
jessemcgilallen has quit [Quit: jessemcgilallen]
mary5030 has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
Guest84423 has quit [Quit: Leaving]
eminence_ has joined #ruby
dopie has joined #ruby
eminencehc has quit [Ping timeout: 260 seconds]
<mwlang>
does xpath and “//section” not work for nokogiri?
ruurd has joined #ruby
Spami has joined #ruby
desmondhume has quit [Remote host closed the connection]
cdg has joined #ruby
malconis has joined #ruby
cdg_ has quit [Ping timeout: 246 seconds]
vev_ has joined #ruby
mordocai has quit [Quit: switching machines]
weemsledeux has quit [Read error: Connection reset by peer]
BrazenBraden has quit [Quit: Leaving]
mordocai has joined #ruby
RobertBirnie has joined #ruby
mikeharr_ has quit [Remote host closed the connection]
ruurd has quit [Read error: Connection reset by peer]
arooni has quit [Ping timeout: 240 seconds]
momomomomo has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
desmondhume has joined #ruby
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
idefine has quit [Remote host closed the connection]
User458764 has joined #ruby
mikeharris22 has joined #ruby
mattwildig has quit [Remote host closed the connection]
mwlang has left #ruby [#ruby]
mwlang has joined #ruby
skade has quit [Ping timeout: 255 seconds]
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
agit0 has joined #ruby
agit0 has quit [Client Quit]
mattwildig has joined #ruby
machan has quit [Ping timeout: 250 seconds]
ruurd has joined #ruby
ruurd has quit [Client Quit]
solocshaw has joined #ruby
aspiers has quit [Ping timeout: 268 seconds]
mahlon has joined #ruby
mistermocha has joined #ruby
houhoulis has quit [Remote host closed the connection]
bricker has joined #ruby
pandaant has joined #ruby
solars has quit [Ping timeout: 255 seconds]
l_tonz has joined #ruby
krz has quit [Ping timeout: 250 seconds]
mattwildig has quit [Remote host closed the connection]
baweaver has joined #ruby
mndoci has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
denver has joined #ruby
Oatmeal has quit [Ping timeout: 246 seconds]
beauby has quit [Ping timeout: 260 seconds]
adac has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
<adac>
Guys, When I install ruby by hand, do you know which paths I need to set for the storages of the gems and the bundles so that a normal user can also use gem install and bundler? BUNDLE_PATH and GEM_HOME? is there anything else?
Azulinho has quit [Quit: Azulinho]
mistermocha has joined #ruby
mistermocha has quit [Remote host closed the connection]
ledestin has joined #ruby
TheNet has quit [Ping timeout: 246 seconds]
l_tonz has quit [Remote host closed the connection]
Lucky__ has joined #ruby
<shevy>
adac what --prefix will you use?
mistermocha has joined #ruby
tno has joined #ruby
<shevy>
normal users also have the option to install into their home dir btw, via 'gem install --user-install'
jas02 has quit [Quit: jas02]
skade has joined #ruby
l_tonz has joined #ruby
machan has joined #ruby
<adac>
shevy, Hmm ok I see. But i wanted to solve this by setting the paths via environment variable since I want to use it within a docker image as a different user then root
DiCablo has joined #ruby
Muz_ is now known as Muz
purplexed- has quit [Read error: Connection reset by peer]
<adac>
shevy, not so sure what "--prefix" is about? can you tell me more about that eventually?
<dorei>
is there a way to find out which methods were defined via attr_reader, attr_writer, etc ?
juanpablo__ has joined #ruby
purplexed- has quit [Remote host closed the connection]
joonty has quit [Quit: joonty]
axl_ has quit [Quit: axl_]
purplexed- has joined #ruby
purplexed- has quit [Changing host]
purplexed- has joined #ruby
chouhoulis has quit [Remote host closed the connection]
idefine has joined #ruby
<mwlang>
given a Node, is it possible to tell nokogiri to tell me what it’s xpath is?
chouhoulis has joined #ruby
Fire-Dragon-DoL has joined #ruby
baweaver has quit [Remote host closed the connection]
<dorei>
mwlang: that's a really good question
<mwlang>
for example, if I parse an HTML doc and manually drill down to any one specific node, can I do something in console like “node.xpath” and see what it’s selector would be?
LLamaRider has joined #ruby
LLamaRider has quit [Client Quit]
<mwlang>
my biggest hurdle with nokogiri is almost always getting the xpath selector right.
kimegede has joined #ruby
axl_ has joined #ruby
Jackneill has joined #ruby
mikeharris22 has quit [Remote host closed the connection]
idefine has quit [Remote host closed the connection]
<mwlang>
Ray`: yeah, I struggle even with the most basic. I have an HTML doc with four or five table elements on it, but doc.xpath('//table').count => 0 so I have to imagine it’s me doing something rather dumb at the basic level.
Oatmeal has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<Ray`>
Ox0dea: haha no, I stopped needing it eventually
<Ray`>
so I don't have it to hand
towski_ has joined #ruby
vev_ has quit [Ping timeout: 255 seconds]
akem has joined #ruby
bruno- has quit [Ping timeout: 268 seconds]
crdpink has quit [Excess Flood]
lsmola has quit [Ping timeout: 250 seconds]
crdpink has joined #ruby
syath has joined #ruby
desmondhume has quit [Remote host closed the connection]
yqt has quit [Ping timeout: 250 seconds]
freerobby has quit [Quit: Leaving.]
<shevy>
adac you wrote "by hand", so I assume you mean that you will compile ruby from source right? so typically one uses --prefix; system installs would have --prefix=/usr, if --prefix is omitted it normally will default to --prefix=/usr/local
adac has quit [Ping timeout: 244 seconds]
Motoservo has quit [Read error: Connection reset by peer]
<shevy>
adac these built-in system variables will be available in RbConfig; for instance, RbConfig::CONFIG['host'] # => 'i686-pc-linux-gnu'
sandals is now known as TomPeed
duckpuppy has quit [Ping timeout: 265 seconds]
mission712 has quit [Disconnected by services]
Pisuke has quit [Read error: Connection reset by peer]
BTRE has quit [Ping timeout: 264 seconds]
Motoservo has joined #ruby
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
podman has joined #ruby
xMopxShell has quit [Ping timeout: 268 seconds]
mission712_ has joined #ruby
mikeharris22 has quit [Remote host closed the connection]
stan has quit [Ping timeout: 264 seconds]
xMopxShell has joined #ruby
musl has quit [Quit: WeeChat 1.1.1]
eminence_ has quit [Remote host closed the connection]
mikeharris22 has joined #ruby
musl has joined #ruby
Renich has quit [Ping timeout: 260 seconds]
aspiers has quit [Ping timeout: 240 seconds]
bkzl has joined #ruby
scottstamp has quit [Ping timeout: 265 seconds]
Renich has joined #ruby
Bloomer has quit []
Spami has quit [Quit: Leaving]
<mwlang>
oh, my. I think I finally figured out why I can’t get at any of the table elements with nokogiri. In pry, if I print the parsed html (“p doc”), I can scroll down and clearly see the info’s there. But doc.xpath(“//table”) returns nothing. If I feed that doc to Nokogiri and print the resulting HTML, all the tables are missing! That is, Nokogiri::HTML.fragment(doc.to_html).to_html => an HTML output with ~90% of the content missing
rbennacer has joined #ruby
riotjones has joined #ruby
bkzl has quit [Quit: leaving]
mikeharris22 has quit [Ping timeout: 244 seconds]
* mwlang
working on making a reproduceable example for gist.
<Ox0dea>
mwlang: Are you sure you don't have two documents?
<dorei>
mwlang: why fragment and not Nokogiri::HTML(doc) ?
benlieb has joined #ruby
<mwlang>
dorei: trying to remove a bunch of badly formatted crap
pathrocle has joined #ruby
mission712_ has quit [Disconnected by services]
Motoservo has quit [Read error: Connection reset by peer]
musl has quit [Quit: WeeChat 1.1.1]
<mwlang>
you’re supposed to be able to clear blank lines and indentation with fragment (if I understand the documentation correctly)
musl has joined #ruby
Rollabunna has quit [Remote host closed the connection]
scottstamp has joined #ruby
xMopxShell has quit [Ping timeout: 264 seconds]
Channel6 has joined #ruby
eminence_ has joined #ruby
SenpaiSilver has joined #ruby
riotjones has quit [Ping timeout: 244 seconds]
olblak has quit [Ping timeout: 255 seconds]
wprice has quit [Ping timeout: 264 seconds]
wprice_ has joined #ruby
olblak has joined #ruby
vev_ has joined #ruby
bonemind has quit [Quit: WeeChat 1.0]
_blizzy_ has quit [Ping timeout: 264 seconds]
Channel6 has quit [Client Quit]
eminence_ has quit [Remote host closed the connection]
TheNet has joined #ruby
BTRE has joined #ruby
PaulCape_ has quit [Quit: .]
The_Phoenix has quit [Read error: Connection reset by peer]
spew has joined #ruby
idefine has quit [Read error: Connection reset by peer]
idefine_ has joined #ruby
eminencehc has joined #ruby
seitensei has quit [Remote host closed the connection]
PaulCapestany has joined #ruby
mistermocha has joined #ruby
xMopxShell has joined #ruby
idefine_ has quit [Read error: Connection reset by peer]
idefine has joined #ruby
synthroid has quit [Remote host closed the connection]
xMopxShell has quit [Excess Flood]
arooni has quit [Ping timeout: 240 seconds]
symm- has joined #ruby
mistermocha has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
mistermocha has joined #ruby
eminencehc has quit [Ping timeout: 240 seconds]
mistermocha has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
idefine_ has joined #ruby
mistermocha has joined #ruby
baweaver has joined #ruby
Xeago has joined #ruby
prettiestPony11 has joined #ruby
eminencehc has joined #ruby
idefine has quit [Read error: Connection reset by peer]
xMopxShell has joined #ruby
Guest47571 has joined #ruby
rakm has joined #ruby
freerobby has joined #ruby
diegoaguilar has quit [Ping timeout: 268 seconds]
olblak has quit [Ping timeout: 265 seconds]
baweaver has quit [Ping timeout: 246 seconds]
olblak has joined #ruby
yosafbridge` has quit [Ping timeout: 240 seconds]
Musashi007 has joined #ruby
benlieb has quit [Quit: benlieb]
_blizzy_ has joined #ruby
<mwlang>
man, oh, man….all this time — it was a byte encoding issue. open-uri was returning the page as encoded US-ASCII instead of UTF-8.
<mwlang>
so html = open-uri(some_url).force_encoding(‘utf-8’) first, then doc = Nokogiri::HTML(html) and then all the xpath stuff works just fine.
benlieb has joined #ruby
<mwlang>
The <meta charset="UTF-8" /> appears to be ignored altogether.
zenguy_pc has quit [Ping timeout: 240 seconds]
crayfishx has joined #ruby
last_staff has joined #ruby
machan has quit [Ping timeout: 268 seconds]
bricker has quit [Quit: Lost terminal]
druonysuse has quit [Read error: Connection reset by peer]
Timba-as has joined #ruby
benlieb has quit [Read error: Connection reset by peer]
jobewan has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
benlieb has joined #ruby
idefine_ has quit [Remote host closed the connection]
<apeiros>
mwlang: if the server sends a content-type header, then that has priority iirc
qpls has quit [Ping timeout: 244 seconds]
idefine has joined #ruby
shadoi has joined #ruby
<apeiros>
might also be that openuri doesn't do anything about the encoding and just uses default_internal
<mwlang>
apeiros: it may very well be sending an overriding header. I just didn’t think to check that setting.
qpls has joined #ruby
<apeiros>
mwlang: I'm curious, though - what's your Encoding.default_internal and .default_external?
<Ox0dea>
mwlang: "Overriding" isn't the right word; open-uri doesn't parse XML, and that's really what you want.
<apeiros>
if internal is set, all IO will translate iirc
darkf has quit [Quit: Leaving]
<apeiros>
I haven't actually experimented enough with those things
<apeiros>
I always set encodings explicitly
<mwlang>
I guess my question really is, what *should* these be for most Ruby environments?
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
mwlang: I think internal nil, external utf-8
vev_ has quit [Ping timeout: 250 seconds]
<apeiros>
and then make sure you actually pass the encoding if your external source is not utf-8
druonysuse has quit [Client Quit]
<mwlang>
apeiros: ok, I’ll do a little more research on these two settings before I start just setting them blindly in all projects, but I do think I’m going to have to start more actively managing the encoding setting with international projects.
<karapetyan>
Ox0dea: my stupid brain + 3hrs and it's done)
dfockler has joined #ruby
itgold has joined #ruby
freerobby has joined #ruby
<itgold>
hi there, friends
<mwlang>
I almost never encounter encoding issues with US-based clients and projects, but with International projects, I find that even if the ecosystem is set up with intent to serve UTF-8 everywhere, it’s not always the case.
<mwlang>
(as in this example!)
<shevy>
hehe
<shevy>
one day we will use the one true encoding to bind them all
m3_del has joined #ruby
__chris has joined #ruby
zenguy_pc has joined #ruby
adac has joined #ruby
<mwlang>
shevy: UTF-16? :-o
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
druonysus has joined #ruby
SCHAAP137 has quit [Ping timeout: 260 seconds]
<karapetyan>
Ox0dea: and it's should be: code.gsub(/(\/\*.+?\*\/)|(\/\/.+)/,"") =)
druonysuse has quit [Ping timeout: 240 seconds]
<__chris>
Anyone here know of any GUI or CLI tools for viewing & running Sphinx queries?
speakingcode has joined #ruby
speakingcode has quit [Client Quit]
tenderlove has quit [Ping timeout: 250 seconds]
m3_del has quit [Ping timeout: 240 seconds]
<mwlang>
__chris: rails! :-D
zotherstupidguy has joined #ruby
<__chris>
Hi
purplexed- has quit [Ping timeout: 240 seconds]
_djbkd has joined #ruby
<mwlang>
__chris: although answered somewhat in jest — I usually code it up in rspec as well as just getting a simple search submission form working early on.
<__chris>
Thanks for your ideas
karapetyan has quit [Remote host closed the connection]
kalusn has joined #ruby
<shevy>
mwlang no clue, I am UTF free, but isn't UTF-8 superior to UTF-16?
desmondhume has joined #ruby
vdamewood has joined #ruby
arup_r has quit [Read error: Connection reset by peer]
bricker has joined #ruby
desmondhume has quit [Client Quit]
baweaver has joined #ruby
arooni has joined #ruby
roxtrongo has joined #ruby
<mwlang>
shevy: depends on the predominent language, I think. I think UTF-8 will use single byte for characters in the ASCII range and 2 bytes only as needed. UTF-16 uses 2 bytes always — IIRC.
rgtk has quit [Remote host closed the connection]
<mwlang>
(in other words, I don’t really know) :-)
solars has joined #ruby
baroquebobcat has quit [Read error: Connection reset by peer]
JuanDaugherty has quit [Remote host closed the connection]
iamvery has joined #ruby
<chris2>
utf-16 uses 2 bytes if they are enough
User458764 has joined #ruby
yokel has quit [Ping timeout: 250 seconds]
jackjackdripper has joined #ruby
jschoolcraft has joined #ruby
sphex_ has joined #ruby
c_nick has joined #ruby
<mwlang>
so, for nokogiri, I can ask for the text of a node via the xpath like this node.at_xpath(“td[3]/div[1]/a/text()”).to_s but how do I retrieve the “href” context of that same node with xpath?
yokel has joined #ruby
jackjackdripper has quit [Client Quit]
jackjackdripper has joined #ruby
<c_nick>
while installing mysql2 i ran into bit of trouble .. i have mysql server installed (no client) for which i downloaded mysql-c- connectors-no-install i pointed to the libs and include folder of that while installing but it still failed with cannot find mysql client
JuanDaugherty has joined #ruby
sphex has quit [Ping timeout: 264 seconds]
<c_nick>
ruby 2.0 32 bit and mysql 5.6
vev_ has joined #ruby
<shevy>
you should put the full error on a pastie site c_nick
shinenelson has quit [Quit: Connection closed for inactivity]
dnomyar has joined #ruby
juanpablo__ has joined #ruby
mattwildig has joined #ruby
pietr0 has joined #ruby
momomomomo has quit [Quit: momomomomo]
jackjackdripper1 has joined #ruby
prettiestPony11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
In case anybody wanted to know the first codepoint that requires four bytes.
<odigity>
Is there a version of attr_accessor that creates accessors that take an option value, like foo(val=nil), that is both getter and setter at the same time? (That way you don't need to preface it with self. when using it as a setter)
baweaver has quit [Remote host closed the connection]
<Ox0dea>
odigity: No, but Gandhi is relevant: "Be the change you wish to see in the world."
<odigity>
Ox0dea, I've already start writing my own, just surprised it doesn't already exist
yardenbar has joined #ruby
Yzguy has joined #ruby
petricore has joined #ruby
vdamewood has quit [Quit: Life beckons.]
<c_nick>
odigity: i like that idea
<c_nick>
but there already something in the libraries that satisfies my laziness :D
<odigity>
c_nick, thanks. reason it matters is because I'm creating a config file format (like Gemfile or Vagrantfile), and want people to be able call setters in context, but the classical ones need to be prefixed with self. to prevent ruby from thinking you're referencing a local variable, and that's ugly and likely error-prone
<c_nick>
anyone with the mysql2 gem error like me?
ibouvousaime has quit [Ping timeout: 252 seconds]
evanjs_ has joined #ruby
radgeRayden has joined #ruby
kaldrenon has joined #ruby
rgtk has joined #ruby
tcrypt has joined #ruby
roxtrongo has quit [Remote host closed the connection]
radgeRayden_ has quit [Ping timeout: 246 seconds]
<shevy>
you use windows?
karapetyan has joined #ruby
roxtrongo has joined #ruby
duckpuppy has joined #ruby
ESpiney has quit [Ping timeout: 246 seconds]
<Ox0dea>
odigity: Explicit self is much less error-prone than implicit.
<kaldrenon>
I'm having a strange issue that's proving hard to google for: when I do rake -T I get invalid option: -T -- and when I do rake -v I get rake: version unknown
<kaldrenon>
How to I deal with that?
mattwildig has quit [Remote host closed the connection]
<odigity>
Ox0dea, not for setting. it's way too easy to write "foo = 42" instead of "self.foo = 42" and then wonder why your config isn't being parsed...
<Ox0dea>
odigity: Why not just do it like all the other (sane) DSLs do and #instance_eval a block, thereby giving the user the freedom to choose what to say instead of `self` and not introducing any undue magic?
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<odigity>
Ox0dea, I tried to determine prior art this morning. I explored the source for Bundler, Sequel, and Vagrant to see how they load Gemfile, migrations, and Vagrantfile, respectively. I couldn't figure out the last one. Bundler puts you in a DSL instance (so you're using implicit self to call methods like 'gem'). Sequel asks you to write Sequel.migration do at the top, and then hands the block to a DSL class.
baweaver has quit [Remote host closed the connection]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<odigity>
Ox0dea, however, what I couldn't figure out was if I give them a method to call (let's day Foo.config do), then I basically have to capture the return value in order to use the result of their config, and that seems very fragile.
machan has joined #ruby
<odigity>
I'm very much open to suggestions, since this is new territory for me.
<Ox0dea>
odigity: I'm not sure I follow; you don't trust Ruby's return semantics?
dhollinger has quit [Remote host closed the connection]
_djbkd has quit [Remote host closed the connection]
dfockler has quit [Ping timeout: 240 seconds]
malconis has joined #ruby
<c_nick>
i m off to sleep now .. i have a battle with mysql2 tomorrow morning
<c_nick>
i also need to shave :(
jordanloky has quit [Ping timeout: 264 seconds]
<odigity>
I don't trust the user not to put something at the end of the file after the Foo.config block which will result in the wrong thing being returned. I like building tools that don't rely on unstated assumptions that result in surprising, negative user experiences.
<Ox0dea>
odigity: What does/should a config block return?
<odigity>
Ox0dea, can you think of a better way of capturing the result of their action?
ibouvousaime has joined #ruby
<Ox0dea>
odigity: Don't you control the definition of #config?
<odigity>
Ox0dea, I was thinking it would return an initialized Foo::Repo object (it's a repoconfig file)
<odigity>
Ox0dea, I do
ESpiney has joined #ruby
<Ox0dea>
odigity: Then you're golden.
c_nick has left #ruby [#ruby]
firstdayonthejob has joined #ruby
<odigity>
Ox0dea, can you explain to me how the plumbing should be done at each step? What would you have Foo.config do, and how would you capture the initialized Foo::Repo instance at the end?
_djbkd has joined #ruby
diegoviola has joined #ruby
<odigity>
(without using global variables or the equivalent, as I'd like to be able to load multiple repoconfig files in the same process)
shinnya has joined #ruby
Guest53 has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
<odigity>
I thought about maybe doing: 1. Foo.config will create the object and add it to an array class variable 2. afterwards, I fetch the last object in the array -- but in theory, they could call Foo.config twice in the same file and create two objects. :) I don't like edge cases...
<Ox0dea>
...
<Ox0dea>
Please see the link. :P
<odigity>
going now
<odigity>
was just in the middle of typing when you posted it...
<odigity>
Ox0dea, not familiar with tap, lemme go look that up first
<Ox0dea>
odigity: It's the most elegant Ruby method.
<Ox0dea>
Without the surrounding #tap, Foo.config would evaluate to the last expression in the block, but you want it to return the Foo::Repo being created.
peteykun has quit [Quit: Leaving]
platzhirsch has quit [Ping timeout: 240 seconds]
<odigity>
Ox0dea, ok, I've read your snippet (very nice, btw), and I think I get it. But I would rather the user use accessors (var) rather than directly reference instance vars (@var), which brings us back to my original point. traditionally setters require self., and are thus very error prone. (I make that mistake all the time, and I'm not a complete noob)
<Ox0dea>
odigity: Oh, sorry, I did forget that detail, but it's very easy to incorporate.
<odigity>
Ox0dea, that is a very nice improvement over my implementation which solves that problem, and will definitely use it
<Ox0dea>
<3
<odigity>
Now I just need my accessors. I'm going to call the macro attr_unified, since it makes one method that's both setter and getter.
RegulationD has joined #ruby
ec is now known as pikajude^
veg has quit [Ping timeout: 246 seconds]
prettiestPony11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<odigity>
Ox0dea, I've already explained several times -- because people often forget to type self., thereby setting a local instead of an attribute, and then wonder why it's not working
<Ox0dea>
odigity: Have you ever seen a gemspec?
<odigity>
Ox0dea, that's better. I don't mind a prefix var (Vagrantfiles use |config| by convention), because it's clear form the opening line that you should be using it. that's an improvement over expecting them to remember self.
<odigity>
Ox0dea, I have.
platzhirsch has joined #ruby
<odigity>
Ox0dea, I totally forget to add gemspec to my list of prior art. :)
michaeldeol has joined #ruby
agentmeerkat has joined #ruby
<odigity>
Ox0dea, ok, great. your second snippet (gemspec style with tap for object retrieval) should be all I need
<Ox0dea>
odigity: Bless you. <3
<odigity>
Ox0dea, but for the record... I still think attr_unified is an obviously useful general helper that should be in ActiveSupport. :)
<Ox0dea>
odigity: I'm all for sexy magic, but setters should at least vaguely resemble setters.
<odigity>
Ox0dea, I assume it's been a long time since you forgot to write self....
<odigity>
Ox0dea, I agree that traditionally setters are superior in most ways -- for example, you couldn't use ||= with my attr_unified accessors
pikajude^ is now known as ec
nertzy has joined #ruby
<Ox0dea>
odigity: And you want that, yeah?
<odigity>
Ox0dea, and I use traditional accessors in my own code. but in a case like this, with a config file intended to be used by possibly non-ruby programs, attr_unified isn't a *terrible* idea...
jaequery has joined #ruby
m3_del has joined #ruby
<odigity>
non-ruby programmers, I mean
<shevy>
grandmas hacking away on ruby code
<Ox0dea>
odigity: I did all I could to put the safety back on your footgun.
mattwildig has joined #ruby
<odigity>
shevy, attr_unified was a class method I proposed to Ox0dea that would create a single accessor that accepts an optional value -- foo(val=nil) instead of foo() + foo=(val)
<shevy>
aha
<Ox0dea>
odigity: May I see your definition of #attr_unified?
<odigity>
though come to think of it, that couldn't handle setting the value to nil. :)
<odigity>
Ox0dea, I didn't finish writing it because your solution was better
bruce_lee has quit [Read error: Connection reset by peer]
<odigity>
But I'm sure you can imagine what it would be.
<mwlang>
the neighbor’s dogs aren’t happy. they’ve been barking for 5 minutes straight…then I toggle over to here to see Irish Setters and Corgi’s…
<odigity>
well, it was a fun thought experiment, anyway
BraddPit1 has joined #ruby
<Ox0dea>
mwlang: Blame odigity.
BraddPit1 has left #ruby [#ruby]
<odigity>
I'm used to it.
<shevy>
mwlang haha
<shevy>
dogs and cats - the things that secretly power the www
<Ox0dea>
odigity: Jeeze, you've got me considering the notion of private Symbols now.
<odigity>
Ox0dea, one more question: what exactly does &proc do in your snippet? is it some kind of shortcut to wrap a passed in block or something?
m3_del has quit [Ping timeout: 260 seconds]
<Ox0dea>
odigity: `proc` is an alias for `Proc.new`, which uses the block passed into the surrounding method if you don't give it one explicitly.
sankaber has quit [Read error: Connection reset by peer]
<odigity>
Ox0dea, ok, cool
tulak has quit []
sankaber has joined #ruby
rdark has quit [Quit: leaving]
druonysus has quit [Remote host closed the connection]
lubarch has quit [Ping timeout: 250 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
<odigity>
Ox0dea, I just realized your solution still doesn't solve the object capture problem. Because Foo.config is being called in the config file, the return value is also returned in the config file -- not to me, the guy loading and evaling the contents of the config file
purplexed- has joined #ruby
purplexed- has joined #ruby
<Ox0dea>
odigity: People deserve what they get if they're using the return value of #load.
<Ox0dea>
Or is that not how you meant?
timonv has joined #ruby
<odigity>
Ox0dea, then how am I to capture the object being created within the config file from outside the config file?
<Ox0dea>
odigity: Are you sure you need to know about the object after it's left #config?
ta has joined #ruby
bricker_ is now known as bricker
<odigity>
Ox0dea, that's the whole point of loading a config file. to get back an initialized Repo object.
<odigity>
so I can then operate on it
Guest97 has joined #ruby
fantazo has joined #ruby
<Ox0dea>
odigity: You're just gonna be operating on it willy-nilly?
evanjs_ has quit [Remote host closed the connection]
<odigity>
Ox0dea, I don't understand the question.
momomomomo has joined #ruby
<Ox0dea>
odigity: At what point are you afraid you'll lose sight of the object?
h99h9h88 has joined #ruby
symm-_ has joined #ruby
<djellemah>
It's a pity you can't magically (that is, from outside the block) cause @binding = binding in the config block. Then you could just assign local variables, and later pull out the ones you want.
symm- has quit [Ping timeout: 250 seconds]
<odigity>
Ox0dea, in my tool, I need to load the config file and then access the resulting Repo object. When the config file is loaded, the Foo.config method will call with the block, and return an initialized Repo object, but no one is there to catch it. So I end up with nothing.
<Ox0dea>
odigity: You have access to the Repo in #config, irrespective of whence it was called.
dnomyar has joined #ruby
pocketprotector is now known as Krusty
Krusty is now known as pocketprotector
<odigity>
Ox0dea, sure, but that's a Foo class method that returns a Repo instance. The only way I could get access to it afterwards is if I also have the config method save it to a class attribute, and then check it after the file loads.
<odigity>
Foo.config is called *inside* the config file.
<Ox0dea>
You can do anything you please with `r` there.
Sceko has joined #ruby
<odigity>
Ox0dea, nope, you're still returning the repo object from the config method, which is still running *inside* the config file, not in my tool. When you say "foo = Foo.config", you're capturing it inside the config file in a local foo that won't be available to me when load() returns
erbesharat has quit [Remote host closed the connection]
eminencehc has quit [Remote host closed the connection]
<Ox0dea>
odigity: But Foo is your tool.
cpup has quit [Ping timeout: 246 seconds]
cpup has joined #ruby
<odigity>
Ox0dea, yes. But that doesn't mean I magically know the correct functionality to add to make this work. That's why I'm here.
<odigity>
Ox0dea, I already suggested the most naive solution, which is have Foo.config stash it in a class var and then fetch it afterwards. I'm hoping to improve on that.
synthroid has quit [Remote host closed the connection]
VeryBewitching has joined #ruby
<Ox0dea>
odigity: Aye, and I'm just trying to make sure that's in line with what you actually want.
h99h9h88 has quit [Ping timeout: 272 seconds]
<Ox0dea>
Why does $thing need to be able to pluck Foo::Repos out of the air?
<odigity>
I want to access the repo object in my tool, the tool that is calling load() on the config file. Currently, your snippet shows the object being return within the config file and set to a local named foo. But my tool doesn't have access to foo after load finishes running.
<odigity>
Ox0dea, are you seriously asking me why my tool needs access to my tool's config file?
skcin7 has joined #ruby
<Ox0dea>
odigity: Yeah, that's exactly what I asked you.
<odigity>
Ox0dea, because the config file contains information that will drive the tool's behavior.
<Ox0dea>
odigity: Oh, wow. Tell me some more things.
<odigity>
suddenly this no longer seems like a productive conversation
<Ox0dea>
odigity: Disclaimer: I have no idea what the fuck I'm talking about.
teclator has quit [Quit: Lost terminal]
<odigity>
Ox0dea, well, thanks for teaching me about tap, anyway. I guess I'll use the obvious naive solution and worry about it if and when I find a reason it's not good enough.
nertzy has quit [Quit: This computer has gone to sleep]
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
cdg has quit [Remote host closed the connection]
codecop has joined #ruby
riotjones has joined #ruby
ibouvousaime has quit [Ping timeout: 240 seconds]
postmodern has joined #ruby
yeticry has quit [Read error: Connection reset by peer]
mikeharris22 has joined #ruby
yeticry has joined #ruby
Rollabunna has joined #ruby
zotherstupidguy has quit [Ping timeout: 272 seconds]
mikeharris22 has quit [Remote host closed the connection]
craysiii has joined #ruby
yardenbar has quit [Remote host closed the connection]
RegulationD has quit [Remote host closed the connection]
mikeharris22 has joined #ruby
riotjones has quit [Ping timeout: 260 seconds]
roxtrongo has quit [Remote host closed the connection]
axl_ has quit [Ping timeout: 252 seconds]
Aquish has joined #ruby
Aquish has left #ruby [#ruby]
yardenbar has joined #ruby
axl_ has joined #ruby
mndoci has quit [Remote host closed the connection]
machan has joined #ruby
Rollabunna has quit [Ping timeout: 265 seconds]
veg has joined #ruby
ibouvousaime has joined #ruby
karapetyan has quit [Remote host closed the connection]
mndoci has joined #ruby
mistermocha has joined #ruby
momomomomo has quit [Quit: momomomomo]
karapetyan has joined #ruby
vev_ has quit [Read error: No route to host]
finisherr has joined #ruby
<shevy>
tap tap the lap
_djbkd has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 255 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ledestin has joined #ruby
Mon_Ouie has quit [Ping timeout: 265 seconds]
arup_r has joined #ruby
blueOxigen has quit [Ping timeout: 250 seconds]
dhollinger has joined #ruby
_djbkd has joined #ruby
baweaver has joined #ruby
momomomomo has joined #ruby
bruno- has joined #ruby
benlieb has quit [Quit: benlieb]
mozzarella has quit [Quit: WeeChat 1.2]
mloy has joined #ruby
baweaver has quit [Ping timeout: 246 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
baweaver has joined #ruby
radgeRayden has quit [Quit: Leaving]
bruno- has quit [Ping timeout: 255 seconds]
bruno- has joined #ruby
Sceko has left #ruby [#ruby]
leafybasil has joined #ruby
zenguy_pc has quit [Ping timeout: 265 seconds]
prettiestPony11 has joined #ruby
baweaver has quit [Ping timeout: 272 seconds]
freeze has quit [Ping timeout: 272 seconds]
diegoaguilar has quit [Ping timeout: 264 seconds]
<Musashi007>
tap tap teh what
roxtrongo has joined #ruby
bruno- has quit [Ping timeout: 264 seconds]
<Musashi007>
lol - have you guys ever considered a TS/Vent server to hang out on?
bruno- has joined #ruby
d5sx43 has joined #ruby
<mloy>
Musashi007 A Mumble server would be better imo
uri_ has joined #ruby
<Musashi007>
sure or something
d5sx43 has quit [Client Quit]
synthroid has joined #ruby
<eam>
sounds terrible, no pun intended
lukaszes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanpablo__ has joined #ruby
agentmeerkat has quit [Ping timeout: 265 seconds]
<Musashi007>
Someone showed me some new app that was like slack but enabled voice chat.. discord or something like that
bruno- has quit [Ping timeout: 265 seconds]
<Musashi007>
@eam what about it sounds terrible?
m3_del has joined #ruby
prettiestPony11 has quit [Remote host closed the connection]
<shevy>
ewww
<eam>
well, the value of irc is that it's only weakly synchronous. I'm not interested in giving you my attention all day
<shevy>
the more you write, the more awful it sounds
s2013 has joined #ruby
<eam>
and spoken conversations are inherently serialized
<eam>
not to mention, you can never search in it, can't represent code (which is what we're here to talk about), and it's slow and just ... zero upside
yfeldblum has joined #ruby
juanpablo__ has quit [Ping timeout: 265 seconds]
m3_del has quit [Read error: No route to host]
m3_del has joined #ruby
karapetyan has quit [Remote host closed the connection]
zenguy_pc has joined #ruby
tmtwd has quit [Ping timeout: 272 seconds]
momomomomo_ has joined #ruby
karapetyan has joined #ruby
momomomomo has quit [Ping timeout: 246 seconds]
momomomomo_ is now known as momomomomo
<tubbo>
yeah agreed
<tubbo>
the only upside a voice-chat server would have is with clients
mozzarella has joined #ruby
<tubbo>
but even then, you can just call them and do a conference call. it's a solved problem :D
<eam>
"well if you're paying me"
<eam>
heck, I'll even put on pants and we can do video
<hanmac>
shevy did you watched gravity falls?
<itgold>
def feed.items; "" end
<Ox0dea>
hanmac!
<Ox0dea>
itgold: That's not very many items.
diegoaguilar has joined #ruby
<itgold>
how to change this declaration so it will work in feed.items.each
braincra- has joined #ruby
braincrash has quit [Ping timeout: 260 seconds]
karapetyan has quit [Ping timeout: 250 seconds]
<Ox0dea>
itgold: Have it return something Enumerable?
<itgold>
yes, how to do this in ruby?
<Musashi007>
Eh, I guess you guys are right
moeabdol has quit [Ping timeout: 240 seconds]
<Ox0dea>
> I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
<shevy>
hanmac nope; I don't get to see a lot of new stuff lately :(
karapetyan has joined #ruby
<itgold>
def feed.items; Enumerable.new end
<Ox0dea>
itgold: Whence are these items coming?
<itgold>
from the parsed feed
colegatron has quit [Ping timeout: 240 seconds]
<itgold>
rss feed
<Ox0dea>
itgold: I bet it's Enumerable.
<itgold>
feed = RSS::Parser.parse(body)
<itgold>
feed.items.each do |item|
<Ox0dea>
itgold: And that doesn't work just fine?
karapetyan has quit [Remote host closed the connection]
<itgold>
this thing is complaining about .each (no such method exception) :(
karapetyan has joined #ruby
kadoppe has quit [Ping timeout: 244 seconds]
ahegyi has quit [Ping timeout: 268 seconds]
Channel6 has joined #ruby
<Ox0dea>
itgold: Debug-print `feed.items.class`.
agentmeerkat has joined #ruby
<itgold>
ok
mpistone has joined #ruby
jordanloky has joined #ruby
kadoppe has joined #ruby
h99h9h88 has joined #ruby
<Ox0dea>
What'dya get?
solocshaw has quit [Ping timeout: 246 seconds]
fantazo has quit [Ping timeout: 252 seconds]
<itgold>
:items=>Array
DEA7TH has quit [Quit: DEA7TH]
Guest97 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<eam>
what's superman's favorite ruby class?
<Ox0dea>
itgold: Well, Array most definitely responds to #each, so that can't possibly actually be the class of `feed.items`.
<eam>
Array (a ray)
FernandoBasso has joined #ruby
mary5030 has quit [Remote host closed the connection]
agentmeerkat has quit [Ping timeout: 240 seconds]
karapetyan has quit [Ping timeout: 250 seconds]
Alina-malina has quit [Ping timeout: 252 seconds]
<itgold>
right, I'm sorry. The real problem is: Error: undefined method `items'
<ruboto>
eam # => /tmp/execpad-9d52922cb886/source-9d52922cb886:2: [BUG] Segmentation fault at 0x4ae9c689 ...check link for more (https://eval.in/461796)
<eam>
whooooa
<adaedra>
ahah
<Ox0dea>
eam: What'dya expect?
<eam>
didn't segv on my end, I actually was left with a working irb
bender_unit has joined #ruby
<Ox0dea>
eam: Same here until I entered anything else.
eminencehc has joined #ruby
<adaedra>
yep, same here too.
consumerism has joined #ruby
<Ox0dea>
eam: Why did you switch it to use exceptions as control flow?
<consumerism>
in php and bash (and others), i can write "somevariable || 'fallback string'" and if somevariable is false, then 'fallback string' is assigned/echoed/whatever instead. how do i do the same in ruby?
<ruboto>
shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<Ox0dea>
~ $ python -c "print('' or 'i suck too')"
<Ox0dea>
i suck too
<shevy>
adaedra french is also offtopic
<adaedra>
that's why I discuss about it there, usually.
baweaver has joined #ruby
<shevy>
Bonsoir.
eminence_ has joined #ruby
eminencehc has quit [Ping timeout: 240 seconds]
<tubbo>
facebook should cost a lot less to operate than it does.
<tubbo>
at least, seemingly
<tubbo>
it does do a lot of stuff though :D
<itgold>
Ox0dea: you are right, this is most likely invalid feed data
<shevy>
I don't know what it does but I find the interconnection things annoying; on twitch.tv you can only chat if you have a facebook account so I am excluded
<itgold>
I just want to ignore this and keep going
<itgold>
not fail
purplexed- has quit [Ping timeout: 260 seconds]
<Ox0dea>
itgold: At least do it sanely; check the return value of RSS::Parser.parse and don't take the happy path if's `nil`.
baweaver has quit [Ping timeout: 246 seconds]
platzhirsch has left #ruby [#ruby]
<itgold>
should I check by return class type?
sdrew has joined #ruby
stacybird has left #ruby [#ruby]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mistermocha has joined #ruby
<Ox0dea>
itgold: No, all `nils` are the same.
codecop has quit [Remote host closed the connection]
<adaedra>
Ox0dea: you're gonna teach him/her your ways? :p
<itgold>
:)
<Ox0dea>
adaedra: It's just odd they're parsing RSS and haven't encountered #map.
<shevy>
you are too sceptical!
<itgold>
if I would be a woman, I would say "Yeah, teach me your way, babe!"
<shevy>
when someone says he is a noodle, believe him
<Ox0dea>
itgold: Wat.
danman has joined #ruby
<itgold>
I'm not parsing this rss thing, I'm just trying to fix an issues with the plugin I've got
<Ox0dea>
itgold: Despite the old trope, tossing a child into the deep end is not the proper way to teach them how to swim.
based_pdev_ has joined #ruby
mozzarella has quit [Quit: WeeChat 1.2]
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
<itgold>
I'm pretty sure I will swim! :)
<itgold>
just give me your lesson
baweaver has joined #ruby
mary5030 has joined #ruby
DEA7TH has joined #ruby
<shevy>
it seems one can use $stdin.gets('//').chomp to have multiline input with // as trailing sequence; but is there a way to have multiple (different) end tokens? such as: $stdin.gets('//','\\').chomp
<pipework>
Ox0dea: I'm always trying to learn ruby.
<Ox0dea>
bradland: It makes it correct.
<bradland>
also, would you prefer the ALTERNATION option or the CLASS syntax
<itgold>
I need to learn a bit for fixing the issues
<Ox0dea>
bradland: /Version : 4|5/ matches any string contaning '5'.
<bradland>
i see
stamina has joined #ruby
<bradland>
so /Version: 4|5/ is "Version: 4" or "5" ?
<Ox0dea>
bradland: Just so.
<Ox0dea>
A character class is best in this case, but don't let that put you off alternation.
<bradland>
gotcha, the only reason i was looking at alternation was because i felt like it communicated intent better
_blizzy_ has quit [Ping timeout: 250 seconds]
<bradland>
with the group and alternation, i create a capture group that i won't use
<bradland>
not sure how horrible that is
<pipework>
Ox0dea: I did a thing where I wanted to have a nice DSL at the class level where methods took blocks and then I wanted to take those blocks and change their binding to the instance as whale as yield a value to them. It was pretty fun. I had to define a temporary method on the instance's eigenclass, pass the block in as the block for define_singleton_method, grab the method object, call with the value and then delete the method from the
<pipework>
eigenclass.
<Ox0dea>
bradland: Well, you can create a non-capturing group.
<Ox0dea>
bradland: Character classes are essentially alternation at the character level, which is precisely what you want here.
<pipework>
Basically, I just wanted to change the binding of a block from the class it was defined in to the instance.
sdrew has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
pipework: My kinda convolution! :P
<pipework>
Ox0dea: YEAH!
<bradland>
Ox0dea: I see, so that means either really communicates what I want, provided the reader understands regex.
<Ox0dea>
Was binding_of_caller out of the question, then?
<pipework>
I did it without adding a banister gem either.
<bradland>
Thanks for the feedback!
<Ox0dea>
bradland: Happy to help.
<Ox0dea>
pipework: You know me too well.
<itgold>
how about this thing: if item.class == nil:NilClass next end
<pipework>
Ox0dea: You still have to change the binding. I had the binding of the caller, the instance, I just needed to swap the binding of the proc to the instance and not the class.
<adaedra>
itgold: you're going too far. nil is the same as false, in the eyes of if (and unless).
<itgold>
ah, thank you, got it
zquad has joined #ruby
<zquad>
Im using capistrano 3, I am trying to require "capistrano/rsync" but getting error: LoadError: cannot load such file -- capistrano/rsync how do I install it
yardenbar has quit [Ping timeout: 272 seconds]
<Ox0dea>
zquad: The gem is called capistrano-rsync.
Xeago has quit [Remote host closed the connection]
<Ox0dea>
I don't know why they gave it such a confusing name.
kaldrenon has quit [Quit: Connection closed for inactivity]
<zquad>
I already installed it via gem install capistrano-rsync though
yfeldblum has quit [Ping timeout: 246 seconds]
veg has quit [Ping timeout: 246 seconds]
<Ox0dea>
zquad: Are you using a Ruby version manager?
guardian has joined #ruby
hxegon has joined #ruby
<guardian>
hello
<zquad>
I have it
m3_del has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<itgold>
and I don't have control over the .parse method
<itgold>
I have to deal with the results of those two factors working together
Timba-as has quit [Quit: Be back later ...]
pullcheezy has joined #ruby
momomomomo has joined #ruby
<Ox0dea>
eam: You want "flow of control" there; it's not the flow that's being controlled, it's the control that's being flown.
Timba-as has joined #ruby
<adaedra>
:')
__chris has quit [Ping timeout: 268 seconds]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mary5030 has quit [Remote host closed the connection]
based_pdev_ has quit [Ping timeout: 240 seconds]
<Ox0dea>
Well, it's true.
roxtrong_ has joined #ruby
northfurr has quit [Quit: northfurr]
Guest97 is now known as thisguy123
northfurr has joined #ruby
<Ox0dea>
itgold: Have you considered upgrading to 2.3?
bruno- has quit [Ping timeout: 265 seconds]
mwlang has quit [Quit: mwlang]
<itgold>
upgrading what?
uri_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanpablo__ has quit [Ping timeout: 255 seconds]
<Ox0dea>
If you did, you could say `item.?description.to_s`.
roxtrongo has quit [Ping timeout: 260 seconds]
<itgold>
is it new feature of ruby?
<havenwood>
itgold: (Ruby 2.3.0 will be released on Christmas day but 2.3.0-dev is available now.)
_djbkd has joined #ruby
Timba-as has quit [Ping timeout: 250 seconds]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xaxisx has quit [Quit: xaxisx]
<itgold>
unfortunately I don't have control over this thing as well. Working with the specific framework and a plugin for it. I'm using predefined ruby version
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
itgold: Do you remember the #respond_to? method that no fewer than four different people advised you to use last time?
Guest53 has joined #ruby
xaxisx has joined #ruby
<itgold>
yes, what is about it?
<Ox0dea>
itgold: You should use it.
<itgold>
I can use it instead of recue?
<Ox0dea>
Yes.
<itgold>
great, thank you! Will give it a try
Eiam_ has joined #ruby
<Ox0dea>
I always wanted a goldfish.
<havenwood>
itgold: Exceptions should be an exceptional case not flow control.
<itgold>
yes, I understand guys. This is the best I can get, I think
<Ox0dea>
I wonder how the conflation of "control flow" with "flow control" came to be so widespread.
swgillespie has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
is it yin-yang time again with havenwood and Ox0dea
<Ox0dea>
havenwood: I wasn't taking a shot, mind.
jessemcgilallen has joined #ruby
<Ox0dea>
~4.5k hits for "flow control graph".
<havenwood>
hehe
neohunter has joined #ruby
<Ray`>
wikipedia ain't helping - In computer science, control flow (or alternatively, flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated.
pullcheezy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bMalum has quit [Quit: bMalum]
jackjackdripper1 has quit [Quit: Leaving.]
<Ox0dea>
Ray`: "Control flow" is for branching, "flow control" for data.
<neohunter>
that last module has a var called HISTORY
LoganG has joined #ruby
<neohunter>
how to access it frmo console
<neohunter>
i've tried with IRB::HistorySavingAbility.class_eval {HISTORY}
<neohunter>
but didnt work
ruurd has quit [Quit: ZZZzzz…]
<itgold>
even better. Thank you Ox0dea
<Ox0dea>
itgold: Sure thing.
shredding has joined #ruby
bruno- has joined #ruby
<Ray`>
Ox0dea is actually a refactoring library with a natural language api
<Ox0dea>
neohunter: You want the Array of previously evaluated expressions, yeah?
<neohunter>
1) yes I want that, 2) I also want to learn and know how to access that HISTORY var if I should use class_eval or instance_eval
freerobby has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
<itgold>
the only thing. I wanted to initialize an original object with the missing method initially. But it looks like local variable would work as well.
freerobby1 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
patchedmonkey has joined #ruby
bender_unit has joined #ruby
CanTonic has quit [Ping timeout: 264 seconds]
bruno- has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
freerobby1 has quit [Read error: Connection reset by peer]
jessemcgilallen has quit [Quit: jessemcgilallen]
freerobby has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
iamvery has quit [Ping timeout: 244 seconds]
Xeago has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iamvery has joined #ruby
bMalum has joined #ruby
spew has quit [Quit: leaving]
<neohunter>
neohunter: you can use puts Readline::HISTORY.to_a to view the recent commands history, not sure about your other question
al2o3-cr has quit [Ping timeout: 250 seconds]
<neohunter>
neohunter: thanks! you are awesome
<neohunter>
neohunter: np
freerobby has quit [Remote host closed the connection]
freerobby has joined #ruby
yfeldblum has joined #ruby
rgrmatt has joined #ruby
bruno- has joined #ruby
skade has joined #ruby
craysiii has quit [Quit: Leaving.]
polishdub has quit [Quit: Leaving]
eminencehc has quit [Remote host closed the connection]
patdohere has joined #ruby
jessemcgilallen has joined #ruby
Xeago has quit [Ping timeout: 264 seconds]
bruno- has quit [Ping timeout: 240 seconds]
Channel6 has quit [Ping timeout: 240 seconds]
<Ox0dea>
neohunter: And if irb has been invoked with the `--noreadline` flag?
ponga has quit [Quit: Connection closed for inactivity]
bruno- has joined #ruby
Limix has joined #ruby
eminencehc has joined #ruby
danman has quit [Ping timeout: 250 seconds]
skade has quit [Quit: Computer has gone to sleep.]
patdohere has quit [Read error: Connection reset by peer]
<Ox0dea>
neohunter: As to your latter question, despite observing the principles of object orientation, the IRB module actively resists being used outside of irb. :/
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruno- has quit [Ping timeout: 255 seconds]
bruno- has joined #ruby
kirun has quit [Remote host closed the connection]
zquad has quit [Quit: Leaving.]
purplexed- has quit [Ping timeout: 240 seconds]
wprice_ has quit [Quit: wprice_]
baweaver has joined #ruby
mistermo_ has joined #ruby
mattwildig has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
<skweek>
I'm wondering if I can ask for some help writing a script, I guess I'm just illiterate when it comes to writing a script, which sucks because I try a lot and I feel dumb, but I'm trying to move anything with the extension mp3 to a folder as long as there are mp3s and m4as in that folder, of a directory of folders containing mostly m4as and some mp3s and m4as, mp3 and m4a file types
northfurr has quit [Quit: northfurr]
m3_del has quit [Ping timeout: 244 seconds]
mag42c has quit [Quit: mag42c]
s00pcan has quit [Remote host closed the connection]
<hxegon>
skweek: have you written anything yet?
freerobby has quit [Remote host closed the connection]
<hxegon>
is there a way to load a specific file from github through bundler?
BigDiesel007 is now known as BigDiesel
<skweek>
i've read a few books on ruby and written scripts that are instructed
s00pcan has joined #ruby
<hxegon>
skweek: but as far as the script goes, you haven't started?
northfurr has joined #ruby
eminencehc has quit [Remote host closed the connection]
duckpuppy has joined #ruby
<hxegon>
skweek: also, what OS are you using?
<dorei>
hxegon: no idea about a specific file but you can tell bundler to fetch a "gem" from github
<skweek>
no, linux
<hxegon>
dorei: I'm not trying to fetch a gem though, its a lib file from someones project (that isn't a gem)
<hxegon>
skweek: well I'm not going to spoon feed you (because I'm trying to break the habit), but I'll help you. You might have to give me a minute first to deal with this git/bundler thing
eminencehc has joined #ruby
<skweek>
k, thanks
ViniciusBrito has quit [Client Quit]
northfurr has joined #ruby
<hxegon>
dorei: I've checked that and it seems to need a .gemspec file to work, so maybe bundler isn't the right tool? I might be looking for git submodules
sandals has joined #ruby
Voker57 has quit [Read error: Connection reset by peer]
northfurr has quit [Client Quit]
Ox0dea has joined #ruby
northfurr has joined #ruby
<Ox0dea>
hxegon: Do you trust GitHub?
<hxegon>
skweek: first thing while I deal with this, break down you problem into component parts. e.g. list the contents of a folder, get file extensions from those, etc.
Yzguy has joined #ruby
ruby-lang044 has quit [Ping timeout: 246 seconds]
<hxegon>
Ox0dea: not with anything too sensitive, but thats not specific to Github. Should I actively distrust them?
<Ox0dea>
skweek: Which Ruby books have you read, if you don't mind my prying?
podman has quit [Quit: Connection closed for inactivity]
<havenwood>
skweek: Want some code to get you started or trying to figure it out yourself?
<Ox0dea>
hxegon: No, I don't think so, but I asked pursuant to suggesting that you could just use open-uri + eval. :P
mordocai has quit [Remote host closed the connection]
northfurr has quit [Client Quit]
mistermocha has joined #ruby
ss_much has joined #ruby
northfurr has joined #ruby
<hxegon>
Ox0dea: hmm... I'll consider it if git submodules turns out to be a bad fit. Thanks for the suggestion though, not something I had thought of before
eminence_ has joined #ruby
<shevy>
I want my xmas ruby
eminencehc has quit [Ping timeout: 260 seconds]
freerobby has joined #ruby
riotjones has joined #ruby
<Ox0dea>
hxegon: Please ignore me on this one.
northfurr has quit [Client Quit]
karapetyan has quit [Remote host closed the connection]
<hxegon>
Ox0dea: Don't suggest that kind of stuff to me, because those kinds of things are just tempting enough for me to use in production because inexperience + enthusiasm
hahuang65 has joined #ruby
<Ox0dea>
skweek?
<skweek>
head first ruby, ruby wizardry, and a two youtube ruby tutorial series' Ox0dea
Steve_Jobs has quit [Quit: WeeChat 0.4.2]
<Ox0dea>
skweek: Hm, not the worst list, I guess. :P
<Ox0dea>
I think that might get you started in the right direction.
mistermocha has quit [Ping timeout: 240 seconds]
northfurr has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
<hxegon>
skweek: any questions about that gist?
karapetyan has joined #ruby
to_json has quit [Quit: Leaving.]
riotjones has quit [Ping timeout: 240 seconds]
northfurr has quit [Client Quit]
<shevy>
skank the weed
<shevy>
skweek the wank
northfurr has joined #ruby
<skweek>
so it lists mp3s and their directories, and then list m4as, and then move those listed items to a directory, and then remove m4as from the computer
Rollabunna has quit [Ping timeout: 240 seconds]
northfurr has quit [Client Quit]
<hxegon>
skweek: specific folders or your entire computer?
<shevy>
keep a backup!
Coldblackice has joined #ruby
<hxegon>
skweek: I'm guessing that this is all taking place in a 'Music' folder or something
<shevy>
as usual, the solution is to use arrays there
<havenwood>
skweek: Did you want some code to give you ideas for getting started or want to figure it out from scratch?
mistermocha has joined #ruby
<weaksauce>
skweek think in smaller chunks and only do the actual destructive commands when you fully know that it works
northfurr has joined #ruby
jorb_ is now known as jorb
tlaxkit has joined #ruby
<hxegon>
skweek: destructive meaning actually changing something in a potential irreversible way
juanpablo__ has joined #ruby
northfurr has quit [Client Quit]
marr has quit [Ping timeout: 244 seconds]
consumerism has quit [Ping timeout: 260 seconds]
Renich has quit [Ping timeout: 264 seconds]
karapetyan has quit [Remote host closed the connection]
<hxegon>
skweek: clarify 'remove m4a from computer' pls. as in it removes the file completely, or it copies it to a location and destroys the original?
rbowlby has joined #ruby
<skweek>
i'm converting m4a to mp3 and deleting m4a
m3_del has joined #ruby
Renich has joined #ruby
towski__ has joined #ruby
northfurr has joined #ruby
juanpablo__ has quit [Ping timeout: 250 seconds]
<skweek>
only some mp3s have been converted out of the directories
stamina has quit [Quit: WeeChat 1.3]
northfurr has quit [Client Quit]
<skweek>
so list m4as from directories, list mp3s from directories, compare and list m4as, remove m4as? does that sound broken down
tkuchiki has joined #ruby
Rickmasta has joined #ruby
towski_ has quit [Ping timeout: 240 seconds]
<hxegon>
skweek: so you only want to convert m4as in directories where mp3s also exist?
northfurr has joined #ruby
rgrmatt has quit [Remote host closed the connection]
<hxegon>
skweek: or are you trying to prevent m4as getting converted that already have mp3 conversions?
babblebre has quit [Quit: Connection closed for inactivity]
<skweek>
I have partially converted m4as into mp3s of several directories
ghoti has joined #ruby
northfurr has quit [Client Quit]
<skweek>
I'm trying to remove the m4as that have already been converted to mp3s
<hxegon>
skweek: alright, before we get into the meat of this, I'm just going to get something out of the way first
dfockler has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
<hxegon>
skweek: bash/zsh is probably a better tool in this situation. that said, doing this in ruby will be a good excersize, and it's not 'bad' to do it in ruby.