roshanavand has quit [Remote host closed the connection]
<riceandbeans>
No implicit conversion of Float into String
solocshaw has joined #ruby
sepp2k has quit [Quit: Leaving.]
peterevjan has quit [Ping timeout: 264 seconds]
aupadhye has joined #ruby
<eam>
>> String.new(1.5)
benhuda has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<riceandbeans>
I don't understand the issue
<shevy>
String.new 1 TypeError: no implicit conversion of Fixnum into String
<riceandbeans>
whp is there a conversion issue
hostess_ has quit [Quit: No Ping reply in 180 seconds.]
<riceandbeans>
why
peterevjan has joined #ruby
<shadoi>
You might want String(baz['biff']) to coerce it.
<eam>
well, if the bot were working you'd see that's what you're doing and the ultimate answer is it's an error becaue only things with #to_str can be passed to String.new
UtkarshRay has quit [Remote host closed the connection]
GriffinHeart has quit [Remote host closed the connection]
GriffinHeart has joined #ruby
jottr has joined #ruby
shakes has quit [Quit: Leaving]
dionysus69 has joined #ruby
Guest84795 has quit [Quit: leaving]
romero has joined #ruby
mpistone has quit [Remote host closed the connection]
aryaching has joined #ruby
sivoais has joined #ruby
peterevjan has joined #ruby
Abrin has joined #ruby
hxegon is now known as hxegon_AFK
juddey has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
vondruch has quit [Ping timeout: 245 seconds]
dsilfen has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
bluOxigen has joined #ruby
dsilfen has quit [Ping timeout: 250 seconds]
Abrin has quit [Ping timeout: 256 seconds]
sandstrom has joined #ruby
sivoais has quit [Ping timeout: 252 seconds]
hxegon_AFK has quit [Quit: BRB]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
sivoais has joined #ruby
nunchuck has quit [Ping timeout: 248 seconds]
jorrin has quit [Quit: Leaving]
sivoais has quit [Client Quit]
shiffles has quit [Ping timeout: 240 seconds]
bluOxigen_ has joined #ruby
defendguin has quit [Ping timeout: 272 seconds]
danielwzd has quit [Quit: Leaving]
shiffles has joined #ruby
bluOxigen has quit [Ping timeout: 248 seconds]
<pizzaops>
So, when I run this code I get "stack level too deep". Googling tells me that's when you create some kind of never-ending recursion, but I don't see how that's happening here: https://gist.github.com/pizzaops/fc603ba5324d2a7fdab7
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
pizzaops: #hello is invoking #hello is invoking #hello...
<pizzaops>
How is hello invoking hello?
<pizzaops>
ohhh
peterevjan has quit [Remote host closed the connection]
<pizzaops>
because i forgot the quotes, lolz
<pizzaops>
doh.
shiffles has quit [Client Quit]
shiffles has joined #ruby
<pizzaops>
I wrote that to confirm I could create helper methods to use in my class's initialize method, when the initialization logic is complex. This error got me worried I couldn't. Glad it was just a dumb mistake :D
<pizzaops>
Ox0dea: blame the vSphere API, not me :/
<Ox0dea>
pizzaops: Fair enough, I guess.
<rubynuby>
'+'.to_sym
<rubynuby>
"+".to_sym
<pizzaops>
You have to do a lot of initial work to get it to do anything at all
<Ox0dea>
pizzaops: Sure, but the constructor isn't necessarily the best place to do it.
joonty has joined #ruby
<rubynuby>
maybe something is wrong with my ruby
zacstewart has quit [Ping timeout: 256 seconds]
<Ox0dea>
It'd be your environment, not the interpreter.
<rubynuby>
yeah, something is wrong with what I'm doing on my computer
<Ox0dea>
Gonna have to nuke it from orbit, I reckon.
<rubynuby>
oh god
<rubynuby>
it works for :- but not for the others
aryaching has quit [Ping timeout: 240 seconds]
<Ox0dea>
It might be your font?
last_staff has quit [Quit: last_staff]
karapetyan has joined #ruby
zacstewart has joined #ruby
ponga has joined #ruby
<rubynuby>
well, i wanted to install ubuntu on my computer anyways
tuelz1 has joined #ruby
elifoster has joined #ruby
<rubynuby>
might be a good time to do it
joonty has quit [Ping timeout: 240 seconds]
<Ox0dea>
It's a sign!
<rubynuby>
alright, thanks, im off
rubynuby has left #ruby [#ruby]
norc has joined #ruby
bluOxigen has joined #ruby
Macaveli has joined #ruby
shiffles has quit [Ping timeout: 240 seconds]
<pizzaops>
Ox0dea: I think I figured out a way to avoid having to do it in the constructor. I was originally doing it to avoid calling a method that would always make a bunch of api calls, but I figured out a way to make it not do that. Can I ask for your thoughts? https://gist.github.com/pizzaops/1d14cbb8da1d247d0649
pwnd_nsfw has quit [Ping timeout: 250 seconds]
<pizzaops>
For the sake of context,`@obj` is an instance of VirtualMachine, and I'm recursively going up the hierarchy to find the instance of "Datacenter" that represents the datacenter it's stored in.
bluOxigen_ has quit [Ping timeout: 240 seconds]
<Ox0dea>
pizzaops: So that @vm_datacenter instance variable is being set elsewhere?
sivoais has joined #ruby
<pizzaops>
Ox0dea: ah good catch. I meant to make it set that, instead of just doing the return
tuelz1 has quit [Ping timeout: 245 seconds]
<Ox0dea>
pizzaops: Here's an approach that passes for idiomatic in some circles: https://eval.in/512919
<Ox0dea>
I'm with apeiros on not quite seeing the applicability to refinements, though.
kerunaru has joined #ruby
<norc>
Ox0dea: Let me show you an example of what I mean.
sivoais has quit [Ping timeout: 250 seconds]
ta_ has quit [Remote host closed the connection]
jbrhbr has quit [Ping timeout: 276 seconds]
<norc>
Or no. This is more easily explained.
djbkd has quit [Remote host closed the connection]
stevemackinnon has quit [Remote host closed the connection]
dEPy_ has joined #ruby
UtkarshRay has joined #ruby
saneax_AFK is now known as saneax
sivoais has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
krzkrz has joined #ruby
chouhoulis has joined #ruby
djbkd has joined #ruby
krz has quit [Ping timeout: 245 seconds]
<norc>
Ox0dea: The whole point of refinements is because you want to change the behaviour of some class in some area of your code. Inheritance does that for you already.
tvw has joined #ruby
<Ox0dea>
norc: Aye, and refinements are for "undoing" inheritance without getting your hands dirty.
dEPy has quit [Ping timeout: 260 seconds]
<norc>
Which basically is just casting semantics. First you want an Array object to be a SerializableArray, and after a while you want it to be a normal Array object again.
<norc>
(Or maybe that particular object can stay a SerializableArray)
troulouliou_div2 has quit [Ping timeout: 250 seconds]
snguyen has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
chouhoulis has quit [Ping timeout: 250 seconds]
<Ox0dea>
You're right that Fiddle could be used to emulate refinements, but you'd have to manually do all the stuff you get for free by dint of their being lexically scoped.
haasn has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
snguyen has quit [Client Quit]
sivoais has quit [Ping timeout: 250 seconds]
mhoungbo has joined #ruby
ramfjord has joined #ruby
oetjenj has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<norc>
Ox0dea: The "advantage" I see, is that you can change the behaviour of classes that some code outside your control uses, although I am still not entirely convinced whether that is a good thing.
sivoais has joined #ruby
<norc>
(Since it completely breaks the concept of interfaces)
<Ox0dea>
It's not a good thing. :P
<norc>
Heh.
<Ox0dea>
But people sometimes do bad things for good reasons.
<norc>
That is how ActiveRecord was created.
<Ox0dea>
Just so.
joneshf-laptop has quit [Remote host closed the connection]
joneshf-laptop has joined #ruby
dEPy_ has quit [Remote host closed the connection]
dEPy has joined #ruby
snguyen has joined #ruby
vl408 has joined #ruby
Mon_Ouie has joined #ruby
adgtl has quit [Read error: Connection reset by peer]
<pizzaops>
Is there a way to advance the cursor? E.g. if I doo (?!word).* then ord matches
<apeiros>
the way you use it differs from [^w][^o][^r][^d]
moeabdol has joined #ruby
karapetyan has quit [Remote host closed the connection]
BSaboia has quit [Ping timeout: 256 seconds]
<apeiros>
(?:(?!word).)*
rhg135 has joined #ruby
<apeiros>
or +
<ljarvis>
derp
sivoais has quit [Ping timeout: 245 seconds]
<apeiros>
OMG, I tried to edit the PICTURE OF RUBULAR
<apeiros>
who friggin posts a pic of rubular?!?
<Ox0dea>
pizzaops: Look what you've done.
<ljarvis>
:D
* ljarvis
did the same
<pizzaops>
lol
<ljarvis>
also Dropbox is pig slow
* apeiros
swings fist at pizzaops :-p
<pizzaops>
>> [^w][^o][^r][^d].*foo =~ "word foo"
ishahnaz has joined #ruby
aufi has joined #ruby
<pizzaops>
Hmm.
<pizzaops>
Did I not invoke the bot correctly?
sivoais has joined #ruby
<apeiros>
that would not match xofoo
<ljarvis>
im confused about what you really want here
amclain has quit [Quit: Leaving]
<ljarvis>
pizzaops: that's not valid ruby anyway
<apeiros>
pizzaops: you're not registered?
<Mon_Ouie>
You also didn't write a regexp literal
jottr has joined #ruby
<pizzaops>
I am registered, but ah look I have a pm from nickserv
einarj has joined #ruby
einarj has quit [Remote host closed the connection]
mdw has joined #ruby
<apeiros>
eval-in only for authed people, sorry :)
einarj has joined #ruby
<ljarvis>
anyway, my question would be what do you really want here? this example might not be real-world enough
<pizzaops>
Sure, here's the real world example. If I have two strings, one of which is foobar-baz.bot and the other is foobar.bot, I want something that matches foobar.bot but not foobar-baz.bot.
<Ox0dea>
I, for one, am overwhelmed by clarification.
<ljarvis>
=~ /foobar.bot/ :troll:
<ljarvis>
anywayyy
<pizzaops>
I'm not trolling. The real example is that when you make a disk in vSphere, it creates two files for it, one that's something.vmdk and another that's something-flat.vmdk
<ljarvis>
ok your example just changed
<pizzaops>
and I want to count the number of disks in a certain datastore, and to do that, I need to ignore the -flat files.
<pizzaops>
Aka find match foobar.bot but not foobar-baz.bot
<ljarvis>
is it always -flat ?
<pizzaops>
Yes.
<pizzaops>
The file I don't care about is always something-flat.vmdk, and th one I do care about is always something.vmdk
darkf has joined #ruby
<Ox0dea>
Then you don't need a regular expression.
<apeiros>
/.*(?<!-flat)\.vmdk/
<ljarvis>
that's overkill imo
<ljarvis>
but it'll work
* ljarvis
would also not use regexp
<apeiros>
whoops, forgot anchoring
<pizzaops>
Ox0dea: to add to the problem, there are other files that don't end in vmdk, and i need to ignore them completely, which is why I opted for a regex, but I'm open to suggestions
<ljarvis>
are these lines are just a big string?
<ljarvis>
or*
<pizzaops>
unfortunatey
<apeiros>
pizzaops: Dir.glob('*.vmdk') # only gets .vmdk files
<Ox0dea>
apeiros: To include the -flat ones.
<pizzaops>
so to even further complicated it, it's not a real directory
<pizzaops>
it's the result of an API query
<pizzaops>
so all i have is the strings
einarj has quit [Client Quit]
<apeiros>
and then reject based on filename[-11,5] == "-flat" (or whatever the correct offset is)
blaxter has joined #ruby
mark3 has joined #ruby
<ljarvis>
I'd strip the extname and check if end_with?("-flat")
<apeiros>
Ox0dea: you're too quick man! wait for the full answer :-p
<Ox0dea>
pizzaops: strings.grep(/\w+\.vmdk/)
<Ox0dea>
Assuming you've got an array of them.
<apeiros>
well, if you already got an array of strings I'd probably indeed use ary.grep(/.*(?<!-flat)\.vmdk/)
<apeiros>
rah
<ljarvis>
rah
<apeiros>
well, if you already got an array of strings I'd probably indeed use ary.grep(/\A.*(?<!-flat)\.vmdk\z/)
<apeiros>
RAH!
<pizzaops>
Ox0dea: yeah so i've got an array of them but that example doesn't eliminate the -flat
<pizzaops>
ljarvis: thank the vSphere API. None of that is me :)
blaxter has joined #ruby
sivoais has quit [Ping timeout: 240 seconds]
<pizzaops>
I mean I wrote the line, but it's the necessary line to query vSphere with their Ruby library for this information.
<ljarvis>
how awful
<pizzaops>
It's pretty bad yes.
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pwnd_nsfw has joined #ruby
<atmosx>
it's awful
dsilfen has quit [Ping timeout: 260 seconds]
<pizzaops>
So, you can iterate throughout all the vms and datastores and whatever if you want to, but it's way slower than using a property collector, since the former would be a potentially infinite number of api calls as you loop, while the latter is vSphere's search interface, which they call a property collector
<pizzaops>
and you can describe the results you want to return, and get them all in one api call
<pizzaops>
but it's definitely a nightmare.
sivoais has joined #ruby
<pizzaops>
I'm just glad there's a library at all. . .it's a SOAP api.
<Ox0dea>
Be advised that Pry'll segfault on exit after that. :P
<pizzaops>
All this is just to make sure that when I create a new disk, the filename is unique. To be honest I'm tempted to just append SecureRandom.uuid
<pizzaops>
Because my current way of doing it possibly doesn't even list all the disk files, since it doesn't list disks that are in the VM's datastore, but have been disconnected from the vm.
Xeago has joined #ruby
<pizzaops>
vSphere + ESXi is basically a "virtual computer simulator". It's just as complicated as physically building one, you just don't need to handle the physical cables. You have to tell it what damn SCSI LUN the drive should use,
Yeomra has joined #ruby
ready has joined #ruby
aryaching has joined #ruby
tomphp has joined #ruby
JohnBat26 has joined #ruby
Snowy has joined #ruby
pink_vampire has quit [Read error: Connection reset by peer]
<pizzaops>
AHAHAH IT WORKS IT MAKES GOD DAMN DISKS
<pizzaops>
Sorry, I've just been working on this nightmare for so long.
last_staff has joined #ruby
<pizzaops>
Also Ox0dea, do you ever sleep? You've helped me every time I've come on here, at random times.
<pizzaops>
(and I do appreciate it!)
last_staff has quit [Client Quit]
mlehrer has joined #ruby
PedramT has quit [Remote host closed the connection]
Ruby_Rocks_007 has quit [Quit: Ruby_Rocks_007]
jgt2 has joined #ruby
sivoais has quit [Ping timeout: 272 seconds]
Rickmasta has joined #ruby
sivoais has joined #ruby
PedramT has joined #ruby
aryaching has quit [Remote host closed the connection]
<p1k>
What's the correct way to delay handling an interupt until I'm read to deal with it (with Thread.handle_interupt)?
infra-red has joined #ruby
PedramT has quit [Remote host closed the connection]
jgt2 has quit [Ping timeout: 250 seconds]
<toretore>
p1k: put it on a queue
PedramT has joined #ruby
cajone has quit [Remote host closed the connection]
dasher00 has joined #ruby
vifino has quit [Ping timeout: 246 seconds]
<p1k>
toretore: could you give an example / link to one?
william3 has quit [Remote host closed the connection]
<toretore>
but i would push signals onto a queue and handle them in the main loop anyway and not have to deal with it
sandstrom has quit [Quit: My computer has gone to sleep.]
bluOxigen has quit [Ping timeout: 250 seconds]
jgt2 has joined #ruby
bluOxigen has joined #ruby
evidex has joined #ruby
<p1k>
But is this the correct way to deal with the ruby Thread.raise? I understand there is a Thread.handle_interrupt but I'm not clear on how to block Thread.raise with it
sandstrom has joined #ruby
nalaginrut has joined #ruby
<toretore>
Thread#raise raises an exception, which is different from a signal
sandstrom has quit [Client Quit]
<apeiros>
p1k: you wrap the part which should not be interrupted with Thread.handle_interrupt
sivoais has quit [Ping timeout: 250 seconds]
<apeiros>
p1k: Thread.handle_interrupt has plenty of examples
<apeiros>
+docs
aupadhye has quit [Quit: Leaving]
sivoais has joined #ruby
aswen has quit [Ping timeout: 250 seconds]
<p1k>
apeiros: It still interrupts in the middle of the code though -
<apeiros>
?code p1k
<ruby[bot]>
p1k: We can't help you without your code, please post it to https://gist.github.com
<apeiros>
without code, that's just a random assertion I can't comment in any way.
sandstrom has joined #ruby
dexter__ has quit [Ping timeout: 276 seconds]
toretore has quit [Quit: Leaving]
TheHodge has joined #ruby
djbkd has quit [Remote host closed the connection]
sandstrom has quit [Read error: Connection reset by peer]
<shevy>
cooooooode!
karapetyan has joined #ruby
william3 has joined #ruby
ocbtec has joined #ruby
ziyadb has joined #ruby
william3 has quit [Remote host closed the connection]
william3 has joined #ruby
marr has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
The_Phoenix has joined #ruby
Conflict has joined #ruby
BTRE has quit [Quit: Leaving]
araujo_ has quit [Quit: Leaving]
Brklyn has joined #ruby
dmolina has joined #ruby
atmosx has quit [Quit: computer went to sleep...]
sivoais has quit [Ping timeout: 240 seconds]
hxegon has joined #ruby
sivoais has joined #ruby
stan has quit [Quit: Leaving]
Brklyn has quit [Ping timeout: 245 seconds]
varunwachaspati has joined #ruby
tuelz1 has joined #ruby
croberts has quit [Ping timeout: 248 seconds]
Hounddog has joined #ruby
PedramT has quit [Ping timeout: 240 seconds]
tuelz1 has quit [Ping timeout: 276 seconds]
lipoqil has joined #ruby
Xeago has quit [Remote host closed the connection]
Ruby_Rocks_007 has quit [Quit: Ruby_Rocks_007]
sivoais has quit [Ping timeout: 240 seconds]
stan has joined #ruby
sivoais has joined #ruby
Xeago has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
GriffinHeart has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
<Deck`>
shevy: it works but my actual goal is to get path in three cases: the path itself is given like: `path`, with http:// version and non-http version. So prepending wont work for me
sftrabbit has quit [Quit: sftrabbit]
<jhass>
does `path` ever contain `/` in your case?
rideh has quit [Changing host]
rideh has joined #ruby
<jhass>
because foo.bar/baz is a totally legit path
<jhass>
and hence that's what URI.parse interprets it as
waka has joined #ruby
<Deck`>
jhass: sure, I agree with URI.parse, my code deals with urls with http/https or with paths itself. It takes the string nad returns path, but there is new requirement: supporting www.url.com/path
gigetoo has quit [Ping timeout: 240 seconds]
ropeney has quit [Remote host closed the connection]
<Deck`>
So I'm looking for the way without completely rewriting this using regexes
sivoais has quit [Ping timeout: 245 seconds]
<jhass>
that gets horrible fast
adgtl has quit [Remote host closed the connection]
blackmesa has joined #ruby
<jhass>
easier to write your own little parser if you seek to be correct
<jhass>
but again, how are you going to differentiate?
<jhass>
match against the public suffix list?
neu0 has joined #ruby
<jhass>
it'll be a heuristic in any case
gigetoo has joined #ruby
sivoais has joined #ruby
<Deck`>
got it, I think it would be something like %r{((https?://)?[^/]+/)?([^/]+)}
<atmosx>
I updated the rake version on a Gemfile, do I need to worry about the Gemfile.lock - this is a github repo
<Deck`>
just to make s in https optional, http:// optional and host optional
<jhass>
atmosx: yes
<jhass>
Gemfile is your wishes, Gemfile.lock is what's enforced
sergey_makagon has joined #ruby
<atmosx>
jhass: hm, do can I delete Gemfile.lock from the repo ?
<jhass>
you shouldn't
<atmosx>
problem is how do I test this..
<jhass>
what?
sftrabbit has joined #ruby
<atmosx>
redmine_plugin
<jhass>
ask #redmine
<atmosx>
I guess I just install redmine and this plugin run rake
<jhass>
last time I checked redmine heavily abused bundler
<atmosx>
true
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Mon_Ouie has joined #ruby
sivoais has quit [Ping timeout: 260 seconds]
kristofferR has joined #ruby
nettoweb has joined #ruby
<nobitanobi>
Could anyone point me to good readings on why would not use class methods if being strict about object oriented paradigm?
dlitvak has quit [Ping timeout: 276 seconds]
sivoais has joined #ruby
aufi_ has joined #ruby
trinaldi_ has joined #ruby
trinaldi has quit [Disconnected by services]
trinaldi_ is now known as trinaldi
jhill_ has quit [Ping timeout: 240 seconds]
kireevco has quit [Ping timeout: 240 seconds]
sftrabbit has quit [Ping timeout: 240 seconds]
mikeiniowa has quit [Ping timeout: 240 seconds]
zipkid has quit [Ping timeout: 240 seconds]
colegatron has quit [Ping timeout: 240 seconds]
matp has quit [Ping timeout: 240 seconds]
sorah has quit [Ping timeout: 240 seconds]
aibot has quit [Ping timeout: 240 seconds]
mja has quit [Ping timeout: 240 seconds]
aufi has quit [Ping timeout: 240 seconds]
sirecote has quit [Ping timeout: 240 seconds]
redondos has quit [Ping timeout: 240 seconds]
aibot_ has joined #ruby
redondos has joined #ruby
redondos has quit [Changing host]
redondos has joined #ruby
blackmesa has joined #ruby
kristofferR has quit [Max SendQ exceeded]
Yeomra_ has joined #ruby
zipkid has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mja has joined #ruby
matp has joined #ruby
sorah has joined #ruby
kristofferR has joined #ruby
colegatron has joined #ruby
sirecote has joined #ruby
mja is now known as Guest26985
JohnBat26 has quit [Ping timeout: 240 seconds]
Pupeno has quit [Read error: Connection reset by peer]
JohnBat26 has joined #ruby
Yeomra has quit [Ping timeout: 248 seconds]
kireevco has joined #ruby
jhill_ has joined #ruby
kristofferR has quit [Client Quit]
billybob has joined #ruby
duckpuppy has quit [Ping timeout: 250 seconds]
Macaveli has joined #ruby
__ht has joined #ruby
<billybob>
hey all. starting to learn ruby. i am confused on || - How can I compare 3 things where I only want to compare A && B || A && C ? Basically I want to say: If A == true && B == true or if A == true and C == true
<jhass>
nobitanobi: not sure I'd agree, who claims so?
<billybob>
but it evaluates both sides obviously. so how do I essentially use something like either
Yeomra_ has quit [Quit: WeeChat 1.4]
<jhass>
billybob: A && (B || C)
Yeomra has joined #ruby
pawnbox has joined #ruby
<billybob>
jhass: i swear I tried that many times. but let me go back and retry again. possible the data being fed to it wasnt correct ;(
<billybob>
jhass: lol works exactly as I expected. who knows what i did before. thanks a bunch
<jhass>
yw
sivoais has quit [Ping timeout: 250 seconds]
Rickmasta has joined #ruby
sivoais has joined #ruby
tvw has quit [Ping timeout: 245 seconds]
skakri` is now known as skakri
tyil has joined #ruby
__ht has quit [Ping timeout: 264 seconds]
synthroid has joined #ruby
emilkarl has joined #ruby
mdw has joined #ruby
karapetyan has joined #ruby
mfb2 has joined #ruby
Snowy has quit [Remote host closed the connection]
<tyil>
the server log shows: Feb 4 14:14:20 mail dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=86.93.148.215, lip=192.168.1.12, TLS handshaking: SSL_accept() failed: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca: SSL alert number 48, session=<mbs9g/EqjqtWXZTX>
cassianoleal has joined #ruby
<jhass>
sounds like your server uses a self signed cert, doesn't deliver the whole chain or uses a CA not trusted by your client
<tyil>
self-signed
sivoais has quit [Ping timeout: 250 seconds]
<jhass>
though a bit odd to get just a closed stream on the client, agreed
dajobat has quit [Ping timeout: 272 seconds]
chouhoulis has joined #ruby
<jhass>
anyway, bet that's the issue
<jhass>
consider getting a letsencrypt, startcom or wosign cert?
Burgestrand has joined #ruby
<tyil>
considered LE, but that sounds as a workaround, not a fix :p
<jhass>
I'd claim the other way around
<jhass>
everything else is a workaround
<tyil>
besides that, the LE application didn't work on FreeBSD last time I tried
<jhass>
thankfully the protocol is simple enough, no need for the messy official client
<tyil>
however, I still think that self-signed certs should be valid too >_>
<jhass>
you're simply wrong about that
<nobitanobi>
jhass: I have talked to several people that claims that the only method that a class should own is the initialize. I tend to use class methods for methods that will do the same thing regardless of the state of its instances
krzkrz has joined #ruby
<jhass>
I'd prefer DANE spreading over a bandage like LE, but still better than self-signed
<tyil>
DANE would be fine too
<tyil>
but simply refusing self-signed without a way to accept them is bad
troulouliou_div2 has quit [Read error: Connection reset by peer]
sgambino has joined #ruby
tuelz1 has joined #ruby
<jhass>
there's a way but it's nothing that should be spread as a solution to the problem
chouhoulis has quit [Ping timeout: 240 seconds]
__ht has quit [Ping timeout: 252 seconds]
sftrabbit has joined #ruby
mfb2 has quit [Remote host closed the connection]
hxegon has joined #ruby
<tyil>
any solution that requires a single point of failure (CAs) that have proven themselves to fail is bad, so I should have a simple way to just accept my self-signed certs
<tyil>
saying "self-signed is wrong" is on itself a wrong statement
joonty has quit [Ping timeout: 240 seconds]
last_staff has joined #ruby
<jhass>
you can simply turn off validation
<ddv>
tyil: ssl is not only about encryption, it is also about a third party identifying you
<shevy>
NSA!
<nobitanobi>
jhass: would love to hear why do you think using class methods it's "ok"
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jirte has joined #ruby
<tyil>
ddv: I know, and using that with teh current CA system is not really any more secure than no third party validation at all
Macaveli has joined #ruby
<jhass>
nobitanobi: it's just bloat if your object has no state and a single method
<tyil>
you can pay anyone 5 bucks and they'll say "yeah that's correct" in the current CA system
codecop has joined #ruby
* shevy
holds out his hand
dayjo has quit [Quit: Leaving]
<tyil>
jhass: the problem remains if I call .starttls({}, false) though
<jhass>
tyil: point is that you have to spend effort, so some validation increases attacker effort, self signed increases attacker effort not at all
<tyil>
welp, since you seem to know just as little about it as I do, I'll ask around at another community (otherwise you would've just given me the right object to pass in)
sepanta has quit [Client Quit]
<jhass>
sigh
<jhass>
if you run with self-signed stuff you shouldn't be as clueless as you are in that area
<tyil>
if I wanted to avoid effort, I would've ran debian and run the LE client, wouldn't I?
DmitryBochkarev has joined #ruby
sivoais has joined #ruby
<tyil>
instead, I'm actually trying to get some sane help out of a childish guy on irc who's just trying to be an elitist prick
sftrabbit has joined #ruby
<jhass>
yes, I strongly oppose your viewpoint, that can only be childish and elitist
baweaver has joined #ruby
<jhass>
despite giving you all the information you would need if you'd spend 10 minutes on reading them
frarwp has joined #ruby
<jhass>
but you already know I'm not here to help you, so why bother doing that
<tyil>
you're elitist because you're refusing to just help me, and your childish for saying things like "I'd tell you to run your own PKI but then you're so fixiated on disabling validation"
mdw has quit [Quit: Sleeping Zzzzz]
<tyil>
if you're here to help, you should consider to drop this elitist act and make childish comments
symbol has joined #ruby
newbie22 has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
<ddv>
tyil: lol relax
newbie22 has left #ruby [#ruby]
blackmesa has quit [Ping timeout: 250 seconds]
symbol has quit [Client Quit]
<ddv>
tyil: you are not entitled to anything in this channel
<ddv>
please keep that in mind, we are all volunteers in here
newbie22 has joined #ruby
newbie22 has quit [Remote host closed the connection]
reppard has joined #ruby
<tyil>
I never claimed I was, I just told jhass that he's acting elitist and childish
<tyil>
which he was
EAK has joined #ruby
<EAK>
hi guys
<tyil>
I came in here for help on an issue, not to get told I'm doing it all wrong because it doesn't fit into someones mindset
newbie22 has joined #ruby
atomical has joined #ruby
mfb2 has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
__ht has joined #ruby
supremekay has quit [Ping timeout: 240 seconds]
mdw has joined #ruby
dlitvak_ has joined #ruby
<EAK>
i need to install this: gem install arduino_firmata
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
despai has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lagweezle>
yorickpeterse: Not sure if you realize, but that was a reference to Monty Python.
<yorickpeterse>
did not realize
wldcordeiro has quit [Ping timeout: 245 seconds]
<lagweezle>
Monty Python and the Holy Grail; scene where they are trying to prove a person is a witch. I can't say it's a GOOD movie, but it sure is a fun watch if you're into that humor type.
weemsledeux has joined #ruby
skade has joined #ruby
zacstewart has quit [Ping timeout: 250 seconds]
cassianoleal has quit [Quit: Went to take a nap...]
dlitvak_ has quit [Ping timeout: 264 seconds]
zacstewart has joined #ruby
<VeryBewitching>
shevy: I would welcome fire, it's cold and damp outside today.
<VeryBewitching>
Not my favourite combination.
chouhoul_ has joined #ruby
ziyadb has joined #ruby
<shevy>
lagweezle I know the dialogue by heart!
<lagweezle>
steam bath!
<VeryBewitching>
My favourite Monty Python is "The Ministry of Silly Walks" sketch
jaiks has quit [Ping timeout: 252 seconds]
sgambino_ has joined #ruby
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest26985 has quit [Ping timeout: 240 seconds]
frarwp has quit [Remote host closed the connection]
huyderman has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 260 seconds]
sgambino has quit [Ping timeout: 250 seconds]
lsmola has quit [Ping timeout: 240 seconds]
hobodave_ has quit [Quit: Computer has gone to sleep.]
Snowy has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
amb77 has left #ruby [#ruby]
SCHAAP137 has quit [Remote host closed the connection]
nofacade has quit [Read error: Connection reset by peer]
amclain has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
idefine has quit [Remote host closed the connection]
Snowy has quit [Client Quit]
synthroid has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 245 seconds]
shredding has quit [Ping timeout: 240 seconds]
sgambino_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sgambino has joined #ruby
sneakerhax has joined #ruby
tjohnson has joined #ruby
JDiPierro has quit [Remote host closed the connection]
adac has quit [Ping timeout: 248 seconds]
webopsx has joined #ruby
mark3 has quit [Remote host closed the connection]
william3 has quit [Remote host closed the connection]
yalue has joined #ruby
ElFerna has joined #ruby
william3 has joined #ruby
infra-red has joined #ruby
djbkd has joined #ruby
infra-re_ has joined #ruby
[Butch] has joined #ruby
william3 has quit [Ping timeout: 240 seconds]
jbrhbr has quit [Quit: Leaving.]
AxonetBE_ has quit [Quit: AxonetBE_]
Deck` has joined #ruby
infra-red has quit [Ping timeout: 264 seconds]
duckpuppy has quit [Ping timeout: 250 seconds]
dionysus69 has joined #ruby
infra-red has joined #ruby
wldcordeiro has joined #ruby
despai has joined #ruby
infra-re_ has quit [Ping timeout: 248 seconds]
symm- has joined #ruby
Deck` has quit [Ping timeout: 256 seconds]
Timba-as has quit [Quit: Be back later ...]
jas02 has quit [Quit: jas02]
kristofferR has joined #ruby
aryaching has quit []
ferr has joined #ruby
mdw has joined #ruby
kolup has quit [Ping timeout: 276 seconds]
KensoDev has quit []
acidrainfall has joined #ruby
IrishGringo has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<acidrainfall>
Hey guys. I'd like to take user input, and if the user just presses enter, accept a default value. I'm struggling with this one.
<acidrainfall>
A prompt like "Please specify instance(s) - defaults to 01"
ElFerna has quit [Ping timeout: 272 seconds]
<jhass>
acidrainfall: use p input to look at what value you get in that case, check for that value and replace it with your default
jottr_ has joined #ruby
<acidrainfall>
So if they just press enter, it takes 01 as its value. I thought maybe something like "es_instances = gets || '01'" but that didn't work
<acidrainfall>
p input?
<jhass>
p es_instances in your case
<acidrainfall>
oh
<acidrainfall>
I haven't heard of p
<jhass>
it's short for puts es_instances.inspect
<acidrainfall>
oh ok
<acidrainfall>
so take the input, and add an unless under it
Gnut has joined #ruby
mdw has quit [Client Quit]
hayden_ has quit [Quit: Connection closed for inactivity]
<jhass>
rather an if
jottr has quit [Ping timeout: 252 seconds]
adgtl has quit [Remote host closed the connection]
johnnyt has quit [Ping timeout: 276 seconds]
KensoDev has joined #ruby
<acidrainfall>
yeah an if is better
<acidrainfall>
thanks jhass that got it
<jhass>
cool
<jhass>
yw
lurch_ has quit [Quit: lurch_]
<volty>
!gets.chomp.empty? || "01"
newbie22 has joined #ruby
synthroid has joined #ruby
<jhass>
I prefer es_instances = "01" if es_instances.nil? || es_instances.chomp.empty? here
ponga has quit [Quit: Connection closed for inactivity]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Gnut>
Is there a good method for converting an entire hash (with some nested arrays) to symbol keys?
jgt3 has quit [Ping timeout: 240 seconds]
idefine has quit [Remote host closed the connection]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sftrabbit has quit [Quit: sftrabbit]
jottr_ is now known as jottr
sgambino has joined #ruby
vondruch has joined #ruby
tilllt has joined #ruby
rakm has joined #ruby
baweaver has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
<acidrainfall>
volty: that's what I was trying to do.
<acidrainfall>
It was the ! that I didn't have I guess.
<shevy>
Gnut do you have a small subset as example of your hash?
djbkd has quit [Ping timeout: 276 seconds]
<tilllt>
hi, a beginner question… if a variable is returned, which begins like this: "#<Ffprober::Wrapper:0x007ffa491fde20 @json= … (lots of json follows)“ what typ of data is that and why the crc at the beginning? and how do i access the json part?
<volty>
gnut: it should go like this h.inject({}) { |nh, pair| nh[pair[0].to_sym] = pair[1] ;nh } // then you have to check if the pair[1] is a hash and recurse on on it
weemsledeux has quit [Ping timeout: 250 seconds]
celly has quit [Remote host closed the connection]
baweaver has quit [Ping timeout: 245 seconds]
<acidrainfall>
I'm starting to write all my admin scripts in ruby (because fuck bash), but the most experience I have is in bash, sorry for the equivalency questions
<volty>
so you should enclose it in a def and call recursively (i guess your 'nested arrays' really meant 'nested hashes')
<acidrainfall>
in bash I can expand a range with {01..20}, in ruby it's (01..20)
xxmphp has joined #ruby
<acidrainfall>
same thing. I want to take user input, to allow a user to specify a list of hostnames (server-(01..20).location)
<acidrainfall>
I figured that might just... work and stuff. But variable.to_a isn't happy.
<volty>
i am going to write sysv-rc-conf in qtruby. (going but who knows when ....)
blaxter has quit [Quit: foo]
<shevy>
you are the qtruby man
skade has quit [Quit: Computer has gone to sleep.]
Felix444 has joined #ruby
felixal has joined #ruby
<volty>
shevy: absolutely. useful and funny
<shevy>
acidrainfall yeah shell scripts annoyed me too, in particular when things become more complex/bigger
<acidrainfall>
Bash is nice because when there isn't a built-in function, I can just call a program
<shevy>
just simple things like calling a function with arguments
<acidrainfall>
Using my entire OS for scripting.
<volty>
acidrainfall: try to restate what you want to achieve
<shevy>
why can't bash use something like: def foo(a,b,c)
<shevy>
ruby can :)
<acidrainfall>
Okay. like this: "Please specify your hostnames:" and accept an answer like "server-(01..20).place.com", which would then expand to an array server-01.place.com, server-02.place.com, etc
<volty>
Array.new(20) { gets.chomp }
<Papierkorb>
volty: he wants to expand that input, not get 20 different user inputs
<shevy>
hehe
johnnyt has joined #ruby
Puffball has quit [Remote host closed the connection]
adgtl has quit [Remote host closed the connection]
<acidrainfall>
haha
adgtl has joined #ruby
<acidrainfall>
What I want is *super* easy in bash, I feel like Ruby has to have some analog
<shevy>
acidrainfall you can write a DSL that will interprete the above
zacstewa_ has joined #ruby
<acidrainfall>
:(
zacstewart has quit [Ping timeout: 256 seconds]
<Papierkorb>
acidrainfall: nothing OOTB, but also nothing that's not doable
celly has joined #ruby
<volty>
acidrainfall: yes it has. have to think
celly has quit [Remote host closed the connection]
<acidrainfall>
Maybe I should go about this another way
celly has joined #ruby
<shevy>
Gnut hash.map {|key, value| {key.to_sym => value} }.first works ? I got back: x = hash.map {|key, value| {key.to_sym => value} }.first # => {:masters=>[{:address=>"127.0.0.1", :port=>"6379", :quorum=>2, :down_after_milliseconds=>30000, :unixsocket=>"/tmp/redis-sentinel.sock", :unixsocketperm=>"777", :can_failover=>"yes", :parallel_syncs=>1, :failover_timeout=>900000}]} ... I think that is the equivalent
<volty>
Gnut: you have to check if the pair two is an array, and if so iterate over it calling recursively if the element is a hash
aegis3121 has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
<Papierkorb>
acidrainfall: have a method, which does str.match and matches for stuff like {0..1}. catch the str before and after, and the a..b stuff too. Interpret the a..b stuff and map it to an array. then, to the same recursively until the regex no longer matches
chouhoul_ has quit [Remote host closed the connection]
peterevjan has joined #ruby
dionysus69 has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<acidrainfall>
:|
<Papierkorb>
the interpet phase is pretty much (lo..hi).map{|cur| "#{before}#{cur}#{after}" }
<acidrainfall>
Yeah I think I'll rethink this
dionysus69 has joined #ruby
<acidrainfall>
Maybe I should have a list of hosts already configured
skade has quit [Quit: Computer has gone to sleep.]
Puffball has joined #ruby
<Papierkorb>
Or allow multiple arguments if it's a CLI tool
celly_ has joined #ruby
xxmphp has quit [Remote host closed the connection]
firstdayonthejob has joined #ruby
adgtl has quit [Remote host closed the connection]
Rodya_ has quit [Remote host closed the connection]
celly has quit [Ping timeout: 240 seconds]
<acidrainfall>
Multiple arguments isn't a problem for me
Meow-J has quit [Quit: Connection closed for inactivity]
dmolina has quit [Quit: Leaving.]
<acidrainfall>
It's that I don't want to copypasta 20 hosts every time I run this
craysiii has joined #ruby
Puffball has quit [Remote host closed the connection]
<eam>
and then embed that syntax into ruby, javascript, w/e so all your cli tools and webapps can speak it
jgt3 has joined #ruby
uri___ has joined #ruby
KensoDev has quit []
zeroDivisible has quit [Ping timeout: 256 seconds]
sftrabbit has joined #ruby
<acidrainfall>
eam: wow
KensoDev has joined #ruby
StinkySteve has joined #ruby
nrsk_ has joined #ruby
<volty>
exp = /\((\d+)\.\.(\d+)\)/; r = Range.new *(s.scan(exp)).flatten.map(&:to_i); ss = s.split(exp); r.map { |i| "#{ss[0]}#{"%02d" % i }#{ss[-1]}"}; ;
Deck` has joined #ruby
KensoDev has quit [Client Quit]
TomyLobo has joined #ruby
KensoDev has joined #ruby
ocbtec has quit [Ping timeout: 264 seconds]
uri_ has quit [Ping timeout: 264 seconds]
Meow-J has joined #ruby
nrsk has quit [Ping timeout: 240 seconds]
ocbtec has joined #ruby
<volty>
>> s = "boom-(1..20).fr"; exp = /\((\d+)\.\.(\d+)\)/; r = Range.new *(s.scan(exp)).flatten.map(&:to_i); ss = s.split(exp); r.map { |i| "#{ss[0]}#{"%02d" % i }#{ss[-1]}"}; ;
<ruby[bot]>
volty: # => ["boom-01.fr", "boom-02.fr", "boom-03.fr", "boom-04.fr", "boom-05.fr", "boom-06.fr", "boom-07.fr", " ...check link for more (https://eval.in/513311)
<eam>
acidrainfall: so like, here's an example from using mssh, which uses the range library to accept sets of hosts to work on and also to compress the output https://gist.github.com/eam/545dc3e0a185259158b1
<eam>
mssh is another rubygem
troulouliou_div2 has quit [Quit: Leaving]
dfockler has joined #ruby
<eam>
what I'm doing there is ssh'ing to an arbitrary list of hosts (defined by the range expression) and bucketing each one based on a hash of the /etc/passwd file -- to find out that two of my hosts don't have a matching /etc/passwd file and probably need to be fixed
<volty>
Ox0dea: yap. my first idea. but breaked to allow him to check for the bounds (let's suppose the user types 1..100000000000000000000000000000) :P
<volty>
nice piece anyway, by a master
<Ox0dea>
s/master/troll/
<Ox0dea>
Unbracketed interpolation and everything!
<volty>
ahah
karapetyan has joined #ruby
<pipework>
Ox0dea: you are into some weird stuff, bud.
zacstewa_ has quit [Ping timeout: 250 seconds]
KensoDev_ has joined #ruby
dionysus69 has quit [Ping timeout: 245 seconds]
Xeago has quit [Remote host closed the connection]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has quit [Remote host closed the connection]
uri_ has quit [Client Quit]
uri_ has joined #ruby
uri_ has quit [Read error: Connection reset by peer]
arup_r has joined #ruby
kirun has joined #ruby
harly has quit [Ping timeout: 272 seconds]
askhat has quit [Client Quit]
<arup_r>
When you have an array ["Monday", "Tuesday", "Wednesday"] and how do you create [{:name=>"Monday"}, {:name=>"Tuesday"}, {:name=>"Wednesday"}] ? I did like a.map { |day| {name: day} } .. amy more clever way ?
<crime>
that block would need to match five of them
<john2496>
anyone know how to execute a method defined in a string, and pass arguments to that method? eg. method_name = "SomeClass.the_method"; method_name.call("some argument");
<Ox0dea>
Someone's not paying attention.
sivoais has quit [Ping timeout: 260 seconds]
<benlieb>
I'm trying to get a hash of specific attributes that a rails model has. It feels verbose. Is there a better/native way to do this? attribs = {}; [:name, :email, :message, :message_type].each{|attr| attribs[attr] = s[attr]}
<crime>
i just hate regex. no need to use any more than necessary
minimalism has joined #ruby
davedev24 has quit [Ping timeout: 250 seconds]
davedev24 has joined #ruby
doublemalt_ has joined #ruby
sivoais has joined #ruby
Macaveli has joined #ruby
<Ox0dea>
john2496: Sounds dangerous.
Macaveli has quit [Client Quit]
<Ox0dea>
You want #const_get and #public_send, but not really.
at46_ has quit [Remote host closed the connection]
<YankNYC>
Ox0dea can you help me refactor one more pls?
<john2496>
Ox0dea: yea, it's a bit wonky - I'm trying to create a generic ActiveJob
<john2496>
Ox0dea: Awesome, thank you
<Ox0dea>
john2496: Godspeed. :)
yfeldblum has joined #ruby
hosttor has joined #ruby
e4xit has joined #ruby
jbrhbr has quit [Quit: Leaving.]
celly_ has quit [Remote host closed the connection]
DoubleMalt has quit [Ping timeout: 256 seconds]
webopsx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mdw has quit [Quit: Sleeping Zzzzz]
ta_ has joined #ruby
hahuang65 has joined #ruby
dlitvak has quit [Ping timeout: 240 seconds]
ta has quit [Ping timeout: 240 seconds]
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jbrhbr has joined #ruby
newbie has joined #ruby
newbie is now known as Guest35482
tomphp has joined #ruby
TomyLobo has quit [Disconnected by services]
TomyLobo has joined #ruby
ElFerna has joined #ruby
aegis3121 has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
tjohnson has quit [Ping timeout: 240 seconds]
zerowaitstate has quit [Ping timeout: 240 seconds]
agentmeerkat has quit [Ping timeout: 240 seconds]
Lloyd has quit [Ping timeout: 240 seconds]
yqt has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 260 seconds]
aegis3121 has joined #ruby
tjohnson has joined #ruby
zipkid has quit [Ping timeout: 240 seconds]
Lloyd has joined #ruby
zerowaitstate has joined #ruby
IanMalcolm has quit [Max SendQ exceeded]
fmcgeough has quit [Quit: fmcgeough]
IanMalcolm has joined #ruby
dlitvak has joined #ruby
Aviio has joined #ruby
zipkid has joined #ruby
IanMalcolm has quit [Max SendQ exceeded]
jxs_ has quit [Remote host closed the connection]
elifoster has joined #ruby
IanMalcolm has joined #ruby
skweek has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
exadeci has joined #ruby
Felix444 has quit [Ping timeout: 245 seconds]
urbanmonk has quit [Quit: urbanmonk]
karapetyan has quit [Ping timeout: 240 seconds]
<YankNYC>
here is the expression that worked \b\A[A-Z].+[!?.]$
<YankNYC>
Thank you for the help today
gambl0re has quit [Ping timeout: 250 seconds]
pluralism has quit [Quit: Leaving]
newbie22 has joined #ruby
newbie22 has quit [Max SendQ exceeded]
dlitvak_ has joined #ruby
newbie22 has joined #ruby
skweek has quit [Read error: Connection reset by peer]
gambl0re has joined #ruby
skweek has joined #ruby
<Aviio>
Hi all
duckpuppy has quit [Ping timeout: 276 seconds]
wldcordeiro has joined #ruby
dlitvak has quit [Ping timeout: 245 seconds]
Rickmasta has joined #ruby
<apeiros>
\b\A[A-Z] seems to have redundancy. \b is probably irrelevant there.
trinaldi has joined #ruby
<apeiros>
hi Aviio
Timba-as has joined #ruby
celly has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
agentmeerkat has joined #ruby
ElFerna has quit [Ping timeout: 250 seconds]
whathappens has quit [Remote host closed the connection]
<Ox0dea>
I feel like /$^/ should raise Errno::EDOOFUS.
ElFerna has joined #ruby
Rodya_ has quit [Remote host closed the connection]
skweek has quit [Remote host closed the connection]
<YankNYC>
This is the resulting code i'll try without \b but there might be an edge case. !!text.match(/\b\A[A-Z].+[!?.]$/)
Felix444 has joined #ruby
<YankNYC>
is that an expensive way of doing it? because isn't it creating a match object
grn_ has quit []
skweek has joined #ruby
<YankNYC>
@apeiros good call ty
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
It's more expensive than #=~, which just returns an index or `nil`.
<Mon_Ouie>
You can just use =~ instead of match if you only care about whether or not the string is matched (I don't know if it's actually slower)
Rodya_ has joined #ruby
<YankNYC>
Mon_Ouie merci', I tried that but maybe i'm grouping it wrong it's not passing
arup_r has quit []
<YankNYC>
got it
dlitvak has joined #ruby
agentmeerkat has quit [Ping timeout: 240 seconds]
<apeiros>
Ox0dea: "it looks like you're trying to anchor your regex, do you want me to help you with it?"
platzhirsch has joined #ruby
<YankNYC>
IRC, best place to find smart people
<YankNYC>
!!text.match(/\b\A[A-Z].+[!?.]$/)
<apeiros>
text !~ /regex/
<YankNYC>
!!(text =~ /\A[A-Z].+[!?.]$/)
<bougyman>
FFFF/23F
<YankNYC>
srry
ElFerna has quit [Ping timeout: 248 seconds]
despai has joined #ruby
kalopsian has quit [Ping timeout: 260 seconds]
<Ox0dea>
bougyman: It's prime!
vagnerd_2 has quit [Quit: Leaving]
<bougyman>
don't mention "Prime", please.
* bougyman
in a bit of amazon hell atm
<eam>
they're doing ATMs now?
dlitvak_ has quit [Ping timeout: 276 seconds]
<bougyman>
I wouldn't be surprised.
last_staff has quit [Quit: last_staff]
skweek has quit [Ping timeout: 276 seconds]
peterevjan has joined #ruby
stevemackinnon has joined #ruby
<Ox0dea>
eam: They're doing bookstores.
<eam>
you do what you are
skweek has joined #ruby
agent_white has quit [Quit: brb]
peterevjan has quit [Remote host closed the connection]
zambini has joined #ruby
roshanavand has joined #ruby
pawnbox has joined #ruby
adac has quit [Ping timeout: 264 seconds]
x77686d has quit [Quit: x77686d]
lemur has joined #ruby
kalopsian has joined #ruby
JDiPierro has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 240 seconds]
ocbtec has quit [Quit: leaving]
pawnbox has quit [Ping timeout: 240 seconds]
lemur has quit [Ping timeout: 260 seconds]
<shevy>
you eat what you do
ESpiney has quit [Ping timeout: 276 seconds]
<eam>
you do what you eat!
B1n4r10 has quit [Ping timeout: 240 seconds]
flori has quit [Remote host closed the connection]
sandstrom has quit [Quit: My computer has gone to sleep.]
kirillzh has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
<Ox0dea>
You eat what you are.
idefine_ has quit [Remote host closed the connection]
VeryBewitching has quit [Quit: Konversation terminated!]
<hxegon>
glanced over here and thought I was looking at markov chain output :D
<shevy>
haha
idefine has joined #ruby
<Ox0dea>
"Thinking meat! You're asking me to believe in thinking meat!"
<eam>
hxegon: I mean, you may well be (see earlier about how we're robots)
despai_ has joined #ruby
<Ox0dea>
Meaty robots!
<eam>
mobots
<Ox0dea>
Meat moot.
roshanavand has joined #ruby
<eam>
>> require 'meat' rescue 'sillycon is fine too'
<hxegon>
Some choice output after pointing it at the navy seal copypasta: "you could have over the face of which has never been seen before on al-quadea, and your ip is being traced right now you're paying the top of which has never been seen before on this earth, mark my secret network of the fuck did you could have access to its full extent to me over seven hundred ways, and i will use it to its full extent to"...
nerium has quit [Quit: nerium]
x77686d has joined #ruby
mary5030_ has quit [Remote host closed the connection]
<shevy>
my secret network of the fuck?!
<Ox0dea>
So good.
dlitvak has quit [Remote host closed the connection]
<hxegon>
'you could have access to its full extent, to me over 700 ways" *blushes*
celly has quit [Remote host closed the connection]
despai has quit [Ping timeout: 260 seconds]
<Ox0dea>
Hey, what's the cleanest way to get a mutable "view" into a String?
<eam>
mutable view howso
<kaleido>
for the noobs, define mutable
<Ox0dea>
`str[3, 3].upcase!` != `str[3, 3] = str[3, 3].upcase`, and it's making me 0x5adface.
<hxegon>
despai_ sorry, we get rails people a lot :P
travisthenavi has joined #ruby
<despai_>
:?
<despai_>
no, ActiveRecord is an ORM that you can use in rails or in any other platform
<Mon_Ouie>
I don't know about ActiveRecord specifically, but why not just put your model classes in a gem, on which your three applications can depend?
travisthenavi has quit [Client Quit]
travisthenavi has joined #ruby
travisthenavi has quit [Client Quit]
yasha0x80 has joined #ruby
ramfjord has joined #ruby
JDiPierro has quit [Ping timeout: 260 seconds]
travisthenavi has joined #ruby
travisthenavi has quit [Client Quit]
Timba-as has joined #ruby
travisthenavi has joined #ruby
travisthenavi has quit [Client Quit]
hplar has joined #ruby
travisthenavi has joined #ruby
ruby-lang352 has joined #ruby
travisthenavi has quit [Client Quit]
roshanavand has joined #ruby
travisthenavi has joined #ruby
solocshaw has joined #ruby
Timba-as has quit [Client Quit]
peterevjan has quit [Remote host closed the connection]
eo has joined #ruby
Mon_Ouie has quit [Ping timeout: 248 seconds]
My_Hearing has joined #ruby
travisthenavi has quit [Client Quit]
<despai_>
good idea
travisthenavi has joined #ruby
<despai_>
lets try
travisthenavi has quit [Read error: Connection reset by peer]
<shevy>
is .chars faster than .split(//) on a string?
travisthenavi has joined #ruby
mwlang has joined #ruby
travisthenavi has quit [Client Quit]
eo has quit [Client Quit]
skweek has quit [Ping timeout: 250 seconds]
travisthenavi has joined #ruby
juddey has joined #ruby
djbkd has joined #ruby
travisthenavi has quit [Client Quit]
dlitvak has joined #ruby
travisthenavi has joined #ruby
roshanavand has quit [Ping timeout: 245 seconds]
rodfersou has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Deck` has quit [Ping timeout: 240 seconds]
mhoungbo has quit [Ping timeout: 272 seconds]
freerobby has quit [Quit: Leaving.]
<Aviio>
huh...
<Aviio>
assert_output(/There is 1 site defined in the sites config/) {@sut.count_sites(sites_hash)}
karapetyan has joined #ruby
<Aviio>
why does this come across as 2 assertions?
dlitvak has quit [Ping timeout: 240 seconds]
ruby-lang352 has quit [Quit: Page closed]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has quit [Ping timeout: 240 seconds]
william3 has joined #ruby
at46 has joined #ruby
kies^ has quit [Ping timeout: 248 seconds]
<Ox0dea>
shevy: Of course.
<shevy>
yay!
<shevy>
I shall purge all instances of .split(//)
Zai00 has quit [Ping timeout: 260 seconds]
<Ox0dea>
Yay!
podman has quit [Quit: Connection closed for inactivity]
<Ox0dea>
Aviio: You're asserting that it does in fact produce output and that the output matches your expectation.
<Aviio>
ahh ok
<Aviio>
Ox0dea: thanks
CloCkWeRX has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
william3 has quit [Remote host closed the connection]
<Ox0dea>
Aviio: Sure thing. :)
william3 has joined #ruby
wolffles has joined #ruby
Abrin2 has joined #ruby
at46 has quit [Ping timeout: 252 seconds]
at46 has joined #ruby
Abrin has quit [Ping timeout: 240 seconds]
icbm has quit [Quit: Computer sleeping]
at46 has quit [Remote host closed the connection]
mhoungbo has joined #ruby
peterevjan has joined #ruby
mhoungbo has quit [Read error: Connection reset by peer]
sanguisdex has joined #ruby
despai_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hobodave has quit [Ping timeout: 256 seconds]
Zai00 has joined #ruby
<wolffles>
trying to change text in a file the text are certain numbers need to add 1000 to numbers