Guest28040 has quit [Remote host closed the connection]
tpendragon has quit [Remote host closed the connection]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inside has quit [Disconnected by services]
Guest58336 has quit [Ping timeout: 264 seconds]
dar123 has joined #ruby
SeepingN has joined #ruby
nythalcrow has quit [Ping timeout: 264 seconds]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Eiam>
havenwood: so some of my peers were uhm, convincing me that step 1 was to get me to use JRuby, step 2 was to get me to stop using Ruby and instead use Scala/Clojure or something else that just targets the JVM
nythalcrow has joined #ruby
<Eiam>
I don't think I'm big data/enterprise-y enough to follow them onto that path, but ruby to jruby I think I'm alright with =p
giraffe has joined #ruby
giraffe is now known as Guest33711
tpendragon has joined #ruby
jenrzzz_ has joined #ruby
workmad3 has joined #ruby
erlend has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz_ has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 268 seconds]
Guest58336 has joined #ruby
cloaked1 has quit [Quit: Leaving]
orbyt_ has joined #ruby
bmurt has joined #ruby
jrafanie has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
Guest58336 has quit [Ping timeout: 260 seconds]
Guest58336 has joined #ruby
starseed0000 has quit [Ping timeout: 260 seconds]
grilix has joined #ruby
Vingador has joined #ruby
bmurt has quit [Remote host closed the connection]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
vonfry has joined #ruby
roamingdog has quit [Remote host closed the connection]
cadillac_ has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
vonfry_ has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
vonfry has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 240 seconds]
roamingdog has joined #ruby
gizmore has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
lbracher has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
dr3w_ has joined #ruby
roamingdog has joined #ruby
cadillac_ has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
dendazen has joined #ruby
fluxAeon_ has joined #ruby
<fluxAeon_>
if i need to do a check to see if a var is nil or not before displaying it in an .erb do i do that in the .erb or in the controller?
synthroid has quit [Read error: Connection reset by peer]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb>
Depends on what you want to do "instead" I'd say
synthroid has joined #ruby
<fluxAeon_>
display a 0
<fluxAeon_>
<td class="number"><%= @member_demographics.find{|x| x['gender'] == 'F'}['Pct']%>%</td>. that's coming back nil sometimes because it doesn't exist in the data so i need to display a 0 instead
<elomatreb>
If your variable doesn't have to be able to contain false (the boolean value) you can just to `your_variable || 0` in the view
synthroid has quit [Remote host closed the connection]
apparition47 has quit [Quit: Bye]
dhollinger has joined #ruby
cschneid has joined #ruby
gregf_ has quit [Ping timeout: 260 seconds]
flips has joined #ruby
dogweather has quit [Ping timeout: 248 seconds]
guille-moe has joined #ruby
shinnya has quit [Ping timeout: 256 seconds]
<fluxAeon>
oh boy. so i don't know ruby at all but i'm trying to update someone elses rails site. they're building a page off of an object that has json data in it. in all but one of the cases there are F and M dictionaries in the json. in the one case there's only an M
<havenwood>
fluxAeon: Note in the first example above, it's mutating the instance of Array that is the receiver to the #each method.
<fluxAeon>
ok
<havenwood>
fluxAeon: The second example creates a new Array.
<havenwood>
fluxAeon: If you don't know filter and map from other languages, they're worth learning!
<havenwood>
filter/map/reduce
<havenwood>
We don't actually get the #filter alias for #select until Christmas. ;-)
synthroid has joined #ruby
PsionTheory has quit [Remote host closed the connection]
<havenwood>
fluxAeon: If you have trouble mapping, show us a gist of what you're trying.
<havenwood>
?gist
<ruby[bot]>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<fluxAeon>
okay let me spend some time on this
<fluxAeon>
thanks for being so helpful!
synthroi_ has joined #ruby
dogweather has quit [Ping timeout: 255 seconds]
houhouli_ has quit [Remote host closed the connection]
cagomez has quit [Remote host closed the connection]
houhoulis has joined #ruby
cagomez has joined #ruby
synthroid has quit [Ping timeout: 268 seconds]
cagomez has quit [Remote host closed the connection]
dogweather has joined #ruby
amar__ has joined #ruby
houhoulis has quit [Remote host closed the connection]
cadillac_ has quit [Ping timeout: 260 seconds]
amar_ has quit [Ping timeout: 256 seconds]
orbyt_ has joined #ruby
dogweather has quit [Ping timeout: 256 seconds]
<icy`>
looks like array of two hashes where the female one comes first. Just prepend it if doesn't exist
<havenwood>
icy`: good point - i didn't look closely enough at the image
<havenwood>
fluxAeon: i misread your example, icy`'s right that you have a separate Hash for M and F inside the Array
dogweather has joined #ruby
megamos has quit [Quit: Leaving]
cadillac_ has joined #ruby
wald0_ has joined #ruby
<havenwood>
fluxAeon: [[{a: 1}, {b: 1}], [{a: 1}]].map { |a| a.prepend({a: 1}) if a.none? { |h| h.key? :a }; a.append({b: 1}) if a.none? { |h| h.key? :b }; a }
guille-moe has quit [Ping timeout: 248 seconds]
<havenwood>
you could do it based on position if those are regular
DTZUZO has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dogweather has quit [Ping timeout: 255 seconds]
jzhu has quit [Quit: Connection closed for inactivity]
Beams has quit [Quit: .]
Asher has quit [Ping timeout: 245 seconds]
roamingdog has joined #ruby
dogweather has joined #ruby
starseed0000 has joined #ruby
orbyt_ has joined #ruby
amar__ has quit [Remote host closed the connection]
rippa has joined #ruby
dogweather has quit [Ping timeout: 265 seconds]
vikaton has joined #ruby
<starseed0000>
/join #devops
amar_ has joined #ruby
cagomez has joined #ruby
amar_ has quit [Ping timeout: 268 seconds]
twobitsprite has joined #ruby
wontruefree has joined #ruby
<twobitsprite>
I've read a couple of posts about this on stackexchange, but I figured I'd ask here to see if there's a better ruby-specific solution: anyone know of a good way to do something like "#!/usr/bin/env ruby -ni" on linux?
Asher has joined #ruby
ha has joined #ruby
dreamthese has quit [Remote host closed the connection]
<twobitsprite>
nm, just found a post demonstrating the -x trick :)
dreamthese has joined #ruby
yohji has quit [Remote host closed the connection]
jcarl43 has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has quit [Remote host closed the connection]
<konsolebox>
twobitsprite: that would still require 3 arguments, no?
dionysus69 has joined #ruby
orbyt_ has joined #ruby
ha has quit [Quit: Leaving]
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dhollinger has quit [Remote host closed the connection]
biberu has joined #ruby
synthroid has joined #ruby
sysvalve has quit [Ping timeout: 248 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hanmac>
only hipster try to code with flip-flop ;P
RougeT430 has joined #ruby
<havenwood>
How would you rewrite the above without flipflop?
* havenwood
waxes his mustache
RougeT430 has quit [Max SendQ exceeded]
Guest58336 has quit [Ping timeout: 240 seconds]
RougeT430 has joined #ruby
r29v has joined #ruby
<baweaver>
havenwood: why modulo?
<havenwood>
just a contrived example
suukim has quit [Quit: Konversation terminated!]
rouget430__ has joined #ruby
rouget430__ has quit [Max SendQ exceeded]
<baweaver>
Well I'm being overly dramatic in work channels with it XD
<havenwood>
haha
rouget430__ has joined #ruby
<baweaver>
Rickroll works fine by the way.
* havenwood
goes back to using the sandals operator
bmurt has quit [Ping timeout: 268 seconds]
RougeR has quit [Read error: Connection reset by peer]
Zaab1t has quit [Quit: Zaab1t]
RougeT430 has quit [Ping timeout: 240 seconds]
Guest58336 has joined #ruby
Eiam has joined #ruby
tdy has quit [Ping timeout: 256 seconds]
mjolnird has quit [Remote host closed the connection]
nowhere_man has joined #ruby
nicht_ has quit [Ping timeout: 245 seconds]
mjolnird has joined #ruby
ishe has quit [Ping timeout: 260 seconds]
Guest58336 has quit [Ping timeout: 240 seconds]
ishe` has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
dr3w_ has joined #ruby
Guest58336 has joined #ruby
<jrich523>
female coming first?
<jrich523>
man, scrolling up can be scary :)
za1b1tsu has quit [Quit: WeeChat 2.1]
<baweaver>
???
nicht_ has joined #ruby
nicht_ has quit [Max SendQ exceeded]
nicht_ has joined #ruby
<jrich523>
mostly im an idiot, i had the window way scrolled up
Guest58336 has quit [Ping timeout: 255 seconds]
<jrich523>
some a nutty comment about a hash, a female and coming first
<jrich523>
lol
KeyJoo has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
dionysus70 is now known as dionysus69
brandon is now known as dbrandon
Guest58336 has joined #ruby
<theRoUS>
working with rails 5 (after a long absence). i want to implement an import method that will loop through the array of item hashes in its params, and do #create or #update as appropriate before moving on to the next item in the import array.
<theRoUS>
is this something easily done, or do i need to replicate the create/update logic in my #import method? i'm having trouble figuring out how to reset the params structure appropriate for each iteration..
amar has joined #ruby
<starseed0000>
theRoUS, are you worried about validations preventing any object to save?
<theRoUS>
i have separate validators for the #import and the #update/#create methods, so i don't think so
Guest58336 has quit [Ping timeout: 245 seconds]
nowhere_man has quit [Ping timeout: 256 seconds]
<theRoUS>
which is why i'd prefer to work within the #create/#update methods rather than try to recreate them
JamJam_kid has joined #ruby
nowhere_man has joined #ruby
amar_ has quit [Ping timeout: 248 seconds]
pastorinni has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
tvw has quit [Read error: Connection reset by peer]
venmx has quit [Ping timeout: 276 seconds]
eckhardt_ has joined #ruby
cagomez has joined #ruby
claudiuinberlin has joined #ruby
<apeiros_>
theRoUS: as long as it's limited to what you've described, then that's rather trivial
sauvin has quit [Read error: Connection reset by peer]
dogweather has joined #ruby
pastorinni has quit [Remote host closed the connection]
rouget430__ has quit [Ping timeout: 240 seconds]
<theRoUS>
apeiros_: that's what i hoped. any pointers to howtos?
dhollinger has joined #ruby
<apeiros_>
theRoUS: what more than .each and .create do you think you need?
apeiros_ is now known as apeiros
<theRoUS>
well, resetting params between each call, since #create depends upon it
cagomez has quit [Remote host closed the connection]
<apeiros>
params? as in Rails' ApplicationController#params ?
dogweather has quit [Ping timeout: 256 seconds]
grilix_ has joined #ruby
grilix has quit [Read error: Connection reset by peer]
<apeiros>
dumm di dumm…
postmodern has joined #ruby
skryking_ has quit [Quit: Leaving]
skryking_ has joined #ruby
skryking_ has quit [Client Quit]
<cthulchu>
I have a quick question
<cthulchu>
I think I can ask the console here
<cthulchu>
>>puts(puts "123" if 1=1)
<ruby[bot]>
cthulchu: # => /tmp/execpad-c1f3d2c4f952/source-c1f3d2c4f952:2: syntax error, unexpected modifier_if, expecting ')' ...check link for more (https://eval.in/1025227)
<theRoUS>
apeiros: yes
<apeiros>
?experiments
<ruby[bot]>
Please use your local irb or pry (see ?pry) to experiment, ruby[bot]'s eval functionality is for demonstration purposes only.
<cthulchu>
I know, I know
<cthulchu>
It was my question
<cthulchu>
whether this will work: events = data_layer.select { |object| puts object.to_json if object.has_key?(data_layer_var_name) }
unknown2 has joined #ruby
<cthulchu>
and I want that object that it puts in my events
<unknown2>
?
<apeiros>
"work" depends on what you expect. but puts returns nil. always. so probably no.
<cthulchu>
so I expect puts to return true
<cthulchu>
I think it should, right?
<apeiros>
also select is not map. your to_json is rather pointless there.
<apeiros>
you think wrong. and I just said so :)
<cthulchu>
my to_json has no relation to the funciton outside
<cthulchu>
it's about puts
<apeiros>
"work" depends on what you expect. but *****puts returns nil*****. always. so probably no. (emphasis added)
kevinburke has quit [Quit: Connection closed for inactivity]
<cthulchu>
ir doesn't mutate the object
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
<cthulchu>
I wrote above what I expected
<apeiros>
yeah, then your to_json is indeed more pointless.
<apeiros>
-more
<cthulchu>
why
<apeiros>
the result of it is not used anywhere.
dendazen has quit [Ping timeout: 240 seconds]
<cthulchu>
weird
<cthulchu>
puts won't output it?
<apeiros>
not at all.
<cthulchu>
why?
<apeiros>
*so*
<apeiros>
*sob*
<apeiros>
stupid keyboard.
<cthulchu>
I treat blocks as functions
<apeiros>
yes, puts will output it.
<cthulchu>
errr...
<cthulchu>
does puts have embeded .to_json?
<cthulchu>
it doesn't
<cthulchu>
I tested it
<cthulchu>
so why are you saying it does nothing?
zachk has joined #ruby
zachk has joined #ruby
<cthulchu>
it does exactly wht I want
<cthulchu>
flattens my hash to a string
<cthulchu>
so I could print it
<cthulchu>
I don't need a string in events and I don't expect to_json to mutate my object
<cthulchu>
I would be very surprised if it did
<apeiros>
no. but puts always returns nil. so that puts there is wrong. if you indeed want to print your object, ok, then that to_json isn't pointless. but your code makes little sense.
<cthulchu>
aha
<cthulchu>
now I see
unknown2 has quit [Read error: Connection reset by peer]
pastorinni has quit [Remote host closed the connection]
pastorinni has joined #ruby
ElFerna has quit [Ping timeout: 264 seconds]
tvw has joined #ruby
cthulchu_ has joined #ruby
fartymcfly has joined #ruby
<fartymcfly>
hey all. is it okay to add folders to a mac root directory? will i break anything?
Guest58336 has quit [Ping timeout: 260 seconds]
synthroid has quit []
<twobitsp1ite>
Anyone have any idea why this matches? " # service: name=unseal-vault enabled=true" =~ /([\s-]*)(\S+?:)( [^"']\S+?=.*)$/
fartymcfly has left #ruby [#ruby]
<tobiasvl>
fartymcfly: it won't break anything as far as I'm aware. can't imagine it does. but: why?
fartymcfly has joined #ruby
<twobitsp1ite>
ohh, nm... guess I should put a ^ at the beginning :P
cthulchu has quit [Ping timeout: 256 seconds]
<elomatreb>
fartymcfly: You probably don't have the permissions to do that unless you're running scripts as root, which usually indicates deeper problems
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest58336 has joined #ruby
<havenwood>
fartymcfly: but no, it won't break anything
<havenwood>
oh, tobiasvl already said
<apeiros>
twobitsp1ite: you probabbly want \A, not ^
<havenwood>
twobitsp1ite: ^ is beginning of *line*
dionysus69 has quit [Ping timeout: 240 seconds]
<apeiros>
and *any* line at that
<havenwood>
"\n\noops".match? /^oops/ #=> true
<havenwood>
twobitsp1ite: \A and \z ftw
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fartymcfly>
i need to put a file in the Vamp directory of `Library/Audio/Plugins/Vamp` but i don't have a Vamp directory on my machine yet. following these directions: https://vamp-plugins.org/download.html#install
Serpent7776 has joined #ruby
Serpent7776 has quit [Remote host closed the connection]
Guest58336 has quit [Ping timeout: 240 seconds]
\void has joined #ruby
drona6 has quit [Quit: Page closed]
vagrant5 has joined #ruby
OneNeptune has joined #ruby
dogweather has joined #ruby
<vagrant5>
fartymcfly: it looks like you can put it in the home directory instead?
Guest58336 has joined #ruby
hph^ has joined #ruby
samosaphile has quit [Quit: Page closed]
<fartymcfly>
vagrant5: yeah. i'll probably do that. just wondering what the implications were of using root directory. it feels weird to add anything to it, but no one can put into words why exacly
dionysus69 has joined #ruby
dogweather has quit [Ping timeout: 276 seconds]
subroot has joined #ruby
subr has joined #ruby
Guest58336 has quit [Ping timeout: 240 seconds]
subr has quit [Remote host closed the connection]
p4p0l0 has quit [Remote host closed the connection]
reber has quit [Remote host closed the connection]
dgaff has joined #ruby
dogweather has joined #ruby
<dgaff>
is rbenv preferred over rvm these days?
pastorinni has quit [Ping timeout: 256 seconds]
Guest58336 has joined #ruby
__goodnight__ has joined #ruby
dhollinger has quit [Remote host closed the connection]
vikaton has quit [Quit: Connection closed for inactivity]
<Eiam>
chruby
<Eiam>
I think is preferred over either
<Eiam>
(I still use rbenv tho)
Guest58336 has quit [Ping timeout: 260 seconds]
<Eiam>
I never had problems with rvm fwiw and have no issues with rbenv, I just moved to it when setting up a new machine cause everyone said i was weird for using rvm and I figured I'd try out something new to see what the dealio was
jenrzzz_ has quit [Ping timeout: 264 seconds]
nicht_ has joined #ruby
fartymcfly has quit [Quit: Page closed]
<dgaff>
Am I that old now
workmad3 has joined #ruby
<dgaff>
where RVM is the weird one
<dgaff>
It's been a while but back in the day wasn't rvm the go-to?
OneNeptune has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest58336 has quit [Ping timeout: 264 seconds]
donnie has quit [Ping timeout: 276 seconds]
matled has joined #ruby
donnie_2 has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
Guest58336 has joined #ruby
apeiros has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
dgaff has quit [Quit: Lost terminal]
Guest58336 has quit [Ping timeout: 240 seconds]
Guest58336 has joined #ruby
dogweather has quit [Ping timeout: 264 seconds]
desperek has quit [Quit: xoxo]
lytol has quit [Remote host closed the connection]
ElFerna has quit [Ping timeout: 248 seconds]
Guest58336 has quit [Ping timeout: 256 seconds]
dogweather has joined #ruby
Mike11 has quit [Quit: Leaving.]
Guest47756 has quit [Changing host]
Guest47756 has joined #ruby
Guest47756 is now known as Nicmavr
Guest58336 has joined #ruby
Guest58336 has quit [Ping timeout: 264 seconds]
amar_ has quit [Remote host closed the connection]
venmx has quit [Ping timeout: 256 seconds]
amar has joined #ruby
Guest58336 has joined #ruby
cschneid has quit [Remote host closed the connection]
amar has quit [Ping timeout: 276 seconds]
cschnei__ has joined #ruby
dogweather has quit [Read error: Connection timed out]
Guest58336 has quit [Ping timeout: 240 seconds]
dogweather has joined #ruby
cschnei__ has quit [Ping timeout: 260 seconds]
ElFerna has joined #ruby
Guest58336 has joined #ruby
wontruefree has quit [Ping timeout: 256 seconds]
whathappens has joined #ruby
nythalcrow has joined #ruby
Guest58336 has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
icarus has quit [Ping timeout: 240 seconds]
nythalcrow has quit [Ping timeout: 240 seconds]
Guest58336 has joined #ruby
white_lilies has joined #ruby
DTZUZO has quit [Ping timeout: 256 seconds]
ElFerna has quit [Ping timeout: 240 seconds]
Guest58336 has quit [Ping timeout: 268 seconds]
cschneid has joined #ruby
AJA4350 has quit [Remote host closed the connection]
dogweather has quit [Ping timeout: 264 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
Guest58336 has joined #ruby
cschneid has quit [Ping timeout: 268 seconds]
dogweather has joined #ruby
wald0 has quit [Ping timeout: 240 seconds]
clemens3 has quit [Ping timeout: 260 seconds]
Guest58336 has quit [Ping timeout: 265 seconds]
subroot has quit [Read error: Connection reset by peer]
codymj has quit [Quit: Leaving]
Guest58336 has joined #ruby
Guest58336 has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
matcouto has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
solocshaw has joined #ruby
roamingdog has joined #ruby
solocshaw has quit [Client Quit]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
Guest58336 has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
jzhu has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
Guest58336 has quit [Ping timeout: 255 seconds]
<zenspider>
mmmm... rspec's describe seems to have a feature where additional args CAN(?) be used as a shared context thingy.... but I can't find that described anywhere in the "relish" doco thingy at all. Can someone clue me ins?