<eam>
does ruby have anything simliar to perl's source filter? Like a preprocessor?
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
grenierm has quit [Ping timeout: 246 seconds]
<ox1eef_>
I don't think so. Nothing I know of that lets you modify the AST on the fly, which is kind of what Perl is doing ? But there's ruby_parser, ripper, and the option to compile Ruby to byte code.
<ox1eef_>
In theory you could modify any of what those three produce, and produce a new script based on it.
<johnjaye>
hmm how do i print unicode chars
<johnjaye>
i can do puts("\u2665") but I'm not sure how to get there from the number
<eam>
perl's is just a cheap preprocessor hack, nothing as fancy as modifying the AST. It's a gsub in a precompliation block like BEGIN
<johnjaye>
ah ok. well tbh i am learning ruby for personal use and because it looks fun. not sure i want a webdev type job with rails
<ox1eef_>
You have the right idea.
<weaksauc_>
it's a great language and has a few big projects that aren't web
<weaksauc_>
vagrant, chef, puppet, homebrew, etc
<weaksauc_>
metasploit is web adjacent but not really web
<ox1eef_>
Also, keep in mind, rubystyle.guide is not official, and is pedantic to the core. It takes the fun out of Ruby. I truly hate it.
dalan038228 has quit [Quit: dalan038228]
<weaksauc_>
of course it's pedantic that's the purpose
<weaksauc_>
but yeah pick and choose
<ox1eef_>
standard is a more easy going alternative that doesn't micro manage the tiniest details and force it down your throat.
dalan038228 has joined #ruby
yosafbridge has joined #ruby
<johnjaye>
not saying web is bad or anything. it's just not my area rn
<adam12>
Wow. Webmachine. Haven't heard that name in ages.
<johnjaye>
it sounds like a brand of ice cream somehow
<adam12>
I've been doing Ruby fulltime without Rails since ~ 2014.
<adam12>
(Ruby fulltime before that, but WITH Rails)
<johnjaye>
ah ok. how would you compare them. is it similar work environment and project style
<adam12>
Well, if you're not using Rails, you're using Padrino, Sinatra, plain Rack, Roda, Hanami, etc.
<adam12>
Rails definitely "ate the world". Sometimes when I am doing web but _not_ using Rails I feel like I am swimming upstream.
<adam12>
Padrino was out of box batteries included like Rails, but nobody on core team seemed to be using it when I started contributing. I had to move on.
<adam12>
Sinatra has been around forever. Still maintained. Almost zero batteries (vs Rails). Some people joke you end up re-creating a crappy version of Rails in large Sinatra projects... I might be inclined to believe it.
<adam12>
I'd put Rack/Roda/Hobbit/everything else micro in that camp.
<adam12>
Hanami is interesting and I've been contributing/trying to contribute to it. Very big goals. Some choices I don't particularly care for but there's a huge lift to learn some of the pieces.
<johnjaye>
ah i see
<adam12>
I've built a lot of stuff on Roda+Sequel successfully. Lately I've been doing my own "Framework" which is Hanami-Router+Sequel(optional)+some glue code. I like it more than the others, but that is natural for things you build yourself.
<adam12>
Roda's routing tree trips up too many people on teams I've found. And I miss real objects/classes where I can extract method and use traditional Ruby programming techniques.
<johnjaye>
you sound like you appreciate the web frameworks a lot. makes sense
<adam12>
Well, it makes me the money.. so I have no choice. LOL.
<johnjaye>
that's odd... you don't use classes when ruby is inherently object based?
<adam12>
I'd much rather be doing something backend.
<adam12>
Sure, but in Roda, it's basically one giant `if` statement in a single class by default.
<adam12>
You need to go out of your way to break it into smaller classes since it wasn't designed that way.
<johnjaye>
that's surprising. someone told me ruby is the most oo language they know aside from smalltalk
<adam12>
It is.
<adam12>
(at least, I think it is)
<johnjaye>
i mean. even integers are objects. when you're treating integers as the same as classes you know you are far down the rabbit hole
<ox1eef_>
Roda and Sinatra make for good routers, but I'm doubtful about them for web applications. They have a block spaghetti problem.
<johnjaye>
in web frameworks, sometimes they don't use the elegant ruby features?
<adam12>
ox1eef_: I think hanami-router has done the best with this so far. And if you adopt Hanami proper, you get something akin to Action-domain-responder vs "MVC"
<adam12>
I've had a ton of fun with my "framework"
<ox1eef_>
What does hanami do differently ?
<adam12>
I cribbed the plugin feature from Sequel/Roda/Jeremys's book and have been building all functionality in it. Been nice to "home grow" it in a real app and then extract it up to the framework.
<ox1eef_>
Compared to say Rails
<adam12>
ox1eef_: #1 is no monkey patching. Except one tiny one around `.html_safe?`.
<ox1eef_>
Hrm interesting.
<adam12>
ox1eef_: Second one is SRP for controller actions. An action has one public method and it only handles one type of request (vs a Rails controller that handles a bunch of request types around a single domain)
<adam12>
Third, which is huge, is the data layer is essentially ROM
<adam12>
Which is fantastic, but a huge lift for me from Sequel which I've crawled over every last line of code these last few years :P
<adam12>
(and ActiveRecord, which I could personally leave if I had to)
<adam12>
It's a really well done framework.
<adam12>
Oooh, my net-http PR from 2021 is getting some action.
<ox1eef_>
Success :))
<johnjaye>
well, it's a bit interesting. i know nothing of frameworks.
<johnjaye>
so hearing you guys talk about it just goes ove rmy head
<adam12>
johnjaye: I think starting with a framework is nice to keep the bikeshedding to a minimum.
<adam12>
but in reality, my favourite projects have been the ones where each piece is independently upgraded. No large Rails upgrades in my recent lifetime.
<ox1eef_>
That's kind of the problem. No one keeps it simple. All these ideas (especially ROM) are inherently complex.
<adam12>
Yes. That's a huge issue.
<adam12>
You can poke through my "framework" if you want. I think it's fairly approachable, but it's missing lots. And it's not fit for public consumption.
<ox1eef_>
Even if I don't use the tool that's a good pattern.
<adam12>
Yep, exactly.
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
<johnjaye>
this ghq tool is pretty interesting
<johnjaye>
it looks like one of those handy tools you pick up while doing a thing
<adam12>
It's one of those weird things you find in a dotfiles repo years ago and carry it with you
ur5us has joined #ruby
<ox1eef_>
I reorganized my git repos according to that approach, before it was ~/git/<username> where username could be from github, gitlab, etc. Much nicer this way.
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
xmachina has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
Vonter has quit [Ping timeout: 248 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Vonter has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
TomyWork has quit [Quit: Leaving]
_ht has joined #ruby
taupiqueur_shiny has joined #ruby
<miah>
moin
<adam12>
miah: how goes
graywolf has quit [Quit: WeeChat 4.0.4]
<miah>
slowly. my task list is infinite, im working through it. weather is heating up at least. getting cold at night, almost back to 70 though
<adam12>
miah: Are you in the southern hemisphere?
<miah>
im in michigan
<adam12>
Oooh. Yeah, it's been a few cold days hasn't it.
<adam12>
(I'm in Ontario)
<miah>
ya, my weather station says its been getting down to mid 40's at night :/
<adam12>
We had a frost warning for northern Ontario a few days ago. Very untypical _this_ early. I wonder if it's wildfire/smoke related.
<miah>
ya, probably
<joto>
i just edited config/environments/production.rb. Would this change get picked up immediatly on a running web application or do I have to reload something?
<joto>
(rails question btw)
<adam12>
joto: Most of the time those files aren't auto-reloaded, so you'll need to restart server.
<joto>
okay! now I need to look up how to do that on Heroku without blowing away that file haha
<joto>
because they have this ephemeral system
<adam12>
joto: Likely not possible. You shoudl be shipping this change in your repository.
<adam12>
Or use an ENV value to configure it.
<joto>
okay
<adam12>
(depending on your needs)
<adam12>
I think Rails has a more official configuration mechanism than ENV. It's been some time since I worked with it.
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
willfish has quit [Ping timeout: 248 seconds]
otisolsen70 has joined #ruby
gr33n7007h has quit [Read error: Connection reset by peer]
gr33n7007h has joined #ruby
svdasein has joined #ruby
svdasein_ has joined #ruby
willfish has joined #ruby
xmachina has quit [Quit: WeeChat 4.0.4]
xmachina has joined #ruby
szkl has joined #ruby
willfish has quit [Ping timeout: 246 seconds]
constxqt_ has quit [Ping timeout: 248 seconds]
gr33n7007h has quit [Read error: Connection reset by peer]
gr33n7007h has joined #ruby
_ht has quit [Remote host closed the connection]
gr33n7007h has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
infinityfye has quit [Read error: Connection reset by peer]
infinityfye has joined #ruby
roshanavand has quit [Ping timeout: 245 seconds]
roshanavand has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
rvalue has quit [Ping timeout: 258 seconds]
roshanavand has quit [Remote host closed the connection]
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 248 seconds]
desnudopenguino1 is now known as desnudopenguino
ur5us has joined #ruby
kokoro_ has quit [Ping timeout: 246 seconds]
kokoro has joined #ruby
xmachina has quit [Quit: WeeChat 4.0.4]
rvalue has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
teclator has quit [Ping timeout: 250 seconds]
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
crespire has quit [Remote host closed the connection]
duderonomy has joined #ruby
Linux_Kerio has quit [Ping timeout: 248 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
otisolsen70 has quit [Quit: Leaving]
constxqt_ has joined #ruby
kiwi_36 has quit [Remote host closed the connection]
eddof13 has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]