havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: 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!
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
davispuh has joined #ruby
<havenwood> apotheon: I've been enjoying Solargraph with my editor lately, which takes some prodding to get working with gems but it's pretty fun. What excited me is a demo Soutaro gave last week with Steep working alongside Ruby::Signature and an editor.
<havenwood> apotheon: Also exciting that Soutaro opened a PR to merge ruby-signature into Ruby: https://github.com/ruby/ruby/pull/2934
<havenwood> wimp, ah, they left.
orbyt_ has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
roadie has joined #ruby
<kaleido> irb(main):001:0> (62688 / 113233) * 100
<kaleido> => 0
<kaleido> why? :(
jmcgnh has joined #ruby
<phaul> integer arithmetics. 2/3 is 0.
<phaul> &>> 2/3
<rubydoc> # => 0 (https://carc.in/#/r/8pby)
<kaleido> so do i need to convert to something else?
<havenwood> kaleido: Use #fdiv instead of #/ to produce a Float.
<havenwood> kaleido: Or use a trailing `r` notation to produce a Rational.
<phaul> floats prly. or rationals if you want to keep it mathematically precise
<havenwood> &>> 2/3r
<rubydoc> # => (2/3) (https://carc.in/#/r/8pbz)
<kaleido> => 55.36195278761492
<kaleido> irb(main):005:0> (62688.to_f / 113233.to_f) * 100
<kaleido> looks silly but ill take it i guess :)
<havenwood> kaleido: 62688.fdiv(113233) * 100
ianbrown78 has quit [Ping timeout: 255 seconds]
<kaleido> woohoo
<kaleido> thanks :)
<havenwood> kaleido: Or: 62688/113233r * 100
<havenwood> kaleido: np
<havenwood> &>> 62688/113233r * 100
<rubydoc> # => (6268800/113233) (https://carc.in/#/r/8pc0)
ianbrown78 has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
<phaul> kaleido: take away is, floats prly do what you want, but they are always just a many digit approximation. infinite fractions are hard to store
lucasb has quit [Quit: Connection closed for inactivity]
mre- has quit [Ping timeout: 255 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndroidKK has joined #ruby
AndroidKitKat has quit [Ping timeout: 265 seconds]
margeas has quit [Ping timeout: 255 seconds]
nofxx has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
roadie has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
chalkmonster has joined #ruby
duderonomy has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has quit [Ping timeout: 256 seconds]
roadie has quit [Ping timeout: 255 seconds]
<bougyman> has anyone ever seen this type thing used in ruby? https://github.com/nginxinc/nginx-ldap-auth/blob/master/nginx-ldap-auth-daemon.py#L2
ianbrown78 has quit [Ping timeout: 265 seconds]
<bougyman> it's a hack so that the shebang is /bin/sh but because of the way python's ''' string thing works, sh execs the thing as 'whatever python shows up in which'
<bougyman> is there a similar hack for ruby that I just can't figure out?
<bougyman> (other than then using python to exec some ruby)
<bougyman> which would be too many layers of inception for me to handle.
<bougyman> that is, bash execs it with python, then python ignores those two line.
<bougyman> *lines.
postmodern has joined #ruby
wildtrees has quit [Quit: Leaving]
ianbrown78 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ianbrown78 has quit [Ping timeout: 255 seconds]
gix has quit [Ping timeout: 256 seconds]
ianbrown78 has joined #ruby
_whitelogger has joined #ruby
ianbrown78 has quit [Ping timeout: 265 seconds]
ianbrown78 has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Ping timeout: 256 seconds]
ianbrown78 has quit [Ping timeout: 260 seconds]
chalkmonster has joined #ruby
ianbrown78 has joined #ruby
roadie has joined #ruby
<bougyman> can even do `which mawk || which awk` there. Nice!
cnsvc has joined #ruby
szqdsegrhrdgdrg has joined #ruby
<bougyman> found it in awk
<szqdsegrhrdgdrg> hi
<szqdsegrhrdgdrg> How to destroy an object ?
<bougyman> an instance of an object?
<szqdsegrhrdgdrg> an instance of a class
<bougyman> just set all references to nil and when the gc runs it'll go away
<apotheon> havenwood: interesting
<apotheon> havenwood: I'll look up all that stuff.
<szqdsegrhrdgdrg> I have the object "user" I want to completely destroy it
<bougyman> what kind of object is it?
<bougyman> I guess I need to know what you mean by destroy
<bougyman> I assume you mean "remove from ram"
<szqdsegrhrdgdrg> yes
<bougyman> when it's not referenced anymore, it will be garbage collected.
<apotheon> havenwood: This is odd. In the part of the readme referring to editor extensions, it says this under Vim: "GitHub: https://github.com/autozimu/LanguageClient-neovim"
<bougyman> Or you could write a specific destructor (that cleared up all instance vars, etc)
roadie has quit [Ping timeout: 258 seconds]
<apotheon> havenwood: That's for Solargraph, of course.
<bougyman> What's the use-case here, szqdsegrhrdgdrg ?
<apotheon> havenwood: Oh, I guess Ruby::Signature is the type signature stuff. I haven't really looked into it yet, but it sounds interesting.
SeepingN has joined #ruby
ianbrown78 has quit [Ping timeout: 240 seconds]
ianbrown78 has joined #ruby
SuperLag has quit [Ping timeout: 272 seconds]
ianbrown78 has quit [Ping timeout: 265 seconds]
SuperLag has joined #ruby
dmz has quit [Quit: Leaving]
ianbrown78 has joined #ruby
alfiemax has joined #ruby
ianbrown78 has quit [Ping timeout: 255 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
ianbrown78 has joined #ruby
alfiemax has joined #ruby
roadie has joined #ruby
ianbrown78 has quit [Ping timeout: 258 seconds]
ianbrown78 has joined #ruby
sergioro has quit [Quit: leaving]
<leftylink> WHAT!!! This r suffix could have been used by me in so many places!!!!
<leftylink> how can I have not known!!!!!!!!!!!
Swyper has joined #ruby
sergioro has joined #ruby
Buggys has left #ruby [#ruby]
<leftylink> https://bugs.ruby-lang.org/issues/8430 ... apparently it was added in ruby 2.1 and I just never heard about it
<adam12> bougyman: Not exactly your example but you can cheat a bit with __END__ and some regex. https://gist.github.com/0343323253f3e7aeb5b3e21472ef17bf
<leftylink> no wonder I never knew
<leftylink> but better late than never
<leftylink> also compare https://ruby-doc.org/core-2.2.0/Rational.html to https://ruby-doc.org/core-2.3.0/Rational.html, didn't get added there until then
<leftylink> this will help in a few places
<leftylink> thank you for showing me this!!!
<bougyman> adam12: the important part is the #!/bin/sh shebang
<bougyman> adam12: #!/bin/sh
<bougyman> "exec" "`which mawk || which awk`" "-f" "$0" "$@" && 0 {}
<bougyman> like dat ^
<bougyman> this is to handle weird rubies/names/locations.
<adam12> bougyman: Ahh! So you weren't more interested in manipulating env first.
roadie has quit [Ping timeout: 260 seconds]
Milos has quit [Read error: Connection reset by peer]
<bougyman> No.
<bougyman> #!/bin/sh
<bougyman> "exec" "$(which ruby)" "$0" "$@"
<bougyman> puts 'foo'
<bougyman> I tried that, but I get ruby: no Ruby script found in input (LoadError)
<bougyman> but when I echo $0 before that, it's proper.
<bougyman> iono what's wrong.
pupsikov has joined #ruby
<adam12> bougyman: Ruby checks the shebang. If you leave it off (ie. no #!/bin/sh) it does work.
jmcgnh has quit [Read error: Connection reset by peer]
<bougyman> ugh. then it's not portable.
alfiemax has quit [Ping timeout: 258 seconds]
<bougyman> I'm trying to make it portable.
alfiemax has joined #ruby
jmcgnh has joined #ruby
<adam12> bougyman: Not sure what it does to command args but this might work. https://gist.github.com/5aa55f02c9e18f2adf978199210621b1
<bougyman> hahah, I thought of that.
<bougyman> seems to dirty.
<bougyman> *too.
<adam12> bougyman: Totally dirty.
<bougyman> I like the way think though :)
<adam12> bougyman: Gotta bounce. Good luck.
<bougyman> thx
alfiemax has quit [Ping timeout: 240 seconds]
ChmEarl has quit [Quit: Leaving]
howdoi has quit [Quit: Connection closed for inactivity]
braincrash has quit [Quit: bye bye]
roadie has joined #ruby
Swyper has quit [Remote host closed the connection]
braincrash has joined #ruby
donofrio has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 265 seconds]
orbyt_ has joined #ruby
szqdsegrhrdgdrg has quit [Remote host closed the connection]
cnsvc has quit [Ping timeout: 240 seconds]
RougeRR has joined #ruby
RougeR has quit [Read error: Connection reset by peer]
cnsvc has joined #ruby
alfiemax has joined #ruby
roadie has joined #ruby
duderonomy has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
dinfuehr has quit [Ping timeout: 260 seconds]
dinfuehr has joined #ruby
sauvin has joined #ruby
hutch has quit [Ping timeout: 255 seconds]
dinfuehr has quit [Ping timeout: 258 seconds]
dinfuehr has joined #ruby
deam0 has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Milos has joined #ruby
roadie has joined #ruby
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
fanta1 has joined #ruby
cthu| has quit [Ping timeout: 256 seconds]
mozzarella has quit [Ping timeout: 258 seconds]
dinfuehr has quit [Ping timeout: 268 seconds]
dinfuehr has joined #ruby
ianbrown78 has quit [Ping timeout: 255 seconds]
pupsikov has quit [Ping timeout: 256 seconds]
ianbrown78 has joined #ruby
pupsikov has joined #ruby
mozzarella has joined #ruby
ianbrown78 has quit [Ping timeout: 260 seconds]
pupsikov has quit [Client Quit]
postmodern has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 240 seconds]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
fluxAeon has quit [Ping timeout: 255 seconds]
fluxAeon has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.7.1]
roadie has joined #ruby
al2o3-cr has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
ur5us has joined #ruby
spiette has quit [Quit: ZNC 1.7.5 - https://znc.in]
johnny56_ has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
spiette has joined #ruby
Milos has quit [Quit: ZNC 1.7.5 - https://znc.in]
Milos has joined #ruby
sdu has joined #ruby
markopasha has joined #ruby
markopasha has quit [Read error: Connection reset by peer]
Ai9zO5AP has quit [Quit: WeeChat 2.7.1]
fercell has joined #ruby
roadie has quit [Ping timeout: 265 seconds]
pyrmont has quit [Quit: Disconnecting...]
pyrmont has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
taserface has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
code_zombie has quit [Quit: Leaving]
roadie has quit [Ping timeout: 255 seconds]
sergioro has quit [Quit: leaving]
roadie has joined #ruby
cnsvc has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 258 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
fanta1 has quit [Quit: fanta1]
schne1der has joined #ruby
fanta1 has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
jinie has joined #ruby
xco has joined #ruby
Bounga has joined #ruby
donofrio has joined #ruby
Emmanuel_Chanel has joined #ruby
roadie has quit [Ping timeout: 272 seconds]
roadie has joined #ruby
TheBrayn has quit [Quit: poof]
TheBrayn has joined #ruby
cnsvc has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
leitz has joined #ruby
ellcs has joined #ruby
Keltia has left #ruby [#ruby]
roadie has quit [Ping timeout: 268 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
caterfxo has quit [Ping timeout: 256 seconds]
_phaul has joined #ruby
<rapha> Wait, it's not possible to make portable (at least Lin/Win/Mac) Ruby scripts??
caterfxo has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
<_phaul> /nick phaul
_phaul is now known as phaul
deam0 has quit [Ping timeout: 255 seconds]
<leitz> If I really want to test the output of a command, is there a better way to capture STDOUT than output = `ruby bin/shipcrewgen.rb -p`
jetchisel has quit [Ping timeout: 265 seconds]
<leitz> Sorry, using RSpec.
royal_screwup21 has joined #ruby
jetchisel has joined #ruby
<jhass> leitz: you could reassign $stdout probbably
xco has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
TomyWork has joined #ruby
Guest21040 has quit [Ping timeout: 245 seconds]
margeas has joined #ruby
BaroMeter has joined #ruby
BaroMeter has quit [Client Quit]
TomyLobo2 has joined #ruby
TomyWork has quit [Read error: Connection reset by peer]
robotmay has quit [Remote host closed the connection]
robotmay has joined #ruby
troulouliou_div2 has joined #ruby
_whitelogger has joined #ruby
markoong has joined #ruby
margeas has quit [Ping timeout: 256 seconds]
weird_error has joined #ruby
woodruffw has quit [Ping timeout: 265 seconds]
woodruffw has joined #ruby
weird_error has quit [Max SendQ exceeded]
weird_error has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
burningserenity has joined #ruby
ravenx has quit [Ping timeout: 240 seconds]
jmcgnh has joined #ruby
ravenx has joined #ruby
cnsvc has joined #ruby
sdu has quit [Remote host closed the connection]
cnsvc has quit [Ping timeout: 240 seconds]
RougeRRR has joined #ruby
RougeRR has quit [Ping timeout: 240 seconds]
ReekenX has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
johnny56_ has quit [Read error: Connection reset by peer]
lucasb has joined #ruby
johnny56_ has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
kinduff has quit [Quit: The Lounge - https://thelounge.chat]
Macrobiotic has joined #ruby
kinduff has joined #ruby
RougeR has joined #ruby
RougeRRR has quit [Ping timeout: 240 seconds]
alexherbo28 has joined #ruby
cnsvc has joined #ruby
alexherbo2 has quit [Ping timeout: 258 seconds]
alexherbo28 is now known as alexherbo2
dionysus69 has quit [Ping timeout: 260 seconds]
caterfxo has quit [Quit: leaving]
chalkmonster has quit [Quit: WeeChat 2.7.1]
caterfxo has joined #ruby
ttoocs has quit [Ping timeout: 260 seconds]
hutch has joined #ruby
Swyper has joined #ruby
TzilTzal has joined #ruby
Swyper has quit [Remote host closed the connection]
<TzilTzal> Hi
royal_screwup21 has joined #ruby
<TzilTzal> When is Ruby 3 supposed to be out?
alfiemax has quit [Remote host closed the connection]
TotalFail has quit [Read error: Connection reset by peer]
<adam12> TzilTzal: In theory, Dec 25/2020. But it's not a firm date since some pieces are still in motion.
<TzilTzal> oh.
<TzilTzal> Thought earlier )
<havenwood> TzilTzal: Ruby is released on Christmas.
<TzilTzal> Fair enough.
alfiemax has joined #ruby
<havenwood> TzilTzal: This Christmas, it'll be Ruby 2.8 or 3.0. Matz hasn't made the final decision, like adam12 mentions.
<havenwood> TzilTzal: The features planned for Ruby 3 seem to be coming together nicely.
drincruz has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
pupsikov has joined #ruby
ReekenX has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ai9zO5AP has joined #ruby
mre- has joined #ruby
ChmEarl has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
royal_screwup21 has joined #ruby
arahael has quit [Ping timeout: 258 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
impermanence has quit [Remote host closed the connection]
royal_screwup21 has quit [Remote host closed the connection]
cnsvc has joined #ruby
code_zombie has joined #ruby
roadie has joined #ruby
Swyper has joined #ruby
orbyt_ has joined #ruby
booboy has quit [Quit: ZNC - https://znc.in]
cthu| has joined #ruby
fercell has quit [Quit: WeeChat 2.7.1]
howdoi has joined #ruby
royal_screwup21 has joined #ruby
mre- has quit [Ping timeout: 268 seconds]
xorl has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has joined #ruby
TheBrayn has quit [Quit: poof]
dinfuehr has quit [Ping timeout: 256 seconds]
mre- has joined #ruby
dinfuehr has joined #ruby
TotalFail has joined #ruby
TotalFail is now known as T0talFa1l
dinfuehr has quit [Ping timeout: 240 seconds]
mre- has quit [Ping timeout: 260 seconds]
dinfuehr has joined #ruby
weird_error has quit [Quit: weird_error]
ldepandis has joined #ruby
dinfuehr has quit [Ping timeout: 255 seconds]
dinfuehr has joined #ruby
bvdw has quit [Quit: bvdw]
bvdw has joined #ruby
alfiemax has joined #ruby
pupsikov has joined #ruby
mre- has joined #ruby
troulouliou_div2 has joined #ruby
mre- has quit [Ping timeout: 260 seconds]
mre- has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
Bounga has quit [Read error: Connection reset by peer]
TomyLobo2 has quit [Ping timeout: 256 seconds]
<TzilTzal> Is there a good way to emulate enums in Ruby? (without Rails, preferably)
<adam12> TzilTzal: What's your use case?
<TzilTzal> That I'd like some value represented by a set of enums.
<TzilTzal> )
alfiemax has quit [Remote host closed the connection]
<TzilTzal> Some like a country, for instance.
<adam12> TzilTzal: You could use a Set. It's not exactly an enum but Set is in stdlib and might get you close.
<havenwood> TzilTzal: Show how you'll use it?
<TzilTzal> havenwood: I'd just like a set of symbols (e.g. :usa, :canada, :uk, etc...). One class will have a attr_accessor called 'country' that should hold this enum/symbols.
<havenwood> TzilTzal: And then you'll be checking for inclusion in the set, or other things?
<TzilTzal> well, some logic might be based on the symbol.
Ven`` has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
<havenwood> TzilTzal: Indexes don't matter for your usecase?
<TzilTzal> Indices in the set?
RougeR has quit [Read error: Connection reset by peer]
<TzilTzal> No.
RougeR has joined #ruby
booboy has joined #ruby
dionysus69 has joined #ruby
<havenwood> TzilTzal: Are you adding to the list at runtime, or it's fixed?
<TzilTzal> Fixed.
<havenwood> TzilTzal: Array, Set or SortedSet (with or without rbtree/rbtree3) are all perfectly fine options.
<havenwood> TzilTzal: Array will be slower to check inclusion once you get into the thousands of members.
<havenwood> TzilTzal: I'd probably just use a frozen Array constant.
mre- has quit [Ping timeout: 265 seconds]
<havenwood> TzilTzal: As you get into the millions of members, Array falls hopelessly behind, thousands of times slower.
<havenwood> TzilTzal: With a few members, it just doesn't matter.
<havenwood> TzilTzal: ~2,000x slower for 1M, ~1,000x slower for 10K, ~100x slower for 1K, ~4x slower for 100, about the same for 10.
<havenwood> TzilTzal: TL;DR: If it's a big set, use Set or SortedSet. If it's a small one, Array is perfectly fine.
<havenwood> TzilTzal: Freeze it and use a constant, in any case.
<havenwood> LETTERS = (:a..).take(1_000_000).freeze
sauvin has quit [Read error: Connection reset by peer]
fanta1 has quit [Quit: fanta1]
postmodern has joined #ruby
burningserenity has quit [Ping timeout: 256 seconds]
RougeR has quit [Remote host closed the connection]
RougeR has joined #ruby
burningserenity has joined #ruby
burningserenity has quit [Client Quit]
burningserenity has joined #ruby
hiroaki has joined #ruby
dinfuehr has quit [Ping timeout: 255 seconds]
dinfuehr has joined #ruby
rippa has joined #ruby
sagax has quit [Read error: Connection reset by peer]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
rprimus has quit [Remote host closed the connection]
rprimus has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
TzilTzal has quit [Quit: Leaving.]
sagax has joined #ruby
wildtrees has joined #ruby
wildtrees has quit [Remote host closed the connection]
wildtrees has joined #ruby
sergioro has joined #ruby
weird_error has joined #ruby
mre- has joined #ruby
jrhorn424 has joined #ruby
weird_error has quit [Quit: weird_error]
burningserenity has quit [Remote host closed the connection]
johnny56_ has quit [Ping timeout: 240 seconds]
schne1der has quit [Ping timeout: 260 seconds]
volix has quit [Ping timeout: 252 seconds]
mre- has quit [Ping timeout: 265 seconds]
mre- has joined #ruby
ur5us has joined #ruby
watzon has joined #ruby
Ven`` has quit [Read error: Connection reset by peer]
hutch has quit [Ping timeout: 258 seconds]
jmcgnh has quit [Read error: Connection reset by peer]
weird_error has joined #ruby
royal_screwup21 has joined #ruby
weird_error has quit [Client Quit]
jmcgnh has joined #ruby
<adam12> Anybody in here build their own template language?
hassox has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<hassox> [JOB POST]
<hassox> Hey folks. At Atomic.vc we’re launching our Engineer-in-Residence program.
<hassox> Work on many different startups
<hassox> Find the right one for you
<hassox> Join as the first Engineer!
<hassox> hope it's ok to post job posts :|
yokel has quit [Ping timeout: 255 seconds]
gigetoo has quit [Ping timeout: 260 seconds]
yokel has joined #ruby
gigetoo has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
sergioro has quit [Quit: leaving]
alexherbo2 has quit [Ping timeout: 268 seconds]
gix has quit [Quit: Client exiting]
gix has joined #ruby
RougeRR has joined #ruby
RougeR has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
T0talFa1l has quit [Read error: Connection reset by peer]
<leitz> Hmm...asking if it's okay afterwards is kinda disingenuous.
<havenwood> leitz: They asked first in #rubyonrails.
<leitz> havenwood, okay.
<leitz> I'm still trying to figure out how one US State can dictate the internet.
<leitz> The whole Cali privacy thing seems bizzare, from a legal standpoint.
orbyt_ has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
johnny56_ has joined #ruby
kinduff has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
mozzarella has quit [Ping timeout: 256 seconds]
RougeRR has quit [Remote host closed the connection]
RougeR has joined #ruby
<havenwood> leitz: Only China, Japan, and Germany have a larger economy than California standing alone.
<havenwood> leitz: You can ignore California privacy protections if you don't care about Californian customers.
<havenwood> I'm personally glad Californian and EU protections are raising the bar just a little, both for their folk and others.
ianbrown78 has joined #ruby
<havenwood> leitz: China, Japan, and Germany have similar clout.
RougeR has quit [Read error: Connection reset by peer]
RougeR has joined #ruby
<havenwood> (Some folk avoid those markets and others due to rules incompatible with their business model.)
<havenwood> 90x the GDP of Wyoming and 68x the population with the same number of "representative" senators, but I digress.
thecoffemaker has joined #ruby
royal_screwup21 has joined #ruby
troulouliou_dev has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
ianbrown78 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
drincruz has quit [Ping timeout: 260 seconds]
RougeR has quit [Read error: Connection reset by peer]
RougeR has joined #ruby
Macrobiotic has quit [Quit: Connection closed for inactivity]
s3nd1v0g1us has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
mheld has joined #ruby
hutch has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has quit [Ping timeout: 272 seconds]
pupsikov has joined #ruby
ur5us has joined #ruby
<leitz> havenwood, the market, and the privacy, are one thing. However, it sets a terrible precedent; that an entity can dictate what those outside it's jurisdiction must do. If someone from Cali gives away their private info, that's on them.
<leitz> They have the ability to not have their info shared; don't give it to anyone.
<havenwood> leitz: There are tons of things you can't bargain away, due to a legal minimum. Privacy is now one of them. It only didn't used to be because it wasn't *possible* to violate it so egregiously.
<havenwood> leitz: We should probably continue discussion in #ruby-offtopic, since Ruby isn't involved here.
<leitz> Hehe, yeah. I'm going to step away from the computer, it's been a plbbght day.
<leitz> I did get my Ruby updated, though. So it's a win.
<havenwood> leitz: Nice!
<leitz> Actually, an actual Ruby question for the masters in the house.
* leitz eyes havenwood and adam12, amoungst others.
<leitz> Some time back I did a short term mentoring thing. I'm thinking of doing it again, this time with a small Ruby project. The target is people who have some Ruby skill, but not a lot of project experience.
renich has joined #ruby
<leitz> There are a couple of ways you (plural) could help. 1. Review my project and let me know what's done in "bad practice". I don't want others to learn that.
<havenwood> 1. Happy to review and give feedback.
<leitz> 2. Be available when folks ask questions. That's something you already do well, and it's really helpful.
<leitz> And in full disclosure, I'm using mentoring to push myself to get better. I've been an Apprentice for a couple of decades, in a few languages. It's time to get better, and deeper, at one thing.
<havenwood> 2. If the questions are here, happy to answer. I can't commit to other channels. Maybe have a bot that proxies questions for folk to answer here?
<leitz> havenwood, nyah. I'll send folks here. They can look things up if they want, but here has a high signal to noise ratio.
<havenwood> leitz: I like the idea of learning while helping answer questions. That seems to be a good way to learn.
<leitz> Unless we talk about Cali. :)
<leitz> For example, adam12 helped me plug in an Adapter. I'm still not great at it, but have used it in more than one place.
<havenwood> leitz: use a Hash literal `{}` rather than `Hash.new`: https://github.com/makhidkarun/ftl_tools/blob/master/bin/chargen#L9
<havenwood> leitz: Most folk follow the `do` for multiple line blocks convention these days: https://github.com/makhidkarun/ftl_tools/blob/master/bin/chargen#L10
<havenwood> leitz: Use something more descriptive than single char variables like `o` if you can.
<havenwood> leitz: Capitalization seems suspect, but I guess that works for your roles?
<leitz> I tend to use Hash.new as an easy "grep" pattern to look for things. The shell gets iffy with special characters. :)
<havenwood> leitz: The grepping difficulty is worth the increased speed and readability.
<havenwood> leitz: It's not that hard to grep for {}.
<havenwood> leitz: Also, why are you grep'n {}.
<havenwood> leitz: Use {}.
<leitz> On multi-line {}, that's because I use vim. It helps me make sure I balance them.
<havenwood> leitz: It's folly to use Hash.new for empty hashes or anything other than providing arguments or a block to Hash.new.
<havenwood> leitz: Ruby itself uses the Hash literal, every major library uses the Hash literal. It's a performance hit every time you create a Hash to do it like you do.
<havenwood> leitz: You can provide an `into: opts` keyword argument to #parse!
<havenwood> leitz: The simplify your parser to: options.on '-r', '--role=ROLE', 'Role for the character'
<havenwood> (no block)
mre- has quit [Ping timeout: 265 seconds]
phaul has quit [Ping timeout: 260 seconds]
<havenwood> leitz: You can drop the Hash literal here, and use a "naked Hash."
<havenwood> leitz: builder.setup('role' => opts[:role])
<havenwood> leitz: If you know there's a role, use #fetch instead of #[].
<havenwood> leitz: builder.setup('role' => opts.fetch(:role)
<leitz> havenwood, would the nekkid hash confuse someone new to Ruby?
<havenwood> leitz: No, you can't avoid literals.
<havenwood> leitz: It might be less confusing to not have literals, but we do, and they're used broadly.
* leitz will have to cut and paste all this, for study...
phaul has joined #ruby
<havenwood> &>> %w('Free Trader' 'Navy' 'Merchant Marine').sample
<rubydoc> # => "'Merchant" (https://carc.in/#/r/8pex)
<havenwood> leitz: ^
<leitz> Yup, i'm currently in the ship_builder branch, and realized that last night. Code isn't ready for a merge yet.
<havenwood> &>> ['Free Trader' 'Navy' 'Merchant Marine']
<rubydoc> # => ["Free TraderNavyMerchant Marine"] (https://carc.in/#/r/8pey)
<havenwood> &>> ['Free Trader', 'Navy', 'Merchant Marine']
<rubydoc> # => ["Free Trader", "Navy", "Merchant Marine"] (https://carc.in/#/r/8pez)
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leitz> havenwood, cool. Hadn't known about clamp. One of the things I want to high-light is Ruby's ability to get things done, without reams of code.
<havenwood> leitz: It's easier to get to idiomatic Go quickly, since they intentionally keep it shallow.
<havenwood> leitz: I like Ruby or something super deep like Perl 6, since you get to keep learning.
<havenwood> ahem, I mean Raku :P
<leitz> I like to get stuff done. Go is cool, but takes me longer. Perl 5 is powerful, but...
<leitz> heheh...