<bithon>
Ox0dea: Oh. Thank you! Boomarked it for when the weekend comes to study the material. Thanks ;p
radgeRayden__ has joined #ruby
<Ox0dea>
SICP is a holy text; use it wisely.
<bbert>
any advice for writing a small ruby daemon that does client I/O over TCP sockets and stores its state in a database (probably sqlite)? I'm already comfortable using TCP in Ruby. I haven't dealt with databases.
<pontiki>
bithon: are you looking for something to practice on?
<pontiki>
lol
<jhass>
bbert: not sure what kind of advice you're seeking
<pontiki>
bbert: well, jhass beat me to the question
<bbert>
jhass pontiki: basically, to be pointed in the right direction for dealing with databases. maybe orm
<jhass>
ah
<jhass>
bbert: check Sequel
<jhass>
(gem called that)
bklane has quit [Ping timeout: 256 seconds]
<Ox0dea>
bbert: Alternatively, use one of the pseudo-databases from the standard library.
<bithon>
Yes sir :D
<jhass>
does anybody really use them?
<bithon>
Well I really just need some sort of brain teaser to keep my mind occupied
<jhass>
bithon: codewars.com?
<bithon>
I've just wasted the entire weekend watching tv shows and doingbasically nothing
<Ox0dea>
bithon: Sounds like you meant to join #selfhelp.
<bithon>
Haha :D
kalopsian has quit [Ping timeout: 256 seconds]
wmdrossard has quit [Ping timeout: 250 seconds]
radgeRayden_ has quit [Ping timeout: 250 seconds]
<bithon>
Good idea probably
<Ox0dea>
Yeah, I wasn't being facetious.
<bithon>
I'm either super productive and work 12-14 hours a day
<bithon>
or I'm a total slob
roshanavand has quit [Ping timeout: 250 seconds]
<bithon>
Can't meet in the middle even if my life depended on it
<Ox0dea>
?ot
<ruboto_>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<bithon>
Alrighty
<Ox0dea>
See ya there!
blackgoat has quit [Ping timeout: 272 seconds]
<bithon>
Well, can I still stay in this channel ?
kalopsian has joined #ruby
bklane has joined #ruby
atomical has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
<jhass>
sure
charliesome has quit [Read error: Connection reset by peer]
<bbert>
Ox0dea: I like built in functionality... are you referring to something like DBM?
bklane_ has joined #ruby
<wolffles>
im sure this is super easy for you guys. i cant get my counter to count :(
bklane has quit [Read error: Connection reset by peer]
devoldmx has quit [Remote host closed the connection]
lyoshajapan has joined #ruby
<Ox0dea>
jhass: I felt they were well off the right path; better to save them going over, I reckon.
<jhass>
well, I usually do that by "look at String#count" and stuff
<jhass>
not giving the solution right away
<jhass>
me thinks you learn less by that
<wolffles>
Ox0dea: thanks that was much easier than mine.
cwong_on_irc has quit [Quit: Leaving.]
<Ox0dea>
wolffles: And correct to boot. :P
<Ox0dea>
Ruby loves you.
jdelaney has joined #ruby
<Ox0dea>
Easy things are easy, hard things are easy.
ElFerna_ has quit [Ping timeout: 240 seconds]
<bithon>
The words of wisom! :D
<wolffles>
question how come in my book the code looks like (/[aeiou]/) instead you just used (‘aeiou’)… what is hte difference
bklane_ has quit [Remote host closed the connection]
bklane has joined #ruby
<Ox0dea>
wolffles: String#scan expects a regular expression to search for, whereas String#count simply expects a string of one or more characters to tally the occurrences thereof.
bklane has quit [Client Quit]
kalopsian has joined #ruby
prereflect has joined #ruby
baweaver has joined #ruby
<al2o3-cr>
jesus loves you more then you will know
rgrmatt has quit [Remote host closed the connection]
<al2o3-cr>
hey
<wolffles>
hmm is there a resource i can use to see what method expects what? i feel like thats something i would want ot memorize.
<havenwood>
?ot
<ruboto_>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<havenwood>
al2o3-cr: ^
<Ox0dea>
havenwood: ?
<Ox0dea>
Oh.
<havenwood>
Ox0dea: :)
<havenwood>
wolffles: The docs do say what the various method params can be.
<Ox0dea>
In his defense, al2o3-cr does normally contain himself to #ot.
<Ox0dea>
wolffles: That should work at your shell too, sans the '&'.
<havenwood>
wolffles: One nice way to look at docs is to do it inside the Pry REPL (an alternative to IRB): gem install pry pry-doc && pry -e "show-doc String#count"
kalopsian has quit [Ping timeout: 240 seconds]
<al2o3-cr>
havenwood: just ?
<havenwood>
wolffles: Or in irb you can enter `help` then: String#count
baweaver has quit [Ping timeout: 240 seconds]
ledestin has joined #ruby
j4cknewt has quit [Remote host closed the connection]
DroidBur_ has quit []
tvon has quit []
ruid has quit [Ping timeout: 256 seconds]
<wolffles>
woah i did the irb method and it was confusing
<havenwood>
wolffles: Yeah, you enter a help mode. :O
lyoshajapan has quit [Remote host closed the connection]
<al2o3-cr>
wolffles: carefully read it, it helps some :)
<TTilus>
wolffles: pry is lovely in countless ways, you want to get familiar with it
ElFerna_ has joined #ruby
<havenwood>
?pry
<ruboto_>
Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting `binding.pry` directly in your source code. Visit https://pryrepl.org/ or get it now with: gem install pry pry-doc
<havenwood>
wolffles: In Pry try `help` for a list of Pry-specific commands.
<havenwood>
wolffles: `ls`, `show-doc` and `show-source` are handy sometimes
malconis has joined #ruby
<havenwood>
Or `gem-install` for that matter. Nice to install and load a gem without leaving the REPL.
jessemcgilallen has quit [Quit: jessemcgilallen]
mitt3ns has joined #ruby
tenderlove has joined #ruby
<wolffles>
i dont have permission lol
kalopsian has joined #ruby
ixti has joined #ruby
atomical_ has joined #ruby
Rickmasta has joined #ruby
ixti has quit [Client Quit]
ixti has joined #ruby
ElFerna_ has quit [Quit: WeeChat 1.3]
atomical has quit [Ping timeout: 240 seconds]
malconis has quit [Client Quit]
ur5us has quit [Remote host closed the connection]
jdelaney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TheWhip has quit [Remote host closed the connection]
steffkes has quit [Ping timeout: 240 seconds]
TheWhip has joined #ruby
grepwood has joined #ruby
<grepwood>
hello everyone
<grepwood>
I've got this nasty piece in my code, system "mysql -e 'SET PASSWORD = PASSWORD('#{mysql_root_password}');'"
skade has joined #ruby
<grepwood>
no matter how many time I escape the characters, it just doesn't want to parse correctly, mysql client complains that the command is malformed
duckpuppy has joined #ruby
<grepwood>
can someone please tell me how to do that nasty piece correctly?
<adaedra>
Just use a mysql adapter?
<grepwood>
it has to use system, mysql gem has way too many dependencies
<ruboto_>
shevy # => /tmp/execpad-183cd4a8b750/source-183cd4a8b750:2: warning: already initialized constant Thing ...check link for more (https://eval.in/484768)
<GinoManWorks>
grepwood: in that case it wouldn't be, but you might get no matches, one match, or many matches. The problem is that it would be type-unsafe to just assume you'd get one or the other because accessing them requires different syntax
<adaedra>
Anyway, since there can be multiple matches, you have to be able to return them all.
jacyzon has quit [Quit: Connection closed for inactivity]
<GinoManWorks>
In the name of simplicity, Ruby handles typing for you to a large extent, but if you ALWAYS got an array, then you'd have to use array redirection even when you expected and only got one result.
<GinoManWorks>
unless I'm wrong, I am still learning myself but I read a couple books several years ago.
<adaedra>
You can have no match, you can have multiple matches, you can have named groups, ...
<GinoManWorks>
and I remember typing and such that much and if that be the case it makes sense to me
<GinoManWorks>
right
<adaedra>
also
pandaant has joined #ruby
<GinoManWorks>
ah yes, I forgot about "named groups", because then you have to be able to retrieve that matched text
<adaedra>
<grepwood> string is a byte array that ends with 0x00 – that's true in C.
<GinoManWorks>
and C++
<shevy>
fossil languages!
<grepwood>
:(
<GinoManWorks>
although they prefer you to use the std::string class moreso
<adaedra>
and some others like Obj-C, yes.
<shevy>
swift to the future!!!
<grepwood>
Ruby has a different definition of a string?
<shevy>
it's an object
<adaedra>
>> "a Ruby string can contain a \x00 character."
<ruboto_>
adaedra # => "a Ruby string can contain a \u0000 character." (https://eval.in/484799)
trautwein has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
Modern implementation use a chars array + size couple.
mary5030 has joined #ruby
Pupp3tm4st3r has joined #ruby
<adaedra>
Allows more flexibility.
<GinoManWorks>
grepwood: also you can call methods directly against a ruby string literal
dlitvak_ has joined #ruby
<grepwood>
adaedra, like Pascal
<adaedra>
grepwood: what language are you coming from?
<GinoManWorks>
>> "this string will respond to messages".capitalize
tenderlove has quit [Remote host closed the connection]
<adaedra>
Ah.
<grepwood>
but my first ever project, prime number bruteforcer, was really slow in Python
<shevy>
well doesn't python have a somewhat similar definition of a string?
<grepwood>
rewrote it in C and that kinda sold it to me
<grepwood>
it does yes
gagrio has quit [Ping timeout: 240 seconds]
<adaedra>
grepwood: note that in Ruby you don't often care about the underlying implementation. A string is a string; how it is stored in memory doesn't really matter, except if you're doing things inside Ruby itself.
Wsewolod has joined #ruby
<GinoManWorks>
Say, does ruby have a syntax checking commandline switch?
polysics has joined #ruby
<adaedra>
ruby --help
<GinoManWorks>
0c
<GinoManWorks>
-c * rather
<GinoManWorks>
thanks
<adaedra>
It's rather basic tho; if you want something tougher (checks style), you have rubocop.
<grepwood>
adaedra, is it possible to do low-level stuff in Ruby? I have LZSS decompression algo implemented in C, C++ and Pascal at home, and I just now wondered if that's possible in Ruby too
artX000 has quit [Remote host closed the connection]
<adaedra>
Depends how low, but should be possible, yes.
<grepwood>
that doesn't even require 64bit math so it's pretty easy
trautwein has joined #ruby
duckpuppy has quit [Ping timeout: 272 seconds]
jordanm has joined #ruby
<adaedra>
If what you're looking for is direct bytes access, you have ri:Array#pack and ri:String#unpack
<adaedra>
bithon: that's exactly the thing the bot asks not to use.
<grepwood>
people don't like ads
<adaedra>
grepwood: seems doable. Not in direct translation; but seems doable.
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adaedra>
?pastebin
<ruboto_>
Please don't use Pastebin! Pastebin sucks because it loads slowly, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org).
<adaedra>
Some people here won't even open your thing if you post it in pastebin, mind.
<bithon>
Now that's just silly
kalopsia1 has joined #ruby
<bithon>
One word: adblock.
<adaedra>
Doesn't solve the other problems.
<GinoManWorks>
actually grepwood, if you already implemented it in C, why not retrofit it to be a ruby module you can call?
<grepwood>
I'm guessing pastebin has a lot of scripts under the hood that don't do anything useful too
<bithon>
Never really had any slowdowns
govg has quit [Ping timeout: 250 seconds]
<bithon>
But whatever, gist is just as fine in my eyes
<grepwood>
GinoManWorks, could do in my spare time
jpank has joined #ruby
<bithon>
not about to start a religious war
<adaedra>
Anyway, if you want to discuss channel policies, go #ruby-community.
<grepwood>
but what would it be useful for?
bMalum_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<grepwood>
LZSS is only ever used in... old games? Final Fantasy 7, Fallout 1, etc...
* bithon
slowly steps away from the debate
<shevy>
hmm
<shevy>
channel policy states that pastebin is not allowed?
<bithon>
Apparently
<GinoManWorks>
grepwood: if you retrofitted it, you could use it in your ruby programs, the algorithm would have the same speed as the C version (because it is the C version, even though now-a-days that's not so much an issue) and it's DRY friendly
<shevy>
can I read up on this
Zamerick_ has joined #ruby
<bithon>
It almost feels like emacs vs vim debate imho lol
<shevy>
anyway, pastebin is inferior to pastie or gis
B1n4r10 has joined #ruby
govg has joined #ruby
<shevy>
emacs vs vim is bad because there are only two losers
<bithon>
:O Oh no you ddn't
<c355e3b>
In that debate we already know the winner bithon
<bithon>
didn't*
<bithon>
vim?
symbol has joined #ruby
<c355e3b>
Emacs
<adaedra>
ok, editor war goes in #ruby-offtopic now.
<shevy>
bithon I remember how pastebin had annoying flash ads that played loud music once... I hated it since that day, that shocked me
<c355e3b>
Fair enough
trwyth has quit [Read error: Connection reset by peer]
<c355e3b>
Pastebin is super ad heavy
* GinoManWorks
gives a thumbs up to the editor war going away (all hail vim)
<shevy>
GinoManWorks hahaha
<bithon>
GinoManWorks <3
<shevy>
sublime forever!!!
jdm has joined #ruby
<bithon>
no shevy, just no.
<c355e3b>
I can see why people would not want to use it
<adaedra>
er.
symbol has quit [Client Quit]
<GinoManWorks>
I like notepad++ but when I'm on the command line on Linux and have to edit config files, vim all the way
<shevy>
:D
<bithon>
Well I use vim or gvim everywhere I go
<adaedra>
ok, editor war goes in #ruby-offtopic now. 2nd call.
<bithon>
as a matter of fact, I have a usb with Vim on it with my vimrc and all that jazz
<shevy>
ok now I can understand vim actually... but gvim? really?
<bithon>
adaedra aye aye!
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mary5030 has quit [Remote host closed the connection]
mostlybadfly has quit [Quit: Connection closed for inactivity]
<GinoManWorks>
anyways grepwood, I would recommend at least looking into that if for no other reason that repurposing the same code without having to rewrite it
<GinoManWorks>
i.e. "DRY friendly"
mary5030 has joined #ruby
atomical has joined #ruby
vdamewood has joined #ruby
<grepwood>
GinoManWorks, what's DRY?
<apeiros>
shevy, bithon: no, channel policy doesn't forbid any paste service. the information is courtesy, mostly because as adaedra said, lots of high profile helpers won't even read a pastebin.com paste.
<GinoManWorks>
Don't Repeat Yourself
jdm__ has quit [Ping timeout: 256 seconds]
<GinoManWorks>
There's a book out there called "The Productive Programmer" where he talks about ways to be more efficient as a programmer and one of them was "DRY - Don't Repeat Yourself"
<bithon>
Fair enough
<GinoManWorks>
he being the author*
<bithon>
I almost feel like productivity hacks are in itself a waste time
<bithon>
a time waster*
<GinoManWorks>
Another one is YAGNI - You Aint Gonna Need It
rgtk has joined #ruby
DeXterbed has quit [Ping timeout: 250 seconds]
shock_one has quit [Remote host closed the connection]
<GinoManWorks>
bithon: They're not so much hacks as principles. They're broader than just "in this one situation, don't do this", it's like "in general observe this principle..."
Guest88888 is now known as saneax_AFK
<shevy>
apeiros \o/ I don't use pastebin anyway, it's indeed awful
gagrio has joined #ruby
govg has quit [Ping timeout: 240 seconds]
mary5030 has quit [Ping timeout: 240 seconds]
<bithon>
GinoManWorks: I know. That was my terrible attempt at humor that I decided belongs to the offtopic channel rather than here. I mean after all, I don't want to be banned from you all beautiful peeps :P;2u
symbol has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<GinoManWorks>
The program I'm re-learning ruby to make I started making in C++ originally and I created a class that would contain all the parsed command line options as C++ types and I kept adding features to the program and then I realized that most of the features had NOTHING to do with the problem I was trying to solve so I commented them out and put an explanation that maybe I'll add these features later but for now they're commented out because YAGNI
<apeiros>
adaedra: we need a clippy-bot :D
<adaedra>
what would it do?
<apeiros>
adaedra: "It looks like you try to start a flame war, would you like to continue in #ruby-offtopic?"
<adaedra>
ahah
<GinoManWorks>
apeiros: It could make it so that we could private message it code pastes and then send it like an "end" command and it would generate a gist.github.com url
symm- has quit [Read error: Connection reset by peer]
atomical has joined #ruby
<apeiros>
GinoManWorks: I don't follow?
<GinoManWorks>
that'd be cool
<GinoManWorks>
clippy bot I assumed you meant for pastes
boxofrox has joined #ruby
<adaedra>
apeiros: he wants ruboto_ to autopaste code we would pm ruboto_.
aryaching has joined #ruby
<apeiros>
GinoManWorks: heh, no, for automatically recognizing certain behaviors
<bithon>
Somebody should make a git repo of that. And in the meantime while it's being developed you could direct people's attention to that rather than the flame war
<bithon>
It's a win-win sitaution
bithon has quit [Quit: WeeChat 0.4.2]
uri_ has joined #ruby
dstarh has joined #ruby
<apeiros>
I keep forgetting how tf to change the nick in cinch
<apeiros>
always assume .nick= would set the value, not trigger a message to the server…
<adaedra>
I'm cheating: the bot is connected to ZNC, so I can connect directly and /nick myself. Way easier.
codecop has quit [Remote host closed the connection]
<apeiros>
adaedra: ah, 2100 - at that time I finally allowed myself some leisure time with xenoblade
<apeiros>
adaedra: oh. clever.
kiez0rd has quit [Ping timeout: 240 seconds]
<apeiros>
capital idea. will steal.
bithon_web has joined #ruby
<`derpy>
Also, makes a great puppet.
thejamespinto has quit [Ping timeout: 256 seconds]
symbol has quit [Quit: WeeChat 1.1]
inteq has quit [Remote host closed the connection]
grill has joined #ruby
bithon has joined #ruby
The_Phoenix has joined #ruby
jgt2 has quit [Ping timeout: 240 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bithon_web has quit [Client Quit]
atomical_ has joined #ruby
roshanavand has joined #ruby
rvchangue has quit [Ping timeout: 260 seconds]
diego2 has joined #ruby
mary5030 has joined #ruby
diego2 is now known as dviola
atomical has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 240 seconds]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
rvchangue has joined #ruby
Tempesta has quit [Quit: See ya!]
mostlybadfly has joined #ruby
malconis has joined #ruby
nhhagen has quit [Ping timeout: 240 seconds]
TheWhip has quit []
rodfersou|afk is now known as rodfersou
polishdub has joined #ruby
djcp has quit [Quit: WeeChat 1.0.1]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
B1n4r10 has quit [Ping timeout: 272 seconds]
scripore has joined #ruby
roshanavand has quit [Remote host closed the connection]
dlitvak_ has quit [Remote host closed the connection]
djcp has joined #ruby
dlitvak has joined #ruby
symm- has quit [Quit: Leaving...]
roshanavand has joined #ruby
mary5030 has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
aspire has joined #ruby
dh64 has quit [Quit: Konversation terminated!]
tenderlove has joined #ruby
dorei has joined #ruby
mhib has joined #ruby
bithon has quit [Quit: WeeChat 0.4.2]
blackms has quit [Ping timeout: 256 seconds]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
jgt2 has joined #ruby
ItSANg___ has quit [Quit: Leaving...]
bronson has joined #ruby
jgpawletko has joined #ruby
Stalkr_ has joined #ruby
dlitvak has quit [Ping timeout: 240 seconds]
tk__ has quit [Quit: ばいばい]
tenderlove has quit [Ping timeout: 256 seconds]
krobzaur has joined #ruby
B1n4r10 has joined #ruby
gregf has quit [Quit: WeeChat 1.3]
dfinninger has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rodfersou is now known as rodfersou|lunch
tagrudev has quit [Remote host closed the connection]
goodcodeguy has joined #ruby
bithon has joined #ruby
dfinninger has quit [Remote host closed the connection]
tulak has joined #ruby
slackr has joined #ruby
slackr is now known as ehth77
gregf has joined #ruby
stannard has joined #ruby
lurch_ has quit [Quit: lurch_]
whippythellama has joined #ruby
<grepwood>
is there a way to capture output of system into a variable?
<al2o3-cr>
grepwood: not with system
devoldmx has joined #ruby
duckpuppy has joined #ruby
lurch_ has joined #ruby
<grepwood>
as noted before I'm avoiding the mysql gem, it needs to many deps to work
<adaedra>
grepwood: there are the backticks, but you'll get back to your escaping problem.
blackms has joined #ruby
<grepwood>
so I do this, system 'mysql -e \'SELECT "Hello World!";\' | base64', to get a base64 of mysql's response
<al2o3-cr>
grepwood: ``, %x(), IO.popen
<adaedra>
Also, I remember that the dependencies for mysql gem is just the mysql dev package.
ItSANgo_ has joined #ruby
<grepwood>
it should be "SGVsbG8gV29ybGQhCkhlbGxvIFdvcmxkIQo=" if the database is working alright
<grepwood>
adaedra, it fails to build in a horrible way on my vms
chipotle has joined #ruby
<grepwood>
don't think boss would fancy my script having more than 300 lines already
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
<adaedra>
Fix that. It will be way less painful to do than to try to make everything go through mysql binary.
bweston92 has joined #ruby
nettoweb has joined #ruby
Wsewolod has quit [Ping timeout: 250 seconds]
ehth77 has quit [Quit: Leaving]
devoldmx has quit [Ping timeout: 256 seconds]
underplank has joined #ruby
kp666 has quit [Ping timeout: 272 seconds]
casadei has quit [Remote host closed the connection]
mary5030 has joined #ruby
kalopsian has quit [Quit: leaving]
anisha has quit [Quit: Leaving]
underplank has quit [Ping timeout: 240 seconds]
<jhass>
grepwood: use the mysql2 gem
loren has joined #ruby
casadei has joined #ruby
Phage has left #ruby [#ruby]
jdm_ has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
mchu has joined #ruby
bbert has joined #ruby
bbert has quit [Changing host]
bbert has joined #ruby
ttilley has joined #ruby
ttilley has quit [Changing host]
ttilley has joined #ruby
azgil has quit [Quit: Leaving]
jdm has quit [Ping timeout: 246 seconds]
tulak has quit [Remote host closed the connection]
kiez0rd has joined #ruby
kp666 has joined #ruby
solocshaw has joined #ruby
tulak has joined #ruby
Suntzu has joined #ruby
Rickmasta has joined #ruby
cdg has joined #ruby
Stalkr_ has quit [Read error: Connection reset by peer]
ornerymoose has quit [Quit: ornerymoose]
kp666 has quit [Ping timeout: 272 seconds]
Rickmasta has quit [Ping timeout: 240 seconds]
ornerymoose has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
kaka__ has joined #ruby
moeabdol has joined #ruby
casadei has quit [Remote host closed the connection]
rippa has joined #ruby
atomical has joined #ruby
gaiada has quit [Ping timeout: 240 seconds]
kp666 has joined #ruby
failshell has joined #ruby
atomical_ has quit [Ping timeout: 240 seconds]
arup_r has quit [Remote host closed the connection]
mustmodify has joined #ruby
<mustmodify>
Is there a way to ask gem where a certain gem lives?
<mustmodify>
like, give me the directory where you stashed all that code?
moeabdol has quit [Ping timeout: 240 seconds]
<adaedra>
gem which
solocshaw has quit [Ping timeout: 250 seconds]
ElFerna has quit [Ping timeout: 250 seconds]
<mustmodify>
adaedra: Now that you've sent it, I'm kind of disappointed in myself I didn't just try that. :)
<apeiros>
mustmodify: there's also always `gem help` ;-)
BSaboia has joined #ruby
freerobby has joined #ruby
bbert has quit [Ping timeout: 250 seconds]
<jhass>
mustmodify: gem open is a thing too
Pumukel has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
<mchu>
why is there a comma after resource.username? what does that mean
<adaedra>
those are the parameters of login_with_credentials
<adaedra>
if we put back optional parenthesis, it's `if login_with_credentials(resource.username, params[:roster_session][:password])`
<mchu>
oh i see. ok thanks, let me try to work with that really quick
Sou|cutter has quit [Quit: WeeChat 0.4.2]
<adaedra>
:q
<adaedra>
oops
Sou|cutter has joined #ruby
steffkes has quit [Ping timeout: 272 seconds]
RobertBirnie has joined #ruby
duckpuppy has quit [Ping timeout: 250 seconds]
<shevy>
a vimster!
<shevy>
it tampers with ze brains
<mchu>
adaedra: is it normal to have parameters for an If Statement? i thought parameters are usually for methods
nateberkopec has joined #ruby
<adaedra>
you have a method, it's login_with_credentials
<adaedra>
it's calling login_with_credentials with the two given parameters, and the if is done on the return of this method
mikecmpbll has quit [Ping timeout: 250 seconds]
sol has joined #ruby
<mchu>
ohh right
psy_ has joined #ruby
sol is now known as Guest66804
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ruby
tenderlove has joined #ruby
solars has quit [Ping timeout: 256 seconds]
<mchu>
thanks adaedra
<adaedra>
yw
monthy has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
blackms has quit [Quit: Leaving]
tenderlove has quit [Ping timeout: 240 seconds]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
polishdub has joined #ruby
kenichi has joined #ruby
akem has quit [Remote host closed the connection]
TheBloke- has joined #ruby
fantazo has joined #ruby
moeabdol has joined #ruby
pdoherty has quit [Ping timeout: 272 seconds]
tildes has joined #ruby
davedev24 has joined #ruby
TheBloke has quit [Ping timeout: 250 seconds]
ornerymoose has quit [Quit: ornerymoose]
nertzy has quit [Quit: This computer has gone to sleep]
ruby-lang437 has joined #ruby
lemur has joined #ruby
TheBloke- is now known as TheBloke
jgt2 has quit [Ping timeout: 256 seconds]
moeabdol has quit [Ping timeout: 256 seconds]
chthon has quit [Ping timeout: 255 seconds]
dmolina has quit [Quit: Leaving.]
momomomomo has joined #ruby
sucks has quit [Read error: Connection reset by peer]
jbrhbr has joined #ruby
spt0 has quit [Quit: Leaving]
Lildirt has quit [Ping timeout: 272 seconds]
spt0 has joined #ruby
ornerymoose has joined #ruby
Lildirt has joined #ruby
ruby-lang437 has quit [Ping timeout: 252 seconds]
berserk_ren has joined #ruby
lemur is now known as baweaver_
baweaver has quit [Disconnected by services]
baweaver_ is now known as baweaver
lemur has joined #ruby
Fire-Dragon-DoL has quit [Read error: Connection reset by peer]
gizmore has joined #ruby
dede has quit [Quit: Connection closed for inactivity]
yqt has quit [Ping timeout: 256 seconds]
bronson has joined #ruby
ElFerna has joined #ruby
baweaver has quit [Remote host closed the connection]
zast has joined #ruby
howdoico1 has joined #ruby
Saklovich has joined #ruby
Saklovich was kicked from #ruby by ChanServ [Banned: trolling]
scripore has joined #ruby
MasterNayru has quit [Remote host closed the connection]
Synthead has quit [Quit: Synthead]
Synthead has joined #ruby
TomyLobo has joined #ruby
baweaver has joined #ruby
RegulationD has quit [Remote host closed the connection]
Lildirt has quit [Ping timeout: 250 seconds]
dviola has quit [Quit: WeeChat 1.3]
JDiPierro has joined #ruby
SylarRuby has joined #ruby
angrywombat has joined #ruby
InvGhost has joined #ruby
SylarRuby has quit [Client Quit]
SegFaultAX has joined #ruby
bMalum_ has quit [Ping timeout: 240 seconds]
angrywombat has left #ruby [#ruby]
nickjj has quit [Read error: Connection reset by peer]
Lildirt has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bronson has quit [Remote host closed the connection]
tomphp has joined #ruby
emilkarl has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
ibouvousaime has joined #ruby
Cohedrin has joined #ruby
jpfuentes2 has joined #ruby
rehat has joined #ruby
Cohedrin has quit [Max SendQ exceeded]
banister has joined #ruby
djbkd has joined #ruby
snockerton has joined #ruby
<thomasfedb_>
How're we looking for a Flynn that I can update?
<thomasfedb_>
(without reinstalling)
pdoherty has joined #ruby
[Butch] has joined #ruby
_djbkd has joined #ruby
jgt2 has joined #ruby
<shevy>
flynn?
kfpratt has joined #ruby
<snockerton>
i need a way to do a #merge equivalent on an existing OpenStruct object - doesn't look like it's supported natively - any ideas?
djbkd has quit [Remote host closed the connection]
fantazo has quit [Ping timeout: 240 seconds]
arooni has joined #ruby
colleenmcguckin has joined #ruby
<apeiros>
snockerton: #to_hash, merge, construct new openstruct from result
<snockerton>
doh, just realized i could to_h it
<snockerton>
thx
<apeiros>
ah right, to_h, not to_hash (to_hash was my name for it when to_h didn't exist yet)
<snockerton>
is there an actual difference?
Lildirt has quit [Ping timeout: 272 seconds]
<snockerton>
i just figured it was a ruby lazy-ism
aibot_ has quit [Ping timeout: 250 seconds]
scripore has joined #ruby
Lildirt has joined #ruby
hakunin_ is now known as hakunin
duckpuppy has joined #ruby
tlaxkit has quit [Quit: ¡Hasta luego!]
rakm has joined #ruby
colleenmcguckin has quit [Read error: Connection reset by peer]
colleenmcguckin has joined #ruby
snguyen has joined #ruby
duckpuppy has quit [Ping timeout: 256 seconds]
momomomomo has quit [Quit: momomomomo]
Eiam has joined #ruby
pawnbox has quit [Remote host closed the connection]
dlitvak has joined #ruby
pawnbox has joined #ruby
bronson has joined #ruby
elaptics is now known as elaptics`away
frem has joined #ruby
kmckelvi1 has joined #ruby
weaksauce has quit [Ping timeout: 246 seconds]
arup_r has quit []
pawnbox has quit [Ping timeout: 240 seconds]
sepp2k has quit [Read error: Connection reset by peer]
howdoico1 has quit [Ping timeout: 250 seconds]
c0m0 has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
jessemcgilallen has joined #ruby
jbrhbr has quit [Quit: Leaving.]
azgil has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
s00pcan has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jgt2 has quit [Ping timeout: 240 seconds]
pika_pika has joined #ruby
platzhirsch has left #ruby [#ruby]
zdman135 has joined #ruby
howdoico1 has joined #ruby
weaksauce has joined #ruby
emilkarl has quit [Quit: emilkarl]
The_Phoenix has quit [Read error: Connection reset by peer]
B1n4r10 has quit [Quit: Lost terminal]
dionysus69 has joined #ruby
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
aibot_ has joined #ruby
last_staff has joined #ruby
howdoico1 has quit [Ping timeout: 256 seconds]
papercode has joined #ruby
thomasfedb_ is now known as thomasfedb
thomasfedb has quit [Changing host]
thomasfedb has joined #ruby
B1n4r10 has joined #ruby
vasilakisfil has quit [Ping timeout: 240 seconds]
jbrhbr has joined #ruby
weaksauce has quit [Ping timeout: 250 seconds]
jdelaney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Omen-DiE- has joined #ruby
Synthead has quit [Remote host closed the connection]
jokke has quit [Quit: WeeChat 1.3]
kadoppe_ has quit [Ping timeout: 256 seconds]
akem has joined #ruby
dlitvak has quit [Ping timeout: 250 seconds]
spt0 has quit [Ping timeout: 240 seconds]
postmodern has joined #ruby
aryaching has quit [Ping timeout: 240 seconds]
kadoppe has joined #ruby
Omen-DiE- has quit [Read error: Connection reset by peer]
moeabdol has joined #ruby
thejamespinto has joined #ruby
Omen-DiE- has joined #ruby
xaxisx has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
shadoi has joined #ruby
firstdayonthejob has joined #ruby
baweaver has quit [Remote host closed the connection]
davejlong has joined #ruby
weaksauce has joined #ruby
pdoherty has quit [Remote host closed the connection]
bl4ckw4ter has joined #ruby
moeabdol has quit [Ping timeout: 240 seconds]
thejamespinto has quit [Ping timeout: 256 seconds]
jokke has joined #ruby
djbkd has joined #ruby
djbkd has quit [Remote host closed the connection]
Vitor_ has quit [Ping timeout: 240 seconds]
guacjack has joined #ruby
ElFerna has quit [Quit: WeeChat 1.3]
saddad has joined #ruby
djbkd has joined #ruby
bl4ckw4ter has left #ruby [#ruby]
jessemcgilallen has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
mchu has quit [Quit: mchu]
ElFerna has joined #ruby
dlitvak has joined #ruby
_djbkd has quit [Ping timeout: 256 seconds]
Pupeno has quit [Remote host closed the connection]
RegulationD has joined #ruby
thejamespinto has joined #ruby
howdoico1 has joined #ruby
calderonroberto has joined #ruby
ta has quit [Read error: Connection reset by peer]
ta has joined #ruby
Lildirt has quit [Ping timeout: 240 seconds]
devoldmx has quit [Ping timeout: 240 seconds]
Regulati_ has joined #ruby
kalopsian has quit [Ping timeout: 250 seconds]
xaoz_ has joined #ruby
Cohedrin has joined #ruby
blaxter has quit [Quit: foo]
Lildirt has joined #ruby
n008f4g_ has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
snockerton I assume it is probably out of consistency, we have .to_s, .to_i, .to_f and .to_a; there also is .to_str though
spider-mario has joined #ruby
<shevy>
I have no idea why apeiros associates .to_h with .to_hash but not .to_a with .to_array though :)
dorei has quit [Ping timeout: 272 seconds]
jdelaney has joined #ruby
<shevy>
oh I forgot .to_sym
<jbrhbr>
my interpretation is that he had his own library that defined .to_hash before .to_h existed in ruby
<apeiros>
shevy: never had a need of defining a to_array
kalopsian has joined #ruby
<apeiros>
jbrhbr: correct
RegulationD has quit [Ping timeout: 272 seconds]
thejamespinto has quit []
<apeiros>
ruby didn't standardize for to_h back then.
skcin7 has joined #ruby
<jbrhbr>
only weird thing there for a newcomer such as myself, which i brought up a couple of weeks ago, is that there is no .to_b
<apeiros>
(nor did any core class have a to_h)
<apeiros>
jbrhbr: to_boolean?
<jbrhbr>
yeah
<apeiros>
we rarely ever need that
<apeiros>
false/nil being the only falsy values obviates the need in most cases
xaoz_ is now known as dorei
<shevy>
x = "true"; x.to_bool now that would be something
<jbrhbr>
i admit its use is limited, but there seems to be other things that would be used less but are still in the language, whereas this creates a slight inconsistency
Pupeno has joined #ruby
<jbrhbr>
shevy: your example is probably why it doesn't exist
<apeiros>
jbrhbr: it's easy to add
<jbrhbr>
shevy: ppl argue that the semantics are ambiguous because some people want to define it as you have written
<apeiros>
class NilClass; def to_b; false; end; end; class FalseClass; def to_b; false; end; end; class Object; def to_b; true; end; end
<jbrhbr>
i argue that it should just be: !!v, ie, "pass it through the truthiness algorithm"
kalopsian has quit [Client Quit]
yardenbar has joined #ruby
kalopsian has joined #ruby
jessemcgilallen has joined #ruby
<shevy>
jbrhbr hmm yeah... I only had to do this for strings though actually
<shevy>
I got tired of having to write true or false in yaml files to I simply used t and f instead :D
<jbrhbr>
my curiosity was just piqued because i saw the !!v idiom being used here at work and i was like "why didn't this code use .to_b? ops, it doesn't exist". but the better argument is why !!v is needed at all perhaps
djbkd has quit [Remote host closed the connection]
<shevy>
I like the ! toggler
djbkd has joined #ruby
zast has quit [Remote host closed the connection]
tenderlove has joined #ruby
<shevy>
it's like turning a switch on and off ... "turn into a pigeon! turn into a pigeon!"
Lucky___ has joined #ruby
<shevy>
eventually I will have a pigeon
axl_ has quit [Quit: axl_]
bbert has joined #ruby
bbert has quit [Changing host]
bbert has joined #ruby
<jbrhbr>
bang enough, and you'll have a pigeon
<shevy>
hahaha
momomomomo has joined #ruby
dlitvak_ has joined #ruby
<shevy>
I think I saw it first in ruby ... I was using perl, then php but can't remember having used that there
Rickmasta has joined #ruby
mg^^ is now known as mg^
colegatron has quit [Ping timeout: 240 seconds]
tenderlove has quit [Ping timeout: 240 seconds]
dlitvak has quit [Ping timeout: 256 seconds]
<apeiros>
the most common case where I translate a value to a boolean is when I don't want to expose inner state
duckpuppy has joined #ruby
<apeiros>
e.g. there's plenty of people who'll write code like: `def foo?; @some_complex_value; end`
tvw has quit []
<apeiros>
and @some_complex_value can be either nil or a complex value - which represent the falsy and truthy results
ponga has quit [Quit: Connection closed for inactivity]
<apeiros>
I prefer to actually return a boolean, to avoid that complex value ending up being referenced somewhere it doesn't belong
ap4y has joined #ruby
Rickmasta has quit [Ping timeout: 272 seconds]
ta has quit [Read error: Connection reset by peer]
<apeiros>
additionally to avoid people stupidly not reading the docs and relying on foo? to return the complex value
ta has joined #ruby
<apeiros>
though, that's a minor concern. people who do that deserve the hurt :)
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
ta has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
ta has joined #ruby
troulouliou_dev has joined #ruby
Xentil has quit [Ping timeout: 250 seconds]
edwinvdgraaf has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
axl_ has quit [Client Quit]
chouhoul_ has joined #ruby
troulouliou_dev has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
duckpuppy has quit [Ping timeout: 256 seconds]
troulouliou_dev has quit [Max SendQ exceeded]
nettoweb has joined #ruby
jdm has joined #ruby
troulouliou_dev has joined #ruby
dfinninger has joined #ruby
<shevy>
there are two difficult-to-handle things in software evolution
<eam>
Icey: are you, by chance, doing advent of code?
<slash_nick>
lol
<apeiros>
Icey: well, then what eam said. because /\n/ matches a newline.
<slash_nick>
i wondered that
<icey>
just wondering what the case for a string containing \n but not being a newline would be
<icey>
no to advent of code
<eam>
slash_nick: I just started again
cdg has quit [Remote host closed the connection]
<eam>
I'm doing look and say
<slash_nick>
eam: i didn't get to spend any time at a computer last weekend, so i have to catch up
<slash_nick>
look and say was so much fun, i thought
<apeiros>
Icey: eh, the point is that your string does not contain \n. it contains \\n
<icey>
fair enough
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<slash_nick>
Icey: be consistent with your decision to use single or double quotes
djbkd has quit [Remote host closed the connection]
<icey>
I'm contemplating a compiler, so my program will be fed strings
<icey>
I won't get to decide what the strings are, just what I don't support :)
Vitor_ has quit [Ping timeout: 250 seconds]
<mg^>
heh advent of code, looks fun
<slash_nick>
mg^: much much
<slash_nick>
also, the gchq christmas card puzzles
<eam>
it has a nice progression from trivial to taking some consideration
edwinvdgraaf has quit [Remote host closed the connection]
howdoico1 has joined #ruby
edwinvdgraaf has joined #ruby
colegatron has joined #ruby
jbrhbr has quit [Quit: Leaving.]
kalopsian has joined #ruby
pdoherty has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
<mg^>
my brain doesn't do crypto puzzles well, so I'll look at the gchq stuff when I have run out of everything else to do
<mg^>
but writing a reindeer simulation is well within my skill set
chouhoulis has joined #ruby
Vitor_ has joined #ruby
weemsledeux has joined #ruby
yfeldblum has joined #ruby
BadQuanta has joined #ruby
yqt has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
f00bar-32 has joined #ruby
aspire has joined #ruby
weemsledeux has quit [Max SendQ exceeded]
BadQuanta has quit [Client Quit]
jbrhbr has joined #ruby
djbkd has joined #ruby
Omen-DiE- has quit [Quit: Leaving]
tulak has joined #ruby
rikai has quit [Ping timeout: 240 seconds]
<slash_nick>
lol
<slash_nick>
yeah, something satsifying about driving a robotic santa around a 2d grid
freerobby has quit [Quit: Leaving.]
dionysus69 has quit [Ping timeout: 250 seconds]
ta has quit [Remote host closed the connection]
_stu_ has quit [Quit: _stu_]
ElFerna has quit [Ping timeout: 240 seconds]
djbkd has quit [Ping timeout: 256 seconds]
gioele has left #ruby [#ruby]
aryaching has joined #ruby
momomomomo has quit [Quit: momomomomo]
Snowy has joined #ruby
djbkd has joined #ruby
<shevy>
what are crypto puzzles
<shevy>
writing a reindeer simulation sounds like fun though
akem has quit [Ping timeout: 240 seconds]
rikai has joined #ruby
<shevy>
apeiros once famously wrote an audio song alle meine entlein... perhaps he does a new variant for xmas melodies :D
jdelaney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dfinninger has quit [Remote host closed the connection]
<shevy>
(except when it would be "last xmas, I gave you my heart ...")
baweaver has joined #ruby
dfinninger has joined #ruby
rikai has quit [Ping timeout: 240 seconds]
<eam>
crypto puzzles are stuff like "why is my openssl library linking all screwed up"
<shevy>
oh damn
<gizmore>
shevy: ?selzzup otpyrc
<shevy>
that reminds me... I had a mix up when I had installed both libressl and openssl, one program was using libressl rather than openssl when I tried to compile it
<shevy>
gizmore let me decipher that...
kalopsian has quit [Ping timeout: 240 seconds]
<shevy>
k seems like .reverse
<gizmore>
actually it´s a book cipher
colleenmcguckin has quit [Read error: Connection reset by peer]
snockerton has quit [Ping timeout: 265 seconds]
<gizmore>
"selzzup otpyrc" means "you are right, this is not crackable and plausible deniable"
<gizmore>
of course the words in the codebook are chosen to distract you!
baweaver has quit [Ping timeout: 240 seconds]
<gizmore>
read up on navajo code book
DroidBurgundy has joined #ruby
ElFerna has joined #ruby
<hxegon>
'egg'
<shevy>
a crypto egg?
howdoico1 has quit [Ping timeout: 272 seconds]
otherj has joined #ruby
<mg^>
OK I know which reindeer is ahead at 2503 seconds.
nhhagen has joined #ruby
bbert has quit [Ping timeout: 240 seconds]
<gizmore>
Cryptologist are not allowed in casinos, because they tend to count cards
<mg^>
heh, I learned how to count cards, can't help myself now at the blackjack table
<mg^>
I just force myself to leave when I am about $20 ahead
<shevy>
I saw some videos about professional cheaters in casino... pretty creative some of them were there
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mg^>
because I'm not at all slick about it like that movie
yqt has quit [Ping timeout: 250 seconds]
edwinvdgraaf has quit [Read error: Connection reset by peer]
<gizmore>
mg^: isn´t it pretty hard with 4 or 6 decks,.... or better said, quite useless?
<mg^>
no, number of decks doesn't matter
pandaant has quit [Remote host closed the connection]
<mg^>
it's how often they shuffle
edwinvdgraaf has joined #ruby
<gizmore>
as they stop at the half?
<mg^>
and how many they burn off the top
rikai has joined #ruby
<gizmore>
:D
<shevy>
so many things you have to keep in mind
atomical has joined #ruby
<mg^>
basically, the more decks, the longer you need the cards to stay in play before your count becomes useful
<gizmore>
Do you want another card? "yes" - The next card would have been a sheep!, wanna re-consider?
<shevy>
same thing with professional players in games, like warcraft 3 or starcraft 2... the amount of factors they consider, or what they have to calculate to min-max, at which specific time ...
<gizmore>
i´d say sc2 and such games are quite easy to play well with lots of clicks and keyboard gestures
<gizmore>
it´s more about concentration on the movement and build up quickly, than strategic decisions
Vitor_ has quit [Ping timeout: 272 seconds]
<gizmore>
of course, you should not make horrible mistakes and have a strategy... but in the end the clickspersecond matter a lot
<shevy>
gizmore I may have thought so too until I listened to some of grubby's post-play commentaries... one of the best statements he made was "to enable later opportunities"... that is, if you adapt your playing style, e. g. push for more pressure at the right time, the game may be easier lateron
colleenmcguckin has quit [Read error: Connection reset by peer]
nettoweb has quit [Ping timeout: 240 seconds]
colleenmcguckin has joined #ruby
tildes has quit [Ping timeout: 240 seconds]
tenderlove has joined #ruby
<gizmore>
shevy: yeah... but the research etc is not _that_ important i bet, compared to resource hogging and such things
momomomomo has joined #ruby
jessemcgilallen has quit [Read error: Connection reset by peer]
<gizmore>
who gets second resources first, usually was the winner in sc1
<havenwood>
mchu: Are you looking at redcross arcdata then?
<mchu>
Yes
<mchu>
howd you know haha
<mchu>
oh nvm
kmckelvin has joined #ruby
<havenwood>
mchu: The best place for Rails questions is the #RubyOnRails channel. That'd be the place to ask why you're getting a Fixnum rather than the expected Object that responds to #empty?.
<mchu>
ok thanks!
<havenwood>
mchu: you're welcome
blackgoat has joined #ruby
scripore has joined #ruby
djbkd has quit [Remote host closed the connection]
moeabdol has joined #ruby
<mchu>
havenwood: getting an error when typing in #rubyonrails room
<mchu>
“can’t send to room “#rubyonrails” on “cht.freenode.net”"
dfinning_ has quit [Remote host closed the connection]
SenpaiSilver has quit [Read error: Connection reset by peer]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SenpaiSilver has joined #ruby
SenpaiSilver has quit [Remote host closed the connection]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has joined #ruby
baweaver has quit [Remote host closed the connection]
atomical has joined #ruby
n_blowna_ has joined #ruby
devoldmx has joined #ruby
n_blownapart has quit [Read error: Connection reset by peer]
ricer2 has joined #ruby
decoponio has quit [Quit: Leaving...]
DavidDudson has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
n_blowna_ has quit [Client Quit]
Pupeno_ has quit [Remote host closed the connection]
ta has quit [Read error: Connection reset by peer]
<shevy>
hmmmm
<shevy>
unfinished thought here ...
ta has joined #ruby
<shevy>
we have ... modules and classes. we can add methods from a module, into a class, but we have to do a include
<shevy>
is there a way to add methods of a module to a class, without using include or extend?
<gizless>
shevy: yes... with kinda reflection
<gizless>
hmmm wait
<shevy>
hmm
gizless is now known as gizmore
<gizmore>
in theory with kinda reflection, no?
FernandoBasso has quit [Ping timeout: 240 seconds]
pwnd_nsfw has joined #ruby
<shevy>
reason I ask this is ... I have a main namespace right now which is a module, there I add some methods to the main namespace... but I also want to have these methods in the main namespace be available for classes, without include... I guess it may not be possible but I am asking for confirmation
<gizmore>
"just" get the methods for a module and add them to the class... maybe possible
<shevy>
gizmore I dunno, it is over the top of my head right now
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
htmldrum has joined #ruby
howdoicomputer has joined #ruby
drysjasperfx is now known as drysjasper
radgeRayden__ has quit [Ping timeout: 256 seconds]
hxegon has quit [Read error: Connection reset by peer]
davedev2_ has joined #ruby
davedev24 has quit [Ping timeout: 250 seconds]
makenoise has quit []
claw has quit [Ping timeout: 272 seconds]
jgpawletko has quit [Quit: jgpawletko]
ttilley has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
akem2 has quit [Read error: No route to host]
akem has joined #ruby
atomical has joined #ruby
claw has joined #ruby
baweaver has quit [Remote host closed the connection]
ttilley has quit [Changing host]
ttilley has joined #ruby
chouhoul_ has joined #ruby
drysjasper has quit [Quit: Konversation terminated!]
houhoulis has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
neanderslob has joined #ruby
cdg has joined #ruby
chouhoulis has quit [Ping timeout: 272 seconds]
chouhoulis has joined #ruby
drys has joined #ruby
davejlong has quit []
akem has quit [Read error: No route to host]
jdelaney has joined #ruby
akem has joined #ruby
threh has joined #ruby
rikai has joined #ruby
tenderlove has joined #ruby
ornerymoose has quit [Ping timeout: 272 seconds]
B1n4r10 has quit [Ping timeout: 240 seconds]
rayzaum has joined #ruby
rikai has quit [Remote host closed the connection]
cassioscabral has quit [Quit: cassioscabral]
jdelaney has quit [Client Quit]
leat1 has quit [Remote host closed the connection]
polishdub has quit [Quit: Leaving]
leat1 has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djcp1 has joined #ruby
rdark has quit [Ping timeout: 272 seconds]
tenderlove has quit [Ping timeout: 240 seconds]
tulak has quit [Remote host closed the connection]
bithon has quit [Ping timeout: 240 seconds]
djcp has quit [Ping timeout: 256 seconds]
tulak has joined #ruby
riceandbeans has left #ruby [#ruby]
aryaching has quit [Read error: Connection reset by peer]
Kabaka has quit [Ping timeout: 260 seconds]
pdoherty has quit [Remote host closed the connection]
dlitvak has joined #ruby
cassioscabral has joined #ruby
pdoherty has joined #ruby
Jackneill has quit [Remote host closed the connection]
bbert has quit [Ping timeout: 256 seconds]
jdelaney has joined #ruby
JDiPierro has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
howdoicomputer has quit [Quit: WeeChat 1.3]
kmckelvin has joined #ruby
howdoicomputer has joined #ruby
dlitvak has quit [Ping timeout: 240 seconds]
xaxisx has left #ruby [#ruby]
<fcser>
Hmm I have a silly question about scope.... I have a cinch bot with the megahal plugin. I want megahal to respond to it's own name instead of a prefix / string. Is there a way to make @bot available outside of methods to make line #51 work? http://pastie.org/10632875#49
zequix_ has joined #ruby
zequix_ has quit []
axl__ has joined #ruby
axl_ has quit [Ping timeout: 240 seconds]
axl__ is now known as axl_
ESpiney has quit [Quit: Leaving]
<TomyLobo>
if you want #megahal to respond, ask in #megahal. as to your question of scope. this is clearly out of scope :P
Kabaka has joined #ruby
howdoicomputer has quit [Client Quit]
howdoicomputer has joined #ruby
<shevy>
fcser if you have a butler bot you could perhaps ask apeiros!
freerobby has quit [Quit: Leaving.]
hobodave has quit [Quit: Computer has gone to sleep.]
<fcser>
lol
<shevy>
dominikh wrote cinch, he used to be on #ruby-lang but seems to not have survived the transition into #ruby
tulak has quit [Remote host closed the connection]
mclong has joined #ruby
<fcser>
well I was just curious I thought there was some way to make the variable available "out of scope"..
<fcser>
with lambda or somethin or maybe it's not possible
<fcser>
or just checking every message the way it is now is fine
pika_pika has quit [Ping timeout: 240 seconds]
<TomyLobo>
fcser, as to your actual question about scope, you have a lifetime problem there, not just a scope problem
<adaedra>
not this way
<TomyLobo>
fcser, i assume you mean @hal, yes?
<TomyLobo>
@hal is initialized upon instantiation and it belongs to an instance of HAL
<fcser>
Ok
<adaedra>
fcser: I don't think this can work this way; if your bot get renamed, you want it to respond to your new name, right?
<TomyLobo>
that match is in calss scope and is run way earlier, when the class HAL is first loaded
<fcser>
adaedra: correct
<TomyLobo>
s/calss/class/
hxegon has joined #ruby
bithon has joined #ruby
Xentil has joined #ruby
<fcser>
TomyLobo: ok yes this is what I'm experiencing
<fcser>
since bot is empty at that point
<fcser>
so it's just 'not possible' I'm approaching it wrong or something
<adaedra>
fcser: I think you'll have to intercept all messages, and match afterwards, in the handler. Here your name will be available.
<fcser>
Ok
<fcser>
that's what I'm doing - was just concrned if that was too... heavy handed
<fcser>
but it will work
<adaedra>
that's what cinch is doing anyway.
gaiada has quit [Ping timeout: 256 seconds]
<TomyLobo>
fcser, well you need your name variable to exist before that match line is run
<adaedra>
You're just moving the match from cinch code to your code.
cassioscabral has quit [Quit: cassioscabral]
jdelaney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Azure has quit [Ping timeout: 272 seconds]
gaiada has joined #ruby
claw has quit [Ping timeout: 256 seconds]
ni291187 has joined #ruby
kmckelvin has quit [Ping timeout: 240 seconds]
<fcser>
TomyLobo: I did try defining a special @botnick = @bot.nick variable in the initialization method but @bot.nick is empty at that point too
claw has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
<fcser>
either way thanks i'm understanding a bit more
<TomyLobo>
fcser, the initialization method is an instance method
<TomyLobo>
when "match" is run, no instance exists yet
Azure has joined #ruby
<TomyLobo>
because, for one, the class isnt even fully initialized yet
ramortegui has quit [Remote host closed the connection]
ornerymoose has joined #ruby
SCHAAP137 has joined #ruby
djcp1 has quit [Ping timeout: 250 seconds]
<fcser>
TomyLobo: ok makes sense - I was just thinking @bot.nick would be available since megahal is a subclass of cinch bot
<TomyLobo>
that doesnt matter at all
<TomyLobo>
there is no instance yet
ni291187 has left #ruby [#ruby]
<TomyLobo>
not even a fully initialized class
<TomyLobo>
and hence no instance methods can possibly have been called yet
<TomyLobo>
not even the initialization method
snguyen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
B1n4r10 has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jessemcgilallen has joined #ruby
bithon has quit [Quit: WeeChat 0.4.2]
EllisTAA has joined #ruby
bithon has joined #ruby
<fcser>
TomyLobo: ok I see - I thought there may have been some way to create an instance to get the bot name (then disregard that instance) and use match etc - but apparently I'm just confused
<fcser>
I'll stop trying to do it the hard way hhe
idefine has quit [Remote host closed the connection]
akem has quit [Read error: No route to host]
dlitvak has quit [Ping timeout: 250 seconds]
ibouvousaime has quit [Ping timeout: 250 seconds]
akem has joined #ruby
kalopsian has joined #ruby
Pumukel has quit [Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]]
ornerymoose has quit [Quit: ornerymoose]
finisherr has joined #ruby
zenlot has quit [Ping timeout: 272 seconds]
djcp1 has joined #ruby
<soahccc>
ellistaa: define_method is a class method. What do you want to do there? a.b.something? I'm not sure if this is the best way of doing things :)
marr has joined #ruby
akem has quit [Read error: No route to host]
akem2 has joined #ruby
idefine has joined #ruby
DroidBurgundy has quit [Ping timeout: 272 seconds]
<EllisTAA>
soahccc: could u explain that to me? i dont get what accept_virutal is
rgrmatt has joined #ruby
<soahccc>
ellistaa: this is just an extracted method from our base model. We use it when we need accessors for form_for etc. and don't want to define them on the class generally. But it does what you want I guess and the caveats :) The first version is bogus and I took ages to realize
Blaguvest has quit []
akem has quit [Read error: No route to host]
akem has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
devoldmx has joined #ruby
<soahccc>
ellistaa: so basically you have to call define_method on the instance metaclass (it's a bit complicated in ruby)
<EllisTAA>
soahccc: what do u mean accessors for form_for?
<soahccc>
ellistaa: rails related
<EllisTAA>
soahccc: does that refer to strong params?
bnizzle has joined #ruby
TomyLobo has quit [Ping timeout: 272 seconds]
kiez0rd has quit [Ping timeout: 272 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<soahccc>
ellistaa: not really. If you use form_for in rails (with a model) and you do `form.text_field :something` that "something" has to be a method on the model. Sometimes you have fields only in that form and we don't want to put the accessor in the class generally so we set it dynamically
devbug has joined #ruby
<EllisTAA>
soahccc: oh i see … so if you wanted info like zip code and you didn’t want to include that in the model you’d use the code you linked to? that’s cool
dfinninger has quit [Remote host closed the connection]
hobodave has quit [Ping timeout: 240 seconds]
gizless has joined #ruby
Rickmasta has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
<jbrhbr>
in trying to understand `a.map(&:foo)`, i tried `a.map(->(v) { v })` and was surprised to see this doesn't work. instead you have to write it as `a.map(&->(v) { v })`. can anyone explain that? in the :foo case, it's calling .to_proc and sending that symbol to the object you're iterating over. but a lambda is already a proc, so why does it need the &?
dlitvak has joined #ruby
dfinninger has joined #ruby
pika_pika has joined #ruby
gizmore has quit [Ping timeout: 250 seconds]
SCHAAP137 has quit [Ping timeout: 256 seconds]
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
<soahccc>
jbrhbr: a method can accept any amount of arguments but either one or no "code block". But you can pass multiple procs/lambdas as arguments. Does that help?
<jbrhbr>
i knew that actually, but your restatement there seems to illuminate hte problem here
jessemcgilallen has joined #ruby
<jbrhbr>
i guess map is using the default block and using &->(){} causes that lambda to become the default block
Qantourisc has quit [Ping timeout: 246 seconds]
<jbrhbr>
otherwise it's just an argument
<EllisTAA>
could someone tell me how i could call this line but get the result ‘christmas.h’ instead of christmas.letter?