havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.2, 2.3.5 & 2.2.8: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
apeiros has joined #ruby
<Radar> I knew about [<regex>] but not [<regex>, <num>]
<Radar> Ugh....
FastJack has joined #ruby
<RickHull> WTH, how is R the least disliked language? https://stackoverflow.blog/2017/10/31/disliked-programming-languages/
<RickHull> R is The Worst (tm)
<Radar> Stockholm Syndrome?
<Papierkorb> Perl is where it belongs
ycyclist has quit [Quit: Page closed]
steph_ has joined #ruby
apeiros has quit [Ping timeout: 258 seconds]
enterprisey has quit [Ping timeout: 240 seconds]
vtx has joined #ruby
bdonnahue has joined #ruby
<bdonnahue> hey guys. im using rvm to install ruby but im seeing the following error:
<bdonnahue> ruby-2.1.0 - #making binaries executable..
<bdonnahue> curl: (60) Peer's Certificate has expired.
<bdonnahue> anyone know what to do?
sepp2k has quit [Read error: Connection reset by peer]
Ropeney has joined #ruby
<RickHull> upgrade curl
<Papierkorb> 1) is your system clock correct? 2) Ruby2.1 is end of life'd
<RickHull> and why install 2.1.0?
apeiros has joined #ruby
<bdonnahue> redmine needs it afaik. double checking that
<RickHull> I doubt it. if anything in your infra depends on something EOL'd you should reconsider your infra
<vtx> hi guys, does anyone here have experience testing sinatra apps with rspec? i can test a simple /status endpoint with: https://gist.github.com/anonymous/10bd887c820269458a9859ff24df3725 but i don’t know how to test more complex endpoints. for example, say i have a /user endpoint that connects to an ldap service or something similar. how can i mock out calls to those services using expect/allow?
weaksauce has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
apeiros has quit [Ping timeout: 240 seconds]
hxegon has quit [Quit: leaving]
guacamole has joined #ruby
ElDoggo has joined #ruby
apeiros has joined #ruby
dviola has joined #ruby
RougeR has quit [Remote host closed the connection]
apeiros has quit [Ping timeout: 255 seconds]
weaksauce has quit [Read error: Connection reset by peer]
ruby_ has joined #ruby
ruby_ has quit [Client Quit]
csk157 has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ruby_ has joined #ruby
ruby_ has quit [Client Quit]
John__ has quit [Read error: Connection reset by peer]
csk157 has quit [Ping timeout: 240 seconds]
apeiros has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guardianx has joined #ruby
AndBobsYourUncle has joined #ruby
jameser has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
agent_white has quit [Ping timeout: 258 seconds]
AndBobsYourUncle has quit [Client Quit]
leah2 has quit [Ping timeout: 258 seconds]
bruno- has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
<RickHull> i'm guessing that's a WebMock question
mikecmpbll has quit [Quit: inabit. zz.]
postmodern has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
<catphish> redis proxy all working now :)
DTZUZO has quit [Ping timeout: 248 seconds]
marr has quit [Ping timeout: 248 seconds]
ElDoggo has quit [Remote host closed the connection]
Technodrome has joined #ruby
ElDoggo has joined #ruby
tobiasvl has quit [Ping timeout: 246 seconds]
ElDoggo has quit [Ping timeout: 240 seconds]
tvl has joined #ruby
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
apeiros has joined #ruby
leah2 has joined #ruby
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
tvl has quit [Ping timeout: 255 seconds]
guacamole has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
charliesome has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
tvl has joined #ruby
tvl is now known as tobiasvl
mson has quit [Quit: Connection closed for inactivity]
<RickHull> catphish: nice :)
<RickHull> untested, I wrote it in the dang web editor
alex`` has quit [Ping timeout: 258 seconds]
mgorbach has quit [Remote host closed the connection]
catphish has quit [Quit: Leaving]
ur5us has joined #ruby
mson has joined #ruby
nginxxx has joined #ruby
mgorbach has joined #ruby
<nginxxx> Why is metasploit framework not made in python?
<nginxxx> language
<nginxxx> i mean is it really better in ruby?
<RickHull> who wrote it?
jphase has joined #ruby
<Papierkorb> as ruby is obviously superior to python ... (lul)
<nginxxx> do you guys know more projects like ms in ruby?
<nginxxx> but in ruby
apeiros has joined #ruby
<benzrf> oh my god
<benzrf> so i modified the mac thing to pass the data in all at once and it errored
<benzrf> i poked a bit and it seems that update was returning the full data encrypted
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
<benzrf> and it expected only 16 bytes out
<benzrf> so. i. called update once. and. truncated to the last 16 bytes.
<benzrf> presto. instantly 100MB/s and my fan doesnt turn on
<RickHull> i'm not a fan of the openssl api and it's easy to misuse
<benzrf> but this is
<benzrf> i mean
<RickHull> it's possible you are not doing the mac check
<benzrf> this part isnt the check
<benzrf> it compares the result
<benzrf> so presumably this is producing the same result
<benzrf> here's my theory...
nginxxx has quit [Quit: Page closed]
<benzrf> calling update all at once has to allocate a big string
nginxxx has joined #ruby
<benzrf> so maybe in C, it's better to do the loop, because you have to loop over the data anyway, and that way you dont need to keep allocating
<benzrf> and then whoever wrote this decided the same thing was true here.
<RickHull> what besides the mac check has to do with 16 bytes?
<benzrf> the function i altered was just the part that computed a mac
apeiros has quit [Ping timeout: 248 seconds]
<RickHull> probably quicker to paste the diff or whatever
jphase has quit [Ping timeout: 248 seconds]
steph_ has quit [Remote host closed the connection]
jenrzzz has joined #ruby
<benzrf> via 19:29 <catphish> block = data + "\x0"*((16-data.bytesize%16)%16);
<benzrf> saved me the trouble of taking 20 seconds to figure out my fenceposts :>
Guest55749 has quit [Quit: Page closed]
enterprisey has joined #ruby
<RickHull> sweet, submit a PR with tests and comments, or at least file an issue
nicesignal has quit [Remote host closed the connection]
<RickHull> I don't quite follow it at a glance, or care particularly, but it looks reasonable :)
nicesignal has joined #ruby
<benzrf> heh
<RickHull> i mean I get doing the padding, that's plenty sensible and avoids some dumb comparisons and conditionals
jenrzzz has quit [Ping timeout: 248 seconds]
jphase has joined #ruby
apeiros has joined #ruby
ElDoggo has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
<RickHull> OIC, it was churning through all the data 16 bytes at a time? anyways, I'd back away slowly from that gem
apeiros has quit [Ping timeout: 246 seconds]
ElDoggo has quit [Ping timeout: 248 seconds]
cdg has joined #ruby
alfiemax has joined #ruby
<nginxxx> what are the main channels here like anonops on anonymous irc
<nginxxx> list is soooooo long
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
ElDoggo_ has joined #ruby
<RickHull> like social channels?
<benzrf> RickHull: it works pretty well apart from that though o:
<RickHull> help em fix it then :)\
<RickHull> er :)
<matthewd> I guess there's probably a #freenode ¯\_(ツ)_/¯
<RickHull> most channels here are organized around particular F/OSS projects
<nginxxx> thats what i searched, thx
cdg has quit [Ping timeout: 246 seconds]
ElDoggo__ has joined #ruby
jphase has quit [Ping timeout: 255 seconds]
ElDoggo_ has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
cschneid_ has joined #ruby
ElDoggo_ has joined #ruby
ElDoggo__ has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 260 seconds]
harfangk has joined #ruby
ElDoggo_ has quit [Ping timeout: 260 seconds]
ElDogg___ has joined #ruby
ElDogg___ has quit [Remote host closed the connection]
ElDoggo__ has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
jphase has joined #ruby
haraoka has joined #ruby
weaksauce has joined #ruby
fuzzyhorns has joined #ruby
<fuzzyhorns> i'm looking at some library code and a bit confused, never seen this before
<fuzzyhorns> old_sep, $; = $;, separator
<fuzzyhorns> multiple assignment i've seen before
<fuzzyhorns> but $;
jphase has quit [Ping timeout: 246 seconds]
<leah2> The default separator for String#split.
apeiros has joined #ruby
<fuzzyhorns> that seems so weird to me
jphase has joined #ruby
<fuzzyhorns> like $ is usually path and ; ends a line
<fuzzyhorns> idgi :d
<RickHull> because perl
<fuzzyhorns> ahhhhhh
<fuzzyhorns> $;.to_s => ","
<fuzzyhorns> good lord lol
<RickHull> mfer do you speak it?! ;)
apeiros has quit [Ping timeout: 240 seconds]
<benzrf> > $;
<fuzzyhorns> lolll well, TIL
<benzrf> oh
<benzrf> whyyy does ruby have global variables
orbyt_ has joined #ruby
<benzrf> WHYYYYYYYYYYYYY does ruby USE GLOBAL VARIABLES TO CONFIGURE DEFAULTS
<RickHull> because perl
alfiemax has quit [Remote host closed the connection]
<RickHull> but let's talk about smalltalk and lisp shall we?
cdg has joined #ruby
marxarelli is now known as marxarelli|afk
gizmore has joined #ruby
jphase has quit [Ping timeout: 248 seconds]
ek926m has joined #ruby
weaksauce has quit [Read error: Connection reset by peer]
gizmore|2 has quit [Ping timeout: 258 seconds]
apeiros has joined #ruby
justwentviral has joined #ruby
jphase has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
jrafanie has joined #ruby
<benzrf> i know because perl
<benzrf> but that's not an excuse
<benzrf> like. just because perl does it. matz still had to look at it and think "yes. that is a good idea. i will put this into my language"
PaulCape_ has quit [Read error: Connection reset by peer]
<matthewd> Defaults are pretty much global by default, no?
vee__ has quit [Ping timeout: 240 seconds]
<benzrf> sorry, not precisely "defaults", i mean like "defaults" in the sense of default behavior of things like #split in the absence of specific args
<benzrf> er, and my objection was less to the use of global variables as opposed to something else, and more the ability to do that at all
<justwentviral> why would i use ruby/rails to make a high-traffic website when it has a reputation of being slow at large scale? i feel like one would be making a bit of a mistake. i ask because, i'm hoping i'm under some misconception or something, as making an mvp in and finding additional resources (learning tools, manpower, etc.) in ruby seems infinitely easier than with, say, haskell or another esoteric but arguably more better-suited langua
jrafanie has quit [Client Quit]
rsa3157 has joined #ruby
<benzrf> if you _really_ want that to be possible, at _least_ don't make it dynamically changable at runtime! good god
PaulCapestany has joined #ruby
rsa3157 has quit [Client Quit]
<matthewd> justwentviral: The obvious answer would be that you're not making a high-traffic website
ek926m has quit [Ping timeout: 240 seconds]
<matthewd> justwentviral: The second would be that "high", "slow", and "large" are all relative
<justwentviral> so i shouldn't use ruby then for what i INTEND to be a high-traffic website, if i want to save myself some headache in the future then
jphase has quit [Ping timeout: 260 seconds]
<matthewd> If you prefer headache now, that's up to you ¯\_(ツ)_/¯
mtkd has quit [Ping timeout: 240 seconds]
<justwentviral> really does seem like a pick-your-poison situation, i suppose :/
nginxxx has quit [Ping timeout: 260 seconds]
csk157 has joined #ruby
mtkd has joined #ruby
<matthewd> Personally, I prefer to solve for problems I'm having now -- ease of development, for example -- over problems I might have in future, like unquantifiable "high-traffic"
<matthewd> There are plenty of Very Not Small things running happily either entirely or substantially on Rails
apeiros has joined #ruby
<RickHull> justwentviral: a website needs hardly any processing power. a webapp can be a tarpit of resources
<RickHull> but it doesn't have to be
<RickHull> just use node and push the inefficiency to battery-powered phones, I say
<RickHull> but for real, it's easy to make efficient websites, and server-based webapps
<RickHull> it's also easy to hack your way through your first rails tutorial and try to stuff everything into ActiveRecord
csk157 has quit [Ping timeout: 240 seconds]
<RickHull> maybe it works better now, I haven't used in anger in about 5 years
<RickHull> /rant
apeiros has quit [Ping timeout: 258 seconds]
uZiel has joined #ruby
vee__ has joined #ruby
<bdonnahue> hey guys, im seeing the following: mkmf.rb can't find header files for ruby
<bdonnahue> i installed ruby with rvm
<bdonnahue> any idea what im misisng?
<RickHull> not to knock AR -- it does what it says on the tin -- but it can be an easy but wrong place to stuff important logic
<RickHull> bdonnahue: what linux distro? you probably need the ruby-dev package
<bdonnahue> centos
lobloblobster has joined #ruby
naitian has left #ruby ["WeeChat 1.9.1"]
<RickHull> try installing ruby-devel
<RickHull> what is driving mkmf.rb ?
<bdonnahue> RickHull, im new to ruby. I am worried that the devel will not match the version i installed with rvm
<RickHull> a gem with a C extension?
<RickHull> what step are you trying to accomplish that bombs out with mkmf.rb ?
<bdonnahue> RickHull, speaking french right now haha im very new to ruby
<bdonnahue> let me check
<bdonnahue> An error occurred while installing json (1.8.6), and Bundler cannot continue.
<bdonnahue> does that help?
<RickHull> if you are following a tutorial, paste a link
<RickHull> yes
apeiros has joined #ruby
<RickHull> what ruby version?
workmad3 has joined #ruby
jphase has joined #ruby
<ruby[bot]> bdonnahue: as I told you already, please use https://gist.github.com
<bdonnahue> ruby 2.1.0
<bdonnahue> ur a jerk ruby bot
<RickHull> busted!
<RickHull> ha, no worries ;)
<RickHull> ok, so yeah, the json gem needs to know about ruby's C underpinnings
<RickHull> i haven't used rvm in a while
lacour has joined #ruby
<RickHull> but something in rubygems / C extension / mkmf / yadayada should be able to find the ruby header files
<RickHull> if rvm installed them
<RickHull> maybe when you do rvm install ruby-2.1 you need to ask for header / dev files?
<bdonnahue> ahh maybe i need to install the c header files with yum?
<RickHull> well yeah, if you weren't trying to use rvm
apeiros has quit [Ping timeout: 260 seconds]
<RickHull> though the header files themselves could possibly work anyway
<RickHull> i doubt they churn much
<RickHull> i mean the yum ruby-devel package. it could work maybe
jphase has quit [Ping timeout: 240 seconds]
<RickHull> but if you are using rvm, then you probably want rvm to manage the headers and it should work
workmad3 has quit [Ping timeout: 240 seconds]
lobloblobster has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<RickHull> you can try #rvm too
hutch34 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<bdonnahue> #join rvm
<bdonnahue> whoops
quobo has quit [Quit: Connection closed for inactivity]
<RickHull> bdonnahue: hm, looks like #rvm is pretty dead here; since they say to leave your email
jphase has joined #ruby
troys is now known as troys_
ElDoggo__ has quit [Remote host closed the connection]
ElDoggo has joined #ruby
hutch34 has quit [Ping timeout: 252 seconds]
apeiros has joined #ruby
lobloblobster has joined #ruby
ElDoggo has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 240 seconds]
iMadper`` is now known as iMadper
iMadper has quit [Changing host]
iMadper has joined #ruby
banisterfiend has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
harfangk has quit [Ping timeout: 248 seconds]
apeiros has joined #ruby
banisterfiend has quit [Client Quit]
banisterfiend has joined #ruby
jphase has quit [Ping timeout: 260 seconds]
bronson_ has joined #ruby
gizmore|2 has joined #ruby
bronson has quit [Read error: Connection reset by peer]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
zautomata has quit [Ping timeout: 240 seconds]
sspreitz has quit [Ping timeout: 248 seconds]
gizmore has quit [Ping timeout: 240 seconds]
lobloblobster has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
harfangk has joined #ruby
sspreitz has joined #ruby
code_zombie has joined #ruby
conta has quit [Ping timeout: 248 seconds]
zautomata has joined #ruby
darkmorph has quit [Ping timeout: 255 seconds]
jphase has joined #ruby
harfangk_ has joined #ruby
harfangk has quit [Remote host closed the connection]
harfangk_ has quit [Remote host closed the connection]
apeiros has joined #ruby
jphase has quit [Ping timeout: 255 seconds]
apeiros has quit [Ping timeout: 240 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
apeiros has joined #ruby
jphase has joined #ruby
alex`` has joined #ruby
zautomata has quit [Ping timeout: 240 seconds]
apeiros has quit [Ping timeout: 240 seconds]
zautomata has joined #ruby
jphase has quit [Ping timeout: 240 seconds]
bruce_lee has quit [Ping timeout: 240 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
mim1k has joined #ruby
kapil___ has joined #ruby
jphase has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
bronson_ has quit [Ping timeout: 248 seconds]
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
hutch34 has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
ElDoggo has joined #ruby
minimalism has quit [Quit: minimalism]
haraoka has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
agent_white has joined #ruby
jphase has joined #ruby
ElDoggo_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElDoggo has quit [Ping timeout: 260 seconds]
ElDoggo has joined #ruby
GodFather has quit [Ping timeout: 248 seconds]
ElDoggo__ has joined #ruby
cdg has quit [Remote host closed the connection]
ap4y has quit [Quit: WeeChat 1.9.1]
cdg has joined #ruby
ElDogg___ has joined #ruby
ElDoggo_ has quit [Ping timeout: 260 seconds]
ElDoggo has quit [Ping timeout: 248 seconds]
ElDoggo has joined #ruby
ElDoggo__ has quit [Ping timeout: 248 seconds]
ur5us has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 246 seconds]
ElDoggo_ has joined #ruby
ElDogg___ has quit [Ping timeout: 248 seconds]
ElDoggo__ has joined #ruby
ElDoggo has quit [Ping timeout: 260 seconds]
dviola has quit [Quit: WeeChat 1.9.1]
hutch34 has quit [Ping timeout: 252 seconds]
jphase has quit [Ping timeout: 260 seconds]
bdonnahue has quit [Ping timeout: 248 seconds]
ElDoggo_ has quit [Ping timeout: 248 seconds]
ElDoggo__ has quit [Ping timeout: 248 seconds]
ElDoggo_ has joined #ruby
agent_white has quit [Ping timeout: 260 seconds]
ElDoggo__ has joined #ruby
ElDoggo has joined #ruby
ElDoggo_ has quit [Ping timeout: 248 seconds]
justwentviral has quit [Quit: Page closed]
ElDoggo_ has joined #ruby
ElDoggo__ has quit [Ping timeout: 240 seconds]
ElDoggo has quit [Ping timeout: 240 seconds]
ElDoggo has joined #ruby
ElDoggo_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
ElDoggo has quit [Ping timeout: 240 seconds]
ElDoggo has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
bronson has joined #ruby
jphase has joined #ruby
ElDoggo has quit [Ping timeout: 240 seconds]
ElDoggo has joined #ruby
agent_white has joined #ruby
troys_ is now known as troys
ElDoggo_ has joined #ruby
millerti has quit [Quit: Textual IRC Client: www.textualapp.com]
ElDoggo has quit [Ping timeout: 248 seconds]
enterprisey has quit [Remote host closed the connection]
ElDoggo has joined #ruby
cschneid_ has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 248 seconds]
apeiros has joined #ruby
ElDoggo_ has quit [Ping timeout: 258 seconds]
ElDoggo__ has joined #ruby
ElDoggo_ has joined #ruby
ElDoggo has quit [Ping timeout: 248 seconds]
jphase has quit [Ping timeout: 260 seconds]
apeiros has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
ElDoggo has joined #ruby
ElDoggo__ has quit [Ping timeout: 258 seconds]
ElDoggo__ has joined #ruby
ElDoggo_ has quit [Ping timeout: 240 seconds]
ElDoggo_ has joined #ruby
ElDoggo has quit [Ping timeout: 258 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
ElDoggo__ has quit [Ping timeout: 248 seconds]
guardianx has quit []
ElDoggo__ has joined #ruby
claw has quit [Ping timeout: 240 seconds]
ElDoggo_ has quit [Ping timeout: 248 seconds]
gix has quit [Ping timeout: 260 seconds]
jphase has joined #ruby
ElDoggo_ has joined #ruby
apeiros has joined #ruby
ElDoggo has joined #ruby
ElDoggo__ has quit [Ping timeout: 260 seconds]
jphase has quit [Ping timeout: 240 seconds]
gix has joined #ruby
ElDoggo_ has quit [Ping timeout: 248 seconds]
ElDoggo_ has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
ElDoggo has quit [Ping timeout: 248 seconds]
claw has joined #ruby
jud has joined #ruby
jphase has joined #ruby
ElDoggo_ has quit [Ping timeout: 248 seconds]
jphase has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
govg has joined #ruby
jud has quit [Quit: Leaving]
jphase has joined #ruby
hutch34 has quit [Ping timeout: 252 seconds]
biox_ has joined #ruby
lacour has quit [Quit: Leaving]
uZiel has quit [Read error: Connection reset by peer]
[[thufir]] has quit [Remote host closed the connection]
jphase has quit [Ping timeout: 260 seconds]
apeiros has joined #ruby
guardianx has joined #ruby
uZiel has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
xall has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
uZiel has joined #ruby
jphase has joined #ruby
csk157 has joined #ruby
LocaMocha has joined #ruby
Freshnuts has joined #ruby
jphase has quit [Ping timeout: 252 seconds]
csk157 has quit [Ping timeout: 248 seconds]
mson has quit [Quit: Connection closed for inactivity]
mim1k has joined #ruby
xall has quit [Quit: xall]
d5sx43 has joined #ruby
anisha has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
LocaMocha has quit [Ping timeout: 240 seconds]
aupadhye has joined #ruby
k3rn31 has joined #ruby
d5sx43 has quit [Quit: Leaving...]
Technodrome has joined #ruby
LocaMocha has joined #ruby
LocaMocha has quit [Ping timeout: 248 seconds]
LocaMocha has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
troys has quit [Quit: Bye]
vondruch has quit [Ping timeout: 248 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
guardianx has quit [Read error: Connection reset by peer]
hutch34 has quit [Ping timeout: 240 seconds]
nertzy3 has quit [Ping timeout: 240 seconds]
guardianx has joined #ruby
guardianxx has joined #ruby
mim1k has joined #ruby
guardianx has quit [Read error: Connection reset by peer]
pb122 has joined #ruby
armyriad has quit [Quit: Leaving]
armyriad has joined #ruby
armyriad has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
guardianxx has quit [Read error: Connection reset by peer]
ElDoggo has joined #ruby
ElDoggo_ has joined #ruby
ElDoggo has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
code_zombie has quit [Quit: Leaving]
ElDoggo__ has joined #ruby
armyriad has joined #ruby
ElDoggo_ has quit [Ping timeout: 248 seconds]
ElDoggo_ has joined #ruby
apeiros has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
quobo has joined #ruby
ElDoggo has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
ElDoggo__ has quit [Ping timeout: 260 seconds]
ElDogg___ has joined #ruby
ElDoggo_ has quit [Ping timeout: 240 seconds]
ElDoggo_ has joined #ruby
apeiros has quit [Ping timeout: 248 seconds]
ElDoggo has quit [Ping timeout: 252 seconds]
ElDogg___ has quit [Ping timeout: 252 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
ElDoggo_ has quit [Ping timeout: 248 seconds]
hays_ has joined #ruby
apeiros has joined #ruby
Emmanuel_Chanel has joined #ruby
<hays_> basically looking for how to package a CLI tool as a gem
<matthewd> hays_: I'm not sure what that does.. but see e.g. https://github.com/rails/rails/blob/master/railties/exe/rails
apeiros has quit [Ping timeout: 240 seconds]
kculpis has quit [Ping timeout: 240 seconds]
<hays_> yep that looks like the analog
<hays_> matthewd: is there a way to 'run' the gem without installing it? for more rapid testing?
apeiros has joined #ruby
imode has joined #ruby
<hays_> matthewd: the shebang thing is not particularly portable to say Windows..
hutch34 has joined #ruby
dinoangelov has joined #ruby
<matthewd> That rails command is executable in place
<matthewd> It sets up the load path ($:) manually, but I think a modern approach would just rely on bundler to do that
<hays_> rails?
<matthewd> So you'd do `bundle exec ./exe/mycmd`
<matthewd> exe/rails, the example I linked
<hays_> s.executables << 'hola'
<matthewd> As for Windows... tbh it's been many years since I've touched one, so don't remember *how*, but something makes it work ¯\_(ツ)_/¯
<hays_> it does it by file extension
<hays_> so i guess portability is achieved if you name your executables .rb
<matthewd> I mean something makes it so that `gem install rails` + `rails` works
hutch34 has quit [Ping timeout: 252 seconds]
<matthewd> I gave you three links -- the docs, and two halves of how the `rails` command works in Rails as a real-world example
<matthewd> But the guide also has an example of running it in place: `ruby -Ilib ./bin/hola`
jameser has quit [Remote host closed the connection]
<hays_> maybe there is some windows magic. i'll have to fire up my VM and see
dinoangelov is now known as dangelov
<matthewd> I want to say rubygems creates a foo.bat maybe?
<hays_> that sounds just ugly enough to be right
<hays_> god i hate windows
<hays_> my company is trying to pry the macbooks out of developers' hands
<hays_> nice
reber has joined #ruby
<hays_> ok with all that bookmarked im going to bed. 3am in home time zone
<hays_> thans
<hays_> thanks
hays_ has quit [Remote host closed the connection]
aufi has joined #ruby
Dreamer3 has joined #ruby
dangelov has quit [Ping timeout: 240 seconds]
Technodrome has joined #ruby
alex`` has quit [Ping timeout: 258 seconds]
TomyWork has joined #ruby
alex`` has joined #ruby
conta has joined #ruby
Technodrome has quit [Ping timeout: 240 seconds]
hxegon has joined #ruby
hxegon has quit [Client Quit]
hxegon has joined #ruby
TinkerTyper has joined #ruby
TinkerTyper_ has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
Burgestrand has joined #ruby
imode has quit [Ping timeout: 240 seconds]
hutch34 has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
Dimik has quit [Ping timeout: 248 seconds]
csk157 has joined #ruby
csk157 has quit [Ping timeout: 255 seconds]
uZiel has quit [Ping timeout: 240 seconds]
mn3m has joined #ruby
uZiel has joined #ruby
claudiuinberlin has joined #ruby
FahmeF_ has joined #ruby
mark_66 has joined #ruby
nertzy has joined #ruby
FahmeF has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 264 seconds]
ams__ has joined #ruby
uZiel has quit [Ping timeout: 258 seconds]
cabotto has joined #ruby
Ltem has joined #ruby
uZiel has joined #ruby
paranoicsan has joined #ruby
vtx has quit [Quit: vtx]
vondruch has joined #ruby
Dreamer3 has quit [Read error: Connection reset by peer]
vondruch has quit [Client Quit]
Dreamer3 has joined #ruby
vondruch has joined #ruby
Dreamer3 has quit [Client Quit]
hutch34 has joined #ruby
VladGh_ has joined #ruby
VladGh has quit [Ping timeout: 248 seconds]
bigkevmcd has joined #ruby
<_ppp> Hello,I am currently at the planning phase of my project and would like to study the different options i have to start building my website and its backend.
<_ppp> I was thinking if there is an opensource framework i can build upon like wordpress or others that would allow me to create a IT request/response ticketing solution. Mainly customers can login, submit their requests, IT professionals can login takethe request, submit the solution and get paid. The system needs to be flexible where i can change parameters for the request screen, make the request flow from one status to another etc.
<_ppp> Is there an existing framework i can build on instead of coding from scratch the whole engine? Your opinion is really valuable to me thank you
<dminuoso> _ppp: Yes.
<dminuoso> _ppp: Jira Service Desk is an example. Other alternatives exist.
<apeiros> redmine is a rails based ticket system
<apeiros> we use and extended it at work
<apeiros> Since I have not worked on extending it myself, I can't give any account on how good the interfaces are
zer0python has quit [Ping timeout: 248 seconds]
vondruch has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 252 seconds]
<dminuoso> _ppp: ?cross
<dminuoso> ?cross _ppp
<ruby[bot]> dminuoso: I don't know anything about cross
bauruine has quit [Quit: ZNC - http://znc.in]
<dminuoso> ?crosspost _ppp
<ruby[bot]> _ppp: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<apeiros> oh, reminds me that I'm not in #rubyonrails anymore
Valkyrie_ has joined #ruby
<dminuoso> apeiros: This was in #javascript.
<apeiros> oh
bruno- has joined #ruby
Tempesta has quit [Ping timeout: 240 seconds]
Valkyrie_ is now known as Tempesta
Tempesta has quit [Changing host]
Tempesta has joined #ruby
xcesariox has joined #ruby
bauruine has joined #ruby
Beams has joined #ruby
Tempesta has quit [Quit: See ya!]
workmad3 has joined #ruby
xcesariox has quit [Client Quit]
vondruch has joined #ruby
<_ppp> ?
dionysus69 has joined #ruby
uZiel_ has joined #ruby
anisha_ has joined #ruby
anisha has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 264 seconds]
anisha_ has quit [Ping timeout: 248 seconds]
SpComb^ has quit [Ping timeout: 248 seconds]
vtx has joined #ruby
<dminuoso> Err, what am I doing wrong here?
<dminuoso> https://eval.in/890646 this works
<dminuoso> What the heck is going on?
<dminuoso> Is this a bug?
Hexafox[I] has joined #ruby
<apeiros> Module.new do <-- that block goes to prepend
<dminuoso> Argh.
<dminuoso> Not a year goes by where I get tripped up.
<apeiros> precedence. it matters. :-p
<dminuoso> Hehe.
<apeiros> I do wish methods which don't take a block raised
<apeiros> it wouldn't solve the problem but some cases would be more obvious
lxsameer has joined #ruby
stamina has joined #ruby
<dminuoso> Yeah. :(
<dminuoso> apeiros: Look at this gross hack: https://gist.github.com/dminuoso/4f2454e6e29c7205d8bdb387e7e8a883
<dminuoso> I really do need to write a paginator for kaminari in pure cells. :(
anisha_ has joined #ruby
RickHull has quit [Ping timeout: 260 seconds]
Tempesta has joined #ruby
milardovich has joined #ruby
Sylvia has joined #ruby
jaruga has joined #ruby
jottr has joined #ruby
Sylvia is now known as Guest34216
<apeiros> dminuoso: I'll not pretend to understand what you're doing there ;-)
<apeiros> kaminari is the successor to will_paginate?
Guest34216 has quit [Client Quit]
<dminuoso> It's an alternative, but yeah.
<apeiros> I see
<dminuoso> apeiros: Part of the problem is that all these rails things follow that "throw everything into helpers" conventions.
<apeiros> well, got my holidays, so I'll finally continue on my project I had to abandon 2y ago. a syncing table widget is part of it :)
<dminuoso> And trailblazers doesn't do that, so basically every helper is opt-in. This basically means a lot of things break.
<dminuoso> Oh that secret project you told me about without telling me anything?
<apeiros> yepp
<apeiros> that one
<dminuoso> :)
<apeiros> I hope I'll be able to tell about parts of it after these holidays
banisterfiend has joined #ruby
mim1k has joined #ruby
<argoneus> hello
<argoneus> as part of a homework I wrote some code that works, but I have no clue why
<argoneus> I have a module, inside it a function called "sum", and its only statement is 'reduce(:+)', this module is than included in a class that also includes enumerable, and for some reason calling 'sum' on this gives the desired result
<argoneus> what exactly does it mean if I just have 'reduce(:+)'? I can't find any doc on this
<argoneus> all I see is that reduce is a method of Enumerable, but inside this other module I'm writing, I don't include Enumerable
bruno- has quit [Quit: Lost terminal]
<argoneus> and what does that even return
bruno- has joined #ruby
hutch34 has joined #ruby
mikecmpbll has joined #ruby
bruno- has quit [Client Quit]
bruno- has joined #ruby
hutch34 has quit [Ping timeout: 264 seconds]
<banisterfiend> anyone here famiiliar with net/http and ssl requests?
wu__ has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
cadillac_ has quit [Ping timeout: 240 seconds]
CrazyEddy has quit [Remote host closed the connection]
hutch34 has joined #ruby
cadillac_ has joined #ruby
* sneep met Matz today \o/
<elomatreb> argoneus: Does something you extend include Enumerable? Check with YourModule.ancestors
ldnunes has joined #ruby
<apeiros> argoneus: since you include your module into a class which also includes Enumerable, that's sufficient
reber has quit [Remote host closed the connection]
hfp_work has quit [Quit: bye]
<apeiros> your module's instance methods, when called on an instance of the including class, can access all instance methods of that class. that includes all methods gained from including other modules.
<dminuoso> argoneus: reduce(:+) is just a shortcut for reduce(&:+)
<apeiros> and as such, the docs you look for are indeed Enumerable#reduce
<apeiros> &ri Enumerable#reduce argoneus
Pisuke has joined #ruby
<dminuoso> Or actually not exactly.
Bearded_Reaper is now known as kspencer
PaulCapestany has quit [Read error: Connection reset by peer]
Arun__ has joined #ruby
<dminuoso> apeiros: see, if ruby had autocurrying this would be so simple. reduce((+)) :(
ElDoggo has joined #ruby
MyMind has quit [Ping timeout: 255 seconds]
CrazyEddy has joined #ruby
<banisterfiend> apeiros sup homie you familiar with ssl and net/http ?
<banisterfiend> apeiros i need to hit a server using https and i need to verify the identify of the server, any ideas? :D
<apeiros> banisterfiend: not really. I have code which performs https calls using net/http, but that's about it
hfp_work has joined #ruby
_sfiguser has joined #ruby
ElDoggo_ has joined #ruby
tomphp has joined #ruby
ElDoggo has quit [Ping timeout: 240 seconds]
<apeiros> verify the server's identity? I guess you'd have to check the cert it returns?
PaulCape_ has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<banisterfiend> apeiros yeah, i was told that ruby does that automatically as it bundles an up to date ca store with the common CAs in it
<banisterfiend> but i wanted to know for sure
<apeiros> I remember rvm doing that, but I don't remember ruby itself doing it
ElDoggo_ has quit [Ping timeout: 246 seconds]
ElDoggo has joined #ruby
<apeiros> and I think you can tell net/http where to look for ca's, but I don't know the relevant methods by heart
<apeiros> we usually had to disable cert checking because our infra guys couldn't be arsed to get proper certs on internal servers :(
<elomatreb> Reading is hard
Arun__ has quit [Ping timeout: 260 seconds]
ElDoggo has quit [Ping timeout: 260 seconds]
rburton_ has joined #ruby
<rburton_> is there a way to see the checks and choices made by eg ext/dbm when it builds? want to verify what db backend it ends up picking.
InfinityFye has joined #ruby
milardovich has quit [Remote host closed the connection]
csk157 has joined #ruby
milardovich has joined #ruby
MrSkeltal is now known as mniip
csk157 has quit [Ping timeout: 248 seconds]
milardovich has quit [Ping timeout: 248 seconds]
ElDoggo has joined #ruby
ElDoggo has quit [Remote host closed the connection]
milardovich has joined #ruby
johnDoe1122 has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apparition has joined #ruby
johnDoe1122 has quit [Remote host closed the connection]
alex`` has quit [Quit: WeeChat 1.9.1]
guardianxx has joined #ruby
sparrow_mango has joined #ruby
old1101 has joined #ruby
<old1101> hello, the best practice is to always install the gems in vendor/ on bundler? (even when deployment for isolation)
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<old1101> it seems to me that vendor/bundle should always be the default (ruby newbie)
<elomatreb> Usually you don't want that, if you have multiple projects you will needlessly duplicate the gem files. The default bundler action is to store them in a shared directory, and get the project to use the right one at runtime
<old1101> but if project A uses gem-x-1.2 and project B uses gem-x.1.5
<old1101> it seems nice to have it always scoped, no?
<old1101> or `gem` handles it?
<elomatreb> Bundler does that at runtime, if your project has a gemfile it will use the one specified in it, even if there are multiple versions installed on the system
<old1101> so I can have two global versions of the same gem?
<old1101> different*
<elomatreb> Yes.
<old1101> s2
<old1101> thanks
csk157 has joined #ruby
leah2 has quit [Ping timeout: 248 seconds]
leah2 has joined #ruby
<argoneus> oh I see
<argoneus> so whether reduce() exists or not is determined in the class that incldues the module
<argoneus> not in the module itself
sparrow_mango has quit []
<elomatreb> Calling a method without a receiver is equivalent to calling it on self, so yes
pierrearseufrasi has joined #ruby
aclark has quit [Remote host closed the connection]
aclark has joined #ruby
guardianxx has quit []
synthroid has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
ElDoggo has joined #ruby
mson has joined #ruby
stan has quit [Remote host closed the connection]
ek926m has joined #ruby
ElDoggo has quit [Remote host closed the connection]
ElDoggo has joined #ruby
stan has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElDoggo has quit [Ping timeout: 248 seconds]
milardovich has quit [Read error: Connection reset by peer]
<argoneus> ah, I see
sagax has quit [Quit: Konversation terminated!]
milardovich has joined #ruby
ledestin has joined #ruby
alex`` has joined #ruby
n13z has joined #ruby
claudiuinberlin has joined #ruby
Burgestrand has quit [Quit: Good bye and have a nice day!]
ledestin has quit [Ping timeout: 240 seconds]
rburton_ has left #ruby ["Textual IRC Client: www.textualapp.com"]
wu__ has quit [Ping timeout: 252 seconds]
milardov_ has joined #ruby
milardov_ has quit [Remote host closed the connection]
milardovich has quit [Read error: Connection reset by peer]
Ropeney has joined #ruby
Ropeney has quit [Client Quit]
InfinityFye has quit [Ping timeout: 258 seconds]
milardovich has joined #ruby
bruno- has quit [Ping timeout: 258 seconds]
milardovich has quit [Ping timeout: 264 seconds]
cabotto has quit [Remote host closed the connection]
cabotto has joined #ruby
bruno- has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
Burgestrand has joined #ruby
Psybur has joined #ruby
Burgestrand has quit [Client Quit]
biberu has joined #ruby
cabotto has quit [Ping timeout: 248 seconds]
heartbleed is now known as emerson
vondruch_ has joined #ruby
tcopeland has quit [Quit: tcopeland]
vondruch_ is now known as vondruch
vondruch has quit [Ping timeout: 240 seconds]
sagax has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
jphase has joined #ruby
cabotto has joined #ruby
Tempesta has quit [Quit: See ya!]
cdg has joined #ruby
charliesome has joined #ruby
shinnya has joined #ruby
Tempesta has joined #ruby
jphase has quit []
cdg_ has joined #ruby
csk157_1 has joined #ruby
csk157 has quit [Quit: WeeChat 1.9.1]
cdg has quit [Ping timeout: 240 seconds]
pierrearseufrasi has left #ruby ["Sair"]
jphase has joined #ruby
ramakanta has joined #ruby
ramakanta has quit [Quit: Sair]
sepp2k has joined #ruby
xcesariox has joined #ruby
Burgestrand has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
dionysus69 has quit [Ping timeout: 246 seconds]
creepycats is now known as cats
<old1101> how can I run a ruby gem without gemspec file?
ElDoggo_ has joined #ruby
<old1101> "ruby gem" = I'm using just bundle
<old1101> I would like to run lib/my_app.rb
GodFather has joined #ruby
<old1101> rspec puts my lib/ on load_path e.g.
Tempesta has quit [Quit: See ya!]
tvw has joined #ruby
Tempesta has joined #ruby
GodFather has quit [Client Quit]
ElDoggo_ has quit [Ping timeout: 248 seconds]
GodFather has joined #ruby
minimalism has joined #ruby
xcesariox has quit [Quit: Textual IRC Client: www.textualapp.com]
Burgestrand has quit [Quit: Good bye and have a nice day!]
darkmorph has joined #ruby
brw has quit [Quit: Off to listen to some tunes...]
Burgestrand has joined #ruby
MrBismuth has quit [Quit: https://www.youtube.com/watch?v=xIIqYqtR1lY -- Suicide is Painless - Johnny Mandel]
DLSteve has joined #ruby
<old1101> seriously, how can I run my code (lib/app.rb) with bundler context? (files `lib/ Gemfile Gemfile.lock`)
<Papierkorb> bundle exec lib/foo.rb
dinfuehr has quit [Ping timeout: 264 seconds]
<old1101> god lord, I was using `bundle exec ruby`
<old1101> thanks
dinfuehr has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
Hexafox[I] has quit [Ping timeout: 260 seconds]
mjolnird has joined #ruby
anisha_ has quit [Quit: Leaving]
imperator has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
imperator has quit [Client Quit]
Rapture has joined #ruby
old1101 has left #ruby ["Leaving"]
jottr has joined #ruby
csk157_1 has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
tcopeland has joined #ruby
John__ has joined #ruby
cabotto has quit [Remote host closed the connection]
brw has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
aswen has joined #ruby
quobo has joined #ruby
rt has quit [Quit: rt]
ek926m has quit [Ping timeout: 258 seconds]
jrafanie has joined #ruby
matti has joined #ruby
cabotto has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
chouhoulis has joined #ruby
matti has quit [Quit: Oh dear ...]
cabotto has quit [Ping timeout: 264 seconds]
matti has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
vee__ has quit [Ping timeout: 248 seconds]
vondruch_ has joined #ruby
troys has joined #ruby
ResidentBiscuit has quit [Quit: Critical Miss]
jrafanie_ has joined #ruby
vondruch_ is now known as vondruch
nowhere_man has joined #ruby
jrafanie has quit [Ping timeout: 264 seconds]
cschneid_ has joined #ruby
bruno- has joined #ruby
hhffppff has joined #ruby
ek926m has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
claudiuinberlin has joined #ruby
vee__ has joined #ruby
anisha has joined #ruby
cgfbee has quit [Ping timeout: 248 seconds]
charliesome_ has joined #ruby
milardovich has joined #ruby
charliesome has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 246 seconds]
vtx has quit [Quit: vtx]
lasenna[m] has quit [Ping timeout: 246 seconds]
kua[m] has quit [Ping timeout: 264 seconds]
KevinMGranger has quit [Ping timeout: 248 seconds]
solocshaw has joined #ruby
milardovich has quit [Ping timeout: 258 seconds]
lasenna[m] has joined #ruby
kua[m] has joined #ruby
cgfbee has joined #ruby
csk157_1 has joined #ruby
KevinMGranger has joined #ruby
Junaos has quit [Quit: ZNC - http://znc.in]
csk157_1 has quit [Ping timeout: 260 seconds]
vee__ has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
solocshaw has quit [Ping timeout: 255 seconds]
pilne has quit [Quit: Quitting!]
charliesome_ has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 260 seconds]
polishdub has joined #ruby
dextrey has joined #ruby
happyface has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
bronson has joined #ruby
cschneid_ has joined #ruby
guacamole has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElDoggo has joined #ruby
charliesome_ has joined #ruby
guacamole has quit [Client Quit]
paranoicsan has quit [Quit: paranoicsan]
iamarun has joined #ruby
guacamole has joined #ruby
vee__ has joined #ruby
nikhgupta1 has joined #ruby
charliesome has quit [Ping timeout: 240 seconds]
guacamole has quit [Client Quit]
ElDoggo has quit [Ping timeout: 255 seconds]
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElDoggo has joined #ruby
nikhgupta1 has quit [Ping timeout: 246 seconds]
jrafanie has joined #ruby
iamarun has quit [Remote host closed the connection]
nikhgupta1 has joined #ruby
lobloblobster has joined #ruby
ek926m has quit [Ping timeout: 246 seconds]
claudiuinberlin has joined #ruby
guacamole has joined #ruby
safetypin has joined #ruby
charliesome has joined #ruby
guacamole has quit [Client Quit]
charliesome_ has quit [Ping timeout: 255 seconds]
PaulCape_ has quit [Read error: Connection reset by peer]
apparition has quit [Quit: Bye]
cagomez has joined #ruby
PaulCapestany has joined #ruby
nikhgupta1 has quit [Quit: WeeChat 1.9.1]
nikhgupta has joined #ruby
safetypin has quit [Quit: Textual IRC Client: www.textualapp.com]
safetypin has joined #ruby
kculpis has joined #ruby
nikhgupta1 has joined #ruby
nikhgupta has quit [Ping timeout: 252 seconds]
charliesome_ has joined #ruby
charliesome has quit [Ping timeout: 260 seconds]
Junaos has joined #ruby
hhffppff has quit [Quit: Leaving]
mark_66 has quit [Remote host closed the connection]
bronson_ has joined #ruby
bronson has quit [Read error: Connection reset by peer]
solocshaw has joined #ruby
nikhgupta1 has quit [Quit: WeeChat 1.9.1]
nikhgupta has joined #ruby
RougeR has joined #ruby
lacour has joined #ruby
charliesome has joined #ruby
charliesome_ has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
troys is now known as troys_
cdg_ has quit [Ping timeout: 240 seconds]
nikhgupta has quit [Quit: WeeChat 1.9.1]
nikhgupta has joined #ruby
solocshaw1 has joined #ruby
cdg_ has joined #ruby
solocshaw has quit [Ping timeout: 246 seconds]
solocshaw1 is now known as solocshaw
troys_ is now known as troys
cdg has quit [Ping timeout: 240 seconds]
ldnunes has quit [Ping timeout: 264 seconds]
aswen has quit [Quit: WeeChat 1.6]
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
raynold has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
conta has quit [Ping timeout: 248 seconds]
vipaca has joined #ruby
charliesome_ has joined #ruby
orbyt_ has joined #ruby
charliesome has quit [Ping timeout: 240 seconds]
Dreamer3 has joined #ruby
ldnunes has joined #ruby
code_zombie has joined #ruby
Guest77 has joined #ruby
Guest77 is now known as dragon14
<dragon14> anyone have time to help me debug a ruby-install issue? I'm trying to install ruby v2.3.4 but getting the following error: /usr/include/sys/syslog.h:227:124: error: expected ',' or ';' before '__asm' on Mac OS 10.13.1
Burgestrand has quit [Quit: Closing time!]
<raynold> ahh it's a wonderful day
<dragon14> mostly cloudy here with a high chance of ruby install errors lol
<havenwood> dragon14: It looks like there's a gcc bug: https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg544669.html
<dragon14> @havenwood hmm I had to install gcc6 just to get the process started
ozcanesen has joined #ruby
<havenwood> dragon14: Usually folk on macOS install "command line tools" including clang with: xcode-select --install
thinkpad has quit [Ping timeout: 240 seconds]
<dragon14> havenwood: yeah I have xcode command line tools installed
<havenwood> dragon14: See: https://github.com/rvm/rvm/issues/4200
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> dragon14: does it work if you set CC=clang but you want to use gcc?
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has joined #ruby
rippa has joined #ruby
<dragon14> hmm I haven't tried that.. I've simply been using ruby-install program to handle the installation..
steph__ has joined #ruby
ek926m has joined #ruby
<havenwood> dragon14: It seems you've installed gcc and are running into an issue with High Sierra and GCC.
kies has quit [Ping timeout: 240 seconds]
TomyWork has quit [Ping timeout: 240 seconds]
<dragon14> havenwood: yes that's correct. This all started with the High Sierra upgrade (I previously had 2.3.4 installed.. but it stopped working with a readline error after the high sierra update
<havenwood> dragon14: I'd recommend going back to the default clang, unless you really want to debug the gcc/high sierra issues.
<dragon14> I'm using ruby-install application (always have)
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dragon14> so I removed 2.3.4 ruby.. and tried a reinstall with ruby-install but now getting this syslog gcc error
<havenwood> dragon14: So you've installed gcc, and ruby-install is using it. That's not the default setup on macOS.
<havenwood> dragon14: Check: gcc --version
<havenwood> dragon14: With the macOS command line tools, it'd be expected to be: Apple LLVM version 9.0.0 (clang-900.0.38)
<dragon14> Apple LLVM version 9.0.0 (clang-900.0.38)
rkoller has joined #ruby
DTZUZO has quit [Ping timeout: 260 seconds]
<havenwood> dragon14: Could you confirm that setting CC doesn't work, just to rule it out?: ruby-install ruby 2.3.4 -- CC=clang
claudiuinberlin has joined #ruby
<dragon14> interesting.. my first attempt to run ruby-install errored saying it could't find gcc6 so I brew installed it.. which allowed it to get started.. but then the error I relayed..
<dragon14> ok trying that now havenwood
<havenwood> dragon14: The issue is that it's using gcc, and running into this gcc/macOS bug.
<havenwood> It looks like some folk resolve that linking bug by reinstalling macOS >.>
<havenwood> So I'd probably use clang until they get that resolved. ;-P
<dragon14> yeah I read that.. uh.. this is my work computer.. I'm not completely reinstalling the OS lol
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
<havenwood> dragon14: But the issue is likely going to be the same whether you use RVM or ruby-install or build Ruby yourself, as long as you're using gcc on that install of macOS.
stamina has quit [Quit: WeeChat 1.9.1]
jamesaxl has quit [Ping timeout: 240 seconds]
<dragon14> havenwood yeah that makes sense.. hopefully forcing CC to clang does the trick
<matthewd> > errored saying it could't find gcc6
<matthewd> Do you happen to still have that message in scrollback?
<matthewd> It sounds.. unexpected
<dragon14> matthewd I don't sadly.. I went back and looked when I mentioned it.. but it's outside my buffer :(
<havenwood> I suspect a badly linked gcc from an old install.
mjolnird has quit [Quit: Leaving]
<havenwood> Default clang never got involved.
<havenwood> It is curious.
<dragon14> havenwood so that appears to have worked!
<havenwood> dragon14: congrats!
dviola has joined #ruby
<dragon14> ah you know what.. I was forcing it to use gcc6 in my old alias *sigh*
<dragon14> ruby-install --no-install-deps ruby $1 -- --disable-install-doc --with-gcc=gcc-6
<dragon14> now I'm not sure why (I set up that alias like 4 years ago)
<havenwood> dragon14: I was confused why that was happening, that explains it. The fact that `gcc` wasn't aliased was hurting my brain.
troulouliou_div2 has joined #ruby
<dragon14> havenwood you and me both honestly lol..
<matthewd> I think you used to need gcc for 1.8 or something, maybe?
<dragon14> yeah most likely ruby-1.9.3-p392
<havenwood> anything older than older than 1.9.3-p429
<havenwood> that was the patch with the fix
<dragon14> I'll just go ahead and update that alias right now
<dragon14> lol
mgorbach has quit [Remote host closed the connection]
<dragon14> havenwood: I truly appreciate your help.. I've been scratching my head for hours on this..
bitemyapp has left #ruby [#ruby]
<havenwood> dragon14: you're welcome
dn`_ has joined #ruby
dn` has quit [Read error: Connection reset by peer]
dn`_ is now known as dn`
ek926m has quit [Ping timeout: 260 seconds]
mgorbach has joined #ruby
csk157_1 has joined #ruby
mgorbach has quit [Client Quit]
ujjain has quit [Ping timeout: 248 seconds]
mgorbach has joined #ruby
<dragon14> now to try and track down why all these gem ignores are happening and requesting I pristine them all after the high sierra update.. *sigh*
<dragon14> I haven't coded in over a year now (been playing scrum master).. but my company just fired everyone else and left only me.. good news is I get to code again.. bad news is NONE of my dev environments are up to date oh the joy
<dragon14> (well not fired.. layed off)
mgorbach has quit [Remote host closed the connection]
csk157_1 has quit [Ping timeout: 252 seconds]
vee__ has quit [Ping timeout: 248 seconds]
mgorbach has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
ujjain has joined #ruby
charliesome has joined #ruby
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
MrBusiness has joined #ruby
vipaca has joined #ruby
FahmeF_ has quit [Ping timeout: 248 seconds]
dextrey has quit [Ping timeout: 248 seconds]
profP has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aloy has quit [Ping timeout: 255 seconds]
SCHAPiE has quit [Ping timeout: 260 seconds]
conta2 has joined #ruby
vee__ has joined #ruby
aloy has joined #ruby
conta2 has quit [Ping timeout: 260 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
charliesome has quit [Ping timeout: 240 seconds]
John__ has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
John__ has joined #ruby
kies has joined #ruby
FahmeF has joined #ruby
jdawgaz has joined #ruby
marxarelli|afk is now known as marxarelli
cabotto has joined #ruby
SCHAPiE has joined #ruby
brendan- has joined #ruby
tomphp has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
Dimik has joined #ruby
ek926m has joined #ruby
jdawgaz has joined #ruby
orbyt_ has joined #ruby
csk157_1 has joined #ruby
bmurt has quit [Client Quit]
profP has left #ruby [#ruby]
orbyt_ has quit [Client Quit]
orbyt_ has joined #ruby
mjolnird has joined #ruby
Beams has quit [Quit: .]
ek926m has quit [Ping timeout: 240 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndBobsYourUncle has joined #ruby
vee__ has quit [Ping timeout: 240 seconds]
SeepingN has joined #ruby
jdawgaz has joined #ruby
vee__ has joined #ruby
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
_sfiguser has quit [Ping timeout: 246 seconds]
jrafanie has joined #ruby
claudiuinberlin has quit [Client Quit]
vipaca has joined #ruby
alnewkirk has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
lxsameer has quit [Quit: WeeChat 1.9.1]
jdawgaz has quit [Client Quit]
blackwind_123 has joined #ruby
alfiemax has joined #ruby
jdawgaz has joined #ruby
blackwind_123 has quit [Client Quit]
alnewkirk has quit [Ping timeout: 240 seconds]
_sfiguser has joined #ruby
blackwind_123 has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
cagomez has quit []
charliesome has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
mn3m has quit [Quit: mn3m]
impermanence has joined #ruby
Nexer has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta2 has joined #ruby
conta2 has quit [Read error: Connection reset by peer]
conta2 has joined #ruby
cdg has joined #ruby
michael1 has joined #ruby
cdg_ has quit [Ping timeout: 240 seconds]
cdg_ has joined #ruby
alex`` has quit [Ping timeout: 246 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has joined #ruby
cdg has quit [Ping timeout: 258 seconds]
nixfreak has joined #ruby
<nixfreak> using osx and brew
LocaMocha has quit [Ping timeout: 248 seconds]
<nixfreak> installed rbenv and set 2.4.2 to local and global
<nixfreak> but ruby -v still says 2.0
<nixfreak> what I am I missing ?
<croberts> not running linux
<croberts> is a start
troys is now known as troys_
<nixfreak> haha funny , don't have a choice at work
<nixfreak> but I agree
Antiarc has quit [Read error: Connection reset by peer]
cdg has joined #ruby
cdg has quit [Read error: Connection reset by peer]
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Antiarc has joined #ruby
<baweaver> PATH
adlerdias has joined #ruby
<baweaver> Give that a run through
jdawgaz has joined #ruby
vipaca has joined #ruby
jaruga has quit [Quit: jaruga]
vipaca has quit [Client Quit]
blackwind_123 has quit [Quit: Say What?]
Puffball has joined #ruby
cdg_ has quit [Ping timeout: 260 seconds]
<impermanence> I've installed this: https://github.com/postmodern/combinatorics and when I call Set['ab', 'cd', 'ef'].powerset I am returned #<Enumerator: #<Set: {"ab", "cd", "ef"}>:powerset> as opposed to what the documentation says powerset should return. Am I missing something here? I expected an array of objects...
hackeron has joined #ruby
MrPunkin has joined #ruby
<lupine> looks like it quacks fine
<MrPunkin> I’m calling a bash script via %x(/bin/bash /path/to/script) and within that script I have a command that is supposed to run in the background (ends with &). It seems that if I run the shell script directly from the command line it does, however it seems that Ruby is waiting for the background subprocess to finish too. How can I program around this?
<impermanence> lupine: oh, yep. I see now. calling each on the enumerator return has straightened me out.
<impermanence> if you were talking to me.
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Antiarc has quit [Ping timeout: 252 seconds]
eckhardt has joined #ruby
claudiuinberlin has joined #ruby
<lupine> yup
Antiarc has joined #ruby
<lupine> MrPunkin: don't use `^x`. Use `Process::spawn` instead
Freshnuts has quit [Quit: Leaving]
<MrPunkin> lupine: thanks for the direction, much appreciated
Devalo has quit [Remote host closed the connection]
Devalo has joined #ruby
dragon14 has quit [Remote host closed the connection]
quobo has quit [Quit: Connection closed for inactivity]
<impermanence> How do I access elements in a data structure such as: #<Set: {3, 5, 7}>
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
segy has quit [Quit: ZNC - http://znc.in]
<elomatreb> Depends on what you mean by "access elements"
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Devalo has quit [Ping timeout: 246 seconds]
<impermanence> elomatreb: touch them to be used. they don't need to be mutated, deleted, nothing else.
jrafanie has joined #ruby
<impermanence> I guess I should just use the Set methods it seems...
<elomatreb> "touch them"? I'm not sure I get what you mean
<havenwood> impermanence: Are you trying to find a particular item in the set or iterate over all items or what?
chouhoulis has quit [Remote host closed the connection]
<impermanence> havenwood: iterate over all items
<impermanence> havenwood: looks like each is fine...
<havenwood> impermanence: Yes, set mixes in Enumerable as well - which works off of #each.
alfiemax has quit [Remote host closed the connection]
<impermanence> I suppose this ...each { |i| i.each { |j| p j } } is disgusting? :)
eckhardt has joined #ruby
<impermanence> This at least prints out what I'm looking to do, essentially
<impermanence> which is iterate of every element in something like this: [[1,2,3], [1,2], [1,3], [2,3], [1], [2], [3]]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
vipaca has joined #ruby
lxsameer has joined #ruby
<impermanence> Is a nested each like that terrible? I would guess that if I have to do that then probably there is a better way to do what I want.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 240 seconds]
vee__ has quit [Ping timeout: 248 seconds]
adlerdias has quit [Quit: adlerdias]
vipaca has quit [Client Quit]
vipaca has joined #ruby
<elomatreb> Try #flatten?
mson has quit [Quit: Connection closed for inactivity]
ozcanesen has quit [Quit: ozcanesen]
<impermanence> elomatreb: yep
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> or inject(:+) :P
InfinityFye has joined #ruby
<al2o3-cr> yeah, flatten your array :)
<elomatreb> flatten(1) if you don't want it to recurse, btw
jdawgaz has joined #ruby
synthroid has quit [Remote host closed the connection]
alfiemax has joined #ruby
charliesome has joined #ruby
<impermanence> elomatreb: this is specifically what I am trying to do: ...
<elomatreb> Recursing into nested arrays?
<impermanence> elomatreb: one sec
cabotto has quit []
synthroid has joined #ruby
mtkd has quit [Ping timeout: 248 seconds]
alfiemax has quit [Remote host closed the connection]
<impermanence> if any of [1, 2, 3] are factors of some number, then begin to check if the subsets of such an array are also factors: [1, 2], [1, 3], [2, 3] ... etc.
vee__ has joined #ruby
<impermanence> that's it
<nixfreak> sweet the directions for ruby-install worked great
<impermanence> I started thinking I would use Combinatorics#powerset
mtkd has joined #ruby
<nixfreak> now i have ruby as 2.4.2 thanks alot appreaciate
<impermanence> which I suppose I could...
<impermanence> but now, algorithmically I realize that if any of [1, 2, 3] are not factors then I don't even need to produce or check their corresponding subsets...
<impermanence> meh
<elomatreb> I'm too tired to think about something like that, sorry :)
jrafanie_ has joined #ruby
<impermanence> elomatreb: that makes [1,2].size of us :)
LBRapid has quit [Quit: ZNC - http://znc.in]
synthroid has quit [Ping timeout: 240 seconds]
jrafanie has quit [Ping timeout: 246 seconds]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
michael1 has quit [Ping timeout: 260 seconds]
guacamole has joined #ruby
<watzon> Question since I can't seem to find an answer by searching. What does it mean when a single quotation mark is used as a parameter? For instance, https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L341
cagomez has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
<Papierkorb> watzon: that's an empty string
tomphp has joined #ruby
<Papierkorb> there are two single-quots
nopolitica has joined #ruby
<dminuoso> watzon: It's a convention for so-called predicate methods.
<watzon> Lol I don't know what happened, I could've sworn it was a single double-quote a second ago
<watzon> I think I need to sleep
<dminuoso> watzon: (it's methods that are expected to return true or false)
<dminuoso> watzon: but know that its just part of the method name, so it's just "convention"
<havenwood> >> "''".bytes
<ruby[bot]> havenwood: # => [39, 39] (https://eval.in/890945)
LBRapid has joined #ruby
<dminuoso> watzon: you can also have a trailing !, but the meaning of that is muddy (sometimes it means "dangerous", or it means "mutates", or it means "exception-throwing-variant", or it means "this is some imperative stuff")
synthroid has joined #ruby
<watzon> Ahh I gotcha. That's good to know
tomphp has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
imode has joined #ruby
steph__ has quit [Remote host closed the connection]
steph_ has joined #ruby
vipaca has joined #ruby
moei has quit [Quit: Leaving...]
jamesaxl has joined #ruby
rkoller has quit [Quit: Textual IRC Client: www.textualapp.com]
nikhgupta has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 248 seconds]
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
orbyt_ has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vipaca has joined #ruby
eckhardt has joined #ruby
troys_ is now known as troys
jottr has joined #ruby
uZiel_ has quit [Read error: Connection reset by peer]
AndBobsYourUncle has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
cagomez has joined #ruby
devn has joined #ruby
uZiel has joined #ruby
ahoyhere has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
<devn> is there a way, once i'm in the ruby runtime, or via a flag on startup, to forcefully set the seed used for calls to String#hash ?
alnewkirk has joined #ruby
guacamole has joined #ruby
milardovich has joined #ruby
<devn> why you may ask? obfuscated ruby, nothing serious.
cagomez has quit [Ping timeout: 240 seconds]
dalitom has joined #ruby
<dalitom> hello good people !
kus_ubuntui686 has joined #ruby
kus_ubuntui686 has quit [Max SendQ exceeded]
cdg has joined #ruby
uZiel has quit [Ping timeout: 240 seconds]
PaulCapestany has quit [Read error: Connection reset by peer]
<apeiros> devn: sadly no. afair there's no code in mri to set String#hash's seed :(
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jamesaxl has quit [Ping timeout: 255 seconds]
<devn> apeiros: surely there must be some filthy hack
cdg has quit [Remote host closed the connection]
cdg_ has joined #ruby
<apeiros> last time I looked, the filthy hack would have involved patching ruby
<devn> does it get set down at the C level?
<apeiros> yes
<baweaver> set_trace_func maybe
<devn> baweaver: ?
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jamesaxl has joined #ruby
segy has joined #ruby
<dminuoso> baweaver: Oh boy that so reminds me of this:
PaulCapestany has joined #ruby
<dminuoso> Its a wonderful article though
jenrzzz has quit [Ping timeout: 258 seconds]
<elomatreb> The api looks a bit different now though (does set_trace_func even still work, or is it all in TracePoint now?)
<devn> baweaver: of course a post like that would come from aphyr :D
<dminuoso> elomatreb: It still works, but its deprecated.
<baweaver> Ah, TracePoint finally took over?
<baweaver> Shows how often I use that part
ozcanesen has joined #ruby
vee__ has quit [Ping timeout: 248 seconds]
postmodern has quit [Quit: Leaving]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vipaca has joined #ruby
polishdub has quit [Quit: leaving]
RougeR has quit [Read error: Connection reset by peer]
Devalo has joined #ruby
ldnunes has quit [Quit: Leaving]
snickers has joined #ruby
marr has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
postmodern has joined #ruby
Devalo has quit [Ping timeout: 248 seconds]
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
csk157_2 has joined #ruby
oleo is now known as oleo2
vee__ has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
oleo2 is now known as oleo
dionysus69 has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
csk157_1 has quit [Ping timeout: 260 seconds]
RickHull has joined #ruby
troys is now known as troys_
Nexer has quit [Quit: Connection closed for inactivity]
vee__ has quit [Ping timeout: 248 seconds]
DoubleMalt has joined #ruby
claudiuinberlin has joined #ruby
cdg has joined #ruby
DoubleMalt has quit [Client Quit]
jottr has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg_ has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
<dalitom> question... how do I iterate inside heredoc ?
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb> A heredoc is a string. #{...} works, if that's what you mean
<matthewd> You don't; a heredoc is a string, not a template language.
<argoneus> hello, I'm wondering, is Ruby suited for a websocket server project? trying to learn the language on something I might actually use
<argoneus> I thought it'd be similar to python but blocks are killing me inside
<Papierkorb> ..?
<elomatreb> Ruby is suitable for websockets, recent versions of Rails ship with built-in support for them. And you'll miss blocks in nearly every language after you "get" them :P
<Papierkorb> How are blocks "killing" you?
<matthewd> argoneus: It can certainly be done, and the code will look idiomatic and pleasant. But it's not going to be as high-concurrency as some other languages (well, runtimes) which have that as a stronger focus.
<Papierkorb> argoneus: Rails stuff isn't vanilla websockets. There's faye-websockets, which does what you want.
<argoneus> I'm not planning to use rails, I plan to use something else altogether to make the client
<matthewd> Papierkorb: I'm not sure I'd put something that uses EventMachine next to the word "vanilla", but okay ;)
<argoneus> and I don't need high performance, I just want to actually learn the language
<argoneus> and by killing me, I mean that I understand in my head how blocks work, but then I see some examples of code that uses blocks and I'm back to square one and don't understand how it works
<Papierkorb> matthewd: faye implements vanilla websockets without any protocol on top.
<matthewd> argoneus: So yes, as an educational exercise in a domain you're potentially familiar with, it's a perfectly reasonable choice
agent_white has quit [Quit: leaving]
<Papierkorb> matthewd: And thankfully, you don't actually have to "use" EM for faye to use it.
<matthewd> Papierkorb: Oh?!... I thought the whole reason I rewrote that stuff was to get rid of EM
<Papierkorb> matthewd: Mh, it's been a good while since I used plain faye. I think I only needed to copy the base "loop" from somewhere and it worked for me. Mostly I use Faye with Roda on Puma et al, so I don't have to mess with any of that *yay*
<argoneus> like, when looking at the example code for faye-websockets
Rapture has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
<argoneus> which part of the example block keeps track of which client it's responding to? or do I need to do that
vee__ has joined #ruby
<argoneus> I just can't picture the flow in my head
<RickHull> have you worked with event architecture before? reactor pattern? inversion of control?
<argoneus> nope, that'd probably be a good place to start
<RickHull> yeah, you're taking on a big conceptual load with this
<argoneus> I've only done raw TCP servers before which was considerably easier
ur5us has joined #ruby
<matthewd> argoneus: In what languages?
<argoneus> Python
<argoneus> using asyncio
<RickHull> you can also look at Phoenix, a project in the Elixir language
<RickHull> i'll stop shilling for #elixir soon I promise :)
<matthewd> RickHull: You think that would be an effective strategy for learning Ruby?
<Papierkorb> argoneus: EventMachine ("EM") basically does async I/O in ruby. Never done Python, so can't compare
AndBobsYourUncle has joined #ruby
<argoneus> the syntax is way different
<RickHull> matthewd: no, but it might help the programmer :)
dalitom has quit [Quit: Page closed]
jdawgaz has joined #ruby
<argoneus> also it's more
<argoneus> I can understand from the examples how to use the code, but I'd like to understand what it actually does under the hood
<argoneus> and the more I try to do this in ruby the more I regret it every time
<Papierkorb> I wouldn't want to learn Ruby through EM
<RickHull> i'm not a fan of inversion of control and EM -- I find it hard to reason about
<RickHull> there are lots of other approaches in ruby
<matthewd> argoneus: If you want to dig in, to understand language fundamentals, you'll likely be better off with a much smaller (and yes, consequently, less interesting) problem
steph_ has quit [Remote host closed the connection]
steph_ has joined #ruby
<argoneus> well, the websocket part is just a tiny part of the server, right
<argoneus> I still need to actually have the server do things, so I can take the websocket lib as magic for now
<Papierkorb> "the server"?
<RickHull> you're buying into the EM architecture first
<argoneus> urf
<Papierkorb> argoneus: do you plan on having a web interface and use websocket in that?
<argoneus> yes, and/or use electron or similar
<argoneus> it's a server for a simple text game
<argoneus> not too concerned about the client atm
csk157_2 has quit [Quit: WeeChat 1.9.1]
benzrf has left #ruby ["WeeChat 1.9.1"]
<Papierkorb> Well. EM is the big hammer, handling multiple clients per thread and stuff. It's what you want if you want to build stuff, maybe not when you want to learn stuff.
<argoneus> implementing websockets by myself is probably out of the question
<Papierkorb> Why?
<RickHull> i'd be tempted to look at what sinatra does for websockets
<matthewd> It's not even what I want when I build stuff ;)
<argoneus> ruby doesn't seem too ideal for low level bitwise work
<Papierkorb> Websocket is actually a nice, simple protocol overall
<argoneus> or am I wrong
<RickHull> argoneus: ruby is a great language for io heavy problems
<matthewd> There's also a library you can use for that
<RickHull> string manipulation, etc
<argoneus> yes but I mean stuff like
<Papierkorb> you can write/read binary structures using Array#pack and String#unpack (as far the stdlib is concerned)
<matthewd> The Rails websocket implementation does its own IO & events, but uses a gem to handle the actual protocol parsing
<argoneus> "extract the first 15 bytes from the tcp stream and convert them to a value"
<RickHull> bread & butter
<argoneus> hmm
<RickHull> this takes no wall clock time relative to IO
<Papierkorb> argoneus: That's no problem to do
<argoneus> then how about writing my own simple websocket implementation on top of TCPServer
<argoneus> I can always just plug the faye-websockets lib in later, right
<Papierkorb> Faye is more complex, but in theory, yes
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has quit []
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
selim has quit [Ping timeout: 248 seconds]
<argoneus> writing my own WS implementation seems like good practice, since it's a lot of io work
troulouliou_div2 has quit [Quit: Leaving]
<argoneus> thanks a lot, just one last thing, or two
<argoneus> 1) is TCPServer the go-to for just a tcp server or are there issues with that too?
<Papierkorb> TCPServer is the basic tcp server everyone relies on
<matthewd> I might argue that "a lot of io work" isn't necessarily the most valuable thing to practice, but that's just opinion
workmad3 has joined #ruby
<RickHull> it's a C-based API mostly -- so be familiar with berkeley sockets and you'll be fine
<argoneus> ah
<argoneus> I'm used to raw sockets so that's nice
selim has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> you can do a #select loop etc
<argoneus> and 2) is it difficult in ruby to write unit tests for network stuff? or in general things out of my control
segy has quit [Quit: ZNC - http://znc.in]
tomphp has joined #ruby
<matthewd> No more or less difficult than any other language, I wouldn't think
jrafanie has joined #ruby
<RickHull> i would write as much of your logic as functions (rather than methods) that take small binary strings
<Papierkorb> argoneus: But as matthewd said, the WS stuff by itself may not really show Ruby. Ruby starts to get really interesting when you're juggling structures
<matthewd> Either you arrange to mock out the actual IO, or your test has to provide something on the other end of the socket
<RickHull> and have a thin layer that reads the socket and provides small strings to the logic layer
<argoneus> well, like I said, it's a text game server
<argoneus> I need to implement the whole text game logic
<matthewd> I'd focus on that
polishdub has joined #ruby
<matthewd> And not spend time reimplementing a protocol layer you can get for free
<Papierkorb> .. Except if you always wanted to know how websockets work
<argoneus> hmm, well, here's what I'll do
ek926m has joined #ruby
<RickHull> for learning and toy projects, it's best to start small rather than ambitious
<Papierkorb> If you couldn't care less, then ...
<argoneus> I've never actually tried implementing WS before, so I'll try that first, if it proves to be too painful, I'll use a lib and just make the game instead
<matthewd> Learning how to write pseudo-C in ruby isn't a good strategy for learning ruby -- but yes, is potentially a great strategy for learning those low level details
<argoneus> does that work
guacamole has joined #ruby
<argoneus> I'm a control freak in the sense that I want to know exactly what my program does >_>
<argoneus> instead of relying on magic function calls
<matthewd> Then focus on learning not to.. that.
darkmorph has quit [Ping timeout: 264 seconds]
<argoneus> *that*?
ams__ has quit [Quit: Connection closed for inactivity]
<matthewd> Because that philosophy does not a productive programmer make.
<argoneus> I'm still learning, it's not my job yet
<cagomez> is there a way to conditionally add a k,v to a hash?
<RickHull> hsh[k] = v if cond
<Papierkorb> cagomez: `if`
MrPunkin has quit [Quit: MrPunkin]
<argoneus> then again... I guess there's a learning curve to using the big boy libraries too?
<cagomez> say I have it like so: {foo:1 , bar: 2}. I want to add :baz if x
workmad3 has quit [Ping timeout: 260 seconds]
<argoneus> like, I can't just "learn" ruby and then download rails and suddenly be familiar with it, right
<RickHull> hsh[:baz] = 'quux' if x
ramfjord has joined #ruby
<matthewd> argoneus: You're obviously free to do what you like -- this is all just Opinions. But yes, there are things to learn anywhere.. and learning when to build and when to "buy" is itself a useful skill.
<RickHull> argoneus: start with smaller things like a project euler problem
Devalo has joined #ruby
<RickHull> rather than investing into an architecture blindly
<matthewd> argoneus: You're going to be learning an API, whose implementation you don't know, either way. Might as well go for the higher level one that gets you closer to a goal.
<Papierkorb> argoneus: I'll provide a counter to matthewds view and say that if you really want to know how X works, you should learn how to do X. If that's websockets, then that's great! Just do know however that it may not be something you do for 2hrs and "be done" with it. But only you know yourself enough to know if you should add the websocket stuff on top of learning ruby, or not. But I'm on par with saying that the websocket stuff will probably not
<Papierkorb> teach you what ruby is really good at.
<RickHull> you'll want to be reasonably fluent in the language before you start thinking about project structure, architecture, how to make things usable and reusable
Psybur has quit [Ping timeout: 248 seconds]
jenrzzz_ has joined #ruby
<argoneus> I think I see what you mean
<RickHull> s/thinking about/investing in/
<argoneus> the average javascript developer is probably way more productive than me
<cagomez> iterating over hashes in ruby don't have a guaranteed order, right? like {foo: 1, bar: 2}
<argoneus> but they probably don't know what a higher order function is
<matthewd> Papierkorb: I'm not sure we're disagreeing :P
<argoneus> well, they do intuitively
<argoneus> something like that?
<Papierkorb> argoneus: Learning is always productive!
<RickHull> cagomez: they used to be unordered. the current implementation maintains insertion order
<Papierkorb> argoneus: Even if you go out later on and learned that you hate something, that's an important thing to know
<RickHull> I believe the order is insertion order
<argoneus> fair enough
segy has joined #ruby
<argoneus> I'll just try implementing my own WS until I start hating it
<argoneus> then I'll look into libs
jenrzzz has quit [Ping timeout: 248 seconds]
<argoneus> thanks for the help anyhow
mson has joined #ruby
<argoneus> rubyists seem like a nice bunch :=)
<RickHull> argoneus: start with that faye project -- look into its codebase and dependencies
charliesome_ has joined #ruby
charliesome has quit [Ping timeout: 240 seconds]
<argoneus> ohhhh
<Papierkorb> argoneus: As I said, Ruby is really good when you start (what I call) to "juggle structures". Kiss that `for` loop good-bye, you won't miss it! Once you get the hang of it, using `each`, `map`, `reduce`, `group_by` (and a ton of other methods like that) gets so much fun that on average, people don't know how they could live without before
<argoneus> I just realized how the pattern actually works
<argoneus> the websocket server example isn't the full program, I still need some "rack" to run it in
cagomez has quit [Read error: Connection reset by peer]
<argoneus> it makes sense now
cagomez has joined #ruby
alex`` has quit [Ping timeout: 248 seconds]
<RickHull> yeah -- rack is a bit of webserver plumbing -- a standard interface and impl to build webservers from
<Papierkorb> Rack is *the* base middleware library for webserver things. it connects a webserver lib to the web framework lib on top
<RickHull> chris2 bless
biberu has quit []
<argoneus> so basically whenever this "rack" receives a request, it calls the lambda stored in App, and creates a new websocket out of the client
<argoneus> and then it's just callbacks on events
<argoneus> well that's simple
hgost has joined #ruby
<RickHull> Papierkorb has a good point about blocks -- I suggest starting with `each` and seeing how it's handier and cleaner than foreach (only slightly)
<RickHull> once you get the hang of each, then `map` starts to make sense
<RickHull> and you see the general pattern
tcopeland has quit [Quit: tcopeland]
<Papierkorb> argoneus: You mentioend "higher order functions" before. Did you use a FP language before?
Devalo has quit [Ping timeout: 240 seconds]
jenrzzz_ has quit [Ping timeout: 248 seconds]
<argoneus> I've done a bit of common lisp if you want strictly FP, but python supports higher order functions
<argoneus> but no, not really
<argoneus> why?
<argoneus> I just know what it is
<Papierkorb> Ah ok. Well, we basically copied `map` and friends from FP.
<argoneus> yeah
<RickHull> python's list comprehensions are similar but much clunkier
<Papierkorb> Ruby is "Good OOP with Functional Programming The Good Parts"
<RickHull> imho
<argoneus> I'm familiar with each and map and reduce and such
<argoneus> kind of
<RickHull> it's more about being familiar with block semantics
<RickHull> knowing they are closures
<Papierkorb> if only "kind of", that'll turn into a "not only kind of" quickly :)
<RickHull> and how to work with yield
<argoneus> I'm actually not 100% on block semantics yet
workmad3 has joined #ruby
<argoneus> the way I see it, when I call "yield x", it passes 'x' into an outside block currently calling the function, then the function does <stuff> and whatever is returned from the block is returned back into the yield statement, so I can assign it or put it back into the structure or such
<argoneus> probably wrong
<Papierkorb> nah sounds about correct
<Papierkorb> blocks are basically embedded anonymous functions. Nothing new in that regard, the interesting part is how it's integrated into the language
<RickHull> the day you write your first method that takes a block and handles it correctly is the day you become a Rubyist :)
<argoneus> what I don't understand yet and didn't find proper doc on
<argoneus> is how to_enum works
<argoneus> like, if I'm writing some custom each, there's often something like
<argoneus> return to_enum(:customeach) unless block_given
<argoneus> it returns an "enumerator", so I can iterate over it at a later time, but I don't get *how* it works
<RickHull> I believe that's an enumerator, which is kind of plumbing-type stuff
<RickHull> here is a dense example of blocks and enumerable, see if this makes sense: https://github.com/rickhull/compsci/blob/master/lib/compsci/fit.rb#L14
<argoneus> is an enumerator like a reference to the current function
<RickHull> there is no explicit use of an enumerator, FYI
<argoneus> so if I call .each on the enumerator it calls the same func
<RickHull> i'm not too good on enumerators, but I believe Enumerable#map returns an enumerator
<argoneus> yeah, unless you give it a block, then it just yields the values
<argoneus> I think?
agent_white has joined #ruby
<argoneus> and saves them back
jenrzzz has joined #ruby
<RickHull> and so you can do [1,2,3].map { |n| n ** 2} or [1,2,3].map.with_index { |n, i| n * i }
<argoneus> right
PaulCapestany has quit [Read error: Connection reset by peer]
alnewkirk has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
Rapture has joined #ruby
PaulCape_ has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has joined #ruby
<argoneus> wew
bronson_ has quit [Read error: Connection reset by peer]
<argoneus> I had to stare at that sigma function for 10 minutes before I got it
<argoneus> &block means it might be nil, right
charliesome_ has quit [Ping timeout: 248 seconds]
<RickHull> the map(&block) is shorthand syntax
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<RickHull> it's equivalent to enum.map { |val| yield val }
<RickHull> (I think, more or less)
milardovich has quit [Remote host closed the connection]
<RickHull> there is a way to explicitly yield to the block parameter in the method definition, or you can just call naked yield, or you can have an implicit block parameter and do: yield blah if block_given?
<RickHull> if you yield and ruby can't find a block, it will error
quobo has joined #ruby
<RickHull> I'm a bit fuzzy on this stuff, beware :)
<argoneus> my head hurts, but I somewhat get it
<RickHull> btw, Enumerable#inject and Enumerable#reduce are aliases
<RickHull> in english, the sigma function says: enum is an array like [1,2,3]; if we have a block, apply the block to the enum; now sum the enum
charliesome_ has joined #ruby
<argoneus> mm, right
<RickHull> sigma is written with an explicit block parameter in this case. it could be written with an implicit block parameter
<RickHull> TMTOWTDI
milardovich has joined #ruby
<matthewd> argoneus: Yes, an enumerator stores the current state of the method, and can resume it
charliesome has quit [Ping timeout: 240 seconds]
<argoneus> so enumerator#next just... goes until the next yield, and then pauses again?
<matthewd> Yes.
<argoneus> that's clever
ap4y has joined #ruby
* baweaver shamelessly plugs things
<baweaver> That may help understand some of what goes on
<matthewd> baweaver: That doesn't touch Enumerator, does it?
<RickHull> baweaver: :+1:
<baweaver> Later ones will
<RickHull> it blew my mind when I first learned that map is specific reduce
<baweaver> This one was entirely how you can write these using reduce
<RickHull> does it touch on transducers?
<matthewd> baweaver: I think it's a great answer to the question RickHull is answering, but not to the one argoneus asked ;)
<baweaver> Oh it's headed that way
<argoneus> I really really like the idea of blocks in Ruby, gotta say
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> remember that they are closures and so can refer to their outer scope
<argoneus> instead of focusing how I'm going to be iterating over what, I focus on what I actually do with the things
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> any vars inside the block are not saved outside the block, unless they are in scope *above* the block
Technodrome has joined #ruby
<RickHull> alternately: any vars introduced within a block go out of scope when the block finishes
<baweaver> >> p2s = Enumerator.new{|y|n=2;loop{y<<n;n=n<<1}; p2s.first(10)
<ruby[bot]> baweaver: # => /tmp/execpad-84ad8895c392/source-84ad8895c392:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/890970)
<baweaver> Ack, forgot one
AndBobsYourUncle has joined #ruby
<argoneus> and it's not just for iterating, I suppose? I can even use blocks as callbacks, like I could have something like file.open { |buf| buf << "text" }, and this will open a file, "yield" a buffer which is filled and then returned, and the file writes it into the file and closes it
marxarelli is now known as marxarelli|afk
<argoneus> (is that a valid use of blocks? tho I'm sure this is in the std lib already)
<matthewd> argoneus: Yes. (And yes.)
<Papierkorb> that's exactly like that in the stdlib
<argoneus> w-wew
<argoneus> that makes a ton of sense though!
<matthewd> Also for callback-callbacks, which will be evaluated later
<RickHull> I called the FactoryFactory and I'm waiting for a callback-callback
<matthewd> ws.on_message { |msg| puts "they said: #{msg}" }; ws.connect!
<matthewd> (as distinct from the file.open example, which you called a callback, but is really more of just a wrapper... the block is only invoked before the original [open, in this case] method returns)
<RickHull> yeah, you can delay evaluation with blocks
<argoneus> so in this case, ws is some socket object, and on_message is... some block inside the ws object, and this block is yielded to from the internal implementation whenever there's a message?
<argoneus> like @message_block
<argoneus> or something
<RickHull> Log.warn build_a_huge_expensive_string() vs. Log.warn { build_a_huge_expensive_string() }
<matthewd> on_message is a method on the websocket, which will take its given block, and store it away for later use, yes
<argoneus> !!
<RickHull> in the second form, if your log level is ERROR, then you don't incur the expense
<argoneus> I get it, then :D
<argoneus> this is awesome
<argoneus> seems like all blocks are are just anonymous functions that take some arguments (or don't)
<RickHull> i could have sworn someone said that already ;)
<Papierkorb> *cough*
<argoneus> >_>
brendan- has quit [Quit: Textual IRC Client: www.textualapp.com]
<matthewd> Yep -- and get passed in a special argument slot
<argoneus> it's a special feeling when I reach the conclusion myself, ok
<argoneus> :P
<argoneus> so it's like
nopolitica has quit [Ping timeout: 240 seconds]
<argoneus> def on_message(block)
<argoneus> @onmessage_block = block if block
vipaca has joined #ruby
<argoneus> or something
<RickHull> yeah, procs and lambdas are similar
<matthewd> That's where the special argument slot comes in... in the argument list, it's `&block`
<argoneus> oh
ozcanesen has quit [Quit: ozcanesen]
<matthewd> If you think of the meta-signature of a method call, it's (array_of_positional_arguments, block_argument)
<argoneus> hmm...
<matthewd> So, because it exists outside the set of "normal" args, you need the & sigil to grab it and put it in a variable
<argoneus> how does another method yield to this @onmessage_block or w/e it's called?
<RickHull> if you just want to store the block for calling later, then would it be def on_message(block) or (&block) ?
vipaca has quit [Client Quit]
<matthewd> It's special so that `yield` knows how to find it, for example
<RickHull> i don't quite understand
vee__ has quit [Ping timeout: 240 seconds]
<matthewd> def on_message(&block); @message_handler = block; end
impermanence has quit [Remote host closed the connection]
<matthewd> Then later: @message_handler.call("hello")
<RickHull> what is & doing for us here?
<RickHull> is it unique to blocks?
<matthewd> RickHull: Giving the block argument a name; yes.
<argoneus> oh, wew
<argoneus> you can call a block just like that?
<argoneus> that's pretty rad
<RickHull> and of course they generalize to multiple args
<matthewd> Technically the block becomes a Proc object when you put it in a variable
<cagomez> what does this do? "1"[0...-1]
vipaca has joined #ruby
<matthewd> Which is basically a class which represents a block
<baweaver> First to last item in a collection
<matthewd> But it can be handy to know that using yield can be slightly faster, because the object never gets constructed
<argoneus> thanks a lot for this discussion
<argoneus> I actually have somewhat of an idea how the faye-websocket thing works now
<argoneus> like, why its interface is how it is
<baweaver> >> [ [0,1,2,3][0..-1], 'string'[0..-1], 'string'[0..-2] ]
<ruby[bot]> baweaver: # => [[0, 1, 2, 3], "string", "strin"] (https://eval.in/890971)
<argoneus> I was confused how they did stuff like
<argoneus> ws.on :message do |event| ... end
<argoneus> but, all this is is just a method on the websocket, def on(type, &block)
<argoneus> which is then converted to a proc object and stored internally and called whenever like @onmessage.call(event)
<argoneus> is that about right
<matthewd> Yep, exactly
<argoneus> nice.
jamesaxl has quit [Read error: Connection reset by peer]
conta2 has quit [Ping timeout: 260 seconds]
<argoneus> this is a really really really clean and nice syntax for callbacks
<argoneus> I love it
marxarelli|afk is now known as marxarelli
<RickHull> <3 #ruby
<RickHull> where is tenderlove?
imode has quit [Ping timeout: 240 seconds]
<baweaver> Twitter mostly, making puns
vipaca has quit [Client Quit]
iamyask has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> also here http://tenderlovemaking.com/
<baweaver> avdi still likes IRC
<baweaver> kind of
<Papierkorb> I wonder how many visits he receives on that domain who weren't looking for ruby stuff
<c-c> Comments on this method? Its for making named pipes. https://gist.github.com/csmr/c6f7d9e4da7313d60845e5996130beb6
<argoneus> anyway, thanks a lot for the discussion! I learned a lot today
<argoneus> I feel a lot more confident in actually writing something now
<argoneus> have a good evening
<baweaver> 'night
<RickHull> cheers!
nopolitica has joined #ruby
jamesaxl has joined #ruby
<c-c> - For one I don't know if its a necessary thing to sleep while trying to create a file with system-command, or perhaps that only returns once the file exists.
vipaca has joined #ruby
<RickHull> it seems like you'll create several and error out or leak something
<Papierkorb> c-c: 1) underscore prefixes for local vars is weird, throw them out 2) line 2: that's just `if msg&.include? wait_on_str` 3) Aalso, don't put ( ) around conditions 4) Line 30, don't #exit, raise an error instead 5) line 13, remove it, #system only returns once the command ran to completion
<RickHull> and sleep is almost never the right thing to do in a method
<RickHull> almost certainly mkfifo will block until the resource is created or ready
GodFather has quit [Ping timeout: 258 seconds]
<Papierkorb> c-c: 6) that method can do one thing: Creating and opening a named pipe (That's actually two already!). It shouldn't also wait_on_str on top of that, refactor that feature into a new method
<elomatreb> Even if it doesn't, re-trying the same operation would not be the correct thing
<RickHull> create it once, sleep until it exists
<RickHull> but I wouldn't even
<Papierkorb> c-c: 7) line 11, instead of `while !`, use `until`: `until File.exist? pipe_path`
<RickHull> only crappy APIs make you resort to sleep polling
<c-c> Papierkorb: wow! thanks B)
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> c-c: you can examine behavior quickly and easily in a REPL like pry or irb
nopolitica has quit [Ping timeout: 248 seconds]
nopolitica has joined #ruby
<RickHull> if you're ever tempted to do sleep polling, ask yourself if you're dealing with a crappy API (probably not) or if there is a better way to use it (likely)
vee__ has joined #ruby
<Papierkorb> c-c: 8) line 12: Avoid using `system("program arg1 arg2 ...")`. Use `system(program, [ arg1, arg2, ... ])` instead. Among other things, your line there will inject the pipe_path into a SHELL. If a (remote) user could control pipe_path, they can do a "shell injection" attack on you (This attack is popular with shitty consumer routers)
<Papierkorb> c-c: You require the first form only if you need shell features, like pipes. If you somehow end up needing that form, use Shellwords, like: `system("ls #{Shellwords.escape some_var}")`. This will escape "some_var" so it can be passed safely there without causing security issues
<Papierkorb> Um yeah I guess that's about it from my end
<RickHull> I always drift toward popen3 or popen2 APIs for dealing with subprocesses
charliesome has joined #ruby
guacamole has joined #ruby
<Papierkorb> There's nothing wrong with #system if all you want to is to call a command and only check if it was successful.
mtkd has quit [Ping timeout: 240 seconds]
<Papierkorb> Which is also missing in the showcased code snippet :P
charliesome_ has quit [Ping timeout: 248 seconds]
safetypin has quit [Ping timeout: 248 seconds]
<elomatreb> Even if you discount the security perspective, using the multi-argument form of the subprocess methods is just easier than dealing with escaping for e.g. weird filenames
jphase has quit [Remote host closed the connection]
mtkd has joined #ruby
jphase has joined #ruby
charliesome_ has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
charliesome has quit [Ping timeout: 248 seconds]
Ltem has quit [Quit: Leaving]
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase has joined #ruby
vipaca has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
chiggins has joined #ruby
<chiggins> Could anyone recommend a gem that would be able to determind if a given string is the output of a hashing function such as MD5, SHA1, etc?
GodFather has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
<al2o3-cr> c-c: can you use File.mkfifo?
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
jphase has joined #ruby
<elomatreb> chiggins: For the very basic distinctions like that you should be able to do that just by comparing the length of the string
kapil___ has quit [Quit: Connection closed for inactivity]
<chiggins> elomatreb: Yeah that's kind of what I was just thinking. Wasn't sure if there was a more elegant way to do that
<apeiros> /\A\h{@hashlength}\z/
<apeiros> where @hashlength is the length of the given hash function
<apeiros> +of the output
<elomatreb> Normally if you need to process a Hash somewhere either the algorithm should be standardized or there should be a tag on the hash string ("SHA256:deadbeef....")
<elomatreb> It won't be able to distinguish between e.g. SHA2 and truncated SHA3 hashes of the same length, and will not work with base64 encoded hashes (e.g. BLAKE hashes are often base64'd instead of hex, for some reason)
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<chiggins> I hear ya. Goal here is to just check any random input, such as IP address or string or whatever. If not IP, check if hash. If not has, then disregard
cagomez has quit [Ping timeout: 248 seconds]
<RickHull> i mean, a hash is effectively a nonce in some integer space
oleo has quit [Quit: Leaving]
<RickHull> it would be pretty hard to distinguish any value that could map into an integer space from a nonce
<RickHull> but uh, carry on :)
jphase has quit [Ping timeout: 258 seconds]
<chiggins> ¯\_(ツ)_/¯
<chiggins> No worries, I know what I'm doing for the most part
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<chiggins> It doesn't need to be 100% valid
<chiggins> More of a sanity check
InfinityFye has quit [Quit: Leaving]
<RickHull> it might be better to have a whitelist of accepted formats
cadillac_ has quit [Ping timeout: 246 seconds]
<RickHull> or I guess def is_hash_looking?(some_str) # returns a score
<elomatreb> tbh if you have any control over the data just specify The One True Algorithm, it's the only sane option in the long run
<elomatreb> (Oh, and encoding as well)
vipaca has joined #ruby
hgost has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
vipaca has quit [Read error: Connection reset by peer]
<chiggins> RickHull: I like that idea
vee__ has quit [Ping timeout: 240 seconds]
<RickHull> it could get expensive trying to determine if it looks random enough or whatever
orbyt_ has joined #ruby
<RickHull> also, my own fault, a predicate method ending in question mark should return a boolean. probably: def hash_looking_score(str) # returns a score; def is_hash?(str, threshold) # calls hash_looking_score
ledestin has joined #ruby
<RickHull> what are the odds I can get lorem_ipsum out of md5?
<RickHull> I'll settle for shakespeare monkeys
jphase has joined #ruby
nixfreak has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
jphase has quit [Ping timeout: 252 seconds]
charliesome_ has quit [Ping timeout: 240 seconds]
oleo has joined #ruby
bdonnahue has joined #ruby
ineb has quit [Ping timeout: 240 seconds]
<c-c> Ok, further edits done, I hope you like this https://gist.github.com/csmr/c6f7d9e4da7313d60845e5996130beb6
vee__ has joined #ruby
jphase has joined #ruby
<RickHull> what happens if pipe_path already exists?
<RickHull> e.g. what if it's my .emacs file
apeiros has quit [Remote host closed the connection]
jphase has quit [Ping timeout: 246 seconds]
<RickHull> rather than calling out to the mkfifo subprocess, you can probably Mkfifo with some stdlib call
<c-c> RickHull: it gets opened
<RickHull> and just bomb out if there is an error
oleo2 has joined #ruby
<c-c> Its not an error - its an expected.
<RickHull> I kind of doubt it, but fair enough :)
<c-c> Also, last I checked - no mkfifo in ruby - thats why I use system
chouhoulis has quit [Remote host closed the connection]
<RickHull> also, your use of leading underscore vars confuses me
<RickHull> the convention means it's a throwaway var that won't be used further
<c-c> its a thing for when I write new methods. vim completion convenience thing
<RickHull> but you have 3 lines that refer to _msg
cschneid_ has quit [Remote host closed the connection]
<c-c> I clean them out later
<RickHull> i would figure out a different convention or not share it :)
<c-c> sometimes its been used to connote "internal to this method/function"
<RickHull> in ruby, unless I'm mistaken, it means "please don't warn about the fact I'm not using this variable"
ruby[bot] has quit [Remote host closed the connection]
<RickHull> you almost always see it where a method returns multiple values but not all are needed
ruby[bot] has joined #ruby
<RickHull> so where I get the result of named_pipe("~/.emacs"), I can pass it to read_bytes_nonblocking and what happens?
<c-c> Sorry, whats that again?
<RickHull> what's the result of named_pipe("~/.emacs") ?
<c-c> its probably going to fail
<RickHull> oh, I thought you said it gets opened, not an error, it's an expected
<RickHull> where does it fail?
jgt has joined #ruby
<c-c> hm, I see your point
<c-c> I guess should somehow test if, is a pipe or regular file
<c-c> not that I know how to
<RickHull> yeah, there's a call for that
thinkpad has joined #ruby
<RickHull> look at File or FileUtils
oleo2 has quit [Quit: Leaving]
cagomez has joined #ruby
troys_ is now known as troys
tcopeland has joined #ruby
<RickHull> clearly, it's just a picture of a pipe :)
<c-c> File.pipe?
<RickHull> yep, that should help
shinnya has joined #ruby
<RickHull> you'll want to decide on an error handling strategy
<c-c> Its going to be 'die'
<RickHull> by default, I would raise an exception or allow it propagate
<RickHull> i.e. if I called MkFifo on an existing file, i wouldn't rescue the FileAlreadyExists or whatever
<RickHull> but you won't get exceptions like that from a subprocess
Devalo has joined #ruby
<al2o3-cr> c-c: what ruby version?
<RickHull> in ruby, raise is an effective 'die'
<RickHull> crash with a message and stacktrace
<RickHull> with an option to recover it at an outer layer
<c-c> al2o3-cr: I seem to be on 2.3 at the moment
<c-c> started this in 2.0 I think
<al2o3-cr> c-c: there is File.mkfifo 2.3+
<RickHull> boosh
Gadgetoid has quit [Read error: Connection reset by peer]
steph_ has quit []
<c-c> al2o3-cr: thanks
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
Gadgetoid has joined #ruby
<c-c> al2o3-cr: looks like it would work fine here
<al2o3-cr> it'll sure save you a lot of hassle. :)
polishdub has quit [Quit: leaving]
Devalo has quit [Ping timeout: 240 seconds]
mson has quit [Quit: Connection closed for inactivity]
<RickHull> I like to keep the "happy path" very simple and clean. I don't write conditionals to handle edge cases if the happy path will raise an exception for me
gnufied has quit [Ping timeout: 252 seconds]
<RickHull> I don't write a lot of rescue clauses except at very outer layers
mson has joined #ruby
<c-c> In the engine I'm going to use a temp directory with the pid in the name, so the pipes will be in a unique location
_sfiguser has quit [Quit: Leaving]
<RickHull> you'll have to be careful that boundaries are maintaining their contracts
<RickHull> or just enforce your contracts and stop worrying
conta1 has joined #ruby
<c-c> well, it now allows you to make pipes/use existing, otherwise fails
<RickHull> if I'm not sure that the happy path will raise exceptions for me, then I will do extensive validation at the top of the method with a lot of raises
<c-c> not sure if should retry on open or not.
<c-c> or if should also have limit on the number of retries
cagomez has quit [Remote host closed the connection]
<RickHull> retries almost always backfire
<RickHull> about 1% of my rescues have retries, and half of those backfired on me
cagomez has joined #ruby
<RickHull> just fail fast and let some outer layer deal with it
<RickHull> don't bother with a retry to start with. it can be helpful to have it available for some later patch
chiggins has left #ruby ["WeeChat 1.7.1"]
jgt_ has joined #ruby
jgt has quit [Read error: Connection reset by peer]
cagomez has quit [Remote host closed the connection]
<RickHull> keep your scope small: do the one thing, and only if you get good data passed in. validate the data, do the thing. if the underlying system fails, then you probably don't have the context to know the remedy
conta1 has quit [Ping timeout: 258 seconds]
cagomez_ has joined #ruby
charliesome_ has joined #ruby
charliesome has quit [Ping timeout: 255 seconds]
AndBobsYourUncle has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
sepp2k has quit [Quit: Leaving.]
<RickHull> put another way: use retries only if you're sure you need to. a lot of overly complicated code has bugs resulting from premature anticipation
<c-c> hehe not sure what else to put in the rescue clause
<c-c> *block
<RickHull> what's the latest?
<RickHull> same url?
<RickHull> yeah, don't rescue there
<RickHull> if mkfifo fails, then bomb out
<RickHull> er File#open, or whatever
apeiros has joined #ruby
<RickHull> probably you want to have 0 rescues and 0 up to 5 or 10 raises in that method definition
<RickHull> gotta run :)
<c-c> sorry
<c-c> RickHull: thanks for input, have a good one
<RickHull> yeah, i would not rescue an open failure there
<RickHull> instead let it propagate
<RickHull> and the caller of named_pipe can deal with the failure
enterprisey has quit [Remote host closed the connection]
<RickHull> dang, how do I edit or fork it?
<RickHull> ah, found it
<c-c> Heh the epic 1-in-all named pipe opening method is dwindling in size https://gist.github.com/csmr/c6f7d9e4da7313d60845e5996130beb6
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> what does File.mkfifo return?
<RickHull> a File object?
alnewkirk has joined #ruby
jdawgaz has joined #ruby
<al2o3-cr> RickHull: 0 or raises
jdawgaz has quit [Client Quit]
apeiros has quit [Ping timeout: 240 seconds]
<RickHull> ah ok
<RickHull> my code is "wrong" then
jgt_ has quit [Ping timeout: 260 seconds]
jdawgaz has joined #ruby
<RickHull> but still consider how I am doing the error handling before getting into the mkfifo and open bits
charliesome_ has quit [Ping timeout: 248 seconds]
jdawgaz has quit [Client Quit]
<RickHull> you should just have 2 file representations: a path, and a handle
jdawgaz has joined #ruby
<RickHull> make sure your path doesn't exist or if it does, it's a pipe. in that case, you probably don't want to call mkfifo on it, not sure
jdawgaz has quit [Client Quit]
<RickHull> then file_handle = File.open(path, flag)
<RickHull> and go from there
<RickHull> i'm out, cheers
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
ResidentBiscuit has joined #ruby
jdawgaz has joined #ruby
milardovich has quit [Remote host closed the connection]
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
tvw has quit [Remote host closed the connection]
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
ek926m has quit [Ping timeout: 260 seconds]
marxarelli is now known as marxarelli|afk
guacamole has joined #ruby
<Radar> I've got a class called "Transactions" which subclasses from array. I want to do chainable filtering on instances of this class, so here's what I've done to accomplish that: https://github.com/radar/moolah/blob/master/lib/moolah/transactions.rb#L20-L32. Is there a cleaner way?
<Radar> This means I can do transactions.between(start, finish).amount { |a| a > 100 }
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ahoyhere has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ahoyhere2 has joined #ruby
ahoyhere2 has quit [Client Quit]
<devn> baweaver: RE: set_trace_func from earlier, how would you go about jacking into overriding the seed?
ahoyhere2 has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
alnewkirk has quit [Ping timeout: 248 seconds]