adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.1, 2.7.3, 2.6.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3
Guest19992 has quit [Quit: ZNC - http://znc.in]
dan64 has joined #ruby
cow[moo] has joined #ruby
dpl_ has quit [Ping timeout: 240 seconds]
pwnd_ has quit [Read error: Connection reset by peer]
pwnd_ has joined #ruby
gray-_-wolf has joined #ruby
jetchisel has quit [Ping timeout: 252 seconds]
jetchisel has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
neshpion has joined #ruby
jenrzzz_ has joined #ruby
Rudd0 has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz_ has quit [Ping timeout: 265 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
Technodrome has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
centrx has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
wallacer has quit [Ping timeout: 250 seconds]
jenrzzz_ has quit [Ping timeout: 245 seconds]
ChmEarl has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
pwnd_0 has joined #ruby
pwnd_ has quit [Ping timeout: 260 seconds]
pwnd_0 is now known as pwnd_
MalkbabY_ has joined #ruby
MalkbabY has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
jenrzzz_ has quit [Ping timeout: 252 seconds]
jenrzzz_ has joined #ruby
robotbee has quit [Ping timeout: 240 seconds]
yuesbeez has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz_ has quit [Ping timeout: 240 seconds]
nixue has quit [Quit: Connection closed]
barg has quit [Read error: Connection reset by peer]
barg has joined #ruby
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
centrx has quit [Remote host closed the connection]
jenrzzz_ has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
m27frogy has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
cd has quit [Quit: cd]
robotbee has joined #ruby
jenrzzz has joined #ruby
neshpion has quit [Quit: neshpion]
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz_ has quit [Ping timeout: 260 seconds]
CoolerX has joined #ruby
<CoolerX> Hi
<CoolerX> where does the Formula class come from?
<CoolerX> there are no load statements
robotbee has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz_ has quit [Ping timeout: 245 seconds]
centrx has joined #ruby
CoolerX has quit [Ping timeout: 240 seconds]
centrx has quit [Ping timeout: 245 seconds]
hiroaki has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
prestorium has quit [Ping timeout: 240 seconds]
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
prestorium has joined #ruby
centrx has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
jla has joined #ruby
TorpedoSkyline has joined #ruby
<leftylink> too bad, I only just looked into it and found the answer to the question
<leftylink> looks like I won't get to answer it now
jenrzzz has joined #ruby
robotbee has joined #ruby
jenrzzz_ has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
drusepth has quit [Ping timeout: 240 seconds]
gix- has quit [Ping timeout: 240 seconds]
pyra has quit [Quit: Konversation terminated!]
centrx has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
centrx has joined #ruby
jenrzzz has joined #ruby
ur5us__ has quit [Ping timeout: 250 seconds]
hiroaki has joined #ruby
centrx_ has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
centrx has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
centrx has joined #ruby
jla has quit [Ping timeout: 240 seconds]
centrx_ has quit [Ping timeout: 245 seconds]
centrx_ has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
centrx has quit [Ping timeout: 245 seconds]
postmodern has quit [Quit: Leaving]
jenrzzz has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
centrx_ has quit [Ping timeout: 250 seconds]
jenrzzz_ has joined #ruby
teclator has joined #ruby
robotbee has quit [Ping timeout: 268 seconds]
centrx has joined #ruby
centrx_ has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
centrx_ has quit [Ping timeout: 245 seconds]
<ecommence> Anybody know of a way to generate random images? https://github.com/faker-ruby/faker/blob/master/doc/default/lorem_flickr.md this only fetches the same image over and over, and if I add `unique` to it, I get `Faker::UniqueGenerator::RetryLimitExceeded: Retry limit exceeded for image`
centrx has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
feriman has joined #ruby
centrx_ has joined #ruby
jla has joined #ruby
jenrzzz has joined #ruby
centrx has quit [Ping timeout: 245 seconds]
centrx has joined #ruby
centrx_ has quit [Ping timeout: 245 seconds]
al2o3-cr has quit [Quit: WeeChat 3.1]
centrx has quit [Ping timeout: 250 seconds]
centrx has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
dpl_ has joined #ruby
jenrzzz has joined #ruby
centrx_ has joined #ruby
centrx has quit [Ping timeout: 245 seconds]
centrx has joined #ruby
centrx_ has quit [Ping timeout: 245 seconds]
vondruch has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
centrx_ has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
centrx_ has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
MalkbabY has joined #ruby
evdubs__ has joined #ruby
evdubs_ has quit [Ping timeout: 245 seconds]
jenrzzz_ has quit [Ping timeout: 240 seconds]
MalkbabY_ has quit [Ping timeout: 268 seconds]
drusepth has joined #ruby
centrx has joined #ruby
evdubs_ has joined #ruby
TomyWork has joined #ruby
jenrzzz has joined #ruby
centrx_ has joined #ruby
evdubs__ has quit [Ping timeout: 245 seconds]
centrx has quit [Ping timeout: 250 seconds]
centrx_ has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
evdubs__ has joined #ruby
centrx has joined #ruby
pyra has joined #ruby
evdubs_ has quit [Ping timeout: 260 seconds]
centrx has quit [Ping timeout: 245 seconds]
centrx has joined #ruby
evdubs_ has joined #ruby
evdubs__ has quit [Ping timeout: 240 seconds]
evdubs__ has joined #ruby
centrx has quit [Ping timeout: 245 seconds]
evdubs_ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
centrx has joined #ruby
centrx_ has joined #ruby
centrx has quit [Ping timeout: 245 seconds]
gearnode has joined #ruby
centrx_ has quit [Ping timeout: 245 seconds]
evdubs_ has joined #ruby
evdubs__ has quit [Ping timeout: 240 seconds]
evdubs__ has joined #ruby
evdubs_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
drusepth has quit [Ping timeout: 252 seconds]
BSaboia has joined #ruby
jla has quit [Ping timeout: 268 seconds]
maxmanders has quit [Ping timeout: 260 seconds]
AutomationD has quit [Ping timeout: 250 seconds]
sorah has quit [Ping timeout: 258 seconds]
graphicsv has quit [Ping timeout: 245 seconds]
coffeejunk has quit [Read error: Connection reset by peer]
podman has quit [Read error: Connection reset by peer]
JayDoubleu has quit [Read error: Connection reset by peer]
peteretep has quit [Read error: Connection reset by peer]
Guest45273 has quit [Read error: Connection reset by peer]
dcunit3d has joined #ruby
dcunit3d has left #ruby [#ruby]
maxmanders has joined #ruby
sorah has joined #ruby
peteretep has joined #ruby
gray-_-wolf has quit [Quit: WeeChat 3.1]
coffeejunk has joined #ruby
JayDoubleu has joined #ruby
AutomationD has joined #ruby
podman has joined #ruby
Guest45273 has joined #ruby
graphicsv has joined #ruby
graphicsv has quit [Excess Flood]
jenrzzz has joined #ruby
graphicsv has joined #ruby
CoolerX has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
shtirlic has quit [Remote host closed the connection]
ur5us__ has joined #ruby
dcunit3d has joined #ruby
centrx has joined #ruby
jenrzzz has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
centrx has quit [Ping timeout: 250 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
AndreYuhai has joined #ruby
jinie has quit [Quit: ZNC 1.8.2 - https://znc.in]
jenrzzz has quit [Ping timeout: 252 seconds]
jinie has joined #ruby
jenrzzz_ has quit [Ping timeout: 265 seconds]
pyra has quit [Quit: Konversation terminated!]
BTRE has quit [Ping timeout: 260 seconds]
BTRE has joined #ruby
jinie has quit [Quit: ZNC 1.8.2 - https://znc.in]
jinie has joined #ruby
shtirlic has joined #ruby
<CoolerX> Hi
centrx has joined #ruby
<CoolerX> anyone here?
<CoolerX> can someone please explain how this works? https://github.com/Homebrew/homebrew-core/blob/master/Formula/abcl.rb#L1
<CoolerX> The definition for the Formula class is not in that file and there are no load statements to load it
<CoolerX> so how does it work?
lightstalker has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
centrx has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
lightstalker has joined #ruby
centrx has joined #ruby
centrx_ has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
vondruch has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
centrx_ has quit [Ping timeout: 245 seconds]
centrx has joined #ruby
krma has joined #ruby
krma has left #ruby [#ruby]
centrx has quit [Ping timeout: 250 seconds]
kwilczynski has quit []
kwilczynski has joined #ruby
brigitte is now known as aloy
evdubs_ has joined #ruby
infinityfye has joined #ruby
evdubs__ has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
<leftylink> well, your concerns would be well-founded in that that file would not work by itself
wallacer has joined #ruby
<leftylink> however... if it were to be the case that https://github.com/Homebrew/brew/blob/master/Library/Homebrew/formula.rb were loaded beforehand, then it would
TCZ has joined #ruby
<leftylink> so we are forced to assume that homebrew arranges for this to be the case
<leftylink> a given source file doesn't have to be the one to require and/or load other source files it depends on. of course, it can lead to confusion if it doesn't, since then of course it would only work if some other mechanism has required and/or loaded them. so I don't like to do that. but whether I like it or not is irrelevant
centrx has quit [Ping timeout: 245 seconds]
<leftylink> nobody asked me whether I like it or not
<CoolerX> leftylink, ok thanks
<CoolerX> leftylink, is there a common place to find the docs for that?
<CoolerX> for homebrew library
<leftylink> if we are talking about homebrew, I do not knowl homebrew well enough to provide an answer for this question
<CoolerX> I found https://ruby-doc.com but I think that's for the ruby language itself
<CoolerX> ok
<CoolerX> is there a convention on how docs are done in ruby?
<CoolerX> like python has docstrings inline with the code
<CoolerX> and other languages have their own conventions, does Ruby have some convention?
<leftylink> I've not yet seen there be a single prevailing convention for this language, but I know that various projects use https://yardoc.org/ . for the particulars of any given project it may be most useful to take a look at a few files in that project to see how that project does it
<AndreYuhai> CoolerX: there's this: https://yardoc.org/
<AndreYuhai> Oh yea leftylink has already posted :)
<CoolerX> Thanks
<CoolerX> In this code should there be double/single quotes around protein in the initialize method? https://bpa.st/CRZA
<CoolerX> line 4
<CoolerX> @protein = 'protein'
<CoolerX> shouldn't*
<CoolerX> The snippet was taken from here https://www.rubyguides.com/2018/11/attr_accessor/
centrx has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
vondruch has quit [Ping timeout: 260 seconds]
<CoolerX> well I tried the code and it seems to set it to nil
<CoolerX> oh actually nvm, I didn't notice the protein variable in the parameter list
centrx has joined #ruby
<CoolerX> now it makes sense
centrx_ has joined #ruby
centrx__ has joined #ruby
centrx has quit [Ping timeout: 245 seconds]
centrx_ has quit [Ping timeout: 245 seconds]
centrx__ has quit [Ping timeout: 250 seconds]
jla has joined #ruby
centrx has joined #ruby
cuerbot has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
ur5us__ has quit [Ping timeout: 250 seconds]
<ecommence> Anybody know why this seeds.rb only adds the first entry? https://dpaste.org/aQ88
AndreYuhai has quit [Ping timeout: 260 seconds]
feriman has quit [Quit: WeeChat 3.1]
evdubs__ has joined #ruby
m27frogy has joined #ruby
<CoolerX> ecommence, not sure what first_or_create! is on line 19
<ecommence> Nevermind, I'm gonna stop using "first_or_create!"
<ecommence> CoolerX: hehe nice timing :D
<CoolerX> but I think you probably meant to call it on an instance?
evdubs_ has quit [Ping timeout: 245 seconds]
<ecommence> yeah i think so, my bad!
<ecommence> completely misunderstood the meaning of first there
AndreYuhai has joined #ruby
evdubs__ has quit [Read error: Connection reset by peer]
evdubs__ has joined #ruby
vondruch has joined #ruby
MalkbabY_ has joined #ruby
MalkbabY has quit [Ping timeout: 240 seconds]
<CoolerX> does anyone know why this works
<CoolerX> x = lambda {|y| y + 2}
queip has quit [Ping timeout: 252 seconds]
<CoolerX> but this doesn't?
<CoolerX> x = lambda({|y| y + 2}
<CoolerX> )
<CoolerX> x = lambda({|y| y + 2})
<AndreYuhai> Because those are two different things AFAIK CoolerX
<AndreYuhai> In the first one you are passing a block
<CoolerX> I guess the block has to come after the arguments to lambda
<CoolerX> AndreYuhai, yeah
<AndreYuhai> In the second one you are trying to pass an argument
<CoolerX> ok
<CoolerX> so what arguments does lambda take?
<CoolerX> anything?
<AndreYuhai> CoolerX: So lambda is equal to Proc.new, and Proc does not take any arguments AFAIK
TCZ has quit [Quit: ...]
wallacer has quit [Ping timeout: 250 seconds]
vondruch has quit [Ping timeout: 260 seconds]
<leftylink> &>> method(:lambda).owner
<rubydoc> # => Kernel (https://carc.in/#/r/azgo)
<leftylink> okay
wallacer has joined #ruby
<havenwood> AndreYuhai: #proc is equivalent to Proc.new
<havenwood> lambdas are a bit different form a procs
<AndreYuhai> havenwood: lambda is not?
<AndreYuhai> Oh I didn't know that
jerme_ has quit [Quit: Connection closed for inactivity]
<havenwood> AndreYuhai: proc {}.lambda? #=> false
<havenwood> AndreYuhai: lambda {}.lambda? #=> true
<havenwood> AndreYuhai: lambdas have strict arity and different locality of return.
<havenwood> AndreYuhai: it doesn't usually matter
<AndreYuhai> havenwood: so the difference is in how they respond to certain calls and how they behave?
queip has joined #ruby
<havenwood> AndreYuhai: how strict they are with arguments and how they return out of methods, yeah
<AndreYuhai> havenwood: btw, on line 49 in that gist, how is :ended_early returned after break?
<havenwood> and how they respond to #lambda? too :P
<AndreYuhai> yea :D
<AndreYuhai> I get the lambda one on line 53 which I would expect
<AndreYuhai> But I don't know how that happens on line 49
<havenwood> AndreYuhai: there's an idea called "Tennent's Correspondence Principle" that in practice just means make it super confusing :P
<havenwood> AndreYuhai: it's just different ways to return that end up being more for fun than for important use cases
<havenwood> AndreYuhai: Ruby has lots of options ¯\_(ツ)_/¯
TCZ has joined #ruby
<CoolerX> why can you put random stuff in a class definition?
<CoolerX> well not random
<CoolerX> but just statements
<CoolerX> when it's run it prints those thigns
<CoolerX> things*
<leftylink> for the same reason you can put `def` in a class definition
<CoolerX> ?
<leftylink> because if you couldn't put things in class definitions, you wouldn't be able to put anything in a class
<CoolerX> ?
<CoolerX> what? I am not saying you shouldn't be able to put def inthere
<leftylink> good, neither am I
<CoolerX> sorry, I didn't understand your point
<AndreYuhai> havenwood: Oh I just realized that it was just an argument to break? I was thinking there is ";" in between :D
<CoolerX> yes def should be there you can define instance and class methods
<CoolerX> but why are other things allowed?
<leftylink> why should they not be allowed? why would def be treated differently than anything else?
<CoolerX> because def is a keyword?
<CoolerX> puts is not
<leftylink> if other things weren't allowed, how would things like attr_accessor?
<leftylink> how would things like attr_reader work?
<leftylink> how would things like include or extend work?
<CoolerX> so basically you can put everything in a class Foo end block?
<CommunistWolf> because ruby is suffer :D
<CommunistWolf> class Foo; Net::HTTP.get .... ; # use the output to define some methods, why not?
TCZ has quit [Quit: ...]
vondruch has joined #ruby
jla has quit [Ping timeout: 245 seconds]
<leftylink> hmm, it's gotten me thinking. I too am curious baout this question
centrx has quit [Remote host closed the connection]
centrx has joined #ruby
<CoolerX> if the function returns something does that do anything to the class ?
<CoolerX> like I am wondering if attr_accessors works by returning some methods or something
centrx has quit [Ping timeout: 250 seconds]
<leftylink> although attr_accessor is implemented in C, if it weren't, I am imagining it would be possible to implement it with define_method
<leftylink> &ri Module#define_method
Fernando-Basso has joined #ruby
jla has joined #ruby
<ccooke> CoolerX: The key point is that Ruby is a pretty much purely imperative language. Every statement in the language is executed when a block is processed, every statement has a return value, etc. You don't define a class so much as you run a piece of code which creates the structure of the class imperatively
<ccooke> leftylink: Take a look at this sometime: http://rubyquiz.com/quiz67.html :-)
<ccooke> (A bit old, but still useful)
<CoolerX> ok
<CoolerX> Thanks
<CoolerX> btw 'foo' => :bar
<CoolerX> is that a hash with a single entry?
<CoolerX> don't you need {'foo' => :bar } ?
<CoolerX> the curly braces
<ccooke> It will get passed to the method as a keyword argument
Azure has quit [Ping timeout: 245 seconds]
<CoolerX> oh ok
<CoolerX> I think this https://ruby-doc.org/core-3.0.1/Hash.html "Note: when the last argument in a method call is a Hash, the curly braces may be omitted:"
<CoolerX> ccooke, so that is the same as depends_on foo: :bar
<CoolerX> ?
<ccooke> Not quite. Example:
<ccooke> 3.0.0 :011 > def foo(**kw) p kw; end
<ccooke> => :foo
<ccooke> 3.0.0 :012 > foo 'bar' => :baz
<ccooke> {"bar"=>:baz}
<ccooke> => {"bar"=>:baz}
<ccooke> 3.0.0 :013 > foo bar: :baz
<ccooke> {:bar=>:baz}
<ccooke> => {:bar=>:baz}
<ccooke> 3.0.0 :014 >
<ccooke> bah. Tmux copy issue again :-/ Sorry about the long lines
jla has quit [Ping timeout: 260 seconds]
<CoolerX> is same as depends_on("pkg-config": :build)
<CoolerX> ?
<ccooke> the difference is that it's passing a string as the key, not a symbol
<CoolerX> yeah
<ccooke> so yes, if you use a string key, it will be the same
<CoolerX> def depends_on("pkg-config": "default value")
<ccooke> That's a bit different. IIRC you can't have a string literal *defined* keyword argument
<ccooke> (if you did, how could you tell?)
<CoolerX> so what is the actual depends_on ?
<CoolerX> def depends_on(**kw)
<ccooke> you can have string keys in the *undefined* key arguments hash
<CoolerX> ?
<ccooke> Likely
<CoolerX> hmm
<CoolerX> it's a bit confusing to me because in other places where they have keyword arguments they have used the colon syntax https://github.com/Homebrew/homebrew-core/blob/master/Formula/abcde.rb#L11
<CoolerX> like this entire block uses the colon syntax for keyword arguments https://github.com/Homebrew/homebrew-core/blob/master/Formula/abuse.rb#L14-L21
<CoolerX> but this block uses the hash rocket syntax for keyword arguments https://github.com/Homebrew/homebrew-core/blob/master/Formula/abuse.rb#L24-L27
<ccooke> the `foo: 'bar'` syntax is a short-form in ruby. The actual hash syntax is defined as { key => value }. The short-form is a quick way to use symbols as keys, which are nice and efficient. You can now use string keys that way, too, but these are still short-forms of the canonical => definition
<ccooke> Ruby methods can take a hash as the last parameter, and when doing so you may omit the curly brackets. It is, however, a normal hash for parsing and will work with the short-hand style or the canonical style
<ccooke> the 'string': :value syntax is newer in Ruby; previously, hashrockets were the only way to pass a string keyword argument to a method
<ccooke> There could be a number of reasons why the code you're looking at does that
<ccooke> Personally, I think most of them are bad reasons, mind, and this looks inconsistent which is bad for maintainability
<ccooke> (*personally* I would prefer to use the shorthand form only, and convert Symbol to String when needed)
<CoolerX> ok
<CoolerX> Thanks
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ccooke> But it's actually possible you have a bit of code archaeology on your hands - I haven't looked at the project you're examining, but it may be old enough to predate the short: 'form' hash style - that's been around for a few years, but not so long that there aren't viable projects that predate it
cow[moo] has joined #ruby
vondruch has quit [Ping timeout: 252 seconds]
<ccooke> So you might actually have code where new work has been updated but older line are untouched
<CoolerX> ccooke, right
<CoolerX> homebrew-core is pretty old
<CoolerX> started in 2009
<ccooke> CoolerX: Those are examples of class methods, yes
<CoolerX> oh
<CoolerX> hmm
<CoolerX> why not just have instance variables you can set?
<CoolerX> or override
<CoolerX> in the Formula class
<ccooke> it's quite likely that these methods are implemented that way
<ccooke> but this is providing some encapsulation, which makes things more consistent and reusable
<ccooke> Also, one of the advantages of the imperative style of class definition is that you can easily have code that generates a whole set of things like that.
<leftylink> bI suppose you can also argue that `desc "better CD Encoder"` is a few characters shorter than e.g. `@desc = "Better CD Encoder"`
<ccooke> and it allows validation where needed
<CoolerX> ok
Fernando-Basso has quit [Remote host closed the connection]
Fernando-Basso has joined #ruby
fernando-basso_ has joined #ruby
Fernando-Basso has quit [Quit: May the force]
fernando-basso_ is now known as fernando-basso
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 252 seconds]
vondruch has joined #ruby
jla has joined #ruby
CoolerX has quit [Read error: Connection reset by peer]
CoolerX has joined #ruby
centrx has joined #ruby
jla has quit [Ping timeout: 246 seconds]
jimms has joined #ruby
cthulchu has joined #ruby
Technodrome has joined #ruby
<ecommence> Anybody know why I'm getting `undefined method `[]' for false:FalseClass` for my puma.rb? https://dpaste.org/t5Xt
wallacer has quit [Ping timeout: 250 seconds]
harlin has quit [Quit: Leaving]
wallacer has joined #ruby
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 240 seconds]
<centrx> ecommence: Look for something like x[], that x is FalseClass when it should be an array/enumerable
<centrx> ecommence: Might be a configuration option that is the wrong type
wallacer has quit [Ping timeout: 245 seconds]
<ecommence> centrx: the user/app i added in myself
wallacer has joined #ruby
<ecommence> not sure i want it after all. just more code to maintain :D
cd has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
jetchisel has quit [Ping timeout: 246 seconds]
phaul has joined #ruby
rubydoc has joined #ruby
<centrx> ecommence: Also try to get a trace for that, will tell you exactly where the error occurs. Logs? Command-line option (verbose) for Puma?
qewr has joined #ruby
jla has joined #ruby
Azure has joined #ruby
<ecommence> centrx: great idea!
AndreYuhai has quit [Quit: leaving]
duderonomy has joined #ruby
klaas has quit [Quit: ZNC 1.8.2 - https://znc.in]
Guest45273 has quit []
Guest45273 has joined #ruby
Guest45273 has quit [Client Quit]
rann has joined #ruby
MalkbabY has joined #ruby
klaas has joined #ruby
MalkbabY_ has quit [Ping timeout: 240 seconds]
klaas has quit [Client Quit]
klaas has joined #ruby
aef has quit [Read error: Connection reset by peer]
miah has quit [Quit: DevOps? DerpOps maybe!]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
miah has joined #ruby
miah has quit [Client Quit]
miah has joined #ruby
rubydoc has quit [Ping timeout: 268 seconds]
phaul has quit [Ping timeout: 260 seconds]
vondruch has quit [Read error: Connection reset by peer]
fernando-basso has quit [Quit: May the force]
fernando-basso has joined #ruby
SeepingN has joined #ruby
phaul has joined #ruby
rubydoc has joined #ruby
ChmEarl has joined #ruby
jla has quit [Ping timeout: 268 seconds]
gix has joined #ruby
phaul has quit [Ping timeout: 252 seconds]
phaul has joined #ruby
crankharder has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyWork has quit [Remote host closed the connection]
jimms has quit [Quit: Leaving]
jenrzzz has joined #ruby
rubydoc has quit [Ping timeout: 246 seconds]
rubydoc has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
arekushi has joined #ruby
cthu| has joined #ruby
cthulchu has quit [Ping timeout: 240 seconds]
yuesbeez has joined #ruby
klaas has quit [Quit: ZNC 1.8.2 - https://znc.in]
klaas has joined #ruby
<rapha> hi all
<rapha> is there anything i can put `"blah".chars[right_here]` so that the result will be `nil`?
<rapha> (nil doesn't work => no implicit conversion; -1 doesn't work => means "last one", i.e. "h"; 0 ofc doesn't work => means "first one", i.e. "b" ... etc.)
<leftylink> well, a number larger than the array would be nil
<leftylink> coming up with a number that's certainly larger than the array may or may not be convenient though
<rapha> hmm
<rapha> i think that might work
robotbee has joined #ruby
<adam12> rapha: Out of curiosity, what are you trying to do at a higher level?
<rapha> adam12: going through a list of words word by word and char by char, getting myself the previous and following char as context, if any
<rapha> (but if none, need a space; which make it a little more involged)
<adam12> rapha: Ah. Presumingly, you’ve seen chars.each_cons(3) ?
SegFaultAX has left #ruby [#ruby]
<rapha> woah
<havenwood> rapha: what about emoji?
<rapha> #each_cons o_O
* rapha looks that up
<adam12> &>> “blah”.chars.each_cons(3).to_a
<rubydoc> stderr: -e:4:in `<main>': undefined local variable or method `“blah”' for main:Object (NameError)... check link for more (https://carc.in/#/r/azl3)
<rapha> havenwood: no emojis is guaranteed for this 1025 y/o text.
<havenwood> rapha: phew
<adam12> Huh interesting. My IRC client seems to want to do it’s own thing I guess.
<havenwood> rapha: I still prefer #each_grapheme_cluster :)
* adam12 slaps adam12 around a bit with a large trout
<rapha> woaaaaaaaaaaaaaaaaaaah
<rapha> Ruby man
<rapha> i love her love her love her
<rapha> how AWESOME a method is that
<rapha> <3 <3 <3
<havenwood> &>> "bl🇸🇲ah".each_grapheme_cluster.each_cons(3).to_a
<rubydoc> # => [["b", "l", "🇸🇲"], ["l", "🇸🇲", "a"], ["🇸🇲", "a", "h"]] (https://carc.in/#/r/azl4)
<rapha> thank you for that adam12 :)
<rapha> WOAAAAAH!!!!
<rapha> srsly?!!?
<rapha> omg omg omg
drusepth has joined #ruby
<rapha> how amazing can a programming language be?!
Technodrome has joined #ruby
* rapha won't even count the number of lines this took up until right now
<adam12> Only issue I see is possibly the first element isn’t correct. In theory it would be [prev, current, next], but the first is wrong.
<rapha> hmm
<rapha> oh
<rapha> let's see
<adam12> Might be worth exploring tho, anyways. Maybe padding by whitespace on either side or something.
<adam12> or some sort of null...
<rapha> yeah something like that must work
<havenwood> rapha: Don't do this but Ruby is flexible enough to do all sorts of things:
<havenwood> &>> class String; include Enumerable; alias each each_grapheme_cluster end; 'rapha'.each_cons(3).to_a
<rubydoc> # => [["r", "a", "p"], ["a", "p", "h"], ["p", "h", "a"]] (https://carc.in/#/r/azl5)
<rapha> lol
<rapha> but yeah that shows what adam said
jenrzzz has joined #ruby
<rapha> also a last one ['h', 'a', ' '] is missing
jla has joined #ruby
<havenwood> ^>> 'rapha'.prepend(' ').<<(' ').each_grapheme_cluster.each_cons(3).to_a
<havenwood> #=> [[" ", "r", "a"], ["r", "a", "p"], ["a", "p", "h"], ["p", "h", "a"], ["h", "a", " "]]
<rapha> hey don't do my work for me!!! :-P
<havenwood> rapha: nicer to have nils probably, like adam12 suggests
<havenwood> &>> [].prepend(nil).append(nil)
<rubydoc> # => [nil, nil] (https://carc.in/#/r/azl6)
<rapha> how metaphysically philosophical!
<rapha> "if there is nothing at either end, and nothing in between, then what is there"?
<havenwood> rapha: 2
<rapha> douglas adams would've been proud of you havenwood
<havenwood> rapha: the size is two and the count is two but the count of itself is zero
<havenwood> &>> [].prepend(nil).append(nil).count(&:itself)
<rubydoc> # => 0 (https://carc.in/#/r/azl7)
<havenwood> &>> [].prepend(nil).append(nil).size
<rubydoc> # => 2 (https://carc.in/#/r/azl8)
<havenwood> Sometimes when you count yourself you end up with less than your size.
<rapha> even richard feynman would've been proud!!!
<adam12> I think each_cons was lifted from SmallTalk. I swear I saw an example of it in the Smalltalk Best Practices book just recently.
jla has quit [Ping timeout: 240 seconds]
moldorcoder7 has quit [Ping timeout: 240 seconds]
<adam12> Oooh. each_cons on steroids.
moldorcoder7 has joined #ruby
Azure has quit [Ping timeout: 252 seconds]
Azure|dc has joined #ruby
CoolerX has quit [Read error: Connection reset by peer]
CoolerX has joined #ruby
Iarfen has joined #ruby
moldorcoder7 has quit [Ping timeout: 240 seconds]
Azure|dc has quit [Read error: Connection reset by peer]
wallacer has quit [Ping timeout: 245 seconds]
moldorcoder7 has joined #ruby
JaredCE has joined #ruby
<JaredCE> i'm trying to run a bundle install for a project but i'm getting: Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate
drusepth has quit [Ping timeout: 252 seconds]
<JaredCE> it points to this for help: http://bit.ly/ruby-ssl which doesn't seem to exist
centrx has quit []
py88 has quit [Read error: Connection reset by peer]
<adam12> JaredCE: bundle —version; gem —version
<adam12> There’s a ton of recent SSL discussion about this on the Rubygems github repo.
<JaredCE> i'm newish to ruby
jla has joined #ruby
<adam12> JaredCE: How did you install Ruby?
<havenwood> JaredCE: Can you install a ca-certificates package?
<havenwood> JaredCE: And what adam12 asked.
<JaredCE> brew install rbenv then rbenv install in the package dir
<adam12> JaredCE: Which ruby version?
<adam12> JaredCE: And can you get me the output of the line above? bundle —version ; gem —version
<JaredCE> 2.6.6
<adam12> It’s versions all the way down.
<adam12> JaredCE: Try `gem update —system` first.
<adam12> That’s a double-hyphen in case it doesnt’ come across correctly.
<JaredCE> Bundler version 1.17.2 && gem 3.0.3
<havenwood> JaredCE: 2.6.7 is the latest version of Ruby 2.6.
<havenwood> JaredCE: brew upgrade
<JaredCE> it's an rbenv install? the .ruby-version file specifies 2.6.6?
py88 has joined #ruby
<havenwood> JaredCE: bump .ruby-version to 2.6.7
<havenwood> JaredCE: and same in the Gemfile
<JaredCE> gem update --system results in: ERROR: SSL verification error at depth 1: self signed certificate in certificate chain (19)
<havenwood> JaredCE: It's odd to get these issues with ruby-build since it ships its own OpenSSL.
<havenwood> JaredCE: Try installing Ruby with ruby-install instead?
BSaboia has quit [Quit: This computer has gone to sleep]
<havenwood> JaredCE: ruby-install -j4 --latest --install-dir ~/.rbenv/versions/2.6.7 ruby 2.6.7
drakonis has joined #ruby
<havenwood> JaredCE: Switching to RVM or chruby with ruby-install are ways around the problem. Or you could try updating ruby-build or installing 2.6.7 with ruby-build.
<havenwood> JaredCE: Since ruby-build ships its own OpenSSL, an update to it and reinstall might solve the problem.
drakonis has left #ruby ["WeeChat 3.1"]
<JaredCE> :( i downloaded a project written in ruby, i just wanted to mess around and try and add to the project... didn't think i'd have to go through this
<havenwood> JaredCE: You chose rbenv and it happened to run into a very odd error.
<havenwood> JaredCE: ¯\_(ツ)_/¯
<JaredCE> i mean i didn't choose it... the project told me to use it
<adam12> JaredCE: Could you try running the script here? https://bundler.io/v2.2/guides/rubygems_tls_ssl_troubleshooting_guide.html#automated-ssl-check (the curl line)
<havenwood> JaredCE: What project?
<havenwood> JaredCE: SSL certs can get funky in any language. Unsure why you got unlucky here.
<JaredCE> output from the curl
<havenwood> JaredCE: That's not Ruby 2.6.6
<havenwood> JaredCE: That's macOS system Ruby
<havenwood> JaredCE: You just need to have rbenv switch you to 2.6.6
<havenwood> JaredCE: rbenv rehash && rbenv global 2.6.6
<havenwood> JaredCE: Then: gem update --system && bundle
<havenwood> JaredCE: and you should be in good shape
<JaredCE> that doesn't seem to be working
<havenwood> JaredCE: do you have Ruby 2.6.6 from rbenv working yet?
<havenwood> JaredCE: ruby -v
<JaredCE> nope
<JaredCE> rbenv global 2.6.6 && ruby -v = ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
<havenwood> JaredCE: Seems rbenv is failing you.
<JaredCE> seems
<JaredCE> so
<havenwood> JaredCE: maybe an rbenv user can spot why
<havenwood> JaredCE: is it in your PATH?
<havenwood> JaredCE: Try the rbenv-doctor script: curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
<havenwood> JaredCE: I don't use rbenv, but I imagine its shims directory isn't in your PATH.
<JaredCE> yeah think it's missing
<havenwood> JaredCE: Just try running: ~/.rbenv/bin/rbenv init
<havenwood> JaredCE: Once you get rbenv working, everything else should *just work*
<havenwood> JaredCE: Or RVM and chruby are popular alternatives to rbenv
<havenwood> JaredCE: After an init, do you see 2.6.6 as the `rbenv version` and current Ruby?
<JaredCE> i have an ~/.rbenv/ but no bin in there
TCZ has joined #ruby
<havenwood> JaredCE: I guess just refollow the installation steps: https://github.com/rbenv/rbenv#installation
<havenwood> JaredCE: Or if you switch off rbenv I'll know how to help, heh.
<havenwood> It should work if you follow rbenv instructions for macOS.
<havenwood> It's a popular tool on a popular platform so it should have plenty of eyes.
<JaredCE> right that's working now
<JaredCE> thank you so much
<adam12> JaredCE: Out of curiousity, what’s the output of `dig rubygems.org`
BSaboia has joined #ruby
phage has joined #ruby
<JaredCE> i say it worked
<JaredCE> it's still erroring when trying to bundle install
<havenwood> JaredCE: gem install bundler
<havenwood> JaredCE: rbenv rehash
<ruby[bot]> JaredCE: 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
<havenwood> JaredCE: Can you confirm you've updated to the latest RubyGems (gem update --system) and installed Bundler (gem install bundler) then try: bundle
ur5us__ has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
<JaredCE> gem update --system does not work
<JaredCE> tbh i have been staring at my screen too long today, gonna clal it a night,
<JaredCE> thanks for your help
<havenwood> JaredCE: Once you get rbenv working everything should fall in line.
<havenwood> JaredCE: Good luck!
<JaredCE> danke
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
howdoi has joined #ruby
JaredCE has quit [Ping timeout: 240 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MalkbabY_ has joined #ruby
SeepingN has joined #ruby
MalkbabY has quit [Ping timeout: 252 seconds]
crankharder has quit [Ping timeout: 246 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
FastJack has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
prestorium has quit [Ping timeout: 260 seconds]
FastJack has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
prestorium has joined #ruby
BTRE has quit [Quit: Leaving]
jla has quit [Ping timeout: 252 seconds]
BTRE has joined #ruby
ur5us__ has quit [Ping timeout: 245 seconds]
wallacer has joined #ruby
cthu| has quit [Ping timeout: 252 seconds]
gearnode has quit [Ping timeout: 250 seconds]
harlin has joined #ruby
evdubs_ has joined #ruby
prestorium has quit [Ping timeout: 260 seconds]
evdubs__ has quit [Ping timeout: 245 seconds]
anoldhacker has joined #ruby
evdubs has joined #ruby
<anoldhacker> https://ruby-doc.org/stdlib-3.0.1/libdoc/yaml/rdoc/YAML.html refers to doc/security.rdoc, but I don't find this file anywhere...
prestorium has joined #ruby
evdubs_ has quit [Ping timeout: 260 seconds]
pyra has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
ruurd has joined #ruby
<anoldhacker> Thanks :)
hiroaki has joined #ruby
pyra has quit [Ping timeout: 245 seconds]
pyra has joined #ruby
ruurd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zapata has quit [Quit: WeeChat 3.1]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hiroaki has quit [Ping timeout: 260 seconds]
CoolerX has quit [Quit: Leaving]
TCZ has quit [Quit: ...]
crankharder has quit [Quit: leaving]
hiroaki has joined #ruby
jess has quit []
ruurd has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
py88 has quit [Read error: Connection reset by peer]
py88 has joined #ruby
ruurd has quit [Ping timeout: 245 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Omnilord has joined #ruby
dpl__ has joined #ruby
dpl_ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
Azure has joined #ruby
Azure has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 246 seconds]
<rinket> haiiiii!
<rinket> wil u b my fren
fernando-basso has quit [Quit: May the force]
gearnode has joined #ruby
jenrzzz has joined #ruby
Iarfen has quit [Remote host closed the connection]
robotbee has quit [Ping timeout: 252 seconds]
fercell has quit [Read error: Connection reset by peer]
fercell has joined #ruby
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 246 seconds]
rogergilmour has joined #ruby
<rogergilmour> hello, any of you know why when I read a json, my file is giving error?
<rogergilmour> @myfile = File.read ("example.json")
<rogergilmour> @result = JSON.parse (@myfile)
<weaksauce> rogergilmour error message?
<rogergilmour> JSON::ParserError at /CRUD_Bricks/
<rogergilmour> 767: unexpected token at '[{"name":"roberto","date":"2021-04-28","scala":null}] [{"name":"mario","date":"2021-04-06","scala":null}] [{"name":"ss","date":"2021-04-28","scala":"7"}] '
jenrzzz has quit [Ping timeout: 252 seconds]
<weaksauce> looks like it's a malformed json
dpl__ has quit [Quit: dpl__]
<rogergilmour> ok i will test it with another json file
BSaboia has joined #ruby
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 260 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
centrx has joined #ruby
jobewan has joined #ruby
centrx_ has joined #ruby
Omnilord has quit [Quit: Leaving]
centrx has quit [Ping timeout: 245 seconds]