havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: 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!
Esa__ has joined #ruby
schne1der has quit [Ping timeout: 264 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
lurkless has quit [Remote host closed the connection]
Azure has quit [Quit: Textual IRC Client: www.textualapp.com]
Azure has joined #ruby
yelloB has joined #ruby
jinmiaoluo has quit [Ping timeout: 256 seconds]
jinmiaoluo has joined #ruby
yelloB has quit [Remote host closed the connection]
yelloB has joined #ruby
yelloB has quit [Remote host closed the connection]
wildtrees has quit [Quit: Leaving]
nyuszika7h has left #ruby ["WeeChat 2.8"]
sarink has joined #ruby
davor_ has joined #ruby
davor has quit [Ping timeout: 256 seconds]
davor_ is now known as davor
sarink has quit [Ping timeout: 258 seconds]
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lurkless has joined #ruby
sergioro has quit [Quit: leaving]
cliluw has quit [Ping timeout: 256 seconds]
shirak has quit [Ping timeout: 250 seconds]
Esa__ has quit [Ping timeout: 265 seconds]
Ai9zO5AP has quit [Ping timeout: 240 seconds]
buckworst has joined #ruby
Ai9zO5AP has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]
Pie_Mage has joined #ruby
ur5us has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
sergioro has joined #ruby
alfiemax has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 265 seconds]
elcontrastador has joined #ruby
impermanence has quit [Quit: Connection closed]
tpanarch1st has quit [Ping timeout: 250 seconds]
ChmEarl has quit [Quit: Leaving]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
alfiemax has quit [Ping timeout: 250 seconds]
cliluw has joined #ruby
cliluw has quit [Ping timeout: 265 seconds]
darkstardevx has quit [Ping timeout: 256 seconds]
darkstardevx has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
buckworst has joined #ruby
jinmiaoluo has quit [Ping timeout: 265 seconds]
hassox has quit [Remote host closed the connection]
buckworst has quit [Quit: WeeChat 2.8]
Esa__ has joined #ruby
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
ur5us has quit [Ping timeout: 246 seconds]
alfiemax has joined #ruby
jetchisel has joined #ruby
banisterfiend has joined #ruby
jinmiaoluo has joined #ruby
sarink has joined #ruby
jinmiaoluo has quit [Ping timeout: 265 seconds]
sauvin has joined #ruby
jinmiaoluo has joined #ruby
troulouliou_dev has joined #ruby
jinmiaoluo has quit [Ping timeout: 260 seconds]
lightstalker has quit [Ping timeout: 264 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
vdl has quit [Ping timeout: 264 seconds]
elcontrastador has quit [Ping timeout: 260 seconds]
vdl has joined #ruby
alfiemax has joined #ruby
pandakekok9 has joined #ruby
sarink has quit [Ping timeout: 240 seconds]
cd has quit [Quit: cd]
ua has quit [Ping timeout: 256 seconds]
ua has joined #ruby
alfiemax has quit [Remote host closed the connection]
jinmiaoluo has joined #ruby
alfiemax has joined #ruby
_whitelogger has joined #ruby
jinmiaoluo has quit [Ping timeout: 265 seconds]
ldepandis has joined #ruby
renich has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alexherbo2 has joined #ruby
conta has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
jinmiaoluo has joined #ruby
zacts has joined #ruby
jinmiaoluo has quit [Ping timeout: 250 seconds]
jinmiaoluo has joined #ruby
jinmiaoluo has quit [Ping timeout: 240 seconds]
jinmiaoluo has joined #ruby
conta has quit [Quit: conta]
imode has quit [Ping timeout: 256 seconds]
alexherbo21 has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo21 is now known as alexherbo2
alfiemax has quit [Ping timeout: 256 seconds]
indian_yogi has joined #ruby
buckworst has joined #ruby
gix has joined #ruby
schne1der has joined #ruby
sergioro has quit [Quit: leaving]
xco has joined #ruby
lurkless has quit [Remote host closed the connection]
darkstardevx has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
darkstardevx has joined #ruby
lurkless has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alexherbo2 has joined #ruby
TCZ has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
alexherbo22 has joined #ruby
alexherbo2 has quit [Read error: Connection reset by peer]
jinmiaoluo has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #ruby
alexherbo22 has quit [Ping timeout: 256 seconds]
jinmiaoluo has joined #ruby
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #ruby
renich has quit [Quit: renich]
davor has quit [Ping timeout: 250 seconds]
deathwishdave has joined #ruby
alexherbo21 has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo21 is now known as alexherbo2
deathwishdave has quit [Client Quit]
davor has joined #ruby
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #ruby
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #ruby
giorgian has quit [Remote host closed the connection]
indian_yogi has quit [Ping timeout: 250 seconds]
hramrach has quit [Ping timeout: 250 seconds]
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #ruby
ur5us has joined #ruby
DTZUZU has joined #ruby
DTZUZU2 has quit [Ping timeout: 264 seconds]
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #ruby
hramrach has joined #ruby
darkstardevx has quit [Remote host closed the connection]
kristian_on_linu has joined #ruby
jinmiaoluo has quit [Quit: WeeChat 2.8]
ur5us has quit [Quit: Leaving]
troulouliou_dev has quit [Quit: Leaving]
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
alexherbo2 has joined #ruby
Ai9zO5AP has quit [Remote host closed the connection]
alexherbo28 has joined #ruby
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo28 is now known as alexherbo2
buckworst has joined #ruby
reber has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
buckworst has joined #ruby
donofrio__ has joined #ruby
buckworst has quit [Ping timeout: 256 seconds]
donofrio_ has quit [Ping timeout: 256 seconds]
TCZ has quit [Quit: Leaving]
hramrach has quit [Ping timeout: 264 seconds]
<siery> I been trying for long time.. and still ain't get this GC stuff.. Even after dereferance objects to WealRef and calling ObjectSpace.garbage_collect, I till see thouse objects hanging in memory..
<siery> Can someone tell me what am I doing wrong with this restart! method?
hramrach has joined #ruby
<jhass> &ri ObjectSpace#garbage_collect
gitter1234 has joined #ruby
<jhass> hah, didn't notice it moved there
<phaul> siery: I'm not sure if this is the problem, but be aware, that if you have a block in the same lexical context where the objects were allocated then the block will hold a reference to the object as it's part of the environment the block has to run in. Which is somewhat confusing
<phaul> a = 'str'; foo { blah } here a cannot be freed as calling foo might use it
<siery> phaul: hmm.. So you mean I can not fully free those objects?
<siery> I have also tried this, with no luck:
<siery> ObjectSpace.each_object GameObject do |object|
<phaul> idk. I haven't looked at your code. It's something to be aware of
<siery> object = WeakRef.new object
<siery> end
<jhass> well that of course wouldn't do this
<jhass> it just reassigns the local variable object
<jhass> does nothing for potential references to it
tpanarch1st has joined #ruby
<jhass> mh, cannot really find any tool that would show a nice reference tree unfortunately, just general heap dump analyzers showing how many objects per type there are and maybe their allocation location
<jhass> idk, jruby + visualvm might be worth a shot
<siery> I don't want to clean referances.. that works fine here, but I want to completely delete those objects from the scope memory
<jhass> how are you determining they're still there?
reber_ has joined #ruby
<jhass> sorry, didn't read up on everytjhing
<siery> All are inheriting from GameObject, so I can just simply print them:
<siery> ObjectSpace.each_object GameObject do |object|
<siery> puts "An objects found in memory: #{object}"
<siery> end
reber has quit [Ping timeout: 250 seconds]
<siery> And all though they are deleted from my @engine_space hash (which is meant to store the scope of @game object), they are still in memory
reber_ has quit [Remote host closed the connection]
<jhass> maybe Gosu just keeps a reference to your Game subclass?
<siery> You can clone this repo and run /bin/thief and then press f6, this will run the restart! method
<siery> hmm.. maybe, I was just thinking that
pandakekok9 has quit [Quit: good night]
xco has joined #ruby
chalkmonster has joined #ruby
wymillerlinux has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 250 seconds]
felix_221986 has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wilhelm418 has joined #ruby
caterfxo has quit [Quit: leaving]
sergioro has joined #ruby
giorgian has joined #ruby
cahoots has joined #ruby
<cahoots> hi, i want to do if 'hash["key1"] && hash["key1"]["key2"]' with some method that takes the list of keys, like 'if hash.inner_key("key1", "key2")'
<cahoots> is this possible?
<cahoots> with the standard library i mean
<phaul> &ri Hash#dig
<phaul> cahoots: ^
<cahoots> ah ty!
<cahoots> ruby has the best names for things
d3bug has joined #ruby
TCZ has joined #ruby
giorgian has quit [Ping timeout: 250 seconds]
TCZ has quit [Quit: Leaving]
caterfxo has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
banisterfiend has quit [Quit: banisterfiend]
ChmEarl has joined #ruby
Xeago has joined #ruby
jinmiaoluo has joined #ruby
DTZUZU2 has joined #ruby
DTZUZU has quit [Ping timeout: 250 seconds]
wildtrees has joined #ruby
wildtrees has quit [Remote host closed the connection]
wildtrees has joined #ruby
alexherbo21 has joined #ruby
alexherbo2 has quit [Ping timeout: 250 seconds]
alexherbo21 is now known as alexherbo2
kent\n has quit [Ping timeout: 260 seconds]
cliluw has joined #ruby
alexherbo24 has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo24 is now known as alexherbo2
roadie has quit [Ping timeout: 256 seconds]
cliluw has quit [Remote host closed the connection]
kent\n has joined #ruby
cliluw has joined #ruby
roadie has joined #ruby
cliluw has quit [Ping timeout: 256 seconds]
cliluw has joined #ruby
hiroaki has joined #ruby
jinmiaoluo has quit [Quit: WeeChat 2.8]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
imode has joined #ruby
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 256 seconds]
Pixi__ has joined #ruby
Xiti` has quit [Ping timeout: 256 seconds]
Xiti` has joined #ruby
alexherbo2 has quit [Ping timeout: 258 seconds]
Pixi__ has quit [Ping timeout: 264 seconds]
kristian_on_linu has quit [Remote host closed the connection]
Xiti has joined #ruby
alexherbo2 has joined #ruby
Xiti` has quit [Ping timeout: 256 seconds]
ellcs has joined #ruby
Fridtjof has quit [Ping timeout: 246 seconds]
alfiemax has joined #ruby
Fridtjof has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
akem has quit [Remote host closed the connection]
akem has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
ldepandis has quit [Read error: Connection reset by peer]
olddogbarks has joined #ruby
hramrach has quit [Ping timeout: 250 seconds]
<imode> seems like the certificate for sinatrarb.com is invalid.
<havenwood> imode: http://sinatrarb.com/
dviola has joined #ruby
hramrach has joined #ruby
<imode> yeah. but it's still weird.
<imode> guess it's being hosted on github now..?
dinfuehr has quit [Ping timeout: 256 seconds]
<havenwood> imode: they themselves link to the HTTP rather than HTTPS version of sinatrarb.com.
<havenwood> imode: I dunno why they have a GitHub cert.
<havenwood> imode: clearly they just want you to use Roda. :P
dinfuehr has joined #ruby
<imode> heh.
<imode> it's now a toss-up between Go and Ruby.
<havenwood> imode: Whatcha making?
<havenwood> imode: Roda really is great. I've had an easy time porting Sinatra apps to it and have never been sorry.
<imode> a project that requires server sent events. I can't really wrap my head around how applications are supposed to be structured with Sinatra/Roda because I'm not a fan of object orientation.
<havenwood> imode: Whatcha using SSE for?
<havenwood> What do the events show?
<imode> I guess the closest description I can provide is a modernized LambdaMOO.
<havenwood> imode: Then you might actually like Roda. It's more functional than anything.
bvdw has quit [Remote host closed the connection]
<imode> yeah, perhaps.. I think in terms of procedures and interfaces vs. classes an inheritance.
<havenwood> imode: I wrote a little async websocket plugin for Roda: https://github.com/socketry/roda-websockets
<imode> also not a fan of additive security vs. subtractive security.
<havenwood> imode: If I wasn't going to use Ruby for something like that, I'd use Elixir with Phoenix rather than Go as the alternative.
<imode> not a fan of how Elixir builds stuff.
<havenwood> imode: What part?
<havenwood> imode: The tooling is one of the biggest wins for me and I always had an easier time building and deploying Elixir even though I have more experience doing so with Ruby.
<imode> last time I used it, it relied on mix to generate application templates for you. I'm a C programmer. not interested in generated projects.
<havenwood> imode: The generators are to guide beginners on best practices.
<imode> sure. and that's fine. I don't like them.
<havenwood> imode: Please just don't use them. But it's not a good reason to avoid Phoenix!
<imode> to put in clearer terms, I guess: I like small languages. larger languages intimidate me because there's a bunch of modes of failure that you don't account for on your first pass through building an application.
<havenwood> imode: Elixir is a small language. It's lovely.
<imode> they tend to impose structure and practices to cope with that.
<imode> but the problems are still there.
<havenwood> Ruby is a much larger, more complex language.
<havenwood> Go is too austere for me.
<imode> ruby is also pretty battle-proven. packaging and running elixir on things like heroku and AWS is also, iirc, a bit of a pain.
<havenwood> The Ruby grammar borders on nuts. Why can't we just LISP? :P
<imode> forth 4 lyfe.
<havenwood> imode: Good point about subtractive security, but I think Roda is worth it. I agree on preferring to write my own code, so I know what it does and only have what I need.
<imode> how long has Roda been around?
<imode> the cliche of time-tested software is still a cliche, but it's my go-to.
<imode> when you start having users, you get paranoid about what you didn't think of.
<havenwood> imode: I've been using Roda for years. It's maintained by Jeremy Evans, who is on Ruby core and also maintains the awesome Sequel gem.
<havenwood> imode: Jeremy Evans is the best of maintainers.
<havenwood> imode: The code is exquisite and he dogfoods it widely in prod.
xco has joined #ruby
<havenwood> imode: (He runs a team working for the US govt.)
<imode> that's quite the endorsement.
<imode> how does it compare to sinatra when it comes to application structures?
<havenwood> imode: It tends to be more DRY and a bit flatter, due to the routing tree.
<havenwood> imode: It composes flexibly, with multiple plugins available depending on the style you'd like.
<havenwood> imode: Jeremy has ported a bunch of Sinatra apps to Roda and has some great examples. I've ported a few myself and never looked back. Roda is Sinatra-inspired, and has plugins that enable more Sinatra-like behavior, so porting is quick.
gix has quit [Ping timeout: 250 seconds]
cahoots has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 256 seconds]
<havenwood> imode: The downside is no route introspection.
dinfuehr has joined #ruby
<havenwood> Which I can live with.
<imode> I guess to diagram what I have to build: this is a system that takes user-submitted code, written in a custom language with a sandbox, and executes it with parameters based off of user-submitted commands.
<imode> you listen to objects via SEE, you send commands to objects via POST.
bvdw has joined #ruby
<imode> so the "front" part of this that doesn't include executing said code across multiple instances needs to be hardened. guarded by rate limiting, auth, etc.
<imode> the "rear" part of this needs to be able to communicate with other instances. a single command could be spread across multiple server instances by virtue of one user's code calling another user's code.
<imode> or, objects talking to objects.
bvdw has quit [Remote host closed the connection]
renich has joined #ruby
TCZ has joined #ruby
giorgian has joined #ruby
DTZUZU2 is now known as DTZUZU
felix_221986 has quit [Quit: Connection closed]
evdubs has quit [Quit: Leaving]
evdubs has joined #ruby
renich has quit [Quit: renich]
Emmanuel_Chanel has joined #ruby
chalkmonster has joined #ruby
hramrach has quit [Ping timeout: 260 seconds]
Xiti has quit [Ping timeout: 256 seconds]
ellcs has quit [Ping timeout: 240 seconds]
hramrach has joined #ruby
jeromelanteri has quit [Quit: Leaving]
gitter1234 has quit [Quit: Connection closed for inactivity]
<havenwood> imode: Rodauth is quite nice for auth, and supports pw hash by DB function as icing: https://github.com/jeremyevans/rodauth
<havenwood> imode: Rack::Attack is reasonable for rate limiting at the middleware level.
<havenwood> imode: You saying "objects talking to objects" makes me think of DRb from the stdlib.
s2013 has joined #ruby
<havenwood> imode: Or gRPC feels like objects talking to objects in practice too: https://github.com/grpc/grpc
kristian_on_linu has joined #ruby
zacts has quit [Quit: WeeChat 2.7.1]
hramrach has quit [Ping timeout: 250 seconds]
chalkmonster has quit [Quit: WeeChat 2.8]
mre-_ has joined #ruby
hramrach has joined #ruby
renich has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
mre-_ has quit [Ping timeout: 256 seconds]
chalkmonster has joined #ruby
mre-_ has joined #ruby
Ai9zO5AP has joined #ruby
SeepingN has joined #ruby
DTZUZU has quit [Ping timeout: 264 seconds]
DTZUZU has joined #ruby
Xiti has joined #ruby
renich has quit [Quit: renich]
mre-_ has quit [Quit: mre-_]
greypack has quit [Ping timeout: 265 seconds]
ldepandis has joined #ruby
greypack has joined #ruby
happyhans has joined #ruby
happyhans has quit [Quit: Leaving]
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
cliluw has quit [Ping timeout: 256 seconds]
cliluw has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
chalkmonster has quit [Quit: WeeChat 2.8]
leitz has joined #ruby
gix has joined #ruby
<leitz> I'm back to my learning about patterns. Would it be a command pattern that would take a task "Buy cargo for the ship", and coordinate the messages to all the other objects touched by the action?
postmodern has joined #ruby
<jhass> if it's for you and all the collaborators on your code, sure why not :)
<jhass> patterns are for humans, not for computers
<jhass> they assign words to common concepts so you can talk about them
SuperLag has quit [Remote host closed the connection]
d3bug has quit [Quit: Connection closed for inactivity]
bvdw has joined #ruby
bvdw has quit [Remote host closed the connection]
SeepingN_ has quit [Ping timeout: 272 seconds]
roadie has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
zapata has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
<leitz> jhass, there's a financial incentive for me to get the language correct. Hence my question. :)
tty1 has joined #ruby
<tty1> so im stuck on something that is probably a really stupid noob thing.... I have a module I wrote, it isnt complex it has two simple methods in it... from another class in another module i am calling the method but i get a message that claims the method is "undefined".. to double check directly on the line before the error is invoked i did a pp on the module's instance_methods and the method is being
<tty1> listed.. so not sure why its showing as undefined
greypack has quit [Quit: All your IRC are belong to ZNC]
<tty1> is an instance method different from a regular method maybe and im just misunderstanding something
<leitz> tty1, there's a module_method, or something, that you need to add. I'm digging through my code, I've had the same issue. :)
dinfuehr has quit [Ping timeout: 250 seconds]
<leitz> Ha, module_function I think.
<tty1> here is the specific line that produces the error: https://git.qoto.org/aethyr/Aethyr/-/blob/master/lib/aethyr/core/commands/move.rb#L24
greypack has joined #ruby
<tty1> leitz: so im not clear what your suggesting the solution is ehre?
dinfuehr has joined #ruby
<leitz> tty1, look at this line, it references the method above it. https://github.com/makhidkarun/ftl_tools/blob/master/lib/ftl_tools/character_tools.rb#L64
<jhass> tty1: def foo inside a module does indeed define an instance methods. These become available on a class once the module is included into it. module Foo; def x; end; end; class Bar; include Foo; end; Bar.new.x
<jhass> if you want the method to be called like Foo.x, you need to define it as def self.x
<jhass> if you want both to be possible, you need to use module_function as mentioned
<zenspider> (or def Foo.x, but that's not recommended)
SuperLag has joined #ruby
<tty1> jhass: including the module seems like a simple fix.. but what if i just want to call a single method from the module.. would there be some way to either include a single method or just to call the method without including it? or is there a way to define the method without it being an instance method?
<tty1> ahh so def Foo.x then i guess
<tty1> why isnt it recommended?
<jhass> you seem to have overlooked a big part of my message :)
<leitz> tty1, because it locks you into the Foo class, and you can't use a subclass.
zenspider has quit [Quit: bye]
<jhass> so no, there's no reasonable way to include a single method
<leitz> tty1, and yes, re-read jhass' note.
<jhass> def self.x; is recommended over def Foo.x; because it doesn't repeat the module name, so it's less likely to break in case of renames :)
<tty1> ohhh so wait i just define it as self.x then not foo.x... ok that i can do
<leitz> tty1, again, read jhass' note. Here's something I did in irb: https://gist.github.com/LeamHall/9d95163f4b164f1b66a77068c60242bd
<tty1> I did read it, and its working now, thanks
<tty1> makes sense
<tty1> i actually went with the include isntead of the static call
<leitz> Ruby modules are pretty easy going about being included as a mixin, or just used. Of course, that gives more to learn. :)
<tty1> leitz: im just pondering how i wrote this much code and didnt realize it before now.. allt his was working before a refactor but the weird thing is the refactor i did shouldnt have effected anything like this as far as I know.. very odd
d3bug has joined #ruby
roadie has joined #ruby
caterfxo has quit [Ping timeout: 256 seconds]
caterfxo has joined #ruby
greypack has quit [Ping timeout: 256 seconds]
madduck has joined #ruby
<madduck> How would I go about text wrapping in Ruby? I have text, an indent width, and a possible list leader, e.g. "this is my text" wrapped to 8 chars with 1 indent and * list bullet would become: " * this\n is my\n text"
<leitz> tty1, one time I refactored according to some advice here. Took me two weeks to get things working again. I learned a good bit, though.
<tty1> leitz: well I know there will be a **lot** I need to fix from this refactor, I just wasnt expecting this to be one of them... The refactor was so major i couldnt do it by hand. I wrote a seperate ruby script that did all the refactoring for me.. so there will be a lot of damage left behind im sure. but still easier than doing the refactor by hand
greypack has joined #ruby
<tty1> leitz: this is the script I wrote that did the refactoring for me: http://dpaste.com/2N6W9C0
roadie has quit [Ping timeout: 260 seconds]
buckworst has joined #ruby
<leitz> tty1, nice! I tend to refactor by hand, but most of my stuff is pretty small. Since I'm learning, each refactor lets me integrate what I've learned since I last looked at the code.
buckworst has quit [Client Quit]
alfiemax has joined #ruby
<tty1> leitz: I almost always refactor by hand.. i started doing this refactor by hand but it took several days and I barely put a dent in it and it caused me to shelf the whole project out of lack of motivation... so doing it this way was a first for me and only relevant due to the scope of the refactoring.
<leitz> tty1, hey, whatever solves the problem at hand!
<leitz> madduck, I'm not sure this helps, but here's how I answered a similar issue. https://gist.github.com/LeamHall/f7d073386b96091f02a44d147cc1012b
<leitz> madduck, note that I'm more a Ruby beginner, so there are likely better ways.
KindTwo has joined #ruby
<leitz> And there's a bug, that the first line is short. Haven't gotten back to it to fix that.
schne1der has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 264 seconds]
KindTwo has quit [Max SendQ exceeded]
TCZ has quit [Quit: Leaving]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
kent\n has quit [Ping timeout: 256 seconds]
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pwnd_nsfw has joined #ruby
vondruch has quit [Quit: vondruch]
KindTwo has joined #ruby
vondruch has joined #ruby
roadie has joined #ruby
kent\n has joined #ruby
KindTwo has quit [Max SendQ exceeded]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
wilhelm418 has quit [Ping timeout: 240 seconds]
roadie has quit [Ping timeout: 264 seconds]
bvdw has joined #ruby
<sagax> for `nil` we can make `nil?`
<sagax> but what we can for `true` and `false`?
<sagax> some like as `true?` and `false?`