ivar has quit [Read error: Connection reset by peer]
shastaky has joined #ruby
preller has quit [Ping timeout: 265 seconds]
shastaky has quit [Read error: Connection reset by peer]
ivar has joined #ruby
preller has joined #ruby
shastaky has joined #ruby
raphaelivan has joined #ruby
shastaky has quit [Remote host closed the connection]
mojjojo has quit [Quit: mojjojo]
lewix has joined #ruby
shastaky has joined #ruby
tkuchiki has joined #ruby
xk_id has quit [Quit:
nullsign has quit [Ping timeout: 240 seconds]
ivar has quit [Read error: Connection reset by peer]
ivar has joined #ruby
Azure has quit [Quit: My MBP went to sleep.]
phipes has quit [Remote host closed the connection]
Azure has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
sambao21 has quit [Quit: Computer has gone to sleep.]
g0bl1n has quit [Ping timeout: 252 seconds]
mark_locklear has quit [Ping timeout: 246 seconds]
fandikurnia01 has quit [Quit: Leaving]
sambao21 has joined #ruby
ewnd9 has quit [Ping timeout: 272 seconds]
nullsign has joined #ruby
shastaky has quit [Quit: Leaving...]
crucify_me has joined #ruby
shastaky has joined #ruby
liamkeil1 has joined #ruby
marr has quit [Ping timeout: 260 seconds]
postmodern has joined #ruby
<crucify_me>
hi incorrigible noob here: sorry, but why does this prog. appear to run twice? Also, is require_relative completely replaced require || why do I need it to run here? thanks: http://pastie.org/8562039
<crucify_me>
has* require_relative
tvw has quit []
<crucify_me>
<<
<crucify_me>
^^
liamkeily has quit [Ping timeout: 250 seconds]
ssvo has joined #ruby
punkcat has quit [Ping timeout: 272 seconds]
troyready has quit [Quit: Leaving]
sparq has joined #ruby
Nogbit has joined #ruby
troyready has joined #ruby
brennanMKE has quit [Remote host closed the connection]
iliketu__ has quit [Quit: zzzzz…..]
kitak_ has joined #ruby
digifiv5e has joined #ruby
mikepack_ has joined #ruby
digifiv5e is now known as Guest79735
blazeroot has quit [Quit: Wychodzi]
nanoyak has quit [Quit: Computer has gone to sleep.]
culturel_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ckinni has joined #ruby
mikepack has quit [Read error: Operation timed out]
phipes has joined #ruby
gverri has joined #ruby
jamblack has quit [Quit: jamblack]
kitak has quit [Ping timeout: 245 seconds]
tonni has quit [Read error: Connection reset by peer]
tonni has joined #ruby
xk_id has joined #ruby
mikepack_ has quit [Ping timeout: 272 seconds]
freakazoid0223 has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Read error: Operation timed out]
n0kada has quit [Remote host closed the connection]
coca_rails has joined #ruby
guardianx has joined #ruby
rushed has joined #ruby
moneydouble has joined #ruby
liamkeil1 has quit [Ping timeout: 264 seconds]
hadees has quit [Quit: hadees]
momomomomo has quit [Quit: momomomomo]
michaeldeol has quit [Remote host closed the connection]
coca_rails has quit [Ping timeout: 245 seconds]
lyanchih has joined #ruby
codygman has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
<YOURBESTFRIEND>
I shall use this instead of underscores from now on, much clearer
coldmethod has quit [Remote host closed the connection]
CaptainJet has quit [Read error: No route to host]
zeromodulus has joined #ruby
Spami has joined #ruby
dhruvasagar has quit [Ping timeout: 264 seconds]
phipes has quit [Remote host closed the connection]
fuhgeddaboudit has quit [Ping timeout: 260 seconds]
hogoo has joined #ruby
whunt has joined #ruby
preller has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
nomenkun has quit [Quit: Leaving...]
kevind has joined #ruby
hogoo has quit [Remote host closed the connection]
noop has quit [Ping timeout: 260 seconds]
baroquebobcat has joined #ruby
nomenkun has joined #ruby
tylersmith has joined #ruby
soba has joined #ruby
mrsolo has joined #ruby
mrsolo has quit [Client Quit]
CaptainJet has joined #ruby
preller has joined #ruby
whunt has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
tylersmith has quit [Ping timeout: 260 seconds]
Spami has quit [Quit: This computer has gone to sleep]
preller has quit [Ping timeout: 248 seconds]
guiocavalcanti has quit [Remote host closed the connection]
cow_ has quit [Remote host closed the connection]
centipedefarmer has quit [Remote host closed the connection]
nomenkun has quit [Remote host closed the connection]
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
preller has joined #ruby
preller has joined #ruby
preller has quit [Changing host]
funburn has quit [Quit: funburn]
jamblack has joined #ruby
phipes has joined #ruby
Spami has joined #ruby
mgberlin has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
habanany1 has joined #ruby
gquental has quit [Ping timeout: 252 seconds]
petey_ has joined #ruby
_5kg has quit [Excess Flood]
_5kg has joined #ruby
zeade has quit [Quit: Leaving.]
Fire-Dragon-DoL has quit [Quit: Leaving.]
hogeo has quit [Remote host closed the connection]
hogeo has joined #ruby
habanany has quit [Read error: Operation timed out]
yfeldblum has joined #ruby
digital-ghost has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
culturel_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
coca_rails has joined #ruby
Akuma has joined #ruby
braincrash has joined #ruby
flaccid has quit [Read error: Connection reset by peer]
timonv has joined #ruby
hogeo has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
hogeo has joined #ruby
crucify_me has quit []
coca_rails has quit [Ping timeout: 245 seconds]
yacks has quit [Quit: Leaving]
L8D has quit [Ping timeout: 248 seconds]
habanany1 has quit [Ping timeout: 250 seconds]
timonv has quit [Ping timeout: 252 seconds]
preller has quit [Ping timeout: 252 seconds]
jamest3 has joined #ruby
<jamest3>
Does anyone know of a good news api (preferable one that lets me send a query string regarding what topic/person i want to search for) i can incorporate into my rails app?
michaeldeol has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
gquental has joined #ruby
hogeo has quit [Remote host closed the connection]
Asitha has quit []
subbyyy_ has joined #ruby
jamblack has quit [Quit: jamblack]
jamblack has joined #ruby
AMcP has quit [Remote host closed the connection]
AMcP has joined #ruby
ahawkins has joined #ruby
AMcP has quit [Read error: Connection reset by peer]
michaeldeol has quit [Ping timeout: 260 seconds]
AMcP has joined #ruby
preller has joined #ruby
freakazoid0223 has quit [Ping timeout: 240 seconds]
phipes has quit [Remote host closed the connection]
dktm has joined #ruby
cmedeiros has quit [Ping timeout: 245 seconds]
machuga is now known as machuga|away
freerobby has quit [Quit: Leaving.]
yfeldblum has joined #ruby
culturel_ has joined #ruby
hogeo has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
io_syl has quit []
dseitz has joined #ruby
framling has quit [Quit: Lost terminal]
phipes has joined #ruby
framling has joined #ruby
xk_id has quit [Quit:
yfeldblum has quit [Read error: Operation timed out]
preller has quit [Ping timeout: 260 seconds]
jkhwan has quit [Remote host closed the connection]
brennanMKE has joined #ruby
ce_afk is now known as cescalante
moneydouble has quit [Quit: Leaving.]
lfox has quit [Quit: ZZZzzz…]
mj12albert has joined #ruby
brennanMKE has quit [Ping timeout: 240 seconds]
cow_ has joined #ruby
preller has joined #ruby
fijimunkii has joined #ruby
cescalante is now known as ce_afk
justsee has quit [Ping timeout: 250 seconds]
Bira has quit [Remote host closed the connection]
L8D has joined #ruby
jamest3 has quit [Remote host closed the connection]
<shevy>
I really dont know why you need to use "ruby bla" rather than just ClassName.new(something)
subbyyy has quit [Quit: none 0.3.9.2]
<hephaestus_rg>
b/c the ruby files don't strictly even need to be classes
<hephaestus_rg>
according to the official rules
zz_N00D is now known as CripperZ
<shevy>
omg :\
<hephaestus_rg>
just read from stdin and ouput to stdout
gja has joined #ruby
pwestlund_away is now known as pwestlund
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hephaestus_rg>
i was considering doing it that way, but then that creates a leaky abstraction
LostMonk- has quit [Read error: Connection reset by peer]
<shevy>
Anyway, I have a big .rb file that is 1.1MB in size and has about 72 arrays, with a total content of 11.000
<hephaestus_rg>
where my strategy.rb file needs to be different in development
tyl has joined #ruby
<shevy>
reading that file in with File.readlines takes less than a second
<shevy>
how big are the files you read in?
<hephaestus_rg>
well, i'm also on an intel atom 1.6ghz
<hephaestus_rg>
and a 5400 rpm hdd
<hephaestus_rg>
the ruby file is
<shevy>
I have a cheap machine
<shevy>
only RAM is high, 4 gig
LostMonk has joined #ruby
<hephaestus_rg>
~ 10k characters
<krainboltgreene>
machty: No, it doesn't.
<shevy>
should be super fast then
Elhu has joined #ruby
<hephaestus_rg>
the input to the strategy file
<hephaestus_rg>
is about 500 characters
simoz4 has joined #ruby
<krainboltgreene>
machty: Websockets is "TCP-like" persistant connections over HTTP which is over TCP.
<hephaestus_rg>
the slowdown seems to be starting and restarting the ruby interpreter
<krainboltgreene>
It's basically TCP via HTTP if you can't do straight up TCP.
<hephaestus_rg>
via backticks
<hephaestus_rg>
i wouldn't call myself a great dev by any stretch, so if you think the whole process could be redesigned let me know
ayaz has joined #ruby
ayaz has quit [Changing host]
ayaz has joined #ruby
hephaestus_rg has left #ruby [#ruby]
hephaestus_rg has joined #ruby
<hephaestus_rg>
whoops closed the wrong tab
ayaz has quit [Client Quit]
HD has joined #ruby
klaut has quit []
zeromodulus has quit [Quit: leaving]
freerobby has joined #ruby
sg has joined #ruby
wald0 has joined #ruby
<pragmatism>
hephaestus_rg: womp womp
lewix has quit [Remote host closed the connection]
hephaestus_rg has left #ruby [#ruby]
Beoran_ has joined #ruby
hephaestus_rg has joined #ruby
<hephaestus_rg>
Colloquy has unintuitive right click behavior
<pragmatism>
Which OS are you running?
lewix has joined #ruby
ayaz has joined #ruby
<sg>
for the purposes of models' class design how should i handle something like an accounting system where each Transaction has several LineItems that each have an Account and Amount?
zipper has quit [Ping timeout: 252 seconds]
<hephaestus_rg>
OSX
<pragmatism>
Dude, Linkinus
<sg>
then i need to enumerate all lineitems of a given account
<pragmatism>
check it out
ayaz has quit [Changing host]
ayaz has joined #ruby
simoz4 has quit [Ping timeout: 240 seconds]
<hephaestus_rg>
paid irc client?
angusiguess has joined #ruby
zipper has joined #ruby
preller has quit [Ping timeout: 265 seconds]
dayepa has joined #ruby
Beoran has quit [Ping timeout: 272 seconds]
<pragmatism>
sg: Have the parent class maintain an ivar array that only allows objects of LineItem type. I'm assuming you're using a relational database to store your data: use a ActiveRecord or another system to store those relationships
preller has joined #ruby
<pragmatism>
hephaestus_rg: Great client.
freerobby has quit [Ping timeout: 260 seconds]
<pragmatism>
Try the trial
<sg>
pragmatism: this is more of a personal exercise to help me with my OO design, i am not using any backend to store any data
<hephaestus_rg>
i might end up impulse buying it if i do
<pragmatism>
Ah
<hephaestus_rg>
lets see if i can put up with colloquy
dayepa has quit [Client Quit]
timonv has quit [Remote host closed the connection]
<pragmatism>
Then transaction should have an ivar array that only allows items of class Transaction
<pragmatism>
sorry of class Linetimes
brennanMKE has joined #ruby
timonv has joined #ruby
<pragmatism>
and each LineItem should be initialized with an account and Amount
<pragmatism>
data classes.
johno has left #ruby [#ruby]
angusiguess has quit [Ping timeout: 240 seconds]
<sg>
right. but then i have the scenario of needing to get all LineItems associated with a specific account (we dont care about transactions which may have lineitems from different accounts)
<sg>
how do i do that without needing to iterate through every transaction's lineitems?
tonni has quit [Remote host closed the connection]
tonni has joined #ruby
varfoo has joined #ruby
OdNairy has quit [Ping timeout: 260 seconds]
<pragmatism>
Update an Account array of IDs each time a transaction refers to it?
dayepa has joined #ruby
preller has quit [Ping timeout: 248 seconds]
krz has joined #ruby
timonv has quit [Ping timeout: 265 seconds]
brennanMKE has quit [Ping timeout: 265 seconds]
<sg>
hma
<sg>
hm*
<pragmatism>
If they cannot be initialized in order (data objects), then without an relational DB you'll have to refer to the objects on both ends with a controller.
LostMonk- has joined #ruby
<pragmatism>
Which is whack
<pragmatism>
Stateless machines may not work in your example/
<pragmatism>
So you end up with something stateful with no ability to persist
subbyyy has joined #ruby
<pragmatism>
I'm sure there's a better pattern for your problem
<pragmatism>
but in RL, use a DB.
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
subbyyy has quit [Client Quit]
tonni has quit [Ping timeout: 245 seconds]
LostMonk has quit [Ping timeout: 265 seconds]
<sg>
thanks
LostMonk- has quit [Read error: Connection reset by peer]
CpuID has quit [Ping timeout: 250 seconds]
preller has joined #ruby
jwang has quit [Quit: Leaving]
txdv has quit [Ping timeout: 252 seconds]
dapz has joined #ruby
mikepack has quit [Remote host closed the connection]
culturel_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GreatSUN>
if someone has an idea on that, please tell me
<shevy>
Xeago the cool kids have flashy IDEs
<krainboltgreene>
If you had to turn a method into JSON, what would your structure be?
<nakazanieto>
popl: im newbie in programming. What are u think? Ruby is easy to learn for something who never programming?
zipper has quit [Ping timeout: 246 seconds]
punkcat has quit [Ping timeout: 264 seconds]
<shevy>
nakazanieto start with php
<shevy>
nakazanieto in 2 years you will switch to a better language
<nakazanieto>
i dont like php.
<shevy>
but you are newbie
<krainboltgreene>
nakazanieto: Yes, Ruby can be easy to learn.
<shevy>
you have to start somewhere
drago777 has quit [Ping timeout: 240 seconds]
<krainboltgreene>
nakazanieto: But it's not a shallow language. It has some deep complexity that can be useful and annoying.
Nilium has quit [Ping timeout: 246 seconds]
<GreatSUN>
this is just an example, also the real implementation is much more complicated and has even more features as well as there are a lot of modules integrated in different classes/parts of the overall
<GreatSUN>
so please don't discuss for some complete other solution
<krainboltgreene>
GreatSUN: What's with line 2?
<shevy>
you use @@class_vars
<shevy>
that is awful
sayan has quit [Ping timeout: 265 seconds]
<krainboltgreene>
It's only terrible if you don't understand global scope problems.
<GreatSUN>
shevy: is there some other solution to have static methods and instance methods access the same variable/value?
<krainboltgreene>
Hard to justify tho.
mosheee has quit [Ping timeout: 246 seconds]
mklappstuhl has quit [Remote host closed the connection]
<shevy>
krainboltgreene can you show me code where you use @@class_vars?
<krainboltgreene>
GreatSUN: Yeah, a few ways, but in your case it works. I suggest having a getter and setter for the instance variable.
<krainboltgreene>
shevy: Data that I want to have access to from all classes and instances of those classes.
<GreatSUN>
krainboltgreene: it doesnt work to be honest
<krainboltgreene>
GreatSUN: I'll make a comment.
<shevy>
krainboltgreene I mean specific, you are on github or? do you recall any of your projects? I'd like to peek into your code there if you don't mind
<GreatSUN>
ahh
<GreatSUN>
ok
<shevy>
GreatSUN you could (mis)use constants
xiphias has quit [Ping timeout: 240 seconds]
<GreatSUN>
stupid me
noc0de has quit [Ping timeout: 246 seconds]
mklappstuhl has joined #ruby
<GreatSUN>
you should read errors carefully :D
<krainboltgreene>
That's true.
<GreatSUN>
krainboltgreene: you are welcome to make a comment
<krainboltgreene>
shevy: Oh man, I think do but I'm not sure if it's public. Momento.
vlad_starkov has joined #ruby
<GreatSUN>
shevy: misuse is the match
drago777 has joined #ruby
<shevy>
GreatSUN misuse in the sense because a constant should be unchangable
<shevy>
but you could always use them to store stuff in a module too
<GreatSUN>
shevy: exactly
xiphias has joined #ruby
<shevy>
ARRAY_FOO = ["bla"]
<GreatSUN>
I know
Xeago has quit [Remote host closed the connection]
<krainboltgreene>
CONSTANTs are good if you don't want to modify things.
<GreatSUN>
but that is not a better solution
<GreatSUN>
thats even worse
<krainboltgreene>
Class variables are essentially constants that can be modified.
<shevy>
ARRAY_FOO can be freely modified as well
<GreatSUN>
krainboltgreene: and exist in a special contect
<krainboltgreene>
:|
<krainboltgreene>
You shouldn't modify constants. You're breaking the language contract.
<GreatSUN>
context
<shevy>
ruby allows you to change constants freely
<shevy>
the name is silly though
<GreatSUN>
krainboltgreene: what is worse? changing constants and misuse them or using classvars
<GreatSUN>
:D
<shevy>
a constant that can be changed should not be called a constant
<GreatSUN>
shevy: I know a lot of languages doing the same, but that doesn't mean that they should be changes like that
<GreatSUN>
even though you don't have them in limited context
s2013 has joined #ruby
<shevy>
GreatSUN I do wonder about that too. I don't like it that in ruby constants are named constants but they can be changed
<krainboltgreene>
GreatSUN: Class Variables have a bad wrap because they have global scope.
<krainboltgreene>
And global scope is not easy.
<shevy>
:D
<krainboltgreene>
Because it can be very confusing.
<shevy>
yeah
moshee has joined #ruby
moshee has joined #ruby
LiohAu has quit [Ping timeout: 272 seconds]
<krainboltgreene>
Suddenly your tests are behaving weird and you're not quite sure why.
<GreatSUN>
krainboltgreene: surely, but not easy and confusing doesn't mean it's a bad style
<krainboltgreene>
The same goes for singleton methods tho.
<jle`>
class variables are namespaced globals so it's not as bad as a global just sitting there
Nilium has joined #ruby
<jle`>
but they are definitely abusable
mklappstuhl has quit [Ping timeout: 245 seconds]
<krainboltgreene>
shevy: I just did an ack on my code directory for '@@', it'll be a bit.
shadoi has joined #ruby
<shevy>
hehe
postmodern has quit [Quit: Leaving]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shevy>
I searched the source of rack
<shevy>
for @@
<shevy>
test/spec_builder.rb: @@env = env
nakazanieto has left #ruby [#ruby]
<shevy>
that's the only file where it is used :)
noc0de has joined #ruby
ss_ has quit [Remote host closed the connection]
<krainboltgreene>
Woops, accidentally searched my ruby and rubinius repository :P
<dweeb_>
How can I read the first 10 lines of a remote txt file that is 100mb?
<krainboltgreene>
A few stdlibs use class variables, but I'm not sure if I'd say they are good examples.
xiphias has quit [Ping timeout: 240 seconds]
mojjojo has quit [Quit: mojjojo]
eka has joined #ruby
coca_rails has quit [Ping timeout: 245 seconds]
xiphias has joined #ruby
<shevy>
I shy away from the japanese comments :D
shadoi has quit [Ping timeout: 248 seconds]
s2013 has quit [Ping timeout: 252 seconds]
<krainboltgreene>
Ah-ha!
LiamFederer has joined #ruby
<cbetta>
can someone explain to me how to add a method that is used outside of method scope in an object instance? What I mean is something like Rails's "belongs_to" method
mercwithamouth has quit [Ping timeout: 240 seconds]
<krainboltgreene>
Okay, so here's why I think I did this: I wanted a class level set of configurations that could then be modified for instance level configurations
<krainboltgreene>
The class level configurations get their data from env variables, like ENV["WHISKEY_SERVER_HOST"]
mercwithamouth has joined #ruby
<krainboltgreene>
And then you can modify them further for instances of servers. I forgot to implement the latter.
shredding has quit [Quit: shredding]
<krainboltgreene>
And really the former doesn't need to be a class variable, since no one is writing to it.
<krainboltgreene>
It can be a constant.
dangerousdave has joined #ruby
Heskie has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
tfitts has quit [Read error: Connection reset by peer]
guiocava_ has joined #ruby
michaeldeol has joined #ruby
lyanchih has joined #ruby
<krainboltgreene>
But I can still see the pattern being useful, when you have shared settings for all classes that can be modified AFTER the class has been defined.
mojjojo has joined #ruby
freerobby has quit [Ping timeout: 252 seconds]
tfitts has joined #ruby
cmedeiros has joined #ruby
guiocavalcanti has quit [Ping timeout: 245 seconds]
Duckily has quit [Ping timeout: 248 seconds]
<shevy>
hmm
cow_ has joined #ruby
vikhyat has quit [Remote host closed the connection]
dogweather has quit [Remote host closed the connection]
dogweather has joined #ruby
ahri has quit [Ping timeout: 272 seconds]
MrJoshua has quit [Quit: MrJoshua]
drumusician has joined #ruby
MrJoshua has joined #ruby
vlad_starkov has joined #ruby
mklappstuhl has joined #ruby
brennanMKE has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
michaeldeol has quit [Ping timeout: 260 seconds]
drago777 has quit [Ping timeout: 240 seconds]
dogweather has quit [Ping timeout: 250 seconds]
mklappst_ has joined #ruby
nari has joined #ruby
dogweather has joined #ruby
cmedeiros has quit [Ping timeout: 252 seconds]
Yan__ has quit [Ping timeout: 252 seconds]
mklappstuhl has quit [Ping timeout: 248 seconds]
drago777 has joined #ruby
cbetta is now known as cbetta_afk
viod has joined #ruby
brennanMKE has quit [Ping timeout: 260 seconds]
jibi has quit [Quit: leaving]
mklappst_ has quit [Ping timeout: 246 seconds]
sayan has joined #ruby
mojjojo has quit [Quit: mojjojo]
banghouse2 has joined #ruby
andycamp has joined #ruby
nfk has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
ss_ has joined #ruby
mojjojo has joined #ruby
yacks has joined #ruby
tonni has quit [Remote host closed the connection]
tonni has joined #ruby
esing has quit [Remote host closed the connection]
jokke has joined #ruby
diegoviola has joined #ruby
drago777 has quit [Ping timeout: 240 seconds]
mojjojo has quit [Client Quit]
esing has joined #ruby
akonny has quit [Quit: akonny]
whysobad has quit [Ping timeout: 272 seconds]
tonni has quit [Ping timeout: 252 seconds]
dayepa has joined #ruby
mlpinit has joined #ruby
drago777 has joined #ruby
vlad_starkov has joined #ruby
esing has quit [Remote host closed the connection]
wildroman2 has joined #ruby
mojjojo has joined #ruby
charliesome has joined #ruby
wildroman2 has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
wildroman2 has joined #ruby
ghr has joined #ruby
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
hogeo has joined #ruby
mojjojo has quit [Client Quit]
mklappstuhl has joined #ruby
dvarrui has joined #ruby
camilasan has joined #ruby
drPoggs has quit [Quit: +++ATH]
lyanchih has quit [Ping timeout: 250 seconds]
esing has joined #ruby
esing has joined #ruby
esing has quit [Changing host]
mojjojo has joined #ruby
rootshift has joined #ruby
drago777 has quit [Ping timeout: 240 seconds]
petey_ has joined #ruby
drago777 has joined #ruby
dvarrui has quit [Quit: Saliendo]
w4pm has joined #ruby
hogeo has quit [Remote host closed the connection]
rootshift has quit [Ping timeout: 240 seconds]
hogeo has joined #ruby
aryaching has joined #ruby
petey_ has quit [Ping timeout: 260 seconds]
coca_rails has joined #ruby
intuxicated has quit [Read error: No route to host]
gja has quit [Quit: This computer has gone to sleep]
mark_locklear has joined #ruby
w4pm has quit [Ping timeout: 264 seconds]
drumusician has quit [Ping timeout: 265 seconds]
zipper has joined #ruby
vlad_starkov has joined #ruby
coca_rails has quit [Ping timeout: 245 seconds]
culturel_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Xeago has joined #ruby
zipper_ has joined #ruby
zipper has quit [Ping timeout: 265 seconds]
Xeago has quit [Ping timeout: 246 seconds]
gja has joined #ruby
banghouse2 is now known as banghouse
freerobby has joined #ruby
vikhyat has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
Yan__ has joined #ruby
popl has quit [Ping timeout: 260 seconds]
dayepa has quit [Quit: dayepa]
Hanmac1 is now known as Hanmac
freerobby has quit [Ping timeout: 246 seconds]
vikhyat has quit [Remote host closed the connection]
Duckily has joined #ruby
mark_locklear has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
jamesaanderson has joined #ruby
bogeyd6 has quit [Ping timeout: 246 seconds]
Bofu2U has joined #ruby
Neomex has joined #ruby
michaeldeol has joined #ruby
Neomex has quit [Client Quit]
Duckily has quit [Ping timeout: 240 seconds]
cow_ has quit [Read error: Connection reset by peer]
cow_ has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
brennanMKE has joined #ruby
ayaz has quit [Quit: Lost terminal]
Mon_Ouie has quit [Ping timeout: 245 seconds]
michaeldeol has quit [Ping timeout: 248 seconds]
ace_striker has quit [Ping timeout: 272 seconds]
ewnd9 has quit [Read error: Operation timed out]
BizarreCake has joined #ruby
Yan__ has quit [Ping timeout: 248 seconds]
alexherbo2 has quit [Ping timeout: 246 seconds]
sergicles has joined #ruby
preller has quit [Read error: Operation timed out]
yfeldblum has joined #ruby
amundj has quit [Ping timeout: 250 seconds]
akonny has joined #ruby
brennanMKE has quit [Ping timeout: 260 seconds]
gja has quit [Quit: This computer has gone to sleep]
andycamp has quit [Quit: andycamp]
gja has joined #ruby
phansch has joined #ruby
amundj has joined #ruby
andycamp has joined #ruby
yacks has quit [Ping timeout: 250 seconds]
amundj has quit [Client Quit]
yfeldblum has quit [Ping timeout: 264 seconds]
aagdbl has quit [Read error: Connection reset by peer]
aagdbl has joined #ruby
centipedefarmer has joined #ruby
aagdbl has quit [Read error: Connection reset by peer]
aagdbl has joined #ruby
Elhu has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amundj has joined #ruby
dayepa has joined #ruby
dayepa has quit [Client Quit]
camilasan has quit [Remote host closed the connection]
dayepa has joined #ruby
habanany has joined #ruby
camilasan has joined #ruby
mojjojo has quit [Quit: mojjojo]
rubyracer has joined #ruby
sharms has quit [Ping timeout: 240 seconds]
preller has joined #ruby
sharms has joined #ruby
cow_ has quit [Remote host closed the connection]
banister has joined #ruby
mojjojo has joined #ruby
esing has quit [Remote host closed the connection]
Xeago has joined #ruby
troyready has joined #ruby
Mohan has quit [Ping timeout: 245 seconds]
hogeo has quit [Remote host closed the connection]
rubyracer has quit [Quit: Konversation terminated!]
gregoriokusows-1 has joined #ruby
osvico has joined #ruby
aryaching_ has joined #ruby
troyready has quit [Max SendQ exceeded]
drago777 has quit [Ping timeout: 240 seconds]
raphaelivan has joined #ruby
Mohan__ has joined #ruby
troyready has joined #ruby
siwica has quit [Ping timeout: 265 seconds]
Fire-Dragon-DoL has joined #ruby
psyprus has quit [Ping timeout: 240 seconds]
drago777 has joined #ruby
gregoriokusowski has quit [Ping timeout: 248 seconds]
sergicles has quit [Quit: sergicles]
psyprus has joined #ruby
Virtualize has joined #ruby
mojjojo has quit [Quit: mojjojo]
Advocation has joined #ruby
dfranciosi has quit [Remote host closed the connection]
preller has quit [Ping timeout: 252 seconds]
aryaching has quit [Ping timeout: 241 seconds]
vpretzel has joined #ruby
amundj has quit [Ping timeout: 240 seconds]
mlpinit_ has joined #ruby
mojjojo has joined #ruby
JonnieCache has quit [Ping timeout: 252 seconds]
pranny has quit [Quit: Leaving.]
mark_locklear has joined #ruby
amundj has joined #ruby
drumusician has joined #ruby
mlpinit has quit [Read error: No route to host]
cmedeiros has joined #ruby
mlpinit__ has joined #ruby
kozma has quit [Remote host closed the connection]
preller has joined #ruby
angusiguess has joined #ruby
akonny has quit [Quit: akonny]
mlpinit_ has quit [Ping timeout: 260 seconds]
securitycrush has joined #ruby
fedesilva has joined #ruby
coca_rails has joined #ruby
TomRone has quit [Ping timeout: 240 seconds]
machuga|away is now known as machuga
ewnd9 has joined #ruby
Guest79735 has quit [Changing host]
Guest79735 has joined #ruby
Guest79735 is now known as guyz
raphaelivan has quit [Quit: Leaving.]
maze has joined #ruby
<maze>
hello
TomRone has joined #ruby
<maze>
how does one collect the results of a block to an array?
mark_locklear has quit [Ping timeout: 250 seconds]
cycorld has joined #ruby
<Geniack_>
damn :(
<TMM>
sorry
<Geniack_>
ever used it ?
toroidalcode has quit []
hogeo has joined #ruby
mark_locklear has joined #ruby
fijimunkii has joined #ruby
psyl0n has joined #ruby
nakazanieto has left #ruby [#ruby]
preller has quit [Read error: Operation timed out]
breakingthings has joined #ruby
rootshift has quit [Ping timeout: 264 seconds]
sayan has quit [Ping timeout: 252 seconds]
grvgr has joined #ruby
voland has joined #ruby
<TMM>
Geniack_, I'm afraid not. Sorry.
<shevy>
guys
<shevy>
any of you can recommend a good way how to properly document a large project in ruby?
<Geniack_>
TMM: thx anyway
fuzzyhorns has joined #ruby
TomRone has quit [Ping timeout: 240 seconds]
jerius has joined #ruby
TomRone has joined #ruby
drPoggs has joined #ruby
drago777 has quit [Ping timeout: 240 seconds]
<workmad3>
shevy: I'd start by asking what types of documentation are needed
preller has joined #ruby
<workmad3>
shevy: code documentation for maintenance? API documentation for people using it as a library? user documentation? installation documentation? design docs?
zipper_ has quit [Quit: leaving]
nowthatsamatt has joined #ruby
cycorld has quit [Remote host closed the connection]
asobrasil has joined #ruby
coca_rails has quit [Remote host closed the connection]
coca_rails has joined #ruby
perlsyntax has joined #ruby
justsee has quit [Ping timeout: 248 seconds]
drago777 has joined #ruby
havenwood has joined #ruby
LostMonk has joined #ruby
mojjojo has joined #ruby
Virtualize has quit [Quit: Leaving...]
aagdbl has left #ruby [#ruby]
<jokke>
how can i check in popen3 if my process has terminated?
viod1 has joined #ruby
grvgr has quit [Quit: grvgr]
Virtualize has joined #ruby
elux has joined #ruby
grvgr has joined #ruby
SHyx0rmZ has joined #ruby
viod has quit [Ping timeout: 260 seconds]
coca_rails has quit [Ping timeout: 245 seconds]
<Geniack_>
jokke: you using the "close_fds" parameter?
rndstr has joined #ruby
<jokke>
hm?
<jokke>
i use all four
freerobby has joined #ruby
pen has joined #ruby
tobago has quit [Ping timeout: 240 seconds]
<jokke>
i.e.: Open3.popen3('echo bla && sleep 10 && echo bla') do |stdin,stdout,stderr,p|
<Geniack_>
oh nevermind, i was thinking about subprocess stuff of python right now
<Geniack_>
but the file descriptors should be accessible anymore after its terminated
akonny has joined #ruby
<Geniack_>
maybe you can check for this condition
drago777 has quit [Ping timeout: 240 seconds]
vpretzel has quit [Ping timeout: 250 seconds]
<jokke>
hmm
rh1n0 has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Remote host closed the connection]
zipper has joined #ruby
angusiguess has joined #ruby
tobago has joined #ruby
kevind has joined #ruby
havenwood has quit [Remote host closed the connection]
Akuma has quit [Ping timeout: 240 seconds]
timonv has joined #ruby
drago777 has joined #ruby
freerobby has quit [Ping timeout: 240 seconds]
nomenkun has joined #ruby
gja has joined #ruby
blindrage has joined #ruby
<blindrage>
anyone familiar with setting up digest auth?
mikepack has joined #ruby
<blindrage>
i don't care what module i use, i'm currently using httparty
freerobby has joined #ruby
kevind has quit [Client Quit]
<blindrage>
i can do 'get "/"' and i get 200 OK with a body
<blindrage>
if i do a post with 'post "/uri" "some data"' i get: EOFError: end of file reached
hogeo has quit [Remote host closed the connection]
LexicalScope has joined #ruby
LexicalScope has joined #ruby
LexicalScope has quit [Changing host]
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
<shevy>
workmad3 all of it!
TomRone has quit [Ping timeout: 240 seconds]
<shevy>
workmad3 though API docu I care less, people should just use it :P
timonv has quit [Ping timeout: 265 seconds]
samsonasu has quit [Quit: samsonasu]
Duckily has joined #ruby
xk_id has joined #ruby
michaeldeol has joined #ruby
Akuma has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
devdazed has joined #ruby
DuoSRX has quit [Quit: Connection closed for inactivity]
<workmad3>
shevy: well, figure out what you need from each area... then start writing it :P
mikepack has quit [Ping timeout: 248 seconds]
iamjarvo has joined #ruby
<workmad3>
shevy: unfortunately, there isn't much more you can do if you're documenting after the fact and aren't hiring people to write the docs and guides for you
TomRone has joined #ruby
vlad_starkov has joined #ruby
mojjojo has quit [Quit: mojjojo]
<DouweM>
yeah, writing docs is what you get interns for :p
michaeldeol has quit [Ping timeout: 246 seconds]
havenwood has joined #ruby
jlast has joined #ruby
asteve has joined #ruby
preller has quit [Ping timeout: 252 seconds]
asteve has quit [Max SendQ exceeded]
AlSquire has joined #ruby
zipper is now known as urbanslug
TomRone has quit [Ping timeout: 240 seconds]
wald0 has quit [Quit: Lost terminal]
ahawkins has joined #ruby
dkamioka has joined #ruby
urbanslug has quit [Quit: Lost terminal]
asteve has joined #ruby
spyderman4g63 has quit []
jlast has quit [Read error: Connection reset by peer]
drago777 has quit [Ping timeout: 240 seconds]
noop has quit [Ping timeout: 265 seconds]
polymar_ has joined #ruby
jlast has joined #ruby
iamjarvo has quit [Remote host closed the connection]
<shevy>
:(
yfeldblum has joined #ruby
iamjarvo has joined #ruby
TomRone has joined #ruby
h_kon has quit [Remote host closed the connection]
whysosad has joined #ruby
SHyx0rmZ has joined #ruby
mark_locklear has quit [Ping timeout: 250 seconds]
drago777 has joined #ruby
kpshek has joined #ruby
jamblack has joined #ruby
polymar has quit [Ping timeout: 240 seconds]
sailias has joined #ruby
akonny has quit [Quit: akonny]
perlsyntax has quit [Quit: Leaving]
preller has joined #ruby
jlast has quit [Ping timeout: 260 seconds]
yfeldblum has quit [Ping timeout: 246 seconds]
TomRone has quit [Ping timeout: 240 seconds]
petey_ has joined #ruby
timonv has joined #ruby
mark_locklear has joined #ruby
iamjarvo has quit [Ping timeout: 272 seconds]
jlast has joined #ruby
petey_ has quit [Read error: Connection reset by peer]
petey_ has joined #ruby
hephaestus|table has quit [Read error: Connection reset by peer]
SHyx0rmZ has quit [Ping timeout: 240 seconds]
amritanshu_RnD has quit [Quit: Leaving]
samsonasu has joined #ruby
polymar_ has quit [Remote host closed the connection]
samsonasu has quit [Client Quit]
wald0 has joined #ruby
luki3k4 has joined #ruby
dktm has joined #ruby
cycorld has joined #ruby
hephaestus_rg has joined #ruby
teenwolf has joined #ruby
voland has quit [Remote host closed the connection]
tannerburson has joined #ruby
TomRone has joined #ruby
voland has joined #ruby
preller has quit [Ping timeout: 264 seconds]
drago777 has quit [Ping timeout: 240 seconds]
lmickh has quit [Quit: lmickh]
BizarreCake has quit [Read error: Connection reset by peer]
drago777 has joined #ruby
user258467 has joined #ruby
duggiefresh has joined #ruby
polymar has joined #ruby
_HolyCow has quit [Read error: Connection reset by peer]
luki3k4 has quit [Client Quit]
nomenkun has quit [Remote host closed the connection]
lfox has quit [Quit: ZZZzzz…]
Sourceless is now known as Guest9473
cycorld has quit [Ping timeout: 250 seconds]
nomenkun has joined #ruby
spider-mario has quit [Remote host closed the connection]
preller has joined #ruby
preller has joined #ruby
preller has quit [Changing host]
_HolyCow has joined #ruby
kevind has joined #ruby
kevind has quit [Remote host closed the connection]
dangerousdave has joined #ruby
blandflakes has joined #ruby
samsonasu has joined #ruby
Virtualize has quit [Quit: Leaving...]
<ivar>
So.. I'm a bit stumped as to how to refactor a piece of code.. I've got a huge block that I need to split into methods, but am not sure the best approach or how to manage it correctly.. if you've got a few mins I'd appreciate it someone could take a peek at https://gist.github.com/anonymous/8040409
nomenkun has quit [Ping timeout: 250 seconds]
<ivar>
the block is way too long and should be broken down
Virtualize has joined #ruby
drumusician has quit [Ping timeout: 248 seconds]
mark_locklear has quit [Ping timeout: 240 seconds]
araujo has quit [Read error: Connection reset by peer]
prc has quit [Quit: Leaving.]
<shevy>
the code does not seem to be very logical
araujo has joined #ruby
Megtastique has joined #ruby
<shevy>
what is often a lot easier is to arrange things into a class and call methods inside of that class
<ivar>
so to wrap the Sunspot search object with my own class ?
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Virtualize has quit [Read error: Operation timed out]
Jetchisel has left #ruby ["Unfortunately time is always against us -- *Morpheus*"]
<shevy>
I dunno, I don't know Sunspot at all
drago777 has quit [Ping timeout: 240 seconds]
Jake232 has joined #ruby
<workmad3>
ivar: that's what I typically do with elasticsearch and sunspot searches
parduse has quit [Remote host closed the connection]
xk_id has quit [Quit:
parduse has joined #ruby
<shevy>
I guess it comes with a bunch of methods attached to itself ... facet(), paginate() with()
akonny has joined #ruby
Duckily has quit [Ping timeout: 248 seconds]
RaCx has quit [Quit: Computer has gone to sleep.]
<ivar>
but when the block gets too big, how best to decompose it ?
ahawkins has quit [Ping timeout: 250 seconds]
drago777 has joined #ruby
nouitfvf has quit [Read error: Connection timed out]
grvgr has quit [Quit: grvgr]
<shevy>
you say block
xk_id has joined #ruby
burlyscudd has quit [Quit: Leaving.]
<shevy>
but to me it is just a bunch of methods that you call
ffio has joined #ruby
<shevy>
and either you need to set these things through the methods or you don't
TomRone has quit [Ping timeout: 240 seconds]
<ivar>
they are methods, but they are called in the context of the Sunspot search object
<shevy>
and if you need to call these methods then I am not sure how you want to get rid of them
<ivar>
so, within the block that gets passed to the search, s'elf' is a search object
<ivar>
'self' rather
nouitfvf has joined #ruby
jamesaanderson has joined #ruby
TomRone has joined #ruby
jamesaanderson has quit [Max SendQ exceeded]
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
jamesaanderson has joined #ruby
dkamioka has quit [Remote host closed the connection]
<ivar>
If I try to call methods from within that block, I get method not found exceptions because the methods don't exist on Sunspot's search
falood has joined #ruby
robbyoconnor has quit [Ping timeout: 264 seconds]
baordog_ has joined #ruby
sec^nd has quit [Ping timeout: 240 seconds]
<ivar>
hmm.. I guess it's not so so horrible, but I'm taking heat from code climate due to method complexity
mary5030 has joined #ruby
<ivar>
Thanks shevy and workmad3 for your time :P
<shevy>
I guess there are limits over as to how useful a block can be
<DouweM>
ivar: code climate is a bit trigger happy. the method is a bit complex in terms of amount of code, but it's plenty understandable
<shevy>
but wrapping things up into a class is often helpful for reusing things, and rearranging too
xk_id has quit [Ping timeout: 240 seconds]
lfox has joined #ruby
drumusician has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
<workmad3>
ivar: if sunsport works like tire for elasticsearch, then if you pass a block 'Sunspot.search(Property) do |search| ...' then self remains the same and 'search' is the search object you call methods like 'with' and 'facet' on
<tyl>
pontiki the method reset_authentication_token! is never called
drumusician has joined #ruby
<tyl>
i pug logger.debug messages in it but they are not shown in the rails logger
jkamenik has quit [Ping timeout: 264 seconds]
<cout>
aerook: validation may have failed
jkamenik has joined #ruby
stetho has joined #ruby
nouitfvf has quit [Read error: Connection timed out]
<tyl>
this line def ensure_authentication_token!
<aerook>
cout: my model tests pass using the same factory
yfeldblum has joined #ruby
<tyl>
reset_authentication_token! if self.authentication_token.blank?
nouitfvf has joined #ruby
coca_rails has quit [Remote host closed the connection]
coca_rails has joined #ruby
<olivier_bK>
do you know how i can resolv this problem
dima_ has joined #ruby
<olivier_bK>
`require': no such file to load -- mysql
<olivier_bK>
i added in MysqlConnect.rb require 'mysql'
dktm has quit [Ping timeout: 250 seconds]
freerobby has quit [Quit: Leaving.]
pen has joined #ruby
jlast has quit [Remote host closed the connection]
snath has quit [Read error: Operation timed out]
<cout>
aerook: but you're still not checking the return value for errors
jamblack has quit [Quit: jamblack]
petey__ has quit [Remote host closed the connection]
jlast has joined #ruby
buscon_ has joined #ruby
TomRone has quit [Ping timeout: 240 seconds]
randomnick_ has joined #ruby
mikecmpbll has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 250 seconds]
user258467 has quit [Quit: Quitte]
sayan has joined #ruby
coca_rails has quit [Ping timeout: 245 seconds]
marcgg_ has joined #ruby
SHyx0rmZ has joined #ruby
TomRone has joined #ruby
<aerook>
cout: Sorry, I'm newish at this...How could a factory work fine for one test but not the other?
petey__ has joined #ruby
jlast has quit [Ping timeout: 248 seconds]
burlyscudd has quit [Quit: Leaving.]
geggam has joined #ruby
<cout>
aerook: fine, if you don't want to check for errors, don't
<cout>
write shit code
geggam has quit [Max SendQ exceeded]
<cout>
I don't care
<aerook>
I can do FactoryGirl.create(:user) in the console without error
xk_id has quit [Quit:
<aerook>
yea i'm trying, that's why im here
geggam has joined #ruby
Virtualize has quit [Quit: Leaving...]
burlyscudd has joined #ruby
<aerook>
you say check for errors, what does that mean? I have tests for all the user model validations, using factorygirl, and they pass
divi_ has joined #ruby
hamakn has quit [Remote host closed the connection]
hamakn has joined #ruby
marcgg has quit [Ping timeout: 264 seconds]
dik_dak has joined #ruby
jchristi has joined #ruby
<aerook>
the error that's being thrown is "Failure/Error: before { visit user_path(user) }", which happens after FactoryGirl.create, so I'm assuming that during the test, the factory user is being created without a problem
<aerook>
that would make this a routing issue
punkcat has joined #ruby
wald0 has quit [Quit: Lost terminal]
Thanatermesis has quit [Quit: ɯlɐɔ uı ʞɹoʍ oʇ ƃuıoƃ]
Parker0_ has joined #ruby
<fuzzyhorns>
aerook: i recommend you try #rubyonrails
bean has joined #ruby
<fuzzyhorns>
aerook: i also recommend using pry with your tests so you can check on them in progress
<havenwood>
Kiba: Is easy to save to file with Marshal or YAML with PStore or YAML::Store, but you've got to properly serialize before you can deserialize (whether it be YAML, JSON, Marshal, MsgPack, whatever).
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vongrippen_ has joined #ruby
ckinni has joined #ruby
ckinni has quit [Max SendQ exceeded]
ckinni has joined #ruby
ckinni has quit [Max SendQ exceeded]
will has joined #ruby
petey__ has quit [Remote host closed the connection]
ckinni has joined #ruby
will is now known as Guest25131
Guest25131 has left #ruby [#ruby]
michaeldeol has quit [*.net *.split]
whunt has quit [*.net *.split]
timonv has quit [*.net *.split]
jlebrech has quit [*.net *.split]
Virtualize has quit [*.net *.split]
falood has quit [*.net *.split]
lfox has quit [*.net *.split]
Bofu2U has quit [*.net *.split]
Mohan__ has quit [*.net *.split]
Mohan has joined #ruby
Mohan has joined #ruby
Mohan has quit [Changing host]
petey_ has joined #ruby
falood has joined #ruby
jlebrech has joined #ruby
koalallama has left #ruby [#ruby]
canton7-mac has joined #ruby
varfoo has quit [Quit: WeeChat 0.4.0]
michaeldeol has joined #ruby
petey_ has quit [Read error: Connection reset by peer]
aspires has quit []
vongrippen_ is now known as vongrippen
coca_rails has joined #ruby
viod has joined #ruby
jkhwan has joined #ruby
varfoo has joined #ruby
dkamioka has joined #ruby
varfoo has quit [Client Quit]
falood has quit [Remote host closed the connection]
mklappstuhl has quit [Remote host closed the connection]
flubba has quit [Remote host closed the connection]
psyl0n has quit []
brianpWins has quit [Quit: brianpWins]
threesome has joined #ruby
lfox has joined #ruby
s2013 has joined #ruby
zumba_addict has joined #ruby
Virtualize has joined #ruby
troyready has quit [Ping timeout: 264 seconds]
ivar has quit [Read error: Connection reset by peer]
flubba has joined #ruby
drago777 has quit [Ping timeout: 240 seconds]
coca_rails has quit [Ping timeout: 245 seconds]
TomRone has quit [Ping timeout: 240 seconds]
<krainboltgreene>
Imagine if ruby automatically bound any keyword arguments you passed.
ivar has joined #ruby
<krainboltgreene>
Would it better or worse?
TomRone has joined #ruby
drago777 has joined #ruby
zeropx has quit [Ping timeout: 272 seconds]
allaire has quit []
rg_ has joined #ruby
flubba has quit [Ping timeout: 250 seconds]
<MrZYX>
you mean if you don't need to declare them in your method definition? worse
Virtualize has quit [Quit: Leaving...]
<workmad3>
krainboltgreene: you mean when using a catch-all **kwargs?
Heskie has quit []
zeropx has joined #ruby
alup has quit [Quit: Leaving]
sambao21 has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<workmad3>
krainboltgreene: because you can already declare them and they'll be bound... e.g. 'def foo(arg1: "fooo", arg2: "bar")
Virtualize has joined #ruby
Bira has quit [Remote host closed the connection]
noop has joined #ruby
petey has joined #ruby
burlyscudd has quit [Quit: Leaving.]
rg_ has quit [Quit: Leaving]
<krainboltgreene>
That is
sambao21 has quit [Ping timeout: 264 seconds]
slash_nick has quit [Ping timeout: 246 seconds]
<krainboltgreene>
You don't ahve to declare them.
slash_nick has joined #ruby
juarlex has quit [Ping timeout: 240 seconds]
<MrZYX>
that's bad. first thing that comes to my mind is that it'd be too easy to accidentally overwrite a (private) method called in the method you call
<krainboltgreene>
That would disambiguate in ruby between the local variable and the method, I believe.
<DouweM>
sure
<krainboltgreene>
It would mean foreverafter requiring self.
freerobby1 has quit [Quit: Leaving.]
<krainboltgreene>
I wonder if adding () would do the same.
<DouweM>
Also, method headers are very useful to learn a class's/method's interface. that goes out the door when you have to scan the code to find the required vars :/
freerobby has joined #ruby
mikepack has joined #ruby
<krainboltgreene>
Might force people to write smaller methods, which is always good.
fcoury has joined #ruby
<DouweM>
and when you find `nationality` halfway down the method definition, you'd have to scan up again to see if it's a local var or a parameter
<krainboltgreene>
Realistically we see this in ruby all the freaking time: def method(arg, options = {})
<DouweM>
true
shedd has joined #ruby
<krainboltgreene>
Though admittedly it means doing options[:key]
TMM has quit [Quit: Ex-Chat]
rg_ has quit [Quit: Leaving]
<DouweM>
but that's not so much Ruby as a Railsism :/ at least, it's just much much more in Rails than in pure Ruby libs in my experience.
drago777 has quit [Ping timeout: 240 seconds]
<DouweM>
right, so it's much easier to scan for
<krainboltgreene>
Agreed, not used once in any of the STDlibs.
<DouweM>
and those are pretty much always explained in the documenting comment accompanying a method def
RaCx has quit [Quit: Computer has gone to sleep.]
rootshift has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
<DouweM>
so if you're going to make that documentation, why not just specify it in the method header explicitly?
<krainboltgreene>
It's funny that we have this syntax "limitation" because documentation isn't a given.
Duckily has joined #ruby
<krainboltgreene>
If good documentation is a given, or small methods prolific, then it might be easier to swallow.
dhruvasagar has joined #ruby
dogweather has quit [Remote host closed the connection]
dapz has joined #ruby
rh1n0 has joined #ruby
<krainboltgreene>
Thanks for the discussion DouweM.
<DouweM>
you're also throwing abstract classes away
dogweather has joined #ruby
pel_daniel has joined #ruby
<krainboltgreene>
How so?
drago777 has joined #ruby
<DouweM>
if vars are only specified by the implementation, you can't have an abstract class without an implementation
Virtualize has quit [Quit: Leaving...]
<DouweM>
If you have an abstract Shape class and subclasses Square and Circle, you can have a #draw method, but to get the parameters for that draw method you'd need to scan the implementation. Which is empty for the Shape class
Kabaka has joined #ruby
fcoury has quit [Ping timeout: 240 seconds]
TomRone has quit [Ping timeout: 240 seconds]
<krainboltgreene>
Interesting. Mixins become a lot harder.
<DouweM>
so there are no parameters? Yeah there are, thats, x and y, which are used in Square#draw and Circle#draw. But you're just dealing with a Shape, and don't care about its subclasses
<DouweM>
Shape needs to specify its interface somehow, even if it has no implementation
<DouweM>
so in this case you'd need to spcify them explicitly, and we're back to square one
<krainboltgreene>
Is that really any different? I mean in a truely reflective language like Smalltalk it's easy to garner information about a method via developer interfaces.
<krainboltgreene>
Ruby's various REPLs now-a-days have things like show-method.
<krainboltgreene>
Instead of delegation it's directly copying.
olivier_bK has quit [Ping timeout: 248 seconds]
Hanmac1 is now known as Hanmac
<workmad3>
DouweM: and that's not getting into issues where you have different options, e.g. a Circle may accept draw(radius: 5) while square would have draw(side_length: 5)
Megtastique has quit []
<workmad3>
should the abstract draw method bind both, so that they're acceptable for all shapes?
<krainboltgreene>
It's definitly difficult to think of this happening in runtime, but perhaps that's not so often.
mklappstuhl has quit [Ping timeout: 250 seconds]
<DouweM>
workmad3: well, in the case of a Shape#draw method that's just called from some Canvas with an array of Shapes, I'm not sure that would be an option anyway?
<krainboltgreene>
Why are square and circile not getting different defined draw methods again?
<Hanmac>
krainboltgreene: make a gist of your code so we canshow you whats wrong
coca_rails has quit [Ping timeout: 245 seconds]
<DouweM>
krainboltgreene: they are. squares and circles aren't drawn the same way, obvs
<workmad3>
krainboltgreene: they will... but they're conforming to an interface from the Shape abstract superclass
wildroman2 has quit [Remote host closed the connection]
<DouweM>
the Shape#draw method doesn't make any assumptions and leaves all implementation to its subclasses
<workmad3>
krainboltgreene: and the method signature of interface methods should really match the superclass interface in order to conform to LSP
wildroman2 has joined #ruby
obs has quit [Quit: Saliendo]
drago777 has quit [Ping timeout: 240 seconds]
mklappstuhl has joined #ruby
<krainboltgreene>
Even in mixin only style passing of behavior?
s2013 has quit [Ping timeout: 240 seconds]
atno has joined #ruby
canton7-mac has quit [Quit: Leaving]
<krainboltgreene>
Seems like that law really only helps when you have single points of behavior passing.
AMcP has quit [Remote host closed the connection]
<DouweM>
krainboltgreene: which is why Shape#draw is empty. Circle#draw and Square#draw do have implementation. Our class has, say, a list of Shapes, and we want to draw them all, by calling shape.draw(ARGS). What args would it take? Well, we look at the Shape#draw method. Which is empty. So no args? Well, no, because obviously a #draw method would take x and y args (or anything else you fancy)
<krainboltgreene>
If you have a Policeman and Fireman mixin on a Person object, which #career method do you conform to?
<workmad3>
krainboltgreene: with mixins, you tend to require some form of interface method too, that you can rely on the interface for... so unless you're going to scan the entire source for all uses and somehow normalise them
mary5030_ has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
<krainboltgreene>
DouweM: Not sure I know why you're making an empty method. Go back to studying.
<DouweM>
krainboltgreene: because Shape doesn't know anything about how to draw a generic shape. that's left to the subclasses
mklappstuhl has joined #ruby
<workmad3>
krainboltgreene: because ruby doesn't support 'true' abstract classes
<krainboltgreene>
I'll probably realize what you're saying in the shower or sometjhing.
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<DouweM>
But yeah, fair point on the studying. I'll leave this to workmad3 and Hanmac :)
<krainboltgreene>
DouweM: If Shape doesn't know how to draw, who the hell gave it a draw method? :P
<workmad3>
krainboltgreene: so to define an interface you create an empty method to declare the expected interface
<krainboltgreene>
workmad3: That sounds like brittle documentation. If I crate an Oblong class that gets it's beahvior from Shape but never define draw, then run my code it breaks because of whatever an empty method returns.
mary5030 has quit [Ping timeout: 246 seconds]
<krainboltgreene>
zumba_addict: That's a Sprockets thing.
<workmad3>
krainboltgreene: catch up :P already commented about what is typical for a required method
<zumba_addict>
What is Sprockets krainboltgreene ?
<Hanmac>
workmad3: you can remove the allocate method from a class to make it "virtual" ;D
<workmad3>
krainboltgreene: while for an optional method, returning nothing is fairly standard... same for creating 'hook' methods
<workmad3>
Hanmac: ewww :)
petey_ has joined #ruby
TomRone has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
<krainboltgreene>
Not sure if I like the idea, but it's good food for thought.
Senjai`work has joined #ruby
<krainboltgreene>
The whole "binding overwriting" thing from DouweM threw me for a loop.
<krainboltgreene>
zumba_addict: It's a thing for Rails.
<zumba_addict>
k
petey has quit [Read error: Connection reset by peer]
<krainboltgreene>
zumba_addict: You probably read it in a application.js or application.css file?
thams has joined #ruby
BombStrike has quit [Ping timeout: 264 seconds]
<zumba_addict>
no, in a coffeescript file
vikhyat has quit [Remote host closed the connection]
mklappstuhl has quit [Ping timeout: 265 seconds]
w4pm has joined #ruby
psyl0n has joined #ruby
Spami has joined #ruby
<krainboltgreene>
Same thing.
<krainboltgreene>
zumba_addict: Google "sprockets ruby github"
<zumba_addict>
ok
Xeago has quit [Remote host closed the connection]
<zumba_addict>
he also thinks it's a comment but he was not sure
subbyyy has joined #ruby
viod has quit [Ping timeout: 264 seconds]
<workmad3>
zumba_addict: coffeescript uses # for comments, javascript uses //
<workmad3>
zumba_addict: and CSS uses /* */ for block comments, sprockets also supports that (with a *= require )
Elhu_ has quit [Quit: Computer has gone to sleep.]
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zumba_addict>
what confuses me is that //= is also found in our coffeescript files, tons of fiels
<workmad3>
zumba_addict: yeah, sprockets removes the comment after it's been procesed
dapz has joined #ruby
<workmad3>
zumba_addict: so it doesn't cause an issue
Duckily has joined #ruby
fijimunkii has joined #ruby
<workmad3>
zumba_addict: but if you tried a plain // comment in a coffeescript file, you'd get errors
<workmad3>
zumba_addict: and you also get weird syntax highlighting... and if you have a syntax checker run when you save a file, you'll also get errors then
<zumba_addict>
ok. What I''ll do is remove that line and try to access the webpage
<workmad3>
zumba_addict: don't remove the lines... just change //= to #=
BombStrike has quit [Ping timeout: 264 seconds]
<zumba_addict>
but some of our coffeescript files doesn't have them
<workmad3>
zumba_addict: not every coffeescript file needs to depend on other files
<zumba_addict>
so are you saying that the require does really import the file?
brianpWins has joined #ruby
<workmad3>
zumba_addict: yes
<zumba_addict>
oh ok
<zumba_addict>
got it
<zumba_addict>
i understand it now
<workmad3>
zumba_addict: those files are parsed by sprockets and used to import files :)
<zumba_addict>
yeah and not by coffeescript
<workmad3>
*lines are parsed
<workmad3>
yeah
ValicekB has joined #ruby
BombStrike has joined #ruby
<zumba_addict>
so if #, sprocket will ignore it?
petey_ has quit [Remote host closed the connection]
troessner has quit [Read error: Connection reset by peer]
<workmad3>
zumba_addict: # is a plain coffeescript comment, yes
dapz has quit [Client Quit]
<zumba_addict>
yes, # is a coffeescript comment
petey has joined #ruby
<zumba_addict>
but when it's #, will sprocket ignore it too?
<workmad3>
zumba_addict: sprockets will pick up #= require (and a few other directives) as long as there aren't any non-comment lines before it in the file
<workmad3>
zumba_addict: yes, sprockets only touches lines it can do stuff with
<zumba_addict>
what if sprocket sees //= require?
<workmad3>
it'll process it
<zumba_addict>
k
<workmad3>
but it'll look ugly in your coffeescript files :)
<zumba_addict>
so now, what does coffeescript do when it sees //= require
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<workmad3>
zumba_addict: barf
<zumba_addict>
ok
Virtualize has joined #ruby
freerobby has quit [Quit: Leaving.]
Alina-malina has quit [Ping timeout: 248 seconds]
txdv has joined #ruby
Alina-malina has joined #ruby
SmileyKeith has joined #ruby
thams has quit [Quit: thams]
dapz has joined #ruby
petey has quit [Ping timeout: 240 seconds]
tylersmith has quit [Read error: Connection reset by peer]
tylersmith has joined #ruby
juarlex has quit [Remote host closed the connection]
<cek>
i'm just installing 2.0 using rvm. it should not've done such things
bobdobbs` has quit [Read error: Connection reset by peer]
pen has quit [Ping timeout: 265 seconds]
bobdobbs` has joined #ruby
doodleha_ has joined #ruby
octoberry has quit [Ping timeout: 246 seconds]
PhilK has quit [Remote host closed the connection]
mikepack has quit [Remote host closed the connection]
PhilK has joined #ruby
preller has quit [Ping timeout: 265 seconds]
mengu has joined #ruby
momomomomo has joined #ruby
ahawkins has joined #ruby
doodlehaus has quit [Ping timeout: 264 seconds]
mikepack has joined #ruby
momomomomo has quit [Client Quit]
TomRone has quit [Ping timeout: 240 seconds]
benlieb has joined #ruby
drumusician has joined #ruby
phipes has joined #ruby
RaCx has joined #ruby
coca_rails has joined #ruby
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mklappstuhl has joined #ruby
iliketur_ has quit [Quit: zzzzz…..]
iamjarvo has joined #ruby
TomRone has joined #ruby
preller has joined #ruby
iliketur_ has joined #ruby
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
iamjarvo has quit [Remote host closed the connection]
iamjarvo has joined #ruby
coca_rails has quit [Ping timeout: 245 seconds]
<havenwood>
cek: ruby-install ftw
<havenwood>
though sounds like a selection rather than installation bug
<havenwood>
so chruby ftw :P
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Virtualize has quit [Quit: Leaving...]
mklappstuhl has quit [Ping timeout: 250 seconds]
<havenwood>
cek: I am curious though, what version exactly of RVM?
petey has quit [Remote host closed the connection]
<havenwood>
cek: Might want to notify #rvm.
petey has joined #ruby
ivar has left #ruby [#ruby]
danshultz has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
Virtualize has joined #ruby
Megtastique has quit []
<MrZYX>
havenwood: sorry I have to say it, but you mentioning ruby-install/chruby on any remotely related topic kinda gets annoying over time. Would be great if you could reduce that a bit :)
dapz has joined #ruby
<havenwood>
MrZYX: no prob - just honestly think it is a better way to go than rvm
gverri has quit [Ping timeout: 246 seconds]
<MrZYX>
sure I got that and guess what, it's what I'm using
jkhwan has quit [Remote host closed the connection]
<Soulcutter>
Can you use the tilt gem for templates that are not based on the filesystem?
preller has quit [Ping timeout: 264 seconds]
<Soulcutter>
the documentation seems to mostly cover using tilt by passing file paths
jkhwan has joined #ruby
brennanMKE has quit [Remote host closed the connection]
thams has quit [Quit: thams]
<havenwood>
MrZYX: Everyone reads from tutorials to use RVM, then come asking for help with bizarre and very-difficult-to-solve bugs. Sorry for the broken record effect though, I'll try to shut up. :P
brennanMKE has joined #ruby
petey has quit [Ping timeout: 272 seconds]
Advocation has joined #ruby
JonnieCache has joined #ruby
<MrZYX>
thank you
IceDragon has joined #ruby
xiphias has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 246 seconds]
kenneth has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
radic has quit [Disconnected by services]
<MrZYX>
Soulcutter: hmm, how would you specify what engine to use?
pen has joined #ruby
radic_ has joined #ruby
<Soulcutter>
I guess I don't -have- to use tilt for rendering templates, but I thought it would be nice since I already have it in my project and it would allow me to switch template engines easily
<Soulcutter>
MrZYX: Tilt['markdown']
xiphias has joined #ruby
<mjc_>
Soulcutter: you could probably use it but you'd have to tell it which template to use manually
dfranciosi has quit [Remote host closed the connection]
shedd has joined #ruby
liamkeil1 has joined #ruby
<mjc_>
and tilt is designed to precompile templates
preller has joined #ruby
<krainboltgreene>
I wish mustache would become the standard in ruby for template evaluation.
thams has joined #ruby
Elhu has joined #ruby
brennanMKE has quit [Ping timeout: 246 seconds]
<Soulcutter>
mjc_: I know I have markdown in the db, so that's not really a problem
<MrZYX>
yeah, the whole design seems to be around files
freezey has joined #ruby
rotor has quit [Ping timeout: 246 seconds]
<mjc_>
Soulcutter: having the templates in the db kind of is the opposite of precompiling templates
<mjc_>
Soulcutter: the idea is that it reads the template once and stores a copy of it as ruby source, then when you refer to that template again it doesn't have to re-parse it until you restart the server
<Soulcutter>
mjc_: not necessarily
IceDragon has quit [Ping timeout: 252 seconds]
<mjc_>
that's basically what tilt is for
gregoriokusowski has joined #ruby
elux has quit [Read error: No route to host]
kep has joined #ruby
rotor has joined #ruby
<Soulcutter>
you could use an id/timestamp from a db resource as a precompilation key
freerobby has quit [Quit: Leaving.]
<Soulcutter>
I was thinking it might be usable just as an abstraction over which specific engine I was using
<mjc_>
so you'd end up with old templates in memory until the process is restarted
pen has quit [Ping timeout: 272 seconds]
freerobby has joined #ruby
<mjc_>
unless tilt has a way to expire a precompiled template
jkhwan has quit [Remote host closed the connection]
<Soulcutter>
I'm really not sure how it caches those either
pu22l3r has quit [Remote host closed the connection]
<Soulcutter>
it -could- be a LRU cache, but who knows without digging I guess
pu22l3r has joined #ruby
<Soulcutter>
thanks for the discussion, though, think it's leading me away from using tilt like this
<mjc_>
Tilt::Cache
cmedeiros has quit [Ping timeout: 250 seconds]
mj12albert has quit [Ping timeout: 246 seconds]
<mjc_>
hashtable
Al___ has quit [Quit: Al___]
Blue_Ice_ has quit [Ping timeout: 246 seconds]
jkhwan has joined #ruby
<mjc_>
has a clear but no way to delete a specific key
burlyscudd has quit [Ping timeout: 265 seconds]
<Soulcutter>
mjc_++
gja has joined #ruby
<mjc_>
if you were to use it you'd have to monkeypatch it :/
Blue_Ice has joined #ruby
Sawbones has joined #ruby
<mjc_>
also I'd be careful when picking markdown parsers, pick one that's threadsafe
nobitanobi has joined #ruby
<Soulcutter>
which ones are those?
gja has quit [Client Quit]
<Soulcutter>
I was going to go with kramdown
shedd has quit [Ping timeout: 240 seconds]
ahawkins has quit [Ping timeout: 265 seconds]
petey has joined #ruby
<mjc_>
rdiscount is almost certainly threadsafe
<mjc_>
unless things have changed lately
mikepack has quit [Remote host closed the connection]
xiphias has quit [Ping timeout: 240 seconds]
<mjc_>
IIRC redcarpet takes some care to use it threaded
<mjc_>
no idea about kramdown
dangerousdave has joined #ruby
xiphias has joined #ruby
<Soulcutter>
hmm
bricker has quit [Ping timeout: 250 seconds]
IceDragon_ is now known as IceDragon
Fuzai has joined #ruby
bricker has joined #ruby
<Fuzai>
Hi, if i'm using Mysql2 to only call stored procedures and the sql user only has call permissions, is it sill possible to sql inject?
mklappstuhl has quit [Read error: Connection reset by peer]
Kricir has joined #ruby
<mjc_>
you might not run into threading problems with MRI but it is always wise to be aware of this stuff because you might want to switch implementations later
Hanmac1 has joined #ruby
mengu has quit [Remote host closed the connection]
<mjc_>
I am using MRI less and less lately
burlyscudd has joined #ruby
* Soulcutter
nods
<Soulcutter>
I have been dabbling with jruby, though I haven't deployed anything substantial on it yet
drago777 has joined #ruby
primenum has joined #ruby
noop has quit [Ping timeout: 248 seconds]
xiphias has quit [Ping timeout: 240 seconds]
g0bl1n has joined #ruby
Hanmac has quit [Ping timeout: 240 seconds]
deception has joined #ruby
freezey has quit [Remote host closed the connection]
<havenwood>
i was going to use jruby for a raspberry pi project, just to get access to swig, but had pi/jvm problems ;(
aspires has joined #ruby
asdsadasd has joined #ruby
nobitanobi has quit [Disconnected by services]
xiphias has joined #ruby
ffio has quit [Quit: WeeChat 0.4.1]
jkhwan has quit [Remote host closed the connection]
jkhwan has joined #ruby
<mjc_>
been using rbx and jruby
Hanmac has joined #ruby
<mjc_>
holding off on rbx for a bit while it stabilizes after the latest major changes
nobitanobi has joined #ruby
<Soulcutter>
rbx breaking up the standard lib rankles with me just a tad
MvDevNull has left #ruby [#ruby]
burlyscudd has quit [Ping timeout: 246 seconds]
jibi has joined #ruby
<Soulcutter>
in fairness, some of the standard lib is of questionable value :x
Hanmac1 has quit [Ping timeout: 252 seconds]
slash_nick has quit [Changing host]
slash_nick has joined #ruby
<Soulcutter>
e.g. rss
burlyscudd has joined #ruby
<havenwood>
Soulcutter: i like that they gemmified rubysl, i just don't like that you have to manually require it in Gemfile etc
<mjc_>
Soulcutter: it's turning out to be useful
petey has quit [Remote host closed the connection]
<mjc_>
havenwood: that may change
<havenwood>
mjc_: i hope :)
<benlieb>
I have an old rspec spec (from a rails 2.1 app) that uses mock_model. Is this still used in rspec? If not how would this be done in rspec 2.14: mock_model(Price, :valid? => true, :[]= => true, :marked_for_deletion => false, :save => true, :member? => true)
<Soulcutter>
it's just a bit of added friction, I guess... different from what I'm used to :P
dayepa has quit [Ping timeout: 245 seconds]
<mjc_>
however I like the idea of having the stdlib versions your app requires in the gemfile.lock
petey has joined #ruby
* Soulcutter
nods to mjc_
asdsadas has joined #ruby
nobitanobi has quit [Disconnected by services]
<Soulcutter>
benlieb: double(Price, :valid? => true, ...) <-- how about that?
xiphias has quit [Ping timeout: 240 seconds]
asdsadasd has quit [Ping timeout: 240 seconds]
petey has quit [Read error: Connection reset by peer]
wildroman2 has joined #ruby
asdsadas is now known as nobitanobi
wildroman2 has quit [Remote host closed the connection]
<benlieb>
Soulcutter: I'm new to rsepc, so I don't know how about that :)
xiphias has joined #ruby
petey has joined #ruby
<benlieb>
Soulcutter: that seem like it could work. Lemme try.
wildroman2 has joined #ruby
<benlieb>
No error...
<Soulcutter>
always a good first step...
coca_rails has joined #ruby
decoponio has quit [Quit: Leaving...]
kirun has joined #ruby
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Virtualize has quit [Quit: Leaving...]
freezey has joined #ruby
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Megtastique has joined #ruby
petey has quit [Ping timeout: 250 seconds]
xiphias has quit [Ping timeout: 240 seconds]
petey has joined #ruby
dapz has joined #ruby
xiphias has joined #ruby
jhaals has joined #ruby
krz has quit [Quit: WeeChat 0.4.2]
Czupa has quit [Ping timeout: 246 seconds]
vt102 has quit [Remote host closed the connection]
fntzr has quit [Quit: Leaving]
lsmola_ has quit [Ping timeout: 250 seconds]
atno has quit [Read error: Connection reset by peer]
atno has joined #ruby
Virtualize has joined #ruby
jlast has quit [Read error: Connection reset by peer]
Advocation has quit [Quit: Advocation]
jlast has joined #ruby
iamjarvo has quit [Remote host closed the connection]
zleslie has joined #ruby
doodlehaus has joined #ruby
<zleslie>
Hi
burlyscudd has quit [Quit: Leaving.]
randomnick_ has quit [Ping timeout: 246 seconds]
iamjarvo has joined #ruby
preller has quit [Ping timeout: 245 seconds]
samsonasu has quit [Quit: samsonasu]
Advocation has joined #ruby
<zleslie>
I don't understand something about ipaddr. I do IPAddr.new('fc01::/7').to_s and it returns 'fc00::'. Thats not the address I entered, why is it not returning the address? I just want to be able to get the IP and prefix from the object.
platzhirsch has joined #ruby
Megtastique has quit []
<zleslie>
As well as validate the address.
<platzhirsch>
I found evil code
* platzhirsch
draws his sword
kevind_ has joined #ruby
senj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
doodleha_ has quit [Ping timeout: 250 seconds]
<mjc_>
zleslie: /7 is a subnet, isn't it?
iamjarvo has quit [Ping timeout: 240 seconds]
Virtualize has quit [Quit: Leaving...]
noxgirl has quit [Ping timeout: 252 seconds]
RaCx has quit [Quit: Computer has gone to sleep.]
kevind has quit [Ping timeout: 272 seconds]
kevind_ is now known as kevind
Hanmac1 has joined #ruby
xiphias has quit [Ping timeout: 240 seconds]
<mjc_>
zleslie: I mean fc00:: is the start of the subnet at /7 anyway
xiphias has joined #ruby
Virtualize has joined #ruby
autumn has joined #ruby
preller has joined #ruby
<benlieb>
rspec question: How can I use double and add the double as an association? @mem_price = double(Price, :valid? => true, :[]= => true, :marked_for_deletion => false, :save => true, :member? => true); @product.prices << @mem_price;
<mjc_>
fc01:: sory
<mjc_>
*sorry
Hanmac has quit [Ping timeout: 248 seconds]
BizarreCake has quit [Read error: No buffer space available]
viod has quit [Ping timeout: 272 seconds]
AMcP has joined #ruby
<MrZYX>
zleslie: well, this is documented behavior: Returns a new ipaddr built by masking IP address with the given prefixlen/netmask. (e.g. 8, 64, "255.255.255.0", etc.)
vpretzel has joined #ruby
axl_ has joined #ruby
<MrZYX>
er, nvm, was in the wrong line
<krainboltgreene>
benlieb: Sounds like you need a factory at this point.
<benlieb>
krainboltgreene: i agree
<krainboltgreene>
double("SomeObject") is meant for mocking simple things.
<benlieb>
krainboltgreene: I'm rewriting someone's old app
drago777 has quit [Ping timeout: 240 seconds]
mklappstuhl has joined #ruby
<MrZYX>
zleslie: there we go: If a prefixlen or a mask is specified, it returns a masked IP address. From IPAddr#initialize
<benlieb>
It's pretty large
michaeldeol has quit [Remote host closed the connection]
<benlieb>
I'd rather make as little changes as possible, but I think I'm going to have to add some factories. ug. Just trying to port from 2.1.1 to 4.0.x. Where's the coffee?
thams has quit [Quit: thams]
michaeldeol has joined #ruby
ScottNYC has joined #ruby
<DouweM>
benlieb: wow, that's going to be hell. good luck.
klaut has quit [Remote host closed the connection]
<Underbyte>
blerg
alexherbo2 has joined #ruby
<benlieb>
krainboltgreene: I've always used FactoryGirl, now's a good time to choose the best factory out there. What's your recommendation.
<krainboltgreene>
Fabricator.
drago777 has joined #ruby
<benlieb>
DouweM: tell me about it :)
<krainboltgreene>
But FactoryGirl might have more 2.1 support.
<DouweM>
I like FactoryGirl *shrug*
<AntelopeSalad>
how would you go about yielding to a heredoc? i've tried a lot of things and it always prints the word yield literally
<benlieb>
krainboltgreene: The new app is rails 4
<krainboltgreene>
Oh, then Fabricator.
AMcP has quit [Ping timeout: 240 seconds]
xiphias has quit [Ping timeout: 240 seconds]
<DouweM>
krainboltgreene: why do you prefer it over FactoryGirl? I have no experience with Fabricator
<Underbyte>
i don't think that .so module is for nginx
<Underbyte>
i think its for ruby
speed2 has joined #ruby
<ddd>
don't you still hve to run the passenger-install-*-module with the passenger package?
<mjc_>
yeah, you do
<mjc_>
run passenger-install-nginx-module and it will compile and install nginx for you
speed2 has quit [Changing host]
speed2 has joined #ruby
jkamenik has joined #ruby
speed2 is now known as Speed
<Underbyte>
heh
<Underbyte>
i just found the reason behind all this
pen has quit [Ping timeout: 250 seconds]
Elhu has joined #ruby
<Underbyte>
i installed 'nginx' instead of 'nginx-full'
<ddd>
ahh missing nginx modules?
Speed has left #ruby [#ruby]
<Underbyte>
yMysql::Error: Access denied for user 'root'@'localhost' (using password: YES) (Sequel::DatabaseConnectionError)
<Underbyte>
excellent :)
<Underbyte>
thanks guys
xiphias has quit [Ping timeout: 240 seconds]
TomRone has quit [Ping timeout: 240 seconds]
roolo has quit [Remote host closed the connection]
divi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shedd has joined #ruby
Duckily has quit [Quit: Duckily]
xiphias has joined #ruby
Advocation has quit [Quit: Advocation]
freerobby has joined #ruby
timonv has quit [Remote host closed the connection]
Virtualize has joined #ruby
divi has joined #ruby
thams has joined #ruby
TomRone has joined #ruby
MrJoshua has quit [Ping timeout: 250 seconds]
mklappstuhl has joined #ruby
klaut has joined #ruby
shedd has quit [Ping timeout: 248 seconds]
Hanmac has joined #ruby
freakazoid0223 has quit [Ping timeout: 240 seconds]
Duckily has joined #ruby
xiphias has quit [Ping timeout: 240 seconds]
drago777 has quit [Ping timeout: 240 seconds]
xiphias has joined #ruby
Hanmac1 has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Ping timeout: 272 seconds]
guiocava_ has quit [Remote host closed the connection]
makerops has joined #ruby
kenneth has quit [Ping timeout: 240 seconds]
<makerops>
hi, im having some trouble with queues
coldmethod has joined #ruby
<makerops>
i basically want two threads, one that listens for a new config, and when it receives one, interrupts the running thread, and puts a value in
<makerops>
am i not thinking about things correctly?
mklappstuhl has quit [Ping timeout: 248 seconds]
dayepa has joined #ruby
bricker has quit [Quit: leaving]
viod has quit [Ping timeout: 248 seconds]
krz has joined #ruby
krz has quit [Changing host]
krz has joined #ruby
bean has joined #ruby
viod has joined #ruby
xiphias has quit [Ping timeout: 240 seconds]
RoryHughes has joined #ruby
drago777 has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
xiphias has joined #ruby
liamkeil1 has quit [Read error: No route to host]
p4d4w4n has quit [Quit: This computer has gone to sleep]
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<makerops>
this is actually not what I got last time
<makerops>
but, I seem to be making progress
<zleslie>
MrZYX: Alright, that helps, its just not what I was expecting. Not sure why the masked IP would ever be useful. Seems like you would just want ot call .network or something instead
viod1 has joined #ruby
marcgg has joined #ruby
viod1 has left #ruby [#ruby]
<DouweM>
krainboltgreene: Note that this won't work properly with attr_accessible on the model. Those attributes won't be set
<zleslie>
MrZYX: Is there a way to get the IP once created with the mask? I've given a quick look through the methods, but it doesn't seem like what I am after
habanany has quit [Ping timeout: 264 seconds]
<zleslie>
Perhaps IPAddr is not what I need, but I'd like not to drag in another lib
<MrZYX>
what do you need then?
moozach has joined #ruby
xiphias has quit [Ping timeout: 240 seconds]
asteve has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zleslie>
MrZYX: I need to get the IP that I pass, validate that its correct, and ask for the mask back. I can just do this all myself by detecting a '/' in the address and taking the last part. It just seems that this should be a solved problem
mary5030_ has quit [Ping timeout: 272 seconds]
b00stfr3ak has joined #ruby
drago777 has joined #ruby
afhammad has joined #ruby
arietis has quit [Ping timeout: 264 seconds]
<zleslie>
I don't know what value IPAddr.new('fc01::/7').mask(7) has. I would think that .mask would just give you the mask portion that you have already supplied.
mary5030 has joined #ruby
<zleslie>
Also, fc00:: is a perfectly acceptable IPv6 Adress, so the fact that when you pass fc00:: to IPAddr.new, and you get a different IP back seems broken
TomRone has joined #ruby
brennanMKE has joined #ruby
mary5030 has quit [Remote host closed the connection]
arietis has joined #ruby
<zleslie>
Sorry, passing fc01:: and getting fc00:: back is the part that seems broken.
mary5030 has joined #ruby
kpshek has quit []
Kiba has joined #ruby
<DouweM>
"fc01::/7" you mean? And are you sure it's broken and not just properly interpreting the mask?
blindrage has quit [Remote host closed the connection]
<MrZYX>
well, as the documentation says it returns the masked ip address. IPAddr itself doesn't has the concept of an attached mask, because two identical ip addresses with different masks are still identical
<MrZYX>
the combination applies to an interface because it describes a network and that this interface has this network
mklappstuhl has joined #ruby
<zleslie>
Sure, fc01::/7 and fc01::/8 are both valid, however neither one of them should be returning fc00:: as the IP, since thats not the address. Masked or otherwise.
xiphias has quit [Ping timeout: 240 seconds]
burlyscudd has quit [Quit: Leaving.]
<zleslie>
The only part that you need to know to understand the network in IPv6 is the prefix. If you are passing in a prefix, ie fc01::/7, then you have the network because you have the prefix.
<MrZYX>
it is the masked address
aspires has quit []
xiphias has joined #ruby
<MrZYX>
fc01 is 1111 1100 0000 0001, with a mask of 1111 11100 0000 0000 that's 1111 1100 0000 0000 aka fc00
kpshek has joined #ruby
<primenum>
hm, to setup a route such that any request for foo.com/controller/action/namevalue gets mapped to a post that posts name=namevalue is possible?
Virtualize has joined #ruby
asteve has joined #ruby
mityaz has quit [Quit: See ya!]
asteve has quit [Max SendQ exceeded]
bricker_ has joined #ruby
max_ has joined #ruby
mklappstuhl has quit [Ping timeout: 245 seconds]
asteve has joined #ruby
<DouweM>
primenum: that's Rails territory. Check out #RubyOnRails
vlad_starkov has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 240 seconds]
<makerops>
primenum, friendly_id gem
vlad_starkov has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
w4pm has quit [Ping timeout: 252 seconds]
mikepack has joined #ruby
vlad_starkov has joined #ruby
<zleslie>
MrZYX: Thats what I am saying is incorrect. I don't think there is a mask concept in v6.
pu22l3r has quit [Remote host closed the connection]
mojjojo has quit [Client Quit]
pu22l3r has joined #ruby
kpshek has joined #ruby
polaco has quit [Ping timeout: 246 seconds]
RoryHughes has quit []
VTLob has joined #ruby
mklappstuhl has quit [Ping timeout: 240 seconds]
mojjojo has joined #ruby
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aef has quit [Ping timeout: 245 seconds]
eka has quit [Ping timeout: 260 seconds]
vigintas_ has joined #ruby
kpshek has quit [Client Quit]
vigintas has quit [Ping timeout: 245 seconds]
eka has joined #ruby
<primenum>
I ended up disconnected earlier but my question was: if someone requests the following foo.com/controller/action/namevalue can it be rerouted to post to controller/action using name=namevalue?
<benlieb>
is there a way to determine where a method is defined?
phipes has quit []
RoryHughes has joined #ruby
<benlieb>
I have a member? method on a model and that method isn't in the model
<primenum>
What do you mean by where?
Czupa has quit [Quit: Wychodzi]
<primenum>
ah, not sure
<benlieb>
I can't tell if a gem added that somewhere
Czupa has joined #ruby
<benlieb>
or what
<benlieb>
it's being tested in the specs, and it exists, I just can't find where it's coming from
coca_rails has quit [Remote host closed the connection]
pu22l3r has quit [Ping timeout: 246 seconds]
<benlieb>
there must be a way, no?
burlyscudd has quit [Ping timeout: 272 seconds]
coca_rails has joined #ruby
Advocation has joined #ruby
<primenum>
Can you just search all *.rb files for it?
cgore has quit [Remote host closed the connection]
<benlieb>
primenum: already did
<benlieb>
that method is defined on other models, but not on this one
<benlieb>
and I don't see an initializer or anything that adds it.
<benlieb>
I just don't know what the method is testing for to determine if member? is true or not.
cgore has joined #ruby
<DouweM>
primenum: this might be better suited to #RubyOnRails
fedesilv_ has quit [Remote host closed the connection]
iamjarvo has quit [Remote host closed the connection]
mklappstuhl has quit [Ping timeout: 272 seconds]
kirun has quit [Quit: Client exiting]
<hephaestus_rg>
can i just gem install benchmark
iamjarvo has joined #ruby
<hephaestus_rg>
or is it builtin
machuga is now known as machuga|away
<havenwood>
hephaestus_rg: It is in the stlib, so you can just: require 'benchmark'
thams has joined #ruby
<hephaestus_rg>
havenwood: thanks!
Matriks has quit [Remote host closed the connection]
pushpak has joined #ruby
<havenwood>
stdlib*
klaut has joined #ruby
brennanMKE has quit [Read error: Connection reset by peer]
fuzzyhorns has quit [Quit: Leaving.]
<shevy>
hephaestus_rg yeah is built in, usually in such blog entries, if it would be an external gem, it will be mentioned explicitely (unless the blog author was an idiot, but most blog authors are very clever)
iamjarvo has quit [Ping timeout: 252 seconds]
Elhu has quit [Read error: Connection reset by peer]
<jonno11>
MrZYX: But, if you took the time to read the gist, you'll see I piped the output to a file.
<MrZYX>
jonno11: you piped stdout, not stderr
<foster63_>
I'm lookingn anyone help? for some idiomatic Ruby. Ca
mklappstuhl has joined #ruby
<foster63_>
Can anyone help?
<MrZYX>
foster63_: don't ask to ask, just ask
<foster63_>
How do I do "Find the first non-false element of an array?"
krz has quit [Quit: WeeChat 0.4.2]
<jonno11>
MrZYX: Yeah. I've done that too, still nothing.
vlad_starkov has quit [Read error: Connection reset by peer]
<MrZYX>
foster63_: array.find {|e| e != false }
<hephaestus_rg>
MrZYX: i didn't really understand your sane soluton
ahawkins has quit [Ping timeout: 252 seconds]
serp` has quit [Quit: serp`]
coca_rai_ has quit [Remote host closed the connection]
<foster63_>
Will array.select!.first work?
blackmesa has joined #ruby
samsonasu has joined #ruby
<MrZYX>
hephaestus_rg: put your code into a class, lets say foo.rb containing the class Foo. Then you can write multiple runners, like run_foo_from_stdin.rb requiring foo and passing $stdin to Foo and run_foos_from_sample_inputs.rb taking a couple of files and passing each one to a new instance of Foo
<foster63_>
Ahh, no because select need a block. Correct?
<MrZYX>
foster63_: let's find out!
culturel_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<MrZYX>
it says "If no block is given, an Enumerator is returned instead."
mklappstuhl has quit [Ping timeout: 248 seconds]
coca_rails has joined #ruby
frustrum has quit [Quit: WeeChat 0.4.2]
Al___ has quit [Read error: Connection reset by peer]
benlieb has joined #ruby
<Authenticator>
I'm trying to unit-test a program that can open a pry console without spamming test output onto the screen. I've redefined $stdout, $stderr (and STDOUT, STDERR) and set the Pry prompt to '' but it still prints its output. I can prevent/capture other output this way, any idea why not Pry's?
Al___ has joined #ruby
<MrZYX>
foster63_: array.select { |e| e != false }.first would work but do more work than array.find {|e| e != false }
<MrZYX>
Authenticator: just a wild guess: probably because it's going through readline
frustrum has joined #ruby
axl_ has left #ruby [#ruby]
tyl has joined #ruby
<MrZYX>
foster63_: also note that the self modifying methods in core (the ones with a ! at the end) may retun nil if they don't change anything