__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
<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]
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]
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
<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]
<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)
<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)"]