MrRobinhood5_ has quit [Read error: Connection reset by peer]
MrRobinhood5_ has joined #ruby
MrRobinhood5_ has quit [Read error: Connection reset by peer]
MrRobinhood5_ has joined #ruby
MrRobinhood5_ has quit [Read error: Connection reset by peer]
krisquigley has quit [Ping timeout: 256 seconds]
mistermo_ has quit [Ping timeout: 264 seconds]
riotjones has quit [Ping timeout: 264 seconds]
MrRobinhood5_ has joined #ruby
MrRobinhood5_ has quit [Read error: Connection reset by peer]
MrRobinhood5_ has joined #ruby
MrRobinhood5_ has quit [Read error: Connection reset by peer]
<Virtual_>
im absolutely terrified of actually writing code
juanca_ has joined #ruby
<Virtual_>
I'm not sure how I got this far with my bot lol
MrRobinhood5_ has joined #ruby
MrRobinhood5_ has quit [Read error: Connection reset by peer]
Sawbones has quit [Remote host closed the connection]
MrRobinhood5_ has joined #ruby
MrRobinhood5_ has quit [Read error: Connection reset by peer]
Sawbones has joined #ruby
MrRobinhood5 has quit [Ping timeout: 252 seconds]
<jhass>
why's that?
<jhass>
why did you choose that hobby if you don't enjoy it?
mistermocha has quit [Remote host closed the connection]
<Virtual_>
fear of failing
jbeeze has joined #ruby
<Virtual_>
I would enjoy it if I could do it properly
cpruitt has joined #ruby
<jhass>
you didn't understand how humans learn
<jhass>
go, make some wikipedia surfing and learn how humans learn
towski_ has quit [Remote host closed the connection]
adriancb_ has quit [Remote host closed the connection]
adriancb has joined #ruby
Wolland has joined #ruby
CorySimmons has joined #ruby
<Virtual_>
what?
Sawbones has quit [Ping timeout: 264 seconds]
elfuego has joined #ruby
<jhass>
failure is probably the most efficient way to achieve progress
DavidDudson has joined #ruby
kyrylo has joined #ruby
blazes816 has joined #ruby
<Virtual_>
it kills me to know that i've failed something
bradleyprice has joined #ruby
<jbeeze>
hey guys, i have a rails question, but no one is answering in that channel, could someone help out real quick?
<jhass>
Virtual_: get over that attitude. The only thing that kills you is that attitude.
<jhass>
jbeeze: 5 minutes is no time
CorySimmons has quit [Client Quit]
<jhass>
response times of 6 hours and more on an inactive channel is nothing unusual on IRC
tubuliferous has joined #ruby
<jbeeze>
jhass: fair enough. im still new to the IRC programming scene
<jbeeze>
being at work for the past 13hrs, just getting a bit antsy
<jhass>
jbeeze: another thing that will help is not asking for an expert, just state your actual problem
<centrx>
Channels are active and inactive at different times
reinaldob has joined #ruby
<jbeeze>
jhass: i didn't mean to, just this wasn't the best place to ask so that's why i asked, but i agree
tcrypt has quit [Ping timeout: 252 seconds]
startupality has quit [Quit: startupality]
bonhoeffer has joined #ruby
<jhass>
Virtual_: I mean it though. Read some wikipedia articles on how the brain works. Maybe even down to the chemical processes. Especially in overcoming fear there's some interesting research where they explain the patients what they brains do on the neurochemical level and it actually helps them overcome it
<jhass>
*their
blazes816 has quit [Ping timeout: 252 seconds]
Joufflu has quit [Read error: Connection reset by peer]
<sevenseacat>
i dont know how anyone can answer the question 'my javascript doesnt work, help'
CorySimmons has joined #ruby
<sevenseacat>
no matter what channel youre in
charliesome has joined #ruby
jherbst has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
unreal has joined #ruby
Virtual_ has quit [Ping timeout: 255 seconds]
Vile` has quit [Ping timeout: 255 seconds]
<jbeeze>
lol?
Mon_Ouie has quit [Quit: WeeChat 1.1.1]
reinaldob has quit [Ping timeout: 245 seconds]
<sevenseacat>
you need to actually provide some evidence of what doesnt work, with some error messages, or code, or anything
<jbeeze>
i clearly didn't say anything remotely that basic, and yes, i would go into greater detail if anyone answered. i rather not crit the channel with a wall of text
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
<sevenseacat>
"(10:07:58) jbeeze: hey everyone, i just put up a rails server from a repo, but for some reason the javascript isn't working, can anyone help?"
<shevy>
jbeeze you can try to turn your rails question into a ruby question
elfuego has quit [Quit: elfuego]
Vile` has joined #ruby
<jhass>
jbeeze: the point is that your asking somebody to commit to you without the slightest chance of estimating the effort going into that
<jhass>
also scroll wheels work well, don't fear the wall of text or put it into a gist
krz has joined #ruby
<shevy>
wait
<shevy>
my scroll wheel does not work
<jhass>
well, you're shevy. Nothing works for you
<shevy>
gcc works!
<shevy>
I am trying my luck with gnome 3.16.0
c_nick has joined #ruby
<c_nick>
In TeamCity What is Agent.Capacity.application ? just a place holder for the configuration to segregate the configs?
karmatr0n has joined #ruby
tus has quit []
<jhass>
shevy: switching to wayland yet?
<shevy>
what the
<shevy>
jhass dunno yet, I had some gtk3 related problem with wayland + webkitgtk ... will go slowly
coin3d has quit [Ping timeout: 255 seconds]
DerisiveLogic has quit [Ping timeout: 264 seconds]
dfinninger has joined #ruby
<sevenseacat>
i like how a wall of text is two lines
<sevenseacat>
thats a very small wall.
<shevy>
haha
Synthbread has joined #ruby
<shevy>
sevenseacat always goes in for the kill
ramfjord has quit [Ping timeout: 265 seconds]
nicolastarzia has quit []
lemur has joined #ruby
<centrx>
Rails + Javascript = #ruby
razieliyo has quit [Remote host closed the connection]
<jokester>
lol
<shevy>
and a little bit php for the flavour
<jbeeze>
it's called being at wits end, but have your fun. i would in your position
dfinninger has quit [Ping timeout: 246 seconds]
Megtastique has quit []
mistermocha has joined #ruby
<jhass>
DeBot: !hangman ruby
<DeBot>
␣␣␣␣␣␣␣␣␣ [] 0/12
<jhass>
uh, short one
jasabella has joined #ruby
<jhass>
DeBot: #:io
<DeBot>
␣i␣␣#␣o␣␣ [:] 1/12
ismaelga has quit [Remote host closed the connection]
kblake has joined #ruby
<nahtnam>
DeBot: L
<DeBot>
␣i␣␣#␣o␣␣ [:l] 2/12
hpoydar has joined #ruby
<Radar>
DeBot: a
<DeBot>
␣i␣␣#␣o␣␣ [:la] 3/12
<Radar>
DeBot: e
<DeBot>
␣i␣e#␣o␣e [:la] 3/12
Spami has quit [Quit: This computer has gone to sleep]
<sevenseacat>
DeBot: st
<DeBot>
Ti␣e#␣o␣e [:las] 4/12
<sevenseacat>
DeBot: m
<DeBot>
Time#␣o␣e [:las] 4/12
<sevenseacat>
DeBot: zn
<DeBot>
Time#zone [:las] 4/12 You won!
<sevenseacat>
\o/
iterator_ has joined #ruby
justin_pdx has quit [Quit: justin_pdx]
<shevy>
your cat skills are unmatched
DerisiveLogic has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
iteratorP has quit [Ping timeout: 250 seconds]
kblake has quit [Ping timeout: 256 seconds]
eighthbit has joined #ruby
hpoydar has quit [Ping timeout: 256 seconds]
ghostpl_ has quit [Remote host closed the connection]
juanca_ has quit [Remote host closed the connection]
Parker0 has joined #ruby
<Robbo`>
I'm using jruby, I have an application on padrino that serves multiple domains. It uses the domain to decide database information and other similar things. At the start of the request it works out which site is current and it stores it in Site.current. All goes well, but since our move to jruby it can sometimes be changed by another request on another site half way through its request so some things will have the wrong site details. I have
<Robbo`>
no idea how to stop this, have tried multiple methods
<headius>
Robbo`: you would want to put a lock around accesses of that value
rkgudboy has joined #ruby
rkgudboy has quit [Read error: Connection reset by peer]
ojacobson has joined #ruby
<headius>
m = Mutex.new; Mutex.synchronized { reads and writes }
<headius>
er, .synchronize
aarthi01 has quit [Ping timeout: 272 seconds]
<Robbo`>
and that will essentially freeze it for the request?
jbeeze has quit [Remote host closed the connection]
<headius>
well, it will prevent multiple threads from modifying and reading it at the same time
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
juanca_ has joined #ruby
<headius>
you may introduce a bottleneck if that's happening a lot, but it's a first line of defense
<Robbo`>
it basically just needs to be a constant after the request has started
<Robbo`>
using trinidad
<jhass>
Robbo`: make it thread local. Site.current is a hidden global
<jhass>
it's shared state
rkgudboy has joined #ruby
jasabella has quit [Ping timeout: 245 seconds]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
balazs has quit [Ping timeout: 252 seconds]
Rollabunna has quit [Remote host closed the connection]
Rollabunna has joined #ruby
digitalextremist has joined #ruby
kyrylo has quit [Ping timeout: 256 seconds]
charliesome has quit [Quit: zzz]
f03lipe has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
justin_pdx has joined #ruby
sevvie has quit [Ping timeout: 246 seconds]
iamninja has joined #ruby
aarthi01 has joined #ruby
jasabella has joined #ruby
sevvie has joined #ruby
n008f4g_ has quit [Ping timeout: 272 seconds]
ramfjord has joined #ruby
postmodern has quit [Quit: Leaving]
charliesome has joined #ruby
doodlehaus has joined #ruby
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
juanca_ has quit [Remote host closed the connection]
michaeldeol has joined #ruby
fuzzyhorns has quit [Ping timeout: 244 seconds]
balazs has joined #ruby
milesmatthias has quit [Remote host closed the connection]
juanca_ has joined #ruby
randomcoder has joined #ruby
<shevy>
jhass that is the error I have with webkitgtk right now /usr/lib/libwebkitgtk-3.0.so: undefined reference to `gdk_wayland_display_get_type'
randomcoder is now known as someotherrandomc
doodlehaus has quit [Ping timeout: 244 seconds]
<jhass>
sound like you want to update gdk first
someotherrandomc has quit [Client Quit]
DEA7TH has quit [Ping timeout: 252 seconds]
<shevy>
sometimes you do find funny things while compiling
<shevy>
like compiling gnome-backgrounds, I got "This work is licensed under a <_:link-1/>."
<shevy>
literally
DEA7TH_ has joined #ruby
<shevy>
oops sorry, it is eog, eye of gnome, not gnome-backgrounds
cpruitt has quit [Quit: cpruitt]
iterator_ has quit [Remote host closed the connection]
juanca_ has quit [Remote host closed the connection]
livingstn has quit []
sankaber has joined #ruby
juanca_ has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 256 seconds]
Musashi007 has quit [Quit: Musashi007]
jenrzzz has joined #ruby
Channel6 has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
krz has quit [Read error: Connection reset by peer]
krz has joined #ruby
juanca_ has quit [Ping timeout: 252 seconds]
juanca_ has joined #ruby
mrdtt has joined #ruby
rwz has quit [Remote host closed the connection]
adriancb_ has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
psy_ has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Lewix has quit [Remote host closed the connection]
dfinninger has joined #ruby
adriancb has quit [Ping timeout: 256 seconds]
havenn has joined #ruby
tcrypt has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
havenwood has quit [Ping timeout: 272 seconds]
jottr has joined #ruby
dfinninger has quit [Ping timeout: 264 seconds]
chris[] has joined #ruby
krz has joined #ruby
krz is now known as Guest55309
jasabella has quit [Ping timeout: 256 seconds]
_shrine has quit [Quit: Leaving]
Guest55309 has quit [Client Quit]
krz has joined #ruby
havenwood has joined #ruby
havenn has quit [Ping timeout: 244 seconds]
jottr has quit [Ping timeout: 272 seconds]
patrick99e99 has quit [Ping timeout: 264 seconds]
patrick99e99 has joined #ruby
krz has quit [Read error: Connection reset by peer]
krz has joined #ruby
RegulationD has joined #ruby
krz has quit [Read error: Connection reset by peer]
ebbflowgo has joined #ruby
adriancb_ has quit [Remote host closed the connection]
krz has joined #ruby
havenn has joined #ruby
havenwood has quit [Ping timeout: 255 seconds]
mistermocha has quit [Remote host closed the connection]
mistermocha has joined #ruby
rwz has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
douglass has joined #ruby
benlieb_ has quit [Quit: benlieb_]
zacts has quit [Quit: leaving]
xenokiller has quit [Ping timeout: 255 seconds]
krisquigley has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
mahtennek has joined #ruby
<mahtennek>
hi, if i am receiving this as a String, {:cur=>"6", :now=>"2", :size=>"1000", :updates=>["992211", "2323131", "654321", "12345"]}, how can i convert this into a Hash?
<jhass>
why are you receiving that as string?
<jhass>
can't you just pass it as hash instead?
caca_colo has joined #ruby
<jhass>
or at least properly serialized, for example to json?
<mahtennek>
how can i do that?
<jhass>
which of those?
krisquigley has quit [Ping timeout: 264 seconds]
<mahtennek>
my current implementation is using a Hash (key, value) but my hash value contains "{:cur=>"6", :now=>"2", :size=>"1000", :updates=>["992211", "2323131", "654321", "12345"]}" this. so i would want to be able to access individual fields to add or update or delete them
<mahtennek>
so you are suggesting to serialize as a json into the hash value? so in that way i get more control of the data?
<jhass>
implementation of what? why do you end up with the .to_s or .inspect of a hash?
adamjleonard has joined #ruby
<mahtennek>
the hash implementation that i am working on
<jhass>
in the debug output too, use things like p(thing_to_inspect) or puts "description of the thing: #{thing_to_inspect.inspect}"
caca_colo has quit [Remote host closed the connection]
<mahtennek>
okay.
<mahtennek>
understand.
<mahtennek>
is my implementation possible?
jasabella has joined #ruby
atomi has quit [Client Quit]
zacts is now known as zacts-
zacts- is now known as zacts
<jhass>
it certainly seems to execute fine, I'm not sure what your issue/question is
ebbflowgo has quit [Quit: ebbflowgo]
<mahtennek>
my question is for my deep value for :updates=>["992211", "2323131", "654321", "12345"]}, should i need to update, add or delete values, i seem to have a blocker here
<mahtennek>
not very sure how best should i proceed.
<jhass>
it's a regular array, you have all the Array methods available
giuseppesolinas has quit [Quit: This computer has gone to sleep]
braincra- has quit [Quit: bye bye]
<mahtennek>
so to update this entire Hash, I have to traverse the Hash to the particular array to update etc
<mahtennek>
okay i am still trying to understand. let me try that out. i will ping again if i am lost. thanks for the info
coin3d has joined #ruby
<jhass>
mahtennek: get pry, paste your first two lines into it and experiment
<mahtennek>
alright sure. that sounds great
<mahtennek>
let me try
<mahtennek>
thanks so much for the guidance
<jhass>
yw
rwz has quit [Remote host closed the connection]
<jhass>
mahtennek: another bunch of very useful tips right upfront: use ls some_expression to look at the methods the returned object has available, install the pry-doc gem and you have access to documentation inside pry by prefixing something with ? , and finally you can do require "pry"; binding.pry in almost any place in almost any ruby script to launch a pry shell in that context
tcrypt has quit [Remote host closed the connection]
braincrash has joined #ruby
milesmatthias has joined #ruby
<mahtennek>
cool. i can run pry with my ruby script would be better.
coin3d has quit [Ping timeout: 250 seconds]
rkgudboy has quit [Ping timeout: 265 seconds]
atomi has joined #ruby
arrubin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jasabella has quit [Ping timeout: 245 seconds]
<jokester>
yeah, I love `pry binding`
christiandsg has joined #ruby
tcrypt has joined #ruby
GreenJello has left #ruby ["(null)"]
hpoydar has joined #ruby
<mahtennek>
(Y) it's awesome
casadei has quit [Remote host closed the connection]
Wolland has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sevenseacat has quit [Ping timeout: 245 seconds]
dfinninger has joined #ruby
hpoydar has quit [Ping timeout: 244 seconds]
iamninja has quit [Read error: Connection reset by peer]
deric_skibotn has quit [Ping timeout: 246 seconds]
iamninja has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
dfinninger has quit [Ping timeout: 245 seconds]
duncannz has joined #ruby
mistermocha has quit [Remote host closed the connection]
slackbotgz has quit [Remote host closed the connection]
<maasha>
Maybe I am looking for the set_summary_width option in optparse ...
postmodern has quit [Quit: Leaving]
angdev has quit [Client Quit]
reinaldob has quit [Ping timeout: 272 seconds]
xcombelle_ has joined #ruby
xcombelle_ has quit [Remote host closed the connection]
alec-c4 has quit [Remote host closed the connection]
krzkrz has quit [Quit: WeeChat 1.0.1]
jasabella has joined #ruby
patrick99e99 has quit [Ping timeout: 252 seconds]
allenn has joined #ruby
patrick99e99 has joined #ruby
codecop has quit [Remote host closed the connection]
arietis has joined #ruby
<arietis>
hello, guys
<SebastianThorn>
hi
<arup_r>
maasha: you battling ? :)
<arup_r>
SebastianThorn: It seems I know you.. But how.. I can't remember.. :)
<maasha>
arup_r: well, it is not going very well.
<arietis>
is em-websocket good choice for server with real time updates?
<arup_r>
humm
ta has joined #ruby
<SebastianThorn>
remm: arup_r cool, im from sweden if that helps ;)
nii236 has quit [Ping timeout: 246 seconds]
<arup_r>
nah.. can't still
angdev has joined #ruby
<arup_r>
Any body here from Newzealand ?
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
coin3d has joined #ruby
<arup_r>
I'm enjoying WC SA vs NZ
davedev2_ has quit [Remote host closed the connection]
rdark has joined #ruby
davedev24_ has joined #ruby
patrick99e99 has quit [Ping timeout: 252 seconds]
elfuego has joined #ruby
doodlehaus has joined #ruby
patrick99e99 has joined #ruby
joonty has joined #ruby
angdev has quit []
caca_colo has quit [Remote host closed the connection]
Cust0sL1men has joined #ruby
coin3d has quit [Ping timeout: 255 seconds]
<maasha>
nope, set_summary_width is not it. So what is a clever way of wrapping lines in getopt, particularly I want correct indentation of argument descriptions: https://gist.github.com/anonymous/7e7c63fb50516f993bed
davedev24_ has quit [Ping timeout: 265 seconds]
chridal has joined #ruby
doodlehaus has quit [Ping timeout: 245 seconds]
adac has joined #ruby
<adac>
can bcrypt also be used to enrcrypt/decrypt a password with a key?
sevvie has joined #ruby
krisquigley has joined #ruby
duncannz has joined #ruby
oo_ has quit [Remote host closed the connection]
patrick99e99 has quit [Ping timeout: 246 seconds]
<wasamasa>
urgh
oo_ has joined #ruby
<jhass>
adac: bcrypt is a hashing scheme
<wasamasa>
so, modifier if behaves different from using the return-value of an if-construct in an assignment
patrick99e99 has joined #ruby
<adac>
Ok I see
<jhass>
adac: and a hashing scheme is what you should use to store passwords, recovering them should be close to impossible
<adac>
what would you use to encrypt a value in a database?
<adac>
So taht it can be recovered only with a key
<wasamasa>
database encryption sounds like silliness
tesuji has quit [Read error: Connection reset by peer]
krz has joined #ruby
sevvie has quit [Ping timeout: 264 seconds]
krisquigley has quit [Ping timeout: 246 seconds]
<certainty>
wasamasa: not with homomorphic encryption
<adac>
wasamasa, If you would like to do silly things. What would you use? :=
<adac>
:)
<wasamasa>
it sounds like snake oil honestly
<wasamasa>
adac: if I want to do silly things, I use emacs
<certainty>
maybe i should've read the entire backlog :p
<ponga>
encrpyt db?
<ponga>
for what purpose
<wasamasa>
^
<adac>
To generate pseudo safety
tesuji has joined #ruby
<wasamasa>
aka snakeoil
<adac>
:P
<wasamasa>
why would you want to waste time on that?
last_staff has quit [Ping timeout: 246 seconds]
<ponga>
hm
<flughafen>
mongoponga
<ponga>
adac: my advice is 'google it'
<adac>
well keeping the 'private key' outside of the database, should at least maybe offer a chance that someon who gains access to the very database would not be abel to read out some values that are sensitive
<ponga>
monga ponga flughafen
Pharaoh2 has quit [Quit: Byebye]
<ponga>
is that new protocol of saying hi
Wolland has quit []
<flughafen>
we were smacking some crap about nosql stuff yesterday, and mongo is funny when you add it in front of stuff
<hanmac1>
gregf_ blank is a activesupport function ... it might be that because sign_up_token is a function/method and not an object ... hm but i still think that it should have been worked
<gregf_>
ah - ok
<gregf_>
no wonder i was'nt able to find it :/
jolg42 has joined #ruby
alec-c4 has joined #ruby
n008f4g_ has joined #ruby
<gregf_>
hanmac1++
martinbmadsen has joined #ruby
SegFaultAX has joined #ruby
* hanmac1
knows his things that he doesnt like
<gregf_>
heh
hpoydar has joined #ruby
martinbmadsen has quit [Ping timeout: 252 seconds]
alexherbo2 has joined #ruby
mroach has quit [Quit: mroach]
alexherbo2 has quit [Client Quit]
jolg42 has quit [Max SendQ exceeded]
hpoydar has quit [Ping timeout: 245 seconds]
ki0 has quit [Remote host closed the connection]
ki0 has joined #ruby
alexherbo2 has joined #ruby
RegulationD has joined #ruby
anonymus has quit [Ping timeout: 244 seconds]
Renich has quit [Quit: leaving]
timonv has joined #ruby
AlexRussia has joined #ruby
roolo has quit [Remote host closed the connection]
<workmad3>
jhass: oh wow, that looks fun... the ruby equivalent of a typecast through void* pointers!
<jhass>
maasha: if you list it in your gemspec as executable, rubygems will install it to a common location that should be in the users path on a proper setup
sinkensabe has quit [Remote host closed the connection]
doodlehaus has quit [Remote host closed the connection]
<jhass>
arup_r: yes, what I wrote
<arup_r>
ok.. let me rescue it then
nii236 has joined #ruby
mathie has quit [Quit: Quitting...]
mathie has joined #ruby
BTRE has quit [Ping timeout: 264 seconds]
coderhs has quit [Ping timeout: 244 seconds]
dblessing has joined #ruby
<arup_r>
jhass: Which part of code throwing the exception.. ?
<canton7>
the stack trace will tell you
<canton7>
read the stack trace
<arup_r>
Yes.. I am reading
<jhass>
arup_r: it's right there in backtrace
<arup_r>
well line# 10
kyrylo has joined #ruby
<jhass>
read more carefully
<cheater>
hi guys
doodlehaus has joined #ruby
<jhass>
hey girl
oo_ has joined #ruby
<cheater>
i have an issue running a system command to get a string. It comes with a trailing newline and i'm not sure how to best get rid of it. Here's the code I am using: vmdk_path = `vboxmanage showvminfo "#{vbox_uuid}" --machinereadable | grep -i vmdk | sed -e 's/^.*="\\|"$//g'`
ROOM1 has quit [Ping timeout: 244 seconds]
<jhass>
cheater: String#chomp
<cheater>
the string that returns is something like "foobar\n" and that newline messes up the rest of my code :(
<canton7>
chomp gets rid of trailing newlines
<cheater>
jhass: so i would just do `bla bla`.chomp() ?
<jhass>
cheater: but I would recommend to move processing it to ruby entirely, you're writing ruby after all, not shellscript
<canton7>
"bla bla\n".chomp
<cheater>
as in vmdk_path = `...`.chomp()?
<canton7>
try it and see ;)
<jhass>
yes
<cheater>
canton7: it's a bit painful if every time you try you have to wait 5 minutes :(
leafybasil has quit [Remote host closed the connection]
<cheater>
jhass: ok. with () or without? I'm still not sure what the semantics are
<canton7>
I'm sure you can cook up some dummy output ;)
<jhass>
cheater: parens can almost always be left of in Ruby, especially if they're empty nobody adds them
<cheater>
gotcha. thank you.
anarang has quit [Ping timeout: 256 seconds]
astrobunny has quit [Remote host closed the connection]
<canton7>
something like #chomp is seen more as a property than a method. "the chomped value of the string"
<jhass>
then puts is a keyword? Not sure that helps :P
alexey__ has quit [Read error: No route to host]
<canton7>
I treat it as one, but I might be in the minority :P
<arup_r>
and those Google results didn't help me anymore
<arup_r>
no. I didn't find
<arup_r>
canton7: that
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rjhunter has joined #ruby
<arup_r>
He changed the source code.. I see
Guest57842 is now known as Affix
jottr has quit [Ping timeout: 255 seconds]
Affix has quit [Changing host]
Affix has joined #ruby
vudew has joined #ruby
<canton7>
he monkey-patched it
<rjhunter>
Is ruby-install no longer the hip way to get and build arbitrary Ruby interpreters?
<rjhunter>
I've been away a while
anarang has joined #ruby
<jhass>
rjhunter: pick whatever works for you
<jhass>
there's no need for fashion here
<rjhunter>
According to ruby-install, the latest MRI is 2.1.3 -- which makes me think I'm missing something or it's abandoned
<gregf_>
arup_r: what is it you want to do? get files from various directories from an ftp server?
oo_ has quit [Remote host closed the connection]
<arup_r>
tired canton7: Come on FTP work for me.. help me.. you are sooooo :(
<arup_r>
gregf_: yes
<canton7>
I'm so what? :P
<jhass>
rjhunter: you probably just didn't update it in a while
<canton7>
and no, I'm not going to spoon-feed you
<gregf_>
arup_r: you can use the notmal ftp -i -n<<EOF ..... no?
<gregf_>
s/notmal/normal/
oo_ has joined #ruby
hanmac has joined #ruby
sigurding has quit [Quit: sigurding]
<gregf_>
arup_r: or do you have to get it working using ruby?
<arup_r>
not you canton7 .. I am talking with Ruby interpreter
jasabella has quit [Ping timeout: 264 seconds]
chridal has quit [Ping timeout: 255 seconds]
<canton7>
<arup_r> tired canton7: Come on FTP work for me.. help me.. you are sooooo :( <-- address your comments to the ruby interpreter then
<arup_r>
gregf_: No.. I have to use Ruby... This script I'll put inside the rake task
<arup_r>
in my Rails app
leafybasil has joined #ruby
* arup_r
raised his hands up..
* undeadaedra
high-fives arup_r
<workmad3>
rjhunter: no, there just hasn't been an official release for a while... if you install the HEAD version from the github repo, it has more up-to-date definitions in
<arup_r>
I meant I gave up undeadaedra
<arup_r>
:D
<undeadaedra>
arup_r: well you earned a free high-five with a random internet stranger, isn’t it nice?
<arup_r>
Yes.. ofcourse it is.. I accepted ... it also
DaniG2k has quit [Quit: leaving]
<rjhunter>
workmad3: aha, you're right. thanks.
AlexRussia has quit [Ping timeout: 256 seconds]
User458764 has joined #ruby
<workmad3>
rjhunter: it doesn't matter too much though... you can still just do 'ruby-install ruby 2.1.5' and it works fine
n008f4g_ has quit [Ping timeout: 246 seconds]
adac has quit [Ping timeout: 264 seconds]
overcrush has quit [Quit: sleep]
<workmad3>
rjhunter: which is part of why there hasn't been an official release for a while... I think postmodern only does an official release when something major needs to change in the install procedure (such as the need for newer openssl versions with ruby 2, a new install procedure for rbx when they hit a milestone, etc.)
alec-c4_ has quit [Remote host closed the connection]
iamjarvo has joined #ruby
jottr has joined #ruby
alec-c4 has joined #ruby
<rjhunter>
workmad3: I've recently picked up a project that specifies ruby 2.2.0 in the Gemfile, and the latest release of ruby-install didn't know how to find that Ruby -- and didn't know how to build it when I passed a URL and MD5
ghostpl_ has quit [Remote host closed the connection]
hs366 has joined #ruby
patrick99e99 has quit [Ping timeout: 255 seconds]
<workmad3>
rjhunter: hmm, weird... the 0.5.0 release doesn't list 2.2.0 (or 2.2.1) for me but finds and builds it fine (I even just rebuilt it with 0.5.0 to double-check)... could just do 'ruby-install ruby 2.2.0' and it guessed the right URL, downloaded it, built fine
GnuYawk has joined #ruby
patrick99e99 has joined #ruby
einarj_ has joined #ruby
mostlybadfly has joined #ruby
einarj has quit [Read error: Network is unreachable]
mikecmpbll has joined #ruby
thinkswan has quit [Remote host closed the connection]
arietis has quit [Quit: Leaving.]
noname has joined #ruby
sandelius has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
spyderman4g63 has joined #ruby
<rjhunter>
workmad3: I'm looking through my command history and I think I know what happened -- I tried `ruby-install 2.2` (rather than 2.2.0) and it would have told me "unknown ruby version", then I would have checked the known versions and started down the wrong path entirely
spyderma_ has joined #ruby
<workmad3>
rjhunter: aha :) yeah, it doesn't know about 2.2.0 so can't infer that you meant 2.2... makes sense :)
jeromelanteri has quit [Ping timeout: 272 seconds]
<workmad3>
*what you meant with 2.2
<rjhunter>
either way, it's all working nicely now and I don't even need to submit a pull request anywhere
<rjhunter>
thanks :-)
ldnunes has joined #ruby
AlexRussia has joined #ruby
chridal has joined #ruby
rsavage has joined #ruby
jimms has joined #ruby
User458764 has joined #ruby
phutchins has joined #ruby
bim has joined #ruby
spyderman4g63 has quit [Ping timeout: 256 seconds]
patrick99e99 has quit [Ping timeout: 250 seconds]
dfinninger has joined #ruby
patrick99e99 has joined #ruby
nii236 has quit [Ping timeout: 252 seconds]
hmsimha has quit [Ping timeout: 252 seconds]
sigurding has joined #ruby
elfuego has quit [Quit: elfuego]
pandaant has joined #ruby
jimms has quit [Remote host closed the connection]
dfinninger has quit [Ping timeout: 244 seconds]
hpoydar has joined #ruby
arietis has joined #ruby
arietis has left #ruby [#ruby]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
vudew has quit [Ping timeout: 264 seconds]
jeromelanteri has joined #ruby
jeromelanteri has quit [Max SendQ exceeded]
jeromelanteri has joined #ruby
jeromelanteri has quit [Max SendQ exceeded]
jeromelanteri has joined #ruby
jeromelanteri has quit [Max SendQ exceeded]
jeromelanteri has joined #ruby
jeromelanteri has quit [Max SendQ exceeded]
jeromelanteri has joined #ruby
jeromelanteri has quit [Max SendQ exceeded]
jeromelanteri has joined #ruby
jeromelanteri has quit [Max SendQ exceeded]
hpoydar has quit [Ping timeout: 250 seconds]
jeromelanteri has joined #ruby
rsavage is now known as R3dk1nG
startupality has joined #ruby
patrick99e99 has quit [Ping timeout: 272 seconds]
patrick99e99 has joined #ruby
RegulationD has joined #ruby
doodlehaus has quit [Remote host closed the connection]
WillAmes has quit [Remote host closed the connection]
bruno- has joined #ruby
tvw has joined #ruby
WillAmes has joined #ruby
iamjarvo has joined #ruby
cpt_yossarian has quit [Ping timeout: 250 seconds]
ismaelga has joined #ruby
vudew has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
bruno- has quit [Ping timeout: 246 seconds]
scripore has quit [Quit: This computer has gone to sleep]
soc42 has joined #ruby
anarang has quit [Ping timeout: 264 seconds]
Lewix has joined #ruby
ghostpl_ has joined #ruby
spyderma_ has quit [Ping timeout: 256 seconds]
chthon has joined #ruby
vudew has quit [Ping timeout: 244 seconds]
shredding has quit [Ping timeout: 256 seconds]
hiyosi has joined #ruby
baash05 has joined #ruby
<baash05>
Woot.. My project lead decided to bump the ruby version to 2.2.1
spyderma_ has joined #ruby
<baash05>
I still formatted my system but at least I'm not on 2.1.3 anymore :)
jolg42 has quit [Quit: ZZZzzz…]
<jhass>
cool, while they're in the mood, let them adopt a policy to update to latest ruby on release ;)
<baash05>
He said he tries, but we'll all agree sometimes its not a smooth process. :)
oo_ has quit [Remote host closed the connection]
<baash05>
We also bumped the rails version. so all caught up.
oo_ has joined #ruby
<baash05>
Never got to the bottom of the 2.1.2 though.. it wasn't native to the OS.
maximski has joined #ruby
anarang has joined #ruby
patrick99e99 has quit [Ping timeout: 255 seconds]
patrick99e99 has joined #ruby
jeromelanteri has quit [Ping timeout: 256 seconds]
lkba has joined #ruby
oo_ has quit [Remote host closed the connection]
badhatter has quit [Remote host closed the connection]
sankaber has joined #ruby
brb3 has joined #ruby
astrobunny has quit [Remote host closed the connection]
aclearman037 has joined #ruby
astrobunny has joined #ruby
maximski has quit []
<baash05>
Okay.. I'm in a namespace and I have a class by the name of Bar, but I have another class called Bar in a non-namespaced bit of code.. How can I access that class while in the namespace.
<baash05>
?
ghostpl_ has quit [Remote host closed the connection]
<undeadaedra>
::Bar ?
<baash05>
would that do it..
<baash05>
Ah crap.. that easy..
<undeadaedra>
:)
Robbo` has left #ruby ["Konversation terminated!"]
oo_ has joined #ruby
B1n4r10 has joined #ruby
<jhass>
if you want to confuse your colleagues do Object::Object::Object::Bar
<baash05>
Na.. I already right off screen if false statements :)
<baash05>
As it is my workmates don't like that I use AND and OR. I try not to antagonize them where I can avoid it.
rkgudboy has quit [Ping timeout: 256 seconds]
<shevy>
AND?
<shevy>
why the caps
<apeiros>
jhass: sure you wouldn't want to use ::Object::Object::Object::Bar?
<baash05>
Oh.. Just because that's how my workmates say it.
<jhass>
apeiros: no, actually I would want to use Net::Object::Bar
<apeiros>
that gives a warning, though
triple_b has joined #ruby
<jhass>
who runs with warnings
<apeiros>
true
<baash05>
I'm creating a braintree wrapper so help shim it into an "interface" class. and I (not knowing called my shim class Braintree.
<jhass>
:o actually it doesn't even work :(
<apeiros>
I think it used to
<apeiros>
at least I remember a "Warning, accessing top level constant Foo from Bar"
<baash05>
Oh.. one question you guys might know. is there a way to run only the failed tests in rspec?
<baash05>
I was reading around for it and it seems it there was a request for it a while back, but it never made it in.
Vivex has joined #ruby
<baash05>
I was thinking of writing an extension, but DRY right :)
<shevy>
I run my rubies with all warnings!
triple_b has quit [Ping timeout: 256 seconds]
arup_r has quit [Ping timeout: 244 seconds]
<baash05>
I turn them on for testing (the warnings) but do you really run them in prod with warnings?
jeromelanteri has joined #ruby
adriancb has quit [Ping timeout: 256 seconds]
webguynow has quit [Ping timeout: 272 seconds]
serivich has joined #ruby
freerobby has joined #ruby
<jhass>
apeiros: I think it doesn't work for modules :/
oo_ has quit [Remote host closed the connection]
lkba_ has joined #ruby
<jhass>
baash05: you can run a specific test by appending its line number to the rspec command
ghostpl_ has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
<jhass>
I also like guard which runs only the failed tests until they pass
<baash05>
I didn't know you could set up guard to do that.
<baash05>
I thought it just ran when the file changed.
oo_ has joined #ruby
<baash05>
I also find that sometimes it runs all the tests in a related file.. if it can't figure out what bit to test.
<jhass>
well yes and it runs the whole suite afterwards if it passed
<baash05>
rightly so it is a guard.
<baash05>
I was seeing talking or rspec --failed or something like that
<jhass>
there's also the focus trick setup by default
<jhass>
change it to fit and it'll only run that test
<baash05>
Humm..
giuseppesolinas has joined #ruby
<jhass>
fit is a shortcut to it "foo", focus: true do
nii236 has joined #ruby
rjhunter has quit [Remote host closed the connection]
<baash05>
I'll have to take a look.. I wasn't overly happy with guard. I find it fine when I'm doing bit work but when I'm refactoring large bits of code it tries too much.
<jhass>
that might just mean your testsuite is too slow :P
<baash05>
Perhaps if it doesn't exist, I should implement it.. One of the suggestions for the github issue seemed really viable.
<baash05>
well my suite takes 15min.
<jhass>
how many examples?
alec-c4 has quit [Remote host closed the connection]
<baash05>
3000 + last time I took note
dfinninger has joined #ruby
<baash05>
I think we have about 90% coverage.
<jhass>
so 0.3 seconds on rough average, that's a bit slow I think :)
nii236 has quit [Ping timeout: 246 seconds]
micw has joined #ruby
<micw>
hi
terlar has joined #ruby
<baash05>
It is.. we are refactoring things out to services and using mocks a lot more.. All our new stuff is under 1 (or we look at it hard)
<baash05>
sorry under 0.1
<jhass>
cool
<baash05>
I'm under a year old in the tdd world, but man I don't know how I would live without it now.
<micw>
i have no idea of ruby but a question ;-) can i write def something [newline] some code [newline] end in one line? i'd need that for a automatically edited config file
<baash05>
I get to sleep at night.
<jhass>
micw: you could always since newline is interchangeable with ;
<jhass>
though your usecase sounds fishy :)
<baash05>
micw def say_hellow(); p "hellow"; end
<baash05>
Not sure if you need the first ;
<micw>
thank you.
<undeadaedra>
baash05: technically no, but it’s better with it
<baash05>
agree with jhass.. I don't see the use case.
<jhass>
micw: btw if you describe your motivation a bit more we might have some alternatives ;)
Macaveli has quit [Remote host closed the connection]
Macaveli has joined #ruby
<shevy>
micw the ruby parser won't score indentation in regards to evaluating whether the code is valid or whether it will be rejected; the python parser will reject incorrectly indented code and refuse to run it
<shevy>
"IndentationError: expected an indented block"
<baash05>
as will haml and coffee.
<jhass>
and slim
codecop has joined #ruby
<undeadaedra>
because ruby is not indent-based, unlike haml, coffee, slim, python, yaml
<undeadaedra>
(obviously)
<shevy>
:(
<shevy>
good old yaml
terlar has quit [Quit: WeeChat 1.1.1]
a5i has joined #ruby
<shevy>
my old cookbooks were in one huge yaml file
<shevy>
that was so annoying
terlar has joined #ruby
<shevy>
I put them into standalone yaml files, that was easier to handle
dfinning_ has quit [Ping timeout: 272 seconds]
<shevy>
most annoying were multiline descriptions; I had to use the | character, and indent properly especially the leading ' '
<baash05>
I argued with a mate about the { } and how they are not as evil as indented scopes.
sgambino has joined #ruby
zz_Outlastsheep has quit [Read error: Connection reset by peer]
<shevy>
huh... I just discovered this command on linux "getconf ARG_MAX"
<micw>
so (to make it more easy) i needed the code in 3. in one line
ghostpl_ has quit [Read error: Connection reset by peer]
<jhass>
micw: so it's not editing, it's creating from a template?
<baash05>
Not sure how it would be easy.
RegulationD has joined #ruby
<jhass>
micw: ah, actually looking at the article I would suggest you fork gitlab, do the changes, commit them(!) and provision from your fork
angdev has joined #ruby
<jhass>
maybe reading the sensitive data from environment variables or things like that
ghostpl_ has joined #ruby
pen has quit []
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<micw>
jhass, i do provisioning with ansible. that does most of what i need but chaning lines in files is sometimes a bit ugly
serivichi has joined #ruby
<jhass>
yep, hence my suggestion
oo_ has quit [Remote host closed the connection]
<micw>
not exactly. i commit my ansible playbook that contains all i need
RegulationD has quit [Ping timeout: 245 seconds]
codecop has quit [Remote host closed the connection]
serivich has quit [Ping timeout: 255 seconds]
spyderma_ has quit [Remote host closed the connection]
JDiPierro has joined #ruby
Lewix has quit []
spyderman4g63 has joined #ruby
yfeldblu_ has quit [Ping timeout: 272 seconds]
arietis has joined #ruby
<arietis>
anyone worked with dnssd?
<jhass>
!used
<helpa>
Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
fryguy9 has joined #ruby
krisquigley has quit [Remote host closed the connection]
chridal has quit [Ping timeout: 252 seconds]
<shevy>
help is such an opinionated little bot
<shevy>
*helpa
krisquigley has joined #ruby
<helpa>
shevy: your point?
<baash05>
What if he just wants to know if anyone uses it.. he's running a pole. Like anyone use "or" in their code lately. I don't have a problem. I just like to ask questions
sushant94 has left #ruby ["Leaving"]
chridal has joined #ruby
allcentury has joined #ruby
tier has joined #ruby
kaiZen has joined #ruby
cpruitt has joined #ruby
<shevy>
lol
<workmad3>
baash05: s/pole/poll ;)
anaeem1 has quit [Remote host closed the connection]
<baash05>
Oops :)
<bradland>
maybe he's running a pole
<bradland>
don't judge
<shevy>
or dancing on one
<baash05>
ha
<workmad3>
:)
<workmad3>
bradland: judging is what I do well though!
anaeem1_ has joined #ruby
superlou has joined #ruby
<jhass>
baash05: simple "I'm doing a study: did anyone of you use dnssd?"
<baash05>
Ah.. well phrased..
superlou has quit [Client Quit]
<shevy>
I'm doing a study: did anyone of you use dnssd?
<workmad3>
"I'm trying to justify my irrational hatred of dnssd to my boss by demonstrating that no one in their right mind uses it... does anyone here use dnssd?"
superlou_ has joined #ruby
<baash05>
Has anyone forced ruby to allow for interface classes?
superlou_ is now known as superlou
<shevy>
baash05 is this aspect oriented programming?
icebourg has joined #ruby
<jhass>
baash05: what do you think of when you say interface class?
thiesen has joined #ruby
<baash05>
OH.. recently in my companies move to services I created a base class.
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
simone__ has joined #ruby
<baash05>
and being in java at night I got frustrated with the lack of ability to make my inherited classes fall down if they didn't implement methods
<shevy>
oh java
<baash05>
so I said.. you will conform or you will not inherit.
<shevy>
how strict
<workmad3>
baash05: you mean something like 'def foobar; raise NotImplemented; end'?
Beliq has quit [Quit: My computer has gone to sleep. ZZZzzz…]
krisquigley has quit [Ping timeout: 256 seconds]
startupality has quit [Ping timeout: 252 seconds]
serivichi has quit [Ping timeout: 272 seconds]
maximski has joined #ruby
<baash05>
Nope that would be useless because it already does that by default :)
maximski has quit [Max SendQ exceeded]
<shevy>
workmad3's example is useless!
<jhass>
so you want parse time errors?
Beliq has joined #ruby
<baash05>
I don't want them.. I got them
<baash05>
I wanted them..
maximski has joined #ruby
<jhass>
okay you completely lost me there
anaeem1_ has quit [Ping timeout: 264 seconds]
<baash05>
I wanted them.. they were not there.. so I found out how and I built them.. I now have parse time errors
maximski has quit [Max SendQ exceeded]
<bradland>
like Contracts, but for methods?
<jhass>
I think you still have runtime errors
<DefV>
5
n80 has joined #ruby
<baash05>
Well technically yes they are run time.
lkba has joined #ruby
lkba_ has quit [Read error: Connection reset by peer]
<baash05>
but they are caught when the file is parsed the first time.
<jhass>
so what do you do? enumerate on included/inherited?
<baash05>
so they explode with great noice.
maximski has joined #ruby
antgel_ has quit [Ping timeout: 244 seconds]
codecop has joined #ruby
startupality has joined #ruby
n80 has quit [Client Quit]
beef-wellington has joined #ruby
thinkswan has joined #ruby
nfk has joined #ruby
<baash05>
I use tracepoint
freerobby has quit [Quit: Leaving.]
<baash05>
in the inherited.
<baash05>
so I can catch the end of the file..
<jhass>
sounds annoying tbh
scripore has joined #ruby
<baash05>
not really
dfinninger has joined #ruby
codecop has quit [Remote host closed the connection]
<jhass>
using tracepoint for anything beyond debugging very much does, yeah
<workmad3>
baash05: what about if I wanted to create a partial implementation that could then be subclassed again, or extended with modules providing specific behaviour on instantiation? :P
<baash05>
well modules are fine..
<baash05>
partial implementation.. there is a limit
<maasha>
Is there anyone actually developing code strictly according to the styleguide and rubocop?
<workmad3>
(I'm very aware that those are straw-man arguments because I'd want to shoot myself before designing a system based on dynamic extension like that :) )
<baash05>
Ha ha..
<maasha>
or is rubocop a nazi?
<arietis>
whatever, what i'm trying to accomplish is to get mdns service ip and port using dnssd gem
teddyp1cker has joined #ruby
n80 has joined #ruby
<baash05>
Yeah.. I don't know anyone does partials.. modules sure, but partials.. ug I can imagine editing that code.
<baash05>
maasha.. I try.
<nickjj>
maasha, i use rubocop but not 100%
<arietis>
but so far i'm just getting target and port
<nickjj>
the every class needs a top level doc is really annoying, especially on a rails project
thinkswan has quit [Ping timeout: 252 seconds]
<jhass>
oh, doc is turned off anyway
<jhass>
yard does that already
<kyrylo>
Hire me. I'm a FoxPro Senior Developer.
<baash05>
actually didn't get a job once because I said (in my sample code) that the complexity of breaking a method into two chunks didn't make sense from a functional point of view.
jimms has joined #ruby
<maasha>
the 10 lines error can of cause be adjusted, but I think it is really interesting and really forces you to think about your code.
jolg42 has joined #ruby
agarie has joined #ruby
<workmad3>
baash05: interfaces partially implemented in generic abstract base classes... sounds like a sure-fire design in java!
eighthbit has joined #ruby
<maasha>
jhass: complexity limits seems not to be a problem if you methods are max 10 LOC
<maasha>
jhass: and what is the problem with guard clauses?
<nickjj>
one thing is for sure, using rubocop at least partially is much much nicer than not at all
<baash05>
Well I wanted to make better use of inheritance because I had a payment_provider class that had a heap of validation (for credit cards and such) but had three core methods that were different.
<baash05>
I rather like running rubo cop over my code.
<baash05>
makes it easier to read for others..
Wolland has joined #ruby
<baash05>
Now that said after a while it becomes less useful
<maasha>
nickjj: but it is also a way to get bugged down in development. Like using strict documentation and simplecov
<maasha>
simplecov is the biggest time robber :o)
<maasha>
should be arrested by rubocop!
alex88 has joined #ruby
<workmad3>
baash05: it's training wheels... it helps you get used to certain conventions but after a while they just get in the way
iamjarvo has joined #ruby
doodlehaus has joined #ruby
<baash05>
Yeah.. I'd say they become internalized.. not in the way.. sort of how reading Clean Code changes your methods and commenting style
iamjarvo has quit [Max SendQ exceeded]
Wolland has quit [Client Quit]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<baash05>
You just add the space after the brace as habit because you know rubocop will whinge if you don't.
<workmad3>
baash05: sorry, I meant the tool gets in the way, entirely because you have internalized the useful information it gives and it starts flagging up mainly on stuff where you've intentionally deviated because it's better in this case to deviate
iamjarvo has joined #ruby
allcentury has quit [Ping timeout: 246 seconds]
<baash05>
Ah.. true.. like the 10 line thing that lost me the job :) Happily, I heard it sucked there from others afterword.
dfinninger has quit [Remote host closed the connection]
<workmad3>
baash05: you also add that space because then W in vim will take you to the first parameter :)
joonty has quit [Quit: joonty]
<baash05>
Humm..
dfinninger has joined #ruby
<baash05>
true I thought it would anyway.
<workmad3>
baash05: or do you not like optimising your code style for vim cursor movements? :)
<baash05>
I do actually.
adriancb has joined #ruby
adriancb has quit [Read error: Connection reset by peer]
adriancb has joined #ruby
<jhass>
arietis: well, if your network is set up properly connecting by the hostname you get should work
<baash05>
don't tell my co-workers.. they all sit on some ide that boggles my my mind.. Autocomplte.. what the heck.
jerius has joined #ruby
<arietis>
jhass: but what if it's ipv6 hostname?
<jhass>
what's a ipv6 hostname?
<baash05>
Yeah vim w takes you to the param space or no space.
<workmad3>
baash05: nothing wrong with autocomplete... the autocomplete in vim is probably one of the most useful versions I've ever come across
<baash05>
I actually had to test.. It was just an automatic thing for me to put the space but it works without it.
<arietis>
jhass: sorry, ipv6 ip :)
<workmad3>
baash05: sure... but 'foo.bar(blah)' and cursor at the start of the line needs 3w, 'foo.bar( blah )' in the same place needs one W
<baash05>
I switch systems too often to customize fim.
<jhass>
arietis: if you get a ipv6 ip back just connect to it?
<workmad3>
baash05: you don't need to customise vim to get autocomplete... ctrl-n is the default binding, autocompletes from all words available in all open buffers
mbeasley has quit [Quit: WeeChat 0.4.2]
<baash05>
I never got the hang of autocomplete. I type fast enough that I don't really think about it..
thiesen has quit [Quit: Leaving]
<baash05>
I read an article a long time ago that turning off colors and autocomplete makes you a faster coder.
<baash05>
Figured I'd give it a week..
dfinninger has quit [Ping timeout: 256 seconds]
<baash05>
I think that was 6 years ago..
<workmad3>
baash05: I find it quite useful if I'm switching from a file where I've just defined a method to the place I'm about to use it that a quick tab will get me the method without retyping it :)
<bradland>
baash05: you sure that article wasn't satire?
charliesome_ has quit [Quit: zzz]
dstarh has joined #ruby
enebo has joined #ruby
martinbmadsen has joined #ruby
<workmad3>
baash05: all the more convoluted methods that involve generating ctags or similar... I've never found them worth the effort of integrating properly, and they slow down the autocomplete lookup to the point of uselessness for me :)
<baash05>
Ha.. No it made some good points.. I write most of my java by reading the docs and then coding without waiting for the drop down.
caca_colo has joined #ruby
lordkryss has quit [Quit: Connection closed for inactivity]
<baash05>
It's why I can open vim and code up an android app while others are looking up methods. I learned them because I had to type them.
jerius has quit [Quit: /quit]
mbeasley has joined #ruby
<bradland>
baash05: autocomplete isn't something I find myself relying on frequently, but code coloring, i couldn't live without
<bradland>
i spend most of my time writing code, reading code
krisquigley has joined #ruby
<workmad3>
baash05: I've diagnosed too many errors from people without syntax highlighting or who ignore it and make errors that would have been instantly obvious with syntax highlighting to get rid of that though
<baash05>
Yeah.. who doesn't :)
allcentury has joined #ruby
<baash05>
I find it really hard to work with it..
<baash05>
Now..
Vivex has quit [Read error: Connection reset by peer]
scripore has quit [Quit: This computer has gone to sleep]
Beliq has quit [Quit: My computer has gone to sleep. ZZZzzz…]
iamjarvo has quit [Ping timeout: 244 seconds]
eighthbit has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
martinbmadsen has quit [Ping timeout: 246 seconds]
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
<baash05>
I think it is something you get used to.. and when I started notepad didn't support colored code :)
nii236 has joined #ruby
<bradland>
oh gawd
<bradland>
you're such a badass, we get it
scripore has joined #ruby
oo_ has joined #ruby
zonetti has quit [Ping timeout: 250 seconds]
<baash05>
No. no.. that's not my point.. I am just old
_mak has left #ruby [".."]
icebourg has quit []
krisquigley has quit [Ping timeout: 272 seconds]
icebourg has joined #ruby
<bradland>
i think if you do a really close self-examination, you'll find that many of these things you espouse as virtues are actuall self-serving
<bradland>
and i'll leave it at that
tus has joined #ruby
nateberkopec has joined #ruby
brandly has joined #ruby
nii236 has quit [Ping timeout: 256 seconds]
JDiPierro has quit [Remote host closed the connection]
davedev2_ has joined #ruby
zonetti has joined #ruby
davedev24_ has quit [Ping timeout: 246 seconds]
<baash05>
of course they are.. I learn by doing things slow and I memorize shite. I learn things well but my reach is narrow. Some of my co-workers are full stack. I will never be.
<nickjj>
maasha, i never used simplecov
<nickjj>
no intentions of ever starting haha
User458764 has joined #ruby
<nickjj>
jhass, do you use yard?
<jhass>
yeah
cazrin has joined #ruby
<nickjj>
my concern with things like that is if you adhere to it, then you lose a lot of what makes ruby nice
blueOxigen has joined #ruby
<nickjj>
yard looks like basically comment driven type hinting + more
chishiki has quit [Read error: Connection reset by peer]
<jhass>
oh well, I only do it for what I consider public api
<jhass>
everything else gets # @api private tacked on and that's it
chishiki has joined #ruby
it0a has joined #ruby
<maasha>
nickjj: simplecov is kinda nice, I like a simple commenting scheme like TomDoc
fmcgeough has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
icebourg has joined #ruby
freerobby has quit [Quit: Leaving.]
<pagios_>
hi all, so i have a json file that is being updated eveyr now and then, i would like to keep reading the changes in ruby and manipulate those changes, is it best to use a timer to do a file read or can i do an event listener on that file using ruby?
<nickjj>
it just bothers me because knowing types prior to runtime is great, but # @type [String] foo , is more verbose than using a statically typed language
<baash05>
I rather like the named parameters.. that was a nice add.
<workmad3>
agarie: well, that's a good example of how people who like haskell can provide lots of sensible-sounding arguments about how they think types let them do X more effectively than in another language
allcentury has joined #ruby
<pagios_>
bradland: i am using linux so what is my best bet
bigmac_ has joined #ruby
alec-c4 has joined #ruby
<baash05>
you have to admit workmad that dynamic types in parameters isn't really all that helpful.
davedev24_ has joined #ruby
psy_ has quit [Ping timeout: 246 seconds]
julweber has joined #ruby
<baash05>
I mean how often do we use a passed in variable and not know what type it is.
nii236 has joined #ruby
<bradland>
pagios_: depends on your goal and constraints. are you OK with this script only working on Linux?
Soda has joined #ruby
<workmad3>
baash05: I don't have to admit anything if you don't dig up evidence for your point of view ;)
davedev2_ has quit [Ping timeout: 255 seconds]
<workmad3>
baash05: without that, it's "He said, she said" :P
<pagios_>
bradland: i have a json file that is being constantly updated, want to always get the new values of that file into ruby thisi s my goal
<baash05>
True..
<bradland>
pagios_: ok, i get that part, but there's more than one way to skin a cat, as they say.
joonty has joined #ruby
<bradland>
the simplest method would be to write a crontask that periodically processes the file
<bradland>
have that task run every 5 minutes
<pagios_>
i need a way to read from ruby while the file is being updated, dont want to have any conflick on locking the file or whatoever
<bradland>
you'll want to do a copy/truncate operation, so that you don't pocess duplicate records
<workmad3>
baash05: btw, the reason I said "growing evidence" is that there are people doing studies on this stuff nowadays, and one of the results they've so far managed to establish (repeated trials across different groups of different skill levels) is that type specifiers in paramater lists does actually give quantifiable benefits in the tasks they've run
ojacobson_ has joined #ruby
<baash05>
pigios. why are you using a json for memory
<pagios_>
baash05: what do you want to use
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<bradland>
i would use a message queue
alec-c4 has quit [Ping timeout: 244 seconds]
<baash05>
well. it seems json is not suited to that type of work. I'd use a queue
<pagios_>
whats a message queue
RegulationD has joined #ruby
<jhass>
workmad3: baash05 gotta love type interference, best of both worlds
<jhass>
compile time checks & duck typing
<workmad3>
baash05: so yeah, I am re-evaluating my previous views that type specifiers in general only catch errors that sound bad in theory but aren't that common in practice :) but I'm not giving up on ruby despite that because I garner employment from it ;)
<bradland>
pagios_: i'm looking for a nice article i read the other day
<workmad3>
jhass: evidence? :D
brandly has joined #ruby
tier_ has joined #ruby
tkuchiki has quit [Ping timeout: 252 seconds]
<bradland>
basically, a message queue acts as a stack that has publishers and subscribers
<jhass>
workmad3: how about that DeBot didn't crash yet :P
<nickjj>
it all boils down to not having to think/guess/remember
rkgudboy has joined #ruby
<pagios_>
cant find anything related to ruby message queue on google
nii236 has quit [Ping timeout: 265 seconds]
ping-pong has quit [Ping timeout: 244 seconds]
<bradland>
publishers push items on to the message queue, and subscribers grab those items and process them
<jhass>
despite having not a single unit test
<workmad3>
jhass: The plural of 'anecdote' is not 'data' :P
<nickjj>
if a param arg tells me it expects an int, when i view the code 8 months from now i don't need to think "hmm, did this arg take a string or int"
<baash05>
Oh.. I quite like the pay-cheque and I actually quite enjoy ruby.
<baash05>
it was built for programmer enjoyment after all
<bradland>
then later, some service comes along and slurps all the text files in to another system
<workmad3>
jhass: so far, your 'evidence' is the same evidence as exists for homeopathy... someone said "After I had a headache for 2 weeks, I went and bought a homeopathic remedy and then my headache cleared up. Homeopathy works!"
grr_ has joined #ruby
<bradland>
as you've correctly identified, that has issues with concurrency, because you have to handle the case where the file is being written to when it comes time to process it
<pagios_>
bradland: i am not using ruby on rails i am using sinatra
kreeves has joined #ruby
<bradland>
i would absolutely use a message queue then, not a file
micw has quit [Quit: Verlassend]
tier has quit [Ping timeout: 252 seconds]
<bradland>
a file seems simple, but you've already uncovered some of its shortcomings
kreeves has quit [Changing host]
kreeves has joined #ruby
<jhass>
workmad3: I only have anecdote, but writing crystal catches a surprising amount of mistakes at compile time while feeling surprisingly close to writing a dynamically typed language, taking into account that it's still a young language of course
<c-c>
link?
<workmad3>
jhass: :)
<pagios_>
bradland: but how will i write to a message queue from a bash script
chrisja has joined #ruby
<jhass>
c-c: for crystal?
zsimpso has joined #ruby
kreeves has left #ruby [#ruby]
<pagios_>
actually a bash script is writing into that json file and ruby reading that file
<bradland>
heh
<workmad3>
jhass: to which I reply "That sounds interesting, that bears further investigation" not "So your claims must be true then!" ;)
<c-c>
jhass: yes
<bradland>
sorry, i thought you meant the sinatra app and the rails app were communicating
<jhass>
c-c: crystal-lang.org
<pagios_>
no rails
<arietis>
argh
<pagios_>
it goes like BASH SCRIPT -> json file < sinatra
<bradland>
pagios: i see, you said "not" using rails
<pagios_>
inside sinatra i read the file repeately
<bradland>
missed that part
<baash05>
pagios. take a look at message queues.. json isn't ment for the job you've given it.
ojacobson_ has quit [Remote host closed the connection]
<arietis>
is there any good Properties tutorial?
<pagios_>
baash05: how about YAML?
<workmad3>
pagios_: also consider unix sockets
<arietis>
i'm trying to set @var but it returns nil everytime
<pagios_>
unix sockets inside rubu?!
nateberkopec has joined #ruby
<baash05>
Yeah.. sockets.. Now that would be the better way.
<bradland>
pagios_: the serialization format doesn't matter
<workmad3>
pagios_: and stop throwing out data-serialisation formats as solutions to concurrency issues
<bradland>
yes, you can use sockets inside ruby
<pagios_>
so my bash script would write to a unix socket and ruby would read from that socket?
<pagios_>
no files ?
<bradland>
right
werelivinginthef has quit [Remote host closed the connection]
<baash05>
right.
<pagios_>
what difference does it make than using a file?
<baash05>
well files have heaps of write time involved.
<baash05>
they are hard to change.
<workmad3>
pagios_: sockets are designed for this sort of situation and resolve the issues around concurrent access
<jhass>
arietis: got some code to share?
<baash05>
think of writing a file like writing on a bit of paper and giving it to someone to read.
<bradland>
if you want an intermediary store, don't use a file. use a message queue. if you just want to pass information between bash and your sinatra app, use a socket.
<workmad3>
pagios_: hell, they're intended for the situation where one process is pumping data into the socket and another is pulling data out
<baash05>
and sockets like the phone.
<pagios_>
workmad3: you mean in a socket i can read and write at the same time whereas in a file i cannot have 2 operations at the same time?
alec-c4 has joined #ruby
werelivinginthef has joined #ruby
<bradland>
the problem with files is that the APIs you use to interact with them don't provide the tools you need.
icebourg has quit []
<baash05>
pigios.. a socket might be thought of as a a stream of water.
simone__ has quit [Ping timeout: 246 seconds]
<baash05>
one pushes in and the data comes out the other end.
<jhass>
arietis: that's sadly nothing I can use to reproduce your issue
decoponio has joined #ruby
<arietis>
jhass: how come?
<bradland>
pagios_: look at the way he's using the queue. it's not rails specific.
<workmad3>
pagios_: don't get hung up that it says 'rails'... the information is just as applicable to plain ruby :P
<pagios_>
i see
<pagios_>
i will read that doc
<arietis>
jhass: i expect @services to be equal to [] at breakpoint
<bradland>
the diagrams alone are worth it
<pagios_>
that message queue is used like in a push notification for groups or chatting aps
<jhass>
arietis: ah, that's where your confusion comes from
simone__ has joined #ruby
<bradland>
pagios_: it can be
<pagios_>
how can i ask my bashscript to write as a publisher to that message queue?
<bradland>
message queues have many, many use cases
<jhass>
arietis: @foo inside and outside a method definition refer to two different variables
<workmad3>
pagios_: in the code examples at the end, yes... he creates a fanout queue
<bradland>
pagios_: i'm not sure if there are bash bindings, but you can write shell scripts in ruby
<jhass>
arietis: since as you may have noticed the self is a different one
plashchynski has joined #ruby
<bradland>
so you could write a wrapper script that can even be called from bash
joonty has quit [Quit: joonty]
<workmad3>
pagios_: also, that example is using rabbitmq, which I believe exposes API calls that you could always script up using curl for simple purposes
<bradland>
so, your bash script would invoke a ruby script, passing in the message to be written to the queue
<pagios_>
the thing is the data i am getting from bash script is low level stuff
<bradland>
is it text?
<pagios_>
yea
<bradland>
then you can pass it around just like any other argument
<bradland>
see the section labeled "Publish a message"
<arietis>
jhass: figured it out, sorry, i'm new to ruby :)
krz has quit [Read error: Connection reset by peer]
ping-pong has joined #ruby
<jhass>
arietis: nothing to worry about, yw
antgel_ has joined #ruby
<jhass>
it's quite a common pitfall actually
<pagios_>
what my bash script is doing is actually reading from some files like /tmp/test123 ; that file is being updated periodically it only contains 1 line and 1 value: A number
<bradland>
the queue acts as a middle man, so that if you need to deploy your sinatra application, you don't have to worry about your bash script writing to a pipe where there is no listener.
joonty has joined #ruby
rodfersou has quit [Remote host closed the connection]
rodfersou has joined #ruby
<pagios_>
bash is then creating the json file
iamjarvo has joined #ruby
<bradland>
so instead of writing JSON, write the values to the queue
mjuszczak has joined #ruby
rbennacer has joined #ruby
tiago has quit [Ping timeout: 252 seconds]
<pagios_>
ill try to ommit bash, read the values of all the /tmp files in ruby , create an array and update that array every 1 sec , i will try this first and keep it simple
brandly has quit [Ping timeout: 255 seconds]
Rollabunna has quit [Read error: Connection reset by peer]
<pagios_>
than do an array.to_json and return it in sinatra
ndrei has quit [Ping timeout: 256 seconds]
<bradland>
if the file exists on the same system as the sinatra app, you could do that as part of the request/response cycle
<pagios_>
bradland: the file exist yea on the same machine
massless has joined #ruby
<bradland>
keep in mind that this couples the task to your request/response cycle
<pagios_>
what do you mean request/ersponse cycle?
jniziol has joined #ruby
tjohnson has joined #ruby
claw has quit [Ping timeout: 250 seconds]
tiago has joined #ruby
<bradland>
i mean that the temp files will only be processed when someone makes a request to your sinatra app, which might be ok
<bradland>
how does your bash script run right now?
<bradland>
as part of of a cron task, or only when triggered by the sinatra app?
massless has left #ruby [#ruby]
mengu has joined #ruby
<pagios_>
crontab it read the values from the tmp files and creates a json file every sec
claw has joined #ruby
<bradland>
ok, so that won't happen if you move this inside your sinatra app
<bradland>
you are recreating the wheel here
j_mcnally has joined #ruby
<bradland>
you want a message queue
lanemeyer has quit [Ping timeout: 255 seconds]
<bradland>
the task you're trying to accomplish is called inter-process communication
<pagios_>
inside my sinatra app i will create a timer every sec read these values into an array (overwrite the values every 1 sec and return an array.tojson) when sinatra is triggered return that array.tojson
<bradland>
you have one process (bash) that has information to pass to another process (your sinatra app)
rbennacer has quit [Remote host closed the connection]
<bradland>
that is a monumentally poor architecture decision, IMO
freerobby has joined #ruby
<bradland>
you don't need all the overhead of the sinatr app to read a temp file
<pagios_>
bradland: can you explain to me how you would do it
<bradland>
what will the sinatra app do with the information?
rbennacer has joined #ruby
<pagios_>
like the workflow let me know how it works
Channel6 has joined #ruby
<bradland>
what does the sinatra app do with the information when it receives it?
rbennace_ has joined #ruby
lanemeyer has joined #ruby
<pagios_>
it returns only the json to the client requesting it thats all
rbennacer has quit [Read error: Connection reset by peer]
<bradland>
so the sinatra app is just a REST API that returns information to requestors?
<pagios_>
yes
<bradland>
ok, so is the sinatra app returning only the current values from the temp files, or is it returning the entire history since the last request?
<pagios_>
good question
mitchellhenke has joined #ruby
<pagios_>
you have a route in sinatra that returns current and another app that returns the whole history
baash05 has quit [Ping timeout: 255 seconds]
<bradland>
the reason i ask is, i don't understand why the bash script is polling every second if you only need to return one value
zsimpso has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bradland>
ok, and where is the entire history stored?
<pagios_>
bash script is polling from many files in /tmp
<pagios_>
each file has 1 value only
elfuego has joined #ruby
<pagios_>
bradland: in a file
<bradland>
ok, so the bash script creates a bunch of files
<bradland>
not "a" file, many files
<bradland>
that's an important distinction, because that makes each file atomic
Jiyuhen has quit [Read error: Connection reset by peer]
<bradland>
if each file is written to one time, then you don't need to worry about concurrency
<pagios_>
it read from many files and creates 1 current json file with file1_value: x file2_value:y etc
<bradland>
haha, yeah, so again, we're back to recreating a message queue
<bradland>
the bash script creates a bunch of files, then a sinatra app comes along and combines them
<bradland>
yeah?
<bradland>
the problem is that a file might be in the middle of being written
<pagios_>
can i pm you instead of flooding the channel?
<bradland>
which is why files are bad at message queuing
<bradland>
i can only take you so far
<bradland>
i will say this
<pagios_>
the file you mean being written by bash?
<bradland>
yes
<bradland>
you can pm me
<pagios_>
ok so issue is mainly when the file is being written and ruby reads it
<bradland>
shevy: i'm in the US, so that may be a problem. only in some states.
<ddv>
lol
blueOxigen has quit [Read error: Connection reset by peer]
patrick99e99 has quit [Ping timeout: 252 seconds]
patrick99e99 has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
crueber has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
mjuszczak has quit []
bluOxigen has joined #ruby
iamninja has quit [Ping timeout: 250 seconds]
icebourg has joined #ruby
User458764 has joined #ruby
justin_pdx has quit [Quit: justin_pdx]
tiago has quit [Ping timeout: 255 seconds]
gmile has joined #ruby
weszlem_ has joined #ruby
weszlem has quit [Ping timeout: 256 seconds]
weszlem_ is now known as weszlem
gmile has quit [Quit: WeeChat 1.1.1]
tiago has joined #ruby
jlast has joined #ruby
willharrison has joined #ruby
nii236 has joined #ruby
paradoja has joined #ruby
emocakes has quit [Ping timeout: 250 seconds]
snath has joined #ruby
<bradland>
need recommendations for a ruby RRD library? there are a couple in varying states of update, it appears.
icebourg has quit []
UmkaDK has left #ruby ["Leaving ..."]
centrx has quit [Remote host closed the connection]
haxrbyte_ has joined #ruby
thiesen has joined #ruby
centrx has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Beliq has joined #ruby
Parker0 has joined #ruby
oivoodoo has quit [Remote host closed the connection]
rkgudboy has quit [Ping timeout: 265 seconds]
nettoweb has joined #ruby
jobewan has joined #ruby
xxneolithicxx has joined #ruby
aclearman037 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
haxrbyte has quit [Ping timeout: 256 seconds]
ta has quit [Remote host closed the connection]
<xxneolithicxx>
hi all, has anyone seen any cases where Addressable::URI truncates a string you pass to it and doesnt give you back the full string you gave it?
chridal has quit [Ping timeout: 246 seconds]
<xxneolithicxx>
* Addressable::URI#encode
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mengu has quit [Remote host closed the connection]
<jhass>
looks like it chokes on the newline
endash has joined #ruby
rbennace_ has quit [Remote host closed the connection]
werelivinginthef has quit [Remote host closed the connection]
mitchellhenke has quit [Read error: Connection reset by peer]
<jhass>
xxneolithicxx: so that's meant to be the full URI or do you want to encode it for a query param?
TL has joined #ruby
<xxneolithicxx>
encoded for like POST
<jhass>
so urlencoding
freerobby has quit [Quit: Leaving.]
<xxneolithicxx>
yep
vtunka has joined #ruby
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
<jhass>
try CGI.escape
dotybb has joined #ruby
spyderman4g63 has quit [Ping timeout: 265 seconds]
mengu has joined #ruby
mengu has joined #ruby
<jhass>
(Addressable::)URI.escape tries to be smart and interpret the argument as full URI
vudew has joined #ruby
mitchell_ has quit [Ping timeout: 272 seconds]
mbeasley has quit [Quit: WeeChat 0.4.2]
mbeasley has joined #ruby
xenokiller has joined #ruby
fryguy9 has joined #ruby
adamjleonard has joined #ruby
mitchellhenke has joined #ruby
thiesen has quit [Quit: WeeChat 1.2-dev]
Dopagod has joined #ruby
mbeasley has quit [Client Quit]
<xxneolithicxx>
isnt that one going to turn spaces into +
Beliq has quit [Read error: Connection reset by peer]
<jhass>
which is valid urlencoding
mbeasley has joined #ruby
<jhass>
%20 and + is both valid
bruno- has joined #ruby
werelivinginthef has joined #ruby
bruno- is now known as Guest37769
joe_meade has joined #ruby
ping-pong has quit [Ping timeout: 250 seconds]
jottr has quit [Ping timeout: 256 seconds]
tesuji has quit [Ping timeout: 246 seconds]
antgel_ has quit [Ping timeout: 244 seconds]
drawingthesun has joined #ruby
freerobby has joined #ruby
martinbmadsen has joined #ruby
drawingthesun has quit [Max SendQ exceeded]
drawingthesun has joined #ruby
Llarson has joined #ruby
chinmay_dd has joined #ruby
Guest37769 has quit [Ping timeout: 264 seconds]
hooper has quit [Remote host closed the connection]
bruno-_ has joined #ruby
oo_ has quit [Remote host closed the connection]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chrishough has joined #ruby
chridal has joined #ruby
vtunka has quit [Quit: Leaving]
martinbmadsen has quit [Ping timeout: 264 seconds]
rhllor has joined #ruby
soc42_ has joined #ruby
sepp2k has joined #ruby
sandelius has joined #ruby
soc42 has quit [Ping timeout: 252 seconds]
sevvie has joined #ruby
Llarson is now known as Lazlo
soc42_ has quit [Ping timeout: 252 seconds]
casadei has joined #ruby
Lazlo has left #ruby [#ruby]
Channel6 has quit [Quit: Leaving]
gorroth has joined #ruby
<gorroth>
hi
ping-pong has joined #ruby
bim has joined #ruby
<gorroth>
do any of you use Riot with ruby? i'm trying to figure out how i can have my regex either match something like /^this is a comment$/ or nil itself
<gorroth>
i'm really new to ruby overall
sigurding has quit [Quit: sigurding]
roolo has joined #ruby
sandelius has quit [Client Quit]
Hounddog has joined #ruby
blueM has joined #ruby
joe_meade has quit [Remote host closed the connection]
gfawcettpq has quit [Ping timeout: 245 seconds]
<centrx>
gorroth, Use some kind of OR ?
<blueM>
hi is there a quick way to reverse a "group_by" on a Enumerable ? going back to the array
<Hounddog>
This is a stupid question but does hash have something like array push? i need to add something during an iteration.
blueOxigen has joined #ruby
<gorroth>
yes, that seems obvious, but this is what a riot test looks like: asserts_json("[1].comment").matches(/^this is a comment$/)
antgel_ has joined #ruby
<gorroth>
i'm not sure how to get it to handle an OR for nil if it's going to throw an error in the matches()
<xxneolithicxx>
havent used it but does calling to_s on the value you are running the regex against work if so then /^(this is a comment)?$/ should work against it
<centrx>
blueM, hash.values.flatten ?
<gorroth>
hmm
<gorroth>
i'm not sure, but i can try
<Hounddog>
it should then be somthing like {"test" => [1,2,3,4]}
scripore has quit [Quit: This computer has gone to sleep]
<apeiros>
centrx: flatten(1)
<centrx>
blueM, ^
<apeiros>
you should almost never use flatten without an argument
<blueM>
dont think centrx
<apeiros>
in fact, you should almost never use flatten :)
<apeiros>
documentation and implementation differ.
<arup_r>
documentation should mention it..
<arup_r>
:(
kirun has joined #ruby
<arup_r>
http://ruby-doc.org/core-2.2.1/Object.html#method-i-inspect says - "The default inspect shows the object’s class name, an encoding of the object id, and a list of the instance variables and their values (by calling inspect on each of them)."
<jhass>
I have to agree it's kind of silly that it's defined in Kernel and not in Object though
<arup_r>
Very nice
<apeiros>
jhass: yes, sure. I agree too. I don't know why they did it that way.
<arup_r>
can you guys please hold on for a moment
<arup_r>
?
JDiPierro has joined #ruby
vdamewood has joined #ruby
<arup_r>
Just hold on
<apeiros>
but that's his explanation for what he observes.
<arup_r>
as per the doco :
<jhass>
and it seems to documented on Object, very weird
<jhass>
looks like it's defined in object.c but on Kernel
<arup_r>
>> class A; def initialize;@=10;end;end; A.new
<eval-in_>
arup_r => /tmp/execpad-883da66fa25d/source-883da66fa25d:2: `@=' is not allowed as an instance variable name ... (https://eval.in/304105)
<arup_r>
>> class A; def initialize;@x=10;end;end; A.new
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 36.0/2015022000]]
prestorium has joined #ruby
ndrei has joined #ruby
Liquid-- has joined #ruby
<prestorium>
hi all. I'm developing a REST API and I have a change-password action. What should I return when the user send the incorrect current_password? I thought about 401, 403 and 422, but none of these seem right. What do you think?
dfinninger has quit [Remote host closed the connection]
<prestorium>
ddv, hmm... sorry for asking and forcing you to be on IRC.
keen__________ has joined #ruby
slackbotgz1 has quit [Remote host closed the connection]
slackbotgz has joined #ruby
aswen has quit [Ping timeout: 248 seconds]
SouL has joined #ruby
duncannz has quit [Ping timeout: 264 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
keen_________ has quit [Ping timeout: 244 seconds]
mengu has quit [Remote host closed the connection]
frem has joined #ruby
mengu has joined #ruby
<jhass>
prestorium: 403 IMO, you authorizes the action with the current password, if it's wrong the action is not authorized
zorak8 has joined #ruby
<jhass>
401 is basically specific to basic auth
mengu has quit [Client Quit]
keen__________ has quit [Read error: Connection reset by peer]
hpoydar has quit [Remote host closed the connection]
<jhass>
mmh, no, actually 401 might make more sense
<jhass>
ideally you would take the current password via the Authenticate header
djbkd has joined #ruby
Aswebb_ has joined #ruby
antgel has quit [Ping timeout: 264 seconds]
einarj has quit [Remote host closed the connection]
baweaver has joined #ruby
<prestorium>
jhass, I thought like that... But 409 states that " the request could not be processed because of conflict in the request, such as an edit conflict".
<prestorium>
jhass, and since I'm using and API, the user IS authenticated through its token.
<jhass>
yes, that's for example if you add something like an If-modified since and it changed in between
lordkryss has quit [Quit: Connection closed for inactivity]
Zai00 has joined #ruby
<jhass>
that there's an existing authentication doesn't mean there can't be an additional layer of authentication that can fail
silkfox has quit [Ping timeout: 255 seconds]
elaptics is now known as elaptics_away
<jhass>
if you want to treat it as strictly invalid input though, the proper response is 400
patrick99e99 has quit [Ping timeout: 272 seconds]
keen___________ has joined #ruby
<prestorium>
jhass, make sense... thanks. :)
prestorium has quit [Quit: Leaving]
angdev has quit []
patrick99e99 has joined #ruby
leslie has quit [Ping timeout: 264 seconds]
Renich has joined #ruby
reinaldob has quit [Remote host closed the connection]
keen___________ has quit [Ping timeout: 246 seconds]
dotybb has quit [Read error: Connection reset by peer]
silkfox has joined #ruby
leslie has joined #ruby
leslie has quit [Changing host]
leslie has joined #ruby
roolo has joined #ruby
wald0 has joined #ruby
hpoydar has joined #ruby
clayreed has quit [Quit: Leaving]
keen___________ has joined #ruby
aclearman037 has quit [Quit: I'm out!]
<diegoviola>
a function will stop executing when you call return, no?
<diegoviola>
*method
<jhass>
yes
iamninja has joined #ruby
<diegoviola>
right, thanks
scripore has quit [Quit: This computer has gone to sleep]
rodfersou has quit [Quit: leaving]
keen___________ has quit [Read error: Connection reset by peer]
harq_ has joined #ruby
d10n-work has joined #ruby
davispuh has quit [Read error: Connection reset by peer]
duncannz has joined #ruby
scripore has joined #ruby
duncannz has quit [Max SendQ exceeded]
bitcycle1 has joined #ruby
julweber has joined #ruby
bitcycle has quit [Read error: Connection reset by peer]
<apeiros>
diegoviola: one exception: ensure blocks are still executed
SouL has quit [Ping timeout: 246 seconds]
kolaman has quit [Quit: Lost terminal]
banister is now known as banisterfiend
keen___________ has joined #ruby
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
subraminion has joined #ruby
<diegoviola>
I see, thanks
brb3 has quit [Quit: <.<]
cloaked1 has joined #ruby
<whateverman>
nnot much help in the RoR room :\
Macaveli has quit [Ping timeout: 255 seconds]
_hollywood has quit [Quit: Leaving]
fmcgeough has quit [Quit: fmcgeough]
wald0 has quit [Ping timeout: 264 seconds]
havenwood has quit [Ping timeout: 264 seconds]
Filete has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JDiPierro has joined #ruby
keen____________ has joined #ruby
keen___________ has quit [Ping timeout: 264 seconds]
Astrologos_ has quit []
havenwood has joined #ruby
tier_ has quit [Ping timeout: 252 seconds]
apurcell has quit [Quit: Be back later ...]
keen___________0 has joined #ruby
Aswebb_ has quit [Read error: No route to host]
Aswebb_ has joined #ruby
opes_ has joined #ruby
keen____________ has quit [Ping timeout: 256 seconds]
chridal has joined #ruby
a5i has quit [Quit: Connection closed for inactivity]
<snockerton>
was wondering if there is something inherently different between environment settings
adriancb has quit [Remote host closed the connection]
cjim_ has quit [Ping timeout: 246 seconds]
oo_ has joined #ruby
keen__________10 has joined #ruby
keen___________9 has quit [Ping timeout: 256 seconds]
keen__________10 has quit [Read error: Connection reset by peer]
rhllor has joined #ruby
<Senjai>
Probably
jottr has quit [Ping timeout: 264 seconds]
<Senjai>
Depends on what sets those variable
MasterPiece has joined #ruby
<Senjai>
Depends on if InfluxDB is configured somewhere in an initializer
sgambino has quit [Remote host closed the connection]
keen__________10 has joined #ruby
snockerton has quit [Quit: Leaving.]
aryaching_ has quit [Ping timeout: 245 seconds]
uptownhr has quit [Quit: uptownhr]
morenoh149 has quit [Ping timeout: 245 seconds]
keen__________11 has joined #ruby
antgel has joined #ruby
keen__________10 has quit [Read error: Connection reset by peer]
hpoydar has quit [Remote host closed the connection]
foureight84 has quit [Ping timeout: 256 seconds]
harq_ has quit [Read error: Connection reset by peer]
harq_ has joined #ruby
apurcell has joined #ruby
segv is now known as btmn
jmdade has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
niotoanzasenco has joined #ruby
keen__________12 has joined #ruby
chridal has quit [Ping timeout: 246 seconds]
hpoydar has joined #ruby
Musashi007 has joined #ruby
keen__________11 has quit [Ping timeout: 264 seconds]
pengin has quit [Remote host closed the connection]
pengin has joined #ruby
niotoanzasenco has quit [Client Quit]
pengin has quit [Remote host closed the connection]
pengin_ has joined #ruby
Apocalypse has quit [Quit: Input/Output Error]
x1337807_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
keen__________13 has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
keen__________12 has quit [Ping timeout: 256 seconds]
elfuego has quit [Quit: elfuego]
x1337807x has joined #ruby
harq_ has quit [Read error: Connection reset by peer]
harq_ has joined #ruby
Soda has quit [Remote host closed the connection]
riotjones has joined #ruby
Virtual_ has joined #ruby
<Virtual_>
Hi
chacmool` has joined #ruby
<jhass>
hi
keen__________13 has quit [Read error: Connection reset by peer]
<Virtual_>
jhass: Would you look at something for me please? if you have the time
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
!expert2
<helpa>
Do not try to find an expert for your problem. Clearly state and describe your specific issue and wait for answers and follow up questions. Asking for an expert will exclude you from help of people that might be able to solve your problem without considering themselves as an expert in that field. Stating your problem upfront gives everybody the opportunity to look at it while remaining silent if
JDiPierro has quit [Remote host closed the connection]
<jhass>
ugh, that went too long
keen__________13 has joined #ruby
<Virtual_>
I see, well I'm just looking for someone to go over like a few lines of my irc bot and see if the way I have parsed messages is 'correct'
chacmool has quit [Ping timeout: 264 seconds]
mistermocha has quit [Remote host closed the connection]
<jhass>
so even if you reasemble the parameter with .join(" ") you loose whitespace
aarthi01 has joined #ruby
Apocalypse has joined #ruby
Apocalypse has quit [Changing host]
Apocalypse has joined #ruby
<jhass>
one approach is to limit the split
icebourg has quit []
<jhass>
>> "sender command param1 :param2 still param2".split(' ', 3)
<eval-in_>
jhass => ["sender", "command", "param1 :param2 still param2"] (https://eval.in/304156)
pontiki has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mistermocha has quit [Ping timeout: 250 seconds]
keen__________13 has quit [Ping timeout: 265 seconds]
<jhass>
then checking if : is in the message, splitting it on its first occurrence if so, spliting the part before it by whitespace into the individual parameters and so on