jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
jl- has joined #ruby
adam12 has quit [Quit: Ping timeout (120 seconds)]
adam12 has joined #ruby
jl- has quit [Ping timeout: 276 seconds]
jpn has quit [Ping timeout: 276 seconds]
John_Ivan has quit [Remote host closed the connection]
John_Ivan has joined #ruby
wand has quit [Remote host closed the connection]
wand has joined #ruby
Na_Klar has quit [Quit: https://quassel-irc.org - Komfortabler Chat. Überall.]
markong has quit [Ping timeout: 276 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
sd722 has joined #ruby
sd722 has quit [Quit: Leaving]
Rounin has quit [Ping timeout: 255 seconds]
maroloccio has quit [Ping timeout: 276 seconds]
maroloccio has joined #ruby
maroloccio has quit [Client Quit]
libsys has quit [Remote host closed the connection]
libsys has joined #ruby
jpn has joined #ruby
Ziyan has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 244 seconds]
Sankalp has quit [Ping timeout: 256 seconds]
Sankalp has joined #ruby
jl- has joined #ruby
<havenwood> >> "€".bytes.map(&:chr)
<ruby[bot]> havenwood: # => (https://carc.in/#/r/df5y)
<havenwood> # => ["\xE2", "\x82", "\xAC"]
<havenwood> >> "€".unpack1 'H*'
<ruby[bot]> havenwood: # => (https://carc.in/#/r/df5z)
<havenwood> # => "e282ac"
jl- has quit [Ping timeout: 255 seconds]
<havenwood> "€".bytes.reduce('') { _1 + _2.chr } #=> "\xE2\x82\xAC"
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
Ziyan_ has quit [Ping timeout: 244 seconds]
Ziyan has joined #ruby
swaggboi has quit [Read error: Connection timed out]
sphex_ has quit [Ping timeout: 244 seconds]
sphex has joined #ruby
swaggboi has joined #ruby
Ziyan has quit [Ping timeout: 244 seconds]
Ziyan has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
Linux_Kerio has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 260 seconds]
ccooke has quit [*.net *.split]
leah2 has quit [*.net *.split]
fcser has quit [*.net *.split]
dostoyevsky2 has quit [*.net *.split]
IsoLinCHiP has quit [*.net *.split]
mahler has quit [*.net *.split]
phryk has quit [*.net *.split]
darabiesvampire has quit [*.net *.split]
tonytony1an has quit [*.net *.split]
dostoyevsky2 has joined #ruby
fcser has joined #ruby
darabiesvampire has joined #ruby
tonytonyjan has joined #ruby
IsoLinCHiP has joined #ruby
leah2 has joined #ruby
phryk has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
ccooke has joined #ruby
rvalue has joined #ruby
hasley has joined #ruby
jposer has quit [*.net *.split]
eam has quit [*.net *.split]
ruby-eval has quit [*.net *.split]
joenoon has quit [*.net *.split]
rubin55 has quit [*.net *.split]
Fridtjof has quit [*.net *.split]
JSharp has quit [*.net *.split]
coffeejunk has quit [*.net *.split]
Jordan has quit [*.net *.split]
bhaak has quit [*.net *.split]
hololeap has quit [*.net *.split]
dorian has quit [*.net *.split]
eof has quit [*.net *.split]
NightMonkey has quit [*.net *.split]
_root has quit [*.net *.split]
eam has joined #ruby
bhaak has joined #ruby
summerisle has joined #ruby
dorian has joined #ruby
Jordan has joined #ruby
joenoon has joined #ruby
_root has joined #ruby
rubin55 has joined #ruby
JSharp has joined #ruby
ruby-eval has joined #ruby
coffeejunk has joined #ruby
jposer has joined #ruby
Ziyan has quit [Ping timeout: 264 seconds]
NightMonkey has joined #ruby
hololeap has joined #ruby
Fridtjof has joined #ruby
Ziyan has joined #ruby
teclator has joined #ruby
swaggboi has quit [Read error: Connection timed out]
swaggboi has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
polishdub has quit [Ping timeout: 272 seconds]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Ziyan has quit [Ping timeout: 260 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
teclator has joined #ruby
polishdub has joined #ruby
Ziyan has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 240 seconds]
rvalue- has quit [Remote host closed the connection]
rvalue has joined #ruby
roshanavand has joined #ruby
dionysus69 has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
leah2 has quit [Quit: trotz alledem!]
leah2 has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
Ziyan has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
jpn has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 244 seconds]
ollysmith has quit [Quit: ZNC 1.8.2+deb2+b5 - https://znc.in]
ollysmith has joined #ruby
bastienleonard has joined #ruby
gproto23 has joined #ruby
jpn has quit [Ping timeout: 272 seconds]
jpn has joined #ruby
Ziyan has quit [Ping timeout: 276 seconds]
Ziyan has joined #ruby
Rounin has joined #ruby
moldorcoder7_ has quit [Ping timeout: 240 seconds]
libsys has quit [Ping timeout: 276 seconds]
libsys has joined #ruby
jl- has joined #ruby
dionysus69 has quit [Ping timeout: 255 seconds]
jl- has quit [Ping timeout: 260 seconds]
Ziyan has quit [Ping timeout: 260 seconds]
Ziyan has joined #ruby
dionysus69 has joined #ruby
roshanavand has joined #ruby
Ziyan has quit [Ping timeout: 272 seconds]
Ziyan has joined #ruby
jpn has quit [Ping timeout: 272 seconds]
jpn has joined #ruby
roshanavand has quit [Ping timeout: 255 seconds]
Ziyan has quit [Ping timeout: 244 seconds]
Ziyan_ has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
jpn has joined #ruby
<depesz> Hi. I need to create http service that will respond to one specific request, basically getting data from request, passing to some underlying library, and outputting what the library returns. that's all. 1 request, nothing else. rails seem like an overkill. can you suggest what to use/how to do it?
jpn has quit [Ping timeout: 272 seconds]
<depesz> i tried to use sinatra, but I can't find any way to disable logging, or how to make it fork to background. plus, sinatra seems to be dead. and I'm almost sure that it's overkill anyway.
<ox1eef> depesz: roda is popular these days. https://github.com/ch1c0t/hobby looks interesting and light, found courtesy of adam12 - besides that, a simple rack app might do.
<depesz> "rack" seems like the underlying thing. and given that my "handler" method is simple: SomeClass.new.process(request[param]).to_json - i think it will be the best thing to do.
<depesz> need to read more on it.
jpn has joined #ruby
<ox1eef> it is essentially a class that implements a #call method, receives a single argument by the name 'env', and returns a 3-element array: [status_code, headers(Hash), response_body] - response_body must implement #each. that's going from memory, and there might have been recent variations as of late.
markong has joined #ruby
jpn has quit [Ping timeout: 272 seconds]
roshanavand has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
Ziyan_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jl- has joined #ruby
jpn has joined #ruby
jl- has quit [Ping timeout: 272 seconds]
roshanavand has quit [Ping timeout: 272 seconds]
jpn has quit [Ping timeout: 272 seconds]
<adam12> ox1eef: Indeed, it did look interesting.
<adam12> ox1eef: I used Sinatra a few weeks ago for a client because I didn't want to introduce the Roda routing tree to them. I forgot how enjoyable Sinatra is.
Ziyan has joined #ruby
<ox1eef> cool :)
Sankalp has quit [Ping timeout: 240 seconds]
<adam12> I do wish Sinatra cribbed a few things from other places tho, like built-in Flash. And a nicer way to do named routes (like Flask has).
<ox1eef> my impression of sinatra is that it is in maintainence mode, with not much innovation going on.
jpn has joined #ruby
Sankalp has joined #ruby
<adam12> Hobby is very close to Hobbit
<adam12> which I contributed to wayyy back in like 2014.
<ox1eef> hobby takes an approach i like, which is class-based and a light stack.
<adam12> I wonder if that's coincidence.
<adam12> I wonder what something like this would look like, but with a Thor-ish API
<adam12> route("/foobar"); def foobar(request, response); end.
<adam12> Where you define the routes using decorators.
<adam12> Everyone seems to use class methods for verbs.
<ox1eef> i'd like to see the DSL *just* for the router, then map to methods. ime the DSL style can turn into spagetti too easily.
<adam12> I'm using hanami-router in gemdocs.org and it's been enjoyable to have SRP classes and a routes file again.
<ox1eef> i like the route idea, that's what i have in mind.
<adam12> Only downside of Hobby (and Hobbit, by extension) that I can see is the naive regex routing implementation.
<adam12> Sinatra ofc adopted Mustermann, and Hanami Router uses a Trie of some sort.
<adam12> Probably OK for small subset of routes but larger applications would suffer I bet.
jpn has quit [Ping timeout: 268 seconds]
<ox1eef> indeed, but i like the concept - turning any old class into a rack app is a nice idea. i would just expand on it by removing the DSL, and using that for mapping routes only.
<adam12> Indeed.
<adam12> I'm not sure why, but it seemed incredibly elegant.
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 272 seconds]
<ox1eef> certainly clever
gr33n7007h has quit [Quit: WeeChat 3.5]
Sankalp has quit [Ping timeout: 260 seconds]
<mooff> aren't those words synonymous? ;)
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Sankalp has joined #ruby
<adam12> LOL
jpn has joined #ruby
<ox1eef> that depends. i wouldn't say it is simple, and i think simplicity is elegance in its purest form.
protektwar has quit [Ping timeout: 255 seconds]
Guest26nakilon has joined #ruby
<Guest26nakilon> I want to reraise it with a custom message but looks like not only the args are ignored, the whole method code makes no sense to me
gr33n7007h has joined #ruby
hasley is now known as mahler
Linux_Kerio has quit [Quit: Konversation terminated!]
Linux_Kerio has joined #ruby
roshanavand has joined #ruby
bit4bit has joined #ruby
bit4bit_ has joined #ruby
bit4bit has quit [Ping timeout: 260 seconds]
cocalero has joined #ruby
dionysus69 has quit [Ping timeout: 244 seconds]
moldorcoder7 has joined #ruby
Guest26nakilon has quit [Quit: Client closed]
cocalero has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<depesz> ox1eef: sorry for pinging you, but you mentioned roda, and I can't find any slack/irc/discord about it - do you know how to get "post payload" in roda? i need to receive data sent by: curl -i -XPOST --data-urlencode "$( < test.sql )" http://127.0.0.1:9292 ?
<depesz> or should I just make id --data-urlencode "q=$( < test.sql )" ?
<adam12> depesz: can you get it from r.body?
bit4bit_ has quit [Ping timeout: 260 seconds]
<adam12> depesz: There was an IRC channel for Roda at one point in time, but Jeremy discontinued it when Freenode imploded and everyone moved to Libera. But I believe he opened Github discussions which is pretty good.
<depesz> what is r.body? or, where can I find it documented?
<adam12> depesz: Well, `r` is a `RodaRequest`. But a `RodaRequest` inherits from `Rack::Request`.
<depesz> i don't want to sound difficult, i'm just not sure how I should navigate http://roda.jeremyevans.net/documentation.html
<depesz> :( docs require A LOT of understanding of what is happening to find related docs. this leads to another question - how can I log something from within roda app ? in docs i see "common_logger" plugin, but there is no example on how to actually log something?
<adam12> depesz: Well, common_logger is a logger format that's been around a long time and somewhat standard.
<adam12> depesz: But you don't need to use the common_logger plugin to log things. Just make your own instance of a Logger class (from ruby stdlib) and log to that.
<adam12> depesz: Using a global here (but only for demonstration, you should use a different approach). require "logger"; $logger = Logger.new; $logger.info("Hello world")
<depesz> adam12: but shouldn't there be some kind of logger already available - there are things logged from the app?
<depesz> or am I missing some big thing?
<adam12> depesz: Not necessarily.
<adam12> depesz: For Roda, that's not configured OOB. If you use `rackup`, the development environment middleware has a logger as default, in common logger format.
<depesz> when I run: "rackup" i get some log to stdout. and I'd like to add something there. I probably can jiust puts ...
<adam12> But only for requests. Not for generic log output.
<adam12> You'd have to look at the source, because I don't know off hand, but the rackup logger might be placed in `env`.
<adam12> Which means in your Roda app, you _might_ be able to do env["rack.logger"].info("Hello world")
kaivai has joined #ruby
<adam12> But you'd have to check
<depesz> ok. thanks.
<rapha> y'all
<rapha> i just discovered a disconcerting thing
<rapha> `"مظفَّر".unicode_normalize(:nfc) == "مظفَّر"` is False! Why in the world would it not be true?! (Note: the word was hand-typed by me to make sure I type it as it's commonly typed)
howdoi has joined #ruby
<ox1eef> what language is that?
<ox1eef> if you idle here all the time, i suggest scroll up a bit, we discussed something similar and how you can analyze the bytes such a string is made up of
szkl has joined #ruby
<depesz> ok. another set of questions. sorry, but I'm *VERY* new at this. where can I find information how to configure the app so that it will listen on some other port than default, make pidfile, daemonize, andmove logs from console to some file?
Ziyan_ has quit [Read error: Connection reset by peer]
Ziyan has joined #ruby
Sankalp has quit [Ping timeout: 272 seconds]
<adam12> depesz: This is dependent on the application server you choose. You might be able to get it through rackup, or you could be more specific and use Puma or Unicorn or other application server.
<depesz> so I have currently 4 avaialble: thin, webrick and puma. so I should be looking into these projects docs about configuration?
<depesz> for now it looks to me that webrick, out of the box, behaves (for me) the best.
Sankalp has joined #ruby
<adam12> depesz: You might be able to use Rack::Server directly. http://gemdocs.org/gems/rack/2.2.4/Rack/Server.html
<adam12> Maybe someone else knows, as I don't normally.
<depesz> thanks.
orbyt has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 272 seconds]
jpn has quit [Ping timeout: 240 seconds]
sagax has quit [Remote host closed the connection]
axisys has quit [Remote host closed the connection]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
jpn has joined #ruby
gproto23 has quit [Quit: Leaving]
Ziyan_ has joined #ruby
ur5us has joined #ruby
Ziyan has quit [Ping timeout: 272 seconds]
roshanavand has quit [Ping timeout: 272 seconds]
sagax has joined #ruby
bit4bit has joined #ruby
dionysus69 has joined #ruby
swaggboi has quit [Read error: Connection timed out]
swaggboi has joined #ruby
ur5us has quit [Ping timeout: 272 seconds]
markong has quit [Ping timeout: 276 seconds]
gproto23 has joined #ruby
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jl- has joined #ruby
orbyt has joined #ruby
jl- has quit [Ping timeout: 260 seconds]
Ziyan_ has quit [Read error: Connection reset by peer]
Ziyan has joined #ruby
ur5us has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Ping timeout: 272 seconds]
<kenichi> depesz: recommend using puma, then run `puma --help`, almost all your needs are there
Na_Klar has joined #ruby
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Na_Klar> Why can't I File.open{f.read(1)} from /dev/input/event0 ? It works on /dev/input/mouse0 .. the pseudo files seems not to be any different in regard to rights an owner etc.? .read() works, but I fon't get any data. in shell cat /dev/input/event0 works and shows the raw data of the events ..
<Na_Klar> (error msg is: invalid argument @io_fread Errno EInVAL)
jpn has quit [Ping timeout: 260 seconds]
Na_Klar has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
<constxd> what does that syntax mean
<constxd> oh they left
jpn has joined #ruby
Sankalp has quit [Ping timeout: 276 seconds]
Sankalp has joined #ruby
orbyt has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 272 seconds]
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
jpn has joined #ruby
jl- has joined #ruby
quintasan has quit []
quintasan has joined #ruby
jl- has quit [Ping timeout: 272 seconds]
jpn has quit [Ping timeout: 272 seconds]
SunClonus has joined #ruby
swaggboi has quit [Read error: Connection timed out]
swaggboi has joined #ruby
jpn has joined #ruby
SunClonus has quit []
jpn has quit [Ping timeout: 272 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
swaggboi has quit [Read error: Connection timed out]
swaggboi has joined #ruby
roshanavand has joined #ruby
markong has joined #ruby
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
jpn has joined #ruby
bit4bit has quit [Quit: Leaving]
roshanavand_ has quit [Remote host closed the connection]
gr33n7007h has quit [Ping timeout: 276 seconds]
<mooff> the input drivers are particular about read sizes from /dev/input
<mooff> there are good Google results for "dev input einval ruby"
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Linux_Kerio has quit [Quit: Konversation terminated!]
Linux_Kerio has joined #ruby
gproto23 has quit [Remote host closed the connection]
jpn has quit [Ping timeout: 240 seconds]
Linux_Kerio has quit [Ping timeout: 272 seconds]
shokohsc has quit [Read error: Connection reset by peer]
shokohsc has joined #ruby
gr33n7007h has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
havenwood has quit [Read error: Connection reset by peer]
axisys has joined #ruby
FetidToot has quit [Quit: Ping timeout (120 seconds)]
havenwood has joined #ruby
FetidToot has joined #ruby