havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
Swyper has quit [Remote host closed the connection]
sergioro has quit [Quit: leaving]
markopasha has quit [Ping timeout: 268 seconds]
markopasha has joined #ruby
markopasha has quit [Remote host closed the connection]
gmcintire has quit [Read error: Connection reset by peer]
strmpnk has quit [Ping timeout: 246 seconds]
gmcintire has joined #ruby
strmpnk has joined #ruby
ur5us has quit [Ping timeout: 245 seconds]
nowhere_man has quit [Ping timeout: 272 seconds]
TCZ has joined #ruby
ur5us has joined #ruby
capadesu has quit [Remote host closed the connection]
drincruz has quit [Ping timeout: 268 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
GodFather has quit [Ping timeout: 272 seconds]
Swyper has quit [Remote host closed the connection]
davidw has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Bye Bye]
cnsvc has quit [Ping timeout: 240 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
dasher00 has quit [Ping timeout: 240 seconds]
splud_wurk has quit [Quit: splud_wurk]
DaRock has quit [Ping timeout: 268 seconds]
wildtrees has quit [Quit: Leaving]
thoraxe has joined #ruby
_phaul has quit [Ping timeout: 246 seconds]
<thoraxe> so i have an array of models m where each Model has a slug attribute (m.slug). I have another array of slugs (["foo","bar"]) and I want to find any of the models in m that have a slug that's in the slugs array
<thoraxe> i'm guessing this is some weird combination of map (on slugs) and select (on m) but my search fu is failing me
<thoraxe> i could do each on slug but that seems naughty
<thoraxe> and slow
_phaul has joined #ruby
<adam12> thoraxe: models.select {|model| array_of_slugs.include?(model.slug) }
<adam12> thoraxe: if I'm understanding you correctly.
<thoraxe> ahh darnit
<thoraxe> yeah i think that's right
<thoraxe> yep, taht's exactly it
<thoraxe> thank you!!
<thoraxe> totally forgot about .include?
<thoraxe> adam12++
<adam12> thoraxe: There's a Railsish version tat flips it but I don't know off the top of my head.
<adam12> thoraxe: model.slug.contained_in(array_of_slugs) or something.
<thoraxe> ah, this is fine tho
<thoraxe> but that's interesting
<adam12> Cool
<thoraxe> (it is rails yes)
ruby-lang465 has joined #ruby
ruby-lang465 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
grilix has joined #ruby
<havenwood> thoraxe: that's ^ the railsism, #in?
renich has joined #ruby
drincruz has joined #ruby
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #ruby
grilix has quit [Ping timeout: 245 seconds]
BrianWGray has quit [Ping timeout: 260 seconds]
tpanarch1st has quit [Ping timeout: 255 seconds]
pisculichi has quit [Ping timeout: 272 seconds]
grilix has joined #ruby
soulisson has joined #ruby
duderonomy has joined #ruby
<soulisson> Hi, is RoR hard to master?
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
tsujp has joined #ruby
tsujp has quit [Client Quit]
drincruz has quit [Ping timeout: 272 seconds]
riceandbeans has joined #ruby
<riceandbeans> Hey, what's the proper term for methods that are !
<riceandbeans> I know what they do by convention
orbyt_ has joined #ruby
<riceandbeans> I just.....I was wanting to explain them to someone today because I was asked and I was like..you know...I don't actually know what they're called but this is what they mean and gave examples to illustrate
<riceandbeans> ie, "FOO".downcase!
turbo_choo has quit [Ping timeout: 265 seconds]
Mrgoose845701915 has quit [Ping timeout: 265 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mrgoose845701915 has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
Guest51 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
sagax has quit [Ping timeout: 272 seconds]
gix- has joined #ruby
gix has quit [Disconnected by services]
<havenwood> soulisson: Yeah, like most things it's tough to get to a level of mastery.
<soulisson> I'm reading about it and there are already things I don't understand like the concept of convention over configuration
<havenwood> riceandbeans: "[B]y convention, a method with an exclamation point or bang is considered dangerous."
<havenwood> soulisson: If you show me a Rails app that's done conventionally, I already know where to find everything without even looking first at the code.
<soulisson> ok
<havenwood> soulisson: You can add someone to a project and they know what drawer to look in for the code.
<havenwood> soulisson: It's harder to master, but then you can get up to speed quickly.
<soulisson> thanks a lot
<havenwood> soulisson: Roda is my favorite minimalist framework in Ruby. Unlike Rails, you start with nothing and cherry pick plugins to build a framework with fewer conventions.
<havenwood> soulisson: http://roda.jeremyevans.net/
<havenwood> riceandbeans: There's a #downcase! that modifies the receiver because a #downcase method that returns a new object already exists, for example.
<havenwood> riceandbeans: If you have a method and want to make another method that's very similar but "more dangerous," add a bang!
<havenwood> riceandbeans: Oh, you said you already know what they do by convention...
<havenwood> I just got that now.
Swyper has joined #ruby
<havenwood> riceandbeans: I don't know of a fancy name like "predicate methods." I just call them "bang methods."
<havenwood> I think just "bang methods" or maybe "dangerous methods."
gix- has quit [Ping timeout: 272 seconds]
ur5us has quit [Ping timeout: 260 seconds]
soulisson has quit [Quit: Leaving]
akemhp has quit [Ping timeout: 260 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
<riceandbeans> havenwood: lol, dangerous methods
<riceandbeans> havenwood: I explained it as one does the op as by val vs by ref
<riceandbeans> like, ! is by ref, no ! is by val
<riceandbeans> Then I saw their eyes light up and like OH I GET IT NOW
sagax has joined #ruby
postmodern has quit [Quit: Leaving]
turbo_choo has joined #ruby
fanta1 has joined #ruby
Iacob has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Iacob has quit [Client Quit]
Iacob has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Swyper has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Iacob has quit [Quit: This computer has gone to sleep]
snuz has quit [Read error: Connection reset by peer]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
code_zombie has quit [Read error: Connection reset by peer]
NODE has quit [Client Quit]
NODE has joined #ruby
NODE has quit [Client Quit]
alexpp has joined #ruby
<alexpp> Hi guys!
NODE has joined #ruby
<alexpp> Need a help
howdoi has quit [Quit: Connection closed for inactivity]
<alexpp> Got a script:or22='style.css'rep22='stylea577.css'Dir.glob("/home/alex/SITE/*.html") do |file_name| text = File.read(file_name) replace = text.gsub!(or22, rep22) File.open(file_name, "w") { |file| file.puts replace }endIt's works fine, but second applying somehow makes affected html empty
alexpp82 has joined #ruby
<alexpp82> Hi guys! Got a script: or22='style.css' rep22='stylea577.css'Dir.glob "/home/alex/SITE/*.html") do |file_name| text = File.read(file_name) replace=text.gsub!(or22, rep22) File.open(file_name, "w") { |file| file.puts replace } endIt's works fine, but second applying somehow makes affected html empty. Could please some1 help me?
alexpp82 has quit [Remote host closed the connection]
alexpp61 has joined #ruby
alexpp61 has quit [Remote host closed the connection]
<leftylink> &ri String#gsub!
<leftylink> please note that gsub! returns nil if no changes were applied.
<leftylink> as documented in the link.
<alexpp> Thank you very much. Really appreciate. How could I change the script to avoid this?
<alexpp> I'm pretty bad at ruby yet :D
<leftylink> note that gsub! has performed the substitution in place.
<leftylink> or, if gsub! is not desired, have a look at other functions at the link.
cthu| has quit [Ping timeout: 265 seconds]
sauvin has joined #ruby
ttoocs has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
Iacob has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
sergioro has joined #ruby
Iacob has quit [Quit: This computer has gone to sleep]
cnsvc has joined #ruby
envex has joined #ruby
Iacob has joined #ruby
Guest88609 has quit [Ping timeout: 240 seconds]
Iacob has quit [Client Quit]
<alexpp> 2leftylink. Sorry, tried to figure out, but failed. What should I use to simply replace multiple lines in multiple files?
bvdw has quit [Read error: Connection reset by peer]
<leftylink> well. if I was given that task, I would choose to use sed, rather than Ruby
<leftylink> but if you must use Ruby, the functions in String are recommended.
<leftylink> &ri String
bvdw has joined #ruby
<alexpp> I don't have to use ruby. It's just seems more readable than sed.
<alexpp> Tried to make it with SED and failed...
<leftylink> ah. a shame.
<leftylink> that is unfortunate
alfiemax has quit [Remote host closed the connection]
cnsvc has quit [Remote host closed the connection]
cnsvc has joined #ruby
alfiemax has joined #ruby
turbo_choo has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
ur5us has joined #ruby
turbo_choo has joined #ruby
alfiemax has quit [Remote host closed the connection]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
alexpp has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
coffeex3 has quit [Ping timeout: 268 seconds]
erts has joined #ruby
erts has left #ruby [#ruby]
erts has joined #ruby
schne1der has joined #ruby
TomyWork has joined #ruby
fanta1 has quit [Quit: fanta1]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
lxsameer has joined #ruby
reber has joined #ruby
renich has quit [Quit: renich]
Mrgoose845701915 has quit [Ping timeout: 260 seconds]
cisco has joined #ruby
cisco is now known as Guest28040
mikecmpbll has joined #ruby
reber has quit [Remote host closed the connection]
lxsameer has left #ruby ["in"]
Mrgoose845701915 has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
prestorium has joined #ruby
prestorium has quit [Client Quit]
prestorium has joined #ruby
chalkmonster has joined #ruby
fig-le-deunch has joined #ruby
i9zO5AP has quit [Ping timeout: 265 seconds]
Guest28040 has quit [Read error: Connection reset by peer]
ellcs has joined #ruby
jacksop has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
jacksop has quit [Client Quit]
mikecmpbll has joined #ruby
conta has joined #ruby
fanta1 has joined #ruby
JediMaster has joined #ruby
JediMaster is now known as Guest7892
alfiemax has quit [Remote host closed the connection]
fanta1 has quit [Quit: fanta1]
x0n has joined #ruby
alfiemax has joined #ruby
conta has quit [Quit: conta]
leitz has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
royal_screwup21 has joined #ruby
Fernando-Basso has joined #ruby
alfiemax has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 265 seconds]
turbo_choo has quit [Ping timeout: 272 seconds]
Fernando-Basso has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
fig-le-deunch has quit [Quit: Konversation terminated!]
jenrzzz has quit [Ping timeout: 240 seconds]
Guest51 has joined #ruby
Fernando-Basso has joined #ruby
alfiemax has joined #ruby
Fernando-Basso has joined #ruby
sergioro has quit [Quit: leaving]
splud_wurk has joined #ruby
<splud_wurk> I have an installed gem "rawline (0.5.3)" that has been in my config for aeons. Another dev needs this for something that uses it, but cannot locate it at this time.
<splud_wurk> is there some invocation of 'gem' that can package up that gemset from my system to share to the other dev? Or specific files I'd grab?
dionysus69 has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
reber has joined #ruby
jenrzzz has joined #ruby
turbo_choo has joined #ruby
<splud_wurk> Hrm, I guess the gem cache will do.
jenrzzz has quit [Ping timeout: 272 seconds]
alfiemax has quit [Remote host closed the connection]
clemens3 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
fig-le-deunch has joined #ruby
fercell has joined #ruby
royal_screwup21 has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
fig-le-deunch has quit [Quit: Konversation terminated!]
ratah has joined #ruby
phaul has joined #ruby
corellian has joined #ruby
_phaul has quit [Ping timeout: 265 seconds]
TomyWork has quit [Ping timeout: 256 seconds]
lucasb has joined #ruby
TomyWork has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
Fernando-Basso has quit [Remote host closed the connection]
Fernando-Basso has joined #ruby
burningserenity has joined #ruby
conta has joined #ruby
jenrzzz has joined #ruby
burningserenity has quit [Quit: Leaving.]
grilix has quit [Ping timeout: 246 seconds]
burningserenity has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
conta has quit [Quit: conta]
grilix has joined #ruby
burningserenity has quit [Quit: Leaving.]
burningserenity has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
<leitz> Is there a need for junior mentors to mentor newbies?
alfiemax has joined #ruby
davispuh has joined #ruby
vondruch has quit [Ping timeout: 272 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
<ratah> leitz: Good question! www.rubymentoring.com seems to be available if you wanna start a new project ;)
<ratah> Remember you heard it here first
corellian has quit [Read error: Connection reset by peer]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fernando-Basso has quit [Quit: Leaving]
splud_wurk has quit [Quit: splud_wurk]
minall has joined #ruby
<leitz> ratah, have you checked the domain? :)
<ratah> leitz: why? :)
<leitz> Parked.
<ratah> oops :)
<leitz> Sorry, I'm overly concise. The domain is parked.
<ratah> i couldnt resist im sorry
<leitz> That means the idea is open.
<ratah> it was available just now though
<ratah> i figured grabbing it would be a nice testimony to my love for ruby
<leitz> ratah, hey, that would be an awesome thing for me! I need mentoring for the things I'm trying to learn.
<ratah> word
<ratah> yeah i keep seeing all these pros going on about their ruby mentoring programs, but ive yet to see a decent site where they can all unite
<leitz> In the past, I've helped people learn things when I was only a little further along than they were.
<ratah> nice!
<leitz> I haven't seen too many/any ruby mentors.
<ratah> maybe because there isnt a real site for them. i know of a lot on stackoverflow and in this channel
<leitz> I have seen "buy my course", and that's fine. One of the things I most wish for is a mentor who will look at my code and tell me the top two or three things I need to work on.
<leitz> I'm self taught, and have a lot of gaps.
<ratah> most of them have moved on from irc, but are still mentoring in their spare time, like ryan bigg etc.
<leitz> For example, adam12 gave me a lot of good insight into the adapter pattern. That's my next big push in my code.
<ratah> leitz: oh yeah, i'd love for that too. actually yeah
<ratah> "how do i hire someone to just look through my final code real quick, where do i find them" - question that's crossed my mind many times
<leitz> One of the challenges I've struggled with is the gap between "book code" and "real code". Most projects are pretty involved, and if you are just learning, there's a steep curve. I have a couple projects that are small, but growing. If someone wanted to, I could help them learn what I know, and they could then go on and be better than I.
<ratah> yeah if it wasn't for adam12 i sure wouldnt be where i am right now :)
<ratah> for sure!
<leitz> ratah, did you just buy rubymentoring.com?
snickers has joined #ruby
<ratah> i guess mentoring is sorta in the intersection between actual consulting and just giving quick tips on irc. the mentorer doesnt really have to get involved, just skim through the code and give quick pointers
<ratah> leitz: sorta ;)
<leitz> ratah, care to expand? I'm hyped about the idea, and don't mind pitching in, if I can.
<ratah> leitz: it seemed like a nice idea. plus the domain seemed kinda lonely there it stood on its own
<ratah> i figured making a quick craigslist-style from-the-scratch message board would be ideal for something like this
burningserenity has quit [Quit: Leaving.]
<apotheon> leitz: You want code reviews, basically. Right?
<leitz> Makes sense. At least for a start, you could point to a github page.
<ratah> perhaps walk around various ruby/rails conventions wearing a tshirt in big bold letters saying "RUBYMENTORS.COM"
<leitz> ratah, should we get .net and .org?
<ratah> leitz: i'd love to have a helping hand if you're able
<ratah> sure!
<ratah> * RUBYMENTORING.COM
<leitz> apotheon, less a detailed "fix this", more a "you need to work on object messages as a fundamental tool".
<apotheon> sure, a more learning-oriented code review
<apotheon> Good code reviews should come with explanations for why, and address structure instead of just minor tweaks
<apotheon> .
<apotheon> hmm
burningserenity has joined #ruby
<apotheon> I should add mentoring-related features to the plan for something I'm doing.
<leitz> apotheon, I think so, but I've been a solo programmer for most of my SysAdmin career. There are a *lot* of things I don't know.
<leitz> What I don't want is a high burden on the mentor, though.
<leitz> ratah, we have .org and .net.
<ratah> excellent :)
<ratah> this is a great idea imho
<ratah> let's make it happen!
<apotheon> One of the problems I see with howtos and books is that they don't tend to teach much about managing one's project. There are things particular to any given language and how projects should be organized in that language that are difficult to learn outside of actually working on code with someone who knows more about it than you (i.e. getting a job with a senior dev whose job includes teaching
<apotheon> you).
snickers has quit [Ping timeout: 246 seconds]
<apotheon> leitz: I think getting code reviews on feature branches could be a reasonably low-burden way to get help from a more experienced developer.
<apotheon> . . . and I've actually enjoyed code reviews at times.
<apotheon> Reviewing others' code can also help keep one sharp.
<apotheon> I'm not sure if others ever enjoy reviewing code. I seem to enjoy things others don't, such as refactoring badly structured code to make it better.
<apotheon> s/badly/poorly/
<leitz> apotheon, one of the mistakes I've struggled with is learning something I'm not ready for. I have Amazon Prime, and I'm not afraid to use it! But that means (few) dozen books on the shelf when I need to internalize basic object creation and messaging.
<apotheon> ratah: I like the idea of a Craigslist-like thing, but I'm not sure what draw that would have for the people offering their mentoring.
<apotheon> ratah: Do you have ideas for how to draw mentors' interest?
<apotheon> leitz: What have you read already?
<ratah> apotheon: Apart from the name, not really. Not right now at least
<ratah> If we can get a solid brand and platform up and running though, I'm sure the rest will come to us
<leitz> apotheon, um, "yes". Seriously, I have gone through most of the "usual" Ruby books, or have them next to me. Pickaxe, POODR, Way, Head First, RSpec, CLosures, Text Processing, Sinatra, Microscope, Cookbook, Metaprogramming, Best Practices, Design Patterns, Eloquent, Refactoring, CLI.
<ratah> two hands holding a ruby gem - like https://equipsblog.files.wordpress.com/2018/04/upholding-hands-the-constitution.png - would be a nice starting point :)
<apotheon> leitz: My usual advice to people looking for some help with learning is to read Eloquent, and write useful command-line stuff in that rather than in sh or (heaven forfend) Bash while doing it, then go through Sinatra Up And Running and build a simple web application, if what they really want to learn is Ruby, and not Rails.
<leitz> apotheon, I forgot the O'Reilly book in the WC and Well grounded on the nightstand. :)
GodFather has joined #ruby
<apotheon> leitz: Doing something with the knowledge as you acquire it is key, of course. I offer to help along the way, too, but usually people just don't really stick to it when they say they want to learn to program.
john2496 has joined #ruby
<leitz> apotheon, I'm actually doing just that; a CLI tool for role-playing games, and I'm spliting out the merchanting game itself into Sinatra.
<apotheon> leitz: You might have actually read more Ruby books than me, if you've read all those.
<apotheon> What CLI tool are you writing?
<leitz> "Read...more like skilled some, read some."
Guest7892 has quit [Ping timeout: 240 seconds]
<leitz> There are currently three branches, but "add_chargen" will go away. I've gotten the basics of it done.
<leitz> Need to get back to a12_adapter, where adam12 was giving me good code on the adapter pattern.
<leitz> apotheon, also read and loved "99 bottles".
silviu has quit [Remote host closed the connection]
silviu has joined #ruby
Rapture has joined #ruby
codefriar has joined #ruby
fercell has quit [Quit: WeeChat 2.7]
<leitz> Hmm...phpmentoring has died.
rippa has joined #ruby
<apotheon> Was it any good?
rohit has joined #ruby
Swyper has joined #ruby
<leitz> apotheon, yes. Mentors listed themselves, and the areas they felt they could mentor in. A mentee could list themselves, and what they were looking for help in. The github page was self-editable, IIRC, and I found an excellent friend to help me figure out stuff.
drincruz has joined #ruby
<leitz> If you've ever seen my PHP code, you'd agree than it needs work. ;)
<apotheon> It's right up there with most professional PHP code, then.
<apotheon> Learn better programming practices elsewhere (e.g. Ruby community), then go back to PHP and be hated for not being as chaotic with your code as most PHP devs.
Intelo has joined #ruby
chalkmonster has joined #ruby
<leitz> Nyah, I'd rather do Sinatra. Doing Go helped my Sinatra code, too. Of course, most of my Ruby/Perl/Shell looks a lot like Python, too.
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<leitz> apotheon, here's one of the big questions i have. In that code, there's "chargen" the CLI app, "character" the base object, "character_tools" module for modifying a character, without putting everything into character, and character_builder, a Factory.
teclator has joined #ruby
<leitz> They work, but is it an expandable design? I need to modify characters based on their careers, and create families of characters with the same last name. bargen and crewgen need rework, they stamp out a bunch of characters to populate bars and a starship crew. Well, they will when I de-Sinatra them.
<leitz> I need to write a better presentation process than this, where does it go? https://github.com/makhidkarun/ftl_tools/blob/add_chargen/bin/chargen#L18-L21
duderonomy has joined #ruby
SeepingN has joined #ruby
jenrzzz has joined #ruby
howdoi has joined #ruby
splud_wurk has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
badas-jtlog has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
<apotheon> leitz: hang on, multitasking
<leitz> apotheon, a well considered assist beats a quick, but unhelpful, one. :)
GodFather has quit [Ping timeout: 240 seconds]
turbo_choo has quit [Ping timeout: 272 seconds]
m_antis has joined #ruby
ttoocs has quit [Ping timeout: 240 seconds]
<apotheon> leitz: I've been looking through code a little, in moments between other things. The CLI wrapper you linked is simple, and still easily modified however you need, I think, so there aren't any big problems there at this point.
<apotheon> leitz: CharacterBuilder immediately makes me think it could benefit from some dependency injection, though, which also might help with testing in the future.
<apotheon> Stuff like what you're doing with generating appearance and other stuff could be handled by refactoring to iterate over lists, possibly over collections of callbacks or something along those lines, allowing for a more modular and customizable design.
m_antis has quit [Ping timeout: 260 seconds]
<phaul> char is not char but represents a game character? I would say using the variable char is very misleading
<apotheon> Oh, yeah, that too.
<phaul> char for most peope represents a letter 'a', 'b' etc
<apotheon> Be careful about namespace clashes like that.
<apotheon> leitz: If you have any questions about some of the terminology I used, or about what I meant by a turn of phrase, let me know.
<apotheon> I'm going to get back to some other stuff I'm doing, but I should be intermittently available throughout the day.
<apotheon> (I'm in a timezone where it's kinda early morning.)
badas-jtlog has quit [Remote host closed the connection]
m_antis has joined #ruby
<apotheon> I wrote a sprawling RPG-management tool in Ruby a long time ago, so I'm kinda sympathetic with the obvious intentions of this software.
jenrzzz has joined #ruby
erts has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
Retr0Punk_ has joined #ruby
Retr0Punk has quit [Quit: ZNC 1.7.3 - https://znc.in]
grilix has quit [Ping timeout: 260 seconds]
<leitz> phaul, I agree on "char"; I thought I had expanded my variable names. One of the lessons from "The Practice of Programming".
<phaul> Do you have a class that represents characters?
dinfuehr has quit [Ping timeout: 265 seconds]
<leitz> phaul, it should be "character", in lib/ftl_tools/character.rb
AndreYuhai has joined #ruby
dinfuehr has joined #ruby
m_antis is now known as m_antis[away]
m_antis[away] has quit [Quit: m_antis[away]]
Swyper has quit [Remote host closed the connection]
<AndreYuhai> Hey there, I am trying to schedule some scripts to run regularly, which gem would you suggest? I am not using Rails by the way which confuses me a lot since everything on the Internet mentions rails.
jordanm has quit [Ping timeout: 268 seconds]
wildtrees has joined #ruby
jenrzzz has joined #ruby
<leitz> I'll fix the "char" after work. Have to keep time separate.
dinfuehr has quit [Ping timeout: 268 seconds]
<phaul> leitz: I see. Consider making pretty printing characters as an instance method of that class. In general if you call many instance method on an object in one place that's a smell. Usually means that the logic wants to be moved inside the class
<phaul> This concept is also known as feature envy
jenrzzz has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
<leitz> phaul, one of the growth areas is that there are several ways to "display" a character, and I need to migrate an old concept into ftl_tools.
dinfuehr has joined #ruby
<leitz> There are three "programs", that seem to be gems. FTLTools, the one I'm doing now, is CLI tools and base stuff like the "Character" class. "FreeTrader" is a web based game that uses FTLTools, and "SomeUnknownName" progam will be a web based character storage a retrieval for my fiction characters.
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
<phaul> It's usually best to avoid control arguments like method there for branching in what to do. One way to overcome thatcan be inheritance, where each sub type can have their ownbehaviour
<phaul> now, many in the community are strongly against inheritance in all cases, but I disagree with them :) But take my advices with pinch of salt
<phaul> Inheritance is good for this exact case as long as you don't create deep chains with large classes
Guest7892 has joined #ruby
<phaul> localized inheritance is better than one code doing many things in this case csv, wiki or txt
Intelo has quit [Ping timeout: 240 seconds]
<leitz> In the Presenter case, it handed it off. Maybe an adapter, once I learn them better.
alfiemax has joined #ruby
<phaul> leitz: try the reek smell detector tool. It might be overwhelming at first with so many complaints coming from it, but it does give some good advice
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 245 seconds]
badairclogger has joined #ruby
badairclogger has quit [Client Quit]
badairclogger has joined #ruby
jenrzzz has joined #ruby
badairclogger has quit [Read error: Connection reset by peer]
badairclogger has joined #ruby
badairclogger has quit [Client Quit]
badairclogger has joined #ruby
tpanarch1st has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
lineus has quit [Ping timeout: 240 seconds]
grilix has joined #ruby
<leitz> phaul, only 119 total warnings. :)
Swyper has quit [Remote host closed the connection]
lineus has joined #ruby
citizentwo has joined #ruby
citizentwo has quit [Remote host closed the connection]
citizentwo has joined #ruby
factorialtime has joined #ruby
badairclogger has quit [Remote host closed the connection]
<factorialtime> Where can I report bugs for ruby?
Swyper has joined #ruby
<factorialtime> Thanks phaul
<phaul> factorialtime: yw, please have a read of https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport first
<factorialtime> Will do
badaircloger has joined #ruby
badaircloger has quit [Client Quit]
badaircloger has joined #ruby
badaircloger has quit [Client Quit]
badaircloger has joined #ruby
AndreYuhai has quit [Quit: Leaving]
gix has joined #ruby
grilix has quit [Quit: Ooops]
mikecmpbll has quit [Quit: inabit. zz.]
alfiemax has joined #ruby
alfiemax has quit [Client Quit]
alexherbo2 has joined #ruby
Swyper has quit [Remote host closed the connection]
<havenwood> factorialtime: I'm curious what the bug is, but I guess we can read the report once you file it!
i9zO5AP has joined #ruby
cthulchu has joined #ruby
jenrzzz has joined #ruby
<havenwood> factorialtime: If you're not sure if it's a bug, feel free to run it by the channel before filing.
factorialtime has quit [Remote host closed the connection]
galaxie has left #ruby [#ruby]
Swyper has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
Guest7892 has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
rohit has quit [Remote host closed the connection]
badaircloger has quit [Remote host closed the connection]
jenrzzz has joined #ruby
badaircloger has joined #ruby
badaircloger has quit [Client Quit]
badaircloger has joined #ruby
Guest7892 has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
drincruz_ has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
fphilipe_ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
Intelo has joined #ruby
badaircloger has quit [Remote host closed the connection]
badaircloger has joined #ruby
clemens3 has quit [Quit: WeeChat 1.6]
clemens3 has joined #ruby
Swyper has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 265 seconds]
Swyper has joined #ruby
dnadev2 has joined #ruby
alfiemax has quit [Remote host closed the connection]
clemens3 has quit [Quit: WeeChat 1.6]
royal_screwup21 has joined #ruby
clemens3 has joined #ruby
ellcs1 has joined #ruby
clemens3 has quit [Quit: WeeChat 1.6]
citizentwo has quit [Remote host closed the connection]
citizentwo has joined #ruby
Guest7892 has quit [Ping timeout: 265 seconds]
Ai9zO5AP has joined #ruby
jenrzzz has joined #ruby
i9zO5AP has quit [Ping timeout: 268 seconds]
citizentwo has quit [Read error: Connection reset by peer]
citizentwo has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
royal_screwup21 has quit [Remote host closed the connection]
snickers has joined #ruby
alfiemax has joined #ruby
ldepandis has joined #ruby
prestorium has quit [Ping timeout: 240 seconds]
citizentwo has quit [Remote host closed the connection]
citizentwo has joined #ruby
jenrzzz has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
badaircloger has quit [Read error: Connection reset by peer]
alfiemax has quit [Ping timeout: 265 seconds]
impermanence has joined #ruby
badaircloger has joined #ruby
Intelo_ has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 272 seconds]
bvdw has joined #ruby
Intelo has quit [Ping timeout: 240 seconds]
kinduff has joined #ruby
kinduff has quit [Client Quit]
fphilipe_ has joined #ruby
kinduff has joined #ruby
kinduff has quit [Changing host]
kinduff has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
Intelo_ has quit [Ping timeout: 268 seconds]
badaircloger has quit [Remote host closed the connection]
badaircloger has joined #ruby
conta1 has joined #ruby
badaircloger has quit [Remote host closed the connection]
badaircloger has joined #ruby
jenrzzz has joined #ruby
conta1 has quit [Quit: conta1]
kapil_ has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
<wildtrees> gem install sinatra is just hanging, no output, is there usually some sort of output for a gem install?
<Eiam> invoke it with verbose flags?
<wildtrees> --verbose?
ur5us has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
wildtrees has quit [Quit: Leaving]
pisculichi has joined #ruby
jenrzzz has joined #ruby
akemhp has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
pirj has joined #ruby
pirj has quit [Remote host closed the connection]
reyfi9e has quit [Remote host closed the connection]
reyfi9e has joined #ruby
wildtrees has joined #ruby
jenrzzz has joined #ruby
orbyt_ has joined #ruby
hiroaki has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
jenrzzz has quit [Ping timeout: 265 seconds]
x0n has quit [Ping timeout: 240 seconds]
sergioro has joined #ruby
bradland has joined #ruby
bradland has quit [Client Quit]
royal_screwup21 has joined #ruby
jenrzzz has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
royal_screwup21 has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
pinpox- has joined #ruby
fphilipe has joined #ruby
akemhp has quit [Ping timeout: 260 seconds]
fphilipe_ has quit [Ping timeout: 272 seconds]
pinpox has quit [Ping timeout: 268 seconds]
akemhp has joined #ruby
fphilipe has quit [Ping timeout: 240 seconds]
_phaul has joined #ruby
jenrzzz has joined #ruby
phaul has quit [Ping timeout: 272 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
chalkmonster has quit [Quit: WeeChat 2.7]
alexherbo29 has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo29 is now known as alexherbo2
royal_screwup21 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
burningserenity has quit [Remote host closed the connection]
GodFather has joined #ruby
bluetown has quit [Ping timeout: 258 seconds]
fphilipe has joined #ruby
Swyper has quit [Remote host closed the connection]
alfiemax has joined #ruby
shansen_ is now known as shansen
pwnd_nsfw` has joined #ruby
kwerle has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
<kwerle> I have a class method metaprogramming question. Given a class with method .foo, what is a clean way to “wrap” that method using a module and be able to call super from the wrapping module’s method? https://github.com/kwerle/with_and_without/blob/master/with_and_without.rb
fphilipe has quit [Ping timeout: 240 seconds]
Rob__ has quit [Ping timeout: 272 seconds]
<adam12> kwerle: What output are you looking for?
jenrzzz has joined #ruby
prestorium has joined #ruby
<kwerle> I would like to wrap WithMethod class’s self.foo method with a module such that th module could call super and have it incorporate the original method results.
<_phaul> you could do WithMethod.singleton_class.prepend ExtensionTwo
<kwerle> So I would like to do something with a module using a method like ModuleTwo and have the result of WithMethod.foo -> “Two foo”
nisstyre has quit [Remote host closed the connection]
<adam12> Yeah; _phaul has it right with the prepending into the singleton class.
pisculichi has quit [Ping timeout: 272 seconds]
<adam12> Obviously you wouldn't need to do the singleton class prepend if it wasn't a class method.
<kwerle> WithMethod.singleton_class.prepend ExtensionTwo
<kwerle> puts WithMethod.foo -> ‘foo’
<_phaul> you did prepend right? not extend
<kwerle> oops - editing wrong file!
jenrzzz has quit [Ping timeout: 240 seconds]
<kwerle> That did the trick - thanks.
<kwerle> I hate to ask - can you tell me why it works differently when you extend a class without the method than when you extend the class with the method?
<_phaul> extend goes above the class in the inheritance chain
<_phaul> try WithMethod.ancestors. you are stil calling the method from the class
<kwerle> That makes sense. Got it. Thanks so much!
<_phaul> or actually you would need to see the singleton classes ancestors. but otherwise correct
reber has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
<adam12> I wouldn't hate to ask, either.
Fusl has quit [Excess Flood]
Fusl has joined #ruby
pisculichi has joined #ruby
pisculichi has joined #ruby
pisculichi has quit [Changing host]
jenrzzz has quit [Ping timeout: 272 seconds]
m_antis has joined #ruby
ratah has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
minall has quit [Quit: minall]
code_zombie has joined #ruby
coffeex3 has joined #ruby
SeepingN has joined #ruby
fphilipe has joined #ruby
jcalla has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
fphilipe has quit [Ping timeout: 246 seconds]
kwerle has quit [Quit: kwerle]
Axy has joined #ruby
ellcs1 has quit [Ping timeout: 240 seconds]
ellcs1 has joined #ruby
Mia has quit [Ping timeout: 265 seconds]
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 272 seconds]
snickers has quit [Quit: Textual IRC Client: www.textualapp.com]
jenrzzz has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
m_antis has quit [Quit: m_antis]
dnadev2 has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
john2496 has quit [Remote host closed the connection]
orbyt_ has joined #ruby
ellcs1 has joined #ruby
jenrzzz has joined #ruby
TCZ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
turbo_choo has joined #ruby
jenrzzz has joined #ruby
sergioro has quit [Quit: Lost terminal]
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
schne1der has quit [Ping timeout: 260 seconds]
Ai9zO5AP has quit [Quit: WeeChat 2.5]
prestorium has quit [Quit: prestorium]
alfiemax has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
prestorium has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
prestorium has quit [Quit: prestorium]
citizentwo has quit [Remote host closed the connection]
tau has joined #ruby
citizentwo has joined #ruby
TCZ has quit [Quit: Bye Bye]
code_zombie has quit [Quit: Leaving]
citizentwo has quit [Ping timeout: 245 seconds]
citizentwo has joined #ruby
s3nd1v0g1us has joined #ruby
hiroaki has quit [Ping timeout: 268 seconds]
prestorium has joined #ruby
jenrzzz has joined #ruby
kinduff has left #ruby ["Leaving"]
citizentwo has quit [Remote host closed the connection]
citizentwo has joined #ruby
phaul has joined #ruby
citizentwo has quit [Remote host closed the connection]
_phaul has quit [Ping timeout: 240 seconds]
royal_screwup21 has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 245 seconds]
turbo_choo has quit [Ping timeout: 260 seconds]
prestorium has quit [Quit: prestorium]
citizentwo has joined #ruby
_phaul has joined #ruby
prestorium has joined #ruby
prestorium has quit [Client Quit]