mary5030 has quit [Remote host closed the connection]
specious has quit [Ping timeout: 272 seconds]
predator217 has joined #ruby
mary5030 has joined #ruby
kirun has quit [Quit: Client exiting]
pskosinski has joined #ruby
<b00stfr3ak>
exit
b00stfr3ak has quit [Quit: leaving]
predator117 has quit [Ping timeout: 260 seconds]
Geniack has quit [Disconnected by services]
Geniack_ has joined #ruby
go|dfish has quit [Quit: SIGQUIT]
mary5030 has quit [Read error: Connection reset by peer]
Duckily has joined #ruby
Iszak_ has joined #ruby
mary5030 has joined #ruby
retrofade has quit [Ping timeout: 245 seconds]
spider-mario has quit [Read error: Connection reset by peer]
Iszak has quit [Ping timeout: 246 seconds]
<Hanmac1>
shevy: i am building the newest trunk again
Duckily has quit [Read error: Connection reset by peer]
Megtastique has quit []
<shevy>
ddd yeah look at what Hanmac1 is doing
<shevy>
2.1 is already out and he can't wait for 2.2
<shevy>
:}
<ddd>
hehe
Hanmac1 is now known as Hanmac
<Hanmac>
thats a reason why i want a Time maschine ... so i can get even newer versions ;D
juarlex has quit [Remote host closed the connection]
Megtastique has joined #ruby
John445 has joined #ruby
<shevy>
isn't a time machine usually to go back in time
<shevy>
rather than ahead into the future
<shevy>
or do you mean the "back to the future" ones
thumpba has joined #ruby
<John445>
time machine |taɪm məˈʃin|
<John445>
noun
<John445>
(in science fiction) a machine capable of transporting a person backward or forward in time.
<John445>
Anyone use GitHub Issues to track their time on a project?
juarlex has joined #ruby
vikhyat has joined #ruby
mary5030_ has joined #ruby
<John445>
Or git Commits
mary5030 has quit [Read error: Connection reset by peer]
<Hanmac>
shevy i would take newest ruby versions from the future and "port them back" into the past ;D
vikhyat_ has quit [Ping timeout: 260 seconds]
colonolGron has joined #ruby
l3ck has joined #ruby
l3ck has quit [Client Quit]
John445 has quit [Client Quit]
snath has quit [Ping timeout: 260 seconds]
klaut has quit [Remote host closed the connection]
tjaco has joined #ruby
matchaw has quit [Ping timeout: 272 seconds]
drumusician has quit [Ping timeout: 252 seconds]
yokel has quit [Quit: leaving]
thumpba has quit [Ping timeout: 245 seconds]
yokel has joined #ruby
mixonic has quit [Quit: *zonk*]
vikhyat has quit [Ping timeout: 272 seconds]
stryek has quit [Quit: Leaving]
dscrd has quit [Read error: Connection reset by peer]
dscrd has joined #ruby
CpuID has quit [Quit: This computer has gone to sleep]
go|dfish has joined #ruby
senayar has joined #ruby
rjhunter has joined #ruby
Mon_Ouie has quit [Ping timeout: 252 seconds]
figgleberry has joined #ruby
<Authenticator>
When I populate a large hash and fork, then add to the hash, does this CoW the entire hash? I've tried an experiment by forking 100 times vs forking 100 times AND overwriting a single hash key. It seems no slower which seems to indicate only the one key gets rewritten...?
IcyDragon is now known as IceDragon
vikhyat has joined #ruby
Hanmac1 has joined #ruby
threesome has quit [Ping timeout: 246 seconds]
Hanmac has quit [Ping timeout: 260 seconds]
sickweezle has left #ruby [#ruby]
Jetchisel has joined #ruby
tylersmith has quit [Remote host closed the connection]
flubba has joined #ruby
CpuID has joined #ruby
CpuID has joined #ruby
CpuID has quit [Changing host]
S0da has quit [Read error: Connection reset by peer]
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
heidi has quit [Quit: Leaving.]
CaptainJet has quit [Read error: Connection reset by peer]
blarghmatey_ has joined #ruby
specious has joined #ruby
<apeiros>
Authenticator: depends on the ruby version
<apeiros>
cow friendly GC was added in 2.0 afaik
CaptainJet has joined #ruby
<apeiros>
(forking is CoW generally, but ruby <= 1.9 had GC which interfered with that)
udon has joined #ruby
dylandog has joined #ruby
Kricir has joined #ruby
emocakes has joined #ruby
cow_ has joined #ruby
figgleberry has quit [Ping timeout: 252 seconds]
Notte has quit [Remote host closed the connection]
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
Kricir has quit [Ping timeout: 246 seconds]
heidi has joined #ruby
Kilobyte|StupidC is now known as Kilo`Byte
tjaco has quit [Ping timeout: 272 seconds]
RoryHughes has quit []
S0da has joined #ruby
vikhyat_ has joined #ruby
mikepack_ has joined #ruby
vikhyat has quit [Ping timeout: 272 seconds]
predator117 has joined #ruby
robustus has quit [Ping timeout: 252 seconds]
mr_red has quit [Ping timeout: 245 seconds]
mikepack has quit [Ping timeout: 252 seconds]
robustus has joined #ruby
vikhyat has joined #ruby
vikhyat_ has quit [Ping timeout: 252 seconds]
mikepack_ has quit [Ping timeout: 272 seconds]
specious has quit [Ping timeout: 272 seconds]
RoryHughes has joined #ruby
predator217 has quit [Ping timeout: 240 seconds]
senayar has quit []
specious has joined #ruby
jokke has joined #ruby
Mars` has joined #ruby
benzrf has joined #ruby
<benzrf>
so whats new in 3.1
CpuID has quit [Quit: This computer has gone to sleep]
<apeiros>
Nilium: I think just `a.zip(b).map { |x,y| x || y }` would have been sufficient
<Nilium>
Not if it were an array of booleans.
flubba has joined #ruby
<apeiros>
but benzrf's loss that he went away
<apeiros>
well, `x.nil? ? y : x` then instead of `x || y`
havenwood has quit [Remote host closed the connection]
tappi has joined #ruby
<apeiros>
still quite a bit shorter ;-)
<Nilium>
Could also work. Either way, too lazy to do that much thinking about an odd situation.
<apeiros>
his case is odd, though… hadn't read until there
<Nilium>
I'm trying to learn perl. Because I'm a masochist.
<apeiros>
you're happy then, I guess
* apeiros
actually liked perl, back in the day
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rjhunter has joined #ruby
jgrevich has quit [Quit: jgrevich]
<Nilium>
Also because I figure its Tk module is better maintained than any of the Ruby GUI gems.
udon has quit [Ping timeout: 246 seconds]
* Nilium
blames Rails.
<tappi>
opinions which is the most optimal resource to learn ruby for an already somewhat experienced programmer, including in other scripting languages (python)?
maletor has quit [Quit: Computer has gone to sleep.]
<Nilium>
Dunno, my idea of an optimal way of learning a language is to use it.
Neomex has quit [Client Quit]
flubba has quit [Read error: No buffer space available]
<Nilium>
I'm one of those people who doesn't read books to learn new languages because it's all the same after a while.
colonolGron has quit [Quit: leaving]
simplyaubs has quit [Quit: simplyaubs]
flubba has joined #ruby
dkamioka has quit [Ping timeout: 272 seconds]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
Hanmac1 has quit [Ping timeout: 245 seconds]
Hanmac has joined #ruby
lewix has joined #ruby
diegoviola has joined #ruby
deol has quit [Remote host closed the connection]
hunterr986 has joined #ruby
<tappi>
Nilium okay i'll just start throwing commands and the interpreter until something works
eka has quit [Quit: Computer has gone to sleep.]
<tappi>
and i'll infer the scoping rules by making extensive tests instead of just reading them
gr33n7007h has joined #ruby
<tappi>
not that i don't appreciate the help but i'll try to find a resource
<tappi>
i'm not looking to buying a book, i'm just trying to figure out which of the many tutorials is a succinct one
<ddd>
tryruby.com
<ddd>
iwanttolearnruby.com as well
<tappi>
(don't really have the same problem in python, python docs only have the one and one only tutorial which covers the whole language in a succint way)
<Nilium>
Well, scoping rules are kind of bog standard for the most part.
cow_ has quit [Remote host closed the connection]
<Jamo>
eloquent ruby - or ruby pickaxe (make sure that its a new version)
mojjojo has quit [Quit: mojjojo]
CaptainJet has quit [Read error: Connection reset by peer]
<Nilium>
That all aside, the language is pretty normal aside from its asinine love of elsif
<Nilium>
Oh, and the metaprogramming stuff, which you should probably get your addiction to out of the way early on so you don't discover it later
<tappi>
nilium you are not helping, your illusion that learning a language is possible without any reference is absurd
aryaching has joined #ruby
<ddd>
ehh while learning a language the metaprogramming is probbly *not* the thing to be learning
<ddd>
why? 1.8 is no longer supported and all the current versions use key: value
estebistec has joined #ruby
<Nilium>
Because then you can have non-symbols as keys.
<Jamo>
convention...
<ddd>
thats not an overarching reason to prefer it. use the old style when you *need* non-symbols
tylersmith has joined #ruby
Nahra has quit [Quit: leaving]
<tappi>
jamo is there a free version of that?
<ddd>
and current convention is to use the new style. those using the old style either have a hard time changing, or are using 1.8 as well as newer so write to be compatible. most don't need to be
<ddd>
just a point of order
<tappi>
i don't think i'll need a book, just a rudimentary tutorial that goes over the language under the assumption that the reader already knows how to program
Nahra has joined #ruby
<Nilium>
I disagree vigorously in place of actual argument because arguing the pros/cons of both while eating turkey is surprisingly hard
<ddd>
tappi: Programming Ruby should fit that
<tappi>
yeah, it looks fine
<tappi>
thanks
Kiba has joined #ruby
<Kiba>
hi folks
<tappi>
hum, 1.6 ruby?
<Jamo>
I think that you can find a pdf version via google...
brennanMKE has quit [Remote host closed the connection]
<deryl>
so now that we've established its not hard for people to get info on what someone is working on, how about stopping being cryptic and explain (complete with gist.github.com code pastes) what you're having troubles with and what you've tried so far
yacks has joined #ruby
<deryl>
for the others, multicraft php api picked it right up. now maybe we can move forward if he desires help
vlad_starkov has joined #ruby
<popl>
I'm glad it's not the Minecraft API. That thing is spooky.
<deryl>
heh
<pcfreak30>
So I think im doing to drop my idea I was attempting and keep it simple. I will post my ported code as I want to now how badly i wrote it.
juarlex has quit [Ping timeout: 272 seconds]
<pcfreak30>
As I have never written any real ruby code before :S
<popl>
So you want confirmation that you suck?
<popl>
Everyone sucks when they start.
juarlex has joined #ruby
<deryl>
or would you prefer folks show you how to improve?
<deryl>
your choice
vlad_starkov has quit [Remote host closed the connection]
ewnd9 has quit [Remote host closed the connection]
<pcfreak30>
popl: I want to be told what can be improved since I have no exp in the language vs 8 years in php
<deryl>
using a *real* situation in which to show you how to improve
Faris has quit [Ping timeout: 272 seconds]
<deryl>
this passive aggressive self deprecation isn't going to help a lot. just post what you got, what people can't fathomn what you're trying to do they'll ask questions. you explain, they;ll explain. everyone wins
phipes has quit [Remote host closed the connection]
flubba has quit [Remote host closed the connection]
zipper has quit [Quit: leaving]
echevemaster has quit [Remote host closed the connection]
Virtualize has joined #ruby
Virtualize has quit [Remote host closed the connection]
vinian has joined #ruby
havenwood has joined #ruby
Virtualize has joined #ruby
echevemaster has joined #ruby
reach has quit [Read error: Connection reset by peer]
Virtualize has quit [Client Quit]
mikepack has quit [Remote host closed the connection]
phipes has quit [Remote host closed the connection]
blarghmatey_ has quit [Ping timeout: 245 seconds]
radic has quit [Ping timeout: 260 seconds]
estebistec has quit [Remote host closed the connection]
radic has joined #ruby
gquental has quit [Ping timeout: 246 seconds]
braincrash has quit [Quit: bye bye]
grep_away is now known as grep_awesome
<deryl>
ok, so you have 3 variables that any instance of MultiCraftAPI will have, populated by whats passed in via the 3 variables the initializer takes. so now, reload your gist at https://gist.github.com/anonymous/26ca62f819f9ecdadd1e
<deryl>
Play with it online at the URL in the comment
braincrash has joined #ruby
tharindu has joined #ruby
Kricir has quit [Remote host closed the connection]
Barrin6 has joined #ruby
freerobby has quit [Quit: Leaving.]
flame_ has quit [Quit: Computer has gone to sleep.]
gquental has joined #ruby
<pcfreak30>
Is it better to access an array element by var[1] or var.at(1)?
<bnagy>
ary[idx]
<bnagy>
but it's often a bad sign
<pcfreak30>
why do you need def new?
flame_ has joined #ruby
<bnagy>
you almost never need def new
DrShoggoth has quit [Read error: Connection reset by peer]
<WJW>
pcfreak30, I see back there where you were talking about arguments as an array. So, inside the method, you just want the arguments that have been passed in?
BrixSat has joined #ruby
cow_ has quit [Remote host closed the connection]
<pcfreak30>
WJW, I am only porting a library
ewnd9 has quit [Ping timeout: 272 seconds]
<pcfreak30>
So im just copying its way of working to ruby
cow_ has joined #ruby
<pcfreak30>
If you look at the php code you will see in general how it works
nisstyre has quit [Quit: Leaving]
brennanMKE has quit [Ping timeout: 246 seconds]
MattStratton has joined #ruby
Kricir has joined #ruby
vikhyat_ has quit [Remote host closed the connection]
cow_ has quit [Read error: Connection reset by peer]
<pontiki>
is there a reason you're using method_missing to define a single method?
cow_ has joined #ruby
<pontiki>
as in, there are many more like it to come?
<pcfreak30>
pontiki: Please read the php code. I am only replicating a existing library
<pontiki>
no
Virtualize has quit [Quit: Leaving...]
<pontiki>
seriously, it's a simple question
<pcfreak30>
Yes, you can easily implement any API call
nanoyak has joined #ruby
<pcfreak30>
So it was made dynamic by the devs
cow_ has quit [Read error: Connection reset by peer]
MattStratton has quit [Client Quit]
cow_ has joined #ruby
flubba has joined #ruby
emocakes has quit [Quit: Leaving...]
grep_awesome is now known as grep_away
emocakes has joined #ruby
vikhyat has joined #ruby
devyn has quit [Read error: Connection reset by peer]
<WJW>
According to the docs I find, each_index only takes one parameter in the block.
vlad_starkov has quit [Read error: Connection reset by peer]
synergy has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
vikhyat has quit [Remote host closed the connection]
flubba has quit [Remote host closed the connection]
nanoyak has quit [Quit: Computer has gone to sleep.]
IceDragon has quit [Quit: Space~~~]
<WJW>
pcfreak30, what is the behavior you intend for method_missing for its success case?
gja has quit [Quit: This computer has gone to sleep]
Tarential has quit [Excess Flood]
Tarential has joined #ruby
Kricir has joined #ruby
<pcfreak30>
WJW, based on the php code
<pcfreak30>
i uses _call for reflecton
<pcfreak30>
so it compiles a post request and returns an array (php) of the json response
<WJW>
pcfreak30, I'm not very good at reading PHP.
tjaco has joined #ruby
<pcfreak30>
basically _call in php is when a method cant be found
<pcfreak30>
so method_missing is the equiv
<pcfreak30>
so it builds a post query, with the method as the api call name
<pcfreak30>
dynamically
Hanmac has joined #ruby
<WJW>
pcfreak30, in your implementation in Ruby, should method_missing return callargs or stuff them somewhere? It looks as though you just build them up and throw them away, unless I am missing something.
ewnd9 has joined #ruby
Hanmac1 has quit [Ping timeout: 245 seconds]
<pcfreak30>
WJW, woops. I forgot to add a call method run
Mars`_ has quit [Remote host closed the connection]
flubba has joined #ruby
vikhyat has joined #ruby
vikhyat has quit [Remote host closed the connection]
<WJW>
Line 59, what is the purpose?
<WJW>
Never mind that.
lyanchih has quit [Quit: lyanchih]
<pontiki>
pcfreak30: does it work?
vlad_starkov has joined #ruby
<WJW>
pcfreak30, lines 63..66 constitute an inelegant way to construct the concatenation of some strings, but anyway I guess the code is reasonable if what you want is what it does.
<pcfreak30>
pontiki: havent tested. im constructing a puppet fact to see.
<pcfreak30>
i mean function
<pontiki>
no unit tests?
<pontiki>
i shouldn't ask
<pontiki>
nm
<pcfreak30>
honestly
<pcfreak30>
ive never even messed with unit tests in any language
Kricir has quit [Remote host closed the connection]
<pcfreak30>
i know its bad, but im the only one who messed with my code mainly
<pcfreak30>
messes
<pcfreak30>
WJW, how can i do it a better way?
<WJW>
params.values.reduce("", &:+)
tjaco has quit [Ping timeout: 272 seconds]
<pcfreak30>
&:+?
Tearan has joined #ruby
<pcfreak30>
" &:+"?
Pixels has joined #ruby
<WJW>
Symbol "+" passed as the block.
<pcfreak30>
and symbol + is something?
<WJW>
params.values.reduce(""){|a, b| a + b}
<WJW>
+ is the string concatenation operator.
specious has joined #ruby
<WJW>
A good way to test this code might be to make it print what it is about to send.
<pcfreak30>
um
<pcfreak30>
how can I sort or get the highest number in an array
<pontiki>
that p.much works if the elements are all comparable
<pontiki>
but not if they aren't
<WJW>
I don't see that it would make sense to look for the max or the sort of elephants that can't be compared to one another for less than, greater than, or equal.
falood has quit [Remote host closed the connection]
slick- has quit [Quit: leaving]
<pontiki>
that assumes you know ahead of time that all the keys of a hash being passed in will be comparable, no?
<WJW>
Yes.
<pontiki>
if it's something that's inside of a method of a class, you shouldn't really assume that
<WJW>
Check the usage instructions for their library.
<pcfreak30>
not sure if there ARE any for this
<WJW>
They may be making an assumption about what directory you will be in when you start the ruby interpreter.
<WJW>
or at least where their code will be relative to the directory you will be in.
Tearan has quit []
nari has quit [Ping timeout: 245 seconds]
anshin has quit [Quit: sleep]
vlad_starkov has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
falood has quit [Remote host closed the connection]
Wolland has joined #ruby
h0rrorvacui has quit [Quit: Leaving]
dima_ has quit [Remote host closed the connection]
brennanMKE has quit [Ping timeout: 252 seconds]
<pcfreak30>
WJW, so do you think I did will on that code for a beginner?
<pcfreak30>
well
Kricir has quit [Remote host closed the connection]
<WJW>
Yes.
<pcfreak30>
Any other improvements that you can see?
Jetchisel has left #ruby ["Unfortunately time is always against us -- *Morpheus*"]
<WJW>
I think your next reasonable step is just to see whether it does what you want.
vikhyat has joined #ruby
<WJW>
If it were my project, I might be concerned about the fact that it's a blocking call.
<pcfreak30>
blocing call?
<pcfreak30>
you my syn vs async
<pcfreak30>
sync vs async
<WJW>
Yes.
Tearan has joined #ruby
<WJW>
But that could mean a major design change.
<pcfreak30>
in this case its good to be blocking as the value thats fetched is used in a erb template
<WJW>
Maybe your solution is adequate for your problem and class of user.
<pcfreak30>
basically im trying to write an intelligent autosetup
deryl has joined #ruby
<WJW>
So you are using some kind of Ruby <-> ERB bridge.
<pcfreak30>
that can feth and id for a node
sayan has joined #ruby
<pcfreak30>
nope
<WJW>
Oops, I confused ERB for Erlang; don't know why.
<pcfreak30>
puppets template function
<pcfreak30>
they have it already :)
<WJW>
ERB is embedded Ruby in HTML.
<pcfreak30>
So pass parms to resoircer, fetch data from api, pass to template
<pcfreak30>
save to filesystem, run service
guest456_ has joined #ruby
Bumptious has joined #ruby
<guest456_>
hello
<pipecloud>
WJW: No, ERB is Embedded Ruby in anything.
sayan has quit [Excess Flood]
<WJW>
If your users can tolerate synchronous behavior, then it will be adequate for your purpose.
<pcfreak30>
WJW, in this case theres no user base
<WJW>
Hello, guest456.
sayan has joined #ruby
<pcfreak30>
its used soley for server provisioning/automation
<guest456_>
is anyone here willing to tutor me in ruby for pay
<guest456_>
via paypal trasfers
<WJW>
I live in the DC area.
<pcfreak30>
um I wouldnt do so.
<pcfreak30>
Not paypal
hogeo has quit [Remote host closed the connection]
<pcfreak30>
Based on my exp thats just a big no, no.
<deryl>
definitely not paypal. buyer says they didn't get what they paid for, even though you taught them, and bam, they file a complaint and *your* paypal account gets screwed up. paypal will back the buyer.
<deryl>
not a chance
<WJW>
guest456_, are you interested in Rails, or rather some other use of Ruby?
<guest456_>
i just want to learn how to make this from scratch
<pcfreak30>
a cool payment method would be bitcoins :S
<deryl>
like make a single Project Management app. handles only a single project. Then do another iteration to make it handle multiple projects. (Do the single first so you see how everything fits together. You'll understand how a single works, and then you can morph to handle multiple)
<guest456_>
i really want to make it in ruby tho
<pcfreak30>
Wel
<pcfreak30>
the backend would be ruby
<pcfreak30>
the UI would be likely jquery
<pcfreak30>
and a UI framework
<guest456_>
ahh
<pcfreak30>
you have a lot of components to learn
<pcfreak30>
and it is a long road....
<deryl>
either way when you hit the web you're going to be using more than a single language or a single component
<WJW>
guest456_, would you be satisfied with playing with your code using IRV (Ruby's REPL)?
<guest456_>
i havent even considered the frontend yet since i hate css .... i always use bootstrap for anything ive done up until now
<deryl>
its going to take learning multiple disciplines and multiple langauges
<WJW>
I mean IRB?
<pcfreak30>
haha, i dont mind css
<guest456_>
IRV?
<WJW>
I mean IRB.
<pcfreak30>
im just strictly a developer
<deryl>
if you want to learn ruby, work through the free ruby books and places like iwanttolearnruby.com
<guest456_>
yea
<deryl>
then move on to something more advanced
<pcfreak30>
just google ruby 101
<guest456_>
i mainly just make a test file and run it
<pcfreak30>
fiest 50 pages == free help
<pcfreak30>
:P
<WJW>
guest456_, what programming languages do you already know?
<deryl>
also try out rubykoans.com (or is it org?)
<WJW>
I have voting systems on the brain, so I said IRV, which is Instant Runoff Voting (which sucks).
<guest456_>
thing is i always do ruby tutorials and then i go to fresh code something and i blankly stare realizing ive actually learned nothing
<WJW>
guest456_, what do you know already about software design?
<deryl>
not that you've learned nothing, that you've got no idea of something to build from scratch on your own
<deryl>
two definitely different things
<guest456_>
like codeacademy teaches individual parts but when it comes to writing fresh code you have 0% clue as to where to start
<WJW>
guest456_, what is your education?
<guest456_>
its frusturating thaats why im staying fixated on seeing this project strart to finish even if i have to stare at this code for 3 months
<WJW>
i mean with respect to programming or software or systems.
<deryl>
guest456_, ok, try this. Take something in your house. Do you collect baseball cards, DVDs, music CDs, games?
<pcfreak30>
um
<guest456_>
graduating w/ economics degree in may
<pcfreak30>
that will strss ou out more
<guest456_>
so fucking useless..
<pcfreak30>
Its not the fact your not learning
<deryl>
make your own purely ruby based cataloging system. Model each of them.
<pcfreak30>
You just cant focus to complete the task
okinomo has quit [Ping timeout: 272 seconds]
dapz has joined #ruby
<pcfreak30>
You can understand concepts all night long
<pcfreak30>
But understanding, and building are very different stages
<deryl>
like take a baseball card. its got tons of stats. So, model a baseball player. add in the stats each card collates, then store that data yourself.
<guest456_>
yea
<WJW>
guest456_, since you are studying Reagonomics, that implies that you understand basic math.
<guest456_>
i c deryl good idea
<deryl>
make a card, make it talk back to you when you query it for some peice of data. then make it give it to you for all cards, or for a percentile range, etc
<WJW>
guest456_, is Ruby your first general-purpose programming language?
<deryl>
just something you're interested in
<deryl>
something in your real life that you collect or have a lot of. like for me its games and books
<guest456_>
wjw yes
<deryl>
if oyu pick something you really like to model, you're more likely to stick with it
<guest456_>
and deryl the only thing i have LOTS of is music....about 25k songs
<deryl>
thats why i suggest it
<WJW>
guest456_, OK, so this is not just about learning Ruby; it's about learning programming.
vlad_starkov has joined #ruby
<deryl>
there you go
<deryl>
make a catalog
<deryl>
genres ect
pyrac has joined #ruby
<guest456_>
yea im realizing that
<deryl>
and you'll learn a lot about ruby, and programming as you go along
<WJW>
guest456_, I endorse deryl's suggestion.
<guest456_>
i REALLY want to make a card game tho since i love poker
Kricir has joined #ruby
<deryl>
and if you learn to write tests, you'll learn to break problems down to smaller chunks even before you write actual code
<deryl>
so it makes it easier to understand each chunk and how they all fit together
<deryl>
then model a deck of playing cars
<deryl>
err cards
<deryl>
and then hands
<deryl>
model a player, then make more players
<deryl>
make them play themselves
<guest456_>
been trying to
<deryl>
make them play you
<WJW>
guest456_, study a couple of classes in particular: Array and Hash.
<deryl>
write tests even if theyre not in any test langauge
<guest456_>
but im not getting far thats why i came here lol
vikhyat has quit [Remote host closed the connection]
<WJW>
Hash is your friend.
<deryl>
just pseudo language. something simple. Given I have a deck of cards. And I deal out 2 hands of 7 cards
<deryl>
When I turn over a card. Then the next player turns a card
<deryl>
simple short sentences
<guest456_>
ok
<deryl>
put it together for how a single game's hand is played
<WJW>
Try examples in "irb". If still stumped, seek local help, someone who can sit by you and has programmed.
<deryl>
betwene just two people
<deryl>
yeah. exactly what wjw said
<deryl>
write the tests (don't worry about rspec or any test language. use straight english. just short sentences)
ecksit has joined #ruby
<WJW>
Success in programming takes a certain mindset and it's about the second most fun thing I know.
<deryl>
then think of everything involved in that that could be a model. A game could be one, a card another, a hand another
<deryl>
and so on
<guest456_>
so say ive created an array of cars 1-13 and an array of suits...how would I join these arrays to randomly spit out a combined output like Ah/Jc or [8d/Kh]
<deryl>
now, figure to yourself. ok, how do these interact when playing a hand?
<deryl>
break it down
<WJW>
guest456_, first you need random numbers in the appropriate ranges.
Mars` has joined #ruby
<WJW>
guest456_, then index into your arrays to get the appropriate elements; use the random numbers as indexes.
<deryl>
guest456_, what he said. but before you do that, break it all down into chunks. how to make a hand is far ahead of defining what a hand is in the first place
<deryl>
the small chunks add up fast. but the smaller the chunk, the easier it is to grasp
<guest456_>
im trying to learn as much as possible by understanding this code :https://github.com/robolson/ruby-poker/blob/master/lib/ruby-poker/card.rb
<deryl>
damn. i was going to stay up and delete the duplicates once this sync took place (so I had a sync'd base) but still got 608 large files to go. so, methinks i'm going to call it a night.
echevemaster has quit [Remote host closed the connection]
<pcfreak30>
yes, its from method_missing my my library
<WJW>
:errors => "Unknown API method #{method.to_s}()"
<deryl>
the '' were throwing me.
<guest456_>
if this project is to advanced I didnt want to make a script thatd autmoatically DL songs for me from this website...think that may be easier?
<deryl>
i wanted to say that but i thought maybe i was missing something else
<deryl>
interpolation was what he was trying to do, but i didn't know you could + inside the ''
<pcfreak30>
guest456_: IMO, your still thinking too big.
<deryl>
to cause interpolation that is
<WJW>
The + is outside the ''.
<deryl>
haha, i read the first one as a "
<deryl>
the 'U as "U
<WJW>
pcfreak30, I don't understand why if you have a symbol, it isn't supporting normal symbol calls such as .to_a.
<pcfreak30>
same
<WJW>
I mean to_s
<WJW>
Grab it and ask for its class.
<pcfreak30>
and thanks for the #{} syntax. made ir cleaner
sayan has joined #ruby
<WJW>
In place of .to_s, write .class.name.
<guest456_>
for the compotent programmers here: how long did it take before you felt coding for a company or job?
<WJW>
Four years in college.
hogeo has joined #ruby
skaflem has joined #ruby
<pcfreak30>
felt coding?
<WJW>
Bachelor of Science in Information and Computer Science at Ga. Tech.
<deryl>
think he meant felt competent coding for a company or job
<pcfreak30>
I dont know what he ment by felt
<deryl>
english might not be his primary
butblack has joined #ruby
<deryl>
before you felt competent to
<deryl>
self eval
<WJW>
While I was in college, I augmented the 'ed' editor similar that that on Unix, to orient itself to a screen.
<WJW>
kind of like 'vi' or 'emacs' but simpler.
<guest456_>
yea i did deryl lol i a word
<WJW>
The version I used was written in Ratfor.
deol has joined #ruby
<guest456_>
ahh
<guest456_>
funny u go to GT
<pcfreak30>
never even hear of that
<guest456_>
i go to morehouse in ALT
<deryl>
err?
<WJW>
Yup, GT.
<WJW>
Graduated in '78.
<deryl>
I've heard of Georgia Tech, and I'm in KY
<pcfreak30>
peace, im crashing!
<deryl>
night
<WJW>
Zzzz
<deryl>
only on file 76 of 608. I'ma crash too
Wolland has quit [Remote host closed the connection]
hogeo has quit [Ping timeout: 240 seconds]
ecksit has left #ruby ["Laters."]
<WJW>
guest456_, if you don't have programmer whizzes at Morehouse, walk over to GT and find some in their College of Computing. Make friends with a junior or a senior.
<guest456_>
yea that may be a good ide
<guest456_>
a
hogeo has joined #ruby
<WJW>
Dan Forsyth may still be a prof. there; he went through when I did.
deol has quit [Ping timeout: 246 seconds]
chihhsin has quit [Quit: leaving]
hogeo has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vlad_starkov has quit [Read error: Connection reset by peer]
codenapper has joined #ruby
brennanMKE has joined #ruby
chihhsin has joined #ruby
lewix has quit [Remote host closed the connection]
havenwood has joined #ruby
Tearan has quit []
brennanMKE has quit [Ping timeout: 272 seconds]
Hanmac1 has joined #ruby
Beoran__ has joined #ruby
mengu has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
Beoran_ has quit [Ping timeout: 252 seconds]
mengu has quit [Ping timeout: 246 seconds]
charliesome has joined #ruby
jkhwan has joined #ruby
S0da has quit [Remote host closed the connection]
Tearan has joined #ruby
hogeo has joined #ruby
Virtualize has joined #ruby
banister has joined #ruby
Tearan has quit [Client Quit]
guardian_ has quit [Ping timeout: 252 seconds]
guardian_ has joined #ruby
jkhwan has quit [Ping timeout: 272 seconds]
butblack_ has joined #ruby
guest456_ has quit [Ping timeout: 272 seconds]
Barrin6 has quit [Quit: Leaving]
butblack has quit [Ping timeout: 245 seconds]
butblack_ is now known as butblack
tjaco has joined #ruby
relix has joined #ruby
hogeo has quit [Ping timeout: 252 seconds]
Virtualize has quit [Ping timeout: 272 seconds]
rjhunter has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
reach has joined #ruby
tkuchiki has joined #ruby
madhatter has quit [Ping timeout: 246 seconds]
banister has quit [Ping timeout: 245 seconds]
madhatter has joined #ruby
noop has quit [Ping timeout: 246 seconds]
sheap has joined #ruby
Tearan has joined #ruby
Jetchisel has joined #ruby
figgleberry has joined #ruby
Tearan has quit [Ping timeout: 272 seconds]
figgleberry has quit [Ping timeout: 252 seconds]
claymore has joined #ruby
rippa has joined #ruby
deol has joined #ruby
abby_peng has joined #ruby
noop has joined #ruby
abby_peng has left #ruby ["Leaving"]
dapz has quit [Ping timeout: 245 seconds]
klaut has joined #ruby
Mon_Ouie has joined #ruby
deol has quit [Ping timeout: 245 seconds]
hogeo has joined #ruby
tjaco has quit [Ping timeout: 260 seconds]
tjaco has joined #ruby
hogeo has quit [Ping timeout: 245 seconds]
brennanMKE has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
<shredding>
I already now that \n means a reference to a prior () ... but i don't know where the \2 and \5 are from, as it looks as it's referencing itself in the example.
stkowski_ has joined #ruby
RoryHughes has joined #ruby
Virtualize has quit [Ping timeout: 246 seconds]
<popl>
\n is a newline
stkowski has quit [Ping timeout: 272 seconds]
stkowski_ is now known as stkowski
vlad_starkov has joined #ruby
ozkan has joined #ruby
<shredding>
popl: I meant \1 or \2 in regexp
<shredding>
n for the number of the reference
<popl>
\2 refers to the second matching group
browndawg has joined #ruby
rippa has quit [Ping timeout: 248 seconds]
phipes has quit [Remote host closed the connection]
dapz has quit [Ping timeout: 272 seconds]
shime has joined #ruby
<shredding>
popl: I know, but in the given example, there is no 2nd or 5th matching group at the time it is referenced.
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
speakingcode has joined #ruby
<popl>
>> "Cats and Dogs".scan(/(Cats (and)) (Dogs)/)
<shredding>
?
<popl>
eval-in: ಠ_ಠ
sepp2k has joined #ruby
<shredding>
popl: Mind elaborate a bit on that for a newbie?
<shredding>
However, why can i reference \2 from within (and), as in my example?
<popl>
what?
<matled>
shredding: \2 is the (.), not the surrounding one
<popl>
just count opening parentheses
<matled>
shredding: /(.). \1./ would be the sub-regexp alone
<shredding>
Now i get it!
<shredding>
Thanks!
<shredding>
For my version, i don't need the matches, i just need to know wether it's a full house or not, so maybe i can simplify it.
atmosx has joined #ruby
<atmosx>
hello ppl
speakingcode has quit [Quit: leaving]
speakingcode has joined #ruby
allsystemsarego has joined #ruby
huttan- has joined #ruby
arietis has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
goganchic has joined #ruby
deol has joined #ruby
robbyoconnor has joined #ruby
Virtualize has joined #ruby
jalcine is now known as jacky
hogeo has joined #ruby
huttan- has quit [Ping timeout: 260 seconds]
<WJW>
I would not use strings to represent cards or hands.
deol has quit [Ping timeout: 240 seconds]
Virtualize has quit [Ping timeout: 245 seconds]
<atmosx>
I used letters + numbers to represent cards ...
hogeo has quit [Ping timeout: 252 seconds]
<atmosx>
hmm tests for models should be written in the same file or use different files?
<DouweM>
atmosx: basicallt, every code file should correspond with one test file
<DouweM>
atmosx: so user.rb and user_spec.rb, post.rb and post_spec.rb
<atmosx>
I see, I have user.rb and models.rb loaded into init.rb (using sinatra here) so... I need 2 _spec for models. Okay, seems cleaner that way.
vlad_starkov has quit [Read error: Connection reset by peer]
brennanMKE has joined #ruby
`mrspock has quit [Ping timeout: 246 seconds]
brennanMKE has quit [Ping timeout: 246 seconds]
freerobby has joined #ruby
<pipecloud>
atmosx: I don't necessarily agree.
diegoviola has quit [Quit: WeeChat 0.4.2]
<atmosx>
pipecloud: I can live with that, unless you care to elaborate.
<pipecloud>
At least two, for sure, but not just two. No, just two wouldn't be enough.
carraroj has joined #ruby
<pipecloud>
There's more to test than just unit tests of each individual class.
<atmosx>
Why do you need more? I'm testing create/update/delete
<atmosx>
like what?
<pipecloud>
I'd have at least one file for the request specs, another file or more for the integration tests between user and models, and then two unit tests for user and model.
Jetchisel has joined #ruby
<DouweM>
agreed
<atmosx>
pipecloud: by request tests you mean http request's? Like browsing (usually done with capybara) ?
<pipecloud>
HTTP requests, not capybara requests.
<atmosx>
I don't care about those right now though.
<pipecloud>
You can use capybara, but I don't prefer it.
<pipecloud>
atmosx: Then don't care about any of it.
lkba has quit [Ping timeout: 246 seconds]
<pipecloud>
You need functional level, integration level, and unit level tests.
<atmosx>
I'm just testing my 2 models, make sure I can perform all actions.
<pipecloud>
good luck
<atmosx>
thanks
Jetchisel has quit [Client Quit]
Jetchisel has joined #ruby
threesome has joined #ruby
huttan- has joined #ruby
CpuID has quit [Quit: This computer has gone to sleep]
jkhwan has joined #ruby
atzorvas has joined #ruby
atzorvas is now known as Guest88728
pyrac has quit [Quit: pyrac]
jkhwan has quit [Ping timeout: 272 seconds]
rootshift has joined #ruby
dkamioka has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
skaflem has quit [Ping timeout: 240 seconds]
rjhunter has joined #ruby
xiphias has quit [Ping timeout: 240 seconds]
skaflem has joined #ruby
xiphias has joined #ruby
brennanMKE has joined #ruby
larissa has joined #ruby
decoponio has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
rjhunter has quit [Ping timeout: 252 seconds]
RoryHughes has quit []
relix has joined #ruby
relix has quit [Client Quit]
brennanMKE has quit [Ping timeout: 272 seconds]
deol has joined #ruby
eval-in has joined #ruby
relix has joined #ruby
LexicalScope has quit [Ping timeout: 246 seconds]
LexicalScope` has quit [Ping timeout: 245 seconds]
deol has quit [Ping timeout: 252 seconds]
relix has quit [Client Quit]
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
RoryHughes has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
Mars` has joined #ruby
jkhwan has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
gja has joined #ruby
ewnd9 has quit [Ping timeout: 272 seconds]
atzorvas has joined #ruby
mengu has joined #ruby
atzorvas is now known as Guest91038
Bumptious has quit [Read error: Connection timed out]
jkhwan has quit [Ping timeout: 272 seconds]
sepp2k1 has joined #ruby
Bumptious has joined #ruby
shredding has joined #ruby
<shevy>
guys
<shevy>
I wanna kill some of you
<apeiros>
why's that?
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
kirun has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
just to show that I love you°!
<apeiros>
you're weird
sepp2k has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
psyl0n has joined #ruby
psyl0n has quit [Changing host]
psyl0n has joined #ruby
prc has joined #ruby
Mars` has quit [Remote host closed the connection]
specious has quit [Ping timeout: 245 seconds]
aspiers has joined #ruby
eval-in has quit [Remote host closed the connection]
Astralum has joined #ruby
eval-in has joined #ruby
<popl>
shevy: you might get prosecuted for saying something like that.
yjmsf20 has quit [Quit: leaving]
<shevy>
yay!
<popl>
Austria is a little rapey and kidnappy anyways.
<popl>
Best not to visit, I guess.
reach has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
<shevy>
that's right, we don't like outsiders around here
teoric has joined #ruby
popl has quit [Ping timeout: 260 seconds]
railsbros_dirk has quit [Quit: railsbros_dirk]
gja has joined #ruby
teoric has quit [Client Quit]
gja has quit [Changing host]
gja has joined #ruby
<shevy>
hmm does anyone know... I have the following situation
<shevy>
one project reads in lots of small yaml files
<shevy>
these yaml files are kept at a specific location, outside of any ruby project
<pipecloud>
Use Go.
<shevy>
can I simply set a symlink to that directory (on linux), and when I publish an updated version of that gem, the content of the symlink will be published as well?
Guest91038 has quit [Ping timeout: 252 seconds]
<pipecloud>
shevy: Naw, use a configuration
<shevy>
a configuration?
<pipecloud>
Have you seen configuration blocks? They typically just get yielded to an object and set instance variables.
<pipecloud>
Then that's memoized or stored somehow, and your library calls into that for configuration details.
pushpak has joined #ruby
Xeago has joined #ruby
rjhunter has joined #ruby
hogeo has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
Virtualize has joined #ruby
agjacome has joined #ruby
Xeago has quit [Remote host closed the connection]
hogeo has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
mengu has quit [Remote host closed the connection]
parduse has joined #ruby
Virtualize has quit [Ping timeout: 260 seconds]
ewnd9 has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
chrisan has joined #ruby
okinomo has joined #ruby
rjhunter has quit [Remote host closed the connection]
drago777 has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
Xeago has quit [Ping timeout: 240 seconds]
sakshi has joined #ruby
drago777 has joined #ruby
gerstein has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
brennanMKE has joined #ruby
eval-in_ has joined #ruby
brennanMKE has quit [Ping timeout: 252 seconds]
eval-in_ has quit [Remote host closed the connection]
Wolland has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
shredding has quit [Quit: shredding]
<apeiros>
hm, .f for frozen strings is a 2.2 thing?
<pipecloud>
Seems it didn't make it in.
Steven_ has joined #ruby
<apeiros>
it's still .freeze as it seems, but at least optimized
<pipecloud>
%f right?
<pipecloud>
or f%?
banister has joined #ruby
<DouweM>
yeah, f suffix didn't make it in. uptimizing #freeze was concluded to make more sense
glide has joined #ruby
mengu has joined #ruby
SeySayux has quit [Ping timeout: 272 seconds]
<apeiros>
%f?
<apeiros>
DouweM: I knew that "foo"f died, but I thought they added "foo".f along with "foo".freeze
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
glide has left #ruby [#ruby]
<pipecloud>
ah
arietis has joined #ruby
SeySayux has joined #ruby
goganchic has quit []
byprdct has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
jkhwan has joined #ruby
<DouweM>
apeiros: ah
Notte has joined #ruby
Notte has quit [Remote host closed the connection]
jkhwan has quit [Ping timeout: 272 seconds]
jonathanwallace has quit [Ping timeout: 260 seconds]
blarghmatey has quit [Ping timeout: 272 seconds]
atno has joined #ruby
atno_ has quit [Ping timeout: 240 seconds]
vlad_starkov has joined #ruby
atno_ has joined #ruby
peregrine81 has joined #ruby
carraroj has joined #ruby
diegoviola has joined #ruby
atno has quit [Ping timeout: 252 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
byprdct has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RoryHughes has quit []
peregrine81 has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
ephemerian has joined #ruby
peregrine81 has joined #ruby
jcx has joined #ruby
rootshift has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Geniack_ has quit [Ping timeout: 245 seconds]
tkuchiki has joined #ruby
Mars` has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
tkuchiki has quit [Ping timeout: 252 seconds]
pen has joined #ruby
jonathanwallace has joined #ruby
Mars` has quit [Ping timeout: 240 seconds]
t_p has joined #ruby
hogeo has joined #ruby
aspiers has quit [Ping timeout: 240 seconds]
colonolGron has quit [Quit: leaving]
habanany has joined #ruby
rootshift has quit [Quit: rootshift]
Wolland has quit [Remote host closed the connection]
jacky has quit [Excess Flood]
hogeo has quit [Ping timeout: 245 seconds]
larissa has quit [Quit: Leaving]
jalcine_ has joined #ruby
jalcine_ has quit [Excess Flood]
jonathanwallace has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
drago777 has quit [Ping timeout: 240 seconds]
jalcine_ has joined #ruby
matchaw has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.2]
pskosinski has joined #ruby
carlsednaoui has joined #ruby
drago777 has joined #ruby
OnkelTem has quit [Quit: WeeChat 0.4.2]
mark_locklear has joined #ruby
brennanMKE has joined #ruby
ab9 has joined #ruby
brennanMKE has quit [Ping timeout: 272 seconds]
atno__ has joined #ruby
byprdct has joined #ruby
michael_lee has quit [Quit: Ex-Chat]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vlad_starkov has joined #ruby
michael_lee has joined #ruby
atno_ has quit [Ping timeout: 245 seconds]
hogeo has joined #ruby
Steven_ has quit [Remote host closed the connection]
ab9 has left #ruby [#ruby]
railsbros_dirk has joined #ruby
brennanMKE has joined #ruby
hogeo has quit [Ping timeout: 246 seconds]
railsbros_dirk has left #ruby [#ruby]
includex has joined #ruby
ptierno has quit [Changing host]
ptierno has joined #ruby
lyanchih_ has joined #ruby
jkhwan has joined #ruby
havenwood has quit [Remote host closed the connection]
mojjojo has quit [Quit: mojjojo]
Guedes0 has joined #ruby
Monie has joined #ruby
<apeiros>
if you could rename rails env, how'd you call it? (given that `env` is easy to be confused with other things already being called env in that context…)
psyl0n has quit [Remote host closed the connection]
MattStratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mzdravkov has joined #ruby
<WJW>
I guess the next best name would be "config".
cosmicpanda has joined #ruby
butblack has joined #ruby
<apeiros>
jcx: we have 3 envs already: *nix env, rack env, rails env
<apeiros>
wouldn't wonder if I even missed one
Steven_ has quit [Remote host closed the connection]
<apeiros>
so if you have code talking about plain `env` it's not necessarily obvious which it is
<WJW>
So qualify it with a namespace.
Guedes0 has quit [Ping timeout: 272 seconds]
<apeiros>
variables/attributes don't have namespaces
<apeiros>
neither do method names
<WJW>
Rails.env
<apeiros>
someobj.env # now what?
<WJW>
OS.env
<WJW>
Rack.env
rootshift has joined #ruby
jalcine_ is now known as jalcine
<apeiros>
yeah, nonstarter as that's not a reality (except for Rails.env)
<WJW>
How much freedom of movement do you have to control your reality, apeiros, on the basis of which you pose the question?
<apeiros>
I obviously can't rename what *nix env is called. I'm building on top of Rack, so that `env` will stay called `env`. The thing I'm able to rename is the equivalent of rails' env.
<WJW>
How can Rack set a lowercase variable name "env" that would be in scope in your code?
psyl0n has joined #ruby
<WJW>
You are writing something that is the equivalent of Rails?
<apeiros>
it can't. just as linux doesn't set a variable. it's terminology.
<apeiros>
to an extent, yes. it's a special purpose webframework.
<WJW>
apeiros, I thought you were asking about terms that you would be able to use in your code.
psyl0n has quit [Remote host closed the connection]
sakshi has left #ruby ["Konversation terminated!"]
jego has joined #ruby
SHyx0rmZ has joined #ruby
<apeiros>
that's one part. terminology is the other.
<apeiros>
it's annoying to have 3 different things called `environment`
<WJW>
What is the name of your package, as you would refer to it in prose in English?
<apeiros>
that's irrelevant. and it doesn't have one yet.
kep has quit [Quit: WeeChat 0.4.2]
<WJW>
The [package name] environment, or the [package name] configuration block.
klaut has joined #ruby
<apeiros>
yes, no, that's NOT what I'm looking for.
ambushsabre has joined #ruby
<WJW>
Why would you call something by a term that does not accurately describe it?
<apeiros>
that's still calling it `environment`.
Virtualize has joined #ruby
jcx has quit [Quit: Leaving...]
<WJW>
No, it's not simply 'environment', it's qualified, [pachage name] 'environment'.
Solnse has joined #ruby
<apeiros>
why do you think "environment" is accurate? why do you think there's no possible other term to accurately describe what it expresses?
nari has joined #ruby
<WJW>
It's an object that contains the fundamental configuration of the running instance of the package or interface to the package from a client, right?
<apeiros>
look, obviously the only answer you have to the issue is "still call it env". So, thank you, but no, that's not what I'm looking for.
<WJW>
Describe the thing in plain language.
rootshift has quit [Ping timeout: 245 seconds]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vlad_starkov has quit [Remote host closed the connection]
larissa has quit [Quit: Leaving]
<apeiros>
configuration would be an option, but I prefer to use that term to the actual configuration values. I'm pondering `runtime` and `setting`. maybe there's better terms.
Virtualize has quit [Ping timeout: 272 seconds]
mechanicles has joined #ruby
<apeiros>
IMO environment is a poor name anyway, as it's not really an env, just a handle.
<WJW>
A client process would have access to just one of these handles, right?
phus1on has joined #ruby
fuhgeddaboudit has joined #ruby
nfk has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
<apeiros>
like in rails, you'd start it up referring to one of the handles which controls what configuration is loaded. so yes, correct, a client would use one.
kiba` has joined #ruby
<WJW>
And would all the client's requests of the package go through the handle?
<apeiros>
what do you consider "go through the handle" - it doesn't in rails either. all requests are subject to the loaded configuration.
ItSAN____ has quit [Quit: Leaving...]
<WJW>
Are you looking for a term to use in the clien's viewpoint, or the package's, or both?
rickruby has quit [Remote host closed the connection]
<apeiros>
I assume by "client" you mean "server"?
<WJW>
I mean the code that wants to call your package.
Kiba has quit [Ping timeout: 245 seconds]
claymore has quit [Ping timeout: 252 seconds]
<apeiros>
it makes little sense if those use different terms
<apeiros>
that's why we have terminology after all
Takumo has joined #ruby
mmitchell has joined #ruby
<apeiros>
to identify a meaning, to give semantics.
<WJW>
Under what circumstances does the calling code use the handle?
TomRone has quit [Ping timeout: 240 seconds]
<apeiros>
same as in rails
<WJW>
and I'm not talking about callbacks.
<Takumo>
Hi all, I've got a question about Rake... would #ruby be a good place to ask?
<apeiros>
Takumo: yes
<WJW>
What is your question, Takumo?
<Takumo>
I've got a package task defined
<Takumo>
and it creates the zip file of #{package}-#{version}.zip
<WJW>
I forget where in an application that uses Rails, we would refer to the environment.
<Takumo>
but inside #{package}-#{version}.zip is a directory called #{package}-#{version} which contains the files
IceDragon has joined #ruby
TomRone has joined #ruby
RoryHughes has joined #ruby
<Takumo>
how do I get the package task to put the files in the root of the package file, instead of inside another directry (i.e. cd package && zip -r *) instead of (zip -r package)
<WJW>
Takumo, currently, how do you create the files?
havenwood has quit [Remote host closed the connection]
<shevy>
WJW you have a method #new ?
snath has quit [Ping timeout: 246 seconds]
speckle has quit [Read error: Connection reset by peer]
huttan- has joined #ruby
anshin has quit [Quit: WeeChat 0.4.2]
brennanMKE has joined #ruby
Virtualize has joined #ruby
rickruby has joined #ruby
pootler has quit [Quit: leaving]
havenwood has joined #ruby
ewnd9 has quit [Ping timeout: 272 seconds]
bklane has joined #ruby
Wolland has joined #ruby
mmitchell has quit [Remote host closed the connection]
xiphias has quit [Ping timeout: 240 seconds]
pengunix has quit [Ping timeout: 252 seconds]
brennanMKE has quit [Ping timeout: 246 seconds]
xiphias has joined #ruby
Virtualize has quit [Ping timeout: 272 seconds]
Megtastique has joined #ruby
Jake232 has joined #ruby
asuka has joined #ruby
dioms has quit [Ping timeout: 260 seconds]
<deryl>
what is i with this channel's aversion to a #new method?
<deryl>
s/is i/is it/.
Megtastique has quit [Client Quit]
rjhunter has joined #ruby
dioms has joined #ruby
Tranquility_ has quit [Ping timeout: 260 seconds]
hashbangchris has joined #ruby
dima_ has joined #ruby
Tranquility_ has joined #ruby
asuka has quit [Remote host closed the connection]
jego has joined #ruby
asuka has joined #ruby
dima_ has quit [Remote host closed the connection]
xiphias has quit [Ping timeout: 240 seconds]
rjhunter has quit [Ping timeout: 252 seconds]
xiphias has joined #ruby
huttan- has quit [Ping timeout: 252 seconds]
kure_ is now known as kure
maletor has joined #ruby
ace_striker has joined #ruby
MattStratton has joined #ruby
elux has joined #ruby
Wolland has quit [Remote host closed the connection]
platzhirsch1 has joined #ruby
huttan- has joined #ruby
<shevy>
deryl how could it work
<platzhirsch1>
The new object space allocation helpers and hooks that have been added to 2.1 seem to be very useful. This should make profiling and memory leak tracing a lot easier
<shevy>
>> class Foo; def new; puts 'I am in new()'; end; end; Foo.new
<eval-in>
shevy => undefined local variable or method `o' for main:Object (NameError) ... (https://eval.in/83759)
<platzhirsch1>
Stags are allowed to have memory leaks
<shevy>
Hirsch sounds a lot better than stag :)
bklane has quit [Remote host closed the connection]
<platzhirsch1>
and deer sounds worse than stag
<shevy>
yeah it's also awful
<platzhirsch1>
but maybe I was refering to a staCK???
<shevy>
platzhirsch is like the boss stag
Mohan has joined #ruby
ripnix has joined #ruby
<shevy>
he comes around, he marks his territory by using the ancient urination method
<platzhirsch1>
D:
butblack has quit [Quit: butblack]
Wolland has joined #ruby
yo61 has quit [Ping timeout: 260 seconds]
kiba` has quit [Ping timeout: 272 seconds]
yo61 has joined #ruby
mojjojo has joined #ruby
carraroj has joined #ruby
carraroj has quit [Changing host]
carraroj has joined #ruby
huttan- has quit [Ping timeout: 246 seconds]
mojjojo has quit [Client Quit]
mojjojo has joined #ruby
axl_ has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.2]
hashbangchris has quit [Quit: mt]
ambushsabre has joined #ruby
lewix has joined #ruby
shime has quit [Ping timeout: 245 seconds]
mojjojo has quit [Client Quit]
shime has joined #ruby
phus1on has quit [Quit: .]
maletor has quit [Quit: Computer has gone to sleep.]
ss_ has quit [Remote host closed the connection]
carraroj has quit [Ping timeout: 246 seconds]
prc has quit [Quit: Leaving.]
prc has joined #ruby
Steven_ has quit [Remote host closed the connection]
<DouweM>
shevy: in your #new example from 20 minutes ago, you're overriding #new, not .new, so obviously Foo.new would still have the old implementation.
<DouweM>
>> class Foo; def self.new; "wtf"; end; Foo.new
jonathanwallace has quit [Ping timeout: 252 seconds]
drago777 has joined #ruby
skulker has joined #ruby
rickruby has quit [Remote host closed the connection]
bklane has joined #ruby
prc1 has joined #ruby
Steven_ has joined #ruby
bogeyd6 has quit [Ping timeout: 272 seconds]
carlsednaoui has quit [Remote host closed the connection]
carlsednaoui has joined #ruby
bogeyd6 has joined #ruby
prc has quit [Ping timeout: 272 seconds]
Hanmac1 has joined #ruby
Kiba has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
jonathanwallace has joined #ruby
brennanMKE has joined #ruby
Virtualize has joined #ruby
jkhwan has joined #ruby
eka has joined #ruby
<apeiros>
deryl: because new suggests it's YourClass::new, so YourClass.new is expected to return an object which is instance_of?(YourClass)
jaredrhine has quit [Remote host closed the connection]
<apeiros>
IMO it's not out of question to have a #new, but the reason should be good (so far the only I'm aware of is Struct.new)
lnormous has joined #ruby
mburns has quit [Ping timeout: 245 seconds]
<apeiros>
even there it'd IMO be better to use a different method name than new.
guardian_ has quit [Ping timeout: 272 seconds]
drago777 has quit [Ping timeout: 240 seconds]
mechanicles has quit [Quit: Computer has gone to sleep.]
Virtualize has quit [Ping timeout: 245 seconds]
renklaf has joined #ruby
jkhwan has quit [Ping timeout: 272 seconds]
mechanicles has joined #ruby
michael_lee has quit [Quit: Ex-Chat]
<deryl>
>> class MyClass ; def new ; end ; end ; @inst = MyClass.new ; @inst.instance_of?(MyClass)
Sawbones has joined #ruby
<apeiros>
deryl: you're confusing class- and instance-methods
drago777 has joined #ruby
<apeiros>
MyClass.new does not invoke the `new` method you defined.
<deryl>
no, I asked why people are against having a new not a #new
mojjojo has joined #ruby
<deryl>
(or would that be ::new
<apeiros>
actually you did
<apeiros>
>> 17:39 deryl: what is i with this channel's aversion to a #new method?
bklane has quit [Remote host closed the connection]
<apeiros>
if you're asking why not ::new, then the answer is that there's #initialize which should handle that. I'm not aware of a good reason for ::new.
deol has quit [Remote host closed the connection]
brennanMKE has quit [Ping timeout: 252 seconds]
deol has joined #ruby
rjhunter has joined #ruby
<deryl>
ok. i forget the denoting for class vs instance
<deryl>
on a method name
<apeiros>
here too, it's not inconceivable that there's a good reason to do it, but I haven't come across a single case in the last 10 years.
<deryl>
i was specifically referring to instance
arietis has quit [Quit: Computer has gone to sleep.]
<apeiros>
>> class MyClass ; def new ; end ; end ; obj = MyClass.new; obj.new.instance_of?(obj)
<apeiros>
blerp, eval-in dead?
<apeiros>
--> false
<apeiros>
that's the issue with #new
<apeiros>
and with ::new, see above
colonolGron has joined #ruby
<deryl>
i'm playing with it all in repl.it :)
<apeiros>
local pry, no patience for websites :)
Deele has joined #ruby
mmitchell has joined #ruby
<deryl>
i'm in windows atm or i would hehe
rjhunter has quit [Ping timeout: 246 seconds]
<deryl>
forgot to copy my key over from the linux install so can't ssh out to the remote. (dumb assed me)
deol has quit [Ping timeout: 272 seconds]
<apeiros>
:-/
mercwithamouth has quit [Ping timeout: 246 seconds]
<mechanicles>
Hi all
mojjojo has quit [Quit: mojjojo]
<apeiros>
hi
<deryl>
o/
claymore has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
Megtastique has joined #ruby
Sawbones has quit [Remote host closed the connection]
Sawbones has joined #ruby
arietis has joined #ruby
fuhgeddaboudit has quit [Ping timeout: 245 seconds]
rickruby has joined #ruby
apeiros_ has joined #ruby
juarlex_ has joined #ruby
lewix has quit [Remote host closed the connection]
juarlex has quit [Read error: Connection reset by peer]
lewix has joined #ruby
mojjojo has joined #ruby
byprdct has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jaredrhine has joined #ruby
mburns has joined #ruby
apeiros has quit [Ping timeout: 260 seconds]
Sawbones has quit [Ping timeout: 245 seconds]
mojjojo has quit [Client Quit]
huttan- has joined #ruby
rippa has quit [Ping timeout: 248 seconds]
<mzdravkov>
what would you use: `cp src dest` vs FileUtils.cp src, dest. Maybe the second is better because it'll throw exception if problem occurs. What do you think?
Sawbones has joined #ruby
Wolland has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
<apeiros_>
I think the former is non-portable
huttan- has quit [Ping timeout: 252 seconds]
<apeiros_>
also the former is easier to screw up with regards to input (escaping, vulnerability, yadda yadda)
mary5030 has joined #ruby
byprdct has joined #ruby
Neomex has quit [Ping timeout: 245 seconds]
Megtastique has quit []
Wolland has joined #ruby
anderson has quit [Ping timeout: 245 seconds]
Neomex has joined #ruby
Megtastique has joined #ruby
Wolland has quit [Remote host closed the connection]
mgberlin has quit [Quit: mgberlin]
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
Xaitec has joined #ruby
lewix has quit [Remote host closed the connection]
lewix has joined #ruby
Tearan has joined #ruby
habanany has quit [Ping timeout: 260 seconds]
mary5030 has quit [Ping timeout: 245 seconds]
voodoofish has joined #ruby
tkuchiki has joined #ruby
<apeiros_>
mzdravkov: does that sufficiently answer your question?
<mzdravkov>
apeiros_: yeah. I was also thinking that the second is better (mainly because it'll throw exception).
<apeiros_>
*raise
<apeiros_>
throw has a different meaning in ruby
freerobby has quit [Quit: Leaving.]
<mzdravkov>
apeiros_: I could never remember all the details about exceptions and etc. I just don't like this aproach, idk why. Excuse my ignorance :)
figgleberry has joined #ruby
ripnix has quit []
ripnix has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
nari has quit [Ping timeout: 272 seconds]
mercwithamouth has joined #ruby
ripnix has left #ruby [#ruby]
ripnix has joined #ruby
yokel has joined #ruby
Sawbones has quit [Remote host closed the connection]
rootshift has joined #ruby
Sawbones has joined #ruby
<shevy>
mzdravkov always FileUtils.cp
<shevy>
mzdravkov but you can do: def cp(i); FileUtils.cp(i); end
atno has quit [Ping timeout: 252 seconds]
Yan__ has joined #ruby
<Mon_Ouie>
or include Fileutils
MattStratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<deryl>
but using that with the backticks will bypass that method and use the system cp, right? or can you use a method with the backticks as well (asking for my own knowledge)
flubba has joined #ruby
claymore has joined #ruby
_maes_ has quit [Ping timeout: 260 seconds]
<mzdravkov>
it's not worth it just to escape writing one time FileUtils :D
casheew_ has joined #ruby
casheew_ has quit [Client Quit]
<mzdravkov>
deryl: `` is I believe equivalent to Kernel.system, so it runs the unix cp
<deryl>
thats what i thought but wasn't entirely sure when you have a cp method defined as well
<mzdravkov>
deryl: And you can use #{} to run ruby code in the ``
flubba has quit [Remote host closed the connection]
<deryl>
what about with the other one (%x[] iirc)
Sawbones has quit [Ping timeout: 260 seconds]
drago777 has quit [Ping timeout: 240 seconds]
<deryl>
only written one thing that calls to system, and think I used the %x[] format rather than backticks.
<deryl>
same, just an alias for Kernel.system call correct?
<mzdravkov>
deryl: so I was wrong: `` is not the same as Kernel.system, because `` will return the output of the command as a string, and Kernel.system will return boolean
noop has quit [Ping timeout: 246 seconds]
browndawg has left #ruby [#ruby]
<deryl>
hehe the implications of that didn't dawn on me until you said so
<mzdravkov>
deryl: also %x() is the same as %x[] or even %x// and %x!!. I just tried it in the repl
soobus has quit [Ping timeout: 252 seconds]
Czupa has joined #ruby
gja has joined #ruby
<apeiros_>
deryl: %x() and %x[] are the same
drago777 has joined #ruby
<apeiros_>
you can use a wide range of delimiters with %? syntax
<deryl>
ah cool
<mzdravkov>
apeiros_: this is something like the syntax of block string (I believe there was some kind of block string that you can say what word will be the delimiter of the block)
<apeiros_>
mzdravkov: you mean %(), %q(), %Q() ?
<apeiros_>
then yes, those work the same way
<apeiros_>
there's %q, %i, %w, %x
<mzdravkov>
yes, seems like it was <<-word some text word
<apeiros_>
no, that one is different
<apeiros_>
those are here-docs
<deryl>
so many shortcuts, some that are pretty damned close to each other but do different things
stkowski has quit [Quit: stkowski]
<deryl>
need a cheatsheet of sorts hehe
<apeiros_>
google "zensiders quickref"
<shevy>
the zensider
<apeiros_>
gah
<apeiros_>
*zenspider
<shevy>
:D
<deryl>
got it
<deryl>
knew what you meant
casheew has quit [Quit: leaving]
<mzdravkov>
apeiros_: but heredocs evaluate to string, so they can be used as multiline strings right?
<shevy>
correcting typos is no fun :(
casheew has joined #ruby
<deryl>
jeez, ryan's got tons of stuff out here
Virtualize has joined #ruby
<mzdravkov>
but seems like I can use normal strings with "" on few lines so...
skulker has quit [Remote host closed the connection]
jkhwan has joined #ruby
<apeiros_>
mzdravkov: I'm not aware of any string literal which does not allow multiline strings ;-)
<apeiros_>
mzdravkov: there are 3 types of string literals: quoted, %-syntax and here-docs
<apeiros_>
I guess you could count DATA too.
<deryl>
hmm, need to turn this into a pdf :)
<deryl>
apeiros_, merci. *exactly* what i wanted
mjburgess has joined #ruby
legrandin has joined #ruby
<apeiros_>
the quickref?
legrandin has left #ruby ["Leaving"]
<deryl>
yeah
<apeiros_>
learned much of my ruby using it
<mzdravkov>
apeiros_: hm, maybe I am mixing my knowledge of different languages :D
<deryl>
bookmarked on delicious now
platzhirsch1 has left #ruby [#ruby]
<mzdravkov>
When I started using ruby I had always an open doc for Array and String classes :D
burlyscudd has joined #ruby
<deryl>
i bought the well-grounded rubyist. that was and still is my bible
<deryl>
but it doesn't have a set of succinct quickrefs or anything.,
<deryl>
this will serve nicely
Virtualize has quit [Ping timeout: 252 seconds]
juarlex_ is now known as juarlex
Xaitec has quit [Remote host closed the connection]
<deryl>
wow, wife just showed me something cool for windows though she doesn't remember hwo she did it. You know the charms section when you hit the windows key? you can split desktop mode in half to show that *and* the desktop at the same time.
<deryl>
(i know this is ruby, but just thought that was pretty cool. unknown windows capability)
brennanMKE has quit [Ping timeout: 245 seconds]
rjhunter has joined #ruby
<deryl>
now if only she could remember how she did it
lewix has quit [Remote host closed the connection]
lewix has joined #ruby
<mzdravkov>
something strange: I have module B, inside of module A and there is self.method in module B. Inside of this self.method I am trying to use FileUtils and it says that there is no such constant
<apeiros_>
mzdravkov: did you require 'fileutils'?
<apeiros_>
also, use gist.github.com with actual code and exception
<mzdravkov>
apeiros_: nope, In my pry I could use it without requiring it. I know about gist, but it;s just too much work for something simple as this (I thought so)
<apeiros_>
mzdravkov: that's probably because something else already required it
carraroj has joined #ruby
<apeiros_>
FileUtils is not core. it must be required.
<mzdravkov>
apeiros_: yes, requiring it worked like a charm. I thought it would be core :)
rjhunter has quit [Ping timeout: 245 seconds]
habanany has joined #ruby
<deryl>
if you use rubinius with this script, remember to include rubysl gem and the require you just did
<deryl>
rbx split out stdlib into multiple gems. jfyi
rickruby has quit [Remote host closed the connection]
Astralum has quit [Ping timeout: 272 seconds]
<apeiros_>
afaik splitting stdlib into gems is the long-term plan anyway
rickruby has joined #ruby
drago777 has quit [Ping timeout: 240 seconds]
<mzdravkov>
hm, just found something interesting, when I used var name inside module's method without taking it as argument. There is name variable inside every module that returns the name of the module :)
<shevy>
wat
<apeiros_>
mzdravkov: name is a method
<apeiros_>
see Module#name
<shevy>
cool
<shevy>
> module Foo; end; Foo.name
<shevy>
>> module Foo; end; Foo.name
<shevy>
eval-in, what's up with you!
<apeiros_>
you're looking kind of down to me *sing*
<shevy>
I think DouweM broke eval-in :(
<apeiros_>
well, actually, that'd start with "eval-in, what's wrong with you…"
drago777 has joined #ruby
rickruby has quit [Ping timeout: 252 seconds]
skulker has quit [Remote host closed the connection]
maycon has joined #ruby
vinian has joined #ruby
vinian has quit [Max SendQ exceeded]
atmosx has joined #ruby
skulker has joined #ruby
voodoofish has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
kep has joined #ruby
tkuchiki has quit [Remote host closed the connection]
drago777 has quit [Ping timeout: 240 seconds]
tkuchiki has joined #ruby
mmitchell has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
dawe has joined #ruby
CaptainJet has joined #ruby
drago777 has joined #ruby
tomaw- has quit [Quit: Quitting]
freerobby has quit [Ping timeout: 252 seconds]
soobus has quit [Ping timeout: 252 seconds]
tkuchiki has quit [Ping timeout: 252 seconds]
vikhyat has joined #ruby
Kricir has joined #ruby
vikhyat_ has joined #ruby
mikepack has joined #ruby
skulker_ has joined #ruby
tomaw_ has joined #ruby
mechanicles has quit [Quit: Computer has gone to sleep.]
deol has joined #ruby
vikhyat has quit [Read error: Connection reset by peer]
skulker has quit [Ping timeout: 252 seconds]
kcombs has joined #ruby
phipes has joined #ruby
vikhyat has joined #ruby
smathieu has joined #ruby
carraroj has quit [Ping timeout: 260 seconds]
Guedes0 has joined #ruby
voodoofish has joined #ruby
vikhyat_ has quit [Ping timeout: 252 seconds]
decoponio has quit [Quit: Leaving...]
mmitchell has joined #ruby
deol has quit [Ping timeout: 272 seconds]
xiphias has quit [Ping timeout: 240 seconds]
xiphias has joined #ruby
vikhyat_ has joined #ruby
Kricir has quit [Remote host closed the connection]
stkowski has joined #ruby
vikhyat has quit [Ping timeout: 252 seconds]
phipes has quit [Remote host closed the connection]
Sawbones has quit [Remote host closed the connection]
chez has joined #ruby
Sawbones has joined #ruby
TomRone has quit [Ping timeout: 240 seconds]
mercwithamouth has quit [Quit: Lost terminal]
phansch has quit [Quit: Leaving]
Guest65897 has quit [Ping timeout: 252 seconds]
xiphias has quit [Ping timeout: 240 seconds]
phansch has joined #ruby
TomRone has joined #ruby
xiphias has joined #ruby
nowthatsamatt has joined #ruby
end_guy has quit [Ping timeout: 240 seconds]
Sawbones has quit [Ping timeout: 272 seconds]
Virtualize has joined #ruby
jkhwan has joined #ruby
bogeyd6 has quit [Ping timeout: 272 seconds]
end_guy has joined #ruby
randomnick_ has joined #ruby
bogeyd6 has joined #ruby
carraroj has joined #ruby
<mzdravkov>
I am trying to remember if ruby has _ variable. _ is used to put things you won't need. For example it would be cool to do smt.sort_by { |_, v| v }
<apeiros_>
_ is a valid lvar name, yes
<apeiros_>
as is _foo
<apeiros_>
no need to remember. just try it.
Virtualize has quit [Ping timeout: 252 seconds]
coinsen has joined #ruby
jkhwan has quit [Ping timeout: 272 seconds]
<shevy>
hmm
<shevy>
in old code I have here
<shevy>
I am using this:
<shevy>
GC.start
<shevy>
can anyone tell me why I did this?
Sawbones has joined #ruby
chrisramon has joined #ruby
<shevy>
The context is: reloading some images and display that new loaded image in a Gtk widget
jego has quit [Ping timeout: 272 seconds]
<shevy>
some images also lead to errors like "Insufficient memory to load image file"
<coinsen>
hi there. has anybody used the libusb gem yet? i'd like to use the "scan" button on my usb-scanner, and i'm wondering how difficult it would be to catch the button command
chez has quit [Quit: Leaving.]
<mzdravkov>
apeiros_: _ is as far as I know the result of the last return. So _ is a "normal" variable and ruby will remember it. I am asking if there is special variable name to put things, that ruby will automatically just erase from memory?
<apeiros_>
mzdravkov: that's in irb
chez has joined #ruby
rootshift has quit [Quit: rootshift]
chez has quit [Client Quit]
<apeiros_>
so no, *ruby* does not treat _ specially. irb does.
<apeiros_>
(and pry, as it inherited that feature)
workmad3 has joined #ruby
chrisbro has joined #ruby
dylandog has joined #ruby
<mzdravkov>
apeiros_: I see
blarghmatey has quit [Ping timeout: 260 seconds]
chrisbro has quit [Client Quit]
chrisgw has joined #ruby
Yan__ has quit [Ping timeout: 272 seconds]
rjhunter has joined #ruby
<shevy>
coinsen I think I have heard of it many years ago
ace_striker has quit [Quit: Page closed]
<shevy>
best is to look at the date of last release
<shevy>
if it's many years ago, the project is surely inactive
<shevy>
coinsen k then the guy who does so probably knows what he is doing, now we just have to find someone who uses libusb here :)
<coinsen>
shevy: so it seems quite up2date, however i have no idea how usb protocol works. what id like to know is: can i just listen on a usb device for key presses, for example? :D
<mzdravkov>
apeiros_: why almost? If = is defined to return the result then it is ok, right?
<shevy>
coinsen depends on whether you can intercept these signals with that gem
<apeiros_>
mzdravkov: as said, it's not the same. use e.g. "foo", and do x.upcase!
<apeiros_>
with shevy's expansion, y would be unaffected as it'd be two different objects
<mzdravkov>
apeiros_: oh, right.
Yan__ has joined #ruby
<kure>
Yo guys, I've made this cute gem that allows you to control a Wordpress blog on the commandline
<mzdravkov>
apeiros_: that thing with the references sometimes really creeps me out
<kure>
I was wondering, is there a place where people post their recently-made creations? Where can people promote their gems?
brunops has joined #ruby
<apeiros_>
mzdravkov: let me assure you that the alternatives are almost universally worse
Megtastique has joined #ruby
rjhunter has quit [Ping timeout: 246 seconds]
udon has joined #ruby
<apeiros_>
mzdravkov: the only viable alternative IMO is to have all objects immutable - but I prefer having mutable objects.
gja has quit [Quit: This computer has gone to sleep]
<shevy>
one is gtk2 ... one is gtk3
<shevy>
guess which one is which (ok the URL gives the hint, but still... :P )
freerobby has joined #ruby
<mzdravkov>
apeiros_: I like immutability. One time I was writing functional code for a while, and then have to write something in ruby, and I was really going mad, because I had used to immutability :D
Mars` has joined #ruby
<Hanmac>
shevy why does gtk3 looks so shity with this? ;D
codecop has joined #ruby
<shevy>
haha
<shevy>
kou does not have windows and can not test what he does on windows... dunno why it looks so awful
Mars`_ has joined #ruby
heidi has joined #ruby
vikhyat_ has quit [Ping timeout: 272 seconds]
<shevy>
kure rubyforge used to have an announcement page
<shevy>
but it will be closed soon
Megtastique has quit [Ping timeout: 240 seconds]
phipes has joined #ruby
Mars` has quit [Ping timeout: 240 seconds]
Megtastique has joined #ruby
vikhyat has joined #ruby
<WJW>
Sometimes I design objects to be mutated only during an initialization phase, after which I make sure not to mutate them.
gregoriokusowski has quit [Quit: gregoriokusowski]
Yan__ has quit [Ping timeout: 260 seconds]
<apeiros_>
"make sure" - just use #freeze ;-)
nowthatsamatt has quit [Quit: nowthatsamatt]
Hanmac1 has joined #ruby
Megtastique has quit [Client Quit]
Hanmac has quit [Ping timeout: 246 seconds]
mmitchell has quit [Remote host closed the connection]
<apeiros_>
sublime is really terrible at guessing soft-tab-width
<apeiros_>
and I don't know why it guesses either… I configured it… should just use those values.
CaptainJet has quit [Read error: No route to host]
timonv has joined #ruby
phansch has quit [Quit: Leaving]
<WJW>
>> 1
wlanboy_ has quit [Changing host]
wlanboy_ has joined #ruby
<shevy>
I hate #freeze, is it useful for anything really?
<apeiros_>
is that like "-1", just that you're shifting?
CaptainJet has joined #ruby
Mars`_ has quit [Remote host closed the connection]
<apeiros_>
shevy: totally. it makes objects immutable. which is awesome for many things.
flame_ has joined #ruby
<WJW>
On some Unices of the past, if you typed "1" as a command, the system would respond, "One Bell System -- It Works."
m8 has quit [Quit: Sto andando via]
<apeiros_>
consider if numeric values were mutable, or symbols. that'd be horrible. I used it extensively e.g. in my color library, all color instances there are immutable too.
wlanboy_ is now known as wlanboy
<shevy>
hmm
chrisramon has quit [Quit: chrisramon]
carraroj has quit [Ping timeout: 245 seconds]
<apeiros_>
value objects often want to be (and should be) immutable.
vlad_starkov has quit [Remote host closed the connection]
<WJW>
They used to say about Fortrash, constants aren't, and variables don't.
<apeiros_>
I don't use it as often as I should as it's annoying to type .freeze all the time :)
<apeiros_>
Fortrash?
<WJW>
Formula Translation.
<apeiros_>
:-/ never heard of that
Mars` has joined #ruby
<apeiros_>
just how old are you? :-D
<WJW>
60
vlad_starkov has joined #ruby
icantbecool has joined #ruby
<apeiros_>
I see, quite a bit more experience than I then
<WJW>
Unless I have wasted my life.
<apeiros_>
I don't think there's such a thing
Yan__ has joined #ruby
<apeiros_>
in the cosmic sense, we're all just dust
heidi has quit [Quit: Leaving.]
heidi has joined #ruby
<apeiros_>
so the only value that matters is the one you assess it to have.
<mzdravkov>
apeiros_: yes, ive heard stories of the times when numbers were mutable in fortran, and someone had said: You have never lived, until you try to debug a fortran program, where the value of 2 is 3 :D
chrisramon has quit [Client Quit]
phipes has quit [Remote host closed the connection]
<WJW>
Yes, you just pass 2 to a "function" or a subroutine, let it mutate its parameter.
<apeiros_>
mzdravkov: lol, yeah, sounds like an awesome situation to be in
<WJW>
Not worse than runaway pointers in C.
<kure>
shevy, oh thats a shame.. Thanks
Megtastique has joined #ruby
<kure>
But, apeiros_ , why bother doing .freeze? Isn't that the same of not mutating the object yourself?
<kure>
Or is it to prevent some calls from doing something behind your back?
<WJW>
I trust my designs and I trust my code to follow my designs.
aspires has joined #ruby
Megtastique has quit [Client Quit]
colonolGron has quit [Ping timeout: 246 seconds]
<mzdravkov>
kure: I may pass the object to some 3th party library and freeze makes you sure they wont change your object
bogeyd6 has quit [Read error: Connection reset by peer]
<WJW>
You might think that .freeze makes things safer, but I'm sure it doesn't traverse the tree of referenced objects to make sure they're immutable too, and it doesn't keep you from calling "new" on a class, which is inherently an imperative operation.
<mzdravkov>
kure: You can use freeze by default if you don't need to change the object. So that if you make mistake somewhere you can easily find where you are trying to change the immutable object
Mars` has quit [Ping timeout: 240 seconds]
Sawbones has quit [Remote host closed the connection]
flame_ has quit [Quit: Computer has gone to sleep.]
<apeiros_>
kure: it's to prevent something accidentally mutates the object
Sawbones has joined #ruby
<kure>
Thanks, guys! But since we're on it, could you give me an example on a situation where you wouldn't wanna mutate something?
<apeiros_>
kure: "it's the same is if you'd not mutate the object yourself" is equivalent of saying "it's the same if we'd not write buggy code"
<kure>
I can only think on Functional Programming n stuf
<apeiros_>
kure: as said, e.g. numeric classes, Symbol
<WJW>
Functional style is good to use even when you are not using a pure functional programming language.
<apeiros_>
or a color. red is red. changing the amount of blue in a color named 'red' would make it not be red anymore.
cj3kim has joined #ruby
<WJW>
Functional style makes your programs easier to read.
<kure>
apeiros_, lol, indeed. Got that
Steven_ has quit [Remote host closed the connection]
vikhyat has quit [Remote host closed the connection]
dylandog has quit [Ping timeout: 252 seconds]
brennanMKE has joined #ruby
<mzdravkov>
kure: in fact ruby has a lot of functional aspects. It's hardly inspired by lisp, which is functional
<kure>
WJW, I once saw an article about exactly that, gonna research on it
<WJW>
Heavily inspired by Lisp.
drago777 has quit [Ping timeout: 240 seconds]
lewix has quit [Remote host closed the connection]
Steven_ has joined #ruby
<mzdravkov>
WJW: yeah, I wonder how could I use the hardly. It's too bad even for my bad english :D
<WJW>
Functional programs have meaning the way mathematical notation has meaning.
<WJW>
Lisp -> Smalltalk -> Ruby.
<mzdravkov>
kure: And it's really different way of looking at computing, so It's really fun
includex has joined #ruby
lewix has joined #ruby
<WJW>
Lisp was invented and implemented by 1959.
Kiba has quit [Ping timeout: 272 seconds]
<kure>
mzdravkov, have you done any code that plays with functional aspects of ruby? I'd like to give it a try
drago777 has joined #ruby
Sawbones has quit [Ping timeout: 245 seconds]
<WJW>
Lisp pioneered the kind of garbage collection that Ruby, Smalltalk, Java, Javascript, etc. do.
bogeyd6 has joined #ruby
<WJW>
The 'reduce' method on collections is a good example of a functional function.
<apeiros_>
Enumerable module in general
Megtastique has joined #ruby
<WJW>
Also the use of 'map' is typical of functional programming.
<WJW>
Those are higher-order functions, because they take a function as argument.
<mzdravkov>
kure: All the code we write has "some" functional aspects. For example using array.map is functional style. Although in pure functional language you will use function to pass to the map for example (map inc [1 2 3]), rather than block like ruby [1,2,3].map {|i| i.inc}
<WJW>
The use of higher-order functions is typical of functional programming.
<WJW>
The block is just Ruby's funny syntax.
TomRone has quit [Ping timeout: 240 seconds]
cj3kim has quit [Remote host closed the connection]
flame_ has joined #ruby
Steven_ has quit [Ping timeout: 272 seconds]
<WJW>
It is easy to map funny syntax to straightforward syntax like that of Lisp, Smalltalk, or Javascript.
axl_ has quit [Quit: axl_]
specious has joined #ruby
popl has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
<kure>
But since we only create new things, never change them, isn't this a performance issue?
<kure>
I mean, every cal too a function creates a copy of it's arguments
<WJW>
I guess Matz thought that the case of passing one immediately constructed procedure as an argument (not more than one) is so frequent that it is worth having special syntax.
lewix has quit [Remote host closed the connection]
heidi has quit [Quit: Leaving.]
xiphias has quit [Ping timeout: 240 seconds]
fantazo has joined #ruby
<WJW>
For many applications, getting them right is more important than performance.
TomRone has joined #ruby
<Mon_Ouie>
In a functional programming language, you'd usually see that as an implementation detail. A smart implementation could decide to mutate some objects instead of creating a copy every time, even though there is no concept of mutation in the code.
<WJW>
Above where I said "procedure", substitute "closure".
xiphias has joined #ruby
heidi has joined #ruby
<kure>
Mon_Ouie, yeah that makes sense. "Compiling" into mutable code while mantaining the theorical behavior
CaptainJet has quit [Read error: Connection reset by peer]
drago777 has quit [Ping timeout: 240 seconds]
<apeiros_>
WJW: IMO that was one of matz' best decisions
<apeiros_>
rubys block syntax was what initially led me to ruby in the first place.
vlad_starkov has quit [Remote host closed the connection]
<apeiros_>
I find it sad that he didn't generalize it more. but well, can't have everything.
Yan__ has quit [Ping timeout: 252 seconds]
m_3 has quit [Remote host closed the connection]
drago777 has joined #ruby
Astralum has joined #ruby
CaptainJet has joined #ruby
<WJW>
IMO one of Matz' best decisions was the syntax and semantics of assignment operators. A selector ending in '=', such as foo=, he assumes it represents an assignment. So if you say self.foo = self.bar = "bletch", the language ignores whatever the bar= method tries to return and uses assignment semantics.
Mars`_ has quit [Remote host closed the connection]
Sawbones has joined #ruby
<WJW>
I think Matz tried to make sure that code can mean what it looks like it means.
<WJW>
All within the imperative paradigm of course.
<WJW>
But also catering to functional style wherever the programmer might want to use it.
phipes has joined #ruby
<AntelopeSalad>
i really like blocks
<mzdravkov>
I have one idea from long ago. I am wondering if I can implement a method on some class (for example the object class), where you can say object.apply and pass a block and every method call in the block is being run on self. For example a=42; a.apply {inc} will just inc 'a'
lnormous has quit [Quit: Leaving]
<WJW>
In Smalltalk or the Self language, you couldn't say foo.bar = 2. You would say foo bar: 2.
<apeiros_>
oh, rare that somebody knows Self
<WJW>
Self is the main intellectual predecessor to Javascript..
<WJW>
mzdravkov, I think it might be possible to do that.
nomenkun has joined #ruby
<WJW>
mzdravkov, on second thought, not quite with the syntax you give.
<apeiros_>
mzdravkov: instance_*
<apeiros_>
instance_eval & instance_exec
m_3 has joined #ruby
<WJW>
mzdravkov, on third throught, yes, with the syntax you give, I think so.
<apeiros_>
"being run on self" means self.methodname, though, not methodname(self), as in your example.
<apeiros_>
also since 42 can't be mutated…
<WJW>
apeiros_ is right.
platzhirsch has joined #ruby
<mzdravkov>
apeiros_: yes my example with mutating 42 was bad :(
Virtualize has joined #ruby
axl_ has joined #ruby
<WJW>
In Ruby and Self, the implied receiver is self.
<apeiros_>
>> x = "foo"; x.instance_eval do upcase! end; x # => "FOO"
<apeiros_>
mzdravkov: instance_eval/_exec is how most DSLs are implemented
bogeyd6 has quit [Read error: Connection reset by peer]
<WJW>
Another brilliance of Matz's work, the amenability to add DSLs.
rippa has joined #ruby
jalcine has quit [Excess Flood]
Kiba has joined #ruby
<mzdravkov>
apeiros_: yep, idk why I haven't thought of them to achieve this, because I use the not so rarely...
pskosinski has quit [Remote host closed the connection]
Virtualize has quit [Ping timeout: 240 seconds]
tvw has quit []
pskosinski has joined #ruby
<mzdravkov>
I just have to get use to use this. It is common to have few method call on one object, so using instance_exec would be a very cool patter
freggles has quit [Remote host closed the connection]
<apeiros_>
rubys syntax is quite an achievement. it's hard to get such a noiseless syntax done (I've tried and still am trying… sigils are a very appealing cheap way out, but increase noise quickly)
havenwood has quit [Remote host closed the connection]
jalcine has joined #ruby
<apeiros_>
mzdravkov: just chain
<apeiros_>
mzdravkov: but remember, don't chain mutating methods, many of them return nil if nothing changed.
<WJW>
Lisp and Smalltalk said, here's a simple syntax, the semantics is up to the programmers. Ruby says, here's a math-like syntax you can use to write what you mean.
havenwood has joined #ruby
<mzdravkov>
yeah, but chaining more then few methods is ugly
<mzdravkov>
and this pattern with the block can be used for mutating methods
pskosinski has quit [Remote host closed the connection]
<waxjar>
IOs syntax is quite appealing but I think it can become verbose quite quickly
nowthatsamatt has joined #ruby
Czupa has quit [Remote host closed the connection]
<apeiros_>
WJW: btw., re env - it's now a .name attribute on the configuration. because that's what it really is - a name for a configuration.
pskosinski has joined #ruby
<pcfreak30>
In a puppet function, I am running puts method.class.name and its outputting Symbol? Any ideas
atmosx has joined #ruby
drumusician has joined #ruby
<apeiros_>
and rails style .development? etc. methods accompanying it, to make testing which env the app runs in easier.
<WJW>
If so, I would like to know what is replacing it.
<WJW>
What arg?
<mzdravkov>
damn it, I was trying to debug some stupid error, where I give to my form_tag in rails method: :put and it creates html with post method. It turns out that that's normal, because "However, most browsers don’t support methods other than “GET” and “POST” when it comes to submitting forms. Rails works around this issue by emulating other methods over POST with a hidden input named "_method", which is set to reflect the desired method. "
<pcfreak30>
its supposed to be listConnections
chrisan has quit [Ping timeout: 272 seconds]
<mzdravkov>
I hate it when the IT just doesn't work!
<pcfreak30>
and idk what arg is or where it came from
icantbecool has quit [Quit: Computer has gone to sleep.]
carlsedn_ has joined #ruby
<shevy>
hmm
dscrd has joined #ruby
adam- is now known as adam
freggles has joined #ruby
geggam has joined #ruby
MrPopinjay has joined #ruby
<WJW>
There is a channel #rails.
carlsednaoui has quit [Ping timeout: 252 seconds]
<WJW>
pcfreak30, it outputs "arg"? Please show the current version of the code.
timonv has quit [Remote host closed the connection]
vikhyat has joined #ruby
<shevy>
the /var/lib stuff sounds typical debian problem
<WJW>
I never use a system Ruby or system gems. I use rbenv to get ruby.
<pcfreak30>
fails regardless
<pcfreak30>
it wont install
zeade has quit [Quit: Leaving.]
<pcfreak30>
dies before even trying a system folder
<shevy>
Hanmac1, how do you install into /var/lib
mdpatrick has joined #ruby
<deryl>
as for mkmf being needed, idk what distrib you're on, but do an apt-cache search mkmf (or if you have apt-file installed on a debian or debian derivative do apt-file find mkmf)
lkba has quit [Ping timeout: 245 seconds]
<shevy>
debian hates mkmf
<deryl>
yeah you're missing the mkmf command according to your output
<apeiros_>
kure: sometimes it just needs a mixin, like ThreeSome or somesuch ;-)
<kure>
I tried to use require_relative on my wife1.0 but it would still throw an ArgumentError
mityaz has quit [Quit: See ya!]
<deryl>
atmosx, Oh i do but she does just as much. so its even steven
<pcfreak30>
o then can someone give me a straight answer on importing a lib thats in the same folder
<apeiros_>
pcfreak30: set up your $LOAD_PATH properly
larissa has joined #ruby
<deryl>
kure, ROTFL
<deryl>
now THATs funny
Megtastique has joined #ruby
bklane has joined #ruby
<apeiros_>
require 'foo' will try to load foo.rb relative to every directory listed in $LOAD_PATH, starting at index 0
<apeiros_>
and $LOAD_PATH is just an array, you can use all the normal Array methods to change it, like <<, .unshift etc.
shime has quit [Ping timeout: 246 seconds]
sassamo_ has quit [Ping timeout: 245 seconds]
<deryl>
kure, becareful with require_relative with wife models. They usually tend to load wrong and think you're trying to require_relative "sister_in_law"
dapz has quit [Ping timeout: 272 seconds]
<atmosx>
Have to go guys, cya tomorrow (hopefully) ;-)
<WJW>
You are trying to define some kind of template for each possible verb in one of these calls you want to put over the wire. The template lets you fill in default arguments, etc.
<apeiros_>
argnames is an array. can't do argnames[:name]
<apeiros_>
you probably wanted name = argnames[index][:name]
<pcfreak30>
yea
nisstyre has joined #ruby
<pcfreak30>
find and replace didnt catch that
figgleberry has quit [Client Quit]
<pcfreak30>
fml. this is getting old
rjhunter has quit [Ping timeout: 245 seconds]
deol has quit [Ping timeout: 245 seconds]
brennanMKE has quit [Read error: Connection reset by peer]
brennanMKE has joined #ruby
<pcfreak30>
atleast i can put debug msgs to find out how far its executing
<apeiros_>
you could also just write a unit test and do proper debugging.
<apeiros_>
make sure it works outside of puppet. then put it into puppet. much less headache.
mmitchell has quit [Ping timeout: 272 seconds]
<pcfreak30>
how do you do unit tests?
jamesaxl_ has joined #ruby
jamesaxl has quit [Ping timeout: 246 seconds]
<pcfreak30>
this isnt in rails or any framework to auto run em
Notte_ has joined #ruby
<apeiros_>
you don't need autorun
kep has joined #ruby
<apeiros_>
choose a unit test framework, read its manual, write tests.
<pcfreak30>
any recommendations?
<WJW>
An example would be rspec.
<apeiros_>
popular ones: test/unit (stdlib), minitest, rspec, beacon
<WJW>
I suppose one could write tests ad-hoc, but I guess people with experience prefer the packages.
Notte has quit [Ping timeout: 252 seconds]
<waxjar>
cutest <3
joaoh82 has joined #ruby
ForceMultiplier has joined #ruby
<apeiros_>
pcfreak30: btw., a) you have various lines ending in ; - ruby doesn't need ; as line terminators, b) you should avoid naming your method `send` (Object#send exists)
<apeiros_>
(and could be written much nicer as params.values.join('') anyway)
<pcfreak30>
eh
<pcfreak30>
may rename. though i was just replicating a lib
<platzhirsch>
When I look at the bulks of code to re-re-refactor I start to feel very sleepy
Hanmac1 has joined #ruby
<pcfreak30>
im actually making a separate repo for this lib alone
<apeiros_>
also, #{} invokes to_s on the value it evaluates to
<apeiros_>
so #{foo.to_s} is just a verbose way of writing #{foo}
Hanmac has quit [Ping timeout: 246 seconds]
<apeiros_>
and: since within argnames.each_index { |index| you always only use argnames[index], you'd better do argnames.each do |argname| and then use argname instead of argnames[index]
<WJW>
ForceMultiplier, you need something to make sure that if any of your data have characters that a browser would interpret as HTML syntax for tags and such, those characters get escaped.
<ForceMultiplier>
i sort of know what that means, but does it apply here?
<apeiros_>
ForceMultiplier: imdb is an Array, you can't use strings to access an array
smathieu has joined #ruby
<pcfreak30>
i dont get the syntax of bowling.score.should eq(0)
<WJW>
ForceMultiplier, if you are getting a string from some database or some API, and the string could have for example "<", you need to convert it into "<".
mengu has joined #ruby
<apeiros_>
pcfreak30: honestly, given your level of expertise, I'd disadvise from rspec
<pcfreak30>
where is eq method from as its not from should object
<apeiros_>
use something more straight forward, like minitest
Hobogrammer has joined #ruby
<pcfreak30>
apeiros_: if im going to do stuff, trying to do right as i like to be organized regardless of the lang. i learn fast anyways
<apeiros_>
ForceMultiplier: notice how your imdb inspect starts with [{
<apeiros_>
ForceMultiplier: meaning it's an array containing a hash
<apeiros_>
pcfreak30: rspec is not more right than minitest.
<apeiros_>
or "doing it right"
<ForceMultiplier>
apeiros_ ahhhhhhh
<apeiros_>
(personally I find it even doing it wrong - but that's a subjective thing…)
TheMoonMaster has quit [Ping timeout: 245 seconds]
coffeina has joined #ruby
mksm_ has quit [Ping timeout: 245 seconds]
gtc has quit [Ping timeout: 240 seconds]
<ForceMultiplier>
apeiros_: how does one access an array containing a hash, then?
brunops has quit [Ping timeout: 260 seconds]
smathieu has quit [Ping timeout: 240 seconds]
crodas has quit [Ping timeout: 252 seconds]
<apeiros_>
ForceMultiplier: it doesn't matter what an array contains
brunops has joined #ruby
<apeiros_>
you always access an array by index, indexes are positional, numeric.
<pcfreak30>
array[0][:key]
<pcfreak30>
?
<WJW>
ForceMultiplier, you index into your array with a number, then you "index" into the result with your hash key.
angelixd has quit [Ping timeout: 252 seconds]
mjmac has quit [Ping timeout: 240 seconds]
<WJW>
pcfreak30, yes, array[0][:key].
timonv has joined #ruby
<apeiros_>
or rather 'key' than :key, since he has string keys in the hash.
lyanchih_ has joined #ruby
angelixd has joined #ruby
<pcfreak30>
i was more of telling ForceMultiplier that than asing if i was right WJW