<anotherpi>
Guest13669: is just for the irc, that's mean it's some code
LiquidInsect has joined #ruby
<anotherpi>
use code between the `
<anotherpi>
(in Ruby, it is use for something but nevermind)
<Guest13669>
just a question are there any ruby audio books
<anotherpi>
lol
<anotherpi>
i really don't know, but for a programming language book, i think it's a wreid idea :p
<ResidentBiscuit>
Ive never heard of a programming audio book lol
<ResidentBiscuit>
There might be some Ruby podcasts out there
<anotherpi>
Guest13669: what is your programming level?
msmith has joined #ruby
fullstack has quit [Ping timeout: 258 seconds]
seekingkyle has joined #ruby
xen0fon has quit [Quit: xen0fon]
<Guest13669>
anotherpi: i basically started like 1 week ago
ragesoss has quit [Quit: No Ping reply in 180 seconds.]
msmith has quit [Ping timeout: 248 seconds]
<Guest13669>
i did some c# in unity years ago but it's all forgotten
Mon_Ouie has quit [Ping timeout: 258 seconds]
ragesoss has joined #ruby
<anotherpi>
ok, so you have to read or watch screencast
<seekingkyle>
c# is the same as java
<anotherpi>
it's obvious this tests are too hard for you
<Guest13669>
should i do launch school?
<anotherpi>
Ruby have less constrains than this language, i expect you gonna have more fun with it
fullstack has joined #ruby
<anotherpi>
i read a book to begin my path in programming
alveric2 has joined #ruby
<anotherpi>
it was well written
<Guest13669>
is it possible to suddenly start learning programming with no previous interest for it?
<anotherpi>
today there are many cool video on the internet for learning programming
GodFather has quit [Read error: Connection reset by peer]
<anotherpi>
why do you start programming today?
<Guest13669>
i wanna create something from nothing
alveric1 has quit [Ping timeout: 240 seconds]
<seekingkyle>
create a porn app that tracks how much time you spend watching porn
<Guest13669>
would be difficult, i'd need browser compatibility and stuff
<seekingkyle>
or you can make a background one
<seekingkyle>
that listens for specific urls
<anotherpi>
lol, seekingkyle doesn't like JS ;p
<seekingkyle>
eww
<Guest13669>
guys what do you think about scala
thejamesbond has joined #ruby
<seekingkyle>
gross
<anotherpi>
LOL
<seekingkyle>
go is better
thejamesbond has quit [Client Quit]
fullstack has quit [Changing host]
fullstack has joined #ruby
<anotherpi>
lol, ok i leave the conversation ;)
ResidentBiscuit has quit [Remote host closed the connection]
<ljarvis>
we're not here to beat on other languages, so lets keep it ruby or take it to #ruby-offtopic
r__rios has joined #ruby
r__rios has joined #ruby
r__rios has quit [Changing host]
kht has quit [Ping timeout: 240 seconds]
<anotherpi>
ljarvis: well said
<seekingkyle>
ljarvis: we're here to discuss how we can replace ruby with other languages
kht has joined #ruby
<seekingkyle>
1 language 1 mess 1 problem
<seekingkyle>
all united by 1
<seekingkyle>
because we have so many languages we have so many messes and so many problems
<seekingkyle>
i don't like that
<ljarvis>
seekingkyle: no, we're not. So if you want to discuss something other than Ruby, take it to the other channel
<seekingkyle>
HERETIC
<ljarvis>
are you finished?
<anotherpi>
only one language is not a problem, the problem is only one implementation
<seekingkyle>
you're a heretic and don't belong in this channel if you think we shouldn't make ruby the most important language of all time
<seekingkyle>
we need to banish the heretic
blackbom1 has joined #ruby
<seekingkyle>
who agrees?
<ljarvis>
nobody agrees, so please stop before you're forced to leave yourself
rrios has quit [Ping timeout: 255 seconds]
<seekingkyle>
BANISH HIM I SAY
<ljarvis>
!mute seekingkyle
<ljarvis>
seekingkyle: feel free to banish me in private message, other people are here to learn and talk about ruby
charliesome has joined #ruby
<anotherpi>
i did not understand what happened
<ljarvis>
!unmute seekingkyle
Mon_Ouie has joined #ruby
<ljarvis>
seekingkyle: are you finished?
<seekingkyle>
WHAT USE IS THIS COMMUNITY IF IT'S RAN BY HERETICS?!?!?!??!?!??!?!?
charliesome has quit [Client Quit]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
same as in #ruby-banned: ex falso quodlibet. your premise is wrong.
BackEndCoder has quit [Excess Flood]
charliesome has joined #ruby
<ljarvis>
you're up late, anotherpi
<ljarvis>
er, apeiros
<apeiros>
it's saturday. and we just had our big release today.
<ljarvis>
congrats
<apeiros>
thanks
<apeiros>
lets wait for the testweek, though
<ljarvis>
:)
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
(you know, the one where the real people use it…)
BackEndCoder has joined #ruby
<ljarvis>
good idea
BTRE has quit [Quit: Leaving]
<seekingkyle>
apeiros: what did you release?
<anotherpi>
ljarvis: you checked my geolocalization? :p
<ljarvis>
anotherpi: heh no, I was speaking to apeiros. Where are you based?
<apeiros>
seekingkyle: internal software at the company I work.
<seekingkyle>
oh
<seekingkyle>
i thought it was something public... i was going to roast your app
<anotherpi>
oh yea sorry, didn't read below
<anotherpi>
from France
<seekingkyle>
may i pm you anotherpi?
jameser has joined #ruby
<ljarvis>
ah, you are up late then (same TZ as apeiros)
<ljarvis>
+1 hour on me :)
<anotherpi>
german?
ResidentBiscuit has joined #ruby
<seekingkyle>
anotherpi: no i'm on vacation right now
<seekingkyle>
i'm 100% murican
<seekingkyle>
i'm checking out the FKK clubs and partytreffs, nothing to do with ruby though
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
banisterfiend has joined #ruby
kht has quit [Ping timeout: 240 seconds]
cyphase_eviltwin has joined #ruby
nertzy has joined #ruby
chouhoulis has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
charliesome has joined #ruby
zapata has joined #ruby
brent__ has joined #ruby
centrx has quit [Ping timeout: 255 seconds]
hays has quit [Read error: Connection reset by peer]
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
BTRE has joined #ruby
jameser has joined #ruby
blackbom1 has quit [Ping timeout: 240 seconds]
ahuman has quit [Ping timeout: 258 seconds]
sneakerhax has joined #ruby
anotherpi has left #ruby ["ERC (IRC client for Emacs 24.5.1)"]
skweek has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Excess Flood]
Toordog has joined #ruby
ahuman has joined #ruby
brent__ has quit [Remote host closed the connection]
Lord_of_Life has joined #ruby
blackbom1 has joined #ruby
nowhereman has joined #ruby
Trynemjoel has quit [Ping timeout: 245 seconds]
volty has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
ResidentBiscuit has quit [Remote host closed the connection]
<Toordog>
Looking for ruby coder for hire
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
spitfireee has joined #ruby
<volty>
Hi, more math than ruby.I need random numbers distributed unequally. Let's say I need numbers from 0..9 but those close to 0 [let's say] four times more often than those close to 99, then, smoothly, around could have equal distribution.
spitfireee has quit [Killed (Sigyn (Spam is off topic on freenode.))]
<volty>
let's say I generate 0..999 and then reduce unequally to 0..9. Any idea, out of pocket, about the function?
<volty>
(ops, reduce = recalc)
<baweaver>
Toordog: There are some freelance sites out and about where you could find some.
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
volty: Offhand, I'd have to think about that one.
<baweaver>
and unfortunately thinking is not going well for me right now, so bear with me.
<volty>
baweaver: me too, but tired right now :)
<baweaver>
So the initial is that you have a range of numbers you want to select from
<baweaver>
but you want to weight certain numbers from 1 to x more heavily in random
<volty>
yap
<baweaver>
How much Ruby do you know?
<volty>
smoothly
<volty>
a lot
<volty>
but from time to time
<baweaver>
kwargs might help here
Trynemjoel has joined #ruby
<baweaver>
make a method that takes: range: range, weight-n: array[range]
<baweaver>
where n will be the multiplier
<baweaver>
make it a string for easier parsing
ResidentBiscuit has joined #ruby
<volty>
I was asking only about the function that can project a higher set to unequally distributed lower set. Never mind. I'll let it sleep. Thanks. :)
<baweaver>
none built in
<baweaver>
but essentially just to an n.times for each "weight" to shove them into a set you return
<baweaver>
s/set/array/
<volty>
going to ask in #math
Guest69 has joined #ruby
msmith has joined #ruby
patarr has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
railswebdev has joined #ruby
milardovich has joined #ruby
<baweaver>
see if I got this right
<baweaver>
>>def ws(**kw);s=kw[:r].to_a;kw.each{|k,vs|next if k!~/^w/;w=k.split('-')[-1];w.times{vs.to_a.each{|v|s<<v}};s;end; ws(r:1..5,'w-4'=>1..3)
<ruby[bot]>
baweaver: # => /tmp/execpad-29c4ddbeb1be/source-29c4ddbeb1be:2: syntax error, unexpected keyword_end, expecting '}' ...check link for more (https://eval.in/730486)
<baweaver>
fine fine, correcting syntax then
Trynemjoel has quit [Ping timeout: 245 seconds]
<baweaver>
>>def ws(**kw);s=kw[:r].to_a;kw.each{|k,vs|next if k!~/^w/;k.split('-')[-1].to_i.times{vs.to_a.each{|v|s<<v}}};s;end; ws(r:1..5,'w-4'=>1..3)
<ruby[bot]>
baweaver: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/730487)
jameser has joined #ruby
* baweaver
opens pry
<baweaver>
>>def ws(kw={});s=kw[:r].to_a;kw.each{|k,vs|next if k !~/^w/;k.split('-')[-1].to_i.times{vs.to_a.each{|v|s<<v}}};s;end; ws(r:1..5,'w-4'=>1..3)
mlindahl_ has quit [Remote host closed the connection]
mlindahl has joined #ruby
unreal has joined #ruby
quick has joined #ruby
zeroDi has joined #ruby
byte512 has joined #ruby
mlindahl has quit [Remote host closed the connection]
mlindahl has joined #ruby
mlindahl has quit [Remote host closed the connection]
mlindahl has joined #ruby
dhollinger has joined #ruby
karapetyan has joined #ruby
blackbom1 has quit [Ping timeout: 240 seconds]
blackbom1 has joined #ruby
charliesome has joined #ruby
blackmesa has joined #ruby
Puffball has quit [Remote host closed the connection]
brent__ has joined #ruby
Puffball has joined #ruby
brent__ has quit [Ping timeout: 264 seconds]
dc4 has joined #ruby
Axy has quit [Ping timeout: 240 seconds]
dnewkerk has quit [Quit: dnewkerk]
lxsameer has joined #ruby
blackbom1 has quit [Ping timeout: 276 seconds]
nofxxx has quit [Read error: Connection reset by peer]
nofxx has joined #ruby
al2o3-cr has joined #ruby
pandaant has joined #ruby
Jackneill has joined #ruby
blackbom1 has joined #ruby
karapety_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapety_ has quit [Read error: Connection reset by peer]
marxarelli|afk has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
Derperperd has joined #ruby
Derperperd has quit [Changing host]
Derperperd has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
nowhereman has quit [Ping timeout: 240 seconds]
Derperperd has quit [Ping timeout: 264 seconds]
mas886 has quit [Read error: Connection reset by peer]
tuxaddicted has joined #ruby
aryaching_ has quit [Ping timeout: 252 seconds]
sagax has joined #ruby
<sagax>
hi all!
<sagax>
how to check true/false that is boolean?
triangles has quit [Quit: Leaving]
<sagax>
true.class is TrueClass, false.class is FalseClass
<sagax>
but where Boolean?
blackmesa has quit [Ping timeout: 245 seconds]
<toretore>
there is no Boolean
<sagax>
hm, well, how to check this TrueClass or FalseClass without [TrueClass, FalseClass].include?(some_true_false_object.class)
<toretore>
why do you want to do this?
<sagax>
i wish check, that some_object is a true or false, i wish check that some_object is a boolean type
blackmesa has joined #ruby
<toretore>
again, why?
blackbom1 has quit [Ping timeout: 255 seconds]
<sagax>
not string or integer or other
<toretore>
what is the actual use case for this?
<sagax>
i check argument in def, i wish check that argument it's true or false
dnewkerk has joined #ruby
<toretore>
you're just saying the same thing over and over, explain *why* you want to do this
Derperperd has joined #ruby
<apeiros>
sagax: the reason toretore asks for the "why" is because it's common in ruby to just rely on truthiness, and not require explicit true/false
quick has quit [Quit: Leaving]
<sagax>
I want to make sure that correct argument was sent
<apeiros>
ok, lets rephrase toretore's question: why do you only want to accept true/false and not truthy/untruthy?
<apeiros>
is there a reason to go counter to common ruby idioms?
pragmaticus has quit [Ping timeout: 248 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sagax>
i know nothing about truthy/untruthy
A124 has quit [Ping timeout: 240 seconds]
<sagax>
but i sent to def (true or false) argument and i must check this argument
<toretore>
no, you must not
<apeiros>
sagax: that's not what's commonly done
<toretore>
you must not not, in fact
<apeiros>
truthy: everything except nil/false
<apeiros>
untruthy: nil and false
<toretore>
wait, i'm getting my boolean logic wrong
<apeiros>
and almost all methods which do a boolean decision accept truthy/untruthy. they don't care about wether the value is precisely true/false
<sagax>
not, i must get exactly true or false
<apeiros>
*why*
<sagax>
i don't sent just object
<toretore>
lol
Derperperd has quit [Ping timeout: 240 seconds]
<toretore>
sagax: gis the code in question where you feel like you have to do this
<toretore>
?gist
<ruby[bot]>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
A124 has joined #ruby
<apeiros>
ok, look, you're almost certainly doing it wrong, but: either your solution, or case obj; when true, false then "is boolean" else "isn't"; end, or obj.equal?(true) || obj.equal?(false)
<apeiros>
and let me reiterate it: you. are. doing. it. wrong. I gave you the tools to do it wrong. your decision on whether you want to actually do it wrong. you've been thoroughly warned :-p
<sagax>
[TrueClass, FalseClass].include?(some_object.class) it looks better, i think
<apeiros>
it looks like done wrong.
* apeiros
afk for a few minutes
karapetyan has quit [Remote host closed the connection]
harai_ has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
<sagax>
i do not make checking that object is exist
karapetyan has quit [Read error: Connection reset by peer]
<manveru>
the only thing you cannot fool is `if` and `unless`
CloCkWeRX has quit [Ping timeout: 255 seconds]
<manveru>
but then you can't say for sure if it's nil or false or true, just if it's truthy/falsy
<manveru>
anw, if you'd explain _why_ you need this in the first place, we might be discussing something more productive :)
<toretore>
sagax: you have been saying one thing over and over, ignoring every advice and not provided any information when asked, so until you change that you are classified as a troll
<elomatreb>
Yeah, makes sense, I must have confused that with something
hutch34 has joined #ruby
evie_hammond has joined #ruby
hutch34 has quit [Ping timeout: 256 seconds]
blackwind_123 has joined #ruby
garit has left #ruby ["exit"]
Derperperd has joined #ruby
A124 has quit [Ping timeout: 248 seconds]
Derperperd has quit [Ping timeout: 276 seconds]
A124 has joined #ruby
gizmore has joined #ruby
blackmesa has quit [Ping timeout: 255 seconds]
vktec has joined #ruby
<vktec>
This isn't the best of channel for this, but I couldn't find a better one, so here goes: What does 'spec' mean in regards to testing? Why is 'rspec' not called, say, 'rtest'?
<havenwood>
vktec: So when they ask for your specs you can point at the spec/ directory!
<vktec>
But why is it called the spec/ directory? ;)
<havenwood>
vktec: More seriously, there're slight syntactic and semantic differences between the test and spec style. Minitest is a good place to look to compare the two styles. You can even mix and match.
<vktec>
Okay
<vktec>
> minitest/spec is a functionally complete spec engine. It hooks onto minitest/test and seamlessly bridges test assertions over to spec expectations.
<havenwood>
vktec: If you write your tests in a style that reads a bit more like English then they double as specs, or at least that's the idea.
<vktec>
That seems to imply that assert style is "testing" whereas expect is "speccing". Is that correct?
<vktec>
havenwood: Ah, okay. Thanks for clarifiying :)
<havenwood>
vktec: Yes, that's one of the semantic differences.
<adam12>
newrubycoder: you have the specs for this? It's not obvious what it does
dc4 has joined #ruby
<adam12>
Also, when you gist, can you make sure it's indented correctly and the proper file type (for syntax highlighting). It makes it easier on the people helping.
alibby has quit [Read error: No route to host]
binaryplease has joined #ruby
hutch34 has quit [Ping timeout: 260 seconds]
alibby has joined #ruby
blackbom1 has quit [Ping timeout: 255 seconds]
last_staff has joined #ruby
<newrubycoder>
adam12: it compares the first 3 digits and next 3 digits of a 6 digit number with eachother, if the sum is the same its true, if not false, the problem is that i wanna make any number with letters become false
blackmes1 has quit [Ping timeout: 245 seconds]
<adam12>
And it's always numbers, never any letters
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Ping timeout: 255 seconds]
blackbom1 has joined #ruby
<adam12>
newrubycoder: I would do an eager return at the top of `is_lucky`, if it finds any non-integers inside the string. Something like this: return false if ticket =~ /\D/
<adam12>
newrubycoder: the first part is a regular expression match (=~), and the second part is a regular expression that matches anything non-decimal (anything not 0-9)
lenwood has quit [Quit: Konversation terminated!]
manjaro-kde5_ has joined #ruby
<newrubycoder>
adam12: is there any way to reject empty expressions?
<newrubycoder>
like if it's ("")
duderonomy has quit [Ping timeout: 256 seconds]
<adam12>
newrubycoder: You could put another eager return to compare ticket == ""
<adam12>
newrubycoder: or you could append to the current eager return with an or conditional ( || )
<adam12>
But I would guess that the \D in the regular expression will work for you
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
Actually, it won't. My bad.
browndawg has quit [Quit: Leaving]
<adam12>
I'd probably return false if it's not 6 characters long, instead of testing for ""
tlahtoani has joined #ruby
<newrubycoder>
well i bypassed the test :D but you're right it's not optimal, i'm just praying the 3 first aren't the same as the next 3 in an illegal 6+ digit number
<newrubycoder>
is text.length a suitable command?
art-solopov has joined #ruby
alexherb1 has joined #ruby
mlindahl has joined #ruby
<newrubycoder>
i guess it would be only .length
alexherb1 has quit [Client Quit]
alexherbo2 has joined #ruby
blackmes1 has joined #ruby
<newrubycoder>
yay it's done Kreygasm
alexherbo2 is now known as alex``
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
dc4 has quit [Ping timeout: 276 seconds]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
mlindahl has quit [Ping timeout: 256 seconds]
nobitanobi has quit [Ping timeout: 248 seconds]
JeanCarloMachado has joined #ruby
<newrubycoder>
adam12: the return false if command was just what i was looking for, didnt know you could do that
blackbombay has joined #ruby
Channel6 has joined #ruby
blackbom1 has quit [Ping timeout: 240 seconds]
grh has quit [Ping timeout: 240 seconds]
danielpclark has joined #ruby
kht has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
nankyokusei has quit [Remote host closed the connection]
antgel has quit [Ping timeout: 252 seconds]
JeanCarloMachado has joined #ruby
nofxx has joined #ruby
blackbombay has quit [Ping timeout: 260 seconds]
blackbombay has joined #ruby
kht has quit [Ping timeout: 264 seconds]
JeanCarloMachado has quit [Ping timeout: 255 seconds]
JeanCarloMachado has joined #ruby
kht has joined #ruby
eblip has quit [Remote host closed the connection]
eb0t has joined #ruby
phaza has quit [Read error: Connection reset by peer]
nankyokusei has joined #ruby
xen0fon has joined #ruby
phoo1234567 has joined #ruby
kht has quit [Ping timeout: 245 seconds]
xen0fon has quit [Client Quit]
nankyokusei has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 248 seconds]
JeanCarloMachado has joined #ruby
blackmes1 has quit [Ping timeout: 255 seconds]
Miah_ has joined #ruby
nofxx has quit [Read error: Connection reset by peer]
nofxx has joined #ruby
dviola has quit [Ping timeout: 255 seconds]
karapetyan has joined #ruby
houhoulis has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 245 seconds]
anotherpi has quit [Ping timeout: 252 seconds]
JeanCarloMachado has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #ruby
vikaton has quit [Quit: Connection closed for inactivity]
gizmore has joined #ruby
JeanCarloMachado has quit [Ping timeout: 248 seconds]
blackmes1 has joined #ruby
JeanCarloMachado has joined #ruby
lxsameer has joined #ruby
tomphp has joined #ruby
shinnya has joined #ruby
LiquidInsect has quit [Ping timeout: 240 seconds]
blackbombay has quit [Ping timeout: 276 seconds]
mlindahl_ has joined #ruby
johnny56_ has quit [Ping timeout: 264 seconds]
blackmes1 has quit [Ping timeout: 255 seconds]
blackbombay has joined #ruby
pragmaticus has quit [Ping timeout: 255 seconds]
<phreakocious>
having some trouble with Rubymine.. I'd like to start an IRB console in the context of a class, but the console doesn't work quite right. anyone know a trick to make this work right?
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phreakocious>
using a breakpoint would be nice, but I need other threads to keep executing :/
JeanCarloMachado has quit [Ping timeout: 252 seconds]
blackmes1 has joined #ruby
clauswitt has joined #ruby
tomphp has joined #ruby
JeanCarloMachado has joined #ruby
CrazyEddy has quit [Ping timeout: 240 seconds]
<danielpclark>
phreakocious, if you're using ruby 2.4 require 'irb'; binding.irb
D100 has quit [Quit: Leaving]
<phreakocious>
on 2.3 because of some 2.4 gem issues sadly, but thanks
<Radar>
what 2.4 gem issues?
<phreakocious>
version compatibility problems between two gems that depended on different versions of faraday
szulak has joined #ruby
blackbombay has quit [Ping timeout: 240 seconds]
tomphp has quit [Client Quit]
nofxxx has joined #ruby
binaryplease has quit [Quit: binaryplease]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
nofxx has quit [Ping timeout: 256 seconds]
shinnya has quit [Ping timeout: 245 seconds]
manjaro-kde5_ has quit [Ping timeout: 240 seconds]
andrzejku has quit [Quit: This computer has gone to sleep]
<Zarthus>
i like being verbose in ruby with .split
<Zarthus>
makes it more readable to a non-rubyist
<baweaver>
depends on the situation, but I find if I'm working in a Ruby codebase that trying to be non-rubyist accomodating is a bit of a strange thing
<Zarthus>
i suppose i write a lot of open source software :P
<baweaver>
Oh I do too.
phoo1234567 has quit [Quit: Gotta go]
<Zarthus>
Just in general being verbose or explicit makes you think less about what the default value may be
<newrubycoder>
nah i will read about .map
<baweaver>
newrubycoder: it can be a bit dense.
<baweaver>
what do you think it is currently?
<Zarthus>
but overall it'll be defined in the styleguide
blackmesa has quit [Ping timeout: 258 seconds]
<baweaver>
Zarthus: starting to sound like the Zen of Python there ;)
<baweaver>
(* which isn't a bad thing, mind, but be careful how far you take it)
<Zarthus>
baweaver: I write a lot of different languages!
jaxxstorm has quit [Remote host closed the connection]
<baweaver>
fair
<Zarthus>
remembering the defaults and caveats of every language gets a bit tricky sometimes.
<baweaver>
It can be, but whenever I switch to speaking Spanish I try and keep the defaults and caveats
<baweaver>
I try and avoid having an accent in a language if I can help it
<Zarthus>
hehe
<baweaver>
not saying that's necessary, but it's what I do.
<baweaver>
It also works with case statements, which is really dang nice considering it knows CIDR blocks / subnetting
JeanCarloMachado has joined #ruby
<baweaver>
newrubycoder: map is a non-mutating function as well, so the original is not transformed and a new array is given with every value "mapped" through the function (block)
<baweaver>
so now a doesn't have its last value, it was given to b
<baweaver>
Now as far as the map(&:to_i) bit, that's shorthand for: values.map { |x| x.to_i }
volty has joined #ruby
<baweaver>
In a lot of the examples I give I'll be purposely verbose at first, and naturally someone will mention it later.
<baweaver>
newrubycoder: so do you understand map any better, or am I being a bit vague?
<newrubycoder>
no i understand it better i think, if im not wrong .map(&:to_i) takes every value in the array and runs it through the .to_i if im right
<baweaver>
yep
<baweaver>
same with to_s and to_f
<newrubycoder>
but isn't it easier and more efficient to use .to_i than map(&:to_i)? or is it different
<baweaver>
reduce is a harder one to get
<baweaver>
You can't really to_i an array
CloCkWeRX has joined #ruby
<baweaver>
so you have to transform each string in your array to an integer
<newrubycoder>
ah ok thanks i get it better :D
<baweaver>
Now you _could_ inline that to your sort, yes.