havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.0, 2.5.3, 2.4.5: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
cnsvc has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
hutch has quit [Ping timeout: 272 seconds]
duderonomy has joined #ruby
clemens3 has quit [Ping timeout: 245 seconds]
hutch has joined #ruby
AJA4351 has joined #ruby
johnny56_ has quit [Ping timeout: 272 seconds]
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4351 is now known as AJA4350
ur5us has joined #ruby
rawrg has quit [Remote host closed the connection]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
exchgr has quit [Quit: ZNC - http://znc.in]
ur5us has quit [Ping timeout: 250 seconds]
AJA4351 has joined #ruby
ur5us has joined #ruby
exchgr has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4350 has joined #ruby
AJA4351 has quit [Ping timeout: 244 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
conta has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
conta has quit [Ping timeout: 258 seconds]
tdy has joined #ruby
AJA4351 has quit [Ping timeout: 246 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
drale2k_ has joined #ruby
AJA4351 has quit [Ping timeout: 258 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davidw_ has joined #ruby
johnny56_ has joined #ruby
drale2k_ has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
akem has quit [Remote host closed the connection]
akem has joined #ruby
johnny56_ has quit [Ping timeout: 272 seconds]
akem has quit [Remote host closed the connection]
akem has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
davidw_ has quit [Ping timeout: 252 seconds]
johnny56_ has joined #ruby
<JJonah> is there any Array builtin that _disallows_ negative indexes? `[]` and `fetch` both interpret negative values as counting from the right...
code_zombie has joined #ruby
<mozzarella> why do you w ant that?
davidw_ has joined #ruby
tdy has quit [Ping timeout: 258 seconds]
davidw_ has quit [Ping timeout: 250 seconds]
tdy has joined #ruby
r29v has joined #ruby
esrse has joined #ruby
uplime has quit [Quit: e36freak: whats your favorite meal of the day]
fiachetti has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
fiachetti has joined #ruby
r29v has quit [Quit: r29v]
phaul has quit [Quit: bye]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has quit [Ping timeout: 250 seconds]
matsaman has joined #ruby
uplime has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
AndreYuhai has joined #ruby
matsaman has quit [Ping timeout: 258 seconds]
<AndreYuhai> Hello how can I write the xPath for this HTML https://paste.ofcode.org/a2egTxG6tEeKP8QFmaT3qJ I want to get the a tag. Is there any other way besides "//section[@class='pv-contact-info__contact-type ci-email']/div/a" ?
<AndreYuhai> I mean any shorter or better way
Azure has joined #ruby
matsaman has joined #ruby
tdy has quit [Read error: Connection reset by peer]
tdy has joined #ruby
ixti has quit [Quit: WeeChat 2.3]
cschneid has joined #ruby
houhoulis has quit [Remote host closed the connection]
rkazak has joined #ruby
AndreYuhai has quit [Quit: Page closed]
cthulchu has joined #ruby
<cthulchu> guys. using #{} is not formatting, right?
<cthulchu> what do you call it?
<cthulchu> I'm trying to find something like that in py now
tiff has joined #ruby
tdy has quit [Ping timeout: 258 seconds]
<mozzarella> cthulchu: string interpolation?
<cthulchu> thanks
hutch has joined #ruby
cthu| has quit [Ping timeout: 246 seconds]
cschneid has quit [Remote host closed the connection]
conta has joined #ruby
braincrash has quit [Quit: bye bye]
cschneid has joined #ruby
braincrash has joined #ruby
conta has quit [Ping timeout: 250 seconds]
uplime has quit [Quit: WeeChat 2.2]
cthulchu is now known as cth
cth is now known as cthulchu
cthulchu is now known as cthu
cthu is now known as cthu|
dellavg_ has joined #ruby
cthu| is now known as cthulchu
cthulchu is now known as cthu
cthu is now known as cthulchu
rkazak has quit [Quit: Sleep.....ing....]
Nicmavr has quit [Read error: Connection reset by peer]
cschneid has quit [Remote host closed the connection]
duderonomy has joined #ruby
Nicmavr has joined #ruby
moei has quit [Ping timeout: 246 seconds]
matsaman has quit [Read error: Connection reset by peer]
faraazahmad has joined #ruby
hutch has quit [Ping timeout: 246 seconds]
nowhere_man has joined #ruby
agent_white has joined #ruby
cnsvc has joined #ruby
hutch has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
solocshaw has joined #ruby
hutch has quit [Ping timeout: 240 seconds]
marmotini_ has joined #ruby
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
marmotini has joined #ruby
marmotini_ has quit [Client Quit]
code_zombie has quit [Quit: Leaving]
eckhardt has quit [Ping timeout: 245 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nadir has quit [Quit: Connection closed for inactivity]
tdy has joined #ruby
cschneid has joined #ruby
conta has joined #ruby
marmotini_ has joined #ruby
nowhere_man has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
segy has quit [Ping timeout: 246 seconds]
marmotini has quit [Ping timeout: 258 seconds]
marmotini_ has quit [Ping timeout: 258 seconds]
marmotini_ has joined #ruby
segy has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
aupadhye_ has joined #ruby
aupadhye has joined #ruby
aupadhye_ has quit [Client Quit]
Dbugger has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
cschneid has joined #ruby
solocshaw has quit [Ping timeout: 252 seconds]
comet23 has joined #ruby
<comet23> is there a way to convert ">" to >
dbugger_ has joined #ruby
Dbugger has quit [Ping timeout: 264 seconds]
<baweaver> ?xy
<ruby[bot]> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
johnny56_ has quit [Ping timeout: 272 seconds]
johnny56_ has joined #ruby
faraazahmad has quit [Quit: Connection closed for inactivity]
<comet23> baweaver: basically i want to refactor my code and the only logical solution i came up with is if there was a way to convert string <> signs back to their respective signs
<baweaver> What's your code?
<baweaver> because chances are high you don't need to do that.
<baweaver> So you're trying to rotate an array?
<comet23> yes
<comet23> the code works fine
<baweaver> First note: Ruby has a rotate function
<comet23> it's a coding exercise
<baweaver> Second note: rotated_arr = arr does not make a clone, it points to the same array
<comet23> oops
<comet23> so i have to iterate through the original array and then append its contents to it? or will that still not make a clone?
<baweaver> arr.dup
<baweaver> I'd use each_with_index and just make a new array.
khomesh24 has left #ruby ["Leaving"]
cschneid has quit [Ping timeout: 244 seconds]
aufi has joined #ruby
<comet23> is there a way to make it so i don't have to have two while loops?
aupadhye has quit [Ping timeout: 250 seconds]
<comet23> i would like to use a conditional > operator that inverts based on the offset being greater or lower than 0
aupadhye has joined #ruby
<baweaver> What if I told you that this is possible with a oneliner?
<baweaver> The trick is to use modulus.
<comet23> i'm really bad at math
<comet23> but yes i would like to see it
<baweaver> Do you know what that is?
<comet23> maybe it'll make me that much better at math
<comet23> i know what it is and how it works
<baweaver> I'm horrid at math too
<comet23> i'm just really bad at using math
<comet23> or coming up with ideas where to use modulus
<baweaver> What happens when you add a negative number?
<comet23> it subtracts
<baweaver> Let's take a look at our base array: [1, 2, 3]
<baweaver> If we were to rotate it by -1, you could say it'd be [2, 3, 1]
<baweaver> right?
<comet23> yes
<baweaver> What's the index of 1 before the rotation?
<comet23> you mean the contents?
<comet23> the contents of index 1?
<leftylink> which index contains the number 1
<baweaver> Let's switch the base array
<baweaver> It's now ['a', 'b', 'c']
<comet23> oh
cnsvc has quit [Remote host closed the connection]
<baweaver> what's the index of 'a' before and after a rotation of -1?
<comet23> 0 and .length - 1 or -1
<baweaver> What happens if you use modulo on a negative number?
<baweaver> Give it a try in a repl
<comet23> i honestly have never done that before
<baweaver> Describe what modulo does to me real quick
<comet23> is the negative number the divisor or the dividend?
faraazahmad_ has joined #ruby
<comet23> it divides numbers evenly, if it can't divide evenly it will tell you how many numbers are
<comet23> left before it could have been divided evenly
<baweaver> So the reason you have two while loops?
<comet23> one while loop to rotate right and the other to rotate left
<baweaver> Adding negative numbers :)
<baweaver> you only need to rotate once
<baweaver> and in one "direction" so to speak
<comet23> the weird thing is, i didn't use the modulo operator
<comet23> i just started rotating it at first, but the negative test cases were failing because it was rotating it the wrong way
aupadhye has quit [Ping timeout: 246 seconds]
<comet23> for a negative offset i mean
agent_white has quit [Quit: blblasdf]
<comet23> could you please give me an example of using % with a negative number
<baweaver> Have you tried in your REPL?
<comet23> i tried 5 % -1 and -1 % 5 and -1 % -1
<baweaver> What did that second one give you?
<comet23> i'm not sure i'm understanding what you're saying
<baweaver> &>> -1 % 3
<rubydoc> # => 2 (https://carc.in/#/r/5xuy)
<comet23> that's clever
<comet23> like really clever
<baweaver> So if i + offset is -1...
<baweaver> You now have the index of the end of the array
<baweaver> So 0 offset by -1 is -1, meaning it'd go at the end of the array
<baweaver> See if you can figure out how to code that in
<comet23> thank you :D
<baweaver> I'd suggest taking 3-5 lines
<baweaver> 1 is just showing off to make it compact
<comet23> i'm at 10
<comet23> :/
<comet23> i still haven't tested it yet
<comet23> 3 is referring to the number of items, correct?
<baweaver> yep
<baweaver> Here's the compact version: https://repl.it/@baweaver/IllustriousPristineClients
<comet23> will i be seeing a lot of code like that professionally>
Puffball has joined #ruby
<leftylink> save a line by changing the reduce to a .with_object
<baweaver> You'd be far far more likely to see `array.rotate(1)`
<baweaver> with_index makes the arg order kinda gnarly
<baweaver> but otherwise pretty much
<baweaver> Very rarely do you need to implement your own functions like that in the real world, though eventually it's nice to know how they work
<baweaver> reduce and each_with_object just happen to be absurdly overpowered functions capable of reimplementing any of the other Enumerable functions.
<baweaver> Including combinations thereof
<comet23> so why are we going through the pain of all these coding challenges?
<comet23> is it just to get a grasp for logical thinking?
<baweaver> It teaches you to think and consider things
<baweaver> You're not going to come to immediate solutions to things when starting out
<baweaver> Instead take time to write it out, get a feel for how the data flows, and try and find patterns
<baweaver> once you build that recognition you start noticing a lot of problems look awfully similar
aupadhye has joined #ruby
za1b1tsu has joined #ruby
nowhere_man has joined #ruby
virmagicis has joined #ruby
clemens3 has joined #ruby
akosednar has quit [Ping timeout: 272 seconds]
vondruch has quit [Quit: vondruch]
aupadhye has quit [Ping timeout: 258 seconds]
aupadhye has joined #ruby
akosednar has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has quit [Ping timeout: 272 seconds]
aupadhye has joined #ruby
lunarkitty7 has joined #ruby
phredus has joined #ruby
apparition has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
faraazahmad_ has quit []
vondruch has joined #ruby
faraazahmad_ has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
jottr_ has quit [Quit: WeeChat 2.2]
rippa has joined #ruby
DTZUZO has joined #ruby
faraazahmad_ has quit [Client Quit]
cthulchu has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
mikecmpbll has quit [Client Quit]
nowhere_man has quit [Ping timeout: 252 seconds]
nowhere_man has joined #ruby
themsay has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
Sina has joined #ruby
cschneid has joined #ruby
aupadhye has quit [Ping timeout: 244 seconds]
aupadhye has joined #ruby
jsrn has joined #ruby
aupadhye has quit [Ping timeout: 244 seconds]
apparition has quit [Quit: Bye]
aupadhye has joined #ruby
cd has joined #ruby
themsay has joined #ruby
olspookishmagus has quit [Ping timeout: 245 seconds]
cschneid has quit [Ping timeout: 264 seconds]
kapil____ has joined #ruby
TomyLobo has joined #ruby
comet23 has quit [Quit: Connection closed for inactivity]
queip has quit [Ping timeout: 246 seconds]
cschneid has joined #ruby
catphish has joined #ruby
queip has joined #ruby
<catphish> it would be really nice if ruby offered direct access to pipe2() with flags
sameerynho has joined #ruby
tinyhippo has left #ruby ["WeeChat 2.3"]
<catphish> may need to write a gem for it, though i've never written a C gem before
esrse has quit [Ping timeout: 246 seconds]
themsay has quit [Ping timeout: 250 seconds]
themsay has joined #ruby
cschneid has quit [Ping timeout: 250 seconds]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
themsay has quit [Ping timeout: 258 seconds]
themsay has joined #ruby
drale2k_ has joined #ruby
dripup has quit [Remote host closed the connection]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drale2k_ has joined #ruby
dminuoso has joined #ruby
dminuoso has left #ruby ["WeeChat 2.0.1"]
drale2k_ has quit [Client Quit]
conta has quit [Ping timeout: 240 seconds]
conta has joined #ruby
aupadhye has quit [Ping timeout: 245 seconds]
aupadhye has joined #ruby
tdy has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
aupadhye has quit [Ping timeout: 250 seconds]
aupadhye has joined #ruby
jlebrech has joined #ruby
vondruch has quit [Ping timeout: 250 seconds]
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
vondruch has joined #ruby
<jlebrech> i want to pack a string into a hexadecimal value, but pack is a method of array and not string
indocomsoft has joined #ruby
<al2o3-cr> jlebrech: got an example?
<jlebrech> basically need the reverse of unpack https://ruby-doc.org/core-2.3.0/String.html#method-i-unpack
<jlebrech> or maybe i need to use base62 but i shouldn't need a gem for that
<al2o3-cr> jlebrech: example input expected output?
donofrio has joined #ruby
<jlebrech> doesn't seem like the right thing
<jlebrech> only converts string into arrays, should probably use encode and decode instead
<indocomsoft> Hi guys, why does Ruby not has data structures as part of its stdlib? e.g. Python's heapq
<indocomsoft> Wondering if there's a particular reason
_whitelogger has joined #ruby
indocomsoft has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has quit [Ping timeout: 260 seconds]
nowhere_man has joined #ruby
thebigj has joined #ruby
<thebigj> I am running my blog on Jekyll (https://dpaste.de/y4gG/raw).
<thebigj> Github is trying to give me warning for using 3.3.1. It says to upgrade to whatever version above 3.6.3 source https://github.com/ultimatecoder/Blog/network/alert/Gemfile.lock/jekyll/open
<thebigj> I am following https://jekyllrb.com/docs/upgrading/
<thebigj> Applied all the commands
<thebigj> Still I found it is not upgrading from 3.3.1
<thebigj> Can anyone guide me if I am mistaking anywhere?
stryek has joined #ruby
phredus has quit [Ping timeout: 250 seconds]
<hays> there is also .bytes and .chars
catbusters has joined #ruby
nowhereman has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhereman is now known as Guest86938
cschneid has joined #ruby
Guest86938 has quit [Remote host closed the connection]
Guest86938 has joined #ruby
bmurt has joined #ruby
Guest86938 has quit [Read error: Connection reset by peer]
Guest86938 has joined #ruby
indocomsoft has joined #ruby
emers2n has joined #ruby
vondruch_ has joined #ruby
<emers2n> I'm struggling to format a hash with children to match a JSON request format: https://pastebin.com/raw/pUXGbCNE
<ruby[bot]> emers2n: as I told you already, please use https://gist.github.com
vondruch has quit [Ping timeout: 258 seconds]
vondruch_ is now known as vondruch
jcalla has quit [Ping timeout: 245 seconds]
Guest86938 has quit [Remote host closed the connection]
Guest86938 has joined #ruby
discopatrick has joined #ruby
cschneid has quit [Ping timeout: 245 seconds]
<go|dfish> emers2n: looking at the docs page for that api it says 'Requests are made with a GET request to the specified endpoint with a single parameter, data, which is a base64 and JSON encoded string.'
<go|dfish> emers2n: ok so you're using the lists api which is different however it says 'The arguments should be sent as content type application/json' on https://www.klaviyo.com/docs/api/v2/lists
<go|dfish> emers2n: this means post_form() is incorrect here
<emers2n> go|dfish: Wow, thank you. That's exactly what I was doing wrong, and I've adjusted the code to see successful calls now.
<go|dfish> emers2n: cool :)
<jlebrech> i have a strange issue where i get a template error but it's rendering correctly
<jlebrech> ActionView::Template::Error (undefined method `[]' for nil:NilClass)
<jlebrech> <h1>Project: <%= @context[:context] %></h1>
<jlebrech> but it renders correctly
Guest86938 has quit [Remote host closed the connection]
Guest86938 has joined #ruby
agent_white has joined #ruby
phaul has joined #ruby
aupadhye has quit [Ping timeout: 250 seconds]
aupadhye has joined #ruby
marmotini_ has quit [Ping timeout: 245 seconds]
vondruch has quit [Quit: vondruch]
mikecmpb_ has joined #ruby
vondruch has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
krawchyk has joined #ruby
conta has quit [Ping timeout: 268 seconds]
jcalla has joined #ruby
vondruch_ has joined #ruby
jlebrech has quit [Remote host closed the connection]
mikecmpb_ has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
vondruch has quit [Ping timeout: 246 seconds]
vondruch_ is now known as vondruch
NL3limin4t0r has joined #ruby
<catphish> al2o3-cr: oh that's beautiful, thanks! i had no idea it was that easy to do on the fly
hutch has joined #ruby
GodFather has joined #ruby
Puffball has quit [Remote host closed the connection]
cschneid has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
tdy has joined #ruby
indocomsoft has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
aupadhye has quit [Quit: Leaving]
dminuoso has joined #ruby
polishdub has joined #ruby
dminuoso has left #ruby ["WeeChat 2.0.1"]
d10n-work has joined #ruby
Bish has joined #ruby
<Bish> why is net/http so weird, seperating GET/POST into classes?
cow[moo] has joined #ruby
dkmueller has joined #ruby
<catphish> well they're different types of request
<catphish> it's sometimes a mild annoyance, but i wouldn't call it weird
<Bish> can't see the benefit of having "Request" Classes
<Bish> what do you do with them except for filling them with data
<Bish> so these things might aswell be parameters
<catphish> you can say the same about any such setup i guess, like the response classes
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
<Bish> well response classes make sense, because they have: return code & content
<Bish> content alone would be useless if you don't know if it's 200
<Bish> that isn't true for requests
Nicmavr has quit [Read error: Connection reset by peer]
<catphish> i don't understand
cschneid has quit [Ping timeout: 246 seconds]
<Bish> well.. reponse classes contain more information than requests,therefor they're useful
<Bish> request only have a body and head, and they only get written never read
<mspo> a 200 is no different from a 404 from a 999
<catphish> i don't follow that logic, nor do i agree with the facts
<Bish> mspo: weird, last time i checked they were different numbers
<catphish> responses have a return code, the class it just an added niceness, it's redundant in terms of data
Nicmavr has joined #ruby
<catphish> requests have no such redundancy, the only place the request method is specified in in the class name
<catphish> but again, it's purely a matter of taste, someone had to make a decision, they did
<mspo> Bish: in http a reponse has way less stuff than a request
<Bish> well everything is
<catphish> it would be perfectly functional either way
<Bish> mspo: how are they any different.. at low level
<Bish> head and body
<Bish> catphish: so is not using types at all
<catphish> "head and body" is a gross oversimplification
<mspo> a request has a verb at least
<mspo> which sets context
<mspo> every response will have the same stuff
<mspo> it's much simpler
<Bish> yeah but good they're not part of the request in ruby
<catphish> anyway, both are fairly simple containers
<Bish> since they have a class for those ^^
<catphish> and it was just a style decision to subclass them
<mspo> http/2 screws it all up, of course :)
<Bish> catphish: guessing the style of fewer people, because i rarely see people use net/http
<Bish> always some httparty something stuff
<TheBrayn> I can really recommend httparty
<TheBrayn> it's a joy to use
<catphish> personally i find the subclassing of http requests to be an annoyance, but not enough to warrant a complaint
<Bish> well i never got the benefit, it does http requests
<Bish> and you add a dependency for it
<Bish> i have only read / fixed code with it, not sure though
<catphish> i always end up with case statements in order to create instances of Net::HTTP::Request
<Bish> like having your own function which then gets a parameter for being get post put patch whatever?
aufi has quit [Ping timeout: 245 seconds]
aufi has joined #ruby
virmagicis has quit [Quit: Connection closed for inactivity]
Inline has joined #ruby
chouhoulis has joined #ruby
conta has joined #ruby
<catphish> yes
gnufied has joined #ruby
<Bish> catphish: so you write your function to get around the great comfort of having multiple requst classes
<Bish> :p?
<catphish> depends on the input data
<catphish> sometimes it's much more convenient being able to instantize a get request directly, other times it's annoying :)
spacesuitdiver has joined #ruby
conta has quit [Ping timeout: 258 seconds]
conta has joined #ruby
conta has quit [Ping timeout: 250 seconds]
Rapture has joined #ruby
Guest86938 has quit [Ping timeout: 252 seconds]
tdy has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
Renich has joined #ruby
Guest86938 has joined #ruby
RougerRR_ has joined #ruby
uplime has joined #ruby
tdy has joined #ruby
davidw_ has joined #ruby
dviola has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
RougerRR_ is now known as RougeR
gnufied has quit [Quit: Leaving]
Eiam_ has joined #ruby
Eiam has quit [Ping timeout: 268 seconds]
tdy has joined #ruby
millerti has joined #ruby
cthulchu has joined #ruby
cthulchu_ has joined #ruby
planigan has quit [Ping timeout: 250 seconds]
maryo has joined #ruby
cthulchu has quit [Ping timeout: 258 seconds]
catphish has quit [Quit: Leaving]
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
\void has joined #ruby
conta has joined #ruby
galaxie has joined #ruby
conta has quit [Remote host closed the connection]
<galaxie> Hi, I finally got annoyed enough to try and solve this problem. Basically I'm using RVM and it has worked for some time but since maybe 6 months ago it doesn't like anything with native extensions and spews garbage about extensions not being built for all these gems and they can't be found.
Guest86938 has quit [Ping timeout: 272 seconds]
galaxie has quit [Quit: ircII EPIC4-2.10.6 -- Are we there yet?]
galaxie has joined #ruby
<galaxie> Sorry, bad connection. I tried restoring all gems to pristine condition but that failed too.
<galaxie> I also use LXTerminal and tried integrating it but even bash -l no longer seems to work.
<uplime> what do you mean doesn't work?
<galaxie> As in, same error. No native extensions.
gnufied has joined #ruby
jsrn has quit [Ping timeout: 258 seconds]
<galaxie> Using different versions of Ruby also doesn't help, so it probably is rvm's fault.
tdy has quit [Ping timeout: 250 seconds]
tdy has joined #ruby
<galaxie> Gems that I install right now with native extensions that seem to install correctly are then not found and ignored.
aufi has quit [Ping timeout: 250 seconds]
<uplime> what does `type gem` say?
<galaxie> It's a function linked to rvm.
reber has joined #ruby
conta has joined #ruby
<phaul> galaxie: paste all error logs you have (full logs please), including the commands you executed.
conta2 has joined #ruby
<galaxie> Wait a minute, I think I somehow alias'd ruby to something other than rvm's shem or whatever and forgot about it. Wow, that worked.
galaxie has quit []
conta has quit [Ping timeout: 272 seconds]
conta2 is now known as conta
bmurt has quit [Quit: Textual IRC Client: www.textualapp.com]
bmurt has joined #ruby
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
Swyper has joined #ruby
Eiam_ is now known as Eiam
cthulchu has joined #ruby
Swyper has quit [Remote host closed the connection]
GodFather has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
film42 has joined #ruby
orbyt_ has joined #ruby
<film42> I was wondering if it would be worth experimenting with caching of zero-values in ruby. Where [], {}, and "" literals are shared references and only dup'd on mutation.
davidw_ has quit [Remote host closed the connection]
<film42> The hypothesis being that we often return empty arrays and hashes in rack middlewares.
davidw_ has joined #ruby
<film42> Might not actually be worth the effort, but wanted to bounce it off #ruby before trying anything.
r29v has joined #ruby
clemens3 has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Max SendQ exceeded]
<uplime> i thought string literals were already frozen? would they still need to be "cached"?
sanscoeur has joined #ruby
Swyper has joined #ruby
RougeR has quit [Ping timeout: 252 seconds]
conta2 has joined #ruby
tdy has quit [Remote host closed the connection]
orbyt_ has joined #ruby
<film42> uplime: String literals might be. I'm thinking about array and hash literals as well.
<film42> And not frozen as in "immutable" but cached as in memory is shared until modified. Like the zero-value is an immutable value that is dup'd before mutation.
hovis has joined #ruby
Aqo has joined #ruby
conta2 has quit [Ping timeout: 258 seconds]
hutch has quit [Ping timeout: 244 seconds]
KeyJoo has joined #ruby
indocomsoft has joined #ruby
<catbusters> Hi
mikecmpbll has joined #ruby
<catbusters> I'm trying to create a method inside a class that can only be called from within that class. Here's my code (http://tpcg.io/1REYkr) but I can't get it to work
<catbusters> What am I doing wrong?
planigan has joined #ruby
hutch has joined #ruby
<phaul> catbusters: you are mixing instance methods and class methods.
<phaul> add is an instance method. call is a class method. calling add from call doesn't work as without explicit receiver it is sent to the class, but the class doesn't have such method
<catbusters> phaul: How can I fix it? I want to be able to do Something.call (without creating a new instance), and the call method needs to call other private methods
<catbusters> In the example above, I removed `private` from the add definition and made it `self.add` which makes it work, but I don't want `Something.add` to be callable
kapil____ has joined #ruby
Sou|cutter has joined #ruby
emers2n has quit [Quit: Page closed]
<phaul> make it private, and make it class method. open the singleton class with class << self .. end syntax, declare a private scope, and define the method (without self)
chouhoulis has quit [Remote host closed the connection]
sauvin has quit [Ping timeout: 268 seconds]
<catbusters> phaul: You mean like this? https://bpaste.net/show/d06194244e14
<phaul> yes, that should do what you want
<catbusters> phaul: Alright. And what I'm trying to do is create a Rails service object, so does this way of doing it make sense or am I off track?
sanscoeu_ has joined #ruby
marmotini_ has joined #ruby
sanscoeur has quit [Ping timeout: 272 seconds]
<phaul> I'm not sure, I am not a big fan of thsese design patterns in Ruby, I fail to see why just PORM (plain old ruby modules) are not enough to factor code out if the code is separable enough from the rest of the class. But someone else might see things differently
marmotini has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
marmotini_ has quit [Ping timeout: 246 seconds]
FastJack has joined #ruby
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> oops, bad autocomplete >.>
<havenwood> catbusters: ^
film42 has quit [Quit: Page closed]
sanscoeu_ has quit [Remote host closed the connection]
sanscoeur has joined #ruby
<havenwood> catbusters: If you aren't instantiating it, use a module instead of a class.
cnsvc has joined #ruby
cnsvc has quit [Client Quit]
<catbusters> Thanks, I'll try using modules instead. Out of curiosity, is `private_class_method` preferable to `class << self` though?
<catbusters> phaul: PORO is what I was going for
cnsvc has joined #ruby
krawchyk_ has joined #ruby
themsay has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
krawchyk has quit [Ping timeout: 244 seconds]
<havenwood> catbusters: They're different things.
indocomsoft has quit [Quit: Textual IRC Client: www.textualapp.com]
discopatrick has quit [Quit: Connection closed for inactivity]
<catbusters> So many ways to do things 😅
<catbusters> Would just defining a method inside a module be enough?
<uplime> are modules able to make use of [public, protected, private] like classes?
<phaul> havenwood: when you said they are different things, I think you misunderstood the question. even though catbusters missed the full code I think it was about private_class_method vs class << self; private def blah .. Those are semantically equivalent right? Just using different syntax to achieve the same
<phaul> in other words a making the instance method of the class' singleton class private is the same as making a class method of the class private.
<phaul> &>> module M; class << self; private def blah; 1; end; end; end; M.blah
<rubydoc> # => private method `blah' called for M:Module (NoMethodError) (https://carc.in/#/r/5y0o)
reber has quit [Remote host closed the connection]
<phaul> uplime: ^
<uplime> neat
themsay has joined #ruby
<uplime> but M#blah (did i use that right?) is still accessible within M right?
planigan has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 268 seconds]
reber has joined #ruby
<uplime> guess i could just try it out myself :}
<uplime> thanks phaul
hutch has quit [Ping timeout: 244 seconds]
orbyt_ has joined #ruby
Tharbakim has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Read error: Connection reset by peer]
planigan has joined #ruby
orbyt_ has joined #ruby
hutch has joined #ruby
maryo_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sou|cutter has quit [Quit: WeeChat 1.4]
maryo has quit [Ping timeout: 250 seconds]
Swyper has quit [Remote host closed the connection]
orbyt_ has joined #ruby
RedNifre has joined #ruby
RougeR has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
conta has quit [Quit: conta]
marmotini has quit [Ping timeout: 250 seconds]
dellavg_ has quit [Ping timeout: 246 seconds]
SeepingN has joined #ruby
<havenwood> phaul: Ah, gotcha. You're right, I misunderstood the question.
perique has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk_ has quit [Quit: krawchyk_]
Sou|cutter has joined #ruby
gix has joined #ruby
ur5us has joined #ruby
krawchyk has joined #ruby
mn3m has joined #ruby
RedNifre has quit [Ping timeout: 252 seconds]
RedNifre has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
davidw_ has quit [Remote host closed the connection]
davidw_ has joined #ruby
polishdub has quit [Remote host closed the connection]
maryo_ has quit [Ping timeout: 244 seconds]
orbyt_ has joined #ruby
fiachetti has quit [Ping timeout: 258 seconds]
tdy has joined #ruby
orbyt_ has quit [Ping timeout: 268 seconds]
conta has joined #ruby
sqbell has joined #ruby
marmotini has joined #ruby
conta has quit [Ping timeout: 246 seconds]
lytol has joined #ruby
dbugger_ has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 2.3]
conta has joined #ruby
tdy has quit [Remote host closed the connection]
marmotini has quit [Ping timeout: 268 seconds]
davidw_ has quit [Remote host closed the connection]
RedNifre has quit [Ping timeout: 252 seconds]
davidw_ has joined #ruby
sanscoeu_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
RedNifre has joined #ruby
conta has quit [Ping timeout: 272 seconds]
sanscoeur has quit [Ping timeout: 245 seconds]
sqbell has quit [Ping timeout: 244 seconds]
hutch has quit [Ping timeout: 258 seconds]
Aqo has quit [Ping timeout: 250 seconds]
Tharbakim has joined #ruby
hutch has joined #ruby
szulak_ has joined #ruby
donofrio has quit [Ping timeout: 245 seconds]
sanscoeu_ has quit [Remote host closed the connection]
sanscoeur has joined #ruby
donofrio has joined #ruby
davidw_ is now known as davidw
davidw has quit [Remote host closed the connection]
davidw_ has joined #ruby
agent_white has quit [Quit: bbl]
reber has quit [Remote host closed the connection]
lunarkitty7 is now known as lunarkittychan
KeyJoo has quit [Quit: KeyJoo]
szulak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lytol has quit [Ping timeout: 268 seconds]
davidw_ is now known as davidw
davidw has quit [Remote host closed the connection]
davidw_ has joined #ruby
szulak_ has joined #ruby
davidw_ is now known as davidw
szulak_ has quit [Quit: Textual IRC Client: www.textualapp.com]
tiff has joined #ruby
Sou|cutter has quit [Quit: WeeChat 1.4]
tdy has joined #ruby
krawchyk has quit [Quit: krawchyk]
cnsvc has quit [Ping timeout: 256 seconds]
postmodern has joined #ruby
spacesuitdiver has quit [Quit: Textual IRC Client: www.textualapp.com]
conta has joined #ruby
fuzzface has joined #ruby
conta has quit [Ping timeout: 258 seconds]
RedNifre has quit [Ping timeout: 252 seconds]
fuzzface has quit [Quit: Leaving]
catbusters has quit [Quit: Connection closed for inactivity]
perique has quit [Ping timeout: 268 seconds]
comet23 has joined #ruby
<comet23> when is a good time to use "and" "or" "not"
<baweaver> Common rule: don't
<baweaver> prefer !, &&, and ||
<baweaver> You're more likely to give yourself headaches with operator precedence by using the english versions comet23
<phaul> &>> a = false or true; a
<rubydoc> # => false (https://carc.in/#/r/5y2q)
ramfjord has quit [Ping timeout: 258 seconds]
ramfjord has joined #ruby
RedNifre has joined #ruby
drale2k_ has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kankava has joined #ruby
<kankava> Hi guys, anyone here uses spree commerce?
<baweaver> kankava: I'd suggest contacting their support channels for questions
<baweaver> They have them listed here: https://spreecommerce.org/
rkazak has joined #ruby
orbyt_ has joined #ruby
<comet23> thank you baweaver
<comet23> so there is absolutely no reason to use the english versions
<baweaver> For where you're currently at in programming, no.
<baweaver> There are exceptions to every rule, but typically you want to play by those rules where possible to avoid confusion.
<baweaver> Much the same with metaprogramming and eval. 99% of the time you don't need them, but every beginner wants to use them at every turn because they have a shiny new tool and it looked fun
<baweaver> More often than not they end up creating a pretty big mess of it when a single-line would have done the same thing if they hadn't been fixating on that.
<comet23> i'm going through app academy's free ruby course
<comet23> they put their whole curriculum out online for free
<comet23> and, or, and not are near-synonyms of &&, ||, and !. The sole difference is that they have lower precedence in the order of operations. For the purposes of this course, we will only be using &&, ||, and ! -- we strongly discourage (at least for now) ever using and, or, and not. Once you've finished the course and are out in the real world, you may find useful applications for these operators, but for now we will not be using
<comet23> them.
ansraliant has joined #ruby
<comet23> i'm sorry i thought it was going to put it in the irccloud pastebin
<Radar> All good. It's only two lines.
<kankava> @baweaver thanks
sanscoeu_ has joined #ruby
<baweaver> That's a fair assessment by them. There are uses but they're rare and are rarely justifiable