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!
whathappens has quit [Ping timeout: 258 seconds]
drincruz has joined #ruby
SanguineAnomaly has quit [Ping timeout: 265 seconds]
drincruz has quit [Ping timeout: 258 seconds]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
evdubs has quit [Quit: Leaving]
evdubs has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
BSaboia has joined #ruby
Rudd0 has quit [Ping timeout: 258 seconds]
bmurt has joined #ruby
meinside has joined #ruby
oneeggeach has joined #ruby
brainfunnel has quit [Quit: whoops]
drincruz has joined #ruby
mangoicedtea has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 244 seconds]
dualfade has quit [Ping timeout: 240 seconds]
dualfade has joined #ruby
lightstalker has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Ping timeout: 264 seconds]
gitter1234 has quit [Quit: Connection closed for inactivity]
justache has quit [Ping timeout: 240 seconds]
lightstalker has joined #ruby
drincruz has quit [Ping timeout: 260 seconds]
justache has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
factormystic has quit [Quit: The Lounge - https://thelounge.chat]
drincruz has joined #ruby
bruce_lee has quit [Ping timeout: 246 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
sirKnight2000 has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 260 seconds]
cthu| has quit [Ping timeout: 256 seconds]
whathappens has joined #ruby
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
whathappens has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adu has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
ChmEarl has quit [Quit: Leaving]
elxbarbosa has joined #ruby
Emmanuel_ChanelW has joined #ruby
whathappens has joined #ruby
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
gix has quit [Ping timeout: 240 seconds]
whathappens has quit [Remote host closed the connection]
dualfade has quit [Ping timeout: 258 seconds]
dualfade has joined #ruby
xco has joined #ruby
whathappens has joined #ruby
whathappens has quit [Ping timeout: 246 seconds]
whathappens has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
whathappens has quit [Remote host closed the connection]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
whathappens has joined #ruby
drincruz has quit [Ping timeout: 258 seconds]
xco has joined #ruby
adu has quit [Quit: adu]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Ping timeout: 265 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mnathani has quit []
howdoi has joined #ruby
sgen has quit [Ping timeout: 256 seconds]
Rudd0 has joined #ruby
oneeggeach has quit [Quit: Leaving...]
elxbarbosa has quit [Ping timeout: 272 seconds]
alfiemax has joined #ruby
arooni has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
arooni has joined #ruby
Mia has quit [Ping timeout: 264 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
_whitelogger has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
yokel has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
neshpion has quit [Quit: WeeChat 2.9]
BSaboia has quit [Quit: This computer has gone to sleep]
yokel has quit [Ping timeout: 265 seconds]
yokel has joined #ruby
yokel has quit [Ping timeout: 264 seconds]
alfiemax has quit [Remote host closed the connection]
pwnd_sfw has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
yokel has joined #ruby
postmodern has quit [Quit: Leaving]
pwnd_sfw has joined #ruby
<Cork> i'm calling sudo find -maxdepth 1 -type d ! -path . -exec bash -c "^C {}; bundle install; cd .." \; but it gives me "bash: bundle: command not found"
<Cork> is there some rvm script i need to include in a subshell for gemset management to work?
<Cork> or something else?
<Cork> opps -c "^C {}; should be -c "cd {};
cd has quit [Quit: cd]
<Cork> ah, bash -c "source /etc/profile.d/rvm.sh; cd {}; bundle install; cd .." solved it
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
SanguineAnomaly has joined #ruby
alexherbo2 has joined #ruby
yokel has quit [Ping timeout: 246 seconds]
alexherbo20 has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo20 is now known as alexherbo2
dfucci has joined #ruby
schne1der has joined #ruby
yokel has joined #ruby
yokel has quit [Ping timeout: 264 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
skape has quit [Quit: Connection closed for inactivity]
yokel has joined #ruby
DaRock has joined #ruby
jenrzzz has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
xco has joined #ruby
alexherbo24 has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo24 is now known as alexherbo2
BSaboia has joined #ruby
ta has quit [Quit: WeeChat 2.9]
ta has joined #ruby
mikecmpbll has joined #ruby
TomyWork has joined #ruby
yokel has joined #ruby
dviola has quit [Quit: WeeChat 2.9]
yokel has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 240 seconds]
vondruch has joined #ruby
ramfjord has quit [Ping timeout: 265 seconds]
BSaboia has quit [Quit: Leaving]
BSaboia has joined #ruby
yokel has joined #ruby
x0n has joined #ruby
chalkmonster has quit [Read error: Connection reset by peer]
ujjain2 has joined #ruby
dfucci has joined #ruby
x0n has quit [Quit: ZNC - https://znc.in]
x0n has joined #ruby
imode has quit [Ping timeout: 240 seconds]
yokel has quit [Ping timeout: 265 seconds]
ellcs has joined #ruby
alexherbo26 has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo26 is now known as alexherbo2
jenrzzz has joined #ruby
drincruz has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
Cork has quit [Quit: .]
drincruz has quit [Ping timeout: 246 seconds]
yokel has joined #ruby
ujjain2 has quit [Quit: Textual IRC Client: www.textualapp.com]
yokel has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
yokel has joined #ruby
TCZ has joined #ruby
Cork has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
TCZ has quit [Client Quit]
TCZ has joined #ruby
no_gravity has joined #ruby
<no_gravity> In Ruby, you do not need to add () to call a function?
<jhass> right, in most context's you don't
<no_gravity> So instead of sayHello() you can just write sayHello?
<jhass> yes
<no_gravity> jhass: In which context do you need to?
<jhass> if it becomes amiguous, for example while passing the result of a method call to another it can become necessary
<jhass> also note that ruby style convention for method names is underscore_case, so say_hello
<no_gravity> So this will not ork? sayHello getName
<jhass> it will
<no_gravity> When will it not work?
<jhass> it will, but consider puts name_of person, child, is that puts(name_of(person), child) or puts(name_of(person, child))
<jhass> (ruby convention is also to leave of get_ prefixes, use foo= instead of set_foo and foo? instead of is_foo)
<no_gravity> I would expect it to be puts(name_of(person(child)))
<jhass> that'd be for puts name_of person child
<jhass> note the comman I put in
<jhass> in my original example
<no_gravity> Oh
yokel has joined #ruby
<no_gravity> That I would expect to be puts(name_of(person,child))
<jhass> and it would be, but if you need the other way around you put parens. and I would argue to put them in either case to make it easier to read :)
<no_gravity> I see
xco has joined #ruby
<jhass> so puts name_of(person, child) or puts name_of(person), child
<no_gravity> Yup
chalkmonster has joined #ruby
<no_gravity> Im not sure what to think about it.
<no_gravity> It makes it impossible to say if "puts name" outputs the value of a variable called name or the ouput of a function called name.
<no_gravity> And seems to lead to wrong error messages.
<no_gravity> name: undefined method `name' for main
<jhass> if your method is so big, you cannot keep in mind the local variables, it's too big :)
<jhass> &>> name
<jhass> >> name
<ruby[bot]> jhass: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<no_gravity> The error is not that there is no method called name. But that there is neither a method nor a variable called name.
<jhass> meh okay, both bots broken
mikecmpbll has quit [Ping timeout: 246 seconds]
<jhass> the message is "undefined local variable or method `name'"
<jhass> yeah
<no_gravity> jhass: Where?
<no_gravity> jhass: So there are different runtimes?
<jhass> sorry, you lost me
<no_gravity> jhass: Why does the bot give a different error msg?
<jhass> because it's broken
<no_gravity> "broken" how?
<jhass> iirc using a service that no longer exists and not handling the error response from that well
<jhass> so the error message is coming from the bots internal code
<no_gravity> Using something that does not exist is quite a feat.
<jhass> no longer exists!
<no_gravity> >> puts 123
<ruby[bot]> no_gravity: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<no_gravity> I see
mikecmpbll has joined #ruby
<no_gravity> I got the error msg on https://try.ruby-lang.org/ though
<jhass> not sure what that's running
<jhass> ah, opal
<no_gravity> On Debian, "ruby -e 'puts name'" gives me the correct error message.
<jhass> opal 0.11.4 (2018-11-07 revision 0)
<jhass> (output of RUBY_DESCRIPTION)
<no_gravity> There are quite some interesting ideas in Ruby.
<jhass> opal is a Ruby to JS transpiler
<no_gravity> omg
alfiemax has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.9]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<no_gravity> What on earth does .freeze do?
<leftylink> forbids further modification
<no_gravity> I see
<jhass> for objects that implement the contract, make them immutable
<no_gravity> Would this be valid Ruby code?
<no_gravity> Class Oink
<no_gravity> boink: 123
<no_gravity> end
<jhass> no
<no_gravity> Ah, next try ...
<no_gravity> Class Oink
<no_gravity> boink :123
<no_gravity> end
<jhass> that's the same
<no_gravity> No, I moved the colon.
<jhass> ah
<jhass> up to the end you could make it work
orbyt_ has joined #ruby
<no_gravity> So what would "boink :123" mean?
yokel has quit [Ping timeout: 256 seconds]
<jhass> ah, actually :123 is invalid
<jhass> :'123' would work or :abcd or :a123
<no_gravity> Ok
<no_gravity> So next try:
<no_gravity> Class Oink
<no_gravity> boink :hello
<no_gravity> end
<no_gravity> What would "boink :hello" mean?
<no_gravity> Well, I get this error:
<jhass> def Class(a); end; def Oink(a); end; def boink(a); end; Class(Oink(boink(:hello)))
<no_gravity> test.rb:3: syntax error, unexpected keyword_end, expecting end-of-input
<jhass> yeah, I said up to the end it would work :)
<jhass> if you make the Class a class it'll even work
<jhass> except for the missing boink method
<no_gravity> Without the end, I get:
<no_gravity> test.rb:1:in `<main>': uninitialized constant Oink (NameError)
<no_gravity> Oh, I need to make "class" lowercase ...
<jhass> ah, right the newline kills it, well close enough :D
<jhass> anyway, boink :hello is just invoking the method boink with the argument :hello which is called a symbol and an object of the class Symbol
Iambchop has quit [*.net *.split]
cstrahan has quit [*.net *.split]
Atro has quit [*.net *.split]
maxmanders has quit [*.net *.split]
Seich has quit [*.net *.split]
d10n-work has quit [*.net *.split]
tweaks has quit [*.net *.split]
Fenhl_ has quit [*.net *.split]
kermit has quit [*.net *.split]
nuck has quit [*.net *.split]
aloy has quit [*.net *.split]
funnel has quit [*.net *.split]
badeball has quit [*.net *.split]
<no_gravity> Ahh!
Seich has joined #ruby
<no_gravity> It invokes it when? On instantiation of the class?
aloy has joined #ruby
tweaks has joined #ruby
maxmanders has joined #ruby
<jhass> just as it encounters it
Iambchop has joined #ruby
cstrahan has joined #ruby
kermit has joined #ruby
d10n-work has joined #ruby
<no_gravity> Well, will it encounter it on instantiation of the class?
<jhass> you can see class Oink as syntax sugar for Oink = Class.new do; ...; end
<jhass> at definition time, so to say
orbyt_ has quit [Client Quit]
<no_gravity> How do I create an object of type Oink?
<jhass> Oink.new
<no_gravity> I see.
Eiam has quit [Ping timeout: 246 seconds]
<no_gravity> It looks like boink is called on what I would call compile time.
ricer2 has quit [Ping timeout: 264 seconds]
<jhass> well, ruby is no compiler, it's an interpreter :)
<no_gravity> We could settle on "interpretation time".
<jhass> a class definition modifies the global state of your program/the VM
<no_gravity> And I guess boink can figure out it was called from Boink, right?
<jhass> hence Oink.new; class Oink; end does not work, but class Oink; end; Oink.new does
<no_gravity> And I guess boink can figure out it was called from Oink, right?
<no_gravity> Because that seems to be how rails implements their magic like has_many.
<jhass> not really, but if it would be a class method on Oink or its ancestors, it would take precedence over a method defined in the main scope
<jhass> and thus have a self of Oink then
<no_gravity> I mean, I see a lot of code like this in rails code:
<no_gravity> class Forum
<no_gravity> has_many :posts
<no_gravity> end
<no_gravity> So I guess has_many is a function that will figure out it was called from Forum and do some magic on it.
Fenhl_ has joined #ruby
Atro has joined #ruby
nuck has joined #ruby
badeball has joined #ruby
funnel has joined #ruby
Atro has joined #ruby
Atro has quit [Changing host]
Fenhl_ has joined #ruby
nuck has joined #ruby
nuck has quit [Changing host]
Fenhl_ has quit [Changing host]
<jhass> it works like this
nuck is now known as Guest41501
Fenhl_ has joined #ruby
<no_gravity> Oh! has_many is not global but a method of the parent class.
<no_gravity> I would have expected you need to use @has_many then.
<jhass> no, that's an instance variable
<no_gravity> I see
<no_gravity> Are there global variables in Ruby?
<jhass> (but at class scope not of the class'es instances but something else)
<jhass> yes, $globals
<jhass> don't use them except for the pseudo globals like $1, $2, perhaps $~
<no_gravity> So to call the global has_many you need to call $globals.has_many?
<no_gravity> Or $has_many?
<jhass> well
<jhass> no
<no_gravity> I mean if there was a global has_many method.
<jhass> $has_many would just be a global variable
<jhass> so, ruby employs two tricks here
<jhass> the first thing to understand is that ruby has a separate definition scope and evaluation scope if you want to call it like that
<jhass> so the scope for a method or constant definition might be different to the scope for local and instance variables
<jhass> now the toplevel scope, its definition scope is Object
<no_gravity> Well, that is going further then I want to dive into it today.
<no_gravity> Thanks a lot!
<jhass> the implicit parent of a class if you give none
<jhass> the evaluation scope is an implicit singleton instance of Object
<jhass> so if you define a "global", let's better call it top-level method, it actually goes to the Object class (as a private method)
<no_gravity> Ruby would at least have to overtake PHP in popularity before I really start to use it
<jhass> that seems like a silly evalution point for choosing a tool :)
<no_gravity> No, because tools are not eternal. The more popular so the better the future.
<jhass> "I prefer a hammer for my screws because more people like to use hamemrs"
<jhass> Ruby is older than PHP I believe
Fenhl_ is now known as Fenhl
<no_gravity> The screw will keep working even if the hammer goes out of fashion.
<no_gravity> If you have a large Ruby code base and Ruby goes out of fashion, you are fucked.
<jhass> I mean, ain't gonna happen
<jhass> too many big things are written in Ruby, the critical mass of the community is big enough to sustain it for the foreseeable future
<no_gravity> So it is more like I will use a type of screw that will be still be maintainable with the tools of the next decade.
dfucci has quit [Ping timeout: 260 seconds]
chalkmonster has joined #ruby
<no_gravity> jhass: How long is the forseeable future?
<jhass> I'd be confident to say at least end of 32bit unix time
<no_gravity> Well, maintaining is one thing. Having a vibrant community is another.
<no_gravity> I would not want to hire a Cobol developer these days.
<jhass> Ruby's community is quite vibrant
<no_gravity> Yeah, but will it be in 2038?
<jhass> you'd be surprised, there's actually great need for those :D
<no_gravity> Yes, great need. But I am more interested in great supply.
<jhass> who can predict the future, what makes you confident PHP is around by then?
<no_gravity> Nothing. But the more popular now, the better.
<jhass> I disagree
<jhass> by that standard we should abandon everything but JS and C
<no_gravity> Well, it is a mix. For me, PHP and Python are much nicer to develop in then JS and C.
snosk8r has quit [Ping timeout: 244 seconds]
<no_gravity> While I have no strong opinion on Ruby.
<jhass> exactly, and for me Ruby is even still much nicer to develop in than any of those
<no_gravity> Citation needed :)
<jhass> don't underestimate talented people preferring to work with tools they enjoy
<no_gravity> Last months stories on Hacker News: Ruby: 61, PHP: 271, Python: 316.
<jhass> (I hate PHP and dislike JS tbh)
<no_gravity> (I think PHP had a boost because of PHP 8)
<jhass> wait until december when Ruby 3 comes out :)
<no_gravity> Lets look at the last 12 months:
<jhass> no, let's stop again
<no_gravity> Ruby: 633, PHP: 2982, Python: 3876
<jhass> your premise still is that popularity is the most important measure
<jhass> I don't share the premise
<no_gravity> Wow, PHP is closer to Python then I though.
<jhass> so no point
TCZ has quit [Quit: Leaving]
<no_gravity> I never said it is the most important measure.
<no_gravity> For me it is like this: I like PHP and Python. More then JS and C. And I find Ruby kinda interesting. Without any strong opinion on it.
<no_gravity> So much for today.
<no_gravity> Thanks for the nice talk and cu soon!
no_gravity has quit [Quit: leaving]
jenrzzz_ has joined #ruby
yokel has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
dfucci has joined #ruby
jenrzzz_ has quit [Ping timeout: 265 seconds]
yokel has quit [Ping timeout: 240 seconds]
BSaboia has quit [Quit: Leaving]
lunarkitty7 has quit [Remote host closed the connection]
mtsd has joined #ruby
pinkpandabot has joined #ruby
lunarkitty7 has joined #ruby
BSaboia has joined #ruby
yokel has joined #ruby
yokel has quit [Ping timeout: 246 seconds]
yokel has joined #ruby
sgen has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
mikecmpbll has quit [Ping timeout: 258 seconds]
yokel has joined #ruby
mikecmpbll has joined #ruby
yokel has quit [Ping timeout: 264 seconds]
braincrash has joined #ruby
yokel has joined #ruby
alexherbo27 has joined #ruby
canton7 has quit [Quit: ZNC - http://znc.in]
alexherbo2 has quit [Ping timeout: 264 seconds]
alexherbo27 is now known as alexherbo2
yokel has quit [Ping timeout: 256 seconds]
canton7 has joined #ruby
catbusters has joined #ruby
braincrash has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
TCZ has joined #ruby
yokel has quit [Ping timeout: 246 seconds]
yokel has joined #ruby
dualfade has quit [Ping timeout: 265 seconds]
weaksauce has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Leaving]
dualfade has joined #ruby
alfiemax has quit [Remote host closed the connection]
akemhp has quit [Ping timeout: 240 seconds]
vondruch has quit [Ping timeout: 264 seconds]
drincruz has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
dualfade has quit [Quit: leaving]
dualfade has joined #ruby
alexherbo22 has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo22 is now known as alexherbo2
yokel has joined #ruby
vondruch has joined #ruby
ellcs has joined #ruby
wallace_mu has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
bmurt has joined #ruby
dualfade has quit [Ping timeout: 246 seconds]
ujjain2 has joined #ruby
braincrash has joined #ruby
dualfade has joined #ruby
alexherbo20 has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
mnathani has joined #ruby
leitz has joined #ruby
yokel has joined #ruby
alexherbo20 has quit [Ping timeout: 246 seconds]
ellcs has quit [Ping timeout: 260 seconds]
yokel has quit [Ping timeout: 265 seconds]
alexherbo2 has quit [Ping timeout: 256 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
_smurf has joined #ruby
yokel has joined #ruby
pgib has quit [Quit: 00 PC LOAD LETTER]
smurfke has quit [Ping timeout: 246 seconds]
akemhp has joined #ruby
xco has joined #ruby
factormystic has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Ping timeout: 258 seconds]
yokel has joined #ruby
mikecmpbll has joined #ruby
mtsd has quit [Quit: Leaving]
cd has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
ChmEarl has joined #ruby
sgen has quit [Ping timeout: 260 seconds]
ricer2 has joined #ruby
orbyt_ has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua_ is now known as ua
x0n has quit [Quit: ZNC - https://znc.in]
skape has joined #ruby
lunarkitty7 has quit [Ping timeout: 240 seconds]
Emmanuel_ChanelW has quit [Quit: Leaving]
xco has joined #ruby
mikecmpbll has quit [Quit: inabit.]
ujjain2 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
va5c0 has joined #ruby
mikecmpbll has joined #ruby
DaRock has quit [Ping timeout: 256 seconds]
x0n has joined #ruby
gthank has joined #ruby
<gthank> Could somebody tell me what this regex matches? `/\342\200\250/u`
<gthank> I'm spelunking some 7 year old code and the person who wrote that bit is gone
va5c0 has quit [Quit: WeeChat 2.9]
catbusters has quit [Quit: Connection closed for inactivity]
<gthank> I'm not familiar with whatever that escape is doing and all my googling is turning up escape sequences like \n or \u9999
<jhass> should be octal escapes, no?
<jhass> so "\u2028"
<jhass> [226, 128, 168]
vondruch has quit [Ping timeout: 260 seconds]
yokel has joined #ruby
<jhass> "\xe2\x80\xa8"
cthu| has joined #ruby
JohnB has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
vondruch has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nakilon> yeah this says it's Unicode line separator https://stackoverflow.com/q/25061895/322020
<gthank> Thanks
<gthank> I got a bunch of stackoverflow answers when I googled, but none explained what it actually was
<nakilon> this is how you convert this oct to hex: "\342\200\250".bytes.pack "C*" => "\xE2\x80\xA8"
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
yokel has joined #ruby
BSaboia has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
weaksauce has joined #ruby
ellcs has joined #ruby
ramfjord has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
sh7d has quit [Ping timeout: 258 seconds]
sh7d has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
braincrash has quit [Ping timeout: 246 seconds]
yokel has quit [Ping timeout: 246 seconds]
TomyWork has quit [Quit: Leaving]
schne1der has quit [Ping timeout: 258 seconds]
sgen has joined #ruby
yokel has joined #ruby
vondruch has quit [Ping timeout: 258 seconds]
yokel has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
rapha has left #ruby ["WeeChat 2.3"]
<nakilon> btw ,our local Papa Johns emailed pizza promocode with some binary nonsense, claiming it's ASCII but it's clearly 3-byte encoded and at first I thought they someone messed the Endian, but the 2nd byte is rotated by 2, not 4, and the third byte is weird anyway
yokel has quit [Ping timeout: 264 seconds]
<gthank> What sort of baroque tooling are they using where you get weirdo encoding errors like that?
klaas has quit [Quit: ZNC 1.8.1 - https://znc.in]
klaas has joined #ruby
dfucci has joined #ruby
imode has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
yokel has joined #ruby
pgib has joined #ruby
tsujp has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
yokel has quit [Ping timeout: 240 seconds]
dfucci has quit [Ping timeout: 256 seconds]
yokel has joined #ruby
topazPants has joined #ruby
<pgib> I'm not sure if RSpec questions are in scope, but #rspec has been nonresponsive for over a day. I'm trying to programmatically omit specific examples from a shared examples. I have a way to stub them out, but they still show as passing in the results. I also don't want them to show as skipped or pending. I simply want to be able to completely disable "it" blocks based on a variable. Some of what I've tried so far: https://dpaste.org/1qd1
skape has quit [Quit: Connection closed for inactivity]
kristian_on_linu has joined #ruby
topazPants has left #ruby [#ruby]
<nakilon> gthank weird thing is that no matter how you encode the codetable shifting, Russian letters are all placed similarly both in UTF and CP1251 (32 chars upper case, 32 lower case) but their promocode is changing in 6 bits plus 1 bit for upper case (only in set in the very first char -- the beginning of the sentense I assume); i.e. they use 6 bits to
<nakilon> encode 32 chars, wtf
<gthank> pgib Would it be acceptable to just tag them and run the specs that don't match, or similar? I haven't messed with spec in a year or two, but I'm almost positive it had some functionality like that
<nakilon> either I'm crazy or it's not baroque tooling but a real puzzle that costs far more than their 20% pizza discount
<pgib> There is tagging, but I don't know if you can enable/disable tags programmatically
<pgib> this is a shared example. So there may be a Controller that supports :update, and :create. But maybe another that supports only :create, and I'd like to disable the update checks in that case
<gthank> nakilon Secretly recruiting security team or some such
<gthank> pgib Sorry, I think you're already out of my depth.
Eiam has joined #ruby
dfucci has joined #ruby
schne1der has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
justache has quit [Remote host closed the connection]
yokel has quit [Ping timeout: 240 seconds]
justache has joined #ruby
neshpion has joined #ruby
whathappens has quit []
wimpog has joined #ruby
alestane has joined #ruby
<alestane> Hi! I'm trying to build an arbitrary series of callbacks, which I'm currently imagining as an array of Proc values. However, Im trying to bind different inputs into them, and it seems like they're getting a shared variable and all seeing the same values. How can I capture the current value of an expression in a new Proc, or is there a better way to do this?
<wimpog> New to Ruby/Rails here. For catching ActiveRecord create errors, can I use begin/rescue and print e.message, e.backtrace.inspect?
skape has joined #ruby
jenrzzz has joined #ruby
gix has joined #ruby
pgib has quit [Quit: 00 PC LOAD LETTER]
pgib has joined #ruby
<pgib> wimpog There is also a fairly active #rails
<wimpog> pgib: but I like it here. Would you help me?
<pgib> I don't know the answer to your question
<wimpog> Thank you, @pgib. I'll go to #rails
Rudd0 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
<wimpog> @pgib they're not letting me into #rails. So staying here....
<wimpog> New to Ruby/Rails here. For catching ActiveRecord create errors, can I use begin/rescue and print e.message, e.backtrace.inspect?
bmurt has joined #ruby
<pgib> sry, #RubyOnRails
yokel has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
davispuh has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
<wimpog> Thanks, @pgib
ellcs has joined #ruby
yokel has joined #ruby
<adam12> wimpog: Those are exceptions; you can rescue them without issue. The begin/end parts of `rescue` are optional in _some_ cases, depending on your Ruby version. Just FYI.
<phaul> &>> :does_this_work?
<phaul> hm
<adam12> alestane: If you have an example it might help, but in essence you just described the Rack interface (which passes around `env` which is a Hash).
howdoi has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 260 seconds]
<adam12> pgib: Starting at the simplest method, can you just wrap the `it` blocks in a giant if statement?
<wimpog> @adam12 how do I do it then?
yokel has joined #ruby
<adam12> wimpog: What do you mean? Show me an example and I'll riff off that.
<wimpog> begin record.create... rescue => e log exception with e.message end
<wimpog> @adam12 something like that should work?
<adam12> wimpog: Looks OK to me
<wimpog> @adam12 here is the snippet: https://pastebin.com/2Hr0MJjs Please tell me if there are problems with it
<ruby[bot]> wimpog: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
ellcs has joined #ruby
<wimpog> @adam12 I want to catch errors/exceptions that happen during create in record_transaction()
<adam12> wimpog: It looks fine. You might want to narrow the exceptions you rescue since right now you're capturing a fair amount, but I'm sure it looks fine.
<Scriptonaut> hey all, lately I've been having issues with git conflicts happening with the rails encrypted credentials file. This is almost impossible to deal with. Let's say I want to rebase my branch on master. I skip the credentials file, rm it, replace it with the one on master, then open up the old one on my branch before the rebase, and manually look over it to see what's different, then commit that.
<adam12> wimpog: Also presumably, you're not accepting card numbers or CVC codes directly, which would be logged in that params call.
<Scriptonaut> how do you deal with merge conflicts happening in your rails credentials files? Is there a way to handle this that most people do?
<wimpog> @adam12: thank you! Yeah at the moment I'm not sure which specific exception to look for. Once I see what is being logged, I might be able to narrow it down. No, I'm not logging cc numbers or cvc codes. That code snippet accepts params from the payment gateway callback. Thank you for your help!
<pgib> adam12 - I had tried that.
<pgib> I forget the exact error, but I cannot reference the any variables or methods outside of the body of it, let, etc.. blocks. (no describe, context, etc)
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
alestane has quit [Quit: alestane]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
<phaul> &>> :does_this_work?
<phaul> &>> 1
yokel has quit [Ping timeout: 265 seconds]
justache has quit [Remote host closed the connection]
justache has joined #ruby
justache has quit [Remote host closed the connection]
justache has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
<phaul> &>> :does_this_work?
<rubydoc> # => :does_this_work? (https://carc.in/#/r/9opg)
<phaul> &>> 1
<rubydoc> # => 1 (https://carc.in/#/r/9oph)
davispuh has joined #ruby
<phaul> okay, Idk. seems it's some bug the way I started using dry-schema & dry-validations. I rolled back
alestane has joined #ruby
<phaul> we are on https://github.com/phaul/yarr/commit/8bbff6c1f481c6028e08e75e41683849bb6217e4 now, if anyone can find what's wrong with the commits after I am curious
<nakilon> ahah, cracked the promocode
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<phaul> for completeness of info this is in the logs : Sep 11 21:21:57 son-1 bash[71068]: [2020/09/11 21:21:57.742] !! (eval):5:in `block in __dry_initializer_initialize__': Yarr::Evaluator::Mode: option 'filter' is required (KeyError)
yokel has joined #ruby
davispuh has joined #ruby
<adam12> pgib: Does `before` accept a block argument? I think it does. Maybe try: before(:all) { |example| example.metadata[:skip] = true }
<adam12> s/accept/pass
<pgib> it does. Good idea. It's kludgy, but if it works...
yokel has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
akemhp has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 240 seconds]
<pgib> adam12. Hmph.. Well, I do get each example in the before block prior to the example running. However, it doesn't seem skippable at that point
wimpog has quit [Quit: wimpog]
jenrzzz has joined #ruby
<adam12> pgib: :\ Hmm.
TCZ has joined #ruby
<pgib> yeah. Looks good on paper
<pgib> Perhaps I could tag the examples. I need a way to include/exclude tags programmatically then
jenrzzz has quit [Ping timeout: 256 seconds]
<pgib> Hmm. seems doable. Hold on
ellcs has quit [Ping timeout: 260 seconds]
lunarkitty7 has joined #ruby
yokel has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsrt^ has quit [Read error: Connection reset by peer]
yokel has quit [Ping timeout: 246 seconds]
cthu| has quit [Ping timeout: 264 seconds]
cthulchu has joined #ruby
<pgib> adam12. Dang... hardcoding a value to eliminate error, even this still runs the 'create' examples: https://dpaste.org/cAJ7
alestane has quit [Quit: alestane]
justache has quit [Remote host closed the connection]
<pgib> verified that the configuration was changed within an 'it' block with pry
yokel has joined #ruby
justache has joined #ruby
alestane has joined #ruby
alestane has quit [Client Quit]
braincrash has joined #ruby
alestane has joined #ruby
alestane has quit [Client Quit]
<pgib> I think it might have to do with the whole declare block being interpreted at load time. At that point the plan is finalized?
dfucci has joined #ruby
yokel has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Leaving]
dfucci has quit [Ping timeout: 240 seconds]
zapata has quit [Quit: WeeChat 2.9]
govg has joined #ruby
_smurf has quit [Remote host closed the connection]
yokel has joined #ruby
dfucci has joined #ruby
ctOS has quit [Quit: Connection closed for inactivity]
yokel has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
<adam12> pgib: Not sure tbh. How are you using this? `include_examples`?
<pgib> Yeah. Looks like that might accept a block? That could ease it
Rudd0 has joined #ruby
<pgib> include_example "strong params", [:update] then act on that before even having a describe block..
<adam12> pgib: it_behaves_like accepts a block too. Maybe you could do something there.
spacesuitdiver has joined #ruby
neshpion has quit [Quit: WeeChat 2.9]
yokel has quit [Ping timeout: 246 seconds]
leitz has quit [Quit: Leaving]
<nakilon> I wonder if there is a way to encode UTF-8 with negative positions
<nakilon> this would explain how they converted 2-byte encoding to 3-byte
yokel has joined #ruby
_whitelogger has joined #ruby
yokel has quit [Ping timeout: 265 seconds]
yokel has joined #ruby
jenrzzz has joined #ruby
schne1der has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
va5c0 has joined #ruby
yokel has joined #ruby
akemhp has joined #ruby
yokel has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
justache has quit [Remote host closed the connection]
justache has joined #ruby
TCZ has joined #ruby
umjisus has quit [Ping timeout: 256 seconds]
umjisus has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
sgen has quit [Ping timeout: 265 seconds]
yokel has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
va5c0 has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 258 seconds]
yokel has quit [Ping timeout: 246 seconds]
ChmEarl has quit [Quit: Leaving]
yokel has joined #ruby