havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
jrabe has quit []
alveric has quit [Ping timeout: 240 seconds]
jaequery has joined #ruby
jrabe has joined #ruby
code_zombie has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
carnegie has joined #ruby
orbyt_ has joined #ruby
_sfiguser has quit [Ping timeout: 260 seconds]
<ShalokShalom> Is there any project known, which can convert Ruby code into Crystal code?
Bock has joined #ruby
carnegie has quit [Remote host closed the connection]
balazs has joined #ruby
<wmoxam> ShalokShalom: no
<ShalokShalom> thx
<ShalokShalom> is it so hard?
<wmoxam> in a lot of cases it's easy to convert
<ShalokShalom> i see
<ShalokShalom> and i some specific..
<ShalokShalom> *in
<wmoxam> cases where I've had difficulty are where hashes are the primary method of passing data around
opekktar has quit [Quit: WeeChat 1.9]
boombox_ has joined #ruby
<ShalokShalom> so you tried?
<ShalokShalom> is there a source code?
<ShalokShalom> did you talk to them?
<ShalokShalom> about this case
emilford has quit [Ping timeout: 248 seconds]
<wmoxam> ShalokShalom: I have a port of Liquid that mostly works
<ShalokShalom> thx
_sfiguser has joined #ruby
<ShalokShalom> how much covers liquid?
<ShalokShalom> of Ruby
<wmoxam> I'm not sure what you mean
bmurt has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ShalokShalom> Probably since i seem to have troubles to understand what liquid is
<ShalokShalom> i thought something like a subset of Ruby
boombox_ has quit [Remote host closed the connection]
<ShalokShalom> hnn, so your work cant be reused?
<ShalokShalom> in order to provide a transpiler?
<ShalokShalom> sad
<ShalokShalom> thanks a lot
<wmoxam> ah, Liquid is a templating language used by many CMS's
<wmoxam> originally writting in Ruby
<ShalokShalom> i see
<ShalokShalom> thy
michael1 has joined #ruby
Guest68790 has quit [Ping timeout: 252 seconds]
guille-moe has quit [Ping timeout: 240 seconds]
nadir has quit [Quit: Connection closed for inactivity]
Al3xG0 has quit [Ping timeout: 246 seconds]
Al3xG0 has joined #ruby
Al3xG0 has quit [Changing host]
Al3xG0 has joined #ruby
michael1 has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 252 seconds]
AxelAlex has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ResidentBiscuit has joined #ruby
milardovich has quit []
gizmore|2 has joined #ruby
gizmore has quit [Ping timeout: 248 seconds]
d^sh has quit [Ping timeout: 248 seconds]
d^sh has joined #ruby
nofxx has quit [Ping timeout: 276 seconds]
lexruee has quit [Quit: Leaving]
nofxx has joined #ruby
emilford has joined #ruby
AxelAlex has quit [Quit: AxelAlex]
Xeago has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
nofxx has joined #ruby
michael1 has joined #ruby
emilford has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
kapil___ has joined #ruby
nofxx has joined #ruby
imode has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
michael1 has quit [Read error: Connection reset by peer]
michael1 has joined #ruby
mong has joined #ruby
bronson has joined #ruby
bronson has quit [Read error: Connection reset by peer]
bronson has joined #ruby
orbyt_ has joined #ruby
nofxx has joined #ruby
harai has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
__Yiota has joined #ruby
bmurt has quit [Quit: Textual IRC Client: www.textualapp.com]
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
_sfiguser has quit [Quit: Leaving]
nofxx has quit [Ping timeout: 248 seconds]
nofxx has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
carnegie has joined #ruby
ResidentBiscuit has quit [Quit: going to superior dunkins]
mjolnird has quit [Read error: No route to host]
mjolnird has joined #ruby
harai has quit [Ping timeout: 252 seconds]
jinie has quit [Ping timeout: 246 seconds]
jackjackdripper has joined #ruby
balazs has quit [Ping timeout: 260 seconds]
jinie has joined #ruby
harai has joined #ruby
carnegie has quit [Remote host closed the connection]
carnegie has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
carnegie has quit [Ping timeout: 252 seconds]
harai has quit [Ping timeout: 246 seconds]
cadillac_ has joined #ruby
jaequery has joined #ruby
Asher has quit [Ping timeout: 246 seconds]
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
michael1 has quit [Ping timeout: 252 seconds]
pugcs has quit [Remote host closed the connection]
pwnd_nsfw` has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicsouth has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
psychicist__ has quit [Ping timeout: 248 seconds]
apparition47 has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
xuanrui has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
psychicist__ has joined #ruby
gix has quit [Ping timeout: 248 seconds]
bronson has joined #ruby
gix has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
iamyask has quit [Quit: Connection closed for inactivity]
kies has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
high_fiver has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.9]
xuanrui has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
ZeroByteZ has joined #ruby
shimshamshao_ has joined #ruby
gr33n7007h is now known as al2o3-cr
<ZeroByteZ> Any ideas what I should code?
pancutan has joined #ruby
high_fiver has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 252 seconds]
gothicsouth has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ZeroByteZ> Very dead
<ZeroByteZ> Much bored
banisterfiend has joined #ruby
bkxd has joined #ruby
naprimer2 has joined #ruby
<shimshamshao_> i have a good ruby question! can anoyone helo?
naprimer has quit [Ping timeout: 252 seconds]
<ZeroByteZ> depends on what it is?
<shimshamshao_> i am wondering how to create an instance where I can gets.chomp to loop to infinity
<shimshamshao_> until a command is run
<shimshamshao_> i will keep the tags in the code
<shimshamshao_> i know it involves if then statements but I am alittle confused from there
<ZeroByteZ> wym until a command is done?
<ZeroByteZ> *run
<shimshamshao_> yes
<ZeroByteZ> what do you mean?
<ZeroByteZ> so like another thread finishes working then another thread can continue?
waveprop has quit [Ping timeout: 255 seconds]
xuanrui has joined #ruby
<ZeroByteZ> @shimshamshao_
Immune has quit [Quit: ZzzZZZzzzz]
waveprop has joined #ruby
<shimshamshao_> what is a ruby thread?
waveprop has quit [Ping timeout: 260 seconds]
nobitanobi has joined #ruby
<ZeroByteZ> a thread allows you to run 2+ different commands at once
waveprop has joined #ruby
yeticry has joined #ruby
synstack has quit [Ping timeout: 246 seconds]
sspreitz has quit [Ping timeout: 252 seconds]
thinkpad has quit [Read error: Connection reset by peer]
Dimik has quit [Ping timeout: 248 seconds]
thinkpad has joined #ruby
cjohnson has quit [Quit: Lost terminal]
nadir has joined #ruby
sspreitz has joined #ruby
SeepingN has quit [Remote host closed the connection]
cjohnson has joined #ruby
zenit has quit [Quit: bye bye]
zenit_ is now known as zenit
Prutheus has joined #ruby
<ShalokShalom> ZeroByteZ: Still bored? ;)
houhoulis has quit [Remote host closed the connection]
bkxd_ has joined #ruby
ShekharReddy has joined #ruby
bkxd has quit [Ping timeout: 252 seconds]
dviola has quit [Quit: WeeChat 1.9]
<shimshamshao_> that is exactly what i am looking for 3+ commands at once
<shimshamshao_> @2erobyte2
bkxd_ has quit [Ping timeout: 246 seconds]
<shimshamshao_> sorry just mildy distracted still here
bkxd has joined #ruby
carnegie has joined #ruby
<ShalokShalom> ZeroByteZ: I thought on a Crystal <> Ruby transpiler. So the result will be something like: Interpret Crystal and compile Ruby. :)
<shimshamshao_> that's a little beyond my skill set currently but thanks for the help i think i'll just get it done in python
<ShalokShalom> So long as it works for you.
<shimshamshao_> it should thanks for the information
carnegie has quit [Ping timeout: 246 seconds]
nobitanobi has quit [Remote host closed the connection]
mong has quit [Quit: Leaving]
<ZeroByteZ> wut
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ZeroByteZ> ShalokShalom: What is that?
<ShalokShalom> ?
<ShalokShalom> you wrote before, that you feel bored and like an idea for a new project
<fredflinstone> crystal becomes less like ruby every week, so you might have your work cut out for you. even a simple subset of ruby being transpiled to crystal would be nice to have
<fredflinstone> i dont think i like crystal a lot as a language. i mean, it's hard to say fairly because i always use ruby as a reference when judging it, but many of the dynamic freedoms ruby has are gone and continue to go
anisha has joined #ruby
<ShalokShalom> other languages solve it to create transpilers, who are less similar to this language, just think on Opal and dozens of other JS transpiler, its just a question of the amount of work and yes, probably will it be a challange :)
<ShalokShalom> fredflinstone: and your argument is an argument for this project ;)
<fredflinstone> sure. could be right. typescript comes to mind but that's going the other way (static => dynamic). but yeah sounds like could work
<fredflinstone> sounds tough too
<fredflinstone> probably ruby_parser/ripper would be good start
<ShalokShalom> Nim, Kotlin, Scala.js, Bucklescript and so on are also staticly typed
yeticry has quit [Ping timeout: 276 seconds]
<ShalokShalom> ah you mean that way around
<fredflinstone> yeah
<ShalokShalom> yes, possible
<ShalokShalom> that this might make issues
<ShalokShalom> Matz spend 500$ on Crystal from what i heard ;)
bronson has joined #ruby
<fredflinstone> yea. could be cool. i stopped following it a while ago
<fredflinstone> so i've lost interest.
waveprop has quit [Ping timeout: 252 seconds]
<ShalokShalom> i see
waveprop has joined #ruby
<ShalokShalom> Crystal develops Qt bindings, as an example
bkxd has quit [Ping timeout: 252 seconds]
yeticry has joined #ruby
<fredflinstone> yeah. followed for months. i know some of the ecosystem it has.
bronson has quit [Ping timeout: 248 seconds]
bkxd has joined #ruby
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
<fredflinstone> shards: sinatra clones. re-adaptions of rails/framework solutions, & C bindings is what i remember most. all very cool. the issue i see is that i don't think it will be able to solve the harder problems, like concurrency, and a memory model, exceptionally well or different than other languages.
<fredflinstone> boehm GC as an example.
ZeroByteZ has quit [Ping timeout: 260 seconds]
synstack has joined #ruby
synstack has joined #ruby
synstack has quit [Changing host]
tvw has joined #ruby
mong has joined #ruby
wnd has quit [Quit: Disconnecting from stoned server.]
wnd has joined #ruby
djbkd has joined #ruby
rayleigh415 has joined #ruby
rayleigh415 has quit [Client Quit]
apparition47 has quit [Quit: Bye]
carnegie has joined #ruby
_whitelogger has joined #ruby
carnegie has quit [Ping timeout: 255 seconds]
Mia has joined #ruby
Al3xG0 has quit [Ping timeout: 240 seconds]
djbkd has quit []
Guest54334 has quit [Ping timeout: 276 seconds]
paradisaeidae_ has quit [Quit: ChatZilla 0.9.93 [Firefox 55.0.2/20170814142917]]
paradisaeidae has quit [Quit: ChatZilla 0.9.93 [Firefox 55.0.2/20170814142917]]
Cope has joined #ruby
Cope is now known as Guest20
_whitelogger has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
mong has quit [Quit: Leaving]
<uZiel> hi
<uZiel> how do I do exponentiation of big numbers (like for crypto)
<uZiel> "x.to_bn ** y.to_bn" takes very very long and never finishes
<uZiel> x is 1024 bits and y is 256 bits
dlitvak has quit [Quit: Connection closed for inactivity]
tvw has quit [Remote host closed the connection]
alex`` has joined #ruby
Guest40 has joined #ruby
<uZiel> ok, got it, "x.to_bn.mod_exp(y, n)CCC
<uZiel> s/CCC/"/
kapil___ has quit [Quit: Connection closed for inactivity]
waveprop has quit [Ping timeout: 240 seconds]
waveprop has joined #ruby
Nicmavr has joined #ruby
Nicmavr is now known as Guest53741
_main_ has joined #ruby
bronson has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
_main_ has joined #ruby
bronson has quit [Read error: Connection reset by peer]
bronson has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
__main__ has quit [Ping timeout: 240 seconds]
__main__ has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
Guest53741 has quit [Changing host]
Guest53741 has joined #ruby
Guest53741 is now known as Nicmavr
marr has joined #ruby
nofxxx has joined #ruby
lxsameer has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
imode has quit [Ping timeout: 246 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weez17_ has joined #ruby
jakaria has joined #ruby
<jakaria> hi, I need a contributor for my gem... anyone is welcome...
carnegie has joined #ruby
carnegie has quit [Remote host closed the connection]
carnegie has joined #ruby
<jakaria> anyone interested?
<ShalokShalom> show us your project?
<jakaria> it's a very small project.... I just started it some weeks ago...
xuanrui has quit [Quit: Leaving]
anisha has quit [Quit: This computer has gone to sleep]
apparition47 has joined #ruby
kapil___ has joined #ruby
cabotto has joined #ruby
nowhere_man has quit [Ping timeout: 248 seconds]
Stickwalker has joined #ruby
pugcs has joined #ruby
Stickwalker has quit [Client Quit]
charliesome has joined #ruby
pandaant has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jakaria has quit [Ping timeout: 248 seconds]
kreantos has joined #ruby
waveprop has quit [Ping timeout: 240 seconds]
MarkBilk_ has joined #ruby
cabotto has quit [Remote host closed the connection]
MarkBilk has quit [Ping timeout: 276 seconds]
cabotto has joined #ruby
waveprop has joined #ruby
kreantos has quit [Remote host closed the connection]
kreantos has joined #ruby
cabotto has quit [Remote host closed the connection]
kreantos has quit [Ping timeout: 246 seconds]
cabotto has joined #ruby
guille-moe has joined #ruby
jakaria has joined #ruby
roshanavand has joined #ruby
bruno- has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby
bronson has joined #ruby
shimshamshao_ has quit [Ping timeout: 248 seconds]
minimalism has quit [Quit: minimalism]
bronson has quit [Ping timeout: 248 seconds]
noe has joined #ruby
_whitelogger has joined #ruby
noe has quit [Quit: noe]
guille-moe has quit [Ping timeout: 248 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
ShalokShalom has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
cadillac_ has joined #ruby
dviola has joined #ruby
p0s1x has joined #ruby
p0s1x has quit [Client Quit]
cabotto has quit [Remote host closed the connection]
code_zombie has quit [Quit: Leaving]
p0s1x has joined #ruby
ShalokShalom has joined #ruby
cabotto has joined #ruby
noe has joined #ruby
noe has quit [Client Quit]
cabotto has quit [Client Quit]
wnd has quit [Excess Flood]
wnd has joined #ruby
jinie has joined #ruby
frozengeek has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
apparition47 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
apparition47 has joined #ruby
pugcs has quit [Quit: pugcs]
shimshamshao_ has joined #ruby
roshanavand has joined #ruby
rapha has quit [Ping timeout: 240 seconds]
shimshamshao_ has quit [Ping timeout: 248 seconds]
pugcs has joined #ruby
aria1 has joined #ruby
aria1 is now known as ar1a
__Yiota has joined #ruby
Guest20 has quit [Ping timeout: 248 seconds]
Cope has joined #ruby
Cope is now known as Guest26639
p0s1x has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
<Prutheus> trying to install talib_ruby on windows ... installed ruby version tested: 2.3.3 and 2.4.1 .... both same error: https://bpaste.net/show/fcdb30488749 ... I have no idea where the problem is ... I've downloaded ta-lib, extracted it to C:/ and yeah, .... that's it. In my bpaste-post is also the command with which I want to install via gem the talib_ruby package
<Prutheus> any idea what I could do to get it working?
rapha has joined #ruby
weez17_ has quit [Quit: Connection closed for inactivity]
michael1 has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
Mon_Ouie has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
pugcs has quit [Quit: pugcs]
pugcs has joined #ruby
shimshamshao_ has joined #ruby
bronson has joined #ruby
shimshamshao_ has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 252 seconds]
apparition47 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
p0s1x has joined #ruby
<darix> Prutheus: 1. are you sure you have the right ta-lib version installed? 2. is the lib installed into the search path of your build?
<darix> checking for TA_Initialize() in -lta_lib... no
mikecmpbll has joined #ruby
<darix> doesnt sound promising tbh
dviola has quit [Quit: WeeChat 1.9]
Asher has joined #ruby
cjohnson has quit [Ping timeout: 246 seconds]
cjohnson has joined #ruby
InfinityFye has joined #ruby
ShekharReddy has quit [Quit: Connection closed for inactivity]
mikecmpbll has quit [Quit: inabit. zz.]
nadir has quit [Quit: Connection closed for inactivity]
<Prutheus> darix: so what I should I do now? I mean yeah, I have ta-lib and it was generating at C:/ta-lib/c/ the folder include and lib ...
apparition47 has joined #ruby
GodFather has joined #ruby
jakaria has quit [Read error: Connection reset by peer]
nadir has joined #ruby
<Prutheus> darix: what do you mean is not correct?
_sfiguser has joined #ruby
mikeiniowa has quit [Remote host closed the connection]
<darix> Prutheus: that extconf.rb check should probably not report "no" for this check
mikeiniowa has joined #ruby
<Prutheus> yes ok but I do not understand what that means to me
<Prutheus> could you guide me how to install ruby, ta-lib on a fresh szstem so it will work?
<darix> Prutheus: sorry. i dont really know much for ruby on windows.
FastJack has quit [Read error: Connection reset by peer]
FastJack has joined #ruby
<Prutheus> yeah me too
<Prutheus> this is really stupid ...
<Prutheus> I don't know what I should do now
guille-moe has joined #ruby
hanmac has left #ruby [#ruby]
carnegie has quit [Remote host closed the connection]
carnegie has joined #ruby
<darix> Prutheus: install linux :p
guille-moe has quit [Ping timeout: 246 seconds]
<Prutheus> i have linux
<Prutheus> and i always work on linux
<Prutheus> but i need to deliver my ruby program as exe for a windows client
<Prutheus> so i wanted to use ocra, but i can only compile the exe on windows or not?
charliesome has joined #ruby
chmurifree has quit [Ping timeout: 252 seconds]
charliesome has quit [Read error: Connection reset by peer]
guille-moe has joined #ruby
carnegie has quit [Ping timeout: 246 seconds]
shimshamshao_ has joined #ruby
shimshamshao_ has quit [Ping timeout: 260 seconds]
fowl has joined #ruby
fowl was kicked from #ruby by ChanServ [Banned: Obsessive troll, see http://logs.ryanbigg.com/p/fowl]
kapil___ has quit [Quit: Connection closed for inactivity]
chmurifree has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
pika_pika has joined #ruby
yaroslav has joined #ruby
yaroslav has quit [Client Quit]
ShalokShalom has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
oleo has quit [Read error: Connection reset by peer]
knight33 has joined #ruby
minimalism has joined #ruby
Al3xG0 has joined #ruby
Al3xG0 has quit [Changing host]
Al3xG0 has joined #ruby
ar1a has quit [Quit: WeeChat 1.9]
mikecmpbll has joined #ruby
eroux has joined #ruby
__Yiota has quit [Ping timeout: 246 seconds]
xlegoman has joined #ruby
__Yiota has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
dachi has joined #ruby
<dachi> hi. i have an instance method in model that accepts request as arguments. do you know how can I get request object in model spec?
<dachi> rails**
<dachi> nm. i created a fake request object
dachi has quit [Quit: Page closed]
maryo has joined #ruby
maryo has quit [Remote host closed the connection]
oleo has joined #ruby
s3nd1v0g1us has quit [Remote host closed the connection]
oleo has quit [Client Quit]
p0s1x has quit [Ping timeout: 255 seconds]
bronson has joined #ruby
pandaant has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 260 seconds]
guille-moe has quit [Ping timeout: 252 seconds]
clemens3 has quit [Quit: WeeChat 1.0.1]
ski7777 has quit [Ping timeout: 248 seconds]
houhoulis has joined #ruby
michael2 has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hnanon has joined #ruby
<hnanon> Hello.
hnanon_ has joined #ruby
ski7777 has joined #ruby
<hnanon_> I have a series of variables like: a = 26, b = 25, c = 24, etc. (the values are actually different).
michael1 has quit [Ping timeout: 240 seconds]
<hnanon_> I want to loop through a array of letters and replace each element with the corresponding variable value.
<hnanon_> So, I suppose I could do something like:
<Papierkorb> hnanon_: You should use a Hash instead to store these values. What's your use-case?
hnanon has quit [Ping timeout: 260 seconds]
<hnanon_> Papierkorb: I'm receiving a list of amino acids, those amino acids have a certain numeric property, I want to ultimately do math on each numeric value of the aa.
<hnanon_> I was going to use .map and a bunch if if/else.
<Papierkorb> hnanon_: The cleanest way will be quickly build the array yourself by simply doing `[ a, b, c ]` in your method
rwb has quit [Ping timeout: 240 seconds]
sepp2k has quit [Ping timeout: 248 seconds]
<hnanon_> Papierkorb: I'm not following. I have an array sequence = ["a", "b", "c"]. I initially planned on doing sequence.map { |aa| if aa == "a" aa = 1, if aa == "b", aa = 2}
<hnanon_> Something like that.
psmolen has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
<hnanon_> But I also have a list of variables: a = 1, b = 2, etc.
<hnanon_> So I thought there might be a simpler way using the predefined variables.
<Papierkorb> As this is Ruby, there is a way, but it's hacky of course. You can access local variables through the `binding` method.
psmolen has joined #ruby
michael2 is now known as RedNifre
<hnanon_> Papierkorb: Would a bunch of if/else (22 or so of them) be the more simpler or "ruby" way?
<hnanon_> What if the I had an array of hashes?
<Papierkorb> Neither of them is certainly nice.
<Papierkorb> Then that'd be much simpler and portable (as in, doesn't break by tomorrows ruby)
<hnanon_> [{"a": 1}, {"b":2}]
<hnanon_> How could I use that to replace the values in the sequence (or create a new sequence, actually).
<Papierkorb> If you only have a single member per hash, then just use a hash for all, or an array of array-tuples
<Papierkorb> Enumerable#map and such
<RedNifre> How do I find the last element in an array that satisfied a given predicate?
<RedNifre> (I want to find the last Time in an ordered array that is before Time.now)
gixxer1k has joined #ruby
brian_penguin has joined #ruby
sepp2k has joined #ruby
<RedNifre> weird, find works but I couldn't find it in the docs
<RedNifre> never mind
Guest40 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pancutan has quit [Ping timeout: 276 seconds]
Guest40 has joined #ruby
oleo has joined #ruby
Prutheus has quit [Quit: leaving]
dionysus69 has joined #ruby
KeyJoo has joined #ruby
Guest40 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RedNifre> I'm not sure about the scoping, if I define a variable in a block and then define a method in that block, why can't the method see the variable?
<Papierkorb> RedNifre: Please gist that code so we can help you better
Guest40 has joined #ruby
moei has quit [Read error: Connection reset by peer]
<Mon_Ouie> def foo; …; end does not close over the scope where it is defined, but define_method(:foo) do … end does
ShalokShalom has joined #ruby
moei has joined #ruby
ShalokShalom has quit [Read error: Connection reset by peer]
clemens3 has joined #ruby
apparition47 has quit [Quit: Bye]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hnanon_> But .map is returning nil for each element in the array.
<hnanon_> In other words, the hash lookup is not working.
t-recx has joined #ruby
<Papierkorb> hnanon_: I'm not sure what that code intended to do. What output did you expect?
<hnanon_> Papierkorb: [1, 2, 3]
Guest40 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hnanon_> Line 5 should be values[:aa]
Guest40 has joined #ruby
<Papierkorb> 1) your hash uses symbol keys, but your array uses strings (They're not the same). I'd prefer symbols for this. 2) The block argument from map is the current item you're supposed to operate on. `:aa` is a symbol, `aa` is a variable. You can't interchange them
eroux has quit [Ping timeout: 240 seconds]
Asher has quit [Quit: Leaving.]
lizard2010 has joined #ruby
lizard2010 has quit [Client Quit]
dn` has quit [Read error: Connection reset by peer]
ShekharReddy has joined #ruby
dn` has joined #ruby
<hnanon_> Papierkorb: Thank you.
<hnanon_> It's working now.
carnegie has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
InfinityFye has quit [Ping timeout: 240 seconds]
elcontrastador has joined #ruby
carnegie has quit [Ping timeout: 276 seconds]
ych has joined #ruby
ych has quit [Remote host closed the connection]
xcesariox has joined #ruby
RedNifre has quit [Ping timeout: 248 seconds]
brian_penguin has quit [Ping timeout: 240 seconds]
brian_penguin has joined #ruby
xcesariox has quit [Quit: Textual IRC Client: www.textualapp.com]
RedNifre has joined #ruby
rwb has joined #ruby
RedNifre is now known as Guest46284
dviola has joined #ruby
InfinityFye has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
rwb has quit [Ping timeout: 260 seconds]
PaulCapestany has quit [Quit: .]
PaulCapestany has joined #ruby
brian_penguin has quit [Ping timeout: 240 seconds]
brian_penguin has joined #ruby
kapil___ has joined #ruby
otherj has joined #ruby
pugcs has quit [Quit: pugcs]
jackjackdripper has joined #ruby
orbyt_ has joined #ruby
rippa has joined #ruby
Guest46284 has quit [Ping timeout: 260 seconds]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Mon_Ouie has joined #ruby
bronson has joined #ruby
ixti has joined #ruby
txr has joined #ruby
<txr> hi
txr has left #ruby [#ruby]
sagax has quit [Ping timeout: 255 seconds]
pancutan has joined #ruby
_sfiguser has quit [Ping timeout: 255 seconds]
bronson has quit [Ping timeout: 240 seconds]
jaequery has joined #ruby
sepp2k has quit [Quit: Leaving.]
_sfiguser has joined #ruby
brian_penguin has quit [Quit: Leaving]
otherj has quit [Quit: .]
KeyJoo has quit [Remote host closed the connection]
knight33 has joined #ruby
__Yiota has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ixti has quit [Quit: WeeChat 1.9]
xlegoman has quit [Quit: Textual IRC Client: www.textualapp.com]
xlegoman has joined #ruby
raynold has joined #ruby
jaequery has joined #ruby
nofxxx has quit [Ping timeout: 260 seconds]
drcode has joined #ruby
drcode has quit [Remote host closed the connection]
sagax has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
tomphp has joined #ruby
carnegie has joined #ruby
hnanon_ has quit [Ping timeout: 260 seconds]
nobitanobi has joined #ruby
carnegie has quit [Ping timeout: 246 seconds]
_sfiguser has quit [Quit: Leaving]
nobitanobi has quit [Remote host closed the connection]
nowhere_man has joined #ruby
minimalism has quit [Quit: minimalism]
Neo95 has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
DTZUZU has quit [Ping timeout: 240 seconds]
DTZUZU has joined #ruby
drcode has joined #ruby
pancutan has quit [Ping timeout: 255 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
houhoulis has quit [Remote host closed the connection]
Guest46284 has joined #ruby
Guest46284 is now known as RedNifre
<RedNifre> Alright, let's gem!
* RedNifre begins writing his first gem.
pika_pika has quit [Ping timeout: 240 seconds]
chmurifree has quit [Ping timeout: 240 seconds]
harfangk has joined #ruby
haylon has joined #ruby
chmurifree has joined #ruby
alex`` has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
InfinityFye has quit [Quit: Leaving]
lexruee has joined #ruby
lexruee has quit [Client Quit]
imode has joined #ruby
nertzy has quit [Ping timeout: 248 seconds]
harfangk has quit [Ping timeout: 240 seconds]
conta has joined #ruby
bronson has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
high_fiver has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
wogi has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
ledestin has joined #ruby
alex`` has joined #ruby
alfiemax has joined #ruby
futilegames has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
brian_penguin has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
futilegames has quit [Quit: futilegames]
ascarter has joined #ruby
Vile` has joined #ruby
ascarter_ has joined #ruby
xlegoman has quit [Quit: Textual IRC Client: www.textualapp.com]
Rodya_ has joined #ruby
ascarter has quit [Ping timeout: 255 seconds]
futilegames has joined #ruby
ascarter has joined #ruby
brian_penguin has quit [Remote host closed the connection]
ascarter_ has quit [Ping timeout: 255 seconds]
SeepingN has joined #ruby
t-recx has quit [Quit: t-recx]
XD_ has quit [Quit: Leaving]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rodya_ has quit [Remote host closed the connection]
Danishman has joined #ruby
armyriad has joined #ruby
m27frogy has joined #ruby
Northop has joined #ruby
conta has quit [Ping timeout: 240 seconds]
houhoulis has joined #ruby
MrBismuth has quit [Quit: https://www.youtube.com/watch?v=xIIqYqtR1lY -- Suicide is Painless - Johnny Mandel]
Northop has quit []
clemens3 has quit [Ping timeout: 246 seconds]
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
enterprisey has quit [Remote host closed the connection]
balazs has joined #ruby
MrBusiness has joined #ruby
houhoulis has quit [Remote host closed the connection]
cdg has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
RedNifre has quit [Ping timeout: 248 seconds]
carnegie has joined #ruby
emilford has joined #ruby
cdg has quit [Ping timeout: 252 seconds]
KeyJoo has joined #ruby
pancutan has joined #ruby
Vile` has quit [Ping timeout: 260 seconds]
futilegames has quit [Quit: futilegames]
emilford has quit [Ping timeout: 248 seconds]
pika_pika has joined #ruby
gusrub has joined #ruby
RedNifre has joined #ruby
RedNifre is now known as Guest94730
alex`` has quit [Quit: WeeChat 1.9]
Immune has joined #ruby
Neo95 has quit [Ping timeout: 276 seconds]
gusrub has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
carnegie has quit [Remote host closed the connection]
Immune has quit [Ping timeout: 240 seconds]
ixti has joined #ruby
bronson has joined #ruby
bronson has quit [Read error: Connection reset by peer]
bronson has joined #ruby
Lyubo1 has joined #ruby
Neo95 has joined #ruby
DanKnox has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
claudiuinberlin has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Client Quit]
uZiel has quit [Ping timeout: 268 seconds]
Immune has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dionysus69 has joined #ruby
ncthom91 has joined #ruby
<Guest94730> Should gems be named like-this or like_this ?
<konsolebox> i'll prefer like-this
<elomatreb> Both have a special meaning
t-recx has joined #ruby
<Guest94730> Ah, guess I'll read the guide then.
<elomatreb> Those aren't formal rules, but good convetions
<imode> gotta say, I've just very recently had the pleasure of using Ruby for a project, and I am absolutely disappointed I didn't try the language earlier.
KeyJoo has quit [Remote host closed the connection]
cdg has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
KeyJoo has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
KeyJoo has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 248 seconds]
KeyJoo has joined #ruby
t-recx has quit [Read error: Connection reset by peer]
t-recx has joined #ruby
clemens3 has joined #ruby
KeyJoo has quit [Remote host closed the connection]
KeyJoo has joined #ruby
Guest94730 is now known as RedNifre
<RedNifre> I guess I can call README README.md instead, huh? Is markdown okay in gem Readmes?
claudiuinberlin has joined #ruby
<havenwood> RedNifre: Yeah, no problem with Markdown in a Gem readme. Some use Rdoc but Markdown looks nice on Github. Your call.
<elomatreb> The README is technically just another file, rubygems.org and Github both render markdown though
<elomatreb> I.e. it has no special significance to gem itself
<havenwood> imode: nice
<RedNifre> "Many people use Bundler" should I use bundler?
dionysus69 has quit [Ping timeout: 276 seconds]
<elomatreb> Probably, as gem itself does nothing to ensure you get the correct versions of gems in a project
<elomatreb> The Gemfile originally was a bundler thing
<RedNifre> What's the best way to learn how to release a gem? The official rubygems.org docs? The bundler docs? Something else?
<elomatreb> The rubygems.org guides effectively go over everything important, it's not a terribly complicated process. You just push them to rubygems.org and then everyone can install them
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pika_pika has quit [Ping timeout: 255 seconds]
RedNifre has quit [Ping timeout: 246 seconds]
Asher has joined #ruby
Asher has quit [Client Quit]
roshanavand has joined #ruby
Asher has joined #ruby
baweaver is now known as baweaver_away
ur5us has joined #ruby
kotedo100 has joined #ruby
jwr has joined #ruby
RedNifre has joined #ruby
RedNifre has quit [Client Quit]
<jwr> I'm trying to get the last two digits of an integer, 73766409. but `73766409 % 100` is only returning '9'. how am i doing this wrong?
<kotedo100> I have a gem that has some loose code in files; meaning just a def method ... end thing without a module or class around it ... How can I tame this and put this into meaningful context without breaking existing code when I put a module and/or class around it? I tried something to the effect of alias_method ... but I got nowhere with that approach. Thoughts anyone?
<elomatreb> jwr: If you're on Ruby 2.4 there's Integer#digits
knight33 has joined #ruby
<jwr> 2.3, sadly.
<elomatreb> To answer your question: You're not doing anything wrong, it's just that 09 == 9 (and also == 009, etc)
<elomatreb> If you want "09", you could .to_s the number and use a substring operation
TomyLobo has quit [Ping timeout: 252 seconds]
<dminuoso> >> 09 == 9
<ruby[bot]> dminuoso: # => /tmp/execpad-3b3835297576/source-3b3835297576:2: Invalid octal digit ...check link for more (https://eval.in/850884)
<dminuoso> Liar liar pants on fire!
<elomatreb> #RemoveOctalLiterals2017
runescape07rsps has joined #ruby
Rodya_ has joined #ruby
<kotedo100> @jwr 123456789.to_s.slice(-2, 2)
knight33 has quit [Client Quit]
<jwr> kotedo100: works great. thanks.
<havenwood> another option:
<havenwood> n = 73766409; ones = n.modulo(10); tens = (n - ones).modulo(100) / 10; [tens, ones]
<havenwood> #=> [0, 9]
<kotedo100> jwr: You're welcome
<jwr> i'm glad i just happened to use '09' as my test case, otherwise this would've bitten me in some weird way.
* apeiros hands havenwood a divmod
* havenwood forgets things
<havenwood> >> remainder, ones = 73766419.divmod(10); tens = remainder.modulo(10); [tens, ones]
<ruby[bot]> havenwood: # => [1, 9] (https://eval.in/850889)
<havenwood> apeiros: yerp, nicer
<havenwood> also nicer to make recursive if you want each digit
spheric has quit [Ping timeout: 276 seconds]
<dminuoso> havenwood, boy that reminds me about quot, rem, div, mod in haskell. Still cant keep them apart. :|
cschneid_ has joined #ruby
enterprisey has joined #ruby
kreantos has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
kreantos has quit [Ping timeout: 240 seconds]
jinie has quit [Ping timeout: 240 seconds]
knight33 has joined #ruby
gothicsouth has joined #ruby
jinie has joined #ruby
nopolitica has joined #ruby
baweaver_away is now known as baweaver
baweaver is now known as baweaver_away
baweaver_away is now known as baweaver
<kotedo100> Anyone any thoughts on these gem issues above?
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
cschneid_ has quit [Ping timeout: 246 seconds]
enterprisey has quit [Remote host closed the connection]
bronson has joined #ruby
Guest40 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Quit: inabit. zz.]
bronson has quit [Ping timeout: 260 seconds]
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
<fredflinstone> the best way to release a gem? pushing to the mothership known as rubygems.org. Bundler allows for distribution via git, so can be de-centralised, esp if you don't jive with rubygems policies (once you push your code there, you can never delete it - f ex)
<fredflinstone> woops sorry wrong -_- sorry. your question has a few answers to maintain backwards compat, but adding top-level methods in a rubygem is usually dis-tasteful
<fredflinstone> so maybe better to not maintain backwards compat at all
<fredflinstone> there's `include` and `extend` for applying instance methods of a module, so you can write: include FooBar, to get the old top-level behaviour back.
xaxisx_ has quit [Quit: Leaving]
bkxd has quit [Ping timeout: 240 seconds]
haylon has quit [Ping timeout: 255 seconds]
Mon_Ouie has quit [Ping timeout: 240 seconds]
Papierkorb has quit [Ping timeout: 246 seconds]
s3nd1v0g1us has joined #ruby
Papierko- has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
roshanavand has quit [Ping timeout: 252 seconds]
gixxer1k has quit [Quit: Leaving]
nofxx has joined #ruby
s3nd1v0g1us has joined #ruby
Guest26639 has quit [Ping timeout: 246 seconds]
Azure|dc is now known as Azure
t-recx has quit [Quit: t-recx]
Cope has joined #ruby
Cope is now known as Guest8586
MissionCritical has quit [Read error: Connection reset by peer]
GodFather has quit [Ping timeout: 252 seconds]
bkxd has joined #ruby
sepp2k has joined #ruby
jackjackdripper has joined #ruby
kotedo100 has quit [Ping timeout: 248 seconds]
Rodya_ has quit [Quit: Leaving...]
kn-928 has joined #ruby
GodFather has joined #ruby
Papierko- is now known as Papierkorb
ShekharReddy has quit [Quit: Connection closed for inactivity]
kotedo100 has joined #ruby
Mon_Ouie has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
kn-928 has quit [Quit: WeeChat 1.9]
kapil___ has joined #ruby
kotedo100 has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby
ascarter has quit [Client Quit]
joelroa has joined #ruby
ascarter has joined #ruby
nobitanobi has joined #ruby
cschneid_ has joined #ruby
__Yiota has joined #ruby
ascarter has quit [Client Quit]
nexi has joined #ruby
cschneid_ has quit [Ping timeout: 248 seconds]
cdg has joined #ruby
nexi has left #ruby ["ERC (IRC client for Emacs 25.2.1)"]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
mostlybadfly has joined #ruby
Immune_ has joined #ruby
jackjackdripper has joined #ruby
Immune has quit [Ping timeout: 276 seconds]
jackjackdripper has quit [Client Quit]
enterprisey has joined #ruby
gusrub has joined #ruby
sepp2k has quit [Quit: Leaving.]
Danishman has quit [Quit: KVIrc 4.9.1 Aria http://www.kvirc.net/]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
Neo95 has quit [Ping timeout: 240 seconds]
haylon has joined #ruby
Immune_ has quit [Quit: ZzzZZZzzzz]
alveric2 has joined #ruby
gusrub has quit [Ping timeout: 248 seconds]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alveric1 has quit [Ping timeout: 248 seconds]