duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
bkxd has joined #ruby
bkxd_ has joined #ruby
nitza has joined #ruby
bkxd_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
bkxd_ has joined #ruby
bronson has joined #ruby
bkxd_ has quit [Ping timeout: 268 seconds]
bkxd has quit [Ping timeout: 268 seconds]
nebben has quit []
bronson has quit [Ping timeout: 248 seconds]
<impermanence>
what is the proper extension for a rake file?
<impermanence>
actually what is the proper full name for a rake file?
<impermanence>
rakefile.rake?
<impermanence>
rakefile.rb?
ketan has joined #ruby
jameser has joined #ruby
jameser has quit [Client Quit]
relyks has quit [Quit: Leaving]
ketan has quit [Ping timeout: 240 seconds]
<ineb>
its usually 'Rakefile' with no extension
shinnya has quit [Ping timeout: 260 seconds]
dviola has quit [Quit: WeeChat 1.9]
[ohjn] has left #ruby ["gotta go"]
comet23 has quit [Ping timeout: 240 seconds]
rhyselsmore has joined #ruby
patarr has joined #ruby
podlech has joined #ruby
podlech has quit [Client Quit]
<impermanence>
ineb: sorry for the delayed response. Anyway, that's interesting and I did not know that. I read that they should always be named rakefile.rb, lol
patarr has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
tastygradient has joined #ruby
hutch34 has quit [Ping timeout: 248 seconds]
bronson has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
tastygradient has quit [Quit: leaving]
djbkd has joined #ruby
ascarter_ has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
shiranuidong has quit [Remote host closed the connection]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
dasher00 has quit [Ping timeout: 255 seconds]
solocshaw has joined #ruby
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 255 seconds]
benjen has quit [Quit: *Dies off camera*]
benjen has joined #ruby
charliesome has joined #ruby
tvw has quit []
sagax has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
sepp2k has joined #ruby
nowhere_man has joined #ruby
cseder has joined #ruby
pmden has joined #ruby
polysics has joined #ruby
blackwind_123 has quit [Quit: Always try to be modest, and be proud about it!]
sepp2k has quit [Ping timeout: 240 seconds]
bsartek has quit [Quit: This computer has gone to sleep]
ianfleeton has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
aphelion has joined #ruby
guardian` has joined #ruby
<aphelion>
i have a PORO to define payment gateways. i was having some issues, so i added some require_relative lines since i guess i have to load in the other files. now i get the error: "Circular dependency detected while autoloading constant" code: https://gist.github.com/LordRobust/3af928f05b9cd7e59955d21d620a01eb
<dminuoso>
aphelion, should be obvious what the problem is.
<aphelion>
nope
<aphelion>
im guessing im requiring what is being required
<aphelion>
so its a loop
<aphelion>
but idk how to fix that
<dminuoso>
aphelion, a requires b, b requires a.
<aphelion>
yeah
<aphelion>
so how do i fix that
<aphelion>
i.e. another way to do it
<dminuoso>
aphelion, don't keep that registry in the base class.
<dminuoso>
It's a design smell anyway
<aphelion>
so what, a gatewaygetter class?
<dminuoso>
Uhh...
<aphelion>
gatewayhandler or something
jeffreylevesque has joined #ruby
<dminuoso>
Don't let your base class know about its descendants in the first place.
<aphelion>
yeah so i have to have another class to serve as the getter
<aphelion>
to hold the registry
<dminuoso>
Besides, what you are doing is essentially some quirky attempt to do singletons - which is another code smell.
<CSMan>
hello
<dminuoso>
Why use such a registry anyway?
<aphelion>
good point
<CSMan>
I'm trying to build a native library with a local copy, but it doesn't seem to have a Gemfile
<CSMan>
Could not find gem 'grpc' in source at `/usr/local/rvm/gems/ruby-2.2.0/gems/grpc-1.4.0`.
<CSMan>
Source does not contain any versions of 'grpc'
kculpis has joined #ruby
<dminuoso>
aphelion, def self.get_gateway_class(str); const_get(str.capitalize + "Gateway"); end
<dminuoso>
Do it fully dynamic.
GodFather_ has joined #ruby
<dminuoso>
If for some reason you want to cache them, you could set up a registry (which would probably be just a plain module)
<aphelion>
that get gateway class method is fine
<dminuoso>
aphelion, be sure to consider whitelisting the input depending on the circumstance
<aphelion>
what do you mean
<dminuoso>
aphelion, well let's say you had some execute method that did: def execute_policy(name); const_get(name).new.exec; end -- and a user had direct control over what "name" was, and you had some class FileSystemDeleter; def exec; ...; end; end
<dminuoso>
aphelion, so you could actually do
bronson has joined #ruby
<dminuoso>
aphelion, GATEWAYS = { stripe: "StripeGateway", paypal: "PaypalGateway" } and then just do const_get(GATEWAYS[name])
bronson has quit [Ping timeout: 248 seconds]
guardianx has quit [Read error: Connection reset by peer]
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guardianx has joined #ruby
* apeiros
pokes dminuoso with a Symbol
<apeiros>
if everything is loaded, i.e. no lazy loading, you can also just do: Gateways = {strip: StripeGateway, paypal: PaypalGateway} (or if it's autoloaded, then too)
<aphelion>
const_get(GATEWAYS[name.to_sym]) seems to return uninitialized constant GatewayLookup::PaypalGateway
<dminuoso>
Mmm
<aphelion>
well, these are some POROs in Ruby on RAils
<aphelion>
i think they're autoloaded
<dminuoso>
aphelion, dont use manual require statements with autoloaded classes in rails.
<aphelion>
without it, it was giving an error
<dminuoso>
The official documentation says "no."
<aphelion>
well, it still is
<aphelion>
what's the alternative?
<dminuoso>
?
<aphelion>
it's not autoloading them i think
<aphelion>
they're located in /app/models/gateways
<dminuoso>
there. autoloaded.
<dminuoso>
!next
<aphelion>
lol
<aphelion>
so whats up with this:
<aphelion>
const_get(GATEWAYS[name.to_sym]) seems to return uninitialized constant GatewayLookup::PaypalGateway
<dminuoso>
aphelion, everything under /app/*/ is autoloaded by default in rails.
<dminuoso>
aphelion, ignore everything I have said, and your original attempt.
ianfleeton has joined #ruby
<dminuoso>
aphelion, you need to follow the rails conventions so rails can figure out how to find stuff.
<aphelion>
whats the rails convention to get a class this way
<aphelion>
their* way
<dminuoso>
aphelion, matching the path and filename to the constants name
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ianfleeton has joined #ruby
<aphelion>
well, i fixed most those issues
<aphelion>
i need to create a new instance though
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guardian` has quit [Ping timeout: 260 seconds]
sepp2k has joined #ruby
tau has joined #ruby
tau has left #ruby [#ruby]
rohitpaulk has quit [Ping timeout: 260 seconds]
<[SpLaT]>
Anybody ever have an issue where the symbolic links to current/ don't work after deploying with capistrano? There is no error in the log and if I do it by hand - it works fine.
guardian` has joined #ruby
pwnd_nsfw has quit [Read error: Connection reset by peer]
GodFather_ has quit [Read error: Connection reset by peer]
GodFather_ has joined #ruby
Ishido has joined #ruby
sepp2k has quit [Quit: Leaving.]
guardian has quit [Disconnected by services]
guardian` has quit [Quit: Coyote finally caught me]
guardian has joined #ruby
ianfleeton has joined #ruby
blackwind_123 has joined #ruby
pwnd_nsfw has joined #ruby
nofxxx has joined #ruby
nofxxxx has quit [Ping timeout: 240 seconds]
sepp2k has joined #ruby
shinnya has quit [Ping timeout: 246 seconds]
sepp2k has quit [Client Quit]
enterprisey has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
polysics has quit [Remote host closed the connection]
polysics has joined #ruby
romankapitonov has joined #ruby
polysics has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby
guardianx has quit []
romankapitonov has quit [Read error: Connection reset by peer]
zapata has quit [Ping timeout: 255 seconds]
sepp2k has joined #ruby
belmoussaoui__ has quit [Ping timeout: 255 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aglorei has quit [Remote host closed the connection]
preyalone has joined #ruby
ascarter has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
bsartek has joined #ruby
aglorei has joined #ruby
sepp2k has quit [Quit: Leaving.]
TwoPiece has joined #ruby
TwoPiece has quit [Max SendQ exceeded]
PatrikasZvaigzde is now known as naprimer
romankapitonov has joined #ruby
zapata has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
br|ck has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
bsartek has quit [Quit: This computer has gone to sleep]
sepp2k has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
polysics has joined #ruby
polysics has quit [Remote host closed the connection]
polysics has joined #ruby
sepp2k has quit [Client Quit]
antgel has quit [Ping timeout: 246 seconds]
bronson has joined #ruby
JoshS has quit [Ping timeout: 255 seconds]
TwoPiece has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
kent\n has quit [Remote host closed the connection]
kent\n has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
br|ck has quit [Ping timeout: 255 seconds]
romankapitonov has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
romankapitonov has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
boombox_ has joined #ruby
boombox_ has quit [Read error: Connection reset by peer]
boombox_ has joined #ruby
cseder has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
romankapitonov has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
rohitpaulk has joined #ruby
boombox_ has quit [Remote host closed the connection]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
knight33 has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
boto has quit [Quit: boto]
brent__ has joined #ruby
vondruch has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 240 seconds]
vondruch has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
conta has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
rohitpaulk has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
<sagax>
hi all!
<sagax>
i find small web framework or just web server on ruby
bsartek has joined #ruby
<sagax>
not rubyonrails
<sagax>
what we have, small and simply?
<ytti>
sinatra is pretty common option
romankapitonov has joined #ruby
shinnya has joined #ruby
brent__ has quit [Remote host closed the connection]
maattdd has joined #ruby
ketan has quit [Ping timeout: 276 seconds]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
maattdd has quit [Ping timeout: 240 seconds]
TwoPiece has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has quit [Quit: Leaving]
TwoPiece has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
weathermaker has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
romankapitonov has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
InfinityFye has quit [Quit: Leaving]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
knight33 has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
conta has quit [Ping timeout: 248 seconds]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
br0d1n has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
dviola has joined #ruby
dviola has quit [Changing host]
dviola has joined #ruby
romankapitonov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
chouhoulis has quit [Remote host closed the connection]
andrzejku has quit [Remote host closed the connection]
chouhoulis has joined #ruby
romankapitonov has joined #ruby
gheegh has joined #ruby
vondruch has quit [Remote host closed the connection]
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has joined #ruby
andrzejku has joined #ruby
cseder has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
<gheegh>
asked onthe Rails channel as well. but thought I'd ask here. does anyone know of existing code/gem to convert strings like this into integers? "67.2M
preyalone has quit [Quit: Connection closed for inactivity]
<gheegh>
i'd expect that to convert 67.2M to 67,200,000
bronson has joined #ruby
JoshS has joined #ruby
shinnya has quit [Ping timeout: 258 seconds]
bronson has quit [Ping timeout: 240 seconds]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dcunit3d has quit [Ping timeout: 248 seconds]
dcunit3d has joined #ruby
ecuanaso has joined #ruby
ni886105 has joined #ruby
ni886105 has quit [Remote host closed the connection]
uZiel has quit [Remote host closed the connection]
hays has quit [Read error: Connection reset by peer]
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
weathermaker has quit [Quit: weathermaker]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
danguita has quit [Ping timeout: 248 seconds]
mtkd has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
conta has joined #ruby
bsartek has quit [Quit: This computer has gone to sleep]
bsartek has joined #ruby
conta has quit [Ping timeout: 268 seconds]
HoierM_ has quit [Ping timeout: 240 seconds]
knight33 has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
ianfleeton has joined #ruby
BSaboia has joined #ruby
tacoboy has joined #ruby
ascarter has joined #ruby
skweek has joined #ruby
rohitpaulk has quit [Remote host closed the connection]