duderonomy has quit [Read error: Connection timed out]
duderonomy has joined #ruby
lightstalker has quit [Ping timeout: 240 seconds]
duderonomy has quit [Ping timeout: 252 seconds]
lightstalker has joined #ruby
duderonomy has joined #ruby
Rootsudo has joined #ruby
dellavg_ has joined #ruby
duderonomy has quit [Max SendQ exceeded]
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
duderonomy has quit [Max SendQ exceeded]
duderonomy has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
joelroa has joined #ruby
duderonomy has quit [Ping timeout: 252 seconds]
clemens3 has joined #ruby
duderonomy has joined #ruby
_whitelogger has joined #ruby
duderonomy has quit [Max SendQ exceeded]
duderonomy has joined #ruby
dionysus69 has joined #ruby
_whitelogger has joined #ruby
idiocrash has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
duderonomy has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
duderonomy has quit [Max SendQ exceeded]
duderonomy has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest58115 has joined #ruby
sidepocket has joined #ruby
sameerynho has joined #ruby
apeiros_ has joined #ruby
desperek has joined #ruby
Guest58115 has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sticaz has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.2]
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
dionysus69 has quit [Ping timeout: 252 seconds]
dionysus69 has joined #ruby
joelroa has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
joelroa has joined #ruby
agent_white has quit [Quit: leaving]
dionysus69 has quit [Quit: dionysus69]
doubledup has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
sidepocket has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
Yxhuvud has quit [Remote host closed the connection]
dellavg_ has quit [Ping timeout: 272 seconds]
Yxhuvud has joined #ruby
sidepocket has joined #ruby
joelroa has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 252 seconds]
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 245 seconds]
ur5us has joined #ruby
Guest58115 has joined #ruby
leitz has joined #ruby
DTZUZO has joined #ruby
ur5us has quit [Ping timeout: 272 seconds]
Guest58115 has quit [Ping timeout: 252 seconds]
<leitz>
If unit tests should not depend on order, how do you write a good test harness that tests insertions and deletions without setting up the db first?
desperek has quit [Ping timeout: 245 seconds]
jamesaxl has quit [Ping timeout: 244 seconds]
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 244 seconds]
magellanicloud has joined #ruby
AJA4350 has joined #ruby
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 245 seconds]
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 252 seconds]
leitz has quit [Quit: Leaving]
sidepocket has quit [Ping timeout: 256 seconds]
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 240 seconds]
Guest58115 has joined #ruby
mfunkmann has joined #ruby
<mfunkmann>
Hey folks! Let's say I have a background task happening via Thread.new {my_background_stuff}, is there a way to call a method from there on the main thread? If not, what would be my options to nicely communicate with the main thread?
Guest58115 has quit [Ping timeout: 245 seconds]
leitz has joined #ruby
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 252 seconds]
postmodern has quit [Quit: Leaving]
Guest58115 has joined #ruby
Guest58115 has quit [Ping timeout: 240 seconds]
AndreYuhai has joined #ruby
bak1an has joined #ruby
Guest58115 has joined #ruby
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
<AndreYuhai>
Hello there, why can I not see the methods for an object instance within another method of the class ? Here you can take a look at it : https://dpaste.de/z75d I didn't know how to explain it better.
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros_ has quit [Remote host closed the connection]
<AndreYuhai>
And of course I've used require 'watir' . I forgot to copy it there.
apeiros_ has joined #ruby
Guest58115 has quit [Ping timeout: 252 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
<leitz>
AndreYuhai, it looks like the question is about Ruby Mine IDE, correct?
<AndreYuhai>
leitz: Well, since I can still use the methods anyway, I guess it's about Ruby Mine IDE.
<leitz>
:P
<AndreYuhai>
I just wanted to ask if anyone else has ever encountered a problem like this, because it is really annoying. :D
<leitz>
Understood. You may get a better answer rate on the Ruby mailing list. There are some smart folks here who drop in occasionally, but traffic is seldom high.
desperek has joined #ruby
<AndreYuhai>
Oh, I will try that. Thank you anyway. :)
<leitz>
No worries. Hang out here if you have time.
<leitz>
If a pre 1.0 release of a gem is in the gems directory, why can't it be 'require'd?
kapil___ has joined #ruby
tristanp has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
apg has joined #ruby
<apg>
hello
<apg>
I have been googling around but I could not find answer. How do you count byte size of a utf-8 character in Ruby?
pskosinski has joined #ruby
<havenwood>
apg: bytesize
<apg>
havenwood, thank you very mucho. you saved moi day
Inline has left #ruby ["Leaving"]
fluxAeon has quit [Ping timeout: 240 seconds]
apg has quit [Quit: Leaving]
wojnar has joined #ruby
fluxAeon has joined #ruby
kotepillar_ has joined #ruby
Guest58115 has joined #ruby
<leitz>
Morning havenwood.
apg has joined #ruby
<havenwood>
g'mornin'
<havenwood>
leitz: by "gems directory" do you mean $GEM_PATH or $GEM_HOME or something else?
Guest58115 has quit [Ping timeout: 240 seconds]
<leitz>
havenwood, I have installed two pre 1.0 gems in the LOAD_PATH. The issue may be the way I structured the gems; I don't do the usual "lib/load_my_libs.rb" file.
<leitz>
Mostly because I don't understand it.
apg has quit [Client Quit]
<leitz>
That may be the issue, or the pre-1.0 issue.
<havenwood>
leitz: The goal is to have your file structure match your namespaces. So there's a lib/ftl_chargen.rb file, and a lib/ftl_chargen/ directory.
<havenwood>
leitz: That's all there typically is in lib/
<havenwood>
leitz: Everything else in that tree is inside the lib/ftl_chargen/ dir.
<havenwood>
leitz: So if you have a lib/ftl_chargen/dice.rb, the namespace is FtlChargen::Dice
<havenwood>
leitz: And a lib/ftl_chargen/dice/another_one is FtlChargen::Dice::AnotherOne
<havenwood>
leitz: And so on
<havenwood>
another_one.rb*
qolq has quit [Read error: Connection reset by peer]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
Ha, oops - did that one wrong in Pry. >.>
<havenwood>
Never mind that example!
<leitz>
hehe...still working it.
<leitz>
pry.rb has other code in in though.
<havenwood>
leitz: Yeah, pry.rb is where Pry class is setup and where all the requires for lib/pry/* live
<havenwood>
leitz: Your ftl_chargen.rb should require the other files in lib/ftl_chargen/*
<havenwood>
leitz: It's the single point of require for the gem.
<leitz>
Should the libraries "careers" and "tools" be in "lib" or "lib/ftl_chargen"
<havenwood>
leitz: lib/ftl_chargen, and they should be namespaced under the FTLChargen or FtlChargen class or module
<havenwood>
leitz: So lib/ftl_chargen/careers.rb would be FtlChargen::Careers
<havenwood>
leitz: Or is it FTLChargen?
<havenwood>
I'm not familiar with the initialism.
xfbs has joined #ruby
RougeR has quit [Ping timeout: 272 seconds]
<leitz>
havenwood, the careers are classes that get used by the generation code. Sorting this out is a task, and they may go from classes to structs as I figure things out more.
<leitz>
In the repo's bin/chargen is where the careers get loaded.
<leitz>
Okay, fixed the careers path issue. Not sure 'tools' is still used.
<havenwood>
leitz: and then the ftl_chargen/career should match nicely with FTLChargen::Career, etc
<havenwood>
with the require name always mirroring the namespace
<leitz>
havenwood, specify the full namespace?
* havenwood
asks the mirror which is the fastest benchmark of them all...
<havenwood>
leitz: so career, character, dice, etc are all defined inside the FTLChargen module
<havenwood>
leitz: that way every gem can have its own Dice without stomping on each other
* leitz
notes it works better if you use the right case for module...
<havenwood>
leitz: that way Havenwood::Dice won't conflict with FTLChargen::Dice
<havenwood>
leitz: It's hygienic to have your gem only have classes and modules under its namespace, in your case FTLChargen
Guest58115 has quit [Ping timeout: 240 seconds]
<leitz>
Err...there are lots of data files as well.
<havenwood>
leitz: files are fine - it's Ruby namespaces where you want everything under FTLChargen
<havenwood>
leitz: when gems are used together, the classes and modules all get mixed in together. if you define a class someone already has defined you stomp on it.
* leitz
is working on his next question.
<havenwood>
leitz: so we don't go stomping on each other's code, we make sure to keep everything namespaced
<havenwood>
so you can have a FTLChargen::Time class and not be redefining stdlib's Time, for example
rgr has quit [Quit: rgr]
mitescugd has quit [Quit: C-x C-c]
<leitz>
havenwood, I agree with namespacing. Understanding it is a bit different. New error, let me post the result since I haven't figured it out yet.
<leitz>
Also, feel free to point in the "general" direction if I should be able to figure it out.
herbmillerjr has quit [Quit: Konversation terminated!]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has quit [Ping timeout: 240 seconds]
tristanp has quit [Ping timeout: 252 seconds]
<leitz>
havenwood, do the careers like ftl_chargen/careers/citizen.rb need to be in the FTLChargen module as well?
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<leitz>
chargen uses const_get to set the career name, and putting the career in the FTLChargen module breaks that.
<leitz>
Leaving it out seems to make it unable to find the methods in character_tools. undefined method `array_from_file' for FTLChargen::CharacterTools:Module (NoMethodError)
<leitz>
Ah, "module_function". Not sure I get why a mixin has to specifically export modules.
<havenwood>
leitz: yes, ftl_chargen/careers/citizen should correspond to FTLChargen::Careers::Citizen
<havenwood>
leitz: I use module_function often. It serves the dual purpose of making functions directly callable on your module and it makes included functions private to the including class.
<leitz>
Ah, so if I used it as a mixin I'd not need to module_function it.
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leitz>
havenwood, old computer, old keyboard monkey. Nothing moves fast here...
<leitz>
private method `social_status' called for #<FTLChargen::Character:0x000055c6acec3f10> (NoMethodError)
<havenwood>
leitz: ftw, in lib/ run: rubocop -la
<havenwood>
leitz: that's because of the module_function
<havenwood>
leitz: it makes included functions private
<havenwood>
leitz: so you'd have to expose it on your class
<leitz>
I thought it made everything public? Ah...
<havenwood>
leitz: module_function makes functions available to call directly on the module as module functions, and it *also* makes included functions private
<leitz>
Dang bipolar methods...
<apeiros_>
there is a point to do it that way.
apeiros_ is now known as apeiros
<leitz>
If rubocop breaks stuff right after I almost got it working I'm going to whine. Loudly...
* havenwood
promises it'll be peachy
<apeiros>
if you can call the method on the module itself directly, it *can't* have any ties to any instance. so there's absolutely no point in calling it on an instance.
knight33 has joined #ruby
<leitz>
Hmm...only 3 offences.
<havenwood>
^
<havenwood>
leitz: now remove the -l :-P
<havenwood>
leitz: rubocop -a
<leitz>
apeiros, I was hoping to find a way to not have to put "module_function" under everything since they are all to be exportable.
knight33 has quit [Client Quit]
<havenwood>
leitz: what apeiros is saying is an important insight
<leitz>
havenwood, okay, a lot more stuff changed.
<havenwood>
leitz: haha - yeah, the non-lints do a lot
<leitz>
havenwood, not sure I get what apeiros is saying. In this case, character_tools is a mixin for character, and other classes. The hope was that an object of class Character could use the methods without having to do module_function or FTLChargen::CharacterTools.social_status.
<apeiros>
leitz: module_function exists to be able to call it as just `social_status` (when mixed in), or as `FTLChargen::CharacterTools.social_status` (when not mixed in)
<apeiros>
it however does *not* exist to allow you to call it on `some_object_which_mixes_it_in.social_status`
<apeiros>
because the social_status method obviously has no relation to some_object_which_mixes_it_in.
<havenwood>
leitz: you can always make a module_function included function public, but typically you'd just not use module_function if that's your intended behavior
<havenwood>
leitz: i'd question _why_ you want functions exposed on a class.
<apeiros>
leitz: if you can't see '' or "" easily, change your editor. you can make it blinking in red to make it really visible. really, that's what we've got syntax highlighting for.
<leitz>
apeiros, social_status gives a name to the characters status, based on the stat. That name is used to choose a career.
herbmillerjr has quit [Quit: Konversation terminated!]
<apeiros>
leitz: that was not my question
<apeiros>
leitz: does social_status make any use of anything in my_object?
<leitz>
apeiros, yes, it uses the upp.
<apeiros>
leitz: how can it be a module_function then?
<havenwood>
leitz: does anything on the instance of Character possibly effect the return value of the social_status function?
<havenwood>
leitz: if it does, it should be defined on Character, and not in a module
<apeiros>
you're having something wrong here. either it can't be a module_function, or it makes no sense to call it on my_object from the outside.
<apeiros>
one of the two is wrong.
<havenwood>
leitz: module functions are for functions, which mean the return the same value for the same input, every time they're called - the class changing can't possibly change their return value, since they're functions not methods
<apeiros>
anyway, I'll leave that in the capable hands of havenwood.
<apeiros>
I like to call them pseudo functions (or pretend functions). but yes, the point is that they try to be functions.
<apeiros>
(things which do not need access to self, neither to @ivars nor to instance methods on self)
<apeiros>
while often deterministically (same input = same output, as havenwood said), that's not necessarily a requirement. see Kernel.rand.
<leitz>
apeiros, havenwood here's the logic. When _creating_ a character, a social "class" is chosen based on a digit in the UPP. This is only used when class Character mixes in module Character_Tools for the purpose of modifying the character. For CSV or Text presentation most if not all of Character_Tools are not used; the character is already created.
herbmillerjr has joined #ruby
<havenwood>
apeiros: i was thinking the same thing - as we say, "friend, you speak my mind"
<apeiros>
leitz: sorry, I'm leaving atm, better discuss this with havenwood :)
<leitz>
thanks apeiros!
<apeiros>
yw, good luck and success on your chargen work!
<leitz>
Character_Tools is specifically a set of methods to get mixed in to Character during creation. Character_Tools is also expected to be mixed in with other stuff but I only have so many brain cells. The real reason was to keep Character clean.
<havenwood>
leitz: should be CharacterTools, no _
<havenwood>
leitz: mind pushing your latest character_tools.rb - I'm curious to take a look.
<leitz>
havenwood, probably. I started this a few years ago when I knew even less.
<havenwood>
looks like it's right in the code
<leitz>
Must have gotten one right by accident...
<leitz>
Pushed
<leitz>
class Character could almost be an ostruct, but I want to learn OOP.
<havenwood>
leitz: looks good up to line 12
<havenwood>
leitz: Don't ever define your own globals, no $$s.
<havenwood>
leitz: the #dice method looks good
<leitz>
Yup. Actually, somewhere else it's DATA_PATH with no $.
<havenwood>
leitz: I'd put NOBILITY with DATA_PATH, above the methods.
<havenwood>
leitz: I like you froze the outer Hash. The inner ones aren't frozen.
<leitz>
Ah, I thought it recursed in.
<havenwood>
leitz: rubocop would add the frozen string literal magic commentl which is great for freezing all the strings
<havenwood>
leitz: nope
graphene has quit [Remote host closed the connection]
ShekharReddy has quit [Quit: Connection closed for inactivity]
* leitz
takes a break.
wojnar has quit [Remote host closed the connection]
wojnar has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
graphene has quit [Remote host closed the connection]
Dbugger has quit [Remote host closed the connection]
graphene has joined #ruby
DTZUZO has quit [Ping timeout: 272 seconds]
Freshnuts has joined #ruby
graphene has quit [Read error: Connection reset by peer]
* leitz
notes he's been at this for 9 or so of the last 10 hours and will probably zonk out shortly.
graphene has joined #ruby
<leitz>
havenwood, I commented where things were updated. Reload character tools. I'll get back to this tomorrow.
<leitz>
And thanks!
psmolen has quit [Ping timeout: 250 seconds]
psmolen has joined #ruby
akem has quit [Remote host closed the connection]
akem__ has joined #ruby
SeepingN has joined #ruby
jdawgaz has joined #ruby
Guest58115 has joined #ruby
dviola has joined #ruby
leitz has quit [Quit: Leaving]
ur5us has joined #ruby
tristanp has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
Guest58115 has quit [Ping timeout: 244 seconds]
tristanp has quit [Ping timeout: 272 seconds]
thy0 has quit [Remote host closed the connection]
lomex has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has joined #ruby
thy0 has joined #ruby
reber has quit [Remote host closed the connection]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO_ has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thy0 has quit [Ping timeout: 246 seconds]
thy0 has joined #ruby
minimal_life has joined #ruby
jdawgaz has joined #ruby
bak1an has joined #ruby
doubledup has quit [Quit: Leaving]
minimal_life has quit [Quit: I am functioning within established parameters.]
tdy has quit [Ping timeout: 244 seconds]
tdy has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 246 seconds]
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndreYuhai has quit [Ping timeout: 252 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheBloke has quit [Read error: Connection reset by peer]
akem__ is now known as akem
TheBloke has joined #ruby
tdy has quit [Ping timeout: 272 seconds]
clemens3 has quit [Ping timeout: 246 seconds]
tdy has joined #ruby
desperek has quit [Quit: xoxo]
brandoncc has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
Freshnuts has quit [Quit: Leaving]
n13z has quit [Ping timeout: 240 seconds]
Turnikov has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
n13z has joined #ruby
thy0 has quit [Quit: TTFN]
thy0 has joined #ruby
thy0 has quit [Client Quit]
thy0 has joined #ruby
RiPuk has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
phrost has joined #ruby
<phrost>
hi hello
DTZUZO_ has quit [Ping timeout: 244 seconds]
patr0clus has joined #ruby
thy0 has quit [Quit: TTFN]
<apeiros>
hi phrost
thy0 has joined #ruby
<phrost>
hello apeiros, could you assist me with some ruby? i have a script i am using inside metasploit, and i am stuck with something
<apeiros>
I don't help with metasploit by principle. there's a metasploit channel afaik, and you can also just ask in the channel generally (as in: without targetting me)
<phrost>
i am automating some simple tasks, however when a command shell opens i can not interact with it because the previous command my script ran is still not finished running