dlitvak has quit [Remote host closed the connection]
sankaber has joined #ruby
nerfando has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has quit [Client Quit]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
johnbburg has joined #ruby
fourq|away is now known as fourq
northfurr has quit [Read error: Connection reset by peer]
fourq is now known as fourq|away
fourq|away is now known as fourq
sakix has joined #ruby
nerfando has quit [Ping timeout: 256 seconds]
fourq is now known as fourq|away
<carella>
I still cant understand how one can safely use fiddle, because to me object_id to memory address conversion implementation is a subject for change
northfurr has joined #ruby
pdoherty has joined #ruby
fourq|away is now known as fourq
fourq is now known as fourq|away
fourq|away is now known as fourq
chris2 has quit [Ping timeout: 256 seconds]
fourq is now known as fourq|away
johnbburg has quit [Client Quit]
baweaver has quit [Remote host closed the connection]
sakix has quit [Ping timeout: 245 seconds]
northfurr has quit [Read error: Connection reset by peer]
SCHAAP137 has quit [Remote host closed the connection]
johnbburg has joined #ruby
tvw has quit [Remote host closed the connection]
devbug has joined #ruby
tjohnson has joined #ruby
astron has quit [Quit: Leaving]
hannelita has quit [Remote host closed the connection]
fourq|away is now known as fourq
mwlang has quit [Quit: mwlang]
<carella>
There's more!
<carella>
> ObjectSpace._id2ref(-62)
<carella>
=> 1.9999999999999982
x0f_ has joined #ruby
kalopsian has quit [Ping timeout: 240 seconds]
jackjackdripper has quit [Quit: Leaving.]
pawnbox has joined #ruby
nerfando has joined #ruby
x0f has quit [Ping timeout: 276 seconds]
<bnagy>
Darmani: probably you want sub or gsub
fsapo has quit [Remote host closed the connection]
kalopsian has joined #ruby
chouhoul_ has quit []
ur5us has joined #ruby
howdoicomputer has joined #ruby
pawnbox has quit [Ping timeout: 255 seconds]
chouhoulis has joined #ruby
nerfando has quit [Ping timeout: 245 seconds]
x0f_ has quit [Ping timeout: 264 seconds]
PaulCapestany has quit [Quit: .]
jbrhbr has quit [Quit: Leaving.]
<Ox0dea>
>> s = 'This is not cool.'; s['not'] = 'kinda'; s # Darmani
mistermocha has quit [Remote host closed the connection]
nerfando has joined #ruby
dlitvak has quit [Remote host closed the connection]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ropeney has quit [Ping timeout: 245 seconds]
babblebre has quit [Quit: Connection closed for inactivity]
dlitvak has joined #ruby
fourq is now known as fourq|away
hxegon has quit [Ping timeout: 240 seconds]
cicloid_ has joined #ruby
nerfando has quit [Ping timeout: 276 seconds]
dlitvak has quit [Remote host closed the connection]
dlitvak has joined #ruby
cicloid has quit [Ping timeout: 260 seconds]
fourq|away is now known as fourq
Domaldel has joined #ruby
ferr has quit [Ping timeout: 256 seconds]
dstarh has joined #ruby
ur5us has quit [Remote host closed the connection]
dlitvak has quit [Remote host closed the connection]
northfurr has joined #ruby
jam_ has joined #ruby
baweaver has joined #ruby
akem has quit [Remote host closed the connection]
johnbburg has joined #ruby
zambini has quit [Quit: Leaving.]
Spami has quit [Quit: This computer has gone to sleep]
Pupeno has quit [Read error: Connection reset by peer]
dfinninger has joined #ruby
Pupeno has joined #ruby
Domaldel has quit [Quit: Leaving]
baweaver has quit [Ping timeout: 240 seconds]
nerfando has joined #ruby
zeroDivisible has quit [Quit: WeeChat 1.3]
Rodya_ has joined #ruby
krobzaur has joined #ruby
bronson has quit [Remote host closed the connection]
marcdel has joined #ruby
Cyrus has quit [Quit: Leaving]
ur5us has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
mistermocha has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
nerfando has quit [Ping timeout: 272 seconds]
rkazak has joined #ruby
Cyrus has joined #ruby
mistermocha has quit [Ping timeout: 245 seconds]
__chris has joined #ruby
<__chris>
Hi
<__chris>
Is there an enumerable method that will return a single value?
Moblin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmes1 has joined #ruby
tomchapin has joined #ruby
northfurr has quit [Ping timeout: 250 seconds]
<__chris>
[1,2,3,4].<method> { |v| "Test" if v == 3; break }
<__chris>
I would like to break out of the loop and return a value
<monoprotic>
why not test if the specific element is in the array
<Cohedrin>
__chris .find
<__chris>
just found detect/find thanks
northfurr has joined #ruby
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
northfurr has quit [Read error: Connection reset by peer]
nerfando has joined #ruby
northfurr has joined #ruby
solocshaw has quit [Quit: solocshaw]
huluhuluhulu has joined #ruby
blackmes1 has quit [Ping timeout: 255 seconds]
Bloomer has joined #ruby
solocshaw has joined #ruby
nerfando has quit [Ping timeout: 260 seconds]
howdoicomputer has joined #ruby
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fourq is now known as fourq|away
jam_ has quit [Remote host closed the connection]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sperant has joined #ruby
emilford has quit [Ping timeout: 276 seconds]
Pupeno has quit [Remote host closed the connection]
yqt has quit [Ping timeout: 276 seconds]
emilford has joined #ruby
guacamol_ has quit [Quit: My face has gone to sleep. ZZZzzz…]
nerfando has joined #ruby
lkba has quit [Read error: Connection reset by peer]
devbug has quit [Ping timeout: 240 seconds]
djbkd has quit [Remote host closed the connection]
lkba has joined #ruby
lkba has quit [Remote host closed the connection]
dfinninger has quit [Remote host closed the connection]
lkba has joined #ruby
marcdel has quit [Ping timeout: 260 seconds]
segmond has joined #ruby
nerfando has quit [Ping timeout: 265 seconds]
djbkd has joined #ruby
iateadonut has quit [Ping timeout: 272 seconds]
waka has quit [Quit: Leaving]
jbrhbr has quit [Quit: Leaving.]
jbrhbr has joined #ruby
cashnguns has joined #ruby
beast has quit [Quit: Leaving]
johnbburg has quit [Quit: Leaving.]
djbkd has quit [Ping timeout: 256 seconds]
dfinninger has joined #ruby
Darmani has quit [Ping timeout: 252 seconds]
Melpaws has joined #ruby
mondok has joined #ruby
krobzaur has quit [Quit: WeeChat 1.2]
jbrhbr has quit [Quit: Leaving.]
j_mcnally has joined #ruby
sperant has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
huluhuluhulu has quit [Quit: huluhuluhulu]
huluhuluhulu has joined #ruby
huluhuluhulu has left #ruby [#ruby]
psy_ has quit [Ping timeout: 245 seconds]
sakix has joined #ruby
sperant has joined #ruby
zambini has joined #ruby
psy_ has joined #ruby
bronson has joined #ruby
psy_ has quit [Max SendQ exceeded]
sperant has quit [Client Quit]
psy_ has joined #ruby
zambini has quit [Client Quit]
robbyoconnor has quit [Quit: Konversation terminated!]
robbyoconnor has joined #ruby
sakix has quit [Ping timeout: 255 seconds]
robbyoconnor has quit [Client Quit]
robbyoconnor has joined #ruby
Rodya_ has joined #ruby
hannelita has joined #ruby
nerfando has joined #ruby
iateadonut has joined #ruby
northfurr has quit [Quit: northfurr]
Rodya_ has quit [Ping timeout: 276 seconds]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emilford has quit [Ping timeout: 260 seconds]
rkazak has quit [Quit: Sleep.....ing....]
hannelita has quit [Ping timeout: 264 seconds]
nerfando has quit [Ping timeout: 255 seconds]
Moblin has joined #ruby
northfurr has joined #ruby
lacrymology has quit [Ping timeout: 256 seconds]
baweaver has joined #ruby
devbug has joined #ruby
<vikas027>
Hello Everyone, I have a Hash like this diff_names = {'mask-passwords' => 'abc123', 'vikas' => 'vicky', 'hello' => 'me'} How can I filter out the value corresponding to 'mask-passwords' ?
ropeney has joined #ruby
tildes has joined #ruby
<havenwood>
vikas027: What would you like the output to be?
<Moblin>
Use reject to remove the key-value pair at key password, and then call values on the rest?
<havenwood>
vikas027: Or rather, what's the desired return value?
tubuliferous_ has quit [Ping timeout: 240 seconds]
<vikas027>
havenwood: I just want to query the first the key of the hash (mask-password, vikas or hello in my case) and print the corresponding value
B1n4r10 has quit [Ping timeout: 256 seconds]
<havenwood>
vikas027: diff_names.values.first
Rickmasta has quit [Ping timeout: 240 seconds]
<vikas027>
havenwood: So, if I query mask-passwords, I get a value abc123
<havenwood>
vikas027: What return value do you want?
blackmes1 has joined #ruby
<vikas027>
havenwood: if I query for mask-passwords, I get a return value abc123
<havenwood>
vikas027: You want the first key's value or no?
<vikas027>
value
<havenwood>
vikas027: So not?: diff_names.values.first
Rickmasta has joined #ruby
<havenwood>
vikas027: Is the return value you're looking for?: "abc123"
Dimik has quit [Ping timeout: 272 seconds]
<havenwood>
vikas027: Either `diff_names.values.first` or `diff_names.first.last` would be the first value of the Hash.
<vikas027>
havenwood: I also want to look for a 'vikas' and have 'vicky' in return. Similary, when I look for 'hello', I should get 'me' in return
<carella>
so you want all values?
<vikas027>
havenwood: Thanks for the first and last values. But, I have a big hash. I am looking to somehow iterate over the hash, and find all corresponding values.
<al2o3-cr>
diff_names.invert['vicky'] # like this?
<vikas027>
carella: right
<havenwood>
al2o3-cr: yup, seems so
<Moblin>
vikas, hash.values.each iterates over all the values in order
<carella>
vikas, diff_names.values will just return the array
<al2o3-cr>
havenwood: I weren't to sure tbh
<havenwood>
vikas027: ^ the values will become unique when you invert but i think al2o3-cr understood what you're asking
caffeinic has quit [Remote host closed the connection]
crdpink2 has quit [Ping timeout: 240 seconds]
northfurr has joined #ruby
<vikas027>
carella, havenwood, al2o3-cr: Sorry for not being clear. I am framing my question again. This is a small part of my hash - diff_names = {'mask-passwords' => 'abc123', 'vikas' => 'vicky', 'hello' => 'me'} What I want is that I can query this hash for keys like 'mask-passwords', 'vikas' or 'hello'. And it returns values like 'abc123', 'vicky' or 'me'. Something like puts diff_names.values.['mask-passwords'] should return abc123
<vikas027>
havenwood: Exactly. sorry for not being clear. Thanks. I am good at shell programming, but new at ruby.
nerfando has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
<havenwood>
vikas027: No prob!
caffeinic has joined #ruby
__chris has quit [Quit: This computer has gone to sleep]
tmtwd has joined #ruby
nerfando has quit [Ping timeout: 265 seconds]
dfinninger has quit [Remote host closed the connection]
casadei has joined #ruby
hxegon has joined #ruby
nerfando has joined #ruby
nanoz has quit [Read error: Connection reset by peer]
haraoka has joined #ruby
casadei has quit [Ping timeout: 272 seconds]
cashnguns has quit [Remote host closed the connection]
braincrash has quit [Quit: bye bye]
nerfando has quit [Ping timeout: 272 seconds]
fedexo has joined #ruby
arup_r has joined #ruby
dfinninger has joined #ruby
mclee has quit [Quit: WeeChat 0.4.2]
yfeldblum has quit [Ping timeout: 260 seconds]
tubuliferous_ has joined #ruby
jtnegrotto has joined #ruby
nerfando has joined #ruby
finisherr has joined #ruby
northfurr has quit [Quit: northfurr]
DiCablo has joined #ruby
rkazak has joined #ruby
nerfando has quit [Ping timeout: 255 seconds]
solocshaw has quit [Ping timeout: 250 seconds]
dorei has quit []
braincrash has joined #ruby
gregf_ has quit [Ping timeout: 272 seconds]
gregf_ has joined #ruby
nerfando has joined #ruby
jtnegrotto has quit [Remote host closed the connection]
jtnegrotto has joined #ruby
Moblin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
peeja has joined #ruby
Rodya_ has joined #ruby
djbkd has joined #ruby
nerfando has quit [Ping timeout: 276 seconds]
hannelita has joined #ruby
sakix has joined #ruby
krz has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dseitz has joined #ruby
peeja has quit [Ping timeout: 260 seconds]
Moblin has joined #ruby
cicloid_ has quit [Quit: zzZZzzzZzzzzzZZZz]
Rodya_ has quit [Ping timeout: 240 seconds]
hannelita has quit [Ping timeout: 240 seconds]
sakix has quit [Ping timeout: 250 seconds]
tjbiddle has joined #ruby
<wolffles>
say im doing range.each_with_index ternary operator
pdoherty_ has joined #ruby
<wolffles>
ignore that
pdoherty has quit [Read error: Connection reset by peer]
<wolffles>
say im doing range.each_with_index with a ternary operator i want to return a number if 2 conditions are true and if false i want enumerator to start at the beginning again.
<wolffles>
is that possible?
<Ox0dea>
wolffles: Sounds scary.
<Radar>
what Ox0dea said
<Radar>
show us some code?
<Ox0dea>
wolffles: It sounds like you want that to run in a loop until #find returns non-nil, but that means you've got mutable state in places it doesn't belong.
nerfando has joined #ruby
<wolffles>
so far this is what im working with i keep messing with the ternerary operator but to no avail https://eval.in/504296
<Ox0dea>
wolffles: Here's my much dumber solution if it makes you feel any better: https://eval.in/504308
nerfando has quit [Ping timeout: 272 seconds]
blackmes1 has joined #ruby
<wolffles>
Ox0dea: im having difficulty understanding yours
<Ox0dea>
wolffles: It's basically al2o3-cr's but retarded.
<wolffles>
why that array? random numbers
diegoviola has quit [Changing host]
diegoviola has joined #ruby
usershell has joined #ruby
<Ox0dea>
No, the 5040 is LCM(1..10) * 2.
<Ox0dea>
The array is 11..20 sans the numbers we don't need to check.
<Majost_>
Does anyone happen to have any prior experience using rmagic? I am trying to just display a jpeg, but when I do ` Magick::Image.display(IO.binread("test.jpg"))` I get the error: `NoMethodError: undefined method `write' for #<String:0x00561296ebba28>`
<Radar>
Majost_: you're the first person. Congratulations.
<Radar>
?ri IO.binread
<ruby[bot]>
Radar: I don't see no IO.binread, whom should I tell about ri?
pawnbox has quit [Remote host closed the connection]
Darmani has joined #ruby
fclausen has joined #ruby
nerfando has quit [Ping timeout: 276 seconds]
rkazak has quit [Quit: Sleep.....ing....]
iateadonut has quit [Ping timeout: 256 seconds]
<Radar>
lowest common multiple
<Radar>
no?
iateadonut has joined #ruby
pawnbox has joined #ruby
<Ox0dea>
Nah.
<Ox0dea>
Yay, English.
dlitvak has joined #ruby
speaking1ode has joined #ruby
<Ox0dea>
Array#min *technically* returns the least element, but nobody talks like that anymore.
tmtwd has quit [Ping timeout: 260 seconds]
<Ox0dea>
Then again, nobody reads < as "lower than", so it's a mixed bag.
<vikas027>
Hello Everyone, I am trying to shorten my code by used .each.with_index, but for some reason the output is a little weird than expected. - https://dpaste.de/c8tZ
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tubuliferous_ has joined #ruby
hannelita has joined #ruby
tubuliferous_ has quit [Read error: Connection reset by peer]
tubuliferous_ has joined #ruby
nerfando has joined #ruby
rkazak has joined #ruby
elaptics`away is now known as elaptics
rkazak has quit [Client Quit]
janebootydoe has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
rkazak has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hannelita has quit [Ping timeout: 240 seconds]
nerfando has quit [Ping timeout: 250 seconds]
Macaveli has joined #ruby
astrobun_ has quit [Remote host closed the connection]
ohaibbq has quit [Quit: Leaving...]
atmosx has quit [Quit: WeeChat 0.4.4-dev]
atmosx has joined #ruby
krz has quit [Ping timeout: 272 seconds]
karapetyan has quit [Remote host closed the connection]
usershell has quit [Remote host closed the connection]
karapetyan has joined #ruby
ta has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
CloCkWeRX has quit [Quit: Leaving.]
usershell has joined #ruby
fantazo has joined #ruby
nerium has quit [Quit: nerium]
tubuliferous_ has quit [Ping timeout: 260 seconds]
claw has quit [Ping timeout: 240 seconds]
nerfando has joined #ruby
krz has joined #ruby
howdoi has joined #ruby
dopie has joined #ruby
blackmes1 has joined #ruby
astrobun_ has joined #ruby
nerfando has quit [Ping timeout: 260 seconds]
claw has joined #ruby
anisha has joined #ruby
Pupeno has joined #ruby
Guest9617 is now known as saneax_AFK
blackmes1 has quit [Ping timeout: 245 seconds]
lxsameer has joined #ruby
rakm has joined #ruby
djbkd has quit [Quit: My people need me...]
rakm has quit [Client Quit]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tjbiddle has quit [Ping timeout: 264 seconds]
Pupeno has quit [Ping timeout: 255 seconds]
goodroot has joined #ruby
mondok has quit [Ping timeout: 256 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nerfando has joined #ruby
goodroot has quit [Ping timeout: 256 seconds]
RobertBirnie has joined #ruby
tjbiddle has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
Spami has joined #ruby
Moblin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yardenbar has joined #ruby
solars has joined #ruby
nerfando has quit [Ping timeout: 264 seconds]
darkf has joined #ruby
pdoherty_ has quit [Ping timeout: 240 seconds]
weemsledeux has joined #ruby
scepticulous has joined #ruby
nerfando has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
User458764 has joined #ruby
usershell has quit [Remote host closed the connection]
neanderslob has quit [Ping timeout: 255 seconds]
RobertBirnie has quit [Ping timeout: 265 seconds]
neanderslob has joined #ruby
pwnd_nsfw has joined #ruby
karapetyan has joined #ruby
usershell has joined #ruby
karapetyan has quit [Remote host closed the connection]
nerfando has quit [Ping timeout: 276 seconds]
usershell has quit [Ping timeout: 260 seconds]
carella has quit [Remote host closed the connection]
carella has joined #ruby
nerfando has joined #ruby
frewtc4ke has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
goodroot has joined #ruby
nerfando has quit [Ping timeout: 276 seconds]
Rodya_ has joined #ruby
amclain has quit [Quit: Leaving]
hannelita has joined #ruby
lipoqil has quit [Quit: Connection closed for inactivity]
pwnd_nsfw has quit [Ping timeout: 260 seconds]
ss_much has quit [Quit: Connection closed for inactivity]
goodroot has quit [Ping timeout: 260 seconds]
nerfando has joined #ruby
DoubleMalt has joined #ruby
Rodya_ has quit [Ping timeout: 245 seconds]
hannelita has quit [Ping timeout: 240 seconds]
frewtc4ke has left #ruby [#ruby]
tubuliferous_ has joined #ruby
sandstrom has joined #ruby
nerfando has quit [Ping timeout: 240 seconds]
RobertBirnie has joined #ruby
symm- has joined #ruby
pawnbox has quit [Remote host closed the connection]
firstdayonthejob has joined #ruby
gagrio has joined #ruby
nerfando has joined #ruby
TomyLobo has quit [Ping timeout: 256 seconds]
sigurding has quit [Quit: sigurding]
ur5us has quit [Remote host closed the connection]
jtnegrotto_ has joined #ruby
ympeg has joined #ruby
pwnd_nsfw has joined #ruby
nerfando has quit [Ping timeout: 265 seconds]
jtnegrotto__ has joined #ruby
saneax_AFK is now known as saneax
saneax is now known as Guest26467
malconis has quit [Ping timeout: 240 seconds]
blackmes1 has joined #ruby
fantazo has quit [Ping timeout: 260 seconds]
rkazak has quit [Quit: Sleep.....ing....]
RobertBirnie has quit [Ping timeout: 256 seconds]
rippa has joined #ruby
nerfando has joined #ruby
hs366 has joined #ruby
blackmes1 has quit [Ping timeout: 260 seconds]
DirtyFinn has joined #ruby
j_mcnally has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
techsethi has quit [Quit: techsethi]
casadei has joined #ruby
j_mcnally has quit [Client Quit]
agent_white has joined #ruby
nerfando has quit [Ping timeout: 250 seconds]
Darmani has quit [Ping timeout: 252 seconds]
casadei has quit [Ping timeout: 265 seconds]
juddey has quit [Ping timeout: 250 seconds]
Hounddog has joined #ruby
RobertBirnie has joined #ruby
roshanavand has joined #ruby
jas02 has joined #ruby
ur5us has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
graphettion has quit [Remote host closed the connection]
jameswatling has joined #ruby
pawnbox has joined #ruby
tubuliferous_ has quit [Ping timeout: 265 seconds]
aufi has joined #ruby
tjbiddle has quit [Ping timeout: 264 seconds]
TomyWork has joined #ruby
tubuliferous_ has joined #ruby
nerfando has joined #ruby
vdamewood has joined #ruby
bascht has quit [Quit: WeeChat 1.4]
elaptics is now known as elaptics`away
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cornerma1 has joined #ruby
bascht has joined #ruby
ta has joined #ruby
Freeaqingme has quit [Ping timeout: 245 seconds]
SCHAAP137 has joined #ruby
sepp2k has joined #ruby
cornerman has quit [Ping timeout: 256 seconds]
cornerma1 is now known as cornerman
nerfando has quit [Ping timeout: 255 seconds]
jam_ has quit [Remote host closed the connection]
blackms has joined #ruby
janebootydoe has quit [Ping timeout: 276 seconds]
mclee has joined #ruby
mclee has quit [Client Quit]
tjbiddle has joined #ruby
fclausen has quit [Ping timeout: 272 seconds]
tubuliferous_ has quit [Ping timeout: 240 seconds]
Waheedi has quit [Quit: Waheedi]
sandstrom has quit [Quit: My computer has gone to sleep.]
Waheedi has joined #ruby
nerfando has joined #ruby
virgil has joined #ruby
goodroot has joined #ruby
JohnT has joined #ruby
JohnT has quit [Client Quit]
astrobun_ has quit [Remote host closed the connection]
mclee has joined #ruby
sandstrom has joined #ruby
Rodya_ has joined #ruby
UtkarshRay has joined #ruby
fantazo has joined #ruby
mark2 has joined #ruby
hannelita has joined #ruby
nerfando has quit [Ping timeout: 245 seconds]
edwinvdgraaf has joined #ruby
goodroot has quit [Ping timeout: 256 seconds]
Rodya_ has quit [Ping timeout: 240 seconds]
techsethi has joined #ruby
hannelita has quit [Ping timeout: 255 seconds]
jbrhbr has joined #ruby
nerfando has joined #ruby
arup_r has quit []
antgel has joined #ruby
blackms has quit [Ping timeout: 240 seconds]
techsethi_ has joined #ruby
virgil has quit [Remote host closed the connection]
techsethi has quit [Ping timeout: 245 seconds]
techsethi_ is now known as techsethi
steffkes has joined #ruby
steffkes has joined #ruby
<sjums>
I want to execute a shell command with `'s, though I also want part of that command to be something user-defined, which open up for a lot of security issues. Is there a way to sanitize user-input before passing it to the shell?
asmodlol has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
asmodlol has joined #ruby
nerfando has quit [Ping timeout: 276 seconds]
Waheedi has quit [Quit: Waheedi]
shellie_ has joined #ruby
firstdayonthejob has quit [Ping timeout: 264 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
bronson has quit [Remote host closed the connection]
<Ox0dea>
sjums: Are you wanting to obtain the output of said command?
<sjums>
yes please
futilegames has joined #ruby
<sjums>
more specific it's the output of the `file` command on a user-uploaded file
<sjums>
I just realized I safely could rename the file to something safe
steffkes has quit [Ping timeout: 255 seconds]
<Ox0dea>
sjums: You can use popen with the arguments passed as an Array to avoid spawning a shell at all.
<sjums>
and would that save me from people running commands on my server?
usershell has joined #ruby
<sjums>
if the file for example was name "kitten.jpg && rm -r . ;"
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
donnoc has joined #ruby
hannelita has joined #ruby
phax has joined #ruby
huyderman has joined #ruby
futilegames has quit [Quit: futilegames]
agent_white has left #ruby [#ruby]
einarj has joined #ruby
sulky has quit [Ping timeout: 276 seconds]
techsethi has quit [Quit: techsethi]
User458764 has joined #ruby
sepp2k has quit [Ping timeout: 256 seconds]
sulky has joined #ruby
mondok has quit [Read error: Connection timed out]
mondok has joined #ruby
dmolina has joined #ruby
Coldblackice has quit [Ping timeout: 256 seconds]
techsethi has joined #ruby
blaxter has joined #ruby
radgeRayden__ has quit [Quit: Leaving]
fclausen has quit [Ping timeout: 272 seconds]
srenatus has joined #ruby
<srenatus>
hi there. how could I find the cause when an `instance_eval &block` is raising an exception? it's a failed conversion of fixnum to string, but I have no idea which line of code even tries to do that...
<srenatus>
I was trying to use byebug to step through the code line-by-line, but it goes directly to the `rescue` block after the `instance_eval`
blur3d has joined #ruby
bronson has joined #ruby
<canton7>
what is the stack trace?
skade has joined #ruby
ur5us has joined #ruby
<srenatus>
the call to instance_eval, basically
<srenatus>
and what led up to it
phax has quit [Quit: phax]
matp_ has joined #ruby
DriesS has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
krz has quit [Ping timeout: 260 seconds]
carella has quit [Read error: Connection timed out]
matp has quit [Ping timeout: 260 seconds]
usershell has joined #ruby
marr has joined #ruby
carella has joined #ruby
colegatron has joined #ruby
Macaveli has joined #ruby
nettoweb has joined #ruby
Macaveli has quit [Client Quit]
d0nn1e has quit [Ping timeout: 255 seconds]
<Ox0dea>
srenatus: Post code?
DriesS has quit [Quit: WeeChat 1.3]
matp_ has quit [Ping timeout: 255 seconds]
kknight has joined #ruby
baweaver has quit [Remote host closed the connection]
carella has quit [Remote host closed the connection]
pandaant has joined #ruby
dfinninger has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
usershell has joined #ruby
workmad3_ is now known as workmad3
CloCkWeRX has joined #ruby
f4cl3y has joined #ruby
UtkarshRay has quit [Quit: Leaving]
<srenatus>
Ox0dea: turns out you can call `instance_eval` either with string, filename, line_no OR with a block. what is not possible (and leads to my error) is `instance_eval(filename, line_no) &block`
<srenatus>
Ox0dea: yup, which is great. there's just no way to give it any information where that block came from, right?
<srenatus>
which is what I was trying to do...
casadei has joined #ruby
<Ox0dea>
srenatus: I'm not sure how you mean.
<Ox0dea>
There's Proc#source_location, if that's what you were going for.
<srenatus>
Ox0dea: exactly, and when I pass that block to instance_eval, I could give it source and line_no information from that. or will it figure that out from Proc#source_location itself?
kknight has quit [Remote host closed the connection]
<Ox0dea>
It'll report the call site for the #instance_eval.
<srenatus>
yup. ok, great.
<srenatus>
Ox0dea: thanks for your help
DaniG2k has quit [Quit: leaving]
<Ox0dea>
Sure thing.
<srenatus>
:)
ur5us has quit [Remote host closed the connection]
<Ox0dea>
Hm... evaluating a String and a block at the same time.
<Ox0dea>
For science, of course.
hannelita has quit [Remote host closed the connection]
casadei has quit [Ping timeout: 245 seconds]
tvw has quit []
<Ox0dea>
>> begin; eval '_(&_){}'; rescue SyntaxError; $! end
<ruby[bot]>
Ox0dea: # => #<SyntaxError: (eval):1: both block arg and actual block given> (https://eval.in/504542)
blackmes1 has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
<Ox0dea>
Shame about that being a syntax error; can't preempt the parser. :/
curses has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
chouhoulis has joined #ruby
goodroot has joined #ruby
<Bish>
>> begin; eval '_(&_){}'; rescue ; $! end
<ruby[bot]>
Bish: # => (eval):1: both block arg and actual block given (SyntaxError) ...check link for more (https://eval.in/504543)
dfinninger has quit [Remote host closed the connection]
<Bish>
>> begin; eval '_(&_){}'; rescue ; puts "wayho";$! end
<ruby[bot]>
Bish: # => (eval):1: both block arg and actual block given (SyntaxError) ...check link for more (https://eval.in/504544)
<Bish>
so rescue without anything does only catch StandardError?
howdoicomputer has quit [Ping timeout: 260 seconds]
<apeiros>
o0
<apeiros>
but you're pink
dlitvak has joined #ruby
sftrabbit has joined #ruby
Xeago has joined #ruby
Macaveli has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
fsapo has joined #ruby
lidenbrock has quit [Ping timeout: 252 seconds]
Jardayn has joined #ruby
jgt has quit [Ping timeout: 240 seconds]
aryaching has joined #ruby
casadei has joined #ruby
<ddv>
<3
<jhass>
and pink is cheap because...
<mikecmpbll>
i'm breaking a file into predefined chunks, but I'm trying to do it in the most memory efficient way possible, so allowing the user of the method to get an array of the chunks, or if they're more memory concerned just each chunk one by one. at the top is my first implementation, using a block, then I thought maybe this is where enumberable::lazy comes in to it's own so I tried to refactor it
Xeago has quit [Remote host closed the connection]
<mikecmpbll>
the idea being, with `chunk2`, they cal call chunk2.to_a to get them all, or chunk2.each{ |c| ... }, i was hoping with the latter that only one chunk will need to be stored in memory at a time
<apeiros>
Enumerator::Lazy#map returns an Enumerator::Lazy
<apeiros>
i.e. not an array. so it'll not build an array.
<mikecmpbll>
yeah, but when .each is called on that, all blocks get evaluated on each item, and at that point i'm wondering whether ruby is building up that array for the return value of map
BTRE has joined #ruby
<mikecmpbll>
not sure that sentence made any sense, hard to explain what i mean ;<
<apeiros>
mikecmpbll: the more idiomatic approach is to drop chunk2 and instead have `return enum_for(__method__) unless block_given?` as first line in #chunk
sdothum has joined #ruby
karapetyan has joined #ruby
<apeiros>
mikecmpbll: calling .each on Enumerator::Lazy#map does not create an array either.
emilford has joined #ruby
<apeiros>
mikecmpbll: you can test that by printing out in the map and the appended each. if it'd build an array, all prints from map would be consecutively. but since it doesn't build an array, it'll be interleaved with the prints from .each.
<mikecmpbll>
ack. of course.
karapetyan has quit [Remote host closed the connection]
synthroid has joined #ruby
<mikecmpbll>
okay, that's allayed my concerns, thanks!
<apeiros>
commented :-)
vikas027 has joined #ruby
<mikecmpbll>
i've never seen enum_for before! looks great, researching now
kp666 has quit [Remote host closed the connection]
<saush>
How to make changes in my ruby gem files?
dstarh has joined #ruby
govg has joined #ruby
binaryplease has joined #ruby
<jhass>
saush: why do you want to? there's probably a better way
johnbburg has joined #ruby
carella has quit [Remote host closed the connection]
<saush>
I want to make changes in some file to test the code
emilford has quit [Ping timeout: 240 seconds]
ItSANgo has quit [Quit: Leaving...]
joonty has joined #ruby
<jhass>
?context
<ruby[bot]>
Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
<saush>
I am having a ruby gem installed which contains C++ files. I want to make changes in the function of that file so that I can test me required output. I tried to simply modify and save the file but its not working.
baweaver has joined #ruby
ympeg has quit [Ping timeout: 240 seconds]
sharkman has quit [Ping timeout: 240 seconds]
rns has joined #ruby
workmad3_ has joined #ruby
dfinninger has quit [Remote host closed the connection]
carella has quit [Remote host closed the connection]
hxegon has joined #ruby
sgambino has joined #ruby
nfk|laptop has joined #ruby
Pupeno has quit [Remote host closed the connection]
<saush>
jhass : Can I maybe change the path of my gem to point my local directory copy of it?
binaryplease has quit [Ping timeout: 256 seconds]
Melpaws has quit [Quit: Leaving.]
workmad3 has joined #ruby
<jhass>
saush: not easily with rubygems, you can add to the load path by using the -I flag to ruby or modifying the Ruby global $LOAD_PATH, or you can use bundler which offers a more convenient way to do what you want
<aegis3121>
saush: if you're using a Gemfile, definitely. gem 'my_gem', path: '/path/to/project'
binaryplease has joined #ruby
steffkes has joined #ruby
steffkes has quit [Changing host]
steffkes has joined #ruby
workmad3_ has quit [Ping timeout: 272 seconds]
<apeiros>
saush: `gem which NAME`
<apeiros>
shows you the path of the installed gem
<apeiros>
but IMO get a copy from the repo and don't install the gem
binaryplease has quit [Client Quit]
nfk|laptop has quit [Quit: yawn]
<saush>
aegis3121 : Do I need to add that to my local directory Gemfile?
krz has quit [Read error: Connection reset by peer]
<aegis3121>
whatever the consuming project is, ya
rodfersou has quit [Ping timeout: 256 seconds]
shinnya has joined #ruby
anagha_ has joined #ruby
<anagha_>
hello
mfb2 has joined #ruby
lacrymology has joined #ruby
carella has joined #ruby
last_staff has quit [Quit: last_staff]
<saush>
aegis3121 : I added into Gemfile but its not working.
<saush>
aegis3121 : Still `gem which gem_name` gives the original location
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
<jhass>
saush: bundle show gem_name
<aegis3121>
That will affect which version the consuming project uses; for trying to simply run the gem, I'm pretty sure it won't. I apologize if I misunderstood your problem :/
<jhass>
and bundle exec your_command
mfb2 has quit [Remote host closed the connection]
roshanavand has joined #ruby
<anagha_>
how can you define an index function?Is it necessary to define that for models?
skade has quit [Quit: Computer has gone to sleep.]
cdg has joined #ruby
rodfersou has joined #ruby
chouhoulis has joined #ruby
<jhass>
?rails
<ruby[bot]>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
goodroot has joined #ruby
skade has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Jackneill has joined #ruby
cfinley_ has joined #ruby
jgt has quit [Ping timeout: 260 seconds]
ympeg has joined #ruby
vdamewood has quit [Quit: Life beckons.]
karapetyan has joined #ruby
yalue has joined #ruby
B1n4r10 has quit [Ping timeout: 276 seconds]
chouhoulis has quit [Ping timeout: 265 seconds]
rodferso1 has joined #ruby
goodroot has quit [Ping timeout: 276 seconds]
<saush>
jhass : Now I can't figure it out but bundle show gem_name is giving me error
<mikecmpbll>
if you have an array of objects that you're regularly/repeatedly checking to see if it contains another object, i.e. objects.include?(other), is it ever sensible to make that a hash because hash key lookups are so much faster than array.include? ? even though the hash values are not relevant
<saush>
Could not locate Gemfile or .bundle/ directory
rodfersou has quit [Ping timeout: 256 seconds]
<apeiros>
mikecmpbll: you realize that "array of objects" is redundant? :)
<jhass>
saush: then you don't run it in the directory where your Gemfile is
<headius>
Ox0dea: maintaining insertion order was made required behavior around 1.9.2 I believe
<mikecmpbll>
apeiros: not sure what you mean, so no probably not :D
<apeiros>
headius: oh, interesting, no 1.9.0?
<headius>
we resisted for a while but it was clear people wanted predictable iteration order of k/v pairs
TomPeed has joined #ruby
<mikecmpbll>
i was thinking like lookup = Hash[objects.map{ |o| [o, nil] }]; lookup.key?(other)
<apeiros>
mikecmpbll: have you seen arrays of non-objects?
<headius>
apeiros: well, might have been around then...I don't consider 1.9.0 or 1.9.1 viable releases
<mikecmpbll>
oh right, yeah.
gbgdev has quit [Remote host closed the connection]
<jhass>
mikecmpbll: looks like a Set
howdoi has quit [Quit: Connection closed for inactivity]
<apeiros>
headius: ah, ok. given that I don't even consider 1.9.2 a viable release (but much more viable than <=1.9.1)
<jhass>
mikecmpbll: but benchmark your case, the tradeoff of conversion can be greater than the lookup gain
<apeiros>
mikecmpbll: and yeah, Set is what you want.
* apeiros
still sad that Set's set operations are slower than Array's :(
<mikecmpbll>
i just did some benchmarks on a size 1000 array and the hash key lookup was ~20x faster
<mikecmpbll>
zomg, sets. knew i forgot something.
<apeiros>
mikecmpbll: it'll get worse on average the more items you have :)
<mikecmpbll>
indeed.
<headius>
apeiros: yeah, ditto
<apeiros>
mikecmpbll: important, though: Array#include? is based on ==, Set#include? is based on #hash + #eql?
<headius>
I think it's the first one that was at least usable though
<mikecmpbll>
benchmarking set now
<saush>
jhass : Could not find gem 'nmatrix-0.2.1' in source at `.`. I am getting this error in my Gemfile directory
zerowaitstate has joined #ruby
Meow-J has joined #ruby
<apeiros>
headius: yeah, it still had a few kinks which got largely resolved in 1.9.3
<jhass>
saush: so the path you've given is wrong (does not contain an appropriate .gemspec)
carella has quit [Remote host closed the connection]
<apeiros>
stuff like instance_eval not yielding self anymore :)
<headius>
oops
<jhass>
saush: might also because the version you requested in the Gemfile is different than from what you've given the path to
<apeiros>
also some weird things regarding encodings. had to patch a lib of mine to do Encoding#to_s because some methods wouldn't accept an encoding instance, only an encoding name…
arup_r has quit [Remote host closed the connection]
<headius>
yeah I think there were a lot of m17n/encoding fixes in 1.9.3
<headius>
key internal things
<apeiros>
mhm
ItSANgo has joined #ruby
* apeiros
still waits for collation support in strings :<
<headius>
1.9.x was just a huge change...I suppose it's not surprising it took several revisions to iron out
<mikecmpbll>
yep, that's better, sets are fast. duh
<apeiros>
sure
<headius>
collation?
jam____ has joined #ruby
<apeiros>
collations define comparisons
arup_r has joined #ruby
<apeiros>
e.g. whether "a", "å" or "ä" is sorted first
djcp has joined #ruby
Pathfinder has quit [Ping timeout: 276 seconds]
<saush>
jhass : Let me clarify. The path I am supposed to give in my gemfile is current gemfile path? or the path of my actually installed gem?
CloCkWeRX has quit [Quit: Leaving.]
<apeiros>
I'm not sure but collations might also include information about case-mapping
<jhass>
saush: neither, it's the path to the working copy of the gem you want to work on while using it in your Gemfile's project at the same time
jokke1 is now known as jokke
rikkipitt has quit [Remote host closed the connection]
VeryBewitching has joined #ruby
sharkman has joined #ruby
sharkman has quit [Client Quit]
sankaber has joined #ruby
malconis has joined #ruby
DirtyFinn has quit []
harai has joined #ruby
<saush>
jhass : I am adding this in my Gemfile. gem 'nmatrix-0.2.1', path: "/home/saurabh/Music/nmatrix"
astrofog has quit [Quit: Quite]
<saush>
jhass : I have cloned nmatrix over here
jam____ has quit [Ping timeout: 264 seconds]
ItSANgo has quit [Quit: Leaving...]
<jhass>
ok
<jhass>
the gem name is probably wrong
<jhass>
don't include the version
virgil has joined #ruby
lxsameer has quit [Quit: Leaving]
beast has joined #ruby
<saush>
jhass : Well now 'bundle show nmatrix' gives => /home/saurabh/Music/nmatrix
<jhass>
interesting
User458764 has joined #ruby
harai has quit [Ping timeout: 260 seconds]
Gadgetoid has quit [Ping timeout: 272 seconds]
<apeiros>
that looks correct?
tjohnson has joined #ruby
karapetyan has quit [Remote host closed the connection]
ESpiney has joined #ruby
ympeg has quit [Ping timeout: 272 seconds]
malconis has quit [Remote host closed the connection]
krz has joined #ruby
karapetyan has joined #ruby
chthon has quit [Ping timeout: 255 seconds]
<jhass>
yes
<jhass>
well, it's interesting in case they didn't fix the name
Gadgetoid has joined #ruby
malconis has joined #ruby
saush has quit [Ping timeout: 252 seconds]
mfb2 has joined #ruby
__chris has joined #ruby
Tempesta_ has joined #ruby
Tempesta_ has quit [Client Quit]
B1n4r10 has joined #ruby
lacrymology has quit [Ping timeout: 276 seconds]
varesa- has joined #ruby
kobain has joined #ruby
<dostoyevsky>
Is code in set_trace_func not traced or are there certain constraints into what code is allowed in a trace_func?
troulouliou_div2 has quit [Ping timeout: 260 seconds]
victortyau has joined #ruby
<dostoyevsky>
> Tracing is disabled within the context of proc.
roshanavand has quit [Read error: Connection reset by peer]
varesa has quit [Ping timeout: 272 seconds]
howdoicomputer has joined #ruby
Pupeno has joined #ruby
roshanavand has joined #ruby
Tempesta has joined #ruby
karapetyan has quit [Remote host closed the connection]
saush has joined #ruby
stamina has quit [Quit: WeeChat 1.3]
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
dlitvak has quit [Ping timeout: 256 seconds]
<saush>
jhass : Sorry Connection problems.
Rodya_ has joined #ruby
<saush>
jhass : now 'bundle show nmatrix' gives => /home/saurabh/Music/nmatrix. What to do next?
dlitvak has joined #ruby
<jhass>
bundle exec whatever
howdoicomputer has quit [Ping timeout: 240 seconds]
Pupeno has quit [Ping timeout: 256 seconds]
bronson has joined #ruby
<saush>
jhass : I want to make changes in cpp file. So should it go bundle exec filename?
howdoi has joined #ruby
rikkipitt has joined #ruby
<jhass>
no
<jhass>
make the changes
<jhass>
run bundle again in the project using it
<jhass>
run the project using it with bundle exec
peeja has joined #ruby
chthon has joined #ruby
<jhass>
or actually I never did that with a project using a C ext
Rodya_ has quit [Ping timeout: 256 seconds]
jtnegrotto has joined #ruby
<jhass>
you probably have to rebuilt the extension and there's probably a rake task for it
<jhass>
check rake -aT in the gem
victortyau has quit [Quit: Leaving]
<imperator>
mornin' jhass
<jhass>
morning
frem has joined #ruby
<saush>
jhass : It gives me a long output!
<jhass>
thanks for the information!
bronson has quit [Ping timeout: 265 seconds]
<shevy>
lol
ferr has quit [Ping timeout: 256 seconds]
drptbl has joined #ruby
quaristice has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Macaveli has joined #ruby
<imperator>
make changes? is there a glitch in the nmatrix?
<blackms>
i need a way to have a step by step approach
__chris has quit [Ping timeout: 260 seconds]
<blackms>
in order to see what happen at a certain point in the code
dfinninger has joined #ruby
TomPeed has joined #ruby
jgt has joined #ruby
jtnegrotto has quit [Read error: Connection reset by peer]
f0ster has quit []
Macaveli has joined #ruby
Macaveli has quit [Client Quit]
atomical_ has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
B1n4r10 has quit [Ping timeout: 264 seconds]
<hxegon>
what are you trying to find out? blackms
aegis3121 has quit [Ping timeout: 240 seconds]
<blackms>
hxegon, i'm developing a new plugin, but the ConfigValidator tell me that the marchine object has two field which is not be there...
<blackms>
:)
Xeago has quit [Remote host closed the connection]
casadei has joined #ruby
__chris has joined #ruby
curses has quit []
baweaver has joined #ruby
aryaching has quit [Ping timeout: 245 seconds]
<scepticulous>
are there any recommendations for a authorization framework, but pundit. I think pundit will meet my needs and looks promising, however, maybe there are new ( and good ) kids on the block
pamatya has quit [Quit: pamatya]
atomical has quit [Ping timeout: 260 seconds]
aufi has joined #ruby
colegatron has joined #ruby
<tubbo>
scepticulous: well there's pundit
<tubbo>
scepticulous: there's also pundit
<tubbo>
;)
<tubbo>
j/k...i used authority for a while and then there's cancancan but imho it's not very good
<tubbo>
authority is *decent* but is a little too big for me. pundit can do all the things authority can do, and doesn't require so much coupling
aryaching has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Ping timeout: 260 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
<scepticulous>
yay I took a look and cancancan, coming from "declarative_authorization" . I will take a look at authority as well, thanks. I believe there is also pundit
goodroot has joined #ruby
marr has quit [Ping timeout: 264 seconds]
sgambino has joined #ruby
<Bish>
i also heard of one.. pu.. pundit, yeah that's it
digs84 has joined #ruby
einarj has quit [Remote host closed the connection]
pdoherty_ has quit [Ping timeout: 256 seconds]
cicloid has quit [Quit: zzZZzzzZzzzzzZZZz]
chouhoulis has joined #ruby
zerowaitstate has quit [Quit: leaving]
User458764 has joined #ruby
<floatingpoint>
what's an appropriate exception to throw if a file doens't ecist
<floatingpoint>
*exist
gagrio has quit [Ping timeout: 276 seconds]
solars has joined #ruby
<apeiros>
you shouldn't throw exceptions, only raise them</pedantry>
<floatingpoint>
sorry. raise
<apeiros>
Errno::ENOENT I guess?
<ljarvis>
>> File.open "foo"
<ruby[bot]>
ljarvis: # => No such file or directory @ rb_sysopen - foo (Errno::ENOENT) ...check link for more (https://eval.in/504788)
<ljarvis>
that one
rodfersou|lunch is now known as rodfersou
jgt has quit [Ping timeout: 272 seconds]
cndiv has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Waheedi has joined #ruby
Mon_Ouie has joined #ruby
__chris has quit [Ping timeout: 256 seconds]
sgambino has joined #ruby
aufi has quit [Quit: Konversation terminated!]
lacrymology has left #ruby [#ruby]
quaristice has joined #ruby
sandstrom has joined #ruby
freerobby has quit [Quit: Leaving.]
houhoulis has joined #ruby
sergey_makagon has quit []
cndiv has quit [Ping timeout: 256 seconds]
freerobby has joined #ruby
digs84 has quit [Remote host closed the connection]
sneakerhax has quit [Quit: Leaving]
st0opkid has joined #ruby
yardenbar has quit [Ping timeout: 245 seconds]
Mon_Ouie has quit [Ping timeout: 255 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
aufi has joined #ruby
Bloomer has joined #ruby
<blackms>
hxegon, are you there?
houhoulis has quit [Ping timeout: 240 seconds]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ljames has joined #ruby
<hxegon>
blackms yeah, I have no idea. As far as I can tell the vagrant gem hasn't been updated since 2014, and I've never used an IDE so I'm not sure how much help I can offer.
<blackms>
without an IDE for me it's the same :)
<blackms>
if i launch that via irb does it should work?
tvw has quit [Read error: Connection reset by peer]
bronson has joined #ruby
troulouliou_div2 has joined #ruby
benlieb has joined #ruby
psy_ has joined #ruby
psy_ has quit [Max SendQ exceeded]
pdoherty has quit [Ping timeout: 256 seconds]
mfb2 has joined #ruby
psy_ has joined #ruby
jottr has joined #ruby
hahuang65 has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
mfb2 has quit [Ping timeout: 240 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cicloid has quit [Quit: zzZZzzzZzzzzzZZZz]
drocsid has joined #ruby
chouhoulis has quit [Remote host closed the connection]
floatingpoint has joined #ruby
ssm has joined #ruby
aegis3121 has joined #ruby
baweaver has joined #ruby
<drocsid>
I'm using ruby to launch scripts that start java processes. These java processes just trigger a remote job. I'm starting them like pid = spawn('/some/java/launcher.sh'). Then I want to give the process a little time to start it's job and kill it. So I sleep a little while and Process.kill(9,pid). However this is not killing the processes. Is it because I'm using spawn?
WeiJunLi has left #ruby ["Konversation terminated!"]
<eam>
drocsid: what do you mean "not killing the process?"
<eam>
what state do you observe it in?
rodferso1 has joined #ruby
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<eam>
(where I'm going with this: there's good odds it has been killed and is a zombie)
mg^ has joined #ruby
cicloid has joined #ruby
<hxegon>
I'll be in my bunker
dwfait has quit [Remote host closed the connection]
RobertBirnie has joined #ruby
<drocsid>
eam: ok I will read up more on zombies.. Thanks
dmolina has quit [Ping timeout: 240 seconds]
<eam>
drocsid: happy to explain further here if you've questions :)
lxsameer has joined #ruby
<eam>
if you use `ps -ef`, see if it's in state "defunct"
rodfersou has quit [Ping timeout: 265 seconds]
<mg^>
always reap your children!
baweaver has quit [Ping timeout: 240 seconds]
tomchapin has joined #ruby
rkazak has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sgambino has joined #ruby
ur5us has joined #ruby
jbrhbr has joined #ruby
JohnT has joined #ruby
JohnT has quit [Client Quit]
gruz0 has joined #ruby
howdoicomputer has joined #ruby
rodfersou has joined #ruby
rkazak has quit [Ping timeout: 255 seconds]
Lewix has quit [Read error: Connection reset by peer]
myntcake has joined #ruby
<myntcake>
m
ur5us has quit [Ping timeout: 240 seconds]
edwinvdgraaf has joined #ruby
mfb2 has joined #ruby
rodferso1 has quit [Ping timeout: 276 seconds]
firstdayonthejob has joined #ruby
guacamole has joined #ruby
howdoicomputer has quit [Ping timeout: 245 seconds]
avril14th has quit [Remote host closed the connection]
PhantomSpank has joined #ruby
JohnT has joined #ruby
<shevy>
have a shotgun ready
lucasb has quit [Quit: leaving]
mistermocha has joined #ruby
User458764 has joined #ruby
gregf_ has quit [Ping timeout: 260 seconds]
dlitvak has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
Mon_Ouie has joined #ruby
BSaboia has quit [Ping timeout: 250 seconds]
dlitvak has joined #ruby
bigkevmcd has joined #ruby
gregf_ has joined #ruby
<drocsid>
Then I assume my issue is that my java processes won't exit when I kill them with the signal?
<mg^>
Gurio: do you already know any other programming languages?
<freeone3000>
jhass: Okay, it looks like only ruby 1.9.3 has this problem, ruby 2.0.0 seems to work.
digs84 has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
<jhass>
freeone3000: yeah, resolves fine here. 1.9 is out of official security maintenance anyway, 2.0 is about to EOL
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sandstrom has joined #ruby
<norc>
freeone3000, that Gemfile is extremely brave. Not locking the version of the Rails meta gem...
<eam>
drocsid: kind of. A zombie occurs when a process *does* exit, but hasn't yet been cleaned up by its parent
<eam>
that is, it's dead, no longer running, but still sitting in the process table as an entry until the parent calls wait()
disconnekted has joined #ruby
<eam>
you can't kill a zombie (because it's already not running, already exited). What's neede is for the parent to call wait() and reap its entry
aspire has joined #ruby
aspire has quit [Client Quit]
jbrhbr has quit [Quit: Leaving.]
zambini has quit [Quit: Leaving.]
<mg^>
yeah this discussion happened on Reddit a week or so ago, someone wrote an entire article about killing zombie processes
<shevy>
all zombies must die
<mg^>
they weren't talking about zombie processes, they were talking about leaked processes
<eam>
an easy way to create a zombie is: ruby -e'fork {puts $$} and sleep' # will print the pid of the zombie
sgambino has joined #ruby
<mg^>
but kept saying zombie. the sysadmin in me was raging.
sigurding has quit [Quit: sigurding]
<eam>
mg^: yeah, zombie processes and this whole area of interaction is one of the least well understood aspects of unix
guacamol_ has joined #ruby
<norc>
Oh. Killing a zombie is fairly trivial. Kill the parent and watch the zombie disappear. :D
<eam>
norc: ;)
<eam>
unless you've done bad things to init, of course
<norc>
Well. If the parent is init you are shit out of luck.
chouhoulis has joined #ruby
<eam>
I did a demo of that for our interns "what happens when init stops calling wait?"
dfinninger has joined #ruby
<norc>
Heh.
momomomomo has joined #ruby
<eam>
turns out you can't just kill -STOP it because there's signal protection on it
chouhoulis has quit [Remote host closed the connection]
<norc>
You can send the SIGREBOOTIREALLYMEANIT still.
dwfait has quit [Remote host closed the connection]
chouhoulis has joined #ruby
emilford has quit [Ping timeout: 260 seconds]
<eam>
anyway after the internship I got word that one of the interns went back to school and tried the same demo on a live server at the school, panic'd the box and created a bit of an outage
<norc>
That is hilarious.
<eam>
"watch this"
guacamole has quit [Ping timeout: 260 seconds]
<eam>
I used gdb to pause it
DoubleMalt has joined #ruby
sanko has joined #ruby
dlitvak has joined #ruby
tildes has quit [Ping timeout: 240 seconds]
<mg^>
a functioning init always reaps its dead children, so if you've got zombies with PPID 1 you've got issues
<sanko>
How to unpack,gemspec and build a ruby gem?
<shevy>
sanko some .gem files will not have a .gemspec file
joonty has joined #ruby
<shevy>
sanko if the .gem has the .gemspec file, you can easily rebuild a new gem
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
pdoherty has quit [Remote host closed the connection]
hanneli has quit [Remote host closed the connection]
<sanko>
What if it does not have a gemspec file?
<eam>
mg^: yeah, can still happen in a bunch of cases though (eg docker)
<shevy>
sanko to unpack, "gem unpack", and to make a new gem, "gem build *.gemspec"
<shevy>
sanko dunno... this is typically bundler gems... I think they tend to have some rake task or something
pdoherty has joined #ruby
<sanko>
Can I copy the gemspec file and put it in appropriate gem
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mg^>
Yeah docker has introduced all kinds of fun into the world
hannelita has joined #ruby
zambini has joined #ruby
<norc>
eam, I have a fun aprils prank coming up. I will set up servers to start throwing proprietary iterm escape codes that changes the color palette into the MOTD.
Xeago has joined #ruby
<norc>
I wonder how that is going to turn out.
<shevy>
sanko how can you copy a file if it is not part of the respective .gem :)
sgambino has joined #ruby
<mg^>
back on topic... I've been toying around with making an X-Chat MRuby plugin. Had some success, been a while since I've programmed in C.
Cohedrin has joined #ruby
<sanko>
shevy Well in my case when I clone it from github it has a gemspec file. But it is not present at the gem location
kadoppe has quit [Ping timeout: 250 seconds]
mist has quit [Quit: leaving]
<shevy>
that is strange... I assume that the process, by which that is built into a .gem, removes the .gemspec file. my gems always have the .gemspec file
mistermocha has quit [Remote host closed the connection]
hanneli has joined #ruby
darkf_ has joined #ruby
kadoppe has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Remote host closed the connection]
darkf has quit [Disconnected by services]
darkf_ is now known as darkf
mistermocha has joined #ruby
Prominent_ has joined #ruby
howdoicomputer has joined #ruby
juddey has joined #ruby
<Ebok>
Is there an #index varient that returns all of the indexes which match?
pawnbox has quit [Remote host closed the connection]
<sanko>
shevy I unpacked the gem, made changes to my files and built it. But changes are not showing up after the built in the gem?
PedramT has joined #ruby
<shevy>
sanko it has a .gemspec file
hannelita has quit [Ping timeout: 255 seconds]
<shevy>
oops
<shevy>
that was supposed to be a question, so add a "?" there
Prominent has quit [Read error: Connection reset by peer]
jackjackdripper has quit [Quit: Leaving.]
hannelita has joined #ruby
<sanko>
shevy I copied the gemspec file
<shevy>
sanko let's assume that it has a .gemspec file... how I would go is, unpack the gem, make your changes to the .rb files, increment the version, then build the gem, then install it. perhaps you are still using the old gem?
varesa- is now known as varesa
beast has quit [Ping timeout: 260 seconds]
newbie22 has joined #ruby
beast has joined #ruby
<sanko>
shevy To be clear I have some C files in my gem and I made changes over there. So after that what does increment the version mean?
hanneli has quit [Ping timeout: 255 seconds]
<shevy>
the .gemspec has a specific version e. g. the entry s.version =
howdoicomputer has quit [Ping timeout: 264 seconds]
kfpratt has quit []
<zambini>
Ebok: #select work for you?
mchu has quit [Quit: mchu]
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
dorei has joined #ruby
<zambini>
But that'll give you the object, not the index
joonty has quit [Ping timeout: 255 seconds]
<sanko>
shevy So can I just keep the same version while building?
mchu has joined #ruby
graphettion has joined #ruby
mrmist has joined #ruby
sftrabbit has joined #ruby
mrmist is now known as mist
<Ebok>
Select wont do the trick. Right now I'm just doing an each interation and shoveling index into a empty array if match. It just seems like one of those things that could be done simpler.
atomical has joined #ruby
<Ebok>
Each_with_index**
gruz0 has quit [Quit: Leaving]
<shevy>
sanko in theory you could... I would uninstall the old gem just in case
freeone3000 has left #ruby ["Konversation terminated!"]
ramfjord has joined #ruby
zast has quit [Remote host closed the connection]
Gurio has quit [Quit: Leaving]
mchu has quit [Client Quit]
duckpuppy has quit [Ping timeout: 272 seconds]
sanko has quit [Ping timeout: 252 seconds]
atomical_ has quit [Ping timeout: 250 seconds]
<al2o3-cr>
>> a = %w[bar foo bar foo bar foo]; a.each_index.find_all { |i| a[i] == "foo" } # Ebok
Rodya_ has quit [Remote host closed the connection]
<al2o3-cr>
find_all is just select btw
<Ebok>
each_index
<Ebok>
:P
<zambini>
-,-
User458764 has joined #ruby
<Ebok>
To be fair, I was working with a string, so these still wont work. However, I'm going to evaluate whether I can get more functionality out of using them as an array. We'll see.
<eam>
norc: nice
<al2o3-cr>
Ebok: Why won't it work?
Bloomer has quit [Remote host closed the connection]
DroidBurgundy has quit [Ping timeout: 264 seconds]
<Ebok>
String doesnt have #each_index or #select. So I'd have to use #chars / #split etc to turn it into an array first.
hanneli has joined #ruby
<al2o3-cr>
yes
<Ebok>
Its not a big deal. I have to dig through the rest of this functionality to determine if I need the string as a string most often, or if I could get by doing all the work as an array. I appreciate the help! It fully and completely answered my query.
hannelita has quit [Ping timeout: 240 seconds]
hakunin has joined #ruby
newdan has joined #ruby
PedramT has quit [Remote host closed the connection]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<newbie22>
*: I hoping learning Ruby, and Python will help me get back into the field.
<newbie22>
what is the latest and the hottest to learn ?
ta has quit [Ping timeout: 250 seconds]
hannelita has quit [Ping timeout: 265 seconds]
Freeaqingme has joined #ruby
hannelita has joined #ruby
BTRRY is now known as BTRE
usershell has joined #ruby
<TomPeed>
languages?
hanneli has joined #ruby
hanneli has quit [Client Quit]
Freeaqingme has quit [Remote host closed the connection]
<TomPeed>
probably javascript and go
choke has joined #ruby
blaxter has quit [Ping timeout: 240 seconds]
PedramT has quit [Ping timeout: 272 seconds]
<shellie>
/win 1
arup_r has joined #ruby
<shellie>
oops.
nerium has quit [Ping timeout: 265 seconds]
<newdan>
newbie22: Python and Ruby should get you plenty of chances. Other languages good for getting into the field are Javascript, Java, PHP, and depending on where you are, C++. Might help to just search want ads and see what people are looking for
<newbie22>
*: I hoping learning Ruby, and Python will help me get back into the field.
<newbie22>
what is the latest and the hottest to learn ?
<newbie22>
*:thanks
<TomPeed>
don't learn python and ruby
dlitvak has quit [Remote host closed the connection]
<TomPeed>
they both pretty much solve the same problems
ziyadb has joined #ruby
<TomPeed>
pick 1 and then learn javascript with it IMO
psy_ has quit [Ping timeout: 245 seconds]
<TomPeed>
that way you'll have a back-end language and a front-end language
hannelita has quit [Ping timeout: 272 seconds]
atomical has joined #ruby
<TomPeed>
the way you decide which language to choose is to look at the job market in your area
<TomPeed>
or look at what the comppanies you want to apply for use
asccigcc has joined #ruby
<mg^>
Node.js is the current hotness at my workplace
Freeaqingme has joined #ruby
<TomPeed>
yeah node.js is hot right now
usershell has quit [Ping timeout: 264 seconds]
emilford has joined #ruby
llrb001 has joined #ruby
skade has quit [Read error: No route to host]
fantazo has quit [Ping timeout: 240 seconds]
llrb001 has quit [Client Quit]
skade has joined #ruby
llrb001 has joined #ruby
psy_ has joined #ruby
<shevy>
:(
<shevy>
javascript kills ruby!
guacamol_ has quit [Ping timeout: 272 seconds]
dlitvak has joined #ruby
<mg^>
Ruby code is so much nicer to read.
<newdan>
shevy: Ruby's doing fine
guacamole has joined #ruby
<shevy>
but node.js look
_5moufl has quit [Ping timeout: 245 seconds]
<zambini>
Coming from a C#/C++ background, Ruby is much prettier than Javascript.
llrb001 has quit [Client Quit]
dfinninger has quit [Remote host closed the connection]
<newdan>
JS has the unique advantage of being *the only* choice for running anything in the browser, but supposedly with new tech like WASM that won't last forever
<zambini>
JS also has fewer uniform standards than Ruby. Which is impressive :P
<mg^>
haha true that
<zambini>
There are approximately 9000 ways to do any one thing in JS, and every asserts it's the "right" way
dfinninger has joined #ruby
sgambino has joined #ruby
<mg^>
The best fun with JS is supporting the bleeding edge stuff cross-browser.
baweaver has quit [Remote host closed the connection]
<zambini>
If I could write and run Ruby on people's browsers, I'd never touch JS
moufl has joined #ruby
<mg^>
we need to get MRuby into firefox or something
<Cohedrin>
well theres a reason you cant
<Cohedrin>
its too slow lol
skade has quit [Quit: Computer has gone to sleep.]
<Cohedrin>
can you imagine
<Cohedrin>
doing the stupid shit people do in js
<Cohedrin>
in ruby
<Cohedrin>
in the browser?
dfinninger has quit [Remote host closed the connection]
<Cohedrin>
you'd need ibm watson to load a web page
dlitvak has quit [Ping timeout: 240 seconds]
dfinninger has joined #ruby
uri_ has quit [Quit: --]
<newdan>
zambini: You can try compiling Ruby to JS using Opal
uri_ has joined #ruby
<zambini>
:l
n00bdev has joined #ruby
nertzy has joined #ruby
diegoviola has joined #ruby
<newbie22>
*: What do you guys think about the book "Learn Ruby the Hard way" ??
<shevy>
you should learn idiomatic ruby
Outlastsheep has quit [Ping timeout: 240 seconds]
postmodern has joined #ruby
baweaver has joined #ruby
hxegon has joined #ruby
PhantomSpank has quit [Remote host closed the connection]
fantazo has joined #ruby
benlieb has quit [Quit: benlieb]
PhantomSpank has joined #ruby
jottr has joined #ruby
B1n4r10 has quit [Ping timeout: 264 seconds]
ta has joined #ruby
dlitvak has joined #ruby
PsionTheory has joined #ruby
<newbie22>
shevy: what is the difference ??
mistermocha has quit [Remote host closed the connection]
<shevy>
newbie22 you will write better ruby code if you learn idiomatic ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
baweaver has quit [Ping timeout: 250 seconds]
last_staff has quit [Ping timeout: 250 seconds]
ramfjord has quit [Ping timeout: 250 seconds]
ta_ has quit [Ping timeout: 255 seconds]
harai has joined #ruby
<newdan>
shevy: "Learn Ruby the Hard Way" doesn't teach idiomatic Ruby?
ramfjord has joined #ruby
mchu has joined #ruby
mchu has quit [Remote host closed the connection]
rodfersou has quit [Quit: leaving]
atomical_ has joined #ruby
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rodya_ has joined #ruby
mchu has joined #ruby
Rodya_ has quit [Remote host closed the connection]
<Xeago>
How can one 'spawn' a process in ruby and write to it's stdin? The sole purpose of my script is to launch that process, write to stdin and quit or stop existing.
skade has joined #ruby
babblebre has joined #ruby
psuedo has joined #ruby
<shdw_frbrd>
IO.popen does that, I think
DoubleMalt has joined #ruby
<psuedo>
Hey gents' and lents' -- I was curious of your opinion on using !(varA == varB) vs varA != varB for logic comparison
<psuedo>
For readability, I wanted to use the former in an if-block... But I was wondering if I should just leave it at !=
<Xeago>
shdw_frbrd: thanks!
<newdan>
psuedo: != is more straightforward imo
<shdw_frbrd>
@Xeago -- check ri or the web -- I don't use it, so take that with salt...
nertzy has quit [Quit: This computer has gone to sleep]
<Roxas>
Hi everyone, im pretty new to ruby and have possibly a dumb question that I havent found a straight answer for on google
<al2o3-cr>
platzhirsch: ternary
<psuedo>
coupons = (current_coupon.present?) ? all + [current_coupon] : all
AnoHito_ has quit [Ping timeout: 250 seconds]
<psuedo>
?
llrb001 has quit [Remote host closed the connection]
<platzhirsch>
not sure if that increases readability :D but true!
<psuedo>
or you could do...
<psuedo>
coupons = all ... coupons = coupons + [current_coupon] if current_coupon.present?
blackgoat has joined #ruby
jam_ has joined #ruby
hakunin has quit [Remote host closed the connection]
<shdw_frbrd>
@platzhirsch - of course the cleanest solution is to make the coupons object deal with it
cryzlr has joined #ruby
<Roxas>
i have a variable that takes a number and converts it from lbs to kgs. how do I make sure that it only spits out its answer to the 2nd decimal place? Example: 500.23554 -> 500.24
<Xeago>
shdw_frbrd: I'm running `cat` which reads from stdin, I've straced it and it is reading from it's stdin. When trying to #write to the returned object, it gives `IOError: not opened for writing`. Any idea's? I've read the online documentation, but it doesn't cover how to write to the process /from/ ruby, it only shows how to attach files to the different streams.
<Roxas>
awesome. exactly what i was looking for. thanks!
<zambini>
platzhirsch: This may be a silly question but is current_coupon inside of all? Reading that makes me think that (obviously w/o real context)
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jtnegrotto has quit [Ping timeout: 276 seconds]
<platzhirsch>
zambini: that's a good question, no all is based on a YAML file and current is retrieved from the associated modell
<Xeago>
even though #closed? is `false` :|
<shdw_frbrd>
@Xeago - running 'cat' seems wrong to me -- what are you catting and why?
Roxas has quit [Quit: Leaving]
dlitvak has joined #ruby
dopie has quit [Quit: Lost terminal]
<shdw_frbrd>
@Xeago if you are just appending to a file...
ta has quit [Read error: Connection reset by peer]
choke has joined #ruby
ta has joined #ruby
PedramT_ has quit [Remote host closed the connection]
dlitvak has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 265 seconds]
newbie22 has quit [Quit: Leaving]
PedramT_ has joined #ruby
<zambini>
platzhirsch: Are you using rails for that? If you wanted to avoid a ternary you could do `(all + current_coupon.presence).compact` and avoid any ifs
hakunin has joined #ruby
<Xeago>
shdw_frbrd: I'm running cat as a example program, cat is easy and you have it :)
dlitvak has joined #ruby
<platzhirsch>
zambini: wow that's neat
<platzhirsch>
indeed
<zambini>
I believe it's only rails though
tomchapin has joined #ruby
n00bdev has quit [Remote host closed the connection]
Dimik has joined #ruby
<Xeago>
`cat`, typing text, giving it an EOF character (^D) has the expected result
<Xeago>
I want to now do this programmattically in ruby
lxsameer has quit [Quit: Leaving]
<Xeago>
(`cat` in irb)
<shdw_frbrd>
@Xeago hang on a min...
roshanavand has quit [Read error: Connection reset by peer]
<zambini>
Oh, except I typo'd, you still have to wrap it in brackets `(all + [current_coupon.presence]).compact`, or you could `push` it if you don't want to bracketize things
mistermocha has joined #ruby
roshanavand has joined #ruby
<drocsid>
I'm getting /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:879:in `initialize': getaddrinfo: Name or service not known (SocketError) when using open ui, but I can resolve the host using nslookup. What gives?
PedramT has quit [Ping timeout: 240 seconds]
<drocsid>
open_uri*
weemsledeux has joined #ruby
PedramT_ has quit [Remote host closed the connection]
skade has quit [Read error: No route to host]
PedramT has joined #ruby
skade has joined #ruby
bronson has quit [Remote host closed the connection]
mistermocha has quit [Remote host closed the connection]
mistermocha has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
weemsledeux has quit [Max SendQ exceeded]
<shdw_frbrd>
@Xeago x = IO.popen('cat', mode='w'); w.puts "foo" ?? Trying to test that in pry, but I think HexChat is screwing with my tiny netbook...
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shdw_frbrd>
@Xeago seems to work here
<shdw_frbrd>
@Xeago - or IO.popen('cat', mode='w') {|x| ...
<Xeago>
shdw_frbrd: I see, I've been stupid, the default mode is just 'r', I did not specify that I wanted to write to it :|
<Xeago>
Thanks!
dlitvak has quit [Remote host closed the connection]
<shdw_frbrd>
Happy to help...
IrishGringo has quit [Read error: Connection reset by peer]
akem has quit [Quit: Bye]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<craysiii>
anyone using VS Code for ruby?
IrishGringo_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
choke has joined #ruby
roshanavand has joined #ruby
nertzy has joined #ruby
PhantomSpank has quit [Remote host closed the connection]
FernandoBasso has joined #ruby
psuedo has quit [Quit: Page closed]
<Ebok>
Does anyone know of a good web tutorial for the various File.readlines File.open etc? Basically the ins and outs of reading and writing to files. I've been using RubyDoc primarily and that's great as a reference, but I'm looking for some instructional pieces that'll teach me best-practices when it comes to these methods.
Coldblackice has joined #ruby
<norc>
craysiii, editors like any other part of your development environment are like religion. Pick one you like but dont talk about it.
IrishGringo_ has quit [Read error: Connection reset by peer]
<norc>
Ebok, use ri instead of rdoc btw
<craysiii>
maybe to you they are :) not everyone is close-minded
<Ebok>
Sure.
j_mcnally has joined #ruby
<norc>
craysiii, no it is just that these talks tend to end up in religious wars - and those always end up in glorious vim vs emacs wars.
<norc>
Its just filled with beliefs, nothing else.
j_mcnally has quit [Max SendQ exceeded]
nerium has joined #ruby
dhollinger has quit [Quit: WeeChat 1.3]
<zambini>
I would suggest Sublime Text craysiii :P unless you're a command line junkie
lucasb has joined #ruby
<craysiii>
i moved from sublime text to VS code for my web stuff, just wondering if anyone has experience with it using ruby/rails
<craysiii>
ill stop though :)
<norc>
Ebok, best practices come with with experience honestly, not from guides.
goodroot has quit [Ping timeout: 250 seconds]
<norc>
Ebok, best to start contributing to existing projects that make extensive use of these facilities.
<Ebok>
norc, I have to start somewhere.
<norc>
Ebok, contribute to a Gem you like then.
<shdw_frbrd>
Sometimes you need some pointers before you can get the experience...
IrishGringo has joined #ruby
roshanavand has quit [Remote host closed the connection]
baweaver has joined #ruby
ta has quit [Read error: Connection reset by peer]
<norc>
Ebok, the advantage is that you gain experience with the used facilities, with gems, with testing, deployment - all very useful feats. :)
ta has joined #ruby
shdw_frbrd has left #ruby ["Leaving"]
baweaver has quit [Remote host closed the connection]
<norc>
And by doing that you get to pick up how other people solve problems, until you start to develop your own style or recognize good and bad patterns.
baweaver has joined #ruby
idefine has joined #ruby
codecop has quit [Remote host closed the connection]
<Ebok>
I completely agree with you. I'm not there yet however, I have to get my footing in the language before attempting to make contributions.
roshanavand has joined #ruby
<Ebok>
In time. First, Im got to figure out how to DO stuff.
<norc>
Alright. Id say dont worry about best practices at all then.
<norc>
Just focus on getting things done.
bigkevmcd has joined #ruby
<norc>
Ebok, the only best practice advice that is relevant for you, is to definitely use the block variants of the File class functions.
arup_r has quit []
<Ebok>
I dont even know what that is
<Ebok>
:P
<norc>
Like File.open(path, mode) { |handle| }
dlitvak has joined #ruby
ta has quit [Read error: Connection reset by peer]
ta has joined #ruby
bigkevmcd has quit [Read error: Connection reset by peer]
<norc>
Ebok, otherwise feel free to write code and share your gists here, there is plenty people who can give you constructive criticsm.
segmond has quit [Ping timeout: 260 seconds]
<Ebok>
Thanks norc.
Asher has quit [Quit: Leaving.]
platzhirsch has left #ruby [#ruby]
j_mcnally has joined #ruby
j_mcnally has quit [Max SendQ exceeded]
dlitvak has quit [Remote host closed the connection]
jbrhbr has quit [Quit: Leaving.]
dlitvak has joined #ruby
j_mcnally has joined #ruby
zambini has quit [Quit: Leaving.]
momomomomo has quit [Quit: momomomomo]
graffix222 has quit [Ping timeout: 260 seconds]
mistermocha has quit [Remote host closed the connection]
skade has quit [Read error: No route to host]
psy_ has quit [Ping timeout: 245 seconds]
skade has joined #ruby
psy_ has joined #ruby
howdoicomputer has joined #ruby
pawnbox has joined #ruby
livcd has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
IrishGringo has quit [Read error: Connection reset by peer]
IrishGringo_ has joined #ruby
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nertzy has quit [Quit: This computer has gone to sleep]
sgambino has joined #ruby
uri_ has joined #ruby
Rodya_ has joined #ruby
Derailed has joined #ruby
aspire has joined #ruby
emilford has quit [Ping timeout: 255 seconds]
skade has quit [Read error: No route to host]
nertzy has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
symm- has quit [Quit: Leaving...]
binaryplease has joined #ruby
emilford has joined #ruby
diego4 has joined #ruby
diego4 has quit [Changing host]
diego4 has joined #ruby
dlitvak has quit [Ping timeout: 265 seconds]
dhollinger has joined #ruby
j_mcnally has quit [Read error: Connection reset by peer]
dlitvak has joined #ruby
lucasb has quit [Quit: leaving]
blackmes1 has quit [Ping timeout: 245 seconds]
diegoviola has quit [Ping timeout: 256 seconds]
cicloid has joined #ruby
harai has quit [Ping timeout: 276 seconds]
atomical has joined #ruby
casadei has joined #ruby
bronson has joined #ruby
ta_ has joined #ruby
PhantomSpank has joined #ruby
cicloid_ has quit [Ping timeout: 265 seconds]
ta_ has joined #ruby
ta_ has quit [Client Quit]
baweaver has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aupadhye has quit [Ping timeout: 245 seconds]
aspire has quit [Quit: Leaving]
pulgolino has quit [Quit: WeeChat 0.4.2]
PedramT has quit [Ping timeout: 245 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cbyrda has joined #ruby
ta has quit [Ping timeout: 255 seconds]
usershell has joined #ruby
B1n4r10 has quit [Ping timeout: 264 seconds]
nertzy has quit [Quit: This computer has gone to sleep]
sneakerhax has joined #ruby
sgambino has joined #ruby
dlitvak has quit [Remote host closed the connection]
YP-QMUL-W has joined #ruby
diego4 is now known as diegoviola
bronson has quit [Ping timeout: 265 seconds]
<mchu>
looking for a project for a beginnner/intermediate level programmer to learn / build a portfolio. anything out there? thanks in advance!
colegatron has quit [Ping timeout: 265 seconds]
jerematic has joined #ruby
<Waheedi>
start your own project for now mchu until something works out :)
jerematic has quit [Remote host closed the connection]
<Waheedi>
thats my advice
atmosx has quit [Quit: Lost in trance]
norc has quit [Ping timeout: 250 seconds]
dlitvak has joined #ruby
psy_ has quit [Ping timeout: 260 seconds]
<mchu>
I tried but I’m not creative enough. I’d like to have set goals/instructions if possible. but any good open source projects out there for beginners?
sgambino has quit [Client Quit]
<eam>
mchu: what's your skillset look like? What kinds of areas are you interested in?
dlitvak has quit [Remote host closed the connection]
dotrb has joined #ruby
<dotrb>
Hi!
atomical_ has joined #ruby
niotoan has joined #ruby
synthroid has quit []
<mchu>
well i know rubyonrails, js, html, css. Looking to debug or possibly build something with some concrete instructions
goodroot has quit [Ping timeout: 276 seconds]
graphettion has quit [Remote host closed the connection]
<dotrb>
newbie here, should I use rvm or rbenv?
<havenwood>
dotrb: chruby
DurstBurger has quit [Ping timeout: 260 seconds]
ta has joined #ruby
sgambino has joined #ruby
goodroot has joined #ruby
zeroDivisible has joined #ruby
guacamol_ has joined #ruby
guacamole has quit [Ping timeout: 245 seconds]
<mfb2>
dotrb: I use rbenv
dlitvak has joined #ruby
<eam>
I use rvm but I'm really not pleased with it
<mfb2>
I struggled through that decision again recently... I had used both in the past, I found rbenv to be much easier to reason about
<Waheedi>
i use rvm and I like it :)
<adaedra>
+1 for chruby.
<niotoan>
Rvm!
<Waheedi>
three characters :)
dlitvak has quit [Remote host closed the connection]
<Waheedi>
less is more :P
<dotrb>
well..
<adaedra>
lol.
<dotrb>
it's like one of those emacs vs vim questions for the ruby world it seems
<adaedra>
"Less is more" is the perfect thing to say *against* rvm, if I may.
atomical has quit [Ping timeout: 264 seconds]
<Waheedi>
lol yeah
<cbyrda>
I'm fairly new to ruby but I've been using rvm, maybe because I don't know any better what is 'The case against RVM' if there is one?
jottr has joined #ruby
momomomomo has joined #ruby
<adaedra>
It's bloat, to be short.
solars has joined #ruby
last_staff has joined #ruby
<dotrb>
adaedra: what is bloat? rvm?
<adaedra>
yeah.
<Waheedi>
mostly end results are very important
<mfb2>
don't expect a cogent defense of rbenv from me... I simply found it easier to deal with than rvm. I recall it required a lot of hand-holding in order to work properly
<cbyrda>
So I guess this is really targeted at people that don't really use multiple ruby versions so maybe if you only ever just use the latest I can see the bloat argument
<adaedra>
mfb2: argument against rbenv: rbenv rehash
<dotrb>
adaedra: yupp, there's that
<mfb2>
adaedra: fair point, definitely had that happen to me in the past
* dotrb
issues rbenv rehash command he forgot earlier
<adaedra>
?rbenv
<ruby[bot]>
Missing command under rbenv? Did you try `rbenv rehash`?
<adaedra>
:p
dlitvak has joined #ruby
__chris has quit [Quit: This computer has gone to sleep]
<newdan>
rbenv is the only one that reads the intended Ruby version from the command line, right?
ledestin has joined #ruby
<newdan>
Er, meant to say from the filesystem
<adaedra>
no?
<newdan>
adaedra: Elaborate?
<dotrb>
chruby seems very minimal
lemur has joined #ruby
<adaedra>
chruby does it too, and iirc rvm does it too
<adaedra>
dotrb: that's the goal.
disconnekted has quit [Remote host closed the connection]
<greenhat>
It looks like adding methods in a rake file just adds those methods to Object, even if you declare the methods in a rake namespace.
<greenhat>
Is that right?
<dotrb>
ah.. clarity
VeryBewitching has quit [Quit: Konversation terminated!]
<cbyrda>
anyone around here ever use Nexus as a gemserver? If so, how did it work out for you
[Butch] has quit [Quit: I'm out . . .]
dlitvak has quit [Remote host closed the connection]
<greenhat>
Is there a suggested way to create functions in a rake file where they don't get added to the global namespace?
colegatron has joined #ruby
roshanavand has quit []
lemur has quit [Ping timeout: 265 seconds]
lacuna has quit [Read error: Connection reset by peer]
uri_ has quit [Ping timeout: 272 seconds]
lacuna has joined #ruby
cbyrda has quit [Quit: Gone]
goodroot has quit [Ping timeout: 260 seconds]
guacamole has joined #ruby
mistermocha has quit [Remote host closed the connection]
PhantomSpank has quit [Remote host closed the connection]
niotoan has quit [Ping timeout: 272 seconds]
dotrb has quit [Quit: WeeChat 1.3]
guacamol_ has quit [Ping timeout: 276 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
axisys has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
sgambino has joined #ruby
pwnd_nsfw has quit [Quit: Leaving]
axisys has joined #ruby
sgambino has quit [Client Quit]
diego4 has joined #ruby
diego4 has quit [Changing host]
diego4 has joined #ruby
agent_white has quit [Quit: brb]
PhantomSpank has joined #ruby
rdark has quit [Ping timeout: 264 seconds]
agent_white has joined #ruby
diegoviola is now known as Guest73861
diego4 is now known as diegoviola
sepp2k has quit [Quit: Leaving.]
sgambino has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
<Ox0dea>
greenhat: Either stick them in your own namespace or add them to Object in a refinement such that they're only visible from the Rakefile itself.
goodroot has joined #ruby
Guest73861 has quit [Ping timeout: 260 seconds]
usershell has quit [Ping timeout: 250 seconds]
gizless has joined #ruby
dlitvak has joined #ruby
gizmore has quit [Ping timeout: 245 seconds]
northfurr has joined #ruby
jbrhbr has joined #ruby
finisherr has joined #ruby
ohcibi has quit [Remote host closed the connection]
steffkes has quit [Ping timeout: 265 seconds]
dlitvak has quit [Remote host closed the connection]
dlitvak has joined #ruby
FernandoBasso has quit [Ping timeout: 272 seconds]
choke has joined #ruby
ohcibi has joined #ruby
binaryplease1 has joined #ruby
baweaver has quit [Remote host closed the connection]
northfurr has quit [Client Quit]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GinoManWorks has quit [Read error: Connection reset by peer]
binaryplease has quit [Ping timeout: 260 seconds]
baweaver has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FernandoBasso has joined #ruby
eriick has joined #ruby
gbgdev has quit [Remote host closed the connection]
jam_ has joined #ruby
gbgdev has joined #ruby
confounds has joined #ruby
yfeldblum has joined #ruby
binaryplease1 has quit [Quit: WeeChat 1.3]
gbgdev has quit [Remote host closed the connection]
binaryplease has joined #ruby
nertzy has joined #ruby
skade has joined #ruby
eriick has left #ruby [#ruby]
zambini has joined #ruby
dlitvak_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
jam_ has quit [Ping timeout: 240 seconds]
newdan has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 240 seconds]
yqt has joined #ruby
Axy has quit [Ping timeout: 265 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
darkf has quit [Quit: Leaving]
ohcibi has quit [Remote host closed the connection]
stevemackinnon has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
kalopsian has joined #ruby
baweaver has quit [Remote host closed the connection]
idefine has quit [Remote host closed the connection]
gizmore has joined #ruby
mchu has quit [Quit: mchu]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
ohcibi has joined #ruby
dextertzu has quit [Read error: Connection reset by peer]
<drbrain>
greenhat: I put functions in a library and make rake a wrapper for the library's actions
<drbrain>
then you get both rake tasks and an API for enhanced automation
pawnbox has quit [Ping timeout: 256 seconds]
mchu has joined #ruby
dlitvak_ has quit [Remote host closed the connection]
atomical has joined #ruby
Jackneill has quit [Ping timeout: 265 seconds]
momomomomo has quit [Quit: momomomomo]
gizless has quit [Ping timeout: 260 seconds]
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
<zambini>
Remember: They're just guidelines, but if you have any questions that page does a pretty decent job of saying what reasons they have for their choices
hxegon has quit [Ping timeout: 272 seconds]
zerowaitstate has quit [Quit: leaving]
<zambini>
For me, learning styles is an important part of learning what it means to "do things right" in a language. Having Rubocop plugin in SublimeText/Emacs/Vim is a nice way to see things in realtime
<zambini>
I'm also new to Ruby specifically, but it helps me out to see almost instantly that I typed something in a less-recommended style. Same thing happened when I was learning Python with PEP8 plugins.
decoponio has quit [Quit: Leaving...]
FernandoBasso has quit [Quit: Leaving]
<Ebok>
I like to have as many good references as possible.
Mackerel has joined #ruby
Mackerel is now known as Pufferfish
phredus has quit [Remote host closed the connection]
pawnbox has joined #ruby
<Pufferfish>
hello all
drocsid has joined #ruby
YP-QMUL-W has quit [Read error: Connection reset by peer]
<Radar>
hi
finisherr has left #ruby [#ruby]
skade has quit [Quit: Computer has gone to sleep.]
bronson has joined #ruby
<lucasb>
that style guide is very good, but... some items are very subjective. I don't follow everything in there.
pawnbox has quit [Ping timeout: 240 seconds]
baweaver has joined #ruby
<Radar>
Sacriledge.
emilford_ has quit [Ping timeout: 240 seconds]
<Radar>
Shun the non-believer.
benzrf has joined #ruby
<benzrf>
hey
<Ox0dea>
Radar: No D like in "privilege".
saneax_AFK is now known as saneax
<Radar>
Ox0dea: I am sorry Oh Mighty One.
<benzrf>
with Thread.new, what order of magnitude of threads is it reasonable to go up to
<benzrf>
10s? 100000s?
<Pufferfish>
what's up Radar, back again to flail with beginner mess
saneax is now known as Guest91159
CihanKaygusuz has left #ruby [#ruby]
<Radar>
Pufferfish: you know me :)
^matp has quit [Ping timeout: 245 seconds]
Snowy has joined #ruby
confounds has quit []
<lucasb>
It's funny how psychology works. It can make you feel like a bad person if you don't follow the style guide. But I think I got over it, now :)
emilford has joined #ruby
chipotle has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
goodroot has quit [Ping timeout: 256 seconds]
<Ox0dea>
benzrf: Nice to meet you.
mary5030_ has joined #ruby
Xeago has joined #ruby
TomyLobo has quit [Ping timeout: 255 seconds]
sakix has quit [Ping timeout: 264 seconds]
CloCkWeRX has joined #ruby
drocsid has quit [Quit: leaving]
choke has joined #ruby
dlitvak_ has joined #ruby
goodroot has joined #ruby
paradisaeidae has joined #ruby
mary5030 has quit [Ping timeout: 255 seconds]
mchu has joined #ruby
dlitvak has quit [Ping timeout: 250 seconds]
mchu has quit [Client Quit]
casadei has joined #ruby
didymus has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 255 seconds]
jottr has quit [Ping timeout: 256 seconds]
guacamol_ has quit [Ping timeout: 240 seconds]
<zambini>
lucasb: yep! Exactly why it's a guide and not a rule :D
jgpawletko has quit [Quit: jgpawletko]
agent_white has quit [Read error: Connection reset by peer]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
casadei has quit [Ping timeout: 260 seconds]
Xeago has quit [Ping timeout: 240 seconds]
guacamole has joined #ruby
dfockler has joined #ruby
lemur has joined #ruby
x77686d has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]