havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.0, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
taupiqueur has joined #ruby
bluedust has joined #ruby
devz3ro has quit [Quit: *]
taupiqueur has quit [Ping timeout: 256 seconds]
Guest9014 has quit [Ping timeout: 240 seconds]
devz3ro has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
ur5us has joined #ruby
graywolf has joined #ruby
<ox1eef> ruby ruby ruby!
devz3ro has quit [Quit: The Lounge - https://thelounge.chat]
<leah2> da dah da dah dah dah
<ox1eef> :)
graywolf has quit [Quit: WeeChat 3.4]
devz3ro has joined #ruby
devz3ro has quit [Quit: The Lounge - https://thelounge.chat]
devz3ro has joined #ruby
devz3ro has left #ruby [#ruby]
devz3ro has joined #ruby
Rounin has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #ruby
rubyruby has joined #ruby
rubyruby has quit [Remote host closed the connection]
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 256 seconds]
constxd_ has joined #ruby
bluedust_ has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 240 seconds]
polishdub has joined #ruby
polishdub has quit [Remote host closed the connection]
lunarkitty has joined #ruby
duds- has quit [Remote host closed the connection]
gr33n7007h has quit [Read error: Connection reset by peer]
gr33n7007h has joined #ruby
polishdub has joined #ruby
graemefawcett has quit [Ping timeout: 240 seconds]
graemefawcett has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
taupiqueur has joined #ruby
duds- has joined #ruby
taupiqueur has quit [Ping timeout: 250 seconds]
constxd_ has quit [Ping timeout: 250 seconds]
hanzo has joined #ruby
polishdub has quit [Ping timeout: 250 seconds]
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 256 seconds]
polishdub has joined #ruby
cdown has quit [Ping timeout: 256 seconds]
polishdub has quit [Quit: leaving]
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 250 seconds]
lunarkitty has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 240 seconds]
reset has quit [Quit: reset]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
bluedust_ has quit [Read error: Connection reset by peer]
bluedust has joined #ruby
bluedust_ has joined #ruby
Guest9014 has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
taupiqueur has joined #ruby
dviola has joined #ruby
taupiqueur has quit [Ping timeout: 256 seconds]
fcser has quit [Ping timeout: 268 seconds]
fcser has joined #ruby
tweaks has quit [Ping timeout: 250 seconds]
tweaks has joined #ruby
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
ZAJDAN has joined #ruby
_ht has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
bluedust_ has quit [Remote host closed the connection]
bluedust has joined #ruby
teclator has quit [Ping timeout: 240 seconds]
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
teclator_ has joined #ruby
teclator_ has quit [Client Quit]
infinityfye has joined #ruby
bluedust has quit [Read error: Connection timed out]
infinityfye has quit [Client Quit]
bluedust has joined #ruby
constxd_ has joined #ruby
fdan has joined #ruby
<fdan> hi guys, i am new to ruby
<fdan> i get this error https://bpa.st/4SNA
<fdan> here is the gemfile https://bpa.st/PBAQ
<jhass[m]> fdan: try bundle update google-protobuf
<fdan> the build has been failing from a custom build tool
<fdan> im trying to figure out how to edit the steps
pandabot has quit [Ping timeout: 250 seconds]
benjaminwil has quit [Ping timeout: 252 seconds]
<fdan> jhass[m] can i try changing the version in the gemfile?
dstein64 has quit [Ping timeout: 256 seconds]
leftylink has quit [Ping timeout: 260 seconds]
<jhass[m]> bundle update google-protobuf would be the safe version of editing Gemfile.lock, those changes you can commit and retry the build tool
leftylink has joined #ruby
benjaminwil has joined #ruby
dstein64 has joined #ruby
pandabot has joined #ruby
<fdan> ok i tried to do that in my terminal
<fdan> i get this error Your Ruby version is 2.6.3, but your Gemfile specified 2.5.5
taupiqueur has joined #ruby
<jhass[m]> ah, bummer. If you have docker lying around fastest might be to run it in there, something like docker run --rm ruby:2.5 -v "$(pwd):/mnt" -w /mnt ruby:2.5 bundle update google-protobuf if memory serves well
mixfix41 has joined #ruby
taupiqueur_ has joined #ruby
<jhass[m]> otherwise temporarily commenting the ruby line in Gemfile might be fair too
taupiqueur has quit [Ping timeout: 256 seconds]
<fdan> jhass[m] i get this error docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "-v": executable file not found in $PATH: unknown.
<jhass[m]> Ah sorry, had an extra ruby:2.5 in there, remove the first one
<fdan> hmm ok i get this now Your Ruby version is 2.5.9, but your Gemfile specified 2.5.5
<fdan> docker run --rm -v "$(pwd):/mnt" -w /mnt ruby:2.5.9 bundle update google-protobuf
benjaminwil has quit [Ping timeout: 256 seconds]
<fdan> should i change the docker run command to the above?
leftylink has quit [Ping timeout: 240 seconds]
pandabot has quit [Ping timeout: 256 seconds]
oxfuxxx has joined #ruby
benjaminwil has joined #ruby
pandabot has joined #ruby
leftylink has joined #ruby
<jhass[m]> Not sure that's available, give it a shot!
dstein64 has quit [Ping timeout: 256 seconds]
<jhass[m]> 2.5.5 not 2.5.9 of course
<fdan> yeah sure
dstein64 has joined #ruby
<fdan> jhass[m] i get this https://bpa.st/5NFQ
<jhass[m]> Looks promising, give it a minute
<fdan> okay
constxd_ has quit [Ping timeout: 240 seconds]
___nick___ has joined #ruby
<fdan> its been like that since 5m now
nebiros_ has joined #ruby
nebiros has quit [Ping timeout: 245 seconds]
<fdan> i think the container is up
<fdan> jhass[m] what's next?
<jhass[m]> Hum, okay it shouldn't get stuck on that...
<fdan> i opened a new tab and did a docker ps
<fdan> i see the container is up
<jhass[m]> Normally it should be installing and updating gems after that and then exit on its own
<fdan> hmm
<fdan> so what can i do to fix this
<jhass[m]> I'd kill it and try to throw an -i -t into the args list to see if it's somehow stuck on allocating a pty, but probably not
Bounga has joined #ruby
<jhass[m]> If that does not help next up would be temporarily removing that silly ruby version restriction in the Gemfile (not Gemfile.lock), never understood why that's even a feature
<fdan> yes that doesnt look like its helping
<fdan> jhass[m] https://bpa.st/U4VA
<fdan> this is my gemfile
<fdan> which line needs to be removed
<jhass[m]> Okay, throw a # in front of line 5 and retry the local bundle update google-protobuf
<fdan> sorry ignore the first link
<fdan> sry i think its the same
<fdan> the characters are because of my yubikey
<jhass[m]> weird, why would it get stuck on this
<fdan> hmm
<jhass[m]> (it's trying to do network calls in case that's not obvious and rings a bell)
<fdan> is there a -v flag to see more verbose
<jhass[m]> you can try -V but not sure it'll really help here
<fdan> jhass[m] https://bpa.st/BOBQ
<jhass[m]> oh well, looks like whatever gembuilder.s3.amazonaws.com was in the first place no longer exists. rubygems.org doesn't seem to host the versions of the gems referenced from there, so I guess you have to consider the project dead, sorry
oxfuxxx has quit [Ping timeout: 256 seconds]
<fdan> i also get this message from the build pipeline https://bpa.st/5SVQ
pandabot has quit [Ping timeout: 256 seconds]
dstein64 has quit [Ping timeout: 250 seconds]
leftylink has quit [Ping timeout: 256 seconds]
<jhass[m]> Yes, that's what we've been trying to achieve
<jhass[m]> build pipeline probably just happens to still have the other gems cached or something
<fdan> any other way to update the version
<fdan> hmm
<jhass[m]> Guess you can try to ninja Gemfile.lock after all, but honestly this all looks terribly maintained so not sure it's all worth the effort
benjaminwil has quit [Ping timeout: 240 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex8 has joined #ruby
taupiqueur has joined #ruby
taupiqueur_ has quit [Ping timeout: 240 seconds]
bluedust_ has joined #ruby
bluedust has quit [Ping timeout: 240 seconds]
benjaminwil has joined #ruby
leftylink has joined #ruby
dstein64 has joined #ruby
pandabot has joined #ruby
oxfuxxx has joined #ruby
taupiqueur_ has joined #ruby
taupiqueur has quit [Ping timeout: 250 seconds]
fdan has quit [Ping timeout: 256 seconds]
infinityfye has joined #ruby
gproto23 has joined #ruby
cdown has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
___nick___ has quit [Read error: Connection reset by peer]
___nick___ has joined #ruby
infinityfye has quit [Remote host closed the connection]
infinityfye has joined #ruby
fef has joined #ruby
TomyWork has joined #ruby
fredlinhares has joined #ruby
BSaboia has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
Guest9014 has quit [Ping timeout: 256 seconds]
perrierjouet has joined #ruby
TCZ has joined #ruby
bluedust has joined #ruby
bluedust_ has quit [Ping timeout: 240 seconds]
duderonomy has quit [Remote host closed the connection]
gproto23 has quit [Read error: Connection reset by peer]
Thanzex8 has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
nebiros_ has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
nebiros has joined #ruby
nebiros has quit [Changing host]
nebiros has joined #ruby
gproto23 has joined #ruby
_aeris_ has joined #ruby
aeris has quit [Remote host closed the connection]
_aeris_ is now known as aeris
fruity has joined #ruby
fredlinhares has quit [Read error: Connection reset by peer]
fruity has quit [Client Quit]
LazyDev123 has joined #ruby
fredlinhares has joined #ruby
TCZ has quit [Quit: Leaving]
infinityfye has quit [Ping timeout: 240 seconds]
oxfuxxx has quit [Ping timeout: 240 seconds]
LazyDev123 has quit [Quit: Client closed]
oxfuxxx has joined #ruby
fredlinhares has quit [Read error: Connection reset by peer]
fredlinhares has joined #ruby
fdan has joined #ruby
bluedust_ has joined #ruby
bluedust has quit [Ping timeout: 240 seconds]
<fdan> why is edititng the Gemfile.lock not a good idea?
<Vaevictus> sorry, adam12 / havenwood ... i had to run and get my kids from the bus as you were helping me yesterday. the index attribute is a unique value, at least in theory, and we can go along that.
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
fdan has quit [Quit: Client closed]
<adam12> Vaevictus: The naive answer would be to just generate a Hash with the attribute as the key and the object as the value.
<adam12> Vaevictus: I _believe_ Ruby Hashes are O(1) so it should be fast for lookups.
<Vaevictus> gotcha... is there a pretty directive to accomplish that, or just iterate the array push the key/object into the hash?
<adam12> I normally do each_with_object or reduce, but if you're on a newer version of Ruby, Array#to_h takes a block. so it would be as simple as array.to_h { |item| [item.attribute, item] }
<jhass[m]> fdan: just very easy to destroy it as part of the process, not updating all places that need to be or doing one too many, putting in an invalid dependency tree resolution etc
<Vaevictus> this project is ruby 3.0
<adam12> Vaevictus: Should be fine then, afaik.
<Vaevictus> cool, thanks. i was looking at reduce initially but not quite figuring that out. I'm a bit dense, haven't used ruby since 1.2 or something :D
<adam12> If you think you need reduce, I'd reach for each_with_object before it. They are similar, but I find each_with_object easier to reason about mentally.
<adam12> With reduce, you need to return the memo object (IIRC) and each_with_object has that hidden away from you.
<jhass[m]> yeah, ton's of inject/reduce abuse in the wild
* adam12 reduces jhass[m] into {}s
BSaboia has joined #ruby
<jhass[m]> :(
<adam12> jhass[m]: Happy Friday!
<jhass[m]> Indeed, happy it's weekend already, am I right?!
BSaboia has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
<adam12> jhass[m]: You win!
<jhass[m]> Yay!
<jhass[m]> let's create an NFT for this moment
oxfuxxx has quit [Ping timeout: 250 seconds]
BSaboia has joined #ruby
<adam12> jhass_ape.gif
BSaboia has quit [Client Quit]
fdan has joined #ruby
oxfuxxx has joined #ruby
BSaboia has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
croberts has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
<croberts> I was looking at the OPENSSL::X509::Certificate class and was curious if you have a subject like this Subject: O=Default_Organization, CN=57b26ce3-e4fe-4f79-a377-2c4d9dea5204
<croberts> is there a way to grab just the CN= out of it without regex?
<croberts> i checked the docs but just saw subject and not a cn method
<John_Ivan_> hi, is there any way to get the entries of a directory's in fullpath mode?
<John_Ivan_> looking inside the Dir object, there's nothing of the sort. but File contains File.realpath(). so my actual question is - how can I make Dir return an array of Files ?
<John_Ivan_> File objects*
<John_Ivan_> or to just print out the full absolute path instead of entry name.
<adam12> John_Ivan_: Can you get what you want via Pathname?
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<John_Ivan_> adam12, let me try.
<John_Ivan_> adam12, yes. that works, it's perfect. how does that work? O_O
<John_Ivan_> it takes a string and it can retrieve it's absolute path.... based on what?
<John_Ivan_> the last call made to enumerate a dir or?
<jhass[m]> croberts: iirc openssl has no API for it and the format there is more of a convention than a standard. But should be simple enough to parse with a .split(", ").to_h {|item| item.split("=") }
<adam12> John_Ivan_: I'd have to see code since I'm not sure what you see.
<John_Ivan_> adam12, actually no. my bad. I'm getting a weird path prefix. I'm getting C:\User\Me
<adam12> John_Ivan_: But ultimately, I consider Pathname above Dir and File in terms of higher-order functionality.
<John_Ivan_> that's not where the actual file is located in.
<micah> is there a way I can tell `gem install` to use the pre-built binary version, rather than compile it manually
<adam12> John_Ivan_: If you're globbing, you might need to glob a full path and not relative.
<adam12> micah: It should, if it's available.
<micah> adam12: you mean it should by default?
<adam12> micah: Yes.
<adam12> micah: what gem and what platform?
<micah> adam12: hm, it seems its building libv8
<micah> adam12: i've set x86_64-linux
<micah> Installing libv8-node 15.14.0.1 with native extensions
<John_Ivan_> adam12, let's start from step 1 again. think I might've messed things up completely. so I have a full path. "D:\mydata\direktory". I need to enumerate all **directories** inside direktory but in the form of "D:\mydata\direktory\fileA.ext", "D:\mydata\direktory\fileB.ext" etc.
<micah> (using bundle install -j $(nproc) --path vendor "${FLAGS[@]}")
<croberts> jhass[m]: thank you sir
teclator has joined #ruby
<adam12> John_Ivan_: So you want all _files_ inside all _directories_ inside that parent directory?
<John_Ivan_> adam12, no. just the toplevel directories inside "direktory" in fullpath form.
<John_Ivan_> and yes, I know I can just append the path I pass over to Dir then concatenate that with the results returned from it, but isn't there like, Dir.entries("path", Mode::FullPath) ?
<adam12> John_Ivan_: Pathname("D:\mydata\direktory").each_child { |path| p path }
<adam12> micah: What version of Ruby? What version of `gem`?
<adam12> micah: Also `uname -a`?
<John_Ivan_> adam12, that solves it. thanks. I'll keep pathname in mind :)
<adam12> John_Ivan_: cheers.
<John_Ivan_> no. thank you :)
<adam12> micah: I just realized you're using bundler. Which version of bundler? There were some improvements around this lately.
<micah> adam12: 2.5, bundler 2.2.33, and on a debian buster machine
<micah> although I think i'll update to debian bullseye, and bundler 2.3.3
<jhass[m]> mmh, debian package supplied bundler & rubygems? I would trust them to patch out stuff like using prebuilt binaries 🤣
<adam12> LOL
<croberts> jhass[m]: I tried to use the split but it comes back with it saying unknown method https://paste.centos.org/view/a6643717 am i using it in the wrong spot?
<jhass[m]> Ah, I guess you need to to_s or something first
<croberts> oh ok
<jhass[m]> croberts: though Name#to_a also looks interesting, give that a call
<croberts> ok i'll play around with it, after doing to_s i got ArgumentError: wrong array length at 0 (expected 2, was 3) so will keep at it
<croberts> will check out name too
<jhass[m]> ?pry
* jhass[m] kicks the bot
<jhass[m]> ?pry
ruby[bot] has joined #ruby
John_Ivan_ has quit [Read error: Connection reset by peer]
<jhass[m]> ?pry
<ruby[bot]> Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (http://pry.github.io/): gem install pry pry-doc
<jhass[m]> croberts: ^ check this out, good for playing around :)
<croberts> ok ty
reset has joined #ruby
John_Ivan has joined #ruby
fef has quit [Quit: Leaving]
gproto23 has quit [Read error: Connection reset by peer]
justJustache is now known as justache
<ox1eef> Not sure I would still call Pry the "better IRB". Have you used IRB recently? it is catching up with Pry, if not over taking it.
gr33n7007h has quit [Quit: WeeChat 3.4]
dstein64 has quit [Ping timeout: 256 seconds]
<havenwood> ox1eef: "Pry, the inspiration for modern IRB"
Rounin has quit [Ping timeout: 240 seconds]
<havenwood> ox1eef: Here's a fun one Pry is still better at: :xxxxxxxxx; Symbol.all_symbols.grep(/xx/)
<havenwood> Check results in Pry and IRB. :)
<havenwood> Now we have ruby/debug too.
gr33n7007h has joined #ruby
John_Ivan has quit [Remote host closed the connection]
John_Ivan has joined #ruby
dstein64 has joined #ruby
taupiqueur_ has quit [Ping timeout: 240 seconds]
<adam12> debug is so nice.
<adam12> I can't believe it took so long to get a better one.
<adam12> I guess everyone was happy wth byebug. I rarely used it.
<adam12> Tho I use debug constantly.
<rapha> can you replace the contents of a capture with themselves .downcase?
<rapha> wait, that's a badly posed question
<rapha> better: what's the most foolproof way of downcasing any character immediately following a specific list of characters?
John_Ivan has quit [Remote host closed the connection]
John_Ivan has joined #ruby
duds- has quit [Remote host closed the connection]
<adam12> gsub with block? Maybe some code would help explain a bit better what you want to do.
___nick___ has quit [Ping timeout: 256 seconds]
taupiqueur has joined #ruby
taupiqueur has quit [Remote host closed the connection]
<ox1eef> havenwood: +1
miah has quit [Ping timeout: 265 seconds]
taupiqueur has joined #ruby
taupiqueur has quit [Ping timeout: 256 seconds]
teocle has joined #ruby
<rapha> adam12: rn i'm (lastc=''; str.chars.map{|c| c.downcase! if lastc.match?(/[ʿʾ]/); lastc=c}.join)'ing
constxd has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
oxfuxxx has quit [Quit: can you please adjust your IRC quit message to be less transphobic?]
taupiqueur has joined #ruby
oxfuxxx has joined #ruby
<havenwood> rapha: preceeding = 'LOL'; 'OMGWTFBBQLOLCOPTERLOLLIGAG'.gsub(/(?<=#{preceeding})(.)/, &:downcase)
John_Ivan_ has joined #ruby
<havenwood> rapha: str.gsub(/(?<=#{specific_chars})(.)/, &:downcase)
<havenwood> rapha: If you mean a union of chars, you can do that regexp for `specific_chars`.
<havenwood> >> preceeding = 'LOL'; 'OMGWTFBBQLOLCOPTERLOLLIGAG'.gsub(/(?<=#{preceeding})(.)/, &:downcase)
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: JSON::ParserError:A JSON text must at least contain two octets!
<havenwood> #=> "OMGWTFBBQLOLcOPTERLOLlIGAG"
John_Ivan has quit [Ping timeout: 240 seconds]
<havenwood> ruby[bot]: Showing example input and the output you want would be best, if that ^ doesn't make sense for your case?
<havenwood> rapha: ^
* havenwood talks to ruby[bot]
oxfuxxx has quit [Ping timeout: 256 seconds]
John_Ivan__ has joined #ruby
<adam12> havenwood: Happy Friday!
<adam12> I'd love to figure out why ruby[bot] won't talk to carc.in anymore.
<adam12> Maybe I'll run my own ruby[bot] on the weekend to look.
John_Ivan__ has quit [Read error: Connection reset by peer]
John_Ivan__ has joined #ruby
John_Ivan_ has quit [Ping timeout: 256 seconds]
fdan has quit [Ping timeout: 256 seconds]
<mooff> ah, ruby[bot] is still bust
<mooff> well, i was wondering about the class/module scope difference between instance_eval(str) and instance_eval(&blk)
ruby[moo] has joined #ruby
<mooff> ] [ instance_eval { class Foo; end }, instance_eval "class Bar; end" ]
<mooff> ] [ instance_eval { class Foo; end }, instance_eval "class Bar; end" ]
<ruby[moo]> Fuck, SyntaxError: (eval):1: syntax error, unexpected string literal, expecting `do' or '{' or '('
<ruby[moo]> ...ass Foo; end }, instance_eval "class Bar; end" ]
<mooff> ] [ instance_eval { class Foo; end }, instance_eval("class Bar; end") ]
<ruby[moo]> Array (2): [nil, nil]
<mooff> ] [ instance_eval { class Foo; end; Foo }, instance_eval("class Bar; end; Bar") ]
<ruby[moo]> Array (2): [OperBot::Foo, #<Class:0x00007fae44fc68a0>::Bar]
<mooff> the former makes constants in the scope of where the eval implementation is defined.. (good)
<mooff> the latter makes constants in the scope of some anonymous class.. (huh??)
<mooff> heh.. please pardon my foul exception reporting :)
<adam12> lol
TomyWork has quit [Remote host closed the connection]
bluedust_ has quit [Remote host closed the connection]
bluedust has joined #ruby
bluedust has quit [Remote host closed the connection]
<mooff> instance_eval with a string goes to this C function:
<mooff> `cat snippet.c`.highlight 'c'
<ruby[moo]> /* string eval under the class/module context */
<ruby[moo]> eval_under(VALUE self, int singleton, VALUE src, VALUE file, int line)
<ruby[moo]> static VALUE
<ruby[moo]> {
<ruby[moo]> rb_cref_t *cref = vm_cref_push(GET_EC(), self, NULL, FALSE, singleton);
<ruby[moo]> SafeStringValue(src);
<ruby[moo]> return eval_string_with_cref(self, src, cref, file, line);
<ruby[moo]> }
<mooff> so i find *why* there's a difference interesting, plus the fact that it's not documented
<mooff> can't find anything about it on Google
<mooff> but i found a solution for my immediate problem
<mooff> which is to use Binding#eval with a binding from the correct class context
<mooff> ] method(:fresh_eval_scope).source.highlight
<ruby[moo]> String (99)
<ruby[moo]> end
<ruby[moo]> binding
<ruby[moo]> private def fresh_eval_scope evt
<ruby[moo]> target, msg = evt.args
<mooff> ] fresh_eval_scope(evt).eval "class HelloWorld; end"; HelloWorld.new
<ruby[moo]> OperBot::HelloWorld: #<OperBot::HelloWorld:0x00007fae44928fe8>
<mooff> woo!
goldfish has joined #ruby
ruby[moo] has quit [Quit: Thanks, rubber duck]
Bounga has quit [Ping timeout: 256 seconds]
<rapha> havenwood: i got very confused when you talked to the bot. apart from that, yes, that's it, but i'm very amazed by your code and will be starting at it for the next 2 to 3 days. thank you! :D
yosafbridge` has quit [Quit: Leaving]
hanzo has quit [Quit: Connection closed for inactivity]
Bounga has joined #ruby
<micah> adam12: i tried with a newer bundler, and same results :()
<adam12> micah: Maybe worth raising a bug report on rubygems repo. I'd see if you could install nokogiri with similar results.
<Vaevictus> can you have two entirely different qrcodes generate the exact same binary data? anyone?
<Vaevictus> error correction aside?
yosafbridge has joined #ruby
teocle has left #ruby [#ruby]
unyu has quit [Quit: WeeChat 3.4]
Bounga has quit [Remote host closed the connection]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
taupiqueur has quit [Quit: taupiqueur]
Bounga has joined #ruby
Bounga has quit [Remote host closed the connection]
Bounga has joined #ruby
ZAJDAN has quit [Ping timeout: 256 seconds]
fredlinhares has quit [Quit: WeeChat 3.4]
_ht has quit [Remote host closed the connection]
<havenwood> Vaevictus: Sure, there are a variety of ways, depending on the why?
<havenwood> Vaevictus: You can for example use a single format but vary things like shape, color, and size. Or vary formats.
<havenwood> Shapes within the QR code, I mean.
constxd has quit [Ping timeout: 240 seconds]
John_Ivan__ has quit [Quit: Leaving]
ZAJDAN has joined #ruby
gproto23 has joined #ruby
duds- has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
ur5us has joined #ruby
BSaboia has joined #ruby
BSaboia has quit [Remote host closed the connection]
duds-_ has joined #ruby
duds- has quit [Ping timeout: 276 seconds]
duds-_ is now known as duds-
ur5us has quit [Ping timeout: 240 seconds]
Guest9014 has joined #ruby
sagax has joined #ruby
rottame has joined #ruby
gproto23 has quit [Ping timeout: 240 seconds]
work has joined #ruby