<Senjai>
I mean yeah, I get that unicorn requires a little leg work to use nicely, but I still stand by the fact that it's super powerful at what it can do
whippythellama has quit [Ping timeout: 272 seconds]
<Senjai>
bougyman: What do you use to host your stack?
charliesome has joined #ruby
<bougyman>
Senjai: runit-ed ubuntu
sevenseacat has joined #ruby
<bougyman>
for now.
Guest24828 has quit [Ping timeout: 252 seconds]
<Senjai>
bougyman: I mean like, EC2? Opsworks?
<bougyman>
we're going to move to either void snapshots or alpine, before ubuntu's next release.
<bougyman>
Senjai: a variety.
<elektronaut>
i like passenger well enough. i've got a ton of mostly low traffic apps running on dozens of servers, i love that it's pretty much set and forget.
<bougyman>
we have quite a bit of our our own bare metal which we virtualize with lxc.
Igorshp has quit [Remote host closed the connection]
<bougyman>
then leverage VPSie, OVH, Vultr, Rackspace, AWS, and DigitalOcean
<Senjai>
That sounds pretty involved
<bougyman>
as well as some local providers in other joint.
<bougyman>
not at all.
<bougyman>
it's all just knife <some shit>
<Senjai>
Aye, we got rid of our chef stack largely by swapping over to Opsworks
<Senjai>
should check it out :)
<bougyman>
have
<Senjai>
except for those cookbooks I linked
<bougyman>
it doesn't really matter which cfgmanager you use.
<bougyman>
just do it intelligently.
eggoez has joined #ruby
<Senjai>
Opsworks isn't a cfgmanager
<Senjai>
:P
<bougyman>
i could make arguments for ansible, salt, juju, name it.
<bougyman>
AWS OpsWorks is an application management service
<bougyman>
from page 1
<bougyman>
cfgmanagement, application management, plz let's not go semantic.
NeverDie_ has joined #ruby
<Senjai>
Sure, I just haven't heard it be called that before
<bougyman>
well I started with home-baked automation, of course.
zivix is now known as cbednarski
<bougyman>
then cfgengine showed up and it was like wow.
<centrx>
acsigusz, Ruby has functional parts, such as enumerable blocks, and can be written in a very functional way, but is not technically a functional programming language
commondream has joined #ruby
bgmarx_ has quit [Ping timeout: 255 seconds]
<noethics>
technically any language that supports functional programming is a functional language
<noethics>
~technically~
zenguy_pc has joined #ruby
bkxd has joined #ruby
<centrx>
Yeah I tend to think of it as supporting functional programming
<centrx>
I guess I mean "not popularly considered a functional language"
<noethics>
maybe you mean it's a functional declarative language
<bougyman>
no, that is horrible and I can't read it
<centrx>
ProLoser, I assume that stuff on the right is just a mistake duplication?
<noethics>
yeah that's not mutually exclusive though
Akagi201 has joined #ruby
<ProLoser>
centrx: the stuff on the right is shitty engineering
<noethics>
lol
<sevenseacat>
ow, wtf is with that code
<ProLoser>
like i said
<ProLoser>
what's the "proper" way
commondream has quit [Ping timeout: 256 seconds]
<elektronaut>
i'd argue the stuff on the left is shitty engineering as well :p
<ProLoser>
in js i'd use some sort of Object.assign or extend()
<ProLoser>
i don't know ruby
<ProLoser>
additionally, i need to whitelist the hash
<elektronaut>
is this rails?
<ProLoser>
i just realized, yes the doubling is accidental
<ProLoser>
sorry
<ProLoser>
i copied a huge diff
Sembei has quit [Ping timeout: 276 seconds]
<sevenseacat>
use strong params to select the params you want
blaines has quit [Ping timeout: 252 seconds]
msnyon has joined #ruby
BanzaiJoe has quit [Ping timeout: 252 seconds]
<ProLoser>
i may want more (i figure) but they may not be used for this part of the code
<noethics>
i think that the whole user_params array isnt necessary at all
<zenspider>
that's just awful.
kyle__ has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
<kyle__>
How do you test a return code in mechanize? I found some examples, but they don't appear to work anymore. I know I can do it with Net::HTTP, but was hoping to use just one library to keep things simple.
<ProLoser>
noethics: so would you just add the uuid to params?
haraoka has quit [Remote host closed the connection]
<David______>
NoMethodError: undefined method `name' for #<Contact id: nil>
towski_ has quit [Remote host closed the connection]
<sevenseacat>
seems straightforward
<sevenseacat>
there's no `name` method
datanoise has quit [Ping timeout: 264 seconds]
endash has quit [Quit: endash]
ferr has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<sevenseacat>
where do you expect it to be defined?
rubie has joined #ruby
nateberkopec has joined #ruby
RegulationD has joined #ruby
<David______>
I'm kinda following a video tutorial so I'm not really sure how the methods are supposed to work, but :name works fine in the line before it.
khebbie_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
khebbie has joined #ruby
<t88m33s>
How do you mock a class, as opposed to an instance of it? I mean, when your class-under-test initializes some object inside of itself, as opposed to having it passed to it (DI).
c0m0 has joined #ruby
chussenot has quit [Quit: chussenot]
dumdedum has joined #ruby
fabrice31_ has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
<shevy>
Does anyone of you have an example for readline completion support, when you do something like "command foo<PRESS TAB HERE>"? In other words, I need to show a list of tab-completions not solely alone on foo<TAB> but on the command prior to foo; I want to complete on different subcommands, for a main command
Iskarlar has joined #ruby
mattarse has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
jtdoncas has quit [Ping timeout: 244 seconds]
dmolina has quit [Quit: Leaving.]
dmolina has joined #ruby
quentin has joined #ruby
houhoulis has quit [Remote host closed the connection]
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has quit [Quit: Musashi007]
Forgetful_Lion has joined #ruby
x0f has quit [Ping timeout: 272 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mdih has quit [Ping timeout: 255 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikecmpbll has joined #ruby
last_staff has joined #ruby
<quentin>
hi everyone, I am modifying a native C extension and I experience a crash when I pass more than 14 arguments to rb_struct_define(...).
<quentin>
any idea ?
charliesome has quit [Quit: zzz]
psy_ has quit [Ping timeout: 250 seconds]
workmad3 has joined #ruby
mattarse has quit [Quit: Leaving]
psy_ has joined #ruby
DLSteve has quit [Read error: Connection reset by peer]
<Ox0dea>
I suspect that has something to do with it.
fgo has joined #ruby
<quentin>
yes probably!
oo_ has joined #ruby
amclain has quit [Quit: Leaving]
Musashi007 has quit [Client Quit]
<quentin>
or is it a limitation from ruby side, not able to call C function with more than 15 arguments
DEA7TH has joined #ruby
<Ox0dea>
quentin: As long as you're using a compiler from this century, that seems less likely.
Spami has quit [Quit: This computer has gone to sleep]
workmad3 has quit [Ping timeout: 276 seconds]
<shevy>
hehe
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
quentin I think the limit is higher, 15 is too low
<quentin>
i means the code that you point out looks like it is made to call C function from ruby
<ljarvis>
127 is the C limit iirc
<ljarvis>
(arguments to one function call)
<ljarvis>
or 256
lee-jon has joined #ruby
zudochkin has joined #ruby
krz has joined #ruby
_djbkd has quit [Quit: My people need me...]
lkba has quit [Ping timeout: 250 seconds]
fgo has quit [Ping timeout: 245 seconds]
<ddv>
anyknow how I can call unpack on a binary literal?
<DefV>
a/2
<ddv>
anyone*
sinkensabe has quit [Remote host closed the connection]
j4cknewt has quit [Remote host closed the connection]
naftilos76 has joined #ruby
t88m33s has joined #ruby
<zenspider>
binary literal? that doesn't make sense
Zai00 has joined #ruby
djbkd_ has joined #ruby
MatthewsFace has joined #ruby
<quentin>
so, I found the problem, as you know the last argument for rb_struct_create is supposed to be "NULL" (many people commenting about that online), but it only works with less than 15 arguments (I guess it is related to the number of registers available in x86-64). With more than 14 arguments, I have to pass (void*)0.
<ddv>
ah found it
<zenspider>
quentin: do you mean NULL or "NULL"?
<quentin>
NULL
<zenspider>
because NULL _is_ (void*)0
<quentin>
well, gcc disagrees with you zenspider
quazimodo has quit [Ping timeout: 250 seconds]
<quentin>
probably a way varargs are read and 0 is put onto the stack or registers
<quentin>
in fact when i use NULL, the segfault is on 0x007fff0000000
<Ox0dea>
quentin: gcc is not (and will likely never be) the cause of your troubles.
<zenspider>
quentin: don't think so
<zenspider>
running this through cc -E: void * x = NULL;
<zenspider>
results in: void * x = ((void *)0);
<zenspider>
<quentin>
no of course but the way varargs are put on the stack and red by the ruby api fucked something
<zenspider>
of course, Ox0dea beat me to it. tho, my output was from clang's cc. :)
<zenspider>
I'm a bit slow. Sorry Ox0dea
<Ox0dea>
zenspider: No worries.
<zenspider>
I've only ever found one bug in gcc (or any C compiler for that matter)
<zenspider>
but boy was it a doozy
et09 has joined #ruby
<zenspider>
caused one tiny c file to take ~20-30 minutes to compile because of a static initialization
<zenspider>
incredibly hard to hunt down and slowed us down for a very long time
CloCkWeRX has quit [Quit: Leaving.]
tesuji has joined #ruby
<Ox0dea>
What ended up being the overarching issue?
mattarse has joined #ruby
<Ox0dea>
That is, how did the initialization's being static so thoroughly confuse the compiler?
<zenspider>
something about the code it had to generate in order for the static initialization to occur. it was calling functions IN the initialization and something about load sequences meant that it had to be more complicated than normal function calls
<zenspider>
but... it was STATIC data, so I replaced it with a simple comment of what it was, and the perl code to generate the static data we needed (ctimes, iirc)
<zenspider>
boom, millisecond compile time again
<zenspider>
*shrug*
<zenspider>
that was a long time ago. sure it's been fixed by now
<Ox0dea>
Kudos to that compiler for (eventually) figuring out how to do it, though.
krisquigley has joined #ruby
<zenspider>
honestly, I'd rather it bomb out after 5 seconds so the build would fail and we would have caught it weeks earlier instead of wasting man hours on it
<zenspider>
exit 1 "nope... this is dumb"
* Ox0dea
would insert a joke about strength reduction if he knew anything about how compilers do their magic.
axl__ has joined #ruby
Xeago has joined #ruby
edwinvdgraaf has joined #ruby
Squarepy has joined #ruby
ringarin has joined #ruby
marr has joined #ruby
veinofstars has joined #ruby
veinofstars has quit [Client Quit]
<zenspider>
quentin: I think I'm gonna have to disagree with your assessment.
djbkd_ has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
<zenspider>
holy shit. there's a #one? now ?
sinkensabe has quit [Remote host closed the connection]
MatthewsFace has quit [Remote host closed the connection]
<quentin>
i guess that in fact ruby is taking my 0 pointer and try to access somewhere in a negative offset leading to that 0x0077ff... address where the segfault happens
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
<zenspider>
no
simplyianm has quit [Remote host closed the connection]
<zenspider>
and it doesn't have anything to do with the number of x86 registers either. stop blaming your tools before totally proving your code is 100% correct.
<zenspider>
Ox0dea: I like the idea. a lot.
<Ox0dea>
Awesome. :)
<Ox0dea>
I'm not sure my implementation is ideal, but it's the least "invasive".
<zenspider>
studying the patch
chussenot has joined #ruby
dg-ratiodata has quit [Remote host closed the connection]
dg-ratiodata has joined #ruby
<quentin>
zenspider: i'm blaming no tool, only the code using the tool, and i'm looking for the problem, if you don't want to be constructive fine but i don't need your sad mood.
kohgpat has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<zenspider>
Ox0dea: you can use refute(x) instead of assert(!x)
<zenspider>
style, really...
tkuchiki has joined #ruby
<zenspider>
quentin: sad mood? you might be projecting.
<Ox0dea>
zenspider: I tried to mimic the style of the surrounding code.
revath has quit [Ping timeout: 256 seconds]
<zenspider>
Ox0dea: absolutely... but some of that code is crufty :)
et09 has quit [Ping timeout: 264 seconds]
withnale_ has joined #ruby
<Ox0dea>
It is, but I didn't want to clutter what is already a big-ish patch.
<zenspider>
Ox0dea: I'm not entirely sure about the enum_* changes... but since you have tests... *shrug* seems good
<zenspider>
ok. I _don't_ like ENUMFUNC... but that might be unavoidable
chussenot has quit [Client Quit]
allomov has quit [Remote host closed the connection]
<Ox0dea>
Yep, that's the really questionable part of the patch.
mandarinkin has joined #ruby
<zenspider>
meh. they were already doing a double-hash macro... so whatever
kohgpat has quit [Client Quit]
<Ox0dea>
Ah, I thought you meant my modifying it to take a second argument.
dg-ratiodata has quit [Remote host closed the connection]
<Ox0dea>
I didn't see how else to different the one-argument case without making significant changes.
<Ox0dea>
*differentiate
dg-ratiodata has joined #ruby
<zenspider>
tada. commented on the issue
<Ox0dea>
That word does not like me right now.
lessless has joined #ruby
<Ox0dea>
Huzzah! Thanks for your vote. ^_^
<zenspider>
good luck with that patch! I hope they accept it
<zenspider>
course, prolly won't be released for a while even if it does... but hey... if you get a patch in, that's all that matters
Cust0sLim3n has quit [Ping timeout: 264 seconds]
<Ox0dea>
Yeah, it doesn't seem the kind of thing worth backporting, but it would be nice to have it in trunk.
<Ox0dea>
And, of course, 3.0.
senayar has joined #ruby
senayar has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
<Ox0dea>
I heard that's gonna have hygienic macros.
yaw has joined #ruby
iamninja has joined #ruby
last_staff has quit [Quit: last_staff]
Tempesta has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
<zenspider>
ok. one more shot of bourbon and then bed. 'ta
<Ox0dea>
[Enjoy] * 2, and thanks again.
Oog has joined #ruby
sinkensabe has joined #ruby
<Oog>
def foo; yield; end def bar; foo{yield}; end bar{puts 'hi') - anything wrong/odd with the foo {yield} ?
sinkensabe has quit [Remote host closed the connection]
<scx_>
How to add new line to string? I don't want to use 'str += "\n"' or Document here. I am looking for variable which is "\n" on UNIX and "\r\n" on Windows.
scx_ is now known as scx
workmad3 has joined #ruby
<Ox0dea>
scx: The $/ contains the system's default record separator.
railsraider has quit [Read error: Connection reset by peer]
ndrei has joined #ruby
edwinvdg_ has joined #ruby
zudochkin has joined #ruby
DEA7TH has quit [Ping timeout: 255 seconds]
railsraider has joined #ruby
DEA7TH has joined #ruby
camilasan has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
edwinvdgraaf has quit [Ping timeout: 264 seconds]
sandstrom has joined #ruby
zudochkin has quit [Remote host closed the connection]
skade has joined #ruby
hectortrope has joined #ruby
djellemah__ has joined #ruby
sgambino has joined #ruby
rbowlby has quit [Remote host closed the connection]
ahmetkapikiran has joined #ruby
auzty has quit [Quit: Leaving]
A205B064 has quit [Ping timeout: 245 seconds]
djellemah_ has quit [Ping timeout: 265 seconds]
krisquigley has quit [Read error: Connection reset by peer]
startupality has joined #ruby
Cust0sLim3n has quit [Ping timeout: 250 seconds]
jamespeach has joined #ruby
<jamespeach>
Has anyone here completed one of those coding bootcamps?
Makorak has quit [Ping timeout: 245 seconds]
<Ox0dea>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
krisquigley has joined #ruby
yoongkang has quit [Remote host closed the connection]
yoongkang has joined #ruby
rubie has joined #ruby
railsraider has quit [Read error: Connection reset by peer]
railsraider has joined #ruby
Makorak_ has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
dhjondoh has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<abyss>
apeiros: hey;) Regarding to the yesterday's script;) something like this: if ( line !~ /INSERT INTO.*)|UPDATE.*)|DELETE.*)/ ) should pass? I mean then it will check each line between INSERT INTO and ) or it doesn't work this way?
khebbie has joined #ruby
Oog has quit [Remote host closed the connection]
zz_Outlastsheep is now known as Outlastsheep
<abyss>
sorry if ( line =~ should be ofcourse
Cust0sLim3n has joined #ruby
Akagi201 has quit []
zudochkin has joined #ruby
sdothum has joined #ruby
sigurding has quit [Quit: sigurding]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
khebbie has joined #ruby
bluish has joined #ruby
oo_ has joined #ruby
bluish has quit [Remote host closed the connection]
dionysus69 has joined #ruby
air_ has joined #ruby
sinkensabe has joined #ruby
<air_>
how path are given in ruby?
Soda has quit [Remote host closed the connection]
railsraider has quit [Read error: Connection reset by peer]
<undeadaedra>
what path
<air_>
suppose i want to give path(ffi) to particular folder
dg-ratiodata has quit [Remote host closed the connection]
mattarse has quit [Remote host closed the connection]
dg-ratiodata has joined #ruby
railsraider has joined #ruby
Zai00 has quit [Quit: Zai00]
nofxx has quit [Ping timeout: 264 seconds]
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
strixd has joined #ruby
strixd has quit [Excess Flood]
sinkensabe has quit [Remote host closed the connection]
Siyfion has joined #ruby
strixd has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
renderfu_ has joined #ruby
mengu has joined #ruby
senayar has quit [Remote host closed the connection]
<Darkwater>
undeadaedra: what if I want the usage help text
<workmad3>
Darkwater: thankfully, all integers are properly representable in floats :P
<undeadaedra>
Darkwater: too long for IRC :)
<Darkwater>
workmad3: yeah
<sheeny>
thanks :)
<workmad3>
shame about things like 0.1 though :D
<Darkwater>
sidenote, for anyone having trouble understanding why floats are shit: imagine 0.3333333333
<Darkwater>
that's perfectly writable in base 3 as 0.1
<Darkwater>
0.5 is perfectly writable in base 2 as 0.1
commondream has joined #ruby
<Darkwater>
0.25 in base 2 is 0.01
<workmad3>
Darkwater: I always prefer to show the rational compared to the float/decimal notation personally... e.g. 1/3 rather than 0.33333...
<workmad3>
Darkwater: less confusion IMO
<undeadaedra>
yes, because 1/3 ≠ 0.33333
<Darkwater>
0.24 in base 2 is 0.0011110101110000101000111101etc
rodfersou has joined #ruby
LMity has joined #ruby
<Darkwater>
workmad3: yeah, but it's harder to work with 1/3 than with 0.33333 as a computer
<Darkwater>
also in my personal opinion
fgo has quit [Ping timeout: 256 seconds]
<workmad3>
Darkwater: yeah... but you're not dealing with a computer... you're explaining number representability to people :P
<Darkwater>
and also why computers can't handle numbers like 0.24 as floats usually
<workmad3>
Darkwater: and saying '0.5 is 0.1 in base 2' gets people going 'wuh, why are you showing me two different decimals and saying they're the same?' as you forgot to specify that 0.5 was in base10 decimal notation ;)
<Darkwater>
kind of
towski_ has joined #ruby
<Darkwater>
meh whatever
<Darkwater>
still asleep
Iskarlar has quit [Read error: Connection reset by peer]
Iskarlar has joined #ruby
tkuchiki has quit [Remote host closed the connection]
commondream has quit [Ping timeout: 276 seconds]
phutchins has joined #ruby
tkuchiki has joined #ruby
krisquigley has quit [Read error: Connection reset by peer]
krisquigley has joined #ruby
Ilyas has quit [Read error: Connection reset by peer]
mengu has joined #ruby
towski_ has quit [Ping timeout: 252 seconds]
lee-jon has quit [Ping timeout: 246 seconds]
lordkryss has joined #ruby
sigurding has quit [Quit: sigurding]
sheeny has quit [Quit: Page closed]
lee-jon has joined #ruby
commondream has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
LMity has quit [Ping timeout: 272 seconds]
Al3ks has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
jud has joined #ruby
jud has joined #ruby
<scx>
What i best way to use getters and setters in ruby?
allomov has quit [Ping timeout: 255 seconds]
haraoka has quit [Ping timeout: 256 seconds]
<scx>
should i use attr_reader, attr_writer if it is possible?
<scx>
(or attr_accessor)
<GarethAdams>
if the alternative is writing methods which do exactly the same thing, I don't see why you wouldn't use the shorthand
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sandstrom has quit [Quit: My computer has gone to sleep.]
<bnagy>
I don't tend to use attr_writer / accessor much because often you want to sanity check
krisquig_ has joined #ruby
<bnagy>
attr_reader yes, especially if you're writing def foo @foo end
sandstrom has joined #ruby
Outlastsheep is now known as zz_Outlastsheep
chinmay_dd has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has joined #ruby
francoi__ has quit [Remote host closed the connection]
lee-jon has left #ruby [#ruby]
sevenseacat has quit [Quit: Me dun like you no more.]
krisquigley has quit [Ping timeout: 264 seconds]
yoongkang has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
Iskarlar_ has joined #ruby
Iskarlar has quit [Read error: No route to host]
CamonZ has joined #ruby
yoongkang has joined #ruby
tkuchiki has quit [Remote host closed the connection]
fujimura has quit [Remote host closed the connection]
fujimura has joined #ruby
ton31337 has joined #ruby
tkuchiki has joined #ruby
<ton31337>
what's the best way to convert a = '1.1.1.1' to a = ['1.1.1.1'] ?
Igorshp has quit [Remote host closed the connection]
Iskarlar has joined #ruby
mcclurmc has joined #ruby
serivich has joined #ruby
naftilos76 has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 276 seconds]
senayar has quit [Remote host closed the connection]
GitGud has joined #ruby
carlosoliveira has joined #ruby
thelastinuit has joined #ruby
Igorshp has joined #ruby
barkerd427 is now known as zz_barkerd427
senayar has joined #ruby
mrgrieves has joined #ruby
railsraider has joined #ruby
francoi__ has joined #ruby
fantazo has joined #ruby
railsraider has quit [Client Quit]
chussenot has quit [Quit: chussenot]
s2013 has joined #ruby
<shevy>
anyone has a ruby script with ascii fun? like xmas ascii and such
dgutierrez1287 has quit [Remote host closed the connection]
migbar has joined #ruby
<mrgrieves>
hi, I have an array as follows ["packageA-version_1.blah", "packageA-version_2.blah", "packageB-version_3-blah", "packageB-version_7.blah"] , what can I do to remove entries from the array and only leave the entries for the latest version of each package?
Igorshp has quit [Remote host closed the connection]
<ljarvis>
mrgrieves: are the numbers only single digits?
chussenot has joined #ruby
houhoulis has joined #ruby
dg-ratiodata has quit [Ping timeout: 272 seconds]
* flughafen
wonders how long I have to be in this chat before shevy acknowledges me
<ddv>
ljarvis: because those methods return data I want to log and I don't want to write a lot of logger.info statements
chussenot has quit [Quit: chussenot]
<ljarvis>
ddv: that's what a delegator is for
<ddv>
ljarvis: cool do you have an example?
<mrgrieves>
and I would like to get ["nginx-1.8.0-1.el6.ngx.x86_64.rpm", "nginx-debuginfo-1.8.0-1.el6.ngx.x86_64.rpm", "hieradata_prod_6322.jax.rpm", "puppet_6322.jax.rpm"]
<yorickpeterse>
instance_variables.each { |ivar| send(ivar.to_s[1..-1]) if respond_to?(ivar.to_s[1..-1]) }
* yorickpeterse
runs
sigurding has quit [Quit: sigurding]
<ddv>
yorickpeterse: thanks
edwinvdgraaf has quit [Ping timeout: 255 seconds]
<yorickpeterse>
ddv: you really shouldn't use that though
<ruboto>
ljarvis # => ["nginx-1.8.0-1.el6.ngx.x86_64.rpm", "nginx-debuginfo-1.8.0-1.el6.ngx.x86_64.rpm", "hieradata_prod_6 ...check link for more (https://eval.in/384335)
<ruboto>
havenwood # => ["nginx-1.8.0-1.el6.ngx.x86_64.rpm", "nginx-debuginfo-1.8.0-1.el6.ngx.x86_64.rpm", "hieradata_prod_6 ...check link for more (https://eval.in/384336)
Igorshp has joined #ruby
<ljarvis>
psh
<havenwood>
ljarvis: pre2, rc1
<ljarvis>
why use partition if you're going to ignore the second result
<ljarvis>
havenwood: im using the example im given :D
codecop has quit [Remote host closed the connection]
<havenwood>
ljarvis: my defense remains lack of coffee
* apeiros
says: use a class for the packages
<havenwood>
i'm invincible!
<mrgrieves>
thanks you both !!!
<ljarvis>
havenwood: I've had 3 cups and I've used the same execuse 4 times in the past hour :(
<mrgrieves>
both invincible
<havenwood>
ljarvis: hehe
<mrgrieves>
gonna give this a try with a bigger sample
<ljarvis>
apeiros: aye I'd probably do that too
yeticry has quit [Ping timeout: 256 seconds]
athos_diddy has quit [Remote host closed the connection]
<linduxed>
pop quiz: what would you guys put after a percent literal like %w ?
<shevy>
(setq res (cons (car dirlist) res))
<shevy>
so beautiful
<shevy>
linduxed ()
<havenwood>
shevy: Matz mentioned merging Streem's concurrency into Ruby 3 as a possible third alternative to Actors or a more Rust-like transferring ownership.
<shevy>
just like in lisp
<canton7>
linduxed, {}, most of the time. maybe | if necessary
<ruboto>
Darkwater # => /tmp/execpad-b1b2edbde08b/source-b1b2edbde08b:2: unterminated string meets end of file ...check link for more (https://eval.in/384356)
<shevy>
fail!
<Darkwater>
bullshit
<Darkwater>
>> %w abc ;
<havenwood>
>> %w*splats splats!*
<ruboto>
Darkwater # => /tmp/execpad-9666161b7fcd/source-9666161b7fcd:2: unterminated string meets end of file ...check link for more (https://eval.in/384358)
tagrudev has quit [Remote host closed the connection]
k3asd` has joined #ruby
rafaelsales has joined #ruby
rafaelsales has quit [Client Quit]
rafaelsales has joined #ruby
haxrbyte_ has joined #ruby
<white_bear>
undeadaedra: cool, thanks!
peter_paule has joined #ruby
revath has quit [Ping timeout: 250 seconds]
newnews has joined #ruby
<newnews>
www.VALBOT.com provides domain valuations. Reporting globally on Site Traffic, Pagerank, Malware, WHOIS data, SEO & even Social Media presence.
<shevy>
linduxed hmm jhass wrote about this yesterday I think
micmus has joined #ruby
bronson has joined #ruby
<ljarvis>
linduxed: it's because Struct.new is special, so instead of creating 1 class and assigning it to Person it creates some superfluous class and inherits from it instead
<linduxed>
i don't have a log that goes that far back
jenrzzz has quit [Ping timeout: 265 seconds]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
<havenwood>
linduxed: Look at `Person.ancestors` for both cases.
<ljarvis>
yorickpeterse: really? you're comparing general to writing a damned xml parser? :D
<apeiros>
.rll?
<linduxed>
havenwood: oooh, that makes sense
<ljarvis>
ruby-ll
<mrgrieves>
how can I make this better? http://pastebin.com/VnU33GLZ the idea is that I have many packages with names that start with "hieradata_" i.e. "hieradata_integration_12.rpm", "hieradata_uat_15.rpm" & "hieradata_prod_15.rpm"
<ljarvis>
yorickpeterse: I would concede that in the case of doing insane things, it is ok to be insane
micmus has quit [Ping timeout: 264 seconds]
<yorickpeterse>
heh
bahar has joined #ruby
<white_bear>
also, still about concatenation, is there a way to make something like: "#{x}.#{y}" with .#{y} appended on condition? e.g., "#{x}#{.#{y} if <cond>}"
bronson has quit [Ping timeout: 276 seconds]
<mrgrieves>
shevy: cheers
<Ox0dea>
white_bear: "#{x}.#{y if cond}"
<ljarvis>
^ wrong
<Ox0dea>
You can interpolate any valid Ruby expression.
<undeadaedra>
Ox0dea: you have the point at any case here
* ljarvis
passes Ox0dea the period
durham has joined #ruby
<shevy>
ack
j_mcnally has quit [Client Quit]
<shevy>
it is beginning to look really ugly
<undeadaedra>
white_bear: cond ? "#{x}.#{y}" : x
wpp has quit [Quit: ZZZzzz…]
momomomomo has quit [Quit: momomomomo]
<yorickpeterse>
You need a StringBuilder for this
<ljarvis>
lol
<undeadaedra>
StringFactory
<ljarvis>
it's Ruby, every string is a stringbuilder
<ljarvis>
herp derp mutable state
tkuchiki has joined #ruby
<undeadaedra>
ljarvis: apparently white_bear has frozen strings
RandyT has quit [Read error: Connection reset by peer]
<yorickpeterse>
they must be cold
<shevy>
well, where do white bears live?
<Ox0dea>
Frozen strings can be thawed. :)
<yorickpeterse>
(get it, white bear?)
<shevy>
surely not in McDonalds
<yorickpeterse>
I'll see myself out
<undeadaedra>
yorickpeterse: HOHOHOHO
piet_ has joined #ruby
<shevy>
explaining a joke is a risky thing to do yorickpeterse!
davedev24_ has joined #ruby
commondream has quit [Remote host closed the connection]
<shevy>
they may end up laughing more about you rather than the joke
<yorickpeterse>
They do anyway
<shevy>
but you still get a laugh :P
<shevy>
haha
<ljarvis>
he's right
<ljarvis>
we do
<diegoviola>
how do I stay sane when I have to write php code? laravel?
<havenwood>
hmm, we should be able to #steam a String and have it become *really* mutable
Soda has quit [Remote host closed the connection]
<havenwood>
maybe mutate randomly
RandyT has joined #ruby
<undeadaedra>
diegoviola: you don't.
<yorickpeterse>
steam?
<ljarvis>
diegoviola: you stop writing php code
<white_bear>
yorickpeterse: nice one :D
aryaching has joined #ruby
<yorickpeterse>
oh shit, there's actually somebody called white_bear here?
<yorickpeterse>
haha, I didn't even see that
<havenwood>
yorickpeterse: when you heat water instead of cool it
<ljarvis>
lrntoirc
yqt has quit [Read error: Connection reset by peer]
<shevy>
diegoviola does the php syntax make you happy?
* undeadaedra
gives yorickpeterse glasses
<ljarvis>
lol havenwood
<diegoviola>
ljarvis: I'm not sure how I would do that, provided they only write php and JS code at this company
<diegoviola>
shevy: NO
<ljarvis>
it's a bit hilarious that you explained that
<ljarvis>
diegoviola: seems like that's easily solved
<yorickpeterse>
diegoviola: write a Ruby-to-PHP compiler
<diegoviola>
undeadaedra: good luck with that, everyone is doing PHP and JS here
<diegoviola>
ljarvis: how?
<shevy>
yorickpeterse you really did not see the white bear?
<durham>
Hi all is there a way to force clear all instances of an object? I have this: https://gist.github.com/anonymous/e544abbc34c6a57aaa72 which shows how i have it working using a class variable to store the objects but using ObjectSpace seems like a better alternative but im not sure how to clear these as they are getting built multiple times so my tests are failing
datanoise has joined #ruby
<shevy>
"INSTALL:"
<shevy>
"No."
<diegoviola>
guys help... I don't want to go back to PHP
<undeadaedra>
diegoviola: making a 3rd party tool that they now use and that I continue to develop.
<shevy>
diegoviola convince the company that ruby is better
uptownhr has joined #ruby
zach_ has joined #ruby
<yorickpeterse>
shevy: worse: tenderlove is actually submitting commits
<ljarvis>
durham: use your first example
<undeadaedra>
It doesn't mean I don't do PHP, but it is a nice escape
<shevy>
yorickpeterse lol
<shevy>
undeadaedra as long as php pays for the daily baguettes!
<undeadaedra>
shevy: fun fact: I rarely eat bread.
<diegoviola>
shevy: I don't think I will succeed, they like their own PHP ways
<ljarvis>
durham: why does using ObjectSpace seem better? because it's not
<yorickpeterse>
apparently it doesn't pay for enough baguettes then
<ljarvis>
durham: you want to mutate the list, you can't do that, so you need a mutable object
<shevy>
diegoviola well, that's the nature of evolution there - you need to outperform them with ruby so clearly that ruby wins
<shevy>
and if you fail
<shevy>
then ruby obviously sucks
<diegoviola>
shevy: they like using composer, but I don't think their code is very nice as my Ruby code
<yorickpeterse>
oh, that reminds me of something
<zach_>
I'm about to launch a gem that depends on a debian package. The default error when attempting to install the gem will lead 99% of ubuntu users to waste time figuring out which package to install. I know which package to install, but I do not know the idiomatic way of either A. doing this for the user. or B. telling the user which package to install.
<diegoviola>
shevy: they don't use any frameworks, etc
<durham>
ljarvis: ah okay, problem solved!
<durham>
ljarvis: thanks
<ljarvis>
durham: I would use a class instance variable instead of a class variable though :P
<diegoviola>
shevy: I've look at some of their code and it doesn't have any structure like most rails projects
<shevy>
zach_ you could display a message when someone tries to install the gem
<yorickpeterse>
and the .gifs
<shevy>
zack s.post_install_message = <<-EOF; Please keep in mind that bla bla bla; EOF
<diegoviola>
so how do I stay sane with this PHP crap?
<ljarvis>
diegoviola: please stop
jbisnett has joined #ruby
<hal_9000>
“How do I stay clean working in this stable?”
<ljarvis>
you've said it 100 times
<ljarvis>
it's now boring and other people are trying to ask Ruby questions
<Ox0dea>
You've been fed fit to bursting, troll, now back whence you come!
durham has quit [Quit: Page closed]
<white_bear>
undeadaedra: foo.include? ... ? ... : ... # the two "?" looks redundant, don't they?
<diegoviola>
ljarvis: why?
<zach_>
thanks shevy
<ljarvis>
diegoviola: because I asked you nicely?
<undeadaedra>
white_bear: they're not.
<diegoviola>
ljarvis: how about no?
<hal_9000>
white_bear: i see your point, but it’s unavoidable
zach_ has left #ruby [#ruby]
<ljarvis>
!kick diegoviola then please come back later
diegoviola was kicked from #ruby by ruboto [then please come back later]
aryaching has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby
<diegoviola>
ljarvis: that wasn't very nice of you
<ljarvis>
I asked you nicely
Sirrr has quit [Ping timeout: 265 seconds]
<ljarvis>
so, it's your choice
<diegoviola>
ljarvis: I'm not trolling or anything
<havenwood>
diegoviola: PHP is off-topic, but there's #ruby-offtopic so head that way and lets talk us some PHP!
<ljarvis>
I asked you to stop. Stop, or leave
<diegoviola>
I've started writing a rails project at this company that only uses PHP but then we have the problem of deploying my app, they only have a server that handles PHP
<undeadaedra>
yeah, go put some activity in the ot channel
<diegoviola>
havenwood: ok, he could have explained this but then he just tells me to stop
<Ox0dea>
Ruby has not one but *two* meanings for double question marks.
<diegoviola>
havenwood: I understand, I'll stop then
<diegoviola>
sorry
Spami has joined #ruby
allomov has quit [Remote host closed the connection]
<hal_9000>
Ox0dea: it’s better to space reasonably
<undeadaedra>
Ox0dea: wow, it took me some time to get this
<diegoviola>
ljarvis: sorry about that
<[k->
It took me some time too
<ljarvis>
diegoviola: no problem, thank you
<[k->
If you would add a bit more spaces
<diegoviola>
I'll ask the company if I can write the project with Rails
zudochkin has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
<diegoviola>
because I honestly don't feel like I will be ok writing PHP code, I can't, I haven't wrote a single line of PHP code in 8 years
<hal_9000>
[‘foo’.empty? ? 0 : 1, ??]
arooni-mobile has quit [Ping timeout: 256 seconds]
nobitanobi has joined #ruby
bkxd has quit [Ping timeout: 252 seconds]
<Ox0dea>
Get out of here with your syntactically invalid fancy quotes.
<[k->
[(‘foo’.empty? ? 0 : 1), ??]
tkuchiki has quit [Remote host closed the connection]
njs126 has joined #ruby
withnale_ has quit [Quit: Be back later ...]
<[k->
I just... noticed that
<white_bear>
i've got a warning about string literal in condition (used ternary operator), why that? i.e., foo = x.include? '.' ? x : "#{x}.#{y}"
<havenwood>
diegoviola: There really is a #ruby-offtopic and PHP really is on-topic there: /join #ruby-offtopic
<hal_9000>
ha, i did not intentionally use those — must be an annoying feature of Colloquy
<diegoviola>
ok
<hal_9000>
white_bear: precedence issue?
<[k->
It seems so
j_mcnally has joined #ruby
fabrice31_ has quit [Read error: No route to host]
<[k->
This is one case where Ruby does what you might not expect
<Ox0dea>
Parentheses are optional until they're not.
fabrice31 has joined #ruby
momomomomo has joined #ruby
<hal_9000>
no, they’re optional ;) you’re still required to say what you mean
<[k->
It probably evaluated '.' ? ... first
AlexRussia has quit [Quit: WeeChat 1.2-dev]
ahmetkapikiran has quit [Quit: ahmetkapikiran]
<Obfuscate>
That isn't a very intuitive binding order.
ogpastaling has joined #ruby
fabrice31 has quit [Remote host closed the connection]
<hal_9000>
this always bothered me a little: puts var unless (var = my_func()).nil?
<[k->
Nim may solve this issue
<hal_9000>
Obfuscate: agreed, but precedence is always a tradeff, and i think ruby does better than most languages
<[k->
With space sensitive binding
<[k->
Haskell does better in this respect imo
Igorshp has quit [Remote host closed the connection]
<white_bear>
fixed: foo = x.include?('.') ? x : "#{x}.#{y}"
aryaching has joined #ruby
<Obfuscate>
hal_9000: Well, it might be hard to change now. I can't think of many situations in which I'd prefer that particular behavior though.
senayar has quit []
<Obfuscate>
hal_9000: What happens with 'unless' there?
<hal_9000>
Obfuscate: true, i’m ust saying if you fix that, you will probably break something else
<hal_9000>
even though the Boolean is (would be) evaluated first, you get an error because var is undefined
nobitanobi has quit [Remote host closed the connection]
tkuchiki has joined #ruby
rafaelsales has joined #ruby
<hal_9000>
the nil? is not really relvant there, it could be any expr
AvidChronos has joined #ruby
mikecmpbll has quit [Ping timeout: 265 seconds]
AlexRussia has joined #ruby
yaw has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<[k->
I prefer if ! to unless
tkuchiki has joined #ruby
<Obfuscate>
hal_9000: Ah, okay. I've become rather used to the requirement to forward declare. That's rather common across languages.
shinnya has joined #ruby
<Ox0dea>
[k-: Vile heathen.
<[k->
unless always screws me up
eedham has joined #ruby
ongolk has joined #ruby
<[k->
if not nil reads better than unless nil
<Ox0dea>
Try again with a real example.
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
<[k->
:(
<phat4life>
rubocop tells me to use unless sometimes, i musst obey
<hal_9000>
well, if/unles is not relevant to the example — change it to if ! and it’s the same issue
nobitano_ has joined #ruby
<phat4life>
i don't like using unless
<[k->
(New issue) I feel that if ! is clearer tho
<eedham>
what would be a good way to hack into a linux game server
<hal_9000>
unless is confusing, true, esp. with an else
<bougyman>
i use unless only in suffix mode.
nisstyre has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
mahtennek has quit []
<hal_9000>
bougyman: i tend to do taht as well
<bougyman>
return :boo unless something
<bougyman>
that's my usual usage of it.
<eedham>
Is there any way to use the ruby scripting language to hack into routers and packet capture
<[k->
I think I'll avoid unless totally
<bougyman>
eedham: yes.
<hal_9000>
the point i was making is that a variable appearing first in a suffixed clause is not valid
<phat4life>
[k- do you use rubocop
<bougyman>
i'd recommend leveraging metasploit rather than writing it all yourself, though.
<eedham>
like if I have the username and password to say a Cisco gateway, Ubiquoss, Huawei, or other router, can you use ruby to be lik ethe ruby katana and view traffic there
<eedham>
oh ok
<[k->
Nope
davedev24_ has quit []
<[k->
That thing impedes my work!
wookiehangover has quit [Ping timeout: 256 seconds]
<bougyman>
it shouldn't
<eedham>
Runna ma nae, I'm GAY!
<bougyman>
you can tune it to your style.
<bougyman>
then it just enforces your own style on you.
snockerton has joined #ruby
<bougyman>
if that slows you down ....
<hal_9000>
i like to rebel against myself
<hal_9000>
j/k, j/k
<[k->
I declare that I have read the style guide as of 2013 and have followed convention for the most part
<phat4life>
i can't see whitespace
<Ox0dea>
phat4life: Get a better editor.
aryaching has quit [Ping timeout: 256 seconds]
<phat4life>
i mean from a philisophical standpoint
mister_solo has joined #ruby
<eedham>
i've noticed some japanese people coming here
<phat4life>
if i need like 10 extra spaces or returns imma use them
AndroidLoverInSF has joined #ruby
<bougyman>
trailing whitespace is asstastic
<eedham>
what's a good way to break into japanese servers
<bougyman>
might as well use tabs, too.
<havenwood>
!mute eedham
eedham has left #ruby [#ruby]
eedhem has joined #ruby
<eedhem>
sorry
veleno has quit [Ping timeout: 252 seconds]
<phat4life>
i just let rubocop yell at me
_blizzy_ has joined #ruby
<phat4life>
what i really need is one of those pavlok shock bracelets
<undeadaedra>
you can tweak it, you know
<eedhem>
could someone help me out with css and making a ruby script to format pages to provide optimal room
<bougyman>
it will learn from any current codebase.
<eedhem>
I'm making a ruby HTML generator
<bougyman>
and make a ruleset based on it.
<eedhem>
We I'm lest come.
<eedhem>
We chisisis of ling. Incream. Wit down execs. Vands fres. Squad. Withe chin' th Kortin't dream. Frease dos tos of Diviny! I'm liver. It's Fream, viol. Wit Korth goes. Destin life! Dee the of Son affly execs. Squad Sonic execs. I'm lis industriesting. Wortionic execs. Divater. Vandelayin' th gets frea! Man. It's Fresh, Playin th andelay, Mening getwork! Vandelay egs, Call over! Incream. It's of
<eedhem>
MandelayState drease doo dow we'll over, Call of Dee cook dreshneshmandelay. Vand Stayindelay bets fork! Mentos of living fre jets the jets oning jetterthis ony ing th Mentos baby, Mandelay. Vandelay bably me.
edwinvdg_ has quit [Remote host closed the connection]
<eedhem>
Thild full overting ching ter withim affliving probay it dow we'rease better! Wortin lindelaying the bette Lizard of Stay bets th goesh Meniesh goesh Mand of livatioling coo dow we'll over. Vand wit's oniesh Koread Stat moliat dos Fre andelay, bayStatiolisis. Sonie Lizard Squad withe doo doo! Increstries. Menie execs. It's th goesh goesh andelay eggs, ing jets of Diver ing. Freasy hackindelay
<jhass>
!mute eedhem
<eedhem>
RIUNNA MA NAE
<eedhem>
Nothe Lizard!
<eedhem>
ing jetworehe the It cre bayStaying. We cooleggs. It's fres.
<eedhem>
Nesh goes th goes. With goess.
<eedhem>
Thisies th a nown life! Mand Stay execs. Stay bets bably baby, is the a mestationy! As in't dress. WortindelayStay, Lizard we'reheas ing th goes th air, ving fres, bette on air, in life! Divertin't doo dithe him andelay hacking tentos of Des. Sony bably hattentos Fream, ing priestriesn't doo Nothe doest doo frehe egs, asy moleam. VandelayStento dithe dresh Mento your ind fream, Vionic lin andelay
nobitano_ has quit [Remote host closed the connection]
eedhem was kicked from #ruby by ljarvis [eedhem]
eedhem has joined #ruby
<eedhem>
po
<eedhem>
We bion air, andustin andelay bette hacking. Yo-ho-ho-ho-ho-hoh-ho-hoh-hoh! Diving fly baby, Call of liny ing. I'm affly industea's fres in the a molife! Squad Squad molesh as thild baby, thisis fres, Play mol. Wore Lizard Stattentos Fife! DDoS th Mentos the bay, a mesn' to Northe the th Man. Word me.
<eedhem>
Hand fortind with Mandelay. Withease hackin life!
<eedhem>
Nothe Lizard Sony moliatento drestriesh Mentos of Duty, Mandelay bay, Vandustento Northe It's full of Sony! Withe dool. I'm legs, besh, fres. Van. Dee afflin't coo you! Mandelay iny in the andelayin you! Mand mol. As on no doo freheasy bably in Diver.
<eedhem>
We'resh asies it's Fre easie eggs. Incress. Dee and moleggs, vion no does. Freasie hatioliver! MandelaySta
et09 has quit [Ping timeout: 250 seconds]
edwinvdgraaf has joined #ruby
* bougyman
mumbles about this never happened in -lang
eedhem has left #ruby [#ruby]
deeham has joined #ruby
<jbisnett>
Im linking in a different memory allocator. Ruby is created but it is failing some tests... does anyone else have experience with this?
<deeham>
that's cuz erlng sucks
francoi__ has quit []
wookiehangover has joined #ruby
nikhgupta has quit [Ping timeout: 245 seconds]
<shevy>
bougyman they get a kick out of annoying jhass here :)
mister_solo has quit [Ping timeout: 252 seconds]
AndroidLoverInSF has quit [Client Quit]
deeham has quit [Remote host closed the connection]
aryaching has joined #ruby
ZOMGITSABEAR has joined #ruby
icebourg has joined #ruby
edwinvdg_ has joined #ruby
icebourg has quit [Max SendQ exceeded]
icebourg has joined #ruby
ramfjord has joined #ruby
oo_ has joined #ruby
dorei has joined #ruby
capncrunch4me has joined #ruby
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edwinvdgraaf has quit [Ping timeout: 252 seconds]
<capncrunch4me>
how difficult is it to fork a gem and change the ruby namespace in it?
volty has joined #ruby
quimrstorres has joined #ruby
<undeadaedra>
depend on the gem
<capncrunch4me>
anyone interested in a bounty to fork one?
sarkyniin has quit [Quit: Quit]
<ljarvis>
400 rupies
<capncrunch4me>
pm if interested
<ljarvis>
capncrunch4me: why do you want to do this?
<capncrunch4me>
haha, funny you ask that
zudochkin has joined #ruby
<shevy>
capncrunch4me it is trivial, just grep through the source, then rebuild it
<ljarvis>
haha yeah
<undeadaedra>
ljarvis: 400 ZWL
<shevy>
if the main name is: module Foo, then replace Foo with Bar
<capncrunch4me>
so the Cassandra native gem and the legacy thrift gem share the same namespace
<shevy>
for most gems, the name should reflect the top namespace
<capncrunch4me>
hence you cant use them collectively in a project
<shevy>
that sucks
<capncrunch4me>
its stuipd
<ponga>
shevy can you give me short advice when to use module instead of class
<undeadaedra>
I already read this, but where?
<shevy>
who of them is the one that is not well-behaving
Squarepy has quit [Quit: Leaving]
<capncrunch4me>
the one sponsored by Datastax
<shevy>
ponga well, it depends. I think a module is great for the topnamespace
<shevy>
and whenever you need "include" and "extend"
<capncrunch4me>
in their infinite wisdon they decided to create the driver with the same namespace as a legacy driver (just bad practice)
<shevy>
inside that main module I usually have smaller classes
<shevy>
you can also fake your module :)
<shevy>
module Foo; def self.new
<shevy>
:D
diegoviola has quit [Ping timeout: 265 seconds]
<shevy>
and inside of that, instantiate your main class that resides as part of module Foo
<ponga>
i often tend to forget that module exists and only use class
<shevy>
capncrunch4me yes, you must rebuild the gem after you change it
<ponga>
i'd want to use module smartly
<shevy>
I also once suggested to the ruby core team to allow ad-hoc reshuffling of all namespaces freely
<capncrunch4me>
I wasnt kidding about the bounty ;)
michael_mbp has quit [Excess Flood]
<capncrunch4me>
bountry, bribe, whatever
<volty>
what could be «reshuffling of all namespaces» ?
<capncrunch4me>
gas money,
<Ox0dea>
capncrunch4me: Are the codebases so convoluted that a few standard Unix utilities won't cut it?
<undeadaedra>
bribe?
<undeadaedra>
*woop* *woop*
<undeadaedra>
it's the polis
<capncrunch4me>
see, i just needed to speak the proper language
<shevy>
volty for instance: module Foo; class Bar <--- say I want Bar to reside only in module Yippie instead
et09 has joined #ruby
<capncrunch4me>
Ox0dea: it should be easy
<capncrunch4me>
*should*
<shevy>
it would also solve capncrunch4me problem btw; you first require one namespace, assign it to another one, load the other gem, then re-assign to another top namespace
<shevy>
even though that is hackish... but better than having to rebuild the gem
<undeadaedra>
shevy: not if the gem refers to the namespace name directly
<volty>
ah, you meant moving definitions from one space to another, @shevy
<shevy>
undeadaedra how?
<shevy>
ah you mean hardcoded stuff, rather than def self.bla ?
<shevy>
I dunno, I always use def self
brettnem has joined #ruby
<undeadaedra>
module Foo; class A < ::Foo::B; ...
mandarinkin has quit [Ping timeout: 264 seconds]
michael_mbp has joined #ruby
<shevy>
well that is an example of suckage
<undeadaedra>
(I know, this one is stupid, I don't have short and not stupid examples)
<shevy>
:)
aryaching has quit [Ping timeout: 246 seconds]
<undeadaedra>
let's say
<shevy>
I also don't like that you need to know the name or the type
<undeadaedra>
module Foo; A = 1; module Bar; A = 2; Foo::A # to not take Foo::Bar::A; end; end
<shevy>
like "is it a module or is it a class" when I wish to extend it. I should not need to depend on that information
Igorshp has joined #ruby
<shevy>
wait
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
your example can be rewritten or?
heftig has quit [Quit: heftig]
<shevy>
the Foo::A part
<undeadaedra>
how would you write it?
<shevy>
we can refer to the top-namespace here right?
<undeadaedra>
jhass, you're so noisy.
<shevy>
lol
heftig has joined #ruby
<jhass>
I'll stop now
yoongkang has quit [Remote host closed the connection]
<shevy>
he wants to invite them back in the channel :)
<Darkwater>
jhass' birthday?
<undeadaedra>
shevy: you mean ::A ?
<undeadaedra>
Don't stop jhass now ♪
<shevy>
undeadaedra nono... isn't there a way to refer to the topnamespace, in a module, without using the name?
<undeadaedra>
'cause he's having such a good time ♪
techsethi has quit [Quit: techsethi]
<shevy>
something similar to def self.foo
<shevy>
but for constants and such
volty has quit [Quit: Konversation terminated!]
hubcaps has quit [Ping timeout: 264 seconds]
barkerd427 is now known as zz_barkerd427
<undeadaedra>
shevy: I don't know one.
<shevy>
hmm
<shevy>
I don't know one either
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
that surprises me
<brettnem>
seems like modules should refer to themselves with “self” instead of their own name, right?
mikecmpbll has joined #ruby
<brettnem>
is that a common rubyism?
<shevy>
will it work brettnem?
<shevy>
undeadaedra> module Foo; A = 1; module Bar; A = 2; Foo::A
shredding has quit [Remote host closed the connection]
<shevy>
undeadaedra> module Foo; A = 1; module Bar; A = 2; ::self::A
<shevy>
hmm
<shevy>
ok that one won't
<undeadaedra>
self is Foo::Bar
<shevy>
that's strange
<ponga>
shevy: what's your main project these days ser
<shevy>
perhaps I should suggest a way to obtain the namespaces, without having to depend on the given name
<shevy>
but I can't think of a good syntax
ndrei has joined #ruby
revath has quit [Ping timeout: 246 seconds]
<undeadaedra>
getting the class name, splitting on '::'
<undeadaedra>
that's heavy
aryaching has joined #ruby
<shevy>
ponga right now I rewrite my pipe-handling stuff from scratch. One day it shall allow me to be usable like virtualdub + avisynth but for objects of all kind, not only audio/video: here is syntax example from old avisynth, it was lovely: http://avisynth.nl/index.php/Script_examples
yaw has joined #ruby
<shevy>
add a logo: clip.Layer(logo, "add", 255, 582, 36, use_chroma=true)
charliesome has joined #ruby
<shevy>
I remember I captured video, and there was the logo from the TV channel. Then I used virtualdub + avisynth to blur out that logo; it was almost perfect, though the area was a bit blurry
<shevy>
(the logo part only, not the rest of the video)
<ponga>
what language is it written in? ruby?
yaw has quit [Max SendQ exceeded]
alex88 has quit []
langlands has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
flughafen_ has joined #ruby
<shevy>
undeadaedra ok but in that example, it is still hardcoded right? you still have the reference Foo as the top namespace
<undeadaedra>
where?
<Ox0dea>
shevy: Ruby does not have actual namespaces.
<shevy>
ponga that's the only language I know! I wish I could instantly know C so I don't have to learn it
Xeago has quit [Remote host closed the connection]
<shevy>
undeadaedra that one:
<shevy>
module Foo; A = 1; module Bar; A = 2; Foo::A
<ljarvis>
i pipe it straight into my head like the matrix
rbennace_ has quit [Remote host closed the connection]
<nietzschette>
there is indeed!
rbennacer has joined #ruby
davedev2_ has joined #ruby
dzejrou has quit [Read error: Connection reset by peer]
senayar has joined #ruby
senayar has joined #ruby
<MonkehParade>
Hello, I'm rather new to Ruby, and I'm trying to set everything up, but..
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
LMity has joined #ruby
uptownhr has joined #ruby
<MonkehParade>
when I install sass locally, I can't execute it. When I install it using sudo, I get an error.
peter_paule has quit [Ping timeout: 265 seconds]
<MonkehParade>
This happens to every other gem I install.
sigurding has quit [Quit: sigurding]
<MonkehParade>
My os is Ubuntu 12.04.
<MonkehParade>
Sorry If I sound like a total noob :/
<jhass>
it would be good to describe your error
<jhass>
that you get one is nice and all, but doesn't say much
RegulationD has quit [Remote host closed the connection]
decoponio has joined #ruby
<jhass>
MonkehParade: ^
davedev24_ has quit [Ping timeout: 265 seconds]
fantazo has joined #ruby
x1337807x has quit [Ping timeout: 245 seconds]
carlosgoce has joined #ruby
fabrice31 has joined #ruby
<jhass>
MonkehParade: are you going to detail your setup & the error you get?
<umgrosscol>
MonkehParade: what is the error returned by 'gem install sass' ?
kahuna_ has joined #ruby
ariutk has quit []
<umgrosscol>
MonkehParade: Use gist if it's an error longer than a couple of lines.
chussenot has quit [Quit: chussenot]
MonkehParade has quit [Ping timeout: 276 seconds]
mikecmpbll has joined #ruby
TechTonics has joined #ruby
fabrice31 has quit [Ping timeout: 276 seconds]
chinmay_dd has quit [Remote host closed the connection]
CorySimmons has quit [Quit: Bye!]
granthatcher has quit []
<nietzschette>
anyway, I know not many people use ruby sdl. I don't know why I still do. I have many tools for stenography and photomanipulation I wrote long ago, but when I attempt to move from ruby 1.9 to 2.1 and also upgrade the sdl library, everything loads and requires fine, I can create windows and surfaces, but when I start calling methods I get undefined errors. I look and the classes have SOME but not all of their usual methods. would thi
<nietzschette>
s be because the newer sdl library is incomplete or is there possibly something I overlooked when building ruby?
NeverDie has joined #ruby
c0m0 has quit [Ping timeout: 265 seconds]
<TechTonics>
is there a way in Ruby to determine if a block of code completed successfully or not?
sharpmachine has quit [Remote host closed the connection]
<jhass>
TechTonics: add code after it
<Spaceghostc2c>
TechTonics: Check the truthiness of the return?
kristoph has joined #ruby
<jhass>
if it's reached then yes, if not then not
<Spaceghostc2c>
You'll get an exception, something truthy, or something falsy.
<Spaceghostc2c>
exceptions are truthy too though.
<TechTonics>
is there an "errorlevel" equilant ?
zudochkin has quit [Remote host closed the connection]
Casty has joined #ruby
NeverDie has quit [Max SendQ exceeded]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duderonomy has quit [Ping timeout: 255 seconds]
<jhass>
TechTonics: like PHPs?
<meatchicken>
any idea how to generate a tournament/league schedule?
Xeago has joined #ruby
<meatchicken>
given an array of 16 team objects
<meatchicken>
I have no idea how to start
<jhass>
meatchicken: .shuffle.each_slice(2) ?
snockerton has quit [Quit: Leaving.]
snockerton has joined #ruby
rdark has quit [Quit: leaving]
snockerton has quit [Client Quit]
<meatchicken>
jhass, I guess I need to read up more about how schedules work
kp666_ has joined #ruby
Thr3d has quit [Quit: Thr3d]
zudochkin has joined #ruby
<jhass>
well or I do
<TechTonics>
jhass : like a batch file ..
<meatchicken>
that would just generate the first week wouldn't it..lol
NeverDie has joined #ruby
<jhass>
TechTonics: there's some stuff to turn up warnings but nothing really widely used, Ruby complains about the stuff you shouldn't do by default or simply doesn't provide them
revath has joined #ruby
neanderslob has quit [Ping timeout: 246 seconds]
<jhass>
meatchicken: what result would you expect for the second one?
snockerton has joined #ruby
<Ox0dea>
jhass: Teams tend not to play each other more than a handful of times in a given season.
sharpmachine has joined #ruby
<nietzschette>
Hmmm . . . . I used to be able to use the arrow keys in IRB, now I get ^[[* characters. what changed?
<ruboto>
havenwood # => ["parrots vs squirrels", "chickens vs llamas", "anteaters vs slugs"] (https://eval.in/384546)
<Spaceghostc2c>
nietzschette: Readline
<havenwood>
Who will win?!
<jhass>
nietzschette: terminal messed up? open a new one/call reset
<havenwood>
llamas are a strong favorite against chickens
<Spaceghostc2c>
havenwood: I'm much more llama-friendly.
Notte has joined #ruby
momomomomo has quit [Quit: momomomomo]
neanderslob has joined #ruby
<Spaceghostc2c>
havenwood: Would you ever spend some time being a nomad or being a part of a technical commune?
RobertBirnie has joined #ruby
<havenwood>
A nomadic technical commune, maybe.
<Spaceghostc2c>
havenwood: ohlawdy.
<Spaceghostc2c>
I was thinking of going one way or the other.
Thr3d has joined #ruby
<Spaceghostc2c>
"Why not both?" is a valid answer, I guess.
<havenwood>
Spaceghostc2c: Granted I don't know of any nomadic technical communes...
<Spaceghostc2c>
havenwood: Would you do either one?
<havenwood>
Sure, I'd consider either.
simplyianm has joined #ruby
eggoez has joined #ruby
zudochkin has quit [Remote host closed the connection]
dopie has quit [Quit: This computer has gone to sleep]
Exuma has quit [Quit: ZZZzzz…]
wallerdev has joined #ruby
dopie has joined #ruby
<miah>
tech communes, aka 'hacker spaces'
Vardan has joined #ruby
<Vardan>
hi all
piet has quit [Ping timeout: 272 seconds]
Exuma has joined #ruby
TechTonics has quit [Quit: Leaving]
bgmarx has quit [Remote host closed the connection]
ponga has joined #ruby
<havenwood>
Vardan: hi
<ponga>
havenwood: hi
<ponga>
can i ask a favour please
Igorshp has quit [Remote host closed the connection]
<havenwood>
ponga: sure
* Spaceghostc2c
asks havenwood a flavor
<ponga>
havenwood: im having issue with my irccloud functionality, can you call my nick again in 10 seconds please
<Spaceghostc2c>
miah: Whale, ones where you live on site.
codecop has joined #ruby
<Vardan>
people one question related with inheritance. I have class A where I have implemented initialize method, then I have created B class which extends A class. B class does not have any methods. When I do b = B.new it not call A initialize method. Is it ok?
<havenwood>
ponga: roger that
<Spaceghostc2c>
codecop: Are you like the thought police for code?
<ponga>
havenwood: ok please do so i will go background now
<Senjai>
Good morining ruby
<havenwood>
Senjai: g'mornin
RobertBi_ has joined #ruby
<havenwood>
ponga: is that ten seconds?
[k- has quit [Read error: No route to host]
RobertBirnie has quit [Ping timeout: 256 seconds]
piet has joined #ruby
bgmarx has joined #ruby
ruby-lang126 has joined #ruby
<ponga>
damn it my connection is so fucked up
<Vardan>
any answer for my questoin?
Channel6 has quit [Quit: Leaving]
haxrbyte has joined #ruby
<ponga>
havenwood: im on background but it thinks ive read it
<havenwood>
ponga: odd
<jhass>
ponga: use a sane client :P
last_staff has joined #ruby
<havenwood>
Vardan: When you extend one class from another you don't get a?: TypeError: wrong argument type Class (expected Module)
<jhass>
Vardan: it should, could you gist an example?
<havenwood>
Vardan: Show the code! :)
<ponga>
jhass: there is no sane client on ios
<ponga>
perhaps you could recommend me one
<jhass>
I try to stay away from apple products
shinnya has quit [Ping timeout: 276 seconds]
<havenwood>
ponga: How about LimeChat?
<ponga>
gud you are clever
<ponga>
sadly im not clever
<lala>
ponga: IRC client for iOS?
<ponga>
havenwood: thing is i can't stay connected more than 10mins on that, irccloud kinda cheats and allows me to stay upto 2hrs on free account
<ponga>
that's why im on irccloud
<phat4life>
lala: i use weechat
<nietzschette>
B and A should have the same initialize method
<Senjai>
phat4life: WEECHAT FO LIFE
<phat4life>
i even compiled weechat on os x
<phat4life>
that was fun
<jhass>
anyway, this makes an excellent topic for #ruby-offtopic!
<Senjai>
ponga: Just get weechat running on a digital ocean box in a tmux session
quimrstorres has quit [Remote host closed the connection]
<Senjai>
ponga: You can ssh in and reattach the screen whenever
<nietzschette>
anything put in A's initialization method will be in B's as well
<Senjai>
You're... ALWAYS CONNECTED
<phat4life>
or use znc
quimrstorres has joined #ruby
<Senjai>
Psht
<Senjai>
I dont even have weechat installed locally
<lala>
ponga: You can try Colloquy.
<Senjai>
I just keep it on DO
jphenow has quit [Quit: Be back later ...]
ruby-lang126 has quit [Ping timeout: 246 seconds]
LMity has quit [Ping timeout: 276 seconds]
<jhass>
seriously, you're burrying an active Ruby question currently
<Senjai>
sorry
bigkevmcd has quit [Quit: Outta here...]
<ponga>
lala: does it allow me to stay connected for a while?
mrsolo has quit [Quit: Connection closed for inactivity]
<jhass>
ponga: it's new :)
rjno has joined #ruby
<jhass>
Vardan: if you take out the < ApplicationController, add MainController.new.index and save that to file you'll see that your example does not reproduce the issue you describe
<jhass>
Vardan: I guess you're inside Rails and face a code reloading issue, make sure to restart your app (including spring)
<Vardan>
jhass: I'm stopping and starting server
<baweaver>
Also, you might consider #RubyOnRails
<baweaver>
Most of the same people are on here, yeah, but there are some uniques there that may be able to help more accurately with your issues.
<dfockler>
If you know some files/gems get required in your app loadpoint should you require them throughout the rest of your app?
rbowlby has joined #ruby
<Vardan>
restarting spring not helped
<baweaver>
dfockler: Normally it won't hurt to just frontload all of them
_djbkd has joined #ruby
<baweaver>
Then again this only works for smaller libraries / gems
<jhass>
Vardan: as said your example does not show the behavior you describe, guessing what the issue might be in your real code is very hard :/
<nietzschette>
yeah, it works when It's saved in a file and run in terminal
<baweaver>
larger apps can become a pain on that after a certain point, but one must consider Rails also frontloads.
<baweaver>
They get a nasty startup time from it as well, mind.
<dfockler>
ahh ok
<dfockler>
baweaver: something to think about, thanks
<Vardan>
by the way Test module and Document class are in gem
lkba_ has joined #ruby
<baweaver>
Once it starts it won't matter much
<dfockler>
sure
<dfockler>
it's a sinatra server so I'm not started it all the time
<dfockler>
s/started/starting
rbennacer has quit [Remote host closed the connection]
<baweaver>
Probably fine, but also remember that getting gem happy will cost you in blood as well
<dfockler>
hehe, it's mostly just local requires
<jhass>
Vardan: so you modified the gem to add `p "Hello"` ?
chussenot has joined #ruby
<baweaver>
The larger the app, the more skeptical you should be about including dependencies. I've seen cases with the phantomjs gem that has some spooky stuff behind the scenes
<Vardan>
yes
<Vardan>
ok, I think I got what you mean :)
lkba has quit [Ping timeout: 264 seconds]
<jhass>
Vardan: are you sure you modified it at the right file/version that's actually loaded?
<dfockler>
baweaver: that's understandable especially if you are only using a tiny amount of the code in the gem
<baweaver>
I am lazy as hell, and wanted to be able to install PhantomJS via Rubygems/Bundler when using poltergeist.
<ruboto>
Vardan, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<jhass>
^ can also help verifying such stuff
<baweaver>
Without looking into dependencies, one would never realize that that thing is included and does some odd junk. The proper solution is to brew install it or apt-get phantomjs
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TvL2386 has joined #ruby
freerobby has joined #ruby
blaines has joined #ruby
tfitts has quit [Ping timeout: 276 seconds]
ag4ve_ has quit [Ping timeout: 248 seconds]
jmhmccr has joined #ruby
RobertBi_ has quit [Ping timeout: 256 seconds]
blaines_ has joined #ruby
wldcordeiro_ has quit [Quit: Konversation terminated!]
aryaching has quit [Ping timeout: 276 seconds]
RobertBirnie has joined #ruby
jgpawletko is now known as jgpawletko_away
RobertBirnie has quit [Max SendQ exceeded]
commondream has joined #ruby
s2013 has joined #ruby
blaines has quit [Ping timeout: 245 seconds]
<Vardan>
ok, so the problem is that my Document class include Base module, when I'm trying to require my gem in pry it give me this: TypeError: wrong argument type Class (expected Module)
simplyianm has quit [Read error: Connection reset by peer]
DroidBur_ has quit [Remote host closed the connection]
DroidBur_ has joined #ruby
<TvL2386>
my guess would be not
<nietzschette>
I believe it is
<nietzschette>
as long as the hash is within scope
simplyianm has joined #ruby
<jhass>
TvL2386: there are many aspects to thread safety, though in MRI you won't be able to corrupt the actual datastructure with concurrent access without locking
kirun has joined #ruby
<jhass>
that doesn't mean all your uses of Hash are thread safe, just that you won't crash MRI
<jhass>
or get corrupted values
<phat4life>
you might be alble to make Hash thread safe is you used a mutex
<nietzschette>
would that be only for hashes or arrays or any object as well?
Thr3d has quit [Quit: WeeChat 1.0.1]
<jhass>
any datastructure provided with Ruby in MRI
rubie has joined #ruby
Thr3d has joined #ruby
<jhass>
note that on jruby and rubinius that's already a different story
d5sx43 has quit [Client Quit]
droidburgundy has quit [Ping timeout: 276 seconds]
<TvL2386>
hmmmmmmmmmmmmmm
<jhass>
what I mean by corrupting the datastructure is that things like that size says there are 5 items while only 4 are actually available yet
RobertBirnie has quit [Remote host closed the connection]
mrsolo has joined #ruby
RobertBirnie has joined #ruby
<jhass>
however it still can change between you asking its size and then doing something based on the result of that
bgmarx_ has joined #ruby
DroidBur_ has quit [Remote host closed the connection]
<jhass>
yes, ^ highlights where corruption could occur in other implementations and what level of thread safety MRI provides you
bgmarx has quit [Ping timeout: 246 seconds]
<jhass>
the concurrent setting of values in the hash or even concurrent access and setting of the same key can not corrupt the hash in MRI, while it can in other implementations
<jhass>
TvL2386: could you edit it and turn on syntax highlighting?
<TvL2386>
sometimes it prints errors, sometimes it goes well
<TvL2386>
jhass, will do
RobertBi_ has joined #ruby
RobertBirnie has quit [Read error: Connection reset by peer]
<TvL2386>
done! excuse me
momomomomo has joined #ruby
mcclurmc has joined #ruby
shadeslayer has quit [Ping timeout: 264 seconds]
lkba_ has quit [Ping timeout: 256 seconds]
<jhass>
"errors"?
jphenow has joined #ruby
tfitts has quit [Ping timeout: 276 seconds]
<TvL2386>
it prints the rescued exception
<jhass>
ah, okay I see a potential issue
shadeslayer has joined #ruby
<TvL2386>
Exception Waited 30 sec occurred in q.timed_pop() thread
<awer>
Hi, I have access to an ftp server of whcih has a set of files i want to pull back to my pc. #I woudl like to organise the files into their respective directories. Each file looks like this.. 2015-06-09-16.08-1006-1012-1433862516.6868.WAV i would like to mv each file to the correct directory based on the 6th column. in this case "1006" but only the "6th" column. I have tried to with .include? and with the foll
<awer>
owing example but havent quite managed to get it to work. Can anyone suggest any thing?
<TvL2386>
jhass, I ran this a lot of times with more threads and iterations with only using a TimedQueue, but when I put it in the Hash, sometimes the timed_pop() will raise a Timeout::Error
<jhass>
TvL2386: one thing I could imagine is the lazy initialization of the hash, like the pusher initiating the initialization, then it gets interrupted after creating the TimedQueue but before the assignment
sharpmachine has quit [Remote host closed the connection]
chussenot has joined #ruby
<jhass>
TvL2386: the poller triggers it again, gets interrupted at the same point, the pusher sets it value, then pushes, then the pollers initialization continues and overwrites the value
RobertBi_ has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby
tfitts has joined #ruby
<TvL2386>
jhass, yeah that's kinda what I think as well
RobertBirnie has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
dmolina has quit [Quit: Leaving.]
commondream has quit [Remote host closed the connection]
andikr has joined #ruby
<jhass>
TvL2386: simple to try out, don't make it lazy
jphenow has quit [Client Quit]
endash has quit [Quit: endash]
sharpmachine has joined #ruby
lkba has joined #ruby
<jhass>
TvL2386: fully initialize the hash prior starting the first thread
droidburgundy has joined #ruby
<TvL2386>
jhass, I would like that, but I don't have control over the keys of the hash in my design
<TvL2386>
jhass, of course the design can be changed ;-)
RobertBi_ has joined #ruby
jphenow has joined #ruby
hahuang65 has joined #ruby
x44x45x41x4E has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
<jhass>
well, or you put a common lock over access & initialization
senayar has quit [Remote host closed the connection]
RegulationD has quit [Read error: Connection reset by peer]
<Senjai>
^^ That's the one
<baweaver>
I'm actually working with them to get more documentation up
AndroidLoverInSF has quit [Quit: This computer has gone to sleep]
RegulationD has joined #ruby
<baweaver>
mainly because I'm a tinge sick of waiting for it, I just decided to write it.
Musashi007 has joined #ruby
<BanzaiJoe>
baweaver I was talking to a googler and he said you can tell the ones that come from JAVA because of the "constant premature abstraction", I tried to keep a straight face
<Senjai>
BanzaiJoe: lolol
<Senjai>
BanzaiJoe: TBH, I really want an abstract class thing in ruby
<Senjai>
That forces methods to be templates.
atomical has joined #ruby
<baweaver>
raise exceptions
<baweaver>
done
<Senjai>
I do
revath has quit [Quit: Leaving.]
<Senjai>
But I still want an abstract class
<Senjai>
To define a clear and easy interface, and yes I know you can use modules
Ruinside has quit [Remote host closed the connection]
<crankharder>
irb(main):039:0> "\xE6".split("\n")
<crankharder>
ArgumentError: invalid byte sequence in UTF-8
<Senjai>
lol
<Senjai>
\xE6 is treated as \xE6
<crankharder>
some stupid character in a CSV, so the doc can't be loaded
<Senjai>
as a string
momomomomo has quit [Ping timeout: 245 seconds]
<Senjai>
parse them out
<Senjai>
"\xE6".split("\xE6")
ramfjord_ has joined #ruby
<Senjai>
>> "\xE6".split("\xE6")
<ruboto>
Senjai # => invalid multibyte character: /\xE6/ (RegexpError) ...check link for more (https://eval.in/384584)
kahuna_ has joined #ruby
m8 has joined #ruby
<Senjai>
when in doubt, just substitute thme all for \n. Someone else might have a better solution
<Senjai>
I dont pretend to be good at encodings
<crankharder>
that works if it's not some character in the middle of a word
<Senjai>
I would just use sed
<crankharder>
neither do i :)
ramfjord has quit [Ping timeout: 252 seconds]
bgmarx_ has quit [Remote host closed the connection]
neanderslob_ has joined #ruby
postmodern has quit [Quit: Leaving]
neanderslob has quit [Ping timeout: 264 seconds]
solars has quit [Ping timeout: 245 seconds]
<shevy>
let's be all honest
<shevy>
encodings are boring and suck!
<Senjai>
I know a guy who does mailserver related things. He's in encoding land all day
cabreraM516 has joined #ruby
<shevy>
poor guy
<Senjai>
He doesnt mind it
<shevy>
a year ago I had a coworker who was using some perl client to read his email, in ncurses
<Senjai>
Encodings are crappy until you understand everything perfectly
<shevy>
he was like lightning fast
cabreraM516 has quit [Client Quit]
baweaver has joined #ruby
<shevy>
is he writing in an exotic language like cyrilic
momomomomo has joined #ruby
tejasmanohar has quit [Ping timeout: 256 seconds]
balazs has joined #ruby
t_ has joined #ruby
casadei has quit [Remote host closed the connection]
RobertBi_ has quit [Ping timeout: 252 seconds]
cabreraM516 has joined #ruby
frem has joined #ruby
nietzschette has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
piet has quit [Quit: leaving]
haxrbyte_ has joined #ruby
yqt has joined #ruby
hcnewsom has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
Me1k0r has joined #ruby
AndroidLoverInSF has joined #ruby
wildroman2 has quit [Remote host closed the connection]
haxrbyte has quit [Ping timeout: 276 seconds]
chinmay_dd has quit [Remote host closed the connection]
casadei has joined #ruby
avalon has joined #ruby
bosma_ is now known as bosma
balazs has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
MatthewsFace has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
MatthewsFace has joined #ruby
workmad3 has joined #ruby
MatthewsFace has quit [Remote host closed the connection]
vdamewood has joined #ruby
dgutierrez1287 has quit [Ping timeout: 252 seconds]
workmad3 has quit [Ping timeout: 256 seconds]
last_staff has joined #ruby
kadoppe has quit [Ping timeout: 264 seconds]
dopie has quit [Quit: This computer has gone to sleep]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dopie has joined #ruby
AndroidLoverInSF has quit [Ping timeout: 250 seconds]
k3asd` has joined #ruby
freerobby has quit [Quit: Leaving.]
_blizzy_ has quit [Ping timeout: 265 seconds]
kadoppe has joined #ruby
momomomomo has quit [Ping timeout: 244 seconds]
bungoman has quit [Remote host closed the connection]
AndroidLoverInSF has joined #ruby
rbennace_ has joined #ruby
icarus has joined #ruby
rbennacer has quit [Ping timeout: 264 seconds]
gambl0re has quit [Ping timeout: 272 seconds]
hashpuppy has joined #ruby
sharpmachine has quit [Remote host closed the connection]
jphenow has quit [Quit: Be back later ...]
peter_paule has joined #ruby
hashpuppy has left #ruby [#ruby]
jphenow has joined #ruby
rbennace_ has quit [Remote host closed the connection]
rbennacer has joined #ruby
ebalsumgo has joined #ruby
yaw has joined #ruby
nietzschette has quit [Ping timeout: 265 seconds]
<ebalsumgo>
i have an array, each element is a string "somename:somedata" i am trying to iterate over all the elemts, then split the string into two variables
Makorak_ has quit [Remote host closed the connection]
<ebalsumgo>
all of this in an ERB template
Igorshp has joined #ruby
yaw has left #ruby [#ruby]
AndroidLoverInSF has quit [Quit: This computer has gone to sleep]
blackmesa has joined #ruby
<ebalsumgo>
and i keep going in circles it seems… this is the code i have now http://pastebin.com/UXA6iYcC and it ends up producing : instead of the actual data i thought it should
<ebalsumgo>
so gear_to_idle should contain the current item of the array
<Mon_Ouie>
Anyway split(':') returns an array. When you assign an array to a list of comma separated values, it extracts the contents of the array and puts each element in the corresponding variable, as shown above ^
<ebalsumgo>
as split out of the array item (which is what gear_to_idle should contain)
k3asd` has quit [Ping timeout: 265 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ebalsumgo>
the input array looks something like this: ['boris1:53ed267142d9f5d88c000017:small','boris2:543d70aad5c665103000002a:small','boris2:53f2c919d5c665d14b00005c:small','boris4:546f866cd5c665f621000428:small']
<elektronaut>
right
<ebalsumgo>
guess gonna test it and see
k3asd` has joined #ruby
<ebalsumgo>
thank you
<jbisnett>
does the ruby interpreter use parallel execution?
bohallor has joined #ruby
duderonomy has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dopie has quit [Quit: This computer has gone to sleep]
<ebalsumgo>
well that almost worked
<ebalsumgo>
just didnt end up with a \N
<ebalsumgo>
\n
<ebalsumgo>
ah derp… i am no longer joining
baweaver has quit [Remote host closed the connection]
dfockler has quit [Remote host closed the connection]
dopie has joined #ruby
segfalt has quit [Quit: segfalt]
dfockler has joined #ruby
baweaver has joined #ruby
startupality has quit [Quit: startupality]
<atmosx>
ywan
<ebalsumgo>
well… ok how do i add just a newline in erb lol
<havenwood>
jbisnett: The reference implementation has a GVL that prevents parallel execution of some things. You can run multiple Ruby processes for parallel execution or use an implementation like JRuby or Rubinius that has no GVL.
<shevy>
faster tea, faster movie, faster life, faster death
Xoro has joined #ruby
jgpawletko has joined #ruby
rbennacer has quit [Remote host closed the connection]
momomomomo_ has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
<atmosx>
also relevant to the conversation: Incremental GC algorithm splits a GC execution process into several fine-grained processes and interleaves GC processes and Ruby processes.
rbennacer has joined #ruby
commondream has quit [Remote host closed the connection]
rjno has quit [Remote host closed the connection]
Oog has quit [Ping timeout: 245 seconds]
<atmosx>
shevy: no, fasting is said to decreease the release of IGF-I hormone, which induces aging.. so you age slower :-P
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
felixjet has quit [Read error: Connection reset by peer]
startupality has joined #ruby
momomomomo has quit [Ping timeout: 272 seconds]
momomomomo_ is now known as momomomomo
dopie has joined #ruby
felixjet has joined #ruby
Rapier- has quit [Quit: (null)]
roger_rabbit has quit [Ping timeout: 255 seconds]
Yiota has joined #ruby
phutchins has joined #ruby
commondream has quit [Ping timeout: 272 seconds]
k3asd` has quit [Ping timeout: 265 seconds]
zendrix has joined #ruby
peter_paule has quit [Ping timeout: 272 seconds]
jbisnett has quit [Ping timeout: 246 seconds]
eggoez has joined #ruby
konieczkow has quit [Ping timeout: 256 seconds]
bruno-_ has quit [Quit: Lost terminal]
k3asd` has joined #ruby
Beoran has joined #ruby
Xoro has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
benlieb has joined #ruby
<kb3ien>
trying to copy an rb file from /usr/local/lib/ruby/gems/2.0.0/gems/ebsco-discovery-service-api-1.0.4/lib/ebsco-discovery-service-api.rb to a local copy, using path in my Gemfile, but its not working, advice ?
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
sharpmachine has joined #ruby
__butch__ has joined #ruby
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rodfersou has quit [Quit: leaving]
rodfersou has joined #ruby
rodfersou has quit [Client Quit]
rjno has joined #ruby
swgillespie has joined #ruby
<atmosx>
kb3ien: show the code on github
edwinvdg_ has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
shum has joined #ruby
sdothum has quit [Read error: Connection reset by peer]
Exuma has joined #ruby
edwinvdgraaf has joined #ruby
<atmosx>
kb3ien: also show he error... might be the path or permissions, maybe both. Why would you wanna do that is beyond me too but anyway.
Exuma has quit [Client Quit]
<kb3ien>
The default code is unwilling to abide by HTTP_PROXY ?
mdih has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
benegget_ has joined #ruby
<atmosx>
that's your error?!
weszlem has joined #ruby
shum has quit [Read error: Connection reset by peer]
Xoro has joined #ruby
sdothum has joined #ruby
davedev24_ has joined #ruby
zudochkin has quit [Remote host closed the connection]
<volty>
is there a ruby parser that preserves formatting information ?
simplyianm has quit [Remote host closed the connection]
<atmosx>
kb3ien: you sur eyou're requiring the correct set of libraries in that file?
mdw has quit [Client Quit]
chussenot has quit [Quit: chussenot]
<atmosx>
I don't see something like 'ruby_eds'
<volty>
s/information//
<kb3ien>
Well it works FINE until I copy the file into a local dir, and make a some change. How should I try to do that?
<atmosx>
kb3ien: what file? what are you trying to do? Ruby is an interpreted language, if your code doesn't test EDSApi somehow it will fail when it's called...
Tamae has joined #ruby
<kb3ien>
Well I just trying to make changes in the file "/usr/local/lib/ruby/gems/2.0.0/gems/ebsco-discovery-service-api-1.0.4/lib/ebsco-discovery-service-api.rb" for one app only.
chussenot has joined #ruby
simplyianm has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
diegoviola has quit [Quit: WeeChat 1.2]
<kb3ien>
I don't want to make changes that affect other apps.
wildroman2 has quit [Remote host closed the connection]
micmus has joined #ruby
adac has joined #ruby
<atmosx>
kb3ien: I don't know the design of this gem/app... You're trying to make a change in the gem library that will affect only one application but not others?
gianlucadv has quit [Ping timeout: 264 seconds]
granthatcher has joined #ruby
granthatcher has quit [Max SendQ exceeded]
bungoman has joined #ruby
<adac>
Is it possible to run an each 'loop' in parallel?
Stany has quit [Ping timeout: 252 seconds]
granthatcher has joined #ruby
baweaver has quit [Remote host closed the connection]
Stany has joined #ruby
zotherstupidguy has quit [Ping timeout: 276 seconds]
razrunelord has joined #ruby
tejasmanohar has left #ruby ["WeeChat 1.1.1"]
eggoez has joined #ruby
<volty>
of course — with threads
FernandoBasso has joined #ruby
<atmosx>
adac: threads? file.each {|f| r = Thread.new do; {whatever};end;end
lkba_ has joined #ruby
<kb3ien>
atmosx that sounds about right.
<adac>
volty, atmosx thanks!
<atmosx>
kb3ien: I see.
Tamae has quit [Ping timeout: 265 seconds]
<volty>
adac: but, sorry, what are you expected to gain doing parallel loops on distinct sources ?
<volty>
s/expected/expecting/
_blizzy_ has joined #ruby
<kb3ien>
Net::HTTP won't honour http_proxy i'm trying recode that file.
<adac>
volty, not so sure, just playing around a bit. Want to fetch things in parallel from the web
<kb3ien>
well, won't honour it RELIABLY. sometimes it did, sometimes it didn't.
lkba has quit [Ping timeout: 264 seconds]
<atmosx>
kb3ien: then write an exception and log the errors?
<kb3ien>
How would I generally get a working local copy ? gem "ebsco-discovery-service-api", "1.0.4" , :path => '/var/www/local_gems/ebsco-discovery-service-api-1.0.4/lib/' fails, but when the path is ommited it works fine.
piet has joined #ruby
hinbody has joined #ruby
<kb3ien>
The OS can hijack TCP on a per uid basis, but I'd rather not.
lampd1 has quit [Read error: Connection reset by peer]
<Rashad>
Hello. Does Ruby support heterogeneous lists?
<Aria>
Yes.
<Rashad>
Did it support it back in 2006?
Stany has quit [Ping timeout: 255 seconds]
<volty>
my question about a ruby parser preserving formatting was very very stupid. Ripper (for example) does it since it registers the position of the found tokens. (so everything between is the original whitespace)
<volty>
(just forgot, I use ripper for syntax highlighting)
<Aria>
Rashad: Yes.
<Rashad>
Thanks Aria.
<Aria>
Rashad: It's dynamically typed -- variables and containers have never cared what is in them.
workmad3 has joined #ruby
razrunelord has quit [Remote host closed the connection]
<Rashad>
Alright.
Yiota has joined #ruby
bgmarx has quit [Remote host closed the connection]
rjno has quit []
nateberkopec has quit [Quit: Leaving...]
paulcsmith has quit [Quit: Be back later ...]
<momomomomo>
everything is an object
yaw has joined #ruby
cabreraM516 has joined #ruby
micmus has joined #ruby
veduardo has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
<volty>
>> a=[]; p a.push *[1,a,:sym, "hi"
<ruboto>
volty # => /tmp/execpad-b01a8af34a69/source-b01a8af34a69:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/384603)