havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.5.0, 2.4.3, 2.3.6, 2.6.0-preview1: https://www.ruby-lang.org || Paste 4+ lines of text to https://gist.github.com || Rails questions? Ask in #RubyOnRails || Books: https://goo.gl/wpGhoQ || Logs: https://irclog.whitequark.org/ruby
mojtaba has quit [Quit: Leaving.]
duckpuppy has quit [Ping timeout: 240 seconds]
<seydar> weird. works on one machine (mac 10.9.5), but not another (ubuntu)
marxarelli has joined #ruby
<seydar> ah okay. that was the problem. i just had to publically ask first before either a) the problem fixed itself or b) i figured out that rvm wasn't getting the latest list
gigetoo has joined #ruby
Olipro has quit [Ping timeout: 240 seconds]
harry_ has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 276 seconds]
harry_ has joined #ruby
jobewan has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.1]
shinnya has quit [Ping timeout: 256 seconds]
ramfjord has quit [Ping timeout: 276 seconds]
ramfjord has joined #ruby
n0m4d1c has joined #ruby
harry_ has quit [Remote host closed the connection]
harry_ has joined #ruby
jobewan has quit [Quit: jobewan]
seydar has quit [Quit: leaving]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
beremenushka has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
beremenushka has joined #ruby
katoline has joined #ruby
tdy has quit [Quit: WeeChat 1.9.1]
harry_ has quit [Ping timeout: 264 seconds]
cdg has quit [Remote host closed the connection]
n008f4g_ has quit [Ping timeout: 260 seconds]
tolerablyjake has joined #ruby
<katoline> hello
alfiemax has quit [Ping timeout: 240 seconds]
clemens3 has quit [Ping timeout: 240 seconds]
katoline has left #ruby [#ruby]
riotjones has joined #ruby
kn-928 has quit [Ping timeout: 240 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 276 seconds]
AJA4350 has joined #ruby
ramfjord has joined #ruby
gix has quit [Read error: No route to host]
roshanavand has quit [Quit: Leaving.]
chmuri has quit [Ping timeout: 240 seconds]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
ramfjord has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
gix has joined #ruby
white_lilies has joined #ruby
white_lilies has quit [Client Quit]
white_lilies has joined #ruby
jobewan has joined #ruby
noobineer has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
harry_ has joined #ruby
bmurt has joined #ruby
duckpuppy has joined #ruby
harry_ has quit [Remote host closed the connection]
fhmax has joined #ruby
jobewan has quit [Quit: jobewan]
harrycs has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
duckpuppy has quit [Ping timeout: 263 seconds]
ledestin has joined #ruby
harrycs has quit [Ping timeout: 260 seconds]
chmurifree has joined #ruby
riotjones has joined #ruby
gizmore|2 has joined #ruby
fhmax has quit [Remote host closed the connection]
tryingruby has joined #ruby
gizmore has quit [Ping timeout: 248 seconds]
riotjones has quit [Ping timeout: 276 seconds]
darkhanb has joined #ruby
<tryingruby> Hi All, trying ruby 101 to be used for ingesting data using logstash: But i can't get past this basic thing I am trying to do. I am not a Ruby programmer, but wondering if one could quickly point my mistake in this 4 line code: https://pastebin.com/D6c3qc2a
marxarelli is now known as marxarelli|afk
<ruby[bot]> tryingruby: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
SeepingN has quit [Quit: The system is going down for reboot NOW!]
alfiemax has joined #ruby
gix has quit [Quit: Client exiting]
jobewan has joined #ruby
<phaul> tryingruby: first thing I spot is that .map(&:to_s) does nothing
<phaul> afaics, at least, those are already strings
<tryingruby> phaul: okay I will get rid of it
gix has joined #ruby
<phaul> but otherwise Im not seeing any obvious mistake. although it's 3 am in the morning here :)
<tryingruby> phaul: I expect only the matched line to be printed, instead I get all lines printed out, any idea why?
dinfuehr has quit [Ping timeout: 256 seconds]
ElFerna has joined #ruby
dinfuehr has joined #ruby
<phaul> yes you are in a repl right like irb? you are not printing anything. the repl prints the last expression which is the whole block
<tryingruby> phaul: 3am that's too late in the night or too early in the morning ;) Anyways my file is delimited by pipe(|)
alfiemax_ has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
<phaul> so the task is to print get an array of lines where only the lines with the String 'user' are kept?
<phaul> s/print//
<phaul> you could put a .grep(/user/) right on on each_line and forget about the block
<tryingruby> phaul: yes that is correct: each line if formatted as user|xyz|sss|sssys|ssddsd|...|zzz ; where user is different user names; and i want to grep specific user and find further details related to user in an array and pass it to elasticsearch
<tryingruby> phaul: can you please explain be why is the current code referencing a block and not a line as I think it is?
<tryingruby> me*
<tryingruby> phaul: I understood data is a line array with all values split in a line
<phaul> so you were saying this code prints something. There is not a single print in this code. That's why I said it must be the REPL giving you the value of the expression you typed
noobineer has quit [Ping timeout: 276 seconds]
noobineer has joined #ruby
<phaul> and that's the whole thing. try putting a puts on the last line in the block to see what hat evaluates to
Radar has joined #ruby
<phaul> s/hat/that/
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
noobineer has quit [Remote host closed the connection]
<tryingruby> phaul: I tried putting a just "puts" but same thing it prints the whole block; what do you mean by s/hat/that/ I understand this has search and replace in vi?
govg has quit [Ping timeout: 260 seconds]
noobineer has joined #ruby
noobineer has quit [Max SendQ exceeded]
<phaul> tryingruby: I made a typo `hat' -> `that' in my previous comment.
<phaul> so, this code does not filter out lines. you iterate on all lines with .each_line. then for all lines you apply the block.
n0m4d1c has quit [Remote host closed the connection]
<tryingruby> phaul: here is what I tried: var=line.grep(/user/); puts var; it failed
<tryingruby> phaul: how do I filter out lines?
guacamole has quit [Client Quit]
<phaul> put a .grep(/user/) on .each_line like
fhmax has joined #ruby
<phaul> File.read("OU_user_details.log").each_line.grep(/user/)
<tryingruby> phaul: is this correct: var=line.grep(/myuser/) ?
<tryingruby> ah
<phaul> you don't even need the block, this just returns an array of matching lines
<tryingruby> phaul: got it that worked. but i get an extra => [nil] printed at the end, what is that for?
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> that's the REPL telling you the value of the last expression
<phaul> that mechanism is simply part of irb
workmad3 has joined #ruby
<tryingruby> phaul: I see, I plan to set variables from the matched lines and their values in elasticsearch/logstash using their libraries that implement event.set I just i hope this nil will not be an issue at that time given it is not running interactively then.
<tryingruby> phaul: anyways thanks a lot my friend ... I will continue with finishing up what i was trying. for now this much ruby is good!! get some rest!!
cdg has joined #ruby
<phaul> good luck with your project
Dimik has joined #ruby
riotjones has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
cagomez has joined #ruby
pilcrow has joined #ruby
phaul has quit [Ping timeout: 264 seconds]
cdg has quit [Ping timeout: 276 seconds]
riotjones has quit [Ping timeout: 264 seconds]
cagomez has quit [Ping timeout: 276 seconds]
jobewan has quit [Quit: jobewan]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
rshetty has joined #ruby
milardovich has joined #ruby
milardovich has quit [Read error: Connection reset by peer]
guacamole has quit [Client Quit]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
jenrzzz_ has quit [Ping timeout: 260 seconds]
duckpuppy has joined #ruby
rshetty has quit [Ping timeout: 256 seconds]
ivanskie has joined #ruby
duckpuppy has quit [Ping timeout: 264 seconds]
Olipro has joined #ruby
Olipro is now known as Guest72808
duderonomy has joined #ruby
fhmax has quit [Remote host closed the connection]
netherwolfe has joined #ruby
n0m4d1c has joined #ruby
STYNC has joined #ruby
netherwolfe has quit [Ping timeout: 240 seconds]
riotjones has joined #ruby
kapil___ has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n0m4d1c has quit [Remote host closed the connection]
pilne has quit [Quit: Leaving]
riotjones has quit [Ping timeout: 268 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jane_booty_doe has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax_ has quit [Remote host closed the connection]
kn-928 has joined #ruby
ElFerna has quit []
harrycs has joined #ruby
toks has joined #ruby
rshetty has joined #ruby
riotjones has joined #ruby
harry_ has joined #ruby
Dimik has quit [Ping timeout: 264 seconds]
toks has quit [Quit: Leaving]
harrycs has quit [Ping timeout: 248 seconds]
harry__ has joined #ruby
riotjones has quit [Ping timeout: 256 seconds]
rshetty has quit [Remote host closed the connection]
harry_ has quit [Ping timeout: 264 seconds]
harry_ has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
rshetty has joined #ruby
guacamole has quit [Client Quit]
r2 has quit [Ping timeout: 264 seconds]
harry__ has quit [Ping timeout: 240 seconds]
rshetty has quit [Remote host closed the connection]
duckpuppy has joined #ruby
harry__ has joined #ruby
harry_ has quit [Ping timeout: 240 seconds]
LenPayne has quit [Quit: ZNC 1.6.6 - http://znc.in]
LenPayne has joined #ruby
duckpuppy has quit [Ping timeout: 256 seconds]
elphe has quit [Quit: leaving]
white_lilies has quit [Ping timeout: 248 seconds]
jyaworski has quit [Ping timeout: 260 seconds]
harry_ has joined #ruby
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
harry__ has quit [Ping timeout: 240 seconds]
riotjones has joined #ruby
n0m4d1c has joined #ruby
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
riotjones has quit [Ping timeout: 246 seconds]
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
ramfjord has joined #ruby
ivanskie has joined #ruby
workmad3 has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
r3m has quit [Quit: ZNC - http://znc.in]
r3m has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
apeiros has quit [Ping timeout: 245 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
harry__ has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
apeiros has joined #ruby
ryan_ford has joined #ruby
pastorinni has joined #ruby
harry_ has quit [Ping timeout: 246 seconds]
tryingruby has quit [Ping timeout: 260 seconds]
Burgestrand has joined #ruby
harrycs has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
harry__ has quit [Ping timeout: 276 seconds]
darkhanb has joined #ruby
GJdan has joined #ruby
alfiemax has quit [Remote host closed the connection]
rshetty has joined #ruby
kn-928 has quit [Quit: WeeChat 2.1]
riotjones has joined #ruby
darkhanb has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has joined #ruby
b100s has joined #ruby
duckpuppy has joined #ruby
eckhardt has joined #ruby
riotjones has quit [Ping timeout: 276 seconds]
govg has joined #ruby
<b100s> Hello! Probably simple question: could I force Sinatra to listen on multiple IPs or/and ports ?
<baweaver> Probably, though you probably want to use NGINX for that instead.
<harrycs> Hi all, restarting my job search made me a little self conscious of my Twitter - so I made a tool in Ruby to purge an account of likes, tweets, and rts. Just thought I'd share this in case any others have had similar https://github.com/stebbins/cage-the-bird
darkhanb has joined #ruby
<baweaver> you might get dinged for the eval in there if you show it off.
STYNC has quit [Ping timeout: 240 seconds]
duckpuppy has quit [Ping timeout: 256 seconds]
<harrycs> baweaver: was that @ me or b100s?
<baweaver> You.
<harrycs> What do you mean by dinged for the eval?
Burgestrand has quit [Quit: Closing time!]
<baweaver> If you show off that code as an example the eval might get some looks
<baweaver> you could likely use public_send there intead, or even a case statement dispatch
<harrycs> baweaver: interesting, thanks for the tip! just curious - what's the advantage of public_send over eval?
<baweaver> public_send will only send to the instance and will only allow you to call the public interface of it
<baweaver> eval lets you do anything
<baweaver> like someone passes you `rm -rf` for instance
jane_booty_doe has quit [Quit: Leaving]
<b100s> baweaver, could I run multiple "apps" in one server like `my_app = Sinatra.new { get('/') { "hi" } } my_app.run!`, so each will listen to different IP and port ?
<harrycs> baweaver: ah, good to know! Thanks for taking a look & for the feedback!
<baweaver> Use NGINX for it, it'll be easier on you
<baweaver> You could
<baweaver> Though if you're running multiple apps off of one file I would consider breaking that up anyways.
<b100s> baweaver, noted, nginx is not my current case, unfotunately
<baweaver> What's your current case?
<b100s> baweaver, I have app which runs inside cloud like bluemix, so I'm not able to change anything aside my app
<b100s> I have two interfaces and have to listen to them for handle different requests
Burgestrand has joined #ruby
rikai has quit [Quit: No Ping reply in 180 seconds.]
rikai has joined #ruby
trautwein has quit [Quit: ZNC 1.6.6 - http://znc.in]
trautwein has joined #ruby
pastorinni has quit [Remote host closed the connection]
zacts has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
riotjones has joined #ruby
alfiemax has joined #ruby
kriskropd has quit [Ping timeout: 245 seconds]
ivanskie has quit [Quit: Textual IRC Client: www.textualapp.com]
rshetty has quit [Ping timeout: 260 seconds]
riotjones has quit [Ping timeout: 263 seconds]
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
Burgestrand has quit [Client Quit]
harrycs has quit [Ping timeout: 260 seconds]
rshetty has joined #ruby
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
jane_booty_doe has joined #ruby
jaequery has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
AJA4350 has quit [Quit: AJA4350]
RougeR has quit [Ping timeout: 276 seconds]
duckpuppy has joined #ruby
rshetty has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 276 seconds]
reber has joined #ruby
reber__ has joined #ruby
reber__ has quit [Remote host closed the connection]
ryan_ford has quit [Ping timeout: 276 seconds]
jyaworski has joined #ruby
__main__ has quit [Read error: Connection reset by peer]
__main__ has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
stoffus has joined #ruby
jaequery has quit [Client Quit]
tolerablyjake has joined #ruby
cdg has joined #ruby
jyaworski has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 276 seconds]
nowhereman_ has joined #ruby
howdoi has joined #ruby
sauvin_ has joined #ruby
oleo has quit [Quit: Leaving]
jyaworski has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
riotjones has joined #ruby
workmad3 has joined #ruby
aupadhye has joined #ruby
jaequery has joined #ruby
riotjones has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 256 seconds]
shuforov has joined #ruby
n008f4g_ has joined #ruby
tomphp has joined #ruby
jyaworski has quit [Ping timeout: 240 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
hays has quit [Ping timeout: 276 seconds]
pilcrow has left #ruby ["Leaving"]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has quit [Ping timeout: 240 seconds]
venmx has joined #ruby
duckpuppy has joined #ruby
za1b1tsu has joined #ruby
duckpuppy has quit [Ping timeout: 246 seconds]
apeiros has quit [Remote host closed the connection]
n0m4d1c has quit [Remote host closed the connection]
reber has quit [Remote host closed the connection]
jcarl43 has joined #ruby
aupadhye has joined #ruby
jyaworski has joined #ruby
jane_booty_doe has quit [Quit: Leaving]
anisha_ has joined #ruby
KeyJoo has joined #ruby
riotjones has joined #ruby
_rshetty_ has joined #ruby
shuforov has quit [Quit: Leaving]
shuforov has joined #ruby
qba73 has joined #ruby
jyaworski has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
nowhereman_ has quit [Ping timeout: 240 seconds]
qba73 has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 248 seconds]
qba73 has joined #ruby
sauvin_ has quit [Remote host closed the connection]
kapil___ has joined #ruby
conta has joined #ruby
marr has joined #ruby
alex`` has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n008f4g_ has quit [Ping timeout: 256 seconds]
qba73 has quit []
shpoont_ has joined #ruby
sanscoeu_ has joined #ruby
shuforov has quit [Ping timeout: 260 seconds]
andikr has joined #ruby
sauvin_ has joined #ruby
sanscoeur has quit [Ping timeout: 260 seconds]
duderonomy has quit [Ping timeout: 246 seconds]
sauvin_ is now known as bocaneri
workmad3 has joined #ruby
venmx has quit [Ping timeout: 264 seconds]
sundhell_away is now known as sundhell
Emmanuel_Chanel has quit [Remote host closed the connection]
jaequery has quit [Ping timeout: 265 seconds]
jcarl43 has quit [Quit: WeeChat 2.1]
Emmanuel_Chanel has joined #ruby
shuforov has joined #ruby
TheMFingYeti has joined #ruby
<TheMFingYeti> Does anyone know what would cause bundle install to spit out: "NameError: undefined local variable or method `options' for #<Bundler::RubyGemsGemInstaller:0x7fd48c2cf520>" when trying to install the mysql 2.9.1 gem?
larcara has joined #ruby
riotjones has joined #ruby
riotjones has quit [Ping timeout: 240 seconds]
TheMFingYeti has quit [Quit: Page closed]
duckpuppy has joined #ruby
TheMFingYeti has joined #ruby
alfiemax_ has joined #ruby
TheMFingYeti has quit [Client Quit]
Flisk has left #ruby ["// this should never happen"]
alfiemax has quit [Ping timeout: 248 seconds]
TheMFingYeti has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
aufi has joined #ruby
RougeR has joined #ruby
suukim has joined #ruby
clemens3 has joined #ruby
aufi has quit [Remote host closed the connection]
schneider has joined #ruby
aufi has joined #ruby
faces has joined #ruby
imode has quit [Ping timeout: 265 seconds]
ur5us_ has joined #ruby
morfin has quit [Ping timeout: 246 seconds]
ur5us has quit [Remote host closed the connection]
facest has quit [Ping timeout: 264 seconds]
morfin has joined #ruby
_whitelogger has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
za1b1tsu has quit [Quit: Leaving]
_rshetty_ has quit [Remote host closed the connection]
Beams has joined #ruby
Burgestrand has joined #ruby
TinkerT has quit [Read error: Connection reset by peer]
_rshetty_ has joined #ruby
duckpuppy has joined #ruby
_rshetty_ has quit [Remote host closed the connection]
TinkerT has joined #ruby
Beams_ has joined #ruby
guille-moe has joined #ruby
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
_rshetty_ has joined #ruby
venmx has joined #ruby
Beams has quit [Ping timeout: 276 seconds]
_rshetty_ has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
duckpuppy has quit [Ping timeout: 245 seconds]
KeyJoo has quit [Ping timeout: 248 seconds]
za1b1tsu has joined #ruby
riotjones has joined #ruby
kriskropd has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
cagomez has joined #ruby
riotjones has quit [Ping timeout: 276 seconds]
tomphp has joined #ruby
Beams has joined #ruby
rshetty has joined #ruby
Beams_ has quit [Ping timeout: 245 seconds]
alfiemax has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
karapetyan has joined #ruby
rshetty has quit [Ping timeout: 260 seconds]
KeyJoo has joined #ruby
RougeR has quit [Ping timeout: 264 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
riotjones has joined #ruby
karapetyan has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 264 seconds]
ellcs has joined #ruby
kriskropd has quit [Ping timeout: 276 seconds]
karapetyan has joined #ruby
shpoont_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapetyan has quit [Ping timeout: 264 seconds]
Beams_ has joined #ruby
mfaeh has joined #ruby
Beams has quit [Ping timeout: 268 seconds]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
pavelz has quit [Quit: leaving]
Burgestrand has quit [Quit: Closing time!]
riotjones has joined #ruby
anisha_ has quit [Read error: Connection reset by peer]
mfaeh has quit []
jottr has joined #ruby
anisha_ has joined #ruby
einarj has joined #ruby
Serpent7776 has joined #ruby
larcara has quit [Remote host closed the connection]
dr3w_ has joined #ruby
larcara has joined #ruby
duckpuppy has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
dhollinger has quit [Ping timeout: 260 seconds]
larcara has quit [Remote host closed the connection]
larcara has joined #ruby
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has quit [Changing host]
nowhereman has joined #ruby
duckpuppy has quit [Ping timeout: 256 seconds]
nowhereman is now known as Guest92986
nowhere_man has quit [Ping timeout: 260 seconds]
Burgestrand has joined #ruby
jyaworski has joined #ruby
ur5us_ has quit [Remote host closed the connection]
duckpuppy has joined #ruby
cdg has joined #ruby
larcara has quit [Remote host closed the connection]
dextrey has joined #ruby
kriskropd has joined #ruby
cdg has quit [Ping timeout: 245 seconds]
dhollinger has joined #ruby
Beams_ has quit [Ping timeout: 256 seconds]
Beams has joined #ruby
jyaworski has quit [Ping timeout: 256 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
sundhell is now known as sundhell_away
workmad3 has quit [Ping timeout: 256 seconds]
mojtaba has joined #ruby
Guest92986 has quit [Ping timeout: 246 seconds]
mojtaba has quit [Ping timeout: 240 seconds]
Guest92986 has joined #ruby
TheMFingYeti has quit [Quit: Leaving]
Zaab1t has joined #ruby
ferr has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
karapetyan has joined #ruby
rshetty has joined #ruby
mojtaba has joined #ruby
Beams_ has joined #ruby
Beams has quit [Ping timeout: 276 seconds]
larcara has joined #ruby
larcara has quit [Read error: Connection reset by peer]
larcara has joined #ruby
rahul_bajaj has joined #ruby
aupadhye_ has joined #ruby
rabajaj has quit [Read error: Connection reset by peer]
aupadhye has quit [Read error: Connection reset by peer]
dr3w_ has joined #ruby
sanscoeur has joined #ruby
rabajaj has joined #ruby
zwliew has joined #ruby
rshetty has quit [Ping timeout: 276 seconds]
larcara has quit [Remote host closed the connection]
za1b1tsu_ has joined #ruby
za1b1tsu_ has quit [Read error: Connection reset by peer]
psychicist__ has joined #ruby
aupadhye_ has quit [Ping timeout: 264 seconds]
rahul_bajaj has quit [Ping timeout: 276 seconds]
sanscoeu_ has quit [Ping timeout: 265 seconds]
rshetty has joined #ruby
KeyJoo has quit [Ping timeout: 246 seconds]
jyaworski has joined #ruby
ramfjord has joined #ruby
Puffball has quit [Remote host closed the connection]
ur5us has joined #ruby
karapetyan has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
jyaworski has quit [Ping timeout: 264 seconds]
ur5us has quit [Ping timeout: 240 seconds]
aupadhye_ has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgestrand has quit [Quit: Closing time!]
larcara has joined #ruby
jottr has joined #ruby
karapetyan has quit [Remote host closed the connection]
kapil___ has quit [Quit: Connection closed for inactivity]
leitz has joined #ruby
silam has joined #ruby
<leitz> If using 5e3 for scientific notation, is there a way to use a variable for the "3"?
smala has joined #ruby
karapetyan has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
karapetyan has quit [Remote host closed the connection]
<canton7> leitz, "use a variable" in what sense?
<leitz> Ah, found it. 5 * 10 ** ldmod
<leitz> canton7, not sure if the "3" in the above is the exponent, or what. Still (re-)learning math.
<leitz> But the goal is to have a variable for the "power of" bit.
<canton7> yeah, "5e3" is scentific notiation for "5 * 10^3"
workmad3 has joined #ruby
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
hays has quit [Remote host closed the connection]
shuforov has quit [Ping timeout: 256 seconds]
<silam> Hi
<WhereIsMySpoon> o/
<silam> I am using ruby-2.4.3 and while exectuing the puppet command
<silam> ./puppet agent -t --debug
apparition has joined #ruby
<silam> I am using ruby-2.4.3 and while exectuing the puppet command ...
<silam> ./puppet agent -t --debug
<silam> am geiing seg fault
<silam> Debug: Dynamically-bound port lookup failed; falling back to ca_port setting Debug: Creating new connection for https://puppet:8140 /opt/iexpress/ruby/lib/ruby/2.4.0/timeout.rb:97: [BUG] Segmentation fault at 0x02beb640 ruby 2.4.3p205 (2017-12-14 revision 61247) [hppa2.0w-hpux11.31]
<silam> Please help me on this issue
<WhereIsMySpoon> silam: are you trying to get puppet to use an external CA?
<silam> here i am not using any external CA .. i am just doing sample test ..
<silam> i am doing this on HP-UX PA platform
<silam> On HP UX IA i dint get any issues..
mahlon has quit [Ping timeout: 246 seconds]
ged has quit [Ping timeout: 268 seconds]
<silam> WhereIsMySpoon : why seg faults is coming ... /opt/iexpress/ruby/lib/ruby/2.4.0/timeout.rb:97: [BUG] Segmentation fault at 0x02beb640
<WhereIsMySpoon> no idea
<WhereIsMySpoon> sorry
<silam> thanks .. did u faced any similar isssues?
<WhereIsMySpoon> nope
<WhereIsMySpoon> sorry
shuforov has joined #ruby
<silam> Thanks.
<WhereIsMySpoon> there are some old issues on the net if you google “puppet timeout.rb segfault
gray_-_wolf has quit [Read error: Connection reset by peer]
<WhereIsMySpoon> "
<WhereIsMySpoon> but theyre like 4-5 years old
Psybur has joined #ruby
gray_-_wolf has joined #ruby
_rshetty_ has joined #ruby
shpoont_ has joined #ruby
rshetty has quit [Ping timeout: 264 seconds]
dr3w_ has joined #ruby
Burgestrand has joined #ruby
larcara has quit [Remote host closed the connection]
shpoont_ has quit [Client Quit]
gray_-_wolf has quit [Quit: WeeChat 2.1]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeffreylevesque has quit [Ping timeout: 240 seconds]
duckpuppy has quit [Read error: Connection reset by peer]
yadnesh has quit [Quit: EliteBNC 1.6.5 - http://elitebnc.org]
KeyJoo has joined #ruby
larcara has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
catphish has joined #ruby
<catphish> i have a situation where some of my ruby processes are sending kill(9) to seemingly random low numbered processes, is there any obvious reason this might happen before i keep digging?
jyaworski has joined #ruby
<catphish> most of the time it gets back "process not found" but just occasionally it kills something important
Guest92986 has quit [Ping timeout: 268 seconds]
<catphish> hopefully strace will soon tell me
<WhereIsMySpoon> catphish: I have no idea, but that sounds whacky :D
<WhereIsMySpoon> catphish: are your ruby processes using ports or the database or threads in a pool or something similar? Maybe theyre trying to clear resources up but getting the wrong pids
<WhereIsMySpoon> Just a random shot in the dark
jyaworski has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
Beams_ has quit [Remote host closed the connection]
nahra has joined #ruby
leitz has quit [Quit: Nappy time]
<catphish> it seems to occur when i call "exit"
ldnunes has joined #ruby
Beams has joined #ruby
<catphish> i guess a badly behaved at_exit
dr3w_ has joined #ruby
tomphp has joined #ruby
Cavallari has joined #ruby
<catphish> looks like i was running exit in a forked process, and it had an at_exit callback that was running kill on some stale data
<WhereIsMySpoon> whoops
yokel has quit [Remote host closed the connection]
sundhell_away is now known as sundhell
WhereIsMySpoon has quit [Quit: WhereIsMySpoon]
yokel has joined #ruby
stoffus_ has joined #ruby
bruce_lee has joined #ruby
stoffus has quit [Ping timeout: 248 seconds]
mahlon has joined #ruby
Cavallari has quit [Quit: Cavallari]
amatas has joined #ruby
larcara has quit [Remote host closed the connection]
larcara has joined #ruby
zwliew has quit [Quit: Connection closed for inactivity]
karapetyan has quit [Remote host closed the connection]
shpoont_ has joined #ruby
bmurt has joined #ruby
ur5us has joined #ruby
ecuanaso has joined #ruby
ecuanaso has quit [Client Quit]
ecuanaso has joined #ruby
ecuanaso has quit [Client Quit]
ur5us has quit [Ping timeout: 260 seconds]
TheBloke has quit [Quit: Textual IRC Client: www.textualapp.com]
ferr has left #ruby ["WeeChat 2.1"]
za1b1tsu has quit [Quit: Leaving]
AJA4350 has joined #ruby
ged has joined #ruby
chmurifree is now known as chmuri
sepp2k has joined #ruby
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has quit [Changing host]
ramfjord has joined #ruby
nme13 has joined #ruby
TheBloke has joined #ruby
Strepsils has joined #ruby
shuforov has quit [Ping timeout: 276 seconds]
ramfjord has quit [Ping timeout: 256 seconds]
Papierkorb has joined #ruby
Papierkorb has left #ruby ["Konversation terminated!"]
schneider has quit [Ping timeout: 240 seconds]
yadnesh has joined #ruby
ecuanaso has joined #ruby
fyrril has joined #ruby
shuforov has joined #ruby
phaul has joined #ruby
Guest92986 has joined #ruby
silam has quit [Quit: Page closed]
RougeR has quit [Ping timeout: 240 seconds]
schneider has joined #ruby
_rshetty_ has quit [Remote host closed the connection]
shuforov has quit [Ping timeout: 268 seconds]
aufi_ has joined #ruby
Beams_ has joined #ruby
shuforov has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
Beams has quit [Ping timeout: 256 seconds]
rshetty has joined #ruby
nme13 has quit [Quit: Leaving]
rsh has joined #ruby
<catphish> i expected exit! to fix it, but strangely it hasn't :(
rshetty has quit [Ping timeout: 276 seconds]
jcalla has joined #ruby
shuforov has quit [Ping timeout: 256 seconds]
jyaworski has joined #ruby
larcara has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fhmax has joined #ruby
shuforov has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
larcara has joined #ruby
Strepsils has quit [Ping timeout: 248 seconds]
leotaku has left #ruby ["WeeChat 2.0"]
shuforov has quit [Ping timeout: 264 seconds]
arekushi has quit [Ping timeout: 256 seconds]
skweek has joined #ruby
cdg has joined #ruby
kn-928 has joined #ruby
skweek has quit [Excess Flood]
skweek has joined #ruby
Burgestrand has quit [Quit: Closing time!]
jyaworski has quit [Ping timeout: 264 seconds]
jyaworski has joined #ruby
hinbody has quit [Quit: leaving]
maufart__ has joined #ruby
Burgestrand has joined #ruby
ecuanaso has joined #ruby
k0mpa has joined #ruby
gentleterror has joined #ruby
aufi_ has quit [Ping timeout: 246 seconds]
jyaworski has quit [Ping timeout: 240 seconds]
gentleterror has quit [Client Quit]
darix has quit [Quit: brb]
shinnya has joined #ruby
shuforov has joined #ruby
sylario has joined #ruby
zaka has joined #ruby
<zaka> Hello
conta has quit [Quit: conta]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has joined #ruby
hinbody has joined #ruby
<catphish> ehllo
ecuanaso has joined #ruby
oleo has joined #ruby
darix has joined #ruby
memo1 has joined #ruby
<ellcs> ehlks?
<zaka> someone who knows somethink about threads is here and can help?
<WhereIsMySpoon> zaka: ask the question, and maybe someone will
<memo1> hi, if i want to execute a ffmpeg command, inside a ruby program and grab all possible exceptions, how i do it?
sundhell is now known as sundhell_away
<ellcs> @memo1 have a look at Open3
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 256 seconds]
darix has quit [Remote host closed the connection]
<zaka> I have a class by which I create objects and add them to the array list.Each object has a doImages method. It takes around 2 minutes to create images per object. How can I start this process in many threads so that it simultaneously creates photos for example 10 objects
za1b1tsu has joined #ruby
<zaka> i can show my code if someone can help
fhmax has quit [Ping timeout: 240 seconds]
drale2k has quit [Quit: ZNC - http://znc.in]
Cybergeek has quit [Quit: ZNC 1.6.1+deb1 - http://znc.in]
dviola has joined #ruby
jrafanie has joined #ruby
skweek has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 256 seconds]
skweek has joined #ruby
<zaka> i trying that and my app finish process automaticly
<zaka> t1 = Thread.new do
<zaka> i.createImage
<zaka> t1.join
<zaka> end
<zaka> end
<zaka> sorry for that spam
<phaul> you join the thread in the thread block. join outside
jottr has quit [Ping timeout: 264 seconds]
<phaul> also for this specific use case take a look at https://github.com/grosser/parallel
<phaul> high level api that fits your needs better
<zaka> thanks for link
orbyt_ has joined #ruby
<catphish> fixed my problem, i was still running exit() instead of exit!() in some places, and calling an at_exit that killed things (which had already been killed by a different fork) :)
<catphish> causing it to occasionally kill something that was reusing an old PID
n0m4d1c has joined #ruby
<memo1> ellcs: thank you, and once i get the stderr and stdout, how i check it as a log?,
alex`` has quit [Quit: WeeChat 2.0.1]
<zaka> no idea how to use that parallel :D
chouhoulis has joined #ruby
<WhereIsMySpoon> catphish: yay for multiprocess programs :D
<phaul> zaka ok, then you hae to move out t.join from the block
suukim has quit [Quit: Konversation terminated!]
<zaka> ok it work when i do it
<zaka> but still doing one method at once
<phaul> start all threads in a loop. dont join them in the loop. after that join all in a separate loop
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arekushi has joined #ruby
<ellcs> @memo1 you might i don't know the specific output you might want to catch. but you can iterate over stderr and check if there are some indicators for your exceptions
<zaka> so i need to keep that thread in array too?
<memo1> ellcs: i can use open3 with a try do block?
Rapture has joined #ruby
<WhereIsMySpoon> is there not a way in ruby to stream a list in a parallel way? like java has myList.parallelStream().map/forEach which will execute the lambda given in a multithreaded way
<WhereIsMySpoon> on the list
ur5us has joined #ruby
apparition has quit [Quit: Bye]
<WhereIsMySpoon> oh wait, that parallel gem does like…exactly that
<phaul> WhereIsMySpoon: the library I linked does exactly that
<WhereIsMySpoon> zaka: follow the readme in that library
<WhereIsMySpoon> yeah
<WhereIsMySpoon> its super super simple
<ellcs> popen won't throw a exception
<ellcs> are you using the ffmpeg gem?
<ellcs> guess not, nvm
nitrnitr has joined #ruby
larcara has quit [Remote host closed the connection]
catphish has left #ruby ["Leaving"]
<zaka> i read some i create somethink like this results = Parallel.map($a) do |one_letter|
<zaka> one_letter.createImage
<zaka> end
nitrnitr has quit [Client Quit]
ur5us has quit [Ping timeout: 240 seconds]
stoffus_ has quit [Ping timeout: 246 seconds]
<WhereIsMySpoon> zaka: sure
skweek has quit [Ping timeout: 276 seconds]
<zaka> error :block (2 levels) in <top (required)>': undefined method `createImage' for //i:Regexp (NoMethodError)
<WhereIsMySpoon> then whatever you’re passing in doesnt have a createImage function
<WhereIsMySpoon> you said doImages when you first said this
<WhereIsMySpoon> then createImages
<WhereIsMySpoon> check youve got the right function and youre passing in the right objects to the array
memo1 has quit [Ping timeout: 256 seconds]
<zaka> function is right because code $a.each do|i| i.createImage end work
nadir has joined #ruby
darix has joined #ruby
fhmax has joined #ruby
alex`` has joined #ruby
dionysus69 has joined #ruby
alfiemax has joined #ruby
dextrey has quit [Ping timeout: 256 seconds]
Fysicus has quit [Excess Flood]
Fysicus has joined #ruby
fhmax has quit [Ping timeout: 240 seconds]
fhmax has joined #ruby
karapetyan has joined #ruby
memo1 has joined #ruby
<memo1> ellcs: no, im using the bash command ffmpeg
jeffreylevesque has joined #ruby
<ellcs> memo1: so you need to check within your stderr object if there has been an error
tdelam has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
Jittler has joined #ruby
<phaul> is there a gem that gives you UINT64 arithmetics, preferably implemented with machine registers?
karapetyan has joined #ruby
<Jittler> Can someone help me get rubocop to auto-format my .rb files on save in VS Code? I'm in a class learning ruby and it'd certainly help.
synthroid has joined #ruby
harrycs has joined #ruby
<Jittler> I have Ruby, Ruby Solargraph, and ruby-rubocop packages installed. The linter works, and I added "ruby.rubocop.onSave": true to my settings.
synthroi_ has joined #ruby
govg has quit [Ping timeout: 248 seconds]
ldnunes has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
govg has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
synthroid has quit [Ping timeout: 265 seconds]
<Jittler> Okay, after some digging.. it looks like rubocop is just a linter and it doesn't do the beautify/prettify autoformat on save thing. Does anyone know a ruby autoformatter I can use? :|
drale2k has joined #ruby
RougeR has joined #ruby
synthroi_ has quit []
govg has quit [Ping timeout: 268 seconds]
fhmax has quit [Quit: Leaving]
alfiemax has quit [Remote host closed the connection]
netherwolfe has joined #ruby
fhmax has joined #ruby
fhmax_ has joined #ruby
fhmax_ has quit [Client Quit]
za1b1tsu has quit [Quit: Leaving]
Esa_ has joined #ruby
<zaka> Process.fork is not supported by this Ruby --- what that means?
<WhereIsMySpoon> zaka: are you on windows?
alfiemax has joined #ruby
jottr has joined #ruby
rippa has joined #ruby
rshetty has joined #ruby
sleepee has joined #ruby
sanscoeur has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
Mike11 has joined #ruby
Azure has quit [Ping timeout: 276 seconds]
RougeR has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 264 seconds]
<WhereIsMySpoon> zaka: ??
jottr has joined #ruby
Serpent7776 has quit [Quit: Leaving]
dionysus69 has quit [Ping timeout: 240 seconds]
<zaka> yes on windows
lxsameer has quit [Quit: WeeChat 1.9.1]
lxsameer has joined #ruby
<WhereIsMySpoon> zaka: youre out of luck, you cant fork on windows
larcara has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
alfiemax_ has joined #ruby
smala has quit [Remote host closed the connection]
alfiemax has quit [Read error: Connection reset by peer]
jottr has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
alfiemax has joined #ruby
mugurel_ has joined #ruby
<mugurel_> Anonymous survey - your help is greatly appreciated Hello everyone, I'd like to have a better idea (that's up to date and real, not possibly fake data) of how much Web Developers / Programmers in different parts of the world are paid. If anyone has 20 - 60 seconds to spare and fill the anonymous survey, it will be very helpful. You will find the survey here: https://goo.gl/forms/gzNw7PWc3h9hWnTL2 After I get enough answers I'll al
maufart__ has quit [Ping timeout: 268 seconds]
<WhereIsMySpoon> mugurel_: you know this data is readily available on various websites?
m27frogy has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
<mugurel_> Yes, I am aware of that, but most of them are from lengthy surveys, and some of them not up to date. Ever if I get a few questions it will help. It's worth a shot anyway.
alfiemax_ has quit [Ping timeout: 265 seconds]
jyaworski has joined #ruby
kn-928 has quit [Quit: WeeChat 2.1]
zaka has quit [Ping timeout: 263 seconds]
amatas has quit [Ping timeout: 276 seconds]
jottr has quit [Ping timeout: 268 seconds]
jottr has joined #ruby
jyaworski has quit [Ping timeout: 256 seconds]
mugurel_ has quit [Quit: Page closed]
ta_ has quit [Ping timeout: 240 seconds]
ldnunes has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
schneider has quit [Ping timeout: 276 seconds]
ta_ has joined #ruby
nme13 has joined #ruby
Burgestrand has quit [Quit: Closing time!]
schneider has joined #ruby
pastorinni has joined #ruby
<memo1> hi, im using evenmachine and rest-client to post to a server. Every two or three weeks i get an exception "too many open files- getaddrinfo". It is solve if a restart the script. How i can solve it programmatically?
alfiemax has quit [Remote host closed the connection]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
<WhereIsMySpoon> memo1: https://askubuntu.com/questions/181215/too-many-open-files-how-to-find-the-culprit this might help you find whats going on
jottr has quit [Ping timeout: 240 seconds]
facest has joined #ruby
ta_ has quit [Ping timeout: 256 seconds]
ta_ has joined #ruby
schneider has quit [Ping timeout: 276 seconds]
jottr has joined #ruby
konsolebox has quit [Ping timeout: 264 seconds]
ellcs has quit [Remote host closed the connection]
troys has joined #ruby
faces has quit [Ping timeout: 268 seconds]
conta has quit [Ping timeout: 256 seconds]
jottr has quit [Ping timeout: 264 seconds]
konsolebox has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
c0ncealed has quit [Remote host closed the connection]
m27frogy has joined #ruby
Jittler has quit [Quit: Page closed]
facest has quit [Ping timeout: 240 seconds]
Bobi_ has joined #ruby
cagomez has joined #ruby
c0ncealed has joined #ruby
harry_ has joined #ruby
<Bobi_> hello everyone
<havenwood> Bobi_: hi
cagomez has quit [Read error: Connection reset by peer]
<Bobi_> havenwood: hello my friend
harrycs has quit [Ping timeout: 265 seconds]
cagomez has joined #ruby
harry__ has joined #ruby
faces has joined #ruby
harry_ has quit [Ping timeout: 248 seconds]
<memo1> WhereIsMySpoon: thank you. Im checking on my server, and it has the ulimit set to umlimit
[Butch] has joined #ruby
jcarl43 has joined #ruby
jottr has joined #ruby
kapil___ has joined #ruby
tvw has joined #ruby
fhmax has quit [Ping timeout: 240 seconds]
shuforov has quit [Ping timeout: 256 seconds]
k0mpa has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 264 seconds]
<eam> memo1: the ulimit for open files cannot be set to unlimited
jottr has joined #ruby
<eam> you can check the limit for a particular process via: cat /proc/$pid/limits
redlegion has quit [Remote host closed the connection]
<eam> reasonable odds you have a descriptor leak in your app, which you would see by looking at lsof -p $pid -- examine if the descriptor table grows over time
redlegion has joined #ruby
nme13 has quit [Quit: Leaving]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<eam> ruby is especially prone to this kind of error as it's common to release an object to the gc which still has descriptors attached to it
Guest92986 has quit [Ping timeout: 260 seconds]
jottr has quit [Ping timeout: 240 seconds]
venmx has quit [Ping timeout: 240 seconds]
venmx has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dr3w_ has joined #ruby
tolerablyjake has joined #ruby
synthroid has joined #ruby
jottr has joined #ruby
suukim has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.1]
Beams_ has quit [Ping timeout: 256 seconds]
jcarl43 has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
darkhanb has joined #ruby
ur5us has joined #ruby
ledestin has joined #ruby
conta has joined #ruby
eckhardt_ has joined #ruby
marxarelli|afk is now known as marxarelli
apeiros has joined #ruby
jottr has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
raynold has joined #ruby
tvw has quit []
jottr has quit [Ping timeout: 246 seconds]
guacamole has joined #ruby
guacamole has quit [Client Quit]
graft has joined #ruby
nme13 has joined #ruby
sleepee has quit [Ping timeout: 240 seconds]
mjolnird has joined #ruby
mjolnird has quit [Remote host closed the connection]
jottr has joined #ruby
<nme13> hi
jyaworski has joined #ruby
<nme13> is there a way to sort this by date ??? please > {2=>Fri, 19 Jan 2018 17:57:23 UTC +00:00, 1=>Tue, 27 Mar 2018 15:00:11 UTC +00:00, 4=>Fri, 19 Jan 2018 13:47:23 UTC +00:00}
shuforov has joined #ruby
<nme13> anybody here ?
n008f4g_ has joined #ruby
<nme13> please I've found many way to sort hashes but it seems that none of them works
<nme13> I want to sort an hash that contains datetime value, by datetime
<apeiros> nme13: how are you currently doing it?
<apeiros> or, what's your current approach?
SeepingN has joined #ruby
<nme13> .sort_by{ |t| t[created_at] }
schneider has joined #ruby
<apeiros> that does not fit the hash you provided - does your real hash look differently from your example then?
<nme13> this hash contains ids and dates
<nme13> no
<havenwood> nme13: And how does the result differ from your expectation?
<nme13> that's the result of .inspect
<apeiros> nme13: ok, sort_by will give you the key/value pair
<nme13> undefined method `created_at' for [2, Fri, 19 Jan 2018 17:57:23 UTC +00:00]:Array
<apeiros> so your_hash.sort_by { |_id, date| date } # => will return a sorted array
<apeiros> and to_h will turn that sorted array back into a hash
<havenwood> >> {}.sort_by(&:itself)
<ruby[bot]> havenwood: # => [] (https://eval.in/979570)
<havenwood> >> {}.sort_by(&:itself).to_h
<ruby[bot]> havenwood: # => {} (https://eval.in/979571)
<apeiros> havenwood: that'd sort by id first
<havenwood> apeiros: aye, not the best example given the context :-O
<nme13> I want to sort by date
<nme13> not id
<nme13> sort by the values
<havenwood> nme13: It seems you're already sorting by date, but as apeiros said you're missing a #to_h.
<havenwood> not the best example period
<apeiros> havenwood: worse, they don't understand their data structure :(
<nme13> {2=>Fri, 19 Jan 2018 17:57:23 UTC +00:00, 1=>Tue, 27 Mar 2018 15:00:11 UTC +00:00, 4=>Fri, 19 Jan 2018 13:47:23 UTC +00:00}
<nme13> no it's not sorting by date
<nme13> @listing.sort_by{ |_id, date| date }.to_h
jottr has quit [Ping timeout: 240 seconds]
<nme13> it does nothing
<apeiros> it *returns* a sorted hash
<nme13> argh
<nme13> lol ok
<apeiros> if you don't assign that return value anywhere, then yes, you're wasting what it does.
<nme13> ok
<apeiros> and yes, minutiae like this matter :-p you have to pay close attention to what people say when it's about programming.
<nme13> it works
<nme13> but it is sorting DESC
<apeiros> no
<apeiros> sort_by defaults to ascending order
<nme13> hum hum sry
<nme13> the contrary
<nme13> lol :p
jyaworski has quit [Ping timeout: 256 seconds]
<nme13> I need DESC order
<nme13> what should I use ?
jottr has joined #ruby
<apeiros> then I suggest you give it a try yourself first :)
aupadhye_ has quit [Ping timeout: 260 seconds]
<nme13> I saw a "-1" somewhere when sorting to reverse
andikr has quit [Remote host closed the connection]
<apeiros> you can negate numeric values, yes
<apeiros> that'll reverse the sort order. so how do you get from datetime to numeric?
fhmax has joined #ruby
<nme13> just use .reverse on the array before casting to hash
<apeiros> there's no casting in ruby. but yes. that's another approach.
<apeiros> for this case it might even be the fastest.
<nme13> it works
<nme13> thx ;)
zerowolfgang has joined #ruby
zerowolfgang has quit [Client Quit]
claudiuinberlin has joined #ruby
<apeiros> nme13: shameless plug, you can also use https://github.com/apeiros/sorting
tomphp has joined #ruby
<apeiros> and then it's just: your_hash.sort_by { |_, date| desc(date) }
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
sanscoeur has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
rshetty has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 256 seconds]
rshetty has joined #ruby
tomphp has quit [Read error: Connection reset by peer]
<nme13> argh
<nme13> now that I have my hash I dont know how to get the key from it
<nme13> oh I think I found it :)
dionysus69 has joined #ruby
justinmcp has quit [Remote host closed the connection]
rsh has quit [Ping timeout: 256 seconds]
nme13 has quit [Read error: Connection reset by peer]
<phaul> what's the current O runtime on Hash operations? is lookup O(n)?!
conta has quit [Ping timeout: 256 seconds]
kyle__ has quit [Ping timeout: 264 seconds]
justinmcp has joined #ruby
rsh has joined #ruby
WhereIsMySpoon has quit [Quit: WhereIsMySpoon]
jottr has quit [Ping timeout: 276 seconds]
pilne has joined #ruby
<phaul> havenwood: thanks, reading ..
graft has quit [Ping timeout: 240 seconds]
larcara has quit [Remote host closed the connection]
einarj has quit [Remote host closed the connection]
larcara has joined #ruby
\void has joined #ruby
<apeiros> phaul: lookup and insertion is amortized O(1)
einarj has joined #ruby
<apeiros> everything which loops is obviously at least O(n). sorting requires working on all values, so it doesn't differ from other collection classes and is O(nlogn)
alfiemax has joined #ruby
larcara has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
larcara has joined #ruby
dviola has quit [Quit: WeeChat 2.1]
einarj has quit [Ping timeout: 248 seconds]
jyaworski has joined #ruby
<phaul> cool
karapetyan has joined #ruby
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
guille-moe has quit [Ping timeout: 240 seconds]
Mike11 has quit [Quit: Leaving.]
rshetty has joined #ruby
tomphp has joined #ruby
nahra has quit [Remote host closed the connection]
FrostCandy has joined #ruby
Silthias has joined #ruby
nowhere_man has joined #ruby
<phaul> not entirely clear on what happens on the collision. So you start a second level of hashing with the unsused bits of key.hash. but even that can start collliding after a while?
larcara has quit [Remote host closed the connection]
<phaul> or is that recursive, and whenever you collide you introduce a new level?
larcara has joined #ruby
imode has joined #ruby
Cybergeek has joined #ruby
jyaworski has quit [Ping timeout: 260 seconds]
rshetty has quit [Remote host closed the connection]
<phaul> or the size with the second level is such that you practically can't exhaust it
moei has quit [Quit: Leaving...]
jyaworski has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
jenrzzz has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.1]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ldepandis has joined #ruby
jyaworski has quit [Ping timeout: 240 seconds]
dextrey has joined #ruby
RougeR has joined #ruby
jcarl43 has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
clemens3 has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
dr3w_ has joined #ruby
jottr has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
biberu has joined #ruby
<apeiros> phaul: hashmaps in general or ruby's implementation?
<phaul> ruby's implementation
memo1 has quit [Ping timeout: 265 seconds]
<apeiros> hm, ok, with the recent changes I'm not sure which strategy ruby currently uses, so can't tell.
<phaul> Im reading st.c atm, the comment at the top seems pretty useful
bmurt has joined #ruby
ramfjord has joined #ruby
sleepee has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
sameerynho has joined #ruby
sleepee has quit [Ping timeout: 260 seconds]
RougeR has quit [Ping timeout: 264 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
synthroi_ has joined #ruby
cdg has quit [Remote host closed the connection]
sleepee has joined #ruby
clemens3 has joined #ruby
jottr has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
synthroid has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 256 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
sleepee has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
<phaul> I *think* I have a vague understanging of this now. so it's 2 levels. but you have many bins.
Junaos has quit [Quit: ZNC - http://znc.in]
<phaul> also If my understanding is correct if key.hash collides than you are in trouble :)
jottr has quit [Ping timeout: 276 seconds]
nowhereman has joined #ruby
nowhereman is now known as Guest32161
lytol has joined #ruby
audy has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
pelegreno_ has quit [Ping timeout: 256 seconds]
chouhoul_ has joined #ruby
nowhere_man has quit [Ping timeout: 264 seconds]
suukim has quit [Quit: Konversation terminated!]
ur5us has joined #ruby
<phaul> the second level of hash can cover all possible bins that can fall out of key.hash
chouhoulis has quit [Ping timeout: 265 seconds]
Junaos has joined #ruby
jottr has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
bocaneri has quit [Remote host closed the connection]
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
jottr has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
eljimmy has joined #ruby
dionysus69 has joined #ruby
okinomo has joined #ruby
jottr has joined #ruby
sundhell_away is now known as sundhell
larcara has quit [Remote host closed the connection]
sundhell is now known as sundhell_away
shuforov has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 240 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jottr has joined #ruby
kapil___ has joined #ruby
Guest34314 has joined #ruby
Guest34314 is now known as kyle__
alfiemax has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
alfiemax has quit [Remote host closed the connection]
larcara has joined #ruby
larcara has joined #ruby
graft has joined #ruby
alfiemax has joined #ruby
<graft> phaul: not sure if someone answered this, but it's not O(n), it's more like O(1)
jottr has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
rsh has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 264 seconds]
larcara has quit []
Psybur has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
dionysus69 has quit [Ping timeout: 264 seconds]
rsh has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
jottr has joined #ruby
pior has joined #ruby
cagomez has quit [Ping timeout: 264 seconds]
moei has joined #ruby
riotjoe has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
safetypin has joined #ruby
jottr has joined #ruby
riotjones has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
riotjoe has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 260 seconds]
eckhardt_ has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marxarelli is now known as marxarelli|afk
duderonomy has quit [Ping timeout: 276 seconds]
Cavallari has joined #ruby
reber has joined #ruby
jottr has joined #ruby
lytol has quit [Remote host closed the connection]
tomphp has joined #ruby
cagomez has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
cloaked1 has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
alfiemax has joined #ruby
dextrey has quit [Ping timeout: 264 seconds]
sameerynho has quit [Ping timeout: 256 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
moei has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
moei has joined #ruby
synthroid has joined #ruby
alfiemax has joined #ruby
alex`` has quit [Quit: WeeChat 2.1]
n0m4d1c has joined #ruby
synthroi_ has quit [Ping timeout: 240 seconds]
darkhanb has joined #ruby
herbmillerjr has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
sparr_ has quit [Changing host]
sparr_ has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
sparr_ is now known as sparr
darkhanb has quit [Client Quit]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
darkhanb has joined #ruby
cdg_ has joined #ruby
memo1 has joined #ruby
cloaked1 has quit [Quit: Leaving]
cdg has quit [Ping timeout: 246 seconds]
marxarelli|afk is now known as marxarelli
tomphp has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeffreylevesque has quit [Ping timeout: 240 seconds]
cschneid has joined #ruby
ur5us has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
ryzokuken has joined #ruby
ramfjord has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
harry__ has quit [Ping timeout: 240 seconds]
ta_ has quit [Read error: Connection reset by peer]
ta__ has joined #ruby
apeiros has joined #ruby
cagomez has joined #ruby
einarj has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
chouhoul_ has quit [Remote host closed the connection]
einarj has quit [Remote host closed the connection]
chouhoulis has joined #ruby
einarj has joined #ruby
karapetyan has quit []
biberu has quit []
<phaul> graft: yes, I was afk for a bit. Thanks
einarj has quit [Ping timeout: 248 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
eckhardt_ has joined #ruby
okinomo has quit [Remote host closed the connection]
einarj has joined #ruby
einarj has quit [Remote host closed the connection]
einarj has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroi_ has joined #ruby
jottr has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
einarj has quit [Ping timeout: 256 seconds]
tomphp has joined #ruby
synthroid has quit [Ping timeout: 264 seconds]
darkhanb has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wdfsdf has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Zaab1t has quit [Quit: Zaab1t]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wdfsdf has quit [Quit: Page closed]
fhmax has quit [Remote host closed the connection]
mojtaba has quit [Ping timeout: 264 seconds]
synthroi_ has quit [Ping timeout: 276 seconds]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rsh has quit [Ping timeout: 240 seconds]
Guest32161 has quit [Ping timeout: 248 seconds]
Guest32161 has joined #ruby
John_Ivan has joined #ruby
John_Ivan has joined #ruby
John_Ivan has quit [Changing host]
Cavallari has quit [Quit: Cavallari]
rahul_bajaj has joined #ruby
xuanrui has joined #ruby
rabajaj has quit [Read error: Connection reset by peer]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcalla has quit [Quit: Leaving]
rabajaj has joined #ruby
tomphp has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
rahul_bajaj has quit [Ping timeout: 264 seconds]
marxarelli is now known as marxarelli|afk
claudiuinberlin has joined #ruby
jottr has joined #ruby
tomphp has quit [Client Quit]
Azure has joined #ruby
ldnunes has quit [Quit: Leaving]
tomphp has joined #ruby
shpoont_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jyaworski has joined #ruby
tomphp has quit [Client Quit]
nowhere_man has joined #ruby
Guest32161 has quit [Ping timeout: 260 seconds]
safetypin has quit [Quit: Textual IRC Client: www.textualapp.com]
jottr has quit [Ping timeout: 264 seconds]
fox_mulder_cp has joined #ruby
eckhardt_ has joined #ruby
Omnilord has joined #ruby
<fox_mulder_cp> how i can proper implement #each for my plain ruby object in array? now it have exeption for [] method
kapil___ has quit [Quit: Connection closed for inactivity]
<phaul> fox_mulder_cp: sorry but your question is hard to understand. Do you want each method on the array or on the object inside the array. If so what is the type of that object?
<phaul> can you give us a code example?
<zenspider> "plain ruby object" ... all ruby objects are plain ruby objects
<apeiros> zenspider: he's from rails. IME they talk about "plain ruby objects" meaning "not an AR model"
<apeiros> (since most stuff every & all logic into models)
<zenspider> yeah. I don't care for the distinction. it's meaningless. AR models are also plain ruby objects.
<apeiros> sure
<zenspider> fox_mulder_cp: making assumptions about what you want... class X... def each; @my_collection.each do |o| ... end end end
<zenspider> it just comes from that java POJO bullshit
harrycs has joined #ruby
<zenspider> and it makes more sense there... not everything is an object
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marxarelli|afk is now known as marxarelli
<apeiros> zenspider: why not &block and pass that on? a) faster, b) gives you enum semantics for free
<zenspider> apeiros: it depends on what he wants to do. might need extra accounting, etc.
<zenspider> but sure. at that point, I'd prolly just do a delegator
<apeiros> you mean if there's code in the block? then yes, sure
<zenspider> tho, I find the delegation code a bit clunky. or at least, the doco
jyaworski has quit [Ping timeout: 256 seconds]
harry_ has joined #ruby
<apeiros> for some irrational reason I rarely ever use Forwardable (and even less Delegator/SimpleDelegator)
agent_white has quit [Remote host closed the connection]
harrycs has quit [Ping timeout: 260 seconds]
<phaul> fox_mulder_cp: do a gist of a minimal example of what you want ..
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
memo1 has quit [Ping timeout: 240 seconds]
<zenspider> don't you love it when ppl ask questions and then seemingly walk away...?
reber has quit [Remote host closed the connection]
tomphp has joined #ruby
<fox_mulder_cp> in some countries of third wotld we have a shit of wifi L)
xuanrui has quit [Remote host closed the connection]
Bobi_ has quit [Quit: Page closed]
jaequery has joined #ruby
dr3w_ has joined #ruby
<zenspider> fox_mulder_cp: don't modify someone else's data on line 9
<zenspider> line 21, 'self.each' would be recursive. you want to call each on your actual collection
<fox_mulder_cp> so how i can pass it as default?
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fox_mulder_cp> zenspider: so how i can implement it properly?
<zenspider> fox_mulder_cp: || would work fine on line 9. you don't need to modify the incoming arg
schneider has joined #ruby
<fox_mulder_cp> zenspider: and what about each emplementation?
<zenspider> read above
<fox_mulder_cp> i don't know properly implement some for collection when user it as arr = [Record.new(), Record.new(),..]
jottr has joined #ruby
<zenspider> fox_mulder_cp: how does the content of the collection matter in this case?
jamesaxl has quit [Quit: WeeChat 2.0.1]
<fox_mulder_cp> for #to_json mapped, in main use case, for mapping data to external api
<zenspider> I think we're hitting a language barrier here... to_json isn't in play here. We're not talking about json as far as I can tell... we're talking about defining #each to work properly.
<zenspider> Yes?
<fox_mulder_cp> yes.
<fox_mulder_cp> i create gem for powerdns, and i need map domain zone json to ruby object structure
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<zenspider> no.
<zenspider> by the time you're calling #each on your W3dns::Record object, your collection should already be translated from json to ruby objects
<zenspider> each shouldn'd DO anything but enumerate
<zenspider> json parsing should be as far away from it as possible
<fox_mulder_cp> zenspider: i need reverse mapping. from json all ok. but into json
<zenspider> dude. no. each is each. it isn't ANYTHING ELSE
<zenspider> if you can't let go of the json thing here and now, I'm done. implement each. implement to_json, implement parsing from json into your Record. They do NOT mix
<fox_mulder_cp> zenspider: i have deep loop exeption when try to use #each for self..
<zenspider> I already pointed out that you're recursively calling each
jottr has quit [Ping timeout: 248 seconds]
<zenspider> that has NOTHING to do with json
<fox_mulder_cp> so i need it proper implementation
<fox_mulder_cp> zenspider: shit. drop to_json. i needf #each
<zenspider> once again... read my original suggestion.
<zenspider> this is wandering into help vampire territory. I carry stakes and holy water for just this reason...
<fox_mulder_cp> i need for ideas for proper implementation of #each to my object with two props. english in not my native.
clemens3 has quit [Ping timeout: 240 seconds]
icarus has joined #ruby
<phaul> fox_mulder_cp: so you want each to iterate both @content and @disabled ? are those arrays?
schneider has quit [Ping timeout: 264 seconds]
psychicist__ has quit [Ping timeout: 256 seconds]
<fox_mulder_cp> @content and @disabled are strings. i need do some with array od W3dns::Record.neODODODODODODODODODODODODODODw
Esa_ has quit []
<phaul> sorry. I cannot help
<zenspider> they're NOT strings. line 9 is clearly boolean (at least for false)
za1b1tsu has quit [Quit: Leaving]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<icarus> hello all, I'm looking at 'net/ssh', attempting to use ssh.exec! to issue a command on a remote server, however it is one that requires :RequestTTY => force, but this isn't an option for Net::SSH (http://www.rubydoc.info/github/net-ssh/net-ssh/Net/SSH); Does anyone have any recommendations for executing "ssh -ttt" commands via ruby?
<zenspider> and while content is named such that it can be a collection, disabled is not. it is a bool-like thing
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fox_mulder_cp> zenspider: it's not critical now
<icarus> I appreciate any input, thank you!
<zenspider> icarus: meaning the command you want to run requires a TTY connection?
[Butch] has quit [Ping timeout: 240 seconds]
<icarus> zenspider: correct! (:config doesnt register an entry in ~/.ssh/config for RequestTTY either)
tdy has joined #ruby
iszak has quit [Ping timeout: 240 seconds]
<zenspider> man rubydoc.info is an unusuable mess.
<zenspider> last time I had problems with net/ssh I wound up creating Rake::RemoteTask... so... this might still be a problem
<icarus> :(
iszak has joined #ruby
<zenspider> ok. grabbed it and grepped around. looks like you might want request_pty via ssh.open_channel
<zenspider> `gem which ssh/connection/channel`
<zenspider> as in: emacs -q `gem which ssh/connection/channel`
eckhardt_ has joined #ruby
<icarus> zenspider: thanks for the assist, ill read up
<SeepingN> Ruby Net:SSH is a PITA
<zenspider> yuup
<SeepingN> In general it's easy, but when you have anything different than the default settins they must test against, good luck
<SeepingN> I have some really horrible hax
<icarus> SeepingN: do you happen to know of any good alternatives? (yeah, in this case i just need the equivalent of "ssh -t" hah)
<SeepingN> like when I tell the remove device to hang up (drop the tunnel, forced), it just stops responding. I have to look for a key phrase and wait 10 seconds and force hard disconnect to move on
<zenspider> and to be clear. Rake::RemoteTask works well, but is more meant for running against N machines and the like. it's very specific about what it is for
jyaworski has joined #ruby
<SeepingN> those docs are so unfinished
harry_ has quit [Ping timeout: 256 seconds]
jeffreylevesque has joined #ruby
<SeepingN> not to mention 11 years out of date
<zenspider> seems so low level... it's just gross
<zenspider> ya know... maybe you want to use expect.rb and a plain popen (or open3) to ssh?
<zenspider> it depends on what you're actually trying to do
<SeepingN> yeah I had ssh.start and ssh.exec! at first. had to move on to using channels for several things to work right
<SeepingN> I wasted weeks playing with popen/open3/some other obscure open
<zenspider> 72 lines of goodness... damn that thing is impressive
<icarus> yea see rake has something like this: "set :ssh_flags, %w[-l joe -p 2000]" thats a lot more convenient
<zenspider> you mean like this? http://docs.seattlerb.org/rake-remote_task/
jottr has joined #ruby
<zenspider> icarus: depending on what you want... I'd probably steer you towards open3 + expect.rb + IO#expect
pastorinni has quit [Remote host closed the connection]
<zenspider> does this not work?
<zenspider> Net::SSH.start( 'localhost' ) do |session| shell = session.shell.open( :pty => true ) ... end
<zenspider> (honestly I have no idea--I left net/ssh out of hate probably a decade ago)
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jyaworski has quit [Ping timeout: 268 seconds]
<icarus> "undefined local variable or method `session' for main:Object (NameError)"
<icarus> does it not exist in net/ssh anymore?
<icarus> I might be leaving it in a few minutes for the same reasons :)
<zenspider> ugh. fuck me. no clue
<zenspider> what do you want to do?
<icarus> im putting an ssh wrapper together to run certain commands on remote servers, behind sinatra/nginx
<icarus> I was handed some endpoints that have broken rpc endpoints, but they still work locally (yea, im hacking it together, but hey its gotta be up asap)
<fox_mulder_cp> icarus: use ansible $)
<fox_mulder_cp> i use ansible for controlling my nodes from rails app
bmurt has joined #ruby
<SeepingN> Net::SSH.start( emuip, "username", :password => pw, :timeout => 8, :verify_host_key => Net::SSH::Verifiers::Null.new ) do |ssh|
bmurt has quit [Client Quit]
<zenspider> icarus: if that's all you want to do, then Rake::RemoteTask might actually be perfect for you.
<icarus> zenspider: yeah i think so
<zenspider> lemme know...
* zenspider goes back to hacking on emacs & enh-ruby-mode...
<SeepingN> I had some strange pty issues initially but don't call out anything specifc for it now
<SeepingN> what happens in your case?
n0m4d1c has quit [Remote host closed the connection]
marxarelli is now known as marxarelli|afk
mojtaba has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
mojtaba has quit [Ping timeout: 240 seconds]
venmx has quit [Ping timeout: 276 seconds]
mojtaba has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
troulouliou_div2 has joined #ruby
sanscoeur has quit [Read error: Connection reset by peer]
sanscoeur has joined #ruby
cschneid has quit [Remote host closed the connection]
mojtaba has quit [Quit: Leaving.]
lytol has joined #ruby
RougeR has joined #ruby
FrostCandy has quit []
<icarus> zenspider: exec ( "ssh -q -t ..." ) is winner winner chicken dinner
<icarus> i really over thought that one
<zenspider> hah! fair
duderonomy has joined #ruby
ecuanaso has joined #ruby
netherwolfe has quit [Ping timeout: 265 seconds]
duderonomy has quit [Client Quit]
ryzokuken has quit [Quit: Connection closed for inactivity]
cschneid has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
cschneid has quit [Ping timeout: 264 seconds]
nertzy has quit [Ping timeout: 263 seconds]
rahul_bajaj has joined #ruby
rabajaj has quit [Read error: Connection reset by peer]
<SeepingN> I had to do that
<SeepingN> in the same script I use other ssh calls
shinnya has joined #ruby
<SeepingN> some weirdo proprietary server that just wouldn't work with net:ssh. gave up, made a file of commands to execute, and pass them to commandline ssh. pretty lame
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rabajaj has joined #ruby
cschneid has joined #ruby
<eam> SeepingN: shelling out to the openssh binary is a pretty regular thing -- none of the ssh libraries (libssh2) have a full authentication featureset
rahul_bajaj has quit [Ping timeout: 248 seconds]
<SeepingN> ah yes, that was it. it didn't like any of our authentication attempts
<eam> you might try this gem for managing ssh jobs https://rubygems.org/gems/mssh
<eam> does parallelism, timeouts, and wraps bin/ssh with the default batch-oriented options you probably want
<eam> the killer feature which keeps us from using libssh2 implementations is lack of kerberos support
nowhereman has joined #ruby
nowhereman is now known as Guest10775
nowhere_man has quit [Ping timeout: 264 seconds]
<zenspider> that looks nice. I especially like the -c flog
<zenspider> flag. ... wow muscle memory...
minimalism has quit [Ping timeout: 240 seconds]
clemens3 has joined #ruby
sepp2k has quit [Quit: Leaving.]
mojtaba has joined #ruby
Psybur has joined #ruby
mojtaba has quit [Ping timeout: 260 seconds]
morfin has quit [Ping timeout: 260 seconds]
Strepsils has joined #ruby
minimalism has joined #ruby
morfin has joined #ruby
marr has quit [Ping timeout: 248 seconds]
<SeepingN> uh huh
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
jottr has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
<phaul> some are more used to floggin' than anything else :D
n008f4g_ has quit [Ping timeout: 256 seconds]