patr0clus has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
Vingador has joined #ruby
patr0clus has joined #ruby
pwnd_ has quit [Quit: Ping timeout (120 seconds)]
pwnd_ has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
venue has joined #ruby
<LACampbell>
TIL that a method was an object that had a to_proc method
<LACampbell>
no that's not right
<LACampbell>
a symbol has a to_proc method
<LACampbell>
is it at all possible to convert `SomeObject.someMethod` to a proc?
jenrzzz has joined #ruby
venue has quit [Quit: venue]
neshpion has quit [Quit: neshpion]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 265 seconds]
duderonomy has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
duderonomy has joined #ruby
dinfuehr has quit [Ping timeout: 252 seconds]
m27frogy has quit [Ping timeout: 252 seconds]
dinfuehr has joined #ruby
ur5us has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
ChmEarl has quit [Quit: Leaving]
Technodrome has joined #ruby
crankharder has joined #ruby
<LACampbell>
oh there's a .method for that, nice
jenrzzz has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
ImARealDoctor has joined #ruby
<ImARealDoctor>
Would somebody mind generating a fresh Rails 6.1.3.1 app, install Webpacker 6.0.0.pre.2, and see if a simple `console.log` works out of the box?
<ImARealDoctor>
I just need to confirm that it's me and not Rails/Webpacker themselves there's something wrong with.
explorier has quit [Remote host closed the connection]
niv has quit [Read error: Connection reset by peer]
Xiti has quit [Quit: Leaving]
explorier has joined #ruby
explorier has quit [Ping timeout: 268 seconds]
Xiti has joined #ruby
crankharder has joined #ruby
nixue has quit [Quit: Connection closed]
crankharder has quit [Ping timeout: 252 seconds]
niv has joined #ruby
jenrzzz has quit [Remote host closed the connection]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
lockweel has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
thewrinklyninja has joined #ruby
ljarvis has quit [Quit: Lost terminal]
MalkbabY has quit [Remote host closed the connection]
hiroaki has joined #ruby
MalkbabY has joined #ruby
akem has quit [Ping timeout: 265 seconds]
Rounin has joined #ruby
akem has joined #ruby
keden has joined #ruby
gearnode has joined #ruby
TomyWork has joined #ruby
jla has joined #ruby
thewrinklyninja has quit [Quit: Leaving]
hiroaki1 has quit [Ping timeout: 258 seconds]
gix- has quit [Ping timeout: 252 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has joined #ruby
<keden>
Hello! I'd like to know what people think about net/http vs Faraday vs HTTParty for an API wrapper gem. I'm tempted to go with net/http to have very few dependencies, but do you think this would be a mistake?
crankharder has quit [Ping timeout: 260 seconds]
Technodrome has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 246 seconds]
postmodern has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
al2o3-cr has joined #ruby
* nakilon
started building own wrapper before all those fancy gems became popular -- in 2014, and uses it since then
<nakilon>
the only downside you'll have is that it won't be as optimized for modern HTTP standards as some popular gems, like the number of network connections, etc.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has joined #ruby
NL3limin4t0r_ark is now known as NL3limin4t0r
crankharder has joined #ruby
crankharder has quit [Ping timeout: 260 seconds]
Technodrome has joined #ruby
TCZ has joined #ruby
^jud has joined #ruby
jud^ has quit [Ping timeout: 268 seconds]
^jud has quit [Client Quit]
<NL3limin4t0r>
ImARealDoctor: It works fine for me. I created a Rails 6.1.3.1 app, updated webpacker to 6.0.0.pre.2. Added `console.log("Hello World!")` in app/javascript/packs/application.rb, added the route `root to: 'dashboard#home'`, created the app/controllers/dashboard_controller.rb controller with an empty #home method and added an empty app/views/dashboard/home.html.erb view.
<NL3limin4t0r>
Note that the default home screen "Yay! You're on Rails!" does not use the application layout and therefor does not load your application pack.
<TCZ>
yay
m27frogy has joined #ruby
<NL3limin4t0r>
ImARealDoctor: Ah, I hadn't seen you also posted the question in #RubyOnRails, let's move the conversation there if you want to respond.
akem_ has quit [Ping timeout: 240 seconds]
<nakilon>
few days ago someone said he wants Array#split
<nakilon>
I think that's kinda what Array#chunk is doing
BSaboia has joined #ruby
wallacer has quit [Ping timeout: 250 seconds]
LtHummus has quit [Ping timeout: 260 seconds]
akem has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
<nakilon>
hmmmm, I don't like that String#delete_prefix does not mutate the string
<nakilon>
it's inconsistent with Array#delete
BSaboia has joined #ruby
crankharder has joined #ruby
Jonopoly has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
MalkbabY has quit [Remote host closed the connection]
jla has quit [Ping timeout: 252 seconds]
MalkbabY has joined #ruby
wallacer has joined #ruby
crankharder has quit [Ping timeout: 268 seconds]
crankharder has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
LtHummus has joined #ruby
cd has quit [Quit: cd]
konsolebox has joined #ruby
TCZ has quit [Quit: Czesc]
BTRE has quit [Remote host closed the connection]
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
Jonopoly has quit [Quit: WeeChat 3.0.1]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has quit [Ping timeout: 252 seconds]
crankharder has joined #ruby
akem has quit [Ping timeout: 268 seconds]
akem has joined #ruby
crankharder has quit [Ping timeout: 268 seconds]
TCZ has joined #ruby
ChmEarl has joined #ruby
crankharder has joined #ruby
Rudd0 has quit [Read error: Connection reset by peer]
jimms has joined #ruby
BTRE has joined #ruby
feminine has quit [Quit: Reconnecting]
akem has quit [Quit: leaving]
brigitte has joined #ruby
aloy has quit [Ping timeout: 240 seconds]
akem has joined #ruby
<nakilon>
&. is cancer
<rubydoc>
nakilon: parser error ["Expected \">>\", but got ", ". "@0] at position 0 around `.'
<nakilon>
see? even bot got problems
Mrgoose has quit [Ping timeout: 260 seconds]
<nakilon>
it's one of a penty of bad influences that Ruby has got from Web; basically Web is built in the way to pretend it's working; it's in the core of Web -- to show an end user anything just to keep him on the webpage even if data on it is invalid
brigitte is now known as aloy
<nakilon>
like here the forum has a bug -- it does not close the <i> tag, but the browsers are built in the way to supress this error: https://i.imgur.com/YnNv57y.png
<nakilon>
and the &. method introduced in Ruby 2.3 is aiming the same goal -- hide the errors, supress them, and don't give a damn
konsolebox has quit [Ping timeout: 268 seconds]
<havenwood>
nakilon: You sound like an XHTML evangelist. :P
<havenwood>
If the web's problem was just nils, that's a lovely thought.
<havenwood>
More came from Scala. ;P
<nakilon>
if I have a problem (and lots of people who did the same a few times in their life) parsing the website because the "closing tag" problem was supressed in browsers, imagine how many bugs are hidden in any Ruby code that is written using the &.
<havenwood>
I'm not knocking XHTML. I validate for fun.
<havenwood>
I was kinda sad the web didn't tighten up a bit.
<havenwood>
The HTML path works fine, but inconsistencies are still a pain.
<keden>
nakilon: yeah that's one of my concerns, but then I saw that Twilio and Stripe are just using 'net/http' for instance, which kinda comforted me in my preference.
<keden>
?keden
<ruby[bot]>
keden: I don't know anything about keden
<keden>
meh, sorry
<nakilon>
?havenwood
<ruby[bot]>
nakilon: I don't know anything about havenwood
<havenwood>
I think "havenwood" is an old folks' home down by the lake.
<adam12>
O_O
<havenwood>
Sounds like a retirement home name.
<nakilon>
automatic closing tags fix is a problem close to be unsolvable -- I'll have to copypaste the bug into my parser to just support parsing this single page
<nakilon>
or edit the page in crawling cache manually that is nearly the same stupid
<havenwood>
keden: Net::HTTP gets a bit shinier with the new scheduler and Async making concurrency easy. Things using libcurl like Typhoeus almost seem more conservative.
cliluw has quit [Ping timeout: 252 seconds]
Technodrome has joined #ruby
<adam12>
Although I do enjoy a healthy ecosystem, seeing a half-dozen HTTP libraries in a Gemfile.lock does induce some sadness.
<adam12>
havenwood: Reminds me of one of those short-lived TV shows that has all the cliche moments. Borderline Hallmark.
<nakilon>
adam12 replace them with a single own one )
<adam12>
nakilon: Hard when it’s dependencies of dependencies. For a while, everyone just standardized on Faraday which was nice.
konsolebox has joined #ruby
<havenwood>
adam12: Tonight, on "havenwood," Laura protects the farm from invading badgers.
* adam12
chuckles
<nakilon>
IIRC faraday had compilation error
<nakilon>
s
<keden>
I think I'll simply go with Net::HTTP and see how I get on.
<adam12>
keden: Faraday by default wraps Net::HTTP, but also offers other adapters.
<nakilon>
keden which HTTP methods do you need? if only GET you might use open-uri
<adam12>
keden: Nothing wrong with going with Net:HTTP tho. I’m fairly sure Stripe’s Ruby SDK started with Faraday and then went back to plain Net::HTTP.
<FetidToot>
+1 for faraday. i only use net:http when i'm building a script or something for others where i don't want them to have to deal with dependencies.
akem has quit [Quit: bbl]
<havenwood>
httpx is a nifty one
<havenwood>
keden: Square uses Faraday too. It can be nice for SDKs to help align on whatever adapter folk want to use.
<MalkbabY>
Matz should announce the sale of Ruby to Microsoft next year :P
<MalkbabY>
That might hit a bit too close to home though, lol
<keden>
havenwood: Thanks a lot for sharing, that's super helpful. HTTPX does sound good actually, but then if I do go for a dependency, I might as well use Faraday.
Nowaker has quit [Quit: No Ping reply in 180 seconds.]
Nowaker has joined #ruby
wallacer has joined #ruby
ua has joined #ruby
deviantfero has joined #ruby
deviantfero has quit [Client Quit]
robotmay has quit [Quit: Be excellent to each other]
<Rounin>
R.Net as I like to call it
Nowaker has quit [Remote host closed the connection]
robotmay has joined #ruby
Nowaker has joined #ruby
<MalkbabY>
R.NET, the new official programming language of the Clippers, GitHub and Pepsi.
<Rounin>
Hmm... Microsoft as a leading open source company... The cognitive dissonance hasn't quite worn off
<AndreYuhai>
I mean self.user_agent_alias = ... Otherwise user_agent doesn't change
shortdudey123 has joined #ruby
shortdudey123 has quit [Excess Flood]
<NL3limin4t0r>
AndreYuhai: Without `self` you create a local variable `user_agent_alias`, with `self` you call the `user_agent_alias=` method on the current instance.
<AndreYuhai>
NL3limin4t0r, Ooooh, I always do that. Now I remember
<AndreYuhai>
Thank you for reminding me that. I just have the idea of the methods like user_agent_alias= so I expect them to work without self as well but of course I forget that I am creating a variable without the self. :D
<NL3limin4t0r>
It's basically ambiguous syntax so the smalles scope is used.
CrazyEddy has joined #ruby
<AndreYuhai>
Alright, thank you so much. I will probably forget that and ask it again as well. :D Because I just remembered after your answer that I'd already asked something similar before. :D
<phaul>
this use case of self is probably what
<phaul>
's motivated the self allowed to receive private method change
<NL3limin4t0r>
You could also do it without self.
<NL3limin4t0r>
But it isn't pretty
<NL3limin4t0r>
If you use parentheses Ruby knows it's a method and implicitly calls it upon self.
MalkbabY has quit [Remote host closed the connection]
<NL3limin4t0r>
But there can't be any spaces around the `=` there, otherwise it's a variable assignment again.
shortdudey123 has quit [Excess Flood]
<NL3limin4t0r>
But I'm not entirely sure
MalkbabY has joined #ruby
<AndreYuhai>
NL3limin4t0r, That doesn't seem to work
<AndreYuhai>
phaul, I didn't get what you mean, sorry.
<NL3limin4t0r>
K, never mind that than.
<phaul>
I pointed out something not quite relevant here, so don't worry about it too much
<NL3limin4t0r>
you can use it to differntiate between a read from local variables or method, but guess not for assignment
<phaul>
if foo was a private method on self, self.foo used to fail - now it's allowed
<phaul>
so you don't have the issue with private attr_writers
<NL3limin4t0r>
say you have a variable `foo` and a private method `foo` you can still distinguish them using `foo` and `foo()` but `self.foo` is more descriptive imo
shortdudey123 has joined #ruby
al2o3-cr has quit [Read error: Connection reset by peer]
<phaul>
right, emphasis was on this motivated the change, not that it's the only way of doing it
<AndreYuhai>
phaul, so if you use self.foo is ok but if you try to use it from an instance then you get the error
<havenwood>
AndreYuhai: So `@foo = 42` instead of `self.foo = 42`.
<havenwood>
It's faster and conveys the simplicity of the operation to the reader.
shortdudey123 has quit [Ping timeout: 268 seconds]
<havenwood>
A `@foo = 42` cannot do other things. A `self.foo = 42` does gods know what.
<havenwood>
It might not even set @foo.
explorier has joined #ruby
<AndreYuhai>
havenwood, But I am inheriting from Mechanize, so how can I do that in this case?
<NL3limin4t0r>
phaul: `private attr_writer :w` does not work like you expect. `attr_writer` returns `nil`. So you first create a public attribute writer with `attr_writer :w` this returns `nil` which you pass to `private`, so `private nil`
<NL3limin4t0r>
you'll have to do that in two statements
<phaul>
yeah, and I also was wrong about the change, I misremembered it
<havenwood>
AndreYuhai: Sec, lemme look at mechanize and see what the method does. I may have assumed incorreclty.
<NL3limin4t0r>
`attr_writer :w` then `private :w=`
<havenwood>
AndreYuhai: I didn't scroll back far enough initially.
<rubydoc>
# => -e:4:in `<main>': private method `private' called for #<Class:#<Object:0x00000000e4e468>> (NoMethodError)... check link for more (https://carc.in/#/r/apqh)
<havenwood>
AndreYuhai: Yup.
<NL3limin4t0r>
phaul: ^ that is what you are looking for I guess
<havenwood>
AndreYuhai: Now more direct and faster. :)
<havenwood>
Any time!
<AndreYuhai>
Yes, that looks better.
<havenwood>
Downside would be that you could say this is a private interface. More clear to do it in your own code. This is probably fairly stable anyways.
<havenwood>
When you open a class, it becomes your own code. :P
<jla>
say i'm on rvm ... ruby 2.7.2 and did ^^ '$ gem install decidim' as per docs ...
NL3limin4t0r is now known as NL3limin4t0r_afk
<jla>
now i realize that i may have switched to (currently already available on my system) ruby 3.0 ... does it metter if i switch ruby versions before or afeter the given Gem install ?
<phaul>
yeah, depending on the task at hand, it might be better not to inherit from Mechanize in the first place. If one wants to extend the functionality one could have a Mechanize instance internally and delegate methods to it. That way it's only the public API that 's been used
<havenwood>
jla: The gem would only be available in Ruby 2.7.
<havenwood>
jla: You can install it for both Rubies if you'd like.
<jla>
ah ... i have both
Tempesta has joined #ruby
<jla>
yet, i've seen that i may have switched to v3.0 prio to ... ok, i see
<havenwood>
jla: You can install for all Rubies: rvm all do gem install decidim
<jla>
ah
<havenwood>
jla: Or pick those you'd like: rvm 2.7.2,3.0.0 do gem install decidim
<jla>
they are hundreds of ...
<havenwood>
jla: All the Rubies you have installed...
<jla>
nice to know
<havenwood>
Not all possible Rubies.
<nakilon>
has anyone deployed to Google Cloud Functions?
<AndreYuhai>
So is it better to have a Mechanize instance instead of inheriting?
<havenwood>
AndreYuhai: Yes, generally.
<phaul>
If you don't own the code you shouldn't really inherit from it
<AndreYuhai>
Usually I was creating an instance but then inheriting feels like easier.
<AndreYuhai>
phaul, oh alright, I will keep that in mind and try to use an instance now.
robotbee has quit [Ping timeout: 265 seconds]
<nakilon>
I would suppose it's because the us.gcr.io/fn-img/buildpacks/ruby26/builder:ruby26_20210322_2_6_6_RC00 does not have git installed but I'm not sure the error message means exactly that
explorier has joined #ruby
banisterfiend has quit [Changing host]
banisterfiend has joined #ruby
crankharder has joined #ruby
explorier has quit [Ping timeout: 246 seconds]
crankharder has quit [Ping timeout: 265 seconds]
deviantfero has quit [Quit: WeeChat 3.1]
explorier has joined #ruby
explorier has quit [Ping timeout: 240 seconds]
<nakilon>
I ran "bundle install --deployment", "mv vendor/bundle/ruby/2.5.0/bundler/gems/damerau-levenshtein-c009e42913bc/ ./", changed "github" to "path" in Gemfile -- hope it will work now
<nakilon>
FFFUUUU: LoadError: libruby.so.2.5: cannot open shared object file: No such file or directory - /workspace/damerau-levenshtein-c009e42913bc/lib/damerau-levenshtein/damerau_levenshtein.so
explorier has joined #ruby
explorier has quit [Ping timeout: 240 seconds]
shortdudey123 has joined #ruby
explorier has joined #ruby
ur5us has joined #ruby
crankharder has joined #ruby
shortdudey123 has quit [Ping timeout: 268 seconds]
crankharder has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthu| has joined #ruby
lockwell has joined #ruby
jla has quit [Ping timeout: 265 seconds]
cthulchu has quit [Ping timeout: 240 seconds]
MalkbabY_ has joined #ruby
lockweel has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 258 seconds]
cthulchu_ has joined #ruby
genpaku has quit [Ping timeout: 246 seconds]
lockwell has quit [Client Quit]
genpaku has joined #ruby
lockweel has joined #ruby
MalkbabY has quit [Ping timeout: 240 seconds]
cthu| has quit [Ping timeout: 260 seconds]
lockweel has quit [Client Quit]
Mia has quit [Write error: Connection reset by peer]
<nakilon>
ok, guy from Google responded quickly, though it does not look there is a solution
<nakilon>
they didn't test it on Gemfiles with :github
Mia has joined #ruby
Mia has joined #ruby
alexherbo2 has joined #ruby
alexherbo2 has quit [Remote host closed the connection]
cliluw has joined #ruby
explorier has quit [Ping timeout: 240 seconds]
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
explorier has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
<nakilon>
okay, I decided I don't actually need to deploy the github fork and rubygems version is fine; the Function works, yay! runs out of 256MB of RAM though, needs some optimization (
Technodrome has joined #ruby
robotbee has joined #ruby
patr0clus has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]