apeiros changed the topic of #ruby to: Ruby 2.0.0-p353: http://ruby-lang.org (Ruby 1.9.3-p484) || Paste >3 lines of text on http://gist.github.com || this channel is logged at http://irclog.whitequark.org, other public logging is prohibited
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]
<benzrf> *2.1
platzhirsch has left #ruby [#ruby]
tylersmith has joined #ruby
mr_red has joined #ruby
<benzrf> def-expr?
mdev has quit [Remote host closed the connection]
ewnd9 has joined #ruby
aharris6 has quit [Read error: Connection reset by peer]
tylersmith has quit [Remote host closed the connection]
Steven_ has joined #ruby
tylersmith has joined #ruby
Mars` has quit [Ping timeout: 272 seconds]
flubba has quit [Remote host closed the connection]
tylersmith has quit [Remote host closed the connection]
specious has quit [Ping timeout: 260 seconds]
Steven_ has quit [Ping timeout: 252 seconds]
ozkan has quit [Quit: Linkinus - http://linkinus.com]
ewnd9 has quit [Remote host closed the connection]
mary5030_ has quit [Remote host closed the connection]
ewnd9 has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
mikepack has joined #ruby
benzrf has left #ruby [#ruby]
deol has quit [Remote host closed the connection]
deol has joined #ruby
jonathanwallace has joined #ruby
pskosinski has quit [Quit: Til rivido Idisti!]
lmickh_ has joined #ruby
maroloccio has joined #ruby
lmickh has quit [Ping timeout: 252 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bricker`LA has joined #ruby
mikepack has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
ambushsabre has joined #ruby
mikepack has joined #ruby
peneconleche has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
rjhunter has quit [Remote host closed the connection]
nari has joined #ruby
magoo has quit [Quit: WeeChat 0.4.2]
psyl0n has quit [Remote host closed the connection]
wowowewa has quit [Ping timeout: 272 seconds]
wowowewa has joined #ruby
dscrd has quit [Quit: .]
marr has quit []
peneconleche has quit [Quit: Leaving...]
dkamioka has joined #ruby
l3ck has joined #ruby
dkamioka_ has quit [Ping timeout: 246 seconds]
simplyaubs has quit [Quit: simplyaubs]
lmickh_ has quit [Ping timeout: 246 seconds]
simplyaubs has joined #ruby
benzrf has joined #ruby
maletor has joined #ruby
charliesome has joined #ruby
Astralum has quit [Ping timeout: 245 seconds]
<benzrf> hi, do arrays have a method for like
<benzrf> p:
<benzrf> taking array a and array b
<benzrf> and returning array a but with each element replaced with the corresponding one from b if it's nil
<benzrf> like mapping ||=
RoryHughes has quit []
cow_ has quit [Remote host closed the connection]
atno_ has joined #ruby
<benzrf> something like zipWith (<>) for [First a] in haskell
cow_ has joined #ruby
<Nilium> I don't think so.
cow_ has quit [Read error: Connection reset by peer]
<benzrf> lame
cow_ has joined #ruby
Guedes0 has quit [Ping timeout: 240 seconds]
<benzrf> what's the best way to deal with defaults other than nil for struct subclasses btw?
mary5030 has joined #ruby
<Nilium> You could do a.zip(b).map { |i| i.reject{ |x| x.nil? }.first }
jellow has joined #ruby
atno has quit [Ping timeout: 272 seconds]
<Nilium> If you need default values, I'd say use an actual class.
carlsednaoui has joined #ruby
<benzrf> right now i have:
<benzrf> 45 def initialize(arena, red_kills=0, blue_kills=0, state=:pending)
<benzrf> 47 end
<benzrf> 46 super(arena, red_kills, blue_kills, state)
Kricir has joined #ruby
<Nilium> Then you can just provide defaults in the initialize method.
<benzrf> which seems unnecessarily verbose
<Nilium> I'm not sure I see the verbose part.
<benzrf> writing out all the names 3 times
<benzrf> once in the struct def, once in init, once in super
<Nilium> So write a function to do it for you.
<benzrf> buh
<benzrf> ok thx
<benzrf> ;p
benzrf has left #ruby [#ruby]
<Nilium> Strange fellow.
carlsednaoui has quit [Remote host closed the connection]
Iszak_ has quit [Quit: Textual IRC Client: www.textualapp.com]
FenixFyreX has quit [Quit: Page closed]
<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)?
<tappi> s/scripting languages/dynamic programming languages/
Mars` has joined #ruby
dkamioka_ has joined #ruby
mojjojo has joined #ruby
Neomex has joined #ruby
heidi has quit [Quit: Leaving.]
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
<Nilium> I'm not saying don't use a reference.
<ddd> tappi: well you can, just not very well
<tappi> jamo googled ruby pickaxe and i got this http://ruby-doc.com/docs/ProgrammingRuby/
<tappi> was that correct?
<ddd> oh you got it already hehe nm
<Nilium> I'm just saying you probably just need a barebones syntax intro and then you're likely good to go.
Kricir has quit [Ping timeout: 252 seconds]
<ddd> its just fine for 1.8 and 1.9. and even 2.0
falood has joined #ruby
<tappi> nilium go back to my first question
<ddd> there are some language changes and additions but nothing that will throw a money wrench at you except when going backawrds
<tappi> jamo thanks
<Jamo> np
atzorvas has quit [Ping timeout: 246 seconds]
flubba has quit [Remote host closed the connection]
<Nilium> I had a really old plaintext version of that. Was basically how I learned.
<ddd> like 1.8 hash rocket is :key => "value" and in 1.9 you can use that or the nicer key: "value"
<ddd> stuff like that
<Jamo> personally I still prefer this: http://eloquentruby.com/
<Nilium> You should prefer :key => "value" >_>
aspiers has quit [Ping timeout: 252 seconds]
mercwithamouth has joined #ruby
<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...
<Nilium> O_o
l3ck has quit [Quit: Bye!]
<Nilium> What about Ruby 1.6?
CpuID has joined #ruby
pyrac has quit [Quit: pyrac]
<ddd> the free book covers it
<tappi> http://ruby-doc.com/docs/ProgrammingRuby/ "This book documents Version 1.6 of Ruby, which was released in September 2000."
Mars` has quit [Remote host closed the connection]
<apeiros> didn't he release a newer version in the mean time?
<apeiros> I mean, for free
<ddd> I thought so
<Nilium> I'm pretty sure there's a newer version
<Nilium> For free, that is.
Synthead has joined #ruby
deol has joined #ruby
tylersmith has quit [Ping timeout: 245 seconds]
<Nilium> Not sure if that was linked yet
amundj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
specious has joined #ruby
guardian_ has joined #ruby
flame_ has joined #ruby
larissa has quit [Ping timeout: 245 seconds]
larissa has joined #ruby
hd1 has joined #ruby
jamesaxl_ has quit [Ping timeout: 272 seconds]
specious has quit [Ping timeout: 260 seconds]
hd1 has left #ruby [#ruby]
Mars` has joined #ruby
michael_lee has joined #ruby
ss_ has joined #ruby
cow_ has joined #ruby
pskosinski has joined #ruby
heidi has joined #ruby
Megtastique has quit []
MattStratton has joined #ruby
dawe_ has joined #ruby
cbetta is now known as cbetta_afk
mixonic has joined #ruby
cbetta_afk is now known as cbetta
dawe_ has quit [Client Quit]
dawe has quit [Ping timeout: 252 seconds]
dima_ has joined #ruby
jrobeson has quit [Remote host closed the connection]
mixonic has quit [Client Quit]
vlad_starkov has quit [Ping timeout: 252 seconds]
specious has joined #ruby
chrisan has quit [Ping timeout: 246 seconds]
cj3kim_ has joined #ruby
nfk has quit [Quit: yawn]
flubba has joined #ruby
grep_away is now known as grep_awesome
gr33n7007h has quit [Remote host closed the connection]
vikhyat_ has joined #ruby
vikhyat has quit [Ping timeout: 246 seconds]
byprdct has joined #ruby
deol has quit [Ping timeout: 272 seconds]
CaptainJet has joined #ruby
Hanmac has quit [Ping timeout: 246 seconds]
CaptainJet has quit [Read error: Connection reset by peer]
apeiros has quit [Remote host closed the connection]
radic_ has quit [Ping timeout: 252 seconds]
dima_ has quit [Remote host closed the connection]
radic has joined #ruby
cj3kim_ has quit [Remote host closed the connection]
specious has quit [Ping timeout: 272 seconds]
CaptainJet has joined #ruby
reach has joined #ruby
<anshin> Nilium: https://rubygems.org/gems/gir_ffi-gtk am I misunderstanding this?
Kricir has joined #ruby
<anshin> Nilium: my understanding is that it supplies GTK bindings that are always up-to-date by nature
<Nilium> GTK bindings are kind of useless on OS X.
<anshin> ah
<anshin> you spoke broadly so I didn't know you were using OS X
Jeticus has joined #ruby
ambushsabre has quit [Quit: rip]
aryaching_ has joined #ruby
<anshin> Nilium: http://www.gtk.org/download/macos.php you may or may not be interested in this, apparently GTK can be used on OS X
felipebalbi has joined #ruby
flubba has quit [Remote host closed the connection]
<anshin> I knew it could be used on Windows, but I didn't know about OS X
<Nilium> I know it can be used on OS X, but you really don't want to see what their standard for "usable" is
CaptainJet has quit [Ping timeout: 260 seconds]
<anshin> ah
felipebalbi has left #ruby [#ruby]
<bnagy> hm, never heard of gir ffi before
<Nilium> Hm
<bnagy> looks kinda dodgy, but it's a cool approach
Jeticus has quit [Client Quit]
<Nilium> Interesting if you use glib stuff, I suppose.
aryaching has quit [Ping timeout: 260 seconds]
<Nilium> I'd probably favor hand-made bindings over those unless they were the only thing available, though
<anshin> why's that?
flubba has joined #ruby
<Nilium> Just more concern for whether the API is well-designed.
echevemaster has joined #ruby
CaptainJet has joined #ruby
<anshin> I'm almost entirely unfamiliar with the concepts, so I wouldn't know about possible drawbacks
Hanmac has joined #ruby
<Nilium> You could probably combine both and add on to the wrapped APIs.
<bnagy> doing an introspection based binding could have who knows how many bugs and fiddly bits and the author would never know
<bnagy> because the 'wrapping' isn't generated until needed
<bnagy> hand made bindings have an explicit API that's easier to read and test
<Nilium> What I'd really like, at the moment, is for Teleglitch to give me the resources necessary to build a nailgun.
vongrippen has joined #ruby
dima_ has joined #ruby
<bnagy> but it takes a long time to hand write bindings if you don't use code generation
CaptainJet has quit [Client Quit]
<anshin> is there an up-to-date set of bindings for gtk in ruby?
<bnagy> who cares?
<bnagy> gtk is fucking vile
<popl> tell us how you really feel
rjhunter has quit [Remote host closed the connection]
<bnagy> :D
<anshin> if I didn't care, I doubt I would have asked the question
<popl> I was talking to bnagy, anshin
<anshin> popl: so was I
<popl> oh, it seemed like a response to me. sorry.
<popl> anshin: did you find anything on the interwebs?
* Nilium tries to avoid GTK on OS X because it tends to involve starting an X server.
<Nilium> The alternative is the Quartz implementation, but that's.. bad.
<popl> anshin: or is this the first place you tried to look?
<anshin> yeah I found the gir-ffi thing
<popl> anshin: Are you locked into using GTK?
<anshin> but they said it's likely to be riddled with strange bugs
<anshin> nope
<anshin> GTK is just all I'm familiar with at the moment
<anshin> well, I'm mildly familiar with qt
<popl> I like Qt better.
<Nilium> Bah humbug, died.
<popl> There are tons of toolkits though.
<popl> FLTK is fine.
heidi has quit [Quit: Leaving.]
<anshin> someone mentioned fltk to me a while back, now that you mention it
<popl> I know there are Ruby bindings for it, not that I've ever used them.
mehlah has quit [Read error: Connection reset by peer]
brennanMKE has joined #ruby
<popl> That's for 1.1, there is another project for FLTK 2 bindings.
<Nilium> FLTK's an unusually nifty and horrifying beast
ylluminate has quit [Quit: Bye!]
<anshin> I'll check it out
<bnagy> hm I wonder if I could write a generic .NET / COM wrapper using FFI and their Reflection api
<Nilium> It's kind of like what you'd get if you took Tk and made it slightly less ugly and more usable
<Nilium> Probably.
<bnagy> all 6 ruby on windows users would rejoice!
<popl> Did someone mention Shoes?
larissa has quit [Quit: Leaving]
<Nilium> Whoever mentioned shoes dies
<popl> I feel I have to if we are talking about GUI toolkits.
<popl> Nilium: Eventually, I suppose.
deol has joined #ruby
<anshin> is Shoes dead?
<bnagy> was it ever usable for anything more than toys?
<bnagy> it's nice to code with, you know, for kids.
<popl> Wasn't that the goal anyways? You know, for learning?
<anshin> ^
<Nilium> It's not terribly useful for doing things.
<popl> That sounds like a challenge, Nilium.
<anshin> I'm not sure it was supposed to be
<bnagy> I never got the impression anyone was promoting it for 'real' tools
<Nilium> No, it's just the cold, hard reality of shoes.
<popl> Like Logo or something.
<Nilium> Speaking of which, I finally got a new pair of shoes after 3 years.
<bnagy> I wrote a toy gui in it like 7 years ago
<popl> I got a new pair of boots.
heidi has joined #ruby
<popl> They're ok as long as I don't lace them too tightly.
<bnagy> in other news, the guys here just caught a 3 foot viper
<anshin> I got a new pair of boots too
<popl> Nilium: I had my previous pair of boots for 4-5 years. What sort of shoes did you get?
<anshin> they're the most comfortable shoes I've owned in years
<popl> bnagy: Did they step on it with their boots?
<Nilium> Normal-ish pseudo-hiking shoes.
<Nilium> I've had my current pair of boots for about 5 to 6 years, they're still fine
<bnagy> no they had it on a stick. They were waving it around near my head so I could take a picture
<popl> Mine are worse for wear.
CaptainJet has joined #ruby
<popl> bnagy: Did you scream?
deryl has joined #ruby
<bnagy> now I suspect they're going to go and kill it somewhere
dima_ has quit [Remote host closed the connection]
<Nilium> Doc Martens are plenty sturdy for the amount of use I get out of boots.
<Nilium> Meaning not much.
<bnagy> I did not, for I am manly and tough
lyanchih_ has joined #ruby
<popl> Mine are Doc Martens, Nilium.
<popl> The soles are worn thing though and cracked.
<popl> bnagy: I don't believe it.
deol has quit [Ping timeout: 272 seconds]
<bnagy> fair call
<bnagy> I didn't scream though
<popl> What sort of viper?
<bnagy> a kind of green one?
<popl> Was it a vindow viper?
flame_ has quit [Quit: Computer has gone to sleep.]
<popl> bnagy: Where in the world are you located?
pcfreak30 has joined #ruby
<bnagy> I'm in .my this week, up north
<bnagy> so snakes and monkeys and leeches etc abound
maroloccio has quit [Quit: WeeChat 0.4.2]
prc has quit [Quit: Leaving.]
vlad_starkov has joined #ruby
<pcfreak30> How could you tale a methods arguments and get it as an array, then set them all on the object?
<anshin> leeches are so cool
mercwithamouth has quit [Ping timeout: 245 seconds]
<bnagy> pcfreak30: afaik you can only get the arity, unless you start parsing
<popl> bnagy: It was probably poisonous.
<bnagy> I don't know what 'set them all on the object' means
flame_ has joined #ruby
<bnagy> hm, pit viper, apparently
<popl> That's what I'm thinking of but you would know better than I would (having seen it).
phipes has quit [Remote host closed the connection]
<pcfreak30> bnagy: arity?
<bnagy> pcfreak30: how many arguments it takes
<pcfreak30> atm 3
phipes has joined #ruby
<bnagy> trouble is that because ruby is very dynamically typed there's not much more information that's useful
<pcfreak30> just figired it might be simpler
<bnagy> like the internal names the method uses for them is useless, and you can pass 3 anythings to a method with arity 3
<pcfreak30> to somehow set all method arguments as instane vars
vinian has joined #ruby
vinian has quit [Max SendQ exceeded]
<pcfreak30> the method though is the constrctor
<pcfreak30> constructor
<bnagy> why don't you just explain what you're actually trying to do, or gist the code you already have
<bnagy> that usually works better
<popl> Now I'm reading about snakes.
<popl> :P
<pcfreak30> dont really have much, and im a beginner coming from php
gigetoo has quit [Remote host closed the connection]
<bnagy> it's OK we don't judge
<bnagy> much
<popl> liar
<pcfreak30> ATM Im trying to port a php API class to ruby.
<pcfreak30> Thus a bit hard on me :P
flubba has quit [Remote host closed the connection]
<deryl> which one. one might already exist
<pcfreak30> already checked
<popl> Without knowing Ruby? What does the API do, maybe there's a gem that replicates the functionality
phipes has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
<pcfreak30> Irs for something that is not going to be widespread for a mass
<popl> So just fucking say already dude. :P
<pcfreak30> and the SAPI class was made by the devs
<popl> Is it a national secret? :P
pskosinski has quit [Quit: Til rivido Idisti!]
phipes has joined #ruby
<deryl> i've heard of being cryptic, but sheesh
<pcfreak30> If google doesnt pick itr up nothing will
heidi has quit [Quit: Leaving.]
<pcfreak30> Im messing with a panel software called multicraft deryl
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gigetoo has joined #ruby
juarlex has quit [Remote host closed the connection]
LexicalScope` has joined #ruby
grep_awesome is now known as grep_away
juarlex has joined #ruby
<pcfreak30> Not being cryptic, just know that I doubt many in here even know about the system, and I know theirs no pre-made library in ruby
vlad_starkov has quit [Remote host closed the connection]
<deryl> ah the minecraft api
nanoyak has joined #ruby
h0rrorvacui has quit [Ping timeout: 245 seconds]
Landshark753 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pcfreak30> deryl, no
<pcfreak30> multicraft is a panel software with its own api
Mars` has quit [Remote host closed the connection]
<pcfreak30> am not referring to minecraft code itself
<deryl> i know
<deryl> its for minecraft hosting. its the API for it
<pcfreak30> yea.
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]
ewnd9 has joined #ruby
phipes has joined #ruby
<pcfreak30> deryl: https://gist.github.com/anonymous/26ca62f819f9ecdadd1e thats all ive written presently
echevemaster has quit [Quit: Leaving]
flubba has joined #ruby
echevemaster has joined #ruby
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]
<pcfreak30> deryl posted it?
<deryl> i'm just used to putting it in to mirror the way I think which is why its usually empty unless its rails
<bnagy> *shrug*
<deryl> not that its absolutely needed
juarlex has quit [Remote host closed the connection]
<pcfreak30> Mk. I havent gone into rails
<pcfreak30> truthfully I am writing this for puppet
<deryl> forget rails til you learn ruby
<pcfreak30> As I dont care to do a shell call to php
<pcfreak30> bit messy in this case
<pcfreak30> i can say though rubymine is a timesaver
juarlex has joined #ruby
eade has quit [Remote host closed the connection]
flubba has joined #ruby
<deryl> if you're used to IDEs yes.
DrShoggoth has joined #ruby
<deryl> plenty that can write more quality code faster in vim than it takes for rubymine to launch and open your project
<deryl> depends on what you're used to, and what you need
rjhunter has joined #ruby
flubba has quit [Remote host closed the connection]
DrShoggoth has quit [Max SendQ exceeded]
gerstein has joined #ruby
charliesome has joined #ruby
flubba has joined #ruby
rjhunter has quit [Read error: Connection reset by peer]
DrShoggoth has joined #ruby
tappi has quit [Ping timeout: 272 seconds]
Sami345 has quit [Ping timeout: 260 seconds]
VesQ has quit [Ping timeout: 246 seconds]
agjacome has quit [Ping timeout: 252 seconds]
tharindu has quit [Quit: Leaving...]
dylandog has quit [Ping timeout: 246 seconds]
byprdct has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Virtualize has joined #ruby
dseitz has joined #ruby
vlad_starkov has joined #ruby
tharindu has joined #ruby
Virtualize has quit [Ping timeout: 245 seconds]
Hien has quit [Quit: leaving]
mary5030 has quit [Remote host closed the connection]
cflat has joined #ruby
CaptainJet has quit []
gja has joined #ruby
byprdct has joined #ruby
h0rrorvacui has joined #ruby
tharindu has quit [Ping timeout: 245 seconds]
Deele has joined #ruby
<pcfreak30> what is the best way to do post request without extra gem installs?
goganchic has joined #ruby
Hanmac has quit [Ping timeout: 240 seconds]
Hanmac1 has joined #ruby
juarlex has quit [Remote host closed the connection]
specious has joined #ruby
snath has joined #ruby
mary5030 has joined #ruby
brennanMKE has joined #ruby
jetblack has quit [Quit: leaving]
laphlaw has joined #ruby
dkamioka has joined #ruby
dkamioka_ has quit [Read error: Connection reset by peer]
cflat has quit [Remote host closed the connection]
pen has joined #ruby
Virtualize has joined #ruby
kate_r has joined #ruby
Mars` has joined #ruby
juarlex has joined #ruby
OdNairy has joined #ruby
<havenwood> pcfreak30: For simple stuff, a `Net::HTTP.post_form(URI('http...'), {...})` might do: http://www.ruby-doc.org/stdlib-2.1.0/libdoc/net/http/rdoc/Net/HTTP.html#method-c-post_form
Hien has joined #ruby
brennanMKE has quit [Ping timeout: 246 seconds]
Mars` has quit [Ping timeout: 252 seconds]
<havenwood> pcfreak30: Though I much prefer a `gem install httpclient` :P
<havenwood> or mechanize or typhoeus
<pcfreak30> havenwood: Im going to be running code on a puppet custom function so I dont now how to force a gem install
<havenwood> pcfreak30: ahh
Mars` has joined #ruby
<havenwood> pcfreak30: yeah, then Net::HTTP sounds right
<havenwood> pcfreak30: or figuring out gem installs on puppet, but i'm not familiar
vlad_starkov has quit [Read error: Connection reset by peer]
<pcfreak30> i know puppet lang well rnough
<pcfreak30> but not the ruby side
flame_ has quit [Quit: Computer has gone to sleep.]
<pcfreak30> also what do i need to require to make use of md5?
<havenwood> pcfreak30: require 'digest/md5'
<pcfreak30> ugg
<pcfreak30> does that need to be explictly installed?
<havenwood> pcfreak30: No, it is in the stdlib.
<pcfreak30> as my ide ont pull up md5
<havenwood> pcfreak30: Digest::MD5.digest 'stuff'
<pcfreak30> ohh
<pcfreak30> odd*
<pcfreak30> seem it gives hmac and sha2
robbyoconnor has quit [Read error: Connection reset by peer]
<havenwood> pcfreak30: require 'digest/sha2'
<havenwood> also stdlib
rjhunter has joined #ruby
cflat has joined #ruby
<pcfreak30> I know that
<havenwood> pcfreak30: gotta run, good luck!
havenwood has quit []
<pcfreak30> im saying for whatever reason i dont have md5?
dima_ has joined #ruby
cflat has quit [Read error: Connection reset by peer]
cflat has joined #ruby
lyanchih_ has quit [Ping timeout: 260 seconds]
lyanchih has joined #ruby
robbyoconnor has joined #ruby
Kricir has joined #ruby
MattStratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
laphlaw has quit [Quit: Computer has gone to sleep.]
alvinsj has joined #ruby
mary5030 has quit [Remote host closed the connection]
vikhyat_ has quit [Ping timeout: 252 seconds]
<pcfreak30> what is the difference between Net::HTTP.post and Net::HTTP.post2?
cflat has quit [Ping timeout: 246 seconds]
phipes has joined #ruby
Kricir has quit [Ping timeout: 272 seconds]
byprdct has quit [Quit: Textual IRC Client: www.textualapp.com]
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vikhyat has joined #ruby
deryl has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
deol has joined #ruby
ss_ has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Mars`_ has joined #ruby
Mars` has quit [Read error: Connection reset by peer]
deol has quit [Ping timeout: 245 seconds]
burlyscudd has quit [Quit: Leaving.]
goganchic has quit [Quit: Computer has gone to sleep.]
cflat has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
specious has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
Asher has joined #ruby
maetthew has joined #ruby
vikhyat_ has joined #ruby
thesheff17 has joined #ruby
vikhyat has quit [Ping timeout: 246 seconds]
ss_ has joined #ruby
deol has joined #ruby
nanoyak has joined #ruby
cflat has quit [Ping timeout: 272 seconds]
`mrspock has joined #ruby
flubba has quit [Remote host closed the connection]
pen has quit [Remote host closed the connection]
pen has joined #ruby
pen has quit [Remote host closed the connection]
lewix has quit [Remote host closed the connection]
nanoyak has quit [Ping timeout: 245 seconds]
elux has joined #ruby
gja has quit [Ping timeout: 245 seconds]
alvinsj has quit []
brennanMKE has joined #ruby
hogeo has joined #ruby
elux has quit [Client Quit]
nanoyak has joined #ruby
<pcfreak30> So if anyone could offer advice on how to improve this code, would be appreciated: https://gist.github.com/anonymous/ecc39ffde449991274c7
nanoyak has quit [Client Quit]
noop has joined #ruby
BrixSat has quit [Read error: Connection reset by peer]
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
<pcfreak30> Here is the original PHP version too: https://gist.github.com/anonymous/1d51ed3647e77d0d8bde
<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]
devyn has joined #ruby
<pcfreak30> fixed that
gja has joined #ruby
gja has joined #ruby
gja has quit [Changing host]
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
Wolland has quit []
lewix has joined #ruby
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
<WJW> max or sort
<pcfreak30> so hash.keys.max
<pcfreak30> ?
<WJW> Yes, if that's what you want.
<pcfreak30> not finding that in the docs?
<WJW> >> [3, 2, 5].max
<eval-in> WJW => 5 (https://eval.in/83623)
<WJW> >> ["foo", "bar", "bletch", "baz"].max
<eval-in> WJW => "foo" (https://eval.in/83624)
<WJW> >> ["foo", "bar", "bletch", "baz"].sort
<eval-in> WJW => ["bar", "baz", "bletch", "foo"] (https://eval.in/83625)
Kricir has joined #ruby
okinomo has joined #ruby
<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
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<WJW> Methods can assume what they want if that's part of the design.
<pontiki> but the caller can't
<WJW> in which case callers are responsible to pass valid arguments.
flubba has quit [Remote host closed the connection]
<pcfreak30> undefined method `require_relative'
<pcfreak30> ?
<WJW> In pcfreak30's design, the hash is probably a constant that he sets up in the first place.
<pontiki> here's a fun thing
<pcfreak30> WJW, i now whats going to be returned. the data will be there or it wont
<WJW> require_relative sounds like something require would call.
<pcfreak30> But im still using max to be simple
<pcfreak30> yes
<pcfreak30> I read about it
<pontiki> he's using kind_of?(Hash), which something like Rails' HashWithIndifferentAccess pass
<Nilium> A fun thing: eating shish-kebabs.
<pcfreak30> trying to use in puppet code to pull my library thats a few dirs up
<pcfreak30> pontiki: in php its if (is_array($argnames[$i]))
<pcfreak30> so im just trying to make the equiv
<pcfreak30> and php array == ruby hash
<pcfreak30> well for the associative type
phipes has quit [Remote host closed the connection]
<WJW> Probably you shouldn't "require" from any context other than the very outermost in a source file.
parduse has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
<pcfreak30> ?
<pcfreak30> it is at the very top?
deol has quit [Remote host closed the connection]
<pcfreak30> require_relative '../../../multicraft_api'
<pcfreak30> module Puppet::Parser::Functions
phipes has joined #ruby
deol has joined #ruby
<WJW> Try plain "require".
<WJW> At the very top.
<pcfreak30> Could not autoload puppet/parser/functions/multicraft_get_daemon_id: no such file to load -- ../../../multicraft_api
<WJW> pontiki, I don't understand why you mention HashWithIndifferentAccess. Aren't pcfreak's keys all of a known type, either symbol or string?
gja has joined #ruby
<WJW> pcfreqk30, when you are in that directory with your shell, can you "ls" the file by the name you are using for it?
<WJW> pcfreak30, I mean, when you are in the directory where the source file is that contains the "require".
<pcfreak30> oh I just relooked
<pcfreak30> i think its trying to pull based on the module name/namespace
<pcfreak30> module Puppet::Parser::Functions
<WJW> pcfreak30, that doesn't sound right.
<WJW> Did you move the "require" to the very top?
brennanMKE has joined #ruby
<pcfreak30> yes
<WJW> Is the filename correct?
<pcfreak30> This is inside puppet so IDK what things they have running
deol has quit [Ping timeout: 252 seconds]
<pcfreak30> thats the code that handles what im running
<pcfreak30> If you want to see
<pcfreak30> and it is
<pcfreak30> i let my ide auto-suggest
<pcfreak30> and the path is correct
<WJW> You are running the puppet code you refer to?
falood has joined #ruby
<pcfreak30> WJW, I am running a custom function that uses the library
cow_ has quit [Remote host closed the connection]
<pcfreak30> so im trying ti require the file
<pcfreak30> to
<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
<pcfreak30> Ok
<pcfreak30> Thats a BIG project based on the name alone
<pcfreak30> in any lang/framework
<deryl> definitely not a 1 hour lesson, thats for sure
<WJW> That may be mostly Javascript.
<guest456_> lol o shit
<WJW> Start smaller.
<guest456_> but im sure u could do it in ruby no?
<deryl> could do it in any language
<deryl> frontend with html css and js
<WJW> To run anything other than js in a browser requires jumping through hoops.
sayan has quit [Ping timeout: 245 seconds]
<pcfreak30> yea...
<pcfreak30> theres no reason to put a server side language in the browser
<pcfreak30> reminds me of repl.it
<WJW> Someone did mention an implementation of Ruby in JS, but I don't know how complete or correct it is.
<pcfreak30> they made a bunch of script interpreters that compile down to js alone
<guest456_> u think thats to big a project for a beginner even if i broke it down into small parts?
<deryl> repl.it is actually pretty cool :)
<WJW> It's too big a project for me.
<pcfreak30> Same
<pcfreak30> thats easily 1-5K in value outsourced
<WJW> guest456_, how are you at Javascript in browsers?
<guest456_> im shit
<guest456_> im just beginning
oitnelis has quit [Ping timeout: 272 seconds]
<deryl> i'd take a FAR FAR smaller bite first
<WJW> So you'd have to learn two languages, plus the Document Object Model (DOM).
<guest456_> yea im focusing on ruby for now
<pcfreak30> Honestly besides these folks helping you, jump to #javascript and get advice
<WJW> guest456_, but you want to use it for web stuff particularly?
<guest456_> tring to use this gem to learn a bit https://github.com/robolson/ruby-poker
<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
<WJW> In Ruby, indexes start at zero.
<deryl> especially when beginning
<WJW> >> ["foo", "bar"][0]
<eval-in> WJW => "foo" (https://eval.in/83636)
<WJW> ["foo", "bar"][1]
<pcfreak30> WJW, Error: undefined method `findConnections' for #<MultiCraftApi:0x7f8982cd3670>
<pcfreak30> yet I have method_missing?
<WJW> >> ["foo", "bar"][1]
<eval-in> WJW => "bar" (https://eval.in/83637)
<WJW> ["foo", "bar"].size
<WJW> I keep forgetting the ">>".
<deryl> hehe was about to say
<WJW> >> ["foo", "bar"].size
<eval-in> WJW => 2 (https://eval.in/83639)
<jalcine> >> String.class
<eval-in> jalcine => Class (https://eval.in/83640)
<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
<jalcine> oh, that's cool
<WJW> >> "".class
<eval-in> WJW => String (https://eval.in/83641)
<deryl> >> "".nil?
<eval-in> deryl => false (https://eval.in/83642)
<deryl> >> "".blank?
<eval-in> deryl => undefined method `blank?' for "":String (NoMethodError) ... (https://eval.in/83643)
<jalcine> >> 1.falsy?
<eval-in> jalcine => undefined method `falsy?' for 1:Fixnum (NoMethodError) ... (https://eval.in/83644)
<deryl> damn
<deryl> oh
<deryl> >> "".empty?
<eval-in> deryl => true (https://eval.in/83646)
<WJW> guest456_, Yes, trying to understand others' code can be a reasonable thing to do unless it's awful code.
mikepack has quit [Remote host closed the connection]
<deryl> guest456_, notice that
<deryl> >> "".nil?
<eval-in> deryl => false (https://eval.in/83647)
<deryl> >> "".blank?
<eval-in> deryl => undefined method `blank?' for "":String (NoMethodError) ... (https://eval.in/83648)
<deryl> notice the difference.
<WJW> guest456_, to understand it, you may have to look up every method and class that they use.
<deryl> damn it
<guest456_> how is that guys code just by looking can u tell if its reasonable?
<guest456_> yea lol i am
<WJW> guest456_, kind of like if an economic theory makes sense or sucks.
<guest456_> been at it for days...i figure if i keep trying over a months time Ill be able to piece it together
<pcfreak30> Error: can't convert Symbol into String a
<guest456_> eventually
<WJW> pcfreak30, what code?
<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.
<deryl> enjoy folks. until the morn!
Mars` has quit [Ping timeout: 252 seconds]
<pcfreak30> WJW, return {:success => false, :errors => ['Unknown API method "'+method.to_s+'()"'], :data => {}};
<WJW> guest456_, my first impression is that that is quite beautiful code (I mean not ugly).
<WJW> pcfreak30, what is the value of the variable "method" at that point? Is it a symbol?
<WJW> >> :foo.to_s
<eval-in> WJW => "foo" (https://eval.in/83649)
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
<WJW> Single quotes are fine.
<guest456_> i did*
<deryl> coupled with the + ?
<WJW> Yes, + works on strings.
<WJW> >> 'foo' + 'bar'
<eval-in> WJW => "foobar" (https://eval.in/83650)
<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]
maroloccio has joined #ruby
codezomb has quit [Quit: Textual IRC Client: www.textualapp.com]
sheap has quit [Quit: Lost terminal]
brennanMKE has quit [Ping timeout: 272 seconds]
kate_r has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
kate_r has joined #ruby
stkowski_ has joined #ruby
tjaco has quit [Ping timeout: 245 seconds]
stkowski has quit [Ping timeout: 260 seconds]
stkowski_ is now known as stkowski
RoryHughes has joined #ruby
pierre1 has joined #ruby
dapz has joined #ruby
tappi has joined #ruby
atzorvas has joined #ruby
atzorvas is now known as Guest14041
Sami345 has joined #ruby
VesQ has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
emocakes has quit [Quit: Linkinus - http://linkinus.com]
jkhwan has joined #ruby
LexicalScope` has quit [Read error: Connection reset by peer]
St_Marx has quit [Quit: Ex-Chat]
LexicalScope` has joined #ruby
Synthead has quit [Ping timeout: 252 seconds]
Virtualize has joined #ruby
RoryHughes has quit []
jamesaxl has joined #ruby
aryaching_ has quit [Ping timeout: 272 seconds]
jkhwan has quit [Ping timeout: 272 seconds]
Guest14041 has quit [Ping timeout: 245 seconds]
phansch has joined #ruby
shredding has joined #ruby
<shredding> hey all
<shredding> I'm into regexp atm and don't understand this one: https://github.com/robolson/ruby-poker/blob/master/lib/ruby-poker/poker_hand.rb#L114
<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?
<popl> "Cats and Dogs".scan(/(Cats (and)) (Dogs)/) # => [["Cats and", "and", "Dogs"]]
<popl> Is that clear?
<shredding> Yep
<shredding> Now it is.
<popl> That's a scary regexp though.
<popl> Probably a better way to do that.
<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]
stkowski_ has joined #ruby
mojjojo has joined #ruby
stkowski has quit [Ping timeout: 252 seconds]
stkowski_ is now known as stkowski
huttan- has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
freerobby has quit [Quit: Leaving.]
huttan- has joined #ruby
rootshift has quit [Quit: rootshift]
St_Marx has joined #ruby
<jacky> >> "foo".to_s
<eval-in> jacky => "foo" (https://eval.in/83686)
kep has joined #ruby
huttan-_ has joined #ruby
Kricir has quit [Remote host closed the connection]
shredding has quit [Quit: shredding]
huttan- has quit [Ping timeout: 252 seconds]
freerobby has joined #ruby
banghouse has quit [Quit: What if the hokey pokey really is what it's all about?]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pixels has quit [Read error: Connection reset by peer]
hogeo has joined #ruby
Virtualize has joined #ruby
freerobby has quit [Quit: Leaving.]
hogeo has quit [Ping timeout: 252 seconds]
Virtualize has quit [Ping timeout: 260 seconds]
alexherb1 has joined #ruby
Steven_ has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
rjhunter has joined #ruby
alexherb1 has quit [Client Quit]
gregoriokusowski has joined #ruby
brennanMKE has joined #ruby
dima_ has joined #ruby
rjhunter has quit [Ping timeout: 245 seconds]
noop has quit [Ping timeout: 240 seconds]
jinie has quit [Quit: ZNC - http://znc.in]
noop has joined #ruby
flubba has joined #ruby
apeiros has joined #ruby
brennanMKE has quit [Ping timeout: 240 seconds]
end_guy has quit [Remote host closed the connection]
jinie has joined #ruby
deol has joined #ruby
Steven_ has quit [Remote host closed the connection]
TomRone has quit [Ping timeout: 240 seconds]
flubba has quit [Remote host closed the connection]
dima_ has quit [Ping timeout: 245 seconds]
Steven_ has joined #ruby
klaut has quit [Remote host closed the connection]
Steven_ has quit [Read error: Connection reset by peer]
eka has joined #ruby
Guest88728 has quit [Ping timeout: 272 seconds]
TomRone has joined #ruby
sayan has quit [Ping timeout: 246 seconds]
deol has quit [Ping timeout: 272 seconds]
ozkan has quit [Ping timeout: 246 seconds]
Speed has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
blarghmatey has joined #ruby
jkhwan has joined #ruby
psyprus has quit [Ping timeout: 240 seconds]
Steven_ has joined #ruby
atzorvas has joined #ruby
mengu has quit [Ping timeout: 272 seconds]
atzorvas is now known as Guest36205
psyprus has joined #ruby
relix has joined #ruby
sayan has joined #ruby
jkhwan has quit [Ping timeout: 272 seconds]
bricker`work has quit [Ping timeout: 272 seconds]
diegoviola has joined #ruby
ewnd9 has quit [Ping timeout: 272 seconds]
vlad_starkov has joined #ruby
maroloccio has quit [Quit: WeeChat 0.4.2]
gja has quit [Quit: This computer has gone to sleep]
gja has joined #ruby
freerobby has joined #ruby
mercwithamouth has joined #ruby
marr has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.2]
huttan-_ has quit [Ping timeout: 245 seconds]
spider-mario has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
S0da has joined #ruby
eval-in has quit [Remote host closed the connection]
sayan has quit [Ping timeout: 272 seconds]
eval-in has joined #ruby
eval-in has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
railsbros_dirk has joined #ruby
colonolGron has joined #ruby
lkba has joined #ruby
Guest36205 has quit [Ping timeout: 240 seconds]
OdNairy has joined #ruby
browndawg has left #ruby [#ruby]
bluOxigen has joined #ruby
bluOxigen has quit [Changing host]
bluOxigen has joined #ruby
Steven_ has quit [Remote host closed the connection]
Hanmac has joined #ruby
hogeo has joined #ruby
carraroj has quit [Ping timeout: 272 seconds]
Virtualize has joined #ruby
Hanmac1 has quit [Ping timeout: 272 seconds]
gja has joined #ruby
Guest65897 has joined #ruby
hogeo has quit [Ping timeout: 246 seconds]
Virtualize has quit [Ping timeout: 245 seconds]
end_guy has joined #ruby
ewnd9 has joined #ruby
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
butblack has quit [Quit: butblack]
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…)
brennanMKE has quit [Ping timeout: 245 seconds]
jkhwan has quit [Ping timeout: 272 seconds]
bogeyd6 has joined #ruby
MattStratton has joined #ruby
Steven_ has joined #ruby
rjhunter has joined #ruby
larissa has joined #ruby
<WJW> I like "env".
<jcx> Same here, don't find it confusing
includex has left #ruby ["Textual IRC Client: www.textualapp.com"]
rjhunter has quit [Ping timeout: 245 seconds]
jonathanwallace has joined #ruby
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?
mengu has quit []
ItSANgo has joined #ruby
<Takumo> I've got a Rakefile which has`Rake::PackageTask.new(package_name, get_verison_name) { |p| p.need_zip = true; p.package_dir = "packages" ; p.package_files.include "**/*" ; p.package_files.exclude "packages/**/*"
carraroj has quit [Ping timeout: 240 seconds]
abra has joined #ruby
vlad_starkov has joined #ruby
<Takumo> I'm reading the docs for the package task but I'm not seeing an option to not encapsulate the files in a directory
<WJW> Maybe PackageTask isn't able to do what you want.
<Takumo> that's not helpful :|
mmitchell has quit [Remote host closed the connection]
<WJW> Maybe someone who knows about it will come along in the next 8 hours.
sailias has quit [Ping timeout: 245 seconds]
<WJW> Or you could try nosing into the source code.
<Takumo> well, off to the source.
IcyDragon has joined #ruby
falood has joined #ruby
IceDragon has quit [Ping timeout: 272 seconds]
<WJW> I am staring at a method for "new" that I wrote, not for a class, but for another kind of factory that takes a rôle quite like that of a class.
jalcine has quit [Excess Flood]
IcyDragon is now known as IceDragon
LexicalScope` has joined #ruby
LexicalScope has joined #ruby
LexicalScope has joined #ruby
browndawg has joined #ruby
OdNairy has joined #ruby
atno__ has quit [Ping timeout: 252 seconds]
aryaching has joined #ruby
rickruby has joined #ruby
brennanMKE has joined #ruby
robbyoconnor has quit [Excess Flood]
jkhwan has joined #ruby
nari has quit [Ping timeout: 246 seconds]
robbyoconnor has joined #ruby
pen has quit [Remote host closed the connection]
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby
atno has joined #ruby
brennanMKE has quit [Ping timeout: 252 seconds]
lassebunk2 has joined #ruby
nfk has quit [Quit: yawn]
jkhwan has quit [Ping timeout: 272 seconds]
Kabaka has quit [Ping timeout: 245 seconds]
peregrine81 has quit []
lassebunk2 is now known as lassebunk
lassebunk has quit [Remote host closed the connection]
jalcine has joined #ruby
rjhunter has joined #ruby
IceDragon has quit [Ping timeout: 245 seconds]
mmitchell has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
anderson has joined #ruby
yokel has quit [Quit: leaving]
claymore has joined #ruby
Deele has quit [Quit: User excited]
rootshift has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
falood has quit [Remote host closed the connection]
rjhunter has quit [Ping timeout: 240 seconds]
Steven_ has joined #ruby
Neomex has joined #ruby
banghouse2 has joined #ruby
peregrine81 has joined #ruby
banghouse2 is now known as banghouse
yokel has joined #ruby
yokel has quit [Client Quit]
yokel has joined #ruby
m8 has joined #ruby
IceDragon has joined #ruby
kure_ has joined #ruby
jego has quit [Ping timeout: 260 seconds]
fuhgeddaboudit has quit [Ping timeout: 252 seconds]
Megtastique has joined #ruby
Kabaka has joined #ruby
kure has quit [Ping timeout: 260 seconds]
peregrine81 has quit []
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rootshift has quit [Quit: rootshift]
amundj has joined #ruby
Virtualize has joined #ruby
OdNairy has joined #ruby
Virtualize has quit [Ping timeout: 246 seconds]
RoryHughes has quit []
freerobby has joined #ruby
okinomo has quit [Ping timeout: 246 seconds]
chrisan has quit [Ping timeout: 240 seconds]
chrisan has joined #ruby
nowthatsamatt has quit [Quit: nowthatsamatt]
pengunix has joined #ruby
<pengunix> When using rbenv install, it downloads a tar.gz over http.
soobus has joined #ruby
<pengunix> How is the integrity checked before actually installing it?
havenwood has joined #ruby
diegoviola has joined #ruby
jalcine has quit [Excess Flood]
lyanchih_ has quit [Quit: lyanchih_]
mercwithamouth has joined #ruby
ewnd9 has quit [Ping timeout: 272 seconds]
TomRone has quit [Ping timeout: 240 seconds]
anshin has joined #ruby
TomRone has joined #ruby
mark_locklear has quit [Ping timeout: 246 seconds]
rickruby has quit [Remote host closed the connection]
eka has quit [Quit: Computer has gone to sleep.]
rickruby has joined #ruby
carlsednaoui has quit [Remote host closed the connection]
carlsednaoui has joined #ruby
abra has quit [Quit: Textual IRC Client: www.textualapp.com]
sayan has joined #ruby
jalcine has joined #ruby
rickruby has quit [Ping timeout: 272 seconds]
<matti> pengunix: SHA1/MD5 check?
ewnd9 has joined #ruby
ambushsabre has quit [Quit: rip]
drago777 has quit [Ping timeout: 240 seconds]
diegoviola has quit [Ping timeout: 260 seconds]
Guest14544 has joined #ruby
Guest14544 has quit [Changing host]
Guest14544 has joined #ruby
Guest14544 is now known as diegoviola
drago777 has joined #ruby
fuhgeddaboudit has joined #ruby
RoryHughes has joined #ruby
Megtastique has quit []
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 => #<Foo:0x41c95068> (https://eval.in/83755)
Mohan__ has quit [Ping timeout: 264 seconds]
<shevy> real men don't have memory leaks
<platzhirsch1> ObjectSpace.allocation_sourceline(o) => 6 \o/
<havenwood> shevy: GC.disable
<shevy> you should not use GC.disable!!!
nari has joined #ruby
<platzhirsch1> I am not a man, I am a stag
<shevy> >> ObjectSpace.allocation_sourceline(o)
<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
<eval-in> DouweM => /tmp/execpad-f17ddb93a795/source-f17ddb93a795:7: syntax error, unexpected end-of-input, expecting keyword_end (https://eval.in/83763)
<DouweM> >> class Foo; def self.new; "wtf"; end; end; Foo.new
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blarghmatey has joined #ruby
polaco_zZz has quit [Ping timeout: 248 seconds]
<DouweM> that should work, dunno why eval-in won't answer
<pontiki> you killed eval-in !!
<shevy> DouweM ah yes
maycon has quit [Ping timeout: 245 seconds]
<havenwood> DouweM: You shorted it an `end`, must pay in full...
carlsednaoui has quit [Remote host closed the connection]
deol has joined #ruby
carlsednaoui has joined #ruby
cbetta is now known as cbetta_afk
<shevy> huh, funny ... I thought there were seven main colours in ansii
<shevy> but that starts at 0, so there are eight
drago777 has quit [Ping timeout: 240 seconds]
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?
Wolland has joined #ruby
<deryl> thanks
Sawbones has joined #ruby
<deryl> ahh %x() not []
figgleberry has quit [Ping timeout: 272 seconds]
_honning_ has joined #ruby
<deryl> bookmarking that. appreciated
<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]
Yan__ has quit [Ping timeout: 260 seconds]
jkhwan has quit [Ping timeout: 272 seconds]
brennanMKE has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
skulker has joined #ruby
vinian has quit [Ping timeout: 245 seconds]
soobus has joined #ruby
Hanmac has joined #ruby
Hanmac1 has quit [Ping timeout: 252 seconds]
Yan__ has joined #ruby
<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]
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Megtastique has quit []
xiphias has quit [Ping timeout: 240 seconds]
anshin has joined #ruby
xiphias has joined #ruby
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> guys, just to verify:
<shevy> x = y = nil
<shevy> is the same as doing
<shevy> x = nil
<shevy> y = nil
<shevy> right?
<mzdravkov> shevy: yes
<apeiros_> almost
<shevy> I am trying to clean up ancient code
<apeiros_> with nil it doesn't matter
<coinsen> shevy: last update is 1 month ago https://github.com/larskanis/libusb
<apeiros_> but it's really: y = nil; x = y
<apeiros_> with e.g. "foo" it would matter.
<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.
<shevy> hey Hanmac look: new ruby-gtk release https://www.ruby-forum.com/attachment/9096/gtk2gtk3-styles.jpg
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.
freggles has joined #ruby
<WJW> http://www.sciencedaily.com/releases/2013/10/131009133216.htm Urgent new time frame for climate change revealed by massive analysis.
snath has joined #ruby
Mars`_ has joined #ruby
tvw has joined #ruby
chrisramon has joined #ruby
<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.
m_3 has quit [Ping timeout: 260 seconds]
<apeiros_> pcfreak30: Module.instance_method(:name).bind(method.class).call
rjhunter has joined #ruby
<apeiros_> pcfreak30: also find the responsible class and file a bug report with the author.
<apeiros_> not nice to change the contract of Module#name
havenwood has quit [Ping timeout: 252 seconds]
<pcfreak30> um, i wrote the library
kenrick has joined #ruby
<pcfreak30> that its catching
<apeiros_> pcfreak30: then file a bug report with yourself! :-p
<pcfreak30> its ment to do it
<pcfreak30> lol
<pcfreak30> im creating dynamic methods
<apeiros_> well, .class should return a class, and Class#name should return a String.
<pcfreak30> But cant seem to get a string instance of the method name
m_3 has joined #ruby
<apeiros_> but since you wrote it - what's your question really?
dylandog has joined #ruby
<apeiros_> what?
<pcfreak30> its outputting Symbol and not the actual method name being called
<apeiros_> aw, stop making me riddle. paste reproducable code on gist.github.com.
mmitchell has joined #ruby
<apeiros_> yeah, because you're probably calling .class on the method name…
<atmosx> apeiros_: that's a shame, you're pretty good at riddles :-P
<apeiros_> and method names are a symbol.
<apeiros_> >> def foo; __method__; end; foo #=> :foo
<apeiros_> >> :foo.class #=> Symbol
<apeiros_> pcfreak30: *reproducable*. thanks.
<pcfreak30> its using puppet code, be warned
<apeiros_> oh, +minimal
<pcfreak30> you will likely not be able to run due to that dep
<apeiros_> thats why you reduce it, and make it reproducable outside of your dep.
vikhyat has joined #ruby
grep_away is now known as grep_awesome
<pcfreak30> i ended up having to include the lib in one file
<apeiros_> dynamically defining methods is not related to, or depending on puppet
rjhunter has quit [Ping timeout: 252 seconds]
larissa has joined #ruby
<pcfreak30> as puppet has a weird autoloader that prevents externals relative file requires
<pcfreak30> no its not, but to execute to see the code is Dependant
<pcfreak30> as is atleast.
dylandog has quit [Ping timeout: 252 seconds]
drumusician has quit [Ping timeout: 245 seconds]
mmitchell has quit [Ping timeout: 252 seconds]
tomaw_ has quit [Quit: Quitting]
<WJW> What is the problem?
<pcfreak30> WJW, I am picking up from last night
<WJW> Does it work?
<pcfreak30> were you got stumpted on symbol.class.name
<pcfreak30> apeiros_ is trying to look
<apeiros_> pcfreak30: no I'm not
<WJW> What line is failing?
<apeiros_> I'm not working through a non-reproducable, non-minimal piece of code.
<WJW> What is the line number of the line that is failing?
<apeiros_> (you didn't even tell where to look, seriously…)
<pcfreak30> on a debug, line 39.
<apeiros_> if I was a consultant and paid by the hour I'd rub my hands and glee…
<pcfreak30> sorry apeiros_ , just woke up so my brains still waing up,
<pcfreak30> waking
<apeiros_> but I'm not, so it's your duty to reduce the problem to the minimum.
sayan has quit [Ping timeout: 272 seconds]
lewix has joined #ruby
ambushsabre has quit [Quit: rip]
<WJW> :errors => ["Unknown API method #{method.inspect}"]
phipes has quit [Remote host closed the connection]
smathieu has quit [Remote host closed the connection]
shime has quit [Ping timeout: 272 seconds]
jego has joined #ruby
<pcfreak30> theres a minimal. the post wont work due to fake info, but it will crash way before then
<WJW> :errors => ["Unknown API method #{method.to_s.inspect}"]
<apeiros_> pcfreak30: dude, that's NOT minimal.
<apeiros_> about 90 lines away from minimal.
<pcfreak30> apeiros_: thats the library and a test case to run it
rippa has quit [Ping timeout: 248 seconds]
<WJW> It dies on to_s, right?
vikhyat_ has joined #ruby
<pcfreak30> yes
habanany has quit [Ping timeout: 246 seconds]
shime has joined #ruby
<pcfreak30> Which is why its a working test case on the issue
<WJW> Maybe the library you are using is overriding some important behavior in Symbol.
vikhyat has quit [Ping timeout: 272 seconds]
<apeiros_> my, why am I doing this…
<WJW> Maybe they are explicitly removing the :to_s method.
<apeiros_> pcfreak30: https://gist.github.com/anonymous/d0eb6f09b3192765c84d#L39 - `puts method.class.name` - as I said, method *is* a Symbol, it already *is* the name of the method
<pcfreak30> i have no clue why they would do that not do i wish to dive into their code to find out
<apeiros_> and :somesymbol.class *of course* returns Symbol, and Symbol.name *of course* returns "Symbol".
mechanicles has joined #ruby
<WJW> Let me try a method_missing example.
<pcfreak30> apeiros_: unfortunately i remember being told that by WJW
<pcfreak30> to use it
<apeiros_> well, it's still wrong.
<pcfreak30> apparently, just stating
mjburgess has quit [Ping timeout: 246 seconds]
<apeiros_> anyway, minimal reproducable example for that would be 6 lines of code.
<pcfreak30> the funny thing is i did a method_missing test in irb with success
<apeiros_> so your "minimal" case is over 100 lines away from minimal.
colonolGron has joined #ruby
<pcfreak30> is there anyway to see if puppet is doing something funky with the Symbol class
<apeiros_> if you're in stuff with method_missing, you also do well to be explicit and not use Kernel#puts
<apeiros_> e.g. $stdout.puts instead.
<WJW> I advised him to use puts for debugging.
<pcfreak30> apeiros_: I only knew puts. This is my first real coding in ruby truthfully. I dont know all of ruby's inner workings yet
mjburgess has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
<pcfreak30> I am from a PHP background
<WJW> pcfreak30, is your pronoun "him" or "her"?
<apeiros_> yes, that part is fine. but within method_missing classes you can easily run into an infinite loop
<WJW> Yes, but it's for debugging.
<apeiros_> WJW: yes, again, fine. but as stated, use $stdout.puts within a class which has method_missing
<apeiros_> not just puts
<pcfreak30> WJW, huh?
<pcfreak30> I am a guy
<WJW> OK.
mechanicles has quit [Ping timeout: 246 seconds]
jego has quit [Ping timeout: 245 seconds]
<apeiros_> pcfreak30: also in all your code you use single quoted strings, they don't interpolate.
<apeiros_> >> foo = "bar"; puts '#{foo}', "#{foo}"
<pcfreak30> Yes I know
<apeiros_> that will print #{foo}\nbar
<pcfreak30> Works the same in most languages
<apeiros_> then why do you use single quotes?
teoric has joined #ruby
phipes has joined #ruby
<pcfreak30> woops
<pcfreak30> overlooed that
popl has quit [Quit: And then there are people who prefer to look their fate in the eye.]
<pcfreak30> it was nearly 3 am, so i was tired in my defense :P
colonolGron has quit [Ping timeout: 260 seconds]
<WJW> I usually look askance at solutions that use method_missing, but in pcfreak30's particular use case, it may be fairly justified, or almost so.
<WJW> Could take the @@methods and process them into a bunch of real methods on some nonce class.
<pcfreak30> eh, keep in mind as well I am only using method_missing as the source PHP lib does the equiv
havenwood has joined #ruby
<WJW> If all PHP programmers jumped off a cliff, would you do the same thing in Ruby?
<pcfreak30> O_o
<pcfreak30> running $stdout.puts method.to_s
<pcfreak30> prints arg?
<WJW> Just kidding.
<pcfreak30> ran exit after to ensure no more output
mercwithamouth has joined #ruby
<pcfreak30> hacky but works
<WJW> My example says ["foo"]
Jetchisel has joined #ruby
<pcfreak30> This seriously should not be such a pain the the a**
<WJW> Well, I guess we don't know yet whom to blame.
<pcfreak30> is there anyway to see if puppet modded the symbol class
<pcfreak30> cause this is flat stupid
<WJW> Binary search. Load a little bit of puppet at a time and see when things break.
<WJW> grep for Symbol
vikhyat has joined #ruby
deol has joined #ruby
vikhyat has quit [Remote host closed the connection]
vikhyat_ has quit [Ping timeout: 252 seconds]
<pcfreak30> Sounds a bit to advanced to me. Now I now how novices feel like when I talk to them :S
<WJW> I wonder if Symbol.freeze would help.
<deryl> hehe
vikhyat has joined #ruby
<deryl> what is the purpose of freeze other than to make something unable to be changed (which you can still do can't you?)
<shevy> to annoy people
<deryl> hehe
<WJW> Yes, that's the purpose. But it might not go deep enough to do any good.
<deryl> doesn't doing a delete or destroy on something call delete until its actually deleted (delayed and batched db updates)
<deryl> s/call delete/call freeze/
<WJW> Symbol is inheriting :to_s from something.
<pcfreak30> hmm this is interesting
<pcfreak30> Error: can't convert Symbol into String at /etc/puppet/modules/multicraft/manifests/init.pp:39
jamesaxl has joined #ruby
<pcfreak30> sounds like the error is now not in ruby, but some puppet ruby code.
mjburgess has quit [Ping timeout: 245 seconds]
<pcfreak30> which is something ill look at later
zeade has joined #ruby
stetho has joined #ruby
<WJW> Where you think it's failing, put a printout before and another after.
<pcfreak30> But whats odd is puts method.to_s returns arg?
<pcfreak30> printout?
deol has quit [Ping timeout: 272 seconds]
<WJW> $stdout.puts "before"; funky_variable.to_s; $stdout.puts "NAFTA"
vikhyat has quit [Ping timeout: 260 seconds]
<pcfreak30> I knew that
<pcfreak30> Just didnt know the term you said
vikhyat has joined #ruby
<shevy> has rubyonrails been declining?
<pcfreak30> um
<pcfreak30> it returns arg
<pcfreak30> WTF
<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.
reach has joined #ruby
Astralum has quit [Ping timeout: 246 seconds]
<pcfreak30> any ideas there?
<pcfreak30> mint linux BTW
allsystemsarego has quit [Quit: Leaving]
<pcfreak30> trying to run a debugger in my ide that requires that
vikhyat_ has joined #ruby
vikhyat has quit [Ping timeout: 252 seconds]
<deryl> why are you installing gems as root for one
<deryl> you do know you can install gems as a regular user right?
<pcfreak30> um it faled as non root
MrPopinjay has quit [Client Quit]
<pcfreak30> no write to var/lib/gems/1.9.1
havenwood has quit [Remote host closed the connection]
<pcfreak30> /var*
skulker_ has quit [Remote host closed the connection]
lewix has quit [Remote host closed the connection]
skulker has joined #ruby
<deryl> see gem help and the --user-install switch
mityaz has joined #ruby
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
lewix_ has joined #ruby
Megtastique has quit []
<shevy> cannot load such file -- mkmf (L
zeade has joined #ruby
<shevy> pcfreak30 go uncripple your ruby
<shevy> mkmf is available for all folks who compile from source, so debian modified the default
vikhyat_ has quit [Ping timeout: 252 seconds]
<Hanmac1> shevy normaly you should not /usr/local/lib is better
<shevy> :\
adam has quit [Disconnected by services]
lewix_ has quit [Remote host closed the connection]
skulker_ has joined #ruby
Virtualize has joined #ruby
jkhwan has joined #ruby
skulker has quit [Ping timeout: 245 seconds]
adam- has joined #ruby
<pcfreak30> shevy: simple fix. ruby dev package needed to be installed
<pcfreak30> and no
dapz has joined #ruby
<pcfreak30> not a debian probem. Dev package wasnt there
hashbangchris has joined #ruby
skulker_ has quit [Remote host closed the connection]
includex has quit [Quit: Textual IRC Client: www.textualapp.com]
<atmosx> offtopic: spotify is incredible
<atmosx> I can't believe I missed it for so long.
kep has quit [Quit: WeeChat 0.4.2]
Virtualize has quit [Ping timeout: 252 seconds]
kate_r has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
skulker has joined #ruby
vikhyat_ has joined #ruby
jkhwan has quit [Ping timeout: 272 seconds]
vikhyat has quit [Ping timeout: 246 seconds]
shime has quit [Ping timeout: 272 seconds]
<pcfreak30> lol, or just find music free
shime has joined #ruby
vikhyat_ has quit [Read error: Connection reset by peer]
banghouse has quit [Remote host closed the connection]
zeade has quit [Quit: Leaving.]
pskosinski has quit [Remote host closed the connection]
<atmosx> shit
<atmosx> gf back, development stops..
* atmosx cruel life
<kure> i feel ya, mate
udon has quit [Quit: Leaving]
rjhunter has joined #ruby
vikhyat has joined #ruby
teoric has quit [Quit: WeeChat 0.4.1]
<apeiros_> just upgrade from gf to wife, and you'll have all the free time you want
skaflem has quit [Quit: Leaving]
TDJACR has quit [Ping timeout: 246 seconds]
<deryl> not true. I did that and i have LESS time than I did when she wore the gf moniker
<kure> found a linking issue on wife1.0, falling back to gf3.0
<deryl> or have we forgotten the infamous Honey-Do lists ;)
<pcfreak30> um
<deryl> kure, I've a wife 2.0
<deryl> need to write a patch methinks
<pcfreak30> i cant seem to do a require or include to a file in the same folder?
<deryl> require_relative
TDJACR has joined #ruby
<pcfreak30> ugg
<pcfreak30> didnt wor before, sihn..
<deryl> pcfreak30, pick up a ruby book damn it ;)
sassamo has joined #ruby
<atmosx> apeiros_: working on that, I got engaged last week.
<pcfreak30> deryl: I used require_relative before but in a puppet env and got errors
<deryl> congrats!
<pcfreak30> so havent tried again
vikhyat_ has joined #ruby
<atmosx> thanks
hashbangchris has quit [Ping timeout: 245 seconds]
<atmosx> :D
MrJoshua has joined #ruby
<deryl> atmosx, for all my bitching, I wouldn't trade mine in for the world
<pcfreak30> atmosx: cool bro :)
<apeiros_> require_relative-- (wrong coupling - and no, not gonna discuss it *again*)
<deryl> she keeps me warm at night :)
<apeiros_> atmosx: congrats, I guess :)
<atmosx> deryl: yeah I feel that way too. I don't bitch too much really.
<atmosx> apeiros_: thanks :-) pcfreak30 thanksss :D
rjhunter has quit [Ping timeout: 245 seconds]
vikhyat has quit [Ping timeout: 246 seconds]
larissa has quit [Ping timeout: 245 seconds]
<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) ;-)
<pcfreak30> ...
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<deryl> think you got ArgumentErrors now??
Sawbones has quit [Remote host closed the connection]
* Hanmac1 makes a Lord of the Rings reference: "No one simply changes $LOAD_PATH without consequences" ;P
<WJW> Sister-in-law said I was arguing incorrectly.
<deryl> doh!
shime has joined #ruby
zeade has joined #ruby
<deryl> Hanmac1, <chuckle>
<kure> deryl, according to apeiros_ , require_relative with gf3.0 is a StandardException, in case class ThreeSome is defined
<deryl> well, she did warn her sister (who likes to cheat on her own man) to be careful or it'd be SisterInLaw not found
zeade has quit [Client Quit]
<kure> omg we'd better stop it
<deryl> kure, he makes a good point
<deryl> hehe
<kure> :P
<deryl> my wife is looking at the channel readout and just shaking her head! lol
joaoh82 has quit [Remote host closed the connection]
<deryl> her only comment as she walked away was "geeks"
fantazo has quit [Ping timeout: 246 seconds]
* deryl smiles with pride
bklane has quit [Ping timeout: 252 seconds]
dscrd has quit [Remote host closed the connection]
dscrd has joined #ruby
<shevy> PENIS
<WJW> Looks off-topic.
<shevy> :(
<shevy> I am sure we can draw some connection to ruby
dscrd has quit [Remote host closed the connection]
<apeiros_> shevy: no, we don't use full-uppercase constants
dscrd has joined #ruby
<WJW> Maybe he meant $penis.
<shevy> no, too perlish
<shevy> they even have a "my" in front of that
<shevy> but what I hated most about perl were the mandatory ;
<pcfreak30> WJW, so i ran everything in shell and it works fine
<shevy> I kept on forgetting them all the time!
<WJW> pcfreak30, congratulations.
<apeiros_> we also pretend globals can't be assigned, and therefore no new ones can be defined…
<pcfreak30> but when running inside puppets env I get arg. Any ideas on tracking this
<WJW> pcfreak30, please post your current code.
anderson has joined #ruby
<WJW> pcfreak30, include the call that causes the problem.
aspires has quit []
hashbangchris has joined #ruby
mikepack has quit [Remote host closed the connection]
Guedes0 has quit [Ping timeout: 246 seconds]
lkba has joined #ruby
<pcfreak30> running inside of puppet period gives issues. isk why. running a test script works in shell
agjacome has quit [Ping timeout: 272 seconds]
agjacome has joined #ruby
<WJW> So you are saying something like Puppet::Parser::Functions:MultiCraftApi.new.arg ?
skulker has quit [Remote host closed the connection]
havenwood has joined #ruby
Faris has joined #ruby
Vivekananda has joined #ruby
Astralum has joined #ruby
aryaching has quit [Ping timeout: 272 seconds]
hashbangchris has quit [Ping timeout: 245 seconds]
Hanmac has joined #ruby
vikhyat_ has quit [Remote host closed the connection]
Hanmac1 has quit [Ping timeout: 252 seconds]
<pcfreak30> no
<pcfreak30> arg is outputted in method missing
<WJW> pcfreak30, what does your call look like?
<pcfreak30> api.listConnections
<WJW> Where do you get api?
<pcfreak30> api being a MultiCraftApi object
<pcfreak30> instance
Sawbones has joined #ruby
skulker has joined #ruby
<WJW> Ask it what is api.class
<WJW> pcfreak30, wait.
<pcfreak30> line 38
<pcfreak30> returns arg only inside puppet module
<pcfreak30> I dont have the time to hack into their code either
<WJW> pcfreak30, line 45 in https://gist.github.com/anonymous/d35cda1234f60a2a593f, what is arg supposed to be?
brunops has quit [Ping timeout: 245 seconds]
<WJW> These are the sorts of problems you get into when you define method_missing.
<pcfreak30> wrong var name
carlsedn_ has quit []
<pcfreak30> geeze
<WJW> That's where it's happening, I suspect.
<pcfreak30> i see your point
deol has joined #ruby
<pcfreak30> very obsecure
<shevy> yeah
<shevy> method_missing can become complicated
colonolGron has joined #ruby
smathieu has joined #ruby
<WJW> If I defined method_missing, I'd probably do it on an object that knows as little as possible else.
pskosinski has joined #ruby
Notte has joined #ruby
ambushsabre has joined #ruby
<apeiros_> pcfreak30: name = arg[:name], line 45
<apeiros_> you do not define a local variable `arg`
<apeiros_> so what happens is, that it becomes self.arg
reach has quit [Remote host closed the connection]
<apeiros_> i.e., a method
<WJW> apeiros_, I already caught that.
<shevy> argh
<apeiros_> ok
<shevy> descriptive names
<apeiros_> didn't read the whole backlog
<shevy> I_AM_ANGRY = true
<pcfreak30> anyway to prevent or catch that in the future
<WJW> or argsinh if you are into continuous math.
<shevy> arrrrr for pirate code
<apeiros_> pcfreak30: anyway, raise is a good concept - gives you a backtrace of who/what invoked your method
<apeiros_> alternatively use Kernel#caller
<pcfreak30> Error: Symbol as array index
<pcfreak30> you cant have symbols as array indexes?
<WJW> For that you need a Hash.
<apeiros_> yeah, *arguments means arguments is an Array, and arrays are index based, not key based.
<apeiros_> index = numerical
<pcfreak30> yea things are already hashes
smathieu has quit [Ping timeout: 252 seconds]
<pcfreak30> arrays of hashes
<apeiros_> that's fine, but arguments isn't a hash
<apeiros_> if one of your arguments is a hash, you have to get that one first
<WJW> pcfreak30, what are you trying to do?
jamesaxl has quit [Read error: Connection reset by peer]
<pcfreak30> atm, im finding it highly annoying
<pcfreak30> that errors in puppet functions dont give a trace or line number. only the puppet file line number
psyl0n has joined #ruby
<WJW> shevy, what is your problem?
<shevy> WJW hmmm there be so many
<WJW> shevy, does it have to do with your not understanding something about Ruby langauge that you need to understand?
<WJW> pcfreak30, I thought uncaught exceptions usually produced a full stack trace.
<shevy> WJW no, mostly it's all a matter of how much time I can afford
<apeiros_> pcfreak30: insert a `binding.pry` before that line
<apeiros_> (and require pry in puppet)
shedd has joined #ruby
Megtastique has quit []
<apeiros_> also I'd wonder if puppet wasn't able to emit the full backtrace
<apeiros_> e.g. via an option (like --trace with rake)
skulker_ has joined #ruby
jamesaxl has joined #ruby
<pcfreak30> code please
<pcfreak30> still have no clue what your referring to
skulker has quit [Ping timeout: 246 seconds]
<shevy> 2.days.from_now # Ruby
<shevy> 2.days().from_now() # Rust
petey has joined #ruby
aryaching has joined #ruby
clamstar has joined #ruby
skulker_ has quit [Remote host closed the connection]
mikepack has joined #ruby
<pcfreak30> undefined method `each_index' for nil:NilClass
<pcfreak30> and the object is an empty array?
<WJW> pcfreak30, no it is nil.
Zhwazi has quit [Ping timeout: 264 seconds]
<pcfreak30> line 43
Megtastique has joined #ruby
<pcfreak30> findConnections hash element points to an empty array
<pcfreak30> so why is nil returned
pgpkeys has joined #ruby
<WJW> Keys of @@methods are symbols, not strings.
kcombs has quit [Ping timeout: 246 seconds]
<apeiros_> gah, tripped again over rvm's automatic bundle exec…
Megtastique has quit [Client Quit]
<pcfreak30> um nope
<pcfreak30> it crashed on a symbol
rootshift has joined #ruby
<pcfreak30> it went farter converting it
<pcfreak30> farther
<WJW> pcfreak30, nope, you called .to_s on it.
<pcfreak30> no
<pcfreak30> i added that after an error
<pcfreak30> and it didnt repeat
<pcfreak30> rror: Symbol as array index
<WJW> Show the code that failed.
<pcfreak30> you are seeing it
pgpkeys has quit [Client Quit]
<pcfreak30> remove .to_s
<pcfreak30> and thats the code
<WJW> Is it a symbol that isn't one of the keys of @@methods?
<pcfreak30> nope
rootshift has quit [Client Quit]
<pcfreak30> the methods ca;;ed are in the puppet fnction at the top
Wolland has quit [Remote host closed the connection]
sassamo has quit [Read error: Connection reset by peer]
<WJW> Double check that you removed the .to_s.
sassamo has joined #ruby
drumusician has joined #ruby
Zhwazi has joined #ruby
<pcfreak30> no. i didnt
<pcfreak30> i ment the code crashing is what you have
<pcfreak30> but remove .to_s
<pcfreak30> as you asked for it
olivier_bK has joined #ruby
banghouse has joined #ruby
<pcfreak30> is there a way to dump an object representation of a variable
<pcfreak30> php has var_dump and var_export
<WJW> variable.inspect
Virtualize has joined #ruby
jkhwan has joined #ruby
banghouse is now known as Guest4421
pushpak has quit [Quit: Linkinus - http://linkinus.com]
Sawbones has quit []
Seich has joined #ruby
<WJW> pcfreak30, your statements confuse me. Remove the .to_s and run the resulting code.
<pcfreak30> ?
<pcfreak30> earlier you asked for the crashing code regarding the .to_s problem
<pcfreak30> so im stating its the same but without that call
<WJW> If you have code without the .to_s, try running it, and if it crashes, post it.
<pcfreak30> i have earlier
<apeiros_> IMO pcfreak30 should write some unit tests for MultiCraftApi. then you'd have a base to go for reproducability.
<WJW> What is the address?
<pcfreak30> i added to_s after it crashed and it ran further as ive stated
<pcfreak30> puts @@methods[method].inspect
<WJW> You have to take out the to_s.
<pcfreak30> returns [{:type=>:array, :name=>:field}, {:type=>:array, :name=>:value}]
<apeiros_> btw., `puts foo.inspect` --> `p foo`
<apeiros_> (same output)
<pcfreak30> WJW: if i do, you get Error: Symbol as array index
<pcfreak30> thats what came earlier and what im trying to explain.
<WJW> On what line, and in what file?
<pcfreak30> thats the thing
clamstar has quit [Quit: Computer has gone to sleep.]
<pcfreak30> puppet doesnt give a damn line
<WJW> OH.
<pcfreak30> so i have to figure it out blind
renklaf has quit [Remote host closed the connection]
chrisgw has quit [Quit: Leaving.]
Virtualize has quit [Ping timeout: 272 seconds]
<pcfreak30> it runs via some weid eval black magic i guess and only gives the puppet file line
<pcfreak30> not ruby code
jkhwan has quit [Ping timeout: 272 seconds]
Guest4421 has quit [Ping timeout: 272 seconds]
<pcfreak30> so at present argnames = @@methods[method] crashes
<pcfreak30> based on trial/error
<apeiros_> pcfreak30: do you have example values for user, url, key and lookupvar('ipaddress')?
<waxjar> what is method in @@methods[method].to_s? i'm guessing its a symbol like the error says.
<pcfreak30> yes
<pcfreak30> read at the top
<pcfreak30> connections = api.findConnections :ip, lookupvar('ipaddress')
<apeiros_> and that's an example value how?
<pcfreak30> and btw, lookupvar is a puppet function to get a puppet variable in the manifest
<pcfreak30> so a symbol and string are passed
<apeiros_> yes, and I don't have puppet, so I ask *you* for an exemplary value of that function.
<apeiros_> you know, that's the part about reproducability I've been raving about…
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros_> you remove the parts which are not relevant dependencies of your problem and substitute them with fixed values.
kcombs has joined #ruby
drumusician has quit [Ping timeout: 252 seconds]
colonolGron has quit [Quit: leaving]
figgleberry has joined #ruby
rjhunter has joined #ruby
deol has quit [Remote host closed the connection]
deol has joined #ruby
<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.
mmitchell has joined #ruby
grep_awesome is now known as grep_away
<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)
LexicalScope` has quit [Quit: Leaving]
<WJW> Ouch, I didn't catch "send".
<apeiros_> and https://gist.github.com/anonymous/8b6edfbc1da7b2650ca8#file-gistfile1-rb-L68 will raise too, since your values are symbols.
<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]
joaoh82 has quit [Ping timeout: 260 seconds]
<ForceMultiplier> can someone help me out? not sure why it is giving me the error "cant convert string into integer" here... https://gist.github.com/FPSDavid/de97d55a0795f817554d
<pcfreak30> apeiros_: cant. some code relies on the index pos
<apeiros_> then use each_with_index
<drPoggs> ForceMultiplier: Which line?
<pcfreak30> didnt know that existed. tried and got an not defined
<ForceMultiplier> drPoggs: "<h2>" + imdb['title'] + "</h2>"
<waxjar> ForceMultiplier: presumably imdb['rating_count'] returns an Integer
<apeiros_> ForceMultiplier: imdb['rating_count'] is probably an integer
<ForceMultiplier> i've tried it on anything, including imdb['title']
<ForceMultiplier> which is def not an integer
<ForceMultiplier> same error
<drPoggs> ForceMultiplier: Put imdb['title'].class - what does it return?
<apeiros_> ForceMultiplier: how about just inspecting instead of guessing?
<apeiros_> drPoggs: p, not puts
<apeiros_> ah, well, you did .class
wallerdev has joined #ruby
rootshift has joined #ruby
<apeiros_> I'd just `p imdb['title']` (or whatever)
<drPoggs> apeiros_: assuming this is in a view rather than a script
<waxjar> ForceMultiplier: more importantly, why aren't you using a proper HTTP library? :p
<ForceMultiplier> cuz i dunno what im doing lol, super new to this stuff
<ForceMultiplier> just trying to tailor http://www.slideshare.net/a_l/simple-web-apps-with-sinatra to do what i want it to do
<waxjar> ah, then it's okay :)
codenapper has quit [Quit: codenapper]
<apeiros_> pcfreak30: also, when you get so far - api.findConnections will probably not return what you want
codenapper has joined #ruby
mgberlin has joined #ruby
<apeiros_> since it invokes method_missing, it'll return method_missing's return value, which currently is argnames
<WJW> ForceMultiplier, there is a #sinatra channel.
<apeiros_> (because argnames.each_index { … } is the last expression, and that just returns argnames)
<ForceMultiplier> WJW, im aware... quite dead over there
<ForceMultiplier> and its probably a ruby code issue anyways, i assume
codenapper has quit [Client Quit]
eka has quit [Quit: Computer has gone to sleep.]
<apeiros_> pcfreak30: also I somewhat doubt that you want to call MultiCraftApi#send for every argument (which is what you currently do)
codecop has quit [Remote host closed the connection]
<ForceMultiplier> drPoggs: i tried .class and it says the same string into int error
<drPoggs> ForceMultiplier: What about imdb.class then?
<ForceMultiplier> Array
rootshift has quit [Quit: rootshift]
Hobogrammer has quit [Ping timeout: 252 seconds]
Synthead has joined #ruby
Mon_Ouie has quit [Ping timeout: 252 seconds]
brunops has joined #ruby
<ForceMultiplier> in irb
bklane has joined #ruby
<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> hmm?
<pcfreak30> on http://rspec.info/
<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 "&LT;".
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
frog0909 has joined #ruby
mjmac has joined #ruby
<ForceMultiplier> cool, got it
<ForceMultiplier> thanks
<WJW> I saw your question mark, pcfreak30.
brunops has quit [Client Quit]
TheMoonMaster has joined #ruby
pinage404 has joined #ruby
<ForceMultiplier> so fancy :P
<pcfreak30> hmm, is there any sort of standard for structuring unit test files on a library thats not based on a framework
skulker has joined #ruby
gtc has joined #ruby
crodas has joined #ruby
drumusician has joined #ruby
mksm has joined #ruby
timonv has quit [Ping timeout: 260 seconds]
kcombs has quit [Remote host closed the connection]
<WJW> Maybe make a directory of the test files to mirror the regular code files?
skulker has quit [Remote host closed the connection]
eka has joined #ruby
claymore has quit [Quit: Leaving]
xai has joined #ruby
xai has quit [Client Quit]
s2013 has joined #ruby
eka has quit [Client Quit]
frog0909 has quit [Quit: Leaving...]
Hanmac has joined #ruby
deryl has quit [Quit: Leaving]
charliesome has joined #ruby
Megtastique has joined #ruby
lnormous has joined #ruby
Hanmac1 has quit [Ping timeout: 260 seconds]
bklane has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 260 seconds]
Wolland has joined #ruby
axl_ has quit [Quit: axl_]
specious has quit [Ping timeout: 252 seconds]
charliesome has quit [Client Quit]
axl_ has joined #ruby
Virtualize has joined #ruby
Megtastique has quit []
byprdct has quit [Ping timeout: 252 seconds]
frog0909 has joined #ruby
charliesome has joined #ruby
Virtualize has quit [Ping timeout: 272 seconds]
maroloccio has joined #ruby
wallerdev has quit [Quit: wallerdev]
brennanMKE has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
coffeina has quit [Quit: Wychodzi]
shedd has quit [Remote host closed the connection]
coffeina has joined #ruby
flubba has joined #ruby
cbetta_afk is now known as cbetta
Wolland has quit [Ping timeout: 246 seconds]
coffeina has quit [Read error: Connection reset by peer]
cashnguns has joined #ruby
coffeina has joined #ruby
ephemerian has quit [Quit: Leaving.]
cashnguns has quit [Client Quit]
swistak35 has joined #ruby
coffeina has quit [Client Quit]
aryaching has quit [Ping timeout: 245 seconds]
Faris has quit [Ping timeout: 272 seconds]
aryaching has joined #ruby
coffeina has joined #ruby
frog0909 has quit [Quit: Leaving...]
mPresent has joined #ruby
Jetchisel has left #ruby ["Unfortunately time is always against us -- *Morpheus*"]
joaoh82 has joined #ruby
chrisan has joined #ruby
kep has quit [Quit: WeeChat 0.4.2]
aryaching has quit [Ping timeout: 252 seconds]
Faris has joined #ruby
coffeina has quit [Client Quit]
coffeina has joined #ruby