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
xenops has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xenops has joined #ruby
be_______ has quit [Ping timeout: 252 seconds]
xenops has quit [Client Quit]
xenops has joined #ruby
xenops has quit [Client Quit]
xenops has joined #ruby
xenops has quit [Client Quit]
hotpancakes has joined #ruby
Pumukel has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xenops has joined #ruby
xenops has quit [Client Quit]
xenops has joined #ruby
preyalone has quit [Quit: Connection closed for inactivity]
xenops has quit [Client Quit]
bonhoeffer has quit [Ping timeout: 252 seconds]
chefuser has joined #ruby
hutch34_ has joined #ruby
skweek has joined #ruby
<chefuser> i hate to ask a noob question. I am trying to use https://github.com/NoRedInk/rspec-retry. however their example is only with it. how would I use this with something like 'its(:content)'
bonhoeffer has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
patr0clus has joined #ruby
esObe has joined #ruby
KnownSyntax has quit [Ping timeout: 258 seconds]
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
<chefuser> i hate to ask a noob question. I am trying to use https://github.com/NoRedInk/rspec-retry. however their example is only with it. how would I use this with something like 'its(:content)'
GodFather has quit [Ping timeout: 252 seconds]
esObe has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
KnownSyntax has joined #ruby
bkxd has joined #ruby
hotpancakes has quit [Ping timeout: 258 seconds]
chefuser has quit [Quit: Page closed]
bonhoeffer has quit [Ping timeout: 255 seconds]
Rodya_ has quit [Remote host closed the connection]
ghornet_ has joined #ruby
pabs has quit [Ping timeout: 240 seconds]
ghornet__ has joined #ruby
jaequery_ has quit [Quit: Textual IRC Client: www.textualapp.com]
ghornet_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
jdawgaz has joined #ruby
statelesscode has quit [Ping timeout: 240 seconds]
ghornet__ has quit [Ping timeout: 240 seconds]
<al2o3-cr> is there a reason for Socket#nread doesn't work in a block?
houhoulis has joined #ruby
mwlang has joined #ruby
<mwlang> what are folks using for natural language processing in Ruby these days? the stanford-core-nlp and treat gems seem like they saw better days and are proving difficult for me to get fully configured.
<mzo> al2o3-cr: u wot
<al2o3-cr> any ideas?
Fasort has quit [Quit: Leaving]
Fasort has joined #ruby
<mzo> al2o3-cr: what is nread
<al2o3-cr> &ri Socket#nread
<mzo> oh it's on IO
<al2o3-cr> yep
<mzo> there's a race condition
<mzo> i think that qualifies as a race condition
<mzo> you're calling nread before the server got your message and replied
<al2o3-cr> ah
<mzo> it worked in the repl because you had to type the line
bonhoeffer has joined #ruby
Yzguy has quit [Quit: Cya]
<al2o3-cr> mzo: yep, correct +1 thanks!
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<al2o3-cr> so i should use Socket.select?
hotpancakes has joined #ruby
<mzo> al2o3-cr: well what are you trying to do?
<al2o3-cr> so something like read = Socket.select([sock], nil, nil, 1); if sock.first ...
<mzo> select on one file descriptor means you're doing something wrong
raul782 has joined #ruby
<mzo> just use #read imo
<mzo> { sock.send "socket test...", 0; sock.read }
<al2o3-cr> that will just hang no?
<mzo> i'm assuming the server closes the connection after handling a single message
<mzo> or does #read on a socket just return as soon as some data becomes available? i don't know tbh
<mzo> the read system call on a socket returns as soon as data is available, and this is meant to mirror that
mwlang has quit [Quit: mwlang]
<mzo> completely different behavior when you omit the buffer size would be strange
<mzo> i don't really get why BasicSocket#recv *needs* a maxlen argument
<mzo> it's only a thing in C because *you* provide the buffer
<mzo> it should just wait for data to be available and then give you everything if you call it without maxlen
hotpancakes has quit [Remote host closed the connection]
<al2o3-cr> mzo: idk
hutch34_ has quit [Ping timeout: 240 seconds]
Pumukel has quit [Read error: Connection reset by peer]
Voker57|2 has quit [Read error: Connection reset by peer]
<al2o3-cr> i suppose select works, but that is bad idea :(
Pumukel has joined #ruby
Pumukel has quit [Read error: Connection reset by peer]
claudevandort has joined #ruby
raul782 has quit [Remote host closed the connection]
__Yiota has joined #ruby
Pumukel has joined #ruby
jdawgaz has joined #ruby
Guest96 has quit [Remote host closed the connection]
hotpancakes has joined #ruby
Guest96 has joined #ruby
<al2o3-cr> mzo: why do you say using select on one fd is bad?
raul782 has joined #ruby
t-recx has quit [Quit: t-recx]
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
binaryplease has quit [Ping timeout: 260 seconds]
<al2o3-cr> ah, i found IO#ready?
jrafanie has joined #ruby
mwlang has joined #ruby
mwlang has quit [Client Quit]
ledestin has joined #ruby
<StoneCypher> aha! getBoundingClientRect();
ghornet has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
hotpancakes has quit [Remote host closed the connection]
Cohedrin has joined #ruby
ghornet has left #ruby ["ruby"]
mooser has quit [Ping timeout: 240 seconds]
hotpancakes has joined #ruby
<mzo> al2o3-cr: why are you so focused on all of this non-blocking stuff?
<mzo> al2o3-cr: just use a blocking read...
<al2o3-cr> mzo: because it hangs
<mzo> select is for when you have several file descriptors and you want to read from the first one that is ready
<mzo> al2o3-cr: what do you mean it hangs?
pabs has joined #ruby
<mzo> it will only hang if the server never sends anything, in which case using a non-blocking read won't help
<al2o3-cr> this works
jameser has joined #ruby
<al2o3-cr> is this ok?
hotpancakes has quit []
<mzo> al2o3-cr: nope
<al2o3-cr> ok. why?
<mzo> that's literally just a blocking read except it will throttle your CPU for absolutely no reason
<al2o3-cr> mzo: so what to do?
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
connor_goodwolf has quit [Ping timeout: 264 seconds]
<mzo> al2o3-cr: ......
<mzo> use a blocking read
connor_goodwolf has joined #ruby
<al2o3-cr> mzo: it hangs for some weird reason
<al2o3-cr> if i use a blocking read
<mzo> show me the program that hangs
<al2o3-cr> mzo: basically what you suggested; { sock.send "socket test...", 0; sock.read }
raul782 has quit [Remote host closed the connection]
<mzo> try sock.read 500
<al2o3-cr> same
jrafanie has joined #ruby
<al2o3-cr> sock.read works when it's 120 bytes anything over that hangs
<mzo> that is senseless
<al2o3-cr> mzo: try it
<al2o3-cr> Addrinfo.tcp(url, port).connect(timeout: 1) { |s| s.puts "socket test..."; s.read 120 }
<al2o3-cr> then change to 121
<al2o3-cr> url = "tcpst.net"; port = 7777
libastral has quit [Ping timeout: 240 seconds]
<al2o3-cr> i'm slowly losing my sanity :(
hutch34_ has joined #ruby
bonhoeffer has quit [Remote host closed the connection]
libastral has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raul782 has joined #ruby
<mzo> al2o3-cr: i believe you, i'm just saying that doesn't mirror the way read() actually works
<al2o3-cr> read works like fread in C yep?
<mzo> well it's hard to compare
<al2o3-cr> well it's stated in the docs
<mzo> i suppose so
ghornet has joined #ruby
<mzo> it's uncommon to use stdio with sockets though
<al2o3-cr> what?
<mzo> fread works on 'FILE *'
<mzo> socket(2) returns a file descriptor. usually you'd just use that, with read/recv
creaked has quit [Ping timeout: 252 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
jameser has joined #ruby
hutch34_ has quit [Ping timeout: 252 seconds]
<al2o3-cr> mzo: so why does it block then?
<mzo> because when you call sock.read 500, it will only return when: 1) it has read 500 bytes, or 2) the connection is closed
<al2o3-cr> that's why i was using recv
<mzo> but in C, if you call read(sock, buf, 500) it will return as soon as *any* data is ready, even if it's less than 500 bytes
<mzo> does sock.recv 500 work?
<al2o3-cr> ah, so use sysread
__Yiota has quit [Client Quit]
<al2o3-cr> mzo: no 500 doesn't work because its 120 bytes
ghornet has left #ruby ["ruby"]
<al2o3-cr> sysread works
__Yiota has joined #ruby
<mzo> i wouldn't use sysread
<mzo> there's got to be a more idiomatic way to do it
<al2o3-cr> well, i'm all out of ideas then
esObe has joined #ruby
patr0clu1 has joined #ruby
patr0clu1 has quit [Client Quit]
hutch34_ has joined #ruby
<al2o3-cr> it says if you want the behavior of single read(2) use readpartial, read_nonblock, sysread
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
be_______ has joined #ruby
patr0clus has quit [Ping timeout: 240 seconds]
esObe has quit [Ping timeout: 252 seconds]
<al2o3-cr> anyway, thanks for the help mzo you've been great!
Guest96 has quit [Remote host closed the connection]
<mzo> np al2o3-cr
joneshf-laptop has quit [Remote host closed the connection]
Guest96 has joined #ruby
be_______ has quit [Ping timeout: 258 seconds]
mooser has joined #ruby
houhoulis has quit [Remote host closed the connection]
mim1k has joined #ruby
nertzy has joined #ruby
armyriad has quit [Quit: Leaving]
mim1k has quit [Ping timeout: 240 seconds]
preyalone has joined #ruby
hutch34_ has quit [Ping timeout: 252 seconds]
enterprisey has joined #ruby
statelesscode has joined #ruby
KnownSyntax has quit [Ping timeout: 255 seconds]
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cfec0b8d has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
astrobunny has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
harfangk has joined #ruby
Tempesta has quit [Quit: See ya!]
mazeinmaze_ has joined #ruby
Tempesta has joined #ruby
charliesome has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Jamo has quit [Ping timeout: 240 seconds]
minimalism has joined #ruby
Guest36187 has joined #ruby
armyriad has joined #ruby
jdawgaz has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cfec0b8d has quit [Quit: Leaving.]
cfec0b8d has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
Cohedrin has joined #ruby
astrobunny has quit [Ping timeout: 240 seconds]
gix has quit [Ping timeout: 240 seconds]
hndk has joined #ruby
spicerack has joined #ruby
gix has joined #ruby
rakm has joined #ruby
mazeinmaze_ has quit [Ping timeout: 252 seconds]
anisha has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xenops has joined #ruby
jameser has joined #ruby
claudevandort has quit [Quit: Textual IRC Client: www.textualapp.com]
Robtop__ is now known as pwnd_nsfw
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hndk has quit [Quit: Leaving]
jdm has left #ruby ["Leaving"]
mooser has quit [Remote host closed the connection]
esObe has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
mazeinmaze_ has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
astrobunny has joined #ruby
esObe has quit [Ping timeout: 268 seconds]
<cerulean> >> eval s=%q($><<"eval s=%q(#{s})\n")
<cerulean> << eval s=%q($><<"eval s=%q(#{s})\n")
<ruby[bot]> cerulean: # => eval s=%q($><<"eval s=%q(#{s})\n") ...check link for more (https://eval.in/777387)
wiuefhw has joined #ruby
<wiuefhw> fuck
wiuefhw has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
enterprisey has quit [Ping timeout: 252 seconds]
mim1k has joined #ruby
jakkn has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 260 seconds]
Channel6 has quit [Quit: Leaving]
__Yiota has joined #ruby
mooser has joined #ruby
balazs has quit [Ping timeout: 260 seconds]
__Yiota has quit [Client Quit]
balazs has joined #ruby
etehtsea has joined #ruby
mooser has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
ta_ has quit [Remote host closed the connection]
skweek has quit [Ping timeout: 252 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest36187 has quit [Quit: Changing server]
raul782 has quit []
pytuger has joined #ruby
pytuger has joined #ruby
pytuger has quit [Changing host]
jane_booty_doe has joined #ruby
mooser has joined #ruby
mooser has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 260 seconds]
mooser has joined #ruby
preyalone has quit [Quit: Connection closed for inactivity]
balazs has quit [Remote host closed the connection]
cagmz_ has quit [Read error: Connection reset by peer]
jakkn has quit [Ping timeout: 252 seconds]
govg has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
anisha has quit [Ping timeout: 258 seconds]
jgt1 has joined #ruby
anisha has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit []
jameser has joined #ruby
etehtsea has quit [Ping timeout: 258 seconds]
dev_ has joined #ruby
enterprisey has quit [Remote host closed the connection]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cohedrin has joined #ruby
esObe has joined #ruby
ddffg has joined #ruby
jane_booty_doe has quit [Quit: Leaving]
esObe has quit [Ping timeout: 252 seconds]
Guest96 has quit [Remote host closed the connection]
Guest96 has joined #ruby
govg has joined #ruby
jamesaxl has joined #ruby
mim1k has joined #ruby
pwnd_nsfw has quit [Quit: Leaving]
dev_ has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 255 seconds]
jameser has joined #ruby
freedrul1 has joined #ruby
freedrul1 is now known as mcfiredrill
TomyLobo2 has joined #ruby
mooser has quit [Remote host closed the connection]
etehtsea has joined #ruby
jgnagy has quit [Remote host closed the connection]
ffi_merlin has joined #ruby
auzty has joined #ruby
jgnagy has joined #ruby
<ffi_merlin> @ruby
bkxd has joined #ruby
<dminuoso> ffi_merlin: instance variables are bad!
ffi_merlin has quit [Quit: leaving]
kristofferR has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 240 seconds]
StoneCypher has quit [Ping timeout: 240 seconds]
Xiti has quit [Quit: Xiti]
etehtsea has quit [Quit: Textual IRC Client: www.textualapp.com]
bkxd has joined #ruby
<dminuoso> ast>> foo.to be true
<ruby[bot]> dminuoso: I have parsed your code, the result is at https://eval.in/777475
<dminuoso> ast>> foo.to be(true)
<ruby[bot]> dminuoso: I have parsed your code, the result is at https://eval.in/777476
leah2 has quit [Ping timeout: 252 seconds]
KnownSyntax has quit [Ping timeout: 255 seconds]
Azure has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
mzo has quit [Ping timeout: 260 seconds]
leah2 has joined #ruby
naprimer_2 has quit [Ping timeout: 260 seconds]
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
djbkd has quit [Remote host closed the connection]
naprimer_2 has joined #ruby
nofxxx has joined #ruby
esObe has joined #ruby
nofxxxx has quit [Ping timeout: 260 seconds]
naprimer_2 has quit [Ping timeout: 260 seconds]
tohuw has joined #ruby
naprimer_2 has joined #ruby
AcidRain has joined #ruby
<tohuw> I've a .rb script I'm working on which has a require statement that references a gem. I want to work on a local copy of this script and its dependent gemfiles which live in a subfolder. The folder structure in my PWD is like this: foo.rb foodeps/bar.rb foodeps/yum.rb How do I change the statement "require foodeps/bar" correctly?
<dminuoso> tohuw: Use bundler.
<AcidRain> hey, im trying to find the single word "message" that occures on a new line between the strings "symbols" and "end" which will also occur on their own line.
<AcidRain> docs says this should work /symbols(message)end/m
<dminuoso> AcidRain: No. That would leave nothing in between.
<dminuoso> AcidRain: Oh well, I suppose it could work.
<dminuoso> >> !!("a\nb" =~ /ab/m)
<ruby[bot]> dminuoso: # => false (https://eval.in/777486)
<dminuoso> Or not.
<dminuoso> >> !!("a\nb" =~ /a\nb/m)
<ruby[bot]> dminuoso: # => true (https://eval.in/777487)
mooser has joined #ruby
<dminuoso> >> !!("a\nb" =~ /a$b/m)
<ruby[bot]> dminuoso: # => false (https://eval.in/777488)
<AcidRain> dminuoso, no it doesnt work
<dminuoso> AcidRain: My second example does.
<dminuoso> Apparently.
<dminuoso> But Im pretty clueless about regex.
leah2 has quit [Ping timeout: 252 seconds]
pppktz has joined #ruby
mooser has quit [Ping timeout: 252 seconds]
Qchmqs has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
StoneCypher has joined #ruby
naprimer_2 has quit [Ping timeout: 258 seconds]
ltem has joined #ruby
StoneCypher has quit [Ping timeout: 240 seconds]
<tohuw> dminuoso: oh cool... I've been using bundler, but didn't really know about :path. Thanks!
leah2 has joined #ruby
<dminuoso> tohuw: Great. :)
naprimer_2 has joined #ruby
bkxd has quit [Ping timeout: 252 seconds]
bkxd has joined #ruby
naprimer_2 has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
djbkd has joined #ruby
manjaro-kde5 has joined #ruby
djbkd_ has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 252 seconds]
kassav__ has joined #ruby
ltem has left #ruby ["Leaving"]
tynamite has joined #ruby
<tynamite> Is there a ruby server I can use on my windows laptop for development?
<dminuoso> tynamite: What is a "ruby server" ?
<dminuoso> tynamite: Ruby works fine on Windows.
<dminuoso> Mostly anyway.
<tynamite> a way i can run ruby websites
<dminuoso> tynamite: What are your requirements? Do you just need something minimalistic? sinatra is your friend.
<tynamite> I'm using the Ramaze framework and it wants me to run the app on port 3000
<dminuoso> Okay, so?
<tynamite> But what if I want to run a simple standalone ruby file as a web page? Or if I want to run multiple ramaze apps on the same port?
<dminuoso> What does either of these things even mean?
<tynamite> I'll try to explain.
<tynamite> I've made a website with the Ramaze framework and to run it on my Windows computer, it wants me to go to command prompt, enter "ramaze start" then the ramaze app runs on port 3000.
<apeiros> tynamite: ramaze afaik uses rack in the backend by now. there's multiple webservers which can run it
<tynamite> I am not happy with this setup.
<apeiros> tynamite: and the port is almost certainly configurable
<apeiros> try `ramaze -h`, it'll probably show the options you can pass in
<tynamite> i'll try that
scootaloo is now known as adaedra
<apeiros> tynamite: re "run single ruby files", might take a look at https://github.com/migrs/rack-server-pages
<tynamite> I've entered "ramaze -h" and there's 6 commands I can choose from.
<tynamite> I'm looking for a way for a ruby server that I can just go to the file manager to add ruby files and folders in, and run those subfolders in the web browser.
<dminuoso> What does "running those subfolders in the web browser" mean.. exactly?
<dminuoso> How do you run a subfolder in a web browser?
<apeiros> tynamite: look at the above link
<apeiros> dminuoso: I think they're thinking about it like e.g. with .php
<tynamite> i'll try to explain
<tynamite> Like how php works.
<dminuoso> Oh boy.
<apeiros> so yeah, above link
<tynamite> When I install wampserver or xampp to my windows computer, I place everything inside www/ or htdocs/ whatever I want, go to the appropriate url and it just runs.
<apeiros> we've evolved away from that, but nothing prevents you from doing it that way. hence somebody came up with a way.
<dminuoso> Devolution is still a thing it seems.
<apeiros> sure
<dminuoso> tynamite: Just use sinatra.
<dminuoso> Like everybody else.
<apeiros> pre-evolution things tend to have the air of being "simpler"
<dminuoso> apeiros: That's the thing. Sinatra is not really that complicated.
<adaedra> you can't form a generation of php developpers telling it the way it's done is the right way® and hope there are no side effects.
jamesaxl has quit [Read error: Connection reset by peer]
<dminuoso> adaedra: But you can put those PHP developers into a rocket for an educational (one way) trip to the moon.
<tynamite> I might have to look into sinatra instead of ramaze.
<dminuoso> tynamite: If you're already comfortable with ramaze you might as well stick to it. They are not too terribly different.
jamesaxl has joined #ruby
<adaedra> dminuoso: did you not hear? Moon is so last century. It's all about mars now.
<dminuoso> adaedra: That's why I want them to stay on the Moon.
<tynamite> I'll look into rack server pages and see if it solves my problem.
Sauvin is now known as Bock
<tynamite> Why did ruby have to evolve away from that apeiros, that's what stopped ruby from being more popular ;)
<adaedra> tynamite: trolling aside, the PHP way of having a .php file for each subpage is not a very good way, especially because of shared code and things that should stay between calls
<apeiros> tynamite: uh, that claim is rather flawed
<adaedra> Ruby became popular thanks to Rails, so that's kinda the opposite
<apeiros> tynamite: we evolved away from that way because it has a tons of issues
<apeiros> tynamite: and if you've done any reasonably big project with php, you'd know that
<tynamite> But there's certain websites that have to work in that fashion.
<apeiros> it's why there are things like apc and other caching solutions in the php world
<dminuoso> tynamite: Anything you want can be trivially done with sinatra/ramaze.
<apeiros> tynamite: no, there is no website which *has* to work in that fashion
mooser has joined #ruby
<dminuoso> tynamite: The concept of multiple sites is solved by routing logic, not by files.
<apeiros> but yes, there are websites where it's nicer if you can start out that way
<tynamite> maybe i'm confused here
<apeiros> and again, nothing stops you from doing it that way.
<dminuoso> tynamite: A ramaze or sinatra do what you want out of the box. They can run some code and render a response to a request.
<apeiros> most of my projects in rails start out with a single "Pages" controller which just evaluates a view from its directory. but that's for "sketching", or "mocking".
<adaedra> Well you're used to working some way, so it's not that easy to move to another way, it's normal
esObe has quit [Ping timeout: 268 seconds]
<tynamite> Can I run multiple ruby apps on the same port and have different apps in different subfolders, all running, if I use phusion passenger?
esObe has joined #ruby
esObe has quit [Read error: Connection reset by peer]
<adaedra> yes
<tynamite> good, it's a shame passenger isn't compatible with windows
bkxd has quit [Ping timeout: 255 seconds]
<ljarvis> get a vm
<tynamite> I tried to install vagrant but it doesn't work on my windows laptop
<adaedra> or use the linux subsystem
<ljarvis> nginx has a windows version
esObe has joined #ruby
djbkd_ has quit [Remote host closed the connection]
mooser has quit [Ping timeout: 258 seconds]
<manveru> https://caddyserver.com/ is pretty damn good too and works on all platforms
<ljarvis> yeah caddy is great
<adaedra> also, for development, you don't need passenger, just use webrick
mikecmpbll has joined #ruby
<tynamite> noob question, does caddy work with ruby?
<apeiros> manveru: got woken up by "ramaze"? :D
<adaedra> If it can proxy to another HTTP server then yes
<ljarvis> tynamite: it's a web server, so it has nothing to do with ruby. you forward requests from caddy to your own ruby web processes
<tynamite> Ramaze hasn't been updated in years.
<ljarvis> so it's just a proxy
<manveru> apeiros: yeah
<manveru> tynamite: exactly, so use something else
StoneCypher has joined #ruby
bkxd has joined #ruby
<dminuoso> ljarvis | get a vm
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> Did I just hear "get docker" ?
<dminuoso> :-P
<ljarvis> it was more polite than "get away from windows"
StoneCypher has quit [Ping timeout: 252 seconds]
acalycine has quit [Quit: bye]
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
<tynamite> This makes me feel like buying a mac so I can run passenger on the mac
<ljarvis> no dont do that
<ljarvis> what do you need passenger for?
<adaedra> You don't *need* passenger
manjaro-kde5 has quit [Remote host closed the connection]
<tynamite> I might be making a client's site in ruby, so they'll need passenger hosting to run the site instead of a regular php web host, and I would like passenger on my computer for safekeeping so I can duplicate the site on my laptop
ledestin has quit [Read error: Connection reset by peer]
lenwood has joined #ruby
ledestin has joined #ruby
astrobunny has quit [Ping timeout: 255 seconds]
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
AcidRain has left #ruby ["Leaving"]
<tynamite> thank you for the advice!
mim1k has quit [Ping timeout: 240 seconds]
lenwood has quit [Ping timeout: 245 seconds]
domgetter has quit [Ping timeout: 258 seconds]
<dminuoso> tynamite: Use docker.
lenwood has joined #ruby
<ljarvis> "they'll need passenger hosting" but why? :/
<tynamite> I'm downloading it now.
<ljarvis> :|
* dminuoso pokes ljarvis with a Ruby 1.9.3 stick
<dminuoso> Take that.
<tynamite> I pay $85 a year to mellowhost for hosting and I asked them to install phusion passenger so I can run ruby there and they refused so now I need to look for a good passenger web host.
<dminuoso> See, I just avoid passenger.
<tynamite> dreamhost sounds good, they believe in freedom of speech, they refused to stop hosting muhammed cartoons
hutch34_ has joined #ruby
<tynamite> dreamhost uses passenger
<cerulean> nginx + puma + 2.4 !!!!!!!
<dminuoso> For once I agree with cerulean.
<cerulean> linode !!!
<cerulean> :D
<dminuoso> And that's where agreement stops again.
<tynamite> I'm looking into puma right now
<cerulean> what host dminuoso
<cerulean> i like my linode.
<dminuoso> cerulean: I work at an internet service provider.
<cerulean> oh i see haha
<cerulean> i switched from passenger to the stack i just said and never looked back
<cerulean> full websockets support, full concurrency
kassav__ has quit [Remote host closed the connection]
kassav__ has joined #ruby
<dminuoso> tynamite: puma is just simpler in that you need no weird nginx or apache plugins.
<dminuoso> And it can be seamlessly integrated into nginx/apache too.
<cerulean> yes, but use nginx
<cerulean> lol
hutch34_ has quit [Ping timeout: 252 seconds]
hutch34_ has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
esObe has quit [Remote host closed the connection]
kassav_ has joined #ruby
esObe has joined #ruby
kassav__ has quit [Read error: Connection reset by peer]
cfec0b8d has quit [Remote host closed the connection]
vuoto has joined #ruby
esObe has quit [Ping timeout: 252 seconds]
<ddffg> how can i use chruby with sublime?
<dminuoso> ddffg: Say what?
GodFather has joined #ruby
<dminuoso> ddffg: What do you want Sublime to do?
<ddffg> i need exec chruby within sublime
<dminuoso> ddffg: Yeah that ^- then
GodFather has quit [Client Quit]
mazeinmaze_ has quit [Ping timeout: 258 seconds]
rgtk has joined #ruby
<ddffg> chruby: command not found
<ddffg> link above is wrong paste
GodFather has joined #ruby
Sembei has joined #ruby
mooser has joined #ruby
sepp2k has joined #ruby
<tynamite> I'm running my ramaze app with puma, and it's running on tcp:// instead of http://
hanmac has quit [Ping timeout: 255 seconds]
t-recx has joined #ruby
mooser has quit [Ping timeout: 258 seconds]
jane_booty_doe has joined #ruby
hanmac has joined #ruby
nebiros has quit [Quit: 🤷‍♂️]
<ytti> apologies for venting, i don't get why python is popular, feels such a dirty language, littered with built-in functions, no way for developer to make educated guess if it's method you want or function
nebiros has joined #ruby
<ytti> list comprehensions are really poor for readability
Fysicus has joined #ruby
<ytti> no way to clearly specify what is internal and what is external api of a c class
<ytti> i wonder what i'd coplain about ruby, if i had first develope in python then ruby
<ytti> right now it seems to me unfathomable how someone could prefer python or ruby, considering how much cleaner and consistent ruby is
<ytti> but surely that is just my own expectations
<Fysicus> I still think C++ is more consistent. ;-)
<ytti> i have nothing against C++
<ytti> but i do have destain for C/C++
<ytti> people who use that notation
<ytti> like what
<ytti> they're entirely different things, knowing one does not imply you know one
<ytti> and those are probably the people who never program in C++, even when they compile in C++
<Fysicus> True.
<ytti> (I have large distain for C though, i don't think anything should be written in it)
<Fysicus> And why is that?
<ytti> i suspect it is major reason why computer security is largely a joke
<ytti> i don't think humans, on average, are capable of writing working code in C
tynamite has quit [Quit: Page closed]
<Fysicus> No, that's more a consequence of lazy programmers and compromises.
Azure has joined #ruby
<ytti> i don't think either view can be proven, and i'm very hesitent to change my mind
<ytti> i don't like blaming people, because we should expect people to perform poorly
<Fysicus> I'm not asking you to change your mind :-)
<Fysicus> I'm also not blaming people.
<ytti> if your method of fixing problem is telling people to do better, you're probably not going to get that problem fixed
<ytti> i suspect if programmer of same skill and motivation writes same program in rust
<Fysicus> It's just a simple fact most software problems are caused by people cutting corners
<ytti> the outcome is higher quality program
<ytti> i'm not arguying it's physically impossible to write good C
<ytti> i'm aruying, people on average won't do it, no matter how much we educate, ask and beg them to
<ytti> so we either change people or we change the tools
<Fysicus> Software development has always been more of an art than a skill.
<Fysicus> Some people have the knack, others don't.
<Fysicus> And of course, a lot of people have different ideas on what clean code looks like.
<ytti> i think only relevant question is, can choice of language produce better quality code, when all other things remain same
<ytti> if answer is yes, then we should use the tool which helps us produce higher quality code
auzty has quit [Quit: Leaving]
ixti has joined #ruby
<toretore> it's incredibly difficult to write correct programs, and very easy to write incorrect ones; a concept that eliminates whole classes of incorrectness without too much of an investment should be welcomed
<toretore> needing 10 years of experience just to be able to write a program that doesn't have security flaws and other critical bugs is a laughable idea
<ytti> when it comes to C, we all the time find catastrophic bugs in well understood code
<ytti> reviewed by best people again and again
<ytti> like the linux udp.c just last week
<toretore> right
<ytti> blaming people for this is cop out
<toretore> c should probably die (i don't actually know it, but i know *of* it)
<ytti> humans will always be humans, and we should expect humans to behave like humans and work around that problem
<ytti> instead of telling them to stop being humans
<ytti> i couldn't agree more
binaryplease has joined #ruby
<Fysicus> As a big C & C++ fan, I hope it won't die
<toretore> i think most sane people are starting to realize this by now
<ytti> i don't include C++ in this bucket at all
<ytti> I think C++ is fine, if person knowns C++ and writes idiomatic C++
<ytti> (i don't, but i know some do)
<Fysicus> I would even say it'll probably outlive ruby and most of the other modern languages
<foxxx0> imho the main problem of C is, that is so extremely flexible and there is unified build and test framework, that would help to better test the code and automatically find buffer overflows and off-by-one errors
<toretore> of course it will, but it doesn't mean it's a good thing
<foxxx0> it can be done, but it's far from easy
<toretore> why bother when there are better alternatives?
<Fysicus> I think it is... What you think as a major problem is one of its strengths
<foxxx0> if the tooling around C was easier, like tooling around ruby, it would be easier to write good code
<ytti> data would be good
<ytti> i wish rust experts would look have CVE's
<ytti> and write article about them
<ytti> with conclusion if or not it would have happened in rust code
<ytti> so that we would have data we can offer managers and decision makers
<ytti> 'x percentage of our security problems would be gone, if we change from C to rust'
<ytti> now i just assume rust produces inherently less buggy code, but i might be wrong
<toretore> i don't even think you can make the argument that c is easier or faster to write, like you can with ruby vs various other langs
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
<ytti> rust is definitely harder to write than c
<ytti> rust is probaby like c++ level complexity
<ytti> i.e. quite high
<ytti> you don't have to understand anything to write seemingly working C
<ytti> you can just start writing
<ytti> but it's pretty hard to brute force your way through idiomatic rust or C++
<toretore> harder to *learn* definitely, but i'm not sure that means harder to write
<ytti> you will end up fighting compiler for long time
<ytti> without educating yourself on the language
<ytti> but i hope/assume once you've invested that time, the code will be inheretnly better quality
<ytti> because some classes of errors are guaranteed by compiler not to happen
<toretore> tbf rust seems to be a really complex language
Fysicus has joined #ruby
Drakx has joined #ruby
rgtk has quit [Ping timeout: 255 seconds]
jameser has quit [Ping timeout: 260 seconds]
<toretore> i think a good analogy is writing concurrent programs with mutable vs immutable state: the language with mutable state is likely to be much more forgiving and less strict, but now you have to understand and always have in mind all the complexities of mutating state concurrently, which is incredibly hard. with the immutable state, all of that just goes away. it may require you to think a little differently, but that's not an inherent
<toretore> drawback
<toretore> *all = most
Drakx has left #ruby [#ruby]
<ytti> i love writing idiomatic OO programs
<ytti> but i hae no intuitive idea of my state
<ytti> so if i run into some memory leaks, very hard to fix
<ytti> i'm kind of hand-waving the problem and just opting not to write long lived processes in OO
Akuma has joined #ruby
StoneCypher has joined #ruby
rgtk has joined #ruby
StoneCypher has quit [Ping timeout: 252 seconds]
tynamite has joined #ruby
<tynamite> hello I'm typing in “ruby script/server” on the command line and a webrick server isn't starting
mooser has joined #ruby
<toretore> give more info
mooser has quit [Ping timeout: 240 seconds]
Akuma has quit [Quit: So long sukkas!]
draxxxeus has joined #ruby
<draxxxeus> Hi, I have a ruby project and i used to use ruby-pkg-tools on Ubuntu 12.04 to build debian out of it. Now in Ubuntu 14.04, the package ruby-pkg-tools is unavailable. What is the correct way to build a debian from a Ruby project now?
Akuma has joined #ruby
<toretore> ?rails tynamite
<ruby[bot]> tynamite: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
pickle_ has joined #ruby
<tynamite> What is the command for starting webrick?
<tynamite> is there one?
draxxxeus has quit [Ping timeout: 260 seconds]
<toretore> tynamite: before you go there, understand that you have to provide more information in order to get any useful response: your code, exactly what happens when you "type ruby script/server"
charliesome has joined #ruby
pickle_ has quit [Read error: Connection reset by peer]
<adaedra> tynamite: I suggest you forget everything you know about web servers and whatnot and just look at a sinatra tutorial with a fresh mind.
<adaedra> it may make things easier than trying to adapt things you search for based on what you know
<toretore> i'm guessing it's someone who downloaded some monster rails app and is trying to run it
pickle_ has joined #ruby
<adaedra> they were asking how to write ruby apps in the old php way
<toretore> i must have missed that
jgt1 has quit [Ping timeout: 240 seconds]
<adaedra> that was more than 2h ago
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
nertzy has quit [Ping timeout: 252 seconds]
Akuma has quit [Quit: So long sukkas!]
jameser has joined #ruby
millerti has joined #ruby
al2o3-cr has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
esObe has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
tynamite has quit [Quit: Page closed]
Pumukel has quit [Remote host closed the connection]
nicesignal has quit [Quit: WeeChat 1.4]
Guest60204 is now known as jdelstrother
jdawgaz has joined #ruby
dasher^0_o has joined #ruby
jdawgaz has quit [Client Quit]
synthroid has joined #ruby
esObe has quit [Ping timeout: 268 seconds]
vuoto has quit [Quit: Lost terminal]
milardovich has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ineb has quit [Quit: leaving]
ldnunes has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.7]
pickle_ has quit [Remote host closed the connection]
pickle_ has joined #ruby
bkxd has quit [Ping timeout: 252 seconds]
bkxd has joined #ruby
GinoManWrx has quit [Quit: Leaving]
biberu has joined #ruby
biberu has quit [Client Quit]
biberu has joined #ruby
al2o3-cr has joined #ruby
pickle_ has quit [Read error: Connection reset by peer]
joelwallis has joined #ruby
epochwolf has quit [Read error: Connection reset by peer]
arquebus has joined #ruby
epochwolf has joined #ruby
pupsicle has joined #ruby
gnufied has joined #ruby
DoubleMalt has joined #ruby
joelwallis has quit []
latemus has joined #ruby
arquebus has quit [Quit: konversation disconnects]
<latemus> i did codecademy's ruby program, and i have done some scripting in ruby since. i want to buy one book which will provide me the opportunity to gain advanced ruby skills. which ruby book should i get
bkxd has quit [Ping timeout: 240 seconds]
lenwood has quit [Quit: Konversation terminated!]
gnufied has quit [Client Quit]
jane_booty_doe has quit [Quit: Leaving]
xenops has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shynoob has joined #ruby
bkxd has joined #ruby
<shynoob> hey guys, I want to start learning the ways of Ruby, thereby preparing myself to play with Rails Framework for web development stuff.. I am complete newbie... please suggest where do I start?:)
<adaedra> ?links
gnufied has joined #ruby
<shynoob> and yah some do's and don't's which ruby professionals over here think.. I should be aware of ... if at all
<adaedra> Lots of things here for Ruby, for Rails I suggest to see with #RubyOnRails
<adaedra> Do: practice and have fun
<shynoob> but someone suggested me before.. that learning programming in general with Ruby before getting acquainted with Rails would be much better!
<centrx> Ruby Monk is not on that list?
Fasort has quit [Remote host closed the connection]
<adaedra> Looks not.
<adaedra> If you want to add a link, make a PR in https://github.com/ruby-community/ruby-community
SCHAPiE has quit [Quit: ZNC - http://znc.in]
xenops has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
howdoi has quit [Quit: Connection closed for inactivity]
SCHAPiE has joined #ruby
esObe has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esObe has quit [Ping timeout: 255 seconds]
Xiti has joined #ruby
Derperperd has joined #ruby
bdonnahue has quit [Ping timeout: 260 seconds]
Qchmqs is now known as Qchmqs_
Qchmqs_ is now known as Qchmqs__
Qchmqs__ is now known as Qchmqs
bkxd has quit [Ping timeout: 260 seconds]
Fasort has joined #ruby
acalycine has joined #ruby
saslam has joined #ruby
jdawgaz has joined #ruby
jrafanie has joined #ruby
ben__ has joined #ruby
FastJack has quit [Quit: leaving]
jrafanie has quit [Client Quit]
jrafanie has joined #ruby
saslam has quit [Read error: Connection reset by peer]
_bet0n has joined #ruby
saslam has joined #ruby
StoneCypher has joined #ruby
jameser has joined #ruby
FastJack has joined #ruby
anotherpi has joined #ruby
<anotherpi> hello
<adaedra> hi
<anotherpi> do you know the seeing_is_believing gem?
<anotherpi> it's very nice (don't know if it's useful in real life…)
StoneCypher has quit [Ping timeout: 240 seconds]
<anotherpi> i am searching for an equivalent for JS
<adaedra> looks like what Xcode has for Swift playgrounds
govg has quit [Ping timeout: 255 seconds]
sepp2k1 has joined #ruby
mooser has joined #ruby
<anotherpi> yep, but centered on Ruby, not on a text editor or IDE
<adaedra> sure
sepp2k has quit [Ping timeout: 240 seconds]
Qommand0r has quit [Quit: WeeChat 1.7]
bkxd has joined #ruby
cpruitt has joined #ruby
Qommand0r has joined #ruby
cpruitt has quit [Client Quit]
<pavelz> erm do ppl know ruby eventmachine here? everywhere it talks about multithreaded multicore support which is sketchy with ruby at best,but nothing said about using eventmachine and em-* gems to create a single listening socket and share it among forked processes. apache style.
<pavelz> old apache
yeticry_ has quit [Ping timeout: 260 seconds]
mooser has quit [Ping timeout: 260 seconds]
<pavelz> oh nm. reactor
yeticry has joined #ruby
cpruitt has joined #ruby
shynoob has quit [Quit: Leaving]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has joined #ruby
bkxd has quit [Ping timeout: 245 seconds]
patarr has joined #ruby
jgt1 has joined #ruby
Xiti has quit [Quit: Xiti]
rgtk has quit [Ping timeout: 260 seconds]
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
jgt1 has quit [Ping timeout: 260 seconds]
DLSteve has joined #ruby
DLSteve has quit [Client Quit]
shinnya has joined #ruby
millerti has joined #ruby
nicesignal has joined #ruby
esObe has joined #ruby
jamesaxl has quit [Quit: WeeChat 1.7]
jdawgaz has joined #ruby
houhoulis has joined #ruby
saslam has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
saslam has joined #ruby
ski7777 has quit [Remote host closed the connection]
solocshaw has joined #ruby
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
govg has joined #ruby
DLSteve has joined #ruby
houhoulis has quit [Ping timeout: 240 seconds]
coatezy has quit [Ping timeout: 255 seconds]
jamesaxl has joined #ruby
ElDoggo has joined #ruby
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
DLSteve has quit [Read error: Connection reset by peer]
coatezy has joined #ruby
joneshf-laptop has joined #ruby
Fasort has quit [Quit: Leaving]
milardovich has quit [Remote host closed the connection]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DLSteve has joined #ruby
sirecote has quit [Quit: "Hang Up"]
tjvc_ has left #ruby ["Leaving"]
cdg has joined #ruby
solocshaw has quit [Ping timeout: 240 seconds]
ResidentBiscuit has joined #ruby
ski7777 has joined #ruby
milardovich has joined #ruby
acalycine has quit [Quit: bye]
milardovich has quit [Ping timeout: 258 seconds]
CloCkWeRX has quit [Quit: Leaving.]
domgetter has joined #ruby
naprimer_2 has joined #ruby
tjvc has joined #ruby
mooser has joined #ruby
mim1k has joined #ruby
tjvc has left #ruby ["Quit: Leaving"]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hinbody-mobile has joined #ruby
hinbody-mobile has quit [Client Quit]
charliesome has joined #ruby
hinbody_mobile has joined #ruby
hinbody_mobile has quit [Client Quit]
al2o3-cr has quit [Ping timeout: 258 seconds]
hinbody_ has joined #ruby
anisha has quit [Quit: Leaving]
narval has joined #ruby
hinbody has quit [Disconnected by services]
hinbody_ has quit [Client Quit]
Xiti has joined #ruby
hinbody has joined #ruby
Fasort has joined #ruby
saslam has quit [Read error: Connection reset by peer]
hotpancakes has joined #ruby
mooser has quit [Remote host closed the connection]
saslam has joined #ruby
__Yiota has joined #ruby
al2o3-cr has joined #ruby
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
<oded> How can I convert a BigDecimal to string without leading zeroes (I don't want to round it though)
mooser has joined #ruby
<oded> BigDecimal("30").something => "30" & BigDecimal("30.5").something => "30.5"
<loincloth> um
saslam has quit [Read error: Connection reset by peer]
ElDoggo has quit [Remote host closed the connection]
<oded> did not expect it to be so hard
saslam has joined #ruby
<havenwood> oded: #to_f and #to_i or #truncate
<oded> havenwood: I don't want to round it, and to_f doesn't remove the leading zero
<havenwood> oded: Oh, i see what you want, gotcha.
<oded> I don't even understand why it put it there
<ljarvis> >> require "bigdecimal"; BigDecimal("30.5").to_s("F")
<ruby[bot]> ljarvis: # => "30.5" (https://eval.in/777744)
nankyokusei has joined #ruby
<oded> it's like a special case because nothing would be added to it if it wasn't a round number
rippa has joined #ruby
d10n-work has joined #ruby
pwnd_nsfw has joined #ruby
<oded> ljarvis: that has failed
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
<ljarvis> oded: do you have a better example of your input than you suggested?
<oded> ljarvis: why do you need a better example?
<oded> require "bigdecimal"; BigDecimal("30").to_s("F")
<ljarvis> you're talking about leading zeroes
<ljarvis> do you mean trailing zeroes?
<oded> >> require "bigdecimal"; BigDecimal("30.5").to_s("F")
<ruby[bot]> oded: # => "30.5" (https://eval.in/777754)
<oded> >> require "bigdecimal"; BigDecimal("30").to_s("F")
<ruby[bot]> oded: # => "30.0" (https://eval.in/777755)
<ljarvis> so you dont mean leading zeroes, ok
<oded> yes, trailing :)
<oded> sorry about that
<ljarvis> well, you either want floating point notation or you dont
<ljarvis> so.. .chomp(".0") ;P
<oded> I don't if it's a round number
<oded> right, did that with a sub but that looks better :)
<ljarvis> but yeah, if you dont want to do math, just chomp the trailing zero
<havenwood> >> require "bigdecimal"; BigDecimal("30").to_s("F").chomp(".0")
<havenwood> nom
<ruby[bot]> havenwood: # => "30" (https://eval.in/777758)
Snickers has joined #ruby
<oded> thanks people
jespada has joined #ruby
jespada has quit [Client Quit]
Xiti has quit [Quit: Xiti]
andmount has joined #ruby
jgnagy has quit [Remote host closed the connection]
jgnagy has joined #ruby
esObe__ has joined #ruby
esObe has quit [Read error: Connection reset by peer]
andmount has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
shinnya has quit [Ping timeout: 240 seconds]
esObe__ has quit [Read error: Connection reset by peer]
esObe has joined #ruby
doublemalt_ has joined #ruby
bigkevmcd has quit [Read error: Connection reset by peer]
bigkevmcd has joined #ruby
ElDoggo has joined #ruby
DoubleMalt has quit [Ping timeout: 240 seconds]
rgtk has joined #ruby
StoneCypher has joined #ruby
polishdub has joined #ruby
dasher^0_o has quit [Ping timeout: 260 seconds]
obzidian has joined #ruby
StoneCypher has quit [Ping timeout: 255 seconds]
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
ForeignBiscuit has joined #ruby
ForeignBiscuit has quit [Max SendQ exceeded]
mooser has quit [Read error: Connection reset by peer]
mooser has joined #ruby
ForeignBiscuit has joined #ruby
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
hotpancakes has quit [Ping timeout: 260 seconds]
ResidentBiscuit has quit [Ping timeout: 255 seconds]
hotpancakes has joined #ruby
mzo has joined #ruby
saslam has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
saslam has joined #ruby
synthroid has quit [Remote host closed the connection]
jrafanie has joined #ruby
jgt1 has joined #ruby
milardovich has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
<ytti> i wonder why this isn't being developed - https://github.com/sconover/wrong/
<ytti> seems like really nice way to test
jgt1 has quit [Ping timeout: 252 seconds]
esObe__ has joined #ruby
esObe has quit [Read error: No route to host]
esObe has joined #ruby
<havenwood> ytti: That is nice indeed. It reminds me of testing in Elixir.
machinew_ has joined #ruby
stupidsenpai has joined #ruby
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
esObe__ has quit [Ping timeout: 268 seconds]
<ytti> havenwood, i'd like to use that, but dunno if i dare to depend on something with so little traction and ~nothing in 3 years
StoneCypher has joined #ruby
<baweaver> Like most of the Net::* libs?
<baweaver> :troll:
amclain has joined #ruby
govg has quit [Ping timeout: 260 seconds]
Fasort has quit [Quit: Leaving]
<mzo> ytti: fork it
lmc has joined #ruby
mikecmpbll has joined #ruby
<ljarvis> I don't see how it's that much different from minitest? assert foo == bar, assert { foo == bar }
<ljarvis> sure the error messages suck unless you use the other helpers like assert_equal, but still
s2013 has joined #ruby
<ytti> yeah, i guess that's the whole selling point, quality of error messages
<ytti> you can use it with minitest
<ljarvis> yeah
<mzo> things like assert_equal are the ugliest thing i've ever seen
<ljarvis> why?
<ljarvis> surely that's a bit hyperbole :)
<mzo> when you need dozens of assert_* variants you know your testing framework is terminally broken
<adaedra> that's syntaxic sugar
<mzo> no it's not
<ljarvis> it's not, unfortunately
<adaedra> yeah, it's an override
synthroid has joined #ruby
<adaedra> but it's just to have a better message, but `assert a == b` works as well
<adaedra> so if you don't want to use them, you don't have too
machinew_ has quit [Ping timeout: 252 seconds]
<adaedra> to
<mzo> yes, but you should get a good message with `assert a == b`
<ljarvis> right, but if you want the messages you do (when don't you want those?) I think that's the argument
<adaedra> sure
<mzo> telling the user to pick the correct assert_* variant is just lazy
marxarelli|afk has quit [Quit: Textual IRC Client: www.textualapp.com]
synthroi_ has joined #ruby
<adaedra> you can't really have an assert() which differentiate between a == b or other boolean returns
<adaedra> without hacking deep in the language, can you
marxarelli has joined #ruby
<ljarvis> yeah it would require monkeypatching
<mzo> why can't my test framework get the location of my assertion in the source code, load and parse the code, and then match the AST against various patterns
<ljarvis> D:
<adaedra> wow
marxarelli has quit [Client Quit]
<ljarvis> I would argue something else is broken if you have to do that
<mzo> why?
<baweaver> you want your specs to take 20x longer?
<adaedra> make it read your mind while you're at it
<ljarvis> especially in a slow language like.. well you know
marxarelli has joined #ruby
<baweaver> adaedra: y'mean like https://github.com/baweaver/clairvoyant ?
<mzo> if it comes down to it, i'd rather just accept the generic message and use plain `assert` everywhere
<ljarvis> i've done that in places
<mzo> having the user choose from all of the assert_* variants feels incredibly wrong
<ljarvis> i mean, if it fails you gotta open up the code any way
<ljarvis> ya lazy hot dog
<mzo> right
andmount has joined #ruby
andmount has quit [Client Quit]
bsartek has quit [Quit: This computer has gone to sleep]
<ljarvis> then again most projects at work (all i think, actually) use rspec
<ljarvis> so *shrug*
<adaedra> so you have to choose between all `to *` instead of all `assert_*` :D
<ljarvis> :D
jgt1 has joined #ruby
synthroid has quit [Ping timeout: 255 seconds]
<ljarvis> yeah but it just infers question? methods, e.g. expect(foo).to include("bar")
jrafanie has joined #ruby
spicerack has joined #ruby
<baweaver> There's always a price to be paid when magic is involved
<adaedra> The simple methods (assert_*) approach is nice to me, as it doesn't pollute the namespace too much (all methods have the same prefix) and are not done by heavilly monkey-patching everything
<ljarvis> tbh i use elixir a lot and really love that just using assert works perfectly, so i do feel spoiled a bit
<baweaver> Haskell :D
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has joined #ruby
mooser has quit [Remote host closed the connection]
<adaedra> Go do your fancy languages in their respective channels
<ljarvis> NO
<adaedra> YES
<adaedra> THIS IS #RUBY
outreachdan has joined #ruby
<ljarvis> RUBY SUX
<ljarvis> jks
<ljarvis> <3
<adaedra> If you mod heard you
<adaedra> If a mod*
<ljarvis> i heard me
chouhoulis has quit [Remote host closed the connection]
<ljarvis> i is mod
<ljarvis> *raises shield*
<baweaver> Mod fight :D
<stupidsenpai> Is there a way for ruby to know which photo is which?
fran_ has joined #ruby
<ljarvis> stupidsenpai: pardon?
<baweaver> stupidsenpai: que?
<adaedra> “between love and bondage” lovely
<stupidsenpai> Like I'm trying to create a smart image finder
<fran_> hi guys, what is the path i should use in my templates to link a css file?
<stupidsenpai> You type in a search result and it gives you accurate results
<hxegon> stupidsenpai: what criteria are you trying to classify the images by?
<ljarvis> oh.. that's.. not a simple challenge to solve, stupidsenpai
<ljarvis> fran_: rails?
<fran_> yes
<ljarvis> ?rails fran_
<ruby[bot]> fran_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<hxegon> search terms?
<baweaver> Just use tagging
<hxegon> stupidsenpai: ^
<ljarvis> ^
<baweaver> anything more in-depth is going to require a doctorate in CS and a lab
<stupidsenpai> Well, I'm searching for naked otters in google images and it's including hairy and hairless otters when I just want hairless otters to show up
<stupidsenpai> I don't want to use tagging
rgtk has quit [Ping timeout: 255 seconds]
fran_ is now known as frankarine
<ljarvis> better get a lab then
<ljarvis> and a lab coat so you fit in
<ljarvis> naked otters
* baweaver wants a lab coat now
<ljarvis> welp
<baweaver> I think we're otterly offtopic now.
<hxegon> uuuuuhg
<ljarvis> stupidsenpai: you want something in ruby that can read an image and differentiate between haired and hairless otters?
<stupidsenpai> Yes
<stupidsenpai> But also different words
<ljarvis> ok someone reboot the internet
<ljarvis> it's broken
<_bet0n> :D
<hxegon> stupidsenpai: It's a really difficult topic, but you should google 'computer vision' and 'image classification' if you want to look into it
<stupidsenpai> Like certain words match with other words
nitric has joined #ruby
<ljarvis> stupidsenpai: this is a really tough thing to solve I'm afraid, do you have ~2 years to work on this?
<ljarvis> perfect
outreachdan has quit [Ping timeout: 255 seconds]
<stupidsenpai> I have time
<hxegon> baweaver: ah, beat me to it
saslam has quit [Read error: Connection reset by peer]
<stupidsenpai> Will people like it if I create something like that
saslam has joined #ruby
<hxegon> If by "create" you mean "improve the state of research on" and by "like" you mean "give you lots of high paying job offers" then yes
<ljarvis> yep, my otter pics are all mixed together and it drives me mad
<stupidsenpai> No I mean find it useful
<stupidsenpai> And use it
<ljarvis> absolutely
<hxegon> yes, absolutely. Google photos does something similar
<ljarvis> remind me in 5 or so years, by that time my image library will be out of control
<baweaver> ....did epochwolf get to you too ljarvis?
<ljarvis> what's a epochwolf
ncthom91 has joined #ruby
<baweaver> best you don't know
kassav_ has quit [Ping timeout: 240 seconds]
<stupidsenpai> I'm going to try to implement a simple one and I hope that people will improve on it
<ljarvis> great
<hxegon> as someone with a history of cringey handles, it sounds like a cringey handle.
<stupidsenpai> This sounds like something a a phd student would do
<hxegon> ding!
petruff has joined #ruby
<stupidsenpai> But I think it'll be fun to do without credit
Ishido has joined #ruby
<ljarvis> hmm
<ljarvis> you think?
<stupidsenpai> I don't know
<stupidsenpai> I think but I'm not so sure
<stupidsenpai> If I knows the answers to such questions I would be already using it
<hxegon> I'd definitely take credit if I were to sink any significant amount of time into it
hotpanca_ has joined #ruby
<hxegon> I'd encourage you to try it out and see if you enjoy the problem. Good to challenge yourself, and that kind of thing looks great on a resume
jaywhawk has joined #ruby
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
negatifze has joined #ruby
Qchmqs has quit [Ping timeout: 260 seconds]
lmc has quit [Remote host closed the connection]
<stupidsenpai> I don't know if I'd ever want to work for a company
hotpancakes has quit [Ping timeout: 258 seconds]
<stupidsenpai> I enjoy having my own
lmc has joined #ruby
<negatifze> So... I'm having the damnedest time trying to find my problem here, could someone please help? The error says I am missing keyword end, but I don't see where. https://pastebin.com/0fLbfVx0
<ruby[bot]> negatifze: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/755455b57eaeb857de2ae462788677b3
<ruby[bot]> negatifze: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
StoneCypher has quit [Quit: Lost terminal]
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
<baweaver> Whitespace is free, use it liberally
jaywhawk has quit []
<negatifze> Ugh, Christ. Sorry guys, disregard my earlier question
<negatifze> Error was in a different fucking file
<baweaver> Also there's some ways to clean up that code.
<baweaver> like: next if line[0] == '#'
lmc has quit [Ping timeout: 268 seconds]
<baweaver> and: current, data = line.split(':'); next unless data
<negatifze> baweaver: Thanks. Actuallym that wouldn't work, since comments can appear at the end of a line also
<baweaver> allows you to unfold from the conditional.
<baweaver> Ah.
strontor has joined #ruby
<baweaver> Then switch it back to the regex and it'll still work
<baweaver> next is handy for skipping an iteration of a loop
<negatifze> baweaver: Thank you though for taking a look. I think I solved my problem
<baweaver> use it to break out early instead of wrapping things in conditionals, it leads to a lot deeper indentation
<adaedra> if not -> unless
<negatifze> baweaver: Spent 45 minutes looking for the missing { or end, the error was in a different file... Doh
<baweaver> happens
<baweaver> you can blame monday too
<baweaver> adaedra: in that case just `if data`
<adaedra> That's what I was thinking too, but technically you're changing behavior for false.
<baweaver> fair fair.
petruff has quit [Quit: WeeChat 1.7]
<adaedra> which shouldn't happen in this code tho.
tristanp_ has quit [Read error: Connection reset by peer]
<baweaver> Also line 22 will break negatifze
petruff has joined #ruby
<baweaver> $current is different than current
tristanp has joined #ruby
<negatifze> baeaver: Yeah, I caught that. Was originally using a global, changed it to local
<adaedra> "#{...}" is uneeded
<baweaver> that, and return on line 41 is unneeded
stupidsenpai has quit [Quit: Mutter: www.mutterirc.com]
<adaedra> 33: delta[dat[0].strip] = dat[1].strip
lmc has joined #ruby
<negatifze> Good points guys. Good points.
<negatifze> However I'll leave the return.
<adaedra> You're testing twice for presence of :
<negatifze> Doing a project, doubt the grader is familiar with ruby, so I'll leave that for clarity
<baweaver> Also the case can be gotten rid of
<adaedra> l.14, since you are inside `if a.include? ':'`, you will have something in line_array[1]
<baweaver> if you take most of those collections and demote them into a hash....
<baweaver> actually, you have a sample input file?
<adaedra> also, be careful that if you have more than one : in a line, everything starting at the second : will be thrown out
<negatifze> :) Sorry guys, not concerned at the moment with the most concise code or perfect input validation. Can assume for the time being that all inputs will be correct
<baweaver> but we want to live vicariously through your assignments D:
<negatifze> :D
<baweaver> If you do want an idea of the concise version though, let us know.
<baweaver> I have a bad habit of doing that
<negatifze> baweaver: Yeah, I used Ruby quite a bit at an internship awhile back, and everyone was obsessed with "The Ruby Way", Sandi Metz, etc.
<negatifze> Haven't touched the language for awhile, but this project is a good fit for it
<baweaver> ....you're not from Missouri are you?
<negatifze> baweaver : Nope
<baweaver> Ah.
<baweaver> I knew a few companies with Ruby internships there, one was super religious about it.
<negatifze> I think "the ruby way" and Sandi Metz are common elements with ruby shops
<negatifze> Personally I think it doesn't really matter, but... whatever
<adaedra> never heard of that.
<baweaver> The Ruby Way is a bit of a tome honestly
<baweaver> Eloquent Ruby is a bit more concise.
Guest96 has quit [Remote host closed the connection]
<baweaver> Metz has some good points across the board, but noted in one of her talks that the 5-line method rule was more of a harsh set for a particularly bad company
<baweaver> See also the book list in the channel topic.
<negatifze> Oh, from what I've read she has some great ideas
ramfjord has joined #ruby
<negatifze> I think some people can be a little to anal about conforming to her practices
Guest96 has joined #ruby
<baweaver> just wait until you discover style guides.
agent_white has joined #ruby
<baweaver> tip: code reviewers who have nothing to add but style comments are typically seen as very junior
mooser has joined #ruby
<obzidian> i think sometimes people lose focus on what style guides and best practices recommendations are meant for
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<obzidian> Metz did mention that the rules laid out are kind of a guideline to avoid straying off the beaten path
<obzidian> however when you're experienced enough, you tend to develop that instinct for knowing when and when not to stray
<negatifze> in general I think the best practices are great, and should be adhered to... But at this place, my impression was that the code base was absurdly over-complicated, with layers and layers of abstractions to dig through. And you're about THIS? :)
<baweaver> just make the linter break the build, and that fixes most everything.
<agent_white> Mornin' folks
<baweaver> alo
<baweaver> 'Any fool can make something complicated. It takes a genius to make it simple.'
centrx has quit [Remote host closed the connection]
<obzidian> negatifze: in general best practices became best because they fit 90% of the requirements for a project
<obzidian> :P
mooser has quit [Ping timeout: 260 seconds]
<obzidian> baweaver: is that in refernce to making things unnecessarily abstracted?
<baweaver> yep
<obzidian> lol glad i'm not alone
<baweaver> premature abstraction is the root of all evil
<negatifze> Amen!
<obzidian> i've always found abstraction for the sake of abstraction to be a main cause for code becoming messy and easy to break in the first place
<baweaver> or: Too DRY makes things BRITTLE: Badly refactored into tiny things lacking expressiveness
<obzidian> too much abstraction = not so friendly to change (most of the times)
<negatifze> baweaver:That's great :) Never heard of BRITTLE
davidmichaelkarr has joined #ruby
<negatifze> I'll use that
<baweaver> I made it a few years back
<baweaver> because acronyms and fun
<baweaver> somewhere forever ago on Twitter under keystonelemur
Xiti has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
<baweaver> because baweaver there is some sorority girl who's very confused about tech recruiters wanting her number
pilne has joined #ruby
Bock has quit [Read error: Connection reset by peer]
synthroid has joined #ruby
petruff has quit [Quit: WeeChat 1.7]
petruff has joined #ruby
strontor has quit [Quit: Leaving]
synthroi_ has quit [Ping timeout: 240 seconds]
saslam has quit [Read error: Connection reset by peer]
patarr_ has joined #ruby
shinnya has joined #ruby
frankarine has quit [Quit: Page closed]
saslam has joined #ruby
ensyde has quit [Ping timeout: 255 seconds]
rakm has joined #ruby
patarr has quit [Ping timeout: 252 seconds]
<hxegon> that's one strategy to avoid them :)
saslam has quit [Read error: Connection reset by peer]
saslam has joined #ruby
stupidsenpai has joined #ruby
__Yiota has joined #ruby
<cerulean> i fucking hate cybercoders
<cerulean> btw
<cerulean> <3
chouhoulis has joined #ruby
Fasort has joined #ruby
<baweaver> cerulean: offtopic?
saslam has quit [Read error: Connection reset by peer]
patarr_ has quit [Ping timeout: 240 seconds]
saslam has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stupidsenpai has quit [Ping timeout: 240 seconds]
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
patarr has joined #ruby
govg has quit [Ping timeout: 260 seconds]
Xiti has quit [Quit: Xiti]
loincloth has quit []
_bet0n has quit [Ping timeout: 240 seconds]
howdoi has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
binaryplease has quit [Quit: binaryplease]
__Yiota has joined #ruby
FoX_77 has joined #ruby
patarr has quit [Ping timeout: 258 seconds]
milardovich has quit [Remote host closed the connection]
patarr has joined #ruby
milardovich has joined #ruby
duderonomy has joined #ruby
FoX_77 has quit [Client Quit]
<cerulean> baweaver: sorry. saw recruiters mentioned
<cerulean> got triggered
milardovich has quit [Ping timeout: 240 seconds]
Cohedrin has joined #ruby
saslam_ has joined #ruby
saslam has quit [Ping timeout: 240 seconds]
phoo1234567 has joined #ruby
govg has joined #ruby
planigan has quit [Ping timeout: 260 seconds]
__Yiota has quit [Quit: Textual IRC Client: www.textualapp.com]
__Yiota has joined #ruby
cfec0b8d has joined #ruby
destructure has quit [Quit: Lost terminal]
kies has quit [Ping timeout: 260 seconds]
domgetter has quit [Ping timeout: 240 seconds]
hkdsun has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
ElDoggo has quit [Remote host closed the connection]
ElDoggo has joined #ruby
planigan has joined #ruby
ElDoggo has quit [Remote host closed the connection]
ElDoggo has joined #ruby
bungoman_ has joined #ruby
naprimer_2 has quit [Ping timeout: 240 seconds]
kies has joined #ruby
cdg has quit [Ping timeout: 260 seconds]
naprimer_2 has joined #ruby
bungoman has quit [Ping timeout: 240 seconds]
mooser has joined #ruby
esObe has quit [Remote host closed the connection]
esObe has joined #ruby
hotpanca_ has quit []
j2k has joined #ruby
mim1k has joined #ruby
Guest96_ has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest96 has quit [Ping timeout: 260 seconds]
__main__ has quit [Read error: Connection reset by peer]
mooser has quit [Ping timeout: 258 seconds]
_main_ has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
bsartek has joined #ruby
_main_ is now known as __main__
xall has joined #ruby
marxarelli is now known as marxarelli|afk
petruff has quit [Quit: WeeChat 1.7]
chouhoul_ has joined #ruby
petruff has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
nankyokusei has quit [Remote host closed the connection]
hkdsun has quit [Quit: hkdsun]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 260 seconds]
hkdsun has joined #ruby
hkdsun has quit [Client Quit]
solocshaw has joined #ruby
KnownSyntax has quit [Ping timeout: 258 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xall has quit [Quit: WeeChat 1.7]
ltem has joined #ruby
ltem has left #ruby [#ruby]
jusa has joined #ruby
lyy has joined #ruby
<lyy> I got an error message
mzo has quit [Ping timeout: 240 seconds]
xMopxShell has quit [Ping timeout: 246 seconds]
ptx0 has quit [Ping timeout: 258 seconds]
bheesham has joined #ruby
<lyy> I've tried to install new version of ruby. After, I installed it.
<lyy> ruby -v ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
<lyy> It wasn't updated to the latest version. what should I do
jakkn has joined #ruby
<lyy> thanks
Fasort has quit [Quit: Leaving]
t-recx has quit [Quit: t-recx]
<lyy> I've tried to set up rails on my Macbook Air
ledestin has joined #ruby
swills has quit [Ping timeout: 258 seconds]
Fasort has joined #ruby
swills has joined #ruby
xMopxShell has joined #ruby
lmc has quit [Remote host closed the connection]
lmc has joined #ruby
ptx0 has joined #ruby
hutch34_ has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
lmc has quit [Ping timeout: 268 seconds]
bheesham has quit [Quit: leaving]
lmc has joined #ruby
Arpanet69 has joined #ruby
mooser has joined #ruby
<cerulean> thank you for linking my liege
<cerulean> Sir Ryan
outreachdan has joined #ruby
solocshaw has quit [Ping timeout: 245 seconds]
mooser has quit [Ping timeout: 240 seconds]
petruff has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Remote host closed the connection]
ferr has joined #ruby
hutch34_ has joined #ruby
chouhoulis has joined #ruby
lyy has quit [Quit: Page closed]
milardovich has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
__Yiota has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
jusa has quit [Ping timeout: 240 seconds]
exchgr has quit [Ping timeout: 240 seconds]
dasher^0_o has joined #ruby
cr3 has joined #ruby
<cr3> if I have "module Foo" contain "extend Bar" and then I set "Foo::VAR = 1" and it seems that the methods defined in Bar can't see VAR, is there a way for Bar to see VAR somehow?
mim1k has joined #ruby
jgt2 has joined #ruby
ahrs has quit [Remote host closed the connection]
jgt1 has quit [Ping timeout: 255 seconds]
ahrs has joined #ruby
doublemalt_ has quit [Quit: Leaving]
machinewar has joined #ruby
KnownSyntax has quit [Quit: No Ping reply in 180 seconds.]
KnownSyntax has joined #ruby
<cerulean> Radar: you should fork ceruversion and change the name and the divident to 1000 and call it ryanversion and make it free for open source users (it already is but stipulate this so they will use it)
<cerulean> that way rails will have a reasonable version number, like 35.6
marcdel has joined #ruby
hinbody has quit [Quit: leaving]
<baweaver> cerulean: completely off topic.
<baweaver> having a hard time not seeing you as a troll
jdawgaz has joined #ruby
jakkn has left #ruby [#ruby]
govg has quit [Ping timeout: 260 seconds]
govg has joined #ruby
ForeignBiscuit has quit [Read error: Connection reset by peer]
patr0clus has joined #ruby
milardovich has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
mooser has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yqt has joined #ruby
jrafanie has joined #ruby
Xiti has joined #ruby
jud^ has joined #ruby
jud has quit [Ping timeout: 260 seconds]
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryan_notabot has quit [Ping timeout: 268 seconds]
ryan_notabot has joined #ruby
Lucky_ABA has joined #ruby
ryan_notabot has quit [Remote host closed the connection]
haylon has joined #ruby
ryan_notabot has joined #ruby
Verity has joined #ruby
<Verity> still loving ruby
milardovich has quit [Remote host closed the connection]
jnj has joined #ruby
<jnj> Hey y'all, does anyone have any tips for printing out the root to leaf paths of a non-binary tree? The structure of my nodes is basically a variable for data and an array that represents the children of that node.
milardovich has joined #ruby
chouhoul_ has joined #ruby
<Verity> data structrues hw in ruby? awesome
<Verity> so you represent your tree in an array?
ResidentBiscuit has joined #ruby
<jnj> Nah not data structures hw in ruby, just doing some programming questions ( I would love if my data structures class was in ruby )
<Verity> mine was c++ :)
<Verity> so is this really a tree you have?
<jnj> My tree is represented via Nodes. Nodes have node.data, and node.children, where node.children is just an array of nodes. So to add a child to a parent node I do node.children << Node.new
<Verity> but traversing this tree is proving problematic?
<jnj> My code works perfectly in building up my tree, I'm just messing up on printing out that tree.
chouhoulis has quit [Ping timeout: 240 seconds]
<jnj> Traversing it isn't actually that hard, I'm just missing out on reprinting parents
enterprisey has joined #ruby
<jnj> Here's an example structure (root -> a -> b -> c), (root -> d -> e -> f) (d -> g -> h)
<jnj> And I'd want it to print out: a b c, d e f, d g h, but it'll do a b c, d e f, g h (so missing printing d a second time)
enterprisey has quit [Client Quit]
jgt2 has quit [Ping timeout: 268 seconds]
jgt2 has joined #ruby
<al2o3-cr> jnj: i'd try and help but i've had to many zubr :(
<jnj> alzo3-cr: zubr?
<al2o3-cr> jnj: might be worth gisting your code
machinewar has quit []
<jnj> al203-cr: Is using something else besides gist alright? I don't like gist that much
ddffg has quit [Quit: Leaving]
t-recx has joined #ruby
synthroid has quit []
<al2o3-cr> jnj: i suppose so yeah
<al2o3-cr> try not to use pastebin.com though
<jnj> al203-cr: Word, Ill probably post in a little bit I want to spend more time on this problem. What's wrong with pastebin?
<al2o3-cr> ads
<jnj> al203-cr: Also, is passing blocks beneficial for recursion?
<jnj> I don't know a lot about blocks but I saw someones print for a tree online using blocks
<al2o3-cr> jnj: tab complete my nick
<al2o3-cr> also, blocks is a whole different thing
<al2o3-cr> jnj: you learning ruby?
<jnj> al2o3-cr, thanks I dind't know I can do tab complete for nicknames
<al2o3-cr> jnj: that quite alright
<jnj> al2o3-cr, I know a bunch of ruby, I've been working on a rails app thats going into prod, I just don't know much about yield and using & with passing blocks
<al2o3-cr> jnj: you need to learn ruby first (to the best of your ability)
<al2o3-cr> before jumping on rails
<al2o3-cr> it's a fundemental building block
solocshaw has joined #ruby
<Verity> hes already written a rails app that is gooing into prod.
<Verity> no need to learn ruby now =P
<baweaver> See the topic for a book list, but Eloquent Ruby is a good read
<Verity> (I'm jk)
<baweaver> Verity: ...
<jnj> al2o3-cr, I'd say I know ruby fairly well, I've read large portions of eloquent ruby and well-grounded rubyist, and have coded data structures and algs using ruby. I've read about blocks a ton of times, I;m just not sure how they work
<Verity> my point is, very often we see this in reverse
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<jnj> baweaver: eloquent ruby is goat
cloaked1 has quit [Quit: leaving]
<jnj> Verity: I learned ruby first before jumping into rails. I initially wanted to learn ruby just for rails, but then I just fell in love with ruby because its a dope progamming langauge
<baweaver> As far as Ruby blocks, search around Google for a bit for detailed tutorials. There are a few good ones out there. I think RubyMonk had a few.
<jnj> oki
<baweaver> see if I can find a good one or two
<baweaver> if not I'll just write one.
bsartek has quit [Quit: Quitte]
<al2o3-cr> just amazes me how one can deploy a rails app for production and not fully understanding the magic which is blocks
<al2o3-cr> jnj: not slagging you off or anything :)
<jnj> al2o3-cr, haha no I got you. I know that blocks are super important within the structure of rails
<jnj> al2o3-cr, and i believe singleton methods too, i think?
<baweaver> jnj: what other languages have you done?
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver> / worked with
mooser has quit [Remote host closed the connection]
mooser has joined #ruby
<al2o3-cr> jnj: singleton methods are just instance methods upon the class definition
<baweaver> because if Javascript is in there then: [1,2,3].map { |v| v * 2 } ~ [1,2,3].map(function (v) { return v * 2; }) ~ [1,2,3].map(v => v * 2)
Guest96_ has quit [Remote host closed the connection]
hutch34_ has quit [Ping timeout: 260 seconds]
<jnj> baweaver: I've done java, php, I'm real bad with javascript haha. I only use it when I need to move divs around
Rodya_ has quit [Remote host closed the connection]
<al2o3-cr> baweaver: you forgot the semicolon :P
Guest96 has joined #ruby
<baweaver> There's one in there, the other two are taken care of with ASI
<al2o3-cr> no you didn't (my eyes)
Guest96 has quit [Remote host closed the connection]
jamesaxl has quit [Quit: WeeChat 1.7]
cdg has joined #ruby
Guest96 has joined #ruby
Rodya_ has joined #ruby
hutch34_ has joined #ruby
<jnj> But anyway basically I'm trying to print out a tree like structure using the logic here: http://www.geeksforgeeks.org/given-a-binary-tree-print-out-all-of-its-root-to-leaf-paths-one-per-line/. So far it's working well, except instead of printing out (and with each one on a new line) [a, b, c][d, e, f][d, e, g] it just keeps on adding the the array, so the output becomes [a, b, c][a, b, c, d, e, f][a, b, c, d, e, f, g, h]
<jnj> But I think my understanding of the problem is wrong
<Verity> is it really a tree?
<baweaver> where was your code on that?
<jnj> I can post my code
chouhoul_ has quit [Remote host closed the connection]
<baweaver> yeah, throw it in a gist or something
<baweaver> probably you're mutating the array in an odd way.
chouhoulis has joined #ruby
Rodya_ has quit [Ping timeout: 255 seconds]
Rodya_ has joined #ruby
<jnj> Is pastebin alright or nah? I dislike gist
<baweaver> the bot will nag you
bsartek has joined #ruby
<jnj> whoops, I just realized i gotta meet with someone so I can't really work on this now :(
<jnj> I'll probably show up later tho
jgt2 has quit [Quit: WeeChat 1.4]
<jnj> thanks for all of your help y'all
jnj has quit [Quit: Leaving]
jgt has joined #ruby
__Yiota has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KnownSyntax has quit [Ping timeout: 240 seconds]
zcrawfor has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
<al2o3-cr> why does `ObjectSpace::InternalObjectWrapper.new/allocate` seg fault?
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgtk has joined #ruby
DLSteve has joined #ruby
<al2o3-cr> on ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* baweaver does not have the requisite C knowledge to know
ldnunes has quit [Quit: Leaving]
enterprisey has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
anotherpi has quit [Remote host closed the connection]
agent_white has joined #ruby
<al2o3-cr> Pointer[Pointer[dlwrap ObjectSpace.reachable_objects_from(Array)[7]].ref[0,4].unpack1('l')].to_value # this shouldn't happen
marcdel has quit [Ping timeout: 240 seconds]
zcrawfor has quit [Quit: ChatZilla 0.9.93 [Firefox 52.0.2/20170323105023]]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<al2o3-cr> why that segfaults is beyond me
KnownSyntax has joined #ruby
pppktz has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
marxarelli|afk is now known as marxarelli
saslam_ has quit [Quit: Leaving]
cdg has quit [Remote host closed the connection]
jamesaxl has quit [Quit: WeeChat 1.7]
cdg has joined #ruby
jusa has joined #ruby
Fasort has quit [Quit: Leaving]
ozcanesen has joined #ruby
Verity has quit [Remote host closed the connection]
ColeHub has joined #ruby
<al2o3-cr> >> require 'fiddle'; require 'objspace'; include Fiddle; Pointer[Pointer[dlwrap ObjectSpace.reachable_objects_from(Array)[7]].ref[0,4].unpack('l')[0]].to_value
<ruby[bot]> al2o3-cr: # => #<InternalObject:0x41683620 T_IMEMO> (https://eval.in/777998)
Fasort has joined #ruby
<al2o3-cr> hmm, strange
<ytti> seeing require 'objspace' in code is much like friend popping uninvited with bottle of vodka
<ytti> you know you're headed for an adventure
<al2o3-cr> ytti: that is expected results though
<al2o3-cr> >> RUBY_VERSION
<ruby[bot]> al2o3-cr: # => "2.3.0" (https://eval.in/777999)
<al2o3-cr> on 2.4.0p0 it segfaults
jusa has quit [Ping timeout: 240 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
marr has joined #ruby
mooser has quit [Remote host closed the connection]
antgel has joined #ruby
elifoster has joined #ruby
patr0clus has quit [Ping timeout: 268 seconds]
sepp2k1 has quit [Read error: Connection reset by peer]
exchgr has joined #ruby
Azure has quit [Quit: Oops.]
Azure has joined #ruby
millerti has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
biberu has quit []
solocshaw has quit [Ping timeout: 255 seconds]
br0d1n has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
HoierM has joined #ruby
pupsicle has quit [Quit: pupsicle]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
HoierM has quit [Max SendQ exceeded]
HoierM has joined #ruby
cfec0b8d has quit [Remote host closed the connection]
moei has quit [Quit: Leaving...]
haylon has quit [Remote host closed the connection]
postmodern has joined #ruby
jdawgaz has joined #ruby
obzidian has quit [Quit: leaving]
polishdub has quit [Quit: Leaving]
<cerulean> sorry you can't take my zany insane somewhat math and programming based weirdo humor baweaver
ResidentBiscuit has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Remote host closed the connection]
<cerulean> i'm very curious about what makes a non-integer, high version number so unappealing tho
<cerulean> i make a very good argument for how rails is version 36.5
patr0clus has joined #ruby
coatezy has quit [Ping timeout: 252 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
Fasort has quit [Quit: Leaving]
Arpanet69 has quit [Ping timeout: 258 seconds]
<al2o3-cr> cerulean: hey?
bsartek has quit [Quit: This computer has gone to sleep]
<cerulean> hey whats up al2o3-cr
<al2o3-cr> cerulean: just wondering what you are talking about tia
skweek has joined #ruby
<cerulean> a very bad versioning program i wrote in crystal
<cerulean> it is very bad and sinful. but not evil. to add more insult to injury, it's a far ass 2mb program that's like probably not much more than 25 lines of code
<cerulean> fat ass*
<cerulean> ceruversion: YOU WHALE !!!!
<cerulean> ask crystal designers to make llvm compilation slim as fuck
<cerulean> <3 crystal
<al2o3-cr> O 0_o
<al2o3-cr> i was gonna diddle in crystal but never persued
_bet0n has joined #ruby
<cerulean> use the force, luke
<_bet0n> Hello folks! :) I have a question. How can I properly replace a regexp match with variable value?
<_bet0n> I tried the regexp on Rubular and it worked flawlessly
<_bet0n> For example there is a string containing a substring like 6000K for which I should use /\d{4}K as a regular expression if I understand it correctly.
<cerulean> #{} ?
<_bet0n> Is it that simple?
<cerulean> hold on
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cerulean> i said wrong
<cerulean> "foo".gsub(/(o+)/, '\1\1\1')
<cerulean> gsub will do it
<cerulean> oh
<cerulean> i see your question now
<cerulean> ruby version might be wrong. try setting ruby version on rubular
cdg_ has joined #ruby
<_bet0n> I am using the highest version available there. 2.1.5
antgel has quit [Ping timeout: 255 seconds]
jcao219 has joined #ruby
<cerulean> ruby 2.4 is the latest ruby. so their expressions might be too old and not work anymore
lxsameer has quit [Quit: WeeChat 1.5]
<Radar> _bet0n: What is your input and expected output?
<al2o3-cr> _bet0n: use parens
<cerulean> best idea is to use 2.4 regex manual ... and irb. and listen to radar ;)
* cerulean exits stage left
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
cdg has quit [Ping timeout: 240 seconds]
<_bet0n> Radar: so input is for example "LED Bulb E17 4W A60 6000K" and expected output is "LED Buld E17 4W A60 Cold White"
cdg_ has quit [Ping timeout: 240 seconds]
<Radar> _bet0n: Right. Thanks. Give me a moment.
<_bet0n> Radar: String "Cold White" is stored in a light_color variable
<Radar> >> light_color = "Cold White"; "LED Bulb E17 4W A60 6000K".gsub("6000K", light_color)
<ruby[bot]> Radar: # => "LED Bulb E17 4W A60 Cold White" (https://eval.in/778035)
<Radar> ?next
<ruby[bot]> Radar: I don't know anything about next
<Radar> ruby[bot]: oh my god.
<al2o3-cr> i was thinking something totally diff
<_bet0n> Radar: Yeah but I am trying to use regexp because they both change with product. The value in Kelvins in the string and light colour as well
<_bet0n> Value is always 4 digits ending with capital K
<baweaver> Look at the block form of gsub
<baweaver> &ri gsub
<al2o3-cr> _bet0n: yeah use \d{4} then
rakm has joined #ruby
<Radar> ^
mikecmpbll has quit [Quit: inabit. zz.]
ryan_notabot has quit [Ping timeout: 240 seconds]
<_bet0n> Thank you. Let me have a look. I have to find a solution :D
<al2o3-cr> use sub if you don't want to globally substitute
ryan_notabot has joined #ruby
jgnagy_ has joined #ruby
<al2o3-cr> meaning every occurence in the string
jgnagy has quit [Ping timeout: 260 seconds]
Fasort has joined #ruby
mooser has joined #ruby
sumobob has joined #ruby
milardovich has quit []
<_bet0n> Ok. Thank you for help guys. As usual it was all my fault. I just forgot to use proper escaping in regular expression and I used gsub! instead of gsub :D Now it works flawlessly :)
<_bet0n> title.gsub(/\d{4}K/, light_color).to_s does the trick :)
<_bet0n> Anyway. Thank you all I appreciate your kindness :)
esObe has quit [Remote host closed the connection]
<al2o3-cr> _bet0n: why .to_s?
esObe has joined #ruby
<_bet0n> It might be because it is a nokogiri node I am working with
<_bet0n> So Ruby asks for method
<al2o3-cr> _bet0n: gsub only works on strings and returns a string
minimalism has quit [Quit: minimalism]
<_bet0n> I don't know then. Now it works without the method specified
<al2o3-cr> well unless you use the block form, but ...
<_bet0n> I am not using the block form.
mooser has quit [Remote host closed the connection]
elifoster has quit [Remote host closed the connection]
elifoster has joined #ruby
<_bet0n> Just try to understand me. I am still in process of learning Ruby :) Sometimes I get lost :)
jcao219 has quit [Ping timeout: 260 seconds]
plujon has joined #ruby
<al2o3-cr> _bet0n: yeah, no worries :)
<jrm> Newbie questions: Is https://ruby.github.io/openssl/ part of ruby itself or is it a separate gem that needs to be installed? If it is part of ruby, why does the ostatu2 gem list it as a runtime dependency?
outreachdan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esObe has quit [Ping timeout: 255 seconds]
username1 has joined #ruby
coatezy has joined #ruby
patr0clus has quit [Quit: WeeChat 1.4]
r3m has quit [Read error: Connection reset by peer]
r3m has joined #ruby
<havenwood> jrm: OpenSSL is part of the stdlib but has been gemified so it can be updated separately from Ruby releases.
<jrm> havenwood: Great. Thanks. :)
<al2o3-cr> jrm: it's a seperate gem now; the default is what is packaged with ruby
<al2o3-cr> as is tk
r3m has quit [Remote host closed the connection]
* havenwood al2o3-cr: The difference is that tk was gemified and removed from the stdlib: https://bugs.ruby-lang.org/issues/8539
<al2o3-cr> havenwood: ah, TIL
<al2o3-cr> it was so simple to gui though :(
<havenwood> it's a gem: gem install tk
<havenwood> same 'ole tk
<al2o3-cr> of course :)
cr3 has quit [Quit: leaving]
<al2o3-cr> what does everyone else get; `gem list --local | wc -l` # 91
marr has quit [Ping timeout: 252 seconds]
<al2o3-cr> gotta be a > 999
<al2o3-cr> well `printf $(($(gem list --local | wc -l) - 3))`
ziarkaen has joined #ruby
r3m has joined #ruby
HoierM has quit [Remote host closed the connection]
TinkerTyper has quit [Ping timeout: 240 seconds]
TinkerTyper has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
narval has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
yqt has quit [Ping timeout: 260 seconds]
GodFather has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
millerti has joined #ruby
ryan_notabot has quit [Ping timeout: 240 seconds]
jcao219 has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
Lucky_ABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<al2o3-cr> why different results `Socket.gethostbyname('ipinfo.io') == TCPSocket.gethostbyname('ipinfo.io')`
<al2o3-cr> one gives dotted oct notation other the actual sock binary string
KI6ESH has joined #ruby
KI6ESH has left #ruby [#ruby]
Guest16109 has joined #ruby
duderonomy has quit [Ping timeout: 245 seconds]
KI6ESH has joined #ruby
ziarkaen has quit [Quit: Lost terminal]
agent_white has quit [Quit: fukudarkf]
<al2o3-cr> well hton
mooser has joined #ruby
KI6ESH has left #ruby [#ruby]
CloCkWeRX has joined #ruby
Guest96 has quit [Remote host closed the connection]
Lucky_ABA has joined #ruby