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
Azure has joined #ruby
jphase has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 240 seconds]
nofxx__ has quit [Remote host closed the connection]
nofxx has joined #ruby
kies has quit [Ping timeout: 240 seconds]
nofxx has quit [Remote host closed the connection]
jphase has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
kies has joined #ruby
nofxx has joined #ruby
millz has joined #ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
hays_ has quit [Remote host closed the connection]
jphase has joined #ruby
<RickHull> quite the moniker...
GodFather has joined #ruby
nofxx has quit [Remote host closed the connection]
jphase_ has joined #ruby
nofxx has joined #ruby
xco has quit [Quit: xco]
jphase has quit [Ping timeout: 248 seconds]
paul_ has joined #ruby
jphase_ has quit [Ping timeout: 258 seconds]
<c-c_> Ok
<c-c_> I improved the ui refresh to work like eam suggested
<c-c_> many LOC eliminated
<c-c_> excellent
ramfjord has quit [Quit: Lost terminal]
<c-c_> thanks eam!
postmodern has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
<RickHull> argh is a great variable name xD
nofxx has quit [Remote host closed the connection]
<c-c_> yeah some rows are from the tread based try even
<RickHull> you could also have that be the name of your error method. argh!("it's hosed")
nowhere_man has quit [Ping timeout: 250 seconds]
<elomatreb> Almost as good as "blargh"
<c-c_> eargh - error argh
nofxx has joined #ruby
paul_ has quit [Ping timeout: 248 seconds]
<RickHull> ha
<c-c_> B]
sepp2k has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<RickHull> c-c_: may I suggest https://github.com/rickhull/lager for debug logging
nofxx_ has joined #ruby
<RickHull> you can do @lager.debug { "all kinds of stuff" } with little impact if the log_level is e.g. WARN
<RickHull> and no need to comment stuff out
nowhere_man has joined #ruby
sucks has joined #ruby
<RickHull> it's a very thin wrapper around Logger, mostly for UX convenience
<c-c_> yeah I just put all "utilities" in one module as functions
nofxx has quit [Ping timeout: 260 seconds]
<c-c_> its kinda soup
<c-c_> I'm hoping I can make it into separate modules later
al2o3-cr has joined #ruby
<RickHull> that is the best approach IMHO. default to a bag of stuff and separate as needed
<c-c_> but the idea with p_dbg I can add some flag to test if output desired
<c-c_> thats all
<RickHull> rather than imagining a grand hierarchy up front
<c-c_> - so I can disable p_dbg output with one flag
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> with @lager, alternately, you just disable output by setting log_level
<RickHull> and by using a block, you ensure that the string you passed, when disabled, isn't evaluated
<c-c_> I do things like $stderr.reopen(Logfile, "w+") for logging output
<RickHull> by passing the log message as a string, rather than inside a block, you are creating that string even when flag==false
<c-c_> sure, its just not outputted
<RickHull> that means you end up tempted to comment out all the debug logging "for performance"
<c-c_> naw
<c-c_> performance has to come from somewhere else
<RickHull> well why is commented out in your gist?
<RickHull> er, maybe it's not :)
alex`` has quit [Ping timeout: 240 seconds]
<RickHull> i just double checked
<c-c_> if you uncomment it, the frame counter pushes into your input and you can't type single letter messages
<c-c_> \r clears the row on the screen, not sure what it does for the input buffer, but when you hit enter, theres something other than the last typed char in the buffer
<RickHull> with Lager, you can say in your class file: log_to $stdout # or /tmp/log.txt
<c-c_> the idea with current row 24 is it refreshes the frame # in real time
<c-c_> iow, the number "runs" on the last row of the screen
<c-c_> and the delay between the frames comes from row 28
<RickHull> I don't quite understand the interference problem you're having, but I would suggest you solve it sooner rather than later. I expect you are going to need extensive trace/debug logging going forward
<c-c_> hmm, I wonder what youre referring
<RickHull> one common pattern is to log a basic trace to stdout, while the game uses something else for user IO
<RickHull> kind of like opening the console on a FPS game
<RickHull> or maybe you want STDIN and STDOUT for user input
<RickHull> and log to STDERR by default, or just a file
<RickHull> but it sounds like your informative log messages are interfering with user IO
<RickHull> (not sure)
<c-c_> I think I've just implented minimal ui refresh at settable rate independent of user input in a ui, + stateserver and engine processes, and spawning, daemonizing and IPC of such
<c-c_> I will use curses on the output actually
<c-c_> but the input is just a nonblocking read from stdin atm
<c-c_> raw mode is possible in the future
<RickHull> also, I understand best practice is to use $stdout rather than the constant STDOUT
<RickHull> that way you can reassign the global if need be
<RickHull> it's a tiny bit of hax flexibility
<c-c_> hehe this thing is a tiny piece of hax
<RickHull> hax all the way down
milardovich has joined #ruby
<RickHull> && self.hax!
mim1k has joined #ruby
<c-c_> cleanup and git-ification later
milardov_ has joined #ruby
alveric3 has joined #ruby
jameser has joined #ruby
alveric2 has quit [Ping timeout: 268 seconds]
milardovich has quit [Ping timeout: 248 seconds]
mim1k has quit [Ping timeout: 268 seconds]
<c-c_> So this is what the game runner class looks like
quobo has quit [Quit: Connection closed for inactivity]
<RickHull> you shouldn't need to pass self to p_dbg right?
<c-c_> yes, its the only way I could figure how to get the instances class and pid right
<RickHull> hmmm
<c-c_> I mean, instance id
<RickHull> when you pass self to p_dbg, wouldn't it be the exact same as self inside the p_dbg definition?
Technodrome has joined #ruby
<c-c_> I tried to use Kernel.caller, but it returns call stack array
<RickHull> I would: def p_dbg(msg, prepend=true)
<RickHull> and where you don't want to put the object details, call p_dbg(msg, false)
<RickHull> otherwise p_dbg(msg) suffices
<RickHull> also consider keyword args
<RickHull> def p_dbg(msg, prepend: true)
<c-c_> outputs "SpyOps::Engine 47168440261980: got msg UI: 1"
<RickHull> hm, maybe this is some mixin strangeness that I'm not used to
<c-c_> its just passing the object
<RickHull> if self.respond_to?(:p_dbg) then within p_dbg, i can't see how self would be different than obj
<RickHull> but I'm probably not considering all the ins, outs, and what-have-yous
<c-c_> because p_dbg is in module Helpers, and self can be instance of Engine, Ui or just plain GameRunner
<RickHull> ok, fair enough. I hate mixins :)
<c-c_> its just a require
<RickHull> still, consider a keyword arg: def p_dbg(msg, obj: nil)
<c-c_> the top of todo list is actually 'fix module structure' but I think there needs to be more fleshed out before that can be done
<RickHull> i would use nil rather than empty string for a default value
<RickHull> this would force your calls to look like p_dbg(msg, obj: self) where you want obj
nertzy has quit [Quit: Leaving]
<c-c_> without default object, it just outputs the string
<c-c_> the idea indeed
fishcooker has joined #ruby
<RickHull> right
<RickHull> I'm just saying, empty string is kind of a weird default
<RickHull> and then you test for empty string
<RickHull> nil is a more common default for such a case
<c-c_> test is for prepending to the arg msg
<RickHull> right
<c-c_> ok I see it now
<c-c_> hm, it must have worked with '+' before, better fix that
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> to more fully illustrate my point, you could make the default be an empty array and test for that
<RickHull> but why would you?
<RickHull> nil is commonly used, and false less so
<RickHull> when any object may be passed in, what's special about an empty string? what is that supposed to indicate?
cdg has joined #ruby
<RickHull> an empty string is truthy, while nil and false are falsey
fishcooker has quit [Ping timeout: 268 seconds]
mtkd has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
cdg_ has quit [Ping timeout: 268 seconds]
<RickHull> where the default says "did they pass something in", it's better to use a falsey value when the answer is no
<c-c_> So there, a disableable instance id debug printer https://gist.github.com/csmr/226ef7eb5ee4ea9de4f15d1e41bb904a
cdg has quit [Ping timeout: 240 seconds]
<RickHull> you can even say `if obj` :)
<RickHull> and again, consider making obj a kwarg: def p_dbg(msg, obj: nil)
<c-c_> not sure if should return just erm, 'return'
<c-c_> I've been taught to prefer expanded if testing
<RickHull> `unless @debug_message_disabled`
<RickHull> body
<RickHull> end
jphase has joined #ruby
<c-c_> return if @debug_print_bool
<RickHull> an if/unless that doesn't fire returns nil
<c-c_> what ever would be the correct way to name that flag
<RickHull> i would just use @debug
<RickHull> and add a subterm only as needed
<c-c_> I try to postfix with expected type or unit
<c-c_> semi-polish
<RickHull> it's your funeral ;)
nertzy has joined #ruby
jphase has quit [Remote host closed the connection]
<RickHull> I'm being very much tongue-in-cheek -- use your judgment :)
<c-c_> things like state_srv_pid and @refreshdelay_secs make things readable and quick
jphase has joined #ruby
<RickHull> yes, readability is generally my top concern
cagomez has quit [Remote host closed the connection]
sucks has quit [Ping timeout: 240 seconds]
<c-c_> I still have to try to get the daemon cleanup working correctly. You can't see it but as it is they try to snuff each other if one dies https://gist.github.com/csmr/a3c26033e86019f941c1e603e44729f9
kryptoz has joined #ruby
cdg has joined #ruby
eregon has joined #ruby
cagomez has joined #ruby
<c-c_> also I wonder how to rename the init process that runs the ui to something related to the UI instance that takes over, other than the init.rb filename - so it looks cool in the the process tree!
marr has quit [Remote host closed the connection]
zanoni has joined #ruby
<RickHull> c-c_: I'm not sure you're right about the value of `self` in a mixed-in method: https://gist.github.com/rickhull/462ca3c81f7e1f860de8788b17d32497
<c-c_> what if printer in Foo
JsilverT has joined #ruby
<c-c_> you want myself "Hi!"
<c-c_> -> "Bar pid 3424234432: 'Hi!'"
<c-c_> uh, s/pid/id/
cdg has quit [Ping timeout: 248 seconds]
<c-c_> well, lot to clean before the gitification and ul to gh
<RickHull> updated
cagomez has quit [Ping timeout: 248 seconds]
<RickHull> can you confirm the behavior?
<RickHull> it's clear that self is the instance of Bar
<RickHull> thus, there is no need to pass self explicitly
sucks has joined #ruby
dcluna has quit [Ping timeout: 240 seconds]
pwnd_nsfw` has joined #ruby
<c-c_> it does work
milardovich has joined #ruby
<c-c_> but then the obj just is replaced with self
<c-c_> and you can't print plain msg rows
pwnd_nsfw has quit [Ping timeout: 240 seconds]
<RickHull> that's where i would change the second arg to prepend=false
govg has quit [Ping timeout: 240 seconds]
<RickHull> er, prepend=true
<c-c_> I think the real 'way' would be to try to get Process.pid to print the correct process
<c-c_> but I gotta .zzZ
<RickHull> i'm just saying, don't pass self
<c-c_> ta!
milardov_ has quit [Ping timeout: 240 seconds]
<RickHull> 'night :)
dcluna has joined #ruby
kryptoz has quit [Remote host closed the connection]
enterprisey has joined #ruby
cdg has joined #ruby
b100s has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
kryptoz has joined #ruby
<b100s> hi2all; is it safe to use something like this http://paste.org.ru/?t231gw in web-app to do some periodic job?
ur5us has joined #ruby
<RickHull> it's quite simplistic, and it depends on what the block is and what you do with the Thread
<RickHull> but the pattern itself seems reasonable
<RickHull> how do you plan on halting execution or tracking errors?
hinbody has quit [Read error: Connection reset by peer]
cdg has quit [Ping timeout: 250 seconds]
juggler has joined #ruby
kryptoz has quit [Ping timeout: 240 seconds]
<b100s> RickHull, it's going to execute forever, every let's say few hours; tracking errors - is good thought, i didn't think about it yet; defenetly it is not critical job and in case of fail i will just write some err message in log and let main thread to do it's main job as before
<b100s> RickHull, what is important, in my opinion, it's shared database object
<RickHull> I don't know what you mean by that
<b100s> i'm not sure which way should i use it; if i do use it and in the same momen main thread will use it... some strange things may happens
<b100s> RickHull, i have some instance of class which do http requests to DB
<RickHull> if this is just a toy or an exercise, then play around with it
<RickHull> if this is a production app, then maybe consider some more mature background patterns
<RickHull> job schedulers, etc
<RickHull> whether this works well or not depends on what block you pass to it, and what you do with the thread that is returned
<RickHull> error handling, etc
<RickHull> for periodic tasks, I prefer a short running script with an external cron-like scheduler
<RickHull> rather than a long-running ruby process
GodFather has quit [Ping timeout: 248 seconds]
milardovich has quit [Remote host closed the connection]
SeepingN has quit [Ping timeout: 240 seconds]
guardianx has joined #ruby
<b100s> RickHull, yep, thanks
the_f0ster has quit [Quit: Lost terminal]
bmurt has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
lagweezle is now known as lagweezle_away
milardovich has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
paul_ has joined #ruby
vee__ has quit [Ping timeout: 250 seconds]
rkoller has joined #ruby
astronavt has joined #ruby
paul_ has quit [Ping timeout: 240 seconds]
<waveprop> wat tha fahk
aScottishBoat has quit [Ping timeout: 240 seconds]
coffeecupp has quit [Ping timeout: 268 seconds]
astronavt has quit [Remote host closed the connection]
<waveprop> i guest you can't use Rack::Response in each middleware ?/
<waveprop> doing it manually works, of course. like everything else in life
* waveprop moves on
vee__ has joined #ruby
rkoller has quit [Quit: Textual IRC Client: www.textualapp.com]
cagomez has joined #ruby
Hexafox[I] has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
PaulCape_ has quit [Read error: Connection reset by peer]
<mkaito> is there a more succinct way to do `foo = bar.baz if bar` ?
jackjackdripper has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
<havenwood> mkaito: Do you want to set foo to nil if no bar? Or must foo not be set to nil and remain unchanged in that case?
<mkaito> it should remain unchanged, or I'd just use bar&.baz
troys is now known as troys_
jphase_ has joined #ruby
jackjackdripper has quit [Client Quit]
<havenwood> mkaito: nope, nothing more succinct
juggler has quit [Remote host closed the connection]
<mkaito> figures. thanks :)
jphase has quit [Ping timeout: 258 seconds]
mim1k has joined #ruby
PaulCapestany has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
gizmore|2 has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
JsilverT has quit [Ping timeout: 248 seconds]
konsolebox has quit [Ping timeout: 268 seconds]
Puffball has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 260 seconds]
Wirehead_Wannabe has joined #ruby
uZiel has joined #ruby
gizmore has quit [Ping timeout: 260 seconds]
millz has quit []
sucks has quit [Remote host closed the connection]
konsolebox has joined #ruby
d^sh has quit [Ping timeout: 252 seconds]
d^sh has joined #ruby
sucks has joined #ruby
cdg has joined #ruby
imode has joined #ruby
pilne has quit [Quit: Quitting!]
guacamole has joined #ruby
guacamole has quit [Client Quit]
JsilverT has joined #ruby
coffeecupp has joined #ruby
nofxx_ has quit [Quit: Leaving]
nofxx has joined #ruby
cdg has quit [Remote host closed the connection]
orbyt_ has joined #ruby
kryptoz has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
alfiemax has joined #ruby
Wirehead_Wannabe has quit [Quit: Leaving]
jamesaxl has quit [Ping timeout: 248 seconds]
coffeecupp has quit [Ping timeout: 260 seconds]
uZiel has quit [Ping timeout: 240 seconds]
darkmorph has quit [Ping timeout: 240 seconds]
bihi has joined #ruby
coffeecupp has joined #ruby
cdg has joined #ruby
JsilverT has quit [Ping timeout: 248 seconds]
JsilverT has joined #ruby
Scriptonaut has joined #ruby
sucks_ has joined #ruby
zanoni has quit [Ping timeout: 240 seconds]
<Scriptonaut> hey, any of y'all do some amateur gamedev in ruby? I was thinking I wanted to make a little game/physics engine in ruby. I got one in es6 I was gonna port to ruby, but not sure what to use. I've heard of gosu, but it seems like gosu does a lot for you, and I want to implement pretty much everything myself (collision detection/resolution, asset loading, game state, sprites, etc)
<Scriptonaut> anyone know of a good library to use that will let me make a window, draw polygons
<Scriptonaut> write text
sucks has quit [Ping timeout: 240 seconds]
JsilverT has quit [Remote host closed the connection]
JsilverT has joined #ruby
<RickHull> I would guess that Gosu will let you dive down into primitives
<RickHull> and it's probably a better place to start for exploring
dviola has quit [Quit: WeeChat 1.9.1]
<Scriptonaut> RickHull: ya I just found a guide on getting started with gosu, and it actually doesn't have very much stuff (which is what I want)
<Scriptonaut> however, it has a huge userbase, and very few bugs from what I gather
<Scriptonaut> so it's basically the perfect platform
<RickHull> grip it and rip it!
<Scriptonaut> all it has is a window with a main loop and callbacks (awesome), 2d graphics and text, sound samples/music, and keyboard and mouse input
<Scriptonaut> ya, I'm pretty stoked that it didn't take me very long to find something so promising
paul___ has joined #ruby
guardianx has quit []
enterprisey has quit [Remote host closed the connection]
paul___ has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
_whitelogger has joined #ruby
gix has quit [Ping timeout: 252 seconds]
ur5us has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hexafox[I] has quit [Remote host closed the connection]
gix has joined #ruby
mim1k has joined #ruby
gnufied has quit [Ping timeout: 258 seconds]
mim1k has quit [Ping timeout: 248 seconds]
uZiel has joined #ruby
govg has joined #ruby
lexruee has quit [Ping timeout: 258 seconds]
Technodrome has joined #ruby
lexruee has joined #ruby
bihi has quit [Quit: Bye!]
sucks_ has quit [Ping timeout: 250 seconds]
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
troys_ is now known as troys
Scriptonaut has left #ruby [#ruby]
JsilverT has quit [Quit: WeeChat 2.0-dev]
JsilverT has joined #ruby
JsilverT has quit [Client Quit]
nolakat has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
JsilverT has joined #ruby
anisha has joined #ruby
JsilverT has quit [Client Quit]
JsilverT has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
mjolnird has joined #ruby
anisha has quit [Ping timeout: 260 seconds]
enko has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
iamarun has joined #ruby
JsilverT has quit [Ping timeout: 260 seconds]
oleo has quit [Quit: Leaving]
JsilverT has joined #ruby
lytol has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 248 seconds]
mim1k has joined #ruby
zipace has joined #ruby
nolakat has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
alex`` has joined #ruby
nolakat has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ta__ has joined #ruby
ta has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
coffeecupp has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Ping timeout: 248 seconds]
reber has joined #ruby
vipaca has joined #ruby
exhiled has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
conta2 has quit [Ping timeout: 240 seconds]
kculpis has quit [Remote host closed the connection]
kculpis has joined #ruby
enko has quit [Quit: Textual IRC Client: www.textualapp.com]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
andikr has joined #ruby
LocaMocha has joined #ruby
ap4y1 has quit [Quit: WeeChat 1.9.1]
jenrzzz has quit [Ping timeout: 268 seconds]
alfiemax has quit [Remote host closed the connection]
exhiled has joined #ruby
alfiemax has joined #ruby
kculpis has quit [Read error: Connection reset by peer]
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 240 seconds]
vipaca has joined #ruby
bkxd has joined #ruby
vipaca has quit [Client Quit]
bkxd has quit [Ping timeout: 248 seconds]
aufi has joined #ruby
<dminuoso> Short of using fiddle, do you see a way to obtain the number of arguments passed?
<dminuoso> (Without using splat args.
<dminuoso> Reason is I want to implement a clean rubyland autocurrying methods.
<RickHull> how does it work with fiddle?
<dminuoso> Right now what I do is: def m(*args) ->(a, b, ...) { ... }[*args]; end
<dminuoso> But that has the problem that the arity of the inner lambda cannot be probed.
<dminuoso> def m(*args) ->(a, b, ...) { ... }.curry[*args]; end
<dminuoso> sorry
<dminuoso> And I want to constrain the outer method somehow, say def m(a=nil, b=nil); end, but that makes it impossible to know whether a or b have in fact been passed or not.
dionysus69 has joined #ruby
<dminuoso> asm>> def f(a) v = 1; end
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/896875
wolakkk has joined #ruby
coffeecupp has joined #ruby
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
alfiemax has joined #ruby
ana_ has joined #ruby
troys has quit [Quit: Bye]
ramfjord has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase_ has quit [Remote host closed the connection]
mniip has quit [Ping timeout: 620 seconds]
rabajaj has joined #ruby
paul___ has joined #ruby
iamarun has quit [Read error: Connection reset by peer]
iamarun has joined #ruby
rabajaj has quit [Ping timeout: 248 seconds]
cdg has quit [Remote host closed the connection]
conta has joined #ruby
cdg has joined #ruby
paul___ has quit [Ping timeout: 268 seconds]
cdg has quit [Ping timeout: 248 seconds]
hs366 has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
exhiled has joined #ruby
c0ncealed has quit [Remote host closed the connection]
jenrzzz has joined #ruby
c0ncealed has joined #ruby
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
hs366 has quit [Read error: Connection reset by peer]
hs366 has joined #ruby
mmasaki has quit [Quit: bye]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hs367 has joined #ruby
hs366 has quit [Read error: Connection reset by peer]
coffeecupp has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
coffeecupp has joined #ruby
biberu has joined #ruby
michael3 has joined #ruby
enterprisey has joined #ruby
michael3 has quit [Ping timeout: 240 seconds]
alfiemax_ has joined #ruby
claudiuinberlin has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
ShekharReddy has joined #ruby
Dimik has joined #ruby
mark_66 has joined #ruby
iamarun has quit [Quit: Leaving]
iamarun has joined #ruby
iamarun has quit [Client Quit]
iamarun has joined #ruby
cdg has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
alfiemax_ has quit [Remote host closed the connection]
imode has quit [Ping timeout: 248 seconds]
ur5us has joined #ruby
anisha has joined #ruby
Gabemo has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
Silthias2 has joined #ruby
Silthias1 has quit [Ping timeout: 258 seconds]
Emmarof has joined #ruby
Silthias has quit [Ping timeout: 268 seconds]
Emmarof has left #ruby [#ruby]
guille-moe has joined #ruby
kinlo has left #ruby [#ruby]
Gabemo has joined #ruby
lexruee has quit [Ping timeout: 248 seconds]
lexruee has joined #ruby
bemep64 has joined #ruby
bemep64 has left #ruby [#ruby]
cdg has quit [Ping timeout: 250 seconds]
cdg has joined #ruby
profetes_ has joined #ruby
shinnya has joined #ruby
paul___ has joined #ruby
jaruga has joined #ruby
Burgestrand has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
profetes has quit [Ping timeout: 258 seconds]
ams__ has joined #ruby
paul___ has quit [Ping timeout: 240 seconds]
Serpent7776 has joined #ruby
stoffus has joined #ruby
mim1k has joined #ruby
wolakkk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
wolakkk has joined #ruby
gigetoo has quit [Ping timeout: 268 seconds]
gigetoo has joined #ruby
Dimik has quit [Ping timeout: 268 seconds]
larcara has joined #ruby
wolakkk has quit [Ping timeout: 248 seconds]
ShalokShalom has joined #ruby
Beams has joined #ruby
nowhere_man has quit [Ping timeout: 248 seconds]
mn3m has joined #ruby
coffeecupp has quit [Quit: ZNC 1.6.5 - http://znc.in]
quobo has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 268 seconds]
samuel02 has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
adlerdias has joined #ruby
adlerdias has left #ruby [#ruby]
kryptoz has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
raynold has quit [Quit: Connection closed for inactivity]
postmodern has quit [Quit: Leaving]
rabajaj has joined #ruby
nowhere_man has joined #ruby
GodFather has joined #ruby
zanoni has joined #ruby
samuel02 has left #ruby [#ruby]
enterprisey has quit [Remote host closed the connection]
Silthias has joined #ruby
Silthias2 has quit [Ping timeout: 248 seconds]
ShalokShalom_ has joined #ruby
ur5us has joined #ruby
apofis has joined #ruby
ShalokShalom has quit [Ping timeout: 268 seconds]
JsilverT has quit [Ping timeout: 248 seconds]
rabajaj has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
ramfjord has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
mim1k has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 248 seconds]
gregf_ has joined #ruby
b100s has quit [Remote host closed the connection]
ldnunes has joined #ruby
mim1k has quit [Read error: Connection reset by peer]
minimalism has quit [Quit: minimalism]
anisha has quit [Quit: This computer has gone to sleep]
mim1k has joined #ruby
qqmash has joined #ruby
growp has joined #ruby
guille-moe has quit [Remote host closed the connection]
guille-moe has joined #ruby
tcopeland has quit [Quit: tcopeland]
growp has quit [Quit: Mutter: www.mutterirc.com]
jottr has joined #ruby
guille-moe has quit [Ping timeout: 240 seconds]
zanoni has quit [Remote host closed the connection]
yeticry has joined #ruby
enterprisey has joined #ruby
enterprisey has quit [Client Quit]
iamarun has quit [Remote host closed the connection]
Technodrome has joined #ruby
tvw has joined #ruby
ferr has joined #ruby
Psybur has joined #ruby
ferr has left #ruby [#ruby]
ldnunes has quit [Ping timeout: 260 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kryptoz has joined #ruby
duckpuppy has joined #ruby
darkmorph has joined #ruby
<matthewd> dminuoso: I haven't read context, but maybe you want: `def foo(a = (no_a = true), b = (no_b = true))`
guacamole has joined #ruby
guacamole has quit [Ping timeout: 248 seconds]
nowhere_man has quit [Quit: Konversation terminated!]
nowhere_man has joined #ruby
ldnunes has joined #ruby
Psybur has quit [Ping timeout: 248 seconds]
ana_ has quit [Remote host closed the connection]
ana_ has joined #ruby
paul___ has joined #ruby
paul___ has quit [Ping timeout: 248 seconds]
raynold has joined #ruby
tcopeland has joined #ruby
Sina has quit [Quit: Connection closed for inactivity]
larcara has quit [Remote host closed the connection]
doublyx has quit [Quit: Connection closed for inactivity]
tomphp has joined #ruby
adlerdias has joined #ruby
mostlybadfly has joined #ruby
kryptoz has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 268 seconds]
tomphp has quit [Client Quit]
truenito has joined #ruby
kryptoz has joined #ruby
RickHull has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 258 seconds]
adlerdias has left #ruby [#ruby]
kryptoz has quit [Read error: Connection reset by peer]
_lyte_ has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
aScottishBoat has joined #ruby
eszett has joined #ruby
milardovich has joined #ruby
_lyte_ has quit [Read error: Connection reset by peer]
Psybur has joined #ruby
kryptoz has joined #ruby
<argoneus> hello
<argoneus> why is it not possible to do ary << yield val?
<argoneus> is it because yield val is a function
<apeiros> what?
<argoneus> I have code that looks like
<apeiros> if I understand your question correctly, then because the syntax doesn't allow it. you have to be explicit.
<apeiros> ary << yield(val)
<argoneus> ah!
<argoneus> ah, okay, that works
alex`` has quit [Quit: WeeChat 1.9.1]
<dminuoso> argoneus: Its invalid with methods as well
<dminuoso> >> a + b c
kryptoz has quit [Read error: Connection reset by peer]
<ruby[bot]> dminuoso: # => /tmp/execpad-b83802d2cf08/source-b83802d2cf08:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/897211)
<dminuoso> >> a + b(c)
<ruby[bot]> dminuoso: # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/897212)
cdg has joined #ruby
kryptoz has joined #ruby
alex`` has joined #ruby
eszett_ has joined #ruby
hinbody has joined #ruby
jottr has joined #ruby
eszett has quit [Ping timeout: 248 seconds]
PaulCapestany has quit [Read error: Connection reset by peer]
kryptoz has quit [Read error: Connection reset by peer]
kryptoz has joined #ruby
PaulCape_ has joined #ruby
eszett has joined #ruby
larcara has joined #ruby
eszett_ has quit [Ping timeout: 248 seconds]
ldnunes has quit [Read error: Connection reset by peer]
whowantstolivefo has quit []
synthroid has joined #ruby
ldnunes has joined #ruby
Defenestrate has joined #ruby
eszett has left #ruby ["Leaving"]
hightower2 has joined #ruby
Barrt has joined #ruby
ramfjord has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
ramfjord has quit [Ping timeout: 240 seconds]
nadir has joined #ruby
milardov_ has joined #ruby
marr has joined #ruby
marr has quit [Remote host closed the connection]
alex`` has quit [Ping timeout: 258 seconds]
milardovich has quit [Ping timeout: 268 seconds]
<aScottishBoat> What's the craic this morning lads
marr has joined #ruby
alfiemax has joined #ruby
rippa has joined #ruby
Silthias1 has joined #ruby
guille-moe has joined #ruby
qqmash has quit [Quit: Leaving.]
Silthias has quit [Ping timeout: 240 seconds]
kotk has joined #ruby
kotk has quit [Client Quit]
Technodrome has joined #ruby
jphase has joined #ruby
mson has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
guardianx has joined #ruby
alex`` has joined #ruby
Bish has quit [Ping timeout: 268 seconds]
synthroid has quit [Remote host closed the connection]
Bish has joined #ruby
synthroid has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
synthroid has joined #ruby
yeticry has quit [Ping timeout: 268 seconds]
synthroid has quit [Read error: Connection reset by peer]
yeticry has joined #ruby
synthroid has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
synthroid has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
kotk has joined #ruby
kotk has quit [Client Quit]
synthroid has joined #ruby
tcopeland has quit [Quit: tcopeland]
synthroid has quit [Read error: Connection reset by peer]
guardianx has quit [Remote host closed the connection]
synthroid has joined #ruby
Defenestrate has quit [Quit: This computer has gone to sleep]
guardianx has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
jrafanie has joined #ruby
oleo has joined #ruby
Defenestrate has joined #ruby
nolakat has joined #ruby
tcopeland has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ek926m has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
milardov_ has quit [Ping timeout: 248 seconds]
krawchyk has joined #ruby
ek926m has quit [Remote host closed the connection]
DLSteve has joined #ruby
tomphp has joined #ruby
jottr has joined #ruby
Defenestrate has quit [Quit: This computer has gone to sleep]
Silthias1 has quit [Ping timeout: 260 seconds]
Silthias has joined #ruby
nicolas has joined #ruby
Defenestrate has joined #ruby
Defenestrate has quit [Changing host]
Defenestrate has joined #ruby
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
Defenestrate has quit [Client Quit]
gnufied has joined #ruby
iamarun has joined #ruby
petto has joined #ruby
MystiqueEnigma has joined #ruby
Rapture has joined #ruby
Silthias has joined #ruby
synthroid has joined #ruby
Silthias1 has quit [Ping timeout: 248 seconds]
JsilverT has joined #ruby
charliesome has joined #ruby
herbmillerjr has joined #ruby
apparition has joined #ruby
stoffus has quit [Ping timeout: 240 seconds]
polishdub has joined #ruby
aScottishBoat has quit [Quit: Leaving]
milardov_ has joined #ruby
synthroi_ has joined #ruby
synthroid has quit [Ping timeout: 248 seconds]
nicolas has left #ruby ["Konversation terminated!"]
aScottishBoat has joined #ruby
iamarun has quit [Read error: Connection reset by peer]
milardovich has quit [Ping timeout: 260 seconds]
jottr has quit [Ping timeout: 260 seconds]
MystiqueEnigma has left #ruby [#ruby]
elphe has joined #ruby
<aScottishBoat> Anyone who can help me with Rails help? I can't connect to their irc room
<aScottishBoat> I want to access my rails app using my outward-facing IP address from my GCE VM.
uZiel has joined #ruby
<ccooke> aScottishBoat: If you type "/join #RubyOnRails" that should get you to their channel
Barrt has quit [Ping timeout: 264 seconds]
<aScottishBoat> I just had to reidentify myself. (doh)
<aScottishBoat> cheer ccooke
nofxx_ has joined #ruby
<ccooke> no problem
jottr has joined #ruby
nofxx has quit [Read error: Connection reset by peer]
Barrt has joined #ruby
alfiemax has quit [Remote host closed the connection]
orbyt_ has joined #ruby
iamarun has joined #ruby
iamarun has quit [Remote host closed the connection]
hightower2 has quit [Ping timeout: 248 seconds]
zautomata has quit [Changing host]
zautomata has joined #ruby
alfiemax has joined #ruby
<aScottishBoat> Well, my question still stands because #RubyOnRails is 100% dead atm.
<aScottishBoat> if anyone can offer some Rails help :)
<coderphive> All the rails r belong 2 us
<larcara> aScottishBoat, did you start server binding the 0.0.0.0 or the public ip?
<Burgestrand> aScottishBoat from a rails-standpoint it should be sufficient for you to start the server by binding it to `0.0.0.0` (should bind it to all network interfaces, not just default loopback)
<Burgestrand> :)
<coderphive> first of all
<coderphive> aScottishBoat: Are you using a web server?
ramfjord has joined #ruby
<coderphive> Because you really shouldn't be allowing rails to just serve traffic in production. It's not a web server.
<aScottishBoat> coderphive, no, I'm just `bundle exec rails s -b 0.0.0.0 -p 80` atm, but I get `sudo: bundle: command not found`
<coderphive> ah
<coderphive> Bundler isn't installed
<aScottishBoat> No, I'm doing a POC for my employer. Building ManageIQ from source
<coderphive> aScottishBoat: what OS are you on?
<aScottishBoat> `36:bundler (1.15.4)`
<aScottishBoat> err
<aScottishBoat> gem list | grep -n "bundler" # => 36:bundler (1.15.4)
<aScottishBoat> CentOS 7
<coderphive> aScottishBoat: do `cat /etc/*release*
<coderphive> without the tick
dionysus69 has joined #ruby
<aScottishBoat> sec
raynold has quit [Quit: Connection closed for inactivity]
<coderphive> good old CentOS. piece of garbage
<aScottishBoat> haha
<coderphive> =|
<aScottishBoat> only cuz there are no Fedora GCE images -_-
<aScottishBoat> personally, I use Debian/Ubuntu + Antergos
Technodrome has joined #ruby
<coderphive> Debian/Ubuntu/CoreOS > *
<coderphive> fact
<coderphive> anyway, I digress
<coderphive> You need to install bundler
<aScottishBoat> coderphive, xD But anyways, bundler works just not with sudo
<aScottishBoat> I have it
cschneid_ has quit [Remote host closed the connection]
<coderphive> type bundle, what happens
ramfjord has quit [Ping timeout: 240 seconds]
<aScottishBoat> bundler -v # => Bundler version 1.15.4
<coderphive> okay, then bundler is not in your sudo path
<aScottishBoat> The latest bundler is 1.16.0, but you are currently running 1.15.4.To update, run `gem install bundler`Could not locate Gemfile
bigkevmcd has joined #ruby
cschneid_ has joined #ruby
<aScottishBoat> That's what I thought. I'm not sure how to add it though
<coderphive> well, Bundler shouldn't be executed as root :)
<aScottishBoat> I get this when I run `rails s -b...` without sudo
<coderphive> I think it actually shoots you a sweet message about that
ana_ has quit [Quit: Leaving]
Barrt has quit [Ping timeout: 248 seconds]
<coderphive> so
<coderphive> You want to do a bundle install --deployment
<coderphive> so it stores your gems locally
vee__ has quit [Ping timeout: 248 seconds]
<aScottishBoat> line 12
<coderphive> does netstat -a show anything else binding to port 80?
moei has joined #ruby
<coderphive> Actually
<coderphive> Sorry - let's reset
<coderphive> A) you need to run on a non-privileged port
<coderphive> like 3000
cschneid_ has quit [Ping timeout: 246 seconds]
<coderphive> B) In order to run rails in prod under port 80 you need to use Nginx + Unicorn or something similar to proxy requests to your app
<aScottishBoat> It doesn't need to be port 80.
<aScottishBoat> Oh wait, I just `bundle exec rails s -b 0.0.0.0 -p 3000` and it worked
<coderphive> then launch it on an unprivileged port
duckpuppy has quit [Ping timeout: 248 seconds]
<coderphive> or a port > 1024
<coderphive> yeap
<aScottishBoat> Aha, great
<coderphive> Do you want me to explain that to you?
<coderphive> (Why it worked)
<aScottishBoat> Sure, learning is good.
<coderphive> 1-1024 are privileged ports (ports that need to be run as root)
<coderphive> > 1024 are unprivileged ports which can be run as any user
<coderphive> In > 1024 you jail that user somehow and then proxy requests from a web server TO it
<coderphive> (in production)
<coderphive> <3
<aScottishBoat> Man, coderphive you're awesome. Thanks mate
<coderphive> np man
<dminuoso> "privileged" ports was such a silly concept honestly.
duckpuppy has joined #ruby
uZiel has quit [Ping timeout: 240 seconds]
<dminuoso> Whoever came up with the idea deserves to be shot, hanged, cruficied, clone back to life and killed again.
<aScottishBoat> Why is it that bad dminuoso?
<aScottishBoat> Mind you: I've done a bit of web dev, but networking is not my domain.
<coderphive> dminuoso That's not true
<dminuoso> aScottishBoat: Do you know what the intend was?
<coderphive> Privileged ports have a very viable existence
<coderphive> Although I can understand why the concept is frustrating to a developer
<dminuoso> It's to promote the idea, that if you connect to a remote service, and it was listening to such a "privileged port", that you could trust the service more, because it took administrative rights to listen to that port.
<dminuoso> In reality it tells you nothign.
uZiel has joined #ruby
<coderphive> dminuoso that's not true
<coderphive> Can you cite that?
<dminuoso> A service is not more trustworthy just because it implies whoever is running it has root access.
<coderphive> heh
<coderphive> I think you miss the point
milardovich has joined #ruby
<coderphive> It's about user separation, which is fairly effective, and abiding by the principal of least privilege
<aScottishBoat> Principal of Least Privilege... never heard of it. What's that coderphive?
<coderphive> Mostly a Linux concept, but fairly universal overall
<coderphive> Basically you give a user the least about of privilege they need to perform their job
<coderphive> In automation this is pretty key
<coderphive> Your app may run as the user "puma" in the group "puma". Maybe it owns a directory called "/opt/puma".
<coderphive> The implication is that if I find a way to hack whatever your app is, all I have access to is that directory and nothing else on the system
vee__ has joined #ruby
milardov_ has quit [Ping timeout: 240 seconds]
<coderphive> the concept of privileged ports isn't as cut and dry as dminuoso put it, but they're somewhat correct
<coderphive> ie: in respect to a web server - nginx runs as the user "nginx", so how does it bind to a privileged port?
<dminuoso> I'd say that is as good a citation as it can get.
guardianx has quit []
Barrt has joined #ruby
<coderphive> nginx spawns a process that handles requests. That process _only_ handles requests and is run as root through systemd
<dminuoso> coderphive: But feel free to provide evidence to the contrary.
truenito has quit [Ping timeout: 250 seconds]
<coderphive> everything else is run under nginx (ie, the more potentially vulnerable parts of the code)
<coderphive> I think nginx has actually revised this to it binds the port to the service and then exits
<coderphive> so it all has to be setup through systemd
<darix> coderphive: having the app be able to write its code is just stpuid
<darix> stupid
<darix> and sadly many tools do that
<coderphive> Yeah, I'd agree
<darix> so my gitlab package e.g. has root:gitlab u=rwX,g=rX,o= as permission set
<darix> and only tmp/ and public/ have partially gitlab:gitlab u=rwX,g=rX,o=
<coderphive> idk, I'm an infrastructure automator, so I do this stuff a lot differently than most of you probably do :P
<darix> coderphive: i am a packager who likes secure over convenient packages ;)
<coderphive> I agree
<jokke> hey
* dminuoso pokes jokke with a monad
<coderphive> But, if someone is just totally frustrated and I can't help them, I'd rather they settle with some sort of compromise
aufi has quit [Remote host closed the connection]
<coderphive> not that what they're doing is good, but it's better than being the worst :P
elbuki has joined #ruby
<jokke> what stubbing lib would you recommend for minitest. i need something like rspec's instance_double(...) and allow(foo).to receive(...)
<jokke> ?
<jokke> i tried Spy but i hate the interface
<aScottishBoat> Hey jokke.
<aScottishBoat> Not sure -- guys?
<dminuoso> jokke: Doesnt minitest have Object#stub ?
<jokke> dminuoso: i need to be able to check if the method has been called
<jokke> and if so with what args
<jokke> i'm unit testing something that reads from and writes to sockets
<jokke> so i'm stubbing out the socket
<dminuoso> "unit testing", "need to check if the method has been called"
<dminuoso> White box unit testing?
<dminuoso> o.o
<atmosx> O.o
<jokke> o.o
<jokke> what do you mean
quobo has quit [Quit: Connection closed for inactivity]
cvander has quit [Quit: Textual IRC Client: www.textualapp.com]
<jokke> another thing: what happens with stderr in IO.popen?
nogic has joined #ruby
<jokke> i thought it would be forwarded to STDERR but seems like it goes nowhere
<Burgestrand> jokke how about using IO.pipe and reading the data in the other end?
<Burgestrand> (as opposed to stubbing it out)
conta has quit [Quit: conta]
cschneid_ has joined #ruby
<coderphive> HOLD THE PHONE
truenito has joined #ruby
<coderphive> o.o
<coderphive> carry on
alfiemax has quit [Remote host closed the connection]
remix2000 has quit [Ping timeout: 258 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AnoHito has quit [Quit: Leaving]
Barrt has quit [Ping timeout: 248 seconds]
elphe has quit [Ping timeout: 268 seconds]
truenito has quit [Ping timeout: 248 seconds]
gregf_ has quit [Quit: Page closed]
Barrt has joined #ruby
gregf_ has joined #ruby
PaulCape_ has quit [Read error: Connection reset by peer]
mjolnird has quit [Quit: Leaving]
cagomez has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vipaca has joined #ruby
remix2000 has joined #ruby
alfiemax has joined #ruby
mark_66 has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardov_ has joined #ruby
milardov_ has quit [Remote host closed the connection]
milardov_ has joined #ruby
AnoHito has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
Burgestrand has quit [Quit: Closing time!]
Barrt has quit [Ping timeout: 268 seconds]
milardov_ has quit [Ping timeout: 240 seconds]
synthroi_ has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
synthroid has joined #ruby
profetes__ has joined #ruby
thinkpad has quit [Ping timeout: 268 seconds]
kryptoz has quit [Remote host closed the connection]
jaruga has quit [Remote host closed the connection]
marr has quit [Read error: Connection reset by peer]
jaruga has joined #ruby
marr has joined #ruby
profetes_ has quit [Ping timeout: 248 seconds]
dionysus69 has quit [Ping timeout: 248 seconds]
jokester_ has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
quobo has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroi_ has joined #ruby
jokester has quit [Ping timeout: 264 seconds]
armando has quit [Quit: ZNC 1.7.x-nightly-20170828-c1e80b22 - https://znc.in]
truenito has joined #ruby
kryptoz has joined #ruby
alfiemax has quit [Remote host closed the connection]
armando has joined #ruby
PaulCapestany has joined #ruby
Barrt has joined #ruby
kryptoz has quit [Ping timeout: 260 seconds]
truenito has quit [Ping timeout: 268 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
bigkevmcd has quit [Ping timeout: 248 seconds]
herbmillerjr has quit [Quit: Konversation terminated!]
Serpent7776 has quit [Quit: Leaving]
bigkevmcd has joined #ruby
troys has joined #ruby
raynold has joined #ruby
milardovich has joined #ruby
tomphp has joined #ruby
sucks has joined #ruby
milardov_ has joined #ruby
truenito has joined #ruby
jottr has joined #ruby
larcara has quit [Remote host closed the connection]
milardovich has quit [Ping timeout: 240 seconds]
larcara has joined #ruby
larcara has quit [Remote host closed the connection]
larcara has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
jrafanie_ has joined #ruby
truenito has quit [Ping timeout: 248 seconds]
jrafanie has quit [Ping timeout: 268 seconds]
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
mniip has joined #ruby
<cagomez> is a variable declared in a begin block accessible in the an exception rescue? eg item = db_op; rescue RecordInvalid => e; puts items.errors; end
nowhere_man has joined #ruby
bigkevmcd has quit [Ping timeout: 248 seconds]
larcara has quit []
elbuki has joined #ruby
ramfjord has joined #ruby
sucks has quit [Remote host closed the connection]
sucks has joined #ruby
sucks has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
exhiled has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
roamingdog has joined #ruby
stoopidmunkey has joined #ruby
<Caius> cagomez: it should be, but only if the error was raised after it was assigned
<cagomez> Caius: in my case, db_op is a transaction that calls yet another method db_op2. db_op2 is blowing up and doesn't return an object
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Caius> If it errors before the assigment (ie, calling the code after =) then the variable won't have been set
<cagomez> ah I see. is the exception text the same as what would have been on the item itself? in other words, is `RecordInvalid => e` the same as what would have been in item.errors ?
<Caius> no, e is the exception object that's raised
hopsoft has joined #ruby
<Caius> If RecordInvalid stores the errors on itself, you might be able to use that
<cagomez> yup Caius , that's exactly what's happening
<cagomez> yes, I can see a Validation Error on e
claudiuinberlin has joined #ruby
Beams has quit [Quit: .]
<cagomez> what do you think of this Caius? https://hastebin.com/iqehavujaq.rb
<Caius> That would work, sure :-)
<Caius> I'd be tempted to try and add it as a validation to the model so it adds the error before saving & saves you having to rescue it
<Caius> But there's many ways to skin that cat, and sometimes you just need it to work :-D
<cagomez> yes this is the latter case, for sure. a bunch of legacy code to work around
cdg has quit [Remote host closed the connection]
tomphp has joined #ruby
cdg has joined #ruby
imode has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
apparition has quit [Quit: Bye]
Asher has joined #ruby
al2o3-cr has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
Sparky2 has joined #ruby
<Sparky2> Hello!
jenrzzz has quit [Ping timeout: 248 seconds]
jaruga has quit [Quit: jaruga]
<Sparky2> I have questions
<Sparky2> First, is this a fair definition? % - Percent - doesn't do percentages when used in ruby math, instead does some weird jiggery pokery with remainders.
mostlybadfly has quit [Quit: Connection closed for inactivity]
<Sparky2> Second, when I define the usage of (), in my early days of learning, is it fair for me to say that it holds arguments?
kies has quit [Ping timeout: 240 seconds]
Eiam has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
tomphp_ has joined #ruby
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkmorph has quit [Ping timeout: 264 seconds]
Barrt has quit [Ping timeout: 268 seconds]
<baweaver> Sparky2: It's called modulo - http://ruby-doc.org/core-2.4.0/Integer.html#method-i-25
tomphp has quit [Ping timeout: 248 seconds]
<jokke> i'll just ask again
<jokke> what stubbing lib would you recommend for minitest. i need something like rspec's instance_double(...) and allow(foo).to receive(...)
petto has quit [Remote host closed the connection]
<baweaver> Sparky2: re (), what now? Explain
petto has joined #ruby
Barrt has joined #ruby
<baweaver> jokke: Haven't really used Minitest or I'd answer
ramfjord has joined #ruby
nowhere_man has joined #ruby
sucks has joined #ruby
<baweaver> Articles like this are popping up in Google for it - https://semaphoreci.com/community/tutorials/mocking-in-ruby-with-minitest
<jokke> baweaver: lucky you
<jokke> minitest is pita
<cagomez> Caius : return an invalid record with its errors; https://apidock.com/rails/ActiveRecord/RecordInvalid . gonna use e.record.errors :)
<baweaver> No need to be snarky.
orbyt_ has joined #ruby
petto has quit [Ping timeout: 240 seconds]
<Sparky2> baweaver: I've been studying for a few days, and so far I've learned that () will hold arguments, example: def number (arg1, arg2)
<Sparky2> baweaver: I was wondering I I missed something with the ()
<Sparky2> if*
<baweaver> To be fair you could also write that as: def number a, b
mim1k has joined #ruby
<baweaver> the parens aren't required
<baweaver> but they clarify intent
<baweaver> It's a way to pass or define arguments
<baweaver> Also used arbitrarily in math scenarios to override order of operations
<baweaver> or getting a method called on a range: (1...5).each
<Sparky2> Oh boy, when people told me that ruby has various ways of doing things.... they weren't kidding
<baweaver> or several other things
<baweaver> Hence me thinking that describing parens as holding arguments was kind of odd
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 248 seconds]
<jokke> Sparky2: there's a style guide though
milardovich has joined #ruby
<baweaver> Typically that one.
<baweaver> Rubocop and other editor linters typically build from it
milardov_ has quit [Ping timeout: 240 seconds]
exhiled has joined #ruby
exhiled has quit [Client Quit]
guille-moe has quit [Ping timeout: 248 seconds]
JsilverT has quit [Quit: WeeChat 2.0-dev]
jrafanie has joined #ruby
mim1k has joined #ruby
andikr has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
jrafanie_ has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
nolakat has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Cohedrin has joined #ruby
DTZUZO has quit [Ping timeout: 260 seconds]
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
gizmore|2 is now known as gizmore
shinnya has joined #ruby
Asher has quit [Remote host closed the connection]
exhiled has joined #ruby
Barrt has quit [Ping timeout: 240 seconds]
johnny56_ has joined #ruby
johnny56 has quit [Ping timeout: 264 seconds]
darkmorph has joined #ruby
<Sparky2> Could someone send me some broken code please?
<Sparky2> Nothing super complex, maybe 30 lines or so
profetes__ has quit [Quit: Leaving]
michael3 has joined #ruby
kies has joined #ruby
<havenwood> Sparky2: Whatcha looking for broken code for?
mim1k has joined #ruby
<Sparky2> havenwood: So I can try to fix it.. you know, a learning proccess
xco has joined #ruby
<havenwood> Sparky2: Sure, I'll give you a small example. Sec.
<Sparky2> Thanks!
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
wilbert has joined #ruby
<Bish> Sparky2: like syntax error?
<Sparky2> Yes!
Barrt has joined #ruby
<Sparky2> My lesson that I'm doing basically told me to find ruby code example and try to understand it, but I thought it would be more fun to unsderstand and fix code that isn't working
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tvw has quit [Remote host closed the connection]
guacamole has joined #ruby
roadrunneratwast has joined #ruby
alfiemax has joined #ruby
mim1k has joined #ruby
Xiti has quit [Ping timeout: 248 seconds]
Xiti has joined #ruby
<havenwood> Sparky2: If you run this code like `ruby sparky.rb` you'll see the tests fail. Once you've fixed the code, all the tests should pass.
guacamole has quit [Ping timeout: 260 seconds]
wilbert has quit [Ping timeout: 248 seconds]
vipaca has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<Sparky2> havenwood: Okay, so I have some research do do on classes and assert
vipaca has quit [Client Quit]
michael3 has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 248 seconds]
Cohedrin has quit [Read error: Connection reset by peer]
roadrunneratwast has left #ruby [#ruby]
uZiel has joined #ruby
mim1k has joined #ruby
Cohedrin has joined #ruby
<dminuoso> havenwood.
<dminuoso> What method name for <*> ?
<dminuoso> .apply ?
jackjackdripper has joined #ruby
<dminuoso> .ap ?
<dminuoso> (.ap is a bit too general, as I want something that only applies to strong lax monoidal functors)
mim1k has quit [Ping timeout: 240 seconds]
Psybur has quit [Remote host closed the connection]
<havenwood> dminuoso: hmmmm
Psybur has joined #ruby
jackjackdripper has quit [Client Quit]
jackjackdripper has joined #ruby
<Sparky2> havenwood: I've totally not covered most of the uhmm.. tools? Right, those tools aren't in my coding toolbelt yet, so I'm having to do a bit of googling to figure out what a lot of it does
<havenwood> dminuoso: .squish, i dunno!
<dminuoso> squish?!
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> haha
<havenwood> splat sammish?
ur5us has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
kies has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
Barrt has quit [Ping timeout: 240 seconds]
xco has quit [Ping timeout: 248 seconds]
kies has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
Barrt has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 268 seconds]
mn3m has quit [Quit: mn3m]
milardovich has quit [Remote host closed the connection]
mson has quit [Quit: Connection closed for inactivity]
LocaMocha has quit [Ping timeout: 240 seconds]
xco has joined #ruby
chmurifree is now known as chmuri
Barrt has quit [Ping timeout: 248 seconds]
Barrt has joined #ruby
A124 has quit [Ping timeout: 258 seconds]
sucks_ has joined #ruby
sucks_ has quit [Remote host closed the connection]
sucks_ has joined #ruby
lagweezle_away is now known as lagweezle
A124 has joined #ruby
enterprisey has joined #ruby
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
PaulCapestany has quit [Ping timeout: 260 seconds]
uZiel has quit [Read error: Connection reset by peer]
John___ has joined #ruby
wilbert has joined #ruby
Barrt has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
RickHull has joined #ruby
A124 has quit [Ping timeout: 248 seconds]
Barrt has joined #ruby
ramfjord has joined #ruby
uZiel has joined #ruby
anisha has joined #ruby
nogic has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
mim1k has quit [Ping timeout: 248 seconds]
PaulCapestany has joined #ruby
mikecmpbll has joined #ruby
nopolitica has joined #ruby
jrafanie has joined #ruby
sucks_ has quit [Ping timeout: 240 seconds]
Xiti has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
guille-moe has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
weaksauce has joined #ruby
cdg has joined #ruby
Freshnuts has joined #ruby
mim1k has joined #ruby
Psybur has quit [Remote host closed the connection]
ur5us has joined #ruby
Psybur has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 240 seconds]
anisha has quit [Quit: This computer has gone to sleep]
sucks has quit [Remote host closed the connection]
Xiti has joined #ruby
guille-moe has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
sightes has joined #ruby
cdg_ has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
ldnunes has quit [Quit: Leaving]
cdg has quit [Ping timeout: 248 seconds]
Rapture has joined #ruby
AnoHito has quit [Quit: Leaving]
ramfjord has quit [Ping timeout: 258 seconds]
zautomata has quit [Ping timeout: 246 seconds]
guacamole has joined #ruby
troulouliou_div2 has joined #ruby
zautomata has joined #ruby
troys is now known as troys_
aScottishBoat has quit [Ping timeout: 250 seconds]
enterprisey has quit [Remote host closed the connection]
cagomez has quit [Remote host closed the connection]
Barrt has quit [Ping timeout: 248 seconds]
AnoHito has joined #ruby
DTZUZO has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
stoopidmunkey has quit [Remote host closed the connection]
stoopidmunkey has joined #ruby
xco has quit [Ping timeout: 240 seconds]
xco_ has joined #ruby
stoopidmunkey has quit [Remote host closed the connection]
stoopidmunkey has joined #ruby
Barrt has joined #ruby
ozcanesen has joined #ruby
synthroi_ has quit [Remote host closed the connection]
synthroid has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
minimalism has joined #ruby
sightes has quit [Quit: WeeChat 1.9.1]
orbyt_ has joined #ruby
michael3 has joined #ruby
mim1k has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroi_ has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
troys_ is now known as troys
urk187 has joined #ruby
urk187 has quit [Client Quit]
ramfjord has joined #ruby
ozcanesen has quit [Quit: ozcanesen]
tomphp has joined #ruby
reber has quit [Remote host closed the connection]
ozcanesen has joined #ruby
ramfjord has quit [Client Quit]
mochiyoda_ has quit [Quit: Konversation terminated!]
mochiyoda_ has joined #ruby
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
zipace has quit [Ping timeout: 250 seconds]
tomphp has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
tomphp has joined #ruby
|ifei5g00d has joined #ruby
|ifei5g00d has quit [Read error: Connection reset by peer]
|ifei5g00d has joined #ruby
|ifei5good has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 260 seconds]
br0d1n has joined #ruby
Psybur has quit [Ping timeout: 248 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
enterprisey has joined #ruby
synthroid has joined #ruby
stoopidmunkey has quit [Read error: Connection reset by peer]
stoopidmunkey has joined #ruby
stoopidmunkey has quit [Client Quit]
synthroi_ has quit [Ping timeout: 248 seconds]
mostlybadfly has joined #ruby
PaulCapestany has quit [Quit: .]
mim1k has joined #ruby
pilne has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
PaulCape_ has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
wilbert has quit [Ping timeout: 268 seconds]
tlaxkit has joined #ruby
yusuf34 has joined #ruby
PaulCape_ has quit [Ping timeout: 268 seconds]
<yusuf34> hi
PaulCapestany has joined #ruby
PaulCapestany has quit [Read error: Connection reset by peer]
yusuf34 has left #ruby ["Leaving"]
PaulCapestany has joined #ruby
krawchyk has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
michael3 has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
synthroid has quit []
br0d1n has quit [Quit: Leaving]
xco_ has quit [Read error: Connection reset by peer]
yabbes has joined #ruby
tcopeland has quit [Quit: tcopeland]
duckpuppy has quit [Ping timeout: 248 seconds]
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkmorph has quit [Ping timeout: 240 seconds]
p0p0pr37 has quit [Remote host closed the connection]
xco has joined #ruby
alveric4 has joined #ruby
alveric3 has quit [Ping timeout: 240 seconds]
<havenwood> hi
<baweaver> hai
dkotlica has joined #ruby
dkotlica has left #ruby [#ruby]
p0p0pr37 has joined #ruby
mim1k has joined #ruby
br0d1n has joined #ruby
thinkpad has joined #ruby
jaruga has joined #ruby
FrostCandy has joined #ruby
InfinityFye has joined #ruby
<FrostCandy> I have a line like :query => params[:search][:query], I want to see if [:query] is present, if not then put '' in :query. something like this :query => ((params[:search][:query].present?) ? params[:search][:query] : '') would that work?
<apeiros> FrostCandy: do you care about present but nil/false?
<apeiros> if not, params.dig(:search, :query) || ''
<apeiros> assuming you're actually talking about a nested hash, and not ActionController::Params
<FrostCandy> oh i think it is actionController actually
<FrostCandy> i guess this was a rails question :P
<havenwood> FrostCandy: Will `params.key?(:search) #=> true` always be true?
<havenwood> >> nil.to_s
<ruby[bot]> havenwood: # => "" (https://eval.in/897756)
<FrostCandy> no , if :search doesn't exist i want to use a ''
<FrostCandy> params.key?(:search) could be non-existant so false
gregf_ has quit [Ping timeout: 260 seconds]
<havenwood> FrostCandy: Then I like apeiros' solution. since it's slightly more straightforward than: params.dig(:search, :query).to_s
jenrzzz has joined #ruby
<havenwood> Though that ^ works too
<FrostCandy> oh ok I see what you did. Can you write if statements in ruby like php ? So x = ((true) ? 1 : 0)
<RickHull> yes, the ternary operator
<FrostCandy> ok thanks
<havenwood> FrostCandy: you can, but you don't need it here
<FrostCandy> nope, apeiro's solution is correct for me here.
<apeiros> /nick apeiro
<apeiros> since apparently, that's me now
duckpuppy has joined #ruby
eckhardt has joined #ruby
<havenwood> sounds refreshing, maybe an apertif
jenrzzz_ has joined #ruby
* apeiros hands havenwood an i, just for good measure
* havenwood joins the drop rando letters club
<adaedra> /nick apéro
banisterfiend has joined #ruby
<apeiros> sadly not valid :(
<havenwood> apéiros
jenrzzz has quit [Ping timeout: 268 seconds]
xco has quit [Ping timeout: 268 seconds]
<FrostCandy> apeiros: undefined method `dig' for #<ActionController::Parameters - like you said , is there an alternative for rails or should i ask in a ralis forum
weaksauce has joined #ruby
<apeiros> you can always patch monkey sense into rails
<apeiros> but yeah…
<apeiros> ?rails FrostCandy
<ruby[bot]> FrostCandy: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
elphe_ has joined #ruby
<FrostCandy> ty
mim1k has quit [Ping timeout: 248 seconds]
jenrzzz_ has quit [Ping timeout: 260 seconds]
polishdub has quit [Quit: leaving]
FrostCandy has quit []
xco has joined #ruby
<havenwood> Or PR it into Rails. :-)
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
* apeiros never prs again to rails
alex`` has quit [Ping timeout: 258 seconds]
<dminuoso> apeiros: Or you could use my lens library!
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> view(queryL, params) :o
<apeiros> oh?
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
xco has quit [Ping timeout: 248 seconds]
<apeiros> I better don't read the code :-p
<dminuoso> This can be neatly adapted to also support "conditionally" traversing.
<dminuoso> apeiros: Just look at the end for usage.
<dminuoso> Ignore the implementation.
<dminuoso> apeiros: It's kind of like Hash#dig but in a far more general and composable way.
<apeiros> mhm
<apeiros> I think somebody implemented something like xpath for ruby. forgot the name, though
Xiti has quit [Ping timeout: 240 seconds]
<elomatreb> When you think "I want to probe this Hash with XPath" you should reevaluate your life decisions
duckpuppy has quit [Ping timeout: 260 seconds]
<apeiros> not hash
<apeiros> arbitrary object tree
<dminuoso> elomatreb: Im not entirely convinced. Much like dig or lenses they encompass the idea of separating the "how do I get there" with "applying it" and "using it"
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
InfinityFye has quit [Ping timeout: 240 seconds]
<dminuoso> apeiros: Yeah, and lenses are even more general.
<apeiros> for debugging, I can actually imagine that being quite nice
<apeiros> for other things, demeter might want to have a word with you
<apeiros> (though, I actually tend to ignore demeter quite a bit)
<dminuoso> apeiros: What I just did is the most basic functionality that allows you to take a lens (Which just focuses on a single object in some arbitrary structure), and then set lets you change that exact value, view lets you see it, and over lets you change it.
<dminuoso> And its done in a way that you can just combine lenses (much like lenses in optics can just be placed behind each other to combine effects)
jphase has quit []
<apeiros> sounds nice
ozcanesen has quit [Quit: ozcanesen]
<RickHull> dminuoso: NameError: undefined local variable or method `w' for L:Module
<RickHull> when I pasted into irb
<dminuoso> RickHull: Ohh sorry one sec, mishap during vim
<dminuoso> RickHull: replace that w with s
<dminuoso> Argh one moment let me fix it
jenrzzz has joined #ruby
<RickHull> dminuoso: any opportunity to slip in something like: w.(t, f)
<dminuoso> RickHull: That shows various usages.
mim1k has joined #ruby
<dminuoso> RickHull: Oh I fail at reading. should have been `w` not `f`. Its a bit hard to read the ruby version of it.
tvw has joined #ruby
darkmorph has joined #ruby
biberu has quit []
<RickHull> ya know, they make these things called github repos... ;)
Xiti has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
<RickHull> can we rename s to w, f to t, and t to f?
<RickHull> and L107 will be w.(t, f)
<dminuoso> s to w is fine, but why f<>t?
jenrzzz has quit [Ping timeout: 268 seconds]
<RickHull> that will make your WTFs per line of code go up
<adaedra> what the
<adaedra> ops, they're doing nasty things
<dminuoso> RickHull: I decided to not make a repo until I have studied the more magical lens things in Haskell
<RickHull> i've saved all your prior versions so I can still shame you with them
<dminuoso> That's fine, it's not as much about shame really.
<RickHull> <3
jaruga has quit [Quit: jaruga]
<dminuoso> -> (get, set, to_functor, transform) { to_functor.(get.(transform)).fmap(-> (f) { set.(f, transform) })}.curry[*args]
<dminuoso> Perhaps thats slightly better
<RickHull> to my eyes, for sure
enterprisey has quit [Remote host closed the connection]
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
darkmorph has quit [Ping timeout: 250 seconds]
mim1k has joined #ruby
<dminuoso> RickHull: So how about it. Got any solution for tackling those lambdas?
<RickHull> er, what's the problem? I doubt I will be helpful and my WTFs / LoC is still too high
<RickHull> s/and/as/
<RickHull> I really like this stuff but I need to study it more before it is sensible to me
<RickHull> and I'm working on mruby stuff which is a whole different ballgame
cschneid_ has quit [Ping timeout: 268 seconds]
duckpuppy has joined #ruby
John___ has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
yabbes has quit [Ping timeout: 240 seconds]
lytol has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 260 seconds]
duckpuppy has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
<dminuoso> I want to be able to do this.
<dminuoso> class Module; def defc(name, lmbda) define_method name { |*args| lmbda.curry.instance_exec(*args, &self) }; end; end;
<dminuoso> this is not enough because I still need that self.
<dminuoso> And I dont know how to get that self back in.
cagomez has quit [Read error: Connection reset by peer]
<dminuoso> About the only thing I can think of is rigging .curry
<RickHull> the most I can contribute right now is a name for your project https://en.wikipedia.org/wiki/Lambada
<matthewd> Which self to the what?
cagomez has joined #ruby
<dminuoso> Ohh I could just do instance_exec(*args, &lmbda.curry)
duckpuppy has quit [Ping timeout: 268 seconds]
<dminuoso> o/ matthewd
blackmesa has joined #ruby
darkmorph has joined #ruby
DTZUZU has joined #ruby
dviola has quit [Ping timeout: 248 seconds]
roamingdog has quit []
mson has joined #ruby
<dminuoso> matthewd: https://eval.in/897769
<dminuoso> Or even https://eval.in/897772
bmurt has joined #ruby
bronson_ has joined #ruby
darkmorph has quit [Ping timeout: 240 seconds]
bronson has quit [Read error: Connection reset by peer]
<matthewd> dminuoso: https://eval.in/897773
darkmorph has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
<dminuoso> matthewd: Ohh, instance_method. Nice trick.
<dminuoso> This is lovely thanks.
<matthewd> Yeah AFAIK that's the only fiddle-less way to convert a proc to a lambda
<matthewd> And as we already know that name is about to be overwritten, we're free to shove something else in there for a moment ¯\_(ツ)_/¯
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
__main__ has quit [Read error: Connection reset by peer]
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
__main__ has joined #ruby
<RickHull> what is being achieved here?
ur5us has joined #ruby
<RickHull> I can see how [1,2,3].app.(4) appends 4 (while print-debugging?)
<dminuoso> RickHull: Autocurrying methods