raul782 has quit [Remote host closed the connection]
raul782 has joined #ruby
cagmz_ has quit [Quit: Leaving]
Bhootrk_ has joined #ruby
_whitelogger has joined #ruby
Dimik has joined #ruby
mooser has joined #ruby
mooser has quit [Remote host closed the connection]
mooser has joined #ruby
FahmeF has joined #ruby
milardovich has joined #ruby
ar1a has quit [Ping timeout: 260 seconds]
ahrs has quit [Remote host closed the connection]
ar1a has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
Ilie[] has quit [Remote host closed the connection]
Ilie has joined #ruby
ahrs has joined #ruby
nowhere_man has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
mooser has quit [Remote host closed the connection]
bruno-_ has quit [Ping timeout: 240 seconds]
mooser has joined #ruby
hndk_ has joined #ruby
mooser has quit [Ping timeout: 260 seconds]
hndk has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
raul782 has quit [Remote host closed the connection]
mkaito has quit [Read error: Connection reset by peer]
mkaito_ has joined #ruby
mkaito_ is now known as mkaito
mkaito has quit [Changing host]
mkaito has joined #ruby
apparition has joined #ruby
mooser has joined #ruby
hndk_ has quit [Ping timeout: 276 seconds]
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
apparition has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
voxxit has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
voxxit has joined #ruby
bkxd has quit [Read error: Connection reset by peer]
brent__ has joined #ruby
enterprisey has quit [Remote host closed the connection]
tgragnato has quit [Quit: Sto andando via]
milardovich has joined #ruby
minimalism has quit [Quit: minimalism]
bronson has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
apparition has quit [Quit: Bye]
bronson has quit [Ping timeout: 240 seconds]
alex`` has joined #ruby
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
brent__ has quit [Remote host closed the connection]
mooser has quit [Remote host closed the connection]
TomyLobo3 has joined #ruby
yabbes has joined #ruby
Ishido has joined #ruby
jameser has joined #ruby
mooser has joined #ruby
P_R_Deltoid has quit [Quit: Leaving]
GodFather has quit [Ping timeout: 246 seconds]
milardovich has joined #ruby
tildes has joined #ruby
scrooloose has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 240 seconds]
mooser has quit [Remote host closed the connection]
mooser has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
cadillac_ has quit [Ping timeout: 276 seconds]
cadillac_ has joined #ruby
mooser has quit [Ping timeout: 255 seconds]
lantastic has joined #ruby
enterprisey has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
apparition has joined #ruby
moeabdol has joined #ruby
dionysus69 has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
scrooloose has joined #ruby
jameser has joined #ruby
vuoto has joined #ruby
sleetdrop has joined #ruby
sleetdrop has quit [Client Quit]
petrussola has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
code_zombie has quit [Quit: Leaving]
mooser has joined #ruby
bkxd has joined #ruby
petrussola has quit [Quit: Page closed]
nowhere_man has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
muzik has quit [Ping timeout: 240 seconds]
mooser has quit [Ping timeout: 240 seconds]
raul782 has joined #ruby
raul782 has quit [Remote host closed the connection]
raul782 has joined #ruby
tildes has quit [Ping timeout: 255 seconds]
conta has joined #ruby
GodFather has joined #ruby
antgel has joined #ruby
sixsixsix has quit [Quit: Page closed]
Ilie[] has joined #ruby
Ilie has quit [Read error: Connection reset by peer]
kapil___ has joined #ruby
djbkd has joined #ruby
lantastic has quit [Ping timeout: 260 seconds]
<yabbes>
i just tried to use a decrement operator -= on a string, and having no idea what ruby wanted to tell me why it wouldnt work "no method -" ; until i wanted to ask here, then i remembered that it was not a number already.. so stupid.. so thank you guys ;) "1".to_i
raul782 has quit [Remote host closed the connection]
mooser has joined #ruby
_main_ has joined #ruby
mooser has quit [Ping timeout: 240 seconds]
ltem has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
_main_ has joined #ruby
__main__ has quit [Ping timeout: 276 seconds]
_main_ is now known as __main__
bronson has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
bkxd_ has joined #ruby
raul782 has joined #ruby
phinxy has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
raul782 has quit [Remote host closed the connection]
raul782 has joined #ruby
tildes has joined #ruby
raul782 has quit [Ping timeout: 260 seconds]
mooser has joined #ruby
nofxxx has joined #ruby
futilegames has joined #ruby
mooser has quit [Ping timeout: 260 seconds]
marr has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
lantastic has joined #ruby
postmodern has quit [Quit: Leaving]
rgtk has joined #ruby
Bhootrk_ has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
bkxd_ has quit [Ping timeout: 260 seconds]
Dimik has quit [Ping timeout: 260 seconds]
rgtk has quit [Ping timeout: 240 seconds]
mooser has joined #ruby
jinie_ has quit [Ping timeout: 240 seconds]
creat has joined #ruby
jinie_ has joined #ruby
quobo has joined #ruby
eelster has quit [Ping timeout: 240 seconds]
mooser has quit [Ping timeout: 248 seconds]
Pacra has quit [Ping timeout: 255 seconds]
vuoto has quit [Quit: Lost terminal]
nOwz has joined #ruby
rippa has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
mooser has joined #ruby
andrzejku has joined #ruby
djellemah has joined #ruby
bkxd_ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
mooser has quit [Ping timeout: 260 seconds]
TvL2386_ is now known as TvL2386
mooser has joined #ruby
mooser has quit [Remote host closed the connection]
<TvL2386>
hey guys, I'm starting development on several gems. I want them all to be member of the same module
<TvL2386>
something like net/ssh net/telnet
<TvL2386>
nm... :)
soloscshaw has joined #ruby
jrafanie has joined #ruby
jrafanie has quit [Ping timeout: 255 seconds]
mustaffa has quit [Ping timeout: 260 seconds]
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mooser has joined #ruby
mooser has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
tildes has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
bkxd has joined #ruby
bkxd_ has quit [Ping timeout: 260 seconds]
futilegames has quit [Quit: futilegames]
bronson has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
zapata has quit [Quit: WeeChat 1.9]
vuoto has quit [Client Quit]
vuoto has joined #ruby
conta has quit [Ping timeout: 260 seconds]
djbkd has quit []
InfinityFye has joined #ruby
mooser has joined #ruby
charliesome has joined #ruby
mooser has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
<TvL2386>
hey guys, I'm making a gem which is going to query the webservices of a piece of software. For that I need a base_url, a username and a password.
<TvL2386>
I want to set those 3 variables once in my program
<TvL2386>
and not supply them on every request
milardovich has quit [Ping timeout: 240 seconds]
<TvL2386>
I was thinking of `MyGem.configure { |c| c.user = 'bla' ; c.pass = 'secret' ; c.base_url = 'https://...' }`
<TvL2386>
not sure if it's a good idea though
jcao219 has quit [Ping timeout: 240 seconds]
lantastic has quit [Ping timeout: 260 seconds]
noe has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
gobertron has joined #ruby
DTZUZO has quit [Ping timeout: 260 seconds]
<Radar>
TvL2386: yes that is a pattern I've seen done before.
gloscombe has quit [Quit: WeeChat 1.9]
<apeiros>
I see it a lot and I don't like it.
<apeiros>
IMO it means you want a class which takes those params on initialize
bkxd_ has joined #ruby
<apeiros>
if you then want one instance of that class in your app, make that part of your app and not that class.
<apeiros>
e.g. MyApp::ThatService = ThatService::Client.new(user: "user", password: "1234", base_url: "…")
bkxd has quit [Ping timeout: 260 seconds]
jcao219 has joined #ruby
<apeiros>
the other way (MyGem.configure) paints you into a corner where you can ever only have one instance per process. it's a bad pattern for that reason.
<apeiros>
singleton pattern considered harmful™
oleo has quit [Quit: irc client terminated!]
gloscombe has joined #ruby
mooser has joined #ruby
alex`` has quit [Ping timeout: 246 seconds]
nOwz has quit [Ping timeout: 255 seconds]
mooser has quit [Ping timeout: 260 seconds]
tildes has joined #ruby
vuoto has quit [Ping timeout: 240 seconds]
tildes has quit [Ping timeout: 276 seconds]
gobertron has quit [Quit: Leaving]
djellemah has quit [Ping timeout: 260 seconds]
runescape07rsps has joined #ruby
lantastic has joined #ruby
jcao219 has quit [Ping timeout: 240 seconds]
alex`` has joined #ruby
conta has joined #ruby
Ishido has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
raul782 has joined #ruby
oleo has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
nOwz has joined #ruby
nOwz has quit [Client Quit]
raul782 has quit [Ping timeout: 248 seconds]
Ishido has joined #ruby
WeiJunLi has joined #ruby
mooser has joined #ruby
kx_ has joined #ruby
kx_ is now known as kaiks
bkxd has joined #ruby
andrzejku has joined #ruby
lxsameer has joined #ruby
mooser has quit [Ping timeout: 260 seconds]
bkxd_ has quit [Ping timeout: 260 seconds]
WeiJunLi has quit [Ping timeout: 240 seconds]
xall has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
<ineb1>
apeiros: is a singleton for app configuration ok?
<ineb1>
MyApp::Config.username or whatever
goyox86 has joined #ruby
Ishido has quit [Ping timeout: 240 seconds]
_sfiguser has quit [Ping timeout: 260 seconds]
sepp2k has joined #ruby
<apeiros>
in an app I mind it much less. but even an app is IMO a class with the config part of its instance. I just see no reason. and you can still have the convenience of a singleton if you want.
<apeiros>
*I just see no reason to artificially limit the way your code can be used
* apeiros
should pay attention to what he writes
<apeiros>
I mean even if you don't want to run multiple instances of your application in a process, it's still nice to be able for e.g. testing. no need to muck around stubbing different configurations you want to test.
Exagone313 has quit [Quit: see ya!]
nadir has joined #ruby
<apeiros>
in general "Oh, I have this state I don't want to pass around" - "well, that's exactly what objects do for you"
Ishido has joined #ruby
naftilos76 has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
mooser has joined #ruby
gloscombe has quit [Ping timeout: 240 seconds]
mooser has quit [Ping timeout: 276 seconds]
_sfiguser has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Exagone313 has joined #ruby
bronson has joined #ruby
xall has quit [Quit: xall]
conta has quit [Ping timeout: 260 seconds]
bkxd_ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
apparition has quit [Quit: Bye]
yabbes has quit [Ping timeout: 240 seconds]
vuoto has quit [Client Quit]
vuoto has joined #ruby
gloscombe has joined #ruby
yabbes has joined #ruby
lantastic has quit [Ping timeout: 276 seconds]
<ineb1>
this is what i have currently
<ineb1>
a spearate config for the spec suite
vuoto has quit [Quit: Lost terminal]
<ineb1>
iam not too happy about it though
vuoto has joined #ruby
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
alex`` has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
ski7777 has quit [Read error: Connection reset by peer]
andrzejku has joined #ruby
ski7777 has joined #ruby
mooser has joined #ruby
ecuanaso has joined #ruby
Ishido has quit [Ping timeout: 240 seconds]
bkxd_ has quit [Ping timeout: 240 seconds]
mooser has quit [Ping timeout: 246 seconds]
Ishido has joined #ruby
someuser has quit [Ping timeout: 260 seconds]
oded has joined #ruby
minichiello has joined #ruby
minichiello has left #ruby [#ruby]
vuoto has quit [Ping timeout: 240 seconds]
ltem has quit [Quit: Leaving]
ski7777 has quit [Read error: Connection reset by peer]
ski7777 has joined #ruby
andrzejku has quit [Read error: Connection reset by peer]
apparition has joined #ruby
bkxd has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
lxsameer has quit [Ping timeout: 260 seconds]
vuoto has joined #ruby
dionysus69 has quit [Remote host closed the connection]
mooser has joined #ruby
ski7777 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
ski7777 has joined #ruby
tacoboy has joined #ruby
mooser has quit [Remote host closed the connection]
dstrunk has joined #ruby
mooser has joined #ruby
mooser has quit [Remote host closed the connection]
mooser has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
FahmeF has quit [Ping timeout: 260 seconds]
mooser has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
raul782 has joined #ruby
selim has quit [Ping timeout: 246 seconds]
selim has joined #ruby
raul782 has quit [Ping timeout: 240 seconds]
mooser has joined #ruby
mooser has quit [Remote host closed the connection]
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
milardovich has quit [Remote host closed the connection]
InfinityFye has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
raul782 has quit [Remote host closed the connection]
milardovich has quit [Ping timeout: 248 seconds]
tirej has joined #ruby
andrzejku has joined #ruby
Timba-as has joined #ruby
Timba-as has quit [Client Quit]
proctrap has quit [Read error: Connection reset by peer]
proctrap has joined #ruby
raul782 has joined #ruby
dstrunk has joined #ruby
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
raul782 has quit [Remote host closed the connection]
oded has quit [Quit: Konversation terminated!]
milardovich has quit [Ping timeout: 276 seconds]
kahra has quit [Quit: WeeChat 1.9]
Xeago has joined #ruby
tom69 has joined #ruby
yabbes has quit [Ping timeout: 240 seconds]
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tom69>
does anybody use ruby without rails? is there any reason to avoid using ruby if you are not doing wweb work?
eljimmy has joined #ruby
<Papierkorb>
tom69: There's plenty to do outside of web, and plenty other frameworks for web (Roda+Sequel <3)
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
<Papierkorb>
Clustering software, all kinds of random small-ish tools (some using simplistic web UIs, some CLIs). You can do almost anything with ruby, except for system programming and high-performance stuff
treaki has joined #ruby
ta_ has joined #ruby
raul782 has joined #ruby
milardovich has joined #ruby
<tom69>
Papierkorb - so, pretty comparable to python?
<Papierkorb>
Never used python, but I both are general purpose programming languages
bronson has joined #ruby
<Papierkorb>
Another really useful thing was, when working with a Java shop, to start pry in JRuby, and then explore java libraries from there. Much easier to try stuff than having to mess with that other language
jcao219 has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
raul782 has quit [Ping timeout: 268 seconds]
deep-book-gk_ has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
mustaffa has quit [Ping timeout: 255 seconds]
j0bk has quit [Changing host]
j0bk has joined #ruby
deep-book-gk_ has left #ruby [#ruby]
runescape07rsps has quit [Quit: Leaving]
alex`` has quit [Quit: WeeChat 1.9]
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
codelurker has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
prawnzy has quit [Ping timeout: 246 seconds]
ltem has joined #ruby
weathermaker has joined #ruby
lizard2010 has joined #ruby
mustaffa has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
prawnzy has joined #ruby
auxbuss has joined #ruby
tom69 has left #ruby ["WeeChat 1.9"]
lizard2010 has quit [Client Quit]
soloscshaw has quit [Ping timeout: 246 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
ar1arelaybot has joined #ruby
yabbes has joined #ruby
prawnzy has quit [Ping timeout: 276 seconds]
cadillac_ has joined #ruby
DLSteve has joined #ruby
asjdsahd has joined #ruby
asjdsahd has quit [Client Quit]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
postmodern has joined #ruby
auxbuss has quit [Quit: I'm gone.]
rgtk has joined #ruby
average has joined #ruby
<average>
in Ruby, why does one want to do
<average>
conn = Some::Obj self.class.name ?
<average>
what's the point of that?
<average>
that's happening inside a method of a class
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
codelurker has quit [Quit: Leaving]
weathermaker has quit [Quit: weathermaker]
andrzejku has joined #ruby
lantastic has joined #ruby
<Papierkorb>
average: Can you give the actual line of code doing what you mean?
<average>
it's exactly how I wrote it
<average>
uhm, let me rephrase
<Papierkorb>
`Some::Obj`..?
<average>
conn = Some::Obj.new self.class.name
<average>
it's actually Net::HTTP::Persistent , not Some::Obj
<average>
still.. idk why it's passing the current class name to it
<Papierkorb>
> # Set +name+ to keep your connections apart from everybody else's.
<Papierkorb>
Looks like you're also missing the `name:` part. Please, if you ask for help, do NOT try to "simplify" it.
dviola has joined #ruby
<Papierkorb>
It makes it much harder to help. The simplification in this case made it impossible to get the correct answer to your question.
<average>
sorry about that Papierkorb
<Papierkorb>
Looks like the net http persistant stuff has an internal "pool" of named connections. The user of `Persistent` chose to use the name of the current class as name for the connection name, which sounds reasonable: If everyone does this, no collisons will occur, so no one else will mess with your connection
<average>
like what collision tho?
lxsameer has joined #ruby
<average>
oh.. nvm
raul782 has joined #ruby
lantastic has quit [Ping timeout: 240 seconds]
raul782 has quit [Client Quit]
kkiero has joined #ruby
Dimik has joined #ruby
statelesscode has quit [Read error: Connection reset by peer]
goyox86 has quit [Read error: No route to host]
goyox86 has joined #ruby
lantastic has joined #ruby
uZiel has joined #ruby
kkiero_ has joined #ruby
kkiero_ has quit [Client Quit]
kkiero has quit [Quit: leaving]
_sfiguser has quit [Ping timeout: 240 seconds]
marr has joined #ruby
<average>
Papierkorb: thanks for brainstorming and helping me