<vasilakisfil>
hi! Any idea why Regexp.escape('$') returns '\\$\ and not just '\$' ? The former escapes \ (which didn't appear in the initial string anyway) and not $, right ?
<vasilakisfil>
sorry I meant it returns '\\$' not '\\$\
<NL3limin4t0r>
vasilakisfil: If it's in double quotes (which return values by Ruby always are) the backslash should be escaped. Resulting in "\\$" this is the same as '\$'.
<dionysus69>
they return same thing but dunno how they would act in various situations
amelliaa has quit [Quit: -]
<NL3limin4t0r>
vasilakisfil: Double quotes allow you to do things like "\n" and other special chars while single quotes are string literals. Meaning '\n' is not a newline character but a backslash and an 'n', The same characters in a double quoted string would be a newline character.
<brianj>
"john@ggo.se " I have an issue with this string.. You probably cant see it cause of client has removed it, but there seams to be a non breaking space..but I cant seam to get rid of it. I basicly just want to remove all charecters that arent part of the email
Milos has joined #ruby
ropeney has joined #ruby
<brianj>
any ideas?
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
<brianj>
If I convert it to json it says: "john@ggo.se \""
cschneid_ has quit [Ping timeout: 265 seconds]
cschneid_ has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
Mahoon has joined #ruby
bmurt has joined #ruby
cpruitt has joined #ruby
depesz has quit [Quit: WeeChat 2.1]
Mahoon has quit [Quit: WeeChat 1.6]
Cavallari1 has joined #ruby
Cavallari has quit [Ping timeout: 264 seconds]
Cavallari1 is now known as Cavallari
blackmesa has joined #ruby
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ruby[bot]>
dminuoso: # => /tmp/execpad-bb74a785b8c9/source-bb74a785b8c9:2: syntax error, unexpected ')' ...check link for more (https://eval.in/997174)
<ruby[bot]>
dminuoso: # => /tmp/execpad-25c651954631/source-25c651954631:2: syntax error, unexpected ')' ...check link for more (https://eval.in/997175)
<apeiros>
yes, of course, because :something is never nil or false
<apeiros>
(:something || … ) will *always* evaluate to :something
k0mpa has joined #ruby
* dminuoso
starts pondering about the most hilarious way to proof apeiros wrong
* dminuoso
thinks about set_trace_func
* dminuoso
starts to get creative
* dminuoso
just became bored and goes back to haskell things
<dionysus69>
case case_var doesn't match :something, so it should go for next val no? why does it work with commas then instead of ||
<apeiros>
dminuoso: I now wonder how much time you'll spend and how far you'll go. I don't think a custom compiled ruby is out of the question with you :-p
<dminuoso>
apeiros: No no! The rules of engagement are that I have to demontrate this with ruby[bot]
<dminuoso>
So..
<dminuoso>
:P
<tobiasvl>
dionysus69: it does match (:something || … ) though
<apeiros>
dionysus69: as said, `case expression when condition` is evaluated as `condition === expression?
<apeiros>
dionysus69: as said, `case expression when condition` is evaluated as `condition === expression`
rivalomega has quit [Ping timeout: 264 seconds]
<apeiros>
and when your condition is (a || b || c) then that is evaluated first
<apeiros>
and since (:something || b || c) *always* evaluates to :something, that's the same as just `:something === expression`
<apeiros>
if you separate your conditions by ",", it will evaluate against each condition separately.
<dionysus69>
I dont understand, :something is obviously not nil but i see it has to match the case var, that's the confusing part
<dminuoso>
asm>> (:foo || puts)
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/997182
cpruitt has quit []
<dminuoso>
Argh!
<apeiros>
i.e. with (a || b), there is no "next value", (a || b) is *one* value
TinkerT has quit [Read error: Connection reset by peer]
<havenwood>
dionysus69: `2` is truthy I ^
ta_ has quit [Remote host closed the connection]
<tobiasvl>
parentheses are used to force an evaluation order, without them standard precedence rules apply
<dionysus69>
ok I clearly got it now :D 3 2 aren't nil
TinkerT has joined #ruby
<dionysus69>
so even though I didn't use parenthesis in when statement, it defaulted to it, you confirm it?
<dionysus69>
still sounds like a rare ruby surprise, back to square 1 :D
<dminuoso>
K = -> a, b { b }.curry; S = -> a, b, c { a[c[(b[c])] }.curry
<dminuoso>
Forget everything else.
<dminuoso>
Write all your programs in SK combinator calculus.
* dminuoso
pokes havenwood
<dionysus69>
I actually don't understand what that line does dminuoso :D
<dminuoso>
K = -> a, b { b }.curry; S = -> a, b, c { a[c][b[c]] }.curry
<dminuoso>
Sorry my bad!
<dminuoso>
Those are just functions!
<dminuoso>
You can write any turing program with these two functions and nothing else.
<dminuoso>
You dont need strings, lists, integers, or anything else.
cschneid_ has joined #ruby
<tobiasvl>
dionysus69: yes, in a way, the case condition is "wrapped" in parentheses before comparison. in the way that it's evaluated as an expression, and not actually a text macro that's substituted before evaluation. I guess you can put it that way
karapetyan has quit [Remote host closed the connection]
Puffball has joined #ruby
<dionysus69>
this is weird too, this actually returns
<brianj>
ellcs: strip didnt work. I had to use gsub(/[\u200B-\u200D\uFEFF]/, '')
chouhoulis has joined #ruby
stormpack has quit [Ping timeout: 255 seconds]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
sepp2k has joined #ruby
shakes has quit [Quit: Leaving]
jyaworski has joined #ruby
ropeney has quit [Remote host closed the connection]
jyaworski has quit [Ping timeout: 248 seconds]
jeffreylevesque has joined #ruby
karapetyan has quit [Remote host closed the connection]
coderphive has joined #ruby
reber has quit [Remote host closed the connection]
suukim has joined #ruby
grilix has joined #ruby
<TomyWork>
say, does ruby 1.8.7 (don't hit me) support any kind of syntactic sugar for passing hashes to functions? it doesn't support "func(key: value)"
cyberg has joined #ruby
* apeiros
hits TomyWork
<apeiros>
TomyWork: iirc last hash arg didn't need {}. but no `foo:` syntax back then, only hash-rockets
Cavallari has quit [Quit: Cavallari]
<TomyWork>
ah
<TomyWork>
i guess i'll just throw in the extra braces to be safe ^^
cschneid_ has joined #ruby
<TomyWork>
convert a puppet module to ruby 1.8.7 ^^
<TomyWork>
converting*
<apeiros>
if you have a 1.8.7, you can just try
clemens3_ has quit [Ping timeout: 268 seconds]
rivalomega has joined #ruby
<TomyWork>
well i dont know what intermediate syntactic sugar exists, i started at 1.9-ish
<TomyWork>
also, done :)
<TomyWork>
it compiles, ship it
jyaworski has joined #ruby
alfiemax_ has joined #ruby
<TomyWork>
looks pretty in "git diff --color-words=."
alfiemax has quit [Ping timeout: 260 seconds]
schneider- has joined #ruby
schneider has quit [Read error: Connection reset by peer]
govg has quit [Ping timeout: 260 seconds]
GodFather_ has quit [Quit: Ex-Chat]
govg has joined #ruby
GodFather_ has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coderphive has quit [Quit: coderphive]
banisterfiend has joined #ruby
tomphp has joined #ruby
govg has quit [Ping timeout: 276 seconds]
schneider- has quit [Ping timeout: 256 seconds]
jyaworski has quit [Ping timeout: 265 seconds]
Nick-S has joined #ruby
Asher has joined #ruby
schneider- has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
ellcs has quit [Remote host closed the connection]
Asher has quit [Ping timeout: 268 seconds]
alfiemax has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
<TomyWork>
Error: undefined method `content' for #<Array:0x7f6741b42a80> <-- any idea what ruby 1.8.7 complains about here? looked at 2.3.1's docs, there's no #content in Array or Enumerable (or Object, for that matter)
conta has quit [Ping timeout: 248 seconds]
<TomyWork>
none in BasicObject or Kernel either
<TomyWork>
also, that module doesn't contain the word "content"
<apeiros>
Array#content is not a ruby method
<apeiros>
so if your code uses that, it has to be added from elsewhere
<TomyWork>
ah so it could be puppet-specific
<TomyWork>
still doesnt explain why i cant find it :)
<apeiros>
you can always ask ruby
<TomyWork>
i'll see if i can hack in a stack trace somehow
<apeiros>
&ri Method#source_location
<kapil___>
I have this string: `"FOREIGN KEY (tax_type_id) REFERENCES ee_guru12.tax_types(id)"`
<kapil___>
i want tax_type_id from it with regex
<TomyWork>
oh well, i'd have to inject pry into puppet first
<apeiros>
hrm, derpy not around?
<TomyWork>
derpy, the less bright cousin of pry?
<apeiros>
kapil___: what have you tried?
schneider- has quit [Ping timeout: 255 seconds]
<apeiros>
TomyWork: derpy reacts on &ri and links to the docs
<TomyWork>
oh it's a bot
<kapil___>
apeiros: i know not much regex
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<TomyWork>
kapil___ best not to parse SQL with regexes :)
<apeiros>
kapil___: ok, time to learn it then? I love to help, but I don't love to be used as "please do it for me (and for free)"
herbmillerjr has quit [Quit: Konversation terminated!]
<kapil___>
apeiros: ok do u suggest good guide for me
<TomyWork>
SQL is kind of a context-free language, regular expressions are less powerful than context-free languages
<kapil___>
TomyWork: from sql i am not getting that column name . so i have to do regex
<kapil___>
apeiros: thanks a lot
<TomyWork>
kapil___ what generates those SQLs for you?
<kapil___>
"select pg_get_constraintdef(2125957)"
<TomyWork>
kapil___ yeah, so you're doing it backwards
<kapil___>
yes
clemens3_ has joined #ruby
<TomyWork>
kapil___ i dont know the exact table, but i'm 99% sure you can just select something else and it'll get you the constraint's components
<TomyWork>
ask #postgresql about how to get a foreign key constraint's foreign key column
<kapil___>
TomyWork: thanks. i asked but they give me this function
<TomyWork>
or whatever that is up there, you didnt paste the entire statement
<kapil___>
ok thanks
<apeiros>
TomyWork: it actually might be
<apeiros>
pg doesn't require a `from` clause if it's a function
<apeiros>
only oracle has that weird 'from dual' BS
<TomyWork>
<MatheusOl> kapil___: If you want the definition, just use pg_get_constraintdef(c.oid)
<TomyWork>
kapil___ there is an "if" in that piece of advice
<TomyWork>
you did not evaluate the if condition before executing the if body
<TomyWork>
apeiros i meant the first one
<TomyWork>
apeiros he posted half a foreign key definition
<TomyWork>
i think
<apeiros>
oh, the output of the function?
<kapil___>
thanks i not want defination i asked to postgresql hope someone answer
<kapil___>
apeiros: yes
<TomyWork>
i want royalties
Klumben has joined #ruby
jyaworski has joined #ruby
<TomyWork>
apeiros i think i know what may be going on here... there are other classes that support the #content method. something expects one of them, but gets an array instead
<TomyWork>
fun to debug without a stack trace
orbyt_ has joined #ruby
<TomyWork>
but tbh i dont know what those other classes may be
schneider- has joined #ruby
orbyt_ has quit [Client Quit]
<TomyWork>
anyway, i gotta go, i'll pick this up next time. thanks for the help, apeiros
jyaworski has quit [Ping timeout: 256 seconds]
sysvalve has quit [Quit: Leaving]
venmx has quit [Ping timeout: 248 seconds]
alt155 has joined #ruby
marxarelli has joined #ruby
John_Ivan has quit [Ping timeout: 256 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kapil___>
TomyWork: postgresql channel answered my question thanks
banisterfiend has joined #ruby
schneider- has quit [Ping timeout: 264 seconds]
venmx has joined #ruby
<TomyWork>
neat
TomyWork has quit [Remote host closed the connection]
grilix has quit [Ping timeout: 264 seconds]
grilix has joined #ruby
[Butch] has joined #ruby
mr_foto has joined #ruby
baweaver_away is now known as baweaver
minimalism has joined #ruby
Mike11 has joined #ruby
minimalism has quit [Client Quit]
minimalism has joined #ruby
nitric has joined #ruby
troys has joined #ruby
amar has quit [Ping timeout: 264 seconds]
sepp2k has quit [Read error: Connection reset by peer]
Psybur has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
sauvin has joined #ruby
jcarl43 has joined #ruby
sauvin_ has joined #ruby
drale2k_ has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
sauvin has quit [Ping timeout: 264 seconds]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
conta has joined #ruby
alfiemax has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nitric has quit [Ping timeout: 276 seconds]
SeepingN has joined #ruby
x77686d has joined #ruby
nitric has joined #ruby
guille-moe has quit [Ping timeout: 248 seconds]
ta_ has joined #ruby
Asher has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
amar has joined #ruby
Asher has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
Mike11 has quit [Ping timeout: 240 seconds]
venmx has quit [Remote host closed the connection]
venmx has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
Mondongo has joined #ruby
eckhardt_ has joined #ruby
banisterfiend has joined #ruby
Asher has joined #ruby
coderphive has joined #ruby
nima_m has joined #ruby
cliluw has quit [Ping timeout: 248 seconds]
cliluw has joined #ruby
nima_m has quit [Remote host closed the connection]
anisha has joined #ruby
nima_m has joined #ruby
coderphive has quit [Quit: coderphive]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
nima_m has quit [Read error: Connection reset by peer]
nima_m has joined #ruby
anisha has quit [Ping timeout: 264 seconds]
coderphive has joined #ruby
samort7 has joined #ruby
jamiejackson has joined #ruby
suukim has quit [Quit: Konversation terminated!]
venmx has quit [Ping timeout: 264 seconds]
alfiemax has quit [Remote host closed the connection]
stormpack_ has quit [Quit: Leaving]
alfiemax has joined #ruby
nima_m has quit [Ping timeout: 264 seconds]
alfiemax has quit [Read error: Connection reset by peer]
nitric_ has joined #ruby
alfiemax has joined #ruby
nitric has quit [Ping timeout: 256 seconds]
houhoulis has joined #ruby
jyaworski has joined #ruby
ramfjord has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Nick-S has quit [Quit: Connection closed for inactivity]
madrax has joined #ruby
nima_m has joined #ruby
madrax has quit [Client Quit]
conta has quit [Ping timeout: 240 seconds]
ccrow has joined #ruby
nima_m has quit [Read error: Connection reset by peer]
nhh^ has quit []
emph^ has joined #ruby
jyaworski has quit [Ping timeout: 248 seconds]
nrk has quit [Quit: WeeChat 1.4]
bathtub_shark has quit [Quit: WeeChat 2.2-dev]
sameerynho has joined #ruby
nickjj has quit [Read error: Connection reset by peer]
Zarthus has quit [Ping timeout: 276 seconds]
reber has joined #ruby
anisha has joined #ruby
nicoulaj has quit [Quit: quit]
jyaworski has joined #ruby
nicoulaj has joined #ruby
Zarthus has joined #ruby
anisha has quit [Ping timeout: 276 seconds]
k0mpa has quit [Ping timeout: 255 seconds]
krawchyk has joined #ruby
chouhoulis has joined #ruby
houhoulis has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Closing time!]
sauvin_ has quit [Remote host closed the connection]
bathtub_shark has joined #ruby
x77686d has quit [Quit: x77686d]
dionysus69 has joined #ruby
banisterfiend has joined #ruby
FrostCandy has joined #ruby
anisha has joined #ruby
stairmast0r has quit [Quit: bye]
GodFather_ has joined #ruby
pablo_ has joined #ruby
silviu has joined #ruby
silviu has quit [Client Quit]
blackmesa has joined #ruby
hanmac has quit [Ping timeout: 240 seconds]
alfiemax_ has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
jyaworski has quit [Ping timeout: 264 seconds]
stairmast0r has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
hanmac has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
sarmiena_ has joined #ruby
ccrow has quit [Quit: Ex-Chat]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta_ has quit [Remote host closed the connection]
krawchyk has quit [Quit: krawchyk]
alfiemax has joined #ruby
jenrzzz_ has joined #ruby
alfiemax_ has quit [Ping timeout: 248 seconds]
RougeR has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
mroutis_ has joined #ruby
krawchyk has joined #ruby
<sarmiena_>
i’ve had a ruby install on production machine for a while using SSL via httparty and such successfully. all of a sudden i’m getting “OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed” for a service we’ve had for a while
<sarmiena_>
is it possible that they updated certs using a different vendor & my ca_certs are out of date?
omninonsense has quit [Read error: Connection reset by peer]
<SeepingN>
sure why not
ramfjord has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
<sarmiena_>
ok. so i’m using rvm… used apt-get (ubuntu 14.04) to update openssl. then reinstalled ruby via ‘rvm install’, but still nothing working
mroutis has quit [Ping timeout: 276 seconds]
JoL1hAHN has joined #ruby
<miah>
have you verified the certificates are valid and non-expired?
<SeepingN>
...
<SeepingN>
next step should NOT be "I reinstalled the operating system"
<sarmiena_>
SeepingN: do you have any ideas other than droll quips? sorry, but it’s just adding noise
<sarmiena_>
miah: ack that would be a good idea. it’s authorize.net, so figure it shouldn’t be the case, but i suppose you can never be too sure
<SeepingN>
ye: inspect the certificate that it's complaining about
<sarmiena_>
SeepingN: but for record i reinstalled ruby because it uses the headers of openssl during setup. so if i update openssl, i would have to rebuild ruby in order for it to use said headers
<SeepingN>
"certificate B: " ...? A secondary cert?
<sarmiena_>
i think certificate b refers to the remote certificate. i’ll check
bmurt has quit [Ping timeout: 264 seconds]
<miah>
ubuntu 14.04 is a Long Term Support release, I dont think updating openssl will do much more than patch security vulns, not going to change behavior/functionality
<miah>
well, it _shouldnt_ change behavior or functionality =)
<sarmiena_>
miah: i think it would also update security certificates so that you can utilize openssl, though
<sarmiena_>
since it’s LTS
jenrzzz_ has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
<miah>
maybe
<miah>
you can also just download the cacert.pem from curl.haxx.se and then run `update-ca-certificates`
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<sarmiena_>
miah: so update on the remote ssl certificate. looks up to date: just went to https://api.authorize.net/
<sarmiena_>
miah: thanks for the pointer. reading now
<miah>
good luck =)
<zxq2>
like in openssl ruby bindings for instance - is there a way aside from the documentation, which is pretty sparse in the case openssl, to determine which exceptions a method raises?
x77686d has joined #ruby
orbyt_ has joined #ruby
<miah>
look at the code?
ta_ has joined #ruby
ccrow has quit [Remote host closed the connection]