<beauby>
I may have misunderstood but it seemed from the above discussion that I didn't have much of a choice for the try since `constants.includes?` won't play nice with autoloading
_orangejuice has quit [Quit: Connection closed for inactivity]
failshell has quit [Ping timeout: 246 seconds]
leat1 has quit [Ping timeout: 256 seconds]
solocshaw has joined #ruby
vF3hNGxc47h8 has quit [Ping timeout: 256 seconds]
RazorX has quit [Remote host closed the connection]
leat1 has joined #ruby
<Ox0dea>
beauby: Having #lookup_chain return actual classes rather than strings a la Module#nesting would be an improvement.
<Ox0dea>
From there, you'd probably be able to define #lookup in terms of #reduce and #const_get, which would be more performant than starting from the top each time through.
RazorX has joined #ruby
<Ox0dea>
Also, check that your rescuing Exception hasn't resulted in the smiting of any nearby creatures.
<Ox0dea>
#const_get can only ever raise NameError, I'd imagine.
mleung has quit [Quit: mleung]
vikaton has joined #ruby
RazorX has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<beauby>
which probably is totally unnecessary actually
HashNuke_ has joined #ruby
colstrom_ has joined #ruby
prosody_ has joined #ruby
nizmow- has joined #ruby
jxie has joined #ruby
ipstatic_ has joined #ruby
Fraeon has joined #ruby
scpike_ has joined #ruby
petersaints_ has joined #ruby
izzol_ has joined #ruby
sonne_ has joined #ruby
totimkop1 has joined #ruby
shortdudey123_ has joined #ruby
bier_ has joined #ruby
MyMind has quit [Read error: Connection reset by peer]
amclain has quit [Read error: Connection reset by peer]
cvtsx has quit [Read error: Connection reset by peer]
dravine has quit [Read error: Connection reset by peer]
mkosaki has quit [Read error: Connection reset by peer]
prosody has quit [Ping timeout: 268 seconds]
alexUaN has quit [Remote host closed the connection]
colstrom has quit [Ping timeout: 268 seconds]
A124 has joined #ruby
<Ox0dea>
beauby: Ah, sorry; forgot you're trying to do it the other way round. Building the array to search with ActiveSupport's Module#parent seems the way to go.
A124 has joined #ruby
jxie_ has quit [Quit: No Ping reply in 180 seconds.]
A124 has quit [Ping timeout: 268 seconds]
M-Kodo has quit [Ping timeout: 268 seconds]
ghoti has quit [Read error: Connection reset by peer]
scpike has quit [Ping timeout: 268 seconds]
farn has quit [Ping timeout: 268 seconds]
totimkopf has quit [Ping timeout: 268 seconds]
izzol has quit [Ping timeout: 268 seconds]
papercode has quit [Ping timeout: 268 seconds]
dravine_ is now known as dravine
A124 has quit [Changing host]
sufyan` has quit [Read error: Connection reset by peer]
matled has quit [Remote host closed the connection]
sepp2k has quit [Read error: Connection reset by peer]
sdwrage has quit [Read error: Connection reset by peer]
meatherly has quit [Read error: Connection reset by peer]
opensource_ninja has quit [Remote host closed the connection]
`derpy has quit [Ping timeout: 264 seconds]
bier has quit [Ping timeout: 264 seconds]
sonne has quit [Ping timeout: 264 seconds]
HashNuke has quit [Ping timeout: 264 seconds]
eregon has quit [Quit: No Ping reply in 180 seconds.]
chipotle has quit [Read error: Connection reset by peer]
chipotle_ has joined #ruby
Trieste has joined #ruby
A124 is now known as Guest37749
CustosL1men has joined #ruby
karapetyan has quit [Ping timeout: 250 seconds]
Guest37749 has quit [Changing host]
Guest37749 has joined #ruby
howdoicomputer has joined #ruby
Guest37749 is now known as A124
ecksit has joined #ruby
xcesariox has joined #ruby
leat1 has quit [Remote host closed the connection]
rcs has joined #ruby
leat1 has joined #ruby
zapata has quit [Ping timeout: 240 seconds]
shakes has joined #ruby
juanpablo_ has quit [Ping timeout: 255 seconds]
cantaberry has joined #ruby
centrx has quit [Quit: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."]
drewvanstone has quit [Ping timeout: 265 seconds]
tjbiddle has quit [Ping timeout: 252 seconds]
<c_nick>
Need a regex for capturing -1.114e-12234 in a string .. I tried with \b[+-]*\d+[.]\d+[eE]*[+-]*\d+\b but is there a better way to do it?
eminencehc has joined #ruby
dorei has quit []
jgt has joined #ruby
stardiviner has joined #ruby
rubie has joined #ruby
jxv has joined #ruby
tjbiddle has joined #ruby
<Ox0dea>
c_nick: Are you sure you need to do this?
<baweaver>
?xy
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
jgt has quit [Ping timeout: 240 seconds]
pwnd_nfsw has quit [Ping timeout: 246 seconds]
FernandoBasso has quit [Quit: WeeChat 1.3]
webguynow has quit [Ping timeout: 244 seconds]
rubie has quit [Ping timeout: 265 seconds]
Lovich has joined #ruby
webguynow has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
iamninja has quit [Read error: Connection reset by peer]
<Ox0dea>
c_nick: If you don't actually need to parse out the constituent parts, the conventionally wise approach is presented above.
<eam>
yeah, I say tokenize on whitespace because while whitespace is OK inside Float(), other stuff won't be
<eam>
so you'll have to tokenize on *something*
bmurt has joined #ruby
<havenwood>
>> Rational('-1.114e-12234')
<baweaver>
c_nick: ?xy
<Ox0dea>
Shit, I completely misinterpreted c_nick's question.
<ruboto>
havenwood # => (-557/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ...check link for more (https://eval.in/434095)
rbennacer has quit [Remote host closed the connection]
<eam>
>> Float('dunno, maybe the data looks like -1.114e-12 or something')
<ruboto>
eam # => invalid value for Float(): "dunno, maybe the data looks like -1.114e-12 or something" (ArgumentError ...check link for more (https://eval.in/434096)
yfeldblum has quit [Remote host closed the connection]
<c_nick>
e-12234 is massive so 0.0 is ok
<baweaver>
something like that
chipotle_ has joined #ruby
<Ox0dea>
s/massive/infinitesimal/
podman has quit [Quit: Connection closed for inactivity]
<eam>
it's both, oddly enough
chipotle has quit [Read error: Connection reset by peer]
<c_nick>
essentially what i need to do is parse a file, if i find any floating point values (viz. 1.234 1.23e-1234) then i need to process that (viz. truncate to 2 floating points)
<c_nick>
so v.gsub!(/\b[+-]*\d+[.]\d+[eE]*.\d+\b/){|o| "%0.2f"%o}
<c_nick>
v is everything from the file
braincrash has joined #ruby
<eam>
c_nick: are they whitespace delimited?
<baweaver>
>> 'har har 1.234 i can word -1.114e-12234 something'.split.map { |w| "%0.2f" % Float(w) rescue nil }.compact
<eam>
the latter can be ambiguous depending on your allowable syntax for floats
<eam>
c_nick: great, in that case definitely do something like what baweaver suggested
<eam>
split on \s+
<eam>
test each word for Float()
<Ox0dea>
c_nick: Your file just has floating point numbers sprinkled all over the place?
<baweaver>
not exactly clean per-se to use rescue, but then again there's not much of a better way.
<eam>
it'll raise if the string isn't a Float()
<eam>
you'll get the same float parser ruby uses
<c_nick>
Ox0dea: not really zero or more floats
chipotle has joined #ruby
<c_nick>
what does compact do /
chipotle_ has quit [Read error: Connection reset by peer]
<Ox0dea>
c_nick: I mean to ask whether there isn't some more concrete structure to the thing, such that you might avoid processing every single "word".
<c_nick>
oh ok .. so he is removing nil from the array which he gets through map
webguynow has quit [Ping timeout: 260 seconds]
rubie has quit [Remote host closed the connection]
webguynow has joined #ruby
<c_nick>
Ox0dea: i am afraid not really
<Ox0dea>
c_nick: Was this file generated by Satan?
<ruboto>
Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
choke has quit [Read error: Connection reset by peer]
choke has joined #ruby
chipotle_ has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
<c_nick>
Ideally they are just numbers output from the function
Gnomethrower has joined #ruby
<c_nick>
so not really any fakes there.. if you really want the exact same thing that here is a sample GetBondStaticData: 1.56238, GetTenors: 5.1298, Currency: USD
arescorpio has joined #ruby
chipotle_ has quit [Read error: Connection reset by peer]
<havenwood>
mices: You can make a single Gist with multiple files. Save files with filenames for syntax highlighting and to add context. Adding comments or even a markdown file that present the full context of your problem will greatly improve the response you get.
<Ox0dea>
rgb-one: Is this for l33tspeak generation or profanity filtration?
<baweaver>
mices: you were kicked for not listening. Use Heroku
<baweaver>
a lot of us are on both channels.
<havenwood>
Options -Indexes
tejasmanohar has quit [Quit: tejasmanohar]
Synthbread has joined #ruby
tejasmanohar has joined #ruby
mary5030 has joined #ruby
radgeRayden has quit [Ping timeout: 265 seconds]
chipotle has joined #ruby
<baweaver>
but more honestly mices, I would take that as time to work on this by yourself. If you crossed enough people in Rails to get kicked, chances are it won't work out much better here.
Guest5 has joined #ruby
tejasmanohar has quit [Client Quit]
rubie has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: i've nodded off.]
mary5030 has joined #ruby
<havenwood>
mices: Working on Nginx now? Spend time to better present your questions if you're getting rebuffed. Also be sure to think about the most appropriate channel to ask your question. I think earlier you were asking Apache questions in #RubyOnRails instead of the #httpd channel and now you seem to be asking Nginx questions in #ruby instead of the #nginx channel.
iamninja has joined #ruby
last_staff has quit [Quit: last_staff]
<havenwood>
mices: You'll find a better receptions and answers in the on-topic channel.
chipotle has quit [Client Quit]
webguynow has quit [Ping timeout: 240 seconds]
webguynow has joined #ruby
oo_ has joined #ruby
<havenwood>
mices: Quick responses to questions after a well-formed Gist are smiled-upon.
mordocai has quit [Remote host closed the connection]
<monoprotic>
Array#product would help
<baweaver>
rgb-one: you already asked
<baweaver>
and were answered above
<rgb-one>
baweaver: Ah, I fell asleep so didn't see the answer
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<rgb-one>
monoprotic: Intersting
shinnya has quit [Ping timeout: 250 seconds]
<baweaver>
Ox0dea already mentioned it above, scroll back a ways or check the logs on channel join
symm- has joined #ruby
dhjondoh1 has joined #ruby
dhjondoh has quit [Ping timeout: 240 seconds]
dhjondoh1 is now known as dhjondoh
webguynow has quit [Ping timeout: 255 seconds]
webguynow has joined #ruby
codecop has joined #ruby
krz has joined #ruby
symm- has quit [Read error: Connection reset by peer]
mordocai has joined #ruby
arup_r has joined #ruby
symm- has joined #ruby
duncannz has quit [Ping timeout: 272 seconds]
ta has quit [Remote host closed the connection]
<rgb-one>
havenwood: In response to your question: "rgb-one: Do you know how to turn the Hash into an Array of just its values?" would `hash.each do |h|; puts h[1]; end` be adequate?
cantaberry has quit [Ping timeout: 256 seconds]
bluOxigen has joined #ruby
duncannz has joined #ruby
Macaveli has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
karapetyan has joined #ruby
duncannz has quit [Max SendQ exceeded]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
duncannz has joined #ruby
darkhex has joined #ruby
howdoicomputer has joined #ruby
<rgb-one>
Ox0dea: Neither of those are my main reason but the application does employ l33tspeak
<certainty>
rgb-one: well Hash#values would do
gix has quit [Ping timeout: 240 seconds]
pawnbox_ has joined #ruby
pawnbox has quit [Ping timeout: 255 seconds]
jhooker has quit [Ping timeout: 252 seconds]
skullcrasher has joined #ruby
howdoi has joined #ruby
jgt has joined #ruby
leat1 has quit [Remote host closed the connection]
leat1 has joined #ruby
iamninja has joined #ruby
ndrei_ has joined #ruby
howdoicomputer has quit [Ping timeout: 250 seconds]
<howdoi>
in haml i'm doing something like var data = #{data}; that will expand all the contents of data is there any way to set a JS variable without exposing it in the source ?
* howdoi
is not sure if this is the right channle
ndrei has quit [Remote host closed the connection]
Guest32 has joined #ruby
firstdayonthejob has joined #ruby
aswen has joined #ruby
Balzrael has joined #ruby
iamninja has quit [Ping timeout: 244 seconds]
beast has quit [Remote host closed the connection]
CustosL1men has quit [Max SendQ exceeded]
Guest32 has quit [Client Quit]
chuy has quit [Ping timeout: 255 seconds]
CustosL1men has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
tjohnson has quit [Quit: Connection closed for inactivity]
opensource_ninj1 has quit [Quit: opensource_ninj1]
<rgb-one>
certainty: Indeed it does :)
mordocai has quit [Remote host closed the connection]
Burgestrand has joined #ruby
chuy has joined #ruby
Burgestrand has quit [Client Quit]
Burgestrand has joined #ruby
greenarrow has joined #ruby
dionysus69 has quit [Ping timeout: 244 seconds]
Guest32 has joined #ruby
webguynow has quit [Ping timeout: 255 seconds]
<BLuEGoD>
I'm trying to add a rack middleware to capture all StandardError Exceptions similar to stackoverflow.com/q/14790380 - However, exceptions are still been thrown down the stack in other call(env) method. Any clues as to what's going on? I'm using Thin as a web server and trying to avoid it to exit everytime an Exception is thrown...
webguynow has joined #ruby
nofxx has quit [Ping timeout: 250 seconds]
amstrad has joined #ruby
UtkarshRay has joined #ruby
amclain_ has quit [Quit: Leaving]
webguynow has quit [Ping timeout: 255 seconds]
webguynow has joined #ruby
SCHAAP137 has joined #ruby
mordocai has joined #ruby
failshell has joined #ruby
devoldmx has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
failshell has quit [Ping timeout: 246 seconds]
infoget has joined #ruby
howdoicomputer has joined #ruby
andikr has joined #ruby
khebbie has quit [*.net *.split]
solars has quit [*.net *.split]
tagrudev has quit [*.net *.split]
oo_ has quit [*.net *.split]
mices has quit [*.net *.split]
iateadonut has quit [*.net *.split]
cookiez has quit [*.net *.split]
Nanuq has quit [*.net *.split]
null__ has quit [*.net *.split]
ReK2 has quit [*.net *.split]
mistermocha has quit [*.net *.split]
eGGsha has quit [*.net *.split]
astrobunny has quit [*.net *.split]
Lucky__ has quit [*.net *.split]
Trieste has quit [*.net *.split]
A124 has quit [*.net *.split]
cjk101010 has quit [*.net *.split]
unholycrab has quit [Read error: Connection reset by peer]
spacemud has joined #ruby
infoget has left #ruby [#ruby]
moeabdol has joined #ruby
symm- has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
renderfu_ has joined #ruby
renderful has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
Trieste has joined #ruby
ReK2 has joined #ruby
astrobunny has joined #ruby
cjk101010 has joined #ruby
eGGsha has joined #ruby
Lucky__ has joined #ruby
A124 has joined #ruby
khebbie has joined #ruby
tagrudev has joined #ruby
oo_ has joined #ruby
solars has joined #ruby
cookiez has joined #ruby
Nanuq has joined #ruby
iateadonut has joined #ruby
null__ has joined #ruby
mices has joined #ruby
webguynow has quit [Ping timeout: 255 seconds]
webguynow has joined #ruby
tatsuo has joined #ruby
tuor has joined #ruby
terlar has joined #ruby
lampshades has joined #ruby
workmad3 has joined #ruby
pawnbox_ has joined #ruby
ta has joined #ruby
leat1 has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sn0wb1rd has quit [Remote host closed the connection]
<tuor>
It's about read_config_file. The file exists but the code l130 isn't run. I tryed to start pry and include the class. I created a instance of it and called the method but config_file is still an empty Hash.
<tuor>
I don't get any syntax error. Now I just don't know how to find out what is going wrong...
tkuchiki has quit [Remote host closed the connection]
<tuor>
What I want with this method (if it's not clear): read a YAML file and create a ruby hash object wich contains (for the moment) only one key
sdwrage_ has quit [Quit: This computer has gone to sleep]
<tobiasvl>
what's the cleanest way to combine a ||= with += I wonder
<tobiasvl>
or something like ||<<
TheHodge has joined #ruby
Hounddog has joined #ruby
x-light has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
<certainty>
tuor: yepp. That's it. If it doesn't stop there, then it means that File.exists? returned false, which means that stat on the given config_file_name failed
juanpablo_ has joined #ruby
skade has joined #ruby
Pupeno has quit [Remote host closed the connection]
lampshades has quit [Remote host closed the connection]
Synthbread has quit [Ping timeout: 244 seconds]
ramfjord has quit [Ping timeout: 256 seconds]
shredding has joined #ruby
webguynow has quit [Ping timeout: 255 seconds]
juanpablo_ has quit [Ping timeout: 240 seconds]
webguynow has joined #ruby
kedare has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adaedra>
I have no hopes, so you can't have let mine down
webguynow has quit [Ping timeout: 272 seconds]
webguynow has joined #ruby
<certainty>
all hope is gone
<atmosx_laptop>
aloha
The_Ball has joined #ruby
<adaedra>
No hopes, only code now
<adaedra>
hi atmosx_laptop
<flughafen>
There is only Zuul
cvtsx has quit [Ping timeout: 265 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cvtsx has joined #ruby
f4cl3y has joined #ruby
iamninja has joined #ruby
allomov has quit [Remote host closed the connection]
stan has joined #ruby
ndrei has quit [Ping timeout: 240 seconds]
mr_dev has joined #ruby
rushed has quit [Quit: rushed]
arup_r has quit [Remote host closed the connection]
Mia has joined #ruby
firstdayonthejob has quit [Ping timeout: 240 seconds]
mr_dev has left #ruby [#ruby]
ndrei has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sonOfRa has quit [Quit: Bye!]
iamninja has quit [Ping timeout: 240 seconds]
webguynow has quit [Ping timeout: 250 seconds]
sonOfRa has joined #ruby
chouhoulis has quit [Remote host closed the connection]
webguynow has joined #ruby
chouhoulis has joined #ruby
siaw has joined #ruby
tvw has joined #ruby
Igorshp has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
wldcordeiro_ has quit [Remote host closed the connection]
mr_dev has joined #ruby
roxtrongo has quit [Read error: Connection reset by peer]
allomov has joined #ruby
wldcordeiro_ has joined #ruby
moeabdol has quit [Ping timeout: 256 seconds]
khebbie has quit [Remote host closed the connection]
khebbie has joined #ruby
MichaelSmith has quit [Quit: Connection closed for inactivity]
webguynow has quit [Ping timeout: 272 seconds]
webguynow has joined #ruby
<shevy>
flughafen lol
blarghlarghl has joined #ruby
merlinp has joined #ruby
<blarghlarghl>
Hello everyone. I have, say 4-5 forks going, each with a set of forks within it. I want each outer fork to Process.waitall, but only on its own inner forks, not on any parallel process forks. Does Process.waitall do that?
arup_r has joined #ruby
failshell has joined #ruby
xnr has quit [Quit: ರ_ರ]
workmad3 has joined #ruby
xnr has joined #ruby
Burgestrand has quit []
joshmyers has joined #ruby
<joshmyers>
Hey, whats the difference between raise_error and raise_exception?
<apeiros>
joshmyers: neither is in ruby, so what are you talking about?
<maloik>
I'm guessing it's the rspec thing
<joshmyers>
sorry, it's an rspec matcher
<joshmyers>
yes
moeabdol has joined #ruby
moeabdol has quit [Client Quit]
k3asd` has quit [Ping timeout: 264 seconds]
cornerman has joined #ruby
<maloik>
their docs seem to say they're functionally interchangeable
failshell has quit [Ping timeout: 272 seconds]
<certainty>
really how difficult is it to look that up on your own
<certainty>
it took us a few seconds
<certainty>
that sounded grumpier than it was supposed to
Balzrael has quit [Quit: Leaving]
<joshmyers>
I did and I came up with the same answer, was wondering if there are conventions of using one over the other.
<joshmyers>
yes it did.
<certainty>
it's about having the choice to pick one that fits best. I'm not aware of conventions.
Burgestrand has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
<certainty>
i first thought that one might only make sure that a subclass of StandardError was raised but apparently it's not the case
webguynow has quit [Ping timeout: 252 seconds]
pawnbox has joined #ruby
lkba_ has quit [Ping timeout: 246 seconds]
webguynow has joined #ruby
bruno- has joined #ruby
Gnomethrower has quit [Changing host]
Gnomethrower has joined #ruby
<joshmyers>
ok cool, thanks.....
timonv has joined #ruby
<joshmyers>
still not sure which would make either 'fit best'
CloCkWeRX has left #ruby [#ruby]
<jhass>
blarghlarghl: I'd expect so, but easy enough to hammer out a small script and verify?
krz has quit [Quit: WeeChat 1.2]
<jhass>
raise_error is less typing, so
moeabdol has joined #ruby
allomov has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 246 seconds]
webguynow has quit [Ping timeout: 272 seconds]
webguynow has joined #ruby
ddv has quit [Changing host]
ddv has joined #ruby
xfbs has joined #ruby
<shevy>
haha
Voker57 has joined #ruby
emilkarl has joined #ruby
Burgestrand has quit []
solocshaw has joined #ruby
solocshaw has quit [Remote host closed the connection]
joshmyers has quit [Remote host closed the connection]
xfbs has quit []
youngbaks has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
dhjondoh has joined #ruby
x-light has joined #ruby
<rgb-one>
When executing `puts [1, 2, 3].product(["a", "b", "c"], ["x", "y", "z"], ["q","w", "e"])`, how can I repersent the result such that the different combinations are outputed line by line instead of the each individual character?
solocshaw has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 250 seconds]
<rgb-one>
So 1, a, x, q will be on line 1, 1, a, x, w, line 2 etc.
<shevy>
dunno, did you try require 'pp'; pp [1, 2, 3].product(["a", "b", "c"], ["x", "y", "z"], ["q","w", "e"]) yet?
<rgb-one>
what is pp?
<SebastianThorn>
pritty print
<rgb-one>
I will give it a try
zerolith has joined #ruby
<shevy>
*pretty :)
<rgb-one>
shevy: Indeed friend it worked
<shevy>
\o/
<shevy>
there is also awesome print if you want colours... but I found it overkill
tjbiddle has quit [Quit: tjbiddle]
johnhamelink has quit [Ping timeout: 246 seconds]
juanpablo_ has joined #ruby
<shevy>
is there a collective word for these three elements: directory, file, symlink? I need to add a colourize-method and I need to give it a name... directories, files and symlinks will be colourized differently but I need to name an aggregate method... "def colorize(input)" isn't a good name...
alem0lars has quit [Ping timeout: 246 seconds]
Klumben has quit [Ping timeout: 246 seconds]
suchness has joined #ruby
slayerjain has joined #ruby
juanpablo_ has quit [Ping timeout: 244 seconds]
stamina has joined #ruby
tatsuo has quit [Remote host closed the connection]
<SebastianThorn>
shevy: ye, it didnt really look right :P
alex88 has joined #ruby
youngbaks has quit [Ping timeout: 252 seconds]
<SebastianThorn>
shevy: "everything is a file"
CustosL1men has quit [Ping timeout: 250 seconds]
<SebastianThorn>
i'd use file, type or filetype?
<adaedra>
shevy: node
<shevy>
hmm
<shevy>
node sounds good
Kallis has joined #ruby
beast_ has joined #ruby
Kallis has quit [Max SendQ exceeded]
samuel02 has joined #ruby
Igorshp has quit [Remote host closed the connection]
Kallis has joined #ruby
xfbs has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
Asher has quit [Quit: Leaving.]
Rurik has joined #ruby
bweston92 has quit [Read error: Connection reset by peer]
webguynow has quit [Ping timeout: 272 seconds]
webguynow has joined #ruby
Asher has joined #ruby
allomov has joined #ruby
Asher is now known as Guest4886
lulzmachine has quit [Quit: Connection closed for inactivity]
x-light has quit [Ping timeout: 255 seconds]
webguynow has quit [Ping timeout: 240 seconds]
Igorshp has joined #ruby
robbyoconnor is now known as r0bby_
r0bby_ is now known as robbyoconnor
webguynow has joined #ruby
terlar has quit [Quit: WeeChat 1.3]
minimalism has quit [Quit: leaving]
duncannz has quit [Remote host closed the connection]
khebbie has quit [Remote host closed the connection]
<moeabdol>
in rspec 3 I have an array containint heterogeneous objects
Guest4886 has quit [Quit: Leaving.]
<moeabdol>
I want to test the existance of a an object in the array so I
MALAZIJSKIJ_BOEI has quit [Quit: Textual IRC Client: www.textualapp.com]
<moeabdol>
it works! but I wonder if this is a neat way to do this, and wither there is a matcher that is already made for such an expectation?
Asher- is now known as Asher
Asher has quit [Client Quit]
Asher has joined #ruby
Rurik has quit [Read error: Connection reset by peer]
webguynow has quit [Ping timeout: 240 seconds]
r_baron has joined #ruby
webguynow has joined #ruby
Denis__ has joined #ruby
Zai00 has quit [Quit: Zai00]
cvtsx has quit [Ping timeout: 244 seconds]
Azure has quit [Ping timeout: 255 seconds]
Igorshp has quit [Remote host closed the connection]
Rurik has joined #ruby
leat1 has quit [Quit: leat1]
cvtsx has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
tvw has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
tatsuo has joined #ruby
CustosL1men has joined #ruby
SCHAAP137 has joined #ruby
hayricicek has quit [Ping timeout: 252 seconds]
c0m0 has joined #ruby
Igorshp has joined #ruby
nettoweb has joined #ruby
khebbie has joined #ruby
kjhsdf has joined #ruby
leat has joined #ruby
leat has quit [Remote host closed the connection]
leat has joined #ruby
webguynow has quit [Ping timeout: 250 seconds]
webguynow has joined #ruby
konsolebox has quit [Quit: Leaving]
hashrocket has quit [Quit: Connection closed for inactivity]
hayricicek has joined #ruby
heidar has joined #ruby
Denis__ has left #ruby ["Leaving"]
webguynow has quit [Ping timeout: 240 seconds]
webguynow has joined #ruby
stardiviner has joined #ruby
leat has quit [Ping timeout: 260 seconds]
phutchins has joined #ruby
marr has joined #ruby
lkba has joined #ruby
polysics has quit [Ping timeout: 255 seconds]
kjhsdf has quit [Quit: WeeChat 1.3]
<shevy>
webkitgtk-source takes much longer to compile than firefox-source ... :(
leat has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
apt-get has joined #ruby
<darix>
shevy: try libreoffice next ;)
bweston92 has joined #ruby
<adaedra>
And Qt
<darix>
adaedra: libreoffice needs 30+GB disk space to compile now 8)
<adaedra>
nice
<darix>
and probably 6+hours
Dreamer3 has quit [Quit: Leaving...]
firstdayonthejob has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
khebbie has quit [Remote host closed the connection]
rgb-one has quit [Remote host closed the connection]
iamninja has joined #ruby
leat has quit [Remote host closed the connection]
agent_white has quit [Quit: night]
leat has joined #ruby
rodfersou has joined #ruby
webguynow has quit [Ping timeout: 246 seconds]
tcopeland has quit [Quit: Leaving.]
webguynow has joined #ruby
iamninja has quit [Ping timeout: 260 seconds]
phutchins has quit [Quit: WeeChat 1.1.1]
karapetyan has quit [Remote host closed the connection]
<shevy>
qt takes less time :D
karapetyan has joined #ruby
<shevy>
libreoffice takes more
pawnbox has quit [Remote host closed the connection]
<shevy>
the odd thing is that firefox source has like 140mb, webkitgtk like 13mb as .tar.xz
lxsameer has joined #ruby
pawnbox has joined #ruby
last_staff has joined #ruby
<shevy>
ruby, python and perl take almost the same time to compile, go very easily
<shevy>
the only strange part about ruby is the rdoc-installation step, that seems to take a really long time
<shevy>
mruby compiles almost instantly :D
khebbie has joined #ruby
webguynow has quit [Ping timeout: 240 seconds]
<workmad3>
shevy: yeah, ri and rdoc both take ages to generate :(
webguynow has joined #ruby
<shevy>
ok ... "almost instantly" was exaggerated... took 27 seconds here
slayerjain has quit [Ping timeout: 250 seconds]
<shevy>
mruby-master/test/t/float.rb:201:17: ambiguous first argument; put parentheses or even spaces
<shevy>
hehe
karapetyan has quit [Ping timeout: 240 seconds]
sdothum has joined #ruby
tvw has joined #ruby
r_baron has quit [Ping timeout: 250 seconds]
krisquigley has quit [Remote host closed the connection]
<shevy>
bin/mruby seems to make use of ncurses ... libncursesw.so.5 => /usr/lib/libncursesw.so.5
jas02 has quit [Ping timeout: 252 seconds]
cache_over_mem has joined #ruby
<cache_over_mem>
guys i know you guys are always doing stuff better than me
<shevy>
cache_over_mem you do this deliberately :>
alex88 has quit [Ping timeout: 240 seconds]
<cache_over_mem>
but i just found out that you can .reduce(:&) for intersections of an array of arrays
<shevy>
gateway ;)
<cache_over_mem>
?
<adaedra>
!
miguelff has joined #ruby
jas02 has joined #ruby
chills42 has joined #ruby
chills42 has quit [Remote host closed the connection]
chills42 has joined #ruby
Burgestrand has joined #ruby
rubie has joined #ruby
Igorshp has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
failshell has joined #ruby
Hrorek has joined #ruby
jschoolcraft has joined #ruby
bazbing80 has joined #ruby
Hrorek has quit [Max SendQ exceeded]
Hrorek has joined #ruby
FernandoBasso has joined #ruby
Hrorek has quit [Max SendQ exceeded]
rubie has quit [Remote host closed the connection]
Rurik has quit [Ping timeout: 240 seconds]
Hrorek has joined #ruby
dfedde has quit [Quit: see ya!]
rubie has joined #ruby
Hrorek has quit [Max SendQ exceeded]
<yorickpeterse>
cache_over_mem: as in:
<yorickpeterse>
?guys
<ruboto>
Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
merlinp has quit [Remote host closed the connection]
failshell has quit [Ping timeout: 272 seconds]
Rurik has joined #ruby
Rurik has quit [Changing host]
Rurik has joined #ruby
<yorickpeterse>
cache_over_mem: I suggest you take the suggestion and honor it
<yorickpeterse>
This has nothing to do with freedom of speech
<cache_over_mem>
yorick, you know how shit you are? you bring nothing to perl as you bring nothing to ruby
krisquigley has joined #ruby
<yorickpeterse>
lol
<cache_over_mem>
neither do i, but i dont whine along the way
<yorickpeterse>
I don't really have to bring anything to Perl, I care little for a dying language
<yorickpeterse>
I also care little for 12 year olds, so enjoy the /ignore
<certainty>
now that escalated quickly
<cache_over_mem>
yeah i just looked at your GH, you're not who i was thinking of, but all the same
rubie has quit [Remote host closed the connection]
<cache_over_mem>
you're the guy who managed to turn a simple XML parser into a career
<adaedra>
Here we go again
<yorickpeterse>
honestly if the first response somebody has "MY FREEDOM OF SPEECH" that just clearly shows how they're missing the point so massively
<yorickpeterse>
There's no point in argueing with people like that
cih has joined #ruby
Kallis has quit [Read error: Connection reset by peer]
gwendall has quit [Remote host closed the connection]
<yorickpeterse>
also somebody just give me +o so I can pre-emptively ban everybody :P
xfbs has quit []
<cache_over_mem>
thats like shooting somebody in an argument and then saying 'Oh what, no rebuttal? You're just whining about being shot'
<suchness>
I blame ruboto.
<cache_over_mem>
^
<suchness>
And I blame people who use it to sidetrack the channel from ruby.
<adaedra>
If you want this channel to discuss ruby issues, you can drag this discussion to -offtopic. It's here for this exact purpose.
krisquigley has quit [Ping timeout: 272 seconds]
<cache_over_mem>
what
<cache_over_mem>
thats exactly the opposite of how it should work
phutchins has joined #ruby
<yorickpeterse>
apeiros: ^
xfbs has joined #ruby
elperdut has joined #ruby
da3mian has joined #ruby
zerolith has left #ruby ["Leaving"]
jas02 has quit [Ping timeout: 252 seconds]
<shevy>
certainty nah it did not escalate really, the moment he used the words "guys" twice in the same sentence upon starting, along with being a gateway user was a dead-give away :)
syath has joined #ruby
<yorickpeterse>
Hm, I should start a collection of responses ?guys triggers
<shevy>
cache_over_mem get a real job man, don't be a vampire
Igorshp has joined #ruby
<cache_over_mem>
lol i probably make more than you, ya know. but you're welcome to not invite me to your special snowflake banquet :(((
<certainty>
shevy: heh
<shevy>
cache_over_mem ah what do you work?
<cache_over_mem>
linux administration
tkuchiki has quit [Remote host closed the connection]
<shevy>
nah
<shevy>
you joined #windows* the other day
<cache_over_mem>
leading the charge to write less sh and perl and more ruby
Rurik has quit [Ping timeout: 250 seconds]
<cache_over_mem>
nope
<suchness>
Are you guys really going to devolve this discussion into personal attacks?
<shevy>
you are using the word guys as well :(
<adaedra>
shevy: tbf, I'm on channels not related to my work at all.
<cache_over_mem>
havent even touched a windows box for more than 5 years. always on my chromebook or crouton'ing centOS
jas02 has joined #ruby
xfbs has quit []
<shevy>
adaedra windows?
<certainty>
adaedra: heresy
<certainty>
:)
<adaedra>
shevy: no.
Igorshp has quit [Remote host closed the connection]
<shevy>
I think I joined #windows perhaps 3 or 4 times in 10 years, usually related to singular questions
ndrei has quit [Ping timeout: 260 seconds]
leat has quit [Remote host closed the connection]
but3k4 has joined #ruby
bruno- has joined #ruby
leat has joined #ruby
<cache_over_mem>
I joined ##linux many moons ago and they showed me how to boot linux, and i didnt realize that i couldnt 'turn it off' and i ended up making a career out of it somehow
codecop has quit [Remote host closed the connection]
Igorshp has joined #ruby
Rurik has joined #ruby
<adaedra>
mmh
Klumben has joined #ruby
<adaedra>
nvm
<certainty>
as the world turns. Sounds good
evrial has left #ruby [#ruby]
dasher00 has quit [Ping timeout: 250 seconds]
cih_ has joined #ruby
cih has quit [Read error: Connection reset by peer]
jas02 has quit [Ping timeout: 250 seconds]
Igorshp has quit [Remote host closed the connection]
juanpablo_ has joined #ruby
<shevy>
Does anyone of you have a statically compiled ruby?
kidoz has joined #ruby
<shevy>
My dream combination will be static busybox, static ruby... and then dietlibc!
<headius>
I wouldn't really consider RubyMotion to be ruby
pontiki has joined #ruby
hadrig has joined #ruby
<headius>
rather a statically-analyzable subset of ruby
<shevy>
yorickpeterse well crystal lacks a few things that I love, aliasing methods for instance. It may be the secondary option after ruby
<shevy>
and I am a past hello-world noob when it comes to crystal
<certainty>
crystal, for me, always has the association to crystal meth
<shevy>
yeah
<shevy>
you must think about rocks instead certainty
<shevy>
gems, diamonds, ruby, perl, shards
<certainty>
yeah i try. still
<shevy>
hehe
juanpablo_ has quit [Ping timeout: 272 seconds]
<cache_over_mem>
shevy, Julia is worth a look. lisp macros, OOP, native asm-dumpable code, really cool
<shevy>
certainty actually I more dream of auto-generating organisms but that seems either costly or technically difficult
* certainty
should research crystal some day
<cache_over_mem>
less rubyish and more luaish
<shevy>
one thing that confused me with crystal so far is... the binaries seem huge
<cache_over_mem>
he hasnt done tree shaking yet
<cache_over_mem>
itll get done soon
jas02 has joined #ruby
<shevy>
that was similar to nim ... the hello world example also was big, even after stripping
howdoicomputer has quit [Ping timeout: 250 seconds]
<cache_over_mem>
its the whole world tho
charliesome has joined #ruby
[k-_ has joined #ruby
hadrig has quit []
charliesome has quit [Client Quit]
hadrig has joined #ruby
pawnbox has quit [Remote host closed the connection]
<jhass>
shevy: I think --release mode shaves off a few bytes, but since we link against a bunch of stuff (gc, unwind, libc at the minimum) that's already like half a meg from the tables and stuff apparently
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ldnunes has joined #ruby
Zai00 has joined #ruby
<jhass>
idk, still better than Go I think :P
charliesome has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
dionysus69 has joined #ruby
mices has quit []
mices has joined #ruby
alem0lars has joined #ruby
mices has quit [Changing host]
mices has joined #ruby
johnhamelink has joined #ruby
<certainty>
jhass: am i correct that you can't use the entire language inside a macro method?
dasher00 has joined #ruby
<certainty>
in crystal that I mean
hadrig has quit [Client Quit]
guardian has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
<jhass>
yes and no, the macro language, that is the part that is evaluated at compile time is quite distinct, more like a template language with AST access if you so will
<yorickpeterse>
jhass: not sure if I'd call Crystal better than Go at this point
<jhass>
the result of that "template" is fed back into the parser
<jhass>
yorickpeterse: just talking about binary size
pwnd_nfsw has joined #ruby
<yorickpeterse>
Ah
jdawgaz has joined #ruby
<mices>
anyone can help me with rails/nginx
<certainty>
jhass: yeah that's how i've pictured it. thanks. A bit unfortunate if you ask me to have two languages basically but there may be some good reasons
greenarrow has quit [Quit: 500]
last_staff has quit [Ping timeout: 265 seconds]
elperdut has joined #ruby
Outlastsheep has joined #ruby
<certainty>
interesting language though
<cache_over_mem>
mices, #rails
<certainty>
i'll read more about it before i judge further
cih has joined #ruby
<jhass>
certainty: the main reason is practically, you'd have to either shell out to a new compiler process all the time (and spawning a process is slow) or reimplement an interpreter for the language in parallel. But it also gives a nice visual distinction between runtime and compile time code
cih_ has quit [Read error: Connection reset by peer]
<arup_r>
What I will ask here now is not direct Ruby, but related.
<jhass>
arup_r: /msg alis help
<shevy>
lol
<mices>
cache_over_men: there's no such channel and i'm banned from #rubyonrails for asking for help
<certainty>
jhass: alright. Scheme for example (at least the syntax-rules system) doesn't use the full language either. The reason there is hygiene though
<jhass>
Silex: more ignoring advice given and repeating the initial (misguided) question instead, from what I've gathered
<shevy>
that does away with tainted input!
<mices>
piece-a-sh*t
<jhass>
mices: watch your languages, see the rules
<Silex>
jhass: yeah, and after being helped for like 30 minutes
<jhass>
*language
<mices>
i don't like people harrassing me
<arup_r>
shevy: I know .dup .. Asking what is the point of duping a MethodObject
<jhass>
mices: /help ignore
<shevy>
arup_r aha, I see. good question... I don't think I have seen that before either
<arup_r>
I am not able to imagine a good example on it
<shevy>
me neither
<arup_r>
This Rails guys do.. anything if Ruby supports :D
<jhass>
arup_r: I could picture it as an alternative to alias_method_chain
cantaberry has joined #ruby
cache_over_mem has quit [Ping timeout: 246 seconds]
dhjondoh has quit [Remote host closed the connection]
<arup_r>
jhass: you are always awesome! .. Can you throw an example ? About the usefulness of the duplication a MethodObject .. I just want to see an useful example. Something ofcourse is there.. That is why the method is there.. but no example, that is bad! :/
<shevy>
but jhass didn't write rails!
radgeRayden has joined #ruby
<arup_r>
jhass: `alias_method_chain` dups a method or delegates it
<arup_r>
?
<jhass>
arup_r: eh, it does not support duplicating a method at all
<arup_r>
:)
<jhass>
arup_r: google alias_method_chain, there should be *tons* of blogs explaining its purpose
<Burgestrand>
More or less you rename the original method, overwrite it, and then call the original (if needed) with the new name.
<shevy>
\o/
<shevy>
see arup_r!
goodcodeguy has joined #ruby
<jhass>
arup_r: Method#duplicable? is just added by rails to facilitate duck typing upon that property, whether what you got at hand is duplicable or not, it's probably just there for completeness
<[k-_>
it's like inheritance and super, but better
<jhass>
arup_r: it always returns false
dhjondoh has joined #ruby
<Burgestrand>
Nowadays there's #prepend to allow something similar without renaming the original method. In the past you could also do a hack where you get a method handle to the old method, and bind the handle runtime and call afterwards.
dionysus69 has quit [Remote host closed the connection]
krisquigley has joined #ruby
<certainty>
you mean by aliasing the old method?
JDiPierro has joined #ruby
mcFactor has quit [Remote host closed the connection]
Igorshp has joined #ruby
<shevy>
oh yeah I have seen that old trick a lot, to reference to the old one, then change the copy
<certainty>
i never thought about it as a hack
<certainty>
i may have to think harder :)
<[k-_>
one of the reasons why people do this is to avoid doing expensive computations twice
<jhass>
[k-_: is that so? got an example?
wald0 has joined #ruby
<[k-_>
you know, those method caches
<jhass>
who talked about method caches?
<[k-_>
i don't have an example though, unless javascript and stuff
<mices>
can anyone help me get my rails app working with nginx
<jhass>
besides that term is usually used to refer to the method lookup caches
<[k-_>
yes, i meant that i think
<jhass>
no, I don't think so, it's a interpreter/VM internal largely
<[k-_>
no, i mean caching the results of the computation
<[k-_>
memoizing
bruno- has quit [Ping timeout: 240 seconds]
<[k-_>
for reuse later
rbennacer has joined #ruby
<jhass>
yup, that's not what's usually meant by method caches
abyss__ is now known as abyss
<[k-_>
and those lookup table things
<jhass>
that's just called memoization
<jhass>
method caches are a memoization technique of course, but one used by the VM/interpreter, not user code
polysics has joined #ruby
<certainty>
you most likely don't memoize by replacing the method with one that just returns the result because your memoized results might depend on the arguments
<[k-_>
sometimes i just | - o - - - - x - - - - - - | miss the spot
dionysus69 has joined #ruby
<Burgestrand>
Here's an example of the four methods I mentioned: https://repl.it/BI5H
<[k-_>
certainty: if there is a cache miss (the arguments are not considered the same), the old method is called with the new arguments and the result is also stored in the cache
<[k-_>
s/miss (the/miss (when the/
<Burgestrand>
arup_r: ^ — none of those use Method#dup though.
failshell has joined #ruby
<Burgestrand>
And actually, you can't dup Method. :)
<arup_r>
Burgestrand: Thank you very much! .. I am looking at it
<Burgestrand>
>> method(:puts).dup
<ruboto>
Burgestrand # => allocator undefined for Method (TypeError) ...check link for more (https://eval.in/434334)
<certainty>
[k-_: yeah exactly. That's why the implementation has to stay the same. It just does the lookup every time to see if there is a cached result
<certainty>
btw. that's a good example for the blurry line between data and code
rbennacer has quit [Client Quit]
failshell has quit [Remote host closed the connection]
failshell has joined #ruby
<certainty>
the computation is turned into a table lookup
JDiPierro has quit [Remote host closed the connection]
<[k-_>
memory in exchange for speed
<shevy>
C!
<certainty>
?
<[k-_>
well, you need somewhere to store those results!
<certainty>
yeah but why C?
<[k-_>
and those algorithms arent going to run any faster!
<arup_r>
Burgestrand: I am still on prepend method.. reading it.. to understand what the method does
oo_ has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 240 seconds]
<Burgestrand>
arup_r: prepend is a relatively new feature of Ruby, it's similar to include, but instead of putting the module behind of the ancestor tree (MyModule -> MyClass), it puts it in front (MyClass -> MyModule)
xfbs has joined #ruby
<arup_r>
ok
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-_>
your arrows confuse @。@
miguelff has quit [Quit: miguelff]
<shevy>
certainty in exchange for speed!!! C is fast!!!!!!!!!!
elfuego has joined #ruby
<jhass>
>> module M; end; class Include; include M; end; class Prepend; prepend M; end; [Include.ancestors, Prepend.ancestors]
<tuor>
and use in the same class only the methods and don't acces directly the variable with @myvar
universa1 has quit [Ping timeout: 240 seconds]
<[k-_>
it's bad practice to expose all your instance variables
linc01n has quit [Ping timeout: 240 seconds]
<[k-_>
and use @myvar, it tells ruby, and everyone else that you are accessing an instance variable
<[k-_>
also, it's faster
AndyRyanSmith has quit [Client Quit]
<tuor>
[k-_, Ah ok. So only use accessors if it's needed from outside?
sfr^ has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
bruno- has joined #ruby
<jhass>
tuor: I kinda flip that on a per class bases. For example if the class has "magical" accessors, that is ones that do things behind the scenes like keeping some related state consistent I usually use the accessors for all public attributes and sometimes even define a couple private ones. If it's a read only class (no setters/writers) I tend to use ivars all the way
<[k-_>
use your judgement. Is it better to expose your Social Security Number for other people to handle or do you keep it to yourself and handle it yourself
<jhass>
I think you can't derive a dogmatic rule, but you should keep it consistent on a per class basis at last
<tuor>
jhass, ok.
<tuor>
[k-_, ok.
mjmac has joined #ruby
JDiPierro has joined #ruby
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
hadrig has joined #ruby
karapetyan has joined #ruby
startupality has quit [Ping timeout: 252 seconds]
platzhirsch has joined #ruby
linuxboytoo has quit [Quit: Leaving...]
howdoi has quit [Quit: Connection closed for inactivity]
xfbs has joined #ruby
<tuor>
So what I do in the class is up to me, so long I do it the same in the complete class. I give accessors if needed.
bruno- has quit [Ping timeout: 246 seconds]
miguelff has joined #ruby
<[k-_>
practise encapsulation
<[k-_>
state is kept within a single object, not all around the world
Igorshp has quit [Remote host closed the connection]
xfbs has quit [Client Quit]
ndrei has joined #ruby
<shevy>
[k-_ ur face is a state!
sfr^ has joined #ruby
c0m0 has quit [Ping timeout: 246 seconds]
karapetyan has quit [Ping timeout: 256 seconds]
universa1 has joined #ruby
linc01n has joined #ruby
* [k-_
sets expression to "D:"
<shevy>
lol
jgt1 has quit [Ping timeout: 252 seconds]
webguynow has quit [Ping timeout: 250 seconds]
Coldblackice has quit [Ping timeout: 250 seconds]
sankaber has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
webguynow has joined #ruby
sankaber has joined #ruby
charliesome has joined #ruby
yashinbasement has quit [Quit: Leaving]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has quit [Ping timeout: 255 seconds]
Igorshp has joined #ruby
riffraff has joined #ruby
kobain has joined #ruby
elfuego has quit [Quit: elfuego]
megagigawatt has joined #ruby
xfbs has joined #ruby
ndrei has joined #ruby
Swappticon has joined #ruby
khebbie has quit [Remote host closed the connection]
<arup_r>
[k-_: I got now what you were talking about regarding the Memoization after reading http://gshutler.com/2013/04/ruby-2-module-prepend/ . Yes the alias_method and #prepend does the same thing -- "Memoization" ... Indeed!!
<shevy>
do you people recommend the use of () when we use "if condition and some_other_condition" ? for instance: if (array[0] == 'x') and (array[1] =~ /^\d+$/) versus if array[0] == 'x' and array[1] =~ /^\d+$/
<arup_r>
They do cache the result of a method.. and lower the response time or whatever time you call it!
khebbie has joined #ruby
<arup_r>
shevy: Don't use () unless you are getting Syntax error from Ruby
<arup_r>
:)
<arup_r>
I follow this
dionysus69 has quit [Remote host closed the connection]
<arup_r>
In nutshell `||=` is the HERO of the story. it seems so
AndyRyanSmith has joined #ruby
jgpawletko has joined #ruby
failshell has quit []
dima__ has joined #ruby
AndyRyanSmith has quit [Client Quit]
<[k-_>
shevy: parentheses are noise
nettoweb has joined #ruby
<[k-_>
no one uses them in ifs
dhjondoh has quit [Quit: dhjondoh]
<[k-_>
unless they run into precedence issues
null__ has quit [Ping timeout: 264 seconds]
null__ has joined #ruby
null__ has quit [Changing host]
null__ has joined #ruby
eGGsha has quit [Max SendQ exceeded]
nibbo has quit [Ping timeout: 250 seconds]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
chills42 has quit [Remote host closed the connection]
nateberkopec has joined #ruby
<tobiasvl>
Ox0dea: niiiiiiice
<Ox0dea>
[k-_oyaanisqatsi!
Igorshp has quit [Remote host closed the connection]
<Ox0dea>
tobiasvl: I'll refrain from pointing out that that feature is in WeeChat out of the box. :P
<tobiasvl>
good ;)
karapetyan has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
polysics has quit []
<Ox0dea>
[k-_: Have you seen Koyaanisqatsi?
apt-get_ has joined #ruby
<[k-_>
no
<[k-_>
are you saying that im unbalanced? :(
<[k-_>
and that english is in a horrible mess?
<Ox0dea>
[k-_: No? You've just been on about global warming and the like as of late.
<[k-_>
and a deeper meaning relating to english is in a horrible mess?
bigbadbear has joined #ruby
<Ox0dea>
The film has virtually nothing to do with the English language.
jgpawletko has joined #ruby
apt-get has quit [Ping timeout: 240 seconds]
Illusioneer has joined #ruby
<tobiasvl>
literally nothing.
mary5030 has joined #ruby
<[k-_>
Reggio explained the lack of dialogue by stating "it's not for lack of love of the language that these films have no words. It's because, from my point of view, our language is in a state of vast humiliation.
<suchness>
Or ruby
<Ox0dea>
Wow, much suchness.
<Ox0dea>
Many "you're not wrong".
<Ox0dea>
Wow.
vondruch has joined #ruby
<[k-_>
such suchness would be alliteration
<[k-_>
Also, stop global warming, today!
Pupeno has quit [Remote host closed the connection]
beauby has joined #ruby
Pupeno has joined #ruby
juanpablo_ has joined #ruby
leat1 has quit [Remote host closed the connection]
dopamean_ has quit [Ping timeout: 252 seconds]
leat1 has joined #ruby
mary5030 has quit [Ping timeout: 246 seconds]
jas02 has joined #ruby
khebbie has quit [Remote host closed the connection]
miguelff has joined #ruby
bentanweihao has joined #ruby
megagigawatt has quit [Remote host closed the connection]
jas02 has quit [Client Quit]
jas02 has joined #ruby
Pupeno has quit [Ping timeout: 246 seconds]
<jhass>
apeiros: ignore mices, complete help vampire, got a +b from #RubyOnRails from it
leat1 has quit [Ping timeout: 240 seconds]
hashrocket has joined #ruby
baroquebobcat has joined #ruby
chills42 has joined #ruby
towski_ has joined #ruby
CHVNX has left #ruby [":)"]
jas02 has quit [Ping timeout: 240 seconds]
oo_ has joined #ruby
<apeiros>
jhass: yeah, I remembered baweaver complaining. I was actually quite curios :)
baroquebobcat has quit [Ping timeout: 240 seconds]
codenapp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
* adaedra
pokes the channel
vipaca has joined #ruby
vipaca has quit [Max SendQ exceeded]
krz has quit [Ping timeout: 240 seconds]
bruno- has quit [Ping timeout: 256 seconds]
MichaelSmith has joined #ruby
* jhass
imagines 1000 people poking adaedra back
skade has quit [Quit: Computer has gone to sleep.]
SenpaiSilver_ has joined #ruby
pawnbox has quit [Ping timeout: 246 seconds]
<adaedra>
How horrifying
dasher00 has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
Igorshp has joined #ruby
ozz has quit [Quit: Lost terminal]
SenpaiSilver_ has quit [Client Quit]
pawnbox has joined #ruby
SenpaiSilver_ has joined #ruby
<Lovich>
hey
<[k->
hey
<adaedra>
hej
<Lovich>
will any of you non-gender-specific people help me with something
Igorshp has quit [Remote host closed the connection]
krisquigley has quit [Remote host closed the connection]
dede__ has quit [Quit: Connection closed for inactivity]
* adaedra
tries its new mind-reading powers to guess what is the problem
<bazbing80>
Burgestrand: just wondering, how can a module be already initialized when you call it?
momomomomo has quit [Client Quit]
<gregf_>
the calculation changes based on something like even and odd numbers in the set?
<Burgestrand>
bazbing80: What do you mean?
<karapetyan>
i have a probably bad idea make overcoded version. Where i will have duplicates, store it in hash, and then make uniq! but it's probably not best solution.
<gregf_>
if ( even ){ (n+n+1) 1 ) } else { n+1 n-1 1 }
<[k-_>
Ox0dea: tell me what's wrong with the given code link above
<Ox0dea>
[k-_: karapetyan's Gist?
webguynow has quit [Ping timeout: 260 seconds]
<karapetyan>
Ox0dea: yes.
<karapetyan>
already sent it ^^
<[k-_>
indeed
webguynow has joined #ruby
<[k-_>
gregf: wouldn't 2 1 1 1 → 3 1 1 then?
<Ox0dea>
[k-_: I suspect ?xy.
<karapetyan>
[k-_: oh, there comment: if i make decomposition for 5 there will never be 2 + 2 + 1 in this case
David27 has joined #ruby
<[k-_>
it's the rabbit problem!
radgeRayden_ has joined #ruby
CustosL1men has quit [Ping timeout: 240 seconds]
<bazbing80>
Burgestrand: I worked it out, no worries :P thanks again
dopamean_ has quit [Ping timeout: 256 seconds]
tatsuo has quit [Quit: Leaving...]
<[k-_>
karapetyan: gist the whole process of adding again
<clebrun>
how do you update a single hash value and have it return the whole mutated hash? for example, have foo[:bar] = 1 return { bar: 1 } with the rest of foo.
<WajidKagzi>
well suffice it to say i didnt get hired, hehe
<pontiki>
you find yourself in a circular room. go to the corner.
<Ox0dea>
clebrun: Use the #tap method.
dmolina has quit [Quit: Leaving.]
<WajidKagzi>
how would you go about it 0x0dea
<clebrun>
0x0dea: thanks, I'll look into it
paulcsmith has joined #ruby
SCHAAP137 has joined #ruby
Rurik has quit [Read error: Connection reset by peer]
chipotle has joined #ruby
ndrei has joined #ruby
fantazo has joined #ruby
<shevy>
hey he called you 0x0dea :)
<clebrun>
i'll put it up here if I work it out
<clebrun>
got it
casadei_ has joined #ruby
<clebrun>
foo.tap { |self| self[:baz] = 1 }
<clebrun>
haha
amoeba` has left #ruby [#ruby]
<clebrun>
sneaky sneaky. just reinstalled irssi and for some reason tab completion for names isn't working
<clebrun>
just assumed it was 0x
<Ox0dea>
clebrun: It would be if it were permitted. Sorry for the confusion.
<clebrun>
it's all good, thanks for the tip
amargherio has joined #ruby
<Ox0dea>
WajidKagzi: Do you promise you're not trying to cheat on your homework?
<clebrun>
btw just in case anyone else wants to use this, I'm using this to mutate hashes for testing.
<shevy>
mutant hashes!
<clebrun>
so fixture = factory.tap { |self| insert_incorrect_data(self) }
<clebrun>
having that on 2 lines bugged the sh*t out of me
leat1 has quit [Ping timeout: 264 seconds]
dima__ has quit [Quit: This computer has gone to sleep]
<Ox0dea>
clebrun: Best not to use `self` as a variable name, mind.
<dorei>
clebrun: aint hashes mutable by default?
Rurik has joined #ruby
Rurik has joined #ruby
howdoicomputer has joined #ruby
tkuchiki has joined #ruby
<Ox0dea>
dorei: Yes, but clebrun wants to do his mutating on a single line.
<dorei>
why 'in' is a keyword in ruby? :(
amoeba` has joined #ruby
<Ox0dea>
dorei: `for i in (1..10)`
<dorei>
is anyone using for? :O
<clebrun>
Ox0dea: normally wouldn't, but for illustrative purposes
<Ox0dea>
clebrun: Hm?
<dorei>
in is a really good name for variables, now i have to resort to names as _in or input
stan has quit [Ping timeout: 244 seconds]
<clebrun>
Ox0dea: use self as a var
crimsonskies has joined #ruby
<crimsonskies>
hi
<crimsonskies>
what do you remember about math?
<Ox0dea>
clebrun: Well, because `self` tends to mean something very different in Ruby, and you oughtn't shadow it needlessly.
nettoweb has joined #ruby
marius has joined #ruby
tkuchiki has quit [Ping timeout: 250 seconds]
<clebrun>
Ox0dea: true, true
<clebrun>
crimsonskies: almost nothing except that 2+2=5 and I love big brother
<Ox0dea>
clebrun: It's unlikely to bite you in so limited a scope as a block, but probably best avoided nonetheless.
shinnya has quit [Ping timeout: 250 seconds]
<clebrun>
O also that might be confusing because your dealing with self inside a block, so wouldn't self be tap anyway?
<clebrun>
Ox0dea: tab completion ^
<WajidKagzi>
hahaha OxOdea
<WajidKagzi>
funny guy
<Ox0dea>
WajidKagzi: I think you probably are. :P
<WajidKagzi>
i wish
<WajidKagzi>
nah im a junior dev learning my ways around emberjs
<Ox0dea>
WajidKagzi: You wish you were trying to cheat on your homework?
webguynow has quit [Ping timeout: 240 seconds]
pwnd_nfsw has quit [Ping timeout: 246 seconds]
<WajidKagzi>
i wish i was still in high school
n008f4g_ has joined #ruby
webguynow has joined #ruby
<gregf_>
haha
Igorshp has quit [Remote host closed the connection]
lkba has joined #ruby
<eam>
WajidKagzi: no problem, go to a community college
<clebrun>
not greendale tho
<gregf_>
Ox0dea: and a guy :/. i thought g**s? was kinda banned on here :/
dumdedum has quit [Quit: foo]
<WajidKagzi>
hahha
saddad has joined #ruby
<WajidKagzi>
i will figure it out on my own
<gregf_>
WajidKagzi: whats your actual question tho'?
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gregf_>
Ox0dea: how can you use while?
Jardayn has joined #ruby
* [k-
emergency rescues Ox0dea
<Ox0dea>
Danke, [k-.
<gregf_>
warum?
<[k->
gregf_, in this case, that was not exclusion, unless Ox0dea doesn't think of himself as a guy
<[k->
that would be mislabelling then
krisquigley has joined #ruby
<Ox0dea>
WajidKagzi: Do you understand how it works?
ramfjord has joined #ruby
karapetyan has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Ping timeout: 246 seconds]
Zai00 has quit [Quit: Zai00]
crimsonskies has quit [Ping timeout: 246 seconds]
da3mian has quit [Quit: Leaving]
skade has joined #ruby
khebbie has joined #ruby
miguelff has quit [Quit: miguelff]
<moeabdol>
in rspec3 how to check if two arrays have the same elements in the same order?
Rurik has quit [Read error: Connection reset by peer]
Rurik has joined #ruby
Rurik has quit [Changing host]
Rurik has joined #ruby
shadoi has joined #ruby
khebbie has quit [Remote host closed the connection]
leat1 has joined #ruby
eminencehc has quit [Remote host closed the connection]
<Ox0dea>
moeabdol: That's how equality is defined for Arrays.
Guest50 has joined #ruby
hanmac has quit [Ping timeout: 246 seconds]
iateadonut has quit [Quit: Leaving.]
jschoolcraft has quit [Quit: peace]
<moeabdol>
Ox0dea: so i simple expect(array1).to eq(array2)
webguynow has quit [Ping timeout: 240 seconds]
WajidKagzi has quit [Ping timeout: 272 seconds]
webguynow has joined #ruby
FernandoBasso1 has joined #ruby
karapetyan has joined #ruby
stamina has quit [Quit: WeeChat 1.3]
prestorium has joined #ruby
lsmola has quit [Ping timeout: 244 seconds]
gwendall has joined #ruby
devoldmx has joined #ruby
FernandoBasso has quit [Ping timeout: 255 seconds]
WajidKagzi has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
chipotle_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
podman has joined #ruby
<Ox0dea>
WajidKagzi: Please confirm that you have learned.
mhib has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
leat1 has quit [Remote host closed the connection]
petricore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
Clear conscience (Y/n)?
leat1 has joined #ruby
dmolina has joined #ruby
fgo has quit [Quit: WeeChat 1.1.1]
pandaant has quit [Remote host closed the connection]
TheRinger has quit [Quit: Konversation terminated!]
hostess_ is now known as hostess
marius has quit [Ping timeout: 240 seconds]
cih has quit [Remote host closed the connection]
webguynow has quit [Ping timeout: 250 seconds]
hanmac has joined #ruby
greenarrow has joined #ruby
webguynow has joined #ruby
ndrei has joined #ruby
f4cl3y has quit [Ping timeout: 246 seconds]
chipotle has joined #ruby
cisco has joined #ruby
sshuff is now known as sshuff|gone
chipotle_ has quit [Read error: Connection reset by peer]
towski_ has joined #ruby
andyrs has joined #ruby
dmolina has quit [Quit: Leaving.]
eminencehc has joined #ruby
amargherio has quit [Ping timeout: 244 seconds]
andyrs has quit [Client Quit]
andyrs has joined #ruby
sdwrage_ has quit [Quit: Leaving]
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
ht__ has joined #ruby
postmodern has joined #ruby
kobain has quit [Ping timeout: 250 seconds]
casadei_ has quit [Ping timeout: 246 seconds]
ndrei has quit [Ping timeout: 250 seconds]
cvtsx has joined #ruby
krisquigley has quit [Remote host closed the connection]
amargherio has joined #ruby
<WajidKagzi>
oh cool
<WajidKagzi>
thnk you 0x0dae
<WajidKagzi>
oxdea
<WajidKagzi>
ugh, 0x0dea
aswen has joined #ruby
da3mian has joined #ruby
BlackCoyote has joined #ruby
<shevy>
lol
SenpaiSilver has quit [Quit: Leaving]
<shevy>
thanks OxOdea
radgeRayden_ has quit [Ping timeout: 265 seconds]
siemprefresco has joined #ruby
I has joined #ruby
BlackCoyote has quit [Read error: Connection reset by peer]
I is now known as Guest92969
karapetyan has quit [Remote host closed the connection]
butch128 has joined #ruby
butch128 has left #ruby [#ruby]
butch128 has joined #ruby
amargherio has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 272 seconds]
danieli has joined #ruby
karapetyan has joined #ruby
Igorshp has quit [Remote host closed the connection]
<butch128>
There is a function call in activerecord... .order(mycol: :desc) - if i wanted to call with these parameters dynamically.. how would I do this? .order(myvar: myvar2) doesn't work
<adaedra>
.order ({ myvar => myvar2 })
<butch128>
ahh, is that all it is? a hash?
<butch128>
thanks!
s2013 has joined #ruby
<adaedra>
yep, you're actually using a syntaxic sugar for generating a hash
<Ox0dea>
And adaedra showed you how to salt it.
<adaedra>
also, forget the silly space I added before the (
<Ox0dea>
And the curly braces.
<adaedra>
Derp
<adaedra>
Ox0dea: hungry?
<Ox0dea>
adaedra: Superfluous curly braces are syntactic salt, I think.
<adaedra>
I don't know why I thought them to be compulsory there
<Ox0dea>
In your defense, that the final argument can be an implicit Hash is a little strange.
<Ox0dea>
Might even be unique to Ruby?
<adaedra>
it's nice to use, but yes, a bit strange indeed
kobain has joined #ruby
eminencehc has quit [Remote host closed the connection]
cvtsx1 has joined #ruby
<adaedra>
and now that you can mix them with labelled parameters...
eminencehc has joined #ruby
siemprefresco has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mhib has quit [Ping timeout: 272 seconds]
cvtsx has quit [Ping timeout: 240 seconds]
petricore has joined #ruby
senayar has joined #ruby
nateberkopec has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
aaeron has joined #ruby
petricore has quit [Client Quit]
fostertheweb has quit [Ping timeout: 250 seconds]
drewvanstone has joined #ruby
Beoran has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cvtsx has joined #ruby
howdoicomputer has quit [Ping timeout: 272 seconds]
cvtsx1 has quit [Ping timeout: 246 seconds]
mhib has joined #ruby
havenwood has joined #ruby
aaeron has quit [Quit: Leaving.]
dionysus69 has joined #ruby
siemprefresco has joined #ruby
rdark has quit [Quit: leaving]
webguynow has quit [Ping timeout: 246 seconds]
webguynow has joined #ruby
kgirthofer has quit [Remote host closed the connection]
nofxx has joined #ruby
s2013 has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
<shevy>
keep it simple people
bruno- has quit [Ping timeout: 264 seconds]
<butch128>
+1
darkf has quit [Quit: Leaving]
cvtsx1 has joined #ruby
pwnd_nfsw has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
<shevy>
it has ranked higher on github before but that was when it had less competition among github and github-based projects
sixty4k_ has quit [Max SendQ exceeded]
chipotle has quit [Read error: Connection reset by peer]
beauby has quit [Ping timeout: 264 seconds]
suchness has quit [Remote host closed the connection]
<karapetyan>
shevy: ok :) well, than it's good news. More ruby - projects mean more job for ruby developers :) And if developer can write on ruby it's one more reason to be happy)
ramfjord has joined #ruby
Pupeno has quit [Remote host closed the connection]
baweaver has joined #ruby
maletor has joined #ruby
allomov has quit [Ping timeout: 265 seconds]
karapetyan has quit [Remote host closed the connection]
<shevy>
php ranks before ruby
joshyjosh_ has joined #ruby
WajidKagzi has quit [Ping timeout: 264 seconds]
<butch128>
php... my day job... ruby... my fun (job)
<butch128>
i hate php
<butch128>
no hate is strong... i do not enjoy using it
<tobiasvl>
i hate php too
Musashi007 has joined #ruby
<joshyjosh_>
Ruby not that good career wise?
<tobiasvl>
installed python flask on my webserver and broke routing to my old php site
<tobiasvl>
I could probably fix it
<tobiasvl>
but
howdoicomputer has joined #ruby
<tobiasvl>
I'll just scrap it all
<butch128>
naw, tons of headhunters contact for ruby... but none pay the same
<shevy>
what are the rhel people doing? using python?
<joshyjosh_>
rhel?
<joshyjosh_>
scratch that googled it
otacon- has quit [Ping timeout: 260 seconds]
<centrx>
yeah everyone knows PHP rulez
Lumio has joined #ruby
WajidKagzi has joined #ruby
howdoicomputer has quit [Ping timeout: 255 seconds]
<wmoxam>
meh, you can get shit done with pretty much anything. Just use what you enjoy and forget about what everyone else uses :p
<shevy>
perl is declining wmoxam
<eam>
shevy: in relative or absolute terms?
bluOxigen has quit [Ping timeout: 260 seconds]
joshyjosh has joined #ruby
cih has joined #ruby
<eam>
I don't think *any* language is declining in absolute terms
<wmoxam>
shevy: meh
<wmoxam>
people get stuff done with it
<shevy>
eam yeah, absolute is hard to say, but relatively for sure
<wmoxam>
and some really enjoy it. Yay!
pragmatism has joined #ruby
The_Phoenix has joined #ruby
yfeldblum has joined #ruby
<nofxx>
github is getting flooded with Go too nowdays
<nofxx>
never touched
chipotle has joined #ruby
baweaver has quit [Remote host closed the connection]
<shevy>
I guess we'll have to wait with Go until something really big is written in it
The_Phoenix has quit [Client Quit]
WajidKagzi has quit [Ping timeout: 240 seconds]
symm- has joined #ruby
sampc has quit [Read error: Connection reset by peer]
cih has quit [Ping timeout: 256 seconds]
<joshyjosh_>
where would one go for rake error questions? Been doing the "Learn Ruby the Hard Way" guide adn been having trouble with testing code.
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
banjara has joined #ruby
freezevee has joined #ruby
Guest92969 has quit [Quit: Leaving]
shinnya has joined #ruby
dopie has joined #ruby
WajidKagzi has joined #ruby
beauby has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruby-lang600 has joined #ruby
<ruby-lang600>
Hello there
<shevy>
joshyjosh_ you could try here, not everyone knows a lot about rake though
<nofxx>
shevy, which is sad, rake is so nice. Could have more love.
Musashi007 has quit [Quit: Musashi007]
chipotle has quit [Read error: Connection reset by peer]
aaeron has quit [Quit: Leaving.]
havenwood has quit [Ping timeout: 246 seconds]
<ruby-lang600>
hey guys
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dorei>
i have this alias for bash, alias rake='bundle exec `which rake`'
aaeron has joined #ruby
<ruby-lang600>
could anyone spare a couple of minutes to help me out please?
chipotle has joined #ruby
s2013 has joined #ruby
<nofxx>
dorei, add ruby bin on your LOAD_PATH
<nofxx>
dorei, ~/.gem/ruby/x.x.x/bin
<dorei>
hmm, which rake isnt needed
<nofxx>
ruby-lang600, just ask
<dorei>
i'm removing the which from my alis
<dorei>
alias
<ruby-lang600>
ok
<nofxx>
dorei, yup, will be not. That actually won't work anyways. (if it's not on your load_path)
aaeron has quit [Client Quit]
<ruby-lang600>
just a brief context: today i enrolled myself in a startup incubation program
tomaz_b has joined #ruby
<ruby-lang600>
and I have 11 weeks to develop a web application
<ruby-lang600>
which I intend to do in RoR
Zai00 has quit [Quit: Zai00]
kirun has joined #ruby
<dorei>
nofxx: i'm using rvm, so if it's not in my load_path, then something is wrong
<ruby-lang600>
I started this monday and have been struggling to get the basics the last 3 days
<ruby-lang600>
I can already perform basic tasks like getting input from users, parsing info and storing in database
bougyman has quit [Ping timeout: 256 seconds]
<ruby-lang600>
but for the rest of the week I would like to give some attention to the layout
UtkarshRay has quit [Quit: Leaving]
andyrs has quit [Quit: gone to sleep. ZZZzzz…]
<ruby-lang600>
i have no experience in bootstrap
Zai00 has joined #ruby
<ruby-lang600>
and i am in doubt whether to buy a bootstrap theme and go from there
drager has left #ruby [#ruby]
<nofxx>
dorei, Ah can't help, sorry. Don't use and recommend against rvm.
<ruby-lang600>
i found one template which i really like but doesn't user LESS or SSAS
<dorei>
nofxx: rvm is awesome :)
<ruby-lang600>
so my first question is where should i start to grasp into the basics of building the web front for my app?
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<nofxx>
dorei, the software might be. The reason to use it nil.
mhib has quit [Read error: Connection reset by peer]
<nofxx>
ruby-lang600, not sure right channel here. More like backend talk here. Anyways, there's plenty of css2sass converters
money2burn is now known as speakingcode
havenwood has joined #ruby
segfalt has quit [Ping timeout: 240 seconds]
krisquigley has joined #ruby
<ruby-lang600>
which channel should i go for some assistance?
<ruby-lang600>
i just installed colloquy so..
segfalt has joined #ruby
<nofxx>
Good question. Dunno what's the css channel on freenode. ruby-lang600 check the channel search
Musashi007 has joined #ruby
aaeron has joined #ruby
jas02 has joined #ruby
xfbs has joined #ruby
otacon- has joined #ruby
sampc has joined #ruby
dfockler has quit [Remote host closed the connection]
andyrs has joined #ruby
Rurik has quit [Read error: Connection reset by peer]
Rurik has joined #ruby
Rurik has quit [Changing host]
Rurik has joined #ruby
krisquigley has quit [Ping timeout: 264 seconds]
jahpereira has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
<jahpereira>
hey there
centrx has quit [Quit: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."]
<jahpereira>
could someone spare a couple of minutes to give me a hand?
<jahpereira>
i have been learning ruby for the last couple of days
Guest50 has joined #ruby
<jahpereira>
and now i am struggling to get the front end of my web app
<wasamasa>
we're all waiting for the actual question
<jahpereira>
but have no clue where to start
<jahpereira>
i have no experience in bootstrap
jas02 has quit [Ping timeout: 265 seconds]
<jahpereira>
with bootstrap*
jdawgaz has joined #ruby
<jahpereira>
so my question is whether u recommend me to buy an existing bootstrap template and try to glue it to my controllers (already did some stuff there)
<jahpereira>
or how should i start to understand how bootstrap templates (or others) work with ruby?
urubuz has joined #ruby
ruby-lang600 has quit [Quit: Page closed]
eminencehc has quit [Remote host closed the connection]
<jgt1>
how do I access an instance variable of a parent class?
shortdudey123 has quit [Ping timeout: 250 seconds]
<wasamasa>
jgt1: buy?
<wasamasa>
err, jahpereira
<jgt1>
:P
<wasamasa>
jahpereira: you can buy bootstrap templates?
<jahpereira>
you mean if i have financial conditions to do that
<Ox0dea>
jgt1: foo.superclass.instance_variable_get, but there's no way that's what you actually want.
<wasamasa>
jahpereira: no, I did assume so far that you download bootstrap to not have to pay for pretty decent base styling
shortdudey123 has joined #ruby
<wasamasa>
jahpereira: so this sounds very foreign to me
<jgt1>
Ox0dea: yeah, that doesn't sound right
<jahpereira>
hum
senayar has quit [Remote host closed the connection]
<Ox0dea>
jgt1: Are you sure you want to muck about in some other object's instance variables?
<jahpereira>
i saw some examples which used bootstrap
<wasamasa>
you know, the one you get when hitting the download button on http://getbootstrap.com/
<jahpereira>
these are free?
<joshyjosh_>
ayup
<jahpereira>
oh they aren't
<jahpereira>
just clicked on one
<wasamasa>
I did just notice their other themes aren't free either
<wasamasa>
oh well
shortdudey123 has quit [Ping timeout: 246 seconds]
<jahpereira>
lol
xfbs has joined #ruby
<wasamasa>
so, if you don't want to design yourself or shell out some money, the default theme is pretty fine to get something basic going
Pupeno has joined #ruby
WajidKagzi has quit [Ping timeout: 265 seconds]
<wasamasa>
heck, it shouldn't matter at all if you're learning
nofxx has quit [Ping timeout: 240 seconds]
SOLDIERz has joined #ruby
<wasamasa>
so, your question was about where to start?
siemprefresco has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rurik has quit [Read error: Connection reset by peer]
siemprefresco has joined #ruby
Rurik has joined #ruby
skullcrasher has quit [Remote host closed the connection]
nofxx has joined #ruby
Igorshp has joined #ruby
<wasamasa>
well, set up your application, add the css and js to wherever it belongs, tweak the views to make use of the css classes and js blingbling
<wasamasa>
you shouldn't spend most of your time with this
shortdudey123 has joined #ruby
jackjackdripper has joined #ruby
aswen has quit [Ping timeout: 260 seconds]
clebrun has quit [Quit: leaving]
bruno- has joined #ruby
aaeron has quit [Quit: Leaving.]
shortdudey123 has quit [Excess Flood]
<jahpereira>
hum
<jahpereira>
sorry for the delay
<jahpereira>
actually the second link i shared had free tempaltes
<jahpereira>
just got a cool navigation bar
shortdudey123 has joined #ruby
<jahpereira>
:D
jackjackdripper has quit [Client Quit]
xfbs has quit []
jackjackdripper has joined #ruby
platzhirsch has left #ruby [#ruby]
xfbs has joined #ruby
aaeron has joined #ruby
<jahpereira>
hum
<jahpereira>
but reading the readme file donest give my any clue that this can be used with rails
chipotle has quit [Read error: Connection reset by peer]
Zai00 has quit [Quit: Zai00]
khebbie has joined #ruby
BLuEGoD has quit [Remote host closed the connection]
miguelff has joined #ruby
khebbie has quit [Remote host closed the connection]
beauby has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 250 seconds]
chipotle has joined #ruby
<wasamasa>
I'd be concerned if it couldn't
youngbaks has joined #ruby
<jahpereira>
hum
<wasamasa>
apparently you're pretty new to this
BLuEGoD has joined #ruby
<wasamasa>
web development covers quite a lot of bases, so please don't forget practicing the basics of everything
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
siemprefresco has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
havenwood has quit [Ping timeout: 265 seconds]
decoponio has quit [Quit: Leaving...]
WajidKagzi has joined #ruby
elperdut has joined #ruby
<jahpereira>
i will
<jahpereira>
just rusty that’s all
<jahpereira>
last time i worked with a MVC framework
<jahpereira>
was 7 years ago with cake php
miguelff has quit [Quit: miguelff]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wasamasa>
ok then
<pipework>
Did it make you fat and give you diabetes?
dfockler has joined #ruby
<jahpereira>
noep
<wasamasa>
I've met quite a few PHP folks who had to relearn everything they thought they knew about web development
<wasamasa>
always funny
<jahpereira>
:)
<wasamasa>
"What do you mean, you can write code that doesn't make your eyes bleed?"
<jahpereira>
ahahaha
<jahpereira>
yoep, ruby seems quite intuitibe
<adaedra>
"What do you mean, you don't need to install Apache to run an application"
<jahpereira>
intuitive*
<pipework>
"How do I set up ruby with apache?" "Don't. A+ easy"
<wasamasa>
well, it's less intuitive and more that you actually have a chance of just taking any rails project and customizing it to fulfil that pet peeve you've got
<wasamasa>
it's an amazing feeling
jhooker has joined #ruby
sgambino has quit [Read error: Connection reset by peer]
<jahpereira>
i see
<wasamasa>
if I tried doing that with wordpress, oh well, better not
<jahpereira>
alright
beauby has joined #ruby
<jahpereira>
i will try railsforzombies for the next couple of hours
<jahpereira>
to relax a bit
weemsledeux has joined #ruby
<pipework>
jahpereira: Ruby also isn't riddled with preserving backwards compatible security problems.
<shaman42_>
lets not argue about what programming language is the best, every language has it uses.
<wasamasa>
jahpereira: try the rails channel, too
<Ox0dea>
shaman42_: When should I use brainfuck?
<pipework>
shaman42_: Some are just best left to the trash bin.
<jahpereira>
cool
<pipework>
Ox0dea: When 90% of your keyboard doesn't work.
<shevy>
ruby is best
<jahpereira>
thank you @wasamasa
<wasamasa>
Ox0dea: design of cutting edge compilers/interpreters
<shaman42_>
for example php, best is when you were in 2003
<wasamasa>
Ox0dea: I wish I was kidding
<Ox0dea>
Well, shit. That's two decent answers.
<Ox0dea>
wasamasa: Nah, it actually makes sense.
<wasamasa>
Ox0dea: I've seen two blog posts on the topic and it was nice that you could comprehend them for a change
baweaver has joined #ruby
<pipework>
Brainfuck++ is nice if you need networking and only have your 10-digit keypad handy
chipotle has quit [Read error: Connection reset by peer]
skade has quit [Quit: Computer has gone to sleep.]
<Ox0dea>
This one looks really good.
chipotle has joined #ruby
<foobar121>
So I found a job description that requires the ideal candidate to be able to process tens of billions of "combinations" per second. Am I living under a rock or is this impossible?
<pipework>
foobar121: I think they just mean someone with a brain that functions.
platzhirsch has joined #ruby
* wasamasa
gasps
Musashi007 has quit [Quit: Musashi007]
<joshyjosh_>
friggin a gotta get that brain process-o-meter
<foobar121>
I was assuming they meant "be able to write a program that does this", not "be able to do this with your brain"
skade has joined #ruby
<foobar121>
but even so, i'm pretty sure the fastest processor in the world is only like 8.5Ghz
<shevy>
>> x = 'abc'; x.lchop
<ruboto>
shevy # => undefined method `lchop' for "abc":String (NoMethodError) ...check link for more (https://eval.in/434532)
kadoppe has quit [Ping timeout: 250 seconds]
<Ox0dea>
shevy: You want #ltrim there.
<shevy>
hmm... we have .chop; do we have a method that chops on the left side?
<shevy>
aha!
<Ox0dea>
Or not.
<Ox0dea>
:(
<joshyjosh_>
aight i got that rake error:
<joshyjosh_>
Command failed with status (1): [ruby -I"lib:tests" "/home/[username]/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb" "tests/test_NAME.rb" ]
<Ox0dea>
shevy: #lstrip.
jenrzzz has joined #ruby
<Ox0dea>
Mind, #chop and #strip do different things.
<shevy>
ah well
<shevy>
I was so excited when .lchop worked in irb... then I realized, I added it :(
<Ox0dea>
You need to remove a newline from the left...?
skade has quit [Client Quit]
<Ox0dea>
Oh, sorry; I'm thinking of #chomp.
<shevy>
nah, just chop off leading characters; I have a lot of code where I do things like: x[0,1] == '' if x[0,0] == 'A'
<shevy>
and other code like: x[0,0] = 'abc' - the latter ones I can replace via .prepend
<Ox0dea>
But... all of these methods take an argument.
siemprefresco has joined #ruby
<Ox0dea>
I lied.
<shevy>
I even used to have things like: x[-'abc'.size,'abc'.size'] == 'abc' or something like that... until I found out that we have .start_with? and .end_with?
kadoppe has joined #ruby
<Ox0dea>
That reminds me of using [min, foo, max].sort[1] to clamp.
foobar121 has quit [Quit: Leaving]
eminencehc has joined #ruby
youngbaks has quit [Quit: WeeChat 1.3]
gix has joined #ruby
dc_ has joined #ruby
dc_ has quit [Remote host closed the connection]
WajidKagzi has quit [Ping timeout: 255 seconds]
andyrs has quit [Read error: Connection reset by peer]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bougyman has joined #ruby
apt-get has joined #ruby
isabelle has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
apt-get_ has quit [Ping timeout: 246 seconds]
<wasamasa>
Ox0dea: wat
radgeRayden has joined #ruby
<Ox0dea>
wasamasa: For limiting a value to some range?
postmodern has quit [Remote host closed the connection]
cornerma1 has joined #ruby
radgeRayden has quit [Ping timeout: 246 seconds]
radgeRayden has joined #ruby
<havenn>
joshyjosh_: Where are you looking? In-person or remote or either?
mikelodeon has joined #ruby
krz has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
xfbs has joined #ruby
<pipework>
joshyjosh_: Almost invariably, be really charismatic, quick to say that you don't know but can know in short order, and to have github projects.
s2013 has joined #ruby
jhooker has joined #ruby
cornerman has quit [Ping timeout: 265 seconds]
cornerma1 is now known as cornerman
miguelff has quit [Ping timeout: 255 seconds]
<joshyjosh_>
id go for either, but prefer local, kinda see how a dev team works.
s2013 has quit [Read error: Connection reset by peer]
<joshyjosh_>
hmm, should get some projects going for github. need something other than a to-do list
postmodern has joined #ruby
<eam>
joshyjosh_: contribute to someone else's project, something people would recognize in an interview
<ytti>
starting is PITA
<eam>
if you can't think of anything to add/fix, write docs
<ytti>
should make some personal rules
<ytti>
that every day you write code for 1h
<ytti>
no exceptions
<eam>
well, no uncaught exceptions
mikelodeon has quit [Ping timeout: 250 seconds]
t3rm has joined #ruby
miguelff has joined #ruby
<joshyjosh_>
kidna am doing the 1 hour+ a day code thing. Problem is i've been diving alot into books and not into projects themselves. Guess next big thing is getting to better grips with github.
Oka has joined #ruby
radgeRayden has quit [Ping timeout: 246 seconds]
St1gma has quit [Ping timeout: 250 seconds]
andyrs has quit [Quit: I'm leaving now, bye.]
Rickmasta has joined #ruby
zero_drool has joined #ruby
<havenn>
joshyjosh_: Where is local for you?
eminencehc has quit [Remote host closed the connection]
<joshyjosh_>
Slovenia, Ljubljana
paulcsmith has quit [Ping timeout: 240 seconds]
moeabdol1 has joined #ruby
rakm has joined #ruby
<joshyjosh_>
could travel round the country a bit though
tejasmanohar has joined #ruby
moeabdol has quit [Ping timeout: 240 seconds]
eminencehc has joined #ruby
n_blownapart has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
miguelff has quit [Quit: miguelff]
nateberkopec has quit [Quit: Leaving...]
gp5st has joined #ruby
sampc has left #ruby ["Saliendo"]
beauby has quit [Ping timeout: 240 seconds]
<gp5st>
is there a well-known dataframes implementation like R's or Pandas (Python)?
sepp2k has joined #ruby
nateberkopec has joined #ruby
<gp5st>
(I know libraries exist, but I don't know how common, stable, or well-used they are)
<gp5st>
I've recently started using ipython and it's quite nice
WajidKagzi has quit [Ping timeout: 255 seconds]
butch128 has left #ruby [#ruby]
twodayslate has joined #ruby
<gp5st>
sadly Ruby and I lost our passion when I was hired to work on a rails app that made me cry. I would like to spend some time to see what's changed, as this was at the 1.8-1.9 era
<twodayslate>
does alias_method run no matter what?
<Ox0dea>
twodayslate: What do you suppose might stop it from doing so?
<twodayslate>
if I have an if statement surround it Ox0dea
WajidKagzi has joined #ruby
renderf__ has joined #ruby
<twodayslate>
nevermind
<Ox0dea>
twodayslate: Nothing runs in the conditional branch that doesn't get taken.
sixty4k_ has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
karapetyan has quit [Remote host closed the connection]
chipotle has joined #ruby
<twodayslate>
how do I prevent alias_method from running twice?
<eam>
it's also weird that the rvalue is a syntax error if expressed as its own statement
<eam>
>> *1
<ruboto>
eam # => /tmp/execpad-1fa7b97bdddd/source-1fa7b97bdddd:2: syntax error, unexpected '\n', expecting :: or '[' ...check link for more (https://eval.in/434635)
<eam>
in what other languages is such a thing true?
davedev24 has quit [Ping timeout: 246 seconds]
<eam>
I can't think of any C rvalue expressions which are errors when expressed alone
<dfockler>
>> y = *(2..10) #nice for building an array
s2013 has quit [Read error: Connection reset by peer]
victortyau has quit [Quit: Leaving]
<dfockler>
Ox0dea: thanks for leading me to discover the Method class :)
minimalism has joined #ruby
xfbs has quit [Client Quit]
jenrzzz_ has joined #ruby
bigbadbear has quit [Ping timeout: 250 seconds]
drewvanstone has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MasterPiece has joined #ruby
otisZart has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
k3asd` has quit [Ping timeout: 252 seconds]
baweaver has quit [Remote host closed the connection]
Beoran has joined #ruby
nkts has joined #ruby
apt-get has quit [Remote host closed the connection]
Luun has quit [Quit: Luun]
<Ox0dea>
dfockler: Sure thing. :)
<Ox0dea>
I trust you took note of that massive disparity in method counts back there?
freezevee has quit [Ping timeout: 250 seconds]
elfuego has quit [Quit: elfuego]
nanoz has quit [Ping timeout: 250 seconds]
mary5030 has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
<Ox0dea>
Eh, you did say that you can use Ranges like Enumerables, not Arrays, so never mind.
xfbs has joined #ruby
<Ox0dea>
That Range doesn't have #product bites me now and again.
<cschneid_>
are there guides out there for writing & using the ruby internals for a gem? I'm looking at stackprof and would like to make it thread-aware. But that would mean understanding much more of the internals of the ruby vm
Azure has joined #ruby
<Ox0dea>
cschneid_: Ruby Under a Microscope.
Igorshp has quit [Remote host closed the connection]
<cschneid_>
Ox0dea: that'd help me understand the current vm? and hence understand how threading happens & how I can exploit it to get what I want? :)
<Ox0dea>
cschneid_: It's a deep dive into many of MRI's internals, yes.
drewvanstone has quit [Ping timeout: 272 seconds]
dima_ has joined #ruby
xfbs has quit [Client Quit]
Rickmasta has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
ndrei has quit [Ping timeout: 265 seconds]
kirun has quit [Quit: Client exiting]
chipotle has joined #ruby
kies^ has quit [Ping timeout: 252 seconds]
ndrei has joined #ruby
s2013 has joined #ruby
baweaver has joined #ruby
Hrorek has joined #ruby
naftilos76 has quit [Quit: Αποχώρησε]
drewvanstone has joined #ruby
Rurik has quit [Read error: Connection reset by peer]
ndrei has quit [Remote host closed the connection]
beauby has joined #ruby
ndrei has joined #ruby
havenwood has joined #ruby
Hrorek has quit [Read error: Connection reset by peer]
petricore has joined #ruby
Rurik has joined #ruby
petricore has quit [Client Quit]
s2013 has quit [Read error: Connection reset by peer]
drewvanstone has quit [Ping timeout: 272 seconds]
gwendall has joined #ruby
whippythellama has quit [Quit: WeeChat 1.3]
ndrei has quit [Ping timeout: 265 seconds]
ndrei has joined #ruby
platzhirsch has quit [Ping timeout: 240 seconds]
s2013 has joined #ruby
zero_drool has quit [Ping timeout: 246 seconds]
northfurr has quit [Quit: northfurr]
Zai00 has quit [Quit: Zai00]
ndrei has quit [Ping timeout: 244 seconds]
yardenbar has quit [Ping timeout: 240 seconds]
jenrzzz_ has quit [Ping timeout: 250 seconds]
ndrei has joined #ruby
havenwood has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
Balzrael has quit [Quit: Leaving]
karapetyan has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
drewvanstone has joined #ruby
northfurr has joined #ruby
n_blownapart has quit []
bayed has quit [Quit: Connection closed for inactivity]
polishdub has quit [Quit: Leaving]
karapetyan has quit [Ping timeout: 255 seconds]
s2013 has quit [Read error: Connection reset by peer]
chipotle has joined #ruby
tomaz_b has quit [Ping timeout: 250 seconds]
leksster has quit [Remote host closed the connection]
[k- has quit [Ping timeout: 265 seconds]
PaulCapestany has quit [Quit: .]
northfurr has quit [Quit: northfurr]
<jackjackdripper>
I'm trying to maintain indentation by using string = q{} is there a way i can insert a variable inside {}?
<ej89>
I'm trying to re-implement the Enumerable API for a class project.
<Ox0dea>
pragmatism: Both of those operators serve exactly one purpose; what're you on about?
<shevy>
tockitj if you have to handle user input sure
<tockitj>
i know about duck principle.. but yet testing for number of methods could be more work than just testing for class
<ej89>
However, for whatever reason, after the first re-defined method, all the others are being ignored.
<Ox0dea>
ej89: Post code?
<dorei>
shevy: type checking is really painful in ruby
<eam>
siaw: I think rounding is built into printf - what you'll probably want to do is truncate your number before giving it to printf
bentanweihao has joined #ruby
<tockitj>
shevy, user input? i am thinking about something like static-like typing for parameters
<ej89>
That is, my test cases (which exercise all the Enumerable API methods) are always calling the library implementations...except for the first redefined method, which *does* call my method.
<Ox0dea>
siaw: Even better, don't use floating point for money.
<ej89>
0x0dea: just a sec...
<Ox0dea>
tockitj: Wrong language.
<dfockler>
haha
<siaw>
Ox0dea: what should i use? BigDecimal?
<pragmatism>
Ox0dea huh? === is defined on a per-class basis.
<tockitj>
0x0dea?
<Ox0dea>
pragmatism: Yes, but it's only used for case equality.
<tockitj>
dfockler, you want method to behave correctly even if it is handling bad input, right?
<ej89>
@0x0dea: it includes two .rb files. The first is my implementation of Enumerable (right now it just contains two methods). The second contains unit tests for all the Enumerable methods.
<shevy>
for a moment I confused dorei with dfockler :)
<tockitj>
breaking arbitrarily just because passed object does not respond to given message is problem - you want to raise argument exception in that case, no?
<Ox0dea>
Look near the bottom for the demonstration of what's going on.
<tockitj>
shevy, that is bad programming no?
<Ox0dea>
We *can* overload methods in Ruby, but we really ought not to.
spider-mario has quit [Remote host closed the connection]
<ej89>
The first redefined method (.all?) is working fine in the unit tests - I can confirm that my version of .all? is being called by the unit test. (The test fails when I switch the true to false.)
eminencehc has quit [Remote host closed the connection]
p0wn3d_ has joined #ruby
<ej89>
But the second one, .any?, isn't called - instead, the unit test is apparently calling the library version.
<dorei>
ruby is so open to monkey patching that you can never make assumptions about how a class behaves
<tockitj>
Ox0dea, i do not see point of that snippet
chipotle has quit [Read error: Connection reset by peer]
<ej89>
I can't see what I did differently between the two...
<tockitj>
dorei, that is plain silly
eminencehc has joined #ruby
bruno- has joined #ruby
<tockitj>
and please do not assume that i do not understand what monkey patching is
<dfockler>
>> (1.9999 * 100).floor / 100.0 #this is gross
<ej89>
I had some more substantial code in .any? earlier, but it wasn't working, so I changed to to simply "return true" to see if I could get it working at all.
<Ox0dea>
Array gets its #all? method from Enumerable, but #any? is optimized specifically for Arrays.
pushpak has joined #ruby
pushpak has quit [Client Quit]
<ej89>
Ah, I see. So I need to separately override #any?
p0wn3d_ has quit [Ping timeout: 264 seconds]
<tockitj>
dorei, i know ruby feels comfortable with any object that quacks like a duck - but are you just going to take a given object and assume that it full fills arbitrary non-specified conditions
<shevy>
Ox0dea do you happen to know if a regex can have another encoding than US_ASCII?
<tockitj>
that can be derived only from code itself
<ej89>
0x0dea: Well, the unit tests were originally written to use Enumerable (to test the tests)...the idea is to use my Enumerable implementations as a drop-in replacement. If that's possible, that is.
<tockitj>
ej89, why are you replacing Enumerable?
<ej89>
tockitj: It's for a class assignment. I'm supposed to re-implement most of Enumerable's public API functions.
baweaver has quit [Remote host closed the connection]
<shevy>
Ox0dea hmm oh... you mean it is possible via Regexp.new(), rather than the // regex literal?
<tockitj>
ook? simply implement them in your own mixin
<Ox0dea>
shevy: Right.
<shevy>
I see
drewvanstone has quit [Ping timeout: 246 seconds]
chino_ has joined #ruby
<tockitj>
ej89, assignment is certainly not to *replace* Enumerable - I can assure you that
<tockitj>
though it is not hard to do either.. you can just go through ObjectSpace find objects that inherit Enumerable and include your own mixin on top of them
<ej89>
tockitj: Right...my thinking there was that it would make it easier to test, by avoiding having to manually change all the method calls in my unit tests from ".some_method" to ".my_some_method".
<chino_>
is there any debugging tools that can hook into an *existing* ruby process to perhaps analyze the heap or inject some code so you can debug it?
<Ox0dea>
>> s = 'foo'.encode('ISO-8859-1'); [Regexp.new(s).encoding, Regexp.new(s, 16).encoding] # shevy
<tockitj>
ej89, why are you changing method names? just change mixin name
davedev24 has joined #ruby
<ej89>
tockitj: Oh, how do you do that?
baroquebobcat has quit [Quit: baroquebobcat]
<shevy>
Ox0dea now I am confused
<tockitj>
how long have you been working with ruby ej89 ?
<ej89>
tockitj: About a week. This class is my first exposure to Ruby. :-)
<shevy>
so regexes by default attempt to prefer US-ASCII?
baroquebobcat has joined #ruby
<tockitj>
oh god
<ej89>
tockitj: :-)
<tockitj>
i am not best person to talk to in that case
<Ox0dea>
shevy: Seems so. It's not the worst choice?
petricore has joined #ruby
petricore has quit [Client Quit]
<Ox0dea>
chino_: Sounds pretty masochistic.
<ej89>
tockitj: No problem. Appreciate the help nonetheless!
<shevy>
no idea, I didn't know that there could be differences in encoding, I thought that the # Encoding line would help there but it seems as if they only are valid for string objects in that file
<tockitj>
good luck! be persistent! :)
chipotle has joined #ruby
<Ox0dea>
>> Regexp.new('', 16).encoding # shevy: Last one. :P
<Ox0dea>
drbrain: Any insight as to why there isn't just an 'f' flag for doing what Regexp::FIXEDENCODING does?
Guest50 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BraddPitt>
an initialization vector can safely be posted to the public, right?
<drbrain>
Ox0dea: I haven't poked that much at Regexp
s00pcan has quit [Ping timeout: 252 seconds]
<BraddPitt>
someome knowing your encryption IV won't gain any advantage into cracking your crypto?
<Ox0dea>
BraddPitt: Just make sure it's duper-random.
<BraddPitt>
right
<BraddPitt>
I'm just using OpenSSL stdlib random generator
<BraddPitt>
which (it claims) is random enough
baweaver has joined #ruby
tuxero has quit [Quit: tuxero]
s00pcan has joined #ruby
veg has quit []
baweaver has quit [Remote host closed the connection]
chino_ has quit [Quit: Page closed]
<tockitj>
Ox0dea, Ova is nice hack - I have not read it carefully first time
<Ox0dea>
tockitj: It's brittle as hell by dint of relying on RubyVM::InstructionSequence, but it was fun nonetheless.
<tockitj>
it is
<BraddPitt>
Ox0dea this means that the user needs to remember both the password and the IV they used if they wish to decrypt, right?
ixti has joined #ruby
baweaver has joined #ruby
<Ox0dea>
BraddPitt: Are your users laymen?
tjohnson has quit [Quit: Connection closed for inactivity]
<Ox0dea>
*laypeople
<tockitj>
i like the way ruby can surprise
<BraddPitt>
in what sense, Ox0dea
* baweaver
gives thumbs up to Ox0dea
<BraddPitt>
they are developers
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
BraddPitt: Well, it depends on what exactly you're doing, but no, remembering the IV isn't strictly necessary.
<Ox0dea>
Especially given that it can be derived, should the need arise.
<Ox0dea>
baweaver: I should've caught myself.
Yzguy has joined #ruby
ej89 has left #ruby [#ruby]
eminencehc has quit [Remote host closed the connection]
cajone has joined #ruby
<Ox0dea>
tockitj: Are you familiar with FizzBuzz? ;)
<baweaver>
oh no
<Ox0dea>
(I'm not gonna do it.)
<Ox0dea>
> i like the way ruby can surprise
<Ox0dea>
Tempted as hell, though.
sp4rrow has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eminencehc has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
<BraddPitt>
Ox0dea I'm reading the ruby OpenSSL docs and it says >A new, random IV should be created for every encryption of data
Igorshp has joined #ruby
snockerton has quit [Quit: Leaving.]
Pupeno has quit [Remote host closed the connection]
dopamean_ has quit [Ping timeout: 240 seconds]
WillAmes has quit [Remote host closed the connection]
<[ace]>
BraddPitt: IV is fine to be stored with the ciphertext, commonly as the first block
Igorshp has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
WillAmes has joined #ruby
<tockitj>
Ox0dea, haha
<[ace]>
and yes, every time you encrypt you should use a different IV or you lose the benefit of having an IV
dfockler has quit [Remote host closed the connection]
cih has quit [Remote host closed the connection]
<BraddPitt>
I guess my problem is that now the user needs to remember both password and the IV used to encrypt their data (unless I use a stream cipher)
<BraddPitt>
well
<BraddPitt>
I may have a way around this
<[ace]>
BraddPitt: put it with the ciphertext
<[ace]>
then you don't have that problem
<Ox0dea>
Or salt the seed.
podman has quit [Quit: Connection closed for inactivity]
<BraddPitt>
append it to the resulting ciphertext you mean [ace] ?
<BraddPitt>
or prepend, whatever
<[ace]>
yes
baroquebobcat has quit [Read error: Connection reset by peer]