cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.2]
cagomez has quit [Ping timeout: 264 seconds]
meinside has joined #ruby
whippythellama has quit [Quit: WeeChat 1.4]
r29v has quit [Quit: r29v]
kapil___ has quit [Quit: Connection closed for inactivity]
mikhael_k33hl_ has joined #ruby
<mikhael_k33hl_>
I'm trying to use this gem: https://github.com/jbussdieker/ruby-rsync and want to extract only the change containing the total size, I can't seem to follow the code specially when the module Change#changed? is called
<mikhael_k33hl_>
It has this if/else statement that return :no_change, but that return value isn't even one of the option though
GodFather has joined #ruby
aninaki has quit [Ping timeout: 268 seconds]
n13z has quit [Ping timeout: 268 seconds]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
ur5us has joined #ruby
Guest83186 has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
sylario has quit [Quit: Connection closed for inactivity]
cagomez has quit [Ping timeout: 240 seconds]
frem has quit [Quit: Connection closed for inactivity]
Guest83186 has quit [Ping timeout: 240 seconds]
n13z has joined #ruby
n13z has quit [Ping timeout: 268 seconds]
ErhardtMundt has quit [Remote host closed the connection]
scrptktty has quit [Quit: Connection closed for inactivity]
Alina-malina has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
georgie has joined #ruby
User458764 has joined #ruby
User458764 has quit [Client Quit]
alfiemax has joined #ruby
Dbugger has joined #ruby
snickers has quit [Ping timeout: 260 seconds]
gnufied has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
wildermind has joined #ruby
tristanp has joined #ruby
Blaguvest has joined #ruby
venmx has joined #ruby
dr3w_ has joined #ruby
tristanp has quit [Ping timeout: 245 seconds]
Guest83186 has joined #ruby
reber has joined #ruby
Beams has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
bak1an has joined #ruby
Blaguvest has quit [Ping timeout: 248 seconds]
venmx has quit [Quit: leaving]
alfiemax has quit [Remote host closed the connection]
dbrandon has quit [Ping timeout: 245 seconds]
postmodern has quit [Quit: Leaving]
galeido_ is now known as galeido
conta has quit [Quit: conta]
InfinityFye has joined #ruby
arekushi has joined #ruby
iMadper has quit [Remote host closed the connection]
alfiemax has joined #ruby
mikecmpbll has joined #ruby
sagax has quit [Quit: Konversation terminated!]
alex-kid has joined #ruby
<alex-kid>
Hi
<alex-kid>
Is there a way to implement function signature?
<alex-kid>
or have to handle different behaviours in single one function :|
<alex-kid>
?
dionysus69 has quit [Ping timeout: 260 seconds]
<ineb>
any way wo write this shorter? (1..5).map{|x| h = {}; h[1] = x; h[2] = x*x; h } ?
<leah2>
>> (1..5).map { |x| {1=>x,2=>x*x} }
ciro has joined #ruby
<leah2>
hm, no evalbot
<ineb>
>> p 'thx'
<leah2>
yw :)
alfiemax has quit [Ping timeout: 268 seconds]
<ineb>
alex-kid: not in an easy/convienient way.
<ineb>
it makes no sense in a typeless language if you think about it
alfiemax has joined #ruby
konsolebox has joined #ruby
sylario has joined #ruby
hahuang65 has quit [Ping timeout: 264 seconds]
<elomatreb>
alex-kid: Generally you approach this kind of thing in Ruby by using default values for arguments, and selecting these so that all different behaviors are special cases of one general behavior
<alex-kid>
Yep
<alex-kid>
The function can becomes really biggy
<alex-kid>
instead of separating the behaviour in different implementation
<alex-kid>
/ signature
<elomatreb>
This sadly is the downside of non-strict typing, as there is no consistent concept of signature in Ruby
<alex-kid>
Crystal looks great in that regard
<alex-kid>
"Fast as C, slick as Ruby"
<apeiros>
alex-kid: if it's different behaviors, it should be different methods IMO
<apeiros>
after all, a method should say what it does. and if it does different things, then it can't possibly do that.
<alex-kid>
Is there inner / outer named parameters?
<elomatreb>
There are keyword arguments that work basically like named parameters, not sure what you mean by inner/outer
<alex-kid>
and to know if a method takes named arguments?
tristanp has joined #ruby
<alex-kid>
I forget how to do
<elomatreb>
You can't differentiate between named parameters and positionals (and optional vs. required) at runtime, you need to look at the source
<alex-kid>
I’m sure there is some hacky way
dionysus69 has joined #ruby
<alex-kid>
method, parameters = case message
alfiemax has quit [Ping timeout: 240 seconds]
<alex-kid>
when ...
<elomatreb>
For methods that are defined in Ruby (i.e. not a native extension) you can look at Method#source to get their source code, and interpret that. But don't.
<alex-kid>
[:method, { a: 1 }]
<alex-kid>
end
alfiemax has joined #ruby
tristanp has quit [Ping timeout: 265 seconds]
<alex-kid>
#parameters can help
<ineb>
when in ruby mindset, there is rarely a situation where you need function signatures
<ineb>
at least thats what iam experiencing.
<ineb>
if you really need a distinction then you must do type checking one way or another
<apeiros>
there is none. since there's little sense for an object to know how each collection type works.
<apeiros>
of course you can implement it by delegating it to the collection object, as in: class Object; def in?(collection); collection.include?(self); end; end
<alex-kid>
Ouki
<apeiros>
but IMO that's pointless. just let the one which has the required knowledge do it directly.
<alex-kid>
What do you think of the Proc#positional? implementation above
<alex-kid>
is it robust enough?
<apeiros>
I'm not quite sure what I'd use it for
<apeiros>
I tend to reserve introspection for debugging
<apeiros>
not parameters.find { |type, name| type == :key }.nil? --> parameters.any? { |type, name| type == :key }
<apeiros>
I still don't really see the point of having that :-/
mikecmpbll has joined #ruby
<apeiros>
looks a bit like currying to me, but not sure since I rarely use those techniques. maybe talk to baweaver.
<alex-kid>
yep it’s currying
AJA4351 has joined #ruby
ciro has quit [Ping timeout: 248 seconds]
AJA4350 has quit [Ping timeout: 260 seconds]
AJA4351 is now known as AJA4350
dr3w___ has joined #ruby
dr3w_ has quit [Ping timeout: 248 seconds]
ciro has joined #ruby
User458764 has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
alfiemax has quit [Ping timeout: 268 seconds]
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
zyxtant has quit [Quit: Leaving]
conta has joined #ruby
za1b1tsu has joined #ruby
arekushi has quit [Quit: Gateway shutdown]
za1b1tsu has quit [Ping timeout: 260 seconds]
augcesar has joined #ruby
rikkipitt has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ec has joined #ruby
User458764 has joined #ruby
GodFather has joined #ruby
User458764 has quit [Client Quit]
Zaab1t has joined #ruby
mikhael_k33hl_ has quit [Ping timeout: 252 seconds]
lunarkitty7 has quit [Ping timeout: 240 seconds]
rikkipitt has quit [Quit: Leaving...]
cagomez has joined #ruby
conta has quit [Quit: conta]
cagomez has quit [Ping timeout: 260 seconds]
GodFather has quit [Ping timeout: 276 seconds]
Blaguvest has joined #ruby
fmcgeough has joined #ruby
strmpnk has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros__ has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
dendazen has joined #ruby
joast has quit [Ping timeout: 248 seconds]
beefjoe has joined #ruby
bmurt has joined #ruby
p4p0l0 has joined #ruby
mikecmpbll has joined #ruby
Rapture has joined #ruby
gnufied has joined #ruby
mgilles has joined #ruby
mgilles has quit [Client Quit]
beefjoe has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
unshackled has joined #ruby
joast has joined #ruby
_Caerus has joined #ruby
Inline has joined #ruby
Caerus has quit [Ping timeout: 260 seconds]
Zaab1t has quit [Quit: Zaab1t]
uplime is now known as nchambers
alfiemax has joined #ruby
elcuervo has joined #ruby
biberu has quit []
Mike11 has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
Alina-malina has quit [Max SendQ exceeded]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
Alina-malina has joined #ruby
Alina-malina has quit [Max SendQ exceeded]
Alina-malina has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
Alina-malina has quit [Max SendQ exceeded]
Alina-malina has joined #ruby
Alina-malina has quit [Max SendQ exceeded]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
johnny56 has quit [Ping timeout: 276 seconds]
ivanskie has joined #ruby
ivanskie has quit [Client Quit]
Cybergeek has joined #ruby
elcuervo has quit [Remote host closed the connection]
rippa has joined #ruby
ivanskie has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4350 has joined #ruby
conta has joined #ruby
Alina-malina has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ivanskie has joined #ruby
conta has quit [Quit: conta]
vondruch has quit [Ping timeout: 240 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ivanskie has joined #ruby
tcopeland has joined #ruby
tcopeland has quit [Client Quit]
ivanskie has quit [Client Quit]
fury has left #ruby [#ruby]
psychicist__ has joined #ruby
AJA4350 has quit [Remote host closed the connection]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has joined #ruby
qolq has joined #ruby
millerti has joined #ruby
ivanskie has joined #ruby
clemens3_ has quit [Ping timeout: 240 seconds]
cajone has joined #ruby
cajone has left #ruby [#ruby]
tristanp has joined #ruby
dviola has joined #ruby
lunarkitty7 has joined #ruby
p4p0l0 has quit [Remote host closed the connection]
p4p0l0 has joined #ruby
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
Mike11 has quit [Quit: Leaving.]
cagomez has joined #ruby
[Butch] has joined #ruby
maryo has joined #ruby
<maryo>
I have executed bundle command as root and it looks like it has broken ruby environment for all the users. Can someone guide on how to fix this issue?
sysvalve has quit [Quit: Leaving]
alex-kid has quit [Ping timeout: 240 seconds]
yohji has quit [Remote host closed the connection]
bak1an has joined #ruby
p4p0l0 has quit [Remote host closed the connection]
<havenwood>
maryo: Do you want to uninstall all system gems, then? Was it just default-installed gems before you sudo bundled?
eckhardt has joined #ruby
<maryo>
havenwood, I have managed to fix the issue. Now while trying to run the command 'gem install bundler' as non root user. I am getting this error https://dpaste.de/DuGN
<havenwood>
maryo: Did you delete rdoc on purpose? You can switch to not build documentation to work around this, or get rdoc working. Which do you prefer?
edwardly has quit [Ping timeout: 240 seconds]
<maryo>
havenwood, which ever is the easies one. Probably fixing the rdoc. I hope I have deleted it by mistake
<havenwood>
maryo: Try installing the ruby-doc package.
conta has joined #ruby
<havenwood>
maryo: yum install ruby-doc
<havenwood>
maryo: Or skip documentation when installing gems with the `--no-document` flag.
<maryo>
havenwood, Package rubygem-rdoc-4.0.0-33.el7_4.noarch already installed and latest version
<maryo>
. Hopefully reinstallation will help?
Alina-malina has quit [Max SendQ exceeded]
dionysus69 has joined #ruby
edwardly has joined #ruby
Alina-malina has joined #ruby
chouhoulis has joined #ruby
Alina-malina has quit [Max SendQ exceeded]
orbyt_ has joined #ruby
Beams has quit [Quit: .]
<maryo>
havenwood, I have installed dashing using bundle install command as non root user. But it is not able to find the binary. Any idea what could be wrong? https://dpaste.de/2336#
krawchyk has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
<maryo>
in addition whenever I execute gem info gem_name I get this error https://dpaste.de/JrE4
yorickpeterse has joined #ruby
yorickpeterse has quit [Client Quit]
howdoi has quit [Quit: Connection closed for inactivity]
AJA4350 has quit [Remote host closed the connection]
InfinityFye has left #ruby ["Leaving"]
Demos has joined #ruby
jcarl43 has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
alfiemax has quit [Ping timeout: 244 seconds]
cats has quit [Ping timeout: 260 seconds]
cats has joined #ruby
ivanskie has joined #ruby
Dbugger has quit [Remote host closed the connection]
lomex has joined #ruby
bipul has quit [Ping timeout: 264 seconds]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MyMind has quit [Ping timeout: 260 seconds]
Pisuke has joined #ruby
gnufied has quit [Ping timeout: 255 seconds]
Demos has quit [Remote host closed the connection]
conta has quit [Quit: conta]
conta has joined #ruby
dionysus69 has quit [Quit: dionysus69]
Alina-malina has joined #ruby
<g->
maryo: sounds like your PATH does not include the location of the binary.
samosaphile has joined #ruby
<g->
maryo: perhaps something like `export PATH="/path/to/binary/dir:$PATH"`
ldepandis has joined #ruby
gnufied has joined #ruby
Alina-malina has quit [Max SendQ exceeded]
Demos has joined #ruby
conta has quit [Quit: conta]
tolland has joined #ruby
ldepandis has quit [Ping timeout: 264 seconds]
alfiemax has joined #ruby
<tolland>
on fedora im trying to run jekyll but I'm getting the error `Ignoring eventmachine-1.2.5 because its extensions are not built.` however it looks like there is a ~/.gem/ruby/extensions/x86_64-linux/2.5.0/eventmachine-1.2.5/rubyeventmachine.so and also a ~/.gem/ruby/gems/eventmachine-1.2.5/ext/rubyeventmachine.so
<tolland>
presumably it's looking in the wrong place, but I don't see any options to set that path
<tolland>
(I'm trying to run jekyll with `bundle exec jekyll serve`)
biberu has joined #ruby
Alina-malina has joined #ruby
<g->
tolland: was the eventmachine gem install with bundler?
Eiam has joined #ruby
def_jam has joined #ruby
<tolland>
I ran `bundle install` in the jekyll folder before... and it tried to install eventmachine
<havenwood>
maryo: You can do something like: export PATH="$(gem env gemdir)/bin:$PATH"
SeepingN has joined #ruby
[Butch] has quit [Read error: Connection reset by peer]
patr0clus has joined #ruby
<tolland>
actually, there is a system eventmachine native extension here - /usr/share/gems/gems/eventmachine-1.2.5/ext/rubyeventmachine.so
[Butch] has joined #ruby
apeiros__ has quit [Remote host closed the connection]
apeiros has joined #ruby
[Butch] has quit [Client Quit]
patr0clus is now known as s3nd1v0g1us
<tolland>
ok. so if I install them manually using `sudo gem install xxxx --version 1.2.3` then those native extensions are put under /usr/lib64/gems/ruby/ and `bundle exec` will run.
<tolland>
but it would be nice to get bundler to look in the ~/.gem/ folder for gem.build_complete
<tolland>
as this makes a mess of things
sauvin has quit [Read error: Connection reset by peer]
apeiros has quit [Ping timeout: 268 seconds]
\void has joined #ruby
maryo_ has joined #ruby
s3nd1v0g1us has quit [Ping timeout: 240 seconds]
<qolq>
i've just seen an instance method named 'new' in production ruby code
<qolq>
i'm inclined to think this is badly named
<qolq>
is it? or is this normal in ruby?
maryo has quit [Ping timeout: 264 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
samosaphile has quit [Ping timeout: 252 seconds]
s3nd1v0g1us has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
[Butch] has joined #ruby
<havenwood>
qolq: I'm curious, on a module or class?
<havenwood>
Oh, instance method.
<qolq>
class
<z64>
yeah. i would be inclined to argue that should be named more explicitly
<havenwood>
I don't see problems beyond naming.
<havenwood>
qolq: The ::new that #initialize uses won't mind if there's a #new.
<qolq>
yeah. i played around with it on irb and it works fine
<qolq>
my concern was potential confusion with the class method
<qolq>
but then i thought maybe it could be a common thing ruby
<z64>
i mean you can very well do `klass = Foo`, `klass.new #=> <Foo ..>`. does it actually return a new instance of T?
<z64>
i.e. some sort of custom .dup?
<qolq>
that would return a new instance of Foo
<qolq>
but if you did klass.new.new, it would call the instance method you defined
<z64>
yeah i get you. i'm just curious about the code in question
<z64>
like, what does this #new actually do
<qolq>
i don't really remember
<qolq>
i don't have the code on hand
<qolq>
but it was something that could very easily have been named something else
<qolq>
something less confusing
<z64>
my point of `klass = Foo` is that you could write code that might look like its an instance method, so i think its a reason for a double-take for sure
<qolq>
definitely
<qolq>
just wanted to make sure
<qolq>
:)
<qolq>
thanks!
millerti has quit [Ping timeout: 240 seconds]
sameerynho has joined #ruby
dendazen has quit [Ping timeout: 276 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<maryo_>
havenwood, as of now when I do "gem install dashing". the binary by default gets installed in this path /usr/bin/dashing and this is a global path.. Not sure why its happening like this. any idea?
<havenwood>
maryo_: Where were you expecting it to install?
<havenwood>
maryo_: Sanity check that you're using the `gem` you're expecting: command -v gem
<Demos>
honestly gem should just never install in /usr/bin
<Demos>
unless gem calls out to the system package manager
<havenwood>
maryo_: Is GEM_HOME set?: printenv GEM_HOME
<Demos>
but yes try `type gem`
<havenwood>
maryo_: I'm kinda curious what all Rubies you have installed. What do you get for?: which -a gem
<maryo_>
havenwood, GEM_HOME is not set
<Demos>
my gem (from rubygems-2.7.6-93.fc28.noarch) installs to /home/<me>/bin by defaulkt
<maryo_>
havenwood, $ which -a gem
<maryo_>
/usr/bin/gem
<maryo_>
Demos, $ type gem
<maryo_>
gem is hashed (/usr/bin/gem)
<maryo_>
Demos, yep that location seems to be perfect. I am also expecting that it should go under /home/<me>/bin
<havenwood>
maryo_: You can set GEM_HOME for an alternate installation location. There's also a --user-install flag for installing in your home dir rather than GEM_HOME.
<havenwood>
There's also an --install-dir flag.
<Demos>
distros love to patch install locations for these sorts of tools <glares>
<Demos>
<directly at debian>
<havenwood>
maryo_: You can set --user-install to be persisted by adding it to your ~/.gemrc: gem: "--user-install"
konsolebox has quit [Ping timeout: 244 seconds]
chouhoulis has quit [Remote host closed the connection]
nowhere_man has joined #ruby
<maryo_>
havenwood, thank you. Can you also please guide me in setting the PATH for the executables? This is what I get -> https://dpaste.de/7SJ5