dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
thews_ has joined #cinch
XESavant- has joined #cinch
XESavant has quit [Ping timeout: 265 seconds]
thews has quit [Ping timeout: 265 seconds]
dominikh has quit [Ping timeout: 265 seconds]
v0n has quit [Ping timeout: 265 seconds]
v0n has joined #cinch
dominikh has joined #cinch
cyrusdavid has quit [Ping timeout: 253 seconds]
postmodern has quit [Quit: Leaving]
postmodern has joined #cinch
Alren has joined #cinch
<Alren>
hello?
<Alren>
i'm new to ruby and have been looking to use irc as a way of getting a better grasp on the language. I've been trying to get cinch to work, but when i try and run the example scripts they don't work. I could use a bit of help if anyone has a bit of time. I hate asking, but i've already read the read me files that are downloaded with it and.. well.. obiviously i'm missing something.
<leftylink>
yeah I think we can do that. first let's dig in deeper into the "they don't work" I guess
<Alren>
I i've been trying to get the most basic ones up and running so I could learn from there. In particular the /examples/basic/hello
<leftylink>
sounds like a good starting point
<leftylink>
and what happens?
<Alren>
when i run it with ruby interperiter (cui) it flashes a window up then closes
<Alren>
i've been able to get a basic dice bot up with ruby before, but had to put in a message to the bot to get it to reconect to irc after the initial log in
<Alren>
i'm wondering if it's the same issue with cinch and if so if there was a way to compinsate for it?
<Alren>
but this is very new territory for me
<leftylink>
my instinct is that maybe the cinch gem isn't installed? what happens if you fire up a ruby interpreter, and type:
<leftylink>
require 'cinch'
<leftylink>
if it prints '=> true', life is good, if it prints LoadError or something similar, life is not good (yet)
<leftylink>
and in the latter case I would say install the cinch gem, and then require 'cinch' should work
<Alren>
seems like a good place to start. Now i'm guessing that the ruby interpreter is different then command prompt with ruby?
<Alren>
i loaded the gem using : gem install cinch on the command prompt with ruby.. so.. the ruby interpereter is a different program?
<leftylink>
actually, it might be the same thing
<leftylink>
when you have a command prompt with ruby, is that a thing where you can type ruby expressions and it will print out the result?
<leftylink>
like type 1 + 2 and it prints 3?
<Alren>
no
<Alren>
or at least it didn't allow me to just now
<leftylink>
however, you said you did gem install cinch, which was the correct thing to do
<leftylink>
that should install the cinch gem
<leftylink>
altough I guess we can check whether it was done corectly
<leftylink>
ok, so the ruby interpreter is a different program from what you mentioned. it's called irb, do you have anything like that?
<Alren>
one moment
<Alren>
i do
<Alren>
and when i open it the window flashes open before closings
<Alren>
hrmm.. maybe i should reinstall it?
<leftylink>
sorry, dumb question, but what do you do to open it?
<Alren>
i dobe click it
<Alren>
double*
<leftylink>
before we reinstall, can we try to run this from the command line
<Alren>
i have it opening with ruby interpritier (cui)
<Alren>
trying with no luck
<Alren>
though, thats likely user error
<Alren>
yea, same thing. The window flashes open then dissapears
<Alren>
when at the file location and putting in: start irb.exe
<leftylink>
hmm, I'm sorry that I'm not familiar with what start does
<leftylink>
what about just irb.exe? no start?
<Alren>
it won't accept irb.exe as a command
<Alren>
is there a particular version of ruby that i have to run for cinch?
<Alren>
ha!
<Alren>
ok, think i have it figured out
<Alren>
i was running an older version of ruby to get the other dice bot i was playing with working
<Alren>
that version of ruby wasn't compatiable
<Alren>
just updated my ruby version to 2.0.0 and tried to run the example help script and the window didn't shuton me but instead ran something
<Alren>
thank you for you help leftylink. I feel a bit silly, but i'm learning and do hope that there will eventually come a time where i know enough that i can help others
<Alren>
just starting out now really with learning about computers. I'm quite wet behind the ears when it comes to programming, and while I'll likely be learning things with a greater focus on networking, theres no way to get around having to have at least a basic understanding of prgraming these days.
<leftylink>
oh, did you figure it out? I see a lot happened while I was grabbing my dinner, then
<Alren>
I did, and .. now that it's up I think I'll take a bit of time poking around with the code a bit to see how things work. I'm all ears to any suggestions.
<leftylink>
hmm... I don't have any suggestion off-hand so I'm kind of making this up as I go along, but I am remembering a common task given to new programmers
<leftylink>
which is to make a guessing game. so in this case you would make your bot think of a number, and then you have a command that lets the user guess a number, and the bot says "that's my number" or "my number is higher than your guess" or "lower than your guess
<leftylink>
might start out a bit simpler though
<Alren>
ahh, i think i have a rough idea of how to do that..
<Alren>
it'll be something to putter around with
<Alren>
programming i think is going to be a hobby of mine. My real goal is to get my ccna by the end of the year
<Alren>
but i do want to get comforatble enough with ruby so I can test the waters of learning rails
<leftylink>
somehow I got into ruby without knowing rails! But I am learning a little bit of it for my work now
<Alren>
i'll see if i can get the number guessing thing up and running by the weekend.
<Alren>
very nice lefty
<Alren>
er. i've gotten as far as the install with rails, and getting a page locally hosted
<leftylink>
and of course check out the examples or ask here if need some help with that
<leftylink>
ah
<Alren>
but my lack of knowlege of actual programming was a bit of a brick wall from there
<Alren>
I'll do that. And thank you. I've always heard that the ruby community had great people involved in it
<Alren>
glad to see there was truth in it.
postmodern has quit [Quit: Leaving]
<leftylink>
glad to help
Alren has left #cinch [#cinch]
<catepillar>
leftylink: your welcome for the ruby without rails bit
<catepillar>
that's still how i am
<leftylink>
rails is pretty big, it's a lot to take in
<leftylink>
I dunno how much I'll actually touch at work
<leftylink>
and then there's microframeworks! we use sinatra sometimes at work too
postmodern has joined #cinch
<CM-Punk>
Alright, I have a question for you guys. I'm pulling a variable named 'user' from the arguments supplied in a matcher, and I need to compare that variable with a key in a YAML file. That comparison looks like this: "if @storage.key?(user)". I need it to return true regardless of case, is that possible
<CM-Punk>
?
<leftylink>
if I understand you correctly, if storage contains "BLAH", you would like it to be able to search for "blah"
<leftylink>
er
<leftylink>
CM-Punk: if I understand you correctly, if storage contains "BLAH", you would like it to be able to search for "blah"
<leftylink>
I have two ways in mind of accomplishing such a task
<CM-Punk>
Yes
<leftylink>
one is that you always store lowercased keys in storage, and then when you search, you lowercase the search term as well
<leftylink>
the other way is you override a comparison function to do a case-insensitive equality check, but I am not 100% clear on how to achieve that, and I like the first way better anyway
<CM-Punk>
I like the first way better as well except for one thing...I already have a large storage file built and I wouldn't want my users to have to re-store everything
<leftylink>
CM-Punk: are you the only maintainer of the storage file? in such case, I would say to just convert your copy of it
<CM-Punk>
Yeah I am
<CM-Punk>
Well, I could do that and I have to rewrite a lot of plugins that depend on it, but honestly I should do that so it's standardized anyway.
XESavant- is now known as rails
rails has quit [Changing host]
rails has joined #cinch
xeviox|afk is now known as xeviox
Spami__ has joined #cinch
xeviox is now known as xeviox|afk
Spami__ has quit [Ping timeout: 252 seconds]
Spami__ has joined #cinch
Dwarf has quit [Quit: Oops I quit]
Dwarf has joined #cinch
kimoto_______ has quit [Ping timeout: 240 seconds]
kimoto_______ has joined #cinch
kludge` has quit [Ping timeout: 246 seconds]
kludge` has joined #cinch
postmodern has quit [Quit: Leaving]
Spami__ has quit [Quit: This computer has gone to sleep]
irsol has quit [Ping timeout: 255 seconds]
irsol has joined #cinch
Azure has quit [Quit: My MBP went to sleep.]
postmodern has joined #cinch
aclearman037 has quit []
gtech has quit [Ping timeout: 240 seconds]
gtech has joined #cinch
<Liru>
CM-Punk: casecmp would work, if you don't mind an inefficient solution
<Liru>
like, going through all the keys in @storage for each match
<Liru>
O(n) instead of O(1)
<Liru>
Granted, if you aren't storing a significant amount of keys and don't foresee it happening in the future, or if said matcher isn't activated on each message, it shouldn't matter
<Liru>
leftylink has the right idea, though. Reconverting the yaml file to all-lowercase would work better and make better code