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]
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
<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
<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 :)
<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;
<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
<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?
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…]
<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?
<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
<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
<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
<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>
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]
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: 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>
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
<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.
<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?
<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]
<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]
<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?
<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