baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
dviola has joined #ruby
<RedNifre> but why? YAML.load_file was so trivial, why is there no trivial way to write it? Why Psych all of a sudden?
<RedNifre> Oh, Psych sits in the YAML variable when I do require 'yaml' ?
<RedNifre> oh well, I guess I'll do the File thing then.
mikecmpbll has quit [Quit: inabit. zz.]
sameerynho has quit [Ping timeout: 252 seconds]
despai has joined #ruby
mrush has joined #ruby
<Radar> RedNifre: Yaml.safe_load is what you should be doing.
<Radar> load_file can convert serialised Ruby to actual Ruby.
<Radar> Why the default is to not load it safely is beyond me.
<Radar> "--- !ruby/class 'RedNifre'\n" <- load this yaml with load + safe_load to see the difference.
duderonomy has quit [Ping timeout: 272 seconds]
dviola_ has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
dviola_ is now known as dviola
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
_whitelogger has joined #ruby
havenwood has quit [Quit: ZNC 1.7.1 - https://znc.in]
havenwood has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
Turnikov has joined #ruby
herbmillerjr has quit [Excess Flood]
herbmillerjr has joined #ruby
Turnikov has quit [Read error: Connection reset by peer]
dbz has quit [Remote host closed the connection]
bryanray has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
bryanray has quit [Client Quit]
despai has quit [Ping timeout: 272 seconds]
mroutis has joined #ruby
mroutis has quit [Remote host closed the connection]
jaszhix has quit [Remote host closed the connection]
tdy has joined #ruby
RedNifre_ has joined #ruby
RedNifre has quit [Ping timeout: 272 seconds]
Cyrus has quit [Quit: brb]
orbyt_ has joined #ruby
apeiros has quit [Remote host closed the connection]
Cyrus has joined #ruby
duderonomy has joined #ruby
_whitelogger has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 268 seconds]
tristanp has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
Puffball has joined #ruby
tristanp has quit [Ping timeout: 244 seconds]
AJA4350 has quit [Quit: AJA4350]
nicesignal has quit [Ping timeout: 252 seconds]
apeiros has joined #ruby
braincrash has quit [Quit: bye bye]
apeiros has quit [Ping timeout: 252 seconds]
braincrash has joined #ruby
nicesignal has joined #ruby
_whitelogger has joined #ruby
ghoti_ has quit [Ping timeout: 264 seconds]
_whitelogger has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has joined #ruby
apeiros has quit [Ping timeout: 252 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
kapil___ has joined #ruby
dbz has joined #ruby
apeiros has joined #ruby
gix has joined #ruby
thy0 has quit [Quit: TTFN]
aupadhye has joined #ruby
apeiros has quit []
_whitelogger has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has joined #ruby
evdubs has joined #ruby
jp has quit [Read error: Connection reset by peer]
jp has joined #ruby
dbz has quit [Remote host closed the connection]
xall has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nima_m has joined #ruby
dbz has joined #ruby
dellavg_ has joined #ruby
dbz has quit [Ping timeout: 264 seconds]
DTZUZO has quit [Ping timeout: 244 seconds]
aupadhye has quit [Ping timeout: 264 seconds]
tdy has quit [Ping timeout: 252 seconds]
dbz has joined #ruby
dbz has quit [Ping timeout: 268 seconds]
dbz has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has quit [Quit: Leaving]
turt2live has quit [Ping timeout: 252 seconds]
Demos[m] has quit [Ping timeout: 260 seconds]
dviola has quit [Quit: WeeChat 2.2]
ur5us has quit [Remote host closed the connection]
Demos[m] has joined #ruby
agent_white has joined #ruby
turt2live has joined #ruby
aufi has joined #ruby
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raulp has quit [Read error: Network is unreachable]
snickers has joined #ruby
bier has quit [Ping timeout: 268 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
raulp has joined #ruby
DK2 has joined #ruby
reber has joined #ruby
dbz has quit [Remote host closed the connection]
CrazyEddy has quit [Remote host closed the connection]
wyoung has joined #ruby
dbz has joined #ruby
clemens3 has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
teclator has joined #ruby
bak1an has joined #ruby
mike11 has joined #ruby
dionysus69 has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
bak1an has quit [Ping timeout: 264 seconds]
nima_m has quit [Quit: Connection closed for inactivity]
clemens3 has joined #ruby
comet23 has joined #ruby
DTZUZO has joined #ruby
Tharbakim has quit [Ping timeout: 252 seconds]
bak1an has joined #ruby
Dbugger has joined #ruby
jamesaxl has quit [Quit: WeeChat 2.2]
Tharbakim has joined #ruby
dbz has quit [Remote host closed the connection]
eb0t_ has quit [Quit: WeeChat 2.0.1]
eb0t has joined #ruby
tty has quit [Quit: tty]
graphene has quit [Remote host closed the connection]
MarcWeber has left #ruby [#ruby]
graphene has joined #ruby
dbz has joined #ruby
lxsameer has joined #ruby
Burgestrand has joined #ruby
despai has joined #ruby
livcd_ has quit [Remote host closed the connection]
dbz has quit [Ping timeout: 272 seconds]
tristanp has joined #ruby
livcd has joined #ruby
tristanp has quit [Ping timeout: 272 seconds]
desperek has joined #ruby
Alina-malina has quit [Ping timeout: 244 seconds]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
kevinsjoberg has joined #ruby
arekushi has quit [Quit: Gateway shutdown]
dminuoso has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
xall has quit [Ping timeout: 252 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
graphene has quit [Read error: Connection reset by peer]
graphene has joined #ruby
jamesaxl has joined #ruby
ferhaty has joined #ruby
comet23 has quit [Ping timeout: 252 seconds]
xall has joined #ruby
aufi has quit [Ping timeout: 268 seconds]
GodFather has quit [Ping timeout: 264 seconds]
quintasan has joined #ruby
clorisu has joined #ruby
Emmanuel_Chanel has joined #ruby
Alina-malina has joined #ruby
sameerynho has joined #ruby
jamesaxl has quit [Ping timeout: 264 seconds]
<clorisu> does anybody know of any good explanations explaining the .times method? I'm having trouble understanding it or finding a good explanation.
<sonne> clorisu: isn't that the equivalent of for ( i=0; i<num; i++ ) { .. } ?
roshanavand has quit [Quit: leaving]
<sonne> clorisu: https://ruby-doc.org/core-2.2.2/Integer.html#method-i-times there's even the source code, it's pretty much that
vondruch has joined #ruby
<clorisu> sonne: I already checked that on the docs, it's too succint for me to comprehend clearly. I'm just beginning to learn programming
roshanavand has joined #ruby
<sonne> clorisu: simply stated: x.times do y end <-- does action y, x times. i don't think it gets simpler than that.. 123.times do puts 'hello' end, prints 'hello' 123 times
<dminuoso> clorisu: Frequently it's best to simply learn by repetition. Try it out, and develop an intuition.
<clorisu> sonne: i understand that loop. sorry I shouldve clarified. What i'm moreso confused about is the variable that it takes in that doc. eg `5.times do {|thisvar| puts thisvar end}` how does that variable work?
<dminuoso> clorisu: Think of a do-block as a function that is passed to a method as an extra argument.
<dminuoso> clorisu: Block variables are arguments of that function.
<dminuoso> clorisu: So you might think of this as: x.times(->(n) { puts n; })
xall has quit [Quit: xall]
<dminuoso> clorisu: The meaning of `n` here depends on whatever the method :times choses to call that function with.
<dminuoso> For the method Integer#times, it happens to do a kind of "for i in 0..n", and call that block with i for each iteration.
aupadhye has joined #ruby
Burgestrand has quit [Quit: Closing time!]
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> clorisu: https://eval.in/1050961
<dminuoso> clorisu: this is the same thing really :)
comet23 has joined #ruby
comet23 has left #ruby [#ruby]
<dminuoso> From that it should be obvious that you could call this `nTimes(10, ->(n) { puts n})`
<dminuoso> 10.times { |n| puts n }
<dminuoso> Is no different
<dminuoso> (The subtle differences are nothing to worry about for now)
mikecmpbll has joined #ruby
<dminuoso> It just looks syntactically different. With `do; end` blocks its not as immediately obvious that you are actually passing a *function* to a method. `obj.method do |abc| ... end` is semantically equivalent to `obj.method(->(abc) { ...})`
<dminuoso> The do-block is captured as a function, passed to the method and the method can then "call it" as a sort of callback whenver it wants
sameerynho has quit [Ping timeout: 264 seconds]
comet23 has joined #ruby
Bish has joined #ruby
<Bish> i would like to use authentication with mechanize in the form of http://a:b@c.de
<Bish> how does one do thath
dbz has joined #ruby
cfjk has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Quit: WeeChat 2.2]
gr33n7007h has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
gr33n7007h is now known as al2o3-cr
RedNifre has joined #ruby
Freshnuts has quit [Quit: Leaving]
RedNifre_ has quit [Ping timeout: 268 seconds]
clemens3 has quit [Remote host closed the connection]
clemens3 has joined #ruby
phoo1234567 has quit [Quit: Gotta go]
ur5us has joined #ruby
CrazyEddy has joined #ruby
vonfry has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
dbz has joined #ruby
jamesaxl has joined #ruby
vonfry has quit [Ping timeout: 264 seconds]
ur5us has quit [Remote host closed the connection]
Burgestrand has joined #ruby
ur5us has joined #ruby
dbz has quit [Ping timeout: 244 seconds]
ur5us has quit [Ping timeout: 252 seconds]
nowhere_man has joined #ruby
sameerynho has joined #ruby
comet23 has quit [K-Lined]
sameerynho has quit [Ping timeout: 264 seconds]
kevinsjoberg has joined #ruby
savolla has joined #ruby
aufi has joined #ruby
despai has quit [Quit: ...]
despai has joined #ruby
AJA4350 has joined #ruby
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
<kke> "bundle install --deployment" with a gemfile that just says "gemspec" seems to install all gems listed in "spec.add_development_dependency"?
mike11 has quit [Read error: Connection reset by peer]
<tbuehlmann> kke: seems about right, what's the problem?
<kke> tbuehlmann: i would assume --deployment does not include development dependencies
havenwood has quit [Quit: ZNC 1.7.1 - https://znc.in]
<kke> i think what i'll do is move the dev deps from gemspec to gemfile
havenwood has joined #ruby
<tbuehlmann> are you bundle installing from within a gem directory?
<kke> yep
<kke> or more exactly, creating a package during ci/cd pipeline from the git repo
<tbuehlmann> I'd expect the described behaviour then. see https://bundler.io/v1.16/man/bundle-install.1.html#DEPLOYMENT-MODE
jcalla has quit [Ping timeout: 264 seconds]
<wyoung> I am learning Ruby from python. does Ruby usr similar patterns? like pythons **{'kwarg1': 1, 'kwarg2': 2} for argument passing to a function or method?
<wyoung> also when are default function / method parameters? once or at class initiating time?
savolla has quit [Ping timeout: 276 seconds]
<tbuehlmann> ruby also has keyword arguments, yes
<tbuehlmann> I don't understand the second quesion, can you elaborate?
yohji has joined #ruby
GodFather has joined #ruby
GodFather_ has joined #ruby
<clorisu> thanks dminuoso
clorisu has quit [Quit: Leaving]
GodFather has quit [Ping timeout: 264 seconds]
aupadhye_ has joined #ruby
galeido has quit [Quit: leaving]
aupadhye has quit [Ping timeout: 264 seconds]
nowhere_man has quit [Ping timeout: 268 seconds]
jackrandom has quit [Quit: ZNC - https://znc.in]
jackrandom has joined #ruby
mroutis has joined #ruby
galeido has joined #ruby
vark90 has joined #ruby
ur5us has joined #ruby
GodFather_ has quit [Ping timeout: 264 seconds]
ur5us has quit [Ping timeout: 264 seconds]
fmcgeough has joined #ruby
GodFather_ has joined #ruby
alex`` has joined #ruby
tristanp has joined #ruby
Azure has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
savolla has joined #ruby
tristanp has quit [Ping timeout: 244 seconds]
jcalla has joined #ruby
GodFather_ has quit [Ping timeout: 276 seconds]
thejs has joined #ruby
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bryanray has joined #ruby
gtramontina has joined #ruby
Azure|dc has joined #ruby
Azure has quit [Ping timeout: 272 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
GodFather_ has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
dionysus69 has quit [Ping timeout: 268 seconds]
beefjoe has joined #ruby
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snickers has joined #ruby
cjohnson has joined #ruby
snickers has quit [Client Quit]
snickers has joined #ruby
snickers has quit [Client Quit]
sticaz has joined #ruby
za1b1tsu has joined #ruby
GodFather__ has joined #ruby
ephemera_ has quit [Ping timeout: 268 seconds]
GodFather_ has quit [Ping timeout: 264 seconds]
mostlybadfly has joined #ruby
k0mpa has quit [Ping timeout: 250 seconds]
GodFather__ has quit [Ping timeout: 276 seconds]
kapil___ has joined #ruby
kapil___ has quit [Excess Flood]
kapil___ has joined #ruby
gnufied has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
aupadhye_ has quit [Ping timeout: 272 seconds]
bmurt has joined #ruby
thy0 has joined #ruby
Eiam has quit [Read error: Connection reset by peer]
dbz has joined #ruby
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Rapture has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
Rootsudo has joined #ruby
bijan_ has joined #ruby
GodFather__ has joined #ruby
RedNifre_ has joined #ruby
bijan_ has quit [Remote host closed the connection]
k0mpa has joined #ruby
RedNifre has quit [Ping timeout: 276 seconds]
ferhaty has quit [Quit: ferhaty]
mroutis has quit [Remote host closed the connection]
ur5us has joined #ruby
[Butch] has joined #ruby
beefjoe has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 264 seconds]
bijan_ has joined #ruby
Burgestrand has quit [Quit: Closing time!]
vark90 has quit [Quit: WeeChat 1.4]
tdy has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
SeepingN has joined #ruby
<dminuoso> Is there a clean way to do something like the either monad in ruby?
<dminuoso> Writing code like this is getting tiring: https://gist.github.com/dminuoso/20fdd2ba3f9c65fea9bda3bde6a06d89
<dminuoso> And doing this with runtime abstractions is nonsense
<dminuoso> Or rather.. simulating this with hashes and things.
GodFather__ has quit [Ping timeout: 244 seconds]
bijan_ has joined #ruby
<ccooke> you could do this quite nicely by running all the tests as something like: %w{ key1 key2 key3 }.each { |k| raise "#{k} is not set" unless ENV.include? k }
Inline has joined #ruby
<ccooke> but that's not specifically answering your question
<dminuoso> Yeah no I want monadic code.
<ccooke> Hmm. So what would your ideal code look more like?
bijan__ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
bmurt has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
bijan__ has quit [Ping timeout: 252 seconds]
despai has quit [Quit: ...]
<dminuoso> Monadic.
<dminuoso> I dont know Ruby very well so..
nopolitica has quit [Ping timeout: 252 seconds]
sticaz has quit [Quit: BELLA LI]
bijan__ has joined #ruby
bijan__ has quit [Read error: Connection reset by peer]
Azure|dc is now known as Azure
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
bijan_ has joined #ruby
orbyt_ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
bijan_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bijan_ has quit [Remote host closed the connection]
jcarl43 has joined #ruby
clemens3 has quit [Ping timeout: 276 seconds]
bijan_ has joined #ruby
nowhere_man has joined #ruby
aufi has quit [Quit: Leaving]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bijan_ has quit [Ping timeout: 252 seconds]
nopolitica has joined #ruby
bijan_ has joined #ruby
sameerynho has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
despai has joined #ruby
bijan_ has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
DTZUZO has quit [Ping timeout: 264 seconds]
bijan_ has quit [Ping timeout: 252 seconds]
yohji has quit [Remote host closed the connection]
dbugger_ has joined #ruby
darkhanb has joined #ruby
bijan_ has joined #ruby
gtramontina has quit [Remote host closed the connection]
jp has quit [Ping timeout: 244 seconds]
Dbugger has quit [Ping timeout: 276 seconds]
jp has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
dviola has joined #ruby
bmurt has joined #ruby
doubledup has joined #ruby
IanMalcolm has joined #ruby
cthulchu_ has joined #ruby
lxsameer has joined #ruby
despai has quit [Quit: ...]
bijan_ has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
cthu| has joined #ruby
polishdub has joined #ruby
IanMalcolm has quit [Remote host closed the connection]
orbyt_ has joined #ruby
ramfjord has joined #ruby
ferhaty has joined #ruby
IanMalcolm has joined #ruby
dbz has joined #ruby
cthulchu_ has quit [Ping timeout: 276 seconds]
cthulchu_ has joined #ruby
bsamorim has joined #ruby
cthu| has quit [Ping timeout: 276 seconds]
Eiam has joined #ruby
dellavg_ has quit [Ping timeout: 252 seconds]
<bsamorim> Is there anyway to explicitly decrease a variable's reference count by 1, so that it can be garbage collected before its scope dies?
ramfjord has quit [Ping timeout: 268 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
dbz has quit [Ping timeout: 264 seconds]
bsamorim has quit [Read error: Connection reset by peer]
bsamorim has joined #ruby
gtramontina has joined #ruby
r29v has joined #ruby
dellavg_ has joined #ruby
gtramontina has quit [Ping timeout: 268 seconds]
theRoUS has quit [Read error: Connection reset by peer]
<al2o3-cr> bsamorim: you'll probably want to check out weakref from the stdlib.
aupadhye has joined #ruby
dbz has joined #ruby
<bsamorim> al2o3-cr: Thanks, that seems to do the trick. Just wondering, tho: Do you know if there's any reason for them not to expose a direct deletion method?
<al2o3-cr> bsamorim: not sure tbh.
<bsamorim> I mean, by the reference documentation, WeakRef's main functionality seems to be letting objects being garbage-collected
<bsamorim> al2o3-cr: OK, thanks!
<al2o3-cr> bsamorim: yw.
s2013 has joined #ruby
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<bsamorim> One more GC question: If I issue a "[1] * 100000000" expression in irb, after its completion, the memory doesn't seem to be freed.
<bsamorim> I thought the repl automatically stored a reference to the last evaluated expression
<bsamorim> But, if I eval the expression "1", the allocated memory is still there!
<bsamorim> Moreover, if I issue a "[2] * 100000000" expression afterwards, the allocated amount does not change
<bsamorim> Does anyone know what's going on?
al2o3-cr has quit [Quit: WeeChat 2.2]
aupadhye has quit [Quit: Leaving]
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
eckhardt has joined #ruby
dellavg_ has quit [Ping timeout: 264 seconds]
thejs has quit [Ping timeout: 272 seconds]
beowuff has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
gnufied has quit [Quit: Leaving]
bmurt has joined #ruby
thejs has joined #ruby
Rootsudo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rootsudo has joined #ruby
RedNifre has joined #ruby
tty has joined #ruby
gtramontina has joined #ruby
<baweaver> Stupid version
<baweaver> Could likely make the function return Right/Left and match on that.
RedNifre_ has quit [Ping timeout: 268 seconds]
<baweaver> just need to change guard to do something like `conditions match ? Right(fn(target)) : Left()`
<baweaver> Could use pattern matching as well: `Qo.match(ENV) { |m| m.when(CITT_MANDY_USER: :present?, ...) { Right() }; m.else { Left() } }`
gtramontina has quit [Ping timeout: 272 seconds]
dellavg_ has joined #ruby
bsamorim has quit [Read error: Connection reset by peer]
augcesar has joined #ruby
dbz has quit [Ping timeout: 268 seconds]
RedNifre_ has joined #ruby
bsamorim has joined #ruby
RedNifre has quit [Ping timeout: 264 seconds]
za1b1tsu has quit [Ping timeout: 272 seconds]
IanMalcolm has joined #ruby
akaiiro has joined #ruby
amelliaa has joined #ruby
akaiiro has quit [Remote host closed the connection]
bijan_ has quit [Ping timeout: 252 seconds]
akaiiro has joined #ruby
<dminuoso> baweaver: You know what, Ill just ffi into Haskell.
<dminuoso> Problem solved.
Alina-malina has quit [Ping timeout: 272 seconds]
<havenwood> ENV.fetch(blarg) { raise blarg }
<havenwood> blarg!
<dminuoso> havenwood: I really want the equivalent of
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<dminuoso> `data Conf = Conf { user :: Text, pass :: Text, url :: URL }` with some `Conf <$> load "FOO_USER" <*> load "FOO_PASS" <*> load "FOO_URL"`
<dminuoso> baweaver: Qo doesnt feel right at all.
<baweaver> of course not, it's not Haskell.
<dminuoso> baweaver: In my opinion it's repeating the same grand mistakes that underpin case.
ferhaty has quit [Quit: ferhaty]
<dminuoso> although I suppoe
<dminuoso> def load(str); env[str] || raise "Missing environment variable: #{str}"; end
<dminuoso> is the way to go
<dminuoso> user = load "FOO_USER"; pass = load "FOO_PASS"; pass = load "FOO_URL";
<dminuoso> Yeah I guess that's what I really want heh
* dminuoso cant write Ruby
<havenwood> dminuoso: but #fetch
<dminuoso> havenwood: Fine.
<havenwood> ;-P
<al2o3-cr> yeah, use fetch instead of that.
* havenwood goes back to work
graphene has quit [Remote host closed the connection]
<dminuoso> raise_ = -> (blah) { raise "...." }; env.fetch("foo", &raise_)
<dminuoso> This is nasty though
Alina-malina has joined #ruby
<dminuoso> Oh
<dminuoso> You mean
graphene has joined #ruby
<dminuoso> def load(str); env.fetch(str) { raise "Missing environment variable: #{str}"} ;end
<dminuoso> really dont care how that code looks, its highly irrelevant
psychicist__ has joined #ruby
bsamorim has quit [Read error: Connection reset by peer]
<baweaver> It's official, and the program is now up. To RubyConf we go!
IanMalcolm has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
<al2o3-cr> dminuoso: yes, ENV.fetch(str, raise("Missing environment variable: #{str}"))
<al2o3-cr> or some such.
<al2o3-cr> as ENV doesn't have fetch_values.
lxsameer has joined #ruby
IanMalcolm has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 268 seconds]
bmurt has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
cthu| has joined #ruby
xtsee has quit [Ping timeout: 264 seconds]
Zaab1t has joined #ruby
lxsameer has joined #ruby
sticaz has joined #ruby
cthulchu_ has quit [Ping timeout: 268 seconds]
apeiros_ has joined #ruby
snickers has joined #ruby
doubledup has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 272 seconds]
doubledup has joined #ruby
thejs has quit [Ping timeout: 272 seconds]
lxsameer has joined #ruby
amelliaa has quit [Read error: Connection reset by peer]
sticaz has quit [Quit: BELLA LI!]
sauvin has quit [Read error: Connection reset by peer]
despai has joined #ruby
sticaz has joined #ruby
gnufied has joined #ruby
ramfjord has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
sticaz has quit [Quit: BELLA LI!]
sticaz has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
lxsameer has joined #ruby
beefjoe has joined #ruby
postmodern has joined #ruby
ur5us has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
bier has joined #ruby
Rootsudo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rootsudo has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
balo has quit [Quit: leaving]
Rootsudo has quit [Ping timeout: 272 seconds]
apeiros_ is now known as apeiros
balo has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 272 seconds]
beefjoe has quit [Remote host closed the connection]
gbristol has joined #ruby
mistym has quit [Ping timeout: 268 seconds]
mistym has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
pistachio has joined #ruby
akaiiro has quit [Ping timeout: 252 seconds]
bmurt has joined #ruby
Azure has quit [Ping timeout: 252 seconds]
thejs has joined #ruby
jane_booty_doe has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
akaiiro has joined #ruby
bmurt has quit [Read error: Connection reset by peer]
kaleido has quit [Remote host closed the connection]
bmurt has joined #ruby
r29v has quit [Quit: r29v]
dbugger_ has quit [Ping timeout: 276 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bak1an has joined #ruby
bak1an has quit [Client Quit]
dinfuehr has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
orbyt_ has joined #ruby
jane_booty_doe has quit [Quit: Leaving]
r29v has joined #ruby
ramfjord has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
ramfjord has quit [Ping timeout: 268 seconds]
GodFather__ has joined #ruby
ramfjord has joined #ruby
akaiiro has quit [Remote host closed the connection]
Freeaqingme has joined #ruby
<Freeaqingme> Hi folks, I'm playing around with some networking stuff. Am looking to get the first usable ip in a subnet. e.g., I've got 10.11.12.150/25, and I expect it to return 10.11.12.129. Basically, what I want to do is IPAddr.new('10.11.12.150/25')+1, but the + operator isn't (albeit understandably) implemented on the IPAddr object.
<Freeaqingme> any ideas how to implement this?
<Freeaqingme> oh lol, I figured I'd ask after 30 mins of trying. But of course right after asking you find the answer...
<Freeaqingme> This seems to do the trick for both ipv4 and ipv6: irb(main):016:0> IPAddr.new('10.11.12.150/25')&IPAddr.new('0.0.0.1')
<Freeaqingme> => #<IPAddr: IPv4:0.0.0.0/255.255.255.128>
<baweaver> What'd you come up with?
chongtxtx has quit [Ping timeout: 240 seconds]
<baweaver> >> IPAddr.new('10.11.12.150/25').to_range
<Freeaqingme> sorry, that's the wrong one
<ruby[bot]> baweaver: # => uninitialized constant IPAddr (NameError) ...check link for more (https://eval.in/1051195)
<Freeaqingme> meant this one: irb(main):017:0> IPAddr.new('10.11.12.150/25')|IPAddr.new('0.0.0.1')
<Freeaqingme> => #<IPAddr: IPv4:10.11.12.129/255.255.255.128>
<baweaver> ...right
<baweaver> >> require 'ipaddr'; IPAddr.new('10.11.12.150/25').to_range
<ruby[bot]> baweaver: # => #<IPAddr: IPv4:10.11.12.128/255.255.255.128>..#<IPAddr: IPv4:10.11.12.255/255.255.255.128> (https://eval.in/1051196)
<baweaver> huh, thought that'd actually make an iterator out of them
<baweaver> Ah, no, it did
savolla has quit [Remote host closed the connection]
<al2o3-cr> Freeaqingme: IPAddr.new('10.11.12.150/25') | 1
<baweaver> One of these days I should make a lib to add extra IP toys to Ruby
<Freeaqingme> al2o3-cr: oh neat. Saves even more typing :)
apeiros has quit []
Freeaqingme has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<al2o3-cr> [0,0,0,1].pack('C4').unpack1('N') == 1
Freeaqingme has joined #ruby
<al2o3-cr> or even #succ
<baweaver> al2o3-cr: Where does one learn all this packery?
mudphone has joined #ruby
<al2o3-cr> the docs mostly.
<baweaver> I C....
mondz has joined #ruby
chongtxtx has joined #ruby
r29v has quit [Quit: r29v]
mondz has quit [Remote host closed the connection]
varesa_ is now known as varesa
<al2o3-cr> 4841434b544845504c414e4554 baweaver pack this ;)
<baweaver> Are you trying to hex me?
<al2o3-cr> hehe ;)
Puffball has quit [Read error: Connection reset by peer]
dbz has joined #ruby
Puffball has joined #ruby
code_zombie has joined #ruby
sameerynho has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
nfk has joined #ruby
<nfk> could it be that tk 8.6 does not even work with ruby?
RedNifre_ has quit [Quit: kwit]
kapil___ has quit [Quit: Connection closed for inactivity]
reber has quit [Remote host closed the connection]
Azure has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
dbz has quit [Remote host closed the connection]
<al2o3-cr> nfk: i doubt that.
druonysus has joined #ruby
<nfk> well, i just built ruby with tk aand i don't think it got built; googling yields mixed results, some imply it works fine, other sources say 8.5 is the only one that works which is why i'm asking in a channel where someone hopefully knows for sure
<nfk> s/only/newest/
xtsee has joined #ruby
<al2o3-cr> nfk: it definitely does, i just tested tk 8.6.3
<al2o3-cr> 8.6.8 infact.
Azure has quit [Ping timeout: 268 seconds]
Azure|dc has joined #ruby
<al2o3-cr> nfk: what have you tried?
desperek has quit [Quit: xoxo]
heinrich5991 has quit [Ping timeout: 264 seconds]
Rootsudo has joined #ruby
ur5us has joined #ruby
<nfk> well, i just told portage to build ruby with tk USE flag
<nfk> which it did, except require 'tk' does not work and doing examination of installed files, there's nothing about tk
<nfk> which to me tells that most likely it silently failed during configure step of compilation
heinrich5991 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> nfk: tk is a gem now; so gem install tk.
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
aldodelgado has joined #ruby
aldodelgado has quit [Client Quit]
Puffball has quit [Quit: Puffball]
doubledup has quit [Quit: Leaving]
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dellavg_ has quit [Ping timeout: 264 seconds]
<nfk> wow, and it built, thanks ruby
bijan_ has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
graphene has quit [Remote host closed the connection]
DTZUZO has joined #ruby
graphene has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
ogres has joined #ruby
bijan_ has quit [Remote host closed the connection]
clorisu has joined #ruby
<clorisu> do else's only work in if's or other loops also?
<baweaver> clorisu: if isn't a loop
<havenwood> >> unless true; else; :clorisu end
<ruby[bot]> havenwood: # => :clorisu (https://eval.in/1051212)
gix has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
augcesar has quit [Quit: Connection closed for inactivity]
gix has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
<nfk> man, i can't believe i haven't written ruby in like a year or two but i can still do stuff like passing a block to constructor intuitively, and it worked
bijan_ has joined #ruby
sticaz has quit [Ping timeout: 272 seconds]
<clorisu> baweaver: is it more aptly called a branch?
bijan_ has quit [Ping timeout: 252 seconds]
<baweaver> yep
<clorisu> thanks
jane_booty_doe has joined #ruby
clorisu has quit [Quit: Leaving]
bijan_ has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
r29v has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bijan_ has joined #ruby
polishdub has quit [Quit: leaving]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sdegutis has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
<sdegutis> Hi all.
sticaz has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
graphene has quit [Read error: Connection reset by peer]
<sdegutis> How's it going?
eckhardt has joined #ruby
graphene has joined #ruby
bijan_ has joined #ruby
siery has joined #ruby
beowuff has quit [Remote host closed the connection]
bijan_ has quit [Ping timeout: 252 seconds]
r29v has quit [Quit: r29v]
lxsameer has joined #ruby
bijan_ has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
<nfk> pretty good, i just calculated that it's cheaper to buy strong spirits at bargain prices than even the cheapest beer on discount, which i was suspecting for a while but now i know for sure thanks to irb and some math
<bougyman> isn't wine the cheapest?
akaiiro has joined #ruby
Puffball has joined #ruby
<sdegutis> nfk: lol
<nfk> hmm.... supermarket estate bottled on average - not even worth computing; cheapest of cheap... let me run the numbers
bijan_ has quit [Ping timeout: 252 seconds]
r29v has joined #ruby
nopolitica has quit [Read error: Connection reset by peer]
nopolitica has joined #ruby
bauruine has quit [Ping timeout: 264 seconds]
sonOfRa has quit [Quit: Bye!]
sonOfRa has joined #ruby
<nfk> bougyman, nope, at least among the bottled wines, even the trashiest would be like 60+% more expensive than spirits that i can get legally
<bougyman> I found a few charts on this.
<bougyman> a cheap shiraz competes well with the cheapest vodkas.
<bougyman> pretty much the same.
ccooke has quit [Ping timeout: 268 seconds]
<nfk> then again, our 15 and sometimes less euros per liter for strong spirits is probably on the very cheap end for an ostensibly developed nation
<bougyman> I can get a 1.75L bottle of cheap vodka for around $10 USD
[Butch] has quit [Read error: Connection reset by peer]
Puffball_ has joined #ruby
<bougyman> but I get a 750ml bottle of cheap shiraz for $2.99
cthulchu has joined #ruby
<nfk> bougyman, i don't think those are legal here, that having been said, vodka that's priced that low is such trash that you might as well go and drink straight methanol
<bougyman> nfk: not arguing.
bijan_ has joined #ruby
<bougyman> But I don't know why cheap wine would be illegal there...
<nfk> i have never seen 1.75L vodka bottles
<bougyman> Haha.
<nfk> 1L is the largest you can commonly get and, if they have good price, usually the price tag is all that remains
<bougyman> https://www.totalwine.com/vodka/vodka/smirnoff/p/1835175-1?glia=true&s=1411&pid=cpc:Shopping+US+WASH+ENG+SPART:::google:&gclid=CjwKCAjwwo7cBRBwEiwAMEoXPDrF31TtVnyiB1CJ1fp6FdQNRSYMhUW8NYQjNPcwPq3TWVEFo9p7ThoChLcQAvD_BwE&gclsrc=aw.ds
<bougyman> $16.99 for that 1.75L smirnoff
<bougyman> that won't be the cheapest they have
akaiiro has quit [Ping timeout: 244 seconds]
<bougyman> wow.
<bougyman> I can find one for $8.99
cthu| has quit [Ping timeout: 252 seconds]
cgfbee has quit [Ping timeout: 252 seconds]
<bougyman> wine won't be able to beat that.
psychicist__ has quit [Ping timeout: 272 seconds]
<nfk> your link is for your eyes only, i got 403
Puffball has quit [Ping timeout: 252 seconds]
<nfk> likely to stop price comparison via bots
<bougyman> could be.
<sdegutis> Were any of you here maybe 8 years ago?
<nfk> not rulling it out, why?
<nfk> actually... unlikely
<nfk> that many years ago i might not have even heard of ruby
bijan_ has quit [Ping timeout: 252 seconds]
<nfk> bougyman, at least now i know why 'murica is considered a nation of drunkards ;D
cgfbee has joined #ruby
<siery> Vodka shold be the cheepest, potetos cost nothing
<nfk> you can poison yourself with vodka for less than a cost of a good meal over the pond
<siery> better start thinkng about mruby vodka destilator
bauruine has joined #ruby
<nfk> siery, arguably most alcohols cost very little, after all, it's possible to produce it as a car fuel, and there even €1/L is already a hefty price
LiftLeft has quit [Ping timeout: 264 seconds]
<siery> nfk, Nah, I dont like vodka even due my Polish roots it is probably not likly to say
gtramontina has joined #ruby
<nfk> i know, it's kinda bland, i prefer whiskey and brandy myself
bijan_ has joined #ruby
<sdegutis> nfk: ok nvm
<nfk> bougyman, so, did you order your 9 dollar vodka?
thejs has quit [Ping timeout: 252 seconds]
<nfk> btw, that nickname ending, LT?
<siery> Leave us a raport when man C:
ramfjord has quit [Ping timeout: 272 seconds]
bijan_ has quit [Ping timeout: 252 seconds]
gtramontina has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
gregf_ has quit [Ping timeout: 252 seconds]
r29v has quit [Quit: r29v]
orbyt_ has joined #ruby
paraxial has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 244 seconds]
ramfjord has joined #ruby
bijan_ has joined #ruby
roshanavand has quit [Ping timeout: 264 seconds]
LiftLeft has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
paraxial has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
eckhardt has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
eckhardt has quit [Client Quit]
bijan_ has joined #ruby
gtramontina has joined #ruby
thejs has joined #ruby
gtramontina has quit [Remote host closed the connection]
arescorpio has joined #ruby
gtramontina has joined #ruby
gtramontina has quit [Remote host closed the connection]
bijan_ has quit [Ping timeout: 252 seconds]
tdy has quit [Ping timeout: 268 seconds]
roshanavand has joined #ruby
thejs has quit [Remote host closed the connection]