<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
<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!
<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
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]
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]
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
<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
<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>
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…]
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…]
<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]
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?
<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!
<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"
<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)