baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
themsay has quit [Ping timeout: 268 seconds]
tdy has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
themsay has joined #ruby
AJA4350 has quit [Quit: AJA4350]
DTZUZO_ has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 268 seconds]
bmurt has joined #ruby
ansraliant has joined #ruby
tag has quit [Quit: Connection closed for inactivity]
roshanavand has quit [Quit: leaving]
chouhoulis has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyLobo has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
<ansraliant> morning
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ansraliant> installing gems locally, I have found that in the bin directory the files are names bundler.ruby2.5, which bash doesn't get when I type bundler. I have to add .ruby2.5. Has anyone experience something similar?
SKINC-BMG1 has quit [Quit: « Ë×Çü®§îöñX » Info~[v10B.1.1]~ Released~[Jul 31 2005]~ Channel~[#Excursion on EF.Net]~]
helpa has quit [Remote host closed the connection]
gnufied has quit [Ping timeout: 246 seconds]
helpa has joined #ruby
gnufied has joined #ruby
ansraliant has quit [Quit: My planet needs me]
<havenwood> ansraliant: RubyGems has a --format-executable flag that appends the Ruby version to gem executables, but it'd just add `25` not `.ruby25`.
ansraliant has joined #ruby
gnufied__ has joined #ruby
gnufied has quit [Ping timeout: 252 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
mniip has quit [Ping timeout: 600 seconds]
dmitch has quit [Quit: Textual IRC Client: www.textualapp.com]
kawaicha00s has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 252 seconds]
dinfuehr has quit [Ping timeout: 245 seconds]
dinfuehr has joined #ruby
ta_ has joined #ruby
cagomez has joined #ruby
ua_ has quit [Ping timeout: 252 seconds]
chouhoulis has joined #ruby
gnufied__ has quit [Ping timeout: 252 seconds]
RougeR has quit [Ping timeout: 260 seconds]
gnufied__ has joined #ruby
pskosinski has quit [Ping timeout: 252 seconds]
pskosinski has joined #ruby
orbyt_ has joined #ruby
twe4ked has quit [Ping timeout: 260 seconds]
twe4ked has joined #ruby
ta_ has quit [Ping timeout: 268 seconds]
mrush has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
gnufied__ has quit [Read error: Connection reset by peer]
gnufied__ has joined #ruby
cliluw has joined #ruby
DTZUZU has quit [Ping timeout: 252 seconds]
elphe has quit [Ping timeout: 252 seconds]
esrse has joined #ruby
DTZUZU has joined #ruby
elphe has joined #ruby
cagomez has quit [Remote host closed the connection]
weaksauce has joined #ruby
gnufied__ has quit [Ping timeout: 260 seconds]
rspades_ has joined #ruby
DTZUZO_ has joined #ruby
ivanskie has joined #ruby
tdy has joined #ruby
darkhanb has joined #ruby
rspades_ has quit [Ping timeout: 268 seconds]
dbz has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ivanskie has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
Xeago has quit [Ping timeout: 272 seconds]
dbz has joined #ruby
Xeago has joined #ruby
ivanskie has quit [Client Quit]
braincrash has quit [Quit: bye bye]
ivanskie has joined #ruby
gnufied has joined #ruby
gix has quit [Disconnected by services]
braincrash has joined #ruby
mzo has quit [Ping timeout: 252 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dar123 has joined #ruby
rspades_ has joined #ruby
ivanskie has joined #ruby
ivanskie has quit [Client Quit]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has joined #ruby
ta_ has joined #ruby
kawaicha00s has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kapil____ has joined #ruby
mrush has quit [Ping timeout: 268 seconds]
mr_rich101 has quit [Quit: ZNC - http://znc.in]
dbz has quit [Remote host closed the connection]
mr_rich101 has joined #ruby
dogweather has quit [Ping timeout: 272 seconds]
akem__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
alicef has quit [Ping timeout: 252 seconds]
<i8igmac> when you do loops like {|x|} vs do |x| is there a difference ?
<i8igmac> variables inside of {|x| var=1} are only set inside?
<i8igmac> do not exist outside
alicef has joined #ruby
Tempesta has quit [Ping timeout: 252 seconds]
akem__ has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
Xiti has quit [Ping timeout: 252 seconds]
Exagone313 has quit [Ping timeout: 252 seconds]
<havenwood> i8igmac: the difference between those two forms of blocks is just precedence
Exagone313 has joined #ruby
xall has joined #ruby
ta_ has quit [Ping timeout: 252 seconds]
chouhoulis has quit [Remote host closed the connection]
<i8igmac> ps aux | grep rails => Pid 666
<i8igmac> cant be good
duderonomy has joined #ruby
rspades_ has quit [Ping timeout: 252 seconds]
xall has quit [Quit: xall]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hobbyboy has quit [Ping timeout: 252 seconds]
dellavg_ has joined #ruby
Hobbyboy has joined #ruby
leafyleong has quit [Ping timeout: 272 seconds]
reber has joined #ruby
leafyleong has joined #ruby
dbz has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
troys has quit [Quit: Bye]
dbz has quit [Ping timeout: 268 seconds]
bousquet has quit [Read error: Connection reset by peer]
sauvin has joined #ruby
rspades_ has joined #ruby
mniip has joined #ruby
Xiti has joined #ruby
MoritaShinobu has joined #ruby
dhollinger has joined #ruby
agent_white has quit [Quit: bbl]
tdy has quit [Ping timeout: 252 seconds]
stoffus has joined #ruby
nowhere_man has joined #ruby
cd has quit [Quit: cd]
dar123 has joined #ruby
ta_ has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dbz has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
aupadhye has joined #ruby
MoritaShinobu has quit [Remote host closed the connection]
MoritaShinobu has joined #ruby
PasNox has joined #ruby
clemens3 has joined #ruby
tdy has joined #ruby
phaul has joined #ruby
<za1b1tsu> so I have main.rb, lib/bo.rb, lib/data_service.rb. And main.rb requires bo.rb and data_service.rb, but data_service.rb requires bo.rb as well. Do I put 'require_relative bo' in main.rb but also in lib/data_service.rb so they can be independent? Or just in main.rb. What is the good practise here? Having 'require_relative the_same_thing' looks chaotic
<za1b1tsu> in multiple files I mean
yohji has joined #ruby
aufi has joined #ruby
jinie has joined #ruby
duderonomy has joined #ruby
raulp has quit [Ping timeout: 240 seconds]
idiocrash has joined #ruby
dbz has joined #ruby
Beams has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sameerynho has joined #ruby
idiocrash has quit [Quit: Textual IRC Client: www.textualapp.com]
duderonomy has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
raulp has joined #ruby
Pupeno has joined #ruby
<Pupeno> Are there any guides about how to build Ruby on Windows?
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
al2o3-cr has quit [Quit: WeeChat 2.2]
pskosinski has quit [Read error: Connection reset by peer]
pskosinski has joined #ruby
trif has quit [Ping timeout: 252 seconds]
trif has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
DTZUZO_ has quit [Ping timeout: 245 seconds]
lxsameer has joined #ruby
LiftLeft2 has joined #ruby
LiftLeft has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
LiftLeft2 is now known as LiftLeft
elphe has joined #ruby
sameerynho has quit [Ping timeout: 252 seconds]
ua has joined #ruby
MIR100 has joined #ruby
MIR100 has quit [Remote host closed the connection]
MIR100 has joined #ruby
elphe has quit [Ping timeout: 244 seconds]
Charliebr73 has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
Bish has joined #ruby
<Bish> is there a way to overwrite a method definition without changing the parameters?
<Pupeno> What do you mean by without changing the parameters?
<Bish> well if i don't want to change the behaviour of the method and just "add" things
<Bish> i do def method(*args,&block)
<Bish> which changes the parameter count from x to undefined
<Pupeno> If you are overriding the method you are changing the behaviour of the method. Are you trying to wrap an existing method with your own functionality?
<Bish> something like, i don't want to change the behaviour at all
<Bish> just emit an event when it's called or something
<Pupeno> I'm sorry, I was thinking of replacing the method, not overriding.
yohji has quit [Remote host closed the connection]
<Bish> what's the difference?
<Pupeno> I don't think it's possible to define a method with def and have it have the same arguments as the one in the parent class.
yohji has joined #ruby
<Bish> well it's possible with weird hacks like eval
<Pupeno> In Ruby you can do pretty much whatever you want, so, you can write class Object; def to_s; end; end and re-define the the to_s method in the Object class.
<Bish> yeah you can call super in there, it's pretty much equivalent to inheritance.. isn't it?
<Pupeno> Yes, you can inspect the method in the parent class, find how many arguments it has, and create a new method with the same amount of arguments, but I don't think this is worthy.
<Pupeno> What I just described with Object is not inheritance, it's opening up an existing class and modifying it.
<Bish> but they're pretty much equivalent.. aren't they
<Bish> if not: what's different?
<Pupeno> No. There's no inheritance at play there. The moment you do that, every object in the system will have a new implementation of that method IIRC.
<Pupeno> Inheritance would doing class MyClass < Object ; def to_s....
<Pupeno> So there's a class called MyClass with a to_s method.
<Bish> yeh, i know.. but that's jsut like redeininfg to_s of the class
<Bish> isn't it?
LiftLeft2 has joined #ruby
<Pupeno> It is redefining to_s for that class, yes. It's called monkey-patching and it's generally frowned upon because it's messy and dangerous.
<Pupeno> You can completely ignore it... I just missinterpreted your question as you doing monkey-patching, instead of proper inheritance overriding.
<Bish> oh, i see
rebreak has joined #ruby
LiftLeft2 has quit [Remote host closed the connection]
<Pupeno> Why are you trying to preserve the amount of arguments?
<Bish> just because of error messages,, for example
kapil____ has quit [Quit: Connection closed for inactivity]
<Bish> but i guess i could just through argument errors
<Bish> raises*
<Pupeno> Why not just hard-code the argument and argument names to match the parent's class's method?
<Bish> puuh, because it stops working when the gem gets updated?
<Bish> had this several times
<Pupeno> Yeah, that's what I thought. I see your point.
rafadc has joined #ruby
<Pupeno> If you get *args and then pass it to the method, and it doesn't match the new amount of arguments, do you get an error that's hard to understand? I can't remember.
<Pupeno> Another possibilty is to check, on-load-time, whether the amount of arguments of the parent class is what you expected when writing your code, and if it's not, fail to load your class with a descriptive error message about tweaking the class. Not the same as matching the parent method.
<Pupeno> It's possible there's another solution that I'm forgetting about. I just came back to Ruby after a while.
Nicmavr has quit [Read error: Connection reset by peer]
tdy has joined #ruby
Nicmavr has joined #ruby
nofxx_ has quit [Remote host closed the connection]
<rafadc> The error you get is ArgumentError: wrong number of arguments
elphe has joined #ruby
dogweather has joined #ruby
Puffball has quit [Remote host closed the connection]
wildermind has joined #ruby
Charliebr73 has quit []
<Pupeno> This channel seems very quiet compared to other programming languages. Are Rubists hanging out somewhere else?
<phaul> yeah #elixir :)
* phaul ducks
<Pupeno> hahahaha
<zenspider> Pupeno: it's 2am pacific time... so...
sheepman has quit [Read error: Connection reset by peer]
<Pupeno> zenspider: take a look at #python, 2am pacific time and it's busting with activity.
Mark22kk has joined #ruby
<Pupeno> I know the Python community is biggen than Ruby, but the discrepancy in activity seems bigger, so, I'm wondering if people moved to Slack or something.
Juzzika has quit [Quit: Textual IRC Client: www.textualapp.com]
thebigj has joined #ruby
sheepman has joined #ruby
<zenspider> meh
Mark22kk has quit [Ping timeout: 246 seconds]
phaul has quit [Ping timeout: 252 seconds]
alem0lars has joined #ruby
<thebigj> I am using Jekyll for my blog. I started with Minimal theme provided by them.
<thebigj> I am expecting help to find other ways of finding the theme.
<thebigj> Are there any more visually appearing theme than the default theme?
alem0lars has quit [Remote host closed the connection]
<thebigj> Please share it with me.
<thebigj> Please guide me what are the appropriate ways to find Jekyll themes
<thebigj> Thanks!
<zenspider> thebigj: have you at least googled it?
<thebigj> zenspider: Thanks for the reply. Yes, I did. I am not happy with the ranked sites by Google.
<thebigj> zenspider: Many from there were giving broken themes
ur5us has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
postmodern has quit [Quit: Leaving]
AJA4350 has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
themsay has quit [Quit: Quit]
jkprg has joined #ruby
elphe has joined #ruby
rspades_ has quit [Ping timeout: 244 seconds]
xfbs has joined #ruby
ur5us has quit [Remote host closed the connection]
<Bish> Pupeno: rubyist are actaully working instead of being in chat all the time :p
dogweather has quit [Ping timeout: 252 seconds]
<Bish> and python is busy fixing 2.7 vs 3 issues
<Bish> or unicode
tdy has joined #ruby
n13z_ has quit [Quit: leaving]
TomyLobo has joined #ruby
<za1b1tsu> realistically is there anyway to avoid 'require_relative' duplicates when making a gem?
<zenspider> za1b1tsu: similar to earlier today: if you haven't measured, you don't care.
dbz has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
catphish has joined #ruby
<catphish> i'm trying to stream a large quantity of data to a command using net::ssh, struggling to find an example, does anyone happen to know how to do this?
rspades_ has joined #ruby
AJA4350 has quit [Remote host closed the connection]
AJA4350 has joined #ruby
<Bish> so it's many datas not big data?
roshanavand has quit [Ping timeout: 246 seconds]
<catphish> Net::SSH::Connection::Channel#send_data buffers data to be sent to the channel, which is perfect, but i don't see a callback to let me know when more data is wanted
<Bish> catphish: what are you doing.. invoking a process and want to get it's stdout?
roshanavand has joined #ruby
<catphish> no, i want to send data to its stdin
<Bish> ah. then just do it? i mean.. what are you expecting..
<Bish> something like stdin is ready to get data?
<catphish> well the problem is that i don't want to buffer all the data in RAM at once
<catphish> so i want to send a chunk any time the buffer gets empty
<catphish> so i want to send a chunk, wait for it to clear, then send more
<catphish> i assume things like net::sftp do this somehow
n13z has joined #ruby
<catphish> all the examples i find are just sending really small amounts of data all at once to Net::SSH::Connection::Channel#send_data
themsay has joined #ruby
themsay has quit [Client Quit]
<catphish> ah got it, looks like i can monitor Net::SSH::Connection::Channel#output which is the output buffer on each invocation of #on_process
tdy has quit [Ping timeout: 252 seconds]
rspades has joined #ruby
rspades_ has quit [Ping timeout: 260 seconds]
themsay has joined #ruby
aufi has quit [Ping timeout: 252 seconds]
Kilo`byte has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Kilo`byte has joined #ruby
Tempesta has joined #ruby
roshanavand has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
schneider has joined #ruby
rebreak has quit [Ping timeout: 252 seconds]
schneider has quit [Ping timeout: 260 seconds]
<catphish> yep that works fine :)
<catphish> ch.on_process { |ch| if ch.output.content.bytesize < n ... }
donofrio has quit [Remote host closed the connection]
rwb has quit [Ping timeout: 252 seconds]
kapil____ has joined #ruby
roshanavand has quit [Ping timeout: 252 seconds]
esrse has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
rebreak has joined #ruby
akosednar has quit [Ping timeout: 246 seconds]
aufi has joined #ruby
donofrio has joined #ruby
akosednar has joined #ruby
NL3limin4t0r has joined #ruby
sagax has quit [Read error: No route to host]
rspades has quit [Ping timeout: 252 seconds]
rspades has joined #ruby
rebreak has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
bkxd has quit [Ping timeout: 264 seconds]
dmitch has joined #ruby
dbz has joined #ruby
elphe has quit [Ping timeout: 260 seconds]
bmurt has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
apparition has joined #ruby
darix has quit [Quit: brb]
gnufied has quit [Read error: Connection reset by peer]
gnufied has joined #ruby
darix has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
bkxd has joined #ruby
soniya29 has joined #ruby
soniya29_ has joined #ruby
rwb has joined #ruby
gnufied has quit [Ping timeout: 252 seconds]
gnufied has joined #ruby
wojnar has joined #ruby
nowhere_man has quit [Ping timeout: 246 seconds]
Rapture has joined #ruby
<JJonah> Is there any way to refer to the entire argument hash on a method with named parameters? That is, to avoid the verbose repetition you see on line 14 here: https://hastebin.com/ejufuregaq.rb
elphe has joined #ruby
desperek has joined #ruby
vondruch has quit [Ping timeout: 244 seconds]
aufi_ has joined #ruby
desperek has quit [Disconnected by services]
m27frogy has quit [Quit: ZNC - https://znc.in]
jcalla has quit [Quit: Leaving]
aufi has quit [Remote host closed the connection]
desperek has joined #ruby
ua has quit [Excess Flood]
[spoiler] has quit [Ping timeout: 252 seconds]
ua has joined #ruby
[spoiler] has joined #ruby
m27frogy has joined #ruby
stoffus has quit [Quit: leaving]
phaul has joined #ruby
Azure|dc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
soniya29 has quit [Ping timeout: 260 seconds]
soniya29_ has quit [Ping timeout: 264 seconds]
soniya29_ has joined #ruby
soniya29 has joined #ruby
rspades has quit [Ping timeout: 272 seconds]
roshanavand has quit [Ping timeout: 268 seconds]
roshanavand has joined #ruby
maxmanders has joined #ruby
sameerynho has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rspades has joined #ruby
aupadhye has quit [Remote host closed the connection]
Fr4n has joined #ruby
rippa has joined #ruby
MoritaShinobu has quit [Quit: Leaving]
sameerynho has quit [Ping timeout: 264 seconds]
BloodyMary has joined #ruby
rspades has quit [Quit: WeeChat 1.9.1]
troys has joined #ruby
soniya29 has quit [Quit: Leaving]
soniya29_ has quit [Quit: Leaving]
mn3m has joined #ruby
conta1 has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
dinfuehr has joined #ruby
BloodyMary has quit [Quit: BloodyMary]
tdy has joined #ruby
chouhoulis has joined #ruby
conta1 has quit [Quit: conta1]
dbz has joined #ruby
mikecmpbll has joined #ruby
mn3m has quit [Quit: mn3m]
ivanskie has joined #ruby
kindaskingg has quit [Remote host closed the connection]
conta1 has joined #ruby
ivanskie has quit [Client Quit]
ivanskie has joined #ruby
nowhere_man has joined #ruby
AJA4350 has quit [Quit: AJA4350]
duderonomy has joined #ruby
jcalla has joined #ruby
<canton7> JJonah, that hastebin is empty?
kapil____ has quit [Quit: Connection closed for inactivity]
orbyt_ has joined #ruby
tdy has quit [Ping timeout: 260 seconds]
yohji has quit [Remote host closed the connection]
orbyt_ has quit [Client Quit]
dbz has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
phaul has left #ruby ["WeeChat 2.2"]
phaul has joined #ruby
catphish has quit [Quit: Leaving]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clemens3 has quit [Ping timeout: 245 seconds]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
edwardly has quit [Quit: ??????????]
marz_d`ghostman has joined #ruby
<marz_d`ghostman> My rspec tests has no failures but it says it failed
orbyt_ has joined #ruby
orbyt_ has quit [Client Quit]
duderonomy has joined #ruby
<havenwood> marz_d`ghostman: Gist the output?
<havenwood> JJonah: def foo **input
edwardly has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
<Eiam> havenwood: wouldn't *input work too?
<Eiam> why the double splat
<Eiam> (single splat worked in a quick test here)
<Eiam> double splat doesn't work, says the method expected 0 arguments
duderonomy has quit [Client Quit]
<havenwood> Eiam: I saw "args" and "hash" and just wildly guess. (The hastebin link is empty.)
<havenwood> Wildly guessed* wrong.
<marz_d`ghostman> havenwood: Am I testing my class correctly though? http://termbin.com/n220 http://termbin.com/y7on http://termbin.com/i2w8
<marz_d`ghostman> modified the spec now I'm getting failures on the examples
cd has joined #ruby
mikecmpbll has quit [Ping timeout: 268 seconds]
aufi_ has quit [Ping timeout: 252 seconds]
<cthu|> wow
<cthu|> I hesitate to claim that I found a bug
<cthu|> so I don't
<cthu|> but it looks like it
<cthu|> file.each_line behaves... strangely
<cthu|> it seems to be losing the data
<cthu|> because I have very special lines in that file
<cthu|> more like special new lines
<cthu|> I have two types of new lines
dogweather has joined #ruby
darkhanb has joined #ruby
leitz has joined #ruby
<Eiam> cthu|: the fun thing about software is bugs are more common than we'd like to admit
sameerynho has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
<cthu|> I think I shouldn't use File.each_line... I think I should cast it into a string and split by \r\n and then parse it.
<cthu|> that's an "in-your-face" solution
<cthu|> maybe File has each_custom function
<cthu|> with a parameter to split by
duderonomy has joined #ruby
fluxAeon has joined #ruby
duderonomy has quit [Client Quit]
jkprg has quit [Quit: jkprg]
apparition has quit [Quit: Bye]
<phaul> marz_d`ghostman: one example I spot right away is when rspec is complaining that you expect exception but it was not given a block. You have to give expect a block. Like expect { raise 'some nastiness' }.to raise_error
sgen has joined #ruby
<phaul> a method, or some action in a block can raise error.. an object can't
<marz_d`ghostman> phaul: replaced expect(sync) to expect(sync.run) and it passes for all tests, weird
<marz_d`ghostman> phaul: no for the raise_error but for the .to receive
<marz_d`ghostman> interesting, I removed the subect { sync.run } and placed the sync.run after the it, and it passes
<marz_d`ghostman> ah rspec fails when my class exits with 1
<phaul> I wouldn't trust "it passes" too much in this case :) you have to fully understand what's going on, otherwise passing is just an illusion :)
<marz_d`ghostman> I have a block to exit 1 which I'm testing. If that gets invoked it exits 1 and also causes rspec to fail
<phaul> On rasie_error expectations use blocks. On expect.to recevie(:message) expectations use doubles
snuz has joined #ruby
snuz has quit [Client Quit]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> or mocks or stubs whatever they are these days
ivanskie has joined #ruby
dbz has joined #ruby
ivanskie has quit [Client Quit]
conta1 has quit [Quit: conta1]
ivanskie has joined #ruby
<phaul> tbh I don't understand expect(sync).to receive(:log_error).with(/pre_cmd/) part, upon which action should it recevie it? I don't see anything happening in the example. Usually you do some method sending in the same example, and assert that the mocks/stubs have received the messages they are supposed to receive. What triggers anything to happen in your case?
shynoob has joined #ruby
<shynoob> hello there
<marz_d`ghostman> phaul: Oh, it means it invokes the log_error if pre_cmd fails
<marz_d`ghostman> you see, the Sync class accepts a mirror object argument. the mirror object contains the pre_cmd value, which the sync runs. If that fails, it should invoke the :log_error with the value which in the test is set to 'pre_cmd' literally
shynoob has left #ruby [#ruby]
brendan- has quit [Ping timeout: 260 seconds]
bmurt has quit [Ping timeout: 245 seconds]
<phaul> marz_d`ghostman: in your sentence "which the sync runs" on which line in http://termbin.com/y7on does that happen? is it subject { sync.run } ?
<marz_d`ghostman> phaul: sync.run invokes execute_cmd, then execute_cmd invokes log_error
<phaul> got it
<phaul> I don't think that's a valid way of using RSpec, but I can be wrong. I think it might even ignore your sync.run block being lazy.., if the subject is not in the example. Anyways I am pretty sure that wasn't the intention behind subject {}.
<marz_d`ghostman> phaul: How do I configure rspec not to fail if the class being tested exits with 1?
<marz_d`ghostman> hmm, well thinking of it, since I'm already logging the error, I shouldn't exit with 1
<phaul> feels like talking across purposes.. but subject {} is for setting a subject so you can do it is_expected.to rather than it '' { expect(object).to ... , seems you are trying to run code in the subject block, and assert on that run..
<phaul> which might not work
<marz_d`ghostman> phaul: http://termbin.com/pq19 how about that? still receiving error that the method is not being received though
<marz_d`ghostman> uncommented the subject, and removed the double, it passes now
elphe has quit [Ping timeout: 260 seconds]
<marz_d`ghostman> everything is passing now, I can rest peacefully, lol
<marz_d`ghostman> phaul: thanks for the help
sgen has quit [Read error: Connection reset by peer]
a1ph4g33k has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
ziggylazer has quit [Ping timeout: 252 seconds]
bmurt has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ziggylazer has joined #ruby
shenghi has quit [Ping timeout: 252 seconds]
<phaul> >> [1,1].sum
<phaul> ruby[bot]: where are you?
<phaul> !ops
tdy has joined #ruby
dogweather has quit [Read error: Connection reset by peer]
shenghi has joined #ruby
duderonomy has joined #ruby
roshanavand has quit [Ping timeout: 268 seconds]
roshanavand has joined #ruby
roshanavand has quit [Ping timeout: 244 seconds]
marz_d`ghostman has quit [Quit: Page closed]
roshanavand has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
mikecmpbll has joined #ruby
millerti has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
dbz has quit [Remote host closed the connection]
SeepingN has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
wojnar has quit [Remote host closed the connection]
<havenwood> #=> 2
Fr4n has quit [Read error: Connection reset by peer]
Fr4n has joined #ruby
kentnl has quit [Ping timeout: 246 seconds]
lxsameer has joined #ruby
kent\n has joined #ruby
ivanskie has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
clemens3 has joined #ruby
mrl5 has joined #ruby
<mrl5> hello, I would like to generate unique string everytime when script is run (to generate a request id) any suggestion how should I do it?
<mrl5> I thought maybe Digest and timestamp?
<havenwood> mrl5: SecureRandom.uuid
<mrl5> thanks havenwood
SuperL4g has joined #ruby
SuperLag_ has joined #ruby
Rapture has joined #ruby
SuperLag has quit [Ping timeout: 268 seconds]
Sup3rLurk has quit [Ping timeout: 268 seconds]
Rapture has quit [Ping timeout: 252 seconds]
savolla has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
<phaul> havenwood: I see you are already on 2.5 ;)
<baweaver> Bit of a teaser for something fun coming up - https://twitter.com/keystonelemur/status/1047935342244851712
rrichardsr3 has joined #ruby
leitz has quit [Quit: Leaving]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ivanskie has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
dviola has joined #ruby
za1b1tsu has joined #ruby
reber has quit [Remote host closed the connection]
<za1b1tsu> Can someone offer some advice regarding oop, I'm trying to build a cmd line app. And when I parse options I want to have the parsed options organized by category
<za1b1tsu> but seems so ugly, any advice? oop design practices?
savolla has quit [Remote host closed the connection]
<phaul> donno. Ruby - and that's not OOP, that's ruby - can offer you some metaprogramming - libs exist, to shorten stuff around option parsing. But I don't find the code under your link ugly at first glane
<phaul> *glance
rwb has quit [Ping timeout: 252 seconds]
<za1b1tsu> I'm thinking of a way to use a class instead of the hash for the metadata, but everything I do seems to make it unreadable
mrl5 has left #ruby [#ruby]
<za1b1tsu> in OOP design practices how would a class that presents constant metadata organized by category etc be called?
<za1b1tsu> is it a presenter?
<phaul> as someone who just reads your code the first time I would much rather see a hash there instead of a bunch of classes that even you have hard time to figure out..
ramfjord has joined #ruby
<za1b1tsu> yeah... true
Vapez has joined #ruby
dellavg_ has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
tdy has joined #ruby
ivanskie has quit [Quit: Textual IRC Client: www.textualapp.com]
telegardian has joined #ruby
telegardian has left #ruby ["Leaving..."]
desperek has quit [Quit: xoxo]
ramfjord has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
roshanavand has quit [Quit: leaving]
lxsameer has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
ramfjord has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
Fr4n has quit [Read error: Connection reset by peer]
Fr4n has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 272 seconds]
bkxd has joined #ruby
BloopMonster has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
rwb has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
kent\n has quit [Ping timeout: 260 seconds]
exchgr has joined #ruby
kent\n has joined #ruby
wildermind has quit [Quit: Connection closed for inactivity]
elphe has joined #ruby
<zenspider> za1b1tsu: why are you reinventing the wheel?
<zenspider> ah. ok. you're not. You're just abstracting unnecessarily.
dviola has quit [Quit: WeeChat 2.2]
<za1b1tsu> so how would you do it?
<zenspider> here's one that's more complicated (so plugins can add options)
<zenspider> but they're both fairly straightforward applications of OptionParser w/o any unnecessary abstractions.
Pupeno has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<za1b1tsu> I see
<za1b1tsu> look more clean
<zenspider> DTSTTCPW... mostly. YAGNI a bit too.
<za1b1tsu> what
<zenspider> do the simplest thing that can possibly work.
<zenspider> and you ain't gonna needit
<zenspider> aka: stop overthinking and complicating things. :P
istrasci has joined #ruby
<za1b1tsu> :P
za1b1tsu has quit [Ping timeout: 252 seconds]
bkxd has joined #ruby
IanMalcolm has joined #ruby
Vapez has quit [Remote host closed the connection]
MoritaShinobu has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
exchgr has quit [Quit: ZNC - http://znc.in]
exchgr has joined #ruby
rrichardsr3 has quit [Quit: He who dares .... wins.]
blackhaze has joined #ruby
fluxAeon has quit [Quit: Textual IRC Client: www.textualapp.com]
ramfjord has joined #ruby
Beams has quit [Quit: .]
a1ph4g33k has quit [Quit: Leaving]
arekushi has joined #ruby
bkxd has quit [Ping timeout: 272 seconds]
clemens3 has quit [Ping timeout: 245 seconds]
al2o3-cr has joined #ruby
exchgr has quit [Quit: ZNC - http://znc.in]
pr0ton has joined #ruby
exchgr has joined #ruby
sameerynho has quit [Ping timeout: 260 seconds]
fluxAeon has joined #ruby
teej has joined #ruby
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cthu| has quit [Ping timeout: 272 seconds]
<blackhaze> hello I need some help in ruby
<blackhaze> I am usin
<blackhaze> I am using linux and I need to know how to install rails on my distro
<zenspider> it "should" be: gem install rails; rails new myproject
<zenspider> where "should" is some function of linux dogma changing things
mikecmpbll has quit [Quit: inabit. zz.]
<havenwood> blackhaze: What distro? Do you have Ruby installed?
al2o3-cr has quit [Quit: WeeChat 2.2]
pr0ton has quit [Quit: pr0ton]
pr0ton has joined #ruby
chouhoulis has quit [Ping timeout: 252 seconds]
tdy has joined #ruby
<blackhaze> I need to install ruby on rails but I have installed and an error is giving me some problem I try to build an app and message "could not locate gemfile " appears I am usin kubuntu
ellcs has joined #ruby
<havenwood> blackhaze: What command are you running and what is the full error message?
<blackhaze> No such file or directory -- /usr/share/rubygems-integration/all/gems/bundler-1.16.1/exe/bundle
lxsameer has joined #ruby
<blackhaze> I am trying to build a proyect in ruby but when I try to do it, No such file or directory -- /usr/share/rubygems-integration/all/gems/bundler-1.16.1/exe/bundle appears
cthu| has joined #ruby
<blackhaze> I am trying to update my gems and when I puts bundler in konsole it appears could not locate gemfile
lxsameer has quit [Ping timeout: 245 seconds]
pr0ton has quit [Quit: pr0ton]
pr0ton has joined #ruby
dviola has joined #ruby
bkxd has joined #ruby
elphe has quit [Ping timeout: 268 seconds]
elphe has joined #ruby
DTZUZO has joined #ruby
<baweaver> You sure you're in the right directory?
xfbs has quit [Quit: afk]
rwb has quit [Ping timeout: 268 seconds]
<blackhaze> I am in my app directory and now my error is slite3 "an error ocurred while installing sqlite3 (1.3.13), and bundler cannot continue"
MoritaShinobu has quit [Quit: Leaving]
wildermind has joined #ruby
mzo has joined #ruby
<blackhaze> baweaver: I am in my app directory and now my error is slite3 "an error ocurred while installing sqlite3 (1.3.13), and bundler cannot continue"
<blackhaze> beaweaver: make sure that gem install sqlite -v 1.3.13 succeeds before bundling
<baweaver> How did you install Ruby? What version is it (ruby -v)? What distro are you on?
<baweaver> It's updated a bit.
<blackhaze> mu ruby version is 2.5.1 I am in kubuntu
<baweaver> How did you install it?
<blackhaze> I did not install ruby it is inside kubuntu installed by default
<JJonah> Reposting this because hastebin was down earlier: Is there any way to refer to the entire argument hash on a method with named parameters? That is, to avoid the verbose repetition you see on line 14 here: https://hastebin.com/ogokidoduz.rb
knight33 has joined #ruby
<baweaver> Unfortunately no.
<baweaver> I mean if you _really_ hacked it to hell, maybe, but it'd be 5x + slower easily
<baweaver> param_names = method(:name).parameters.map(&:last)
<baweaver> args = param_names.map { |v| binding.local_variable_get(v) }
<baweaver> something kinda like that, don't remember exactly.
<JJonah> baweaver: right, thanks for the confirmation though.
<baweaver> I'd like there to be introspection of methods in the method itself
<baweaver> current_method.arguments, current_method.default_values, current_method.to_proc, current_method.name
<baweaver> etc etc etc
<JJonah> me too. really seems like this should be built in. ofc the other way is take a hash, then validate the hash to enforce the args inside the method. but that feels worse than the repetition too...
<baweaver> Want to see my even scarier solution?
<JJonah> ofc
<baweaver> I made destructuring work in Ruby
<baweaver> kinda
<baweaver> Could potentially be adapted to inject "current_method" into the....
* baweaver runs off to write the code
ellcs has quit [Ping timeout: 252 seconds]
chouhoulis has joined #ruby
<blackhaze> sqlite3.h not exists how can I download
<blackhaze> ?
<baweaver> Read through that guide above
<baweaver> it mentions it