<slash_nick>
when takes a list, so splat it baweaver
tkuchiki has joined #ruby
<baweaver>
that too
<shevy>
splat the beaver, spank the beaver!
lkba has joined #ruby
<slash_nick>
and don't forget to thank the beaver.
cdg has quit [Ping timeout: 265 seconds]
jellyjellyrobot has joined #ruby
jellyjellyrobot has quit [Max SendQ exceeded]
lkba_ has quit [Ping timeout: 240 seconds]
jellyjellyrobot has joined #ruby
<shevy>
yeah
Miron has joined #ruby
andersoldahl has quit [Quit: Goodbye everyone.]
<shevy>
then we can prank the beaver
jellyjellyrobot has quit [Max SendQ exceeded]
inanepenguin has joined #ruby
andersoldahl has joined #ruby
zemmihates has joined #ruby
SenpaiSilver has quit [Ping timeout: 265 seconds]
<eam>
too easy
<shevy>
why don't we actually have something like the jvm on the whole OS level?
zhkirill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<eam>
shevy: we do
havenn has quit [Ping timeout: 256 seconds]
<shevy>
so like people could write in ruby but it would be lightning fast
<eam>
well hang on
<craysiii>
dont let go..
<eam>
ruby being slow isn't related to needing something like the jvm
tkuchiki has quit [Remote host closed the connection]
jellyjellyrobot has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
there is also a reason I state this right now; I just reinstalled my OS, went back to archaic slackware, but I find myself compiling stuff again
jellyjellyrobot has quit [Max SendQ exceeded]
<shevy>
with ruby scripts! but it still takes some time...
calleerlandsson has joined #ruby
sulky has joined #ruby
riotjones has joined #ruby
ngscheurich has joined #ruby
andersoldahl has quit [Quit: Goodbye everyone.]
andersh has joined #ruby
Musashi007 has quit [Quit: Musashi007]
riotjones has quit [Ping timeout: 272 seconds]
sharkman has quit [Quit: Leaving]
stardiviner has joined #ruby
Guest123456666 has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
ZucchiniZe has joined #ruby
goobagar has joined #ruby
rushed has quit [Quit: rushed]
Jardayn has quit [Quit: Leaving]
inanepenguin has quit [Quit: inanepenguin]
shoutsid has joined #ruby
Guest123456666 has quit [Client Quit]
iateadonut has joined #ruby
solocshaw has joined #ruby
TheWhip has joined #ruby
renderf__ has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
`tim` has joined #ruby
nKulo has joined #ruby
baweaver has quit [Remote host closed the connection]
_djbkd has quit [Remote host closed the connection]
renderf__ has quit [Ping timeout: 252 seconds]
TheWhip has quit [Ping timeout: 256 seconds]
rodfersou has quit [Quit: leaving]
Guest123456666 has joined #ruby
blackmesa has quit [Ping timeout: 272 seconds]
pocketprotector2 has quit [Ping timeout: 268 seconds]
hephaestus_rg has quit [Ping timeout: 265 seconds]
mattprelude has quit [Ping timeout: 240 seconds]
ducklobster has quit [Ping timeout: 252 seconds]
platzhirsch has left #ruby [#ruby]
poguez_ has quit [Quit: Connection closed for inactivity]
Seich has quit [Ping timeout: 240 seconds]
Rickmast_ has joined #ruby
lethjakman has joined #ruby
slash_nick is now known as slash_quit
Rickmasta has quit [Ping timeout: 264 seconds]
Seich has joined #ruby
willardg has joined #ruby
<shevy>
slash_quit don't quit man, don't you ever quit!
<slash_quit>
huge facepalm... so... i spent half an hour thinking ATT was censoring my information (forcing 404 for certain content or something)...i checked this url in chrome, firefox, lynx, on verizon, on att... nothing!
riotjones has quit [Read error: Connection reset by peer]
imperator has quit [Quit: Leaving]
riotjones has joined #ruby
casadei has quit [Remote host closed the connection]
jamesaxl has joined #ruby
mdih has joined #ruby
craysiii has quit [Remote host closed the connection]
SylarRuby has quit [Ping timeout: 265 seconds]
riotjones has quit [Ping timeout: 250 seconds]
shoutsid has joined #ruby
jamesaxl|2 has quit [Ping timeout: 246 seconds]
fullofcaffeine has quit [Remote host closed the connection]
gdd229 has quit [Quit: WeeChat 0.4.2]
baweaver has joined #ruby
Guest123456666 has joined #ruby
bruno- has joined #ruby
<uberjar>
Hi I have a question about Time..
haraoka has joined #ruby
<uberjar>
in the rdocs about the method #getlocal it says: Returns a new Time object representing time in local time (using the local time zone in effect for this process). If utc_offset is given, it is used instead of the local time.
<uberjar>
getlocal(utc_offset) → new_time
stardiviner has quit [Ping timeout: 250 seconds]
<uberjar>
I wish to pass in that utc_offset parameter and I wanted that to basically tell ruby to pretend that the local operating system time is whatever I set that parameter to.. but apparently it's not working
<uberjar>
but it *should* return "2015-04-05T00:00:00Z" if I am understanding the documentation correctly… (my local system's time zone is Z-04:00)
shoutsid has quit [Ping timeout: 264 seconds]
fullofcaffeine has joined #ruby
<bnagy>
eh?
<bnagy>
the time you gave it was midnight your local (-4) and it gave back 4am at 0
<bnagy>
that seems correct to me?
_djbkd has quit [Quit: My people need me...]
towski_ has quit [Remote host closed the connection]
<uberjar>
well that would have been correct if I had called #getlocal() but instead I passed in a parameter to #getlocal which specified that I wanted Ruby to pretend that my system timezone is +00:00
<uberjar>
therefor it should have given me midnight UTC
blackmesa has quit [Ping timeout: 240 seconds]
<bnagy>
yeah, no
<bnagy>
it gives you the time at the offset you specify
<bnagy>
If utc_offset is given, it is used instead of the local time.
EllisTAA has quit [Quit: EllisTAA]
<uberjar>
I assume that means that it will completely ignore the local time and assume offset is the new localtime
<uberjar>
which would be UTC
<bnagy>
it takes a time, then represents it in the offset you pass
<bnagy>
which is what it has done here
maikowblue has quit [Quit: .]
<bnagy>
0 your time (-4) is 4am zulu
korolyov has quit [Ping timeout: 260 seconds]
inanepenguin has joined #ruby
bl0ndie has joined #ruby
<uberjar>
is there a way to take an iso8601 timestamp which does not specify Zulu (asumes localtime) and then have Ruby process it as if my system time were UTC ?
blowmage has quit [Ping timeout: 264 seconds]
<uberjar>
I basically want to output 2015-04-05T00:00:00Z from the time object even if the user specifies something ambiguous like "2015-04-05T00:00:00"
<uberjar>
but I dont' want to actually change my system time to UTC
stardiviner has joined #ruby
Yzguy has joined #ruby
chipotle has joined #ruby
<bnagy>
there are probably a few ways
simplyianm has joined #ruby
<bnagy>
you could add your offset, or you could strftime the stamp from the user
Channel6 has joined #ruby
<uberjar>
strftime the stamp to a certain length then concat Z on the end then Time.iso8604 that string ?
<uberjar>
that sounds like it should work… magnificent!
ThaiWood has joined #ruby
<bnagy>
imho adding your offset (or subtracting obvs) might be more reliable
simplyianm has quit [Remote host closed the connection]
<bnagy>
but it's a pretty scary specification, like what happens when the user _does_ specify a zone?
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
simplyianm has joined #ruby
shoutsid has joined #ruby
havenwood has joined #ruby
marienz has quit [Ping timeout: 610 seconds]
noethics has quit [Quit: Leaving]
simplyianm has quit [Remote host closed the connection]
simplyianm has joined #ruby
<uberjar>
well from what I can tell it should be possible to rule out the idea that a timezone has been specified by checking to see if the length of the string is less than a certain size and the string does not contain the letter Z
<uberjar>
the ENV thing sounds scarry because I dont' want to assume that this code might not be extracted one day and used in a different context where the programmer might not be aware
<uberjar>
where should I look in ActiveSupport ?
marienz has joined #ruby
<uberjar>
I thought I checked it out
<bnagy>
check that SO answer
TheWhip has quit [Ping timeout: 268 seconds]
<bnagy>
hmm... actually no, you really want the env variable, not in_time_zone I think
<bnagy>
that's just a tzdata aware version of getlocal, really
<uberjar>
oh interesting, he sets the ENV and then returns it back.. I wonder though is that threadsafe ?
<uberjar>
and what about on JRuby
<bnagy>
oh god no
<uberjar>
lol
<bnagy>
I wouldn't set it back, that sounds crazypants
<bnagy>
but env is per process so you don't break anything else
eminencehc has quit [Remote host closed the connection]
dEPy has joined #ruby
<bnagy>
very not-threadsafe
<bnagy>
although on MRI you'd probably get away with it
gener1c_ has joined #ruby
<uberjar>
well believe it or not I'm deploying into a Java application server (Wildfly) and I have a requirement where the application server log timestamps need to match my service's timestamps
<uberjar>
so ENV is pretty much a no-go
Channel6 has quit [Read error: Connection reset by peer]
eminencehc has joined #ruby
Rollabunna has joined #ruby
<uberjar>
if you happen to see something in particular in ActiveSupport that might be nicer than the string manipulation / offset math let me know I'd apprecaite it.. otherwise I'll probably end up having to hope my understanding of iso 8601 is up to par
<uberjar>
(using Torquebox 4)
eminencehc has quit [Remote host closed the connection]
TheWhip has joined #ruby
gener1c has quit [Ping timeout: 264 seconds]
andersoldahl has quit [Max SendQ exceeded]
braincrash has quit [Quit: bye bye]
Guest123456666 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
andersoldahl has joined #ruby
Rollabunna has quit [Ping timeout: 265 seconds]
darkf has joined #ruby
pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rakm has joined #ruby
andersoldahl has quit [Ping timeout: 240 seconds]
braincrash has joined #ruby
DmitryBochkarev has quit [Quit: This computer has gone to sleep]
Guest123456666 has joined #ruby
dEPy has quit [Ping timeout: 256 seconds]
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
<uberjar>
hrmm I could monkeypatch a certain function to prefer a different environment variable ahead of ENV['TZ']
User458764 has joined #ruby
gix has quit [Ping timeout: 264 seconds]
shadoi has quit [Quit: Leaving.]
codecop has joined #ruby
SylarRuby has joined #ruby
<bnagy>
:<
TheWhip has quit [Remote host closed the connection]
riotjones has joined #ruby
User458764 has quit [Ping timeout: 240 seconds]
mclee_ has quit [Ping timeout: 250 seconds]
Soda has joined #ruby
gix has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<uberjar>
maybe I'll send a variant of it as a pull request to Ruby core.. then if somebody finds a proper reason to reject it I'll at least know that it's flawed and maybe a better way will be recommended
xcesariox has joined #ruby
<uberjar>
after all it seems to me at least like this should exist
cndiv has joined #ruby
<uberjar>
maybe matz will agree
otacon- has joined #ruby
shoutsid has quit [Ping timeout: 272 seconds]
aaeron has quit [Quit: Leaving.]
tmillc has quit [Quit: WeeChat 1.1.1]
psy_ has quit [Ping timeout: 264 seconds]
SylarRuby has joined #ruby
solocshaw has joined #ruby
solocshaw has quit [Remote host closed the connection]
astrobun_ has joined #ruby
TheWhip has quit [Ping timeout: 244 seconds]
solocshaw has joined #ruby
jenrzzz has joined #ruby
blackmesa has joined #ruby
<uberjar>
I'm not going to make a big deal out of it though.. because I like to respect people's Time =^o
howdoi has joined #ruby
_djbkd has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
SylarRuby has quit []
blackmesa has quit [Ping timeout: 260 seconds]
shadoi has joined #ruby
Soda has quit [Remote host closed the connection]
bap1313 has quit [Ping timeout: 268 seconds]
leslie_ has joined #ruby
shoutsid has joined #ruby
inanepenguin has quit [Quit: inanepenguin]
jenrzzz has joined #ruby
tenderlove has quit [Quit: Leaving...]
zenguy_pc has quit [Read error: Connection reset by peer]
_djbkd has quit [Remote host closed the connection]
Asher has joined #ruby
tkuchiki has joined #ruby
datanoise has quit [Ping timeout: 240 seconds]
nfk|laptop has joined #ruby
andikr has joined #ruby
Faduo has joined #ruby
<Faduo>
hi
<Faduo>
anybody here?
hephaestus_rg has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
mark3 has joined #ruby
DEA7TH has joined #ruby
fullofcaffeine has joined #ruby
sebyx07 has joined #ruby
firstdayonthejob has quit [Ping timeout: 256 seconds]
<Faduo>
hi
<Faduo>
nobody ?
<[k->
patience.
psy_ has quit [Quit: Leaving]
<Faduo>
who are you?
<[k->
nobody of use to you
<Faduo>
why?
<baweaver>
we are
<baweaver>
and we are not
pawnbox has joined #ruby
fullofcaffeine has quit [Ping timeout: 240 seconds]
<Faduo>
why do you join the #ruby?
<baweaver>
why does one not?
adac has joined #ruby
<sebyx07>
Faduo: do you have a problem that is related with ruby ?
roshanavand has joined #ruby
<Faduo>
yeah
<baweaver>
sebyx07: aw, you're no fun
pawnbox has quit [Remote host closed the connection]
<baweaver>
vague questions tend to get vague answers :P
pecpec has joined #ruby
pecpec has quit [Client Quit]
<Faduo>
not, i prefer sebyx07
Trynemjoel has quit [Ping timeout: 250 seconds]
<sebyx07>
baweaver: we should help ppl out, already there is a lot of talk about moving away from ruby
<Faduo>
1# encoding: utf-8 2 3a = Thread::start() do 4 i = 0 5 while true do 6 print i++ 7 end 8end 9 10a.run 11 12j = 0 13while true do 14 print j++ 15end
<baweaver>
!gist
<baweaver>
hm
<[k->
?gist
<ruboto>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<baweaver>
every time I mix those up
<baweaver>
paste your code in there
<Faduo>
yes ! sebyx07 says right
<baweaver>
sebyx07: you don't honestly believe that do you?
IanV0rn2341 has joined #ruby
platzhirsch has quit [Ping timeout: 264 seconds]
<baweaver>
trends come and go
<Faduo>
ok gist!
<[k->
Faduo: do you like being questioned your identity? i feel we aren't to blame for your provocative question
<[k->
?ask
<ruboto>
Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
Trynemjoel has joined #ruby
<baweaver>
on the note of ruby losing people / dying, it's as nonsense today as it is any other day. Languages don't die in programming
<baweaver>
source: I know RPG, COBOL, and a smidge of ALGOL. All of which are still very much alive and being used in production, despite being made in the 60s and being heralded as "dead"
<baweaver>
now as to whether or not I want a job in them, that's a different matter...
<baweaver>
and print doesn't put a newline, making that very hard to read
<[k->
while true results in an infinite loop
<baweaver>
that and `loop do` is preferred to `while true`
<baweaver>
it's in a thread
<[k->
there is also one in the main thread
<baweaver>
granted
dvxam has joined #ruby
<baweaver>
hard to read a one-liner with line numbers
<[k->
it will probably die of a syntax error before anything else
<baweaver>
Faduo: still not seeing a question out of this
<baweaver>
[k-: yeah
roshanavand has quit [Remote host closed the connection]
<baweaver>
we can't exactly answer something that hasn't been asked.
roshanavand has joined #ruby
darkf_ has joined #ruby
<[k->
indeed
chipotle has quit [Quit: cheerio]
platzhirsch has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkf has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 268 seconds]
TheWhip_ has quit [Remote host closed the connection]
favadi has joined #ruby
anisha has quit [Quit: Leaving]
_blizzy_ has quit [Ping timeout: 246 seconds]
soforchunet has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
giuseppesolinas_ has quit [Quit: This computer has gone to sleep]
EXID123 has quit [Ping timeout: 250 seconds]
ta has joined #ruby
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver>
that and thread.run is a bit pointless.
dvxam has quit [Quit: leaving]
<baweaver>
Thread.start (which is new) does that already.
EXID123_ has quit [Ping timeout: 240 seconds]
skade has joined #ruby
IanV0rn2341 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver>
I guess there's no question then.
IanV0rn2341 has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
<[k->
printing will slow things down, io is slow
<[k->
we need faster IO!
<baweaver>
To C!
Timba-as has joined #ruby
system64 has joined #ruby
moty66 has joined #ruby
Macaveli has joined #ruby
karapetyan has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
soforchunet has quit [Quit: Page closed]
Feyn has joined #ruby
drptbl has joined #ruby
nfk|laptop has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
it_tard has joined #ruby
it_tard has quit [Client Quit]
Log1x has quit [Ping timeout: 272 seconds]
it_tard has joined #ruby
<moty66>
Hello, looking for help to find a way how to filter submethods of a list of objects, please take a look here https://paste.debian.net/314743/
senayar has joined #ruby
it_tard is now known as nfk|laptop
roshanavand has joined #ruby
giuseppesolinas_ has joined #ruby
giuseppesolinas has joined #ruby
Log1x has joined #ruby
techsethi has joined #ruby
<techsethi>
Hi Folks, could someone please help me find a ruby library for TTS that can speak small sentence(s) in like a "song" melody format. For instance, I wan't it to read and
<[k->
firstly, you need to call the method containing the arrays on obj1 and obj2
roshanavand has quit [Ping timeout: 272 seconds]
<techsethi>
"sing" Happy birthday <name>". I have found this library. it works fine for simple text but I want something that can kind of "sing" the sentence. https://github.com/c2h2/tts thanks much in dvance.
ndrei has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BrazenBraden has joined #ruby
<[k->
if you have a mac, i believe you can rely on the underlying tts on it
<moty66>
[k-: i have to each loops, one for objects and one for mehtods which I want to get the submehtods
<moty66>
[k-: but I don't know to to handle the hashes or the array for the results
roshanavand has joined #ruby
giuseppesolinas_ has quit [Quit: Leaving]
<techsethi>
hi [k- I have mac but how to use the underlying tts to close to "sing" the text.
<[k->
i want you to look through that link and tell me the methods you can use to achieve those things
sebyx07 has quit [Ping timeout: 240 seconds]
<shevy>
moty66 did you use .select already
htmldrum has quit [Ping timeout: 250 seconds]
gigetoo has joined #ruby
<shevy>
since you will work on arrays and hashes anyway, you can select inside the {} block what you want from your datastructure
stardiviner has quit [Ping timeout: 240 seconds]
IanV0rn2341 has joined #ruby
hephaestus_rg has quit [Ping timeout: 250 seconds]
<[k->
shevy: this is a special case, s/he wants one of each submethod to appear, there is already a method for that
fullofcaffeine has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
<[k->
select involves more work, let's point him/her to the other method?
<shevy>
I don't know what is a submethod
stardiviner has joined #ruby
datanoise has quit [Ping timeout: 256 seconds]
<[k->
it's just the value of the symbols s/he is using
roshanavand has joined #ruby
<[k->
:submethod1A, etc
<shevy>
ah ok so symbols
hephaestus_rg has joined #ruby
dikaio has quit [Quit: ........]
roshanavand has quit [Ping timeout: 240 seconds]
jellene4eva has joined #ruby
roshanavand has joined #ruby
ndrei_ has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
favadi has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
leo19 has joined #ruby
rdark has joined #ruby
the_drow has joined #ruby
roshanavand has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
renderf__ has joined #ruby
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
ta has joined #ruby
roshanavand has joined #ruby
yfeldblum has joined #ruby
renderf__ has quit [Ping timeout: 240 seconds]
lenwood has joined #ruby
fullofcaffeine has quit [Ping timeout: 255 seconds]
soc42 has joined #ruby
dmolina has joined #ruby
mdih has quit [Ping timeout: 246 seconds]
tvw has joined #ruby
ndrei_ has quit [Ping timeout: 250 seconds]
TheWhip has joined #ruby
pawnbox has joined #ruby
ndrei has joined #ruby
<moty66>
shevy: not really, I'll check the docs for the select method, thanks
jenrzzz has quit [Ping timeout: 264 seconds]
vdamewood has joined #ruby
arup_r has quit [Remote host closed the connection]
subscope has joined #ruby
shoutsid has quit [Ping timeout: 250 seconds]
shoutsid has joined #ruby
lxsameer has quit [Quit: Leaving]
lxsameer has joined #ruby
jenrzzz has joined #ruby
lalalaaa has joined #ruby
mdih has joined #ruby
mdih has quit [Max SendQ exceeded]
mdih has joined #ruby
mdih has quit [Max SendQ exceeded]
mdih has joined #ruby
TheWhip_ has joined #ruby
sepp2k has joined #ruby
Rollabunna has joined #ruby
jgt has joined #ruby
TheWhip has quit [Ping timeout: 255 seconds]
AnoHito_ has joined #ruby
Prawnzy has joined #ruby
howardg has joined #ruby
neanderslob has quit [Remote host closed the connection]
spider-mario has joined #ruby
<howardg>
good day. lets say there's a function called "fun" whose origin I do not know, is there a way to find out to which module the function belongs at runtime?
Peg-leg has quit [Read error: Connection reset by peer]
solocshaw has quit [Ping timeout: 246 seconds]
matp has joined #ruby
dmolina has joined #ruby
favadi has joined #ruby
<bougyman>
what are the bad things about using /remember=(?<memory>\d+)/ =~ line ?
<bougyman>
I hear that it shouldn't be used, but it's ever so convenient.
<bougyman>
as opposed to MatchData#captures
<jhass>
for the locals?
<bougyman>
yeah.
<jhass>
the bad thing is that it adds locals
<jhass>
do you know any other method call that does that?
<jhass>
how would you like it if it's a common thing?
<bougyman>
well otherwise i'd do a memory = /regex/.match(string)
<bougyman>
and still make a local.
<jhass>
yes. List me the ways you know to create a local variable.
<[k->
you can make it a local because you do not have any other variables named memory in the first place
krisquigley has joined #ruby
<bougyman>
with the named captures trick, and by assignment.
<jhass>
no, in general
Faduo has quit [Ping timeout: 246 seconds]
TheWhip_ has quit [Remote host closed the connection]
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
ah, sorry. so
<jhass>
there's usually one way, assignment
<bougyman>
but there's two.
<bougyman>
(at least)
<jhass>
everything else are special cases you have to learn extra
<jhass>
and constantly check extra
<bougyman>
so the only objection to it is that it's surprising?
<jhass>
it's a quite big objection
<jhass>
say you have FOO =~ bar
howardg has left #ruby [#ruby]
<jhass>
will it create locals? which?
<bougyman>
I have FOO =~ bar
troulouliou_div2 has joined #ruby
<jhass>
will it conflict with other locals? which locals am I safe to use around it?
<jhass>
gotta scroll to wherever that constant is defined to find out
<jhass>
or ignore it and risk subtle bugs
hephaestus_rg has quit [Ping timeout: 260 seconds]
Azure has quit [Read error: Connection reset by peer]
<[k->
you have to check the jungle before you do something
Azure|dc has joined #ruby
<[k->
doing // =~ is an implicit assumption
<jhass>
a big part of keeping methods small is keeping their scope small, the amount of locals you have to track
<jhass>
=~ adds locals to the scope out of potentially nowhere
<[k->
scope is mad, state is mad, checking regexes to see if they had assigned a variable with the name you wanted to use is mad
krisquigley has quit [Ping timeout: 246 seconds]
<[k->
i would want this for perl
<bougyman>
None of these objections are swaying me.
<[k->
code slinging mega quick
<bougyman>
seeing as i'm 1: not using a variable as a regex, 2: using this in a method where the only local var is the one created from the named capture, and 3: prefer the method to be shorter rather than longer.
<[k->
I would now like to quote my teacher
<[k->
We can teach slow students, but we cannot teach stubborn students
<bougyman>
isn't the // =~ more efficient by not having to create a MatchData object, too?
mprelude has joined #ruby
<[k->
yoy
<jhass>
what's $~ ?
skade has quit [Quit: Computer has gone to sleep.]
<jhass>
oh, MatchData object
<jhass>
always there
<bougyman>
jhass: something that doesn't get created til you access it, I thought.
<jhass>
is that so?
<bougyman>
I don't know, I was told that once upon a time in here.
<bougyman>
I didn't look into the guts to verify that.
FrankD has quit [Ping timeout: 260 seconds]
Rollabunna has joined #ruby
Porfa has joined #ruby
roshanavand has quit [Remote host closed the connection]
<jhass>
anyway, I dislike =~, it has a rarely useful return value, I always mistype it as ~= first and it has surprising behavior (you know it, do others reading your code?)
stamina has joined #ruby
roshanavand has joined #ruby
<jhass>
it's 95% String#match and String#[] for me these days
<Porfa>
hello guys.. i've ran into a problem i have no idea on how to handle this… so i have a entry in my database and I'm trying to put that into an array, the entry is a long string with product specifications.. BUT.. for instance, it's a JUG, and one of the specs is… "1,5 Liters" all of the specs are separated by commas so my .split(',') is splitting the JUG capacity :( is there a workaround on this?
User458764 has quit [Ping timeout: 256 seconds]
<bougyman>
hrm.
<bougyman>
binding.local_variable_set is funky
wottam has joined #ruby
dhjondoh has joined #ruby
bubbys has quit [Ping timeout: 256 seconds]
<jhass>
Porfa: sounds like CSV? is it properly escaped?
<Porfa>
hmmmm I'm storing the data on the DB, and i am joining it with (',') so it's my choice… can anyone suggest me another field separator? would it be too bad if i used TILDE as a field separator? or some weird character that i will never ever encounter during one of my scrappings
devoldmx has joined #ruby
<jhass>
Porfa: uhm
<jhass>
why don't you normalize it?
User458764 has joined #ruby
<jhass>
make a table with the fields?
<jhass>
or whatever
herbst has joined #ruby
<Porfa>
oh i see.. so, a different table just to keep the product details, nice
<jhass>
(I have no idea what JUG is btw)
favadi has quit [Ping timeout: 246 seconds]
<Porfa>
JUG is a thing you put liquids in? or is it a MUG? ...
<[k->
a jug
<Porfa>
i though MUG would be small JUG.
<[k->
both can be used
<Porfa>
ok
<jhass>
why do you capitalize it?
<jhass>
makes it look like an acronym
<Porfa>
because i was trying to be more… forget it, I'm just dumb i talk on IRC like i do in real life, sorry man :(
<Porfa>
yeah
<jhass>
you shout whenever you say jug?
Voker57 has joined #ruby
<[k->
use a non breaking space character, that'd be /fun/
Voker57 has quit [Changing host]
Voker57 has joined #ruby
<[k->
or a zero-width space, even
<TTilus>
Porfa: how about you tell us what your app does
<TTilus>
Porfa: and what does your db structure look like now
<workmad3>
norc: there's a couple of cycles in the dependency graph at the lowest levels in ruby, which get bootstrapped into existence in the interpreter with C
fullofcaffeine has quit [Ping timeout: 256 seconds]
Guest40271 has joined #ruby
ndrei has joined #ruby
<norc>
workmad3: Alright. I was worried that I saw a circular dependency when there was none.
<norc>
jhass: Oh yeah, that graph helps.
Pupeno has quit [Ping timeout: 246 seconds]
Guest40271 has quit [Client Quit]
shredding has joined #ruby
herbst has joined #ruby
rodfersou has joined #ruby
DEA7TH has quit [Quit: DEA7TH]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
shredding has quit [Client Quit]
ByronJohnson has quit [Ping timeout: 246 seconds]
shredding has joined #ruby
ByronJohnson has joined #ruby
<[k->
they should make it clear that the arrow head ^ means inherited from
joonty has quit [Quit: joonty]
nateberkopec has joined #ruby
<[k->
i had a natural tendency to think that ^ meant inherits
giuseppesolinas has joined #ruby
rushed has quit [Quit: rushed]
Coldblackice_ has quit [Ping timeout: 240 seconds]
tkuchiki has quit [Remote host closed the connection]
joonty has joined #ruby
shadoi has quit [Quit: Leaving.]
shredding has quit [Remote host closed the connection]
shoutsid has quit [Remote host closed the connection]
shredding has joined #ruby
pontiki has joined #ruby
<ljarvis>
...
<ljarvis>
aren't those the same thing
DEA7TH has joined #ruby
User4587_ has quit [Ping timeout: 264 seconds]
<[k->
oh yea, i meant ... i have no idea
<pontiki>
hi o/
<[k->
oh ^ means is the superclass of
bruno- has quit [Ping timeout: 246 seconds]
steeljav has joined #ruby
doddok has joined #ruby
shoutsid has joined #ruby
<workmad3>
[k-: yeah, it uses an ascii representation of fairly standard UML diagrams there ;)
jgt has joined #ruby
<[k->
not everyone knows uml diagrams
cgfbee has quit [Ping timeout: 255 seconds]
<[k->
(i clearly show i don't)
<beast>
Keep calm and code in Ruby
datanoise has joined #ruby
unshadow has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
cgfbee has joined #ruby
leo19 has quit [Ping timeout: 256 seconds]
joonty has quit [Quit: joonty]
waheedi has quit [Ping timeout: 252 seconds]
waheedi has joined #ruby
datanoise has quit [Ping timeout: 246 seconds]
dionysus69 has joined #ruby
TheTrueBrot has joined #ruby
arup_r has quit [Remote host closed the connection]
davedev24 has joined #ruby
darkxploit has quit [Ping timeout: 252 seconds]
shredding has quit [Ping timeout: 264 seconds]
TheTrueBrot has left #ruby ["Leaving"]
syath has joined #ruby
arup_r has joined #ruby
charliesome has joined #ruby
ndrei has quit [Ping timeout: 268 seconds]
arup_r has quit [Remote host closed the connection]
davedev2_ has joined #ruby
davedev24 has quit [Read error: Connection reset by peer]
Feyn has quit [Ping timeout: 264 seconds]
arup_r has joined #ruby
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup_r_ has joined #ruby
Spami has joined #ruby
Ilyes512 has joined #ruby
ldnunes has joined #ruby
darkxploit has joined #ruby
arup_r has quit [Ping timeout: 240 seconds]
JDiPierro has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
phutchins1 has joined #ruby
leo19 has joined #ruby
phutchins has quit [Read error: Connection reset by peer]
dionysus69 has quit [Read error: Connection reset by peer]
<norc>
jhass: Awesome. I think I have been craving for something like this. :)
ndrei has joined #ruby
lkba has joined #ruby
jokke- has joined #ruby
<cfjk>
hello. what is the best way to set instance variables dynamically? send("#{my_var}=", value)? instance_variable_set("@#{my_var}", value)? is there any other proper or correct way?
jgt has quit [Ping timeout: 240 seconds]
<jhass>
the latter, the former just calls a method that may or not set an instance variable of the same name
<jhass>
if you do that a lot, chances are you meant to use a hash instead
<workmad3>
^^
fullofcaffeine has joined #ruby
<cfjk>
i have to add that all those variables are attr_accessor if that changes anything.
<apeiros>
IMO even if you don't do it often (chances are that you want/should use a hash)
<cfjk>
thank you.
rubybeginner has joined #ruby
tvw has quit [Remote host closed the connection]
<[k->
if those are attr_accessors already, use =
<jhass>
[k-: why?
<apeiros>
job security device through increase of abstraction
patchedmonkey has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shoutsid has quit [Remote host closed the connection]
<moty66>
what do you recommend to use Apache2 or nginx to deploy a rails app on a 2 core server and 2GB of ram? my app uses about 100MB of ram for each process and I expect t oget 1K users each day
pwnd_nfsw has joined #ruby
Timba-as_ has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Timba-as has quit [Ping timeout: 268 seconds]
shoutsid has joined #ruby
PierreRambaud has quit [Remote host closed the connection]
norc has quit [Ping timeout: 246 seconds]
<apeiros>
moty66: 1k users is "low traffic". either should handle it easily.
<apeiros>
(1k/d)
<moty66>
yes, I don't expect to get lot of traffic
DoubleMalt has joined #ruby
<[k->
that is like a slap in the face
<[k->
poor moty66
<moty66>
[k-: 1K is good enough for me :D
beauby has joined #ruby
User458764 has joined #ruby
Rodya_ has joined #ruby
axl_ has joined #ruby
Ankhers has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bruno- has joined #ruby
<moty66>
so apache2 and passenger is a good idea?
Ankhers has joined #ruby
ndrei has quit [Ping timeout: 240 seconds]
p0wn3d_ has joined #ruby
chrissonar has quit [Remote host closed the connection]
tkuchiki has joined #ruby
sankaber has quit [Remote host closed the connection]
<apeiros>
moty66: it works well, yes
<apeiros>
[k-: I don't think that's a slap in the face
sankaber has joined #ruby
<apeiros>
1K/d is more than many sites will get
codeurge has joined #ruby
krisquigley has joined #ruby
nfk|laptop has quit [Quit: yawn]
InternetFriend has joined #ruby
<[k->
i wouldn't know, i wouldn't know
shmoon_ has quit [Quit: Connection closed for inactivity]
simplyianm has joined #ruby
Rickmasta has joined #ruby
<apeiros>
your face would know
rdark has joined #ruby
<moty66>
it also depend on how much each single user pay for your service
marr has joined #ruby
<[k->
your face is a joke!
<moty66>
my customers pay 1024€ each day to use my app
* moty66
is kidding
evanjs has joined #ruby
niftylettuce has joined #ruby
krisquigley has quit [Ping timeout: 246 seconds]
davispuh has quit [Ping timeout: 256 seconds]
jtperreault has quit [Ping timeout: 256 seconds]
chouhoulis has joined #ruby
based_pdev_ has quit [Read error: Connection reset by peer]
WizJin has joined #ruby
auzty has quit [Remote host closed the connection]
karapetyan has joined #ruby
victortyau has joined #ruby
based_pdev has joined #ruby
riotjones has quit [Remote host closed the connection]
ndrei has joined #ruby
decoponio has joined #ruby
skweek has quit [Remote host closed the connection]
jokke- has quit [Ping timeout: 264 seconds]
davedev24 has quit []
chthon has quit [Remote host closed the connection]
pawnbox has joined #ruby
sanguisdex has joined #ruby
patrick_star has quit [Ping timeout: 250 seconds]
darkxploit has quit [Ping timeout: 240 seconds]
davispuh has joined #ruby
jgt has quit [Ping timeout: 264 seconds]
eminencehc has joined #ruby
David27 has joined #ruby
trautwein has quit [Ping timeout: 268 seconds]
ndrei has quit [Ping timeout: 246 seconds]
podman has joined #ruby
noethics has joined #ruby
arup_r has joined #ruby
beauby has quit [Ping timeout: 265 seconds]
atomical has quit [Read error: Connection reset by peer]
atomical_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
r00t_ has joined #ruby
ndrei has joined #ruby
<slash_nick>
moty66: bitcoin trading site?
dionysus69 has quit [Ping timeout: 264 seconds]
<moty66>
no, it is a speakers site, it was really kidding
<slash_nick>
me too :)
KnownSyntax_ has joined #ruby
HammyJammy has joined #ruby
nertzy3 has joined #ruby
alienaut has quit [Remote host closed the connection]
tercenya_ has joined #ruby
JDiPierr_ has joined #ruby
Voker57 has quit []
bubbys has quit [Ping timeout: 240 seconds]
face has joined #ruby
doddok has quit [Ping timeout: 256 seconds]
codeurge has quit [Read error: Connection reset by peer]
JDiPierro has quit [Read error: Connection reset by peer]
faces has quit [Read error: Connection reset by peer]
Kharma has quit [Read error: Connection reset by peer]
flyinprogrammer has quit [Ping timeout: 265 seconds]
leafybasil has joined #ruby
Kharma has joined #ruby
Kharma has quit [Changing host]
Kharma has joined #ruby
Scient has quit [Ping timeout: 265 seconds]
Sigma00 has quit [Ping timeout: 265 seconds]
kurzweil has quit [Ping timeout: 265 seconds]
nitrix has quit [Ping timeout: 265 seconds]
absolutejam has quit [Ping timeout: 265 seconds]
amoeba_ has quit [Ping timeout: 265 seconds]
Antiarc has quit [Quit: No Ping reply in 180 seconds.]
m4rCsi has quit [Quit: No Ping reply in 180 seconds.]
claw has quit [Remote host closed the connection]
KnownSyntax has quit [Read error: Connection reset by peer]
shortdudey123 has quit [Excess Flood]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
last_staff has quit [Quit: last_staff]
darkxploit has joined #ruby
roshanavand has joined #ruby
JammyHammy has quit [Ping timeout: 265 seconds]
nertzy2 has quit [Ping timeout: 265 seconds]
Eiam has quit [Ping timeout: 265 seconds]
Antiarc has joined #ruby
m4rCsi has joined #ruby
absolutejam has joined #ruby
shortdudey123 has joined #ruby
Sigma00 has joined #ruby
devoldmx has joined #ruby
Scient has joined #ruby
doddok has joined #ruby
kurzweil has joined #ruby
gizmore has quit [Ping timeout: 244 seconds]
tercenya has quit [Ping timeout: 265 seconds]
amoeba` has joined #ruby
claw has joined #ruby
roshanavand has quit [Remote host closed the connection]
xcesariox has joined #ruby
patrick_star has joined #ruby
<yorickpeterse>
platzhirsch: ᕕ(ᐛ)ᕗ
<platzhirsch>
thanks
fullofcaffeine has quit [Ping timeout: 246 seconds]
maikowblue has joined #ruby
leafybas_ has joined #ruby
tjohnson has joined #ruby
devoldmx has quit [Ping timeout: 265 seconds]
leafybasil has quit [Ping timeout: 265 seconds]
fullofcaffeine has joined #ruby
baroquebobcat has joined #ruby
Puffball has quit [Ping timeout: 265 seconds]
Puffball has joined #ruby
Guest6328 has joined #ruby
eminencehc has quit [Remote host closed the connection]
DmitryBochkarev has joined #ruby
erasmus has joined #ruby
lxsameer has quit [Quit: Leaving]
eminencehc has joined #ruby
simplyianm has quit [Remote host closed the connection]
atomical_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
atomical has joined #ruby
Pupp3tm4st3r has joined #ruby
mary5030 has joined #ruby
Rollabunna has quit [Quit: Leaving...]
CloCkWeRX has quit [Remote host closed the connection]
joonty has quit [Quit: joonty]
bubbys has joined #ruby
fedexo has joined #ruby
trautwein has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
InternetFriend has joined #ruby
Voker57 has joined #ruby
cantaberry has joined #ruby
Alayde has joined #ruby
p0wn3d_ has quit [Ping timeout: 255 seconds]
fullofcaffeine has quit [Ping timeout: 250 seconds]
p0wn3d_ has joined #ruby
rippa has joined #ruby
astrobunny has quit [Ping timeout: 255 seconds]
anisha has quit [Quit: Leaving]
Jardayn has joined #ruby
joonty has joined #ruby
roshanavand has joined #ruby
datanoise has joined #ruby
tier_ has joined #ruby
The_Phoenix has joined #ruby
fullofcaffeine has joined #ruby
antgel has quit [Ping timeout: 255 seconds]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tier has quit [Ping timeout: 244 seconds]
apt-get has joined #ruby
Pisuke has quit [Quit: WeeChat 1.4-dev]
jas02 has quit [Quit: jas02]
karapetyan has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 246 seconds]
astrobunny has joined #ruby
tynamite___ has joined #ruby
InternetFriend has joined #ruby
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<slash_nick>
arup_r: you could `params[:asset_id].in?(session[:shared_items]) and session[:shared_items].delete(params[:asset_id]) or session[:shared_items] << params[:asset_id]`
<jhass>
ugh, please don't
<[k->
such line
<[k->
why would i even read it
<[k->
>> %%params[:asset_id].in?(session[:shared_items]) and session[:shared_items].delete(params[:asset_id]) or session[:shared_items] << params[:asset_id]%.length
<slash_nick>
jhass: i figured if you didn't like using a ternary for control flow, you'd prefer using the control flow operators or whatever they're called
<[k->
what a nice expression
<jhass>
no, I prefer if/else
<[k->
did you know that in Agda, if then else is a library function
<slash_nick>
[k-: "you can paint gold wings on a piece of shit, but that won't make it fly"
aquiles has joined #ruby
<[k->
not a built in
vondruch has joined #ruby
<[k->
that is too vulgur
blackmesa has joined #ruby
<[k->
and not a nice expression
<apeiros>
and/or aren't control flow
<slash_nick>
[k-: i'm sorry
dagda1_ has joined #ruby
<arup_r>
I went with if/else.. `? :` was a freaking code.. hehehe
<[k->
i wasn't upset
amclain_ has joined #ruby
<[k->
apeiros why are they not?
grenierm has quit [Quit: grenierm]
<[k->
what are they then?
amclain_ has quit [Read error: Connection reset by peer]
krisquigley has quit [Remote host closed the connection]
<eam>
anything flies given enough kinetic energy
<slash_nick>
where the hell are the documented? google finds nothing but SO and blog posts
<apeiros>
they are logic/logical operators
<slash_nick>
apeiros: like && and ||?
<apeiros>
yes. with different precedence.
<[k->
avdi suggested to use them for control flow
<eam>
apeiros: and/or can do control flow
<apeiros>
I guess I disagree with avdi there.
<eam>
you can write any ?: as and/or
TheWhip has joined #ruby
<apeiros>
eam yes, just like ternary can.
<slash_nick>
apeiros: and the other bloggers :/ i know they have different precedence (aren't aliases of each other)
<eam>
and/or/not are buggy in ruby though
<apeiros>
in what way? o0
<eam>
>> [true and false]
dmolina has quit [Quit: Leaving.]
<ruboto>
eam # => /tmp/execpad-7b322bcbbbad/source-7b322bcbbbad:2: syntax error, unexpected keyword_and, expecting ']' ...check link for more (https://eval.in/446362)
<slash_nick>
eam: when you sub them in for && and ||
<eam>
parser is busted
gregf has quit [Quit: WeeChat 1.3]
<apeiros>
interesting
amclain has quit [Ping timeout: 265 seconds]
<slash_nick>
>> [[true and true], [false and false]]
<ruboto>
slash_nick # => /tmp/execpad-f0e908f646f7/source-f0e908f646f7:2: syntax error, unexpected keyword_and, expecting ']' ...check link for more (https://eval.in/446364)
eminencehc has quit [Remote host closed the connection]
<eam>
apeiros: remember back when I was commenting on how absolutely ugly the ruby parser was? I was investigating fixing this
<ruboto>
eam # => /tmp/execpad-fe3461104202/source-fe3461104202:2: syntax error, unexpected keyword_and, expecting ')' ...check link for more (https://eval.in/446370)
<User458764>
jhass like the class strange
<slash_nick>
eam: onoes.
<eam>
slash_nick: f (x) is parsed as f((x))
gregf has joined #ruby
<eam>
ruby's parser :(
<apeiros>
eam: don't really remember. but I remember whitequark's woes
<apeiros>
and I have no difficulty imagining that ruby's parser is horribly complex
<eam>
anyway that's why I avoid and/or/not in ruby, because I keep hitting these weird parse issues
<eam>
apeiros: it's roughly 10x the size of perl's, if that gives any indication
<[k->
yea, the parser is just weird
<[k->
got caught a few times :(
jenrzzz has joined #ruby
kobain has quit [Read error: Connection reset by peer]
<apeiros>
eam: heh, ouch
<workmad3>
eam: how does it compare to a C++ parser? :)
<apeiros>
you're coming from perl? explains why you like and/or for control flow, I guess :D
<eam>
thing() or raise "omg"
devoldmx has quit [Ping timeout: 240 seconds]
<apeiros>
workmad3: does C++ support trigraphs like C?
Eiam has joined #ruby
<eam>
workmad3: no clue
<workmad3>
apeiros: probably
<eam>
to be fair no one builds with trigraph support
<workmad3>
apeiros: a quick check seems to indicate 'yes', as the C++ standard has basically imported a large chunk of the C standard there
<treehug88>
" In C++17, trigraphs wlil be removed but digraphs will remain."
<eam>
I wonder if C++17 will simply not be able to include C headers with trigraphs then (I'm sure there aren't any, because everyone -Wno-trigraphs anyway)
_djbkd has joined #ruby
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
<EdwardIII>
how come "people.each do |p|"? why not "people.each do p"?
<apeiros>
EdwardIII: because the former is valid, the latter isn't
<eam>
huh, acutally trigraphs are already disabled by default in gcc
<eam>
for C
<workmad3>
EdwardIII: because | is the ruby syntax for block parameters
<apeiros>
or well, the latter is valid too, but then you don't get a block param.
tkuchiki has quit [Remote host closed the connection]
<EdwardIII>
you know what seems weird? is that there's two of them
rakm has joined #ruby
<EdwardIII>
this is my first time poking around in ruby, but i've done a lot of python/php/c# etc
jokke has quit [Disconnected by services]
hanmac has quit [Ping timeout: 240 seconds]
evanjs has quit [Quit: Leaving...]
jokke- has joined #ruby
_djbkd has quit [Ping timeout: 240 seconds]
petricore has joined #ruby
<EdwardIII>
the equivalent is js would be people.each(function(p){ p.something }); right?
skade has joined #ruby
<apeiros>
almost, yes
<EdwardIII>
mmm almost? how does it differ?
<apeiros>
the difference being that in js it's an ordinary argument, while in ruby you can only have one of the special block syntax args
last_staff has joined #ruby
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<EdwardIII>
hmm
<apeiros>
you can do people.custom_each(->(p) { p.something }) in ruby too, though. which would be an ordinary argument as well.
<apeiros>
syntactically. but I guess it gives a nice visual effect too.
kp666 has quit [Quit: Leaving]
dagda1_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<EdwardIII>
i'm just curious that's all
dagda1 has joined #ruby
<EdwardIII>
like, what else could be there if not an argument? how come the parser just can't assume "everything after do but before \n means a block argument?"
eminencehc has joined #ruby
<workmad3>
EdwardIII: because '[1,2].each do p "hi" end' is valid
<apeiros>
the fact that the \n is not required
<EdwardIII>
ahhh ok
chipotle has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
<workmad3>
EdwardIII: or '.each { ... }' as well... the same || syntax for args is used for both do/end and {} blocks :)
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Trynemjoel has quit [Ping timeout: 264 seconds]
ta has quit [Remote host closed the connection]
<EdwardIII>
right, got it
inanepenguin has quit [Quit: inanepenguin]
Trynemjoel has joined #ruby
<EdwardIII>
workmad3: what's the p in this? [1,2].each do p "hi" end
datanoise has joined #ruby
InternetFriend has joined #ruby
kobain has joined #ruby
niftylettuce has quit [Quit: Connection closed for inactivity]
<[k->
this is the same case in haskell, \x -> x...
<EdwardIII>
i just wanted to understand it a bit better rather than just slavishly writing it
inanepenguin has joined #ruby
subscope has joined #ruby
pharaoh2 has joined #ruby
towski_ has quit [Ping timeout: 264 seconds]
<EdwardIII>
whenever i've seen blocks being used in ruby, they use the magic $_ to handle that job, right? like my @doubles = map {$_ * 2} @numbers;
<EdwardIII>
so a ruby block is kinda like that but with a proper name, not magic?
s2013 has joined #ruby
towski_ has joined #ruby
<EdwardIII>
er sorry heh
<EdwardIII>
whenever i've seen blocks being used in perl
the_drow has quit [Ping timeout: 246 seconds]
roshanavand has joined #ruby
leat has quit [Ping timeout: 264 seconds]
eminencehc has quit [Remote host closed the connection]
<eam>
EdwardIII: yes, and more to the point it's really @_ in perl
blaxter has quit [Quit: foo]
<eam>
which is the equivilent of def f(*args) in ruby
hooper has joined #ruby
hooper has quit [Max SendQ exceeded]
<EdwardIII>
neat ok got it
<EdwardIII>
thanks chaps
vdamewood has quit [Quit: Life beckons.]
hooper has joined #ruby
hooper has quit [Max SendQ exceeded]
hooper has joined #ruby
leat has joined #ruby
<eam>
because in perl you're write map() like sub mymap(&@) { my ($func, @list) = @_; $func->($_) for @list # so $_ is set }
roshanavand has quit [Ping timeout: 240 seconds]
<eam>
|| is a nice way to structure the my (named args) = @_ boilerplate that perl has
darkf has quit [Quit: Leaving]
pocketprotector2 has quit [Quit: Konversation terminated!]
eminencehc has joined #ruby
<eam>
(and yeah that perl example doesn't work since I did for ...)
billylinder has joined #ruby
sheperson has quit [Quit: sheperson]
Axy has joined #ruby
riotjones has joined #ruby
postmodern has joined #ruby
ladmin has joined #ruby
Mia has quit [Ping timeout: 255 seconds]
ladmin is now known as pocketprotector[
RegulationD has quit [Remote host closed the connection]
icbm has quit [Quit: Leaving]
Trynemjoel has quit [Ping timeout: 250 seconds]
kirun has joined #ruby
Trynemjoel has joined #ruby
riotjones has quit [Ping timeout: 240 seconds]
shoutsid has quit [Ping timeout: 250 seconds]
JDiPierro has joined #ruby
zenguy_pc has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
blackmesa has quit [Client Quit]
iateadonut has quit [Quit: Leaving.]
pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
null_ref has joined #ruby
tkuchiki has joined #ruby
aaeron has joined #ruby
skweek has quit [Remote host closed the connection]
sirecote has joined #ruby
UtkarshRay has quit [Quit: Leaving]
ta has joined #ruby
keypusher has joined #ruby
dopamean_ has joined #ruby
blackmesa has joined #ruby
tomphp has joined #ruby
havenwood has joined #ruby
billylinder has quit [Read error: Connection reset by peer]
ht__ has joined #ruby
shoutsid has joined #ruby
Eiam_ has joined #ruby
bruno- has joined #ruby
nfk has quit [Ping timeout: 240 seconds]
pocketprotector[ has quit [Quit: Leaving]
Asher has joined #ruby
shoutsid has quit [Ping timeout: 240 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
prefixed has joined #ruby
<prefixed>
YO. what's the simplest way to check if a process exists in ruby?
sankaber has quit [Remote host closed the connection]
waheedi has quit [Quit: waheedi]
tkuchiki has quit [Remote host closed the connection]
sankaber has joined #ruby
zenguy_pc has joined #ruby
<jhass>
send the 0 signal with Process.kill I guess
dravine has quit [Ping timeout: 264 seconds]
pocketprotector- has joined #ruby
Pupeno_ has joined #ruby
dravine has joined #ruby
simplyianm has quit [Remote host closed the connection]
based_pdev_ has joined #ruby
shmoon_ has joined #ruby
pocketprotector- has quit [Client Quit]
codecop has joined #ruby
<shmoon_>
any of you make use of state machine ?
Pupeno has quit [Ping timeout: 244 seconds]
Eiam_ has quit [Ping timeout: 265 seconds]
<prefixed>
ok. let's change that question a bit: how can i determine if a program is running in ruby?
rushed has joined #ruby
fullofcaffeine has quit [Ping timeout: 250 seconds]
Porfa has quit [Ping timeout: 246 seconds]
Mia has joined #ruby
<slash_nick>
?
<prefixed>
? is not a valid command
Axy has quit [Ping timeout: 244 seconds]
<slash_nick>
prefixed: i'm confused... you didn't really respond to the suggestion jhass gave you...
krisquigley has joined #ruby
based_pdev has quit [Ping timeout: 268 seconds]
aaeron has quit [Quit: Leaving.]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
or waitpid with WNOHANG apparently
<prefixed>
how can i get a processes' pid without knowing that the process exists?
<prefixed>
this sounds like a chicken / egg issue
<jhass>
eh
<jhass>
if you don't have the pid, how do you identify it?
<apeiros>
how do you identify a process without a pid?
<prefixed>
in linux?
<prefixed>
pgrep
<prefixed>
or ps -ef | grep "program name"
<apeiros>
and you grep for what?
<slash_nick>
i guess parse for a comand name
<jhass>
so your question is "how can I know if any process with the given procname exists"
<prefixed>
pgrep "program name"
<prefixed>
sure
<jhass>
it's not what you asked
RegulationD has joined #ruby
<prefixed>
ok
<prefixed>
good thing you know what i meant now
unclouded has quit [Ping timeout: 240 seconds]
<slash_nick>
high levels of sarcasm detected...
<eam>
prefixed: is it a server?
baweaver has joined #ruby
<prefixed>
yes
<eam>
if it's a server, I suggest using the listen socket as the selector
baweaver has quit [Remote host closed the connection]
<prefixed>
I could just use pgrep, but i'd like a pure-ruby solutiuon
<eam>
much more reliable than grepping the commandline
eminencehc has quit [Remote host closed the connection]
<eam>
prefixed: these are all just wrappers around /proc
bigmac has quit [Ping timeout: 250 seconds]
<jhass>
I'm not aware of a stdlib API that allows to list all processes
<eam>
jhass: there isn't one, not specified by posix =/
<eam>
the commands like ps and so on are, which is why portable code either does the implementation dirty work, or shells out
krisquigley has quit [Ping timeout: 246 seconds]
<eam>
(but the formatting isn't well specified either sooo)
haylon has quit [Ping timeout: 246 seconds]
bigmac has joined #ruby
<eam>
prefixed: fuser -n tcp 80 => list of pids listening on :80
aaeron has joined #ruby
<eam>
if you want to do that in ruby, you'll be looking at /proc/net/tcp and /proc/*/fd/*
eminencehc has joined #ruby
pocketprotector- has joined #ruby
<eam>
that's by far the most reliable way to get the pid of a server
fullofcaffeine has joined #ruby
haylon has joined #ruby
<apeiros>
eam: fuser over lsof?
<eam>
lsof is fine too
<prefixed>
eam sorry. it's not a server. I thought you meant "are you running this code on a server"
<eam>
prefixed: ah
<eam>
prefixed: well, all the data you might use to select a process can be found in /proc - go hunt around and see what you can use
<prefixed>
so, it sounds like check the OS and use pgrep if the environment supports it
<prefixed>
wonderbar
atmosx has quit [Quit: Lost in trance]
atmosx has joined #ruby
ksteck has quit [Ping timeout: 250 seconds]
wldcordeiro has quit [Quit: Konversation terminated!]
sheperson has joined #ruby
<sheperson>
Hi
blackmesa has quit [Quit: WeeChat 1.3]
eminencehc has quit [Remote host closed the connection]
<sheperson>
I am writing a class which is a wrapper around an API
flyinprogrammer has joined #ruby
<sheperson>
there are other methods calling my wrapper class methods
<sheperson>
In the dev environment everything works fine
<sheperson>
but for the test env
<sheperson>
I don’t want to call the API
baweaver has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
Swappticon has joined #ruby
<sheperson>
Any idea about how to do this?
<eam>
speaking of "no stdlib to enumerate processes" -- anyone know why `ps` used to be setuid root on FreeBSD?
<eam>
(it's also the reason why you'd have to recompile userland when upgrading the kernel)
poguez_ has joined #ruby
shoutsid has joined #ruby
hephaestus_rg has joined #ruby
flyinprogrammer has left #ruby [#ruby]
tvw has quit [Read error: Connection reset by peer]
skweek has joined #ruby
weaksauce has joined #ruby
<darix>
prefixed: the cleanest way is to launch the program yourself and then have the program running without daemonize. that way you can easily track it
<keypusher>
prefixed: many processes will write their pid out to a file somewhere. on my servers, they are under /var/run, ymmv
<darix>
and i would look at what bluepill/unicorn do for process management
freezevee has joined #ruby
<jhass>
or god/monit/eye/daemontools/systemd/whatever, but ++ for a supervisor
bb010g has joined #ruby
pharaoh2 has joined #ruby
rodfersou|lunch is now known as rodfersou
<baweaver>
hehe, eye has a mess of a codebase
CrazyEddy has quit [Ping timeout: 255 seconds]
<baweaver>
considered contributing once but man is that thing a monster
<darix>
since i got systemd i stopped using other supervisors
<jhass>
ditto
<jhass>
baweaver: but the least worst config DSL IMO
<baweaver>
perhaps
<baweaver>
I just remember it taking 3 hours to run their "unit" tests
<keypusher>
sheperson: problem is often solved by mocking out the API. you could have static files in your test env that contain json similar to what the API returns, and use those in the mock
<sheperson>
keypusher: Do you know of any examples?
<baweaver>
but still enough of an annoyance that I didn't want to go back after that.
<keypusher>
sheperson: https://github.com/rspec/rspec-mocks you would use something like this i think. the basic idea is to replace certain methods of your class with stubbed/mocked out methods
<keypusher>
sheperson: i've done this in other languages but not personally familiar with the ruby tools for it
<atmosx>
eam: if it were, it would reside in /sbin/ anyway..
ericjphillips has quit [Quit: Leaving.]
<atmosx>
eam: an 'used to be'. No idea.
sepp2k has quit [Quit: Leaving.]
tomchapin has quit [Read error: Connection reset by peer]
tomchapin has joined #ruby
p0wn3d__ has joined #ruby
jackjackdripper has joined #ruby
David27 has quit [Remote host closed the connection]
p0wn3d_ has quit [Ping timeout: 264 seconds]
rushed has quit [Quit: rushed]
dmolina has joined #ruby
<eam>
atmosx: it's not anymore
<eam>
hasn't been since FreeBSD got a /proc ;)
<eam>
it used to open up /dev/kmem and walk the kernel structures directly ...
jackjackdripper has quit [Client Quit]
<EdwardIII>
hmm if i try and access a key that doesn't exist in a hash, it doesn't error?
DoubleMalt has joined #ruby
fullofcaffeine has quit [Ping timeout: 256 seconds]
jackjackdripper has joined #ruby
<EdwardIII>
just returns nil, hmm
<jhass>
EdwardIII: not with #[], some invocations of #fetch do
davedev24 has joined #ruby
gguggi has quit [Ping timeout: 240 seconds]
<eam>
atmosx: which is why you'd have to rebuild userland -- because if those structures changed and ps wasn't aware -- a kernel upgrade could cause it to segv
<jhass>
and nil is just the default, you can set it to other values, see #initialize, #default, #default_proc
fullofcaffeine has joined #ruby
bubbys has joined #ruby
baweaver has quit [Remote host closed the connection]
<EdwardIII>
this is all so flexbile, it's a bit scary heh
_aeris_ has quit [Ping timeout: 264 seconds]
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_aeris_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
tomchapin has joined #ruby
mprelude has joined #ruby
p0wn3d_ has joined #ruby
mwlang has quit [Quit: mwlang]
`based_pdev` has joined #ruby
p0wn3d__ has quit [Read error: Connection reset by peer]
giuseppesolinas has joined #ruby
riotjones has joined #ruby
Guest53 has joined #ruby
tangentstorm has quit [Ping timeout: 255 seconds]
cdg has quit [Remote host closed the connection]
eminencehc has quit [Remote host closed the connection]
cdg has joined #ruby
skade has joined #ruby
eminencehc has joined #ruby
based_pdev_ has quit [Ping timeout: 260 seconds]
gizmore has quit [Ping timeout: 250 seconds]
leafybas_ has quit [Remote host closed the connection]
leafybasil has joined #ruby
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cdg has quit [Ping timeout: 240 seconds]
riotjones has quit [Ping timeout: 256 seconds]
ericjphillips has joined #ruby
fullofcaffeine has quit [Ping timeout: 256 seconds]
p0wn3d__ has joined #ruby
p0wn3d_ has quit [Read error: Connection reset by peer]
naftilos76 has joined #ruby
anisha has joined #ruby
rushed has joined #ruby
sepp2k has joined #ruby
fullofcaffeine has joined #ruby
rushed has quit [Client Quit]
Macaveli has joined #ruby
Macaveli has quit [Max SendQ exceeded]
rushed has joined #ruby
User4587_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
Macaveli has joined #ruby
EllisTAA has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
michaeldeol has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
inanepenguin has quit [Ping timeout: 252 seconds]
s2013 has joined #ruby
s2013 has quit [Client Quit]
atomical has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 250 seconds]
ndrei has joined #ruby
diegoviola has joined #ruby
ta has quit [Quit: Leaving...]
atomical has joined #ruby
tangentstorm has joined #ruby
InternetFriend has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
ericjphillips has quit [Quit: Leaving.]
User458764 has quit [Ping timeout: 264 seconds]
inanepenguin has joined #ruby
_el_fer_ has quit [Quit: Leaving]
gizmore has joined #ruby
devoldmx has joined #ruby
paulcsmith has joined #ruby
jamesaxl has joined #ruby
inanepenguin has quit [Client Quit]
alveric has joined #ruby
rushed has quit [Quit: rushed]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tangentstorm has quit [Ping timeout: 250 seconds]
bap1313 has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xaoz has joined #ruby
Agoldfish has joined #ruby
ta has joined #ruby
xaoz has quit [Remote host closed the connection]
pharaoh2 has joined #ruby
simplyianm has joined #ruby
dstarh has joined #ruby
nKulo has quit [Read error: Connection reset by peer]
diegoviola has quit [Quit: WeeChat 1.3]
tier_ has quit [Ping timeout: 246 seconds]
sdwrage has quit [Quit: Leaving]
SenpaiSilver has quit [Ping timeout: 244 seconds]
Agoldfish has quit [Client Quit]
jessemcgilallen has joined #ruby
devoldmx has quit [Ping timeout: 268 seconds]
tier has joined #ruby
Kendos-Kenlen has quit [Quit: Konversation terminated!]
zenguy_pc has joined #ruby
jessemcgilallen has quit [Client Quit]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rushed has joined #ruby
gusTester has quit [Quit: Leaving.]
Kendos-Kenlen has joined #ruby
n008f4g_ has quit [Ping timeout: 272 seconds]
datanoise has quit [Ping timeout: 272 seconds]
__main__ has quit [Ping timeout: 250 seconds]
BlackCoyote has joined #ruby
chandlerbing has joined #ruby
dagda1_ has joined #ruby
patchedmonkey has joined #ruby
gusTester has joined #ruby
chino has joined #ruby
<prefixed>
does RUBY_PLATFORM not work in some environments?
__main__ has joined #ruby
jenrzzz has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
tangentstorm has joined #ruby
mikecmpbll has joined #ruby
<shevy>
you have so many fake questions prefixed
blueOxigen has quit [Ping timeout: 264 seconds]
agit0 has joined #ruby
<prefixed>
this is a real question
<prefixed>
It looks like it works on my platform.
<shevy>
you don't have any "real" questions
<prefixed>
stop
<shevy>
you probably scavenge on stackoverflow for some arbitrary fake ones to ask and waste people's time
<prefixed>
that'd be pretty insidious actually. nice
tuxero has quit [Ping timeout: 255 seconds]
<prefixed>
look for the most downvoted questions to ask in here
SenpaiSilver has joined #ruby
<pipework>
Crowdsourcing answers so you can claim the internet points? Lul.
* shevy
downvotes prefixed
aquiles has quit [Ping timeout: 252 seconds]
<prefixed>
pipework ?
karapetyan has quit [Remote host closed the connection]
<prefixed>
anyway, so i take it you have no idea what RUBY_PLATFORM is about shevy
karapetyan has joined #ruby
<pipework>
I don't understand why people think "?" is a response that's ever worth giving.
rushed has quit [Quit: rushed]
<shevy>
prefixed you don't want to know, that is the problem
<prefixed>
pipework it means: "your statement was unclear. please rephrase"
Kendos-Kenlen_ has joined #ruby
<pipework>
prefixed: ?
<shevy>
prefix: ?
<shevy>
ack
<shevy>
prefixed: ?
Trynemjoel has quit [Ping timeout: 264 seconds]
cornerma1 has joined #ruby
p0wn3d__ has quit [Ping timeout: 250 seconds]
<pipework>
It doesn't say what was misunderstood or where the confusion is. It's a useless response.
jokke| has joined #ruby
jokke- has quit [Read error: Connection reset by peer]
fullofcaffeine has quit [Ping timeout: 240 seconds]
<pipework>
I usually just ignore the person until they come up with a cogent question that's actually informing about their confusion
jokke| is now known as jokke
Trynemjoel has joined #ruby
<prefixed>
shevy i think you are a bot
<apeiros>
prefixed: where did this question come up for you?
DEA7TH has joined #ruby
tobyx has quit [Remote host closed the connection]
<prefixed>
apeiros I'm trying to detect my OS flavor. Stackoverflow suggests all of these seemingly-overcomplicated methods. I don't understand why people don't just use RUBY_PLAYFORM
<prefixed>
*RUBY_PLATFORM
<shevy>
a playform
Kendos-Kenlen has quit [Ping timeout: 264 seconds]
cornerman has quit [Ping timeout: 272 seconds]
cornerma1 is now known as cornerman
<apeiros>
prefixed: I'd use a gem. those usually use RUBY_PLATFORM and/or something from rbconfig
chandlerbing has quit [Quit: I'm your father...]
<prefixed>
is RUBY_PLATFORM not bullet-proof? if so, why not?
<apeiros>
but reinventing that yourself is prone to error. e.g. mistakes like =~ /win/ -> windows - whoops, wrong. darwin matches too.
fullofcaffeine has joined #ruby
Coldblackice_ has joined #ruby
aquiles has joined #ruby
tobyx has joined #ruby
AccordLTN has quit []
__main__ has quit [Ping timeout: 265 seconds]
Outlastsheep has quit [Ping timeout: 240 seconds]
Soda has quit [Remote host closed the connection]
__main__ has joined #ruby
ascarter_ has joined #ruby
ascarter has quit [Read error: Connection reset by peer]
jsrn has quit [Ping timeout: 241 seconds]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
renderf__ has quit [Remote host closed the connection]
goldfish6744 has joined #ruby
syath has quit [Quit: WeeChat 1.2]
Oog has joined #ruby
inanepenguin has joined #ruby
Rickmasta has joined #ruby
Kyhz has joined #ruby
hhuijhfdcghhjj has quit [Read error: Connection reset by peer]
fullofcaffeine has quit [Read error: Connection reset by peer]
QORRiE has joined #ruby
Jackneill has quit [Remote host closed the connection]
Kendos-Kenlen_ has quit [Ping timeout: 250 seconds]
lxsameer has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
jamesaxl has quit [Ping timeout: 246 seconds]
fullofcaffeine has joined #ruby
eminencehc has quit [Remote host closed the connection]
havenn has joined #ruby
<shevy>
yeah, ruby can be very terse
ndrei has joined #ruby
eminencehc has joined #ruby
havenwood has quit [Ping timeout: 240 seconds]
Pupeno_ has quit [Remote host closed the connection]
NeverDie has joined #ruby
doddok has quit [Ping timeout: 260 seconds]
nuck has joined #ruby
User458764 has joined #ruby
adac has quit [Ping timeout: 268 seconds]
nettoweb has joined #ruby
krisquigley has joined #ruby
Kendos-Kenlen has joined #ruby
hobodave has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 240 seconds]
renderf__ has joined #ruby
naftilos76 has quit [Quit: Αποχώρησε]
User458764 has quit [Ping timeout: 265 seconds]
skade has quit [Quit: Computer has gone to sleep.]
krisquigley has quit [Ping timeout: 240 seconds]
skade has joined #ruby
craysiii has joined #ruby
bap1313 has joined #ruby
naftilos76 has joined #ruby
Oog has quit []
<haylon>
Hey everyone, what would putting a class in a class get me? I'm trying to think of a way to put an object in an object. Does that sound like a good idea, or should I look for something different?
<pipework>
haylon: 'get me' in what way?
wnd has quit [Ping timeout: 260 seconds]
<haylon>
could I create an object inside of an object?
<pipework>
You can have usages of the `class` keyword inside a class that's also using the `class` keyword.
<haylon>
I'm not sure if that's how that works
<pipework>
haylon: You can always create objects in objects.
<pipework>
haylon: What do you have for code?
tier has quit [Ping timeout: 265 seconds]
<haylon>
Nothing yet, pseudo coding, and planning
ericjphillips has quit [Quit: Leaving.]
<pipework>
haylon: Ah, well, when you get to code, we'll be here.
<haylon>
Thanks for your input though pipework
<haylon>
I most definitely will. I needed to rubber ducky with someone who knew what I was asking
TheWhip has joined #ruby
BlackCoyote has quit [Ping timeout: 272 seconds]
prestorium has quit [Quit: Leaving]
`tim` has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ddtblues has quit []
JDiPierro has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 268 seconds]
naftilos76 has quit [Quit: Αποχώρησε]
doddok has joined #ruby
shmilan has joined #ruby
noodles`` has joined #ruby
Rutix has quit []
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tangentstorm has quit [Ping timeout: 265 seconds]
freezevee has quit [Ping timeout: 256 seconds]
northfurr has quit [Quit: northfurr]
noodles`` has left #ruby [#ruby]
lenwood has joined #ruby
<BraddPitt>
can anyone help me with a design decision for a gem I'm making? Not really asking about code, per se
JM_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
<havenn>
BraddPitt: I'm for it!
<treehug88>
don't ask to ask
<BraddPitt>
ah, right. Was making sure this was the right place. Anyways, let me explain quickly
havenn is now known as havenwood
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
asxbr has joined #ruby
BlackCoyote has joined #ruby
<BraddPitt>
I'm making a gem quite similar to Hashicorps Vault. It encrypts secrets.yml, stores it in S3, and allows a client to retrieve and decrypt. I have all that down fine
<BraddPitt>
my question is, in order for that to happen the user needs to supply their S3 credentials
sankaber has quit [Read error: Connection reset by peer]
renderf__ has quit []
sankaber has joined #ruby
<BraddPitt>
so should I have them supply this by command line (dont like because of bash history), supply in the same secrets.yml file that gets encyrpted and uploaded (feels like security theater) or have them supply it in a 2nd secrets.yml file that never gets uploaded anywhere
mdih has joined #ruby
spcmastertim has quit [Quit: Leaving]
wnd has joined #ruby
yardenbar has quit [Ping timeout: 252 seconds]
<jhass>
well, what's the point of uploading, backup or is there a retrieval story?
asxbr has quit [Ping timeout: 252 seconds]
galeido has quit [Quit: leaving]
karapetyan has joined #ruby
fullofcaffeine has quit [Ping timeout: 260 seconds]
sankaber has quit [Client Quit]
<BraddPitt>
retrieval, yes
AccordLTN has joined #ruby
<darix>
jhass: nobody wants backup, everyone just wants restore.
<darix>
:p
<BraddPitt>
the idea is you add fellow team members as an authenticated IAM user (or whitelist an IP range in AWS) so they can get the secrets.yml for the project without having to pass it around offline
<jhass>
so if you put the into the file that's uploaded itself, how would that look?
haylon has quit [Quit: Leaving]
<jhass>
given it wasn't downloaded yet, so it's not an update
tangentstorm has joined #ruby
dikaio has joined #ruby
<BraddPitt>
what do you mean, how would it look?
ldnunes has quit [Quit: Leaving]
<jhass>
you need the keys to download it, right?
<jhass>
or is the S3 public?
<BraddPitt>
you need the "master key" to decrypt, and valid AWS credentials for that S3 bucket
anisha has joined #ruby
<BraddPitt>
that is up to the user but most likely it will be private
<dorei>
it's so funny i can't resist spamming it to you xD
<BraddPitt>
the more I think about it, the more I think it makes sense to have a 2nd yml file that holds master key and S3 credentials
<jhass>
so, what's the UX for when doing the initial download, where do the credentials come from if they're stored in the file to be downloaded?
k3asd` has joined #ruby
<BraddPitt>
no UX, it is a rake task that auto loads it into ENV hash
<goldfish6744>
then why not a challenge-response authentication? That way the decryption key never needs to leave the server, and the user still can have access...
Guest53 has joined #ruby
KensoDev has joined #ruby
<jhass>
UX means user experience, that's not limited to GUIs
<jhass>
a CLI is a UI too
<BraddPitt>
rake install or rake refresh
<BraddPitt>
the latter simply updates it
Pumukel has quit [Remote host closed the connection]
galeido has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
apt-get has quit [Ping timeout: 252 seconds]
<jhass>
shall I ask my question a third time?
fullofcaffeine has joined #ruby
<BraddPitt>
i'm sorry, i don't intend to be vague
<BraddPitt>
I'm not sure I understand what exactly you're requesting
<BraddPitt>
oh
<BraddPitt>
oh
<BraddPitt>
shit
<BraddPitt>
im an idiot
<BraddPitt>
I just re-read your question
<BraddPitt>
ok
<BraddPitt>
well I think that solves it. There should be 2 yml files. 1 has the contents of your secrets and gets de/encrypted, the other simply has the master password for crypto and S3 credentials for the client. The latter never leaves your local machine
<BraddPitt>
does this seem sane?
<jhass>
sounds about right
<jhass>
might even put the latter in $XDG_CONFIG_HOME
<craysiii>
seems like security through obscurity
<BraddPitt>
thanks jhass, sometimes it just helps to bounce an idea around and talk about it
xcesariox has joined #ruby
<pipework>
I'd really consider something closer to goldfish6744, unless you like having to re-encrypt when someone is no longer allowed to access the data.
<BraddPitt>
yes pipework that was the original idea (to re-encrypt)
<BraddPitt>
goldfish6744 can you expand on your idea?
tomphp has joined #ruby
<pipework>
A challenge-response would allow you to not have to decrypt and not expose the master key. The only thing you'd expose is the actual passphrases they've been able to access that are sent to the client.
<jhass>
something that might work better for your design over S3 is to require your team members to have an openpgp key and encrypt for each
<jhass>
could even go as far and integrate over something like keybase and validate the associated github account
<pipework>
When someone leaves you'll have to change the encrypted secrets, but you'd not have to change the symmetric key which the secrets are encrypted with.
Timba-as_ has joined #ruby
eminencehc has quit [Remote host closed the connection]
<BraddPitt>
I'm not tied to S3 btw, I chose it because it has easy to implement envelope encryption
<BraddPitt>
in fact, the upload destination would (ideally) be left up to the user
dfockler has quit [Quit: Leaving]
dfockler has joined #ruby
<goldfish6744>
BraddPitt, it's how my bank login ID passkey device works like, sort of. The bank, at login, sends you a challenge value (it's a max 8-digit wide number), you type that and your PIN code into the device, and with these two you get a number that's sent back to the bank. They always result in the same hash (by whatever mechanism they use) in the end, so the bank needs to only compare those two.
<jhass>
but then I mean they'll have the plaintext keys on their machines anyway, you'll have to change all shared credentials if you want to truly revoke, not just prevent access to new credentials
<goldfish6744>
Then it uses its own password to decrypt the stuff you need
[k- has quit [Ping timeout: 264 seconds]
<pipework>
What I'm curious about but haven't explored myself is how does meldium not hand credentials for a service whose credentials are encrypted in meldium to a team member in a way that would cause you to need to change the service credentials if they leave?
lenwood has quit [Ping timeout: 256 seconds]
kirun has quit [Quit: Client exiting]
existensil has quit [Quit: WeeChat 0.4.2]
rodfersou has quit [Quit: leaving]
<jhass>
I'd love to see more DNSSEC based auth schemes developed. Just list allowed public keys in your DNS, tell services the names that are allowed access, service fetches public key from there, poses challenge to client, client signs challenge, service validates
existensil has joined #ruby
eikood has joined #ruby
<jhass>
revoke access? tell service a name has no longer access
<jhass>
change key? just update the DNS
eminencehc has joined #ruby
arup_r has quit [Quit: Leaving]
shoutsid has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
shmilan has quit [Ping timeout: 240 seconds]
btrs has quit [Quit: Page closed]
mary5030 has joined #ruby
symm-_ has joined #ruby
[Butch] has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
symm- has quit [Ping timeout: 260 seconds]
mary5030 has joined #ruby
<BraddPitt>
jhass with my current implementation they will have the plaintext secrets.yml regardless
arthurix_ has joined #ruby
<BraddPitt>
but, as most companies currently operate, this is how it is anyways
<jhass>
yeah
<jhass>
damn shared credentials everywhere
<jhass>
kinda sad
<BraddPitt>
I mean, regardless, if someone really wanted it they could just print out the ENV hash
<BraddPitt>
its a hard problem to solve
<jhass>
the hard problem is solved, the open stuff is building nice integrations and UX
freerobby has quit [Quit: Leaving.]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 252 seconds]
arthurix has quit [Ping timeout: 240 seconds]
newdan has quit [Ping timeout: 272 seconds]
datanoise has quit [Ping timeout: 244 seconds]
troulouliou_dev has quit [Quit: Leaving]
Voker57 has quit [Read error: Connection reset by peer]
symm-_ has quit [Ping timeout: 265 seconds]
Prawnzy has quit [Ping timeout: 268 seconds]
<pipework>
jhass: That works for services that either implement that or you control, but most places just do username+password(+totp)
<jhass>
that's what I mean with integrations
<pipework>
Oh gotcha.
<pipework>
It seems tedious to automate password resets through existing systems though.
k3asd` has quit [Ping timeout: 260 seconds]
shoutsid has joined #ruby
kache has joined #ruby
umgrosscol has quit [Ping timeout: 240 seconds]
kache has left #ruby [#ruby]
k3asd` has joined #ruby
paulcsmith has quit [Quit: Be back later ...]
<jhass>
you'd basically replace "enter password" with "enter public key" or better just derive a hostname based on the mail address to retrieve it (me@jhass.eu -> me._pka.jhass.eu TXT) during registration, the WebCryptoAPI then should make login fairly painless too, challenge -> sign challenge -> validate signature
<pipework>
I mean, I get it.
<jhass>
CLI tools could hook into gpg
<pipework>
I've even implemented a neat enough TLS mutual auth system
diegoaguilar_ has joined #ruby
chino has joined #ruby
fullofcaffeine has quit [Read error: Connection reset by peer]
shoutsid has quit [Remote host closed the connection]
<chino>
i tried that but for example let's assume a layout like A > B > C where it's defined on an A and not B
wottam has joined #ruby
<jhass>
then you want false?
<chino>
like manually walking the superclass chain just felt like I was doing something wrong
skullcrasher has joined #ruby
<drbrain>
chino: defined? super is the check you want, but you shouldn't care if your parent, grantparent, great-great-grandparent, etc. has an implementation you can super to
subscope has quit [Remote host closed the connection]
<chino>
I agree I don't really want to care but I do want to call it if it exists
<jhass>
superclass.instance_methods(false).include?(__method__) # if you care, I guess
shoutsid has quit [Remote host closed the connection]
anisha has quit [Ping timeout: 250 seconds]
<chino>
oh interesting didn't even know that instance_methods has a include_super arg
davedev2_ has joined #ruby
davedev24 has quit [Ping timeout: 246 seconds]
<jhass>
must stuff has, methods, respond_to?
<jhass>
*most
<chino>
I did get this to work by crawling the superclass chain but it just felt like I shouldn't have to do that
<chino>
let me try out the define? super
matp has quit [Ping timeout: 250 seconds]
shevy has quit [Quit: ""]
wottam has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
beast has quit [Quit: Leaving]
<drbrain>
>> class A; def m() defined? super; end; end; class B < A; def m() [defined? super, super] end; end; B.new.m
inteq has quit [Remote host closed the connection]
fullofcaffeine has quit [Ping timeout: 256 seconds]
matp has joined #ruby
victortyau has quit [Quit: Leaving]
ksteck has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
devoldmx has joined #ruby
hephaestus_rg has quit [Ping timeout: 260 seconds]
Swappticon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fullofcaffeine has joined #ruby
e1senhorn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
balazs_ has quit [Ping timeout: 265 seconds]
jenrzzz_ has joined #ruby
minimalism has joined #ruby
tahon__ has joined #ruby
JDiPierro has joined #ruby
benlieb has quit [Quit: benlieb]
QORRiE has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 250 seconds]
shoutsid has joined #ruby
<chino>
I wonder if the Method#super_method implementation/docs makes sense given this behavior? Ruby docs say, "Returns a Method of superclass, which would be called when super is used". Which to me gave me the impression that it would only return a value if super() would actually work at that moment?
devoldmx has quit [Ping timeout: 252 seconds]
djcp has joined #ruby
Seich has quit [Ping timeout: 240 seconds]
lkba_ has joined #ruby
Timba-as_ has quit [Quit: Be back later ...]
baweaver has quit [Remote host closed the connection]
<chino>
well I guess since the Method returned was B's then it did work properly it's just confusing
<dorei>
chino: it says it returns a method, so i guess it does that
<dorei>
hmm
<chino>
ok well thanks for help
lkba has quit [Ping timeout: 250 seconds]
shoutsid has quit [Remote host closed the connection]
riotjones has joined #ruby
Azure has quit [Excess Flood]
User4587_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
xcesariox has quit [Read error: Connection reset by peer]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomchapin has joined #ruby
Pumukel has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
agent_white has joined #ruby
<jhass>
chino: in relation to the given Method object. whether you obtained the "right" Method object is a distinct issue from #super_method
<chino>
right
riotjones has quit [Ping timeout: 246 seconds]
<jhass>
so the question is rather which Method object #method inside a super call should return
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
now #method is a normal method call itself, if it changes behavior depending on the invocation of the method it is called from, that might be equally confusing
tahon__ has quit []
prefixed has quit [Ping timeout: 250 seconds]
<jhass>
say you have def x; method(:y); end; and an override for y in in the subclass and x called through super, would you not expect it to return the y of the subclass?
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shoutsid has joined #ruby
baweaver has joined #ruby
htmldrum has joined #ruby
Rickmasta has quit [Read error: Connection reset by peer]
<chino>
right I agree
fullofcaffeine has quit [Ping timeout: 256 seconds]
<chino>
honestly I never ever used defined? before
<jhass>
s/before// for me
axl_ has quit [Quit: axl_]
<jhass>
haven't decided yet if I'd use it or just rescue in your case yet
Rickmasta has joined #ruby
cdg has quit [Remote host closed the connection]
spider-mario has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
devdazed has quit [Quit: Computer has gone to sleep.]
ngscheurich has quit [Ping timeout: 240 seconds]
__chris has joined #ruby
chipotle has quit [Quit: cheerio]
<chino>
rescue crossed my mind but I just felt there should be a way to check similar to block_given?
infernix has joined #ruby
neanderslob has joined #ruby
Pumukel has quit [Quit: ChatZilla 0.9.92 [Firefox 41.0.1/20150929144111]]
cwong_on_irc has joined #ruby
patchedmonkey has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cwong_on_irc>
how do i do a if staetment that will be like: if file exist AND shell output returns none 0?. so like the file /path/to/file exist, AND the command output failed, do x
phutchins1 has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djcp has quit [Ping timeout: 246 seconds]
pocketprotector- is now known as Al-Qaeda
benlieb has joined #ruby
Al-Qaeda is now known as pocketprotector-
shoutsid has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 240 seconds]
havenwood has joined #ruby
michaeldeol has joined #ruby
axl_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]
shoutsid has joined #ruby
datanoise has joined #ruby
axl_ has quit [Client Quit]
dopamean_ has quit [Ping timeout: 265 seconds]
_aeris_ has quit [Ping timeout: 265 seconds]
_aeris_ has joined #ruby
yfeldblum has joined #ruby
<`based_pdev`>
wat
eminencehc has quit [Remote host closed the connection]
jenrzzz has joined #ruby
shoutsid has quit [Remote host closed the connection]
yfeldblu_ has quit [Ping timeout: 260 seconds]
nateberkope has joined #ruby
based_pdev_ has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
eminencehc has joined #ruby
mosez has quit [Ping timeout: 256 seconds]
unshadow has quit [Ping timeout: 244 seconds]
ekleog has quit [Ping timeout: 244 seconds]
mosez has joined #ruby
unshadow has joined #ruby
ekleog has joined #ruby
[Butch] has quit [Read error: Connection reset by peer]
`based_pdev` has quit [Ping timeout: 240 seconds]
SCHAAP137 has quit [Quit: Leaving]
nateberkopec has quit [Ping timeout: 250 seconds]
<havenwood>
cwong_on_irc: if File.exist?(path) && !system(cmd, path)
mordocai has quit [Remote host closed the connection]
dmolina has quit [Quit: Leaving.]
davedev2_ has quit [Read error: Connection reset by peer]
dfockler has quit [Ping timeout: 252 seconds]
fedexo has quit [Ping timeout: 240 seconds]
davedev24 has joined #ruby
<havenwood>
cwong_on_irc: Kernel#system returns `false` for non-zero exit statuses.
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]