havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.0, 2.5.3, 2.4.5: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
<baweaver> For a small application it probably won't kill you.
<baweaver> For a larger one, a Hash is going to be a nightmare down the road
<baweaver> Primarily around documentation, interface contracts, deprecations, and other such things. A class would be used when you need structure, and structure that you can communicate
<baweaver> Sure, one can use `keys` on a hash, but how do you know what the intent of each of those keys is? If it's just a few, it's probably not a big deal, but as it grows it's easy to lose track of them.
<baweaver> Though it's a notably good idea to question standard practice once in a while, as some things are just cargo culted from days and languages long past
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver> Visceral reactions to questions should force an amount of introspection as to _why_ we make certain decisions
<baweaver> A few other fun topics which start that type of fire real quick: goto, global variables, shorthand globals, english operators, etc etc
<baweaver> That said, it'd be impolite to drop those types of grenades without yourself doing some sort of pre-reading on the topic
<baweaver> Even moreso to assume that the lack of response or improper level of it confirms that they're not a big deal
* baweaver wrote a small blog post again
tdy has quit [Ping timeout: 244 seconds]
<phaul> I can't help but wonder if you meant my response by your last remark. I'm happy to go on with a debate as I stand by my views. I don't really see what was improper about them
blackmesa1 has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
<phaul> I would say we don't know if an encapsulated Hash that you delegate to is or is not the right internal representation, that would depend on whats stored there, and usage patterns. If you can get away with a bunch of instance vars instead ofc you should do that
planigan_ has joined #ruby
<phaul> but I agree with all your points that you made on having a class & dedicated interface
themsay has quit [Ping timeout: 244 seconds]
themsay has joined #ruby
planigan has quit [Ping timeout: 240 seconds]
mat_bug has quit [Ping timeout: 252 seconds]
themsay has quit [Ping timeout: 246 seconds]
themsay has joined #ruby
AJA4350 has joined #ruby
mat_bug has joined #ruby
<baweaver> phaul: Wasn't meant as an indictment
<baweaver> Just as an "It's ok to ask questions"
duderonomy has joined #ruby
<baweaver> I wouldn't characterize any responses here as visceral by any measure
<baweaver> But I have certainly seen them in the past.
sonofentropy has quit [Quit: sonofentropy]
lxsameer has quit [Ping timeout: 250 seconds]
mat_bug has quit [Ping timeout: 252 seconds]
matchaw has quit [Quit: Leaving]
sonofentropy has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
GodFather has quit [Ping timeout: 268 seconds]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4351 is now known as AJA4350
W33DS has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
\void has quit [Quit: So long, and thanks for all the fish.]
W33DS has quit []
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
stryek has quit [Quit: Connection closed for inactivity]
tris has joined #ruby
code_zombie_ has joined #ruby
code_zombie has quit [Ping timeout: 268 seconds]
tdy has joined #ruby
ansraliant has joined #ruby
AJA4351 has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
AJA4350 has quit [Quit: AJA4350]
SeepingN has quit [Ping timeout: 250 seconds]
Cthulu201 has quit [Ping timeout: 240 seconds]
Cthulu201 has joined #ruby
houhoulis has joined #ruby
haxx0r has joined #ruby
_whitelogger has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mat_bug has joined #ruby
dviola has quit [Quit: WeeChat 2.3]
DTZUZO has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 245 seconds]
esrse has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
limezzz has joined #ruby
tdy has joined #ruby
limezzz has quit [Client Quit]
brandoncc has joined #ruby
brandoncc has quit [Client Quit]
mat_bug has quit [Ping timeout: 252 seconds]
mat_bug has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
maryo_ has joined #ruby
tdy has joined #ruby
orbyt_ has joined #ruby
cnsvc has joined #ruby
znz_jp has quit [Ping timeout: 252 seconds]
mat_bug has quit [Ping timeout: 252 seconds]
tdy has quit [Ping timeout: 245 seconds]
znz_jp has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
haxx0r has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
maryo_ has quit [Quit: Leaving]
DTZUZO has joined #ruby
foobear has joined #ruby
foobear has left #ruby [#ruby]
duderonomy has joined #ruby
ixti has quit [Quit: WeeChat 2.3]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
sonofentropy has quit [Quit: sonofentropy]
houhoulis has quit [Remote host closed the connection]
lytol_ has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
sonofentropy has joined #ruby
tdy has joined #ruby
mat_bug has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davidw_ has quit [Ping timeout: 250 seconds]
cnsvc has joined #ruby
orbyt_ has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
jcarl43 has joined #ruby
mat_bug has quit [Ping timeout: 252 seconds]
meinside has joined #ruby
dviola has joined #ruby
dellavg_ has joined #ruby
mat_bug has joined #ruby
akem has quit [Remote host closed the connection]
Milos has quit [Ping timeout: 246 seconds]
akem has joined #ruby
tdy has joined #ruby
govg has joined #ruby
Inline has quit [Quit: Leaving]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
mat_bug has quit [Ping timeout: 252 seconds]
tdy has joined #ruby
dellavg_ has quit [Ping timeout: 268 seconds]
Leifr has joined #ruby
dviola has quit [Quit: WeeChat 2.3]
dinfuehr has quit [Ping timeout: 250 seconds]
Milos has joined #ruby
ravenousmoose has joined #ruby
ravenousmoose is now known as ravenousmoose[aw
dinfuehr has joined #ruby
ravenousmoose[aw has quit [Client Quit]
mat_bug has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
conta has joined #ruby
kapil____ has joined #ruby
govg has quit [Ping timeout: 268 seconds]
mat_bug has quit [Ping timeout: 252 seconds]
GinoMan2440 has quit [Ping timeout: 268 seconds]
GinoMan has joined #ruby
mat_bug has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
mat_bug has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
Nicmavr has joined #ruby
\void has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ruby
aupadhye has joined #ruby
govg has joined #ruby
blackmesa1 has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
jcarl43 has quit [Quit: WeeChat 2.3]
dinfuehr has quit [Ping timeout: 245 seconds]
dinfuehr has joined #ruby
blackmesa1 has quit [Ping timeout: 240 seconds]
clemens3 has joined #ruby
snuz has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
mat_bug has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
ansraliant has quit [Quit: My planet needs me]
nfk has joined #ruby
clemens3 has quit [Ping timeout: 268 seconds]
mat_bug has quit [Remote host closed the connection]
clemens3 has joined #ruby
coderphive has quit [Quit: Ping timeout (120 seconds)]
nowhere_man has joined #ruby
coderphive has joined #ruby
sonofentropy has quit [Quit: sonofentropy]
bruce_lee has joined #ruby
sonofentropy has joined #ruby
akem__ has joined #ruby
mikecmpbll has joined #ruby
akem has quit [Ping timeout: 272 seconds]
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
jammanbo has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
snuz has quit [Quit: WeeChat 2.3]
<ntt> Hello, how can I pass a variable to the match() method? example: str="/myregex$/"; x.match(str)
<ntt> obviously my example doesn't work
code_zombie_ has quit [Quit: Leaving]
mikecmpbll has joined #ruby
<TheBrayn> ntt: ^
<ntt> x is a string in my case
<ntt> and str should be the regex.... probably the name of the variable is not so good
<TheBrayn> don't quote your regexp
<TheBrayn> just do /myregexp$/
<leftylink> &>> ["a".match(/a$/), "a".match("a$"), "will_never_match_a".match("/a$/"), "could_m/a/tch".match("/a/")]
<rubydoc> # => [#<MatchData "a">, #<MatchData "a">, nil, #<MatchData "/a/">] (https://carc.in/#/r/64j6)
<ntt> I need to use a variable to save the regex because the regex is variable
<ellcs> isn't the second solution from ntt the thing you are looking for? :)
<TheBrayn> ntt: do you know how variables in ruby work?
ravenousmoose has joined #ruby
<jammanbo> It sounds like ntt wants to dynamically construct their regex, right?
<ntt> yes
<jammanbo> You can interpolate in Regexs, which may or may not be sufficient.
<jammanbo> e.g. /aaa#{my_var}bbb/
<jammanbo> There are obvious potential issues with that though
<ntt> ok. so I can do rx="a" and then x.match(/#{a}/)
<ntt> ?
<jammanbo> Try it
<ntt> yes. it works
<ntt> thank you
<jammanbo> Also, is there any chance that you are just trying to see if a string ends with another, variable and possibly user supplied, string?
<jammanbo> cos we have the technoology for taht
<jammanbo> Em, can anyone recommend a brilliant XML to Hash/JSON converter? XML is coming from Savon and its/Nori's #to_hash is nearly great, except for it's inconsistent handling of attributes.
<ntt> jammanbo: here is the complete line in my code: myarray.select{|x| x.match(/#{rx}$/)}
<ntt> so basically I'm trying to see if a string ends with another, because each element of the array is a string
cnsvc has quit [Ping timeout: 256 seconds]
<jammanbo> ntt: Will x.end_with?(rx) suffice, or is rx actually a regex (as opposed to a simple string)
ramfjord has joined #ruby
<ntt> no. rx is just a simple string
ramfjord has quit [Read error: Connection reset by peer]
BH23 has joined #ruby
ramfjord has joined #ruby
BLuEGoD has joined #ruby
apparition has joined #ruby
BH23 has quit [Quit: Leaving]
BH23 has joined #ruby
pbandark has joined #ruby
<ntt> jammanbo: thank you
<jammanbo> You are welcome ntt
dhollin3 has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 250 seconds]
keanny479 has joined #ruby
<keanny479> Hi, im learning Ruby, is there a way to rewrite these instance variables ? => https://gist.github.com/wesley974/515ff5488111c60078d0f49fa9ed662d
<tbuehlmann> keanny479: hey! what exactly do you mean, to "rewrite" the instance variables?
<keanny479> avoid 3 lines to declare these instance variables, they share the same source local variable
<keanny479> i just ask if there's a way for a rewrite
kapil____ has quit [Quit: Connection closed for inactivity]
Tuor has joined #ruby
<tbuehlmann> nah, that's fine
tankf33der has left #ruby [#ruby]
<keanny479> Thank's tbuehlmann
nfk has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
<keanny479> Is there a way to rewrite the replace method ? => https://gist.github.com/wesley974/515ff5488111c60078d0f49fa9ed662d
bruce_lee has quit [Ping timeout: 240 seconds]
<keanny479> or perhaps there's a gem that already do keyword replacement in file... ?
ramfjord has quit [Ping timeout: 250 seconds]
Guest16678 has joined #ruby
Emmanuel_Chanel has joined #ruby
nfk has joined #ruby
<leftylink> well, if you have https://en.wikipedia.org/wiki/Sed installed, you could consider using it
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
ravenousmoose is now known as ravenousmoose[aw
ravenousmoose[aw has quit [Quit: Taking a quick nap...ZZzzz]
blackmesa1 has joined #ruby
ramfjord has joined #ruby
KeyJoo has joined #ruby
pbandark has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 244 seconds]
ravenousmoose has joined #ruby
ramfjord has joined #ruby
keanny479 has quit [Ping timeout: 256 seconds]
blackmesa1 has quit [Ping timeout: 252 seconds]
exchgr has quit [Ping timeout: 240 seconds]
ravenousmoose has quit [Ping timeout: 252 seconds]
ravenousmoose has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
blackmesa1 has joined #ruby
blackmesa1 has quit [Ping timeout: 240 seconds]
esrse has quit [Ping timeout: 240 seconds]
blackmesa1 has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
canton7 has quit [Quit: ZNC - http://znc.in]
canton7 has joined #ruby
blackmesa1 has quit [Ping timeout: 240 seconds]
keden has quit [Ping timeout: 246 seconds]
exchgr has joined #ruby
keden has joined #ruby
kapil____ has joined #ruby
AJA4350 has joined #ruby
<jammanbo> Does anyone know of a handy way to munge date formats like DD/MM/CCYY, YYYY-MM-DD, etc. into standard strftime format strings?
ravenousmoose has quit [Ping timeout: 252 seconds]
<phaul> there is a lot of methods on the Date class that could help you. including .parse and #strftime.
apparition has quit [Quit: Bye]
<phaul> &ri Date
<rubydoc> I found 2 entries matching class Date.
<phaul> &list Date
<rubydoc> Date (date), Date (json)
<phaul> &ri Date (date)
ravenousmoose has joined #ruby
leni1 has joined #ruby
cubillosxy_py has joined #ruby
<phaul> maybe I misunderstood the question. Example input / output?
<leni1> Hi. Quick question: is this the right place to ask about `bundler` or does `bundler` fall under Ruby on Rails?
<leni1> Never mind. A quick Google says that it is for Ruby.
<leni1> So my question is: I have a system version of bundler installed but the Gemfile.lock was created with a newer version of Ruby. I tried to install a newer version in the folder I was in and it seemed to succeed.
<leni1> However when I run `bundle install`, it seems that the installer is still using the system wide `bundler`. Is there a way to specify which version of `bundler` I'd like to use or specify that the locally installed bundler (local to my project folder) is the one to be used for installing dependencies?
<jammanbo> phaul: Yeah, it's the actual format strings that are the problem. An external source is providing date strings and associated format strings, for the format strings are not compatible with strptime etc., so they would need to be translated into something that strptime could use to parse the date.
<jammanbo> It's not a hug issue, #to_date will probably work 99% of the time.
<jammanbo> leni1: It's not a direct answer, but using something like rbenv would probably help you now and in the future. I like to supplement that with rbenv-gemset for finer grained control.
<leni1> jammanbo: let me look into that. Thanks
moei has joined #ruby
keden has quit [Ping timeout: 250 seconds]
keden has joined #ruby
matchaw has joined #ruby
leni1 has quit [Quit: Konversation terminated!]
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4350 has joined #ruby
ramfjord has joined #ruby
blackmesa1 has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
_ikke_ has quit [Ping timeout: 252 seconds]
segy has quit [Quit: ZNC - http://znc.in]
blackmesa1 has quit [Ping timeout: 252 seconds]
KeyJoo has quit [Quit: KeyJoo]
segy has joined #ruby
_ikke_ has joined #ruby
naltun has joined #ruby
<naltun> Hey guys. I hope everyone's doing well! I'm getting this error: You don't have write permissions for the /usr/lib/ruby/gems/2.6.0
<naltun> I'm using Arch Linux, and my recent upgrade to 2.6 has apparently broken my gems
<naltun> I can't install gems without SU privileges and then, of course, when running PATHS/privileges/etc. come into effect and I can't run any ruby projects properly
<naltun> I'm trying to use Ruby's FFI for writing Rust + Ruby projects :( Super excited but pretty stumped here
<naltun> Gem home (via bundler env): Gem Home /usr/lib/ruby/gems/2.6.0. Gem Path: /home/naltun/.gem/ruby/2.6.0:/usr/lib/ruby/gems/2.6.0. User Path: /home/naltun/.gem/ruby/2.6.0
conta has quit [Remote host closed the connection]
conta has joined #ruby
aufi has joined #ruby
conta has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
bruce_lee has joined #ruby
Inline has joined #ruby
keden has quit [Ping timeout: 240 seconds]
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
ravenousmoose has joined #ruby
<al2o3-cr> naltun: try setting GEM_HOME=$HOME/.gem
<naltun> will do when I get a chance, thanks al2o3-cr :)
<al2o3-cr> naltun: yeah, np.
aupadhye has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
skryking has joined #ruby
BTRE has quit [Remote host closed the connection]
Rapture has joined #ruby
DTZUZO has joined #ruby
bruce_lee has quit [Ping timeout: 240 seconds]
BTRE has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
polishdub has joined #ruby
Dbugger has joined #ruby
sebuba has joined #ruby
sebuba has quit [Remote host closed the connection]
tdy has joined #ruby
moei has quit [Ping timeout: 268 seconds]
stryek has joined #ruby
skryking has quit [Ping timeout: 246 seconds]
skryking has joined #ruby
<naltun> al2o3-cr, I'm getting the error still. gem env output -> https://gist.github.com/naltun/a0d3993d7d8f34aefffdd98f33dd589d
<naltun> ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/lib/ruby/gems/2.6.0 directory.
Tuor has quit [Quit: Konversation terminated!]
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
dhollin3 is now known as dhollinger
blackmesa1 has joined #ruby
<al2o3-cr> naltun: how did you set GEM_HOME?
<naltun> .zshrc file
<al2o3-cr> naltun: did you export it?
<al2o3-cr> as in `export GEM_HOME=$HOME/.gem'
<naltun> yes
<al2o3-cr> did you restart the shell?
<naltun> Yep
<al2o3-cr> hmm...
<naltun> Ah bollocks I got it
<naltun> I was working in the wrong terminal that didn't have the latest changes
<naltun> Sorry mate lacked a bit of attention-to-detail :P
<al2o3-cr> naltun: ah. no worries.
<naltun> but your original suggestion worked, setting the GEM_HOME variable. Awesome
<al2o3-cr> good good ;)
Fusl has quit [Ping timeout: 256 seconds]
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
Fusl has joined #ruby
havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.1, 2.5.3, 2.4.5: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
blackmesa1 has quit [Ping timeout: 240 seconds]
nowhereman has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
davidw_ has joined #ruby
matchaw_ has joined #ruby
ellcs has quit [Remote host closed the connection]
matchaw_ has quit [Remote host closed the connection]
matchaw_ has joined #ruby
matchaw has quit [Remote host closed the connection]
duderonomy has joined #ruby
matchaw_ is now known as matchaw
matchaw has quit [Quit: Leaving]
AJA4350 has quit [Ping timeout: 268 seconds]
ravenousmoose has joined #ruby
snuz has joined #ruby
conta1 has joined #ruby
<naltun> havenwood, woohoo!
<al2o3-cr> &>> [128077].pack('U')
<rubydoc> # => "\u{1F44D}" (https://carc.in/#/r/64nw)
<al2o3-cr> 👍
nowhereman has joined #ruby
<al2o3-cr> i keep forgetting carc.in in binary :(
aufi has quit [Ping timeout: 246 seconds]
conta1 has quit [Ping timeout: 245 seconds]
<phaul> >> [128077].pack('U')
<al2o3-cr> &>> Encoding.default_external = 'utf-8'; [128077].pack('U')
<rubydoc> # => "👍" (https://carc.in/#/r/64nx)
foxxx0 has quit [Quit: foxxx0]
\void has joined #ruby
foxxx0 has joined #ruby
<al2o3-cr> phaul: that's the nit.
foxxx0_ has joined #ruby
<al2o3-cr> &>> ([128077]*7).pack('U7').b.force_encoding 'utf-8'
<rubydoc> # => "\u{1F44D}\u{1F44D}\u{1F44D}\u{1F44D}\u{1F44D}\u{1F44D}\u{1F44D}" (https://carc.in/#/r/64ny)
foxxx0_ has quit [Read error: Connection timed out]
<al2o3-cr> 7 thumbs ;)
foxxx0_ has joined #ruby
<phaul> ruby_bot came back to life a few weeks back, but seems it was short lived revival
<al2o3-cr> >> ([128077]*7).pack('U7')
<al2o3-cr> hmm..... i think its gone to the knackered yard :(
<al2o3-cr> it's not the bot that's temperamental its eval.in.
<al2o3-cr> but saying that, we're not even getting a response now?
<phaul> well, we are better of with carc.in anyways, as we have jhass in the channel! :)
<naltun> al2o3-cr, are you from Ireland/Britain?
<al2o3-cr> phaul: true ;)
<al2o3-cr> naltun: latter ;)
<naltun> Ahhh, which part?
<naltun> I've been known to be 'Aberdonian' from time to time
<al2o3-cr> naltun: Manchester.
<naltun> Good Northease o' Scotland ;)
<naltun> Northeast**
<naltun> Nice
<al2o3-cr> broughty ferry
<al2o3-cr> crocodile dundee lol ')
<phaul> I've never been further up than Birmingham, spent a few days rambling in the Peaks
<phaul> about 7 years ago :D
<al2o3-cr> phaul: you like to go on adventures?
GodFather has quit [Ping timeout: 272 seconds]
<phaul> you are asking a man who have been non-stop sailing in the poast 3 years
<phaul> so I think I qualify :)
perique has joined #ruby
<al2o3-cr> awesome phaul :)
<al2o3-cr> bit of a daft question that tbh ;)
<al2o3-cr> my dad was that tight, he could peel an orange in his pocket hehe
<phaul> lol
<naltun> phaul, you're a sailer? Ugh mate, that's my dream
<phaul> naltun: it's easy to try first without much commitment
<phaul> google day skipper /competent crew curses first
<naltun> I was in Caernarfon, North Wales a few years ago and met some older gents who just came back from their sailing cert course. 5 days at sea.
<naltun> Aye, the competent crew course
BLuEGoD has quit [Ping timeout: 250 seconds]
<phaul> any RYA approved place
<naltun> RYA course
<naltun> Although I love Scotland, I'd love to take the course in Wales if I can.
<naltun> I follow r/sailing on Reddit. Good place to keep the spark alive
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
jokester has quit [Quit: reboot]
BLuEGoD has joined #ruby
foxxx0_ has quit [Quit: foxxx0_]
<al2o3-cr> david gray's, sail away with me (very good)
galaxie has left #ruby [#ruby]
BLuEGoD has quit [Quit: WeeChat 2.0.1]
ravenousmoose has joined #ruby
foxxx0_ has joined #ruby
ravenousmoose has quit [Ping timeout: 252 seconds]
foxxx0 has quit [Quit: foxxx0]
foxxx0_ is now known as foxxx0
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
jinie_ has quit [Ping timeout: 268 seconds]
perique has quit [Read error: Connection reset by peer]
krawchyk has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
snuz has quit [Quit: WeeChat 2.3]
Nicmavr has quit [Read error: Connection reset by peer]
<baweaver> havenwood: Who do we know that works on Rubocop?
<baweaver> Looking to get rewriter promoted to more of a first-class gem
Nicmavr has joined #ruby
orbyt_ has joined #ruby
cd has quit [Remote host closed the connection]
cd has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> baweaver: Hmm, our own segiddiins or Pan over at Strava, maybe?
<havenwood> baweaver: Maybe koic? He's been committing a lot lately.
lxsameer has joined #ruby
Guest16678 has quit [Ping timeout: 250 seconds]
sonofentropy has quit [Quit: sonofentropy]
sonofentropy has joined #ruby
sonofentropy has quit [Client Quit]
skryking has quit [Ping timeout: 272 seconds]
ryovaa has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.1 - https://znc.in]
skryking has joined #ruby
mikecmpbll has joined #ruby
r29v has joined #ruby
cek has joined #ruby
agent_white has joined #ruby
jammanbo has quit [Ping timeout: 256 seconds]
code_zombie has joined #ruby
<cek> what entry function is executed for a compiled module? When a lib is required, its main file gets evaluated, but what happens in C?
bruce_lee has joined #ruby
<cek> bruce_lee?
<bruce_lee> \(^_^)/ @all
cubillosxy_py has quit [Quit: Lost terminal]
<al2o3-cr> bruce_lee: you still flow like water?
<al2o3-cr> become the tea cup.
<al2o3-cr> *pot.
blackmesa1 has joined #ruby
conta1 has joined #ruby
<ryovaa> flow... or crash
minimal_life has joined #ruby
naltun has quit [Remote host closed the connection]
<al2o3-cr> bruce lee's quotes are the educating.
josh_newbie has joined #ruby
<josh_newbie> hello
cek has left #ruby [#ruby]
<josh_newbie> is it possible in Ruby to write a method that will accept <<END (i wish to append a content to a file using a method) ?
conta1 has quit [Read error: Connection reset by peer]
bruce_lee has quit [Ping timeout: 250 seconds]
jgw has left #ruby [#ruby]
minimal_life has quit [Quit: I am functioning within established parameters.]
bruce_lee has joined #ruby
<bruce_lee> \(^_^)/
<mozzarella> josh_newbie: yes
tdy has quit [Ping timeout: 246 seconds]
blackmesa1 has quit [Ping timeout: 250 seconds]
tdy has joined #ruby
<josh_newbie> mozzarella, thank's, is this the good way to do that => https://gist.github.com/wesley974/614d7473e47e74278db40ef7c0bfc301 ?
ramfjord has quit [Ping timeout: 268 seconds]
<bruce_lee> josh_newbie: looks nice to me, but I'm really not an experienced "programmer"
<josh_newbie> Bruce, i'm a fan of you!
cubillosxy_py has joined #ruby
houhoulis has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
<cubillosxy_py> hi there, i need to decode a jwt encrypted with a public_key, how to do that? pd: i am beginner in ruby
<al2o3-cr> cubillosxy_py: ask havenwood
<bruce_lee> what is "jwt"?
<mozzarella> josh_newbie: what do you mean by "good way"?
<josh_newbie> i mean best practice
<josh_newbie> perhaps theres already a gem for this kind of operation ... ?
<mozzarella> you can put your closing paren on the same line as the opnening one, but I'm not sure that's considered better
<al2o3-cr> josh_newbie: i think there is a gem for this
<havenwood> bruce_lee: It's a little standard for representing signed/encrypted/plain text content over the wire as base64 encoded JSON: https://jwt.io/
<havenwood> oops, responded to the wrong person! sorry josh_newbie
<josh_newbie> havenwood: no problem
<havenwood> cubillosxy_py: There are a few nice Ruby JWT gems. Here's one: https://github.com/jwt/ruby-jwt
<josh_newbie> al2o3-cr: which one ? (gem)
Dreamer3 has joined #ruby
<josh_newbie> al2o3-cr: tty-file ?
<havenwood> cubillosxy_py: You'll just need to check the algorithm, which is in the payload. Ping us if you have trouble.
<al2o3-cr> josh_newbie: you don't need a gem for this. your example is ample ;)
sonofentropy has joined #ruby
<havenwood> josh_newbie: Is there a part of your example you're worried about?
<josh_newbie> thank's everyone!
renich has joined #ruby
<havenwood> josh_newbie: It looks like you already knew this, since you added newlines in your example, but #<< won't add a newline.
<cubillosxy_py> havenwood, ok i am using python for encode with rs256, i encrypt with private key and decrypt with public_key and works in python
<havenwood> josh_newbie: If you want an implicit newline: file.puts content
josh_newbie has quit [Ping timeout: 256 seconds]
<havenwood> cubillosxy_py: The jwt gem should work nicely: JWT.decode token, rsa_public, true, { algorithm: 'RS256' }
<cubillosxy_py> thanks
orbyt_ has joined #ruby
<cubillosxy_py> havenwood, i get this error verify_rsa': undefined method `verify' for #<String:0x0 , https://dpaste.de/Z0an
ravenousmoose has joined #ruby
<havenwood> cubillosxy_py: Hrm, that looks right to me.
<havenwood> cubillosxy_py: An aside, but you can drop the "./" from File.read. I'll try to reproduce when i get a min.
renich has quit [Quit: renich]
<havenwood> cubillosxy_py: Ah, it's expecting `public_key` to be an instance of OpenSSL::PKey::RSA, not a String.
<cubillosxy_py> now eds.rb:13:in `initialize': Neither PUB key nor PRIV key: nested asn1 error (OpenSSL::PKey::RSAError)
laaron has joined #ruby
Azure has quit [Ping timeout: 250 seconds]
<havenwood> cubillosxy_py: Hrm. I can't reproduce from an RS256 created locally: https://gist.github.com/havenwood/90067d0e37353f0e8dc5a0dfc7868952
laaron- has quit [Ping timeout: 256 seconds]
<havenwood> cubillosxy_py: Does that same public_key work to decrypt from Python?
akem__ has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
<havenwood> cubillosxy_py: Does the public_key start with?: -----BEGIN PUBLIC KEY-----\n
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<al2o3-cr> havenwood: probably needs a; OpenSSL::PKey::RSA.new([pub].pack('m0'))
<havenwood> al2o3-cr: Yeah, it'd not surprise me if ti was a der and that'd do the trick.
<havenwood> "-----BEGIN PUBLIC KEY-----\n#{[rsa_public.to_der].pack('m0')}\n-----END PUBLIC KEY-----\n"
<al2o3-cr> havenwood: exactly.
<havenwood> cubillosxy_py: Is your `pub` bytes? If so, see ^
GodFather has joined #ruby
<al2o3-cr> cubillosxy_py: just paste your public key.
<al2o3-cr> i'm mean your private.... joke ;)
skryking has quit [Ping timeout: 244 seconds]
nchambers has joined #ruby
skryking has joined #ruby
Leifr has quit [Ping timeout: 246 seconds]
<al2o3-cr> cubillosxy_py: any progress?
AJA4350 has joined #ruby
davidw_ is now known as davidw
<al2o3-cr> cubillosxy_py: try converting public key to pem.
SeepingN has joined #ruby
reber has joined #ruby
cubillosxy_py has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
donofrio_ has joined #ruby
cnsvc has joined #ruby
donofrio_ has quit [Ping timeout: 240 seconds]
gix has joined #ruby
Dbugger has quit [Remote host closed the connection]
shlomif has joined #ruby
cubillosxy_py has joined #ruby
<cubillosxy_py> havenwood: thanks , that works I need only convert the key.pub to pem
<havenwood> cubillosxy_py: 👍🏽
skryking has quit [Ping timeout: 250 seconds]
matchaw has joined #ruby
cubillosxy_py has quit [Quit: leaving]
skryking has joined #ruby
reber has quit [Remote host closed the connection]
AJA4350 has quit [Ping timeout: 244 seconds]
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
shlomif is now known as rindolf
rindolf has quit [Remote host closed the connection]
zEphiRo has joined #ruby
ramfjord has joined #ruby
millerti has joined #ruby
<al2o3-cr> i'm being followed by a moonshadow, moonshadow, moonshadow.
cthulchu_ has quit [Quit: Leaving]
cthulchu_ has joined #ruby
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 250 seconds]
Xeago_ is now known as Xeago
yoshie902a has joined #ruby
<yoshie902a> Need database design help… 1 to 1 polymorphic vs none. See here.. https://stackoverflow.com/questions/54442282/1-to-1-polymorphic-relationship-vs-none-ruby-on-rails
<al2o3-cr> yoshie902a: tough question. really, you'd get better answers on #rubyonrails
<al2o3-cr> but hang about, you never know.
thebetra1 has quit [Quit: WeeChat 2.3]
<yoshie902a> al2o3-cr: Happy to get answer from any where, but have not been able to get a response from anywhere.
<al2o3-cr> hold tight, it's gonna be a ride then.= ;)
clemens3 has quit [Ping timeout: 244 seconds]
houhoulis has quit [Remote host closed the connection]
ravenousmoose[aw has joined #ruby
ravenousmoose[aw has quit [Client Quit]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<al2o3-cr> &>> class X; def x(i) i.x; end; end; class Y < X; def x; 42 end; end; X.new.x Y.new
<rubydoc> # => 42 (https://carc.in/#/r/64pn)
lukelukeluke has joined #ruby
<al2o3-cr> polymorphism, encapulation ... is not as easy one thinks.
polishdub has quit [Quit: leaving]
<al2o3-cr> encapsulation in ruby is never encapsulation.
<al2o3-cr> i generally hide it in a namespace.
<al2o3-cr> well, that's just not to populate the namespace tbh.
<al2o3-cr> but you get my point.
ellcs has joined #ruby
nchambers has quit [Ping timeout: 246 seconds]
AJA4350 has joined #ruby
<al2o3-cr> build it up from there.
cats has quit [Read error: Connection reset by peer]
nchambers has joined #ruby
houhoulis has joined #ruby
houhoulis has quit [Remote host closed the connection]
ellcs has quit [Ping timeout: 268 seconds]
BH23 has quit [Ping timeout: 268 seconds]
cd has quit [Quit: cd]
dinfuehr has quit [Ping timeout: 272 seconds]
dinfuehr has joined #ruby
yorickpeterse has joined #ruby
moei has joined #ruby
bruce_lee has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zEphiRo has quit [Quit: zEphiRo]
icy` has joined #ruby
zEphiRo has joined #ruby
<icy`> hi, having an issue with server recognizing a file attachment when i do an HTTP Post. Aren't you just supposed to be able to give the file handle as part of the request body? Looks something like this atm https://pastebin.com/VC4Xw5h0 Response i get back is that no file was uploaded. If I add a .read then an error is rescued with something about ASCII to UTF-8 conversion. I can't get rest-client gem
<icy`> cause my ruby is 2.6 and that's too new for unf_ext dependency
raulp has joined #ruby
<icy`> thinking my core issue is just malformed "form data" body. I'll try to follow https://yukimotopress.github.io/http , the section "File Upload - HTML Style" later tonight
<icy`> rest-client probably just adds those missing headers that I needed around the file itself. It does indeed look like the file needs to be read, as in that example and file handle is not enough
yorickpeterse has quit [Quit: WeeChat 2.3]
AJA4350 has quit [Ping timeout: 250 seconds]
akem__ has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
rkazak has joined #ruby
ericboehs has quit [Quit: Textual IRC Client: www.textualapp.com]
ericboehs has joined #ruby