<elomatreb>
Well, the message is. The second argument is the stack trace IIRC?
<morfin>
well that's not trivial error )
<morfin>
i should handle somehow external error from API - i have code, message, details(optional), trace(full Java trace if trace generation turned on on server)
meinside has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
santhnu has joined #ruby
pagios has left #ruby ["Leaving"]
mikecmpbll has joined #ruby
jaruga has joined #ruby
marr has joined #ruby
pagios has joined #ruby
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
vee_ has joined #ruby
VladGh has joined #ruby
santhnu has quit [Quit: Leaving]
VladGh_ has quit [Ping timeout: 252 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
shime has joined #ruby
Burgestrand has quit [Client Quit]
santhnu has joined #ruby
Yzguy has quit [Quit: Zzz...]
<morfin>
weird
enterprisey has quit [Read error: Connection reset by peer]
Guest24 has joined #ruby
daumie has joined #ruby
ElDoggo has joined #ruby
<matthewd>
morfin: Build the exception then raise it
<matthewd>
`raise Foo, "msg"` is just a shortcut for `raise Foo.new("msg")`
ElDoggo has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
Silthias1 has quit [Read error: Connection reset by peer]
Silthias1 has joined #ruby
huyderman_ has quit [Ping timeout: 248 seconds]
<morfin>
hm interesting thing
<morfin>
raise ApiException, message, trace wrote Java backtrace into an exception
Silthias has quit [Ping timeout: 240 seconds]
huyderman has joined #ruby
teatime_ is now known as teatime
<morfin>
i thought it won't accept Java backtrace
cdg has joined #ruby
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ruby
phaul has quit [Ping timeout: 252 seconds]
cdg has quit [Ping timeout: 246 seconds]
bhaak_ is now known as bhaak
_aeris_ has quit [Ping timeout: 248 seconds]
MrSparkle has quit [Ping timeout: 252 seconds]
<jokke>
hey
<jokke>
is there any builtin way to do a select/reject + map for an enumerable? It's a fairly common pattern and one has to resort to lazy + to_a so that the enumerable is only iterated once
minimalism has quit [Ping timeout: 260 seconds]
<jokke>
so a relatively simple thing like getting a list of attributes from a list of objects where another attribute is a certain value becomes somewhat complicated
<rh10>
guys, which best place to start with ruby (and rails)? to understand it and supplementary technologies like gems, bundler? need a quick start point
<elomatreb>
flat_map doesn't flatten recursively, btw, which is useful for this
<jokke>
matthewd: it still doesn't quite feel rubyisqe
<matthewd>
It's not pretty... the problem is that anything as simple as map, but which allows this, is declaring some value un-"mappable"
imode has quit [Ping timeout: 252 seconds]
dionysus69 has joined #ruby
<jokke>
yeah
<matthewd>
I guess you could do it with: def select_map; result = []; token = Object.new; each {|el| x = yield(el, token); result << x unless token.eql?(x) }; result; end
<Cork>
if i have a private key and a cert anyone know how to best verify that they work together?
<elomatreb>
I like the flat_map solution, because you can still map everything by just wrapping it in an array once
santhnu has quit [Quit: Leaving]
<jokke>
matthewd: i think the problem is rather, that you'd basically need the ability to pass two blocks to methods
<jokke>
one for mapping and one for selecting
<matthewd>
Cork: The certificate contains the public key's fingerprint; you can derive the public key (and thus its fingerprint) from the private key
<Cork>
ah, intressing idea
<Cork>
i'll try that, thx
<teatime>
er, you can??
lxsameer has joined #ruby
<jokke>
what about my lazy approach? would that really iterate only once? (also in c?)
Defenestrate has joined #ruby
Defenestrate has joined #ruby
Defenestrate has quit [Changing host]
<elomatreb>
The lazy approach being the one with the separate select/map?
<elomatreb>
Because that one will iterate twice
<matthewd>
jokke: Technically yes, I think so... but it depends why you're trying to avoid the double iteration
<matthewd>
elomatreb: As in Enumerable#lazy
<jokke>
elomatreb: foos.lazy.select ...
<elomatreb>
Oh, I'm not paying attention today, sorry
<jokke>
elomatreb: no problem :)
<jokke>
matthewd: just to satisfy my curiosity
<Cork>
matthewd: sweet that worked perfectly thx!
ur5us has quit [Remote host closed the connection]
nobitanobi has joined #ruby
<matthewd>
jokke: My point is just that, without checking, I think the setup of the laziness could well outweigh the actual iteration -- depending on just how huge your [filtered] array is, of course
<jokke>
matthewd: yes, i'm aware
<jokke>
won't make sense for arrays of size 5
<jokke>
:D
goyox86_ has joined #ruby
goyox86_ has quit [Client Quit]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgestrand has joined #ruby
dhollinger has quit [Ping timeout: 252 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
skweek has quit [Remote host closed the connection]
vondruch has joined #ruby
skweek has joined #ruby
Alina-malina has quit [Ping timeout: 260 seconds]
synthroid has joined #ruby
Alina-malina has joined #ruby
Parraki_ has joined #ruby
bmurt has joined #ruby
hs366 has joined #ruby
Parraki has quit [Ping timeout: 240 seconds]
hndk has quit [Quit: Leaving]
Alina-malina has quit [Ping timeout: 255 seconds]
Alina-malina has joined #ruby
hyperreal has joined #ruby
griffindy has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
raynold has quit [Quit: Connection closed for inactivity]
truenito has joined #ruby
tcopeland has quit [Quit: tcopeland]
marr has joined #ruby
ruby-lang191 has joined #ruby
ruby-lang191 has quit [Client Quit]
mson has joined #ruby
stamina has quit [Quit: WeeChat 1.9.1]
bruno- has joined #ruby
balazs_ has joined #ruby
Ishido has quit [Remote host closed the connection]
Ishido has joined #ruby
jphase_ has joined #ruby
elsevero has quit [Ping timeout: 248 seconds]
sumobob has joined #ruby
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
jphase has quit [Ping timeout: 264 seconds]
milardovich has joined #ruby
elsevero has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg_ has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
duckpupp1 has joined #ruby
sumobob has quit [Ping timeout: 252 seconds]
paranoicsan has quit [Quit: paranoicsan]
kassav_ has quit [Read error: Connection reset by peer]
cdg has quit [Ping timeout: 240 seconds]
kassav_ has joined #ruby
harfangk has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
truenito1 has joined #ruby
truenito has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
sumobob has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 260 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FastJack_ has joined #ruby
FastJack has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
sumobob has quit [Ping timeout: 246 seconds]
sumobob has joined #ruby
truenito1 has quit [Ping timeout: 248 seconds]
DLSteve has joined #ruby
claudiuinberlin has joined #ruby
knight33 has joined #ruby
ramfjord has joined #ruby
sumobob has quit [Ping timeout: 255 seconds]
sysvalve has joined #ruby
waveprop has quit [Changing host]
waveprop has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has quit [Quit: vondruch]
bmurt has joined #ruby
tamouse__ has joined #ruby
holgerdanske has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
<holgerdanske>
Hello everyone. I've gone a bit maverick and decided to start cracking on developing a fairly rudimentary time clock system for my work. I'm still a pretty amateur rubyist at best and I was curious as to whether any of you had any sort of experience with developing software to handle remote logging (that would be sent to a secure spreadsheet on my boss' computer for him to handle payroll at the end of the weekly pay cycle).
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sumobob has joined #ruby
tamouse__ has quit [Ping timeout: 264 seconds]
vondruch has joined #ruby
bmurt has joined #ruby
<tobiasvl>
why reinvent the wheel? log locally and use filebeat/logstash?
snickers has quit [Ping timeout: 255 seconds]
r_rios has joined #ruby
paranoicsan has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
sumobob has quit [Ping timeout: 255 seconds]
vondruch has joined #ruby
mikecmpb_ has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
ta has quit [Remote host closed the connection]
rrios has joined #ruby
rrios has quit [Changing host]
rrios has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
r_rios has quit [Ping timeout: 252 seconds]
sumobob has joined #ruby
bruno- has joined #ruby
sumobob has quit [Ping timeout: 248 seconds]
shinnya has quit [Ping timeout: 248 seconds]
synthroid has quit [Remote host closed the connection]
<DaniG2k>
I am trying to upload images using Dropzone as part of a multi-step form that I am building with Vue.js and Rais 5.1, and I'm a bit confused as to how to set this up properly.
troys has joined #ruby
<DaniG2k>
I've outlined the problem more specifically with my code on SO
<DaniG2k>
if anyone could help out with that it would be greatly appreciated
truenito has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kassav__ has joined #ruby
samlisl_ has joined #ruby
oleo has joined #ruby
kassav_ has quit [Ping timeout: 260 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
mtkd has quit [Ping timeout: 246 seconds]
mtkd has joined #ruby
claudiuinberlin has joined #ruby
imode has joined #ruby
__Yiota has quit [Read error: Connection reset by peer]
tvw has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
s2013 has joined #ruby
FastJack has joined #ruby
cjs226 has joined #ruby
FastJack_ has quit [Read error: Connection reset by peer]
elsevero has quit [Quit: elsevero]
theunraveler has joined #ruby
mim1k has quit [Quit: Reconnecting]
mim1k has joined #ruby
shime has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
samlisl_ has quit [Ping timeout: 264 seconds]
John__ has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
knight33 has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
s2013 has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fmcgeough has joined #ruby
mson has joined #ruby
__Yiota has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
JD2020X has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rafadc has joined #ruby
milardovich has joined #ruby
polishdub has joined #ruby
nicholalexander has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
ElDoggo has joined #ruby
rafadc has quit [Client Quit]
nicholalexander has quit [Client Quit]
rafadc has joined #ruby
neachdainn has joined #ruby
<neachdainn>
Hey all, super new to Ruby. How do I make optional arguments? I'm trying to do something like Enumerable's find_index method, but I'm not sure how
<Papierkorb>
`def foo(bar = "I'm the default value"); p(bar); end`
<neachdainn>
Ok. So when the docs have `find_index(value)` and `find_index { block }`, the second one is just ignoring that the argument exists, right?
<neachdainn>
I.e., there isn't an overloaded method or anything
uZiel has joined #ruby
<adaedra>
It's the same method with an optional parameter
<Papierkorb>
No, it still has to be declared like `find_index(value = nil)` (or similar). Blocks do not make arguments optional
nobitanobi has quit []
<neachdainn>
Alright. Thank you!
<adaedra>
`find_index` is probably `def find_index(x = nil, &blk)`
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aufi has quit [Remote host closed the connection]
<neachdainn>
adaedra: What's the advantage of having &blk in the arguments list? Is it required to do things with the block other than `yield`?
<adaedra>
ah yes, it's not required if you just yield
<havenwood>
neachdainn: if you want to pass the block on, uncalled - then it's useful
<adaedra>
if you want to store it or pass it to another method, you need to specify it
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<holgerdanske>
tobiasvl: Can Filebeat handle outputting to quickbooks format?
conta has quit [Ping timeout: 240 seconds]
VeryBewitching has joined #ruby
DaniG2k has quit [Read error: Connection reset by peer]
DaniG2k has joined #ruby
synthroid has quit [Remote host closed the connection]
sylario has joined #ruby
troys is now known as troys_
TinkerTyper has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
paranoicsan has quit [Quit: paranoicsan]
cagomez has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
bmurt has joined #ruby
troys_ is now known as troys
csk has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<neachdainn>
So I'm looking at Enumerable's `inject` method. I'm assuming it's defined as `def inject(initial=nil, sym=nil, &blk)`?
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<neachdainn>
If so, in the `inject(sym) -> obj` form, is it really `initial=sym` and logic inside the function sorts it out?
<neachdainn>
Or does Ruby do something magical?
bmurt has joined #ruby
truenito1 has joined #ruby
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
truenito has quit [Ping timeout: 260 seconds]
ResidentBiscuit has joined #ruby
Serpent7776 has quit [Quit: Leaving]
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
truenito1 has quit [Ping timeout: 240 seconds]
<matthewd>
neachdainn: Yes, logic inside the function
<havenwood>
neachdainn: That's right for how you'd define it if it was written in Ruby, like it is in TruffleRuby or Rubinius. The CRuby implementation of that method is in C.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adaedra>
neachdainn: note that even if it's not how it's done here, optional arguments don't have to be last. `def foo(a = nil, b)` is perfectly valid, and `foo(0)` would set `b`.
waveprop has quit [Ping timeout: 248 seconds]
<neachdainn>
Sounds good! Thanks, all!
lagweezle_away is now known as lagweezle
waveprop has joined #ruby
paranoicsan has joined #ruby
lxsameer has quit [Ping timeout: 255 seconds]
mkali has quit [Quit: mkali]
csk has quit [Ping timeout: 255 seconds]
swills has quit [Remote host closed the connection]
swills has joined #ruby
gregf_ has quit [Quit: Page closed]
kassav_ has joined #ruby
Parraki_ has quit [Ping timeout: 252 seconds]
NicolasHov has joined #ruby
kassav__ has quit [Ping timeout: 264 seconds]
sumobob has joined #ruby
<Yxhuvud>
it is worth noting the symbol support for inject is older than Symbol#to_proc. I doubt very much it would have been added at all today.
<holgerdanske>
are any of you familiar with "filebeat"?
DaniG2k has quit [Ping timeout: 240 seconds]
cagomez has quit [Read error: Connection reset by peer]
kassav_ has quit [Quit: kassav_]
Beams has quit [Quit: .]
cagomez has joined #ruby
Rutix`away is now known as Rutix
krandi has quit [Remote host closed the connection]
John__ has quit [Read error: Connection reset by peer]
NicolasHov has quit [Quit: WeeChat 1.7]
conta has joined #ruby
Yzguy has joined #ruby
DaniG2k has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
bmurt has joined #ruby
gregf_ has joined #ruby
truenito has joined #ruby
orbyt_ has joined #ruby
synthroid has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
kies has quit [Ping timeout: 252 seconds]
paranoicsan has quit [Quit: paranoicsan]
mikecmpbll has quit [Quit: inabit. zz.]
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
truenito has quit [Ping timeout: 240 seconds]
Yzguy has quit [Quit: Zzz...]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Linux_Se7en has joined #ruby
moei has joined #ruby
aupadhye has joined #ruby
Linux_Se7en is now known as Heph
Heph is now known as hephinator
mostlybadfly has quit [Quit: Connection closed for inactivity]
bmurt has joined #ruby
hephinator has left #ruby ["Leaving"]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
anisha__ has quit [Quit: This computer has gone to sleep]
anisha__ has joined #ruby
phaul has quit [Ping timeout: 248 seconds]
<baweaver>
I think it was a carry over from 1.8 syntax before Symbol to_proc existed
<baweaver>
you remember that matthewd?
<Quentinius>
I have a string and its poem (its one of the challenges in tryruby) and the challenge is to just reverse it (that easy) but I wanted to reverse only words in the order it was so how should I do it? I was thinking about something like some separators but I am total noob and this is beyond my capbilities... :(
anisha__ has quit [Remote host closed the connection]
goyox86_ has quit [Remote host closed the connection]
workmad3 has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 246 seconds]
kn-928 has joined #ruby
sagax has joined #ruby
oetjenj has quit [Ping timeout: 240 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
ycyclist has joined #ruby
<ycyclist>
What regex switch after the slash do I use when $s =~ /^something.*somethingelse$/ should cover beginning of string to end, not just any given line on the string, to be true?
<ycyclist>
Perhaps I would better simply say: $s =~ /^thisstring has only this in it and no other lines$/
matcouto has joined #ruby
rafadc has joined #ruby
TomyLobo has quit [Ping timeout: 252 seconds]
rh10 has quit [Remote host closed the connection]
capstar has quit [Quit: Leaving]
banisterfiend has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
jrafanie has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<dachi>
hello. could anyone help me with mail attachments variable (undefined local variable or method) in helper for mailer and rspec? http://rubyfiddle.com/riddles/1424a/2
rrios has joined #ruby
rrios has quit [Changing host]
rrios has joined #ruby
<RickHull>
ycyclist: \A and \z
gigetoo has quit [Ping timeout: 240 seconds]
<RickHull>
ycyclist: instead of ^ and $
gigetoo has joined #ruby
<RickHull>
ycyclist: hm, there is also a multiline switch... trailing x maybe does what you want?
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sp4rrow has joined #ruby
Asher has joined #ruby
<RickHull>
dachi: hm, RubyFiddle won't show me the actual error, just says "SyntaxError:"
<RickHull>
but yes, where does `attachments` come from, on line 4?
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
<RickHull>
dachi: trailing x means, more or less, ignore newlines in the regex (not sure about newlines in the string-to-match)
sp4rrow_ has joined #ruby
<dachi>
SomeMailer.some_method.attachments
<RickHull>
dachi: oops, that last "trailing x" comment was meant for ycyclist
<RickHull>
dachi: it looks like whatever defines the attachments method hasn't been loaded yet
sp4rrow has quit [Ping timeout: 240 seconds]
gusrub has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DaniG2k has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
ycyclist has quit [Ping timeout: 260 seconds]
morfin has quit []
kapil___ has quit [Quit: Connection closed for inactivity]
shinnya has joined #ruby
ycyclist has joined #ruby
<ycyclist>
Looking at trailing x...
<RickHull>
ycyclist: i think you want \A and \z instead of ^ and $
<ycyclist>
That may be it. Trying...
LastWhisper____ has joined #ruby
pilne has joined #ruby
JD2020X has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ycyclist>
yes, \A and \z does it. Thanks guys.
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
bmurt has joined #ruby
<ycyclist>
Sorry about the slow response. This really helps.
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #ruby
Lighter has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
cd-rum has joined #ruby
Lighter_ has joined #ruby
bmurt has quit [Client Quit]
sp4rrow_ has quit [Quit: The Internet needs a break and I need a cookie]
Lighter has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
faces has quit [Ping timeout: 240 seconds]
preyalone has quit [Quit: Connection closed for inactivity]
biberu has quit []
fusta has quit [Remote host closed the connection]
troys_ is now known as troys
eam_ is now known as eam
graft_ has joined #ruby
gusrub has joined #ruby
John__ has quit [Read error: Connection reset by peer]
JD2020X is now known as runescape07rsps
polishdub has quit [Remote host closed the connection]
cd-rum has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 240 seconds]
xunila has quit [Quit: Leaving]
<ycyclist>
I have a routine "blek" that returns a single string. I want it to return a string and an int from now on, but for those calls that still expect just the string, I want to not bother them but still just give them the string.
<elomatreb>
That's going to be difficult. You probably should create a new method for the new calls that expect both