__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nofxx has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
Chagel has joined #ruby
A_Drone has joined #ruby
saneax-_-|AFK is now known as saneax
dc4 has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
ta has quit [Ping timeout: 264 seconds]
SiliconDon has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
DTZUZO has quit [Quit: WeeChat 1.5]
CloCkWeRX has quit [Ping timeout: 245 seconds]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arescorpio has quit [Quit: Leaving.]
cibs has quit [Ping timeout: 240 seconds]
_3by8 has quit [Quit: Page closed]
LoneHerm_ has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
LoneHermit has joined #ruby
cibs has joined #ruby
nunchuck has quit [Read error: Connection reset by peer]
deduped has quit [Read error: Connection reset by peer]
nanoz has joined #ruby
hakash has joined #ruby
hotpancakes has quit [Remote host closed the connection]
ifctj has joined #ruby
CloCkWeRX has joined #ruby
rippa has joined #ruby
mistermocha has joined #ruby
brent__ has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 255 seconds]
cschneid_ has joined #ruby
ifctj has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
JeanCarloMachado has quit [Ping timeout: 264 seconds]
hotpancakes has joined #ruby
JeanCarloMachado has joined #ruby
cschneid_ has quit [Ping timeout: 255 seconds]
pragmatism has quit [Quit: Connection.close!]
dc4 has quit [Ping timeout: 252 seconds]
montanonic has quit [Remote host closed the connection]
ifctj has joined #ruby
roamingdog has quit [Read error: Connection reset by peer]
JeanCarloMachado has quit [Ping timeout: 256 seconds]
JeanCarloMachado has joined #ruby
nanoz has quit [Read error: Connection reset by peer]
abdulmugni has joined #ruby
reverberations has joined #ruby
bkxd has joined #ruby
hutch34 has joined #ruby
akaiiro has quit [Ping timeout: 256 seconds]
Anonymoose2 has quit [Ping timeout: 240 seconds]
markholmes has joined #ruby
JeanCarloMachado has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
ta has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
<dminuoso>
So I got hardware of various types, implementing the same abstract functionality differently. Now I want runtime polymorphic behavior, so that if I interact with that hardware, the correct class is picked. If no correct class is available it would default to the abstract base class that throws NotImplementedErrors.
<dminuoso>
This Ive already implemented through a bit hackish usage of const_get, where I essentially do def create(type, *args); Cards.const_get(type).new(*args); end, having Cards::Foo, Cards::Bar as specific implementations.
<dminuoso>
It feels awkward and testing is quite annoying
cibs has quit [Ping timeout: 240 seconds]
ta has quit [Ping timeout: 240 seconds]
cschneid_ has joined #ruby
cibs has joined #ruby
JeanCarloMachado has joined #ruby
teclator has joined #ruby
despai has joined #ruby
cschneid_ has quit [Ping timeout: 258 seconds]
elifoster has quit [Quit: sleep]
anisha has joined #ruby
JeanCarloMachado has quit [Ping timeout: 245 seconds]
JeanCarloMachado has joined #ruby
enterprisey has quit [Remote host closed the connection]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jcao219 has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
ifctj has quit [Read error: Connection reset by peer]
ifctj has joined #ruby
lxsameer has joined #ruby
hotpancakes has joined #ruby
msmith has joined #ruby
Chagel has quit [Ping timeout: 240 seconds]
last_staff has joined #ruby
Chagel has joined #ruby
JeanCarloMachado has joined #ruby
conta has joined #ruby
ifctj has quit [Ping timeout: 258 seconds]
LoneHermit has quit [Remote host closed the connection]
LoneHerm_ has joined #ruby
Guest57252 has quit [Ping timeout: 260 seconds]
LoneHerm_ has quit [Ping timeout: 258 seconds]
kent\n has quit [Ping timeout: 255 seconds]
MrBusiness has quit [Ping timeout: 245 seconds]
kent\n has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
bkxd has joined #ruby
Guest46409 has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
msg31 has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
JeanCarloMachado has joined #ruby
grh has joined #ruby
vondruch_ has quit [Ping timeout: 260 seconds]
despai has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 260 seconds]
sysvalve has joined #ruby
simmaniac has joined #ruby
aganov has joined #ruby
sysvalve has quit [Ping timeout: 255 seconds]
<kke>
how can i list (or bundle package) only runtime dependencies for a gem?
djbkd has quit [Quit: Leaving...]
msmith has quit [Ping timeout: 258 seconds]
despai has joined #ruby
biberu has joined #ruby
mark_66 has joined #ruby
Snickers has joined #ruby
blaxter has joined #ruby
rajat has joined #ruby
szulak has joined #ruby
djbkd4 has quit [Quit: node-irc says goodbye]
despai has quit [Read error: Connection reset by peer]
despai has joined #ruby
ta has joined #ruby
<kke>
removing the development deps from gemspec is so far the only way i can find
simmaniac has quit [Ping timeout: 255 seconds]
pandaant has joined #ruby
knutmithut has joined #ruby
vondruch_ has joined #ruby
<dminuoso>
knutmithut: for bundle its simply "bundle show"
<dminuoso>
kke I mean (dont even ask me why irssi keeps making mistakes)
blaxter has quit [Quit: foo]
SteenJobs has quit [Quit: SteenJobs]
ta has quit [Ping timeout: 240 seconds]
Mortomes|Work has joined #ruby
pandaant has quit [Remote host closed the connection]
Chagel has quit [Ping timeout: 264 seconds]
aupadhye has joined #ruby
BackEndCoder has quit [Excess Flood]
djellemah_ has joined #ruby
djellemah_ has quit [Remote host closed the connection]
BackEndCoder has joined #ruby
hakash has quit [Ping timeout: 258 seconds]
<havenwood>
kke: Just for "fun": the_gem="rails"; the_version="5.0.1"; gem dependency "$the_gem" --remote --version "$the_version" | sed -n "/^Gem $the_gem-$the_version$/,/^$/p" | sed '1d;$d'
djbkd has joined #ruby
andikr has joined #ruby
<kke>
bundle show requires that you install the bundle, that may not be a problem, but still annoying
<kke>
i think
Chagel has joined #ruby
vondruch_ is now known as vondruch
<kke>
and does that include all the deps of the deps?
<havenwood>
kke: Are you trying to see what versions of what gems a Gemfile resolves to without creating a Gemfile.lock?
byte512 has joined #ruby
TheHodge has joined #ruby
<dminuoso>
kke: bundle show will show you the bundled gems, essentially the contents of your Gemfile.lock
DaniG2k has joined #ruby
<dminuoso>
kke: "gem dependency" or "gem dependency -R" would give you the dependnecy tree without installing them
<kke>
i want to list the whole tree of runtime dependencies, preferably from either a .gem or .gemspec
<kke>
yes but gem dependency gives all the development deps
<havenwood>
kke: See my little example above.
<havenwood>
kke: Are you wanting to know for one gem or for the whole gemfile?
<havenwood>
kke: For the whole Gemfile: gem install -g --explain
<havenwood>
kke: For one gem: gem install [gem name here] --explain
<havenwood>
kke: Or like dminuoso said, if you have a Gemfile.lock you can use: bundle show
* dminuoso
tosses a snowball in havenwood's direction
aufi has joined #ruby
<kke>
i think -g --explain gives what i need, nice.
ketan has quit [Remote host closed the connection]
ketan has joined #ruby
terens has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Ping timeout: 255 seconds]
tyang has joined #ruby
xen0fon has quit [Quit: xen0fon]
Guest71657 has quit [Quit: Leaving]
jameser has joined #ruby
<kke>
hm. depends_on :ruby => '2.1' --> brew install the-formula, all ok --> brew info ruby says Not installed
<kke>
brewing is hard.
<marchelzo>
T_T
lenwood has joined #ruby
despai has joined #ruby
ifctj has joined #ruby
dionysus70 has joined #ruby
aibot___ has joined #ruby
Yxhvd has joined #ruby
teclator_ has joined #ruby
boshhead_ has joined #ruby
jrmhurst92 has joined #ruby
ichthys has joined #ruby
gse_ has joined #ruby
lupine_ has joined #ruby
crankhar1er has joined #ruby
Ariadeno has joined #ruby
A124 has quit [Disconnected by services]
b0nn__ has joined #ruby
A124 has joined #ruby
SuperLag_ has joined #ruby
cschneid_ has joined #ruby
ec\_ has joined #ruby
LiquidIn1ect has joined #ruby
BadAtom_ has joined #ruby
Sp4rKy_ has joined #ruby
izaac_ has joined #ruby
CloCkWeRX has left #ruby [#ruby]
Yxhuvud has quit [Write error: Broken pipe]
teclator has quit [Write error: Broken pipe]
aibot__ has quit [Write error: Broken pipe]
Ariadeno_ has quit [Write error: Broken pipe]
BadAtom has quit [Write error: Broken pipe]
piotrj has quit [Write error: Broken pipe]
SCHAAP137 has quit [Excess Flood]
millerti has quit [Excess Flood]
Subfusc has quit [Excess Flood]
rt has quit [Excess Flood]
lupine has quit [Quit: No Ping reply in 180 seconds.]
is_null has quit [Quit: No Ping reply in 180 seconds.]
boshhead has quit [Quit: No Ping reply in 180 seconds.]
dionysus69 has quit [Remote host closed the connection]
jrmhurs102 has quit [Remote host closed the connection]
midacts has quit [Remote host closed the connection]
mnemon has quit [Remote host closed the connection]
gse has quit [Remote host closed the connection]
raldu has quit [Remote host closed the connection]
SuperLag has quit [Remote host closed the connection]
ec\ has quit [Remote host closed the connection]
Sp4rKy has quit [Remote host closed the connection]
piotrj has joined #ruby
Subfusc_ has joined #ruby
Sp4rKy_ is now known as Sp4rKy
mnemon has joined #ruby
is_null has joined #ruby
Subfusc_ is now known as Subfusc
volix_ has joined #ruby
rt has joined #ruby
millerti has joined #ruby
dionysus70 has quit [Ping timeout: 245 seconds]
vondruch_ has joined #ruby
cschneid_ has quit [Ping timeout: 255 seconds]
phansch_ has joined #ruby
izaac has quit [Ping timeout: 258 seconds]
aupadhye has quit [Ping timeout: 258 seconds]
LiquidInsect has quit [Ping timeout: 258 seconds]
b0nn has quit [Ping timeout: 258 seconds]
volix has quit [Ping timeout: 258 seconds]
phansch has quit [Ping timeout: 258 seconds]
crankharder has quit [Ping timeout: 258 seconds]
vondruch has quit [Ping timeout: 260 seconds]
is_null has quit [Changing host]
is_null has joined #ruby
raldu has joined #ruby
SCHAAP137 has joined #ruby
volix_ is now known as volix
rajat has joined #ruby
bw_ has joined #ruby
volix has quit [Changing host]
volix has joined #ruby
msmith has joined #ruby
Mortomes|Work has quit [Ping timeout: 260 seconds]
AnoHito_ has quit [Read error: Connection reset by peer]
AnoHito_ has joined #ruby
AnoHito_ has quit [Read error: Connection reset by peer]
AnoHito_ has joined #ruby
AnoHito_ has quit [Read error: Connection reset by peer]
AnoHito_ has joined #ruby
ketan has quit [Remote host closed the connection]
ketan has joined #ruby
hutch34 has joined #ruby
OTORelic has joined #ruby
bkxd has joined #ruby
bergalath has joined #ruby
malconis has joined #ruby
malconis is now known as malconis_
sagax has quit [Remote host closed the connection]
spooq has quit [Ping timeout: 276 seconds]
opt9 has quit [Ping timeout: 240 seconds]
msmith has quit [Remote host closed the connection]
msmith has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
lele has quit [Ping timeout: 252 seconds]
opt9 has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
rajat has quit [Ping timeout: 255 seconds]
lele has joined #ruby
szulak has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
cdg has joined #ruby
xen0fon has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
OTORelic1 has joined #ruby
cdg has joined #ruby
hotpancakes has joined #ruby
jameser_ has joined #ruby
OTORelic has quit [Ping timeout: 256 seconds]
anisha has quit [Quit: This computer has gone to sleep]
Bob` has quit [Ping timeout: 256 seconds]
jameser has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Ping timeout: 255 seconds]
ramortegui has joined #ruby
james has joined #ruby
<james>
active_support/json (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55
james is now known as Guest29275
<Guest29275>
pls find this errot
<Guest29275>
active_support/json (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55
xall has joined #ruby
A124 has quit [Quit: '']
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
bmurt has joined #ruby
cdg_ has joined #ruby
<xf000>
http://pastebin.com/QeKvgc0q how would one go about defeating the monsters in this? I am trying to work out if its possible to defeat the monsters. So when the flag is in your inventory, you would use "describe " to get the value?
jhack has quit [Read error: Connection reset by peer]
cdg has quit [Ping timeout: 252 seconds]
jhack has joined #ruby
jhack has quit [Read error: Connection reset by peer]
<pagios>
i am using require 'rbnacl', i am getting decryption error when sending text, if i change the text i get a correct decryption can anyone help?
Lord_of_Life has quit [Excess Flood]
Lord_of_Life has joined #ruby
jhack has joined #ruby
<pagios>
its a random error,
<pagios>
sometimes it decrypts sometimes it doesnt
jhack_ has quit [Read error: Connection reset by peer]
jhack_ has joined #ruby
jhack_ has quit [Read error: Connection reset by peer]
roberts` has joined #ruby
jhack has quit [Read error: Connection reset by peer]
workmad3 has quit [Read error: Connection reset by peer]
<pagios>
i am using Get requests
<pagios>
so for example if i send a clear text being 'A' it gets encrypted in javascript , encoded and then sent to ruby, ruby decodes base64, decrypts and no error. If i try on 'AB' for example i get a decryption error
mikecmpbll has quit [Read error: Connection reset by peer]
Bob` has quit [Read error: Connection reset by peer]
nikivi has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
Beams has joined #ruby
DenSchub has quit [Max SendQ exceeded]
<Papierkorb>
pagios: why are you doing crypto stuff yourself?
mikecmpb_ has joined #ruby
AnoHito_ has quit [Read error: Connection reset by peer]
jhack has joined #ruby
DenSchub has joined #ruby
Derperpe1 has quit [Ping timeout: 240 seconds]
<pagios>
Papierkorb, coz i am generating qrcode and that qrcode needs to be encrypted
<pagios>
i dont want that qrcode to reveal any readable data
<pagios>
so i need to do crypto on it
<pagios>
ssl and such wont help in this case
hogetaro has quit [Ping timeout: 240 seconds]
nikivi has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gnufied has joined #ruby
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
shinnya has joined #ruby
DLSteve has joined #ruby
despai has quit [Read error: Connection reset by peer]
<newrubycoder>
i still don't know the each command, basically any solution i have is a workaround to avoid each :(
despai has joined #ruby
ifctj has quit [Ping timeout: 264 seconds]
bkxd has joined #ruby
Snickers_ has quit [Ping timeout: 255 seconds]
aufi has joined #ruby
malconis_ has quit [Read error: Connection reset by peer]
SteenJobs has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
polishdub has joined #ruby
ocbtec has joined #ruby
ketan has quit []
<pagios>
Papierkorb, any hintS?
<Papierkorb>
pagios: You didn't give anything to work with
<pagios>
Papierkorb, i am using libsodium secretbox on javascript and ruby side
<pagios>
can i pm you?
chouhoulis has quit [Remote host closed the connection]
malconis has joined #ruby
ifctj has joined #ruby
<Papierkorb>
No, I never used libsodium, and this channel is here to help.
<pagios>
what else can i use something that owrks for javascript and ruby too
<pagios>
enc/decrypt
mim1k has joined #ruby
pabs_ is now known as pabs
ferr1 has quit [Quit: WeeChat 1.6]
SteenJobs has quit [Quit: SteenJobs]
grh has quit [Ping timeout: 256 seconds]
ketan has joined #ruby
ifctj has quit [Ping timeout: 264 seconds]
CloCkWeRX has joined #ruby
bmurt has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
saneax is now known as saneax-_-|AFK
x00r__ has joined #ruby
cpruitt has joined #ruby
xen0fon has quit [Quit: xen0fon]
Lord_of_Life has quit [Excess Flood]
chouhoulis has joined #ruby
mim1k has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Lord_of_Life has joined #ruby
<apeiros>
newrubycoder: you understand what an array is?
jrafanie has joined #ruby
hotpancakes has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
mustmodify has joined #ruby
<ketan>
Is it ok to post a job here that's just become available in the company I work for?
lenwood has quit [Ping timeout: 255 seconds]
hakash has joined #ruby
<mustmodify>
sure. Maybe not the most effective place. :)
<havenwood>
ketan: No prob.
<marchelzo>
ketan: hire me
<ketan>
cool, I'm a Ruby developer at Survival International, a human rights charity in London. We have a job opening for a Ruby developer. Details are here: http://www.survivalinternational.org/info/work
<marchelzo>
i can work remote. we'll start tomorrow.
<ketan>
To apply, send your CV, and a cover letter, to rubydeveloper@survivalinternational.org, by 10 March
hotpancakes has quit [Ping timeout: 255 seconds]
patarr has joined #ruby
<marchelzo>
remote is not a possibility?
<ketan>
This is a full-time role in London, we are not offering remote working at the moment, sorry.
<marchelzo>
you're making a grave mistake
bmurt has joined #ruby
hakash has quit [Ping timeout: 258 seconds]
<IonutVan_>
ketan, hire me now, and I will be in london in two days
<ketan>
IonutVan_: Please send your info to rubydeveloper@survivalinternational.org, the application deadline is 10th March
<IonutVan_>
ah, I was thinking that is enough to be in this channel, to get hired
<marchelzo>
it should be
<IonutVan_>
if you want app process, I will not do it, too much politics and time spent
<marchelzo>
i've almost a *month* of experience working with ruby
<IonutVan_>
marchelzo, they don't want juniors :)
<marchelzo>
i'm no junior
SuperLag_ is now known as SuperLag
<IonutVan_>
you not, but perhaps your ruby skills :)
SuperLag has quit [Changing host]
SuperLag has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
<marchelzo>
i learn fast
<IonutVan_>
how fast? show us
<matthewd>
?ot
<ruby[bot]>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
jhack has quit [Quit: jhack]
<marchelzo>
matthewd: this is ruby-related
<marchelzo>
IonutVan_: how can i prove my ruby skills to you
<ketan>
Just to give you an idea, I started in July as a bootcamp graduate, this is my first Ruby job. The main thing we're looking for is someone who is familiar with Ruby and knows their way around a Rails project, everything else you will learn on the job.
jhack has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
braincrash has joined #ruby
<marchelzo>
oh i don't qualify then
<ketan>
IonutVan_: Do you have a github account or some recent projects. Also, I think a CV will be necessary. The application process is not that long. If we like your CV/projects we call you in for an interview an a possible 2nd interview and that's it.
<ketan>
*and
aufi has quit [Ping timeout: 245 seconds]
<apeiros>
?ot
<ruby[bot]>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<apeiros>
matthewd was right
<marchelzo>
no but you are
<apeiros>
don't make me pull my wizard hat
<marchelzo>
it wasn't ot then but it is now
<marchelzo>
(imho)
<IonutVan_>
ketan, I was joking, I don't plan to move to uk, but perhaps remote
<apeiros>
for future record: posting info about a job opening: on-topic. but replies go either to PM or offtopic
<IonutVan_>
apeiros, marchelzo sorry
<newrubycoder>
apeiros: yeah an array is like a collection of stuff
<ketan>
IonutVan_: No problem
<apeiros>
newrubycoder: correct. now what if you want to, for example, print out every item in an array?
<apeiros>
or should I say, "each item" in the array
<toretore>
newrubycoder: have you done any other programming before ruby?
<apeiros>
newrubycoder: ok, lets say "store each item in a db", the call is `db.store(item)`
<marchelzo>
db.store(my_array.join)
<newrubycoder>
nah i'm a very fresh coder who suck at maths
<marchelzo>
db.store_items(my_array)
Mia has joined #ruby
<apeiros>
marchelzo: no, the point is that you have to store the items individually
<marchelzo>
i was being intentionally dense as a joke
<apeiros>
marchelzo: that is not helpful for newrubycoder
<marchelzo>
indeed not
<IonutVan_>
ah, forgot "end"
andikr has quit [Remote host closed the connection]
<newrubycoder>
dont know
bkxd has joined #ruby
<apeiros>
newrubycoder: each exists to enumerate each item in an array
<apeiros>
so you'd do: array.each do |item| db.store(item) end
mistermocha has quit [Ping timeout: 255 seconds]
<apeiros>
the `do … end` part is executed once for every item in the array.
<newrubycoder>
are all the outputs collected
chouhoulis has quit [Remote host closed the connection]
<apeiros>
no
chouhoulis has joined #ruby
<apeiros>
the return value of array.each is array
braincrash has quit [Ping timeout: 264 seconds]
<apeiros>
each exists for side-effects
<newrubycoder>
array.each do |item| db.store(item) end what is item in this code?
<apeiros>
i.e., the return value of the block is irrelevant, and so is (usually) the return value of each itself too, as it is always the object the method is called upon.
<apeiros>
newrubycoder: with array = [1,2,3], it will be `1` in the first invocation, `2` in the second, and `3` in the last.
antoniobeyah has joined #ruby
milardovich has quit []
bkxd has quit [Ping timeout: 264 seconds]
Xentil has joined #ruby
braincrash has joined #ruby
hotpancakes has joined #ruby
<newrubycoder>
.store makes hashes?
<IonutVan_>
is there any diff between do...end or {...}
<havenwood>
IonutVan_: Precedence.
aganov has quit [Remote host closed the connection]
<havenwood>
IonutVan_: If there was an argument before the block you'd need to use parens with {/} because of its precedence but not with do/end.
<IonutVan_>
newrubycoder, the above link is good for you as well
mustmodify has left #ruby [#ruby]
<IonutVan_>
havenwood, ok, thanks
<toretore>
newrubycoder: it's irrelevant what .store does, it has nothing to do with understanding .each
mim1k has quit [Quit: leaving]
amagawdd has joined #ruby
maloik15 has quit [Remote host closed the connection]
maloik has joined #ruby
<newrubycoder>
i dont get why .map was so easy to understand and .each is so hard
<toretore>
how does map work then?
cschneid_ has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
mark_66 has quit [Remote host closed the connection]
<newrubycoder>
it operates on each part of an array
<toretore>
.. and?
<newrubycoder>
then outputs the values it gets from each operation i think
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<toretore>
define "outputs"
benlieb has joined #ruby
<toretore>
i think the problem you're having is that you don't understand expressions and where values are created and where they go
railswebdev has joined #ruby
Guest69 has joined #ruby
boshhead_ is now known as boshhead
<newrubycoder>
it returns the values, but doesnt print it
despai has joined #ruby
<toretore>
where do the values go?
<newrubycoder>
it stays in the ram
<toretore>
no
<toretore>
not unless you store them somewhere
<newrubycoder>
stay in the cpu?
<toretore>
no
xen0fon has joined #ruby
<toretore>
forget about ram and cpu, it doesn't matter
<havenwood>
newrubycoder: map returns a new array, where every item is the result of invoking the block on every corresponding item in the original collection
Derperpe1 has joined #ruby
<havenwood>
newrubycoder: each is the same, except it returns the original collection, only invoking the block on every item for purposes of side effects
<newrubycoder>
what's a side effect tbh?
<newrubycoder>
toretore all i know in codewars is that if i puts something, it gets rejected, but if i return it/output it it gets accepted granted it's correct
<toretore>
actually, i think you should just forget about each for now
<havenwood>
newrubycoder: A side effect is changing something else. Like printing, or mutating a value.
jgnagy has joined #ruby
<toretore>
you don't need it, and you shouldn't be using it
<toretore>
if you can learn to program without side effects that's not negative
<havenwood>
newrubycoder: You use map for its return value, since it returns the collection mapped to an Array. You don't use each for its return value. It returns the collection you call it on. You use each for its side effects.
quoboo has quit []
emilkarl has quit [Quit: emilkarl]
mrVandermare has joined #ruby
<newrubycoder>
havenwood: ok so how do i use side effects? can i create a new variable and get all the side effects? or do i use it on a pre existing variable?
<havenwood>
newrubycoder: In irb or pry try `[1, 2, 3].each { |n| puts n + 1 }`. What is the side effect? What does it return?
Exuma has joined #ruby
<baweaver>
admittedly I'd worry very little about printing as a side effect compared to mutation.
<newrubycoder>
2 3 4
Rr4sT has quit [Quit: Connection closed for inactivity]
<havenwood>
IonutVan_: So which of those things is the side effect and which is the return value?
<baweaver>
Also remember that puts returns nil
<newrubycoder>
'[1' is not recognized as an internal or external command, operable program or batch file. so i removed the tildes and that's what i got
<baweaver>
yeah, whenever we put tildes take them off
<baweaver>
that's just to say this is the code
<havenwood>
newrubycoder: Tildes are used for code examples to enclose code.
<newrubycoder>
kk
<baweaver>
habit from using too much Git, Slack, and other tools
<newrubycoder>
oh now i see it
<newrubycoder>
it says 2 3 4 then [1,2,3]
<bougyman>
it output 2 3 4
<bougyman>
it returned [1,2,3]
flying has joined #ruby
inbx has joined #ruby
top4o has left #ruby [#ruby]
<IonutVan_>
what is returned is not so important
<havenwood>
newrubycoder: So no matter what you do with each value as you iterate through, it's going to return you the same initial collection you called it on. In a long like Elixir it simply returns `:ok` since you don't use the return value of each.
<jgnagy>
best OTP library (including performing OTP verification) for ruby github.com/mdp/rotp? any better suggestions?
<havenwood>
lang*
troulouliou_div2 has joined #ruby
<baweaver>
>> a = [1, 2, 3]; a.each{ |v| v += 5 }; a
<newrubycoder>
how do you store these side effects or use them for anything?
<toretore>
how do you store anything?
emilkarl has joined #ruby
inbx_ has quit [Client Quit]
<jgnagy>
getting philosophical in here
<toretore>
i still think you should forget about each and stop worrying about understanding it and side effects for now
<havenwood>
newrubycoder: Given `last_side_effect = nil; [1, 2, 3].each { |n| last_side_effect = n + 42 }` what is the new value of `last_side_effect`?
<havenwood>
newrubycoder: Maybe the side effect is making a light blink. Maybe printing something or an API call. Variables could be involved as well. Up to you.
<havenwood>
newrubycoder: Iterate over each item in a collection and do a thing. Not for the return value but for the sake of doing the thing.
LoneHermit has joined #ruby
<havenwood>
newrubycoder: Does that make sense?
sepp2k has joined #ruby
emilkarl has quit [Quit: emilkarl]
<newrubycoder>
yeah sort of but only if i can access it and output it somehow
blaxter has quit [Client Quit]
<havenwood>
newrubycoder: Maybe do like toretore said, and don't use it until you need it.
<havenwood>
newrubycoder: It seems you get what it's for. I'm sure you'll find use soon enough!
<newrubycoder>
i can't just give up ruby coding because i suck at it right now, i must gun on and never look back and do my best and maybe i can become an okay coder :)
<havenwood>
newrubycoder: Practice with map. When you need something similar but aren't using the return value, remember each.
<newrubycoder>
i will
otolock has quit [Quit: Page closed]
LoneHermit has quit [Remote host closed the connection]
LoneHerm_ has joined #ruby
SuperLag has quit [Remote host closed the connection]
ocbtec has quit [Quit: leaving]
SuperLag has joined #ruby
inbx_ has joined #ruby
xall has joined #ruby
aupadhye has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
nahra` has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
bigkevmcd has joined #ruby
nahra has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
<newrubycoder>
any good place to learn fundamentals?
<newrubycoder>
i might stop codewaring and read a bit
vuoto has joined #ruby
xall has quit [Ping timeout: 240 seconds]
<baweaver>
The Well Grounded Rubyist or Eloquent Ruby
AnoHito has joined #ruby
<newrubycoder>
do they start very basic? cuz i have little coding experience from before
Boss16166 has joined #ruby
<havenwood>
newrubycoder: Learn to Program by Chris Pine starts with the very basics for new programmers and makes a good intro to those other books.
<knutmithut>
By system installed I mean that cloning the git repo and doing gem build/install manually worked and gem which unf_ext returns the correct path of the .so
mistermocha has quit [Remote host closed the connection]
speakingcode has joined #ruby
<fuzzyhorns>
a q: any way i can have reference to a receiver in each's block?
ur5us has quit [Ping timeout: 245 seconds]
<fuzzyhorns>
ie. [1,2,3,4].each { p self } will return main (or whatever the scope is)
<fuzzyhorns>
whereas i'd like to get access to the entire object
<fuzzyhorns>
without having to do it explicitly like a = [1,2,3,4]; a.each_with_object(a) {}
tvw has quit []
<toretore>
fuzzyhorns: why do you want this?
<fuzzyhorns>
toretore i'm comparing to something in haskell
nettoweb has quit [Ping timeout: 240 seconds]
* baweaver
attempts to parse question
<toretore>
(there isn't a straight forawrd way)
elementaru has quit [Remote host closed the connection]
<fuzzyhorns>
there's a long chain of thought that's making me explore what i can actually do with each and map
<fuzzyhorns>
baweaver: sigh, i know there's gems to do this stuff
jhn has joined #ruby
<fuzzyhorns>
& this is a different meaning of functor than what it means in haskell
ewandor has joined #ruby
<fuzzyhorns>
the context only matters in that this is a "how can this theoretically work" not "i am doing a practical task and should do it right" :d
samdvr has joined #ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<toretore>
fuzzyhorns: which is why i want to know why, i.e. exactly what practical task you're performing
grh has quit [Ping timeout: 264 seconds]
<toretore>
sorry misread
<fuzzyhorns>
toretore: …
<toretore>
it's *not* a practical task
<fuzzyhorns>
haha yes
<fuzzyhorns>
it is a million miles away from one
<toretore>
well that should be an indication
<fuzzyhorns>
with no pretension of it hah
<fuzzyhorns>
_but_ it is interesting in trying to understand what Ruby is capable of, in terms of what guarantees it can give you when you reason about it
<toretore>
there are no guarantees in ruby :P
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benlieb has joined #ruby
<toretore>
it will let you shoot yourself in the foot
<elomatreb>
But the source will look good while doing it
l4v2 has joined #ruby
dopamean_ has quit [Ping timeout: 256 seconds]
<toretore>
>> [1,2,3].instance_eval{ map{ self.length } } #like this
<toretore>
so pretty much anything you can think of, it will let you do it somehow
<toretore>
but 80% of the time it's a bad idea
mistermocha has joined #ruby
bmurt has joined #ruby
cdg has quit [Ping timeout: 260 seconds]
<fuzzyhorns>
toretore: hah awesome
<toretore>
fuzzyhorns: out of curiosity, how would functors let you do this?
dviola has joined #ruby
samdvr has left #ruby [#ruby]
<fuzzyhorns>
toretore: idk that they would necessarily, it's more that in working to understand the law they obey that i tried to see what if any laws each and map obey
<fuzzyhorns>
i thought each might at least preserve structure, but you can delete so it doesn't
<toretore>
laws + ruby = lol
<fuzzyhorns>
hehe i know, ruby is lawless to the max
<toretore>
i'm quite certain ruby's Enumerable does not follow the functor laws, or any other laws
<fuzzyhorns>
but the way i learn in general is contrasting stuff i know to new stuff
<fuzzyhorns>
toretore: well, i'm proving it doesn't right now so when i finish the blog post you can see lol
coreutil has joined #ruby
<fuzzyhorns>
i thought map might, if i introduced my composition operator, but sadly not really
coreutil has quit [Client Quit]
<leitz>
If method X is sometimes called as a mixin and sometimes from a module, how do you deal with the need for "self.X" part of the time?
coreutil has joined #ruby
coreutil has quit [Remote host closed the connection]
<toretore>
?code leitz
<ruby[bot]>
leitz: We can't help you without your code, please post it to https://gist.github.com
<toretore>
what you said doesn't make sense, show it with code instead
jhack has quit [Quit: jhack]
biberu has quit []
newbie1 has quit [Read error: Connection reset by peer]
<fuzzyhorns>
leitz i think i follow you, you mean sometimes you include it, and sometimes you call it as a class method on the module?
coreutil has joined #ruby
coreutil has quit [Remote host closed the connection]
<fuzzyhorns>
include it in another class i mean
newbie1 has joined #ruby
<fuzzyhorns>
(or is it extend when it's a class method, i always get them switched)
<leitz>
fuzzyhorns, yes.
<fuzzyhorns>
so what do you mean "handle"?
ur5us has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leitz>
The class Character has a mixin, CharacterTools, which has a method "generate_plot", which works when the Character.generate method is called. When running tests on CharacterTools.generate_plot, it gets an undefined local variable or method.
jhack has joined #ruby
<fuzzyhorns>
i'd have to see how the two are defined to give you more feedback really
<fuzzyhorns>
it should be obvious from the errors you're seeing thrown what's not in scope
<havenwood>
leitz: A link to a gist would be the best way to share the code. Consider using module_function, which will make the module method available on CharacterTools and also make the mixed-in instance method private on Character.
<toretore>
fuzzyhorns: thinking about it, stating that functor laws are "common sense", Enumerable probably does mostly follow them, as anything else would be surprising behavior
<leitz>
Working on the gist now, it's from a few files.
<toretore>
not including any crazy mutation you would throw in there
jhack has quit [Client Quit]
<fuzzyhorns>
toretore: if you write your blocks correctly, map follows them
<fuzzyhorns>
toretore: but you have no guarantees :c
<toretore>
no
jhack has joined #ruby
BackEndCoder has joined #ruby
swills_ has joined #ruby
grh has joined #ruby
swills has quit [Ping timeout: 256 seconds]
_sfiguser has quit [Quit: Leaving]
Guest69 has joined #ruby
railswebdev has joined #ruby
bkxd has joined #ruby
whathappens has quit [Remote host closed the connection]
<fuzzyhorns>
though module_function is a great convenience
<leitz>
fuzzyhorns, I'm actually making time to learn lots of stuff; the code is a toy to understand OOP and Ruby.
<fuzzyhorns>
havenwood: i know all about it — but i also knew from leitz's error message exactly what his problem was; i think it'd be good if he got some deeper understanding of why module_function works
<leitz>
Fortunatly, not for a class. I'm mildly slow.
enterprisey has quit [Remote host closed the connection]
<havenwood>
fuzzyhorns: good point
<fuzzyhorns>
leitz: for me "doing" is the best learning :)
<leitz>
I like the "13 tests, 33 assertions, 0 failures, 0 errors"
nankyokusei has joined #ruby
<fuzzyhorns>
as long as they started with 33 failures, that's great news x)
<leitz>
Except that I'm refactoring and broke most everything else.
nettoweb has joined #ruby
nettoweb1 has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
<leitz>
It's ~80 failures if I test evertying, this is just the CharacterTools module.
<leitz>
One crisis at a time...
JeanCarloMachado has joined #ruby
<fuzzyhorns>
oh i'm just saying tests only prove something is working if they started out from proving it's not working
larcara has quit []
tomphp has joined #ruby
<leitz>
Understood. Most of the tests passed as I didn't change as much in this file. I was having issues with name collisions preventing program growth and am slowly moving forward.
nankyokusei has quit [Ping timeout: 256 seconds]
mistermocha has quit [Remote host closed the connection]
ur5us has joined #ruby
l4v2 has joined #ruby
ur5us has quit [Remote host closed the connection]
despai has quit [Ping timeout: 258 seconds]
<fuzzyhorns>
leitz: yep, good luck :)
<leitz>
I will point out something from the PHP community though, for all you experts. The PHP Mentor stuff is pretty useful for overall guidance. For example, I have about fifteen thousnd things to learn in Ruby; knowing which ones to focus on first would help.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fernando-Basso has quit [Quit: WeeChat 1.7]
<leitz>
fuzzyhorns, I actually have several books and access to videos through Safaribooksonline. I'm working through the code, with the Pickaxe book on one hand and a few other books handy. Like Metz's OOP and Eloquent Ruby.
<leitz>
I have more resources than brain cells, it seems.
<baweaver>
leitz: see the channel topic
<baweaver>
working on curating a book list
<fuzzyhorns>
leitz: i do love metz
<nofxx>
leitz, use rubocop *inside* your editor.... great to learn/refactor
<fuzzyhorns>
her advice extends across languages too
whathappens has quit [Read error: Connection reset by peer]
<elomatreb>
I'm not sure (not that much bundler experience), but if you put the gem in *your* gemfile (either pointing to the local copy or to the git repo), wouldn't it use that instead of the version from rubygems?
<fuzzyhorns>
so download the gem locally, then point to it via bundle config
enterprisey has joined #ruby
<fuzzyhorns>
elomatreb: i dont think so if it's a transitive dependency :/
<fuzzyhorns>
maybe though
<knutmithut>
gonna try it, thank you :)
whathappens has joined #ruby
<fuzzyhorns>
knutmithut: i've only used that when i'm actually working on writing a local gem, so idk if it'll work with a transitive dependency, but if it does let us know
<elomatreb>
I remember having to do something like this when testing Rails 5, using a custom RSpec branch off of github
roamingdog has quit [Remote host closed the connection]
workmad3_ has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
coreutil has quit [Remote host closed the connection]
arashb has joined #ruby
coreutil has joined #ruby
krmx has joined #ruby
krmx has quit [Remote host closed the connection]
coreutil has quit [Remote host closed the connection]
coreutil has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
<knutmithut>
fuzzyhorns: I need to add "gem 'unf_ext', :github ...." to the Gemfile, but won't bundler just look into Gemfile.lock?
<elomatreb>
Gemfile.lock is generated from the regular Gemfile and contains the fixed versions, it will be overriden if you change the Gemfile
coreutil has quit [Client Quit]
coreutil has joined #ruby
<knutmithut>
Well, in that case I can't install in deployment mode
coreutil has quit [Remote host closed the connection]
coreutil has joined #ruby
coreutil has quit [Changing host]
coreutil has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kappy has joined #ruby
coreutil has quit [Remote host closed the connection]
coreutil has joined #ruby
Guest69 has joined #ruby
r_rios has joined #ruby
r_rios has joined #ruby
r_rios has quit [Changing host]
coreutil has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
gusrub_ has joined #ruby
Xiti has quit [Quit: Xiti]
railswebdev has joined #ruby
jhack has joined #ruby
speakingcode has quit [Ping timeout: 260 seconds]
polishdub has quit [Quit: Leaving]
gusrub_ has quit [Ping timeout: 240 seconds]
jhack has quit [Client Quit]
despai has joined #ruby
mistermocha has quit [Remote host closed the connection]
mistermocha has joined #ruby
l4v2 has joined #ruby
minimalism has joined #ruby
nowhereman has joined #ruby
jhack has joined #ruby
roamingdog has quit [Read error: Connection reset by peer]
mistermocha has quit [Ping timeout: 240 seconds]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
gk--1wm- has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
<elomatreb>
leitz: I'd probably move the part actually doing the printing to a small mini-method and just have the big method return something
samdvr has joined #ruby
<elomatreb>
Also, I'd break that big thing into multiple methods, just to be cleaner
patarr has quit [Ping timeout: 252 seconds]
<elomatreb>
Another common strategy is having an optional IO parameter that is printed to and passing a StringIO during testing
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
boombox_ has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<zenspider>
leitz: minitest has assert_output for exactly this reason.
<zenspider>
and captureio
enterprisey has quit [Remote host closed the connection]
boombox_ has quit [Remote host closed the connection]
BackEndCoder has quit [Excess Flood]
BackEndCoder has joined #ruby
<leitz>
If I'm going to go past test/unit, any reason not to just make it to rspec?
<elomatreb>
Preference, RSpec is a different approach
JeanCarloMachado has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Ping timeout: 240 seconds]
KCmetro has quit [Remote host closed the connection]
mistermocha has joined #ruby
KCmetro has joined #ruby
JeanCarloMachado has joined #ruby
CloCkWeRX has joined #ruby
tau is now known as RiderOnTheStorm
RiderOnTheStorm is now known as mumm-ra
<leitz>
Is it just me or is there a lack of chanops present?
DTZUZU has joined #ruby
workmad3_ has quit [Ping timeout: 240 seconds]
<elomatreb>
leitz: They're not marked as OP, it's done through ruby[bot]
mistermocha has quit [Ping timeout: 240 seconds]
Xiti has joined #ruby
<leitz>
Ah, cool. A while back I was on a channel and there was a long time with a dumb spammer spewing trash.
kht has joined #ruby
minimalism has quit [Quit: minimalism]
<leitz>
Okay, 90 tests, 159 assertions, no failures or errors. Known issues with test gaps. Something to work on, when I'm awake. For those who might forget, tomorrow is Valentine's day.
<leitz>
If I see you tomorrow either she's sick or I'm in trouble anyway...
leitz has quit [Quit: Nappy time]
jcao219 has quit [Ping timeout: 240 seconds]
minimalism has joined #ruby
last_staff has quit [Quit: last_staff]
TomyLobo has quit [Ping timeout: 255 seconds]
JeanCarloMachado has quit [Ping timeout: 276 seconds]