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-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
RyanMcCoskrie has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 248 seconds]
alfiemax has quit [Ping timeout: 248 seconds]
jenrzzz_ has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
nitric_ has quit [Ping timeout: 245 seconds]
Puffball has quit [Quit: Puffball]
rcvalle has quit []
x0f has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
banisterfiend has joined #ruby
Guest19310 is now known as ged
ged is now known as Guest85807
lilherc has left #ruby ["Leaving"]
dviola has quit [Ping timeout: 260 seconds]
ogres has joined #ruby
alfiemax has joined #ruby
venmx has joined #ruby
shadeslayer has joined #ruby
elphe has joined #ruby
Guest55615 is now known as Radar
alfiemax has quit [Ping timeout: 245 seconds]
shadeslayer has quit [Read error: Connection reset by peer]
shadeslayer has joined #ruby
shadeslayer has quit [Remote host closed the connection]
shadeslayer has joined #ruby
cagomez has quit [Remote host closed the connection]
jcarl43 has quit [Quit: WeeChat 2.1]
cagomez has joined #ruby
orbyt_ has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
venmx has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 268 seconds]
cthulchu has quit [Ping timeout: 245 seconds]
GodFather_ has quit [Remote host closed the connection]
coderphive has quit [Quit: coderphive]
sytherax has quit [Remote host closed the connection]
ipe has quit [Read error: Connection reset by peer]
sytherax has joined #ruby
khanred has joined #ruby
hlmjr has joined #ruby
dviola has joined #ruby
ur5us has joined #ruby
khanred has left #ruby ["Textual IRC Client: www.textualapp.com"]
venmx has joined #ruby
Deesl has joined #ruby
ur5us has quit [Ping timeout: 245 seconds]
<havenwood> lystra_: Does it work without the --local flag?
ur5us has joined #ruby
<havenwood> lystra_: You want to install it from the remote source, yeah?
<havenwood> gem install rails --local #!> ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has quit [Changing host]
dviola has joined #ruby
AJA4350 has quit [Quit: AJA4350]
dbugger_ has joined #ruby
<havenwood> lystra_: The default is --both, which allows local or remote sourced gems to be installed. It seems you're meaning to install from a remote source, so the default or --remote will work, but you don't have loquacious.gem locally, so it can't be found with --local.
bayprogrammer has quit [Quit: WeeChat 2.0.1]
<Radar> seems a bit like "Installing Ruby: The Hard Way"
Dbugger has quit [Ping timeout: 245 seconds]
tvw has quit [Remote host closed the connection]
bayprogrammer has joined #ruby
<Radar> But yeah, I think havenwood is right. --local is probably the cause of the problem here.
dbugger__ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
dbugger_ has quit [Ping timeout: 252 seconds]
Dbugger has joined #ruby
dbugger__ has quit [Ping timeout: 260 seconds]
eckhardt has joined #ruby
eckhardt has quit [Client Quit]
nertzy has quit [Read error: Connection reset by peer]
nertzy has joined #ruby
Puffball has joined #ruby
white_lilies has joined #ruby
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest85807 is now known as ged
ged is now known as Guest36153
hlmjr has quit [Read error: Connection reset by peer]
<lystra_> havenwood: Let me try.
GodFather has joined #ruby
<lystra_> havenwood: That worked. Thanks! I was using the same installation procedure as with ruby-2.0 so I expected things to work for future Ruby versions as well. Thanks a lot.
rivalomega has joined #ruby
<lystra_> havenwood: I don't really get the difference between local/remote but things work with --local.
<havenwood> lystra_: With --local you're saying you have the loquacious.gem file locally, and you'd like to install it from your local version.
venmx has quit [Ping timeout: 268 seconds]
<lystra_> Radar: Yeah, it might not seem intuitive but we want to keep the base Ruby installation and any 3rd-party gems separate. We do something similar with Python, Perl, Tcl/Tk, etc.
kmurphy4 has joined #ruby
<havenwood> lystra_: With --both (default) or --remote, it'll look for the gem in your remote sources as well (default https://rubygems.org/).
kapil___ has quit [Quit: Connection closed for inactivity]
<havenwood> lystra_: See what you have set for remote gem sources: gem env remotesources
rivalomega has quit [Ping timeout: 256 seconds]
<lystra_> havenwood: https://rubygems.org/ which I guess is the default.
<havenwood> lystra_: Yup, just the --local flag was overriding the --both default, telling RubyGems not to look at https://rubygems.org/.
<havenwood> lystra_: Without already having a local copy of those gems, it couldn't find them.
<lystra_> havenwood: Well, we have /tmp/ruby24p/vendor/lib/2.4.0/cache/loquacious-1.9.1.gem which I would expect it to find with --local.
alfiemax has joined #ruby
<lystra_> havenwood: Actually, our preference is for gem install not to fetch anything from the Internet.
alfiemax has quit [Ping timeout: 256 seconds]
<lystra_> havenwood: BTW, if I install to the default directory (i.e. omit --bindir and --install-dir), then even with --local, I can install little-plugger, loquacious, and bones successfully. Only when installing outside of the default installation path is there a problem. So, I think the problem remains that Ruby is not search out custom installation directory for gems to match the dependency.
<havenwood> lystra_: I'm curious if we'd be able to give better suggestions if we knew more about what you're doing.
<lystra_> havenwood: I just want to install all gems (via gem install) to a separate directory from where ruby was installed.
<lystra_> havenwood: So if I install ruby 2.4.4 to /tmp/ruby24, I want to install all gems for it to /tmp/ruby24p.
<havenwood> lystra_: Normally in prod we use a Gemfile.lock to specify the exact gem versions then install them to vendor/bundle relative to the root of the project.
<havenwood> lystra_: If you don't want to download remote gems, how do they get on the server?
<havenwood> lystra_: You can pass the location of the .gem file to --local.
Puffball has quit [Quit: Puffball]
<lystra_> havenwood: I download them manually. I just don't want them downloaded automatically. Sorry for the poor wording.
<havenwood> lystra_: You can also run your own local gemserver. It's hard to give recommendations without knowing more about why you're doing what you're doing.
<havenwood> lystra_: no prob
<lystra_> havenwood: We're packaging Ruby for some customers. When we provide an RPM to them, Ruby will be installed to /usr/local/ruby24. The customers also want some gems and we don't want to install the gems to the same directory as Ruby so we're installing the gems to /usr/local/ruby24p. We also want Ruby, when someone requires the gem, to search for the gems in /usr/local/ruby24 *and* /usr/local/ruby24p.
<havenwood> lystra_: I'd say just pass the location of the *.gem to --local.
<lystra_> havenwood: I am installing with /tmp/ruby24/bin/gem install -V --rdoc --ri --bindir=/tmp/ruby24p/bin --install-dir=/tmp/ruby24p/vendor/lib/2.4.0 --local /opt/src/2018.01.01/ruby/bones-3.8.4/src/bones-3.8.4.gem. Isn't that passing the location of the gem file?
pilne has quit [Quit: Leaving]
bga57 has quit [Ping timeout: 245 seconds]
alfiemax has joined #ruby
bga57 has joined #ruby
<havenwood> lystra_: yes, looks right to me
<lystra_> havenwood: That's the command that's failing. It succeeds without --local.
<havenwood> lystra_: --rdoc and --ri are deprecated, you can use --document instead but you're not changing the default so I'd omit them
alfiemax has quit [Ping timeout: 245 seconds]
Azure|dc is now known as Azure
<lystra_> havenwood: Ok, thanks. I see that with 'gem install --help. Didn't notice it. Holdovers from how we installed things with Ruby 2.0.
<havenwood> lystra_: Sanity check that .gem file really is there?: file /opt/src/2018.01.01/ruby/bones-3.8.4/src/bones-3.8.4.gem
<lystra_> havenwood: Yep. I use the same command line for Ruby 2.0 but just change 24 -> 20 and it works fine.
<lystra_> havenwood: If the .gem file wasn't there, it wouldn't know loquacious was a dependency and generate the error message about not finding it.
<lystra_> havenwood: If I strace the command, /tmp/ruby24p/vendor/lib/2.4.0/specifications is never searched unlike when I use Ruby 2.0.
<havenwood> lystra_: oh! you're not trying to install loquacious, it's a dep of a gem?
<havenwood> I mean not trying to install it directly?
<lystra_> havenwood: Correct. bones needs little-plugger and loquacious. We manually installed both using the same method. Then, when we try to install bones, it fails because it cannot find its dependencies. So our custom gem installation path isn't getting searched for dependencies.
<havenwood> lystra_: So you're installing the gems while online with --install-dir BLARG then moving all those gems and their deps over to your server from BLARG/cache/*.gem?
RyanMcCoskrie has joined #ruby
<havenwood> lystra_: Interesting. I don't know why it's not finding the deps.
<lystra_> havenwood: No, we're installing directly to our custom gem path, /tmp/ruby24p for now to test things. When we have this issue figured out, we'll rebuild Ruby and the gems and install to /usr/local/ruby24 and /usr/local/ruby24p and then generate an RPM directly from that directory. We're doing all this while online but using local paths to find all the gems.
<lystra_> havenwood: Ok, thanks. I'll post to ruby-talk and hopefully someone will have an answer.
j416 has quit [Ping timeout: 256 seconds]
RougeR has quit [Ping timeout: 240 seconds]
RyanMcCoskrie has quit [Remote host closed the connection]
gnufied has quit [Remote host closed the connection]
Guest36153 is now known as ged
coderphive has joined #ruby
ged is now known as Guest22663
j416 has joined #ruby
sleetdrop has joined #ruby
cyberg has quit [Remote host closed the connection]
enigma has joined #ruby
enigma has quit [Client Quit]
sleetdrop has quit [Quit: Computer has gone to sleep.]
coderphive has quit [Quit: coderphive]
sleetdrop has joined #ruby
millerti has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
hlmjr has joined #ruby
krawchyk has joined #ruby
alfiemax has quit [Ping timeout: 245 seconds]
tdy has quit [Ping timeout: 252 seconds]
cadillac_ has joined #ruby
thapakazi has joined #ruby
braincrash has quit [Quit: bye bye]
elphe has quit [Ping timeout: 252 seconds]
braincrash has joined #ruby
conta has joined #ruby
white_lilies has quit [Ping timeout: 264 seconds]
conta has quit [Ping timeout: 245 seconds]
howdoi has joined #ruby
alfiemax has joined #ruby
sleetdrop has quit [Quit: Computer has gone to sleep.]
alfiemax_ has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
white_lilies has joined #ruby
ramfjord has quit [Ping timeout: 252 seconds]
elphe has joined #ruby
sleetdrop has joined #ruby
cagomez has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Radar> Is roo still the latest and greatest gem to use for reading Excel files?
coderphive has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
orbyt_ has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
mtkd has joined #ruby
Guest22663 is now known as ged
ged is now known as Guest10644
gix- has joined #ruby
gix has quit [Disconnected by services]
sleetdrop has quit [Quit: Textual IRC Client: www.textualapp.com]
krawchyk has quit [Quit: krawchyk]
dbugger_ has joined #ruby
\void has quit [Ping timeout: 260 seconds]
cadillac_ has quit [Ping timeout: 260 seconds]
skryking has joined #ruby
Dbugger has quit [Ping timeout: 245 seconds]
roshanavand has quit [Ping timeout: 245 seconds]
\void has joined #ruby
phate408 has joined #ruby
minimalism has quit [Quit: minimalism]
white_lilies has quit [Ping timeout: 248 seconds]
donofrio_ has quit [Remote host closed the connection]
cagomez has quit [Remote host closed the connection]
rkazak has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brendan- has quit [Ping timeout: 240 seconds]
jamesaxl has quit [Ping timeout: 240 seconds]
jamesaxl has joined #ruby
elphe has quit [Ping timeout: 268 seconds]
eckhardt has joined #ruby
johnny56 has quit [Ping timeout: 276 seconds]
johnny56_ has joined #ruby
eckhardt has quit [Client Quit]
eckhardt has joined #ruby
reber has joined #ruby
conta has joined #ruby
phaul has joined #ruby
conta has quit [Ping timeout: 260 seconds]
elphe has joined #ruby
Guest3612 is now known as baweaver
anisha has joined #ruby
coderphive has quit [Quit: coderphive]
jamesaxl has quit [Quit: WeeChat 2.1]
pskosinski has quit [Ping timeout: 265 seconds]
jcarl43 has joined #ruby
Guest10644 is now known as ged
apeiros has joined #ruby
ged is now known as Guest65777
pskosinski has joined #ruby
rivalomega has joined #ruby
elphe has quit [Ping timeout: 260 seconds]
elphe has joined #ruby
eck has joined #ruby
kmurphy4 has quit [Quit: kmurphy4]
Guest54268 is now known as markand
bryan has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
bryan is now known as Guest32367
skryking has quit [Quit: Leaving]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
elomatreb has joined #ruby
Guest32367 has quit [Client Quit]
alfiemax has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 268 seconds]
rivalomega has quit [Read error: Connection reset by peer]
rivalomega has joined #ruby
sauvin has joined #ruby
Asher has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
apeiros has quit [Remote host closed the connection]
Asher has quit [Ping timeout: 248 seconds]
KeyJoo has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
KeyJoo has joined #ruby
aupadhye has joined #ruby
oleo has quit [Quit: Leaving]
Guest83502 is now known as rmerry
ciscam has quit [Ping timeout: 248 seconds]
ciscam has joined #ruby
z3uS has quit [Quit: /dev/null]
jcarl43 has quit [Quit: WeeChat 2.1]
Asher has joined #ruby
z3uS has joined #ruby
kapil___ has joined #ruby
troys has quit [Quit: Bye]
Asher has quit [Ping timeout: 256 seconds]
sagax has quit [Quit: Konversation terminated!]
emilford has quit [Ping timeout: 252 seconds]
clemens3 has joined #ruby
emilford has joined #ruby
Guest65777 is now known as ged
ged is now known as Guest70804
conta has joined #ruby
elomatreb has quit [Quit: mep mep]
tag has joined #ruby
clemens3_ has joined #ruby
schleppel has joined #ruby
Guest73982 has quit [Quit: All for nothing]
xuanrui has joined #ruby
olspookishmagus has joined #ruby
ciscam has quit [Ping timeout: 245 seconds]
ciscam has joined #ruby
biberu has joined #ruby
RougeR has joined #ruby
apeiros has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
xuanrui has quit [Quit: Leaving]
Burgestrand has joined #ruby
elphe has quit [Ping timeout: 256 seconds]
elphe has joined #ruby
Guest8084 is now known as Cork
clemens3 has quit [Ping timeout: 240 seconds]
Asher has joined #ruby
Deesl has joined #ruby
elphe has quit [Ping timeout: 264 seconds]
lypsis|awy is now known as lypsis
tvw has joined #ruby
Burgestrand has quit [Quit: Closing time!]
Asher has quit [Ping timeout: 260 seconds]
sytherax has quit [Remote host closed the connection]
elphe has joined #ruby
claudiuinberlin has joined #ruby
clemens3 has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
Guest70804 is now known as ged
ged is now known as Guest2576
suukim has joined #ruby
aufi has joined #ruby
lypsis is now known as lypsis|awy
ArtCorvelay has joined #ruby
vondruch has joined #ruby
rivalomega has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 260 seconds]
dinfuehr has joined #ruby
Guest14918 has quit [Quit: Bye]
c0ncealed1 has quit [Read error: Connection reset by peer]
DarthGandalf has joined #ruby
c0ncealed1 has joined #ruby
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
ArtCorvelay has quit [Quit: Leaving]
ellcs has joined #ruby
sytherax has joined #ruby
dviola has quit [Quit: WeeChat 2.1]
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
sysvalve has joined #ruby
mlkkk has joined #ruby
Guest23707 has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 240 seconds]
yohji has joined #ruby
NL3limin4t0r has joined #ruby
marr has joined #ruby
dionysus69 has joined #ruby
Guest36902 is now known as SuperTux88
Burgestrand has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
duderonomy has joined #ruby
mrush has joined #ruby
mrush is now known as Guest92733
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
Guest41156 is now known as Sp4rKy
Sp4rKy is now known as Guest17152
alfiemax has quit [Remote host closed the connection]
Guest17152 is now known as henry
Guest92733 has quit [Ping timeout: 252 seconds]
henry is now known as Sp4rKy
alfiemax has joined #ruby
Sp4rKy is now known as Guest34758
Guest2576 is now known as ged
alfiemax has quit [Remote host closed the connection]
ged is now known as Guest26197
alfiemax has joined #ruby
Guest34758 is now known as Sp4rKy
guille-moe has joined #ruby
KeyJoo has quit [Remote host closed the connection]
elphe has joined #ruby
duderono_ has joined #ruby
amar has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
duderonomy has quit [Ping timeout: 256 seconds]
mrush_ has joined #ruby
marr has quit [Ping timeout: 264 seconds]
<ellcs> guys, can someone explain me why this behavior exists? xD
<ellcs> `nil.to_i # => 0`
<apeiros> that's a very good question and I have no good answer for it.
<dminuoso> ellcs: nil.to_a works too
<dminuoso> nil.to_s works too
<dminuoso> lots of surprising things.
<apeiros> I guess you'd have to ask matz
<apeiros> nil.to_s at least makes some sense. though you could argue about "" vs "niL"
lypsis|awy is now known as lypsis
<apeiros> but yeah, nil.to_i, .to_f, .to_<numeric>, .to_a, .to_h all make no sense IMO
<dminuoso> nil.to_s makes sense?
<dminuoso> heh
<dminuoso> oh goodie!
<dminuoso> apeiros is on the righteous path of type theory
<apeiros> sure. "printable representation of the object" makes sense for almost all objects.
mtkd has quit []
<dminuoso> >> nil.to_str
Asher has joined #ruby
<dminuoso> >> nil.to_ary
<phaul> however is nil an object that represents the absence of any object? :)
<apeiros> yes, that's its purpose. implementing the nullobject pattern :)
<ellcs> i dont want to start a war, but aren't there two concepts mixed up? neutral elements and non-existence?
<ellcs> but i see the purpose now, thanks!
mtkd has joined #ruby
<apeiros> ellcs: that's probably where it comes from. but neutral element in numbers isn't always 0 either. it depends on the operation (e.g. multiplication, 0 is not neutral, 1 is). which makes 0 even less of a meaningful choice.
* apeiros pokes ruby[bot]
<apeiros> ?help
<ruby[bot]> You can find an overview of my commands at http://ruby-community.com/ruboto/commands
<apeiros> >> 1+1
<ruby[bot]> apeiros: # => 2 (https://eval.in/1009775)
<apeiros> hm
<phaul> I mean what I said there feels like a contradiction in itself. :) but it's rather philosophical and a bit pointless argument..
<apeiros> I understood. but having a value representing the absence of a value is a widely used concept, known as the nullobject pattern. it's not just limited to nil.
<apeiros> in an authentication/authorization system you could e.g. have a NullUser
<apeiros> so while it may be contradictory, it's useful
<phaul> true
<apeiros> I'd love it if ruby allowed subclassing NilClass for this purpose
<apeiros> so that: `class NullUser < NilClass; end; user =NullUser.new; user ? true : false` => false
kapil___ has quit [Quit: Connection closed for inactivity]
<ellcs> but why subclassing it, i mean you can just use nil itself
<apeiros> can you do nil.privileges ?
<apeiros> or nil.has_privilege?("edit_stuff")?
<ellcs> no, but your programm crashes at this point
<apeiros> which is not what I want
<phaul> but doesn't that mean u need to sublcass User?
<phaul> at least for the interface
<apeiros> all I need is a duck
<ellcs> i see
<apeiros> if it quacks like a user and walks like a user, it is a user. it just is not allowed to do anything :)
<ellcs> well, you might have a user "nil" entry xD
<apeiros> it simplifies the design a lot.
<apeiros> without the nulluser, I either have crashing apps, or I have to take care of nil *everywhere*
<phaul> yeah, I'm just not seeing why subclassing NilClass is needed
<ellcs> i mean, having a 'nil'-user in your database has the same benefits.
<apeiros> it isn't. it'd just make a couple of things nicer.
<apeiros> without that, I just use predicates
<apeiros> user.logged_in? f.ex.
<apeiros> hardcoded to true for User, hardcoded to false for NullUser
<apeiros> but it means you have to invent a predicate for every kind of class
t0xik has joined #ruby
dhollinger has quit [Read error: Connection reset by peer]
<apeiros> I'd rather treat NullObjects as falsy.
XB23 has joined #ruby
yohji has quit [Remote host closed the connection]
dhollinger has joined #ruby
venmx has joined #ruby
Charliebr73 has joined #ruby
Charliebr73 has left #ruby [#ruby]
Charliebr73 has joined #ruby
<phaul> where Im unsure about your design is that would you def has_priviledge? in your NullUser < NilClass? Or would have checks outside
<apeiros> NullUser has the same interface as User
<apeiros> since NullObjects usually deviate wildly from their non-null counterpart, a shared codebase was rarely a consideration
<apeiros> but yeah, maybe we could use a different approach than subclassing to turn an entire class falsy
<phaul> >> Object.instance_methods.grep(/to_/)
<ruby[bot]> phaul: # => [:to_enum, :to_s] (https://eval.in/1009793)
<phaul> at least to_s is there. I was thinking based on the same argument as the NullUser should have the interface of the User, NilClass should have the same interface as Object. But object doesn't respond to those things..
<apeiros> >> Object.instance_methods & NilClass.instance_methods
<ruby[bot]> apeiros: # => [:instance_of?, :public_send, :instance_variable_get, :instance_variable_set, :instance_variable_def ...check link for more (https://eval.in/1009794)
<apeiros> that's the common interface
<apeiros> >> {object_only: Object.instance_methods - NilClass.instance_methods, nil_only: NilClass.instance_methods - Object.instance_methods}
<ruby[bot]> apeiros: # => {:object_only=>[], :nil_only=>[:&, :^, :|, :to_a, :to_i, :to_f, :to_h, :to_r, :rationalize, :to_c]} (https://eval.in/1009796)
<apeiros> and as said, IMO the to_<num> and to_<collection> methods should not be in there
thapakazi has quit [Ping timeout: 248 seconds]
<apeiros> and while I see a reason for the logical operation methods, they probably shouldn't be either
yohji has joined #ruby
Guest4172 is now known as marahin
sytherax_ has joined #ruby
sytherax has quit [Ping timeout: 252 seconds]
mouni has joined #ruby
mouni has left #ruby [#ruby]
sytherax_ has quit [Ping timeout: 260 seconds]
rivalomega has joined #ruby
sytherax has joined #ruby
rivalomega has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 260 seconds]
RougeR has quit [Ping timeout: 256 seconds]
conta has quit [Remote host closed the connection]
<NL3limin4t0r> The object_only method result is kinda obvious since:
<NL3limin4t0r> >> NillClass.superclass
<ruby[bot]> NL3limin4t0r: # => uninitialized constant NillClass ...check link for more (https://eval.in/1009825)
minimalism has joined #ruby
<NL3limin4t0r> >> NilClass.superclass
<ruby[bot]> NL3limin4t0r: # => Object (https://eval.in/1009826)
conta has joined #ruby
<phaul> &ri Object.[]
<phaul> derpy?
amelliaa has joined #ruby
Guest26197 is now known as ged
conta has quit [Ping timeout: 252 seconds]
xuyuheng has joined #ruby
ged is now known as Guest58843
duderono_ has quit [Read error: Connection reset by peer]
<dminuoso> Where is adaedra
<phaul> [] is not an instance method of Object here on 2.5...
duderonomy has joined #ruby
<dminuoso> 11:00 apeiros | I'd rather treat NullObjects as falsy.
<phaul> /o\ I'm stupid :D
<dminuoso> How about not allowing it all.
alfiemax has joined #ruby
<phaul> I thought object_only: [] was object_only: [ :[] ] :D
sylario has joined #ruby
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
conta has joined #ruby
jyaworski has quit [Ping timeout: 252 seconds]
duderonomy has quit [Max SendQ exceeded]
duderonomy has joined #ruby
conta has quit [Ping timeout: 256 seconds]
roshanavand has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
jyaworski has joined #ruby
dbugger_ has quit [Remote host closed the connection]
conta has joined #ruby
Dbugger has joined #ruby
apparition has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
elphe has joined #ruby
kirun has joined #ruby
anisha has quit [Ping timeout: 240 seconds]
jyaworski has quit [Ping timeout: 260 seconds]
quobo has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
anisha has joined #ruby
karapetyan has joined #ruby
elphe has quit [Ping timeout: 268 seconds]
Mike11 has joined #ruby
apeiros has joined #ruby
guille-moe has quit [Quit: guille-moe]
plexigras has joined #ruby
guille-moe has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 264 seconds]
sytherax has quit [Remote host closed the connection]
xuyuheng has joined #ruby
elphe has joined #ruby
duderonomy has quit [Ping timeout: 245 seconds]
viq has joined #ruby
<viq> ruby bundler question: I'm trying to run "bundle install" pretty much on https://github.com/chef/inspec/blob/master/examples/kitchen-puppet/Gemfile and keep getting errors like "Network error while fetching https://rubygems.org/quick/Marshal.4.8/minitest-5.11.3.gemspec.rz (execution expired)", what am I doing wrong?
alfiemax has quit [Remote host closed the connection]
guille-moe has quit [Quit: guille-moe]
guille-moe has joined #ruby
ur5us has joined #ruby
alfiemax has joined #ruby
webhat has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
duderonomy has joined #ruby
webhat has joined #ruby
Guest73467 is now known as mkaito
ciscam has quit [Ping timeout: 256 seconds]
ellcs has joined #ruby
ciscam has joined #ruby
Guest58843 is now known as ged
ged is now known as Guest5592
alfiemax has quit [Ping timeout: 240 seconds]
mtkd has quit [Ping timeout: 256 seconds]
mtkd has joined #ruby
karapetyan has quit [Remote host closed the connection]
guille-moe has quit [Quit: guille-moe]
guille-moe has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
<phaul> viq, fwiw I can download that link here, so it's not the server side.
nertzy2 has joined #ruby
<viq> phaul: so can I using curl. Yet "bundle install" consistently fails
plexigras has quit [Ping timeout: 245 seconds]
nertzy has quit [Ping timeout: 264 seconds]
rmerry has left #ruby [#ruby]
plexigras has joined #ruby
karapetyan has joined #ruby
elphe has joined #ruby
ur5us has quit [Remote host closed the connection]
ellcs has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
emilford has quit [Ping timeout: 264 seconds]
contradictioned has quit [Ping timeout: 256 seconds]
Mike11 has quit [Ping timeout: 240 seconds]
emilford has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 248 seconds]
jamesaxl has joined #ruby
contradictioned has joined #ruby
Guest69234 is now known as r3dc0d3r
t0xik has quit [Quit: Connection closed for inactivity]
xuyuheng has quit [Ping timeout: 260 seconds]
xuyuheng has joined #ruby
<viq> phaul: it started working when I disabled IPv6 on my machine...
<phaul> viq: all is well then :)
paul_ has joined #ruby
xuyuheng has quit [Ping timeout: 276 seconds]
Cavallari has joined #ruby
duderonomy has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
ellcs has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
ciscam has quit [Ping timeout: 245 seconds]
ciscam has joined #ruby
ur5us has joined #ruby
coderphive has joined #ruby
AJA4350 has joined #ruby
ur5us has quit [Remote host closed the connection]
coderphive has quit [Client Quit]
ipe has joined #ruby
ur5us has joined #ruby
contradictioned has quit [Ping timeout: 245 seconds]
tvw has quit []
ellcs has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 256 seconds]
jottr has joined #ruby
Guest25333 has quit []
ldnunes has joined #ruby
Guest25333 has joined #ruby
contradictioned has joined #ruby
brucebag has quit [Quit: brucebag nipped out]
Guest25333 has quit [Client Quit]
brucebag has joined #ruby
brucebag has joined #ruby
brucebag has quit [Changing host]
graingert has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
Guest5592 is now known as ged
ged is now known as Guest76059
jrabe has quit [Quit: Disconnected]
jrabe has joined #ruby
donofrio has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
canton7 has quit [Ping timeout: 240 seconds]
jcalla has joined #ruby
canton7 has joined #ruby
sytherax has joined #ruby
catphish has joined #ruby
sytherax has quit [Ping timeout: 240 seconds]
<catphish> is there a correct way to allow instance of a custom class to be "coerced" into an expected object?
<catphish> for example Fixnum#+ expects a number as a parameter, but i want to pass something that's not a numeric
ShekharReddy has joined #ruby
oleo has joined #ruby
<catphish> (and allow it to be coerced)
<phaul> does that thing respond to to_i? Can you make it to if not?
<phaul> that's what I would try
<phaul> not sure if it's "the correct way" tho
<catphish> i just found there's a method called coerce that might help
<apeiros> catphish: see #coerce
<apeiros> probably best Numeric#coerce
<apeiros> (for docs I mean)
<apeiros> >> class Two; def coerce(other); [other, 2]; end; end; two = Two.new; 1 + two
<ruby[bot]> apeiros: # => 3 (https://eval.in/1010072)
<catphish> coerce is odd
<dminuoso> catphish: wait a sec!
<catphish> 1) first of all, method_missing doesn't receive coerce
<catphish> defining "def coerce; super; end" causes different behaviour to not defining it
<dminuoso> catphish: https://eval.in/1010074
<dminuoso> Coercing done right.
<dminuoso> Usual disclaimer: I will not be held responsible if you run this in production code. ;o
<catphish> basically, i can't extend primative classes, so doing something like this to carry them around in a wrapper https://paste.ubuntu.com/p/FFyNh9BDHS/
<catphish> not the actual code, i paraphrase, but that's the concept, not sure why it's necessary to define coerce explicitly here
<catphish> not sure how ugly this is, but it works
codymj has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
gnufied has joined #ruby
<apeiros> catphish: your object probably recevies a respond_to?(:coerce)
<apeiros> so if you omitted a proper respond_to_missing? impl, then it won't even try to invoke .coerce
chouhoulis has quit [Ping timeout: 240 seconds]
<apeiros> and seeing your paste, you did in fact not add a proper respond_to_missing. you should amend that. there's a couple of things which will not work properly without it.
Burgestrand has quit [Quit: Good bye and have a nice day!]
<apeiros> baweaver: ruby tip for tomorrow: "if you implement method_missing, also implement a corresponding respond_to_missing?" ;-)
roshanavand has quit [Ping timeout: 245 seconds]
alfiemax has quit [Ping timeout: 252 seconds]
<catphish> apeiros: thanks, i'll implement respond_to_missing, it seems that at least #corerce and #to_s are implicitly definied, and so don't go to method_missing
<catphish> or it may be the result of my respond_to_missing, or a combination :)
<catphish> *my missing respond_to_missing
<catphish> thanks
Mike11 has joined #ruby
* dminuoso gave you the best coerce in the world
<dminuoso> and you ignored it :(
<catphish> i did :)
<dminuoso> Because it was called _cast?
<catphish> that did scare me a little, yes
<catphish> would you like a slice of my gdpr cake to make up for it? https://i.imgur.com/hvEh0V6.jpg
<dminuoso> It directly pokes in the ruby land vm and changes the class pointer!
<dminuoso> Haha
sysfault has quit [Ping timeout: 252 seconds]
marr has joined #ruby
Guest76059 is now known as ged
sysvalve has quit [Read error: Connection reset by peer]
ged is now known as Guest57223
sysvalve has joined #ruby
jarnalyrkar has joined #ruby
tag has quit [Quit: Connection closed for inactivity]
mjolnird has quit [Remote host closed the connection]
kmurphy4 has joined #ruby
gigetoo has quit [Read error: No route to host]
gigetoo has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
jarnalyrkar has quit [Quit: Leaving]
jarnalyrkar has joined #ruby
chmurifree has quit [Ping timeout: 256 seconds]
shinnya has joined #ruby
XB23 has quit [Quit: Leaving]
mostlybadfly has joined #ruby
aupadhye has quit [Remote host closed the connection]
dionysus69 has quit [Quit: dionysus69]
chouhoulis has joined #ruby
duderono_ has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
bmurt has joined #ruby
rippa has joined #ruby
ta_ has joined #ruby
norfumpit has joined #ruby
mjolnird has joined #ruby
<norfumpit> is it safe to change value of Net::HTTP::HTTPVersion inside a passenger environment? i think I might be having some concurrency issues due to my changing that constant around a block of code
ferr_ has quit [Quit: WeeChat 2.1]
quobo has quit [Quit: Connection closed for inactivity]
viq has left #ruby [#ruby]
houhoulis has joined #ruby
jyaworski has joined #ruby
rivalomega has joined #ruby
mtkd has quit [Ping timeout: 268 seconds]
mtkd has joined #ruby
rivalomega has quit [Remote host closed the connection]
grilix_ has joined #ruby
Rapture has joined #ruby
Asher has joined #ruby
paul_ has quit [Ping timeout: 260 seconds]
Asher has quit [Ping timeout: 240 seconds]
krawchyk[away] has joined #ruby
biberu has quit [Ping timeout: 256 seconds]
chouhoulis has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk[away] has quit [Client Quit]
conta has quit [Ping timeout: 268 seconds]
bmurt has joined #ruby
<apeiros> catphish: sorry, got distracted by RL. you should google for examples of how to implement numeric-like classes in ruby. iirc there are good examples around.
houhoulis has quit [Remote host closed the connection]
kmurphy4 has quit [Quit: kmurphy4]
ta_ has quit [Ping timeout: 245 seconds]
Guest57223 is now known as ged
venmx has quit [Ping timeout: 268 seconds]
ged is now known as Guest34091
kmurphy4 has joined #ruby
venmx has joined #ruby
jyaworski has quit [Ping timeout: 245 seconds]
sysfault has joined #ruby
<catphish> apeiros: RL is boring
\13k has quit [Ping timeout: 256 seconds]
syndikate has quit [Ping timeout: 256 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kmurphy4 has quit [Ping timeout: 240 seconds]
apparition has quit [Quit: Bye]
syndikate has joined #ruby
eckhardt_ has joined #ruby
\13k has joined #ruby
alfiemax has joined #ruby
bmurt has joined #ruby
phaul has quit [Ping timeout: 260 seconds]
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 260 seconds]
mlkkk has quit [Remote host closed the connection]
mlkkk has joined #ruby
jamiejackson has joined #ruby
Mike11 has quit [Quit: Leaving.]
bmurt has quit [Ping timeout: 248 seconds]
hlmjr has quit [Ping timeout: 245 seconds]
mlkkk has quit [Ping timeout: 256 seconds]
chouhoulis has joined #ruby
hlmjr has joined #ruby
Charliebr73 has quit []
DTZUZO has joined #ruby
mostly-harmless has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has quit [Remote host closed the connection]
conta has joined #ruby
lxsameer has joined #ruby
beefjoe70 has joined #ruby
coderphive has joined #ruby
ShekharReddy has quit [Quit: Connection closed for inactivity]
Cavallari has quit [Quit: Cavallari]
mtkd has quit []
clemens3 has quit [Ping timeout: 240 seconds]
nayena has joined #ruby
cagomez has joined #ruby
sytherax has joined #ruby
nayena has quit [Ping timeout: 260 seconds]
cagomez has quit []
Guest34091 is now known as ged
ged is now known as Guest5706
kapil___ has joined #ruby
apeiros has joined #ruby
mtkd has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
aufi has quit [Remote host closed the connection]
plexigras has quit [Ping timeout: 268 seconds]
rivalomega has joined #ruby
plexigras has joined #ruby
amar has quit [Remote host closed the connection]
rivalomega has quit [Remote host closed the connection]
rivalomega has joined #ruby
alfiemax has quit [Remote host closed the connection]
paul_ has joined #ruby
Meowcenary has joined #ruby
zacts has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
rivalomega has quit [Remote host closed the connection]
nayena has joined #ruby
alfiemax has joined #ruby
<beefjoe70> can I get the type of the result for eval(1+1) ?
<havenwood> beefjoe70: The type is always Object, arguably. ;-P
<havenwood> beefjoe70: You can ask any Object its class with Object#class.
<havenwood> >> eval('1 + 1').class
<ruby[bot]> havenwood: # => Fixnum (https://eval.in/1010186)
<havenwood> (Integer, in modern Ruby.)
<beefjoe70> what's the method to return the typeOf ?
<mozzarella> focus brother
<havenwood> >> 'beefjoe70'.class
<ruby[bot]> havenwood: # => String (https://eval.in/1010189)
mtkd has quit [Ping timeout: 268 seconds]
<beefjoe70> oh didn't see it before
<beefjoe70> thanks!
paul_ has quit [Ping timeout: 260 seconds]
mtkd has joined #ruby
yohji has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
Asher has joined #ruby
nayena has quit [Ping timeout: 264 seconds]
cthulchu has joined #ruby
rivalomega has joined #ruby
jamiejackson has quit [Ping timeout: 245 seconds]
Deesl has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quobo has joined #ruby
Deesl has joined #ruby
beefjoe70 has quit [Remote host closed the connection]
ta_ has joined #ruby
catphish has quit [Quit: Leaving]
BTRE has quit [Ping timeout: 245 seconds]
rivalomega has quit [Remote host closed the connection]
rivalomega has joined #ruby
elomatreb has joined #ruby
hlmjr has quit [Quit: Konversation terminated!]
thapakazi has joined #ruby
tipyn has joined #ruby
sysvalve has quit [Quit: Leaving]
wontruefree has joined #ruby
karapetyan has quit [Remote host closed the connection]
jamesaxl has quit [Quit: WeeChat 2.1]
jcarl43 has joined #ruby
Guest5706 is now known as ged
ged is now known as Guest54758
mtkd has quit []
mtkd has joined #ruby
eckhardt_ has joined #ruby
ldnunes has quit [Quit: Leaving]
amar has joined #ruby
ldnunes has joined #ruby
alfiemax_ has joined #ruby
ta_ has quit [Ping timeout: 256 seconds]
alfiemax has quit [Ping timeout: 264 seconds]
amar has quit [Ping timeout: 252 seconds]
phaul has joined #ruby
amar has joined #ruby
eckhard__ has joined #ruby
raynold has joined #ruby
guille-moe has quit [Ping timeout: 265 seconds]
\void has joined #ruby
eckhardt_ has quit [Ping timeout: 260 seconds]
amar has quit [Ping timeout: 252 seconds]
<baweaver> apeiros: I already have a list :P
<apeiros> thought as much
<baweaver> I've made it some 15 days in advance so far, aiming for 30 to 60 when I have some spare time to sit down and write more.
<baweaver> Struct is a fun one. It acts like a hash, an array, and an object.
tipyn has quit [Remote host closed the connection]
amar has joined #ruby
emilford has quit [Ping timeout: 260 seconds]
emilford has joined #ruby
nitric has joined #ruby
<havenwood> >> require 'json/add/struct'; Point = Struct.new(:x, :y); JSON.load Point.new(42, 42).to_json
<ruby[bot]> havenwood: # => #<struct Point x=42, y=42> (https://eval.in/1010245)
pilne has joined #ruby
yehdawg has joined #ruby
biberu has joined #ruby
ramfjord has joined #ruby
<havenwood> >> require 'json/add/symbol'; JSON.load([:ok].to_json)
<ruby[bot]> havenwood: # => [:ok] (https://eval.in/1010253)
<yehdawg> hey I was trying to get into Ruby but don't really know where to start. Any recommendations of resources that helped you?
<havenwood> baweaver: Yeah, Struct is an interesting one.
amar has quit [Ping timeout: 252 seconds]
suukim has quit [Quit: Konversation terminated!]
sytherax has quit [Remote host closed the connection]
arne has joined #ruby
<arne> is it true that if a method is called with a block and params
<havenwood> yehdawg: Once you get the basics, Exercism.io is a nice way to get feedback on challenges.
<arne> and i "overload" it, the block gets passed on implictly?
<havenwood> yadnesh: tryruby.org is a good thing to get started on
<havenwood> yadnesh: oops, MT
sytherax has joined #ruby
<arne> it's a bug.. nota feature :o
<havenwood> arne: Show an example of what you mean?
<havenwood> arne: When you say overload it, do you mean using?: super
<arne> pretty much what is said there
<havenwood> arne: super without parens passes on args automagically
<havenwood> arne: super() with parens doesn't
<arne> havenwood: well, exactly that's what i expected
shinnya has quit [Ping timeout: 240 seconds]
thinkpad has quit [Ping timeout: 248 seconds]
<arne> but super() will still send the block
<arne> and so will super(some_fancy_params*)
<havenwood> arne: yeah, that's true
<arne> wow, that really caught me offguard
thinkpad has joined #ruby
emilford has quit [Ping timeout: 248 seconds]
<yehdawg> @havenwood thank you!
amar has joined #ruby
jenrzzz has joined #ruby
emilford has joined #ruby
segy has quit [Ping timeout: 240 seconds]
<NL3limin4t0r> yehdawg: The Ruby docs have also some documentation that pretty usefull when new to Ruby. See the first alinea of http://ruby-doc.org/core-2.5.1/ This however is not in tutorial form and just shows you things like controll expressions, assignment, etc.
venmx has quit [Ping timeout: 260 seconds]
yehdawg has quit [Ping timeout: 252 seconds]
segy has joined #ruby
segy has quit [Excess Flood]
emilford has quit [Ping timeout: 240 seconds]
Immune has joined #ruby
yehdawg has joined #ruby
roshanavand has joined #ruby
<apeiros> havenwood: I really wish they'd have put this into JSON.<something>_load instead of plain .load
mostlybadfly has quit [Quit: Connection closed for inactivity]
<apeiros> that kind of thing is a primary source for security issues
emilford has joined #ruby
Immune has left #ruby [#ruby]
sytherax has quit [Remote host closed the connection]
nachoman has joined #ruby
BTRE has joined #ruby
arashb has joined #ruby
alfiemax_ has quit [Ping timeout: 268 seconds]
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
beefjoe has joined #ruby
sytherax has joined #ruby
clemens3 has joined #ruby
sytherax has quit [Read error: Connection reset by peer]
sytherax has joined #ruby
nachoman has quit [Ping timeout: 245 seconds]
Puffball has joined #ruby
thapakazi has quit [Quit: thapakazi]
sanscoeur has joined #ruby
segy has joined #ruby
karapetyan has joined #ruby
mostlybadfly has joined #ruby
nitric_ has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
physicist__ has joined #ruby
nitric has quit [Ping timeout: 245 seconds]
karapetyan has quit [Ping timeout: 260 seconds]
jyaworski has joined #ruby
jrich523 has joined #ruby
<jrich523> what are the things like %Q{} called?
alfiemax has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz_ has joined #ruby
<elomatreb> Percent-literals is the usual term I think
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest54758 is now known as ged
Guest90958 is now known as bougyman
ged is now known as Guest34421
<jrich523> awesome, thanks
Deesl has joined #ruby
<jrich523> that got me to a pretty solid page, thanks! https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Literals
amar_ has joined #ruby
rivalomega has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
xuyuheng has joined #ruby
ramfjord_ has joined #ruby
amar has quit [Ping timeout: 252 seconds]
segy has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 268 seconds]
cthulchu_ has joined #ruby
cthulchu_ has quit [Max SendQ exceeded]
chouhoulis has quit [Ping timeout: 245 seconds]
cthulchu_ has joined #ruby
<havenwood> arne: I did a little Gist example showing the odd super keyword rules: https://gist.github.com/havenwood/3ca22b3e03a16509708002d6c3c13562
segy has joined #ruby
xuyuheng has quit [Ping timeout: 260 seconds]
mtkd has quit []
<havenwood> I do think Bongo and Wombat are little-known.
mtkd has joined #ruby
arashb_ has joined #ruby
cthulchu_ has quit [Max SendQ exceeded]
cthulchu_ has joined #ruby
rivalomega has joined #ruby
cthulchu has quit [Ping timeout: 260 seconds]
<havenwood> Qux is a more widely-known idiosyncrasy of super.
arashb has quit [Ping timeout: 268 seconds]
<apeiros> havenwood: you should add `def foo(arg); arg = "changed"; super; end`
alfiemax has quit [Remote host closed the connection]
<audy> 7/
<audy> oops
jyaworski has quit [Ping timeout: 248 seconds]
bmurt has joined #ruby
ramfjord_ has quit [Ping timeout: 245 seconds]
tipyn has joined #ruby
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
amar_ has quit [Read error: Connection reset by peer]
amar has joined #ruby
amar has quit [Read error: Connection reset by peer]
Deesl has joined #ruby
amar has joined #ruby
mtkd has quit []
bmurt has quit [Ping timeout: 264 seconds]
xuyuheng has joined #ruby
sanscoeur has quit [Remote host closed the connection]
sanscoeur has joined #ruby
xuyuheng has quit [Ping timeout: 245 seconds]
segy has quit [Ping timeout: 245 seconds]
Mike11 has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
sanscoeur has quit [Ping timeout: 245 seconds]
yehdawg has quit [Quit: Leaving]
segy has joined #ruby
alfiemax has joined #ruby
dviola has joined #ruby
donkey_hotei has joined #ruby
sytherax has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
karapetyan has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
xuyuheng has joined #ruby
<donkey_hotei> Hello, I posted a ruby question on SO about Ruby's memoization operator and the null object pattern https://stackoverflow.com/questions/50535106/ruby-memoization-and-null-object-pattern
<donkey_hotei> Maybe ya'll rubyists have a clue ;-)
alfiemax_ has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
beefjoe has quit [Ping timeout: 256 seconds]
chef_byd has joined #ruby
xuyuheng has quit [Ping timeout: 245 seconds]
ta_ has joined #ruby
eckhard__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
emilford has quit [Ping timeout: 268 seconds]
<baweaver> donkey_hotei: Huh. That's interesting. I'd think overwriting `=` might do it.
alfiemax has quit [Ping timeout: 276 seconds]
emilford has joined #ruby
chouhoulis has joined #ruby
<baweaver> Give me a bit to play with it
<apeiros> donkey_hotei: no, you can't
<apeiros> || is syntax and it does not use any method on the object to identify falsiness. it uses object identity with nil/false
<apeiros> I'd do memoization with NullObjects like: `def initialize; @thing = NoThing.new; end; def memoized_thing; if @thing.none? then @thing = Thing.new end; @thing; end`
<apeiros> though honestly if you memoize, when would you actually use the NullObject?
<apeiros> and if you don't ever actually use it: just go with nil and ||=
<baweaver> donkey_hotei: also stay away from windmills
<apeiros> why? is the don not one of your idols?
<baweaver> Windmills did nothing wrong T_T
<apeiros> they're evil incarnate
<baweaver> Now I kinda want the ability to make something falsy...
<apeiros> you missed our earlier conversation about nullobjects then :)
<baweaver> donkey_hotei: You might enjoy the idea of Either.
emilford has quit [Ping timeout: 256 seconds]
tipyn has quit [Remote host closed the connection]
Guest34421 is now known as ged
<baweaver> Option / Either / Maybe come from FP land, but do a lot more than a null object pattern.
ged is now known as Guest79708
t0xik has joined #ruby
segy has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
segy has joined #ruby
tipyn has joined #ruby
duderonomy has quit [Ping timeout: 256 seconds]
contradictioned has quit [Ping timeout: 256 seconds]
<donkey_hotei> apeiros: good point, for now I went with switching on class name instead of memoizing
contradictioned has joined #ruby
<donkey_hotei> baweaver: haha ;-) thanks for the link - always love seeing FP patterns in OOP
emilford has joined #ruby
camilacott has joined #ruby
camilacott has quit [Read error: Connection reset by peer]
sysfault has quit [Ping timeout: 252 seconds]
lypsis is now known as lypsis|awy
<baweaver> There are a few more articles around it and I have a lot more on the way.
duderonomy has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
emilford has quit [Ping timeout: 256 seconds]
ModusPwnens has joined #ruby
<ModusPwnens> can someone explain why I can't do "(".tr('(', '%28')? I can't find any documentation on this anywhere and its driving me nuts
<ModusPwnens> for some reason it unexpectly outputs "%" instead of "%28"
ta_ has quit [Ping timeout: 256 seconds]
<elomatreb> String#tr substitues single characters
<elomatreb> It finds the matching index in the first argument, and replaces it with the corresponding index in the second
<ModusPwnens> i see.
<elomatreb> gsub may be what you want
<ModusPwnens> Yeah, i'll have to resort to using gsub then
jenrzzz_ has quit [Ping timeout: 248 seconds]
xuyuheng has joined #ruby
<ModusPwnens> thanks
dviola has quit [Quit: WeeChat 2.1]
emilford has joined #ruby
xuyuheng has quit [Ping timeout: 256 seconds]
reber has left #ruby ["Leaving"]
mkroman has quit [Quit: Reconnecting]
mkroman has joined #ruby
ModusPwnens has quit [Quit: Page closed]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
shinnya has joined #ruby
<baweaver> gsub also takes a hash second argument which is fun
<baweaver> >> '((fun))'.gsub(/[\(\)]/, '(' => '<', ')' => '>')
<ruby[bot]> baweaver: # => "<<fun>>" (https://eval.in/1010330)
<baweaver> Hm. Gsub tricks. That'll give me another 4-5 days
conta has quit [Ping timeout: 252 seconds]
jarnalyrkar has quit [Remote host closed the connection]
<apeiros> go through ruby core and you have enough for a year I think 😂
<apeiros> it's a great idea btw.
mrush_ has quit [Ping timeout: 260 seconds]
mrush has joined #ruby
mrush is now known as Guest46587
eckhardt_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
quobo has joined #ruby
xuyuheng has joined #ruby
KeyJoo has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
alfiemax has joined #ruby
GodFather has joined #ruby
xuyuheng has quit [Ping timeout: 245 seconds]
eckhardt_ has quit [Ping timeout: 256 seconds]
sagax has joined #ruby
mtkd has quit []
jenrzzz_ has joined #ruby
eckhardt_ has joined #ruby
conta has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
karapetyan has quit [Remote host closed the connection]
jyaworski has joined #ruby
mtkd has joined #ruby
conta has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
xuyuheng has joined #ruby
ur5us has joined #ruby
alfiemax has joined #ruby
xuyuheng has quit [Ping timeout: 252 seconds]
karapetyan has quit [Remote host closed the connection]
Guest79708 is now known as ged
ged is now known as Guest23764
karapetyan has joined #ruby
tipyn_ has joined #ruby
tipyn has quit [Read error: Connection reset by peer]
tipyn_ has quit [Read error: Connection reset by peer]
tag has joined #ruby
cthu| has joined #ruby
ipe has left #ruby ["Leaving"]
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu_ has quit [Ping timeout: 245 seconds]
Deesl has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
drakko has joined #ruby
jyaworski has quit [Ping timeout: 252 seconds]
desperek has quit [Ping timeout: 268 seconds]
drakko is now known as desperek
desperek has quit [Changing host]
desperek has joined #ruby
xuyuheng has joined #ruby
ta_ has joined #ruby
dr3w_ has joined #ruby
xuyuheng has quit [Ping timeout: 240 seconds]
jcalla has quit [Quit: Leaving]
coderphive has quit [Quit: coderphive]
jinie has quit [Remote host closed the connection]
coderphive has joined #ruby
arashb has joined #ruby
alfiemax_ has joined #ruby
arashb_ has quit [Ping timeout: 252 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
f3ttX] has joined #ruby
xuyuheng has joined #ruby
xuyuheng has quit [Ping timeout: 252 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sanscoeur has joined #ruby
biberu has quit []
eckhardt_ has joined #ruby
eckhardt_ has quit [Client Quit]
Deesl has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xuyuheng has joined #ruby
desperek has quit [Quit: xoxo]
sanscoeur has quit []
sanscoeur has joined #ruby
banisterfiend has joined #ruby
xuyuheng has quit [Ping timeout: 245 seconds]
grilix_ has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 252 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mlkkk has joined #ruby
cyberg has joined #ruby
ldnunes has quit [Quit: Leaving]
clemens3 has quit [Ping timeout: 245 seconds]
Guest23764 is now known as ged
ged is now known as Guest98248
clemens3_ has quit [Ping timeout: 276 seconds]
jenrzzz_ has quit [Ping timeout: 245 seconds]
mikeeeeeeey has quit [Quit: Page closed]
schleppel has quit [Quit: Konversation terminated!]
xuyuheng has joined #ruby
jenrzzz has joined #ruby
emilford has quit [Ping timeout: 245 seconds]
wontruefree has quit [Quit: bye]
xuyuheng has quit [Ping timeout: 245 seconds]
emilford has joined #ruby
Meowcenary has quit []
plexigras has quit [Ping timeout: 260 seconds]
wontruefree has joined #ruby
wontruefree has quit [Client Quit]
emilford has quit [Ping timeout: 268 seconds]
chihhsin has quit [Ping timeout: 265 seconds]
emilford has joined #ruby
xuyuheng has joined #ruby
wontruefree has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
xuyuheng has quit [Ping timeout: 240 seconds]
wontruefree has quit [Client Quit]
physicist__ has quit [Ping timeout: 260 seconds]
Immune has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
emilford has quit [Ping timeout: 252 seconds]
chihhsin has joined #ruby
Immune has left #ruby [#ruby]
phaul has quit [Ping timeout: 248 seconds]
emilford has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
amelliaa has quit [Quit: -]
wontruefree has joined #ruby
emilford has quit [Ping timeout: 245 seconds]
Mike11 has quit [Quit: Leaving.]
emilford has joined #ruby
mtkd has quit []
yokel has quit [Remote host closed the connection]
xuyuheng has joined #ruby
coderphive has quit [Quit: coderphive]
ruby[bot] has quit [Read error: Connection reset by peer]
emilford has quit [Ping timeout: 248 seconds]
yokel has joined #ruby
ruby[bot] has joined #ruby
emilford has joined #ruby
wontruefree has quit [Quit: bye]
codymj has quit [Quit: Leaving]
xuyuheng has quit [Ping timeout: 248 seconds]
tfitts has quit [Quit: Connection closed for inactivity]
ciscam has quit [Ping timeout: 240 seconds]
banisterfiend has joined #ruby
emilford has quit [Ping timeout: 252 seconds]
Glenjamin has joined #ruby
ciscam has joined #ruby
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
<Glenjamin> Hi all, I'm getting an odd error from bundler, and it's proving very hard to google for, can anyone point me in the right direction?
<Glenjamin> ```
<Glenjamin> /var/folders/dl/n48gqs8s6fq81lxplt137spc0000gn/T/bundler20180525-69026-131qnmddiff-lcs-1.3/bin directory.
<Glenjamin> Gem::FilePermissionError: You don't have write permissions for the
<Glenjamin> ```
<Glenjamin> That dir is inside $TMPDIR, and doesn't seem to exist after the failure
paraxial has joined #ruby
<Glenjamin> I do get prompted for sudo, but it fails anyway
alfiemax_ has quit [Remote host closed the connection]
<baweaver> Glenjamin: how did you install Ruby?
<baweaver> how do you normally install gems?
emilford has joined #ruby
<Glenjamin> OSX system ruby i think - first time i've used Ruby on this laptop
<baweaver> Can you run `which ruby`, `ruby -v`
Deesl has quit [Quit: Textual IRC Client: www.textualapp.com]
<Glenjamin> > which ruby; ruby -v
<Glenjamin> ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
<Glenjamin> /usr/bin/ruby
<baweaver> Gotcha. It's old enough that I'd probably avoid it
<baweaver> Huh
<baweaver> they upgraded
<Glenjamin> bundler installed via `sudo gem install bundler`
<baweaver> Anyways, one sec, got a guide for OSX
jyaworski has joined #ruby
cthulchu_ has joined #ruby
<baweaver> Remember that sudo and your user are different
<baweaver> meaning anything you try and get path to afterwards is different, including ruby version and the rest of it
xuyuheng has joined #ruby
<baweaver> That should get you on a stable version.
<baweaver> Latest is 2.5.1 on Ruby
<baweaver> but the instructions are pretty well the same.
<Glenjamin> ah ok, ta - i'll try an up-to-date ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
venmx has joined #ruby
<baweaver> Yeah, anything that sudo installs a gem is a mess waiting to happen, because then you have an arms race of always needing it to do anything
<baweaver> especially because sudo will root own everything it touches on that
<baweaver> which is likely the cause of your problems
cthu| has quit [Ping timeout: 260 seconds]
<Glenjamin> but the symptoms don't match that
xuyuheng has quit [Ping timeout: 260 seconds]
<Glenjamin> bundler correctly prompts for sudo to try and install into the system gem folder, and the permissions error is on a tempdir
<Glenjamin> i'm thinking this might be because of the version of rubygems that comes with 2.3.0 though
emilford has quit [Ping timeout: 245 seconds]
Guest98248 is now known as ged
emilford has joined #ruby
ged is now known as Guest62306
<Glenjamin> hrm, I've added some debug logging into bundler to help understand the issue more - the generated tempdir itself is user-owned, but the `bin` dir inside it is root owned
<zenspider> can anyone confirm that bbatsov/rubocop doesn't have a clean test run out of the box (I *just* checked out)
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
<zenspider> ah. and it appears that it is literally running the tests twice and doco and and and when you run the default task.
<Glenjamin> aha, found it - it's a bug in bundler that only kicks in under weird circumstances
<havenwood> zenspider: cloned and run locally with 2.5.1, seeing two test runs and both passing with pendings
<havenwood> zenspider: 21700 examples, 0 failures, 6 pending
emilford has quit [Ping timeout: 268 seconds]
jyaworski has quit [Ping timeout: 240 seconds]
<zenspider> havenwood: thanks. I'm seeing that too. Is there a cheap/easy way to filter out the pendings so I don't even see them?
<Glenjamin> if `requires_sudo?` is true, and rubygems is < 2.7.5, then it runs `mkdir_p bin_path`, but internally that also checks `requires_sudo?` and makes the dir as root
<zenspider> WHAT I REALLY WANT: a good ruby project that uses rspec idiomaticall and dosn't have nasty external dependencies
<zenspider> preferably faster than these... 45 seconds for the one run is a bit much... totally doable... I could also just run a subset
kirun has quit [Quit: Konversation terminated!]
emilford has joined #ruby
xuyuheng has joined #ruby
venmx has quit [Ping timeout: 240 seconds]
<zenspider> time rspec spec/rubocop/formatter/ # => 2.88 seconds. that's doable
<zenspider> but man... 2.88 seconds for 1.12 seconds worth of tests. WTF?+
jmux has joined #ruby
ur5us has quit [Remote host closed the connection]
<zenspider> "files took 1.04 seconds to load"... that means 25% of the time is unaccounted for
zenspider has quit [Changing host]
zenspider has joined #ruby
<havenwood> zenspider: Seems there's not an RSpec option to silence pending, so you'd need a custom formatter: https://github.com/rspec/rspec-core/issues/2377
<zenspider> I'd rather just cut them out
<zenspider> but for now, I can run those formatter tests and get 90% of what I need for now
xuyuheng has quit [Ping timeout: 245 seconds]
<Glenjamin> wrote up the bundler issue as https://github.com/bundler/bundler/issues/6555 in case anyone was following along with interest :)
<zenspider> just running one file: (1.715−0.051−0.989)/1.715 = ~40% unaccounted for... why is rspec SO heavy?
ogres has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
<zenspider> consistently 25-40% overhead for the smaller sets
cthu| has joined #ruby
ur5us has joined #ruby
mostly-harmless has quit [Ping timeout: 256 seconds]
emilford has quit [Ping timeout: 245 seconds]
emilford has joined #ruby
cthulchu_ has quit [Ping timeout: 240 seconds]
<zenspider> havenwood: if you just run `rspec spec/cop` do you get 2 failures + 6 pending?
mostly-harmless has joined #ruby
GodFather has quit [Ping timeout: 256 seconds]
<havenwood> checking
<havenwood> zenspider: with `bundle exec rspec spec/rubocop` I got: 21682 examples, 0 failures, 6 pending
<havenwood> (i don't have a spec/cop, using clone of master)
karapetyan has quit [Remote host closed the connection]
<zenspider> `gem list rspec-rails` has output for you, I assume?
<zenspider> looks like they depend on it in the tests, but don't declare it to bundler
emilford has quit [Ping timeout: 248 seconds]
GodFather has joined #ruby
emilford has joined #ruby
xuyuheng has joined #ruby
<havenwood> zenspider: nope, I don't have it installed
<havenwood> gem which rspec-rails #!> ERROR: Can't find Ruby library file or shared library rspec-rails
<zenspider> huh! I wonder why I'm seeing that. doesn't matter. Anything noisy I'm just gonna cut out. there are ~22k specs here. I've got plenty to poke at.
mostly-harmless has quit [Ping timeout: 252 seconds]
xuyuheng has quit [Ping timeout: 240 seconds]
mostly-harmless has joined #ruby
emilford has quit [Ping timeout: 256 seconds]
emilford has joined #ruby
capellaS7 has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
emilford has quit [Ping timeout: 260 seconds]
emilford has joined #ruby
orbyt_ has joined #ruby
chouhoulis has quit [Ping timeout: 248 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
emilford has quit [Ping timeout: 252 seconds]
go|dfish has quit [Ping timeout: 268 seconds]
f3ttX] has quit [Remote host closed the connection]
ciscam has quit [Ping timeout: 245 seconds]
nertzy2 has quit [Read error: No route to host]
ciscam has joined #ruby
emilford has joined #ruby
emilford has quit [Ping timeout: 264 seconds]
jmux has quit [Quit: Leaving]
emilford has joined #ruby
Guest62306 is now known as ged
ged is now known as Guest39593
amar has quit [Remote host closed the connection]
go|dfish has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthu| has quit [Ping timeout: 252 seconds]
emilford has quit [Ping timeout: 240 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
herbmillerjr has joined #ruby
tdy has quit [Ping timeout: 260 seconds]
white_lilies has joined #ruby
karapetyan has joined #ruby
ur5us has quit [Remote host closed the connection]
shortdudey123_ has joined #ruby
shortdudey123 has quit [Ping timeout: 252 seconds]
shortdudey123_ is now known as shortdudey123
marr has quit [Ping timeout: 265 seconds]