<phaul>
these are all workable approaches but they give you slightly different behaviour. you need to consider whether a single (inmutable) attack object is ok per name or you need one dynamically ( newly created ) on each lookup by name.
<phaul>
then you can think about the interface, which is an orthogonal question. Separate class, or same class class methods for lookup by name. All can work whichever interface you like better
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has joined #ruby
hiroaki has joined #ruby
xrexeon has quit [Remote host closed the connection]
dellavg_ has joined #ruby
uplime has joined #ruby
Dbugger has joined #ruby
uplime has quit [Ping timeout: 268 seconds]
uplime has joined #ruby
raul782 has quit [Ping timeout: 272 seconds]
<phaul>
desperek: it doesn't seem like camping has a lot of traction. https://github.com/camping/camping/commits/master seems about ~20 check ins in the past 4 years. what's the appeal? If you want something small, why not roda?
Fernando-Basso has quit [Remote host closed the connection]
<desperek>
well, looks nice
<desperek>
but then, camping is kinda more raily ://
<desperek>
railsy
<desperek>
aaand theeen i also think of other langs
d10n-work has joined #ruby
bmurt has joined #ruby
davidw has joined #ruby
Fridtjof has joined #ruby
hiroaki has quit [Ping timeout: 245 seconds]
hutch has joined #ruby
TaterTotMan has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
Puffball has quit [Remote host closed the connection]
orbyt_ has joined #ruby
<havenwood>
desperek: Camping was a neat project by _why, but I agree there are crisper options these days unless you're just exploring.
<desperek>
oh are there
<havenwood>
desperek: If you'd like something Rails-ish, checkout Hanami. Or if you'd like something simple that's extensible, +1 Roda.
<desperek>
well, okay. i think ill check out roda+sequel more
<havenwood>
i do like that path. it's fun to write all the code yourself and keep it tiny.
<desperek>
true
<desperek>
havenwood, im just a little bit confused. should i put my routing tree in .ru or .rb
<desperek>
i guess it doesnt matter?
hutch has quit [Ping timeout: 246 seconds]
<havenwood>
desperek: All Rack apps have a config.ru file (rackup file), even Rails. Typically in a Roda app you'll start with config.ru that uses the Roda app from an app.rb.
<havenwood>
desperek: you're right, it doesn't really matter.
hutch has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has quit [Ping timeout: 250 seconds]
noobineer has joined #ruby
xrexeon has joined #ruby
xrexeon has quit [Max SendQ exceeded]
xrexeon has joined #ruby
xrexeon has quit [Max SendQ exceeded]
xrexeon has joined #ruby
uranoss has quit [Quit: Connection closed for inactivity]
reber has quit [Remote host closed the connection]
tdy has joined #ruby
cthulchu has joined #ruby
noobineer has quit [Ping timeout: 246 seconds]
ghormoon has joined #ruby
<noboruma>
Hi guys, is there any nice way of applying a color on string (in place) that matches a specific regex?
<phaul>
noboruma: can you elaborate a bit more? Where do you want to see the colours? What interface are you talking about? terminal? web? neither?
cthulchu has quit [Ping timeout: 264 seconds]
<noboruma>
phaul: woops, I should have put more detailed! I want to see those colour in terminal. I am working a CLI tool that execute some external shell commands and I would like to colourise their outputs
<phaul>
noboruma: is printing strings (in colour) what you want? you also said in place.. which makes me wonder you need more terminal control
m27frogy has quit [Ping timeout: 268 seconds]
Puffball has joined #ruby
<noboruma>
phaul: thank you for the links, I am checking rainbow but in my understanding, colorize "only" allow you to colorize a full string. What I want to do is colorize only certain part of a string (for instace all the numbers in red)
<noboruma>
I was wondering if there is any regex tricks that could help?
m27frogy has joined #ruby
noobineer has joined #ruby
<phaul>
noboruma: Im sorry I don't fully follow. You can split up a string and then apply colours to sub strings and concatenate them back together. Colour here is really nothing more that inserting a bunch of ANSI escape sequences under the hood.
<desperek>
or gsub
<noboruma>
phaul: yes, but my question is: what is the nicest way of achieving that (spliting+inserting) in ruby?
duderonomy has joined #ruby
<noboruma>
I guess gsub might be the answer, thanks guys!
tpanarch1st has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
conta has quit [Quit: conta]
Fernando-Basso has joined #ruby
Spitfire has joined #ruby
barg has quit []
<desperek>
havenwood, do you have any idea how do i know how to access session etc.?
<desperek>
nvm i know it now
raul782 has joined #ruby
quipa has joined #ruby
raul782 has quit [Ping timeout: 246 seconds]
hutch has joined #ruby
lupine has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
hutch has quit [Ping timeout: 268 seconds]
tdy has quit [Ping timeout: 240 seconds]
tpanarch1st has quit [Ping timeout: 240 seconds]
sanscoeur has joined #ruby
m27frogy_ has joined #ruby
m27frogy has quit [Ping timeout: 268 seconds]
lupine has joined #ruby
tdy has joined #ruby
uplime has quit [Quit: WeeChat 2.2]
sonofentropy has joined #ruby
Aqo has quit [Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805]]
sonofentropy has quit [Quit: sonofentropy]
\void has joined #ruby
tdy1 has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
Dbugger has quit [Ping timeout: 250 seconds]
tdy1 has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy1 has joined #ruby
mr_roybot has joined #ruby
cd has joined #ruby
uplime has joined #ruby
mr_roybot has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 272 seconds]
hightower2 has joined #ruby
<hightower2>
Hey, I 'require' a ruby file. Inside the required file, which variable or constant contains its full path?
<havenwood>
lupine: If you change the working directory, Dir.pwd won't be the dir the file is in anymore, so Ii think it's better to use `File.expand_path(__dir__)` and `File.expand_path(__FILE__)`.
<lupine>
fair
Fernando-Basso has quit [Remote host closed the connection]