<quuxman>
ah yes you can, it's a Partial Double. Ok, my next question is if you use `allow(Foo::Logger).to receive(:msg)` does that method revert to the original at the end of the test?
konsolebox has quit [Ping timeout: 255 seconds]
duderonomy has joined #ruby
<quuxman>
I mean if Foo::Logger.msg is already defined, does msg have the original definition after the test
sanscoeur has quit [Ping timeout: 260 seconds]
caoraivoso has quit [Quit: WeeChat 2.1]
konsolebox has joined #ruby
AJA4350 has joined #ruby
AJA4350 has quit [Remote host closed the connection]
rivalomega has quit []
memo1 has joined #ruby
erlend has quit [Ping timeout: 260 seconds]
ryzokuken has joined #ruby
erlend has joined #ruby
arescorpio has joined #ruby
mroutis has quit [Ping timeout: 276 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
vikaton has joined #ruby
minimalism has joined #ruby
Yxhuvud has joined #ruby
lelliott has quit [Remote host closed the connection]
lelliott has joined #ruby
<quuxman>
apparently yes
anisha has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
despai has quit [Quit: ...]
x0f has quit [Ping timeout: 255 seconds]
karapetyan has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
ledestin has joined #ruby
x0f has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
gizmore has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
iMadper has quit [Remote host closed the connection]
Yxhuvud has joined #ruby
gizmore|2 has quit [Ping timeout: 265 seconds]
cyberg has quit [Remote host closed the connection]
mikeiniowa has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 240 seconds]
tolerablyjake has joined #ruby
Creatornator has quit [Ping timeout: 245 seconds]
noobineer has quit [Remote host closed the connection]
n0m4d1c has joined #ruby
cschneid_ has joined #ruby
s2013 has joined #ruby
mikhael_keehl has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<mikhael_keehl>
What's the best gem of generating email reports?
ogres has joined #ruby
Yxhuvud has joined #ruby
<havenwood>
mikhael_keehl: You want more than a regular email-sending library? What're the reports about?
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Miron has quit [Ping timeout: 265 seconds]
noobineer has joined #ruby
<mikhael_keehl>
havenwood: I have a ruby script/app that runs rsync for every mirror 3-times a day. I want to get a weekly report of what rsync failed, and its error.
<havenwood>
mikhael_keehl: It sounds like the mail or pony gems would do the trick.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mikhael_keehl>
ruby-toolbox, hey teach a man how to fish, hehe ;)
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
dinfuehr has quit [Ping timeout: 264 seconds]
Yxhuvud has joined #ruby
cschneid_ has quit [Remote host closed the connection]
Xiti` has quit [Quit: Xiti`]
cschneid_ has joined #ruby
dinfuehr has joined #ruby
alfiemax has joined #ruby
herbmillerjr has joined #ruby
Xiti has joined #ruby
RougeR has quit [Ping timeout: 276 seconds]
cschneid_ has quit [Remote host closed the connection]
sspreitz has quit [Ping timeout: 256 seconds]
sspreitz has joined #ruby
<memo1>
hi, im running a script wih a ffmpeg (bash), but this command blocks other execution lines. How i run concurrently other lines of codes?, right now im using exec() and system() with no luck
cschneid_ has joined #ruby
arescorpio has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
lelliott has quit [Remote host closed the connection]
shtirlic has quit [Ping timeout: 256 seconds]
mikhael_keehl has quit [Ping timeout: 260 seconds]
drale2k has quit [Ping timeout: 256 seconds]
tacoboy has quit [Remote host closed the connection]
tacoboy has joined #ruby
gremax has quit [Ping timeout: 256 seconds]
drale2k has joined #ruby
shtirlic has joined #ruby
JankyDoodle has quit []
gremax has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
n0m4d1c_ has joined #ruby
workmad3 has joined #ruby
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix- has quit [Ping timeout: 255 seconds]
n0m4d1c has quit [Ping timeout: 240 seconds]
n0m4d1c_ has quit [Ping timeout: 265 seconds]
gix has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<Bish>
dmarcoux: yesterday you said mutability is cool for the sake of performance, but i can't possible write code with mutation that is faster than immutable one :o (atleast if it's threaded)
<Bish>
dminuoso: *
<Bish>
i just rewrote a huge ass mutex overloaded code, and it's so much faster!
<apeiros>
Bish: aka "I can write shit code in any language"
alfiemax has quit [Remote host closed the connection]
<Bish>
apeiros: true, but i am wondering.. how i would make better performance with mutability
alfiemax has joined #ruby
<Bish>
if it's multithreaded
uptime is now known as downtime
<Bish>
mutex seem so costly especially in ruby
<apeiros>
avoid shared mutable state
<Bish>
so avoid mutexes
<apeiros>
yes, a consequence of not having shared mutable state is that you need less mutexes.
<Bish>
so that's what i said
<apeiros>
not if we're pedantic.
ldnunes has joined #ruby
<apeiros>
(though I'd even argue that it's not really pedantic)
<Bish>
yep
erlend has quit [Ping timeout: 240 seconds]
<apeiros>
as for "mutability has performance benefits" - copying large datastructures on changes can be expensive. "just" replacing a part of it in place can be much cheaper.
alfiemax has quit [Ping timeout: 240 seconds]
adlerdias has joined #ruby
<Bish>
are there places where you have to have shared mutable state?
erlend has joined #ruby
<apeiros>
the world is shared mutable state
cadillac_ has quit [Ping timeout: 240 seconds]
KeyJoo has joined #ruby
depesz has joined #ruby
<Bish>
now it's getting philosophical
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amar has quit [Remote host closed the connection]
<apeiros>
common place for shared mutable state: IO, the database
cadillac_ has joined #ruby
<apeiros>
you can go from abstract to concrete. think about the interactions of your application with the world and you can see where shared mutable state permeates into your application.
amar has joined #ruby
mtkd has quit [Ping timeout: 264 seconds]
karapetyan has quit [Remote host closed the connection]
KeyJoo has quit [Remote host closed the connection]
mtkd has joined #ruby
claudiuinberlin has quit [Ping timeout: 264 seconds]
sidx64 has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
jeffreylevesque has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
cadillac_ has quit [Ping timeout: 265 seconds]
cadillac_ has joined #ruby
alfiemax has joined #ruby
masterasia has quit [Ping timeout: 256 seconds]
hkais has joined #ruby
karapetyan has quit [Remote host closed the connection]
Beams has quit [Quit: .]
masterasia has joined #ruby
inerthia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amar has quit [Remote host closed the connection]
byte512 has joined #ruby
<depesz>
hi. i have a class, that internally defines module. I'd like to make new class that has *some* of the methods from the module replaced by new code.
<depesz>
how can I go about it?
Beams has joined #ruby
<apeiros>
depesz: how did you add the methods of that module to your new class?
<apeiros>
"I'd like to make a new class" - that says *your* class, *you* made it. no?
<depesz>
internally it has class PgQuery, and in there there is Deparse module. I'd like to make na new class (PgQuery2), which inherits PgQuery, but overwrites some of the methods in Deparse module in it.
<depesz>
apeiros: base class/module is not mine. the new one is mine, but Deparse methods seem to be called from parent class (PgQuery), and not my overwrite ...
<apeiros>
ok, first things first:
<apeiros>
do not inherit from classes you don't own
<depesz>
why? copying the whole code doesn't make much sense.
<apeiros>
copying the code isn't the only alternative
<depesz>
i need to deparse sql query, but in nicer way. adding indentation, and other "things"
<apeiros>
the common approach is to compose. i.e. your class contains an instance of that class.
<depesz>
deparse code is there, i just need to modify *some* methods of the class.
<apeiros>
anyway, re your original question: if you inherit, all you have to do to have some methods replaced with your own is to define them
<depesz>
apeiros: well, then I would have to copy the whole deparse module, which is pretty long.
<depesz>
apeiros: well, doesn't seem to be the case.
<depesz>
moment, let me show some simple example
<apeiros>
I'm not quite sure what leap you do to get to that conclusion ("then I have to copy deparse module")
<apeiros>
either it includes Deparse, then it's as I said before, you just override it in your subclass (and that really means in the subclass, NOT in a module nested in your subclass)
<depesz>
deparse method in PgQuery calls Deparse.from() for each item in tree
<apeiros>
well
<apeiros>
then you have bad luck
<depesz>
i nested it because that's what i saw in pg_query gem source.
<depesz>
how bad?
<apeiros>
bad enough that there's no silver bullet. you'll have to inspect the codepath and figure out how to selectively replace/reuse parts.
despai has joined #ruby
<depesz>
apeiros: given the source as it is in here - do you see a way i could have a pgquery2 class that will overwrite just deparse_select ?
<depesz>
but keep all other things from normal pgquery ?
<apeiros>
and bad enough that it'd take too much time for me, meaning I should go back to what I'm paid for. if you're still at it in ~5h, I can take another look.
<depesz>
apeiros: would appreciate. just ping me if/when you'll have time.
<depesz>
thanks.
rwb has quit [Ping timeout: 260 seconds]
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
vutral|kali has joined #ruby
Psybur has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
despai has quit [Quit: ...]
ltt has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Puffball has quit [Remote host closed the connection]
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64_ has joined #ruby
sidx64_ has quit [Client Quit]
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amelliaa has joined #ruby
amar has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
sidx64 has quit [Read error: Connection reset by peer]
_aeris_ has quit [Ping timeout: 268 seconds]
_aeris_ has joined #ruby
ltt has joined #ruby
ltt has quit [Client Quit]
k0mpa has joined #ruby
bmurt has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
sidx64 has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
Asher has quit [Ping timeout: 264 seconds]
ltt has joined #ruby
konsolebox has joined #ruby
Mike11 has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
houhoulis has quit []
despai has joined #ruby
duderonomy has quit [Ping timeout: 256 seconds]
Asher has joined #ruby
despai has quit [Client Quit]
Psybur has quit [Read error: Connection reset by peer]
drale2k_ has joined #ruby
Beams has quit [Quit: .]
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Psybur has joined #ruby
cadillac_ has quit [Ping timeout: 255 seconds]
sidx64 has joined #ruby
ltt has joined #ruby
karapetyan has joined #ruby
voxxit has joined #ruby
cadillac_ has joined #ruby
Beams has joined #ruby
sundhell_away is now known as sundhell
masterasia has quit [Ping timeout: 256 seconds]
karapetyan has quit [Ping timeout: 240 seconds]
masterasia has joined #ruby
jcalla has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
jeffreylevesque has joined #ruby
yohji has joined #ruby
imode has joined #ruby
dbugger has joined #ruby
<dbugger>
hello everyone. I have a weird issue when using rbenv, I get an error "recipe for target 'rdoc' failed". Is there a way to install a version without the documentation?
duderonomy has joined #ruby
shinnya has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhereman_ has joined #ruby
Mike11 has quit [Quit: Leaving.]
DLSteve has joined #ruby
sidx64 has joined #ruby
rfoust has joined #ruby
Mikasi has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
cschneid_ has joined #ruby
guardian has joined #ruby
tomphp_ has joined #ruby
memo1 has joined #ruby
rfoust has quit [Ping timeout: 276 seconds]
justinweiss has quit [Quit: ~]
justinweiss has joined #ruby
tomphp has quit [Ping timeout: 276 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
schaary has quit [Quit: ~]
cschneid_ has quit [Ping timeout: 260 seconds]
schaary has joined #ruby
pizzaops has quit [Quit: ~]
pizzaops has joined #ruby
lipoqil has quit [Quit: ~]
lipoqil has joined #ruby
amatas_ has joined #ruby
tobiasvl has quit [Ping timeout: 256 seconds]
erlend has quit [Ping timeout: 265 seconds]
erlend has joined #ruby
bcavileer has quit [Quit: ~]
bcavileer has joined #ruby
tobiasvl has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amatas__ has joined #ruby
BuildTheRobots has quit [Quit: ~]
BuildTheRobots has joined #ruby
amatas_ has quit [Ping timeout: 240 seconds]
amatas__ has quit [Client Quit]
Yonk_ has quit [Quit: ~]
Yonk_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cadillac_ has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 264 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
aupadhye has quit [Ping timeout: 245 seconds]
mtkd has quit [Ping timeout: 260 seconds]
imode has quit [Ping timeout: 240 seconds]
podman has quit [Quit: ~]
mikecmpbll has joined #ruby
suukim has quit [Quit: Konversation terminated!]
podman has joined #ruby
cadillac_ has joined #ruby
<law>
are there recommended systemd setting for giving a rails daemon run as the 'rails' user more/unlimited system resources?
mtkd has joined #ruby
aarongodin has quit [Quit: ~]
micalexander has quit [Quit: ~]
aarongodin has joined #ruby
micalexander has joined #ruby
kapowaz has quit [Quit: ~]
ggherdov has quit [Quit: ~]
kapowaz has joined #ruby
dukedave has quit [Quit: ~]
HashNuke has quit [Quit: ~]
HashNuke has joined #ruby
dukedave has joined #ruby
ggherdov has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
machty has quit [Quit: ~]
mroth has quit [Quit: ~]
mroth has joined #ruby
Tony-St4rk has quit [Quit: ~]
machty has joined #ruby
Tony-St4rk has joined #ruby
colstrom has quit [Quit: ~]
ckrailo has quit [Quit: ~]
colstrom has joined #ruby
ckrailo has joined #ruby
kireevco has quit [Quit: ~]
Mutsuhito has quit [Quit: ~]
kireevco has joined #ruby
Mutsuhito has joined #ruby
dbugger has quit [Remote host closed the connection]
Brak____________ has quit [Quit: ~]
incomprehensibly has quit [Quit: ~]
Brak____________ has joined #ruby
foamz has quit [Quit: ~]
knowtheory has quit [Quit: ~]
knowtheory has joined #ruby
incomprehensibly has joined #ruby
foamz has joined #ruby
rflot has quit [Quit: ~]
rflot has joined #ruby
Chew has quit [Quit: ~]
memo1 has quit [Quit: WeeChat 1.4]
Chew has joined #ruby
memo1 has joined #ruby
ircmaxell has quit [Quit: ~]
jnix has quit [Quit: ~]
Rapture has joined #ruby
drale2k_ has joined #ruby
jnix has joined #ruby
ircmaxell has joined #ruby
mattwc has quit [Quit: ~]
catbusters has quit [Quit: ~]
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mattwc has joined #ruby
catbusters has joined #ruby
caw_______ has quit [Quit: ~]
caw_______ has joined #ruby
iamdevnul has quit [Quit: ~]
iamdevnul has joined #ruby
untitaker has quit [Quit: ~]
AndyWojo has quit [Quit: ~]
AndyWojo has joined #ruby
auv has quit [Quit: ~]
untitaker has joined #ruby
Lloyd has quit [Quit: ~]
Lloyd has joined #ruby
auv has joined #ruby
fury has quit [Quit: ~]
fury has joined #ruby
jetpack_joe has quit [Quit: ~]
jetpack_joe has joined #ruby
tycoon177 has quit [Quit: ~]
tycoon177 has joined #ruby
andikr has joined #ruby
mtkd has quit []
Flabbergazta_ has quit [Quit: ~]
Flabbergazta_ has joined #ruby
craysiii has quit [Quit: ~]
craysiii has joined #ruby
Beams has quit [Quit: .]
qba73 has quit [Ping timeout: 260 seconds]
reber has quit [Remote host closed the connection]
seanh has quit [Quit: ~]
seanh has joined #ruby
apeiros__ has joined #ruby
Beams has joined #ruby
koenrh has quit [Quit: ~]
koenrh has joined #ruby
sundhell is now known as sundhell_away
apeiros__ has quit [Read error: Connection reset by peer]
surminus has quit [Quit: ~]
surminus has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has quit [Read error: Connection reset by peer]
ltt has joined #ruby
netherwolfe has joined #ruby
maciuszek has quit [Quit: ~]
maciuszek has joined #ruby
KrzaQ has quit [Ping timeout: 268 seconds]
imode has joined #ruby
sidx64 has joined #ruby
qba73 has joined #ruby
nuck has quit [Quit: ~]
afisher has quit [Quit: ~]
nuck has joined #ruby
afisher has joined #ruby
mr-robert has quit [Quit: ~]
mr-robert has joined #ruby
sepp2k has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
<al2o3-cr>
has Proc#call always been able to take the reciever as first argument?
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr>
as in
<al2o3-cr>
>> :send.to_proc.call(:puts, ?*)
<ruby[bot]>
al2o3-cr: # => undefined method `*' for :puts:Symbol (NoMethodError) ...check link for more (https://eval.in/987062)
<al2o3-cr>
dminuoso: how can i bind to a C level proc?
<al2o3-cr>
>> :send.to_proc.binding
<ruby[bot]>
al2o3-cr: # => /tmp/execpad-94ad8e09440f/source-94ad8e09440f:2: [BUG] Segmentation fault at 0x0bd116 ...check link for more (https://eval.in/987064)
<phaul>
what's /\G/ ? "matching first matching position", of what???
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr>
of space
clemens3 has quit [Remote host closed the connection]
<canton7>
"\G will match the match boundary, which is either the beginning of the string, or the point where the last character of last match is consumed."
andikr has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
jamesaxl has joined #ruby
snapcase has joined #ruby
ellcs has quit [Remote host closed the connection]
unreal has joined #ruby
dr3w_ has joined #ruby
yohji has quit [Remote host closed the connection]
Beams has quit [Quit: .]
karapetyan has quit [Remote host closed the connection]
jdawgaz has joined #ruby
lelliott has quit [Remote host closed the connection]
<Janky>
I have a folder full of about a thousand .txt files. Each of these .txt files has about 30 lines of information in it. Can anyone point me to a tutorial on how to put these files into a single spreadsheet? Thanks.
sanscoeur has joined #ruby
<al2o3-cr>
Janky: as in csv?
<Janky>
that would work
claudiuinberlin has joined #ruby
kapil___ has joined #ruby
<gizmore>
Janky: what format are the txt files?
ltt has quit [Ping timeout: 245 seconds]
pilne has joined #ruby
<Janky>
delimited by line
<gizmore>
so its basically output excel from multiple line by line data?
<Janky>
yes
darkhanb_ has joined #ruby
<gizmore>
for me the most difficult part would be the excel writing
<gizmore>
never did that
<Janky>
I'm trying to make it so each .txt file has it's own row, and each line within that .txt file has it's own column
<gizmore>
sounds reasonable
<gizmore>
how about this
<gizmore>
generate a csv from the files
<gizmore>
then import to excel
<gizmore>
:D
<Janky>
lol
zautomata4 has quit [Quit: WeeChat 1.9.1]
stormpack_ has joined #ruby
<gizmore>
but excel writing would be possible too
<Janky>
I could do that
<havenwood>
Janky: To load it all into memory: Dir['*.txt'].map { |filename| File.readlines filename, chomp: true }
<gizmore>
start with a few for loops
<baweaver>
al2o3-cr: I made something fun
karapetyan has joined #ruby
<gizmore>
Janky: havenwood took all the fun and made rubygolf
<al2o3-cr>
nothing ceases to amaze me in ruby, do you know that.
<baweaver>
Just wait until we get started on the next book
<al2o3-cr>
i can't wait :)
<baweaver>
It's a book of Ruby black magics, The Ruby Grimoire
<al2o3-cr>
haha nice name
<baweaver>
Current book is mostly just pending legal feedback at $WORK
darkhanb has joined #ruby
<baweaver>
Then ETA Jan 2019 for the final draft, though I think I'll be done sooner.
<al2o3-cr>
ah, thought it was taking a while
amar has joined #ruby
<baweaver>
Dotted i's and crossed t's and such
<sparr>
other than an explicit call to somestring.to_sym or somestring.intern, what could cause "interning empty string" error?
<sparr>
in ruby 1.8
imode has joined #ruby
<al2o3-cr>
sparr: an empty string would do that.
darkhanb_ has quit [Ping timeout: 268 seconds]
<baweaver>
sparr: Just to get it out of the way: 1.8 is super old and long since deprecated, which means it's a massive security risk. You should upgrade.
cadillac_ has quit [Ping timeout: 264 seconds]
<al2o3-cr>
sparr: %s"" might do it?
cadillac_ has joined #ruby
<al2o3-cr>
who knows
clemens3 has joined #ruby
<al2o3-cr>
18>> %s""
<ruby[bot]>
al2o3-cr: # => /tmp/execpad-57d9285cb600/source-57d9285cb600:2: empty symbol literal (https://eval.in/987114)
<al2o3-cr>
hmm, no it doesn't
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stormpack_ has quit [Quit: Leaving]
yokel has quit [Ping timeout: 260 seconds]
<al2o3-cr>
sparr: i can't overemphasize UPGRADE
cagomez has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Closing time!]
cadillac_ has quit [Ping timeout: 256 seconds]
reber has joined #ruby
cadillac_ has joined #ruby
suukim has joined #ruby
cagomez has joined #ruby
Rapture has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
venmx has quit [Ping timeout: 240 seconds]
cyberg has joined #ruby
<sparr>
i know :(
<sparr>
sadly not my call
alex`` has quit [Quit: WeeChat 2.1]
<baweaver>
sparr: Who's blocking it?
<al2o3-cr>
sparr: i mean come on, i must of been 3 or 4 when 1.8 was a thing ;P
n0m4d1c has joined #ruby
harrycs has quit [Ping timeout: 240 seconds]
TinkerT has quit [Quit: ZNC 1.7.x-nightly-20180328-82a93253 - https://znc.in]
TinkerT has joined #ruby
<baweaver>
because by this point it's a glaring security hole, especially if you're on RHEL or CentOS and using it for deployments.
imode has quit [Ping timeout: 260 seconds]
twshelton has joined #ruby
n0m4d1c_ has joined #ruby
n0m4d1c has quit [Ping timeout: 263 seconds]
karapetyan has quit []
memo1 has quit [Ping timeout: 276 seconds]
faces has joined #ruby
despai has joined #ruby
<al2o3-cr>
sparr: whos cal is it?
<al2o3-cr>
*call
despai has quit [Client Quit]
GodFather_ has joined #ruby
face has quit [Ping timeout: 264 seconds]
Rapture has joined #ruby
cstrahan has joined #ruby
<al2o3-cr>
class Integer; alias whoa +; def +(moar) puts "#{self}+#{moar}"; whoa(moar); end; end; %(#{$$}) # good terminal fun ;)
<sparr>
my boss' boss
amelliaa has quit [Quit: -]
<sparr>
so, new line of questioning...
<al2o3-cr>
sparr: sack them.
<al2o3-cr>
ok, listening...
<sparr>
preface: this is in puppet, so it's Not Real Ruby, but I'm hoping some guidance here will point me in the right direction there.
<al2o3-cr>
?puppet sparr
<ruby[bot]>
sparr: Please join #puppet for help with it.
<sparr>
yeah :(
erlend has quit [Ping timeout: 268 seconds]
\void has joined #ruby
John_Ivan has joined #ruby
John_Ivan has joined #ruby
John_Ivan has quit [Changing host]
erlend has joined #ruby
<al2o3-cr>
maybe you'll get more guidance there
<sparr>
negative
<al2o3-cr>
:(
<al2o3-cr>
i honestly can't help as i have no clue.
<al2o3-cr>
maybe others can though, idk sorry.
tdy has quit [Ping timeout: 256 seconds]
imode has joined #ruby
mroutis has quit [Read error: Connection reset by peer]
mroutis has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
sauvin has quit [Ping timeout: 240 seconds]
alex`` has joined #ruby
tdy has joined #ruby
<al2o3-cr>
1 kudos point if someone can achieve a SyntaxError with the msg "void value expression"
<al2o3-cr>
raise SyntaxError, "void ..." is a no no.
sameerynho has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
<al2o3-cr>
?fixcon jdawgaz
<ruby[bot]>
al2o3-cr: I don't know anything about fixcon
jdawgaz has quit [Client Quit]
<al2o3-cr>
:(
jdawgaz has joined #ruby
<apeiros>
banning of all kinds is a command, hence ! prefixed and restricted to ops
<apeiros>
!fixcon jdawgaz
jdawgaz was kicked from #ruby by ruby[bot] [repeated join/part detected]
<al2o3-cr>
ah, thought it was part of the public api
traxnov has joined #ruby
<al2o3-cr>
it makes sense.
<al2o3-cr>
why is {foo: :bar **other} faster than Hash#update what else is going on?
AndBobsYourUncle has joined #ruby
zautomata has joined #ruby
zautomata has quit [Changing host]
zautomata has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
psychicist__ has joined #ruby
suukim has quit [Quit: Konversation terminated!]
nicesignal has quit [Read error: Connection reset by peer]
eckhardt has quit [Read error: Connection reset by peer]
mroutis has quit [Read error: Connection reset by peer]
mtkd has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
mtkd has joined #ruby
ellcs has joined #ruby
mroutis has joined #ruby
dr3w_ has joined #ruby
alex`` has quit [Quit: WeeChat 2.1]
hkais has quit [Ping timeout: 255 seconds]
<cjohnson>
Sorry, I had a call
<cjohnson>
2.2
<cjohnson>
2.4 in the coming months but...2.2 for now
<cjohnson>
So, let me clarify. This is for a rails app, the web API needs to call gpg to decrypt the incoming encrypted data
<cjohnson>
I'm reviewing the PR to add this endpoint and the author wrote the lib which pipes the encrypted data via stdin, and passes the passphrase on the command line using --passphrase "cleartextpassphrase"
FrostCandy has joined #ruby
<cjohnson>
I wanted to suggest an improvement that gets it out of the process list
<cjohnson>
So I can't prompt interactively for the passphrase
<cjohnson>
One approach might be to have ruby write hte passphrase to a file and then pass that file path to the gpg command
<cjohnson>
Seems wonky though. What if the ruby process fails to clean up after itself and the passphrase is left behind
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
^mtkd has joined #ruby
mtkd has quit [Read error: Connection reset by peer]
kapil___ has quit [Quit: Connection closed for inactivity]
<al2o3-cr>
cjohnson: not too sure then.
Ltem has quit [Quit: gn]
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
ellcs has quit [Remote host closed the connection]
ellcs has joined #ruby
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
cagomez has quit [Remote host closed the connection]
nahra has quit [Remote host closed the connection]
sidx64 has joined #ruby
<cjohnson>
Oh it turns out this is just a stupid client request
<cjohnson>
I thought we were plaintext sending encrypted data
<cjohnson>
we're using sftp to transfer the file but they want to transfer double-encrypted shit
mostlybadfly has quit [Quit: Connection closed for inactivity]
<cjohnson>
So, meh, I don't care
alfiemax has quit [Remote host closed the connection]
<al2o3-cr>
cjohnson: hehe, no worries
pastorinni has joined #ruby
alfiemax has joined #ruby
adlerdias has quit [Quit: adlerdias]
alfiemax has quit [Ping timeout: 268 seconds]
vikaton has quit [Quit: Connection closed for inactivity]
workmad3 has joined #ruby
marxarelli is now known as marxarelli|afk
m4rCsi has quit [Quit: No Ping reply in 180 seconds.]
m4rCsi has joined #ruby
pastorinni has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
Psybur has quit [Ping timeout: 265 seconds]
erlend has quit [Ping timeout: 256 seconds]
lelliott has joined #ruby
erlend has joined #ruby
eckhardt has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n0m4d1c has quit [Read error: Connection reset by peer]
n0m4d1c has joined #ruby
m4rCsi has quit [Quit: No Ping reply in 180 seconds.]
claudiuinberlin has joined #ruby
m4rCsi has joined #ruby
cagomez has joined #ruby
venmx has joined #ruby
mroutis has quit [Ping timeout: 264 seconds]
k0mpa has quit [Quit: k0mpa]
pastorinni has joined #ruby
n008f4g_ has joined #ruby
cagomez has quit [Ping timeout: 245 seconds]
moei has joined #ruby
sidx64_ has joined #ruby
sonOfRa has quit [Remote host closed the connection]
jeffreylevesque has quit [Ping timeout: 256 seconds]
sidx64 has quit [Ping timeout: 265 seconds]
rwb has quit [Ping timeout: 256 seconds]
memo1 has joined #ruby
sonOfRa has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
cagomez has joined #ruby
harrycs has joined #ruby
n008f4g_ has quit [Ping timeout: 240 seconds]
memo1 has quit [Ping timeout: 240 seconds]
hkais has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
SeepingN has joined #ruby
mikecmpbll has joined #ruby
alfiemax has joined #ruby
dimik--- has joined #ruby
<dimik--->
how can i use some specific version of a gem in a require of .rb file
<dimik--->
without rails environment
alfiemax has quit [Ping timeout: 240 seconds]
<mr-robert>
dimik---: gem "name", "= X.X.X" then require "name"
mroutis has joined #ruby
lelliott has quit [Remote host closed the connection]
<dimik--->
mr-robert thank you sir
<Janky>
can anyone help me with a small script I'm working on?
chouhoul_ has joined #ruby
<phaul>
Janky, tell us about it, there will be someone
memo1 has joined #ruby
<Janky>
well
chouhoulis has quit [Ping timeout: 255 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
<Janky>
I've got about a thousand text files, each of them contains about 30 lines. I'm trying to write a program that goes through each files and outputs everything to a CSV. I would like to have it where every file has it's own row and the lines within those .txt. files have their own columns. I've got it setup to where it will read the .txt files and output everything to a .csv, but my only problem
<Janky>
is that everything is being output on it's own row under 1 column
synthroid has quit []
marxarelli|afk is now known as marxarelli
sidx64 has joined #ruby
ledestin has joined #ruby
sidx64_ has quit [Ping timeout: 276 seconds]
<phaul>
if I were you, - this assuming that you have written that script - so if I were you, I would paste the code on a gist, point out where I'm stuck with it, and ask specific questions about it. You are to vague atm. for anybody to help
<phaul>
Janky: sounded like you had something running already, that's good. Why not paste it to gist, and tell where it behaves different to what you expect?
GodFather_ has quit [Ping timeout: 276 seconds]
harrycs has quit [Ping timeout: 276 seconds]
<Janky>
I don't even know what gist is
venmx_ has joined #ruby
rwb has joined #ruby
GodFather_ has joined #ruby
<phaul>
it's where ppl ususally paste there code to share it with the chat.
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has quit [Remote host closed the connection]
<Janky>
so, I have a thousand .txt files in a directory. Each of them has about 30 lines of text. That script goes through each file, and then each line, and outputs all of the information to a single CSV. My only issue is that each line is being written to a row instead of a column
chouhoulis has joined #ruby
snc123 has joined #ruby
reber has quit [Remote host closed the connection]
psychicist__ has quit [Ping timeout: 240 seconds]
atchoum has joined #ruby
snc123 has quit [Client Quit]
<SeepingN>
build arrays for each column
nikivi has joined #ruby
chouhoul_ has quit [Ping timeout: 265 seconds]
<tobiasvl>
Janky: deja vu - did you ask the same thing about python in another channel earlier?
hkais has quit [Ping timeout: 256 seconds]
rwb has quit [Ping timeout: 260 seconds]
sluggo has joined #ruby
amar has quit [Remote host closed the connection]
<Janky>
tobiasvl, I did not
<Janky>
hmm, ok
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vikaton has joined #ruby
<Janky>
SeepingN, so I would be putting arrays within arrays?
sagax has joined #ruby
John_Ivan has quit [Read error: Connection reset by peer]
dimik-- has joined #ruby
<tobiasvl>
Janky: I'm a little confused at what you're doing. for each line, you put that line into an array, write that array to the csv, and then clear the array?
<tobiasvl>
seems a little redundant
<Janky>
I think that's what has been suggested that I do
jottr has joined #ruby
<tobiasvl>
so the array you're writing to the csv is supposed to just contain one line?
<Janky>
right now I just want each file .txt to have it's own row, and each line in that .txt file to have it's own column
dimik--- has quit [Ping timeout: 265 seconds]
<Janky>
my script generates 30,000 rows. I'd like a thousand rows with 30 columns
<tobiasvl>
ok, then I guess line 13 should be moved to above what's line 11 now?
dimik--- has joined #ruby
<tobiasvl>
so that for each line in a txt file, you append that to the array, and then when all the lines are in the array, THEN you write the array to the csv
<tobiasvl>
righ?
<tobiasvl>
t
<Janky>
I'll give it a shot
t0rchh has joined #ruby
<tobiasvl>
ok. try to understand why I'm suggesting this though.
<Janky>
you're a genius
<Janky>
it worked!
<tobiasvl>
haha. glad to hear it
dimik-- has quit [Ping timeout: 264 seconds]
<Janky>
man
<Janky>
I've been working on that for a week
venmx_ has quit [Remote host closed the connection]
t0rchy has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
rivalomega has joined #ruby
t0rchy has joined #ruby
t0rchy has quit [Client Quit]
it_tard has joined #ruby
mroutis has left #ruby [#ruby]
t0rchh has quit [Ping timeout: 240 seconds]
nfk has quit [Ping timeout: 240 seconds]
n0m4d1c has joined #ruby
mroutis has joined #ruby
atchoum has quit [Ping timeout: 260 seconds]
n0m4d1c_ has joined #ruby
venmx has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
mroutis has quit [Remote host closed the connection]
n0m4d1c__ has quit [Read error: Connection reset by peer]
rwb has joined #ruby
<Sar_Sa>
what is the better way to pad a string up to certain size. For instance, I have a string with a size less than 10 and I want to padd it with null bytes until the size of 10. So "AA" would be converted to "AA\x00\x00\x00\x00\x00\x00\x00\x00\x00". How can I get that ?
<phaul>
&ljust
netherwolfe_ has joined #ruby
<mroutis>
Sar_Sa: you should look to ljust and rjust, to pad a string up to a certain size, as phaul said; however, I think it won't help you with bytes
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul>
how does derpy work again?
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
rivalomega has quit [Remote host closed the connection]
netherwolfe has quit [Ping timeout: 260 seconds]
rivalomega has joined #ruby
<mroutis>
at least, you could try a combination of ljust with map, but it's an ugly hack
FrostCandy has quit []
<havenwood>
phaul: &ri
<phaul>
havenwood: thanks
<Sar_Sa>
phaul: mroutis thank you let me check
n0m4d1c_ has joined #ruby
n0m4d1c has quit [Read error: Connection reset by peer]
<mroutis>
Sar_Sa: something like the following `'AA'.ljust(10, '~').gsub('~', '\x00')`
<Sar_Sa>
mroutis: thank I'm gonna try it
rivalomega has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mroutis>
Sar_Sa, why do you want to append "bytes" into a string?
<Sar_Sa>
mroutis: works for me. And just another question, How can I convert a integer to a hex string of 4 bytes. For instance 13 would be "\x0D\x00\x00\x00"
<apeiros>
not sure what you mean by "a list with the integer"
phaul has quit [Ping timeout: 260 seconds]
<Sar_Sa>
apeiros: I meadn that if I have an integer like n=3. I can not use n.pack
<Sar_Sa>
I need to use [n].pack
rivalomega has joined #ruby
<apeiros>
yes
<apeiros>
sadly
<apeiros>
would be nice if there was a way for single values to pack/unpack
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<Sar_Sa>
apeiros / mroutis thank for the help
Mikasi has quit [Read error: Connection reset by peer]
rivalomega has quit [Remote host closed the connection]
minimalism has joined #ruby
conceivably has joined #ruby
<conceivably>
Hi :) Can any one think of a more elegant way of turning an ordinal into an integer than doing /(\d+)/.match("1st").captures.first.to_i ?
<al2o3-cr>
holy jesus
<al2o3-cr>
Sar_Sa: that was 11 bytes 'esus
<Sar_Sa>
al2o3-cr: what ?
<apeiros>
"1st".to_i # => 1 @ conceivably
<apeiros>
(and no, ruby isn't aware of ordinals, it's just that to_i ignores everything from and after the first non-digit)
<conceivably>
:D brilliant! Thank you. I'm glad I asked.
<al2o3-cr>
Sar_Sa: it was 10+1 bytes
rivalomega has joined #ruby
<al2o3-cr>
Sar_Sa: what endian?
<Sar_Sa>
big
<al2o3-cr>
vV is VAX nN is network > big endian
<Sar_Sa>
yes
<al2o3-cr>
yes to what?
<al2o3-cr>
k :)
<Sar_Sa>
bit endian
<al2o3-cr>
what size do you need though?
<al2o3-cr>
and what's for?
<al2o3-cr>
vax is rearly use now
<al2o3-cr>
*used
devyn has quit [Read error: Connection reset by peer]
cschneid_ has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<al2o3-cr>
things can change on different archs
devyn has joined #ruby
<Sar_Sa>
al2o3-cr: but I've already got it with [n].pack("V") :)
spiette has quit [Quit: :qa!]
marr has quit [Ping timeout: 265 seconds]
<al2o3-cr>
[n].pack 'L<' which is well make your own mind up
marr has joined #ruby
<Sar_Sa>
al2o3-cr: let me check
<Sar_Sa>
al2o3-cr: it works too
<Sar_Sa>
the same result
jamesaxl has quit [Quit: WeeChat 2.1]
venmx has quit [Remote host closed the connection]
pastorinni has quit [Remote host closed the connection]
sanscoeur has quit [Ping timeout: 240 seconds]
<al2o3-cr>
well it holds 32 unsigned integer
<al2o3-cr>
*bit
<al2o3-cr>
vax is gone don't use it.
<Sar_Sa>
nice! thanks
<al2o3-cr>
it's a perlism. legacy.
ellcs has quit [Ping timeout: 256 seconds]
<Sar_Sa>
nice to know that
<al2o3-cr>
Sar_Sa: np pal
<Sar_Sa>
:)
rcs has quit [Ping timeout: 240 seconds]
<al2o3-cr>
Nn still hold though.
<Sar_Sa>
pack is easy to get
<Sar_Sa>
*is not
mroutis has quit [Read error: Connection reset by peer]