<havenwood>
elxbarbosa: From perspective of the reader, the line seems like end of statement. The trailing dot flows linearly. I think it's fair to use trailing dots if it feels right, but oddly not a great practice like pipeline operator in other langs.
<havenwood>
elxbarbosa: Yeah, I think avoid is right.
<elxbarbosa>
havenwood: well, I wont debate ruby style, but that's the first language Ive seen using trailing dot :)
<havenwood>
It's not common to see.
<elxbarbosa>
havenwood: what about constants var, should I put those above initialize? or near its first usage?
<havenwood>
You can extract a local variable or method instead of chaining deeply. I personally do like a chaining syntax and wish we had a functional-style pipeline operator but there are implementation difficulties that may be hard to surmount.
<elxbarbosa>
.NET almost follow C style
<havenwood>
elxbarbosa: Constants are typically defined at the top of the class.
<havenwood>
elxbarbosa: Usually not contextually, and all at the top, but it's just convention.
<elxbarbosa>
I guessed so, as its maintainer are doing C everyday :)
<elxbarbosa>
mmm, evans is behind openbsd ports, interesting
<elxbarbosa>
around here, ELixir team are always bullying everyone :)
<havenwood>
elxbarbosa: Yeah, he runs a number of hardened gov't services on openbsd with roda, afaik.
<elxbarbosa>
boasting all day about its virtuness
<havenwood>
well, it's so damned virtuous
<havenwood>
elxbarbosa: Elixir and Phoenix are pretty great. I don't have much to complain about.
blender has joined #ruby
<havenwood>
I still like Ruby. <3
<elxbarbosa>
I am very much enjoying learning ruby
<havenwood>
elxbarbosa: Ruby and Elixir are definitely two of my personal favorite languages.
<elxbarbosa>
it has a lot of Lisp resemblance
<havenwood>
Yes! For sure.
<elxbarbosa>
and what about Crystal?
<elxbarbosa>
do ruby dev care about it
<elxbarbosa>
I guess it may be way different of ruby
<havenwood>
elxbarbosa: Macros like Elixir, tons like Ruby, but more equivalent to Go in other ways.
GankMove has joined #ruby
<havenwood>
elxbarbosa: Yeah, super similar but different class.
cnsvc_ has joined #ruby
<havenwood>
elxbarbosa: Like Jose says, if it touches a socket it's a good fit for Elixir.
<havenwood>
elxbarbosa: Crystal makes great binaries.
<havenwood>
elxbarbosa: I just enjoy Ruby.
<havenwood>
And it works. :)
georgie has quit [Remote host closed the connection]
georgie has joined #ruby
<elxbarbosa>
evans is really making me sad by leaving openbsd back there because of its lack of .NET support
<havenwood>
mmm
georgie has quit [Remote host closed the connection]
<havenwood>
yeah
<elxbarbosa>
I may go back if I decide go serious with ruby
<elxbarbosa>
pry :)
noodle has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
mikecmpbll has quit [Client Quit]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
alfiemax has joined #ruby
cnsvc_ has joined #ruby
georgie has joined #ruby
zacts has joined #ruby
georgie has quit [Ping timeout: 260 seconds]
cnsvc_ has quit [Ping timeout: 240 seconds]
cthulchu_ has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
bocaneri has joined #ruby
GankMove has quit [Read error: Connection reset by peer]
alfiemax has quit [Remote host closed the connection]
elxbarbosa has quit [Ping timeout: 272 seconds]
sagax has quit [Quit: Konversation terminated!]
jenrzzz has quit [Ping timeout: 272 seconds]
alfiemax has joined #ruby
jenrzzz has joined #ruby
woodruffw has quit [Ping timeout: 256 seconds]
woodruffw has joined #ruby
woodruffw has joined #ruby
woodruffw has quit [Changing host]
elxbarbosa has joined #ruby
Guest41501 has quit [Ping timeout: 240 seconds]
jnoon has quit [Read error: Connection reset by peer]
entel has quit [Ping timeout: 260 seconds]
jnoon has joined #ruby
Guest41501 has joined #ruby
entel has joined #ruby
cd has quit [Quit: cd]
woodruffw has quit [Ping timeout: 240 seconds]
woodruffw has joined #ruby
woodruffw has quit [Changing host]
woodruffw has joined #ruby
dfucci has joined #ruby
BSaboia has joined #ruby
Rudd0 has quit [Remote host closed the connection]
phage has joined #ruby
phage has quit [Client Quit]
imode has quit [Ping timeout: 265 seconds]
sagax has joined #ruby
imode has joined #ruby
burgestrand has joined #ruby
xco has joined #ruby
phage has joined #ruby
cognemo has quit [Quit: cognemo]
cognemo has joined #ruby
wallace_mu has joined #ruby
elxbarbosa has quit [Remote host closed the connection]
phenom has quit [Remote host closed the connection]
phenom has joined #ruby
phaul has quit [Ping timeout: 272 seconds]
phaul has joined #ruby
wallace_mu has quit [Ping timeout: 272 seconds]
brij has joined #ruby
<brij>
Hello
<brij>
I want to use the functions ".hour", ".minute",etc. in my rails model. These are coming from following library: activesupport/lib/active_support/duration.rb.What is the best way to access this in my model? The code is working in the rails console so I assume the file is available.I tried doing the following in the top of my model (like mentioned in
<brij>
I mean required any module of ActiveSupport::Duration:Class any solutions?
alfiemax has quit [Remote host closed the connection]
<jhass>
brij: You cannot use it in Rails 4, no
<jhass>
the :Class just denotes it's called on the class rather than an instance of it
TomyWork has joined #ruby
mikecmpbll has joined #ruby
imode has quit [Ping timeout: 272 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
GankMove has joined #ruby
Liothen has joined #ruby
Liothen has quit [Excess Flood]
Liothen has joined #ruby
Liothen has quit [Excess Flood]
schne1der has joined #ruby
Liothen has joined #ruby
Liothen has quit [Excess Flood]
Liothen has joined #ruby
Liothen has quit [Excess Flood]
cnsvc_ has joined #ruby
Liothen has joined #ruby
Liothen has quit [Excess Flood]
jenrzzz has quit [Ping timeout: 240 seconds]
Liothen has joined #ruby
Liothen has quit [Excess Flood]
alfiemax has joined #ruby
Liothen has joined #ruby
Liothen has quit [Excess Flood]
cnsvc_ has quit [Ping timeout: 240 seconds]
impermanence has quit [Ping timeout: 246 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
rafadc has quit [Read error: Connection reset by peer]
alfiemax has quit [Remote host closed the connection]
rafadc has joined #ruby
cnsvc_ has joined #ruby
burgestrand has quit [Quit: burgestrand]
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greengriminal has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
phage has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
phage has quit [Client Quit]
wallace_mu has joined #ruby
Ediz has joined #ruby
<Ediz>
Hello everyone
wallace_mu has quit [Ping timeout: 246 seconds]
<Ediz>
I'm trying to make use of Rack::Session::Cookie to send the session cookie in the header using sinatra. I'm not able to get it working so far. I'm using rackup to start the app and visiting the local URL I see no cookie related headers sent. I'm confued, as I think this is supposed to set the cookie for me? What am I missing? https://hastebin.com/oladadegog.rb
<Ediz>
thanks in advance.
brij has quit [Remote host closed the connection]
ap4y has quit [Ping timeout: 264 seconds]
<jhass>
Ediz: I guess it't not set when there's no data in the session
<Ediz>
isn't there supposed to be the session id in there? I'm sorry I can see various places this and enable: sessions used as an alternative to each other
<jhass>
so if the rack session header is not set (=nil), then commit_session? will be false
dionysus69 has joined #ruby
ruurd has quit [Quit: bye folks]
<Ediz>
is there an extra step I need to take?
goyangi has quit [Read error: No route to host]
cnsvc_ has quit [Ping timeout: 240 seconds]
Rudd0 has joined #ruby
phage has joined #ruby
vondruch has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
alfiemax has quit [Remote host closed the connection]
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
dfucci has quit [Quit: Lost terminal]
phage has joined #ruby
Eiam has quit [Ping timeout: 256 seconds]
akem_ has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neozor has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rippa has joined #ruby
yasumi2136 has joined #ruby
lxsameer has joined #ruby
kenichi_ has joined #ruby
kenichi has quit [Ping timeout: 256 seconds]
postmodern has quit [Quit: Leaving]
xco has joined #ruby
burgestrand has joined #ruby
TCZ has joined #ruby
rafadc has quit [Ping timeout: 256 seconds]
burgestrand has quit [Quit: burgestrand]
wallace_mu has joined #ruby
BSaboia has joined #ruby
akem has joined #ruby
burgestrand has joined #ruby
wallace_mu has quit [Ping timeout: 260 seconds]
alfiemax has quit [Remote host closed the connection]
<Ediz>
figured it out, jhass, it just needs to be accessed using [] once to be loaded
<Ediz>
it was a bit weird but :p ok
<Ediz>
ty
alfiemax has joined #ruby
dfucci has joined #ruby
drincruz has joined #ruby
schne1der has quit [Quit: schne1der]
drincruz has quit [Ping timeout: 272 seconds]
akem has quit [Read error: Connection reset by peer]
georgie has joined #ruby
TzilTzal has joined #ruby
georgie has quit [Ping timeout: 260 seconds]
Fenhl has left #ruby [#ruby]
drincruz has joined #ruby
sagax has quit [Remote host closed the connection]
leitz has joined #ruby
Emmanuel_ChanelW has joined #ruby
TzilTzal has quit [Remote host closed the connection]
TzilTzal has joined #ruby
dualfade_ has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
Tinu2048 has joined #ruby
<Tinu2048>
helo
dualfade has joined #ruby
<Tinu2048>
someone?
Takumo has quit [Quit: WeeChat 1.9.1]
jenrzzz has quit [Ping timeout: 256 seconds]
yasumi2136_ has joined #ruby
Tinu2048 has quit [Ping timeout: 260 seconds]
Ediz has quit [Remote host closed the connection]
Tinu2048 has joined #ruby
Ediz has joined #ruby
Ediz is now known as Guest34900
yasumi2136 has quit [Ping timeout: 240 seconds]
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 256 seconds]
aftakitani has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
<aftakitani>
Hi there
Guest34900 has quit [Read error: Connection reset by peer]
<Tinu2048>
helo
<aftakitani>
I'm building a api client here
<aftakitani>
and what I use to do is, to set up a connection method on a base class
<aftakitani>
and call it from the other classes
<aftakitani>
I was wondering, how to do like activerecord that already sets up the connection for every class?
<aftakitani>
can someone point me to the correct way to do that?
sagax has joined #ruby
Tinu2048 has quit [Remote host closed the connection]
phage has joined #ruby
chouhoulis has joined #ruby
TzilTzal has quit [Remote host closed the connection]
yasumi2136 has joined #ruby
chouhoulis has quit [Ping timeout: 256 seconds]
yasumi2136_ has quit [Ping timeout: 256 seconds]
ruurd has joined #ruby
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phage has joined #ruby
<yxhuvud>
That is not really how AR works. AR uses a thread pool, so whenever someone needs to do queries against the db a connection is checked out and then when query is done it is returned
vondruch has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neozor has quit [Remote host closed the connection]
georgie has joined #ruby
neozor has joined #ruby
neozor has quit [Ping timeout: 260 seconds]
wallace_mu has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greengriminal has quit [Quit: Leaving]
phage has joined #ruby
ruurd has joined #ruby
aftakitani has quit [Quit: Leaving]
xco has joined #ruby
ruurd has quit [Quit: bye folks]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
infinityfye has joined #ruby
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
burgestrand has quit [Quit: burgestrand]
phage has joined #ruby
Emmanuel_ChanelW has quit [Quit: Leaving]
impermanence has joined #ruby
bmurt has joined #ruby
dfucci_ has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
georgie has quit [Remote host closed the connection]
<jhass>
s/thread pool/connection pool/
ruurd has joined #ruby
cd has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v4.0 Beta Build (2020/09/30 UTC) 64 Bit]
Tempesta has joined #ruby
jenrzzz has joined #ruby
TomyWork has quit [Remote host closed the connection]
TomyWork has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
dfucci_ has quit [Ping timeout: 246 seconds]
<yxhuvud>
*cough*. Right.
chouhoulis has joined #ruby
alfiemax has joined #ruby
dfucci has joined #ruby
TzilTzal has joined #ruby
TzilTzal has quit [Ping timeout: 260 seconds]
ChmEarl has joined #ruby
TCZ has quit [Quit: Leaving]
stryek has joined #ruby
TCZ has joined #ruby
neozor has joined #ruby
cthulchu_ has joined #ruby
akem has joined #ruby
Liothen has joined #ruby
Liothen has quit [Excess Flood]
neozor has quit [Ping timeout: 260 seconds]
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
emad has joined #ruby
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kenichi_ is now known as kenichi
phage has joined #ruby
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has quit [Ping timeout: 258 seconds]
akem has joined #ruby
emad has quit [Remote host closed the connection]
ellcs1 has joined #ruby
<jhass>
:)
banisterfiend has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
TomyWork has quit [Remote host closed the connection]
chromis has left #ruby [#ruby]
chromis has joined #ruby
dfucci_ has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 240 seconds]
ruurd has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
alfiemax has quit [Remote host closed the connection]
howdoi has joined #ruby
imode has joined #ruby
TzilTzal has joined #ruby
TzilTzal has quit [Remote host closed the connection]
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
Rounin has quit [Ping timeout: 260 seconds]
regedit has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
edwardly has quit [Quit: ??????????]
jenrzzz has joined #ruby
alfiemax has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
alfiemax has quit [Ping timeout: 246 seconds]
va5c0 has joined #ruby
alfiemax has joined #ruby
Rounin has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
Rounin has quit [Max SendQ exceeded]
Rounin has joined #ruby
va5c0 has quit [Ping timeout: 256 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
gueorgui_ is now known as gueorgui
ramfjord has joined #ruby
alfiemax has quit [Remote host closed the connection]
<leitz>
ruby-community.com maintainers. If I want to do a fork to add some stuff, which branch should I work off of? I see "master" and "production".
hiroaki has joined #ruby
<havenwood>
leitz: Branch off master. Thanks for contributing!
alfiemax has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
NightMonkey has joined #ruby
NightMonkey has quit [Remote host closed the connection]
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 260 seconds]
whoisxy has joined #ruby
<whoisxy>
Hello, I'm a bit confused with the behaviour of the following, could someone explain it please? https://ideone.com/capCor
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TzilTzal has joined #ruby
bmurt has joined #ruby
NightMonkey has joined #ruby
<adam12>
whoisxy: `num =` is setting a _local_ variable.
<adam12>
whoisxy: to call the accessor `num` on an instance of `Foo`, this is one of the special cases that you need to use `self` to set the receiver. `self.num = (num + 1)`
<whoisxy>
Ahhh Okay. I assume it's preferred to use @
TzilTzal has quit [Remote host closed the connection]
jobewan has joined #ruby
<adam12>
whoisxy: ... not entirely and it will depend on who you talk to likely. Using the accessor is a method call, which can have _some_ overhead.
<adam12>
whoisxy: But if you did `@numm` by accident, without warnings, Ruby would not complain. So using an instance variable (`@num`) you might run the risk of a subtle bug.
davispuh has joined #ruby
<whoisxy>
Would it fail in the case of self.numm then?
<adam12>
whoisxy: Yes!
<whoisxy>
Okay, thank you.
<adam12>
whoisxy: np
TzilTzal has joined #ruby
TzilTzal has quit [Remote host closed the connection]
blender_ has joined #ruby
blender has quit [Ping timeout: 272 seconds]
zacts has quit [Quit: leaving]
vondruch has quit [Ping timeout: 246 seconds]
foxxx0 is now known as foxxx0|M
foxxx0|M is now known as foxxx0
ramfjord has joined #ruby
emad has joined #ruby
r29v has joined #ruby
emad has quit [Client Quit]
bocaneri has quit [Remote host closed the connection]
jenrzzz has joined #ruby
<havenwood>
I'm in the using instance variables club. :)
<havenwood>
Your signatures will catch the @numm. :P
<whoisxy>
This is me being a bit lazy. But does anyone know an nice way to get an int into a 32-bit BE the encoding stuff looks to be specific to character sets.