sylario has quit [Quit: Connection closed for inactivity]
lxsameer has quit [Ping timeout: 272 seconds]
faitswulff has joined #ruby
al2o3-cr has joined #ruby
jmcgnh has quit [Ping timeout: 245 seconds]
cthu| has quit [Ping timeout: 260 seconds]
white_lilies has joined #ruby
wojnar has quit [Remote host closed the connection]
Dirak has joined #ruby
akem has quit [Remote host closed the connection]
akem has joined #ruby
white_lilies has quit [Ping timeout: 252 seconds]
gizmore has quit [Ping timeout: 246 seconds]
_za1b1tsu_ has joined #ruby
ciscam has quit [Ping timeout: 260 seconds]
ciscam has joined #ruby
_za1b1tsu_ has quit [Ping timeout: 246 seconds]
faitswulff has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 240 seconds]
elphe has joined #ruby
mzo has quit [Ping timeout: 260 seconds]
white_lilies has joined #ruby
pahn has joined #ruby
im0nde has quit [Ping timeout: 252 seconds]
<sparc>
Can I access variables outside of my class, from within the class, if it is in the same file?
<sparc>
Like a package variable in perl.
<sparc>
RubyMine is telling me it can't find it.
im0nde has joined #ruby
<sparc>
Accessing a local variable from within a class.
faitswulff has joined #ruby
pahn has quit [Quit: Dear faux peoples of IRC-- buh bye & sweet dreams. Love, the scroop. That is all, carry on.]
pahn has joined #ruby
cagomez has joined #ruby
faitswulff has quit [Ping timeout: 240 seconds]
<cagomez>
what is this doing? what is the name for this syntax? `GUEST = Object.new; def GUEST.name; "some name"; end;`
<havenwood>
cagomez: That's assigning a constant to an instance of Object. Then it's defining a singleton method on the eigenclass of that instance of object.
<baweaver>
sparc: Class variable in Ruby.
<baweaver>
ohai havenwood
<havenwood>
baweaver: o/ long time no see! haha
<sparc>
rubymine yells at me for that too. there's no winning!
<baweaver>
What exactly are you trying to do?
bkxd has joined #ruby
<havenwood>
sparc: Local variables are local to the method in which they were defined. There isn't a lexically scoped variable that is limited to the current file. (That *is* how refinements are scoped.)
bkxd has quit [Client Quit]
<sparc>
Ok cool. Thanks for explaining baweaver and havenwood!
<havenwood>
+1 what are you trying to do?
<sparc>
I'm trying to define a hash that any instance of my class can use.
<baweaver>
For?
<sparc>
It's not going to be changed at all. I figure why make a new one, for every instance.
<sparc>
I would like to iterate over it to build objects in my builder class.
<baweaver>
No no, I mean what is it used for?
<baweaver>
What are you using the builder to make?
<baweaver>
because a lot of patterns you'd find familiar in Java end up with much simpler solutions this side of the fence
<sparc>
It's a super-secret startup secret. I can't tell anyone or I'll break a zillion-dollar NDA.
<havenwood>
sparc: I use a module when there's no state to track, a singleton class when there's a single instance of state, and a regular class when there's many instances of state.
<sparc>
I'm populating variables in a template object that then generates an ERB template.
<sparc>
ok, that sounds good. thanks again.
<havenwood>
Singleton is one of the module Matz himself maintains.
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
Andrevan has joined #ruby
tdy has joined #ruby
lxsameer has joined #ruby
djuber has joined #ruby
cajone has joined #ruby
cajone has left #ruby [#ruby]
<havenwood>
cagomez: A video still to show code? Hehe.
ciscam has quit [Ping timeout: 260 seconds]
lxsameer has quit [Ping timeout: 245 seconds]
<havenwood>
cagomez: The part up top is aliasing two class methods on Variant. Guessing that's not the part confusing you? Just wondering about the #scope method?
ciscam has joined #ruby
<havenwood>
cagomez: #scope is using the @product instance variable if it's set, otherwise it's using the variant class, with it's aliased class methods.
braincrash has quit [Quit: bye bye]
<havenwood>
cagomez: Then it's calling one of two methods on the above, depending on whether there's and admin role and params want to show deleted.
<havenwood>
cagomez: @product presumably responds to those two methods, and the Variant class has them aliased to #scoped and #active.
<havenwood>
cagomez: I'm sure folk here would be happy to talk about the code in more detail. A Gist is preferable so code can be commented, run, etc.
<havenwood>
cagomez: Any specific part you're wondering about, or just the whole thing?
RougeR has joined #ruby
braincrash has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
<cagomez>
Great explanation; sorry for the still
<cagomez>
is code like that common in production? I've never seen it (almost 2 years)
Andrevan has quit [Quit: WeeChat 2.2]
_za1b1tsu_ has joined #ruby
gix has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
faitswulff has joined #ruby
_za1b1tsu_ has quit [Ping timeout: 252 seconds]
faitswulff has quit [Remote host closed the connection]
cpruitt has joined #ruby
RougeR has quit [Ping timeout: 246 seconds]
_whitelogger has joined #ruby
cagomez has quit [Remote host closed the connection]
ivanskie has joined #ruby
cagomez has joined #ruby
cpruitt has quit [Ping timeout: 252 seconds]
RougeR has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
cagomez has quit [Ping timeout: 252 seconds]
cpruitt has joined #ruby
AJA4350 has quit [Remote host closed the connection]
Dirak has quit [Ping timeout: 252 seconds]
Dirak has joined #ruby
Emmanuel_Chanel has joined #ruby
brent__ has quit [Quit: Connection closed for inactivity]
cpruitt has quit [Ping timeout: 245 seconds]
cpruitt has joined #ruby
BloopMonsterOMG has joined #ruby
faitswulff has joined #ruby
akosednar has joined #ruby
cagomez has joined #ruby
cpruitt has quit [Ping timeout: 252 seconds]
Azure has quit [Ping timeout: 240 seconds]
faitswulff has quit [Ping timeout: 252 seconds]
cagomez has quit [Ping timeout: 252 seconds]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
Azure has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
lxsameer has joined #ruby
asphyxia has joined #ruby
cpruitt has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cpruitt has quit [Ping timeout: 246 seconds]
ciscam has quit [Ping timeout: 246 seconds]
ciscam has joined #ruby
cpruitt has joined #ruby
cpruitt has quit [Ping timeout: 252 seconds]
cagomez has joined #ruby
elphe has quit [Ping timeout: 244 seconds]
elphe has joined #ruby
_za1b1tsu_ has joined #ruby
gnufied has quit [Ping timeout: 252 seconds]
al2o3-cr has quit [Quit: WeeChat 2.2]
al2o3-cr has joined #ruby
cagomez has quit [Ping timeout: 272 seconds]
apparition has quit [Quit: Bye]
white_lilies has quit [Ping timeout: 272 seconds]
kapil___ has joined #ruby
mooe has joined #ruby
P1RATEZ has quit []
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arekushi has joined #ruby
arekushi is now known as Guest18202
al2o3-cr has quit [Quit: WeeChat 2.2]
Dirak has quit [Ping timeout: 272 seconds]
al2o3-cr has joined #ruby
ciscam has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Quit: WeeChat 2.2]
ciscam has joined #ruby
sauvin has joined #ruby
idiocrash has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reber has joined #ruby
al2o3-cr has joined #ruby
reber has quit [Remote host closed the connection]
reber has joined #ruby
faitswulff has joined #ruby
faitswulff has quit [Ping timeout: 240 seconds]
druonysus has joined #ruby
reber has quit [Remote host closed the connection]
nowhere_man has quit [Ping timeout: 252 seconds]
akem has quit [Remote host closed the connection]
nowhere_man has joined #ruby
reber has joined #ruby
akem has joined #ruby
_whitelogger has joined #ruby
LiftLeft has quit [Ping timeout: 252 seconds]
reber has quit [Remote host closed the connection]
reber has joined #ruby
LiftLeft has joined #ruby
dellavg_ has joined #ruby
nowhereman has joined #ruby
nowhereman is now known as Guest25977
nowhere_man has quit [Ping timeout: 240 seconds]
MoritaShinobu has joined #ruby
akosednar has quit [Changing host]
akosednar has joined #ruby
akosednar has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
ua has quit [Ping timeout: 252 seconds]
akosednar has joined #ruby
akem__ has joined #ruby
akem has quit [Ping timeout: 260 seconds]
ua has joined #ruby
LiftLeft2 has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
LiftLeft has quit [Ping timeout: 252 seconds]
gravitation has joined #ruby
gravitation has quit [Client Quit]
ciscam has quit [Ping timeout: 252 seconds]
sticaz has joined #ruby
ciscam has joined #ruby
Eiam has quit [Ping timeout: 260 seconds]
sticaz has quit [Quit: sticaz]
sticaz has joined #ruby
sticaz has quit [Client Quit]
sticaz has joined #ruby
lomex has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
lomex has joined #ruby
asphyxia has quit [Ping timeout: 252 seconds]
duderonomy has quit [Client Quit]
venmx has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
akem__ has quit [Remote host closed the connection]
<wuzamarine>
how good is vhost support in Ruby? I've spent a year trying to get past 'Hello World' on django because I can't get vhost to work.
eblip is now known as eb0t_
<sonOfRa>
With passenger, vhosts work just fine
<wuzamarine>
sonOfRa: is it by chance a standard library?
<wuzamarine>
or at least under the main fork?
<sonOfRa>
Uh, passenger is similar to mod_wsgi what you'd use to run rails in apache
<sonOfRa>
Or are you not running rails?
<wuzamarine>
I'll need to be in rails. I was just curious if passenger was support on this main channel. I'm looking at the apache config now and it appears pretty 'bigbird/cookie monster'.
<sonOfRa>
Generally not too hard to configure, I think it's in debian and other repos, so you install it like other apache/nginx modules, and then configure it. Pretty well documented
wojnar has joined #ruby
mzo has quit [Ping timeout: 260 seconds]
cagomez has quit [Remote host closed the connection]
<apeiros>
the installer also mostly navigates you through the configuration
cagomez has joined #ruby
brent__ has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
al2o3-cr is now known as cmtprt
Fr4n has joined #ruby
<wuzamarine>
how expensive is rails on a system with a basic deployment? django is pretty lean where is laravel comes with a pretty big load for just the basics. how does rails compare?.
<daed>
i've never found it expensive at all
<daed>
could probably run millions of requests a day out of a $5 VPS
<daed>
$5/month i mean
<cmtprt>
daed: what webserver you using?
<baweaver>
Digital Ocean does around that rate.
<daed>
the last test run i did with a small VPS was nginx/unicorn
<daed>
yeah i was testing against a digitalocean VPS
<daed>
their $5 one
<daed>
i used jmeter to test against it
kpoman has joined #ruby
<cmtprt>
daed: nginx for ftw
<daed>
yeah i moved to nginx years ago, it's just superior to apache
cmtprt is now known as al2o3-cr
<al2o3-cr>
daed: without a doubt.
<baweaver>
https://m.do.co/c/0b83c42deae2 - Referral link, but it gets you $10 in credit which is good for a few months of use.
<kpoman>
hello ! I am getting error 401 with lot of ressources (js, css, images, etc..) on a rails app running with puma. Where do I check to authorize all that static content ?
<al2o3-cr>
?rails kpoman
<ruby[bot]>
kpoman: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<kpoman>
ah ok thanks !
johnny56 has quit [Ping timeout: 272 seconds]
<al2o3-cr>
baweaver: how's the book proceeding?
<baweaver>
Pretty well, two chapters out to editors, third mostly done, and fourth well on its way.
ciscam has quit [Ping timeout: 240 seconds]
ciscam has joined #ruby
johnny56 has joined #ruby
desperek has quit [Ping timeout: 252 seconds]
xfbs has quit [Quit: afk]
desperek has joined #ruby
white_lilies has quit [Ping timeout: 252 seconds]
jp has quit [Ping timeout: 252 seconds]
reber has quit [Read error: Connection reset by peer]
Hobbyboy has quit [Quit: I think the BNC broke.]
Hobbyboy has joined #ruby
tristanp has joined #ruby
venmx has joined #ruby
SuperTux88 has left #ruby ["WeeChat 2.1"]
desperek has quit [Quit: xoxo]
dviola has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
white_lilies has joined #ruby
jp has joined #ruby
Chew has joined #ruby
MyMind has quit [Ping timeout: 260 seconds]
MyMind has joined #ruby
xfbs has joined #ruby
clemens3 has quit [Ping timeout: 272 seconds]
wojnar has quit [Remote host closed the connection]
Guest25977 has joined #ruby
cagomez has joined #ruby
<cagomez>
Is it commonplace to open classes at runtime in production code?
<apeiros>
cagomez: given that there is only runtime in ruby - yes :D
<cagomez>
very sly
<cagomez>
apeiros: I have an AR model that I need to initialize with merged attributes from 2 sources. would it be better to create a class that uses these 2 sources and returns an initialized AR model, or define a method on the class itself at runtime that does the same thing?
<cagomez>
benefit of the former is that it's easily testable, whereas the latter I thought I'd just define the method and runtime and not have any explicit test coverage :\. Sounds bad now that I'm typing it out
xfbs has quit [Ping timeout: 245 seconds]
xfbs_ has joined #ruby
venmx has quit [Ping timeout: 252 seconds]
eb0t has joined #ruby
eb0t_ has quit [Ping timeout: 240 seconds]
eblip has joined #ruby
def_jam has quit [Ping timeout: 260 seconds]
white_lilies has quit [Quit: WeeChat 2.1]
tristanp has joined #ruby
eb0t is now known as eb0t_
<apeiros>
cagomez: what do you mean by "2 sources"? two tables?
<cagomez>
apeiros: 1 is a JSON response from an API call, and another user input. 2 hashes, basically