havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
phage has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
phage has quit [Client Quit]
TCZ has quit [Quit: Leaving]
orbyt_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
DaRock has joined #ruby
Technodrome has joined #ruby
alexherbo21 has joined #ruby
alexherbo2 has quit [Ping timeout: 264 seconds]
alexherbo21 is now known as alexherbo2
GodFather has quit [Ping timeout: 244 seconds]
envex has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
neshpion has joined #ruby
bg21 has joined #ruby
krma has joined #ruby
elxbarbosa has joined #ruby
elxbarbosa has quit [Remote host closed the connection]
elxbarbosa has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
dualfade has quit [Ping timeout: 256 seconds]
bg21 has left #ruby [#ruby]
dualfade has joined #ruby
axsuul has joined #ruby
bmurt has joined #ruby
jenrzzz has joined #ruby
Rudd0 has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
sgen has quit [Remote host closed the connection]
dualfade has quit [Quit: leaving]
dualfade has joined #ruby
bruce_lee has quit [Ping timeout: 246 seconds]
bruce_lee has joined #ruby
meinside has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
alexherbo22 has joined #ruby
cliluw has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo22 is now known as alexherbo2
cliluw has quit [Ping timeout: 246 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cliluw has joined #ruby
dualfade has quit [Ping timeout: 240 seconds]
ChmEarl has joined #ruby
bmurt has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
alexherbo2 has quit [Ping timeout: 258 seconds]
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
duderonomy has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dualfade has joined #ruby
jenrzzz has joined #ruby
elcuervo has quit [Read error: Connection reset by peer]
gix has quit [Ping timeout: 240 seconds]
elcuervo has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
oneeggeach has quit [Quit: Konversation terminated!]
ramfjord has joined #ruby
aandrew has left #ruby [#ruby]
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
neshpion has quit [Quit: WeeChat 2.9]
Mia has quit [Ping timeout: 260 seconds]
ChmEarl has quit [Quit: Leaving]
Rudd0 has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
donofrio__ has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
SuperLag has quit [Remote host closed the connection]
orbyt_ has joined #ruby
cd has quit [Quit: cd]
ur5us has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 265 seconds]
bambanx has joined #ruby
Asa has joined #ruby
Asa is now known as Guest62283
FrankyCyborg has quit [Quit: The Sleep Monster got me!]
elxbarbosa has quit [Ping timeout: 272 seconds]
dfucci has joined #ruby
TzilTzal has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has joined #ruby
Rudd0 has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
rprimus has quit [Quit: Lost terminal]
rprimus has joined #ruby
bambanx has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
chalkmonster has quit [Quit: WeeChat 2.9]
chalkmonster has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.9]
chalkmonster has joined #ruby
nofxx has quit [Remote host closed the connection]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
jinie has joined #ruby
phage has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
alexherbo2 has joined #ruby
nofxx has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
jintseng has joined #ruby
vondruch has joined #ruby
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has joined #ruby
tumdum has quit [Remote host closed the connection]
chalkmonster has quit [Quit: WeeChat 2.9]
alfiemax has quit [Remote host closed the connection]
ur5us has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
secret-fire__ has joined #ruby
alfiemax has joined #ruby
Secret-Fire has quit [Ping timeout: 246 seconds]
jintseng has quit [Ping timeout: 256 seconds]
akemhp has joined #ruby
akemhp is now known as akem
schne1der has quit [Ping timeout: 258 seconds]
braincrash has joined #ruby
TomyWork has joined #ruby
akemhp_ has joined #ruby
akem has quit [Ping timeout: 240 seconds]
imode has quit [Ping timeout: 260 seconds]
chalkmonster has joined #ruby
akemhp_ is now known as akem
dionysus69 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
ropeney has quit [Ping timeout: 240 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
russano has quit [Ping timeout: 260 seconds]
ropeney has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
Rudd0 has joined #ruby
envex has quit []
skape has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 260 seconds]
<nakilon> bundle exec says I need to bundle install but I just did it: https://dpaste.org/ryH9/slim
<nakilon> I even recreated Gemfile.lock
dfucci has joined #ruby
phage has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
<nakilon> is stopped working after I specified the branch
TCZ has joined #ruby
postmodern has quit [Quit: Leaving]
schne1der has joined #ruby
<nakilon> updating gem bundler didn't help
<nakilon> when I put a breakpoint in bundler to see why it raises the error, it's "def allow_git_ops? ; @allow_remote || @allow_cached ; end" -- both booleans are false for some reason
<nakilon> nope, they are false too even with master branch so that's not the cause
<nakilon> this exception seem to be raised many times during bundle exec but handled somewhere
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
akem has quit [Remote host closed the connection]
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo2 has joined #ruby
ruurd has quit [Remote host closed the connection]
iNs has quit [Ping timeout: 240 seconds]
rann is now known as list
iNs has joined #ruby
list is now known as rann
bmurt has joined #ruby
ruurd has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.9]
bmurt has quit [Client Quit]
<nakilon> so looks like the :branch just does not work in the Gemfile when developing a gem and there is no fix
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nakilon> have to resolve dependencies as remote master branch but use local copy of custom branch with -I flag; and it would not even work if the branch had other dependencies versions
<nakilon> consecutive "bundle install" also behaves differently on master and custom branch -- when generating the Gemfile.lock the first time for master it only fetches the code once
<nakilon> with custom branch it fetches the code from github again and again -- seems like it just can't find the checkouted code
<nakilon> folders with master HEAD and custom branch HEAD are both fetched: ferrum-3d5f991a92b1/ ferrum-b54cc48250a6/
<nakilon> hah! changed the "branch: 'false'" to "ref: 'b54cc48250a6'" and it works now
TCZ has quit [Remote host closed the connection]
TCZ has joined #ruby
cd has joined #ruby
Scient has quit [Quit: ZNC - http://znc.in]
Scient has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
cliluw has joined #ruby
Kanana has joined #ruby
Kanana has quit [Client Quit]
bzb has joined #ruby
TCZ has quit [Quit: Leaving]
dfucci has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
Rudd0 has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
dfucci_ has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
grumby has joined #ruby
fercell has joined #ruby
TCZ has joined #ruby
dualfade has quit [Ping timeout: 258 seconds]
dualfade has joined #ruby
TCZ has quit [Remote host closed the connection]
alfiemax_ has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
ChmEarl has joined #ruby
TCZ has quit [Remote host closed the connection]
bzb has quit [Quit: Leaving]
TCZ has joined #ruby
TCZ has quit [Remote host closed the connection]
TCZ has joined #ruby
TCZ has quit [Remote host closed the connection]
TCZ has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
alfiemax has joined #ruby
fercell has quit [Quit: WeeChat 2.9]
chihhsin has quit [Quit: leaving]
DaRock has quit [Ping timeout: 246 seconds]
m27frogy has quit [Quit: ZNC - https://znc.in]
m27frogy has joined #ruby
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
sol1d has quit [Ping timeout: 256 seconds]
<TzilTzal> Hi.
<TzilTzal> How can I make a block/lambda be evaluated in the context of the yield-er? I'd like to send a block (from main) to be evaluated inside Class.new but when I yield it, self = main....
akemhp has joined #ruby
<adam12> TzilTzal: maybe instance_exec or class_exec?
<adam12> TzilTzal: I'd have to see code to say anything more.
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
skape has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
gray-_-wolf has quit [Quit: WeeChat 2.9]
jenrzzz has quit [Ping timeout: 240 seconds]
Rudd0 has joined #ruby
<TzilTzal> adam12: I'd like to do:
<TzilTzal> def foo
<TzilTzal> ...
<TzilTzal> Class.new(model_klass) do
<TzilTzal> yield if block_given?
<TzilTzal> end
<TzilTzal> end
<TzilTzal> foo do
<TzilTzal> belongs_to ....
<TzilTzal> ... more rails model stuff...
<TzilTzal> end
alfiemax has quit [Remote host closed the connection]
Guest62283 has quit [Remote host closed the connection]
<adam12> TzilTzal: Maybe a few different ways to do this, but I'd probably capture the block by name, assign the new class to an instance variable, then call instance_exec on that variable with your block as an argument.
<TzilTzal> The thing is that when currently the block is executed, self = main and therefore blongs_to fails immediately. It's not executed in the context of the newly created class...
<TzilTzal> adam12: will try your suggestion though.
howdoi has joined #ruby
TCZ has quit [Quit: Leaving]
<adam12> TzilTzal: https://carc.in/#/r/9nkg
<adam12> TzilTzal: You might run into an issue where the binding is odd.
<TzilTzal> adam12: that's pretty much what I'm looking for. What do you mean binding is odd?
<adam12> TzilTzal: Capturing the block also captures the binding. In some rare scenarios you may need to rebind the block to a new binding.
<adam12> TzilTzal: Too much to go into here likely.
jintseng has joined #ruby
<TzilTzal> hmmm sorry, I'm not that advanced in Ruby, so don't now much about binding...
<TzilTzal> at any rate - thanks for your help!
<adam12> TzilTzal: Cheers.
TomyWork has quit [Remote host closed the connection]
phage has joined #ruby
mnathani has quit []
jintseng has quit [Ping timeout: 264 seconds]
sol1d has joined #ruby
<apotheon> TzilTzal: I'm not actually entirely sure what adam12 means about binding, but if I had to guess I think it's a reference to scope -- that is, the block is bound to a particular scope context, including access to its variables and returning to that context.
<apotheon> That's just a guess without looking into it too much, though.
<apotheon> The difficulty for me, without looking more closely, is that there are several different uses of the term "binding" in a programming context, and perhaps more than one of them could apply here. I'm pretty sure this isn't a reference to language binding, though, such as a Ruby API wrapper around a C library. My second guess, after scope binding, would be name binding.
jintseng has joined #ruby
jintseng has quit [Ping timeout: 256 seconds]
jintseng has joined #ruby
Twemlow has joined #ruby
orbyt_ has joined #ruby
neshpion has joined #ruby
jintseng has quit [Ping timeout: 256 seconds]
dfucci_ has quit [Ping timeout: 260 seconds]
Rudd0 has quit [Ping timeout: 256 seconds]
dualfade has quit [Ping timeout: 256 seconds]
neshpion has left #ruby ["WeeChat 2.9"]
dualfade has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
maryo has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
jenrzzz has joined #ruby
vondruch has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
kristian_on_linu has joined #ruby
gix has joined #ruby
bambanx has joined #ruby
TzilTzal has quit [Quit: Leaving.]
rippa has joined #ruby
pwnd_sfw has quit [Remote host closed the connection]
Iarfen has joined #ruby
oneeggeach has joined #ruby
pwnd_sfw has joined #ruby
maryo has quit [Quit: Leaving]
Twemlow has quit [Quit: Twemlow has now left the arena!]
bambanx has quit [Quit: Leaving]
imode has joined #ruby
towo_ has quit [Quit: I am the vanguard of your destruction. This exchange is over.]
towo has joined #ruby
ChmEarl has quit [Quit: Leaving]
powerhouse has quit [Read error: Connection reset by peer]
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lmat has quit [Ping timeout: 258 seconds]
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
TCZ has joined #ruby
powerhouse has joined #ruby
akem has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
roshanavand has joined #ruby
va5c0 has joined #ruby
thither has quit [Ping timeout: 260 seconds]
cnsvc has joined #ruby
sunya7a has joined #ruby
va5c0 has quit [Quit: WeeChat 2.9]
thither has joined #ruby
envex has joined #ruby
jmcgnh has quit [Ping timeout: 264 seconds]
va5c0 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
va5c0 has quit [Client Quit]
va5c0 has joined #ruby
va5c0 has quit [Client Quit]
ellcs1 has joined #ruby
va5c0 has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
va5c0 has quit [Quit: WeeChat 2.9]
va5c0 has joined #ruby
wildtrees has joined #ruby
akemhp has quit [Quit: Leaving]
va5c0 has quit [Client Quit]
va5c0 has joined #ruby
va5c0 has quit [Client Quit]
akem has quit [Ping timeout: 240 seconds]
wildtrees_ has joined #ruby
wildtrees has quit [Ping timeout: 240 seconds]
wildtrees__ has joined #ruby
lmat has joined #ruby
wildtrees_ has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 265 seconds]
lmat has quit [Ping timeout: 246 seconds]
wildtrees_ has joined #ruby
lmat has joined #ruby
Technodrome has quit [Ping timeout: 260 seconds]
wildtrees__ has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Leaving]
alexherbo22 has joined #ruby
hiroaki has joined #ruby
bmurt has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo22 is now known as alexherbo2
wildtrees__ has joined #ruby
wildtrees__ has quit [Remote host closed the connection]
wildtrees_ has quit [Ping timeout: 240 seconds]
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
akemhp has joined #ruby
dfucci has joined #ruby
Iarfen has quit [Remote host closed the connection]
schne1der has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 258 seconds]
CrazyEddy has quit [Ping timeout: 265 seconds]
oneeggeach has quit [Quit: Leaving...]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rudd0 has joined #ruby
jenrzzz has joined #ruby
dviola has quit [Quit: WeeChat 2.9]
dfucci has joined #ruby
dviola has joined #ruby
ap4y has joined #ruby
akemhp has quit [Quit: Leaving]
dfucci has quit [Ping timeout: 260 seconds]
CrazyEddy has joined #ruby
akemhp has joined #ruby
akemhp has quit [Quit: Leaving]
xco has joined #ruby
<xco> hi everyone
<xco> i want to do a repeated, once ever ~24hrs
<xco> i don't want to use cron jobs
<xco> so i came up with this
<xco> i'd like some thoughts or see how others would do it
akemhp has joined #ruby
Rudd0^ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Rudd0 has quit [Ping timeout: 246 seconds]
Caerus has quit [Ping timeout: 240 seconds]
braincrash has quit [Ping timeout: 265 seconds]
bambanx has joined #ruby
Rudd0 has joined #ruby
havenwoo_ has joined #ruby
Caerus has joined #ruby
Rudd0^ has quit [Ping timeout: 265 seconds]
havenwoo_ has quit [Ping timeout: 244 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
Caerus has quit [Ping timeout: 265 seconds]
<havenwood> xco: Note, that'll "slip" by the amount of time it takes to # Do something
<havenwood> xco: You might consider using the timers gem if you care about slipping https://github.com/socketry/timers
kerframil has quit [Ping timeout: 256 seconds]
<havenwood> xco: Or just use a cronjob https://github.com/javan/whenever
<xco> havenwood the time #todosomething should be exact. it can be random and that how i really want it
<xco> i don't want it to be exact every day
<xco> i can't do that with cron jobs i believe
<xco> shouldn't** be exact, sorry
<havenwood> xco: I just mean that, for example, if it takes a second, it'll be 82_801..93_601 and so on.
jmcgnh has joined #ruby
Caerus has joined #ruby
<havenwood> xco: You can have a cronjob run at the same time every day, then have a script insert a delay
<havenwood> 0 1 * * * ruby -e 'sleep rand 10800; # Do something'
<havenwood> xco: ^
<xco> is there a chance i can do this without a cron job?
<havenwood> xco: yeah, cron is just one tool
<havenwood> xco: The timers gem is nice, or your approach works
<xco> havenwood but you meant the only problem with my approach is "time slipping" correct?
<xco> i don't see how this is possible though 🤔
<xco> havenwood perhpah i could take the range out of the loop to avoid the slippage?
Rudd0 has quit [Ping timeout: 260 seconds]
<leftylink> that does not jive with my understanding
<leftylink> maybe it's easier to understand if we imagine the task takes 3600 seconds, and then think about what effect that would have on what time this runs every day
Caerus has quit [Ping timeout: 258 seconds]
<leftylink> for such a case, I don't think taking the range out would work. but maybe I misunderstand what taking the range out entails
e2 has quit [Quit: Stable ZNC provider ##bnc4you]
<havenwood> xco: The slippage is just because the runtime of the command isn't subtracted. If you don't care about that, no worries.
<havenwood> xco: The timers gem keeps the loop separate from the command, so it doesn't slip.
thither has quit [Ping timeout: 264 seconds]
<havenwood> xco: If you don't care about the extra time the command takes not being accounted for in the next loop, it's no problem.
<havenwood> xco: For example, imagine if `# Do something` spins up a separate thread to no block the timer continuing the loop.
kristian_on_linu has quit [Remote host closed the connection]
<havenwood> xco: If you don't care about it taking a little extra time each time the command is run then no need to concern yourself. It's common though to see folk not account for the time a command runs so it happens a bit later every increment.
<havenwood> Just something to keep in mind.
e2 has joined #ruby
alexherbo2 has quit [Ping timeout: 258 seconds]
Caerus has joined #ruby
<xco> havenwood yeah i got that. the intrust it runs takes less that 2microseconds and it's neglible
<havenwood> xco: It seems you want variance anyways then, so should be fine.
<xco> havenwood yup exactly :)
<xco> ok we're good now
<xco> thanks you havenwood leftylink
helpa-bot has joined #ruby
Caerus has quit [Ping timeout: 246 seconds]
helpa-bot has quit [Remote host closed the connection]
helpa-bot has joined #ruby
<adam12> I built something for this. https://github.com/adam12/scheduled
<adam12> I do very little work inside the timer tho. Most of it calls out to another service (such as Que)
helpa has quit [Remote host closed the connection]
jenrzzz has joined #ruby
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
<xco> adam12 thanks for sharing though, looking at your implementation
<adam12> Hard to believe I wrote it ~ 3 years ago. Time flies.
<xco> adam12 if you're feeling time flies then it's a good thing. it means you're enjoying your life
<adam12> xco: Yeah :) Also having kids made me perceive time a lot more.
<xco> there you go ;)
<adam12> xco: I cheated a bit by wrapping Concurrent, but back then, I think the only reasonable option was Rufus Scheduler and I think it was somewhat unmaintained then. Seemed simple enough to recreate.
<adam12> Actually there was one by the Heroku guy too..
<adam12> clockwork?