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
jud^ is now known as jud
jud has quit [Changing host]
jud has joined #ruby
ecuanaso has joined #ruby
jgt1 has quit [Ping timeout: 240 seconds]
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
GinoMan1423 has quit [Read error: Connection reset by peer]
Munto has joined #ruby
GinoMan1423 has joined #ruby
troys has joined #ruby
Guest69 has joined #ruby
tsul has quit [Ping timeout: 258 seconds]
nowhere_man has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
quazimodo has quit [Ping timeout: 268 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhereman has quit [Ping timeout: 240 seconds]
nitric has quit [Ping timeout: 240 seconds]
tsul has joined #ruby
dmtd has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cohedrin has joined #ruby
ascarter has joined #ruby
chouhoulis has joined #ruby
Kestrel-029 has quit [Read error: Connection reset by peer]
ascarter has quit [Client Quit]
Fernando-Basso has quit [Quit: WeeChat 1.8]
ascarter has joined #ruby
ascarter has quit [Client Quit]
stormbytes has quit [Ping timeout: 268 seconds]
LastWhisper____ has joined #ruby
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
DeeJayh has joined #ruby
tsul has quit [Ping timeout: 245 seconds]
DeeJayh_ has quit [Ping timeout: 260 seconds]
DeeJayh__ has joined #ruby
kies has joined #ruby
tsul has joined #ruby
bast has quit [Ping timeout: 255 seconds]
DeeJayh has quit [Ping timeout: 240 seconds]
dc2 has joined #ruby
Nicmavr has joined #ruby
Nicmavr is now known as Guest24406
Guest24406 has quit [Changing host]
Guest24406 has joined #ruby
Guest24406 is now known as Kestrel-029
bast has joined #ruby
bast has joined #ruby
bast has quit [Changing host]
SeepingN_ has quit [Quit: The system is going down for reboot NOW!]
KnownSyntax has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
shinnya has quit [Ping timeout: 260 seconds]
polysics has joined #ruby
dc2 has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Rodya_ has quit [Ping timeout: 246 seconds]
Mia has quit [Read error: Connection reset by peer]
quazimodo has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
polysics has quit [Ping timeout: 260 seconds]
brent__ has quit [Remote host closed the connection]
bkxd has joined #ruby
KeyJoo has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
brent__ has joined #ruby
rohitpaulk has joined #ruby
bandu has quit [Changing host]
bandu has joined #ruby
bandu is now known as coyo
charliesome has joined #ruby
brent___ has joined #ruby
bkxd has quit [Ping timeout: 245 seconds]
brent__ has quit [Ping timeout: 260 seconds]
brent___ is now known as brent__
jenrzzz has quit [Ping timeout: 260 seconds]
Munto has quit [Quit: Leaving]
hlmjr has quit [Quit: Konversation terminated!]
apparition has joined #ruby
Guest69 has joined #ruby
latemus has quit [Ping timeout: 272 seconds]
herbmillerjr has joined #ruby
quazimodo has quit [Ping timeout: 260 seconds]
JoshS has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
roamingdog has joined #ruby
jrafanie has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
ascarter has joined #ruby
BSAlb has joined #ruby
quazimodo has joined #ruby
enterprisey has joined #ruby
BSaboia has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
rkazak has joined #ruby
ecuanaso has joined #ruby
jusa has joined #ruby
KnownSyntax has quit [Ping timeout: 260 seconds]
uZiel has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
kies has quit [Ping timeout: 260 seconds]
BSab has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jusa has quit [Ping timeout: 240 seconds]
troys is now known as troys_
BSAlb has quit [Ping timeout: 245 seconds]
uZiel has quit [Ping timeout: 248 seconds]
bruce_lee has quit [Ping timeout: 268 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
roger_rabbit has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dc2 has joined #ruby
Guest69 has joined #ruby
mim1k has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
sepp2k has quit [Ping timeout: 240 seconds]
ascarter has quit [Client Quit]
dc2 has quit [Ping timeout: 268 seconds]
uranellus has quit [Ping timeout: 245 seconds]
ascarter has joined #ruby
d^sh_ has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 255 seconds]
d^sh has joined #ruby
ur5us has joined #ruby
brent___ has joined #ruby
uranellus has joined #ruby
uranellus has joined #ruby
uranellus has quit [Changing host]
charliesome has joined #ruby
rohitpaulk has quit [Ping timeout: 245 seconds]
gothicsouth has joined #ruby
uZiel has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
brent___ has quit [Ping timeout: 260 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hosttor has joined #ruby
gizmore|2 has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
gizmore has quit [Ping timeout: 255 seconds]
patr0clus has joined #ruby
minimalism has joined #ruby
marxarelli is now known as marxarelli|afk
LastWhisper____ has joined #ruby
bougyman_ has quit [Changing host]
bougyman_ has joined #ruby
bougyman_ is now known as bougyman
armguy has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
PorcoRex has joined #ruby
<PorcoRex> Evening #Ruby-
pazzaz has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
_blaze_ has joined #ruby
<_blaze_> Is secureRandom a part of ruby? or do I need to download it and implement it into my project
<_blaze_> Also I'm trying to use secure random to generate a token, which then will be masked over an id so then it cannot be traced with the id or opened
ecuanaso has joined #ruby
<lostapathy> ot just gen a uuid?
_blaze_ has quit [Remote host closed the connection]
<PorcoRex> _blaze_ SecureRandom is part of Ruby's standard library, so you should be able to require it in most cases.
<PorcoRex> _blaze_ your second concern needs a bit more explanation.
cdg has quit [Remote host closed the connection]
gnufied has quit [Quit: Leaving]
cdg has joined #ruby
genpaku has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 260 seconds]
genpaku has joined #ruby
oncall-pokemon has quit [Quit: Connection closed for inactivity]
roamingdog has quit []
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
hosttor has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
Guest69 has joined #ruby
armguy has joined #ruby
ascarter has joined #ruby
ur5us_ has joined #ruby
ur5us_ has quit [Remote host closed the connection]
TinkerTyper has quit [Ping timeout: 240 seconds]
blackwind_123 has joined #ruby
dc2 has joined #ruby
jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
TinkerTyper has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
jameser has joined #ruby
gothicsouth has joined #ruby
haylon has joined #ruby
brent___ has joined #ruby
dc2 has quit [Ping timeout: 260 seconds]
brent___ has quit [Remote host closed the connection]
ledestin has joined #ruby
haylon has quit []
ur5us has joined #ruby
jjaii9 has joined #ruby
troys_ is now known as troys
jjaii9 has quit [Ping timeout: 255 seconds]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
HoierM has quit [Ping timeout: 260 seconds]
ozcanesen has joined #ruby
uZiel has quit [Remote host closed the connection]
AnoHito_ has joined #ruby
Guest69 has joined #ruby
uZiel has joined #ruby
cdg_ has joined #ruby
AnoHito has quit [Ping timeout: 268 seconds]
xall has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
xall has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
gix has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
dc2 has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
gix has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dc2 has quit [Ping timeout: 240 seconds]
polysics has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
patr0clus has quit [Quit: WeeChat 1.4]
cisco has quit [Quit: Leaving.]
claw has quit [Ping timeout: 240 seconds]
polysics has quit [Ping timeout: 260 seconds]
Trynemjoel has quit [Ping timeout: 245 seconds]
segmond has joined #ruby
Trynemjoel has joined #ruby
_blaze_ has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
_blaze_ has quit [Remote host closed the connection]
cdg_ has quit [Remote host closed the connection]
sarbs has joined #ruby
claw has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
blackwind_123 has quit [Ping timeout: 268 seconds]
troys is now known as troys_
blackwind_123 has joined #ruby
brent__ has quit [Quit: Connection closed for inactivity]
xall has joined #ruby
PatrikasZvaigzde has quit [Ping timeout: 260 seconds]
kies has joined #ruby
PatrikasZvaigzde has joined #ruby
staticfox has quit [Ping timeout: 260 seconds]
xerx has joined #ruby
rohitpaulk has joined #ruby
Guest69 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
xerx has quit [Client Quit]
uZiel has quit [Ping timeout: 248 seconds]
xerx has joined #ruby
xall has quit [Quit: xall]
xall has joined #ruby
xall has quit [Client Quit]
Tharbakim has quit [Quit: Something has gone terribly wrong. Send help.]
xall has joined #ruby
xall has quit [Client Quit]
Tharbakim has joined #ruby
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
uZiel has joined #ruby
nowhereman has joined #ruby
xall has joined #ruby
Bhootrk_ has joined #ruby
Bhootrk_ has quit [Max SendQ exceeded]
xall has quit [Client Quit]
xall has joined #ruby
xall has quit [Client Quit]
nowhere_man has quit [Ping timeout: 255 seconds]
xall has joined #ruby
xall has quit [Client Quit]
xall has joined #ruby
xall has quit [Client Quit]
elomatreb has left #ruby ["leaving"]
elomatreb has joined #ruby
sneakerhax has joined #ruby
dc2 has joined #ruby
renchan has joined #ruby
Cohedrin has quit [Ping timeout: 255 seconds]
Cohedrin has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
polysics has joined #ruby
konsolebox has joined #ruby
staticfox has joined #ruby
troys_ is now known as troys
polysics has quit [Ping timeout: 240 seconds]
staticfox has quit [Read error: Connection reset by peer]
Rich_Morin__ has quit [Ping timeout: 260 seconds]
scott4000 has quit [Ping timeout: 245 seconds]
ur5us has quit [Remote host closed the connection]
xMopxShell has quit [Ping timeout: 240 seconds]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
Rich_Morin_ has joined #ruby
scott4000 has joined #ruby
xMopxShell has joined #ruby
mim1k has quit [Ping timeout: 245 seconds]
Rich_Morin_ has quit [Ping timeout: 240 seconds]
JayGee has joined #ruby
staticfox has joined #ruby
jgt1 has joined #ruby
Tharbakim has quit [Quit: Something has gone terribly wrong. Send help.]
Rich_Morin_ has joined #ruby
Tharbakim has joined #ruby
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
segmond has quit [Quit: l8r]
kies has quit [Ping timeout: 268 seconds]
bkxd has joined #ruby
Bock has joined #ruby
harfangk has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
polysics has joined #ruby
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
brent__ has quit [Remote host closed the connection]
aupadhye has joined #ruby
aupadhye has quit [Client Quit]
kies has joined #ruby
Muz_ is now known as Muz
anisha has joined #ruby
dn` has quit [Ping timeout: 245 seconds]
aupadhye has joined #ruby
Rodya_ has joined #ruby
rohitpaulk has quit [Ping timeout: 255 seconds]
rgr_ has joined #ruby
<ledestin> would you say that saving a few cycles by moving a variable assignment out of a loop is premature optimisation?
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<matthewd> ledestin: If it doesn't depend on the loop body, I'd say it's clarifying/simplifying
<ledestin> matthewd well, it's used only in the loop body
<ledestin> but doesn't depend on the items that are iterated over
rohitpaulk has joined #ruby
<ledestin> well, guess that's good thinking
<matthewd> Yeah, then I would consider just-before-the-loop to be the clearest place for it
<ledestin> yeah. cool, thanks matthewd
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
polysics has quit [Remote host closed the connection]
PorcoRex has quit [Remote host closed the connection]
anisha_ has joined #ruby
ozcanesen has quit [Quit: Textual IRC Client: www.textualapp.com]
rohitpaulk has quit [Ping timeout: 240 seconds]
anisha has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Quit: Leaving...]
anisha_ has quit [Ping timeout: 240 seconds]
oleo has quit [Quit: irc client terminated!]
cfec0b8d has joined #ruby
cfec0b8d has quit [Remote host closed the connection]
dc2 has joined #ruby
cfec0b8d has joined #ruby
cfec0b8d has quit [Remote host closed the connection]
polysics has joined #ruby
cfec0b8d has joined #ruby
konsolebox has quit [Ping timeout: 255 seconds]
cfec0b8d has quit [Remote host closed the connection]
dc2 has quit [Ping timeout: 240 seconds]
cfec0b8d has joined #ruby
pwnd_nsfw` has joined #ruby
anisha_ has joined #ruby
pwnd_nsfw has quit [Ping timeout: 260 seconds]
johnny56 has quit [Ping timeout: 264 seconds]
armando has quit [Ping timeout: 272 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
pwnd_nsfw has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 255 seconds]
nowhereman has quit [Ping timeout: 260 seconds]
nicesignal has quit [Ping timeout: 258 seconds]
amclain has quit [Quit: Leaving]
<kke_> could i somehow reset pretty much everything in rspec? (to test that everything is required at the right place)
armando has joined #ruby
<matthewd> kke_: Not really. Rails does it by running every test file in a separate Ruby instance, and hoping that's sufficiently fine-grained.
Cohedrin has quit [Read error: Connection reset by peer]
bigkevmcd has joined #ruby
uZiel has quit [Remote host closed the connection]
pwnd_nsfw` has joined #ruby
Cohedrin has joined #ruby
pwnd_nsfw has quit [Ping timeout: 245 seconds]
andikr has joined #ruby
uZiel has joined #ruby
dn` has joined #ruby
rgr_ has quit [Ping timeout: 245 seconds]
jamesaxl has joined #ruby
troys has quit [Quit: Bye]
ta has quit [Remote host closed the connection]
djbkd has joined #ruby
jgt2 has joined #ruby
ecuanaso has joined #ruby
conta has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jgt1 has quit [Ping timeout: 240 seconds]
chat_ has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Robtop__ has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
enterprisey has quit [Quit: Leaving]
cfec0b8d has quit [Remote host closed the connection]
cfec0b8d has joined #ruby
erry has quit [Ping timeout: 240 seconds]
chat has joined #ruby
chat is now known as Guest97009
dc2 has joined #ruby
rohitpaulk has joined #ruby
nowhereman has joined #ruby
dc2 has quit [Ping timeout: 245 seconds]
vali has joined #ruby
rohitpaulk has quit [Ping timeout: 260 seconds]
<zenspider> matthewd: not just every test file. IsolationTest runs each test in its own process as well.
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> I wasn't aware of the test file separation... does it actually help? last I checked, it still wasn't fully randomization safe
<zenspider> kke_: maybe you want a rake task that runs each file one at a time to make sure they require everything they need?
<zenspider> that's the type of thing I wouldn't want to run every time tho
jgnagy has quit [Remote host closed the connection]
jgnagy has joined #ruby
johnny56 has joined #ruby
horst has joined #ruby
jgnagy has quit [Ping timeout: 255 seconds]
jjaii9 has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
TomyWork has joined #ruby
horst has quit [Quit: horst]
aurelien has quit [Remote host closed the connection]
horst has joined #ruby
Pumukel has joined #ruby
jjaii9 has quit [Ping timeout: 240 seconds]
aurelien has joined #ruby
uZiel has joined #ruby
anisha_ has quit [Ping timeout: 240 seconds]
jjaii9 has joined #ruby
anisha_ has joined #ruby
aufi has joined #ruby
roshanavand has joined #ruby
pankaj_ has joined #ruby
djbkd has quit []
nicesignal has joined #ruby
erry has joined #ruby
t-recx has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
saschavoid has joined #ruby
ta has joined #ruby
ecuanaso has joined #ruby
x27 has joined #ruby
KeyJoo has joined #ruby
gizmore|2 has quit [Ping timeout: 240 seconds]
rgr_ has joined #ruby
jjaii9_ has joined #ruby
jjaii9_ has quit [Client Quit]
anisha_ has quit [Quit: Leaving]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has joined #ruby
ecuanaso has joined #ruby
jjaii9 has quit [Ping timeout: 272 seconds]
PaulCapestany has quit [Quit: .]
ur5us has joined #ruby
ecuanaso has quit [Client Quit]
mtkd has quit [Read error: Connection reset by peer]
dc2 has joined #ruby
mtkd has joined #ruby
nofxxxx has joined #ruby
konsolebox has joined #ruby
anisha has joined #ruby
nowhereman has quit [Ping timeout: 240 seconds]
nofxxx has quit [Ping timeout: 268 seconds]
dc2 has quit [Ping timeout: 240 seconds]
Bish_ has joined #ruby
Bish has quit [Ping timeout: 260 seconds]
PaulCapestany has joined #ruby
jenrzzz has joined #ruby
Cohedrin has joined #ruby
pankaj_ has quit [Ping timeout: 272 seconds]
mim1k has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
statikowsky has quit [Quit: Connection closed for inactivity]
bambanx has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
nhhc has joined #ruby
Pumukel has quit [Remote host closed the connection]
quobo has joined #ruby
Pumukel has joined #ruby
konsolebox has quit [Quit: Leaving]
pandaant has joined #ruby
Pumukel has quit [Ping timeout: 255 seconds]
postmodern has quit [Remote host closed the connection]
x27 has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
mathys has joined #ruby
Beams has joined #ruby
cyphase has quit [Ping timeout: 255 seconds]
im0nde has joined #ruby
Mortomes|Work has joined #ruby
im0nde_ has joined #ruby
armando has quit [Ping timeout: 246 seconds]
cyphase has joined #ruby
im0nde has quit [Ping timeout: 260 seconds]
im0nde_ is now known as im0nde
nowhereman has joined #ruby
ur5us has quit [Remote host closed the connection]
mim1k has joined #ruby
Emmanuel_Chanel has quit [Remote host closed the connection]
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
sinebif has joined #ruby
<sinebif> how do i use ruby as a calc
<sinebif> I did type ruby in the terminal in linux
<sinebif> but I don't get an interpreter?
<sinebif> also where is the notebook?
<herwin> guess you're looking for irb
<herwin> as the interpreter
<herwin> no clue wat the notebook should be
mim1k_ is now known as mim1k
<sinebif> herwin: then there is no notebook??
<sinebif> a good GUI
<sinebif> then why nothing comes when I press ruby ?? but need irb
<herwin> then type irb in the console instead of ruby
<herwin> i guess
<herwin> and by GUI you mean IDE?
xall has joined #ruby
aupadhye has quit [Ping timeout: 246 seconds]
<sinebif> hey it doesn't even have auto complete
<sinebif> I need a notebook like ipython's, so that I can get rid of that ugly terminal
lxsameer has joined #ruby
<sinebif> and limited terminal
<sinebif> herwin: I need an excellent IDE, more like spyder
<sinebif> Scientific IDE
anonymus has left #ruby ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
dc2 has joined #ruby
rohitpaulk has joined #ruby
<sinebif> there is learn ruby in 20 minutes?
<sinebif> is this a joke?
<sinebif> Can it be learnt even quicker than python?
<sinebif> tell me someone
dc2 has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 268 seconds]
torarne has joined #ruby
Pumukel has joined #ruby
<torarne> Q: I have a class in a random module/namespace that I can get hold of an instance off, and call .class on. Is there any way to extend that class in a separate/module namespace, as if the original class was evaled in the other module? Just doing class Foo < bar.class doesn't work for some reason
<ljarvis> torarne: Foo = Class.new(bar.class). That's not "extending" it though, it's just creating a new subclass
<elomatreb> Can't you pass a block to Class.new and define methods like you normally would?
tvw has joined #ruby
<ljarvis> yep
<torarne> ljarvis: that would have the same effect as Foo < bar.class? What I'm seeing there is that attributes of the base Bar class, eg url "http:/..." do not seem to have any effect on the subclass, as if they were not set
rkazak has quit [Quit: Sleep.....ing....]
<ljarvis> torarne: you'll have to provide some example code i'm afraid
im0nde has quit [Ping timeout: 255 seconds]
Fernando-Basso has joined #ruby
* dminuoso pokes ljarvis with a stick
im0nde has joined #ruby
<ljarvis> torarne: https://eval.in/809314
* ljarvis pokes dminuoso with a cattle prod
<dminuoso> What the fuck.
<torarne> ljarvis: i'm trying to extend an existing homebrew formula. but brew complains that "Error: formulae require at least a URL"
<dminuoso> torarne: What the fuck is this gist?
<dminuoso> 2.5k lines?
<torarne> dminuoso: the two small files are mine, formula.rb is from homebrew
<ljarvis> you can remove formula.rb
<ljarvis> it's unhelpful
<ljarvis> torarne: the "url" attribute is not inherited. It's stored on the Foo instance of Class
<torarne> Ah, i see. Is there any way to change that? Proxy all attrribute accesses to the base ?
<ljarvis> you want MyFormula to have the same url as Foo?
<torarne> Yupp
<ljarvis> well, it's possible.. but why exactly? are you doing something weird that other homebrew maintainers don't do?
<ljarvis> because this must be a solved issue
<torarne> So I can extend a formula's install() step, without having to make a copy of the whole formula i'm extended, meaning i'd have to rebase it every time the formula version is updated
<sinebif> which is the best IDE for ruby ?
<sinebif> I hate terminal
<torarne> unfortunately it's not really supported by homebrew out of the box
<ljarvis> sinebif: the best one is the one that works for you, so try one of them?
<ljarvis> (ps the terminal is best by far)
<sinebif> ljarvis: no for scientific computing
<sinebif> more like spyder
<sinebif> all don't work for me
<ljarvis> torarne: perhaps SimpleDelegator in stdlib would help
<ljarvis> sinebif: "don't work for me" isn't very specific. I'm not really sure what you want anyone here to help you with
anonymus has joined #ruby
<torarne> ljarvis: i assume most maintainers are maintaining the canoical brew formula for a software packge, so there they don't have that issue. brew supports pinning other taps, so i can provide an alternate formula for an existing packge, but i'd have to provide the full package, making mine stale quite fast, which is why i'd rather inherit the existing formula and just add my tweak, so i can pick up any changes to the software
<torarne> version in the default formula
<anonymus> guys? please help
<dminuoso> ?help
<ruby[bot]> You can find an overview of my commands at http://ruby-community.com/ruboto/commands
<ljarvis> ^ lol
<anonymus> I even do not know how to explain my pain
<anonymus> I have an array of Structs
<dminuoso> anonymus: Have you tried consulting a pain management doctor?
<ljarvis> anonymus: well, go off and try to figure that out before writing a coherant question here
romank has joined #ruby
<anonymus> with 2 variables in each
<dminuoso> ljarvis: before writing a coherent question?
<ljarvis> torarne: right, OK. I guess I'm just duplicate everything *shrug*
<dminuoso> ljarvis: you make it sound like anything of that was coherent.
* dminuoso nitpicks on ljarvis
<ljarvis> anonymus: stop, write your entire question in one sentence
<dminuoso> take that!
<ljarvis> dminuoso: :(
<dminuoso> torarne: What you could do is .dup the original class and modify it.
<dminuoso> That sounds like a cool thing to do.
<anonymus> I want to do something like structs.each {|s| s.first_var = s.second_var}; p first_var
<ljarvis> ^ and then pick up a shotgun to blow your leg off
<dminuoso> Though Im not sure what that "url attribute" is supposed to mean.
<anonymus> bljad
<ruby[bot]> anonymus: We can't help you without your code, please post it to https://gist.github.com
<ljarvis> ?code anonymus
<dminuoso> That code has no url attribute. It's a method.
<ljarvis> nitpick master today, dminuoso
<dminuoso> !
<dminuoso> Im trying to get a medal.
<ljarvis> ?medal
<ruby[bot]> ljarvis: I don't know anything about medal
<torarne> dminuoso: hmm, interesting, would that allow me to call super though?
ahrs has quit [Remote host closed the connection]
<ljarvis> nope
<dminuoso> torarne: You can use super all day long
<anonymus> omg bot battle
<dminuoso> the question is just what it does.
<torarne> :)
<dminuoso> >> super
<ruby[bot]> dminuoso: # => super called outside of method (NoMethodError) ...check link for more (https://eval.in/809316)
<dminuoso> Okay well.
<ljarvis> anonymus: go and post your code if you want help
<dminuoso> Perhaps not all day long.
<ljarvis> >> def foo() super; end; foo
<ruby[bot]> ljarvis: # => super: no superclass method `foo' for main:Object (NoMethodError) ...check link for more (https://eval.in/809317)
<ljarvis> we're getting there team
rohitpaulk has joined #ruby
<torarne> to put it another way, i want to extend install() and caveats(), but still call the base implementation, either though super or some other magic trick that achieves the same :)
<polysics> !kernels
<polysics> !kernel
<polysics> ok, I failed.
<ljarvis> polysics: what are you doing?
<anonymus> ljarvis: im trying man
<matthewd> torarne: Module#prepend may interest you
ahrs has joined #ruby
<polysics> ljarvis: there's a command to see all current kernel versions :)
<ljarvis> kernel versions for what?
<polysics> oh haha
<polysics> wrooooong channel
<polysics> sorry
<ljarvis> wow, impressive
<ljarvis> you can have the medal i was going to give to dminuoso
<anonymus> here it is
<polysics> ty ty
<anonymus> ljarvis:
<anonymus> I need something like that
<anonymus> imap = "_imap._tcp.yaa1.ololo.com. 7200 IN SRV 0 5 143 imap.yaa1.ololo.com.",
<anonymus> in my script
tvw has quit []
roychri has quit [Ping timeout: 255 seconds]
<torarne> matthewd:hmm, both extend and include assumes the module has naked functions as far as i understood it? so if I have module X; class Foo; end; end, can i then include/prepend the methods and attributes etc of Foo into a new class Bar?
tvw has joined #ruby
<ljarvis> anonymus: so what's wrong with your code?
<matthewd> torarne: module Foo
<anonymus> I do not know how to create a variable imap thats equal to whole string _imap...
<torarne> matthewd: i don't control the code of moduleX; class Foo;
<anonymus> and so with the rest of elements
<matthewd> >> module Doubler; def +(other); super * 2; end; end; Integer.prepend(Doubler); 3 + 4
<ruby[bot]> matthewd: # => 7 (https://eval.in/809321)
<matthewd> >> module Doubler; def +(other); super * 2; end; end; Fixnum.prepend(Doubler); 3 + 4
<ruby[bot]> matthewd: # => 14 (https://eval.in/809322)
marr has joined #ruby
<matthewd> torarne: You control the module which contains the things you want to add
<torarne> aaah, the other way around, got it
dionysus69 has joined #ruby
<sinebif> i need a good ide
<sinebif> i need it
<ljarvis> sinebif: stop trolling or you'll be banned
<sinebif> i also need autocomplete
<sinebif> irb doesn't autocomplete, ruby is trolling me
<sinebif> so annoying it can't even autocomplete which is the right of every coder
<torarne> matthewd: private method `prepend' called for #<Class:0x007fcce4a562a8>, use send()?
x27 has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
<matthewd> torarne: Oh, you may have a ruby version issue there.. especially if you have to work on arbitrary machines
<anonymus> here it is
<ljarvis> matthewd: torarne prepend is private, you need to call it from inside the class/module. So using send seems right here?
<torarne> matthewd: i have 2.0.0, but i guess homebrew could run on prior versions
<ljarvis> oh, im lying
<ljarvis> weird
* ljarvis shuts up
<matthewd> torarne: In that case, maybe go back to the dup plan. You can't use super, but before you overwrite an existing method, you can alias its existing definition to another name.
<sinebif> how do I autocomplete guys? or is it not possible at all?
<torarne> matthewd: that's a good idea!'
<ljarvis> !kick sinebif last warning
sinebif was kicked from #ruby by ruby[bot] [last warning]
<anonymus> well ok
<torarne> matthewd: ljarvis: fwd, the Module.prepend trick worked, but you're right about the version being an issue, so i'll try the dup road
ur5us has joined #ruby
<anonymus> bl djad
<torarne> actually, seems bw has been vendoring ruby 2.0 for a while
<torarne> so the prpend approach is fine
mim1k has joined #ruby
patarr has joined #ruby
nowhereman has quit [Ping timeout: 260 seconds]
dc2 has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
<anonymus> thanks for helping
<anonymus> bb
cschneid_ has joined #ruby
anonymus has left #ruby ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
psychicist__ has joined #ruby
dc2 has quit [Ping timeout: 268 seconds]
ujjain has quit [Quit: ZNC - 1.6.0 - http://znc.in]
cschneid_ has quit [Ping timeout: 246 seconds]
nofxxx has joined #ruby
nofxxxx has quit [Ping timeout: 260 seconds]
leitz has joined #ruby
xall has quit [Ping timeout: 268 seconds]
Emmanuel_Chanel has joined #ruby
GodFather has joined #ruby
gigetoo has quit [Ping timeout: 255 seconds]
blackwind_123 has quit [Ping timeout: 268 seconds]
rohitpaulk has quit [Remote host closed the connection]
xall has joined #ruby
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CrazyEddy has quit [Ping timeout: 246 seconds]
jameser has quit [Ping timeout: 260 seconds]
Pumukel has quit [Remote host closed the connection]
<ljarvis> torarne: nice one
CrazyEddy has joined #ruby
quarcu_ has quit [Quit: Peace.]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
alibby1 has joined #ruby
alibby has quit [Ping timeout: 260 seconds]
xall has quit [Ping timeout: 240 seconds]
t-recx has quit [Quit: t-recx]
ddffg has joined #ruby
<dionysus69> how to add members of 2d array to another array and get 2d array as a result, because atm I get 3d array
scottschecter has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
<dionysus69> atm i solved it by converting 2 d array to array[hash] and then add it to main array, then do flatten
scottschecter has joined #ruby
<dionysus69> but doesn't feel neat
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
bkxd has joined #ruby
rgr_ has quit [Quit: rgr_]
alibby has joined #ruby
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
alibby1 has quit [Ping timeout: 268 seconds]
HoierM has joined #ruby
ferr1 has joined #ruby
xall has joined #ruby
x27 has quit [Ping timeout: 255 seconds]
<ddffg> [a,b].transpose.map {|x| x.reduce(:+)}
pankaj_ has joined #ruby
dc2 has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
dc2 has quit [Ping timeout: 246 seconds]
quobo has quit [Quit: Connection closed for inactivity]
jrafanie has joined #ruby
alibby1 has joined #ruby
alibby has quit [Ping timeout: 260 seconds]
ur5us has quit [Remote host closed the connection]
jgnagy has joined #ruby
jgnagy has quit [Ping timeout: 260 seconds]
luong has joined #ruby
jameser has joined #ruby
alibby1 has quit [Ping timeout: 255 seconds]
alibby has joined #ruby
flying has joined #ruby
pankaj_ has quit [Ping timeout: 246 seconds]
antgel has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
pankaj_ has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanx has quit [Quit: Leaving]
jrafanie has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
mim1k has joined #ruby
apparition has joined #ruby
bkxd_ has joined #ruby
rgr has joined #ruby
ldnunes has joined #ruby
nadir is now known as adnir
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pandaant has quit [Remote host closed the connection]
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
bkxd has quit [Ping timeout: 260 seconds]
adnir is now known as nadir
nowhereman has joined #ruby
soahccc_ is now known as soahcc
soahcc is now known as soahccc
arquebus has joined #ruby
xall has quit [Ping timeout: 240 seconds]
GinoMan1423 has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 258 seconds]
konsolebox has quit [Quit: Leaving]
marr has quit [Ping timeout: 240 seconds]
GinoMan has joined #ruby
synthroid has joined #ruby
aupadhye has joined #ruby
arquebus has quit [Quit: konversation disconnects]
GinoMan2440 has joined #ruby
dc2 has joined #ruby
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
GinoMan has quit [Ping timeout: 240 seconds]
Mortomes|Work has quit [Ping timeout: 260 seconds]
dc2 has quit [Ping timeout: 240 seconds]
Puffball has quit [Read error: Connection reset by peer]
Puffball has joined #ruby
luong has quit [Quit: Leaving]
opencw has joined #ruby
x27 has joined #ruby
pankaj_ has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
konsolebox has joined #ruby
bkxd_ has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
konsolebox has quit [Quit: ZNC 1.6.5 - http://znc.in]
ur5us has quit [Ping timeout: 255 seconds]
jamesaxl has quit [Ping timeout: 268 seconds]
im0nde has quit [Ping timeout: 245 seconds]
jrafanie has joined #ruby
im0nde_ has joined #ruby
im0nde_ is now known as im0nde
im0nde has quit [Ping timeout: 240 seconds]
<manveru> >> [[1,2,3],[4,5,6]].transpose.map(&:sum)
<ruby[bot]> manveru: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<manveru> huh
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xerx has quit [Quit: "There is no system but GNU"]
gnufied has joined #ruby
hutch34 has joined #ruby
alibby has quit [Ping timeout: 245 seconds]
jameser has joined #ruby
quazimodo has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
chouhoulis has joined #ruby
anisha_ has joined #ruby
anisha has quit [Ping timeout: 255 seconds]
mim1k has joined #ruby
alibby has joined #ruby
x27 has left #ruby ["Leaving"]
jameser has quit [Ping timeout: 260 seconds]
anisha_ has quit [Read error: Connection reset by peer]
anisha_ has joined #ruby
anisha_ has quit [Read error: Connection reset by peer]
anisha_ has joined #ruby
dc2 has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
andikr has quit [Remote host closed the connection]
bkxd has joined #ruby
jamesaxl has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
ddffg has quit [Ping timeout: 260 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jamesaxl has quit [Read error: Connection reset by peer]
robotmay has quit [Remote host closed the connection]
jamesaxl has joined #ruby
charliesome has joined #ruby
shinnya has joined #ruby
jamesaxl has quit [Ping timeout: 255 seconds]
Burgestrand has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
HoierM has quit [Ping timeout: 240 seconds]
haylon has joined #ruby
HoierM has joined #ruby
leitz has quit [Quit: Nappy time]
GodFather has joined #ruby
gizmore has joined #ruby
jameser has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
grymmjack has quit [Ping timeout: 240 seconds]
nazty has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ikopico> manveru: it's only implemented in 2.4 (Array#sum)
ben______ has joined #ruby
<manveru> isn't everyone on 2.4 now? /hide
ta has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 260 seconds]
ben__ has quit [Ping timeout: 255 seconds]
<ikopico> >> RUBY_VERSION
<ruby[bot]> ikopico: # => "2.3.0" (https://eval.in/809584)
<ikopico> Nope
jameser has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
dc2 has joined #ruby
grymmjack has joined #ruby
oleo has joined #ruby
daemonwrangler has quit [Ping timeout: 240 seconds]
jamesaxl has joined #ruby
__Yiota has joined #ruby
im0nde has joined #ruby
haylon has quit []
dc2 has quit [Ping timeout: 245 seconds]
konsolebox has joined #ruby
andywww has joined #ruby
jameser_ has joined #ruby
<andywww> Repost from RoR channel, Can anyone give me any steer as to why this might be happening?
bkxd has quit [Ping timeout: 260 seconds]
<Burgestrand> andywww file encoding information is not written to the file, it's guessed by its contents
anisha_ has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
<Burgestrand> andywww UTF-8 is ASCII 7-bit compatible, meaning that "this is UTF8 text" is encoded the same in UTF-8 as it would be in 7-bit ASCII
jusa has joined #ruby
jameser has quit [Ping timeout: 260 seconds]
<andywww> what i’m struggling with is when i create a file in textmate, the file command identifies it as utf-8 with the same text
<Burgestrand> andywww also, your force_encoding call is most likely wrong
<andywww> when i create it with ruby it is ascii-8bit every time
<Burgestrand> andywww could it be that you're saving it with BOM from textmate?
daemonwrangler has joined #ruby
<Burgestrand> andywww (there's likely a BOM checkbox somewhere, or a setting for it)
<andywww> i’m not familiar with BOM
GodFather_ has joined #ruby
<andywww> but even if it is would it likely be worth trying to emulate that in ruby?
GodFather has quit [Remote host closed the connection]
<Burgestrand> andywww essentially it's some garbage that sometimes end up in the start of UTF-encoded files, usually it's used in other encodings but sometimes end up in UTF-8 encoded files too
<Burgestrand> andywww depends entirely on why you want `file` to recognize your file as UTF-8
<andywww> I’m using ruby to generate a file for upload to googles webmaster tools console and they specifically state it must be a UTF-8 encoded text file
jameser_ has quit [Ping timeout: 245 seconds]
<Burgestrand> andywww if that's the only text you have in it then you're OK
<andywww> I’d like to be reasonably sure that even if `file` might be guessing wrong, that I’ve done as much as I can to ensure that it is actually writing out as UTF-8
<Burgestrand> andywww encoding is very similar to languages, if I give you the word "okay" without telling you what language it is in, you cannot know which language I intended
<andywww> which I assume I can only do by writing out a specific UF-8 character?
<Burgestrand> andywww the `:UTF-8` part when you write to the file is sufficient for that
LastWhisper____ has joined #ruby
Pumukel has quit []
jameser has joined #ruby
rohitpaulk has joined #ruby
sepp2k has joined #ruby
jameser_ has joined #ruby
Pumukel has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
jameser has quit [Ping timeout: 260 seconds]
Pumukel has quit [Read error: Connection reset by peer]
<andywww> it seems inserting a bom at the start of the file might help it be identified as UTF-8 and ensure anything reading it in the future doesn’t make any mistakes when parsing. would it not make sense to include this BOM?
<andywww> or are there negative sideeffects?
workmad3 has joined #ruby
mikecmpb_ has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
marr has joined #ruby
jameser_ has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
bkxd has quit [Ping timeout: 268 seconds]
cschneid_ has joined #ruby
mikecmpb_ has quit [Quit: inabit. zz.]
aupadhye has quit [Ping timeout: 246 seconds]
GodFather_ has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
patarr has joined #ruby
t-recx has joined #ruby
synthroid has quit [Remote host closed the connection]
rippa has joined #ruby
amclain has joined #ruby
rgr has quit [Ping timeout: 258 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta has joined #ruby
GodFather_ has joined #ruby
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has quit [Quit: roshanavand]
futilegames has joined #ruby
jameser has joined #ruby
dc2 has joined #ruby
lightstalker has quit [Ping timeout: 240 seconds]
andikr has joined #ruby
konsolebox has quit [Quit: ZNC 1.6.5 - http://znc.in]
pupsicle has quit [Quit: pupsicle]
chalkmonster has joined #ruby
futilegames has quit [Ping timeout: 246 seconds]
GodFather_ has quit [Ping timeout: 260 seconds]
dc2 has quit [Ping timeout: 255 seconds]
jgnagy has joined #ruby
lightstalker has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
aufi has quit [Quit: Leaving]
nhhc has quit [Remote host closed the connection]
jameser has joined #ruby
ta has quit [Remote host closed the connection]
ferr1 has quit [Quit: WeeChat 1.8]
jgnagy has quit [Ping timeout: 240 seconds]
chaugiang has joined #ruby
<chaugiang> hi everybody
<chaugiang> Hello everyone, If I have 2 methods : https://pastebin.com/zLdBQqdi How can I creat a scope for them? Thank you so much!
<ruby[bot]> chaugiang: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/8bd5d4183be12969ed25e473e2198a39
<ruby[bot]> chaugiang: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
rkazak has joined #ruby
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
jgt2 has quit [Ping timeout: 240 seconds]
<chaugiang> Hello everyone, If I have 2 methods : https://gist.github.com/anonymous/6343edbfd9dd98e23dcd07ee8f6745da How can I creat a scope for them?
luckyruby has joined #ruby
jrafanie has joined #ruby
im0nde has quit [Ping timeout: 260 seconds]
jameser has quit [Ping timeout: 240 seconds]
vali has quit [Quit: vali]
im0nde has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
mim1k has quit [Read error: Connection reset by peer]
jameser has joined #ruby
jameser has quit [Client Quit]
pupsicle has joined #ruby
synthroid has joined #ruby
hutch34 has joined #ruby
brent__ has joined #ruby
conta has quit [Ping timeout: 240 seconds]
duderonomy has quit [Ping timeout: 255 seconds]
pupsicle has quit [Remote host closed the connection]
rkazak has quit [Quit: Sleep.....ing....]
jgnagy has joined #ruby
mim1k has joined #ruby
ta has joined #ruby
konsolebox has joined #ruby
ascarter has joined #ruby
troys has joined #ruby
zacts has quit [Ping timeout: 240 seconds]
zacts has joined #ruby
pb122 has quit [Read error: Connection reset by peer]
gnarf has quit [Ping timeout: 240 seconds]
<Burgestrand> andywww yes, there are negative side effects to the BOM
<andywww> yes, i’ve been reading since
<andywww> i’m going to have faith that :UTF-8 is sufficient!
<Burgestrand> andywww when google say that your file must be in UTF-8, they're mainly saying "we're going to assume it's UTF-8 and if it's broken somehow then it's your fault"
bmurt has joined #ruby
Burgestrand has quit [Quit: Good bye and have a nice day!]
anisha has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
marxarelli|afk has quit [Max SendQ exceeded]
frem_ has joined #ruby
catphish has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gnarf has joined #ruby
synthroid has quit [Remote host closed the connection]
pb122 has joined #ruby
andywww has quit [Quit: andywww]
mim1k has quit [Ping timeout: 260 seconds]
nowhereman has quit [Ping timeout: 240 seconds]
ryzokuken has joined #ruby
haylon has joined #ruby
dionysus69 has joined #ruby
marr has quit [Ping timeout: 240 seconds]
synthroid has joined #ruby
dc2 has joined #ruby
Sajeesh has joined #ruby
<Sajeesh> hi @all need a help in resolving a ruby gem issue that I am currently facing
im0nde has quit [Ping timeout: 240 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dc2 has quit [Ping timeout: 240 seconds]
<Sajeesh> error i have pasted in the Gist
taurgal has joined #ruby
<taurgal> Can someone help me with this MWE: https://gist.github.com/taurgal/c752410d5c1d3d150f0c0c83975d7756
<taurgal> I do not understand why the instance variable @test is not printed...
troys is now known as troys_
balazs_ has joined #ruby
nitric has joined #ruby
tvw has quit [Remote host closed the connection]
<taurgal> I am pretty new to ruby but have already written quite some code theses past few days but this is bogging me
balazs has quit [Ping timeout: 260 seconds]
<elomatreb> taurgal: Try using `p` instead of puts for debugging, it will generate more useful output
bkulbida has joined #ruby
yeticry has joined #ruby
yottanami_ has joined #ruby
<yottanami_> Is any assertion in Minitest for checking an item exists in an Array? like `include?`
<taurgal> elomatreb: Thanks. p prints nil (I knew test was nil but still do not understand why)
saschavoid has quit [Quit: die();]
<taurgal> yottanami_: myarray.include?
<elomatreb> And I assume the problem with the instance variable being nil is related to subclassing Date. Subclassing core classes is generally a bad idea
<taurgal> yottanami_: sorry, tried to be smart and quick bit failed
vondruch has quit [Ping timeout: 240 seconds]
yeticry_ has quit [Read error: Connection reset by peer]
<elomatreb> I'd recommend you instead create a Date object in your initalize and store it in an instance variable
<taurgal> elomatreb: elomatreb thanks, that's it!
<taurgal> I must say I am quite disappointed by ruby...
<hxegon> elomatreb, taurgal you could also accept a date object in the initialize parameters
<hxegon> taurgal: why?
<taurgal> hxegon: yes, but this is not transparent then
<elomatreb> Or that, which might even be a better idea since you could e.g. use the activesupport helpers if you're in rails to create an instance
ta has quit [Remote host closed the connection]
<elomatreb> You could create a factory method like SchoolDay.from_date or something
knight33 has joined #ruby
<hxegon> ^
<taurgal> elomatreb: but then I has to define <=> and all...
<hxegon> Also, this way you could have different date formats like Schoolday.from_ymd or .from_iso8601
marxarelli has joined #ruby
<yottanami_> taurgal, tnx, I just find `assert_includes`
<elomatreb> You just have to define <=> and include Comparable
<baweaver> Why do you even need a SchoolDate?
<hxegon> couldn't you forward that to date taurgal
konsolebox has quit [Quit: ZNC 1.6.5 - http://znc.in]
<baweaver> What functionality are you hoping to add to the core class there that necessitates that inheritance?
<baweaver> What problem are you trying to solve?
bkulbida has quit [Quit: Mutter: www.mutterirc.com]
mim1k has joined #ruby
andikr has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
hutch34 has quit [Quit: WeeChat 1.5]
<taurgal> baweaver: I wont to add special markup for school exams...
<elomatreb> Markup?
<baweaver> Exams?
<elomatreb> School?!
mim1k has quit [Read error: Connection reset by peer]
<hxegon> WONT?!
bkulbida has joined #ruby
<hxegon> taurgal: what kind of markup?
<matthewd> taurgal: Can you show an example of how you'd do this in another language?
<Sajeesh> thanks
<elomatreb> Sajeesh: Your mysql gem is broken and your Ruby version is old. You should probably upgrade and maybe a fresh mysql gem works again
<matthewd> Sajeesh: Try `gem pristine mysql`
PaulCapestany has quit [Quit: .]
<Sajeesh> trying that, thanks
<taurgal> matthewd: Well I would subclass Date... Now I am working around it
<elomatreb> Uh? 2.1 is still supported?
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<taurgal> hxegon: It's to create a calendar
<hxegon> it's 2.1.7 now
<baweaver> EOL'd
<matthewd> taurgal: In which language?
<taurgal> hxegon: the code already works, I am just tidying the while thing
<taurgal> matthewd: python
<elomatreb> Oh, ruby-doc just doesn't show the red outdated banner for 2.1.4 (but it does for 2.1.7?)
zacts has quit [Ping timeout: 240 seconds]
catphish has quit [Quit: Leaving]
jane_booty_doe has joined #ruby
<hxegon> taurgal: could you give us a more robust sample of the code? It's kind of hard to give a good solution when we don't understand exactly what you are trying to do yet
<taurgal> matthewd: thanks. I though date was OK in python...
<taurgal> hxegon: coding it right now.
<dionysus69> what is the URI class for? I dont understand idea behind first two examples, and difference between them https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/Net/HTTP.html#top
jamesaxl has quit [Ping timeout: 240 seconds]
zacts has joined #ruby
aglorei has quit [Ping timeout: 248 seconds]
rkazak has joined #ruby
bkulbida has quit [Quit: Mutter: www.mutterirc.com]
<haylon> For Hashes, the #include?(key) just checks to see if that key exists in the hash correct? The docs say #has_key?(key). I just wanted to verify
<matthewd> dionysus69: The URI class is for representing a URI as an object
<taurgal> hxegon: coding it right now.
<matthewd> haylon: Yes
<dionysus69> and whats the point? why isnt string enough?
<elomatreb> dionysus69: HTTP.get expects the hostname and the path (the file) as different parameters (and e.g. without a protocol), the URI class can parse an entire URI
<baweaver> >> {a: 1}.include?(:a)
<ruby[bot]> baweaver: # => true (https://eval.in/809752)
<dionysus69> oh I see, its about parsing then
<elomatreb> Look at how a HTTP request works, the path is independent of the Host
<dionysus69> thanks elomatreb
* baweaver has never been a particular fan of Net::HTTP
<haylon> Thank you mathewd
* baweaver thinks it's clunky and awkward
<dionysus69> baweaver: are there alternatives ? :D
<elomatreb> open-uri for simple get requests
<dionysus69> I just need to send post requests
<baweaver> several, but sometimes it's easier just to outright use the builtins
<baweaver> normally I go for Typhoeus if I need to do much
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dionysus69> baweaver: atm I dont have enough manual request experience to understand the difference so i ll stick with vanilla ruby lib :D
<elomatreb> If you're doing like a utility script you need to consider if installing a gem (and even maybe setting up bundler) is worth the trouble you save
romank has quit [Ping timeout: 255 seconds]
<dionysus69> I am going to build a lil script that will send sms messages from rails app
<elomatreb> Look at a raw http request in your browser, it's a very easy to understand protocol (at least the core basics)
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
<dionysus69> to verify phone numbers upon registration asyncronously
<dionysus69> I actually have php sample provided, translating it to ruby now :D if you can help you are welcome xD
<baweaver> If it's Twilio they have Ruby options
sneakerhax has quit [Ping timeout: 260 seconds]
<dionysus69> no it's some local company provided script in my country
<dionysus69> twilio is 2.5 times more expensive per sms, if it were cheaper I would definitely go with it
tmm88 has joined #ruby
ta has joined #ruby
<tmm88> hey guys. i have a doubt i created this gitst https://gist.github.com/tiagmoraismorgado/2760487cc34e812c9884f12846b0310b
<tmm88> for making a contribution to sonic pi
<tmm88> but i cannot print the binary digit to my terminal console
<tmm88> can you please help me to fix this tiny little issue
<tmm88> ?
<tmm88> cheers
roshanavand has joined #ruby
<elomatreb> Some output would help, i.e. what do you expect and what are you getting instead
<tmm88> i expect a binary digit
<tmm88> i am getting nothing
<baweaver> >> '1'.to_s(2)
<ruby[bot]> baweaver: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/809753)
<baweaver> >> 1.to_s(2)
<ruby[bot]> baweaver: # => "1" (https://eval.in/809754)
<elomatreb> Yeah, arguments in ARGV are strings, not numbers
<baweaver> ARGV[0] is going to be a string coming in
<tmm88> by using something like this on the console ruby -r cenar.rb "333"
<tmm88> so how do i get a number
<tmm88> ?
<tmm88> i think this is the issue
<elomatreb> >> Integer("12")
<baweaver> where did you find to_s?
<ruby[bot]> elomatreb: # => 12 (https://eval.in/809755)
<tmm88> stackoverflow
<baweaver> elomatreb: not to_i?
<tmm88> perharps to i
<tmm88> this might be what i want
<elomatreb> Isn't there some difference between how they handle invalid strings? I just always use integer because idk
shinnya has quit [Ping timeout: 255 seconds]
<baweaver> &ri Kernel#Integer
aglorei has joined #ruby
<tmm88> PrototypeTest.permScales(ARGV[0]) then how do i fix this line?
<baweaver> &ri String#to_i
<elomatreb> Ah
<hxegon> >> "".to_i elomatreb
<baweaver> (mainly because I don't want to google)
<ruby[bot]> hxegon: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<elomatreb> >> nil.to_i
<hxegon> hmm, in my pry that is 0
<ruby[bot]> elomatreb: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
<elomatreb> Yeah, nil too IIRC
<baweaver> bot is crashing a bit
<hxegon> but integer is stricter
<hxegon> excuse me, Integer()
<baweaver> tmm88: Use the information that was just posted and see if you can piece it together
chouhoulis has quit [Remote host closed the connection]
nhhc has joined #ruby
frem_ is now known as frem
TomyWork has quit [Ping timeout: 240 seconds]
Beams has quit [Quit: .]
flying has quit []
jusa has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
roshanavand has quit [Quit: roshanavand]
ascarter has joined #ruby
gusrub has quit [Ping timeout: 272 seconds]
rkazak has quit [Quit: Sleep.....ing....]
ta has quit [Remote host closed the connection]
<dionysus69> I have two roadblocks on my translation trip
<dionysus69> one is Json_encode([“123”]) in php, what this would be in ruby?
<dionysus69> so is that equivalent to JSON.generate?
lxsameer has quit [Quit: WeeChat 1.7]
duderonomy has joined #ruby
troulouliou_dev has joined #ruby
dc2 has joined #ruby
<troulouliou_dev> hi why is rubocop detecting MYCONST = '' as : Freeze mutable objects assigned to constants issue ?
<troulouliou_dev> i mean what else can i do instead of MYCONST = 'BLAH'
TomyLobo has joined #ruby
<havenwood> troulouliou_dev: You can freeze the String via magic comment or #freese.
<havenwood> #freeze*
<dionysus69> so you dont accidentally change constant later I guess?
<havenwood> troulouliou_dev: MYCONST = ''.freeze
<elomatreb> dionysus69: If you just want to wrap something in an Array and stringify it you may want to use #to_json, but generate works too
<dionysus69> ye just remembered about to_json, I guess that's it. but the output doesnt make sense, I gues I dont have enough experience with this syntax. {\"hello\":\"goodbye\"}
<elomatreb> What would you expect? That's regular valid JSON
<havenwood> dionysus69: Print it and look at it. It's JSON.
<dionysus69> oh puts changed the syntax again
<havenwood> troulouliou_dev: Here's a writeup on frozen string literals, which would freeze that String automagically .
<dionysus69> thx for the hint :D
<troulouliou_dev> havenwood, thanks
__Yiota has joined #ruby
dc2 has quit [Ping timeout: 245 seconds]
jgt2 has joined #ruby
DLSteve has joined #ruby
bmurt has joined #ruby
tmm88 has quit [Remote host closed the connection]
ta has joined #ruby
LastWhisper____ has joined #ruby
rkazak has joined #ruby
jgt2 has quit [Ping timeout: 255 seconds]
xall has joined #ruby
xall has quit [Client Quit]
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
nhhc has quit [Ping timeout: 240 seconds]
KeyJoo has quit [Ping timeout: 268 seconds]
<dionysus69> can anyone help me understand what is this doing?
<havenwood> dionysus69: That's not Ruby.
<dionysus69> I know its php :D trying to translate it
<dionysus69> but i have no idea what it does in first place
<havenwood> dionysus69: Figure out what it does in ##php and then we can help.
<troulouliou_dev> havenwood, mixing 'bla' and 'bla'.freeze won't lead to any wonky issue ?
<elomatreb> PHP lacks an actual HTTP client in it's standard library, so they use curl (a separate request library) to build one. That whole mess sets up common options
renchan has quit [Quit: Leaving...]
<elomatreb> And turns off SSL verification??
<havenwood> troulouliou_dev: It's fine to freeze some Strings. The only issue you would have is if you try to mutate it. But in that case you want the explosion not silent bugs.
<havenwood> troulouliou_dev: Freeze away!
roshanavand has joined #ruby
ascarter has quit [Remote host closed the connection]
<dionysus69> elomatreb: ye dunno, this is weird script from a weird company :D
ascarter has joined #ruby
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
chouhoulis has joined #ruby
jusa has joined #ruby
bast has quit [Ping timeout: 255 seconds]
bast has joined #ruby
bast has quit [Max SendQ exceeded]
<troulouliou_dev> havenwood, ok thanks
bast has joined #ruby
bast has quit [Max SendQ exceeded]
yottanami has joined #ruby
yottanami_ has quit [Ping timeout: 240 seconds]
yottanami has quit [Remote host closed the connection]
bast has joined #ruby
bast has quit [Changing host]
bast has joined #ruby
BTRE has quit [Ping timeout: 260 seconds]
BTRE has joined #ruby
latemus has joined #ruby
rohitpaulk has quit [Ping timeout: 245 seconds]
mtkd has quit [Read error: Connection reset by peer]
^mtkd has joined #ruby
rohitpaulk has joined #ruby
troulouliou_dev2 has joined #ruby
Sajeesh has quit [Quit: Page closed]
konsolebox has joined #ruby
troulouliou_dev has quit [Ping timeout: 255 seconds]
taurgal has quit [Ping timeout: 260 seconds]
PatrikasZvaigzde has quit [Read error: Connection reset by peer]
konsolebox has quit [Client Quit]
segy has quit [Quit: ZNC - http://znc.in]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
brent__ has quit [Remote host closed the connection]
segy has joined #ruby
centrx has quit []
<dionysus69> The API asks me to send it SHA1 of some 4 pieces of specific info... I don't understand how can they later decode it?
<havenwood> dionysus69: It's a one-way hashing function. They can compare it to another SHA1.
<dionysus69> I am not encoding it with any specific public key right?
<havenwood> No.
<dionysus69> yes but I am sending them info like phone number, text, and secret api key which then will be used to send sms with some random text to phone
<havenwood> dionysus69: I'd suggest reading up on checksums.
CacoS has joined #ruby
<dionysus69> how can they compare it to other SHA1, two pieces of information from here are random
konsolebox has joined #ruby
<dionysus69> I could be sending anything right? any phone number with any text
<dionysus69> oh
<dionysus69> ok one second
<dionysus69> let me post full snippet
<havenwood> dionysus69: This doesn't seem Ruby-related. Maybe #ruby-offtopic.
<havenwood> dionysus69: Is it a Ruby snippet?
<dionysus69> yep it is ruby :D
<havenwood> dionysus69: Well, you sent them all parts of that text that is checksummed except for the API sekret, which they presumably know.
<havenwood> dionysus69: So they then compare the SHA1s.
<dionysus69> ok now I get it actually
<dionysus69> :D :D
<dionysus69> I was like how do they decode api secret if I encode it with other stuff
mikecmpbll has joined #ruby
<dionysus69> one more offtopic question for today, even if I send this info through http, information is supposed to be secure right? it is pretty impossible to guess api key from the hash I am sending isn't it?
<havenwood> typical http 1.1 is plaintext
<havenwood> text over the wire, you can read it all
<havenwood> dionysus69: do you mean https?
<dionysus69> yes so? i am still sending the hash? without knowing api key in advance, how would I know if it is right or wrong
<dionysus69> nope I meant http
konsolebox has quit [Quit: ZNC 1.6.5 - http://znc.in]
<havenwood> dionysus69: it's not secure at all
<dionysus69> https would be required if I were sending api key as a regular post param as well, without digest
SeepingN has joined #ruby
<dionysus69> so how would anyone be able to get api key, from the digest and all other params as plaintext?
konsolebox has joined #ruby
<havenwood> dionysus69: your api sekret would even be vulnerable if someone built a rainbow table off your other data sans sekret
<havenwood> dionysus69: the rest is in plaintext
nitric has quit [Quit: quit]
<havenwood> dionysus69: If I wanted your sekret, I'd try every possible string following your plaintext public data and record all the checksums (rainbow table). Then the one that matches is your sekret.
<dionysus69> hmm
<dionysus69> i dont understand how that rainbow table would help make brute force faster
<havenwood> dionysus69: Maybe a script kiddie wouldn't figure it out but I'd consider it completely insecure based on what you've shown us.
<sonOfRa> If you send this over HTTP, it's vulnerable to replay attacks
<havenwood> dionysus69: Look up rainbow tables.
<dionysus69> it will still be brute force decoding sha1 thats how I see it
<sonOfRa> You don't even need a rainbow table to recover the secret, you don't NEED to recover the secret
<havenwood> dionysus69: Try making your own. Discover your own sekret. It's a good excercise.
jjunior has joined #ruby
<dionysus69> i dont know where to start though :D
<sonOfRa> So, you can't really recover the key from intercepting a message, but you can forge the same message again
xall has joined #ruby
<sonOfRa> Which is definitely bad. The answer is use https. Always. Never not. Every time.
<havenwood> sonOfRa: Well, you can recover the key or forge the message. There are multiple vectors of attack.
AlexRussia has joined #ruby
<jjunior> So. If I start a gem programmatically, is there a way to update LOAD_PATH to require gem in the next line?
<havenwood> dionysus69: +1 HTTPS
<dionysus69> sonOfRa, the only thing I would be able to do is to send same data over and over again, because I would still need to decode secret to send data I want right?
nitric has joined #ruby
<sonOfRa> havenwood: yeah, you can recover the secret by building a rainbow table, but you don't need to if you just want to show that you can send unauthorized messages (which is usually enough as a proof of concept)
<havenwood> sonOfRa: true
<sonOfRa> dionysus69: "the only thing". Sending unauthorized messages is always a breach of security. If you think it's not, your threat model is dumb.
<jjunior> *install a gem programmaticaly
<dionysus69> haha I agree it's not a good practice, I am just theorizing :D
<havenwood> jjunior: There's probably a way. Say more about what you're doing? Have any code to show?
<dionysus69> trying to understand how internet security works in general
dc2 has joined #ruby
jane_booty_doe2 has joined #ruby
jane_booty_doe2 has quit [Remote host closed the connection]
lxsameer has joined #ruby
taurgal has joined #ruby
<jjunior> havewood: There is Puppet in the middle of the problem. While puppet applies a manifest (that ensures a gem is installed), if I require that gem after it, it's not available. Only in the next run.
<havenwood> dionysus69: Here's a tiny little rainbow table in Ruby: require 'digest/sha1'; 'a'.upto('zz').map { |s| [Digest::SHA1.hexdigest(s), s] }.to_h
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
tomphp has joined #ruby
<havenwood> dionysus69: If you give me the hash "7acdfe9c6bbea6dfaadf40d521f346a1de647983" I can see that key points to the value: "zp"
<havenwood> >> require 'digest/sha1'; Digest::SHA1.hexdigest "zp"
<ruby[bot]> havenwood: # => "7acdfe9c6bbea6dfaadf40d521f346a1de647983" (https://eval.in/809765)
<havenwood> dionysus69: And look, I've discovered the plaintext.
<havenwood> dionysus69: Now just put everything but your sekret key in front of the random strings and you've got a rainbow table to attack your payload.
ta has quit [Ping timeout: 260 seconds]
ta has joined #ruby
dc2 has quit [Ping timeout: 260 seconds]
PaulCapestany has joined #ruby
<dionysus69> I couldnt relate this case to the one we were talking about
roshanavand has quit [Quit: roshanavand]
lxsameer has quit [Ping timeout: 260 seconds]
<dionysus69> we were able to get plain text so easily because we only had 25^2 cases and we had full raindbow table with all possible cases
roshanavand has joined #ruby
<dionysus69> 26^2 *
<havenwood> dionysus69: I can make a massive rainbow table for your payload in minutes.
<havenwood> dionysus69: It is trivial to break.
<havenwood> The api_secret is mine.
<havenwood> dionysus69: It'd not trust that api_secret is secret if anyone grabs it over the wire and wants at the payload.
ta has quit [Ping timeout: 240 seconds]
<havenwood> dionysus69: Then again, maybe nobody will happen to crack it. It's certainly insecure.
<dionysus69> hard for me to think about it :S + you have to be a middle man right? given all targeted traffic needs to pass through my node in order to be able to collect such data
<havenwood> dionysus69: Just use HTTPS. ;-P
<dionysus69> i know i would of course for a production app
<dionysus69> their api actually is a https address
<havenwood> dionysus69: I gotta run, but when I have a few minutes later I'd be happy to craft an exploit for your payload and show you
troulouliou_dev2 has quit [Quit: Leaving]
<dionysus69> hehe cool, i ll ping you later sometime then, thanks already too!
^mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
Bock has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
marr has joined #ruby
chouhoulis has quit [Remote host closed the connection]
normie1 has joined #ruby
chouhoulis has joined #ruby
jamesaxl has joined #ruby
lxsameer has joined #ruby
normie1 has quit [Client Quit]
KeyJoo has joined #ruby
normie1 has joined #ruby
Cohedrin has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
<taurgal> I defined a "[]=" method for my class. How can I use it from another method?
ascarter has quit [Remote host closed the connection]
ta has joined #ruby
ascarter has joined #ruby
<alibby> self[:joe]= maybe?
<taurgal> alibby: thanks!
<alibby> taurgal: That's a guess, I don't recall ever doing it.
rohitpaulk has quit [Ping timeout: 258 seconds]
<taurgal> alibby: just checked ;)
<ule> hey guys
knight33 has joined #ruby
<ule> trick question: What do you guys think about the ruby code style from bbatsov? -> https://github.com/bbatsov/ruby-style-guide
<ule> I would love to hear about the idea of single responsability and methods with <= 10 lines of code
<ule> is it good or bad idea in your opinion?
ta has quit [Read error: Connection reset by peer]
<havenwood> ule: Learn to make small methods before you learn the exceptions.
<ule> havenwood: that means that you agree with it that right?
<mikecmpbll> i find those arbitrary rules utterly pointless
<havenwood> ule: no
<alibby> ule: I'm scanning the guide now, it looks decent enough. Small things I don't really care for, but honestly consistency in a codebase trumps any of my personal preferences. Short methods rock.
<ule> mikecmpbll: why?
<ule> alibby: thanks for sharing your thoughts
<mikecmpbll> ule : because what logic is there, from a comprehension point of view, to impose an arbitrary numerical constraint on number of lines?
AlexRussia has quit [Quit: WeeChat 1.8]
<alibby> ule: Np.
<mikecmpbll> can i understand a 11 line method less well than a 10 line one? no.
<ule> mikecmpbll: I mean.. you is that guy that prefeers write a method with 100 lines instead of splitting the logic to 6 private methods?
<havenwood> ule: You could likewise say to limit sentences to 20 words. Do you agree with that?
<alibby> Well yeah, 10 vs 11 is nitpicking.
segy has quit [Quit: ZNC - http://znc.in]
<mikecmpbll> if it takes 100 lines of code to do something well defined. yes that's fine.
<alibby> But 11 turns to 25 turns to 100 over time. Kinda gotta draw the line somewhere, but better to go with a gut feel about complexity.
<mikecmpbll> no, you don't have to draw the line anywhere
<havenwood> ule: It might help folk who are creating obscenely run-on sentences that go forever and ever to have some sane limit so they do use periods and don't just keep typing and typing but really a writer who knows what they're doing isn't going to follow this sentence limit, right?
<alibby> Though tools are not all that great at analyzing complexity.
<ule> mikecmpbll: ohh OK
AlexRussia has joined #ruby
<ule> havenwood: I see right agree
<ule> cool, thanks for answering guys
<elomatreb> Remember that you can always turn off the linter for a scope, there may be good reasons for a long method but they're rare
AlexRussia has quit [Client Quit]
<ule> elomatreb: what is a long method for you?
<alibby> elomatreb: I dig it.
PatrikasZvaigzde has joined #ruby
segy has joined #ruby
<elomatreb> By "long" I mean longer than some arbitrary number you deem acceptable, I usually leave it at the 10 lines from the defaults and it's fine
AlexRussia has joined #ruby
ta has joined #ruby
arthurl has joined #ruby
AlexRussia has quit [Client Quit]
AlexRussia has joined #ruby
<mikecmpbll> another reason why number of lines is completely stupid is just by formatting the same code slightly different could double the number of lines it's over.
<mikecmpbll> but it obviously doesn't change how hard that unit of code is to comprehend
<mikecmpbll> so that demonstrates how bad a unit of measurement LOC is for complexity.
<ule> apeiros: online?
<ule> look at me.. Im asking questions using ruby style "online?"
<ule> lol
<mikecmpbll> ;)
PaulCapestany has quit [Quit: .]
knight33 has quit [Read error: Connection reset by peer]
jgt2 has joined #ruby
shinnya has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
ta has quit [Quit: Leaving...]
enterprisey has joined #ruby
jgt2 has quit [Ping timeout: 246 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
PaulCapestany has joined #ruby
dc2 has joined #ruby
ddffg has joined #ruby
ur5us has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
patr0clus has joined #ruby
ta has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Silthias has joined #ruby
Silthias1 has quit [Ping timeout: 260 seconds]
Cohedrin has joined #ruby
sneakers has joined #ruby
troys_ is now known as troys
pankaj has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
nazty has quit [Ping timeout: 240 seconds]
jamesaxl has joined #ruby
ur5us has quit [Remote host closed the connection]
MarkBilk has quit [Ping timeout: 255 seconds]
pankaj has quit [Quit: Leaving]
pupsicle has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 248 seconds]
mathys has quit [Quit: Leaving]
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
d5sx43 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
d5sx43 has quit [Client Quit]
AgentVenom has joined #ruby
hashrocket has quit [Quit: Connection closed for inactivity]
MarkBilk_ has joined #ruby
ecuanaso has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
brent__ has joined #ruby
<zenspider> rawr
glmglmglm has joined #ruby
<baweaver> rawr
quobo has joined #ruby
<zenspider> ugh. you *can't* judge a method by its line count... that's just horseshit
<baweaver> zenspider: you and I both know we'd give side-eye to a 100+ long line method though
<mikecmpbll> <3
* zenspider glances at RubyLexer.next_token, weighing in at a feeble 252 lines
<baweaver> A method does precisely what it needs to, nothing more, nothing less
segmond has joined #ruby
<zenspider> yes, that is definitely the hope and the goal... and it completely independent of line count
<zenspider> Much better to look at its complexity than its line count tho... and even still, you can't judge it by the score.
<baweaver> Indeed.
<baweaver> I'd just look at a super sized method with some skepticism out the gate
xall has quit [Ping timeout: 240 seconds]
brent__ has quit [Ping timeout: 268 seconds]
jenrzzz_ has joined #ruby
<zenspider> alibby: no, better to *measure*
<baweaver> not finding the source for next_token. Probably looking in the wrong place
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 258 seconds]
<zenspider> no, it's actually generated from https://github.com/seattlerb/ruby_parser/blob/master/lib/ruby_lexer.rex ... basically that whole file becomes one big method
ryzokuken has quit [Quit: Connection closed for inactivity]
<baweaver> ah
<zenspider> and honestly... that method is great. no problems with it... but I can't tell you how my heredoc code works at all. :P
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
ascarter has joined #ruby
Rich_Morin_ has quit [Ping timeout: 240 seconds]
<zenspider> just horrible
luckyrub_ has joined #ruby
ascarter has quit [Client Quit]
marxarelli is now known as marxarelli|afk
<zenspider> and I'm currently adding about 2900 lines of diff to sexp_processor. :P
marxarelli|afk is now known as marxarelli
nertzy has joined #ruby
luckyruby has quit [Ping timeout: 240 seconds]
<zenspider> I'm highly tempted to remove an entire section of it tho... this is adding pattern matching to sexps and currently you can do a named "capture" like so: match = s{ s(:node, _ % :name) } =~ sexp; match[:name] => whatever
<zenspider> just not sure how much that's worth versus the complexity it adds
* baweaver really needs to get coffee
<zenspider> esp given that you can't use it inside the same expression
<zenspider> get it! I wholeheartedly support that decision.
* zenspider looks around in his cafe
<baweaver> I'll have to read through all that code some time and try and grok it
<zenspider> I just had a quad and I'm tempted to go back for more
Rich_Morin_ has joined #ruby
<baweaver> latest screwing around is making a JSON query language roughly analogous to JQ
dc2 has joined #ruby
<baweaver> because config files suck to parse, and are even worse to match/update with 10 layers deep of `if` checks and `each` blocks
luckyrub_ has quit [Ping timeout: 255 seconds]
<baweaver> in this case, Grafana configuration mass-updates whenever someone has the idea to switch DB clusters or tag names again
<zenspider> ew
<baweaver> yep
sarbs has quit [Read error: Connection reset by peer]
Myk267 has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
jgt2 has joined #ruby
ecuanaso has joined #ruby
dc2 has quit [Ping timeout: 260 seconds]
luckyruby has joined #ruby
ascarter has joined #ruby
sarbs has joined #ruby
CacoS has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tolvstaa has joined #ruby
<tolvstaa> Hello, I'm trying to use YARD to document a script and it's exhibiting some very strange behavior.
mtkd has quit [Read error: Connection reset by peer]
<tolvstaa> It's removing the first letter from my method parameters and putting two commas after them. I can't find anything pertaining to this online.
mtkd has joined #ruby
luckyrub_ has joined #ruby
luckyruby has quit [Ping timeout: 246 seconds]
<tolvstaa> I'm using Ruby 2.3.1 and YARD 0.9.9
gusrub has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> tolvstaa: I can't help. I find YARD to be a mess. I use straight rdoc.
<zenspider> YARD seems to mostly appeal to those coming over from java and still stuck on typing
<tolvstaa> ah well, thanks anyway :)
jenrzzz_ has quit [Ping timeout: 255 seconds]
mitt3ns has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
opencw has quit [Quit: Leaving]
Robtop__ is now known as pwnd_nsfw
agent_white has quit [Ping timeout: 240 seconds]
luckyrub_ has quit [Ping timeout: 240 seconds]
Fernando-Basso has quit [Ping timeout: 245 seconds]
<zenspider> huh... if a.b? c then ... end is fine. but case when a.b? c then ... end is not
<zenspider> ruby syntax is such a tar pit
synthroid has quit []
romeoh has joined #ruby
<leah2> case then is never allowed?
<leah2> never has been
troys is now known as troys_
luckyruby has joined #ruby
MrBismuth has joined #ruby
MrBusiness has quit [Ping timeout: 246 seconds]
duderonomy has quit [Ping timeout: 272 seconds]
leitz has joined #ruby
Fernando-Basso has joined #ruby
<ljarvis> yes it has
luckyruby has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
luckyruby has joined #ruby
<ljarvis> >> case "foo" when /foo/ then "omg" end
<ruby[bot]> ljarvis: # => "omg" (https://eval.in/809832)
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
nowhereman has joined #ruby
<ljarvis> tbh i thought it was removed at some point, but maybe it was just discussed
normie1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
normie1 has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
<zenspider> leah2: not true... it's called an expressionless case.
dc2 has joined #ruby
<zenspider> basically a better aligned multi-clause if
<ljarvis> oh that's what they're refering to?
<zenspider> that's how I read it
<zenspider> oh. you were probably thinking of colons
<zenspider> when blah:
<ljarvis> yeah, case ... == case true; and i love it
<ljarvis> ah right, yes probably
<ljarvis> forgot those existed
<ljarvis> lol ruby
<ljarvis> u so silly
<zenspider> I guess I never thought of it that way. I always thought of it as a transformer to if
neruda has joined #ruby
luckyruby has quit [Read error: Connection reset by peer]
<neruda> hi all
<zenspider> hmmm... I don't think it actually acts like true === expr
<ljarvis> I think I read it as `case true` somewhere and it just made sense to me. Not sure how accurate it is. I love it sometimes though, really makes some code easy to read
luckyruby has joined #ruby
<leah2> i thought only : was allowed in case, and deleted for 1.9?
<ljarvis> right, perhaps not
<zenspider> >> true === :truthy
<ruby[bot]> zenspider: # => false (https://eval.in/809834)
<neruda> its real quiet on the rails chan, so I'll try here
<neruda> are there additional anti-csrf measures a rails app can employ other than the :prevent_forgery and session nonce? Like storing and checking IP address on each request etc?
<ljarvis> neruda: not built in
<zenspider> neruda: not a good reason to ask here
GinoMan1423 has joined #ruby
troys_ is now known as troys
<ljarvis> also true ^
<zenspider> maybe there is a ##webdev or something
<neruda> zenspider: thx
<leah2> hm. 1.8 had optional then or : for when and rescue
<zenspider> it'd be kinda neat if TrueClass#=== o was just !!o
dc2 has quit [Ping timeout: 240 seconds]
<ljarvis> yeah
<leah2> same in 1.9.3
dcluna has quit [Ping timeout: 272 seconds]
<leah2> ah, 1.9 drops :, right
<zenspider> leah2: were you referring to that or to `case when ...` ?
GinoMan1423 has quit [Max SendQ exceeded]
ldnunes has quit [Quit: Leaving]
<leah2> i dont even know how case when is parsed :D
<leah2> isnt it just case true when ... ?
<ljarvis> heh
dcluna has joined #ruby
<ljarvis> short story: no, not exactly
GinoMan2440 has quit [Ping timeout: 245 seconds]
<ljarvis> but i have liked to think of it like that
<ljarvis> for better or worse
<zenspider> case ; (when expr [then] expr)* (else expr)? end
<zenspider> same as
<leah2> i dont see a special node for it?
<zenspider> if expr [then] expr (elsif expr [then] expr)* end
<zenspider> oops. else.
<zenspider> special node?
<leah2> for case x when vs case when
<ljarvis> what do you mean node?
DeeJayh__ has quit [Read error: Connection reset by peer]
<leah2> in the AST
<zenspider> what AST are you looking at?
<ljarvis> ah, yeah i haven't dug (and wont, im not feeling up to that tonight)
<leah2> 2.3
<zenspider> looking directly at parse.y?
<leah2> sure
<zenspider> there is no special node for it.
<zenspider> look for NEW_CASE
<leah2> yep
<leah2> it uses 0 as first arg
jamesaxl has quit [Read error: Connection reset by peer]
<leah2> duh, was confusing NODE_CASE and NODE_WHEN
jamesaxl has joined #ruby
<leah2> if (node->nd_head == 0) {
<leah2> COMPILE_(ret, "when", node->nd_body, poped);
<leah2> ok
<zenspider> yup
<zenspider> again, basically just an if stmt
DeeJayh has joined #ruby
<ljarvis> good to know
pupsicle has quit [Quit: pupsicle]
postmodern has joined #ruby
duderonomy has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
romeoh has quit []
_sfiguser has joined #ruby
normie1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
luckyruby has quit [Ping timeout: 246 seconds]
chouhoul_ has joined #ruby
SilentNinja1 has joined #ruby
neruda has quit [Quit: Page closed]
<SilentNinja1> Hi is there a one liner to convert local time to UTC? Thanks
jusa has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
haylon has quit [Remote host closed the connection]
luckyruby has joined #ruby
<SilentNinja1> DateTime.now.utc ?
jusa has quit [Ping timeout: 240 seconds]
GinoMan has joined #ruby
ResidentBiscuit has quit [Quit: Critical Miss]
haylon has joined #ruby
brent__ has joined #ruby
blackwind_123 has joined #ruby
glmglmglm has left #ruby ["Leaving..."]
mitt3ns has quit [Quit: bai]
haylon has quit [Ping timeout: 268 seconds]
luckyruby has quit [Read error: Connection reset by peer]
workmad3_ has joined #ruby
luckyruby has joined #ruby
brent__ has quit [Ping timeout: 268 seconds]
__Yiota has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
SilentNinja1 has quit [Ping timeout: 240 seconds]
psychicist__ has quit [Quit: Lost terminal]
tristanp has quit [Remote host closed the connection]
tristanp has joined #ruby
brent__ has joined #ruby
luckyruby has quit [Read error: Connection reset by peer]
luckyrub_ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
<havenwood> >> require 'date'; Time.now.utc.to_datetime.zone
<ruby[bot]> havenwood: # => "+00:00" (https://eval.in/809841)
tristanp has quit [Ping timeout: 268 seconds]
luckyruby has joined #ruby
luckyrub_ has quit [Ping timeout: 260 seconds]
<zenspider> you can see it just in the regular output
<zenspider> >> Time.now.utc
<ruby[bot]> zenspider: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<zenspider> Pththth
dc2 has joined #ruby
<zenspider> what is that crap?
<havenwood> #=> 2017-06-01 22:14:44 UTC
<zenspider> yeah. that.
<zenspider> >> Time.now
mikecmpbll has quit [Read error: Connection reset by peer]
<ruby[bot]> zenspider: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
<havenwood> #=> 2017-06-01 15:15:38 -0700
<zenspider> huh. I wonder what's going on
mikecmpbll has joined #ruby
roshanavand has quit [Quit: roshanavand]
dc2 has quit [Ping timeout: 260 seconds]
enterprisey has quit [Ping timeout: 245 seconds]
<SeepingN> puts Time.now
<SeepingN> >> puts Time.now
<ruby[bot]> SeepingN: # => 2017-06-01 22:22:35 +0000 ...check link for more (https://eval.in/809843)
<SeepingN> puts Time.now.utc
<SeepingN> le sigh
<SeepingN> >> puts Time.now.utc
<ruby[bot]> SeepingN: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<SeepingN> wow
PatrikasZvaigzde has quit [Ping timeout: 260 seconds]
<Papierkorb> >> nil[0]
<ruby[bot]> Papierkorb: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<Papierkorb> at least it's not running 2.3.0
<SeepingN> >> puts TIme.utc
<ruby[bot]> SeepingN: # => uninitialized constant TIme ...check link for more (https://eval.in/809844)
<SeepingN> >> puts Time.utc
<ruby[bot]> SeepingN: # => wrong number of arguments (given 0, expected 1..8) (ArgumentError) ...check link for more (https://eval.in/809845)
<SeepingN> ya know what ruby, just figure it out
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<zenspider> Papierkorb: that code goes WAY back. and works fine in irb. it's the service
<SeepingN> >> puts Time.utc(Time.now)
<ruby[bot]> SeepingN: # => no implicit conversion of Time into Integer (TypeError) ...check link for more (https://eval.in/809846)
<SeepingN> anyway
<zenspider> SeepingN: please use IRB locally
<SeepingN> yeah sorry
TomyLobo has quit [Ping timeout: 245 seconds]
luckyruby has quit [Read error: Connection reset by peer]
luckyruby has joined #ruby
r_rios_ has quit [Read error: Connection reset by peer]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has quit [Quit: Nappy time]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ecuanaso has joined #ruby
luckyrub_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
polishdub has quit [Quit: Leaving]
mikecmpbll has quit [Quit: inabit. zz.]
chouhoul_ has quit [Remote host closed the connection]
gusrub has quit [Remote host closed the connection]
luckyruby has quit [Ping timeout: 240 seconds]
gusrub has joined #ruby
gusrub has quit [Read error: Connection reset by peer]
gusrub has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
t-recx has quit [Quit: t-recx]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
im0nde has joined #ruby
arthurl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ecuanaso has joined #ruby
im0nde has quit [Ping timeout: 260 seconds]
chaugiang has quit [Quit: Leaving.]
lxsameer has quit [Quit: WeeChat 1.7]
Cohedrin has quit [Read error: Connection reset by peer]
GodFather_ has joined #ruby
tristanp has joined #ruby
Cohedrin has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gusrub_ has joined #ruby
gusrub has quit [Ping timeout: 268 seconds]
brent__ has quit [Remote host closed the connection]
PatrikasZvaigzde has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
ledestin has joined #ruby
nowhereman has quit [Remote host closed the connection]
nowhere_man has joined #ruby
marxarelli is now known as marxarelli|afk
sneakers has quit [Quit: back later]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
dc2 has joined #ruby
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 260 seconds]
gusrub_ has quit [Read error: Connection reset by peer]
gusrub has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
GinoMan has quit [Read error: Connection reset by peer]
Silthias has joined #ruby
Cohedrin has joined #ruby
GinoMan has joined #ruby
patr0clus has quit [Ping timeout: 268 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
taurgal has quit [Ping timeout: 240 seconds]
snockerton has joined #ruby
username has joined #ruby
BSAlb has joined #ruby
Kero has joined #ruby
BSab has quit [Ping timeout: 260 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
jgt2 has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
jusa has joined #ruby
cdg has quit [Ping timeout: 245 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
stormbytes has joined #ruby
jusa has quit [Ping timeout: 240 seconds]
Mia has quit [Read error: Connection reset by peer]
jamesaxl has quit [Client Quit]
cschneid_ has joined #ruby
Kero has left #ruby [#ruby]