lucidreamachine has quit [Ping timeout: 260 seconds]
Mia has joined #ruby
Mia has joined #ruby
Axy has quit [Ping timeout: 268 seconds]
Technodrome has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Wawel - Czujesz sie dobrze, czynisz dobrze]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mia has quit [Ping timeout: 268 seconds]
Cork has quit [Quit: .]
banisterfiend has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
rubydoc has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
rubydoc has quit [Excess Flood]
phaul has joined #ruby
rubydoc has joined #ruby
prion has joined #ruby
jl4 has quit [Ping timeout: 272 seconds]
rubydoc has quit [Excess Flood]
rubydoc has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
rubydoc has quit [Ping timeout: 268 seconds]
banisterfiend has joined #ruby
TCZ has joined #ruby
banisterfiend has quit [Ping timeout: 268 seconds]
Swyper has quit [Remote host closed the connection]
stryek has joined #ruby
banisterfiend has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Max SendQ exceeded]
DarthGandalf has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xiti` has joined #ruby
Technodrome has joined #ruby
Xiti has quit [Ping timeout: 260 seconds]
Swyper has joined #ruby
lucidreamachine has joined #ruby
Swyper has quit [Remote host closed the connection]
banister_ has joined #ruby
bsdband36 has joined #ruby
bsdband36 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
SeepingN has joined #ruby
Cork has joined #ruby
mihael has quit [Ping timeout: 260 seconds]
mbrndtgn has quit [Quit: Ping timeout (120 seconds)]
mbrndtgn has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troll_ has joined #ruby
<troll_>
ruby is bloated.
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
troll_ was banned on #ruby by adam12 [*!*@2001:ac8:20:302::202d]
troll_ was kicked from #ruby by adam12 [troll_]
Swyper has quit [Remote host closed the connection]
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Mia has quit [Ping timeout: 246 seconds]
hiroaki has quit [Ping timeout: 264 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Axy has quit [Ping timeout: 256 seconds]
rubydoc has joined #ruby
phaul has joined #ruby
mihael has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
rubydoc has quit [Remote host closed the connection]
bsdbandit-01 has joined #ruby
rubydoc has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
hiroaki has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
lucidreamachine has quit [Ping timeout: 260 seconds]
prion has quit [Ping timeout: 246 seconds]
lucidreamachine has joined #ruby
ChmEarl has joined #ruby
Swyper has joined #ruby
banisterfiend has quit [Quit: banisterfiend]
Rudd0 has quit [Remote host closed the connection]
Rudd0 has joined #ruby
blackmesa1 has quit [Ping timeout: 268 seconds]
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 265 seconds]
jl4 has joined #ruby
ule has quit [Ping timeout: 272 seconds]
ule has joined #ruby
Mrgoose has quit [Ping timeout: 256 seconds]
Swyper has quit [Remote host closed the connection]
Swyper_ has joined #ruby
dfucci has quit [Ping timeout: 265 seconds]
Mrgoose has joined #ruby
prion has joined #ruby
mihael has quit [Ping timeout: 268 seconds]
JasonO- has joined #ruby
naftilos76 has joined #ruby
Swyper_ has quit [Remote host closed the connection]
<naftilos76>
Hi, does anybody have any idea why mysql2 gem shows 000 when strftime is configured to show milliseconds? I tried channel rubygems but there is nobody there :)
robotmay has quit [Remote host closed the connection]
Swyper has joined #ruby
robotmay has joined #ruby
<adam12>
naftilos76: Code?
bsdbandit-01 has joined #ruby
TCZ has quit [Quit: Wawel - Czujesz sie dobrze, czynisz dobrze]
JasonO has quit [Excess Flood]
<naftilos76>
adam12: i will be back in a while
rubydoc has joined #ruby
dfucci has joined #ruby
phaul has joined #ruby
dfucci has quit [Ping timeout: 268 seconds]
arahael has quit [Ping timeout: 260 seconds]
elcuervo has quit [Read error: Connection reset by peer]
ian| has joined #ruby
arahael has joined #ruby
<isene>
Anyone? Is there any way to intercept 'getc' - i.e. to tell it to no longer wait for input?
elcuervo has joined #ruby
<adam12>
isene: None that I'm aware. What about getch() with a time argument, in a loop?
<adam12>
Then if you want to no longer wait, the loop is checking something which says to abort. while prompt_user?; c = getch(time: 1); end
lucidreamachine has quit [Ping timeout: 260 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
howdoi has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
braincrash has joined #ruby
ellcs has joined #ruby
lucidreamachine has joined #ruby
phaul has quit [Remote host closed the connection]
phaul has joined #ruby
<ian|>
in ruby are there 'static' class variables, which... perhaps remain uniform across all instances, or tied to the Class?
<baweaver>
@@class_variable = 'shared across instances'
<baweaver>
but they can be touchy
<baweaver>
with inheritance*
<ian|>
thanks
rubydoc has quit [Remote host closed the connection]
<adam12>
Agreed; I don't say _avoid_ them, but if they end up in a PR I'm reviewing, they get looked at extra carefully.
jl4 has quit [Remote host closed the connection]
rubydoc has joined #ruby
rubydoc has quit [Excess Flood]
rubydoc has joined #ruby
<ian|>
i don't like how [Array.new] calls Array.new(), I would expect the function, as used as an expression, to return itself, not call it
<ian|>
perhaps there is a sigil to make it return itself
<ian|>
or perhaps i'm getting ruby confused with javascript, and good OOP would not permit a first-class class method to be a value
<ian|>
s/first-class//
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
rubydoc has quit [Ping timeout: 264 seconds]
phaul has quit [Ping timeout: 260 seconds]
<adam12>
ian|: Array()
phaul has joined #ruby
<adam12>
&>> Array([])
<adam12>
Maybe I'm mis-understanding what you want.
rubydoc has joined #ruby
<ian|>
i was confusing ruby for a prototypal-OOP language or something.. lol
<leftylink>
Array.method(:new) is what is being requested
<leftylink>
which can then be called
<leftylink>
&>> Array.method(:new)[1, 2, 3, 4, 5]
<rubydoc>
stderr: -e:4:in `initialize': wrong number of arguments (given 5, expected 0..2) (ArgumentError)... check link for more (https://carc.in/#/r/a4e0)
<Petruchio>
Hello. Anyone know a gem which expedites the routine of checking on files and permissions? E.g.: Does directory x exist? If not, create it. If you can't, change permissions. If you can't, raise an error. Does file x/y exist? If not...
<Petruchio>
I'd like to just declare what needs to be the case, and know that sensible steps are taken.
<leftylink>
hmm... if there doesn't exist one, maybe install(1) can be looked into as an alternative
ramfjord has joined #ruby
<leftylink>
because I sort of get the feeling that it does this thing
vondruch has quit [Read error: Connection reset by peer]
<tempate>
havenwood: I'm reading about all of this. It's beautiful!
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
bsdbandit-01 has joined #ruby
Swyper has quit [Remote host closed the connection]
<havenwood>
tempate: i meant #any? and #none? for this use case but #each is generally much less used than say #map or predicate methods (ones ending in ?).
<havenwood>
tempate: #each is what Enumerable is based on, it uses it internally to provide these other methods to Ranges, Arrays, Hashes, and all sorts of other collection classes that mix in Enumerable.
<tempate>
havenwood: I've noticed that since I started writing ruby (only a couple of weeks ago), I'm leaning towards using map a lot more.
<tempate>
havenwood: I see, I see
<havenwood>
tempate: use of #each in your code is primary for side effects. there's usually a better Enumerable method when you're relying on a return value.
<tempate>
havenwood: not sure how this'd work, tbh; valid_ticket would be the number of the ticket that didn't fulfill is_field_valid?
<havenwood>
#=> "yup"
phaul has quit [Ping timeout: 246 seconds]
rubydoc has quit [Ping timeout: 268 seconds]
<havenwood>
tempate: Stepping into a meeting but I'm sure others can help. :) The convention in Ruby is to name methods like #ticket_valid? rather than #is_ticket_valid.
phaul has joined #ruby
rubydoc has joined #ruby
blackmesa has joined #ruby
Rudd0 has joined #ruby
<tempate>
havenwood: alright, thanks for everything
blackmesa1 has quit [Ping timeout: 260 seconds]
ruurd has joined #ruby
<leftylink>
huh, seeing that code also causes me to ask a few questions
<leftylink>
about the input
<leftylink>
let me check
<tempate>
Feel free to ask
<tempate>
The input is inside that same folder, btw
<leftylink>
huh. got lucky
<leftylink>
no ticket has two invalid fields
<leftylink>
that totally would have broken that code if any ticket did
<leftylink>
too bad
<leftylink>
I was thinking there would be a ticket with such
<tempate>
hehe
<tempate>
Yeah, I thought of that
<tempate>
They were nice
<tempate>
leftylink: if you don't mind me abusing of your kindness, what do you think of the code as a whole? Any advice?
<leftylink>
oh, it's too bad you dont' have Ruby 2.7... if you did, then you'd be able to use filter_map instead of map.compact
<leftylink>
there is sort of a missed opportunity in the input in that they could have made a field have three ranges, or one range, etc., but it's all two ranges, so I can't really complain
qbklinm81 has quit [Quit: Leaving.]
<tempate>
I could install Ruby 2.7 if it's not too much of a hustle
somazero has quit [Remote host closed the connection]
<leftylink>
.split(",").map(&:to_i) is done twice, is that enough to pull it out into a `ticket(str)` ? guess that depends on preference
prion has joined #ruby
<leftylink>
oh... that calculate_ticket_scanning_error_rate is actually begging to use Enumerable#sum not #each
<tempate>
Hmmm
<tempate>
I didn't know #sum was a thing, tbh
<tempate>
Is sum the same as map with inject(:+) ?
dionysus69 has joined #ruby
<leftylink>
I suppose. though giving it a block is useful, since then it replaces map { ... }.reduce(:+)
<leftylink>
replacing both the map and the reduce
<tempate>
I see, I see
<tempate>
Let me push my actual code
bsdbandit-01 has joined #ruby
<nakilon>
hmmm, if I add bin/my_gem_binary to spec.files in gemspec, is it enough? how do I test that it works?
<tempate>
leftylink: there, the code should be up to date. It has many, if not all, of the recommendations you and havenwood gave.
<nakilon>
I've added the file there, also spec.bindir and spec.executable (still not sure if they are needed), then I did gem build my_gem, gem install my_gem-0.0.1.gem
<nakilon>
"gem which" shows that the binary is there but it's somehow not in the PATH
bsdbandit-01 has quit [Read error: Connection reset by peer]
<nakilon>
in case of the gem install from rubygems the "gem which" points to /Users/nakilon/.rbenv/shims/my_gem
<nakilon>
but when installed from .gem it's /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/mygem-0.0.1
<nakilon>
oh wait, that shim is "which my_gem", not "gem which my_gem"
blackmesa has quit [Ping timeout: 260 seconds]
<nakilon>
looks like those shims are some magic sh scripts and "gem install my_gem.gem" don't create them so I'm unable to test if the executable is callable without pushing it to rubygems
<nakilon>
not even with "rake install"
<nakilon>
oh, nvm, I guess I actually forgot spec.bindir and spec.executable and they appeared to be important, after I've added them rebuilt and ran "rake install" it works now
cloud69 has quit [Quit: Connection closed for inactivity]
somazero has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
tty has joined #ruby
teclator has quit [Read error: Connection reset by peer]
tty is now known as cd
cd has quit [Client Quit]
cd has joined #ruby
bsdbandit-01 has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
fuzzface has quit [Quit: Leaving]
Technodrome has joined #ruby
ellcs has quit [Ping timeout: 268 seconds]
prion has quit [Ping timeout: 256 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
prion has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
orbyt_ has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
somazero has quit [Quit: Leaving]
BananaDisco has quit [Quit: Leaving]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]