havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
<ragnar> am I doing something wrong here or does it just take a few minutes to get replies?
<SeepingN> try a few hours, some times
<ragnar> thks
<SeepingN> it's hard to prepend data to a file. I imagine you always have to rewrite everything. or the filesystem itself might.
digitalnomad has joined #ruby
kies has joined #ruby
impermanence has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
hutch34 has joined #ruby
impermanence has joined #ruby
guacamole has quit [Quit: Textual IRC Client: www.textualapp.com]
alex`` has quit [Ping timeout: 276 seconds]
goyox86_ has quit [Quit: goyox86_]
jackjackdripper has quit [Quit: Leaving.]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
impermanence has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
t00r has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
<t00r> Hey guys! I'm new in ruby and I'm trying to parse a json to a array without success here
<t00r> here is the code: https://pastebin.com/d26rW4c7
<ruby[bot]> t00r: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/b9b66d8c91f2991c5b8931d057d2ef41
<ruby[bot]> t00r: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
cadillac_ has joined #ruby
nopolitica has joined #ruby
moeabdol has quit [Quit: WeeChat 1.9]
<havenwood> t00r: Are you getting?: {"error"=>"Out of memory"}
<havenwood> t00r: hash == {"error"=>"Out of memory"} #=> true
<t00r> havenwood: nope, I got the data as well, but I can format to use the values one by one
<havenwood> t00r: What is the value of `hash` when you run the code you linked?
<t00r> I you paste it on paste bin one second please
<havenwood> p hash
<ruby[bot]> t00r: as I told you already, please use https://gist.github.com
ResidentBiscuit has quit [Remote host closed the connection]
<havenwood> t00r: I take it that's the value of `response` not `hash` then?
ResidentBiscuit has joined #ruby
<t00r> I would like to use each value individually
ResidentBiscuit has quit [Remote host closed the connection]
acalycine has joined #ruby
marr123 has quit [Ping timeout: 240 seconds]
<t00r> havenwood: I think so
<havenwood> t00r: Look at the value of `hash` in the code you're running.
<havenwood> t00r: p hash
<havenwood> t00r: Look at `hash.keys` and see what the keys are.
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<havenwood> t00r: Look at `hash.values` if you don't care about hte keys.
<havenwood> t00r: If you show us what `hash` is and what you want, I'm sure we can show you some solutions.
<t00r> havenwood: hash.values Out of memory
<havenwood> ;-)
<havenwood> t00r: Is `hash` then?: {"error"=>"Out of memory"}
<t00r> Sorry if I could not be clear :)
cagomez has quit [Remote host closed the connection]
nowhere_man has quit [Ping timeout: 240 seconds]
<t00r> havenwood: My problem is this, I can return a messy array. I'd like to know how I can have key and value separately
<t00r> havenwood: I'm not a native english speaker and my english is a work in progress (-_-)'
acalycine has quit [Ping timeout: 260 seconds]
cahoots has quit [Ping timeout: 260 seconds]
<t00r> havenwood: but that last link that I send have the messy array that I got here
baroquebobcat has quit [Quit: baroquebobcat]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
gusrub has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
cagomez has quit [Ping timeout: 260 seconds]
t00r has quit [Remote host closed the connection]
beauby has joined #ruby
impermanence has joined #ruby
dviola has quit [Changing host]
dviola has joined #ruby
nowhere_man has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
<impermanence> arr.sort_by(&:some_attribute) some_attribute are Integers. Is there an idiomatic way to make the order descending?
yabbes has joined #ruby
<impermanence> I tried *-1 but no love
<impermanence> and reverse is not right
hutch34 has quit [Ping timeout: 246 seconds]
tobiasvl has quit [Remote host closed the connection]
gusrub has quit [Remote host closed the connection]
<impermanence> back
HoierM has joined #ruby
go|dfish has quit [Ping timeout: 260 seconds]
Mon_Ouie has quit [Ping timeout: 240 seconds]
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
howdoi has joined #ruby
hutch34 has joined #ruby
domgetter has joined #ruby
beauby has quit [Ping timeout: 240 seconds]
beauby has joined #ruby
bruno- has quit [Ping timeout: 258 seconds]
digitalnomad has joined #ruby
ResidentBiscuit has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
Mon_Ouie has joined #ruby
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
hutch34 has quit [Ping timeout: 276 seconds]
bruno- has joined #ruby
gizmore|2 has joined #ruby
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
gizmore has quit [Ping timeout: 260 seconds]
duderonomy has quit [Ping timeout: 246 seconds]
acalycine has quit [Ping timeout: 260 seconds]
acalycine has joined #ruby
acalycine has quit [Changing host]
acalycine has joined #ruby
jackjackdripper has joined #ruby
ragnar has quit [Quit: Page closed]
TomyLobo3 has quit [Ping timeout: 258 seconds]
Bock has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
preyalone has quit [Quit: Connection closed for inactivity]
grant has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
Dimik has joined #ruby
GinoMan has joined #ruby
ecuanaso has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
mostlybadfly has quit [Quit: Connection closed for inactivity]
hkdsun has quit [Ping timeout: 240 seconds]
hkdsun has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
mim1k has joined #ruby
hutch34 has joined #ruby
__Yiota has joined #ruby
__Yiota has quit [Client Quit]
mim1k has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tacoboy has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
FahmeF has joined #ruby
yabbes has quit [Ping timeout: 260 seconds]
FahmeF has quit [Ping timeout: 260 seconds]
beauby has quit [Ping timeout: 248 seconds]
beauby has joined #ruby
ResidentBiscuit has quit []
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
ecuanaso has joined #ruby
bmurt has joined #ruby
maryo has joined #ruby
mtkd has quit [Ping timeout: 255 seconds]
apparition47 has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moei has quit [Quit: Leaving...]
ecuanaso has joined #ruby
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
dviola has quit [Ping timeout: 268 seconds]
xenops has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
cahoots has joined #ruby
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase has joined #ruby
HoierM has quit [Ping timeout: 240 seconds]
dlitvak has quit [Quit: Connection closed for inactivity]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cahoots has quit [Quit: leaving]
opekktar has joined #ruby
gix has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
ShekharReddy has joined #ruby
gix has joined #ruby
charliesome has joined #ruby
kculpis has joined #ruby
robnester has quit [Ping timeout: 248 seconds]
knight33 has joined #ruby
robnester has joined #ruby
apparition47 has quit [Quit: Bye]
mim1k has joined #ruby
opekktar_ has joined #ruby
segy_ has joined #ruby
segy has quit [Ping timeout: 240 seconds]
opekktar has quit [Ping timeout: 260 seconds]
segy has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
segy_ has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
segy_ has joined #ruby
segy has quit [Ping timeout: 240 seconds]
segy_ is now known as segy
tacoboy has quit [Read error: Connection reset by peer]
opekktar has joined #ruby
digitalnomad has joined #ruby
opekktar_ has quit [Ping timeout: 260 seconds]
jphase has quit [Remote host closed the connection]
opekktar has quit [Ping timeout: 240 seconds]
opekktar has joined #ruby
mtkd has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
go|dfish has joined #ruby
t-recx has quit [Quit: t-recx]
dcunit3d has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jphase has joined #ruby
__Yiota has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
icarus has joined #ruby
jphase has quit [Remote host closed the connection]
icarus has quit [Ping timeout: 240 seconds]
icarus has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
beauby has quit [Ping timeout: 276 seconds]
beauby has joined #ruby
maryo has quit [Ping timeout: 240 seconds]
bambanx has joined #ruby
chimkan has joined #ruby
pootiscoder has joined #ruby
runescape07rsps has quit [Quit: Leaving]
charliesome has joined #ruby
chimkan has quit [Quit: chimkan]
beauby has quit [Ping timeout: 240 seconds]
Silthias has quit [Read error: Connection reset by peer]
Silthias has joined #ruby
impermanence has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
chimkan has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
djbkd has joined #ruby
cagomez has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
vuoto has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
dcunit3d has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
icarus has quit [Read error: Connection reset by peer]
icarus has joined #ruby
TomyLobo3 has joined #ruby
jackjackdripper has joined #ruby
mim1k has joined #ruby
nicolai86 has quit [Read error: Connection reset by peer]
nicolai86 has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase has joined #ruby
maryo has joined #ruby
alex`` has joined #ruby
jphase has quit [Remote host closed the connection]
KeyJoo has joined #ruby
dviola has quit [Quit: WeeChat 1.9]
maryo has quit [Ping timeout: 248 seconds]
opekktar has quit [Quit: leaving]
opekktar has joined #ruby
chmurifree has quit [Ping timeout: 255 seconds]
code_zombie_ has quit [Quit: Leaving]
dcunit3d has quit [Ping timeout: 255 seconds]
dcunit3d has joined #ruby
chmurifree has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
zacts has quit [Quit: WeeChat 1.9]
vuoto has quit [Client Quit]
zacts has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
djbkd has quit [Ping timeout: 260 seconds]
mabus44 has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dcunit3d has quit [Ping timeout: 240 seconds]
beauby has joined #ruby
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
minimalism has quit [Quit: minimalism]
ramfjord has joined #ruby
mabus44 has quit [Ping timeout: 240 seconds]
noe has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
vuoto has joined #ruby
govg has joined #ruby
Silthias1 has joined #ruby
yabbes has joined #ruby
beauby has quit [Ping timeout: 240 seconds]
Silthias has quit [Ping timeout: 246 seconds]
noe has quit [Quit: noe]
gusrub has joined #ruby
ramfjord has joined #ruby
SeepingN_ has quit [Quit: The system is going down for reboot NOW!]
ramfjord has quit [Ping timeout: 240 seconds]
gusrub has quit []
_whitelogger has joined #ruby
domgetter has quit [Ping timeout: 276 seconds]
segy has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Ping timeout: 240 seconds]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has quit [Quit: WeeChat 1.9]
ramfjord has joined #ruby
ltem has joined #ruby
vuoto has quit [Quit: Lost terminal]
maryo has joined #ruby
acalycine has quit [Ping timeout: 246 seconds]
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
allisio has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
nofxxx has joined #ruby
nofxxxx has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
impermanence has joined #ruby
impermanence has quit [Client Quit]
moei has joined #ruby
ramfjord has joined #ruby
cagomez has joined #ruby
bb010g_ has joined #ruby
beauby has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
cagomez has quit [Ping timeout: 260 seconds]
Silthias has joined #ruby
Silthias1 has quit [Ping timeout: 258 seconds]
bambanx has quit [Quit: Leaving]
maryo has quit [Quit: Leaving]
allisio has quit [Quit: WeeChat 1.9]
mim1k has joined #ruby
noe has joined #ruby
rabajaj has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
ramfjord has joined #ruby
sspreitz has quit [Quit: ZNC 1.6.2 - http://znc.in]
impermanence has joined #ruby
impermanence has quit [Client Quit]
ramfjord has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ruby
opekktar has left #ruby [#ruby]
noe has quit [Quit: noe]
beauby has quit [Ping timeout: 260 seconds]
dikaio_ has quit [Remote host closed the connection]
dikaio has quit [Remote host closed the connection]
ramfjord has joined #ruby
inkky[m] has joined #ruby
Rutix has quit []
yabbes has quit [Ping timeout: 260 seconds]
Dimik has quit [Ping timeout: 248 seconds]
hutch34 has joined #ruby
InfinityFye has joined #ruby
millerti has quit [Quit: Textual IRC Client: www.textualapp.com]
impermanence has joined #ruby
rivalomega has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
sspreitz has joined #ruby
impermanence has quit [Client Quit]
marr123 has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
masterasia has joined #ruby
<masterasia> To find days since a model has been created in rails
<masterasia> I'm doing (Date.today - created_at.to_date).to_i
<masterasia> why is the to_date necessary for created_at?
<masterasia> it is a datetime according to my schema
<masterasia> but gets instantiated as a activesupport:timewithzone class
pygospa has quit [Quit: leaving]
pygospa has joined #ruby
ramfjord has joined #ruby
ryzokuken has joined #ruby
jinie_ has quit [Ping timeout: 240 seconds]
<Yxhuvud> please go to #rubyonrails for rails related questions.
ramfjord has quit [Ping timeout: 248 seconds]
dcunit3d has joined #ruby
pootiscoder has quit [Quit: Going offline, see ya! (www.adiirc.com)]
jinie_ has joined #ruby
FahmeF has joined #ruby
moeabdol has joined #ruby
pootiscoder has joined #ruby
impermanence has joined #ruby
pootiscoder has quit [Client Quit]
pootiscoder has joined #ruby
impermanence has quit [Client Quit]
beauby has joined #ruby
lele has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
ta_ has quit [Remote host closed the connection]
lele has joined #ruby
dcunit3d has quit [Ping timeout: 276 seconds]
ramfjord has quit [Ping timeout: 260 seconds]
rivalomega has quit []
mim1k has joined #ruby
lxsameer has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
yabbes has joined #ruby
ramfjord has joined #ruby
pootiscoder has quit [Quit: Going offline, see ya! (www.adiirc.com)]
pootiscoder has joined #ruby
vuoto has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
foooobear has joined #ruby
z0mbee has quit [Remote host closed the connection]
dionysus69 has joined #ruby
beauby has quit [Ping timeout: 260 seconds]
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #ruby
anisha has joined #ruby
foooobear has quit [Read error: Connection reset by peer]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
hanmac has quit [Ping timeout: 255 seconds]
dcunit3d has joined #ruby
opekktar has joined #ruby
high_fiver has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
mjolnird has quit [Read error: Connection reset by peer]
WeiJunLi has joined #ruby
mjolnird has joined #ruby
pygospa has quit [Quit: leaving]
ramfjord has joined #ruby
pygospa has joined #ruby
cagomez has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
cagomez has quit [Ping timeout: 240 seconds]
bb010g_ has quit [Quit: Connection closed for inactivity]
bb010g_ has joined #ruby
bb010g_ has quit [Client Quit]
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
marr123 is now known as marr
ramfjord has joined #ruby
MarkBilk has quit [Ping timeout: 258 seconds]
high_fiver has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 246 seconds]
ryzokuken has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
pootiscoder has quit [Ping timeout: 276 seconds]
Mon_Ouie has quit [Quit: WeeChat 1.9]
WeiJunLi has quit [Ping timeout: 255 seconds]
jackjackdripper has quit [Quit: Leaving.]
conta has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
BTRE has quit [Quit: Leaving]
cveron has joined #ruby
MarkBilk has joined #ruby
cveron has quit [Quit: Leaving]
cagomez has joined #ruby
Emmanuel_Chanel has joined #ruby
ltem has quit [Quit: Leaving]
BTRE has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
rgr has joined #ruby
vuoto has quit [Remote host closed the connection]
CrazyEddy has quit [Ping timeout: 260 seconds]
beauby has joined #ruby
impermanence has joined #ruby
dcunit3d has quit [Quit: WeeChat 1.4]
impermanence has quit [Client Quit]
__Yiota has joined #ruby
ramfjord has joined #ruby
impermanence has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
impermanence has quit [Client Quit]
_whitelogger has joined #ruby
acalycine has quit [Ping timeout: 276 seconds]
skdjas has joined #ruby
domgetter has joined #ruby
dlitvak has joined #ruby
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
impermanence has joined #ruby
impermanence has quit [Client Quit]
c__ has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
skdjas has quit [Remote host closed the connection]
selim_ has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has joined #ruby
selim has joined #ruby
impermanence has joined #ruby
marxarelli|afk has quit [Ping timeout: 260 seconds]
impermanence has quit [Client Quit]
alex`` has joined #ruby
mabus44 has joined #ruby
mabus44 has quit [Ping timeout: 260 seconds]
marr has quit [Ping timeout: 260 seconds]
beauby has quit [Ping timeout: 240 seconds]
phinxy has joined #ruby
kahra has quit [Ping timeout: 248 seconds]
kahra has joined #ruby
t-recx has joined #ruby
impermanence has joined #ruby
impermanence has quit [Client Quit]
mim1k has joined #ruby
kahra has quit [Ping timeout: 248 seconds]
cadillac_ has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
cadillac_ has joined #ruby
beauby has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
nowhere_man has joined #ruby
melkor has joined #ruby
<melkor> I am trying to build ruby2.3.4 and when I run make, it says that prefix is /usr, but I ran ./configure --prefix=/path/to/where/I/want
charliesome has joined #ruby
evie_hammond has joined #ruby
impermanence has joined #ruby
impermanence has quit [Client Quit]
<melkor> odd, it worked finally. Not sure what I did differently.
moeabdol has quit [Quit: WeeChat 1.9]
kahra has joined #ruby
HoierM has joined #ruby
Guest9443 is now known as alamar
beauby has quit [Ping timeout: 240 seconds]
apparition47 has joined #ruby
glaux has joined #ruby
impermanence has joined #ruby
glaux has left #ruby [#ruby]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
glaux has joined #ruby
impermanence has quit [Client Quit]
glaux has quit [Client Quit]
seybo has joined #ruby
bruno- has quit [Ping timeout: 240 seconds]
moeabdol has joined #ruby
moeabdol has left #ruby [#ruby]
impermanence has joined #ruby
impermanence has quit [Client Quit]
conta has quit [Ping timeout: 248 seconds]
InfinityFye has quit [Ping timeout: 260 seconds]
gr33n7007h has joined #ruby
FahmeF has quit [Remote host closed the connection]
ryzokuken has joined #ruby
andrzejku has joined #ruby
<melkor> It appears my vps doesn't have enough memory to run ./passenger-install-apache2-module. Is there anything I can do?
impermanence has joined #ruby
impermanence has quit [Client Quit]
bmurt has joined #ruby
bmurt has quit [Client Quit]
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
beauby has joined #ruby
digitalnomad has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
beauby has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
_sfiguser has joined #ruby
segy has joined #ruby
<darix> melkor: you are sure it can run your app under passenger afterwards?
Guest98725 is now known as rprimus
faraco has joined #ruby
bruno- has joined #ruby
mim1k has joined #ruby
acalycine has quit [Ping timeout: 276 seconds]
bruno- has quit [Read error: Connection reset by peer]
Seenox has quit [Quit: Connection closed for inactivity]
sleepee has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 276 seconds]
bruno- has joined #ruby
<faraco> Hi guys, I have a good background in Python and fairly small in Perl. I use them both usually for commandline utils/text parsing and simple web development. Let's say I want to scrape web pages and do GUI development, what Ruby offers in terms of gems and what Ruby is generally suited for? I'm not really 'trendy' person, which I use tools only when I need it. I want to give ruby a try and want to get some insights from the ruby devs.
<faraco> In Python, for web scraping, I got scrapy and beautifulsoup, and for packet processing, I can use scapy. What Ruby offers in this case?
impermanence has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
impermanence has quit [Client Quit]
bruno- has joined #ruby
nowhere_man has quit [Remote host closed the connection]
bruno- has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
mim1k has joined #ruby
duderonomy has joined #ruby
<faraco> nevermind I guess
sepp2k has joined #ruby
bruno- has joined #ruby
jphase has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
opekktar has quit [Ping timeout: 276 seconds]
<gr33n7007h> faraco: web scrpaing (nokogiri) packet processing (packetfu) just my two bits
bruno- has quit [Read error: Connection reset by peer]
hutch34 has joined #ruby
<faraco> thanks, I never knew that gem is in existence. I should look more harder..
bruno- has joined #ruby
avelldiroll has quit [Quit: WeeChat 1.0.1]
sleepee has joined #ruby
jphase has quit [Ping timeout: 246 seconds]
<apeiros> faraco: mechanize for scraping (builds up on nokogiri)
impermanence has joined #ruby
<faraco> mechanize? That's cool. I'm familiar with Perl's WWW::Mechanize too. This is great.
<apeiros> quite likely it's inspired by that
ryzokuken has quit [Remote host closed the connection]
bruno- has quit [Read error: Connection reset by peer]
impermanence has quit [Client Quit]
bruno- has joined #ruby
ryzokuken has joined #ruby
<faraco> then I just need to learn ruby quite a bit more thoroughly since the libraries I need are available and I don't have to write on by myself. Thank you.
ltem has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
<faraco> anyway, I believe most ruby devs are on Mac. On linux, what is the 'good' way to get the ruby interpreter and the toolchains setup?
<apeiros> I use rvm. there's a couple of people advocating other tools. chruby and rbenv iirc are popular options
<faraco> using package manager on linux doesn't seems great because they need super user access. I had to 'su gem install blah' everytime..
<apeiros> yeah, all three options I named install ruby and gems in userspace
mim1k has joined #ruby
<apeiros> no need for root :)
<faraco> apeiros: thanks so much. :)
<apeiros> yw
Tempesta has quit [Quit: See ya!]
bruno- has joined #ruby
ta_ has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
bruno- has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
ta_ has quit [Remote host closed the connection]
avelldiroll has joined #ruby
pygospa has quit [Quit: Lost terminal]
faraco has quit [Quit: Leaving]
rgr_ has joined #ruby
mim1k has joined #ruby
rgr has quit [Ping timeout: 258 seconds]
mahlon has quit [Ping timeout: 240 seconds]
bruno- has quit [Read error: Connection reset by peer]
impermanence has joined #ruby
bruno- has joined #ruby
ged has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 260 seconds]
mahlon has joined #ruby
impermanence has quit [Client Quit]
ged has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
avelldiroll has quit [Quit: WeeChat 1.6]
avelldiroll has joined #ruby
noname1 has joined #ruby
ncthom91 has joined #ruby
Bhootrk_ has quit [Read error: Connection reset by peer]
ncthom91 has quit [Max SendQ exceeded]
nopolitica has quit [Ping timeout: 248 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mustaffa__ has quit [Ping timeout: 255 seconds]
melkor has quit [Ping timeout: 260 seconds]
avelldiroll has quit [Quit: WeeChat 1.6]
noname1 has quit [Ping timeout: 240 seconds]
avelldiroll has joined #ruby
acalycine has joined #ruby
mim1k has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
impermanence has joined #ruby
leandrobighetti has joined #ruby
impermanence has quit [Client Quit]
alex`` has joined #ruby
FrankD__ has quit [Ping timeout: 260 seconds]
acalycine has quit [Ping timeout: 248 seconds]
opekktar has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
vad4r has joined #ruby
vad4r has quit [Client Quit]
rgtk has joined #ruby
apparition47 has quit [Quit: Bye]
GodFather has quit [Read error: No route to host]
GodFather has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
KeyJoo has quit [Ping timeout: 240 seconds]
ltem has quit [Quit: Leaving]
avelldiroll has quit [Quit: WeeChat 1.6]
avelldiroll has joined #ruby
bruno- has joined #ruby
deduped has joined #ruby
tom69 has joined #ruby
mim1k has joined #ruby
GodFather has quit [Ping timeout: 276 seconds]
leandrobighetti has quit [Remote host closed the connection]
nunchuck has quit [Ping timeout: 276 seconds]
leandrobighetti has joined #ruby
beauby has joined #ruby
impermanence has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
mustaffa__ has joined #ruby
avelldiroll has quit [Quit: WeeChat 1.6]
avelldiroll has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
impermanence has quit [Client Quit]
beauby has quit [Ping timeout: 246 seconds]
tom69 has quit [Quit: WeeChat 1.9]
mim1k has joined #ruby
tom69 has joined #ruby
romankapitonov has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
digitalnomad has joined #ruby
FahmeF has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 260 seconds]
FahmeF has quit [Client Quit]
bruno- has joined #ruby
bruno- is now known as Guest61815
nopolitica has joined #ruby
icarus has quit [Ping timeout: 260 seconds]
Guest61815 has quit [Read error: Connection reset by peer]
impermanence has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
impermanence has quit [Client Quit]
bruno-_ has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
romankapitonov has joined #ruby
rabajaj has quit [Quit: Leaving]
bruno-_ has quit [Read error: Connection reset by peer]
impermanence has joined #ruby
impermanence has quit [Client Quit]
nadir has quit [Quit: Connection closed for inactivity]
mim1k has joined #ruby
http_GK1wmSU has joined #ruby
vuoto has joined #ruby
http_GK1wmSU has left #ruby [#ruby]
mim1k has quit [Ping timeout: 255 seconds]
Guest76729 has quit [Changing host]
Guest76729 has joined #ruby
Guest76729 has joined #ruby
Guest76729 is now known as pskosinski
vuoto has quit [Quit: Lost terminal]
vuoto has joined #ruby
acalycine has joined #ruby
PaulCapestany has quit [Read error: Connection reset by peer]
hutch34 has joined #ruby
mim1k has joined #ruby
mabus44 has joined #ruby
vuoto has quit [Client Quit]
acalycine has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
mabus44 has quit [Ping timeout: 260 seconds]
InfinityFye has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
knight33 has joined #ruby
bruno-_ has joined #ruby
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryzokuken has quit [Ping timeout: 246 seconds]
jackjackdripper has joined #ruby
romankapitonov has joined #ruby
cdg has joined #ruby
leandrobighetti has quit [Remote host closed the connection]
kies has quit [Ping timeout: 240 seconds]
digitalnomad has joined #ruby
swills has quit [Remote host closed the connection]
romankapitonov has quit [Read error: Connection reset by peer]
bruno-_ has quit [Ping timeout: 260 seconds]
Silthias has quit [Read error: Connection reset by peer]
knight33 has quit [Ping timeout: 246 seconds]
impermanence has joined #ruby
<impermanence> What is the best way to compare object arrays and remove duplicates based on a shared attribute? I think using group_by(&:attr) and something else?
romankapitonov has joined #ruby
ryzokuken has joined #ruby
swills has joined #ruby
swills has quit [Changing host]
rgtk has quit [Ping timeout: 240 seconds]
ted_ has joined #ruby
AxelAlex has joined #ruby
ted_ has quit [Read error: Connection reset by peer]
phinxy has quit [Ping timeout: 276 seconds]
swills has joined #ruby
swills has joined #ruby
AxelAlex has quit [Quit: AxelAlex]
hutch34 has joined #ruby
leandrobighetti has joined #ruby
AxelAlex has joined #ruby
AxelAlex has quit [Remote host closed the connection]
leandrobighetti has quit [Ping timeout: 276 seconds]
acalycine has joined #ruby
acalycine has quit [Changing host]
acalycine has joined #ruby
runescape07rsps has joined #ruby
acalycine has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby
AxelAlex has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
rvca has joined #ruby
ascarter has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ryzokuken has quit [Remote host closed the connection]
ryzokuken has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
rvca has quit [Ping timeout: 240 seconds]
VladGh has quit [Remote host closed the connection]
VladGh has joined #ruby
Azure has joined #ruby
vuoto has quit [Quit: Lost terminal]
rgtk has joined #ruby
vuoto has joined #ruby
cdg_ has joined #ruby
cdg_ has quit [Remote host closed the connection]
cdg_ has joined #ruby
bruno- has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
romankapitonov has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 260 seconds]
hutch34 has quit [Ping timeout: 255 seconds]
eightlimbed_ has joined #ruby
romankapitonov has joined #ruby
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
leandrobighetti has joined #ruby
mustaffa__ has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
leandrobighetti has quit [Remote host closed the connection]
acalycine has joined #ruby
mim1k has joined #ruby
minimalism has joined #ruby
govg has quit [Ping timeout: 276 seconds]
bruno- has quit [Ping timeout: 240 seconds]
acalycine has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 260 seconds]
vuoto has quit [Remote host closed the connection]
AxelAlex has quit [Quit: AxelAlex]
hutch34 has joined #ruby
vuoto has joined #ruby
rgtk has quit [Ping timeout: 246 seconds]
Sammichmaker has joined #ruby
Sammichmaker has joined #ruby
Sammichmaker has quit [Changing host]
Jonathan_ has joined #ruby
gnoss has quit [Quit: jetsetradio.live]
mustaffa__ has joined #ruby
Jonathan_ has quit [Client Quit]
romankapitonov has quit [Read error: Connection reset by peer]
mustaffa__ has quit [Ping timeout: 240 seconds]
millerti has joined #ruby
jrabe has joined #ruby
goyox86_ has joined #ruby
romankapitonov has joined #ruby
ych has joined #ruby
mim1k has joined #ruby
all_thr9 has joined #ruby
InfinityFye has quit [Quit: Leaving]
all_thr9 has left #ruby [#ruby]
rgtk has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby
mustaffa__ has joined #ruby
workmad3 has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3_ has joined #ruby
mim1k has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
bruno- has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
workmad3_ has quit [Ping timeout: 240 seconds]
nadir has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
meadmoon has joined #ruby
vuoto has quit [Remote host closed the connection]
nobitanobi has joined #ruby
chouhoulis has joined #ruby
yokel has quit [Remote host closed the connection]
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
vuoto has joined #ruby
yokel has joined #ruby
goyox86_ has quit [Quit: goyox86_]
nopolitica has quit [Ping timeout: 276 seconds]
mabus44 has joined #ruby
goyox86_ has joined #ruby
vuoto has quit [Client Quit]
vuoto has joined #ruby
acalycine has quit [Ping timeout: 240 seconds]
mabus44 has quit [Ping timeout: 255 seconds]
hkdsun has quit [Ping timeout: 268 seconds]
<baweaver> &ri Enumerable#uniq
<baweaver> impermanence
<baweaver> block argument
seybo has quit [Quit: Page closed]
<impermanence> baweaver: I've made some headway. I'm spinning up a gist as I'm stuck on a particular part.
chihhsin_ has quit [Ping timeout: 240 seconds]
Asher has joined #ruby
nobitanobi has quit [Remote host closed the connection]
bruno- has joined #ruby
nobitanobi has joined #ruby
sleepee has quit [Ping timeout: 260 seconds]
hutch34 has quit [Ping timeout: 255 seconds]
chouhoulis has quit [Remote host closed the connection]
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
goyox86_ has quit [Quit: goyox86_]
romankapitonov has quit [Read error: Connection reset by peer]
axsuul has joined #ruby
MrBusiness has quit [Ping timeout: 240 seconds]
nobitanobi has quit [Ping timeout: 246 seconds]
patr0clus has joined #ruby
patr0clus has quit [Max SendQ exceeded]
nobitanobi has joined #ruby
mim1k has joined #ruby
sleepee has joined #ruby
nobitanobi has quit [Remote host closed the connection]
patr0clus has joined #ruby
patr0clus has quit [Max SendQ exceeded]
mim1k has quit [Ping timeout: 260 seconds]
patr0clus has joined #ruby
hutch34 has joined #ruby
chihhsin has joined #ruby
<baweaver> impermanence: give me a sec. Also name your gists .rb, gives syntax highlighting. Not a big deal for now
<impermanence> baweaver: oh, wow, I didn't know that about naming gists. cool :)
patr0clus is now known as s3nd1v0g1us
<baweaver> your syntax is wrong around 12
<baweaver> you need an end there
<baweaver> Also line 8 is not needed
<baweaver> ruby methods don't use { } to denote boundries
<baweaver> they use def name ... end
<baweaver> Not Scala ;)
<baweaver> or C or Javascript or...
<baweaver> anyways, not the point, just don't surround your methods in {}
<impermanence> ha! I didn't even notice that ;)
Asher has quit [Quit: Leaving.]
<baweaver> Also select returns an array for which the condition is true
<baweaver> >>C=Struct.new(:name,:category); C.new('test', 'one')
<ruby[bot]> baweaver: # => #<struct C name="test", category="one"> (https://eval.in/841949)
<baweaver> ok good, testing something
PaulCapestany has joined #ruby
<baweaver> >>C=Struct.new(:name,:category); [C.new('test', 'one'), C.new('foo', 'one'), C.new('bar', 'two')].select { |c| c.category == 'one' }
<ruby[bot]> baweaver: # => [#<struct C name="test", category="one">, #<struct C name="foo", category="one">] (https://eval.in/841950)
<baweaver> Don't use Structs like that, just needed a cheap class to demonstrate
hkdsun has joined #ruby
ecuanaso has joined #ruby
<impermanence> ah, I see
<baweaver> So now line 8 is gone, and line 9 becomes: companies.select { |x| x.category == company.category && x != company }.sort_by(&:capital).reverse
<baweaver> with line breaks preferably
<baweaver> the delete_if can be combined with the select as the: && x != company
hutch34 has quit [Ping timeout: 255 seconds]
conta has joined #ruby
<impermanence> yes I see that now, wow
<baweaver> also throw a uniq on the end if you want.
<baweaver> that'll prevent dupes
<impermanence> in other words: ...reverse.uniq ?
kahra has quit [Quit: WeeChat 1.9]
<baweaver> though it'd be rather odd for there to be duplicates except for the recommending company
<baweaver> Have you heard of testing yet?
kahra has joined #ruby
eightlimbed_ has quit [Ping timeout: 246 seconds]
<impermanence> I am familiar with literally just the very basics: minitest, assert_equal, etc.
<baweaver> You might start using some of it to verify that your code works as expected
<baweaver> Look into Guard as well which will run them on file changes
<baweaver> ie: foo.rb changing triggers a run of foo_spec.rb
<impermanence> I will do that
<baweaver> Nice to get fast feedback on things
<baweaver> you can even tie it into mac notifications to get an alert for them
meadmoon has quit [Quit: I am functioning within established parameters.]
workmad3 has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
mim1k has joined #ruby
<impermanence> I updated my first method with your changes :) much easier to read!
opekktar has quit [Quit: leaving]
mim1k has quit [Ping timeout: 255 seconds]
t-recx has quit [Quit: t-recx]
hanmac has joined #ruby
icarus has joined #ruby
nopolitica has joined #ruby
airdisa_ has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
airdisa has quit [Ping timeout: 258 seconds]
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
<impermanence> baweaver: any thoughts on my second method?
acalycine has quit [Ping timeout: 246 seconds]
icarus has quit [Ping timeout: 255 seconds]
mim1k has joined #ruby
FahmeF has joined #ruby
cdg has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
cdg_ has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 248 seconds]
mim1k has joined #ruby
runescape07rsps has quit [Quit: Leaving]
mtkd has quit [Ping timeout: 276 seconds]
<impermanence> baweaver: I feel like this should be close: backed_companies.each_with_index { |val, idx| all_companies.select { |x| val.category == x.category && val != x }.sort_by(&:capital).reverse.uniq }
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
t-recx has joined #ruby
acalycine has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
opekktar has joined #ruby
acalycine has quit [Ping timeout: 240 seconds]
rvca has joined #ruby
acalycine has joined #ruby
kahra_ has joined #ruby
MrBusiness has joined #ruby
ncthom91 has joined #ruby
kahra has quit [Ping timeout: 248 seconds]
sleepee has quit [Ping timeout: 260 seconds]
digitalnomad has joined #ruby
cdg has quit [Remote host closed the connection]
<apeiros> impermanence: why each_with_index? you don't use the index.
mim1k has quit [Ping timeout: 276 seconds]
<impermanence> apeiros: I'll show you what I am using now, which is just each b/c you're right :)
<apeiros> also, each_* returns backed_companies, so the result in your block is thrown away.
<apeiros> and one thing regarding the performance of your code: you go through all companies once for every backed_company. that's n*m. you could do it in n+m (go through all backed_companies once and go through all companies once)
<apeiros> say you have 100 backed companies and 10000 companies, that's 1_000_000 times the block invoked vs. 10_100, or a ~100x speed up.
<impermanence> apeiros: ah...hm. could you show me the code difference? I can not visualize that in code, sorry.
<apeiros> (though, in the n+m variant, the block for the n iterations will differ from the one for the m iterations, so it's not really possible to compare iterations 1:1)
eightlimbed_ has joined #ruby
<apeiros> require 'set'; backed_categories = backed_companies.map(&:category).to_set; all_companies.select { |company| backed_categories.include?(company.category) }.sortandstuff
dionysus69 has quit [Ping timeout: 260 seconds]
<apeiros> depending on what you do I'd do it even differently. but this is strictly the code you gave improved.
<apeiros> oh, might have to do `result - backed_companies`, since your block seems to throw those out too.
nopolitica has quit [Ping timeout: 246 seconds]
<impermanence> apeiros: yes, it does. I'm spinning up a gist right now with a short block showing my attempt
<apeiros> I wonder why your all_companies has duplicates in it to begin with, though
<apeiros> impermanence: pro-tip - array of objects is a pleonasm
<apeiros> there are no arrays of non-objects in ruby ;-)
cbyrda has quit [Remote host closed the connection]
<impermanence> apeiros: mm...that is enlightening.
<apeiros> yeah, ok, uniq seems superfluous then.
<apeiros> just (all_companies.select { … } - backed_companies).sort_by(&:capital)
<apeiros> and that'll be n+m instead of n*m
opekktar has quit [Quit: leaving]
chouhoulis has joined #ruby
ryzokuken has quit [Quit: Leaving]
<impermanence> apeiros: is it possible to do without set?
Murda has joined #ruby
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> you can use a hash instead.
<apeiros> a set is really just a hash (literally, it's implemented via hash) without values
acalycine has quit [Ping timeout: 240 seconds]
<impermanence> aperios: okay, so how I would delete elements from the array being returned if they are also found in backed_companies?
<impermanence> apeiros: is there a way to chain a method to do that?
<impermanence> apeiros: this is what I have so far:
<apeiros> ?tabnick impermanence
<ruby[bot]> impermanence: pro-tip - use tab completion for nicks. avoids typos in nicks.
<apeiros> that's the `- backed_companies` part.
<apeiros> >> [1,2,3,4,5] - [2,4]
<ruby[bot]> apeiros: # => [1, 3, 5] (https://eval.in/841957)
<apeiros> works with any properly programmed class (namely it has proper #hash and #eql? methods)
<impermanence> apeiros: ah, I see...
<impermanence> apeiros: wait, where is the - backed_companies part? I don't see it in the original part.
<apeiros> 22:53 apeiros: oh, might have to do `result - backed_companies`, since your block seems to throw those out too.
<apeiros> 23:00 apeiros: just (all_companies.select { … } - backed_companies).sort_by(&:capital)
_sfiguser has quit [Quit: Leaving]
<impermanence> apeiros: tab completing now :) yes, I see it, thank you.
<apeiros> for reference, #hash and #eql? are normally based on identity. they're used to determine whether two objects should be treated as the same key in a hash.
<impermanence> apeiros: oh, okay.
<apeiros> e.g "foo" and "foo" are two different objects, but they're the same hash key.
<impermanence> apeiros: I must be missing something. above you show: (all_companies.select { … } - backed_companies).sort_by(&:capital)
<impermanence> apeiros: what are the parentheses around (all_companies ... backed_companies) ?
<apeiros> just that, parens
<apeiros> without them, sort_by would only affect backed_companies.
<apeiros> (a - b).sort # sort the return value of `a - b`
<apeiros> a - b.sort # sort b, subtract it from a
<apeiros> a - b.sort # sort b, subtract *the result* from a (small clarification to what I wrote above)
mustaffa__ has quit [Ping timeout: 240 seconds]
<impermanence> apeiros: where should I begin that parens set at?
<apeiros> think about what you want to be sorted.
<apeiros> around that.
ltem has joined #ruby
<apeiros> you can also just work with assigning intermediate results to variables and split your code to more lines.
<apeiros> makes probably more sense at your current level of knowledge.
sepp2k1 has joined #ruby
conta has quit [Ping timeout: 240 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
<impermanence> apeiros: one sec
<apeiros> I'll be playing soon, so my replies might get more sporadic anyways ;-)
ltem has quit [Client Quit]
kkiero has joined #ruby
ledestin has joined #ruby
<impermanence> apeiros: I just did your line - backed_companies :)
ledestin has quit [Ping timeout: 240 seconds]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mustaffa__ has joined #ruby
vuoto has quit [Remote host closed the connection]
nopolitica has joined #ruby
icarus has joined #ruby
Murda has quit [Quit: Murda]
icarus has quit [Client Quit]
mim1k has joined #ruby
kkiero has left #ruby [#ruby]
melkor has joined #ruby
d33pb00k-GK1wmSU has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
d33pb00k-GK1wmSU has left #ruby [#ruby]
mustaffa__ has quit [Ping timeout: 276 seconds]
selim has quit [Ping timeout: 240 seconds]
rvca has quit [Ping timeout: 248 seconds]
selim has joined #ruby
eightlimbed_ has quit [Ping timeout: 246 seconds]
FahmeF has quit [Remote host closed the connection]
iomotoko has joined #ruby
opekktar has joined #ruby
opekktar has quit [Client Quit]
TomyLobo3 has quit [Ping timeout: 276 seconds]
nobitanobi has joined #ruby
mim1k has joined #ruby
melkor has quit [Ping timeout: 255 seconds]
cagomez has joined #ruby
opekktar has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
belmoussaoui_ has joined #ruby
impermanence has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ych has quit [Remote host closed the connection]
mim1k has joined #ruby
Murda has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
minimalism has quit [Quit: minimalism]
minimalism has joined #ruby
bruno- has quit [Ping timeout: 268 seconds]
<rapha> is it possible (and how?) to run a shell command in ruby inside a thread and to also kill it again?
<apeiros> yes. various ways. the ultimate tool is Kernel#spawn.
<rapha> ultimatr sounds good
<apeiros> the simpler tools are `` (backticks) and popen.
<apeiros> well, ultimate also means "might drown you in options" :)
<rapha> i know about the backticks - but how to _end_ the process?
<apeiros> ah, right, no access to the pid
<rapha> yup
<apeiros> spawn then. popen won't give that either.
<rapha> apeiros: or would it end upon Thread#kill if the backticks are inside the Thread#new block?
<eam> rapha: so, point of order. None of these run "inside a thread"
<eam> they all fork and exec -- and mixing that with threads is probably a bad idea
<rapha> ah.
<matthewd> Mixing that with threads is just fine
<eam> or at least, fraught with peril and implementation-specific odd behaviors
<eam> matthewd: naaaaah
<rapha> i just thought of threads because i want to do stuff after i start the process and then end the process once i'm done doing stuff.
<matthewd> Though with spawn, you won't need to
<rapha> okay
* rapha wanders off to the docs
<eam> rapha: you may want to deal with the subprocess async, rather than use threads
alex`` has quit [Ping timeout: 246 seconds]
<rapha> oh cool, thanks!
<rapha> humm
<rapha> without having read that yet ... spawn does return the pid. so all should be fine. except if i want to see the spawned process's stdout i guess
mim1k has joined #ruby
<eam> you can give spawn a descriptor for stdin/out
<eam> that'll give you popen-ish behavior
eizua has joined #ruby
<rapha> i'll stop asking stupid questions now and just try to get it working and maybe come back with better questions
<eam> :D
<eam> here's a maybe better article, describing why go banned fork https://thorstenball.com/blog/2014/10/13/why-threads-cant-fork/
bruno- has joined #ruby
<rapha> why go banned fork?
<rapha> that does not parse...
<eam> article explains it, but in short: mixing forks and threads is dangerous
<rapha> oh! not go, Go+
<eam> golang
<rapha> s/+/! ... still learning the Swiss keyboard layout
* rapha got himself an X200 with a Swiss keyboard
cagomez has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 260 seconds]
eizua has quit [Remote host closed the connection]
cagomez has joined #ruby
sepp2k1 has quit [Read error: Connection reset by peer]
cagomez has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
mim1k has joined #ruby
digitalnomad has joined #ruby
nobitanobi has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
runescape07rsps has joined #ruby
opekktar has quit [Quit: leaving]
opekktar has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
ssplatt has joined #ruby
impermanence has joined #ruby
<impermanence> yay! ;)
kies has joined #ruby
<ssplatt> I’m trying to use some data from the nfl fantasy football api, so i made a wrapper object and methods. they work in irb but when i call them in my web app i keep getting “undefined method `[]' for nil:NilClass”
<ssplatt> @nfl.get_players_details(@lineup.qb_id)["players"][0] gives that error. removing the [0] makes it go away, but then i can’t process the data correctly because it’s a hash in a list
<ssplatt> is there any reason why @nfl.get_players_details(@lineup.qb_id)["players"][0] would work in irb but not the web app?
ShekharReddy has quit [Quit: Connection closed for inactivity]
<rapha> hmm
<rapha> so i spawned a new process and have its pid now. i can wait for it to end or i can end it. but how do i tell it to pause? (i.e. as if i was pressing Ctrl-Z in the terminal and then did "fg" to resume it)
alveric4 has joined #ruby
<apeiros> ctrl-z probably signals the app
<apeiros> so find the signal, then Process.kill to send that signal
<apeiros> eh
<apeiros> no, silly me
nobitanobi has joined #ruby
<apeiros> doesn't ctrl-z just background the job?
<matthewd> Yeah, sigstop/sigcont
<rapha> No, it pauses it and backgrounds it, both
<rapha> Yay+
xuanrui has quit [Ping timeout: 260 seconds]
<apeiros> ok, then what was the command to background an app? o0
<rapha> bg
alveric3 has quit [Ping timeout: 268 seconds]
<impermanence> Suppose I have a method that takes a lambda as an argument. This lambda has two parameters itself. Is it possible for me to access the lambda's parameters inside the method?
yabbes has quit [Ping timeout: 276 seconds]
nobitanobi has quit [Remote host closed the connection]
airdisa_ has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
ssplatt has quit [Quit: ssplatt]
<apeiros> impermanence: no. and that'd be bad design anyway.