Garb0 has quit [Remote host closed the connection]
Garb0 has joined #ruby
drincruz has joined #ruby
roadie has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rmnull has quit [Ping timeout: 265 seconds]
roadie has quit [Ping timeout: 260 seconds]
buckworst has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
<havenwood>
tty1: Nice! What was the solution?
cnsvc has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
chalkmonster has joined #ruby
drincruz has quit [Ping timeout: 246 seconds]
SuperLag has quit [Ping timeout: 240 seconds]
SuperLag has joined #ruby
hemmi has joined #ruby
<hemmi>
Hi there. Is there a way to take a Tempfile and save it as a real file?
<hemmi>
I would like to conditionally save a Tempfile I'm working with locally when working in my development environment (to simulate ActiveStorage saving files to s3 in production)
drincruz has joined #ruby
<havenwood>
hemmi: A Tempfile is a real file, just in a location that makes it temporary. If you write the file to a non-temporary location, it won't be temporary.
ur5us has quit [Ping timeout: 244 seconds]
roadie has joined #ruby
<hemmi>
havenwood: hmm, so maybe the distinction I make is in the file that's created i'm writing to. use tempfile if in production and file in development.
<hemmi>
i was thinking about it the other way around- always create the tempfile and copy it if in development
gitter1234 has quit [Quit: Connection closed for inactivity]
roadie has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
roadie has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ldepandis has joined #ruby
braj has joined #ruby
hemmi has quit [Remote host closed the connection]
Vashy has quit [Ping timeout: 252 seconds]
TomyWork has quit [Remote host closed the connection]
Kilo`byte has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Tuor has quit [Remote host closed the connection]
cnsvc has quit [Ping timeout: 240 seconds]
Kilo`byte has joined #ruby
napcae has joined #ruby
iNs has quit [Ping timeout: 240 seconds]
Fridtjof has joined #ruby
iNs has joined #ruby
Tuor has joined #ruby
cnsvc has joined #ruby
dostoyevsky has quit [Ping timeout: 265 seconds]
dostoyevsky has joined #ruby
tpanarch1st has quit [Ping timeout: 260 seconds]
imode has quit [Ping timeout: 244 seconds]
imode has joined #ruby
Garb0_ has joined #ruby
imode has quit [Client Quit]
Garb0 has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 244 seconds]
imode has joined #ruby
Garb0_ has quit [Ping timeout: 246 seconds]
dviola has joined #ruby
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
sergioro has quit [Quit: leaving]
sergioro has joined #ruby
brool has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
fercell has joined #ruby
conta has joined #ruby
cgfbee has joined #ruby
burgestrand has joined #ruby
bwitt has quit [Remote host closed the connection]
alfiemax has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ldepandis has joined #ruby
schne1der has joined #ruby
alfiemax has quit [Remote host closed the connection]
crisfm has joined #ruby
buckworst has joined #ruby
TomyWork has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
imode has quit [Ping timeout: 244 seconds]
ldepandis has quit [Read error: Connection reset by peer]
jinmiaoluo has quit [Remote host closed the connection]
jinmiaoluo has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
jinmiaoluo has quit [Remote host closed the connection]
kenso has joined #ruby
jinmiaoluo has joined #ruby
jinmiaoluo has quit [Remote host closed the connection]
jinmiaoluo has joined #ruby
chalkmonster has joined #ruby
jinmiaoluo has quit [Remote host closed the connection]
jinmiaoluo has joined #ruby
gajus has quit [Ping timeout: 272 seconds]
jinmiaol2 has joined #ruby
gajus has joined #ruby
hahuang65 has quit [Ping timeout: 272 seconds]
jinmiaoluo has quit [Ping timeout: 244 seconds]
hahuang65 has joined #ruby
sergioro has quit [Quit: Lost terminal]
Seich has quit [Quit: Gone fishing.]
nemesit|znc has quit [Ping timeout: 272 seconds]
nemesit|znc has joined #ruby
interruptinuse has quit [Quit: ZNC - https://znc.in -- bye bye!]
jinmiaoluo has joined #ruby
jinmiaol2 has quit [Ping timeout: 260 seconds]
crisfm has quit [Ping timeout: 260 seconds]
conta has quit [Ping timeout: 265 seconds]
conta has joined #ruby
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
jetchisel has joined #ruby
pppktz has joined #ruby
burgestrand has quit [Quit: burgestrand]
d3bug has quit [Quit: Connection closed for inactivity]
dionysus69 has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
dionysus69 has quit [Ping timeout: 265 seconds]
alexherbo23 has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo23 is now known as alexherbo2
jetchisel has quit [Ping timeout: 260 seconds]
jetchisel has joined #ruby
infinityfye has joined #ruby
kenso has quit [Quit: Connection closed for inactivity]
akem has joined #ruby
burgestrand has joined #ruby
_nexxus_ has left #ruby ["Leaving"]
jetchisel has quit [Ping timeout: 260 seconds]
jetchisel has joined #ruby
yokel has joined #ruby
ldepandis has joined #ruby
TCZ has joined #ruby
drincruz has joined #ruby
Technodrome has joined #ruby
conta has quit [Quit: conta]
buckworst has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
drincruz has joined #ruby
hiroaki has joined #ruby
vondruch has joined #ruby
dionysus69 has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
burningserenity has joined #ruby
stooj has quit [Ping timeout: 240 seconds]
cd has joined #ruby
impermanence has quit [Quit: Connection closed]
conta has joined #ruby
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
TCZ has quit [Client Quit]
TCZ has joined #ruby
TCZ has quit [Client Quit]
Esa__ has joined #ruby
GodFather has joined #ruby
burgestrand has quit [Quit: burgestrand]
conta has quit [Quit: conta]
cd has quit [Quit: cd]
mikecmpbll has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.8]
tf2ftw has quit [Quit: Leaving]
al2o3-cr has joined #ruby
jinmiaoluo has quit [Ping timeout: 260 seconds]
impermanence has joined #ruby
ExoUNX has joined #ruby
jinmiaoluo has joined #ruby
stnly has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
gitter1234 has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
arahael1 has joined #ruby
Arahael has quit [Ping timeout: 258 seconds]
burgestrand has joined #ruby
burgestrand has quit [Client Quit]
sergioro has joined #ruby
GodFather has joined #ruby
rippa has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
GodFather has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
arahael1 has quit [Ping timeout: 260 seconds]
arahael2 has joined #ruby
burningserenity has quit [Ping timeout: 244 seconds]
fercell has quit [Quit: WeeChat 2.8]
Technodrome has joined #ruby
ChmEarl has joined #ruby
burningserenity has joined #ruby
arahael2 has quit [Ping timeout: 246 seconds]
s2013 has joined #ruby
titanbiscuit has quit [Ping timeout: 260 seconds]
titanbiscuit has joined #ruby
TomyWork has quit [Remote host closed the connection]
arahael2 has joined #ruby
sergushakov has joined #ruby
d3bug has joined #ruby
jinmiaoluo has quit [Ping timeout: 256 seconds]
ellcs has joined #ruby
balo has joined #ruby
brool has joined #ruby
ellcs has quit [Ping timeout: 244 seconds]
imode has joined #ruby
howdoi has joined #ruby
alfiemax has joined #ruby
TCZ2 has joined #ruby
RiPuk has quit [Ping timeout: 240 seconds]
aphorise has quit [Read error: Connection reset by peer]
ghormoon_ has joined #ruby
romanlevin0 has joined #ruby
alexherbo28 has joined #ruby
rubydoc has quit [Ping timeout: 260 seconds]
infernix has quit [Ping timeout: 260 seconds]
lxsameer has quit [Ping timeout: 256 seconds]
plutes has quit [Ping timeout: 256 seconds]
x0n has quit [Ping timeout: 256 seconds]
rubydoc has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
bhaak has quit [Remote host closed the connection]
cthu| has joined #ruby
x0n has joined #ruby
Esa__ has quit [*.net *.split]
TCZ has quit [*.net *.split]
sergioro has quit [*.net *.split]
ExoUNX has quit [*.net *.split]
stnly has quit [*.net *.split]
infinityfye has quit [*.net *.split]
alexherbo2 has quit [*.net *.split]
yokel has quit [*.net *.split]
jmcgnh has quit [*.net *.split]
SuperLag has quit [*.net *.split]
dhollinger has quit [*.net *.split]
romanlevin has quit [*.net *.split]
mozzarella has quit [*.net *.split]
gdonald has quit [*.net *.split]
mikecmpbll has quit [*.net *.split]
Xeago has quit [*.net *.split]
nchambers has quit [*.net *.split]
rainer_t1 has quit [*.net *.split]
sphex has quit [*.net *.split]
klys has quit [*.net *.split]
genpaku has quit [*.net *.split]
arooni has quit [*.net *.split]
ujjain has quit [*.net *.split]
ghormoon has quit [*.net *.split]
quintasan has quit [*.net *.split]
bodqhrohro has quit [*.net *.split]
tris has quit [*.net *.split]
alexherbo28 is now known as alexherbo2
romanlevin0 is now known as romanlevin
vondruch has joined #ruby
yokel has joined #ruby
mozzarella has joined #ruby
nchambers has joined #ruby
plutes has joined #ruby
tris has joined #ruby
RiPuk has joined #ruby
plutes has quit [Max SendQ exceeded]
Garb0 has joined #ruby
bhaak has joined #ruby
ellcs has joined #ruby
plutes has joined #ruby
<howdoi>
~bot
<howdoi>
!bot
<howdoi>
ruby[bot]: books
Esa__ has joined #ruby
sergioro has joined #ruby
stnly has joined #ruby
SuperLag has joined #ruby
infinityfye has joined #ruby
gdonald has joined #ruby
dhollinger has joined #ruby
<howdoi>
🧞♂️
genpaku has joined #ruby
mikecmpbll has joined #ruby
rainer_t1 has joined #ruby
Xeago has joined #ruby
sphex has joined #ruby
bodqhrohro has joined #ruby
arooni has joined #ruby
ujjain has joined #ruby
jmcgnh has joined #ruby
tty1_ has joined #ruby
stooj has joined #ruby
Garb0 has quit [Read error: Connection reset by peer]
<tty1_>
cant figure out why trying to mixin a static ethod throws an error for me.. line 50 complains the method doesnt exist (worked fine when i had it as its own class rather than a mixin): https://pastebin.com/yj3H32QC
<tty1_>
adam12: not sure im following (thought i was until i saw the example lol)
<adam12>
tty1_: When you include that module, you get the 2 methods dehydrate/rehydrate as instance methods exactly how you want. The class method is the issue.
<adam12>
tty1_: The solution is to move the class method into another module, then extend it from inside the included hook
<tty1_>
adam12: yea its the "extend it from inside the included hook" im not groking
<tty1_>
adam12: ahh so included is a special method that will get autotriggered when i include? The class that uses it still just gets included?
<adam12>
tty1_: Yeah!
<tty1_>
adam12: ahhh i see makes sense let me try, thanks
<adam12>
tty1_: There's a bunch. included, extended, inherited.
TCZ2 has quit [Quit: Leaving]
<tty1_>
adam12: yea it seems like a common ruby sort of pattern, ive seen stuff like that on classes
<tty1_>
adam12: now its complaining @@volatile isnt defined.. hmm
<adam12>
tty1_: quick fix is likely set @@volatile in a class_eval block. I don't use class variables much so I'd have to look deeper.
vondruch_ has joined #ruby
<tty1_>
adam12: ill try to play with it before i beg for help, thanks :)
<havenwood>
tty1_: Is the class instance variable here just used since there's only a single instance of Hydration? Or is @@volatile used from elsewhere?
<tty1_>
havenwood: seems i just solved it by defining @@volatile in the module level outside of the def
<havenwood>
tty1_: If it's just for the single instance, consider using the stdlib Singleton mixin for a class with just a single instance.
<tty1_>
havenwood: im basically trying to create a method called volatile that behave a bit like attr_accesor and such would... im using it to flag instance variables as volatile so marshalling has a way to handle them more elegantly
<havenwood>
tty1_: Matz himself actually maintains Singleton from the stdlib. :)
<havenwood>
tty1_: Singleton is also built with marshalling in mind.
<tty1_>
thsi seems to be working now, but ill check it out thanks
vondruch has quit [Ping timeout: 260 seconds]
vondruch_ is now known as vondruch
<havenwood>
tty1_: Matz even recommends avoiding defining your own class variables and global variables. Even if you want to stick with a module for a singe instance of state (Singleton class is idiomatic here), I'd use a constant or instance variable rather than a class variable.
<tty1_>
havenwood: i do tend to find in the vast majority of cases class varibles are a bad idea.. though some cases they make sense, though id have to see matz alternative before i stick to that opinion
<havenwood>
tty1_: Since you're not reassigning it, a constant seems fine. Or on first glance it looks like it could straight swap for an instance variable—just drop an @. :P
<tty1_>
havenwood: instance variable wouldnt work.. like i said the volatile method is intended to act much like the attr_accessor method does, as such it must be defined as the class level as its invoked before any instances even exist
<havenwood>
tty1_: I do like the Singleton way, since it signals to the reader there's one and only one instance. Modules don't have state, Singleton classes have one instance, and Classes have many.
<havenwood>
tty1_: You can have an instance variable at the module class level, fwiw.
<tty1_>
havenwood: id have to see what that looks like to understand i think
infernix has quit [Ping timeout: 244 seconds]
RiPuk has quit [Ping timeout: 260 seconds]
vondruch has quit [Ping timeout: 260 seconds]
plutes has quit [Ping timeout: 260 seconds]
GodFather has quit [*.net *.split]
Xeago has quit [*.net *.split]
rainer_t1 has quit [*.net *.split]
sphex has quit [*.net *.split]
arooni has quit [*.net *.split]
bodqhrohro has quit [*.net *.split]
ujjain has quit [*.net *.split]
Garb0 has quit [*.net *.split]
sergioro has quit [*.net *.split]
stnly has quit [*.net *.split]
Esa__ has quit [*.net *.split]
infinityfye has quit [*.net *.split]
SuperLag has quit [*.net *.split]
dhollinger has quit [*.net *.split]
gdonald has quit [*.net *.split]
bwitt has joined #ruby
<tankf33der>
i am implementing FFI interface to monocypher library.
<rubydoc>
phaul: I don't know anything about thanks.
<phaul>
lol
<phaul>
np, howdoi
<howdoi>
`_why's Poignant Guide to Ruby` is broken in that list
<phaul>
actually baweaver's list is more up to date, which is in the title https://goo.gl/wpGhoQ
<baweaver>
Ding
<phaul>
&? rm books
<rubydoc>
I forgot what books is.
<phaul>
&? add books You can find a list of recommended books at https://goo.gl/wpGhoQ
<rubydoc>
I will remember that books is You can find a list of recommended books at https://goo.gl/wpGhoQ
dhollinger has quit [Ping timeout: 246 seconds]
alfiemax has quit [Ping timeout: 244 seconds]
dhollinger has joined #ruby
GodFather has quit [Ping timeout: 264 seconds]
plutes has quit [Ping timeout: 246 seconds]
RiPuk has quit [Ping timeout: 260 seconds]
infernix has quit [Ping timeout: 244 seconds]
sh7d has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
felix_221986 has joined #ruby
greypack has quit [Read error: Connection reset by peer]
greypack has joined #ruby
vondruch has joined #ruby
sh7d has joined #ruby
RiPuk has joined #ruby
plutes has joined #ruby
plutes has quit [Max SendQ exceeded]
plutes has joined #ruby
braj has quit []
<howdoi>
cool
tweaks has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
r3m has quit [Quit: WeeChat 2.9-dev]
r3m has joined #ruby
infernix has joined #ruby
gix has joined #ruby
crisfm has joined #ruby
hiroaki has joined #ruby
conta has joined #ruby
caterfxo has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
brool has quit [Quit: WeeChat 2.8]
<howdoi>
is there a oneOf Google's protobuf syntax in ruby
<howdoi>
?
<jidar>
is var =~ Array valid to type/.class checking?
<jidar>
I think this might be an old format, like 1.8.7
* jidar
groans
<phaul>
jidar: no. You can use the type dependent triqual === in the reverse order, Array === [], or kind_of? is_a?
<jidar>
phaul: I tested in 1.8.7 and it's valid, so yeah I need to fix that
<phaul>
but ultimately you don't want type checking code as it's a smell
<jidar>
well, not valid.. returns false.. so uhh
<jidar>
"foo".class would be better, no?
<jhass>
?xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
gigetoo has joined #ruby
* jidar
nods
<jhass>
cannoncal is var.is_a?(Array)
<jhass>
often you can use .respond_to? instead to retain some flexibility
<jhass>
yet more often you can just assume it'll quack alright and consider that not being the case an error condition of your program or misuse of your library
<jhass>
a neat trick to accept either a single value or an array of those is to just do Array(param).each
<jhass>
Module#=== mainly exists for case/when so you can case foo; when Array; ...; when String; ...; end
<jidar>
yeah
<jidar>
that's basically what I'm looking at
leah2 has quit [Ping timeout: 246 seconds]
<apotheon>
Yeah, Array is idempotent. It's pretty nice that way.
<apotheon>
It might take a little thinking, but it shouldn't be too difficult to do yourself. I don't know of a straightforward just-pass-the-array-of-hashes-as-an-argument method, though.
RiPuk has joined #ruby
plutes has joined #ruby
plutes has quit [Remote host closed the connection]
<apotheon>
This is what I've got, off the top of my head: [{one: 1, two: 2, three: 3},{one: 'uno', two: 'dos', three: 'tres'}].each {|h| h.each_pair {|k,v| !foo.has_key? k ? foo[k] = [v] : foo[k] << v } }
<apotheon>
uglified by the fact it's a one-liner
<apotheon>
I should look at what jhass whipped up.
<apotheon>
(even though it requires JavaScript to view it)