freezey has quit [Remote host closed the connection]
gwb3 has quit [Remote host closed the connection]
<g0th>
hmm, can I do: @d=(something do |k,v| ..... done).d=
<g0th>
hmm, can I do: @d=(something do |k,v| ..... done).d?
<g0th>
with newlines inside the block/etc
<g0th>
s/done/end/ arg
ColKurtz has joined #ruby
vim_shim has joined #ruby
<bnagy>
yeah, and you don't need the brackets
simoz has quit [Ping timeout: 240 seconds]
twoism has quit [Remote host closed the connection]
<bnagy>
normally I'd use the curly brace block form for that
simoz has joined #ruby
simoz has quit [Read error: Connection reset by peer]
<bnagy>
a = foo.something {|a,b| blah blah blah}.whatever
pleal has quit [Remote host closed the connection]
<g0th>
yeah
<g0th>
but it is several lines
<bnagy>
it's not incredibly common to use multiline blocks with another value at the end though, just cause it's hard to read
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bnagy>
so I would write obj = blah.whatever{|a| etc etc}; a = obj.thing
<bnagy>
with added newlines wherever
<g0th>
hmm can I also do z=Density.new; z=foo.inject(z) {}
<g0th>
?
<bnagy>
yeah
<g0th>
so I can use the inject thingy again?
<g0th>
at the end
<bnagy>
but ew
<g0th>
saves me one variable :)
<bnagy>
like variable names are not a scarce resource
<g0th>
readbility
<g0th>
too many names is confusing
mrsolo has joined #ruby
<bnagy>
uh, no
<g0th>
ok
<bnagy>
single letter variables being reassigned while being operated on is confusing
SkuliOskarsson has joined #ruby
<bnagy>
like z = z.inject(foo) ... I wouldn't mind as much, cause it's a transformation of z
SeySayux has quit [Read error: Operation timed out]
freezey has joined #ruby
<bnagy>
anyways
freezey has quit [Remote host closed the connection]
siwica1 has quit [Ping timeout: 240 seconds]
Nogbit has quit [Quit: Leaving.]
unlikable43 has quit [Ping timeout: 245 seconds]
<g0th>
how do I overload/define delete_if?
Popple has quit [Quit: Computer has gone to sleep.]
<g0th>
resp. how was it done in the source?
<bnagy>
imho, don't
<g0th>
I want my class to have a method for modifying densities
<bnagy>
delete_if is completely basic, either make a method that uses it in a specific way, or just expose it to the user
<g0th>
one of those methods is settings some values to zero probability
<g0th>
I could rename it
<g0th>
but I would like to give it a block or something of that sort that can be used as a condition
<g0th>
how to do that?
<bnagy>
it already takes a block
mary5030 has quit [Remote host closed the connection]
<g0th>
(the condition specifies what elements should be set to zero=
rupee has quit [Quit: Leaving]
<g0th>
yeah but I also want to change the probabilities
Nogbit has joined #ruby
SeySayux has joined #ruby
<g0th>
thats why I want to overload it
mary5030 has joined #ruby
<g0th>
but I can as easily just add another name
<g0th>
that's fine
Popple has joined #ruby
<bnagy>
just look up how to make methods that take blocks
<g0th>
that's my question :)
<g0th>
ok I do some more rtfm
<bnagy>
basically def meth &blk; #do stuff res = yield(something)
<havenwood>
often it is nice to create a new method rather than override the core class method, same benefit but less collision
<bnagy>
yield yields to the user block, can be called with or without a val
<havenwood>
&block block.call or just a yield
<g0th>
do you have a link for that?
tgraham|away is now known as tgraham
<g0th>
documentation
<g0th>
yield + google, sec
<bnagy>
I'm recommending that you read up on it, though, cause it's very core ruby and you'd do well to read a proper thing carefully
nfk has quit [Quit: yawn]
SkuliOskarsson has quit [Quit: Leaving.]
<g0th>
hmm, seems clear for now, thx
<g0th>
I will try it
unlikable43 has joined #ruby
amsi has quit [Quit: Leaving]
<g0th>
yield(@d.select).values.inject(:+)
siwica has joined #ruby
SkuliOskarsson has joined #ruby
<bnagy>
uh
<g0th>
yield(@d.delete_if)
<g0th>
^- core line
<bnagy>
@d.select probably doesn't return what you want
SkuliOskarsson has quit [Client Quit]
<g0th>
it doesn't give the elements in d that satisfy the condition in the argument block?
<g0th>
resp. a new hash with those
<bnagy>
only if you write the block in a weird way
<g0th>
{|k,v| k<=7}
<g0th>
e.g.
ryandeussing has joined #ruby
<bnagy>
@d.select {|item| yield item}
popl has joined #ruby
<bnagy>
think of it as user_block.call( some_val )
<bnagy>
it's probably clearer in this case, since it's a condition block
io_syl has quit []
<bnagy>
if condition_block.call( val ) do_something
wallerdev has joined #ruby
<g0th>
hmm, ok I have to read more
<g0th>
*g*
sectionme has joined #ruby
jonr22 has quit [Ping timeout: 252 seconds]
KobraKao has quit [Ping timeout: 264 seconds]
quoin has joined #ruby
<bnagy>
also, IMHO it's a high bar to clear to satisfy me that you shouldn't just expose your hash - like let the user just blah.d.delete_if {|k,v| ...
jonr22 has joined #ruby
khoury has joined #ruby
sectionme has quit [Ping timeout: 252 seconds]
RichardBaker has quit [Quit: RichardBaker]
ryandeus_ has joined #ruby
Heero has joined #ruby
lukec has quit [Quit: lukec]
tyfighter has quit [Quit: tyfighter]
pwh has quit [Quit: pwh]
burlyscudd has joined #ruby
quoin has quit [Ping timeout: 248 seconds]
<khoury>
Hello anyone working in UK who would like to answer a few questions?
KobraKao has joined #ruby
zeade has quit [Quit: Leaving.]
hamakn has joined #ruby
ryandeussing has quit [Ping timeout: 245 seconds]
hamakn has quit [Read error: Connection reset by peer]
Guest10465 has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
hamakn has joined #ruby
reset has joined #ruby
sarkis has joined #ruby
tgraham is now known as tgraham|away
<g0th>
hmm I am still confused about @d.select {|item| yield item}
<g0th>
doesn't that give something like:
<g0th>
@d.select {|item| {|k,v| k<=7}} ?
<g0th>
arg with item but anyway
burlyscudd has quit [Ping timeout: 256 seconds]
snovak has joined #ruby
<g0th>
@d.select {|item| {|k,v| k<=7}.call(item)} or whatever
<bnagy>
yeah, pretty much
<g0th>
and that makes sense?
<g0th>
hmm
<bnagy>
so if the called block returns true, that's the last value in the block, so that iteration returns true
<bnagy>
which means that item gets selected out of @d
<g0th>
do I have to put |item| or |k,v|
pwh has joined #ruby
kvirani has quit [Remote host closed the connection]
<bnagy>
imagine I wrote truthy in all cases, not true
hogeo has joined #ruby
mxweas has quit [Ping timeout: 248 seconds]
<bnagy>
in the condition block, either, if you're selecting out of a hash
kvirani has joined #ruby
siwica has quit [Ping timeout: 240 seconds]
<bnagy>
cause item would be an array [k,v] and you're not decomposing, but in the condition you're decomposing
<bnagy>
are you using irb yet?
HAKEON_ has joined #ruby
<bnagy>
cause it's a lot quicker and more useful for you just to test this stuss
<ru>
So I am considering ditching extend self in favor of using module_function. I am wondering if there is a generally accepted coding convention for doing module_function. Do you declare this right after you define the method? Do you do a bunch of module_function statements at the very end of the module?
gwb3 has quit [Remote host closed the connection]
<ru>
both seem kind of weird to me. Doesn't quite feel ruby-ish.
Tearan has quit [Quit: Sleepy Badger....]
arussel` has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<bnagy>
don't know - I usually define MyMod.blah as module MyMod; def self.blah
Tearan has joined #ruby
<bnagy>
just so it's explicit :/
dkamioka has quit [Remote host closed the connection]
<bnagy>
you could look through stdlib I guess, see how Base64, Open3 etc do it
<ru>
bnagy: good point. I'll take a peek and see what that yields.
i_s has quit [Remote host closed the connection]
ner0x has quit [Quit: Leaving]
quoin has joined #ruby
Nogbit has joined #ruby
<banisterfiend>
ru what are u trying to achieve
<banisterfiend>
ru: you just want class methods on the module? or you want them to be instance methods as well as class methods bb?
saarinen has quit [Quit: saarinen]
tgraham has joined #ruby
toah has quit [Ping timeout: 240 seconds]
<banisterfiend>
ru cos module_function should be used when u want them as both class *and* instance methods (which is quite a rare thing)
duggiefresh has joined #ruby
scatophage has joined #ruby
<banisterfiend>
ru if u just want to define a block of class methods you can either do what nagg-dogg said or you can wrap normal method definitions (without the self.) inside a class << self block
phantasm66 has joined #ruby
phantasm66 has quit [Client Quit]
burlyscudd has joined #ruby
quoin has quit [Ping timeout: 260 seconds]
ndngvr` has quit [Ping timeout: 245 seconds]
Nogbit has quit [Read error: Operation timed out]
sayan has joined #ruby
jamesaanderson has joined #ruby
i_s has joined #ruby
taternuts has quit []
duggiefresh has quit [Remote host closed the connection]
taternuts has joined #ruby
taternuts has quit [Client Quit]
dodosan has quit [Remote host closed the connection]
alvaro_o has quit [Quit: Ex-Chat]
burlyscudd has quit [Ping timeout: 246 seconds]
seejohnrun has joined #ruby
snovak has joined #ruby
tgraham has quit [Ping timeout: 245 seconds]
noop has joined #ruby
axl_ has joined #ruby
jlebrech has quit [Ping timeout: 246 seconds]
snovak has quit [Ping timeout: 248 seconds]
jlebrech has joined #ruby
duggiefresh has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
mmitchel_ has joined #ruby
dodosan has joined #ruby
mercwithamouth has joined #ruby
ScaredWeems is now known as weems
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
weems has quit [Changing host]
weems has joined #ruby
axl_ has quit [Client Quit]
iamjarvo_ has quit [Remote host closed the connection]
iamjarvo_ has joined #ruby
r0bgl33s0n has quit [Ping timeout: 252 seconds]
iravan has quit [Quit: Leaving.]
kvirani has quit [Remote host closed the connection]
kvirani has joined #ruby
mmitchel_ has quit [Ping timeout: 252 seconds]
ndngvr has joined #ruby
benlieb has joined #ruby
iamjarvo_ has quit [Ping timeout: 245 seconds]
narcan has joined #ruby
ukd1 has quit [Remote host closed the connection]
kvirani has quit [Ping timeout: 248 seconds]
ukd1 has joined #ruby
rahulkmr has joined #ruby
i_s has quit [Remote host closed the connection]
seejohnrun has quit [Ping timeout: 260 seconds]
habib has joined #ruby
aagdbl has joined #ruby
aryaching has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
kil0byte_ has joined #ruby
duggiefr_ has joined #ruby
sectionme has joined #ruby
duggiefresh has quit [Read error: Connection reset by peer]
kil0byte has quit [Ping timeout: 240 seconds]
habib has quit [Quit: habib-gone]
aagdbl has quit [Quit: Leaving.]
sectionme has quit [Ping timeout: 248 seconds]
Michael has joined #ruby
Michael is now known as Guest8737
noop has quit [Ping timeout: 256 seconds]
polaco is now known as polaco_zZz
Emmanuel_Chanel has joined #ruby
PenjaNinguin has joined #ruby
rjhunter has quit [Remote host closed the connection]
Guest8737 has quit [Ping timeout: 245 seconds]
yacks has quit [Quit: Leaving]
habib has joined #ruby
mary5030 has quit [Remote host closed the connection]
Davey has quit [Quit: Computer has gone to sleep.]
duggiefr_ has quit [Read error: Connection reset by peer]
duggiefresh has joined #ruby
kevinykchan has quit [Read error: Connection reset by peer]
Davey has joined #ruby
duggiefr_ has joined #ruby
kevinykchan has joined #ruby
thesheff17 has quit [Ping timeout: 248 seconds]
lta has quit [Ping timeout: 264 seconds]
nanoxd has quit [Quit: nanoxd]
duggiefr_ has quit [Remote host closed the connection]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MrPoT4tO has quit [Remote host closed the connection]
duggiefresh has quit [Ping timeout: 246 seconds]
brupeb has joined #ruby
adeponte has quit [Ping timeout: 268 seconds]
saarinen has joined #ruby
funburn has quit [Read error: Connection reset by peer]
mercwithamouth has quit [Ping timeout: 264 seconds]
murz has joined #ruby
murz has left #ruby [#ruby]
ukd1_ has joined #ruby
lta has joined #ruby
mercwithamouth has joined #ruby
ryandeussing has quit [Remote host closed the connection]
habib has quit [Remote host closed the connection]
funburn has joined #ruby
rahulkmr has quit [Ping timeout: 268 seconds]
ukd1 has quit [Ping timeout: 248 seconds]
chickenf_ has joined #ruby
KobraKao has quit [Quit: Saindo]
v0n has quit [Ping timeout: 256 seconds]
nignaztic has quit [Read error: Connection reset by peer]
ssickle has joined #ruby
zeade has joined #ruby
kevinykchan has quit [Read error: Connection reset by peer]
kevinykc_ has joined #ruby
zeade has quit [Client Quit]
Emmanuel_Chanel has quit [Quit: Leaving]
funburn_ has joined #ruby
chickenf_ has quit [Read error: Connection reset by peer]
quoin has joined #ruby
atno has joined #ruby
funburn has quit [Ping timeout: 252 seconds]
funburn_ is now known as funburn
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Emmanuel_Chanel has joined #ruby
kevinykc_ has quit [Client Quit]
carraroj has joined #ruby
marius has joined #ruby
kevinykchan has joined #ruby
burlyscudd has joined #ruby
gwb3 has joined #ruby
quoin has quit [Ping timeout: 256 seconds]
benlieb has quit [Quit: benlieb]
iliketurtles has joined #ruby
kevinykchan has quit [Read error: Connection reset by peer]
kevinykchan has joined #ruby
tgraham has joined #ruby
xjiujiu has joined #ruby
carraroj has quit [Client Quit]
burlyscudd has quit [Read error: Connection reset by peer]
Nogbit has joined #ruby
gwb3 has quit [Ping timeout: 245 seconds]
iliketurtles has quit [Ping timeout: 246 seconds]
Ox6abe has quit [Remote host closed the connection]
<popl>
zeknox: why would you run code you don't understand?
chicken__ has joined #ruby
<zeknox>
popl: cause if i followed that rule, I would never run any code...
<popl>
but you're asking for help understanding it in #ruby
<popl>
surely you see the irony
<zeknox>
popl: it was a joke yo
chicken__ has quit [Client Quit]
<popl>
zeknox: I missed the emoticon. :)
amacgregor has joined #ruby
<zeknox>
popl: roger that
chickenf_ has quit [Ping timeout: 264 seconds]
<popl>
is the code in that example all the code you're trying to run?
<zeknox>
popl: think i got the fix cause my buddy here... ill keep you posted
<popl>
cool
amacgregor has quit [Ping timeout: 248 seconds]
nbrosnahan has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
mary5030 has quit [Remote host closed the connection]
petey has quit [Remote host closed the connection]
braoru has joined #ruby
b_ has joined #ruby
JimmyNeutron has quit [Quit: Leaving]
lukec has quit [Quit: lukec]
codecop has joined #ruby
duggiefresh has joined #ruby
duggiefresh has quit [Remote host closed the connection]
freezey has quit [Remote host closed the connection]
fgo_ has quit [Remote host closed the connection]
toah has joined #ruby
jonahR has joined #ruby
orangerobot has quit [Quit: Page closed]
maletor has joined #ruby
aagdbl has joined #ruby
__username__ has quit [Ping timeout: 240 seconds]
__userna1 has joined #ruby
schaerli has quit [Remote host closed the connection]
ewnd9 has joined #ruby
iliketurtles has joined #ruby
apeiros has quit [Remote host closed the connection]
fgo_ has joined #ruby
funburn has quit [Ping timeout: 240 seconds]
kil0byte_ has quit [Ping timeout: 264 seconds]
buibex has joined #ruby
aryaching has quit [Ping timeout: 240 seconds]
dlind has quit [Ping timeout: 240 seconds]
T_T has joined #ruby
OdNairy has joined #ruby
tgraham has joined #ruby
popl has quit [Ping timeout: 240 seconds]
burlyscudd has joined #ruby
Asher1 has joined #ruby
Asher1 has quit [Client Quit]
Heero has quit [Ping timeout: 264 seconds]
Asher1 has joined #ruby
Asher has quit [Disconnected by services]
Asher1 is now known as Asher
funburn has joined #ruby
Jetchisel has joined #ruby
ananthakumaran has joined #ruby
mengu has joined #ruby
snovak has joined #ruby
tgraham has quit [Ping timeout: 264 seconds]
tagrudev has joined #ruby
lemonsparrow has quit [Quit: Page closed]
burlyscudd has quit [Ping timeout: 260 seconds]
ylluminate has quit [Quit: Bye!]
snovak has quit [Ping timeout: 252 seconds]
Jetchisel has quit [Ping timeout: 260 seconds]
taptapdan has quit [Quit: taptapdan]
sarkis has quit [Ping timeout: 264 seconds]
dlind has joined #ruby
dash_ has joined #ruby
dodosan has quit [Ping timeout: 256 seconds]
goganchic has joined #ruby
sectionme has joined #ruby
chickenf_ has joined #ruby
dodosan has joined #ruby
choobie has quit [Read error: Connection reset by peer]
scottstamp is now known as zz_scottstamp
sectionme has quit [Ping timeout: 256 seconds]
vishal_ has joined #ruby
xjiujiu has quit [Ping timeout: 248 seconds]
nbrosnahan has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iliketurtles has quit [Quit: zzzzz…..]
toah has quit [Remote host closed the connection]
apeiros has joined #ruby
nbrosnahan has joined #ruby
vishal has quit [Ping timeout: 240 seconds]
goganchi_ has joined #ruby
goganchi_ has quit [Client Quit]
tylersmith has quit [Ping timeout: 256 seconds]
goganchic has quit []
tylersmith has joined #ruby
dodosan has quit [Remote host closed the connection]
jprovazn has joined #ruby
jordan__888 has joined #ruby
<jordan__888>
can i post a question here
<jordan__888>
?
DanKnox is now known as DanKnox_away
mengu has quit [Remote host closed the connection]
popl has joined #ruby
zoee has joined #ruby
brennanMKE has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
__userna1 has quit [Ping timeout: 248 seconds]
goganchic has joined #ruby
dodosan_ has joined #ruby
browndawg has left #ruby [#ruby]
goganchic has quit [Client Quit]
zarubin has joined #ruby
Lewix has quit [Remote host closed the connection]
brupeb has quit [Remote host closed the connection]
goganchic has joined #ruby
ryandeussing has joined #ruby
buibex has quit [Remote host closed the connection]
Elhu has joined #ruby
Elhu has quit [Client Quit]
coderhs has joined #ruby
buibex has joined #ruby
i_s has joined #ruby
browndawg has joined #ruby
brennanMKE has quit [Ping timeout: 248 seconds]
buibex has quit [Remote host closed the connection]
xjiujiu has joined #ruby
T_T has quit [Remote host closed the connection]
weeb1e has joined #ruby
buibex has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
ryandeussing has quit [Ping timeout: 264 seconds]
evelyette_ has joined #ruby
<weeb1e>
Hello everyone, I have a JSON parser encoding issues I am trying to solve. I am parsing a text file containing JSON which is read over http, the chars that are getting messed up are valid windows file names and they show up correctly in my browser (such as ñ)
bricker`1A has quit [Ping timeout: 256 seconds]
noop has joined #ruby
Elhu has joined #ruby
<popl>
weeb1e: if you paste your code to the pastebin URL in the /topic I'm sure someone might be able to help.
mengu has joined #ruby
bricker`LA has joined #ruby
<weeb1e>
popl: Firstly, can you paste the two chars I put in my message back to me, so I can see if this IRC server and your IRC client even supports sending the chars in their correct encoding? Code alone is not going to help, I am using em-http-request to fetch the files contents and using JSON.parse to parse it
Kneferilis has quit [Quit: Leaving]
mercwithamouth has joined #ruby
Kneferilis has joined #ruby
__userna1 has joined #ruby
ayaz has joined #ruby
<weeb1e>
Somehow, after parsing the JSON, those two chars are being turned into either 2 other chars of the incorrect encoding or over 5500 chars of god knows what encoding
<popl>
weeb1e: how is me pasting that going to help you?
maletor has quit [Quit: Computer has gone to sleep.]
<weeb1e>
It would be a start, to know if you (and other people in here) can even see the actual chars I am referring to
<weeb1e>
Or if IRC is breaking their encoding too, in which case there is no point in me referencing them here
<popl>
if you paste it to a gist then that would be irrelevant
<weeb1e>
I'm trying to work out the easiest way to create a test case so that someone can attempt to help me
kazuuu has joined #ruby
<sevenseacat>
i saw ñ
<weeb1e>
Ok, that is the correct encoding
<sevenseacat>
(which is A with something on top, and a plus/minus)
<weeb1e>
I just realized I can reproduce the issue in IRB, which will make things a lot easier, since that way you don't need to request the data from a web page
<weeb1e>
Hopefully you can see what is happening, except it gets a lot worse in some cases, causing those two chars to literally be expanding to about 5800 chars
<sevenseacat>
oh cool. my irc font is a lil' strange so i couldnt make it out
quoin has joined #ruby
<weeb1e>
Does anyone here know how I can go about fixing this issue?
maletor has joined #ruby
aganov has joined #ruby
<sevenseacat>
ruby 2 treats it correctly
<sevenseacat>
what version are you using
<weeb1e>
I need a solution for 1.9.2
<sevenseacat>
ah
<sevenseacat>
i just tested it on my 1.9.3 and it's fine there too
<sevenseacat>
i dont have 1.9.2 installed
__userna1 has quit [Quit: none 0.4.1]
<weeb1e>
I doubt that is correct
<weeb1e>
It could be because I am on windows
<sevenseacat>
quite possibly.
<weeb1e>
This is for an application I have packaged for windows, so I need to find a solution
<apeiros>
but your decision whether you want help or not.
dzhulk has joined #ruby
<weeb1e>
apeiros: I get those chars from inside a json file which is fetched with em-http-request and then parsed with JSON.parse
<weeb1e>
The chars are valid windows file names, but ruby is messing up the encoding
<apeiros>
weeb1e: you get a bunch of bytes, which get interpreted in a certain way
<apeiros>
that's what encodings are. and that's what can cause garbled output - you have bytes which should have a meaning but are interpreted with a different meaning.
snovak has quit [Ping timeout: 264 seconds]
<weeb1e>
Either turning those two chars into the same two I pasted from my testing now, or 5800+ chars which I don't even understand where it is getting those from
<apeiros>
anyway, meeting now.
<weeb1e>
apeiros: I am aware of that, which is why I am here begging for help with this
<apeiros>
just a hint: you're prematurely assigning guilt. that may block you from figuring the cause ("ruby is messing the encoding" - ruby does exactly what you tell it)
<weeb1e>
I have tried stuff and gotten no where, and I know nothing about windows encoding
<popl>
if you were aware of that then you would not have made your previous assertions weeb1e
<weeb1e>
Ok, do you remember how I started off popl?
LMolr has joined #ruby
pwh has quit [Quit: pwh]
<weeb1e>
I said, my browser renders the encoding correctly. Even though the http response has nothing related to encoding
amacgregor has quit [Ping timeout: 248 seconds]
dhruvasagar has quit [Ping timeout: 245 seconds]
<weeb1e>
So the question is, why is ruby using the incorrect encoding, and how am I supposed to guess what the correct encoding is?
<popl>
anyways. change your encoding. try utf-8
<weeb1e>
I have tried.
<popl>
what have you tried?
<weeb1e>
Pretty sure a from encoding is also required, is it not?
dhruvasagar has joined #ruby
row248 has joined #ruby
<weeb1e>
> puts str.encode('utf-16', 'utf-8')
<weeb1e>
ArgumentError: ASCII incompatible string written for text mode IO without encoding conversion: UTF-16
bricker`LA has quit [Ping timeout: 268 seconds]
<weeb1e>
> str.encode('utf-8', 'utf-16')
<weeb1e>
Encoding::InvalidByteSequenceError: ".e" on UTF-16
<weeb1e>
Ok, so going back to the start now with test cases, so that you don't tell me it's my terminal breaking it
dodosan_ has quit [Remote host closed the connection]
<weeb1e>
I don't even... know anymore
<weeb1e>
I can't seem to reproduce this with my own uploaded json file
<popl>
weeb1e: windows is set to cp437. your browser is using something different
<weeb1e>
And I cannot share the file I am using with you
<weeb1e>
This is killing me from the inside
<weeb1e>
The json file I am reading is 2.5MB big, it has almost 20 000 file names and other data in it
<weeb1e>
Only 4 of those 20 000 names have chars with messed up encoding
dhruvasagar has quit [Quit: leaving]
dhruvasagar has joined #ruby
sectionme has joined #ruby
<jrobeson>
windows still doesn't default to utf-8 yet?
<popl>
jrobeson: not as far as I know
Xeago has joined #ruby
<jrobeson>
stupid codepages
<popl>
weeb1e: are you sure the encoding is even messed up? it could just be the way you are seeing it.
<jrobeson>
yep..
<jrobeson>
try opening it up in an editor know to support utf8 ..
<jrobeson>
and/or another browser..
<weeb1e>
popl: It needs to request the files from s3, and gets 404 because the two chars are wrong, then earlier it also tried to write a file to disk with 8500+ "random" chars in place of those two
tonni has joined #ruby
<jrobeson>
man i haven't used windows is so long.. i can't remember any of this
filipe has joined #ruby
<weeb1e>
So yeah, I am very sure that it is messed up.
Trynemjoel has quit [Ping timeout: 245 seconds]
browndawg has left #ruby [#ruby]
<weeb1e>
It is encoding those two chars as \u251C\u2592
Elhu has quit [Quit: Computer has gone to sleep.]
<weeb1e>
Which turns them into ├▒ instead of A±
<popl>
what is?
ianclarksmith has joined #ruby
<weeb1e>
Something :|
<weeb1e>
I am busy tracing it back slowly using the live source, since that is the only way I am able to reproduce it
kizzx2 has joined #ruby
kizzx2 has quit [Max SendQ exceeded]
ianclarksmith has quit [Max SendQ exceeded]
kizzx2 has joined #ruby
h_kon has joined #ruby
cads has quit [Ping timeout: 268 seconds]
adnils has left #ruby ["to infinity and beyond!"]
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
burlyscudd has joined #ruby
sayan has quit [Ping timeout: 252 seconds]
<weeb1e>
My guess is something related to em-http-request
Trynemjoel has joined #ruby
<weeb1e>
And how it handles the encoding of requested URLs
<weeb1e>
No, still looks like a JSON.parse issue
Hanmac has joined #ruby
Kelet has joined #ruby
Kelet has joined #ruby
<weeb1e>
I just pulled those chars out of the returned raw json and they are correctly encoded
mmitchell has joined #ruby
<weeb1e>
So the only thing that happens after that is JSON.parse, and then they turn into ├▒ or worse
<weeb1e>
So I guess it's time to look for a new JSON parser or something
Xeago has quit [Ping timeout: 245 seconds]
kx has quit [Ping timeout: 240 seconds]
<sevenseacat>
i thought you said in a plain string they were still messed up
<sevenseacat>
outside the JSON.parse
burlyscudd has quit [Ping timeout: 268 seconds]
<weeb1e>
In my console, yes
<sevenseacat>
so nothing to do with the JSON.parse?
toah has joined #ruby
<weeb1e>
But I just regex matched the raw json string returned from the http request and they look fine in my console
ahawkins has joined #ruby
<weeb1e>
So unless the regex matching is somehow fixing the encoding, I don't know what to tell you
mmitchell has quit [Ping timeout: 240 seconds]
<weeb1e>
"_spe\xC3\xB1.dds" - _speñ.dds
<weeb1e>
"_spe\u251C\u2592.dds" - _spe├▒.dds
maletor has quit [Quit: Computer has gone to sleep.]
_maes_ has joined #ruby
<weeb1e>
First line is from my regex match before JSON.parse, second is using the parsed object
kx has joined #ruby
amacgregor has joined #ruby
<weeb1e>
So still looks like JSON.parse is messing it up
amacgregor_ has quit [Ping timeout: 248 seconds]
funburn has quit [Quit: funburn]
julweber has joined #ruby
lurch_ has joined #ruby
camilasan has joined #ruby
cads has joined #ruby
<weeb1e>
I can fix the parsed JSON with value.encode('IBM437', 'UTF-8'), so that means JSON.parse is turning the whole thing into UTF-8 when it parses it
zarubin has quit [Ping timeout: 245 seconds]
kaspergrubbe has joined #ruby
<weeb1e>
Surely there should be a way to set the encoding used by JSON.parse...
julweber has quit [Ping timeout: 260 seconds]
kil0byte has joined #ruby
<apeiros>
weeb1e: json is specified to be utf-8
<apeiros>
if your json is not utf-8, it is in fact not json
ehaliewicz has quit [Ping timeout: 264 seconds]
<weeb1e>
apeiros: Great, well now I at least have a proper response for the author of the json source I am reading
<weeb1e>
I will just have to reencode the file names after parsing as a workaround for now
<weeb1e>
Thanks for the help
nomenkun has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
RDash[AW] is now known as RDash
RDash has quit [Changing host]
RDash has joined #ruby
_maes_ has quit [Ping timeout: 268 seconds]
popl has quit [Quit: We must make an idol of our fear, and call it God.]
io_syl has quit []
obs has joined #ruby
<apeiros>
weeb1e: amending what I said: utf-16 and utf-32 are allowed too
relix has joined #ruby
<weeb1e>
apeiros: That doesn't help with the funny chars that are valid in windows file names
<apeiros>
weeb1e: pretty sure those chars are mapped in unicode
quoin has joined #ruby
<weeb1e>
To be fair, it is breaking the JSON spec, and further more, those chars are only in those file names due to some bug with their build system. But it still causes my client to request incorrect URLs and write incorrect file names
<apeiros>
second line in each cell is the unicode codepoint
<weeb1e>
apeiros: They are not mapped to the correct chars
<weeb1e>
As I pointed out in detail above
<apeiros>
yes they are
<apeiros>
that doesn't mean you can display them properly, though.
craigp has joined #ruby
<apeiros>
a) if you erroneously recode them
<apeiros>
b) if your font can't
<apeiros>
c) if your terminal settings are wrong
<weeb1e>
apeiros: Do you realize what you are saying?
<weeb1e>
Because now you are just confusing me all over again
<apeiros>
*sob*, and I'm back at: encoding lectures should be mandatory for all coders
<weeb1e>
I parse the JSON, it messes up the chars. This has nothing to do with displaying
<sevenseacat>
that doesnt mean he's saying anything incorrect
Tearan has quit [Quit: Sleepy Badger....]
<weeb1e>
I wouldn't be displaying anything unless there was an error, which there is because the requested URL is invalid because the two chars are encoded to different chars
<apeiros>
"it messes up"… don't even want to start telling you in how many ways this statement is just wrong :-p
<weeb1e>
apeiros: Please explain to me how your theory is valid, given the above
<apeiros>
weeb1e: there's nothing "theory" about it
<weeb1e>
The issue is extremely simple, and I thought I had a solid explaination, from you. You said the encoding is breaking JSON spec, which I accepted
<weeb1e>
But now you are saying that is not the case...
* apeiros
afk
<weeb1e>
And now instead of explaining better, you leave.
quoin has quit [Ping timeout: 248 seconds]
<weeb1e>
Thanks...
tgraham has joined #ruby
pwh has joined #ruby
<weeb1e>
My proposed workaround will not work, since JSON.parse re-encodes it incorrectly before parsing it
marius has quit [Quit: oh nooo]
<weeb1e>
Which explains how those two chars become over 5500 chars
<weeb1e>
The reencoded JSON is then parsed incorrectly, and values do not end where they should
<ccooke>
... okay, this is odd.
<weeb1e>
So I'm back to being unable to use JSON.parse at all
<weeb1e>
And back to my only solution being trying to find a new JSON parser, which can parse without first re-encoding
<ccooke>
I have a file containing data generated by Marshal.dump - around 900 bytes, and it seems to have the right data in it as binary.
<ccooke>
But when I run Marshal.load on that data, I get back an empty hash
Elhu has joined #ruby
tgraham has quit [Ping timeout: 248 seconds]
wallerdev has quit [Quit: wallerdev]
snovak has joined #ruby
craigp has quit [Quit: craigp]
quoin has joined #ruby
craigp has joined #ruby
<weeb1e>
Alternatively, I could come up with a crazy plan to replace these non UTF-8 chars with tokens before calling JSON.parse and then swap them back again after parsing by recursively walking the parsed object
<weeb1e>
That seem awfully inefficient and terribly hacky, but no one is giving me a better solution.
<sam113101>
where does that json come from
<weeb1e>
sam113101: It is generated by a third party, the chars are in windows file names
julweber has joined #ruby
ephemerian has joined #ruby
snovak has quit [Read error: Operation timed out]
staafl has joined #ruby
pwh has quit [Ping timeout: 268 seconds]
chickenf_ has quit [Quit: Computer has gone to sleep.]
<weeb1e>
Unless someone here can come up with a better solution, or I can think of one within the next few minutes, I am going to have to implement something terrible. I need a working workaround for this issue, and I need to have it implemented very quickly before a bunch of people launch their applications and get errors because windows does not want them to create a file with 8500+ random UTF-8 chars in it
craigp has quit [Remote host closed the connection]
quazimodo has joined #ruby
<weeb1e>
*with 8500+ random UTF-8 chars in the file name
<sevenseacat>
you've gone back and forth so many times on the problem that i no longer have any idea where its coming from.
<sevenseacat>
so i cant help you, sorry.
<weeb1e>
sevenseacat: Well I have managed to pinpoint the exact issue... To sum it up: JSON.parse re-encodes the JSON before parsing it, which breaks the parsing in some messed up way
<sevenseacat>
that sounds incorrect
<weeb1e>
Everything sounds incorrect apparently, which is why I am near giving up on finding a decent solution
<ccooke>
How can a hash have no keys (returned by hash.keys), and yet a lookup hash[:foo] returns data.
<ccooke>
It's my code, and there's no monkey patching of hash.
<sevenseacat>
ccooke: defaults?
<ccooke>
there's no default
quazimodo has quit [Ping timeout: 240 seconds]
<ccooke>
very odd.
jordan__888 has left #ruby [#ruby]
troessner has joined #ruby
<sevenseacat>
weeb1e: do you deploy to a windows server?
<weeb1e>
sevenseacat: Worse, deployment is releasing a packaged windows application
<sevenseacat>
O.O
<weeb1e>
It is a client-side application
<sevenseacat>
oy vey
* sevenseacat
tiptoes away slowly
<weeb1e>
The majority of users are on windows, but some are on linux too
yonahw_ has quit [Quit: No Ping reply in 180 seconds.]
yonahw has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
staafl has quit [Ping timeout: 248 seconds]
<weeb1e>
sevenseacat: So I think I have a somewhat more plausable explaination
<weeb1e>
JSON.parse re-encodes incorrectly, which by itself does not break the JSON structure, but then dumping that badly encoded data back to a new JSON file and parsing that file breaks the structure
tatsuya_o has joined #ruby
ryandeussing has joined #ruby
Jetchisel has joined #ruby
thesheff17 has quit [Ping timeout: 264 seconds]
Dreamer3 has quit [Ping timeout: 240 seconds]
yonahw has quit [Client Quit]
sajjadg has joined #ruby
amacgregor_ has joined #ruby
staafl has joined #ruby
amacgregor__ has joined #ruby
bricker`LA has joined #ruby
yonahw has joined #ruby
hasham2 has joined #ruby
SkuliOskarsson has joined #ruby
rdark has joined #ruby
the_mentat has quit [Ping timeout: 268 seconds]
ryandeussing has quit [Ping timeout: 256 seconds]
tatsuya_o has quit [Ping timeout: 248 seconds]
dayepa has quit [Quit: dayepa]
amacgregor has quit [Ping timeout: 248 seconds]
hasham2 has quit [Quit: Leaving]
allsystemsarego has joined #ruby
thesheff17 has joined #ruby
fridim__ has quit [Ping timeout: 246 seconds]
amacgregor_ has quit [Ping timeout: 252 seconds]
the_mentat has joined #ruby
ewnd9 has quit [Ping timeout: 268 seconds]
<weeb1e>
?> puts [str, JSON.dump([str])]
<weeb1e>
A±
<weeb1e>
["A┬▒"]
<tobiasvl>
>> puts [str, JSON.dump([str])]
<eval-in>
tobiasvl => undefined local variable or method `str' for main:Object (NameError) ... (https://eval.in/51074)
<tobiasvl>
lol. anyway, weeb1e, use eval-in instead of partial pastes from irb
burlyscudd has joined #ruby
<weeb1e>
tobiasvl: I usually try to avoid dealing with encoding stuff over IRC, since the server or bot may mess up the encoding itself
<Hanmac>
json does not work for evalin … for unkwon reason
ghr has joined #ruby
burlyscudd has quit [Ping timeout: 245 seconds]
<clocKwize>
hi
* clocKwize
has a znc on aws
<clocKwize>
its pretty cool
<weeb1e>
Well, now that I know it's the dumping that is breaking the encoding, I could just swap out using JSON for cache storage with another format
<weeb1e>
Still, pretty retarded that JSONs generation breaks encoding
thesheff17 has quit [Ping timeout: 240 seconds]
<Hanmac>
hm it works for me, maybe your ruby is shitty?
<weeb1e>
hanmac: Windows
LMolr has quit [Ping timeout: 245 seconds]
<weeb1e>
If anything it is windows fault, not my ruby
craigp has joined #ruby
craigp has left #ruby [#ruby]
* Hanmac
point and laugh about windows
<sevenseacat>
we worked out a while ago it was nothing to do with ruby and everything to do with windows
enriclluelles has joined #ruby
<flughafen>
sevenseacat: have you tried turning it off and on again?
saarinen has joined #ruby
craigp has joined #ruby
Xeago has joined #ruby
sajjadg has left #ruby ["Leaving..."]
SkuliOskarsson has quit [Quit: Leaving.]
<weeb1e>
I'll try swap JSON.fast_generate out with Marshal
xk_id has joined #ruby
dayepa1 has joined #ruby
gcds has joined #ruby
Anticom has joined #ruby
<flughafen>
morning everybody
<weeb1e>
Morning
<craigp>
morning
evelyette_ has quit [Remote host closed the connection]
evelyette_ has joined #ruby
* Hanmac
grumples *stupid social group reaction*
MJBrune has left #ruby [#ruby]
k610 has joined #ruby
elaptics`away is now known as elaptics
Xeago has quit [Ping timeout: 260 seconds]
<gcds>
Morning
<gcds>
maybe someone know how to make module for gem? like i have general gem and many sub gems which act as plugins?
lkba has quit [Ping timeout: 260 seconds]
jibi has joined #ruby
<gcds>
For e.g. I have data parser and would like to support many data storage modules like redis/mongo and etc so I would like to many for every data storage separate gem
colonolGron has joined #ruby
craigp has quit [Quit: Leaving]
evelyette_ has quit [Remote host closed the connection]
<weeb1e>
Great, Marshal comes with its own issues. marshaled time format differ (TypeError)
evelyette_ has joined #ruby
fgo_ has quit [Remote host closed the connection]
einarj has joined #ruby
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
kobain has quit []
xjiujiu has joined #ruby
riginding has quit [Quit: Changing server]
mistertim has joined #ruby
<apeiros>
weeb1e: sorry, work has priority.
justsee has quit [Ping timeout: 240 seconds]
xk_id has quit [Quit:
<weeb1e>
I didn't mean that as a question or call for help, I have already solved it on my own :)
<apeiros>
great
<apeiros>
I wrote 'afk' so that you at least know that I can't reply
<weeb1e>
If you are referring to earlier, well it's both JSON.parse and JSON.dump that breaks encoding
<weeb1e>
It forces it to UTF-8 which is changes the chars and "breaks" them
craigp has joined #ruby
Kar- has joined #ruby
<weeb1e>
By encoding them back to IBMwhatever after using JSON.parse and changing JSON.fast_generate to Marshal.dump, I think I have solved both issues
noname001 has joined #ruby
chickenf_ has joined #ruby
shredding has joined #ruby
kizzx2 has quit [Quit: Leaving.]
<weeb1e>
Providing I don't run into any further issues, I'll just need to add detection for a json cache file so that it can be automatically removed and rebuilt using Marshal and non-corrupt data
<apeiros>
weeb1e: on the danger of confusing you further - ruby 2's JSON properly recodes the string for me, it doesn't use force_encoding which would break it:
<weeb1e>
But either way, upgrading the ruby version will require a lot more effort, since it is packaged with my deployed windows package and my auto-updater only updates .rb files, not dlls or exes which would be in-use by windows
<apeiros>
what can/will break is if your input string is e.g. IBM437, but labeled as UTF-8 or vice-versa
<apeiros>
I'd assume it works on 1.9 the same. I just didn't switch
rahulkmr has quit [Ping timeout: 260 seconds]
<apeiros>
yepp, same with 1.9.3-p448
<weeb1e>
The input here is definitely .ecoding = IBM437, yet JSON.parse and JSON.fast_generate force it to UTF-8
jonahR has quit [Quit: jonahR]
<apeiros>
weeb1e: what does the pasted code return for you?
<apeiros>
this line: JSON.parse(JSON.dump(["\u2561".encode('IBM437')])).first.unpack("U*")
sjltaylo_ has joined #ruby
joonty_ has quit [Quit: WeeChat 0.4.1]
joonty has joined #ruby
cads has quit [Ping timeout: 246 seconds]
<weeb1e>
Both pastebin'd lines return [9569]
nomenkun has quit [Read error: Operation timed out]
<apeiros>
then I doubt that your ruby version mangles the input
<apeiros>
we could check against the full 256 chars in IBM437…
<weeb1e>
Well, my workaround works...
<Hanmac>
i guess your console is maybe configured wrong …
ayaz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<weeb1e>
@file_hashes = {}; file_hashes.each do |file_name, file_info| @file_hashes[file_name.encode('IBM437', 'UTF-8')] = file_info end
<weeb1e>
hanmac: It has nothing to do with my console, these filenames would not be printed out, they are used to make HTTP requests, which fail with 404 due to the incorrect chars
tgraham has quit [Ping timeout: 240 seconds]
snovak has joined #ruby
<weeb1e>
(file_hashes being the return of JSON.parse)
schaerli has joined #ruby
justsee has joined #ruby
LMolr has joined #ruby
<gcds>
what means * before variable?
<tobiasvl>
splat
predator117 has joined #ruby
<weeb1e>
gcds: * is the splat operator, if the variable is an argument it will consume all arguments in that area, if it is on a array variable it will unpack the array
schaerli has quit [Remote host closed the connection]
<gcds>
mmm :)
<gcds>
so if i want to pass array of arguments to class.new so i should use splat ?
<weeb1e>
hanmac: Not everyone gets to use ruby 2 yet :(
shaunbaker has joined #ruby
<weeb1e>
There are a bunch of features I'm dying to use, but almost all the code I write is for my servers and updating ruby on them is too much effort
predator217 has quit [Ping timeout: 260 seconds]
RTG` has quit [Ping timeout: 240 seconds]
<weeb1e>
I have tons of large platforms running on 1.9.3 on all my servers, so updating is no trivial task
amacgregor has joined #ruby
RTG` has joined #ruby
amacgregor has quit [Read error: Connection reset by peer]
<weeb1e>
gcds: If you haven't guessed from my example, the answer to your question is: yes
<gcds>
>> a = [1,2]; def sum(c,b) puts c + b end; sum(*a);
dross has quit [Read error: Connection reset by peer]
jbpros has quit [Quit: jbpros]
<weeb1e>
Yeah, in most cases I'd use a MongoDB or SQL DB. I don't usually write client-side apps, especially not in ruby
<gcds>
:D
<weeb1e>
But since JSON fails so hard with this for whatever reason, Marshal is a good fit. It even saves on disk space
<weeb1e>
Haha gcds
chickenf_ has joined #ruby
<gcds>
:D
quazimodo has joined #ruby
burlyscudd has joined #ruby
Stalebread has joined #ruby
row248 has quit [Read error: Connection reset by peer]
quoin has quit [Remote host closed the connection]
dross has joined #ruby
amacgregor_ has joined #ruby
eka has joined #ruby
mistertim has quit [Quit: mistertim]
leehambley has quit [Ping timeout: 245 seconds]
amacgregor__ has joined #ruby
dross has quit [Client Quit]
<gcds>
Hmm if I have in the master gem OptionParser and in sub gem which adds additional functionality to master gem how would I get additional opts from option parser inside sub gem?
burlyscudd has quit [Ping timeout: 248 seconds]
<gcds>
just start new optionparse ?
amacgregor has quit [Ping timeout: 252 seconds]
vim_shim has quit [Ping timeout: 252 seconds]
jbpros has joined #ruby
leehambley has joined #ruby
noop has joined #ruby
funburn has quit [Quit: funburn]
amacgregor_ has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Remote host closed the connection]
gyre007 has joined #ruby
jbpros has quit [Client Quit]
siwica has joined #ruby
mistertim has joined #ruby
dross has joined #ruby
nfk has joined #ruby
vlad_starkov has joined #ruby
<shredding>
I want to initialize a hash variable if not set to zero, otherwise count up.
vlad_starkov has quit [Remote host closed the connection]
<weeb1e>
Wouldn't that be +1 hanmac?
<weeb1e>
I'd think Hash.new(-1) may do what he wanted
<Hanmac>
hm maybe
<weeb1e>
shredding: I have no idea what you are trying to do now
<shredding>
What does the 0 or -1?
leonidlm has joined #ruby
quoin has joined #ruby
<weeb1e>
That is the default value for any undefined hash keys which are referenced
apok has quit [Quit: apok]
<shredding>
Ah, that is interesting.
<shredding>
Thanks.
mengu has quit [Remote host closed the connection]
kil0byte has quit [Remote host closed the connection]
claymore has joined #ruby
<weeb1e>
Alternatively, you can also specify a block with Hash.new that is called with |hash, key| when an undefined value is referenced
<weeb1e>
I find that a lot more useful personally
<shredding>
I can not really figure out the syntax.
mengu has joined #ruby
<Hanmac>
weeb1e: but BEWARE … Hashs with default_procs cant be stored in JSON or Marshal anymore
quazimodo has quit [Ping timeout: 260 seconds]
mrsolo has quit [Quit: Leaving]
<weeb1e>
Cool to know I guess, though I stick to simple data for storage
funburn has joined #ruby
<Hanmac>
yeah but maybe you want to store complex data … like an extendable RPG Game
khushildep has quit [Ping timeout: 264 seconds]
tgraham has joined #ruby
zoee has quit [Quit: zoee]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
siwica has quit [Ping timeout: 240 seconds]
sayan has quit [Ping timeout: 240 seconds]
<shredding>
I got it now working, nice.
razi has joined #ruby
roadt has joined #ruby
Nenor has quit [Quit: Nenor]
row has joined #ruby
tgraham has quit [Ping timeout: 248 seconds]
snovak has joined #ruby
amacgregor__ has quit [Ping timeout: 248 seconds]
einarj has quit [Remote host closed the connection]
SkuliOskarsson has joined #ruby
justsee has quit [Ping timeout: 268 seconds]
nari has quit [Ping timeout: 245 seconds]
ephemerian has quit [Quit: Leaving.]
boboc has joined #ruby
boboc has quit [Remote host closed the connection]
ryandeussing has joined #ruby
boboc has joined #ruby
snovak has quit [Ping timeout: 256 seconds]
stoffus has joined #ruby
boboc has quit [Remote host closed the connection]
ryandeussing has quit [Ping timeout: 264 seconds]
ewnd9 has joined #ruby
vince_prignano has joined #ruby
user258467 has joined #ruby
pushpak has joined #ruby
sayan has joined #ruby
siwica has joined #ruby
xjiujiu has quit [Quit: No Ping reply in 180 seconds.]
tziOm has joined #ruby
fgo_ has joined #ruby
xjiujiu has joined #ruby
jprovazn has joined #ruby
einarj has joined #ruby
noname001 has quit [Remote host closed the connection]
<weeb1e>
So it looks like by fixing the encoding on windows with that workaround, I broke my app on linux :)
SkuliOskarsson has quit [Quit: Leaving.]
Stalebread has quit [Quit: Leaving]
noname001 has joined #ruby
Xeago has joined #ruby
fgo_ has quit [Ping timeout: 268 seconds]
pushpak has quit [Read error: Connection reset by peer]
flughafen has quit [Quit: Lost terminal]
dawkirst has quit [Ping timeout: 256 seconds]
tkuchiki has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby
julweber has quit [Read error: Connection reset by peer]
julweber has joined #ruby
noname001 has quit [Remote host closed the connection]
noname001__ has joined #ruby
lkba has joined #ruby
burlyscudd has joined #ruby
SkuliOskarsson has joined #ruby
craigp has quit [Quit: leaving]
LMolr has quit [Ping timeout: 264 seconds]
Guest83492 has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
burlyscudd has quit [Ping timeout: 252 seconds]
sjltaylo_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
siwica has quit [Ping timeout: 264 seconds]
vlad_starkov has joined #ruby
kil0byte has joined #ruby
OdNairy has joined #ruby
dawkirst has joined #ruby
<gcds>
Hmm if I have in the master gem OptionParser and in sub gem which adds additional functionality to master gem how would I get additional opts from option parser inside sub gem?
<gcds>
just start new optionparse ?
chickenf_ has quit [Quit: Computer has gone to sleep.]
mlpinit has joined #ruby
flughafen has joined #ruby
siwica has joined #ruby
<weeb1e>
apeiros: Goddamn encoding
<shevy>
weeb1e encoding is the bane of ruby these days
<apeiros>
told you. mandatory lesson.
<weeb1e>
The behaviour I'm seeing is all over the place
<weeb1e>
Making it really hard to find a solution which will work on linux and windows
<flughafen>
yeah, it's like, totally the bane of ruby...
<weeb1e>
Even .inspect does not work correctly always
<apeiros>
I think you haven't really had a solution. you had a "work around" which was just really "breaking stuff in a funny new way"
quoin has quit [Read error: Connection reset by peer]
quoin has joined #ruby
<weeb1e>
apeiros: .inspect on the default encoding my linux box prints it like puts does on my windows PC after re-encoding back to IBMxxx
mlpinit has quit [Remote host closed the connection]
<apeiros>
weeb1e: use unpack("C*") when in doubt
<weeb1e>
"tree_03_speñ.dds"
toah has quit [Ping timeout: 264 seconds]
<weeb1e>
That is the output of inspect, how that is valid as inspects output I may never understand
amacgregor has joined #ruby
<apeiros>
why should not not be valid?
hasham2 has joined #ruby
<apeiros>
+it
Michael has joined #ruby
<apeiros>
String#inspect prints the string the way you'd have to write it in ruby code.
<weeb1e>
Sigh, this behaviour is just all over the place, I'm sure at least one of more things are bugged but I need it to work everywhere :(
Michael is now known as Guest20699
justsee has joined #ruby
<weeb1e>
I actually have a lot of other important work to get to, but every time I think I've finally solved this, it breaks somewhere else
<apeiros>
weeb1e: start by breaking the problem down. figure out facts. don't work on assumptions.
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
<weeb1e>
I'm ready to start doing all sorts of platform and ruby version detections with custom logic
<apeiros>
I'm pretty sure that's unnecessary and properly analyzing the problem would get you to the solution.
NinjaPenguin_ has joined #ruby
<apeiros>
(and probably faster than those weird-ass-yet-still-breaking workarounds will)
<weeb1e>
apeiros: Even using unpack to dump the chars, how can I be sure my test input is correct if I paste it in terminal?
NinjaPenguin has quit [Read error: Connection reset by peer]
xjiujiu has quit [Read error: Connection reset by peer]
<apeiros>
weeb1e: what's the source of your string?
<weeb1e>
A 2.5MB json file requested over HTTP from the other side of the world
<apeiros>
source as in origin
noop has quit [Ping timeout: 264 seconds]
<apeiros>
good. json *should* be unicode (utf-8, -16, or -32), so lets verify the source first.
<apeiros>
how do you retrieve the file?
<apeiros>
(actual code)
emergion has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
<weeb1e>
Using em-http-request wrapped with multiple layers, and then JSON.parse, so the top level code is meaningless to you
<apeiros>
amazing how you prematurely draw conclusions…
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
if you want help, let me draw the conclusions, ok?
<weeb1e>
I also can't give you the source URL, which makes things even harder
<weeb1e>
Ok.
<apeiros>
that's fine
<shevy>
hmm ... when I get a directory listing with ruby, which attribute would I have to query to find out "youngest file"? i.e. the file I just downloaded
Speed has joined #ruby
<apeiros>
weeb1e: can you intercept the string before you pass it to JSON.parse?
<weeb1e>
I already did when testing earlier, which is how I figured out that it was JSON.parse "breaking" the encoding on windows
dawkirst has quit [Ping timeout: 252 seconds]
<apeiros>
good. did you test what that_json_string.encoding said?
<apeiros>
(before passing it to JSON.parse)
<weeb1e>
Not on multiple platforms, I will test that now quick
<apeiros>
it's sufficient if you test it on one platform where stuff breaks for you
mengu has quit [Remote host closed the connection]
<weeb1e>
#<Encoding:IBM437> on windows, #<Encoding:ASCII-8BIT> on linux
<apeiros>
good. *that* is probably already the source of your issue.
<apeiros>
can you do: .force_encoding('utf-8').valid_encoding? on both?
<weeb1e>
That would break it?
<jrobeson>
shevy, is there a ctime?
<shevy>
weeb1e it would! :D
<jrobeson>
i know there's an mtime, try for a ctime
<shevy>
jrobeson let me try
<weeb1e>
The reason it breaks on windows by default is because JSON.parse forces it to utf-8
<apeiros>
that would check whether the source is actually utf-8 as I assume it is
<apeiros>
weeb1e: it doesn't *force* it to utf-8, it *transcodes* it
<shevy>
jrobeson cool, I think that works ... File.ctime
boxmein has joined #ruby
<apeiros>
weeb1e: and because the source is probably utf-8, but mislabeled as ibm437 (or binary respectively), it breaks.
<jrobeson>
shevy, that was just a guess based what i read on the File docs
<shevy>
hmm... and there is File.ctime and File.mtime
<shevy>
sorry
<shevy>
I mean File.atime
<jrobeson>
yep.. pretty standard :)
<weeb1e>
apeiros: Both platforms say true
<apeiros>
weeb1e: so we verify my assumption that the JSON is actually valid JSON and as such utf-8. and we do that by re-labeling it (force_encoding only sets the "label") as utf-8
<jrobeson>
every languages file access class has such
<jrobeson>
even in php
<apeiros>
weeb1e: try whether you have any breakages if you .force_encoding('utf-8') the string before passing it through JSON.parse
tgraham has joined #ruby
<jrobeson>
apeiros is the smart guy here
<shevy>
hehe
<apeiros>
also check your Encoding.default_external
vlad_starkov has quit [Remote host closed the connection]
<shevy>
add lots of more checks weeb1e :D
Hanmac has quit [Quit: Leaving.]
quazimodo has joined #ruby
<apeiros>
I'd bet it's Encoding:IBM437 on win and Encoding:ASCII-8BIT on linux
r0bgl33s0n has joined #ruby
Hanmac has joined #ruby
freakazoid0223 has quit [Ping timeout: 256 seconds]
senayar has joined #ruby
<evelyette_>
hi
emergion has quit [Read error: Connection reset by peer]
<weeb1e>
apeiros: At first glace that appears to be working
<weeb1e>
*partially speechless*
<evelyette_>
can somebody tell me the difference between: "rails server -e production" and "bundle exex rails server -e production"
D4T has joined #ruby
<apeiros>
evelyette_: the former runs the command 'rails', the latter runs the command 'bundle'
<evelyette_>
apeiros, yes, but the bundle evidently also runs the command rails
<apeiros>
and bundle is a command which lets you run another command with a specific setup of the environment - specifically available gems
tgraham has quit [Ping timeout: 240 seconds]
<weeb1e>
apeiros: Interestingly enough, default is utf-8 on linux :P
<weeb1e>
So you lost half your bet
<apeiros>
weeb1e: too bad
<evelyette_>
so why is it beneficial to run bundle , which runs rails, instead of just running rails in the first place
justsee has quit [Ping timeout: 240 seconds]
freakazoid0223 has joined #ruby
jbpros has joined #ruby
<apeiros>
evelyette_: because it ensures that you have the proper gems in the proper versions
snovak has joined #ruby
<evelyette_>
apeiros, and rails doesn't do that by default?
<apeiros>
plain `rails` will normally do the bundling for you btw.
<apeiros>
that is, if bundler is installed
fgo_ has joined #ruby
<apeiros>
weeb1e: IMO something in your http-get stack is broken
boxmein has quit [Quit: [02:26.00] <Ristovski> mozzarella filofax fadget]
<workmad3>
evelyette_: the 'rails' command will usually make sure the right version of rails is activated, by making sure bundler is set up before doing anything gem-related
<apeiros>
weeb1e: additionally, I'd assume (or hope - since otherwise the stack is even more broken) that the server doesn't send a proper content-type
Elhu has quit [Quit: Computer has gone to sleep.]
dawkirst has joined #ruby
<evelyette_>
workmad3, so it doesn't really matter whether I run rails directly, because it consequently also uses bundle ?
jibi has joined #ruby
<workmad3>
evelyette_: but rails is an exception with that, not the norm... a lot of other commands (such as rake, or rspec) you will generally want to run 'bundle exec <command>' rather than the command directly
noop has joined #ruby
<workmad3>
evelyette_: and I've still sometimes managed to get odd behaviour out of 'rails' with that
<evelyette_>
workmad3, ok thank you
snovak has quit [Ping timeout: 245 seconds]
<weeb1e>
apeiros: Well I've added force_encoding('utf-8') to the JSON parsing of the http request stack, you said JSON is supposed to be that anyway
freakazoid0223 has quit [Ping timeout: 256 seconds]
kaspergrubbe has joined #ruby
<weeb1e>
The json file has no encoding headers, so encoding can't be detected anyway
<weeb1e>
apeiros: It sends the json file as plain/text and even with a .txt extension
<weeb1e>
It's some horrible apache server
<weeb1e>
*text/plain
Guest19968 has quit [Read error: Connection reset by peer]
tvw has joined #ruby
<apeiros>
a horribly configured
<apeiros>
the json file doesn't need an encoding header. the http response does. or should.
<apeiros>
it's not required. but a sane web application will send a correct one.
<weeb1e>
Yeah of cource, but not my server
emergion has joined #ruby
<weeb1e>
Doesn't even have gzip enabled
<apeiros>
shevy: encoding is not the bane of ruby. the bane of our time is that we have different encodings and no means to store the encoding along with the data.
<weeb1e>
incompatible marshal file format (can't be read)
<weeb1e>
format version 4.8 required; 123.34 given (TypeError)
<weeb1e>
Oh well, I highly doubt it was anything other than my SFTP auto syncing
Popple has joined #ruby
<weeb1e>
Probably not something that will happen in production
<weeb1e>
Thanks for the help with the encoding :)
<apeiros>
*shrug*, just telling you what and why I think
pehlert has left #ruby [#ruby]
freakazoid0223 has joined #ruby
<weeb1e>
Yeah well, the only thing that could write to that file other than the apps Marshal.dump is my sftp
<shevy>
now you repeated it about 3 times
<shevy>
I am slowly beginning to believe that it is unrelated to sftp ...
<shevy>
are you sure you checked out all other alternatives? :D
<weeb1e>
Don't mind me, I've been up way too long, and won't be getting any sleep any time soon :(
Xeago has quit [Remote host closed the connection]
<apeiros>
I know that feeling
<weeb1e>
As long as there are no more sneaky encoding issues, I can now move on to even more time critical stuff
<apeiros>
currently trying guarana as energy drink substitute
Xeago has joined #ruby
<weeb1e>
Never had guarana before, don't think you can get it here
<sevenseacat>
guarana is in most energy drinks isnt it
<weeb1e>
I'm trying to cut down on the coffee though, not the best for ones health
<shevy>
guarana? isn't that what birds leave from their behinds?
greengriminal has joined #ruby
<sevenseacat>
thats guano :P
freakazoid0223 has quit [Ping timeout: 245 seconds]
<weeb1e>
lol
<apeiros>
sevenseacat: not in the red bull copies we have here
freakazoid0223 has joined #ruby
shredding has quit [Quit: shredding]
<apeiros>
at least afaik
aagdbl1 has joined #ruby
* apeiros
not an expert by any means
<sevenseacat>
me either, i try to avoid them
nomenkun has joined #ruby
aagdbl1 has quit [Client Quit]
<apeiros>
the only thing I know about energy drinks is that 1 has 100% B6 dose. and since that's metabolized slowly, I got to 4x over normal levels of B6 :)
<workmad3>
I think red bull tends to have taurine and caffeine
<workmad3>
one of the other enegry drinks I used to prefer had guarana in it
<workmad3>
*energy
* flughafen
finds himself drinking too much soda when it's free
Xeago has quit [Ping timeout: 260 seconds]
browndawg has joined #ruby
<workmad3>
I don't drink them anymore though... moved onto coffee
lta has left #ruby ["Leaving"]
* apeiros
only drinks water, milk, energy drink and ethanol
Jdubs has joined #ruby
* flughafen
only drinks diesel
<evelyette_>
hi, when issuing "bundle install", the bundle installs the required gems where the GEM_HOME points to right ?
* sevenseacat
is diet-coke powered
<weeb1e>
apeiros: Oh god - 404
aagdbl has quit [Ping timeout: 260 seconds]
* weeb1e
fetches the box of tissues
<weeb1e>
"_tree_03_speâ”â–’.dds" (status: 404)
<apeiros>
who has filenames like that anyway?!?
<flughafen>
sevenseacat: coke-zero babyyyyyyy!
<weeb1e>
apeiros: The same people who have uncompressed, plain text json without any headers :P
<apeiros>
weeb1e: btw., your "marshal" starts with {" - which looks suspiciously like raw JSON :-p
Jdubs has quit [Remote host closed the connection]
<shevy>
weeb1e exposed!!!
<weeb1e>
apeiros: The marshal dump looks kinda weird, but then again I don't know what marshal is supposed to look like
<shevy>
apeiros I sometimes have problems when using german umlauts in filenames :(
burlyscudd has joined #ruby
funburn has quit [Quit: funburn]
<apeiros>
weeb1e: not too difficult to figure out, how it should look. just use it in your irb/pry
<apeiros>
shevy: you have problems with all kinds non-ascii :-p
<weeb1e>
True, I'm more worried about the encoding causing 404s again though
jbpros has quit [Quit: jbpros]
* flughafen
gets more cooooooke
dash_ has quit [Ping timeout: 264 seconds]
soba has quit [Ping timeout: 245 seconds]
AxonetBE has joined #ruby
hamakn has quit [Remote host closed the connection]
<weeb1e>
apeiros: If you marshal a hash it starts with {
* flughafen
finds it hard to snort liquid coke
<weeb1e>
If it ends with { too, my outdated json cache check is dead in the water
hamakn has joined #ruby
<weeb1e>
*ends with }
<AxonetBE>
if I have a Hash with {:brand => "Apple"} and I know I will have always this format how can I get :brand out of it?
<AxonetBE>
weeb1e: and how to get the key out of it?
<apeiros>
hence - your "marshal" probably is actually unmarshalled json
<apeiros>
AxonetBE: you already *have* the key
<apeiros>
if you have :brand
<weeb1e>
AxonetBE: h.keys or h.each do |key, value|
<sevenseacat>
hash.keys
<apeiros>
or do you mean "how do I get from "Apple" to :brand"?
emergion has quit [Quit: Computer has gone to sleep.]
<apeiros>
h.invert["Apple"] # will fail if different keys have the same value
<AxonetBE>
sevenseacat: Ok thanks
emergion has joined #ruby
Xeago has joined #ruby
<AxonetBE>
And if we have always just 1 key -> value that we pass through a hash to our method is it better to split it an use method_name ( key, value ) instead of method_name ( hash ) ?
hamakn has quit [Ping timeout: 260 seconds]
klaas_ is now known as klaas
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
shredding has quit [Quit: shredding]
<weeb1e>
Fairly sure there are actually no issues at all, good possibility both issues I came across were due to a combination of SFTP syncing and bad internet connectivity
<gcds>
I have gem A and gem B which extends A when in gem a I require B file and then execute a gem i get LoadError
<gcds>
maybe someone knows what I am doing wrong?
<gcds>
LoadError b file not found *
<weeb1e>
Great, I knew saying that would come back to bite me in the ass. I just didn't think it would happen so quickly
<shevy>
hehe
<weeb1e>
And the hunt for the mystical encoding magic continues...
mengu has joined #ruby
shaunbak_ has quit [Remote host closed the connection]
<gcds>
anyone?
PragCypher has quit [Quit: Leaving]
<shevy>
I did not even understand the question gcds
varfoo has joined #ruby
<shevy>
you get a LoadError when a file does not exist usually, like:
<shevy>
#<LoadError: cannot load such file -- foo.rb>
<gcds>
Ok :( I have gem A and gem B (it extends the gem A) in gem A I load gem B file using require and when I do it i get LoadError
VTLob has joined #ruby
<gcds>
maybe because I not load "b" but "a/mods/red" which is in gem B "a/mods/red"
<gcds>
... Now i understood the problem here :DD I should require gem B not file inside it
varfoo has quit [Client Quit]
varfoo has joined #ruby
jrhe has joined #ruby
Domon has quit [Remote host closed the connection]
Bry8Star{T2 has joined #ruby
Domon has joined #ruby
<shevy>
usually when you do require a project, organized in a gem, as in name 'foo', require 'foo' should pull in all the necessary files of that gem-project in proper order
<gcds>
hmm i am lost :(
<shevy>
the simplest rules to follow are best - if in a .rb file you make use of other classes, require those other classes first (respectively, the .rb files in which they reside)
OdNairy has joined #ruby
<shevy>
gcds how do you require precisely?
lurch_ has left #ruby [#ruby]
nari has joined #ruby
<shevy>
you write "I load gem B file" but you don't show the ruby code you use
jamesaanderson has joined #ruby
ryandeussing has joined #ruby
<kke>
i need to process big ass hashes (or trees of mostly string and integer data) and would like to do so without using lots of memory, do you have any recommendations for something else, maybe some binary format with indexes and streaming possibilities?
<gcds>
shevy: I figured out now but I am lost a little bit. If i name gem as extension of another gem how should I load it? simply by a-b ?
siwica has quit [Quit: siwica]
Domon has quit [Ping timeout: 240 seconds]
siwica has joined #ruby
<evelyette_>
hi, how does "bundle install" install application dependencies locally only for the specific application ?
<weeb1e>
apeiros: Any hints as to what I should do about encoding when using CGI::escape?
sectionme has joined #ruby
krz has quit [Quit: krz]
<weeb1e>
The library making the download requests to S3 is clearly screwing up the file names encoding when forming the URL, but forcing its encoding before it calls CGI::escape doesn't seem to help
tgraham has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
ryandeussing has quit [Ping timeout: 240 seconds]
boxmein has joined #ruby
kitak has quit [Remote host closed the connection]
mistertim has quit [Quit: mistertim]
tgraham_ has joined #ruby
tgraham has quit [Ping timeout: 256 seconds]
senayar has quit [Remote host closed the connection]
LMolr has joined #ruby
vince_prignano has quit [Remote host closed the connection]
whitefox has joined #ruby
<gcds>
shevy: fu.... gem extensions loads not like gem-extenion but gem/extension
<gcds>
:DD
buibex has joined #ruby
skaflem has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
jkamenik has joined #ruby
<gcds>
:( still no luck... in irb "beefeater/redis" works perfectly inside gem i get (cannot load such file -- beefeater/redis)
PenjaNinguin has quit [Quit: Page closed]
Popple has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Ping timeout: 264 seconds]
rwsq1 has joined #ruby
jibi has quit [Quit: .]
kaspergrubbe has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
chickenf_ has joined #ruby
whitefox has quit [Quit: Page closed]
chickenf_ has quit [Client Quit]
kitak has joined #ruby
Xeago has joined #ruby
Xeago has quit [Remote host closed the connection]
antulik-afk is now known as antulik
SkuliOskarsson has quit [Quit: SkuliOskarsson]
IceyEC has joined #ruby
kaspergrubbe has joined #ruby
Bira has joined #ruby
vlad_starkov has joined #ruby
persand has quit [Quit: persand]
ldnunes has joined #ruby
browndawg has quit [Read error: Connection reset by peer]
<shevy>
gcds you seem to have a weird setup
<shevy>
gcds first task - locate beefeater/redis
<shevy>
and tell me the path
<apeiros>
weeb1e: sorry, at work again :-/
<gcds>
but why require "beefeater/redis" works in irb and inside "beefeater" gem not
saarinen has quit [Quit: saarinen]
<shevy>
gcds did you locate the file already
<gcds>
yes
<gcds>
minute
<shevy>
one reason I can think of is that you have multiple rubies
<shevy>
but as long as you do not know where it resides, it is kind of useless to speculate further
<g0th>
imagine that this is inside a calculation step of millions of steps
kaspergrubbe has quit [Remote host closed the connection]
pandawarrior has left #ruby [#ruby]
kaspergrubbe has joined #ruby
failshell has quit [Ping timeout: 264 seconds]
<g0th>
before I used .repeated_permutations()
<g0th>
now I want to switch to .repeated_combinations()
ij has joined #ruby
<g0th>
and figure out how many permutations I get in each case
<g0th>
(which drastically reduces the number of steps)
<bean__>
is what hanmac said what you're looking for?
Macaveli has joined #ruby
emergion has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
<g0th>
yes
chichou has quit [Read error: Connection reset by peer]
<g0th>
I think so
<ij>
Some requests are going to HTTPS over HTTPI gem with the aid of Net::HTTP and I want to debug them. That means outer monitoring won't work. Is there any simple way to get all of the i/o traffic Net::HTTP is sending?
chichou has joined #ruby
kvirani has joined #ruby
<bean__>
ij: are you trying to write your own monitoring system?
hamed_r has joined #ruby
<ij>
No, just debugging.
polaco_zZz is now known as polaco
petey has quit [Remote host closed the connection]
schaerli has joined #ruby
<ij>
Aha!, Net::HTTP#set_debug_output
xcfox has joined #ruby
emergion has quit [Client Quit]
MrThePlague has joined #ruby
theRoUS has joined #ruby
obs has quit [Read error: Connection reset by peer]
obs has joined #ruby
momomomomo has joined #ruby
<g0th>
bean__: but hanmac's solution is slow
fmcgeough has joined #ruby
<bean__>
*shrug* you're writing something that you want to be fast in an interpreted language.
colonolGron has joined #ruby
<g0th>
yes?
<nhmood>
Is there a concept of a static class CONSTANT in Ruby?
<g0th>
bean__: which is valid imho
coderhs has joined #ruby
<nhmood>
I know I can have a static class method (class << self) and define static class vars (@@var or @var outside of methods)
<nhmood>
But I can't seem to get a "static" constant working
<g0th>
especially because the interpreted language is slow already
<bean__>
right, so it's not going to be fast.
<bean__>
feel free to implement it in a faster way.
taternuts has quit [Quit: Page closed]
maoko has joined #ruby
xjiujiu has joined #ruby
KobraKao has joined #ruby
snovak has joined #ruby
xjiujiu has quit [Read error: Connection reset by peer]
keen_ has joined #ruby
mansi has joined #ruby
sayan has quit [Ping timeout: 260 seconds]
<g0th>
bean__: how do I get how many entries there are that are equal to "7"?
rahulkmr has quit [Ping timeout: 245 seconds]
<g0th>
(bean__: the whole purpose of switching from permutations to combinations was to make it faster, not slower)
vlad_starkov has quit [Read error: Operation timed out]
mikecmpbll has joined #ruby
mrsolo has joined #ruby
Jetchisel has left #ruby ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
<gcds_>
existensil: I mean not extension but master_gem-extension
burlyscudd has quit [Quit: Leaving.]
havenwood has quit [Remote host closed the connection]
akemrir has joined #ruby
<gcds_>
like extending gem methods
<pontiki>
what?
<pontiki>
you mean extending teh Gem module?
BizarreCake has joined #ruby
sambao21 has joined #ruby
mistertim has quit [Quit: mistertim]
<gcds_>
yes
<pontiki>
same as you would any other module
Targen has joined #ruby
<existensil>
gcds_: yeah, you need to depend on the gem in your gem, then start adding your sub-modules and monkey patches and violently rip apart the master gem you want to extend
<gcds_>
ok, but how to require that gem in main gem ? because I only got it working when specified it in gem file
sarlalian has quit [Ping timeout: 260 seconds]
aganov has quit [Remote host closed the connection]
<existensil>
if its not violent you aren't using enough meta programming
sarkis has joined #ruby
<pontiki>
what do you mean by "main gem"?
<existensil>
gcds_: it should be in your gemname.gemspec file
quoin has quit [Ping timeout: 260 seconds]
<existensil>
then your Gemfile can just have a `gemspec` line in it to pick up that dependency in bundler
<pontiki>
oh golly
<gcds_>
imagine i have the gem which makes authorisation and I want users add sub gems which defines custom datastorage like I have authme gem and many subgems like authme-redis authme-mysql authme-memcached and etc
Stygia has quit [Remote host closed the connection]
Ripp__ has joined #ruby
momomomomo has quit [Quit: momomomomo]
peregrine81 has joined #ruby
<gcds_>
but the problem is that I want to define that subgem by cli option like authme -m redis/mysql/etc
<existensil>
yep, that sounds doable. sounds like a simply gemspec dependency with some sub modules
<pontiki>
sounds like plugins
ij has quit [Ping timeout: 245 seconds]
<gcds_>
if i require it without defining somewhere in gemfile or gemspec it shouts that if doesnt exists
<pontiki>
if it's user-addable, it's not a gemspec thing
<existensil>
that's not how it should be specified. if the "subgems" are actual gems then your users should be specifying them in their Gemfile and maybe in an environment config somewhere
dhruvasagar has quit [Ping timeout: 246 seconds]
<existensil>
if you want command line options then your "subgems" shouldn't really be gems at all but should be included in your main gem as optional modules
freezey has joined #ruby
petey has joined #ruby
<gcds_>
existensil: so you suggest to put everything in main gem? But how people should add own methods ?
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
<pontiki>
PLUG INs
<existensil>
ActiveSupport might be a good example. ActiveSupport includes a few implementations of ActiveSupport::Cache (memory, file_store, mem_cache_store)
<existensil>
if users want more than that, they can either add it to their project, or create their own gem (like redis-store does)
<gcds_>
existensil: I stolen a little bit from it but it doesnt work...
<existensil>
just an example of how your main gem can provide a few concrete implementations, while still providing the flexibility of users adding their own
Nenor has quit [Quit: Nenor]
<gcds_>
ahh sorry I got this working if I include it in gemfile
<gcds_>
but how to get away from it?
ramen_ has joined #ruby
<gcds_>
my gem is only executable
b00stfr3ak has joined #ruby
Clooth has joined #ruby
toah has quit [Read error: Operation timed out]
<existensil>
i'd look at other executable-only gems and see how they handle plugins and such
ahawkins has quit [Quit: leaving]
SkuliOskarsson has quit [Quit: SkuliOskarsson]
<existensil>
maybe check out earthquake
apfelbox has quit [Remote host closed the connection]
<existensil>
only executable-only gem i can think of right now
<tgraham_>
capistrano, rvm-capistrano, whenever
yacks has joined #ruby
ssvo has joined #ruby
<tgraham_>
rvm-capistarno and whenever tie into capistrano to utilize things it provides vi cli.
<gcds_>
earthquake it uses plugins not gems as extensions
toddWork_ has quit [Quit: toddWork_]
kpshek has joined #ruby
<existensil>
right. maybe that makes more sense if your gem is executable only
acrussell has joined #ruby
AxonetBE has joined #ruby
<gcds_>
existensil: but download place in some dir is more work than just gem install gem-plugin
<existensil>
but gem install mygem-extension isn't alone going to help mygem even know that an gem that extends it has been installed
clov3r has quit [Read error: Connection reset by peer]
<gcds_>
existensil: here goes the option which defines which model to use mygem -m extension
<tgraham_>
How are you going to hardcode extensions and still allow your end user to extend things themselves (plugins or gems) that you don't know about?
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<existensil>
that will load their gem and any modifications it makes will be done
clov3r has joined #ruby
<gcds_>
existensil: but it not works if i not specify that gem inside gemfile :(
mistertim has joined #ruby
<tgraham_>
You can optionally require gems based on the options you parse at runtime.
<existensil>
gcds_: it should. is the extension gem not in your path?
Ox6abe has quit [Remote host closed the connection]
<existensil>
check out what's going on with your $LOAD_PATH
<gcds_>
existensil: i get file not found if i require it
<lectrick>
Does "bundle install" do ANYTHING more than "bundle" by itself does?
alup has quit [Quit: Leaving]
toah has joined #ruby
sectionme has quit [Ping timeout: 252 seconds]
<joonty>
lectrick: nope
sepp2k has joined #ruby
ghr has quit [Quit: Computer has gone to sleep.]
twoism has quit [Read error: Connection reset by peer]
twoism has joined #ruby
sayan has joined #ruby
sambao21 has quit [Ping timeout: 256 seconds]
iliketurtles has joined #ruby
johnkary has quit [Quit: @johnkary]
apeiros has quit [Remote host closed the connection]
Nogbit has quit [Quit: Leaving.]
crazymykl has joined #ruby
pwh has quit [Quit: pwh]
Nogbit has joined #ruby
Ox6abe_ has joined #ruby
io_syl has joined #ruby
lilfaf has quit [Remote host closed the connection]
brennanMKE has quit [Remote host closed the connection]
iliketurtles has joined #ruby
blaxter has quit [Quit: KTHXBYE]
sectionme has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<onewheelskyward>
Or Datamapper.
<ramen_>
good choice for a data mapper. :)
<Veejay>
Is there a common idiom in Ruby for "try this method call, if an exception is raised, try again up to N times and then give up?
brennanM_ has joined #ruby
<apeiros>
Veejay: not really. you can use begin/rescue/end with retry and a counter.
ewnd9 has quit [Ping timeout: 256 seconds]
sectionme has quit [Ping timeout: 248 seconds]
OdNairy has joined #ruby
axl_ has joined #ruby
<Veejay>
apeiros: I see thanks
SkuliOskarsson has quit [Ping timeout: 248 seconds]
DanKnox_away is now known as DanKnox
cj3kim_ has joined #ruby
Jdubs has quit [Read error: Connection reset by peer]
julweber has joined #ruby
Es0teric has joined #ruby
s2013 has joined #ruby
Jdubs has joined #ruby
enriclluelles has quit [Remote host closed the connection]
freezey has joined #ruby
troessner has quit [Quit: Leaving]
drim has joined #ruby
petey has quit [Remote host closed the connection]
greenride has joined #ruby
petey has joined #ruby
ramen_ has quit [Quit: Leaving]
gwb3 has quit [Remote host closed the connection]
julweber has quit [Ping timeout: 260 seconds]
<drim>
Im playing with metaclass and wondering why it cannot be set to the class itself ? I have to set it in Object to make it working http://pastebin.com/im3RR0cT
T_T has quit [Remote host closed the connection]
c0rn has joined #ruby
<burlyscudd>
anyone know how to convert an ISO 8601 date w/ format like "20130926T11000000" to a Time or DateTime in Ruby?
<drim>
getting metaclass not defined
xcv has quit [Remote host closed the connection]
kaldrenon has quit [Remote host closed the connection]
RDash is now known as RDash[AW]
Bira has quit [Remote host closed the connection]
kaldrenon has joined #ruby
jb41 has quit [Quit: Lost terminal]
krawchyk_ has joined #ruby
senayar has joined #ruby
Lewix has quit [Remote host closed the connection]
huoxito_ has quit [Read error: Connection reset by peer]
Trazira has quit [Ping timeout: 264 seconds]
huoxito_ has joined #ruby
axl_ has quit [Quit: axl_]
AdmiraI has joined #ruby
xcv has joined #ruby
kaldrenon has quit [Ping timeout: 248 seconds]
iliketurtles has quit [Quit: zzzzz…..]
<Mon_Ouie>
There's no point in defining a metaclass method anymore, we have singleton_class (which is probably the name you should use to refer to them, too)
MrThePlague has quit [Remote host closed the connection]
krawchyk has quit [Ping timeout: 246 seconds]
<Mon_Ouie>
And the error comes from the fact you only define that method for instances of Creature, not for Creature itself
bonhag has joined #ruby
<drim>
you mean not a static method ?
Ripp__ has quit []
<Mon_Ouie>
If you want to define a method called :life on Creature, when self is Creature, all you need to do is define_method(:life) { … }
coderhs has quit [Ping timeout: 256 seconds]
Bira has joined #ruby
hamed_r has quit [Read error: Connection reset by peer]
<Mon_Ouie>
drim: A class method, yes
apok has joined #ruby
<drim>
but why the same code about def metaclass in class Object is working ?
<Mon_Ouie>
Unless you want to define Creature.life, in which case you could use define_singleton_method
<Mon_Ouie>
drim: Because of the weird loops that exist in the Ruby object system. Object.is_a? Object #=> true
Michael is now known as Guest18740
heidi has joined #ruby
pellenation has quit [Quit: Leaving.]
Galgorth has joined #ruby
endash has quit [Quit: endash]
dhruvasagar has joined #ruby
<apeiros>
seems Time::iso8601 is rather picky about which specific format it'll actually parse.
<drim>
Mon_Ouie: sorry I dont get it ?
<apeiros>
burlyscudd: DateTime::strptime is probably your best bet then
JohnBat26 has joined #ruby
toah has quit [Ping timeout: 240 seconds]
<Mon_Ouie>
drim: If you define a method on Object, it becomes available to every instance of Object. But Object is an Object (indeed, an instance of itself). Therefore, Object too gets that method.
<Mon_Ouie>
In the case of Creature, Creature itself is a Class, not *a* Creature. So it doesn't get instance methods from itself.
<burlyscudd>
apeiros: weirdly DateTime.parse will do it. DateTime.iso8601, which is supposed to parse a string, throws an error
<burlyscudd>
apeiros: yeah but it's not complete
lfox has joined #ruby
<drim>
ah I see
<burlyscudd>
apeiros: that's the funny thing — there are a bunch of iso8601 sub formats
<drim>
thank you :-)
brennanM_ has quit [Remote host closed the connection]
<apeiros>
burlyscudd: DateTime::parse is IMO a last-resort-only thing
<burlyscudd>
DateTime#parse handles more than DateTime#iso8601 for some reason
<drim>
so metaclass is not used anymore ?
Trazira has joined #ruby
ipstone has joined #ruby
coderhs has joined #ruby
<burlyscudd>
apeiros: DateTime#strptime also throws ArgumentError: invalid date
Ripp__ has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
ipstone has left #ruby [#ruby]
<Mon_Ouie>
No, simply because singleton_class means you don't have to define it for yourself anymore (and if you mean the term "metaclass", I'd avoid it too, so as to stick with the terms used in the documentation)
cj3kim_ has quit [Remote host closed the connection]
colonolGron has joined #ruby
rdark has quit [Quit: leaving]
<drim>
thanks
rahulkmr1 has joined #ruby
cpruitt has joined #ruby
Galgorth has quit [Ping timeout: 240 seconds]
gwb3 has joined #ruby
rahulkmr has quit [Read error: Operation timed out]
Hanmac has joined #ruby
dhruvasagar has quit [Ping timeout: 245 seconds]
atno is now known as afarazit
<apeiros>
burlyscudd: eh? you did look up how to use it, yes?
kaldrenon has joined #ruby
afarazit is now known as atno
<apeiros>
also it's DateTime::strptime, not #strptime ;-) (latter would be an instance method)
iliketurtles has joined #ruby
fenicks has joined #ruby
jonathanwallace has joined #ruby
siwica has quit [Ping timeout: 260 seconds]
<apeiros>
not sure what your last 2 zeroes are, they seem superfluous…
interactionjaxsn has quit [Remote host closed the connection]
yacks has joined #ruby
interactionjaxsn has joined #ruby
Ripp__ has joined #ruby
nari has quit [Ping timeout: 264 seconds]
fgo_ has quit [Remote host closed the connection]
colonolGron has quit [Ping timeout: 248 seconds]
brennanMKE has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
persand has joined #ruby
persand has quit [Client Quit]
hamakn has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
interactionjaxsn has quit [Ping timeout: 240 seconds]
hamakn has joined #ruby
rumours has joined #ruby
sarlalian has quit [Quit: WeeChat 0.4.1]
petey has quit [Remote host closed the connection]
sarlalian has joined #ruby
Tearan has joined #ruby
<Uranio>
irb (2.0) do not work tab completation :-/ what could I do?
<shevy>
Uranio and it worked for you before?
<shevy>
the completion part should still be at irb/completion, perhaps try: require 'irb/completion' in irb
<Uranio>
for 1.9
<Uranio>
yes
<Uranio>
LoadError: cannot load such file -- readline
<Uranio>
shevy: and there is not such gem
<Uranio>
could be a compilation problem erally?
<Uranio>
really*
iliketurtles has quit [Quit: zzzzz…..]
<shevy>
do you use debian?
Monie has joined #ruby
hamakn has quit [Ping timeout: 248 seconds]
Jdubs has quit [Read error: Connection reset by peer]
<Uranio>
yes
<Uranio>
(unfortunely)
Jdubs has joined #ruby
pwh has quit [Quit: pwh]
Clooth has quit [Quit: Leaving...]
popcornlover has quit [Ping timeout: 256 seconds]
<shevy>
yes, this is typical for debian
<shevy>
I am sorry for you
breakingthings has quit []
DarkAceLaptop has joined #ruby
<apeiros>
Advocation: since he doesn't use the `fmt` variable later on, it's just superfluous. probably a mistake.
<shevy>
in theory there is a way for you to uncripple and install everything through apt-get
<apeiros>
Advocation: and even if he did use the variable later on, it'd still be bad style IMO :)
ixti has joined #ruby
brennanMKE has quit [Ping timeout: 248 seconds]
<shevy>
Uranio on my system, I compile from source, usually first ncurses + readline, then ruby. but you dont have to recompile all of ruby, in ruby's extracted source tarball there is an ext/ directory, and inside is readline/ which has all the bindings. you should be able to run the *.rb there... setup.rb or install.rb, and get it to compile
<shevy>
Uranio alternatively, there must be some sane way on debian to decripple the system but it's best to ask those who crippled the system in the first place. another way might be to use RVM https://rvm.io/ instead. or, as I do, to compile from source :P
<drim>
ok but how do you get for example :life value from Creature ?
<shevy>
but what the intent of this is to combine it with attr_accessor inside a method, I have absolutely no idea. I didn't even know this could work with attr
<drim>
Creature.life returns nil
Clooth has joined #ruby
<shevy>
well, he defined traits
<shevy>
def self.traits( *arr )
chrisja has quit [Quit: leaving]
<shevy>
and he tried to add them dynamically
<shevy>
define_method( a ) do |val|
sethetter has quit [Quit: Lost terminal]
<drim>
yes right, it's a setter
<shevy>
storing in the ivar @traits
<drim>
but how do you retrieve the @traits value ?
geekbri has joined #ruby
acrussell has left #ruby [#ruby]
pushpak_ has joined #ruby
ukd1 has joined #ruby
<shevy>
self.traits()
<shevy>
self.class.traits
<shevy>
^^^ it's an empty call
<shevy>
self.class.traits()
<shevy>
return @traits if arr.empty?
<shevy>
you see that now?
LMolr has joined #ruby
<Uranio>
shevy: I guest that RVM is the best way, thanks
<drim>
yes but how can I do if I want dynamic getter for example ?
<drim>
Creature.life ?
AdmiraI has joined #ruby
<shevy>
define it
burlyscudd has quit [Quit: Leaving.]
<shevy>
class Creature; def self.life; end; end
pushpak has quit [Read error: Connection reset by peer]
<drim>
it's not really dynamic :)
<shevy>
it is if you use define_method
kirun has joined #ruby
pushpak_ has quit [Read error: Connection reset by peer]
<drim>
define_method(a) { return @traits[a]} ?
<shevy>
just write a method that accepts input and pass an array to it
<drim>
guess because im using Creature.life without any parameter
<lessless>
if class has an attr_reader :qunatity, why the bloody hell I need everytime reference to the variable @quantity and can't use plain quantity instead?!
<lessless>
i.e. "#{@quantity}", but not "#{quantity}"
<shevy>
really :qunatity ?
<apeiros>
lessless: why the hell everytime is angry he can't make any meaningful question anymore? :-p
<lessless>
:D
<apeiros>
lessless: paste actual, useful, reproducable code. helps more than raging around
<apeiros>
ugh, missed a "someone" there
<weeb1e>
Can anyone recommend the "lightest weight" GUI framework for ruby? I'm looking for something that can be packaged together with my app without causing it to become 100x the size. I just started installing the green_shoes gem and noticed it needs to install hundreds of MB of gems
<shevy>
weeb1e there is not that much choice, truthfully
Jdubs has quit [Read error: Connection reset by peer]
hanmac1 has joined #ruby
<weeb1e>
shevy: I never realized it was quite so bad
<shevy>
weeb1e pure ruby-gtk bindings alone ... let me see how large that is
<shevy>
weeb1e actually, tell me your size-limit
gen0cide_ has joined #ruby
<shevy>
I think green_shoes is some monster mod
<shevy>
the original shoes was not that big I think
sepp2k has joined #ruby
<Mon_Ouie>
drim: do |val = nil| to have an optional argument
freezey has quit [Remote host closed the connection]
Jdubs has joined #ruby
GoldenGiant has joined #ruby
<weeb1e>
shevy: Well my whole packaged windows app with ruby, 11 gems and their dependencies compress to 7MB
<lessless>
shevy, yeah, problem must be somewhere else :(
DanKnox_away is now known as DanKnox
<gen0cide_>
There is a much heated debate going on in my office right now - I figure such will occur here, but I think it's worth getting public opinion. What do you think the best way to escape/sanitize arguments to execute a shell command inside Ruby?
LMolr has quit [Ping timeout: 245 seconds]
<shevy>
weeb1e well ...
<weeb1e>
shevy: So I've preferably not want to double the apps size for a GUI, but I'm really just looking for the smallest option
<apeiros>
gen0cide_: don't at all. use the proper method instead.
hanmac1 has quit [Read error: Operation timed out]
<popl>
apeiros++
brianpWins has quit [Quit: brianpWins]
<shevy>
rubygnome2-2.0.1.tar.xz: 765K
<apeiros>
gen0cide_: e.g. spawn which accepts array instead and passes the arguments directly. bypassing the shell.
<shevy>
weeb1e, you can extract the ruby-gtk part from it and go under 765
<weeb1e>
shevy: And that will work on windows and linux?
<apeiros>
gen0cide_: but if you MUST escape arguments, use shellwords. stdlib.
<shevy>
weeb1e yes
tvw has joined #ruby
<weeb1e>
shevy: I'll take a look, thanks
<shevy>
weeb1e it looks better on linux though
<weeb1e>
I'm less worried about looks
<shevy>
hehe
<weeb1e>
Hell, I may end up going minimal UI and a tray icon for windows
<weeb1e>
Depending on just how much effort the tray icon will be
brianpWins has joined #ruby
Ahti333 has joined #ruby
<shevy>
ruby-gnome has a tray icon!
<weeb1e>
This is a long running "service" application with only a few options, other than a UI to edit the config file
evelyette_ has quit [Ping timeout: 240 seconds]
<weeb1e>
A tray icon that supports windows too? :O
<drim>
Mon_Ouie: define_method(a) do |val = nil| ?
jmccune has joined #ruby
<weeb1e>
Shoes looked great at first, but I quickly realized it is far from ideal for a packaged solution
<shevy>
there are like +400 examples with ruby-gnome, but you can always get the minimal piece that works, then extend from there
<shevy>
no...
<shevy>
I think there are several versions of shoes
<popl>
can I get the tray icon in cornflower blue?
<Ahti333>
hi! i want to cross compile CRuby, are there any docs about that? I've googled quite a bit, but couldn't find anything
Nogbit has quit [Quit: Leaving.]
<shevy>
popl yeah, it is subclass from Gtk::Window so it must have common set of operations to colourize it all
<weeb1e>
There are, the first one doesn't even have a gem, it needs a exe to be installed on windows
tvw has quit [Client Quit]
greenrose has quit []
<weeb1e>
"green_shoes" is pure ruby, but it downloaded ridiculous amounts when installing the gems
<shevy>
hehe
<shevy>
well
<shevy>
shoes without _why is useless
<shevy>
it should close down
hamakn has quit [Ping timeout: 245 seconds]
tgraham_ is now known as tgraham_|away
tvw has joined #ruby
<weeb1e>
"visualruby" looks cool for building UI for GTK
Guest8047 has quit [Remote host closed the connection]
<Mon_Ouie>
drim: Yes
<drim>
syntax error, unexpected '=',
quoin has joined #ruby
Jdubs has quit [Read error: Connection reset by peer]
arietis has joined #ruby
<Mon_Ouie>
Oh, are you using 1.8 still?
amacgregor has quit [Ping timeout: 248 seconds]
<apeiros>
we should opt to add code to ruby
<Mon_Ouie>
You could use |*args| and check how many arguments were passed
<apeiros>
which includes release dates of specific versions
<drim>
ok
Jdubs has joined #ruby
<apeiros>
and if you run a ruby whose version has been out >5y, it should print a warning "old ruby, get up to speed already!"
<breakingthings>
It should print that warning once for every ruby minor version you are behind.
<apeiros>
heh
DeanH has joined #ruby
DeanH has quit [Max SendQ exceeded]
<shevy>
only if the disclaimer is proper
pushpak has quit [Ping timeout: 248 seconds]
<shevy>
"old ruby, get up to speed already! join up to the latest and greatest and enter the world of painful encoding!"
DeanH has joined #ruby
aef has joined #ruby
<apeiros>
shevy: you know, encoding isn't a ruby issue. if you're so annoyed by it, just force everything to binary.
<apeiros>
gen0cide_: so how's the argument going?
quoin has quit [Ping timeout: 260 seconds]
<shevy>
apeiros you mean "# Encoding: ASCII-8BIT"?
<gen0cide_>
the two sides have decided to create a poc
<apeiros>
shevy: insufficient. but yes, that'd be a start. also, don't use the name "ascii-8bit". that's a horribly name for 'binary'.
<apeiros>
gen0cide_: what do the sides propose?
<apeiros>
and what's a poc? :)
<apeiros>
shevy: Encoding.default_external and .default_internal too. I think the LANG env would have to be set as well.
<gen0cide_>
apeiros: TeamA is what you said, TeamB thinks that an input whitelist regex with a standard %x[] would be "safer"
<shevy>
hmm
dsferreira has joined #ruby
<shevy>
and that will solve my issues
<shevy>
guaranteed ;P
<gen0cide_>
apeiros: going to let them make their PoCs (proof of concepts) then I'm going to try and get a cmd execution
<shevy>
apeiros I'll try it
bonhag has quit [Quit: bonhag]
<shevy>
today I had this problem with kramdown, I will find out what was behind it
einarj has joined #ruby
<apeiros>
gen0cide_: go with both?
<apeiros>
whitelist and pass as arguments
creature has quit [Ping timeout: 246 seconds]
sectionme has joined #ruby
Ox6abe has quit [Remote host closed the connection]
<gen0cide_>
yea
<apeiros>
if you whitelist, you obviously have separate components
huoxito_ has quit [Ping timeout: 245 seconds]
Vivekananda has joined #ruby
creature has joined #ruby
creature has quit [Changing host]
creature has joined #ruby
yekta has quit [Quit: yekta]
Trudko has joined #ruby
gwb3 has quit [Remote host closed the connection]
m8 has joined #ruby
<Trudko>
hi guys i am tryint to import CSV -> http://pastie.org/8360742problem is when my file doesnt have UTF-8 encoding I would like to force it somehow.
tgraham_|away is now known as tgraham_
hamush has joined #ruby
<hamush>
hi, does anyone happen to know a way to tell what version of ruby a gem requires without installing it?
dash_ has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
coderhs has joined #ruby
sectionme has quit [Ping timeout: 246 seconds]
boboc has joined #ruby
danman has quit [Quit: danman]
einarj has quit [Ping timeout: 245 seconds]
malkomalko has joined #ruby
lilfaf has quit [Remote host closed the connection]
<boboc>
guys how can i update to Ruby 2.0 on a mac?
<onewheelskyward>
boboc Use rbenv or rvm.
<boboc>
i tried to install the rvm but it is not added to $PATH
mansi_ has quit [Remote host closed the connection]
aef has joined #ruby
shredding has quit [Quit: shredding]
mansi has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
aef has quit [Remote host closed the connection]
snovak has quit [Ping timeout: 252 seconds]
aef has joined #ruby
<boboc>
after installation of rvm i've received this message:
<boboc>
WARNING: You have '~/.profile' file, you might want to load it,
<boboc>
to do that add the following line to '/Users/bbb/.bash_profile':
<boboc>
source ~/.profile
codezombie has joined #ruby
creature has joined #ruby
creature has joined #ruby
creature has quit [Changing host]
<hamush>
it's looking to me like the best way to find out what version of ruby a gem requires is to untar it, gunzip metadata.gz and search for "required_ruby_version"... is there a better way?
colonolGron has joined #ruby
tsykoduk is now known as zz_tsykoduk
snovak_ has quit [Ping timeout: 260 seconds]
senayar has quit [Ping timeout: 245 seconds]
mansi has quit [Read error: Connection reset by peer]
mansi has joined #ruby
cyberarm has quit [Remote host closed the connection]
greenrose has joined #ruby
ehaliewicz has joined #ruby
snovak has joined #ruby
hakunin has joined #ruby
colonolGron has quit [Ping timeout: 248 seconds]
dcunit3d has joined #ruby
<dcunit3d>
who's in Boulder for Rocky Mtn Ruby?
alvaro_o has joined #ruby
<dcunit3d>
i am lol
Nogbit has joined #ruby
cfi30 has joined #ruby
Monie has joined #ruby
g0bl1n has quit [Quit: g0bl1n]
kazuuu has joined #ruby
gwb3 has joined #ruby
Jdubs has quit [Read error: Connection reset by peer]
gwb3 has quit [Remote host closed the connection]
Jdubs has joined #ruby
Monie has quit [Read error: Connection reset by peer]
mengu has joined #ruby
axl_ has joined #ruby
BizarreCake has quit [Ping timeout: 240 seconds]
jonathanwallace has quit [Ping timeout: 240 seconds]
Michael has joined #ruby
axl_ has quit [Client Quit]
Nogbit has quit [Ping timeout: 246 seconds]
Michael is now known as Guest30443
nemesit|znc has quit [Ping timeout: 240 seconds]
Monie has joined #ruby
Notte has joined #ruby
rahulkmr1 has quit [Ping timeout: 245 seconds]
Monie has quit [Client Quit]
<rien>
folks, does anyone have a definite solution for the encoding problem of reading CP1252 files and treating them as UTF-8 ?
<rien>
I've googled and there are many many solutions but none actually work, they're all half solutions.
<rien>
I'm looking for the pie-in-the-sky solution that will handle it all for me so I can stop thinking about encoding and focus on my code.
Ripp__ has quit []
nemesit|znc has joined #ruby
<rien>
even if there's a perfect function that always perfectly converts cp1252 to utf8 that's still not good enough because I have no way to detect when a file is actually cp1252
boboc has quit [Remote host closed the connection]
cek has joined #ruby
Xeago_ has joined #ruby
burlyscudd has quit [Quit: Leaving.]
<cek>
how do you get method with context and then call that method in another context?
freezey has joined #ruby
fcahoon has joined #ruby
<cek>
a-la local vars that are "inherited" when you open a new context, but for methods
Stalkr^ has quit [Quit: Leaving...]
Macaveli has joined #ruby
dcunit3d has quit [Ping timeout: 246 seconds]
<rien>
you mean a closure that keeps references to upvalues?
<rien>
what's a "context"? the stack frame before the current frame?
Targen has quit [Read error: Connection reset by peer]
Jdubs has quit [Read error: Connection reset by peer]
<cek>
context is "this"
Jdubs has joined #ruby
<apeiros>
cek: still not getting help in ##ruby? the bestestes ruby channel? :-p
<cek>
forgot about that channel, need to ask there
<rien>
apeiros: what's the difference?
<apeiros>
you forget about your own channel?
<cek>
always forgetting about that channel when I join #ruby
<apeiros>
rien: hm, one is useless and one is not
Targen has joined #ruby
momomomomo has quit [Quit: momomomomo]
<Xeago_>
I never knew about ##ruby
<Xeago_>
what is the difference?
dcunit3d has joined #ruby
<rien>
Xeago_: apparently the difference is that one is useless and one is not
fcahoon has quit [Client Quit]
Monie has joined #ruby
<cek>
in every other aspect, it's better
<Xeago_>
please define it, it is not clearly defined
Xeago has quit [Remote host closed the connection]
julweber has joined #ruby
gwb3 has joined #ruby
colonolGron has joined #ruby
Uranio has quit [Quit: while you reading this, a kitty dies]
zaltekk has joined #ruby
rezzack has joined #ruby
<gazarsgo>
oh, there's no bullying in ##ruby. also, no people.
<weeb1e>
I'm busy slowly deleting files from all the gems gtk2 depend on
<platzhirsch>
Gosh I love the Yajl Ruby Parser, they added compression support, but with a deprecation warning that it will be removed in v2.0. Looking at the maintained status of the project, there won't even be a v1.2. But good think it spams my loggers
kvirani has quit [Ping timeout: 248 seconds]
<weeb1e>
Hopefully I'll me able to get it down to a fair size while it is still working
dv__ is now known as dv_
aknewhope has quit [Quit: Leaving]
decoponio has quit [Quit: Leaving...]
Jdubs has quit [Remote host closed the connection]
twoism has quit [Ping timeout: 240 seconds]
<apeiros>
platzhirsch: use Oj?
<platzhirsch>
apeiros: Oj?
<apeiros>
probably the best json gem atm
<apeiros>
at least the fastest
<platzhirsch>
no way
<apeiros>
don't believe me, believe some random website on the intertubes, because it has numbers on it!
ehaliewicz has quit [Remote host closed the connection]
senayar has joined #ruby
marsLantern has joined #ruby
<platzhirsch>
I am on it
dv_ has quit [Ping timeout: 260 seconds]
<apeiros>
I use it to generate JSON from some couple of thousand AR records
mengu has quit [Remote host closed the connection]
<platzhirsch>
well, good to know, but it seems there is no stream support
<apeiros>
parse or dump?
<platzhirsch>
both
boboc has quit [Remote host closed the connection]
<platzhirsch>
Yajl has wrappers for Gzip streamed writer and reader which is pretty nice
dv_ has joined #ruby
boboc has joined #ruby
enriclluelles has quit [Remote host closed the connection]
Nogbit has joined #ruby
<platzhirsch>
but it looks good anyway
boboc has quit [Remote host closed the connection]
mayorga has joined #ruby
<apeiros>
that sounds nice
<apeiros>
port them over? :)
<platzhirsch>
wait what do I read here!
<platzhirsch>
"Symbolizing keys can be used to cause memory to be filled up since Ruby does not garbage collect Symbols. "
senayar has quit [Ping timeout: 245 seconds]
virtualize has quit [Read error: Connection reset by peer]
virtualize has joined #ruby
Advocation has quit [Quit: Advocation]
fmcgeough has quit [Quit: fmcgeough]
Bosox20051 has quit [Remote host closed the connection]
<platzhirsch>
ok I thought I do this.. darn, that would have explained a lot
<platzhirsch>
apeiros: yeah, definitely, I mean Oj already supports callback handlers for event-oriented parsing
<platzhirsch>
just not now :D
enriclluelles has joined #ruby
iliketurtles has joined #ruby
DrOwl has joined #ruby
Nogbit has quit [Ping timeout: 246 seconds]
Kar- has quit [Ping timeout: 248 seconds]
cfi30 has quit [Quit: 1]
twoism has joined #ruby
i_s has quit [Remote host closed the connection]
cfi30 has joined #ruby
i_s has joined #ruby
nfk has quit [Quit: yawn]
kraljev2 has joined #ruby
ass-groper has joined #ruby
<ass-groper>
hi
jibi has joined #ruby
kraljev2 has left #ruby [#ruby]
Kar- has joined #ruby
<ass-groper>
i like ass.
<ass-groper>
GIRLS ASS.
<weeb1e>
apeiros: Ever tried stripping down gems until they break?
<apeiros>
weeb1e: no
<popl>
thanks apeiros
krawchyk_ has quit [Remote host closed the connection]
<apeiros>
yw
wlanboy has quit [Ping timeout: 240 seconds]
ehc has quit [Quit: ehc]
<apeiros>
seems to be some kind of daily troll
<weeb1e>
apeiros: I guess I need to confirm with a VM, but if I rename cairo-1.12.6-x86-mingw32\vendor\local\lib\libcairo.a, which is 14MB alone, my gtk2 app still starts correctly
Michael has joined #ruby
krawchyk has joined #ruby
<platzhirsch>
Where do these guys come from
<popl>
platzhirsch: the Internet
wlanboy has joined #ruby
<platzhirsch>
popl: that's scary
<platzhirsch>
*hide*
Michael is now known as Guest91153
<platzhirsch>
haha he is in #RoR too
<apeiros>
well, not an op in #ror
cads has quit [Ping timeout: 256 seconds]
<DrOwl>
Hi All, I have what _might_ be a totally random question ;)
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
if it's totally random, the answer can be totally random too, right?
<DrOwl>
I am using a App (say for example pupper-dashboard) It has a load of Rake tasks already... i am trying to extend one of those tasks... and want to use a gem in the rake task
i_s has quit [Read error: Connection reset by peer]
Nogbit has joined #ruby
<shevy>
the old one I have here ruby-gnome2-0.16.0-1-i386-mswin32.exe is at 12M hmm
i_s has joined #ruby
<weeb1e>
apeiros: People seem to say bad things about tk, but if it ends up being the only light weight thing, then I may have to go with it
kvirani has joined #ruby
i_s has quit [Read error: Connection reset by peer]
i_s has joined #ruby
<weeb1e>
shevy: I'm working from the gems at the moment, I doubt all dependencies will compress to 12MB
<weeb1e>
I've gotten it down to under 40MB compressed so far
<weeb1e>
Or near 40MB
evenix has joined #ruby
nbrosnahan has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<weeb1e>
There are tons of so's and dll's in total across all the gems
<weeb1e>
It requires: atk-2.0.2-x86-mingw32, cairo-1.12.6-x86-mingw32, gdk_pixbuf2-2.0.2-x86-mingw32, glib2-2.0.2-x86-mingw32, gtk2-2.0.2-x86-mingw32, pango-2.0.2-x86-mingw32
momomomomo has quit [Quit: momomomomo]
drim has quit [Quit: drim]
<shevy>
yeah that sounds right
<shevy>
but 40MB... man
<shevy>
from 12 to 40 how can that happen
<weeb1e>
Uncompressed is a lot more...
Nogbit has quit [Ping timeout: 245 seconds]
<shevy>
I am going to go ahead and simply state... you did something wrong :P
<weeb1e>
250MB
<weeb1e>
I used gem install gtk2
<weeb1e>
Not sure how you can do that wrong
k610 has joined #ruby
Kar- has quit [Ping timeout: 240 seconds]
<shevy>
weeb1e you should write to https://www.ruby-forum.com/forum/gnome2 and make sure that what you did was the maximum, the japanese devs should be able to confirm, and there are some good users there like detlef
row has quit [Ping timeout: 252 seconds]
<weeb1e>
I wonder how big tk and its dependencies are
blackmesa has quit [Remote host closed the connection]
<weeb1e>
And then theres other issues like it may not support tray icons
<shevy>
hehehe
<shevy>
I hate tk
<shevy>
I'd rather die than use it
mxweas has quit [Quit: Leaving...]
<shevy>
or I will use java instead
<weeb1e>
Haha
blackmesa has joined #ruby
<shevy>
there are bindings to qt
<weeb1e>
I hate java more than most people hate anything
<shevy>
qt4 bindings for ruby looked best
<shevy>
but there is just like one main dev on it
<shevy>
and he is an old man :(
wchun has joined #ruby
<weeb1e>
But how big will qt be?
<shevy>
(no kidding btw)
<weeb1e>
I'm pretty sure Qt is large too
<popl>
that means you can probably take him
<popl>
right?
<shevy>
I dunno... when I saw that it is just one person, and it has literally no docs, I stopped pursuing it
<shevy>
popl I am not that much younger anymore :P
ducknorris has quit [Remote host closed the connection]
<weeb1e>
At first glace I can just rm vendor/local/lib
platzhirsch has joined #ruby
<weeb1e>
Which will save a ton of space
cwong2012 has joined #ruby
Stalkr^ has joined #ruby
freerobby has quit [Quit: Leaving.]
enriclluelles has joined #ruby
<weeb1e>
Nevermind, at least some of those libs broke my app
larissa has joined #ruby
freerobby has joined #ruby
<weeb1e>
I didn't realize the quit icons next turned into blocks
<cwong2012>
so i am trying to go thru search_group_id, then inside, go thru vol_ids. i am not doing it correctly for vol_ids <% @search_instance.sort.each do |key,value| -%>
<cwong2012>
<group id='i<%= @search_group_id %>-<%= key %>' numShards='<%= @num_shards %>' numReplicas='<%= @num_replicas %>' alias='<% @vol_ids.split(",").each do |x| -%>v<%= x %>,<% end %>' />
<cwong2012>
<% end -%>
dallasm_ has quit [Remote host closed the connection]
hanmac1 has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
greenrose has quit []
Jdubs has joined #ruby
momomomomo has joined #ruby
tgraham_|away is now known as tgraham_
enriclluelles has quit [Ping timeout: 245 seconds]
<shevy>
jrobeson yeah, sadly python has like 2x as many devs using it
Nogbit has joined #ruby
i_s has joined #ruby
saarinen has quit [Quit: saarinen]
quoin has joined #ruby
<jrobeson>
shevy, more importantly.. the python gtk/qt users are more than 2x..
bret has joined #ruby
<shevy>
:(
<shevy>
jrobeson you make me feel bad!
<jrobeson>
i have many active apps on my computer that are python gtk, not a single one ruby gtk..
GoldenGiant has joined #ruby
greenrose has joined #ruby
<bret>
what is best practice for dealing with .ruby-version files in a git repo?
<bret>
do I check those in?
<jrobeson>
yes
i_s has quit [Remote host closed the connection]
<bret>
aight
<bret>
thanks jrobeson
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ehc has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
bricker`work is now known as bricker
saarinen has joined #ruby
<rien>
in pry, using pry-byebug, does anyone know how to step to the next live on the stack frame below?
petey has quit [Remote host closed the connection]
<rien>
I'm inside a huge loop and I want to step out of it
quoin has quit [Ping timeout: 246 seconds]
gwb3 has quit [Remote host closed the connection]
johnnyfuchs has quit [Remote host closed the connection]
jibi has quit [Quit: .]
dodosan_ has joined #ruby
raphaelivan has joined #ruby
momomomomo has quit [Quit: momomomomo]
jbpros has joined #ruby
GoldenGiant has quit [Ping timeout: 245 seconds]
dodosan has quit [Ping timeout: 260 seconds]
<platzhirsch>
rien: f ?
<platzhirsch>
f for finish
justanotherjason has left #ruby [#ruby]
brennanMKE has joined #ruby
zeade has quit [Quit: Leaving.]
<rien>
platzhirsch: that doesn't sound right. I saw the commands show-stack, up, down, frame, but all of them return an error saying "you're nowhere" or something like that
<platzhirsch>
that sounds like pry-stack_explorer
<platzhirsch>
with finish my pry session jumps to the end of the method
huoxito_ has joined #ruby
blischalk has joined #ruby
lfox is now known as lfox_
felipec has joined #ruby
lfox_ is now known as lfox
<felipec>
is there a shorter way to do string[11..-1] ?
Guest91445 is now known as mephux
jbpros has quit [Ping timeout: 256 seconds]
mephux has quit [Changing host]
mephux has joined #ruby
burlyscudd has joined #ruby
<platzhirsch>
felipec: shorter?
larissa has quit [Quit: Leaving]
<felipec>
platzhirsch: in C it's str + 11
adambeynon has joined #ruby
lfox has quit []
<platzhirsch>
felipec: that moves the pointer forward, doesn't it?
lfox has joined #ruby
<zaltekk>
why would +11 change the value of str?
<zaltekk>
it isn't +=
<felipec>
platzhirsch: yes, which achieves the desired effect
<zaltekk>
felipec: you want a substring from 11 to the end?
<felipec>
zaltekk: yes
<zaltekk>
there won't be any equivalent to pointer arithmetic
<rien>
Dwarf: you're not an idiot. it's annoying that hashes don't work like you said. that's why rails created the HashWithIndifferentAccess. I rolled my own that converts the key to symbol and tries again if the string key isn't there.
<platzhirsch>
apeiros: gnah
<rien>
sometimes I think programming could use a good dose of "c'mon, ya know what I mean"
<Dwarf>
I guess switching from php to ruby from ruby to perl and back isn't really helping either
<apeiros>
rien: you do understand that converting random strings to symbols is a rather bad idea?
<Dwarf>
PHP in college, ruby in my spare time and perl for irssi
<rien>
apeiros: present your case.
<apeiros>
symbols are interned. they're never garbage collected.
Stalkr^ has quit [Read error: Connection reset by peer]
<apeiros>
there's a reason strings and symbols exist both and aren't just one and the same happy class.
<rien>
apeiros: I can't be faulted for the fact that symbols aren't garbage collected...
<apeiros>
if you're concerned about confusing the two, just never use symbols.
<rien>
apeiros: but it's more convenient to type symbols than strings
<apeiros>
rien: you can be faulted for *not knowing*, and for *using the wrong tool*.
cj3kim_ has joined #ruby
<angusiguess>
@apeiros Out of curiosity then, what is the use case for a symbol?
<apeiros>
it's one character.
<zaltekk>
just use symbols instead
<rien>
apeiros: so I can be faulted for not knowing every ruby bug there is?
<shevy>
well he is forced to use symbols else his big hashes will be slow
<apeiros>
angusiguess: they're used in ruby internally to identify about everything. you define a method foobarbaz, the symbol :foobarbaz starts to exist.
IceyEC has quit [Quit: IceyEC]
<Dwarf>
You know why it confused me? I did varaible.each {|key,value| puts key+"=>"+value} and it didn't show the :
<rien>
apeiros: this code is a web app. phusion forks and kills threads. garbage collection is not an issue.
<apeiros>
rien: claiming that behaviour was a bug is blatant ignorance.
freezey has joined #ruby
<zaltekk>
they can't be collected
kaldrenon has quit [Remote host closed the connection]
<rien>
apeiros: I can't be expected to know every low-level detail :/ I'm coding in a high-level language precisely to avoid the nitty-gritty and be able to get things done.
kaldrenon has joined #ruby
<apeiros>
rien: except this is NOT a low level detail.
<apeiros>
this is the very definition of a symbol
<apeiros>
it's like complaining how array is so very slow to find a key by name in it (-> use a hash instead)
ndrei has joined #ruby
<apeiros>
so yes, you can be expected to
johnnyfuchs has joined #ruby
<rien>
apeiros: I use symbols in common lisp willy nilly, never had a problem with gc, in fact never thought of it. so it's unexpected behavior for me.
<apeiros>
and if you don't, it's entirely your fault, not the language's
Lewix has quit [Remote host closed the connection]
tbrock has joined #ruby
<zaltekk>
you don't have to think of it in ruby either
<rien>
apeiros: your analogy doesn't hold since the latter is ignorance about algorithms, not implementation.
<rien>
anyhoo.... this code is in a thread that gets killed when it's done. so gc is not a problem.
<shevy>
zaltekk of course he has, all the time. you can pass a symbol to any method
<apeiros>
eh, it's an implementation detail
cdelo has joined #ruby
<apeiros>
why should you be expected to understand how lookup works in a hash vs. an array?
<angusiguess>
apeiros: So is there a reason for this behaviour in symbols?
<rien>
apeiros: because that's what differentiates them!
<zaltekk>
shevy: i meant he can not care what's going on and write shitty code
jonathanwallace has joined #ruby
<apeiros>
rien: d'uh!
<platzhirsch>
rien: I wish my Sidekiq threads would be killed, too after they finish. Somehow they hold onto the allocated memory with their dead cold hands... bloody Sidekiq threads
<apeiros>
rien: so you agree with me? one should know what two things differentiates?
fuzzyhorns has joined #ruby
<apeiros>
rien: you're putting your arguments however it pleases you, eh? :-p
hamush has quit [Ping timeout: 248 seconds]
<rien>
apeiros: yes, and I know the difference between string and symbols.
<fuzzyhorns>
what's the best way to consolidate this pattern i keep using
<fuzzyhorns>
so that i dont have to define counts outside of it
<shevy>
what is this code doing
<rien>
apeiros: I appreciate it but this is totally not something I will ever fix. I have real-world problems to fix in my code.
<banisterfiend>
rien sometimes i wish Symbol and String were siblings of a superclass
<rien>
apeiros: no offense.
<rien>
banisterfiend: that would make sense
kazuuu has quit [Remote host closed the connection]
kaldrenon has quit [Ping timeout: 240 seconds]
Soda has quit [Ping timeout: 256 seconds]
<apeiros>
angusiguess: I'd assume exposing symbols to code is was mostly a performance decision. they could have limited the vanilla ruby scope to strings and everything would work fine. there'd just be more objects to gc and comparisons would be slower.
<rien>
apeiros: telling a lisper to stop using symbols and start using strings instead, are you out of your mind... :P
Soda has joined #ruby
<banisterfiend>
rien what languages do you come from?
staafl has quit [Ping timeout: 248 seconds]
chrismerrill has joined #ruby
<fuzzyhorns>
rails allows for indifference between string and symbol
<rien>
banisterfiend: I'm into scheme and cl mainly, I do ruby professionally (almost no rails anymore, woot!)
<platzhirsch>
Hah, this chat starts to sound all religious and tolerance debating
<apeiros>
fuzzyhorns: yes, and it's one of the worst things ever IMO
pepito_ has quit [Quit: Page closed]
DrShoggoth has joined #ruby
<fuzzyhorns>
apeiros: lol
<banisterfiend>
rien you're new to ruby though?
<banisterfiend>
you seem new-ish
<fuzzyhorns>
any input on my question above?
freerobby has quit [Quit: Leaving.]
<rien>
banisterfiend: nope
ldnunes has quit [Quit: Leaving]
mengu has joined #ruby
<rien>
banisterfiend: why do I seem new?
<apeiros>
"I can't be arsed to learn the difference - lets make a broken abstraction". awesome.
<apeiros>
worst of both worlds.
cj3kim_ has quit [Remote host closed the connection]
Macaveli has quit [Quit: Computer has gone to sleep.]
<fuzzyhorns>
idk, makes sense for handling json
<rien>
apeiros: I'd love to work where you work where you have time to sweat the small stuff :)
<fuzzyhorns>
makes it easier anyway
i_s has joined #ruby
adkron has quit [Ping timeout: 248 seconds]
<apeiros>
fuzzyhorns: symbolize_keys is sufficient for that
<apeiros>
if you talk about parsing
<zaltekk>
you mean where you have to write correct code?
<rien>
apeiros: except you have to do it all the time. not the same.
<apeiros>
if you talk about dumping, then it's not really needed.
<rien>
plus it walks the hash every time. performance penalty.
<banisterfiend>
rien some of your questions the other night about local variables, i figured that was common knowledge for an experienced rubyist :) (but i could be wrong)
<apeiros>
rien: d'uh, you think it works by pixy dust in HWIA?
<fuzzyhorns>
true apeiros
<apeiros>
rien: if you're concerned about performance, DONT USE HWIA
<rien>
banisterfiend: I'm not experience in ruby metaprogramming, you're right.
<rien>
banisterfiend: plus I'm already disappointed at it :)
<apeiros>
because, psssshhh, top secret, HWIA is slower than a proper hash with symbol keys
OdNairy has joined #ruby
<fuzzyhorns>
pre declring counts hash seems silly
<rien>
apeiros: I don't, I swear I hate that thing.
<zaltekk>
variable scoping is now meta?
<fuzzyhorns>
tell me how to unsuck
<banisterfiend>
rien well the distinction between metaprogramming and programming is kind of artificial IMO, knowing 'metaprogramming' is really just having decent experience with the language
<rien>
zaltekk: no, I was trying to metaprogrammatically introduce local variables.
<zaltekk>
rien: ah
<rien>
zaltekk: which is impossible in ruby for some silly reason that escapes me
<shevy>
matz has not thought about it
<fuzzyhorns>
metaprogramming is just adding a recursive level of abstraction to programming
<rien>
banisterfiend: not to me. metaprogramming should be code that executes at compile time and transforms the ast.
<shevy>
rien or perhaps noone else before you has had the idea
<a1ph4g33k>
rien, no it's not.
<a1ph4g33k>
very little in ruby is impossible.
<apeiros>
rien: you can introduce new local variables. but only for further evals on the bindings.
i_s has quit [Remote host closed the connection]
<shevy>
a1ph4g33k show code ;)
i_s has joined #ruby
<shevy>
!!!
<apeiros>
rien: you can assign values to existing lvars
<a1ph4g33k>
... shevy, want to give me more of a problem statement first ... I don't want a repeat of last itme.
<rien>
shevy: ruby was inspired by lisp somewhat. they knew what it was possible to do in it regarding macros.
breakingthings has quit []
<shevy>
a1ph4g33k the full equivalent of programmatically doing x = 5, without doing x = 5 and without any restrictions
<rien>
a1ph4g33k: very little is impossible, but introducing local vars is one of those very little things
<banisterfiend>
rien but a lot of rub 'metaprogramming' happens at runtime, and the notion of compile time is kind of artificial in ruby
<a1ph4g33k>
so something that becomes set_local( :x, 5 ) ... or something like that ?
pellenation has joined #ruby
<rien>
banisterfiend: agreed, which is why it becomes difficult in ruby to have metaprogramming as powerful as cl has it
<shevy>
a1ph4g33k yeah
<a1ph4g33k>
k.
<banisterfiend>
rien yeah, i don't think anything can compete with cl there :)
mayorga has joined #ruby
<a1ph4g33k>
to be called on an object externally or internally ?
<xybre>
There's some artifacts of compile time, but mostly its transparent.
<platzhirsch>
Well good discussion, so far I converted most of my hashes to HWIA because I found writing symbols to access the elements more convenient, but performance-wise, well...
<rien>
banisterfiend: just because people don't care too. there are no magical properties about cl that allow its macros :)
<banisterfiend>
rien i read the introduction to the art of MOP
<banisterfiend>
:)
<apeiros>
btw. to any HWIA advocates, this is the magic in HWIA:
<shevy>
a1ph4g33k to be 100% functionally equivalent to anyone else setting a local var in a plain .rb file. so: x = 5; y = 'hello world' etc...
<rien>
banisterfiend: oh did you?
<apeiros>
def convert_key(key)
<apeiros>
key.kind_of?(Symbol) ? key.to_s : key
<apeiros>
end
<rien>
banisterfiend: are you going to be THE ONE who will rewrite it for a broader audience?
<banisterfiend>
rien yeah, i spent a while trying to bring some of that stuff to ruby via a c extension a couple of years ago
<rien>
banisterfiend: Alan Kay will give you a medal if you do
<rien>
banisterfiend: and praise you forever
<apeiros>
so - Symbols are converted to Strings - which I said all along :-p
<rien>
banisterfiend: is it really groundbreaking stuff? I must admit I never looked at it
<banisterfiend>
rien hehe, not me :)
<banisterfiend>
rien well the cool thing about MOP is you can redefine what OOP means, you can redefine the entire OOP model
<shevy>
platzhirsch wait... what did you say
<shevy>
platzhirsch performance wise?
<platzhirsch>
now I get punished
<shevy>
platzhirsch ah... you meant HWIA
<shevy>
I thought you meant normal hashes
gazarsgo has quit [Ping timeout: 260 seconds]
<platzhirsch>
^^
<rien>
banisterfiend: that sounds like something I'll have to read up on... that book isn't free, right? I guess I'll order it. it's not ultra academic, is it?
<shevy>
I cant ever use HWIA because it's too long a name
<banisterfiend>
rien i found it free online, it's a very old book
<banisterfiend>
1991
<rien>
shevy: and too long an implementation for what it does
<shevy>
rien hehehe
<shevy>
rien I thought you liked it :P
tabolario has joined #ruby
<rien>
banisterfiend: hahahah 1991 == very old ;)
<rien>
shevy: I like what it achieves, not how it does it
<banisterfiend>
a1ph4g33k btw thanks for the nice things u said about pry, you seem one of the few who actually 'grok' it ;)
<platzhirsch>
So let's burn HWIA down, witch, witch, witch
<banisterfiend>
rien in computer time, yes :)
AdmiraI has quit [Ping timeout: 240 seconds]
<a1ph4g33k>
banisterfiend, I love pry ... irb ++ on super-steroids
<rien>
banisterfiend: oh yeah I should ask you, but maybe you won't know, but in pry-byebug I never found a way to step out of a loop, for instance, or step down a frame
<banisterfiend>
a1ph4g33k cool, how did you hear about it?
cdelo has left #ruby ["Leaving"]
mayorga has quit [Ping timeout: 256 seconds]
<a1ph4g33k>
I found a tutorial online somewhere a long while ago ... watched a video of usage ... and was really impressed.
<a1ph4g33k>
basically covered things I was adding through my .irbrc ( like being able to pull rdoc for any method ) ... plus more ( view method source, edit in place, etc ) ... just wicked.
<banisterfiend>
rien yeah, it's not hard to add that stuff but pry-byebug hasn't got those features yet. we should port more gdb-style commands.
<rien>
apeiros: just checked, in cl uninterned symbols are always gc'ed. not that it matters :P
<a1ph4g33k>
why do you ask ?
pczajka has joined #ruby
<a1ph4g33k>
( expecting you are one of the pry devs @ this point )
<banisterfiend>
a1ph4g33k well i created pry, so i'm always interested how word gets round
<apeiros>
rien: as somebody already pointed out, cl != ruby. ruby doesn't have uninterned symbols.
<platzhirsch>
btw. time to donate for Pry
<apeiros>
if you want cl, use cl :-p
<a1ph4g33k>
.. called it =)
<shevy>
rien do you still use lisp?
<rien>
apeiros: one day :))
amacgregor has joined #ruby
<rien>
shevy: "still" ? :)
atmosx has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
atmosx has quit [Client Quit]
interactionjaxsn has joined #ruby
<banisterfiend>
rien by stepping 'down' you mean mean like up/down ?
<banisterfiend>
it adds stack navigation, and iirc it's compatible with pry-byebug
machuga is now known as machuga|away
blackmes1 has joined #ruby
<rien>
banisterfiend: yes up and down the stack frames... sometimes I don't care about some loop and the whole method it's in... so I'd like to go down
<rien>
ok, will check
<banisterfiend>
but tbh i don't use stepping/nexting very often, mostly use pry in combination with pry-rescue
atmosx has joined #ruby
<rien>
banisterfiend: hmmm... I step all the time
atmosx has quit [Client Quit]
<rien>
is pry-rescue something that would allow me to say "catch all" and it would break on any exception? I've been needing that too
blackmesa has quit [Ping timeout: 240 seconds]
Ox6abe has quit [Ping timeout: 252 seconds]
Trudko has quit [Quit: ChatZilla 0.9.90-rdmsoft [XULRunner 1.9.0.17/2009122204]]
<banisterfiend>
rien you mean it drops you into exceptions at the point they're raised irrespective of whether they're caught on a parent stack frame?
<rien>
banisterfiend: yes!
<banisterfiend>
rien my earlier project pry-exception_explorer supported that, but i think the author of pry-rescue didn't add that yet, but he might have…check out the readme for pry-rescue it's pretty solid
<shevy>
rien yes, as in if you still use it today
fuzzyhorns has left #ruby [#ruby]
<rien>
shevy: I use scheme for personal projects... chicken scheme and racket
<shevy>
hmm
<rien>
shevy: I sometimes use CL but not as often
thepumpkin has quit [Remote host closed the connection]
<shevy>
chicken
interactionjaxsn has quit [Ping timeout: 240 seconds]
<shevy>
oh man ...
<shevy>
"I use a programming language called Chicken."
amacgregor has quit [Read error: No route to host]
<rien>
shevy: the compiler is called chicken, it implements r5rs so it's standard scheme :)
amacgregor has joined #ruby
<rien>
it's called that because it solves an important chicken and egg problem iirc
<rien>
google "cheney on the mta" if interested
<shevy>
lol
<shevy>
at least that is a funny explanation
coderhs has quit [Ping timeout: 248 seconds]
pellenation has quit [Quit: Leaving.]
heidi has quit [Quit: Leaving.]
intuxicated has quit [Read error: Connection reset by peer]
<banisterfiend>
a1ph4g33k i assume you're Konrad? :) thx
martin_work has joined #ruby
hanmac1 has joined #ruby
<a1ph4g33k>
?
<a1ph4g33k>
nope.
<a1ph4g33k>
who's Konrad ?
<martin_work>
can someone remind me the method that gets called when you do puts Object?
johnnyfuchs has quit [Remote host closed the connection]
pczajka has left #ruby [#ruby]
s2013 has quit [Quit: Leaving]
<a1ph4g33k>
puts ? :to_s
<martin_work>
I want to overide what gets printed out.
<martin_work>
thanks
<a1ph4g33k>
p uses :inspect
johnnyfuchs has joined #ruby
atmosx has joined #ruby
<a1ph4g33k>
regarding the local variables ... still hunting but I do remember a lib a long while ago in the early days of Ruby ... I think it was called Evil, and the developer had exposed a bunch of deep direct object ( c-struct ) manipulation stuff ...
<banisterfiend>
platzhirsch oh it's you :) thx
chrismerrill has left #ruby [#ruby]
atmosx has quit [Client Quit]
havenwood has quit [Remote host closed the connection]
soheil has quit [Remote host closed the connection]
<platzhirsch>
banisterfiend: yeah that was me, not much, but was about time
pczajka has joined #ruby
soheil has joined #ruby
<banisterfiend>
thx
kirun has quit [Quit: Client exiting]
lukec has joined #ruby
<platzhirsch>
you should start a Kickstarter Project at some time
<platzhirsch>
Fund pry next generation
knigitz has joined #ruby
baordog_ has quit [Read error: Connection reset by peer]
hanmac1 has quit [Ping timeout: 246 seconds]
<banisterfiend>
maybe.. :)
soheil has quit [Remote host closed the connection]
soheil has joined #ruby
johnnyfuchs has quit [Remote host closed the connection]
gcds_ has quit [Quit: gcds_]
Pasha has joined #ruby
AdmiraI has joined #ruby
mary5030 has quit [Ping timeout: 245 seconds]
jonahR has joined #ruby
apeiros has quit [Remote host closed the connection]
quoin has joined #ruby
jlast has quit [Remote host closed the connection]
apeiros has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soheil has quit [Remote host closed the connection]
<DrOwl>
ARr joy i found the problem a local frozen bundel config, a little kick of "Gemfile.lock" and all is well =)
soheil has joined #ruby
mayorga has quit [Max SendQ exceeded]
mayorga has joined #ruby
Guest75791 has quit [Changing host]
Guest75791 has joined #ruby
Guest75791 is now known as z
<DrOwl>
strace is your friend =) (ok may be knowing how things work is simpler)
danman has joined #ruby
jonr22 has joined #ruby
sarlalian has joined #ruby
Zai00 has joined #ruby
kvirani has joined #ruby
TheRealPygo is now known as pygospa
kramsee has joined #ruby
yano has joined #ruby
Markvilla has joined #ruby
justsee has quit [Ping timeout: 246 seconds]
Nogbit has quit [Ping timeout: 240 seconds]
mayorga has quit [Ping timeout: 256 seconds]
sniffingcats has joined #ruby
codecop has quit [Remote host closed the connection]
apok has quit [Quit: apok]
boboc has quit [Remote host closed the connection]
boboc has joined #ruby
colonolGron has joined #ruby
sectionme has joined #ruby
nisstyre has joined #ruby
tacos1de has joined #ruby
cj3kim_ has joined #ruby
freerobby has joined #ruby
kvirani has quit [Ping timeout: 248 seconds]
ixti has quit [Ping timeout: 256 seconds]
mrsolo has joined #ruby
sectionme has quit [Ping timeout: 248 seconds]
yfeldblum has joined #ruby
xk_id has joined #ruby
jonr22 has quit [Ping timeout: 245 seconds]
boboc has quit [Remote host closed the connection]
jibi has joined #ruby
hanmac1 has joined #ruby
mayorga has joined #ruby
apok has joined #ruby
pel_daniel has left #ruby [#ruby]
hanmac1 has quit [Read error: Operation timed out]
GoldenGiant has quit [Quit: Computer has gone to sleep.]
GoldenGiant has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
Nogbit has joined #ruby
brennanMKE has joined #ruby
colonolGron has quit [Quit: Lost terminal]
gazarsgo has joined #ruby
GoldenGiant has quit [Ping timeout: 240 seconds]
snovak has quit [Remote host closed the connection]
Nogbit has left #ruby [#ruby]
snovak has joined #ruby
kpshek has quit []
quoin has joined #ruby
vim_shim has quit [Ping timeout: 248 seconds]
Notte has quit [Remote host closed the connection]
dallasm has joined #ruby
Popple has joined #ruby
gazarsgo has left #ruby [#ruby]
zz_tsykoduk is now known as zz_zz_tsykoduk
sarlalian has quit [Quit: WeeChat 0.4.1]
sarlalian has joined #ruby
tylersmith has quit [Read error: Connection reset by peer]
tylersmith has joined #ruby
freezey has quit [Remote host closed the connection]
quoin has quit [Ping timeout: 245 seconds]
RichardBaker has joined #ruby
snovak has quit [Ping timeout: 240 seconds]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
cfi30 has quit [Quit: 2]
cek has quit [Quit: жопа диридай диридиридай]
cfi30 has joined #ruby
lukec has quit [Quit: lukec]
lukec has joined #ruby
workmad3 is now known as wm3|zZz
mengu has quit [Quit: This computer has gone to sleep]
zarubin has joined #ruby
huoxito__ has joined #ruby
TheMoonMaster has quit [Excess Flood]
Trazira has quit [Ping timeout: 240 seconds]
huoxito_ has quit [Ping timeout: 252 seconds]
Popple has quit [Quit: Computer has gone to sleep.]
senayar has joined #ruby
dodosan_ has quit [Remote host closed the connection]
ner0x has joined #ruby
mansi_ has quit [Remote host closed the connection]
jerius has quit [Ping timeout: 245 seconds]
vim_shim has joined #ruby
TheMoonMaster has joined #ruby
mansi has joined #ruby
Popple has joined #ruby
quoin has joined #ruby
bingo has joined #ruby
<bingo>
ruby is shit.
senayar has quit [Ping timeout: 260 seconds]
Xiti` is now known as Xiti
mansi has quit [Ping timeout: 240 seconds]
Galgorth has joined #ruby
Popple has quit [Client Quit]
snovak has joined #ruby
<banisterfiend>
bingo u r
julweber has joined #ruby
robbyoconnor has joined #ruby
brupeb has quit [Remote host closed the connection]
ldnunes has joined #ruby
lfox has quit [Quit: ZZZzzz…]
Rollabunna has joined #ruby
kevind has quit [Quit: kevind]
pumper has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 256 seconds]
Guest96486 has quit [Ping timeout: 264 seconds]
jrhe_ has joined #ruby
conner has joined #ruby
cfanning has quit [Quit: WeeChat 0.4.0]
funburn has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
bio has joined #ruby
bio is now known as Guest80927
<bingo>
ruby bitch
<conner>
Hello. I'm seeing some unexpected values from String#length with both binary and regular ASCII data which I assume is due to some sort of unicode processing or other string encoding magic. Could anyone help me understand this test: https://gist.github.com/jhoblitt/6736485
danman has quit [Quit: danman]
<BraddPitt>
what is the convention for multiple word classes?
<BraddPitt>
Foo_Bar
<BraddPitt>
or FooBar?
<zaltekk>
FooBar
<BraddPitt>
ty
<bnagy>
CamelCase
johnnyfuchs has joined #ruby
Notte has joined #ruby
<bnagy>
conner: what version of ruby?
<conner>
bnagy, that's 1.9.3
<bnagy>
cause there were issues with read and \r\n
gwb3 has joined #ruby
<bnagy>
I would use binread and bytesize, then see if it still looks wrong
<bnagy>
ok. I _think_ that should use the binary flag for read by default, but I use binread anyway to alert people that I am reading binary stuff
<conner>
bnagy, I actually hit that problem looking at the response sizes from RestClient. Is there some way to tell a string you want to treat it as binary/ char ?
<bnagy>
siiiiigh - it's all a bit ugly :)
<bnagy>
you can encode it, and you can force_encoding
gwb3 has quit [Remote host closed the connection]
<conner>
:(
freerobby has quit [Quit: Leaving.]
<bnagy>
by default it's probably coming in as utf-8
emergion has joined #ruby
<zaltekk>
conner: was #bytesize wrong too?
<bnagy>
you can do str.codepoints
<conner>
zaltekk, didn't know about that #, I assumed #length, #size, etc. were all aliased... let me try
<zaltekk>
well, #length and #size don't mean the same as #bytesize
<conner>
zaltekk, #bytesize works
<bnagy>
cool then you probably have some stuff that it's reading as multibyte codepoints
<conner>
zaltekk, bnagy thank you both!
<bnagy>
if just using binread and bytesize is enough then job done :P
<conner>
for my edification, is there a way to set the encoding type on a String?
<zaltekk>
perl magically just gets utf8 right
Zai00 has quit [Quit: Zai00]
<zaltekk>
#force_encoding
<bnagy>
there's a default, which will be used for all incoming, which is the 'magic comment'
<shevy>
if perl would just have a nicer syntax
<conner>
I've been a perl guy since I joined pdx.pm in, uh, 98? :)
<shevy>
and if perl would drop perl 6 and go for perl 7
<zaltekk>
i just miss my and our
<bnagy>
which is utf8 as of 1.9 api
<platzhirsch>
Any ideas on implementing a spell checker, but using aspell-ruby and creating a list of exceptions to avoid false-negatives?
Lewix has joined #ruby
<shevy>
zaltekk, lol there is really "our"?
<conner>
in all honesty, I was a committer or parrot a long time ago
<zaltekk>
shevy: yes
cfanning has joined #ruby
johnnyfuchs has quit [Remote host closed the connection]
<conner>
perl6 effectively killed perl5
Trazira has joined #ruby
<conner>
Ruby is in a lot of ways perl6
xk_id has quit [Quit:
<shevy>
well
<shevy>
I thought perl5 was more active than perl6
<zaltekk>
it is
<platzhirsch>
I always thought of Perl as an old language I should not touch
<zaltekk>
perl6 isn't even a successor
bingo has quit [K-Lined]
<zaltekk>
it's described as a sister language
nippysaurus has joined #ruby
<onewheelskyward>
soul sista
<conner>
zaltekk, I hear that. I've only been seriously trying to come up to speed on Ruby since April and I dont know how many hard to find bugs I've had because of variable name typos
<zaltekk>
and like all things on parrot, it isn't ready yet
danman has joined #ruby
<conner>
parrot is dead
<shevy>
I had a guy on #gobolinux tell me like 3 years ago that he is a perl committer but only perl5 and he did not care at all about perl6, it felt as if he meant it was a completely different language (to him, or his use cases, I dont know why he cared about perl5 though)
<conner>
perl 5 dev is ramping back up again
<zaltekk>
conner: exactly. i've had to pick up ruby for work, and that's the main thing that i miss
mdst_ has left #ruby ["Leaving"]
<xybre>
platzhirsch: kinda true, but it can still do some things easier than awk or bash alone, but not much that you'd not want to use ruby for.
sarlalian has quit [Ping timeout: 256 seconds]
kung has joined #ruby
kung has quit [Changing host]
kung has joined #ruby
danman has quit [Client Quit]
<zaltekk>
xybre: sure it can.
<platzhirsch>
xybre: It seemed to be too much trouble to get into it now
Notte has quit [Remote host closed the connection]
Clooth has quit [Ping timeout: 248 seconds]
nippysaurus has quit [Client Quit]
cj3kim_ has quit [Read error: Connection reset by peer]
<platzhirsch>
I'd rather spent time getting into Java 8
<conner>
the issue with perl6 was not only brain drain but marketing... why start a new p5 project when p6 is about to come out
<zaltekk>
platzhirsch: the issue in the professional world is that perl has gone the way of cobol in a sense -- most places don't use it, but the places that do are grasping at straws for developers
cj3kim_ has joined #ruby
<conner>
the scope was always grossly too large verse the resources available
<shevy>
can't they kill off perl6 completely?
marsLantern has quit [Quit: marsLantern]
Galgorth has quit [Ping timeout: 256 seconds]
<conner>
well parrot pretty is dead
<xybre>
zaltekk: You think so? I dunno, I'm pretty sure I'm better off writing bash+gnu or ruby than perl for 99% of things. I'm not sure what that 1% might be though.
<zaltekk>
i honestly don't know enough about perl6 to comment at all
<conner>
rakudo will be jvm/clr
<zaltekk>
xybre: depends on the team, i guess. i'd much rather write perl that bash.
<conner>
which has the same slow start issues as jruby
<shevy>
man this is fun... on www.perl.org, it reads:
chinkung has quit [Ping timeout: 252 seconds]
<shevy>
"Perl 6 is a sister language, part of the Perl family."
<shevy>
imagine if ruby 2.0 would be a sister language too :D
<conner>
we use jruby/torquebox at $day job and it's amazing how long the installation takes when running rake tasks under jruby because of the slow startup problem
<platzhirsch>
Soon we have Christmas and 2.1
<zaltekk>
anyway, ruby is so similar to perl that i don't really mind using it...other than the lack of lexical variable declarations
<shevy>
perl6 seemed cleaner than perl5 but it's annoying to have to wait
cfi30 has quit [Quit: 3]
b00stfr3ak has quit [Ping timeout: 248 seconds]
<zaltekk>
if you are honestly interested in the way perl5 is now used, you should look at the (free) book Modern Perl
cj3kim_ has quit [Remote host closed the connection]
<zaltekk>
it's rather short, and you can mostly skim it
ismlages has quit [Remote host closed the connection]
<conner>
I think O'Reilly helped kill the community too... there were p5 books for everything so they started hyping python/ruby/etc.
<zaltekk>
there are still new perl5 books coming out
<zaltekk>
there was just a new iteration of The Perl Programming language
<conner>
there were maybe 100 people at the state of the onion this year
<zaltekk>
and the 3-book learning series is still being actively updated
<conner>
it was scary
Jetchisel has joined #ruby
blackmes1 has joined #ruby
<zaltekk>
i do agree that the community has gotten much smaller
emergion has quit [Quit: Computer has gone to sleep.]
<zaltekk>
maybe in a large part due to the similarity yet higher commercial acceptance of ruby
<conner>
things are getting better now that there is perlbrew/carton/etc. but those are really just clones of ruby tools
<zaltekk>
i believe perlbrew came before rvm
<conner>
the perl documentation tends to be a lot better as a community value... I think ruby shops tend to a lot of learning by interaction and the docs suffer
<zaltekk>
but, i could be completely wrong.
<conner>
I've been hearing my hair out over Capybara/selenium all week
<conner>
*tearing
<conner>
the docs are written as a reference for people that know the ins/outs already
<zaltekk>
isn't selenium java with multiple language interfaces?
Hanmac has joined #ruby
<conner>
yes but I'm using capybara/webdriver
<zaltekk>
not familiar with capybara
<zaltekk>
assuming it's ruby?
Clooth has joined #ruby
fenicks_ has quit [Remote host closed the connection]
<conner>
zaltekk, it's a layer over webdriver like things that helps take the pain out of testing ajaxy html
boxmein has joined #ruby
ixti has joined #ruby
<conner>
zaltekk, I converted webdriver stuff to capybara and it cut the number of lines in half
<zaltekk>
nice
<conner>
which is actually how I hit my string encoding issue
<zaltekk>
i (luckily) don't do web development and/or testing
stkowski has joined #ruby
<conner>
I don't either but I've had it with getting regressions and semi-silent failed deployments from one of our software groups
Hanmac has quit [Ping timeout: 252 seconds]
<conner>
so I need tests not just for unit testing but something I can point remotely at prod
leehambley has quit [Ping timeout: 264 seconds]
Soda has quit [Read error: Connection reset by peer]
c0rn has quit [Ping timeout: 256 seconds]
leehambley has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
sarlalian has joined #ruby
c0rn has joined #ruby
justsee has quit [Ping timeout: 245 seconds]
dzhulk has quit [Quit: Leaving.]
ehc has quit [Quit: ehc]
Galgorth has joined #ruby
kramsee has quit [Ping timeout: 245 seconds]
seaworthy has joined #ruby
<seaworthy>
yo where do gem usually get installed? i want to see the source of one
<seaworthy>
but idk where to look
iliketur_ has quit [Quit: zzzzz…..]
Trazira has quit [Ping timeout: 264 seconds]
<bnagy>
blah lib ruby gems 1.9.1 gems blah, give or take
<bnagy>
or just search for the gemname
IceyEC has joined #ruby
xerxas has joined #ruby
ayonix_ is now known as ayonix
maroloccio has joined #ruby
brennanMKE has quit [Remote host closed the connection]
bubbajones has quit [Read error: Operation timed out]
<seaworthy>
kewl thnaks!
iliketurtles has joined #ruby
mayorga has quit [Ping timeout: 256 seconds]
Markvilla has quit [Ping timeout: 256 seconds]
marius has joined #ruby
<seaworthy>
umm
<seaworthy>
the lib in my project is blank
<seaworthy>
empty
i_s has quit [Remote host closed the connection]
<seaworthy>
when i do gem install where does stuff go
Markvilla has joined #ruby
<bnagy>
into your ruby install
bubbajones has joined #ruby
<bnagy>
I don't know what your 'project' is
<seaworthy>
gem which
<seaworthy>
is the answr
<seaworthy>
DING DING
wyclif_ has joined #ruby
zz_taion809 is now known as taion809
<BraddPitt>
can i pass a regular expression to String#include?
amacgregor has quit [Ping timeout: 248 seconds]
adkron has joined #ruby
Lewix has quit [Remote host closed the connection]
<sophomorical>
BraddPitt: I am curious, are you responsible for *.tf properties?