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!]
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
<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?
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.
<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
<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
<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]
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..
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?
<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
<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...