yfeldblu_ has quit [Remote host closed the connection]
AKASkip has joined #ruby-lang
<bnagy>
epitron: re FFI, what ruby are you trying to use? I have good results with the new rubyinstaller ( MRI ) and jruby now, even on x64
<bnagy>
haven't used cygwin bullshit for years now
<epitron>
i really like having a real commandline
<epitron>
with working unix tools
<bnagy>
yeah, you just think you do
<bnagy>
learn powershell :)
<epitron>
pfft :)
<epitron>
if i used windows more than once per month, i'd do that
<bnagy>
anyway, nobody _uses_ windows, that's crazy. You just need your code to run on it
<epitron>
yep
<bnagy>
anyway, having what appears to be proper unix tools and yet are actually waiting patiently to trick you and destroy your sanity is < just using rubyinstall and cmd.exe imho
<epitron>
i have a large collection of scripts that i use for day-to-day file operations that i can't live without
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
<epitron>
i prefer the occasional cygwin hiccup to having nothing
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
michaeldeol has joined #ruby-lang
clauswit_ has quit [Max SendQ exceeded]
yfeldblum has quit [Remote host closed the connection]
clauswitt has joined #ruby-lang
yfeldblum has joined #ruby-lang
gianlucadv has quit [Ping timeout: 265 seconds]
clauswitt has quit [Max SendQ exceeded]
clauswitt has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vieq has quit [Ping timeout: 256 seconds]
ahmetkapikiran has quit [Quit: ahmetkapikiran]
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
RobertBirnie has joined #ruby-lang
mattyohe has quit [Quit: Connection closed for inactivity]
vieq has joined #ruby-lang
amsha has joined #ruby-lang
amsha has quit [Ping timeout: 250 seconds]
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby-lang
mark_slight has joined #ruby-lang
voxxit has joined #ruby-lang
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AKASkip has quit [Ping timeout: 258 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
apeiros has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: zzz]
oleo has quit [Quit: Verlassend]
jmrepetti has joined #ruby-lang
miqui_ has joined #ruby-lang
rahul_j has joined #ruby-lang
kaczmar has joined #ruby-lang
ledestin_ has joined #ruby-lang
rippa has joined #ruby-lang
ledestin has quit [Ping timeout: 265 seconds]
ledestin_ is now known as ledestin
mark_slight has quit [Quit: mark_slight]
Forgetful_Lion has joined #ruby-lang
SuMo_D has quit [Remote host closed the connection]
SuMo_D has joined #ruby-lang
miqui has quit [Read error: Connection reset by peer]
SuMo_D has quit [Ping timeout: 272 seconds]
chinmay_dd_ has joined #ruby-lang
miqui_ has quit [Read error: Connection reset by peer]
charliesome has joined #ruby-lang
solars has joined #ruby-lang
allomov has joined #ruby-lang
pr0ton_ has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
mamantoha has joined #ruby-lang
JohnBat26 has joined #ruby-lang
pnbeast has quit [Quit: leaving]
qba73 has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
clauswitt has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
amsha has joined #ruby-lang
rahul_j has joined #ruby-lang
clauswitt has quit [Client Quit]
mistym has quit [Remote host closed the connection]
amsha has quit [Ping timeout: 272 seconds]
RitterJack has joined #ruby-lang
futilegames has joined #ruby-lang
futilegames has quit [Client Quit]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
apeiros has joined #ruby-lang
oak has quit [Ping timeout: 265 seconds]
muskalek has quit [Ping timeout: 245 seconds]
qba73 has quit []
rahul_j has quit [Ping timeout: 264 seconds]
kaczmar has quit [Quit: kaczmar]
rahul_j has joined #ruby-lang
vondruch has joined #ruby-lang
clauswitt has joined #ruby-lang
muskalek has joined #ruby-lang
clauswitt has quit [Max SendQ exceeded]
nofxx has quit [Ping timeout: 265 seconds]
clauswitt has joined #ruby-lang
michael_mbp has quit [Excess Flood]
clauswitt has quit [Max SendQ exceeded]
benlovell has joined #ruby-lang
Kabaka has quit [Ping timeout: 245 seconds]
clauswitt has joined #ruby-lang
michael_mbp has joined #ruby-lang
clauswitt has quit [Max SendQ exceeded]
kyb3r_ has quit [Read error: Connection reset by peer]
clauswitt has joined #ruby-lang
clauswitt has quit [Max SendQ exceeded]
allomov has quit [Remote host closed the connection]
clauswitt has joined #ruby-lang
allomov has joined #ruby-lang
pr0ton_ has quit [Quit: pr0ton_]
AKASkip has joined #ruby-lang
allomov has quit [Remote host closed the connection]
mark_slight has joined #ruby-lang
GBrawl has joined #ruby-lang
allomov has joined #ruby-lang
kaczmar has joined #ruby-lang
clauswit_ has joined #ruby-lang
clauswitt has quit [Ping timeout: 250 seconds]
GBrawl has quit [Quit: (null)]
snovity has joined #ruby-lang
michd is now known as MichD
RitterJack has quit [Ping timeout: 255 seconds]
face has joined #ruby-lang
faces has quit [Ping timeout: 256 seconds]
yfeldblum has quit [Remote host closed the connection]
dangerousdave has joined #ruby-lang
<yorickpeterse>
morning
GBrawl has joined #ruby-lang
tbuehlmann has joined #ruby-lang
GBrawl has quit [Client Quit]
RitterJack has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rahul_j has quit [Quit: rahul_j]
rahul_j has joined #ruby-lang
marr has joined #ruby-lang
mark_slight has quit [Read error: No route to host]
kaczmar has quit [Quit: kaczmar]
yfeldblu_ has joined #ruby-lang
alvadorn has joined #ruby-lang
vuwon has joined #ruby-lang
alvadorn has quit [Client Quit]
vuwon has quit [Client Quit]
yfeldblu_ has quit [Ping timeout: 255 seconds]
arBmind1 has quit [Quit: Leaving.]
workmad3 has joined #ruby-lang
amsha has joined #ruby-lang
mikecmpbll has joined #ruby-lang
amsha has quit [Ping timeout: 256 seconds]
skade has joined #ruby-lang
kaczmar has joined #ruby-lang
jmrepetti has quit [Remote host closed the connection]
arBmind has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
jmrepetti has joined #ruby-lang
stamina has joined #ruby-lang
allomov has quit [Remote host closed the connection]
banister has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
rahul_j has joined #ruby-lang
tkuchiki has quit [Ping timeout: 255 seconds]
muskalek has quit [Ping timeout: 244 seconds]
<ljarvis>
moin
siwica1 has joined #ruby-lang
siwica has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby-lang
ldnunes has joined #ruby-lang
yfeldblum has quit [Ping timeout: 258 seconds]
muskalek has joined #ruby-lang
allomov has joined #ruby-lang
<yorickpeterse>
"hm why does this thing not start on rbx"
<yorickpeterse>
"RELEASE_RUBY_VERSION: ruby-2.1"
<yorickpeterse>
durrr Mondays
caseydriscoll has joined #ruby-lang
<ljarvis>
durrrr everyday*
<ljarvis>
i received an excel spreadsheet for a certification process, and the mac client doesn't support macros so it's broken #macproblems
jds has joined #ruby-lang
<yorickpeterse>
well you already failed the certification it seems
<workmad3>
ljarvis: is it a certification process for something mac-based? :)
<ljarvis>
no :)
ledestin has quit [Ping timeout: 245 seconds]
<workmad3>
ljarvis: no excuse then... boot up your favourite malware-OS and run it properly! :P
<yorickpeterse>
"Re: Certified Windows Developer Training"
<ljarvis>
aye :(
<yorickpeterse>
"Body: I'm on a Mac"
<ljarvis>
I don't have anything to run windows either
<ljarvis>
so maybe I just tell them I'll forward everything in text files
<workmad3>
ljarvis: you have a mac, which should be capable of running virtualbox? :P
mamantoha has quit [Ping timeout: 260 seconds]
<ljarvis>
I guess, i'm already tired of just thinking about what I'll need to go to get up and running just to open a file
<workmad3>
:)
<yorickpeterse>
ljarvis: well you need to double click, then clap your hands, then update your anti-virus software
<yorickpeterse>
Then you need to reboot because Windows Update tells you to
<yorickpeterse>
well what teh fuck is this, this one app is running without any errors so far
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
[spoiler] has joined #ruby-lang
yfeldblum has quit [Ping timeout: 258 seconds]
dangerousdave has joined #ruby-lang
dangerousdave has quit [Client Quit]
sepp2k has joined #ruby-lang
amsha has joined #ruby-lang
lele|w has joined #ruby-lang
chouhoulis has joined #ruby-lang
amsha has quit [Ping timeout: 250 seconds]
chouhoul_ has joined #ruby-lang
jonuts has joined #ruby-lang
chouhoulis has quit [Ping timeout: 260 seconds]
crankharder has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 1.0.1]
<maloik>
long shot, but does anyone happen to know if it's possible to make kramdown turn codeblocks (using ```) into <code><pre></pre></code> instead of just the code element?
<maloik>
standard bootstrap markup requires the pre element for proper formatting
momomomomo has joined #ruby-lang
<apeiros>
you could post-process it with nokogiri
<yorickpeterse>
maloik: you can extend the parser
<yorickpeterse>
Also, Kramdown already does that
<yorickpeterse>
at least when you use CodeRay by the looks of it
<darix>
maloik: how about just setting up <code> to render it in a way you want?
<yorickpeterse>
you get something like .CodeRay -> .code pre code
jmrepetti has joined #ruby-lang
<maloik>
darix: that's pretty much my question :P
<maloik>
oh you mean the css?
<darix>
yes css
<maloik>
mostly because of maintainability
<maloik>
I don't want to touch the css unless I REALLY have to
<darix>
you can just overwrite it locally
<darix>
code { display: block; }
<darix>
should do it
<maloik>
what? that makes no sense :) that's not the problem at all
<darix>
what is?
dwknoxy has joined #ruby-lang
<maloik>
bootstrap (and our custom "theme" for it) applies styles to both code and pre elements, and in this case I want pre inside of the code element when turning the markdown file into html
<haxxtivist>
Anyone wanna help me with installing rails on arch?
<centrx>
gem install rails
<haxxtivist>
Didn't seem to work.
<haxxtivist>
:(
<haxxtivist>
Trying to install from AUR now, but I'm in an infinite loop of pressing y lol
<centrx>
What didn't work with gem install
<centrx>
is there an error message
<haxxtivist>
It said it installed successfully
<haxxtivist>
added it to the PATH
<haxxtivist>
then says rails isn't a command
<centrx>
oh you may want to use bundler
<haxxtivist>
?
<centrx>
but that is odd, it should be there
<haxxtivist>
hm.
<haxxtivist>
I exited the infinite loop of bullcrap
<haxxtivist>
and tried again
<haxxtivist>
rails worked
<haxxtivist>
but on doing rails new blahblah
<haxxtivist>
got this
<haxxtivist>
Your user account isn't allowed to install to the system Rubygems.
<haxxtivist>
You can cancel this installation and run:
<haxxtivist>
bundle install --path vendor/bundle
<haxxtivist>
to install the gems into ./vendor/bundle/, or you can enter your password
<haxxtivist>
and install the bundled gems to Rubygems using sudo.
<bougyman>
that aur package is crap
<bougyman>
dont' do it that way.
<haxxtivist>
I installed like 20 things, and gave up. What do now?
<bougyman>
you gave up? Take a nap, now, then.
<haxxtivist>
Gave up on the AUR package*
<haxxtivist>
I was sitting here for 20 minutes pressing y, it was just reinstalling packages over and over.
momomomomo has quit [Ping timeout: 264 seconds]
<bougyman>
it probably got bundler installed, at least.
<bougyman>
so you could gem install rails
<bougyman>
sudo gem install rails for system-wide.
momomomomo has joined #ruby-lang
<haxxtivist>
cool, cool. Thanks a bunch.
jmrepetti has quit [Remote host closed the connection]
wm3|busy has quit [Ping timeout: 250 seconds]
skade has quit [Quit: Computer has gone to sleep.]
bantic has quit [Quit: bantic]
wallerdev has joined #ruby-lang
muskalek has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malconis has joined #ruby-lang
<haxxtivist>
Ugh. "Could not find a JavaScript runtime"
<haxxtivist>
D;
<haxxtivist>
What do?
malconis has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
<jhass>
pacman -S nodejs
malconis has joined #ruby-lang
yfeldblum has joined #ruby-lang
banister has quit [Ping timeout: 250 seconds]
<haxxtivist>
That evidently doesn't exist anymore. 404 at all mirrors. D:
<haxxtivist>
Nevermind, finally found it.
<haxxtivist>
Thanks, again.
hahuang61 has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby-lang
postmodern has joined #ruby-lang
jmrepetti has joined #ruby-lang
chinmay_dd has quit [Quit: Leaving]
postmodern has quit [Ping timeout: 265 seconds]
momomomomo has quit [Ping timeout: 250 seconds]
thagomizer has joined #ruby-lang
sunaku has joined #ruby-lang
RobertBirnie has joined #ruby-lang
allomov_ has quit [Remote host closed the connection]
<haxxtivist>
Shoot.
<haxxtivist>
Undefined method attr accessible?
<haxxtivist>
Why isn't that working?
kaczmar has joined #ruby-lang
<nofxx>
haxxtivist, missing an underline?
<haxxtivist>
nofxx, I tried both ways, same error.
<nofxx>
haxxtivist, accessor
<nofxx>
reader/writer/accessor
<haxxtivist>
?
<nofxx>
attr_accessor not accessible
<jhass>
haxxtivist: are you following a Rails 3 tutorial in a Rails 4 app (btw. #RubyOnRails for rails talk)?
Xney2 is now known as Xney
<nofxx>
haxxtivist, ahhh...rails mass assignment protection. Moved to controllers!
<haxxtivist>
Sorry about the wrong irc channel, jhass. Also, yes I am lol.
<haxxtivist>
but changing that actually did work, nofxx
<nofxx>
haxxtivist, not the same thing man
<nofxx>
haxxtivist, get a ruby tut first, one afternoon you get the basics
<haxxtivist>
It gave the desired output :S
<jhass>
get a rails 4 tutorial
<haxxtivist>
I've done several basics tutorials. No tutorials go past basic usage of any given language.
<haxxtivist>
:(
<nofxx>
for that use a book, the pickaxe has nice examples
<jhass>
guides.rubyonrails.org is not too bad actually
<haxxtivist>
gah. All of this is confusing.
<haxxtivist>
I go one place, they say dive right into a project and learn. I go another place, they say start with basics tutorials.
<haxxtivist>
What do, what do.
justinmburrous has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
<nofxx>
haxxtivist, no excuses man, attr_* helpers are ruby basics you should know ;)
djbkd has quit [Remote host closed the connection]
<haxxtivist>
Real quick, for my purposes here, what is the difference between attr_accessible and attr_accessor? Because switching those made the method work.
arBmind1 has quit [Quit: Leaving.]
<jhass>
attr_accessible is an old rails ism that was removed in rails 4
<jhass>
attr_accessor is a shortcut to define methods that read and set an instance variable
<jhass>
which ActiveRecord already does for all your columns, without any of the two
<haxxtivist>
Ah. I'm doing a tutorial on creating a blog with rails. The method was used for posting, defining title and content.
djbkd has joined #ruby-lang
<jhass>
seriously
<jhass>
get a rails 4 tutorial
<haxxtivist>
Any suggestions on a good one to begin with?
apeiros has joined #ruby-lang
<Sunlorhic>
attr_accessible was used to allow an attribute to be set with mass assignment
<cout>
it is interesting that initialize_copy calls @table.dup, even though I was copying with #clone (so @table's singleton methods don't get copied.. but I don't think that's a problem)
diegoviola has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
yfeldblum has quit [Ping timeout: 265 seconds]
oleo is now known as Guest55827
Guest55827 has quit [Ping timeout: 250 seconds]
oleo__ has quit [Read error: Connection reset by peer]
Miphix has quit [Read error: Connection reset by peer]
Miphix has joined #ruby-lang
persand has quit [Quit: persand]
chinmay_dd has quit [Quit: Leaving]
doosy has joined #ruby-lang
Antiarc has quit [Read error: Connection reset by peer]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
doosy has quit [Remote host closed the connection]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
<zenspider>
cout: you live. how goes? it's been a long time
banister has quit [Client Quit]
jmrepetti has quit [Remote host closed the connection]
oleo__ has joined #ruby-lang
allomov has joined #ruby-lang
doosy has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
miqui has quit [Remote host closed the connection]
dagda1 has joined #ruby-lang
benlovell has joined #ruby-lang
amsi has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
|jemc| has joined #ruby-lang
mistym has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
benlovell has quit [Ping timeout: 265 seconds]
oleo__ is now known as oleo
amsi has quit [Quit: Leaving]
wallerdev has quit [Client Quit]
wallerdev has joined #ruby-lang
loincloth has quit [Read error: Connection reset by peer]
loincloth has joined #ruby-lang
emmesswhy has quit [Quit: emmesswhy]
malconis has quit [Write error: Broken pipe]
__butch__ has quit [Quit: Leaving.]
malconis_ has joined #ruby-lang
emmesswhy has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 1.0.1]
<cout>
zenspider: I do live
<cout>
zenspider: dropped out of school to go back into programming again
|jemc| has joined #ruby-lang
postmodern has quit [Ping timeout: 264 seconds]
<haxxtivist>
Is it better to use obj.nil? or obj==nil andwhy?
doosy has quit [Remote host closed the connection]
<cout>
zenspider: kept failing tests due to health issues and racing addiction and being old
ledestin_ has joined #ruby-lang
dacamp has joined #ruby-lang
postmodern has joined #ruby-lang
<ljarvis>
haxxtivist: use !obj unless you really care if it's exactly nil
<dacamp>
Anyone have a suggestion on using RDoc to gather all flags with ':feature:'? I'm trying to create a single page with links to all new features.
<zenspider>
cout: what were you studying?
arBmind has joined #ruby-lang
<zenspider>
drbrain: *ping* see dacamp
ledestin has quit [Ping timeout: 296 seconds]
SuMo_D has joined #ruby-lang
twe4ked has quit [Ping timeout: 244 seconds]
<cout>
zenspider: was doing pre-med
<zenspider>
oh damn. yeah. that's a bitch.
SuMo_D_ has joined #ruby-lang
<cout>
zenspider: applied and got turned down. I think I would have gotten in if I kept trying, but it wasn't worth the cost.
<zenspider>
my dad was an md
<haxxtivist>
So I'm doing the Koans
<haxxtivist>
assert_equal __, 1.5.is_a?(Object)
<haxxtivist>
Does this REALLY just want me to say the same thing as is on the right?
<cout>
zenspider: but at least now I can understand what these daggum wikipedia articles about various drugs are saying
<zenspider>
haxxtivist: no
ledestin_ has quit [Ping timeout: 250 seconds]
<zenspider>
haxxtivist: think about what is_a? would return in that case, and put than in ___
<zenspider>
and I _do_ mean think. don't just put it in irb
<zenspider>
koans are for contemplating
<haxxtivist>
I would say it returns true, if everything is an object.
SuMo_D_ has quit [Remote host closed the connection]
<haxxtivist>
yeah?
ledestin has joined #ruby-lang
<haxxtivist>
Would it be true then, zenspider?
<zenspider>
put it in and try it
<haxxtivist>
Oops, sorry. I did. It worked.
twe4ked has joined #ruby-lang
<haxxtivist>
I feel like those aren't the only things that would work there, though?
<zenspider>
awesome
<zenspider>
assert_equal is there to ensure the result is equal to the expected
SuMo_D has quit [Ping timeout: 272 seconds]
<haxxtivist>
Ahh. That makes much more sense. Thank you. I may be on here blabbing on about other koans I don't understand.
doosy has joined #ruby-lang
<zenspider>
that's what we're here for. just think about it and come to us when you're confused
toretore has quit [Quit: This computer has gone to sleep]
fusillicode1 has quit [Ping timeout: 255 seconds]
<yorickpeterse>
haxxtivist: nobody here minds people asking questions/talking a lot
<dacamp>
drbrain: does RDoc have its own channel? Google says no, wanted to confirm.
<yorickpeterse>
unless it's me ranting about things
M3M0CooL has quit []
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
doosy_ has joined #ruby-lang
mistym has joined #ruby-lang
onkara has quit [Quit: onkara]
Onk has quit [Remote host closed the connection]
onkara has joined #ruby-lang
emmesswhy has quit [Quit: Leaving]
doosy has quit [Ping timeout: 258 seconds]
<yorickpeterse>
oh sweet, Baruco videos are finally all online
<yorickpeterse>
now I can enjoy myself sucking at presentations on Linux
<yorickpeterse>
hihi
<yorickpeterse>
dang it, they cut the part where I made a "year of the desktop" joke
yfeldblu_ has quit [Remote host closed the connection]
havenwood has quit []
doosy_ has quit [Remote host closed the connection]
whippythellama has joined #ruby-lang
yfeldblum has joined #ruby-lang
_djbkd has joined #ruby-lang
_djbkd has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby-lang
sunaku has quit [Quit: WeeChat 1.0.1]
sunaku has joined #ruby-lang
<haxxtivist>
What does the .inspect method do?
djbkd has quit [Ping timeout: 256 seconds]
<|jemc|>
haxxtivist: returns a more detailed string version of the object than "puts"
<yorickpeterse>
haxxtivist: it basically converts an object to a "pretty formatted" string
<|jemc|>
haxxtivist: better yet, type "gem install pry", then "pry" for a more feature-rich interactive prompt
<zenspider>
then type: puts "blah\n".inspect
<zenspider>
|jemc|: don't confound things
<zenspider>
the guy doesn't know to_s vs inspect. baby steps
<yorickpeterse>
pry is way too heavy for beginners
<haxxtivist>
Used irb to try and test, and it reports that assert_equal isn't a method.
GBrawl has quit [Quit: (null)]
<|jemc|>
I disagree - pry's extra features and niceties make it more approachable for beginners
<yorickpeterse>
haxxtivist: correct, assert_equal isn't available by default
<haxxtivist>
Eff approachable, I wanna learn the barebones of things, and then get fancy with it. In that order.
<zenspider>
haxxtivist: assert_equal isn't loaded in that context
<zenspider>
|jemc|: working out of the box > explaining gems + pathing + all sorts of shit.
<zenspider>
haxxtivist: don't use irb to work on koans directly. use it to ask questions you come up with on your own: "I wonder if X" type things
futilegames has quit [Quit: futilegames]
<haxxtivist>
Hm. Alright. Help me understand this real quick. Why does nil.inspect == "nil", but nil.to_s !="nil"
<haxxtivist>
?
<zenspider>
many of those types of questions are gonna be answered with: because
<zenspider>
or: that's what matz wanted
<yorickpeterse>
to_s just converts it to a string meant for computers basically
<yorickpeterse>
while inspect is meant for humans
<zenspider>
nil is an object that represents nothing. to_s => "" makes sense in that regard
<yorickpeterse>
say you have some kind of variable, like so:
<yorickpeterse>
number = nil
<zenspider>
but for debugging, you want to see that it is nil, and not an actual empty string
<yorickpeterse>
and somewhere in your code you want to see what `number` is while debugging
<yorickpeterse>
If you just get an empty string that's not very useful
<yorickpeterse>
heh, zenspider beat me to it
<haxxtivist>
Right. That makes a lot more sense. Thanks guys.
<zenspider>
you'll get it. it takes time
<haxxtivist>
Inspect = strings for nerds.
havenwood has joined #ruby-lang
lcdhoffman has joined #ruby-lang
<haxxtivist>
There's so many predefined keywords in ruby lol. It's confusing, coming from C++ where you have to make everything before making anything else.
<yorickpeterse>
actually the amount of keywords is lower than in C++
<haxxtivist>
useful keywords*
<|jemc|>
haxxtivist: note that to_s and inspect are not keywords
<|jemc|>
they're only methods called on the object
mistym has quit [Remote host closed the connection]
GBrawl has joined #ruby-lang
<haxxtivist>
I had moved on, I know that
<haxxtivist>
Was talking about Fixnum.
<|jemc|>
well, Fixnum is also not a keyword - it's a constant :)
<yorickpeterse>
haxxtivist: there are very few _actual_ keywords in Ruby
<haxxtivist>
Well eff me and my poor word choice, man.
<haxxtivist>
lol
<yorickpeterse>
e.g. "def" and "class" are keywords
<cout>
and even the keywords that ruby has can be used as regular identifiers in certain contexts
<cout>
e.g. you can have a method named 'if' and ruby doesn't complain
djbkd has quit [Remote host closed the connection]
vlad_starkov has quit [Client Quit]
vlad_starkov has joined #ruby-lang
g0bl1n has quit [Ping timeout: 265 seconds]
|jemc| has left #ruby-lang ["WeeChat 1.0.1"]
sarkyniin has quit [Quit: Quitte]
Thecrazylumberja has joined #ruby-lang
spuk has quit [Read error: Connection reset by peer]
symm- has quit [Ping timeout: 250 seconds]
amsi has joined #ruby-lang
mistym has joined #ruby-lang
supergeek has joined #ruby-lang
supergeek has quit [Max SendQ exceeded]
supergeek has joined #ruby-lang
spuk has joined #ruby-lang
supergeek has quit [Max SendQ exceeded]
solars has quit [Ping timeout: 245 seconds]
godd2 has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
GBrawl has quit [Quit: (null)]
charliesome has joined #ruby-lang
AKASkip has quit [Ping timeout: 260 seconds]
<jxpx777>
Silly Ruby question: is there a simple way to check an array for elements matching some condition but if none do fall back to a second condition? If possible I'd like to avoid iterating over the entire array multiple times.
<apeiros>
how would it know before iterating over all that none matches?
<apeiros>
but to answer it: no, there's no pre-made method which does that
postmodern has quit [Ping timeout: 260 seconds]
bantic has quit [Quit: bantic]
djbkd has joined #ruby-lang
charliesome has quit [Quit: zzz]
duderonomy has quit [Ping timeout: 272 seconds]
<ledestin>
jxpx777: choose between iterating twice or spending extra time for second check right away
<bnagy>
jxpx777: each over it and fill two result arrays for cond1 and cond2
<godd2>
well still, there -is- a method that does it in one pass
<apeiros>
godd2: yes. each.
loincloth has quit [Remote host closed the connection]
<apeiros>
godd2: by that logic, that is.
djbkd has quit [Ping timeout: 244 seconds]
<apeiros>
yes, you can build something which does that. inject does not directly do what he wants. you need to code it up. you can do that in a dozen ways.
<godd2>
fair enough. also, "inject abuse" and "inject abuse programming" just give me drug results on teh google
<apeiros>
lol
<apeiros>
dang :)
<apeiros>
just means either your google search result personalization says something bad about you, or isn't up to speed yet ;-p
<bnagy>
oh wait if you just want to check for _any_ then you can each with an early break for cond1 and a flag for cond2
<apeiros>
(and yes, google search result personalization is a thing - I remember yelling at somebody for failing to click the first link in the results for a given term - just to learn that it was the first result only for me. with a pristine browser it was like result #30)
slawrence00 has joined #ruby-lang
<womble>
duckduckgo's first page of results for "inject abuse" is all drugs
<womble>
ruby inject abuse seems more relevant.
<bnagy>
yeah I just get a bunch of visited links foe methadone suppliers
nathanstitt has quit [Quit: I growing sleepy]
<jxpx777>
Here's what I ended up coming up with: Dir.glob(File.join(profile_home, "*.{default,devmode}*")).each { |p| break [p] if p.to_s =~ /devmode/i }[0]
<jxpx777>
Basically, I want the devmode profile if it's available. Otherwise, default
kaczmar has quit [Quit: kaczmar]
<ericwood>
I prefer reduce to inject
<ericwood>
makes more sense to me mentally...it's a many --> one operation
<womble>
And as a bonus, "reduce abuse" has a nice rhyming quality
<havenwood>
reduce reduce abuse
<jxpx777>
reduce would definitely technically allow me to do what I want but it feels super wrong as a "find-y" method
<ericwood>
I'm only in it for the alliteration
<ericwood>
reduce is an alias of inject
<jxpx777>
yah, I know reduce/inject
<jxpx777>
:)
<ericwood>
if you chain the two together I'll hurt you
<jxpx777>
Any thoughts on the oneliner I came up with? Feels almost too clever…
<jxpx777>
(My actual glob is on a separate line)
<zenspider>
godd2: why in the fuck would you use reduce in that example?
cmhobbs has quit [Remote host closed the connection]
<bnagy>
jxpx777: tbh I think inject would be kinda readable for that :)
<bnagy>
early break is always a bit smelly
<godd2>
zenspider cause he wanted to filter with a default
<zenspider>
that's _horrible_
<godd2>
Why?
<bnagy>
jxpx777: imho IRL I would just write it as an if find?
<godd2>
(honest question, I'd like to understand why it's bad)
<jhass>
jxpx777: I'm obvisouly missing something, why is this not .find {|path| path.include? 'devmode' } ?
<jhass>
where's the second condition?
<jxpx777>
well, the second condition is in the globbing. devmode vs default
<bnagy>
the first default glob is the second conditionb
<bnagy>
but you can easily extract that before you start
<jhass>
so just .find
<bnagy>
^^
nertzy has joined #ruby-lang
<zenspider>
"but if none do fall back to a second condition? If possible I'd like to avoid iterating over the entire array multiple times."
<zenspider>
how does that make sense?
benlovell has joined #ruby-lang
<zenspider>
you want to apply a second condition AFTER figuring out that nothing satisfies the first condition, but you want to do it WITHOUT going over the collection again?
<bnagy>
jxpx777: imho, always prefer readable over 'fast' for anything that's not scicomp
RitterJack has quit [Remote host closed the connection]
<zenspider>
not just readable... UNDERSTANDABLE
<jxpx777>
OK, I just discovered the ifnone argument for find, so I think this is better: profiles.find(profiles.first) { |profile| profile.include?('devmode') }
<bnagy>
jxpx777: still wouldn't use it
<jxpx777>
? what's wrong with that version?
<zenspider>
doesn't second condition imply testing the contents again?
<bnagy>
less readable than if profiles.find blah
<bnagy>
or profiles.find blah || default
<zenspider>
I prefer: profiles.find { ... } || profiles.first
<haxxtivist>
Is the entirety of the koans just asserts?
<zenspider>
haxxtivist: pretty much, iirc
<jhass>
haxxtivist: pretty much, later some game implementations iirc
<zenspider>
it's just a framework for you to work out the koans in
<zenspider>
provides structure
<jxpx777>
bnagy, zenspider: those are just the same as the ifnone argument right? Just a little more verbose but functionally no different?
<bnagy>
right. I can't really explain why profiles.find {blah} || default is the most idiomatic, but imho it is
<bnagy>
guess it's just based on reading lots of ruby
<jhass>
jxpx777: note that ifnone wants a callable like a lambda
malconis_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider>
and it SAYS what it is doing clearly
<zenspider>
find or fall back to X
<godd2>
zenspider Okay then I'll admit that it wasn't the best solution to the problem at hand, but it was more a counter to the claim that there was no such method he could use.
<jxpx777>
zenspider: good point. thanks
benlovell has quit [Ping timeout: 250 seconds]
malconis has joined #ruby-lang
malconis has quit [Client Quit]
<zenspider>
oh shit. I didn't realize that the ifnone was a callable