fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
vish has joined #ruby
<macer1> burgestrand: is it a "heavy" task or the mapping can be computer every time it is accessed?
Hawklord has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<macer1> computed*
Hawklord has joined #ruby
<burgestrand> macer1: it can be, but since the classes never change what would be the point? you plan on adding more classes during run?
<macer1> no
<macer1> add it inside the module?
<burgestrand> macer1: but yeah, unless you have many many classes it probably does not matter anyway :)
darren_ has quit [Remote host closed the connection]
<macer1> module[class class class; mapping = codetomadeit]
<macer1> like that?
<EstanislaoStan> burgestrand: For some reason, just defining methods that don't use the .method notation doesn't work. How does Ruby know whether I want there to be a dot or not? And how do I take the string before my method as an argument for the method?
<macer1> where to put that mappings
<burgestrand> macer1: http://ideone.com/mdf5M
joshman_ has joined #ruby
shashin has quit [Ping timeout: 260 seconds]
<macer1> ok ;p
<macer1> looks good
<burgestrand> EstanislaoStan: ruby has a list of methods that you can define that don’t need to be called in the regular way (I call them infix methods, but there is also unary + and - that can be defined). It also means you can’t just make up your own.
dankest has joined #ruby
bradhe has joined #ruby
darren has joined #ruby
und3f has quit [Ping timeout: 260 seconds]
<burgestrand> Oh, yeah, unary ! can also be defined. :)
<shevy> that was the strangest thing
<EstanislaoStan> So I can't add to that list. And there isn't a way to take the receiver as an argument?
<bricker88> macer1: Okay, what if the error was still occurring?
<burgestrand> EstanislaoStan: http://codepad.org/Jn0hsHnP
<macer1> can you pastebin the code that causes the problem?
<burgestrand> EstanislaoStan: right, you can’t add to it, and you *are* the receiver so no need to take it as argument.
<shevy> class Foo; def ^(); puts "hi"; end; end; Foo.new.^()
<shevy> hi
maxmmurphy has quit [Quit: maxmmurphy]
bbttxu has quit [Quit: bbttxu]
freeayu has joined #ruby
jwg2s has quit [Quit: jwg2s]
<davidcelis> thats two semicolons too many
Araxia has quit [Read error: Connection reset by peer]
Araxia has joined #ruby
strnx has quit [Excess Flood]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
sevvie has quit [Read error: Connection reset by peer]
sdwrage has left #ruby [#ruby]
sent-hil has joined #ruby
centipedefarmer has joined #ruby
<bricker88> macer: `y 1` gives the error 'undefined method `y' for main:Object', and yaml is required
<macer1> emm
tvw has quit [Ping timeout: 272 seconds]
<burgestrand> Huh, cool, I never knew yaml defined a method y.
<macer1> u r doing it wrong
<bricker88> macer1: how so
<macer1> no, hmm
<macer1> works for me
<burgestrand> bricker88: use YAML.dump(obj) instead
<macer1> are you using windows?
<EstanislaoStan> Thanks burgestrand. I need to figure out the variable name for a string object's stored string then. The ruby core documentation only shows what methods work with the classes. Is there a place I can find the actual class definition?
sailias has quit [Quit: Leaving.]
benson has quit [Remote host closed the connection]
tvw has joined #ruby
<bricker88> burgestrand: I know I can do that, or a number of other things, I am just wondering why the `y` method is no longer working. macer1: No, OSX
troyack has joined #ruby
<macer1> me too...
pen has quit [Remote host closed the connection]
<macer1> using rvm?
sailias has joined #ruby
sailias has quit [Client Quit]
nari has quit [Read error: Operation timed out]
<bricker88> macer1: yes, 1.9.2 and 1.9.3 both gave the same error
jorge has quit [Remote host closed the connection]
<burgestrand> bricker88: which engine are you using, Psych or Syck? Type YAML and you should see the name.
sailias has joined #ruby
<macer1> ehh no idea
sailias has quit [Client Quit]
<bricker88> macer1: if I change YAML::ENGINE.yamler to 'syck' it works.
andrewhl has joined #ruby
dagnachewa has joined #ruby
sailias has joined #ruby
sailias has quit [Client Quit]
<burgestrand> EstanislaoStan: you need to figure out the _variable name_?
TorpedoSkyline has joined #ruby
sailias has joined #ruby
sailias has quit [Client Quit]
Hawklord has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
sailias has joined #ruby
sailias has quit [Read error: Connection reset by peer]
htroyack has quit [Ping timeout: 240 seconds]
sailias has joined #ruby
adamkittelson has quit [Remote host closed the connection]
vish has quit [Quit: vish]
htroyack has joined #ruby
<burgestrand> EstanislaoStan: also, some classes are defined in C, some classes are defined in Ruby, some are defined with both.
d3c has quit [Ping timeout: 248 seconds]
vvgomes has quit [Ping timeout: 260 seconds]
troyack has quit [Ping timeout: 244 seconds]
<burgestrand> EstanislaoStan: looking at ruby-doc I believe the files the class is defined in is listed at the top.
centipedefarmer has quit [Quit: This computer has gone to sleep]
htroyack has quit [Client Quit]
<EstanislaoStan> I need to be able to add a method to the String class that lets access the string's value. So if I used "hello, world".my_method my_method would somehow be accessing "hello, world".
andrewhl has quit [Remote host closed the connection]
<EstanislaoStan> *lets me access
itnomad has quit [Ping timeout: 264 seconds]
<macer1> burgestrand: what if I have more constants in my classes...it is using first one
<macer1> ah
Hawklord has joined #ruby
<macer1> nevermind, logic fail
sailias has quit [Ping timeout: 260 seconds]
raphie has joined #ruby
<raphie> having a very weird problem concerning Mountain Lion, Shoes.rb, and Rgeo if anyone can help
<burgestrand> EstanislaoStan: the string’s value is the string, it’s a string.
beakerman has joined #ruby
itnomad has joined #ruby
pskosinski has quit [Remote host closed the connection]
<EstanislaoStan> I guess I'm confused on how to add methods that operate on the string's value. I thought that I'd have to, in the class definition, modify a variable inside of the String class. But from what I'm seeing online I just put the method to operate on the string inside of the string class and it'll automatically pick up on the value. That somewhat confuses me because I don't understand how a string
<EstanislaoStan> can be an object of a class and not have it's value stored somewhere. I guess it's because I'm poking around the roots of the language where things get less intuitive because they're probably defined in C or whatever.
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
centipedefarmer has joined #ruby
Araxia has quit [Read error: No route to host]
baroquebobcat has quit [Quit: baroquebobcat]
Araxia has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
<burgestrand> EstanislaoStan: strings are mutatable, and you can replace the contents of one string with another if you wish: http://codepad.org/EAlCmR89
<burgestrand> EstanislaoStan: in addition, you can access many other aspects of a string (i.e. transformed into upcase, array of its bytes, its encoding)
raphie has quit [Read error: Connection reset by peer]
MasterIdler_ has joined #ruby
dagnachewa has quit [Quit: Leaving]
<burgestrand> EstanislaoStan: however, for CRuby, the actual *raw* data is stored in C and is not directly accessible from memory, but given String#replace exists you don’t need to be able to access it.
<EstanislaoStan> Yeah, thanks. I figured out how to do what I wanted. I needed to use self. I.E. regex_occurance_position = self =~ regex. I'm not trying to replace the string, I'm trying to make a method of the String class that will out put the integer values of the positions that every occurance of the regex happens. Whereas =~ only give the first position of the occurance.
bosent has quit []
<burgestrand> EstanislaoStan: aye, I remember. I’d suggest you use String#scan with it’s block form, it’ll give you all matches in a given string. You could iterate through these to find the indices after that.
havenn has quit [Remote host closed the connection]
wiskey5alpha has joined #ruby
sdwrage has joined #ruby
<EstanislaoStan> Ok, thanks for all your help. I'll give that a try.
<burgestrand> EstanislaoStan: another hint, $~ contain’s the MatchData for the previous match, you’ll be likely to want to use it. :)
tvw has quit [Remote host closed the connection]
Speed has quit [Ping timeout: 245 seconds]
<EstanislaoStan> Ok. :)
justsee has joined #ruby
fbernier has joined #ruby
strnx has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
jorge has joined #ruby
mehlah has quit [Quit: Leaving...]
dagnachewa has joined #ruby
SCommette has joined #ruby
Spooner has quit [Ping timeout: 252 seconds]
jorge has quit [Remote host closed the connection]
stephenjudkins has quit [Quit: stephenjudkins]
SCommette has quit [Client Quit]
Goles has joined #ruby
havenn has joined #ruby
tiripamwe has quit [Ping timeout: 260 seconds]
aantix has quit [Ping timeout: 248 seconds]
beakerman has quit [Remote host closed the connection]
robert- has quit [Quit: Linkinus - http://linkinus.com]
havenn has quit [Remote host closed the connection]
<bricker88> So there is a discrepancy it seems between ruby-1.9.3-p0 and ruby-1.9.3-p194… in the former `y 1` works, in the latter it throws "NoMethodError: undefined method `y' for main:Object"
tompsony has joined #ruby
<tompsony> Hello! I got the following error in my ftp client that is preventing the script to continue a new section.
dagnachewa has quit [Quit: Leaving]
Godslastering has joined #ruby
schickung has joined #ruby
jorge has joined #ruby
GeekOnCoffee has quit [Ping timeout: 244 seconds]
S2kx has quit [Read error: Connection reset by peer]
gtuckerkellogg has joined #ruby
sgronblom has joined #ruby
<macer1> burgestrand: https://gist.github.com/65a6a8781593063d7ceb why it is not working
<macer1> returning empty hash, the mapping
S2kx has joined #ruby
pushp0p is now known as can_i_get_a_witn
can_i_get_a_witn is now known as canigetawitness
adeponte has quit [Remote host closed the connection]
<burgestrand> macer1: condition #2 in the mapping. None of your classes are descendants of Packet.
yugui is now known as yugui_zzz
sent-hil has quit [Remote host closed the connection]
<macer1> oh *facepalm*, I changed that recently
<macer1> thanks!
iori has joined #ruby
<burgestrand> macer1: also you have two classes with the same id :)
<macer1> condition #3
<macer1> :)
<macer1> also look at top comment
<macer1> you send a Login and receive a LoginResponse
<macer1> and I want only the response to be in mappings
yugui_zzz is now known as yugui
ryh_ has quit [Remote host closed the connection]
Stalkr_ has quit [Quit: Leaving...]
davidcelis has quit [Quit: K-Lined.]
Godslastering has quit [Changing host]
Godslastering has joined #ruby
Jay_Levitt has quit [Ping timeout: 264 seconds]
<macer1> ok this is the mapping
<macer1> {3=>Protocol29::Msg, 1=>Protocol29::LoginResponse}
<macer1> my id is 1
<macer1> mapping[id] = ni;
<macer1> nil*...
wiskey5alpha has left #ruby [#ruby]
<macer1> I mean that it is nil
<macer1> how can it be
<burgestrand> macer1: looks like it isn’t :)
<burgestrand> macer1: so either your mapping is wrong, or your id is wrong
<macer1> p id = 1
<tompsony> Hello I have an ftp client that is stopping when authentication failures.
<tompsony> I need to ignore this error for him to continue to the next login.
dagnachewa has joined #ruby
dankest has quit [Quit: Linkinus - http://linkinus.com]
<macer1> burgestrand: weird :(
<burgestrand> macer1: something is not what you think it is
mrsolo has quit [Quit: Leaving]
cantonic has quit [Quit: cantonic]
<macer1> p map, p id, p map[id]
kvirani has joined #ruby
<macer1> correct map, 1, nil
<macer1> :(
fbernier has quit [Ping timeout: 260 seconds]
<burgestrand> macer1: use pry instead of printing things, less margin for error
<burgestrand> also easier to test things
kvirani has quit [Remote host closed the connection]
darren has quit [Remote host closed the connection]
<macer1> I used pp
<macer1> still nil
pdtpatrick has quit [Quit: pdtpatrick]
jrajav has quit [Ping timeout: 250 seconds]
<macer1> oh
<macer1> guess what
<macer1> it was a hex byte or sthing :)
tiripamwe has joined #ruby
tompsony has quit [Quit: CyberScript - It is. Are you? (www.cyberscript.org)]
<macer1> id.to_i fixed it
nesoi has joined #ruby
<macer1> yay, it automaticaly converts it to proper packet ^.^
tiripamwe has quit [Client Quit]
tiripamwe has joined #ruby
Gurpartap has joined #ruby
<Gurpartap> Is there a concern about obfuscating developer's email in gemspec?
<Gurpartap> what do devs do commonly?
<nesoi> I have a very stupid question: some time ago I set up ruby on my macbook, but now I forget how I would have set it up, and when I type ruby, it is invoking the older version that came with 10.6. Can anyone suggest how I should try invoking a newer version I would have set up?
savage- has quit [Remote host closed the connection]
<Gurpartap> nesoi: `ls ~/.r*`
<Gurpartap> nesoi: does it have .rvm or .rbenv ?
GeekOnCoffee has joined #ruby
emmanuelux has quit [Ping timeout: 264 seconds]
<nesoi> Gurpartap, no idea. It's what I would have installed as 1.9.2 or whatever
<Gurpartap> nesoi: if you use brew, see if you installed the ruby-build brew formula
<nesoi> yeah, I have brew
<Gurpartap> `brew list`
<nesoi> but no ruby-build
foEs has joined #ruby
<Gurpartap> nesoi: do you have anything informative your $PATH ?
opus has quit [Quit:]
<nesoi> hm. just libgpg-error and libk.sba
<Gurpartap> in your*
<nesoi> nothing useful in $PATH
<nesoi> where would it usually be installed?
bradhe has quit [Remote host closed the connection]
Hawklord has quit [Ping timeout: 276 seconds]
liluo has joined #ruby
stephenjudkins has joined #ruby
artOfWar has quit [Ping timeout: 244 seconds]
richardcreme has quit [Ping timeout: 244 seconds]
uris has joined #ruby
EstanislaoStan has quit []
Hanmac1 has joined #ruby
yugui is now known as yugui_zzz
Hanmac has quit [Ping timeout: 264 seconds]
nari has joined #ruby
SCommette has joined #ruby
SCommette has quit [Client Quit]
maletor has quit [Quit: Computer has gone to sleep.]
richardcreme has joined #ruby
maucat has joined #ruby
yugui_zzz is now known as yugui
<nesoi> Gurpartap, any idea where I should look?
SCommette has joined #ruby
<Gurpartap> nesoi: the OS default is usually at /usr/bin/ruby
jarjar_prime has quit [Quit: Sleep time.]
TorpedoSkyline has joined #ruby
<burgestrand> Gurpartap: did you check your home directory for .rbenv or .rvm?
<burgestrand> Uh.
<burgestrand> nesoi: ^
<burgestrand> Username fail.
<Gurpartap> nesoi: a custom install would unlikely be overriding that. so maybe look some where in dot dirs your home directory?
<Gurpartap> burgestrand: i asked that. apparently not there
<Gurpartap> in your home*
<burgestrand> Gurpartap: your response was "no idea", I don’t take that for an answer :p
monkegjinni has quit [Remote host closed the connection]
<Gurpartap> burgestrand: nesoi's response. not mine XD
<Gurpartap> although you're right. could still be the case
<burgestrand> Gurpartap: response to you, your response :d
<Gurpartap> response to you != your response :P
<burgestrand> ;)
* Gurpartap is not fighting
<Gurpartap> :P
adamkittelson has joined #ruby
justsee is now known as justsee|away
lorandi has joined #ruby
<nesoi> yes, the default is /usr/bin/ruby, but I don't know where the custom install is
htroyack has joined #ruby
richardcreme has quit [Ping timeout: 244 seconds]
adeponte has joined #ruby
<nesoi> ruby is not in my home dir
<nesoi> where does it go by default when installed?
htroyack has quit [Client Quit]
balki has quit [Remote host closed the connection]
SCommette has quit [Quit: SCommette]
adeponte has quit [Remote host closed the connection]
yugui is now known as yugui_zzz
adeponte has joined #ruby
richardcreme has joined #ruby
<Quadlex> nesoi: I imagine that depends on your OS
htroyack has joined #ruby
baroquebobcat has joined #ruby
<nesoi> osx 10.6 Quadlex
<Gurpartap> Quadlex?
<Gurpartap> did canonical ship this osx version?
<Gurpartap> :p
<Gurpartap> Great. rubygems signup form takes me to Page not found
voodoofish430 has quit [Quit: Leaving.]
balki has joined #ruby
alanp has joined #ruby
<Quadlex> nesoi: No idea, I'm afraid:P
bradhe has joined #ruby
<Quadlex> Gurpartap: I didn't know it was OSX, I joined the conversation late
<Gurpartap> Quadlex: ah wait. i misinterpreted his response. i didn't know we have someone with the name Quadlex in the chat
<Gurpartap> and thought that his os had a nick "Quadlex"
<Gurpartap> :)
* Quadlex doffs his bonnet
<Gurpartap> lol
phanousit has joined #ruby
<phanousit> hello
<Quadlex> There's a unix xommand to show where something's insalled isn't therE?
<Quadlex> ...installed
<Quadlex> Isn't that what where does?
<Gurpartap> which / whereis
<burgestrand> You also have locate
<nesoi> which only shows you the default path
<Gurpartap> but that'll only show the ruby version that nesoi already knows
<burgestrand> At least on OS X.
vvgomes has joined #ruby
adeponte has quit [Ping timeout: 248 seconds]
foEs has quit [Remote host closed the connection]
apok_ has joined #ruby
locriani has quit [Remote host closed the connection]
apok has quit [Ping timeout: 244 seconds]
lunitikcalm has quit [Remote host closed the connection]
apok_ has quit [Ping timeout: 260 seconds]
justsee|away is now known as justsee
jarednorman has quit [Ping timeout: 252 seconds]
Ionic` has joined #ruby
freeayu__ has joined #ruby
MasterIdler_ is now known as MasterIdler
mascool has quit [Ping timeout: 244 seconds]
freeayu has quit [Ping timeout: 250 seconds]
vitor-br has joined #ruby
schickung has quit [Quit: schickung]
sent-hil has joined #ruby
rakm has quit [Quit: Computer has gone to sleep.]
<nesoi> ok, so I found a bunch of ruby in my home dir under .gem/ruby, etc. I don't think that's how I was invoking it though
sent-hil has quit [Remote host closed the connection]
<nesoi> also under .rvm
<burgestrand> nesoi: you have an .rvm?
<nesoi> yeah
<burgestrand> nesoi: if you type rvm -v, what do you see?
<nesoi> rvm 1.10.3 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]
<burgestrand> nesoi: rvm list
<nesoi> rvm rubies
<nesoi> ruby-1.9.3-p125 [ x86_64 ]
<nesoi> # Default ruby not set. Try 'rvm alias create default <ruby>'.
<nesoi> # =* - current && default
<nesoi> # => - current
<nesoi> # * - default
<burgestrand> nesoi: you see, rvm is one of the few preferred ways of installing ruby yourself :)
<burgestrand> nesoi: you can switch to your installed ruby 1.9.3 with "rvm use 1.9.3-p125"
<burgestrand> nesoi: after that, ruby -v should show you 1.9.3 instead of your system’s default
jorge has quit [Remote host closed the connection]
<nesoi> yes, it worked, thanks
<burgestrand> nesoi: you can make it your default one with "rvm use 1.9.3-p125 --default"
<burgestrand> nesoi: that way it will be that ruby when you start a new terminal, too
<nesoi> cool, do I have to install gems some special way too?
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<burgestrand> nesoi: no, once you have made "rvm use rubyversion" both ruby, gem and irb have all been replaced
<nesoi> so just gem install gemname
<burgestrand> I shouldn’t say replaced, but you’ll be using the correct version of them all
<burgestrand> nesoi: yep!
<nesoi> okay thanks~
<burgestrand> that includes gem binaries too
baroquebobcat has quit [Quit: baroquebobcat]
SuperSonicSound has joined #ruby
<nesoi> hm now I'm getting
<nesoi> libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
<nesoi> -----
<nesoi> *** extconf.rb failed ***
<nesoi> trying to gem install a gem
<burgestrand> nesoi: you used homebrew, right?
stephenjudkins has quit [Ping timeout: 250 seconds]
<nesoi> I guess so
<nesoi> I'm following the instructions on that webpage now
<burgestrand> nesoi: it should be enough to install libiconv with homebrew, the webpage doesn’t say anything about that
TorpedoSkyline has joined #ruby
Targen has quit [Ping timeout: 244 seconds]
<nesoi> it says it doesn't work
gtuckerkellogg has joined #ruby
vjacob has joined #ruby
<burgestrand> nesoi: doing "brew install libiconv" and then "brew link libiconv" and try to install your gem again
tomzx has joined #ruby
benyarb has joined #ruby
<burgestrand> nesoi: it says if you have issues when it should work, which is probably not the problem you are having, you most likely don’t have it at all
yugui_zzz is now known as yugui
<nesoi> oops I just issued those 2 brew commands on that page. did I screw something up?
benyarb has quit [Client Quit]
<burgestrand> nesoi: the libxml xslt things? Naw, you should be alright. Was probably a good thing :)
<tomzx> hi, I'm running a very small test suite, 12 tests with 20 assertions, and it's taking over 12s to complete... I'm running the tests with -rprofile and #toplevel is only 0.64s. Any idea what's going on here?
seanstickle has joined #ruby
jblack_ has joined #ruby
TheShadowFog has joined #ruby
beakerman has joined #ruby
Araxia has quit [Quit: Araxia]
jarjar_prime has joined #ruby
jarjar_prime has quit [Client Quit]
<reuf> anybody used octopress in herE?
havenn has joined #ruby
manizzle has quit [Ping timeout: 260 seconds]
dagnachewa has quit [Quit: Leaving]
darren_ has joined #ruby
jblack_ has quit [Quit: leaving]
jblack has joined #ruby
macer1 has quit [Remote host closed the connection]
fivetwentysix has joined #ruby
abdulkarim has quit [Ping timeout: 264 seconds]
ianbrandt has quit [Quit: ianbrandt]
<nesoi> burgestrand, gem install still gives me the not found message... any idea what to try next?
darren_ has quit [Ping timeout: 260 seconds]
<burgestrand> nesoi: now it’s probably time to follow the website I’m afraid :)
<nesoi> :)
<nesoi> wget command not found ugh
ProLoser|Work has quit [Quit: Music to Code to: http://turntable.fm/freenode]
justsee is now known as justsee|away
ZachBeta has quit [Quit: Computer has gone to sleep.]
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
emsilva has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
jorge has joined #ruby
havenn has quit [Remote host closed the connection]
wvms has quit [Read error: Connection reset by peer]
wvms has joined #ruby
yugui is now known as yugui_zzz
crankycoder has quit [Remote host closed the connection]
bricker88 has quit [Quit: Leaving.]
jjbohn has quit [Quit: Leaving...]
tomzx has left #ruby ["Quitte"]
<nesoi> burgestrand, I went through that whole thing, and I still get the same missing message
fowl has joined #ruby
<burgestrand> nesoi: paste the install command and the final error, just to double-check
<nesoi> which install command?
<nesoi> gem install ruby-mws
<burgestrand> nesoi: did you install nokogiri?
<burgestrand> nesoi: like it says here: http://nokogiri.org/tutorials/installing_nokogiri.html
<nesoi> yes, but it only took thei first --wth
ortho_stice has quit [Ping timeout: 255 seconds]
<burgestrand> nesoi: did it install successfully?
<nesoi> oops, I was using the .8 brew... now I tried it and it gives the same libiconv is missing error
AlbireoX`Laptop has joined #ruby
<nesoi> Macintosh:libiconv-1.13.1 ril$ brew link libxml2 libxslt libiconv
<nesoi> Linking /usr/local/Cellar/libxml2/2.7.8...
<nesoi> Another version is already linked: /usr/local/Cellar/libxml2/2.7.8
<nesoi> Error: Cannot link libxml2
ryanf has joined #ruby
freeayu__ has quit [Read error: Connection reset by peer]
<phanousit> hey are we able to put methods in hashes?
<burgestrand> phanousit: yep
<phanousit> i like that
<burgestrand> phanousit: *high five*
<phanousit> I'm looking to land an internship doing ruby, does anyone have any tips?
justsee|away is now known as justsee
ngoldman has quit [Remote host closed the connection]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<burgestrand> phanousit: yeah, find a ruby user group in your area, you’ll meet a bunch of rubyists and might get some good leads.
<fowl> phanousit: don't get caught having sex with the president
<phanousit> hah
<phanousit> why do you guys think of the job prospects of ruby in the future
sdwrage has quit [Quit: geekli.st/programmer]
<burgestrand> I’m still hoping for flying cars by then.
<fowl> hoping for flying burger stands
odigity has quit [Ping timeout: 264 seconds]
<fowl> by then the Son of Rails will have fulfilled the prophecy and slain his father (hopefully)
htroyack has quit [Quit: see you tomorrow]
locriani has quit [Ping timeout: 250 seconds]
locriani has joined #ruby
nesoi has quit [Quit: This computer has gone to sleep]
freeayu has joined #ruby
nesoi has joined #ruby
stefanp_ has joined #ruby
<nesoi> burgestrand, any other ideas? I tried what's on that page and it still can't find libiconv
jrajav has joined #ruby
<burgestrand> nesoi: I’m afraid not. If following those instructions to install nokogiri does not help I’d just turn to googling. Never had this issue myself, even though I reinstall my mac fairly often.
<nesoi> anyone else have an idea what to do? the error message is here: http://pastebin.com/qMTuydE4
noganex has quit [Read error: Operation timed out]
odigity has joined #ruby
<burgestrand> nesoi: it doesn’t look like you supplied the necessary install options when installing nokogiri there.
stefanp has quit [Ping timeout: 265 seconds]
brianpWins has quit [Quit: brianpWins]
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
<nesoi> burgestrand, for brew 0.8 it said to just do gem install nokogiri
<burgestrand> nesoi: make sure /usr/local/Cellar/libiconv/1.13.1 exists, and that you pass all the extra —with-xml2-include, etc when you install nokogiri
<burgestrand> nesoi: ah, so it does, I’d still give the —with-thing a try though.
cakehero has quit [Quit: Leaving...]
Tomasso has quit [Ping timeout: 252 seconds]
noganex has joined #ruby
adeponte has joined #ruby
stefanp_ has quit [Ping timeout: 265 seconds]
ryanf has quit [Ping timeout: 264 seconds]
ttilley has quit [Ping timeout: 245 seconds]
ttilley has joined #ruby
ttilley has quit [Changing host]
ttilley has joined #ruby
seanstickle has quit [Quit: seanstickle]
MasterIdler has quit [Quit: MasterIdler]
dhruvasa1ar has joined #ruby
fbernier has joined #ruby
fbernier has quit [Client Quit]
epochwolf has quit [Ping timeout: 260 seconds]
denysonique has quit [Excess Flood]
icambridge has quit [Excess Flood]
epochwolf has joined #ruby
epochwolf has quit [Changing host]
epochwolf has joined #ruby
icambridge_ has joined #ruby
mdickens has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
wallerdev has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
wallerdev has quit [Read error: Connection reset by peer]
rutkla_ has joined #ruby
rutkla has quit [Ping timeout: 260 seconds]
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
itnomad has quit [Quit: Leaving]
andrewhl has joined #ruby
<Gurpartap> Why would (int)RSTRING_LEN ever return 0 for a string that really exists :S
mengu has quit [Remote host closed the connection]
<Gurpartap> in this particular case, i'm passing an instance attribute to a method which ends up calling RSTRING_LEN to check for the var's length. and it fails there.
<Gurpartap> even though if i puts out the variable myself, it definitely is fine.
<Gurpartap> if, instead of referencing to the attribute variable, i pass in a string manually, then it works fine.
<Gurpartap> anyone know where i'm going wrong?
<Gurpartap> s/know/knows/
<burgestrand> Gurpartap: could you provide a minimal example?
nesoi has quit [Quit: This computer has gone to sleep]
jorge has quit [Remote host closed the connection]
<Gurpartap> burgestrand: it's my own library, http://github.com/Gurpartap/aescrypt, which ends up calling one of openssl's function: https://github.com/emboss/ruby-openssl/blob/master/ext/openssl/ossl_cipher.c#L334
<Gurpartap> burgestrand: and i'm overriding an attribute's getter in my model, where i decrypt the value of that attribute for display (the value is stored as encrypted in the db; the encryption being done in before_save hook)
w400z has joined #ruby
<Gurpartap> burgestrand: the openssl line #334 is where it fails if i pass it like this:
ananthakumaran has joined #ruby
bier has quit [Remote host closed the connection]
<Gurpartap> def my_attr; AESCrypt.decrypt(read_attribute(:my_attr), "p4ssw0rd"); end
w400z has quit [Client Quit]
<Gurpartap> the above produces the error
<Gurpartap> the following however, doesn't:
bier has joined #ruby
<Gurpartap> def my_attr; AESCrypt.decrypt("a long encrypted value that i copy pasted here from the value of stored my_attr", "p4ssw0rd"); end
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
beakerman has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
w400z has joined #ruby
<burgestrand> Gurpartap: to the receiving method, AESCrypt.decrypt, there is no difference
<burgestrand> Gurpartap: the only thing that has an impact is the return value of read_attribute, which is probably just returning an empty string here
<Gurpartap> burgestrand: def my_attr; read_attribute(:my_attr); end
<Gurpartap> burgestrand: this works as excepted, however
<Gurpartap> which is why i'm uncertain about what's happening
grey__ has joined #ruby
<burgestrand> Gurpartap: I don’t know what you expect
mucker has quit [Ping timeout: 272 seconds]
<Gurpartap> burgestrand: i dont know why, when i pass the reference to read_attribute(:my_attr) to decrypt, it doesn't read it :/
<burgestrand> Gurpartap: read it to a local variable, hop into a pry session, inspect the local variable, run decrypt on it
vvgomes_ has joined #ruby
vvgomes has quit [Ping timeout: 246 seconds]
davidcelis has joined #ruby
<Gurpartap> let me
<burgestrand> Gurpartap: ought to reveal what’s happening to you :)
gmci has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby
lorandi has quit [Quit: Leaving]
manizzle has joined #ruby
havenn has quit [Ping timeout: 246 seconds]
indian has quit [Read error: Operation timed out]
kpshek has joined #ruby
kpshek has quit [Client Quit]
baroquebobcat has joined #ruby
tiripamwe has quit [Quit: Leaving]
brianpWins has joined #ruby
grey__ has quit [Quit: Leaving]
nedbat has quit [Ping timeout: 276 seconds]
sgronblo1 has joined #ruby
friskd has quit [Ping timeout: 240 seconds]
sgronblom has quit [Ping timeout: 255 seconds]
jameshyde has joined #ruby
Bosma has quit [Ping timeout: 255 seconds]
Nanuq has quit [Ping timeout: 245 seconds]
vvgomes_ is now known as vvgomes
mockra has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
igotnolegs has joined #ruby
Rezwan has quit [Read error: Connection reset by peer]
burgestrand has quit [Quit: Leaving.]
verbad has joined #ruby
vitor-br has quit [Quit: Saindo]
jonathanwallace has quit [Ping timeout: 255 seconds]
jarred has joined #ruby
vvgomes has left #ruby [#ruby]
AlbireoX`Mac has joined #ruby
AlbireoX`Laptop has quit [Ping timeout: 246 seconds]
Vert has quit [Ping timeout: 252 seconds]
td123 has joined #ruby
Foxhoundz has joined #ruby
<Foxhoundz> Ruby.
jrajav has quit [Quit: The best darkness is strange and surprising]
TPFC-SYSTEM has joined #ruby
Nanuq has joined #ruby
<fowl> RUBY!
tommyvyo has joined #ruby
adeponte has quit [Remote host closed the connection]
adeponte has joined #ruby
indian has joined #ruby
apok has joined #ruby
Cache_Money has joined #ruby
<Cache_Money> i'm working on a problem and need some guidance. How would you suggest I go about solving this problem http://www.checkio.org/mission/info/addendums/python-27/
htroyack has joined #ruby
dhruvasa1ar has quit [Read error: Connection reset by peer]
adeponte has quit [Ping timeout: 248 seconds]
<davidcelis> RUUUUUBBBYYYYYYYYYYY
<Paradox> with soup
<Paradox> always use soup
dhruvasagar has joined #ruby
<Gurpartap> rooby
uris has quit [Quit: Lost terminal]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
troyack has joined #ruby
troyack has quit [Client Quit]
fowl has quit [Ping timeout: 246 seconds]
centipedefarmer has quit [Quit: This computer has gone to sleep]
<Paradox> rewbie
codora has quit [Quit: Heaven is not a place, it's being with people who love you.]
krz has quit [Quit: krz]
<davidcelis> rübee
fralcon_ has joined #ruby
fralcon has quit [Read error: Connection reset by peer]
htroyack has quit [Ping timeout: 240 seconds]
<Paradox> ®øߥ
td123 has quit [Quit: WeeChat 0.3.8]
td123 has joined #ruby
<davidcelis> roby?
<Foxhoundz> I'm new to Ruby.
<davidcelis> Foxhoundz: I'm new to you.
<Foxhoundz> Also RoR for that matter.
<Foxhoundz> As well as MVC...
<Spaceghostc2c> I'm new to being new.
solofight has joined #ruby
<solofight> people is there any ready made library which i can utilize for solving a transportation problem ?
statix_ has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
<davidcelis> solofight: how delightfully vague
stat1x has joined #ruby
<davidcelis> what constitutes "a transportation problem"?
<heftig> sounds like travelling salesman to me
<solofight> davidboy: shipment problem in other words
<heftig> that's not any better
savage- has joined #ruby
AndChat| has joined #ruby
<solofight> davidboy: vehicle routing software library that uses algorithms to calculate an optimized allocation of orders and stops to mobile resources
<solofight> heftig: ^
juarlex has joined #ruby
andrewhl has joined #ruby
jblack has quit [Ping timeout: 264 seconds]
phoe6 has joined #ruby
havenn has joined #ruby
jblack has joined #ruby
Banistergalaxy has quit [Ping timeout: 244 seconds]
<solofight> davidcelis: ^
stephenjudkins has quit [Quit: stephenjudkins]
<phoe6> Hi, how I can test a kernel method - for e.g http://uthcode.codepad.org/xkpE1py4
<phoe6> how can i test canonical here?
<phoe6> canonical.respond_to?
<phoe6> says - ArgumentError: wrong number of arguments (0 for 1)
adeponte has joined #ruby
<phoe6> I just wanted to test that a Kernel method is callable.
CannedCorn has joined #ruby
bglusman has quit [Remote host closed the connection]
solofight 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"]
SuperSonicSound has quit [Quit: Leaving]
juarlex has quit [Quit: leaving]
Guest91275 has joined #ruby
<Paradox> hey Foxhoundz
<Paradox> how goes it
wallerdev has joined #ruby
joshman_ has quit [Quit: Computer has gone to sleep.]
noyb has joined #ruby
cj3kim has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
adamkittelson has quit [Remote host closed the connection]
julio has joined #ruby
julio has quit [Client Quit]
Nanuq has quit [Ping timeout: 245 seconds]
locriani has quit [Remote host closed the connection]
chee has joined #ruby
gtuckerkellogg has joined #ruby
fowl has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
jarred has quit [Remote host closed the connection]
klotho has joined #ruby
<phoe6> any help?
<phoe6> help?
jarred has joined #ruby
<chee> hi !
<phoe6> Looks like I can do Kernel.respond_to?("canonical")
<phoe6> that's pretty much what I was looking for.
freeayu has joined #ruby
krusty_ar has quit [Read error: Operation timed out]
dhruvasagar has quit [Ping timeout: 252 seconds]
locriani has quit [Ping timeout: 246 seconds]
ryanf has joined #ruby
<Quadlex> How can I return two values from a begin - rescue - end block?
<Quadlex> I'm trying begin; true, 7; rescue; end;
<Quadlex> And getting a syntax error
<banisterfiend> Quadlex: [true, 7]
baroquebobcat has quit [Quit: baroquebobcat]
ryanf has quit [Ping timeout: 246 seconds]
tonini has joined #ruby
gtuckerkellogg has quit [Ping timeout: 250 seconds]
baroquebobcat has joined #ruby
ReTFEF has joined #ruby
TheTFEF has quit [Ping timeout: 240 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
mockra has quit [Remote host closed the connection]
mascool has joined #ruby
<Quadlex> Thanks banisterfiend
AlbireoX`Mac has quit [Read error: Connection reset by peer]
AlbireoX`Laptop has joined #ruby
Hanmac1 is now known as Hanmac
phoe6 has quit [Quit: Bye, leaving for the day.]
fralcon_ has quit [Quit: fralcon_]
a_a_g has joined #ruby
charlies_ has joined #ruby
charlies_ is now known as charliesome_
ryanf has joined #ruby
jarred has quit [Quit: jarred]
jarred has joined #ruby
jhunter has quit [Ping timeout: 240 seconds]
tomb_ has joined #ruby
rutkla_ has quit [Ping timeout: 240 seconds]
w400z has quit []
jhunter has joined #ruby
<klotho> hello, I'm having a problem where libiconv is not found when doing a ruby gem install. has anyone else run into this and found a solution?
Nanuq has joined #ruby
CannedCorn has quit [Quit: Computer has gone to sleep.]
Chryson has quit [Quit: Leaving]
friskd has joined #ruby
Ionic` has quit [Ping timeout: 248 seconds]
<Hanmac> klotho whats your system, your ruby version, and what gem?
adeponte has quit [Remote host closed the connection]
<klotho> hi Hanmac. it's osx 10.6, ruby 1.9.2-p318 and the gem is nokogiri
adeponte has joined #ruby
<Hanmac> hm try to upload to an newer ruby version ...
<klotho> what do you suggest?
<Hanmac> you could try to find an newer ruby or build from source ...
<Hanmac> (but first you could post the error that gem install shows)
Jacob_ has joined #ruby
Jacob_ is now known as ecksit
<klotho> pastebin.com/qMTuydE4
rutkla has joined #ruby
adeponte has quit [Ping timeout: 248 seconds]
araujo has quit [Quit: Leaving]
ryanf has quit [Quit: leaving]
savage- has quit [Remote host closed the connection]
mockra has joined #ruby
mockra has quit [Remote host closed the connection]
<klotho> thanks Hanmac. I tried all those steps and it still fails
<klotho> that error message was AFTER trying those steps
<klotho> (the same error message as before)
<Hanmac> did you try it with the correct homebrew or mackports version?
<klotho> I haven't tried macports
Morkel has joined #ruby
<klotho> I have homebrew 0.8
arkiver has joined #ruby
indian has quit [Ping timeout: 260 seconds]
<klotho> should I try macports? I was afraid of weird conflicts
<Hanmac> hm no ... normaly it should work when you use install libiconv and link it ...
<klotho> so what shall I try?
<Hanmac> what does "brew install libxml2 libxslt libiconv" output?
<klotho> No available formula for libiconv
<klotho> no sorry
<klotho> typo
<Paradox> you need to install xcode command line tools
<Paradox> install xcode
<klotho> all get error, already installed
<klotho> xcode is installed
<Paradox> open it and go to preferences
<klotho> ok
<Paradox> downloads
<Paradox> click install by command line tools
<Paradox> also, you probably need XQuartz
<klotho> there's no downloads under preferences
leoncamel has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
jonathanwallace has joined #ruby
<Paradox> then you dont have xcode 4
<klotho> 3.2.6
<klotho> ok, but I don't have 4
<klotho> do I need it to fix this problem??
n1x has joined #ruby
Eldariof-ru has joined #ruby
<Paradox> yeah
<Paradox> 4 is free on the mac app store
<Hanmac> an linux would solv your problem too
<klotho> Hanmac: : )
<Paradox> linux causes more problems than it solves on desktops
<Paradox> on headless id agree with you
<Paradox> desktop…not so much
<klotho> xcode 4 doesn't support 10.6
<Paradox> well theres your problem
<klotho> so either I'm SOL or there's another way to get this gem to install
<klotho> I think there must be another way
<Paradox> it needs libiconv?
<klotho> yeah
sent-hil has joined #ruby
<Paradox> run brew search libiconv
fantazo has quit [Remote host closed the connection]
baphled has joined #ruby
<Paradox> do what it says
jonathanwallace has quit [Ping timeout: 252 seconds]
<Paradox> basically apple distributes it
<Paradox> but some brews fuck shit up
<Paradox> homebrew/dupes/libiconv show how to fix
cloud|droid has joined #ruby
cloud_droid has joined #ruby
yakko has quit [Read error: Connection reset by peer]
<klotho> Paradox : you mean the directory homebrew/dupes/libiconv
<Paradox> that or the project
<Paradox> on github
<klotho> if I do brew search libiconv it just shows that it found libiconv
twinturbo has joined #ruby
jwmann has quit [Quit: Leaving.]
Fretta has quit [Quit: Fretta]
quest88 has quit [Read error: Connection reset by peer]
mascool has quit [Ping timeout: 244 seconds]
rutkla has quit [Ping timeout: 248 seconds]
<klotho> brew finds libiconv, gem install doesn't
<Paradox> you dont see this ?
Cache_Money has quit [Ping timeout: 246 seconds]
twinturbo has quit [Client Quit]
verbad has quit []
quest88 has joined #ruby
vectorshelve has joined #ruby
twinturbo has joined #ruby
<klotho> Paradox : not sure what action I should take based on that to make gem install see it
<Paradox> idk
<Paradox> sorry i couldnt help more
<Paradox> im off to bed
<twinturbo> hey
<klotho> thanks anyway
<klotho> hi twinturbo
<klotho> so, no one knows how to make gem install see libiconf on osx 10.6?
<Hanmac> klotho i think that "homebrew/dupes/libiconv" means a path
<Hanmac> have you tryed to goto there?
<klotho> right, so what do I do with that?
<twinturbo> how can I setup something that triggers a callback when a child process prints to stdout ?
<Hanmac> its maybe a file or a dir
<klotho> I am searching for find / -name homebrew because I don't know if there is a "homebrew" directory
<klotho> I haven't found it yet
<klotho> nope, didn't find a homebrew directory
baphled has quit [Ping timeout: 246 seconds]
<klotho> brew is /usr/local/bin/brew
<klotho> not homebrew
mohits has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
<ecksit> how and why did everyone come across ruby?
indian has joined #ruby
friskd has quit [Ping timeout: 252 seconds]
jhunter has quit [Ping timeout: 246 seconds]
friskd has joined #ruby
<vectorshelve> Good Morning
<seoaqua> could anyone help me with https://gist.github.com/3214176 , pls? this is centos installing mechanize
<jblack> One of my contracts uses it. It wasn't long before I started using it everywhere else. =)
<Hanmac> ecksit RPGMaker2000 and its sequel RPGMakerXP
elhu has joined #ruby
<ecksit> my story is similar to jblack's
jhunter has joined #ruby
Foxhoundz has quit [Quit: Leaving]
mockra has joined #ruby
<Hanmac> seiaqua update rdoc first
jarred has quit [Quit: jarred]
<seoaqua> Hanmac, ok
und3f has joined #ruby
apok has quit [Quit: apok]
leoncamel has quit [Remote host closed the connection]
<fowl> Hanmac: thank god ruby saved you from rpgmaker
n1x has quit [Ping timeout: 260 seconds]
dekroning has joined #ruby
<dekroning> hi all
jblack has quit [Ping timeout: 255 seconds]
<Hanmac> fowl the rpgmaker versions make me think: "i can do it better" :P
mockra has quit [Ping timeout: 250 seconds]
Targen has joined #ruby
friskd_ has joined #ruby
friskd has quit [Read error: Connection reset by peer]
friskd_ is now known as friskd
gtuckerkellogg has joined #ruby
JarJar has joined #ruby
maesbn has joined #ruby
qwerxy has joined #ruby
<klotho> I may have fixed the problem with ports
ananthakumaran has joined #ruby
wallerdev has quit [Quit: wallerdev]
freeayu__ has joined #ruby
<Bauer> when compiling ruby from sources, how do I know which possible parameters can I pass to ./configure? I want to see the list of options
andrewhl has quit [Remote host closed the connection]
mascool has joined #ruby
freeayu has quit [Ping timeout: 264 seconds]
mobilegamelabs has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
<klotho> ok, now I'm getting my code to run a bit, but it's choking on mysql and activerecord. which gem should I install?
<td123> Bauer: ./configure --help
<td123> Bauer: that applies to pretty much all ./configures
cj3kim has quit [Quit: This computer has gone to sleep]
hippyphysicist has joined #ruby
conor_ireland has quit [Quit: conor_ireland]
<Bauer> ahh, thanks td123 :) never was interested in that before, until I learned some applications just dont include everything by default compilation :(
kennyvb has quit [Read error: Operation timed out]
hippyphysicist has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
reuf has quit [Quit: Leaving]
AndChat| has quit [Ping timeout: 260 seconds]
<Bauer> td123: any idea what is RUBY_DEBUG environment variable
friskd has quit [Quit: friskd]
<td123> no, I would have to check
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<td123> is this from the ./configure --help?
nesoi has joined #ruby
<Bauer> yes, I wonder if its required for debuggin ruby programs, or ruby itself
<nesoi> hello, I'm getting this error trying to run my ruby app http://pastebin.com/KAY4e5Ki
<nesoi> anyone know what to do to fix it? It works on Windows but not Mac... I think I have the wrong gem installed for mysql
JohnBat26 has joined #ruby
jblack has joined #ruby
locriani has quit [Ping timeout: 252 seconds]
jprovazn_away is now known as jprovazn
saschagehlich has joined #ruby
<Hanmac> shevy what do you think about this error? : http://bugs.ruby-lang.org/issues/6807 :D
r0bby_ has joined #ruby
n1x has joined #ruby
<shevy> Hanmac I think I saw it before
<shevy> it sucks
r0bby_ is now known as robbyoconnor
<shevy> but I dont think it happens in official releases
r0bby has quit [Ping timeout: 248 seconds]
Eldariof-ru has quit []
justsee is now known as justsee|away
td123 has quit [Quit: WeeChat 0.3.8]
<Hanmac> shevy http://bugs.ruby-lang.org/issues/6111 is more interesting for me
jonathanwallace has joined #ruby
gtuckerkellogg has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
sent-hil has quit [Remote host closed the connection]
igotnolegs has quit [Quit: Computer has gone to sleep.]
<shevy> they still have not fixed that one?
jonathanwallace has quit [Ping timeout: 240 seconds]
rutkla has joined #ruby
gavilan2 has left #ruby [#ruby]
Criztian has joined #ruby
Wizek has joined #ruby
<Hanmac> not yet but it is planed
<Wizek> hello
<Wizek> what is `(a, b) = [1, 2]` called in Ruby?
<Mon_Ouie> parallel assignment
<Wizek> I'm trying to do something similar with return values of methods on an object,
<Wizek> ty
<Mon_Ouie> A method that returns "multiple values" in Ruby is just a method that returns an array
<Wizek> Not like that :)
mascool has quit [Ping timeout: 244 seconds]
<Wizek> I meant that there is an object with multiple methods, which each return single values
<Wizek> I meant that there is an object with multiple methods, and each returns a single value*
<heftig> a, b, c = foo.a, foo.b, foo.c
banghouse has quit [Remote host closed the connection]
dhodgkin has quit [Read error: Operation timed out]
<Wizek> yep :)
<Wizek> ty
brianpWins has quit [Quit: brianpWins]
<Hanmac> or like this: a, b, c = [:a,:b,:c].map {|s| foo.send(s)}
<Hanmac> or like this: a, b, c = [:a,:b,:c].map(&foo.method(:send))
justsee|away is now known as justsee
jameshyde has quit [Remote host closed the connection]
jgrevich has quit [Quit: jgrevich]
aganov has joined #ruby
mockra has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
elhu has joined #ruby
aTastyCookie_ has joined #ruby
aTastyCookie_ is now known as aTastyCookie
m4rtijn has joined #ruby
<m4rtijn> good morning
<m4rtijn> does anyone know how to generate step definitions from a cucumber feature .. with cucumber?
<aTastyCookie> I'm a beginner looking for project ideas...
telling has quit [Remote host closed the connection]
<m4rtijn> im reading "the cucumber book" which just reads.. now run cucumber to generate step def.
mockra has quit [Ping timeout: 245 seconds]
nesoi has quit [Quit: This computer has gone to sleep]
<Bauer> hmmm I compiled from sources, and getting this:
<Bauer> It seems your ruby installation is missing psych (for YAML output).
<Bauer> To eliminate this warning, please install libyaml and reinstall your ruby.
Criztian has quit [Remote host closed the connection]
<Bauer> I did compile yaml from the source: yaml-0.1.4 and re-installed, but still the same msg
<Bauer> to be correct, did configure, make and make install all over
<m4rtijn> Bauer, why not use gems?
Criztian has joined #ruby
<Bauer> m4rtijn: what do you mean? how? I am totally new to ruby
mobilegamelabs has quit [Quit: Angry Polygon (iPhone/Android/Mac) - http://www.MGGGGG.com/ap #ratingexchange]
<Hanmac> Bauer what is your os? some kind of debianoid?
kennyvb has joined #ruby
<Bauer> Hanmac: Centos
<Bauer> 5.4
<m4rtijn> Bauer, i'd recommend reading up on RVM - it makes your ruby env totally OS independent
<m4rtijn> it's a bit of an overkill to start.. but makes everything a lot easier afterwards
<m4rtijn> especially usefull for outdated centOsses
<m4rtijn> :)
bluOxigen has joined #ruby
<Bauer> m4rtijn: how long would that take? ruby is only a means to an end to install redmine, not something I wanna spend the whole day at , today at least
<Hanmac> before you install ruby you should install its build-depends ... (i dont know how it sounds on centos)
<m4rtijn> ah.. k Bauer
<shevy> Bauer, this can not be
<m4rtijn> Bauer, i would recommend using an up to date OS version then anyways
<m4rtijn> and forget about rvm :)
<shevy> Bauer, I compiled yaml-0.1.4 from source into /usr prefix. Then I compiled ruby from source into /usr prefix. I get no error message
<Bauer> Hanmac: I am following this guide: http://www.freshblurbs.com/install-ruby-1-9-centos
<Hanmac> i think they miss yaml-devel
<shevy> why would he need yaml-devel
<shevy> he wrote he compiled yaml
<Bauer> shevy: hmmmm, I did it with ./configure --prefix=/usr/local - could this be the reason?
<shevy> <Bauer> I did compile yaml from the source
<Hanmac> hm /usr/local should be fine too
<shevy> could be. if you have yaml libraries in /usr/lib
<Hanmac> did you rerun ldconfig?
<banisterfiend> Hanmac: guten tag?
<Bauer> ok.. hmm how do I reinstall yaml into /usr then? :) hmm nope did not run ldconfig
<Bauer> should I try it first?
<shevy> you reinstall it by simply compling with --prefix=/usr
<shevy> *compiling
<Hanmac> Bauer ldconfig sould be run after you install libs ... it may solv your problem
<Hanmac> banisterfiend thats my quest to find out, if that day is good or not ... (currently its too cold for this season)
ABK has joined #ruby
freeayu__ has quit [Read error: Connection reset by peer]
<shevy> it's getting warmer
<banisterfiend> Hanmac: if you decide it is a good day, can you dress up in a pretty summer dress and come dancing with me
<Hanmac> shevy: currently its ~15°C
<Bauer> shevy, good guess! the culprit was indeed the --prefix=/usr/local
<shevy> we are at around 20°C
<Bauer> thanks guys :)
indian has quit [Ping timeout: 240 seconds]
<shevy> but I think we will reach about 25 today
freeayu has joined #ruby
<Hanmac> Bauer ... normaly it schould work with /usr/local ... i install my stuff also into it
<banisterfiend> Hanmac: can you wear a traditional german fraulein clothing when we go dancing
<Bauer> Hanmac: that centos shit is not 'normal', unfortunately :)
quest88 has quit [Quit: quest88]
<Bauer> hmmm I just did gem install bundler, and then doing bundle install --without development test I get: Could not locate Gemfile
* Hanmac prefers an ubuntu with some alpha stuff into it ... (imo packages cant be too-new :P)
<shevy> Bauer perhaps your /etc/ld.so.conf file does not list /usr/local
<shevy> or the configure script first tries to pick up /usr when it found /usr/*yaml* files
cantonic has joined #ruby
<shevy> no surprise. bundler sucks. only Hanmac likes it
<Bauer> shevy: /etc/ld.so.conf has only one line: include ld.so.conf.d/*.conf
<shevy> yeah
<shevy> they like to put the files in that directory
<shevy> I hate this
Eldariof-ru has joined #ruby
aTastyCookie has quit [Ping timeout: 246 seconds]
[Neurotic] has quit [Quit: off to mongodb]
<Bauer> but whats wrong? I didnt quite understand
<shevy> with bundler?
cantonic has quit [Client Quit]
mathie has joined #ruby
<Bauer> no, with the ld.so.conf, which you say cuases bundler not to find the Gemfile?
<shevy> I did not say that
<shevy> bundler of course works independent of ld.so.conf
pratz has joined #ruby
<Bauer> hmm ok, you said either that or the config script :) which one? where?
hoelzro|away is now known as hoelzro
pabloh has joined #ruby
<shevy> nono, I am not saying anything about bundler
MarGarina has joined #ruby
tk__ has joined #ruby
Bofu has joined #ruby
<shevy> you have to ask Hanmac about bundler
* Bauer pokes Hanmac :)
<Hanmac> :P that was mean ... i never used bundler ...
znouza_ has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Bauer> lies! :p
cezar has joined #ruby
freeayu has quit [Ping timeout: 260 seconds]
cezar has quit [Client Quit]
n1x has quit [Remote host closed the connection]
arkiver has quit [Remote host closed the connection]
Bofu2U has quit [Ping timeout: 246 seconds]
<Paradox> i got a bundler t-shirt today
<Paradox> out of the blue
Wizek has quit [Ping timeout: 246 seconds]
<Paradox> its a sexy shirt
<Paradox> looks like the kind my girlfriend wears
<shevy> ok good
<shevy> Bauer, you can ask Paradox
[eko] has quit [Quit: This computer has gone to sleep]
arturaz has joined #ruby
<Bauer> lol, Paradox can you help with the bundler issue? :)
<Paradox> what issue?
<Paradox> my first suggestion is run --pre
<Paradox> my scrollback isnt working for some reason
<Bauer> Paradox: I just did gem install bundler, and then doing bundle install --without development test I get: Could not locate Gemfile
<Paradox> do you have a gemfile?
tvw has joined #ruby
arkiver has joined #ruby
<Paradox> i know its obvious
<Paradox> but i have to ask
<shevy> lol
<Bauer> Paradox: I am not sure, how to check?
<Paradox> ls
<Bauer> ls where?
<Paradox> project root
<Paradox> is this a rails app?
mahmoudimus has joined #ruby
<Paradox> or something else
<Bauer> OHH, lol dumb me! I was still in the ruby source directory, not in remine... thanks Paradox :) hehe
<Paradox> lol
arkiver has quit [Max SendQ exceeded]
<shevy> !!!
<Paradox> "hello it have you tried turning it off and on again"
freeayu has joined #ruby
<aces23up> anyone know how I store a constant in a yaml file?
JasonBr0x has joined #ruby
<JasonBr0x> hello all, I got a server with "Red Hat Enterprise Linux ES release 4" and I wanted to install "libxml-ruby" but I got "libxml-ruby requires Ruby version >= 1.8.6" my actual version is 1.8.5, so how to upgrade that version if the repository says it's the last version it has ?
arkiver has joined #ruby
<Paradox> key: value
<Paradox> thats how
<Bauer> hmmm Paradox: it fails with: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. and another line: checking for mysql.h... no
<Paradox> then in your initialization parse it once
<banisterfiend> does apple have a streaming music service yet?
<Hanmac> JasonBr0x install ruby1.9.1-full
<Paradox> banisterfiend, nope
<Paradox> Bauer, you are missing a C dep
<JasonBr0x> Hanmac: thanks , let me try
<Bauer> Paradox: why does it miss? and how to add it?
<Paradox> thats not a bundler issue
<Paradox> can you install the gem normally?
<Bauer> Paradox: I just tried, same error
<shevy> Bauer it tells you
<shevy> mysql.h
<Paradox> then its not bundler's fault
sepp2k has joined #ruby
<Paradox> you're missing some system library
<Paradox> what os
<shevy> which is the C header file for mysql database
<Bauer> centos 5.4
<banisterfiend> sepp2k: hey seppy
<Paradox> yum install mysql
<Paradox> or something like that
<shevy> distributions by default believe that users are idiots and never need .h files
<Paradox> This is why OS X is nice
<Paradox> it doesnt do half of anything
<Paradox> you either get a perfectly working install
<Paradox> or nothing
<shevy> yeah
<shevy> Bauer is stuck with centos
<Paradox> poor bastard
jonathanwallace has joined #ruby
<hoelzro> shevy: depends on the distro
<hoelzro> but that *is* the trend =(
<shevy> once we are done with RubyOS, that will all have changed
<Bauer> Paradox: well this centos server has a working in production mysql server
<Paradox> Bauer, but not the header files
<hoelzro> shevy: =)
<Paradox> shevy, i just want a ruby shell that doesnt suck
<Paradox> no
<hoelzro> shevy: do you have a repo out there? =P
<Paradox> rush is NOT a good shell
<shevy> Paradox you mean, one that aims to replace bash, or one that uses only valid ruby code?
arkiver has quit [Ping timeout: 260 seconds]
<hoelzro> Paradox: you mean like a bash replacement?
<Paradox> both
<Paradox> more like a zsh or fish replacement
<Paradox> but yah
<Mon_Ouie> Ruby syntax feels bad for a shell
<shevy> hoelzro, hehehe ... not really... I think I am too lazy for a real RubyOS... and, I also think it would have to follow the C/UNIX model (Ruby/RubyOS), but ruby can't be as fast as C, so that kinda means, no real RubyOS alone... (unless one mixes in C ... but then one could use linux anyway...)
<Paradox> Mon_Ouie, i know
<Paradox> but some things it would work well for
<Mon_Ouie> Have to quote strings, globs that aren't expanded automatically, etc
<shevy> Paradox, I see
<hoelzro> I think that a Ruby shell (or any shell that uses a non-shell syntax for its scripting) is difficult by nature
<shevy> Paradox, I think one would need to use C for a ruby shell
<Paradox> i know
<Paradox> its a pipe dream
<Bauer> ok.. I am installing mysql-devel package now :( I hate the separation into devel packages...
<Paradox> Mon_Ouie, i've use rush
<Paradox> its terribal
<hoelzro> shevy: that's kinda what I'm thinking; thin Linux underneath, but with a sophisicated Ruby API on top
<banisterfiend> Paradox: what kind of thing do u have in mind? can u give example?
<shevy> I tried to write a replacement for bash, but listing content of directories is always slower than with bash so far :(
<hoelzro> kinda like what Android does
<shevy> yeah hoelzro, that could work
<shevy> still a lot of work :P
<hoelzro> because why write a kernel if you have to maintain it, and add drivers, etdc
<hoelzro> oh, totally
<Mon_Ouie> I'd think just adding the ability to run Ruby code easily from the shell (always keeping the same VM) would be more helpful than creating a whole replacement
<Paradox> banisterfiend, some drunken idea of ls.each { |f| f.mv('/aadsfakjsdfhadsf/') } or some shit like that
<Paradox> never anything coherent
<banisterfiend> Paradox: yuck
<Paradox> just something easier to use than Dir
jonathanwallace has quit [Ping timeout: 248 seconds]
<Paradox> as i said though
<hoelzro> Paradox: reminds me of hotwire
<shevy> Paradox well you could use all bash-like commands in such a shell too
<Paradox> drunken ideas
<hoelzro> what if you embedded a Ruby interpreter into bash?
<hoelzro> and used a custom prefix to turn on "Ruby mode
<shevy> hmm
<shevy> Hanmac, can you do this ^^^
* hoelzro thinks that could actually work
<Mon_Ouie> hoelzro: Yeah, that's what I was thinking of
<Paradox> hoelzro, hell i'd use it
<banisterfiend> Paradox: u can interpolate ruby code in shell code using pry, like this: .cd #{my_dir} but we dont optimize for the shell case at all, and dont provide many features aside from ruby interpolation
<hoelzro> and gradually phase out the C portions for Ruby bits >:)
<hoelzro> mwahahahahaha
<Hanmac> shevy writing a shell? yeah why not ... but not currently
<Paradox> but gsub(/bash/, 'zsh')
<Paradox> banisterfiend, i know
<hoelzro> but the Ruby mode and the shell mode would have to integrate well together
<Paradox> i pop into pry whenever i have a slightly complex rename
<hoelzro> ex. R$ puts "$HOME" would have to print ENV['HOME']
indian has joined #ruby
<Paradox> ie naming pictures based off of an exif tag in a way that would take far too fucking long in lightroom
icambridge_ is now known as icambridge
<Hanmac> shevy about feeding gremlins after midnight ... what kind of? local time or Greenwich time?
odigity has quit [Quit: Leaving]
Markvilla has joined #ruby
ReTFEF has quit [Changing host]
ReTFEF has joined #ruby
<banisterfiend> hoelzro: the difficult part is mixing the ruby and the bash
<Paradox> banisterfiend, yeah
<Paradox> thats why rush fails
<banisterfiend> hoelzro: cos if they're just completely separate, i dont really see much use in that..
<hoelzro> banisterfiend: indeed
<hoelzro> yeah, that's what I meant with my puts "$HOME" example
<hoelzro> does Ruby have a global_missing lookup hook?
<banisterfiend> no
<banisterfiend> they're initialized to nil
<banisterfiend> same as @vars
<Hanmac> hoelzro no ... but with c-exts you could define globals as virtual
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie> But you have to know their name in advance
<Hanmac> but you are right ... imo there should be some kind of global_missing
<banisterfiend> Paradox: btw we also have an undocumented feature in pry
<Paradox> console escape mode?
arkiver has joined #ruby
fivetwentysix has quit [Quit: fivetwentysix]
Wizek has joined #ruby
<banisterfiend> Paradox: .ls | { |captured| captured.split.sort.display }
<banisterfiend> Paradox: redirection through a block
<Paradox> ah cool
<banisterfiend> works with any shell command
<hoelzro> Hanmac: could you show me some docs on that feature?
<Paradox> doesnt set _ though, heh
<hoelzro> I'd love to see how it works
justsee is now known as justsee|away
* hoelzro needs to actually start writing Ruby
<Paradox> fun fact
<Paradox> the dreamcast supported a keyboard and mouse
justsee|away is now known as justsee
<hoelzro> Hanmac: thanks
icy` has quit [Quit: .: adios :.]
<banisterfiend> Hanmac: can you find out what rb_protect() does
<Hanmac> i am not sure ...
<hoelzro> isn't like an exception handling thing?
mockra has joined #ruby
<zii> Yup.
<zii> rb_protect((VALUE(*)(VALUE) func, *error); where error could be int* or *VALUE, don't know.
qwerxy has quit [Quit: offski]
<zii> Essentially it's the same as begin; func; rescue; end
<banisterfiend> zii: are you sure? i think it's more exotic than that..
<banisterfiend> it's messing with my fibers
<banisterfiend> and the signature i have is very different
<banisterfiend> rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
mockra has quit [Ping timeout: 248 seconds]
<zii> Oh, well yeah. you can pass that data stuff to it. I'm not into that, as it limits the types of functions I can call.
<banisterfiend> rb_eval_string_protect != rb_protect
<zii> _protect idea is the same.
<zii> Doesn't matter the way you make it call stuff.
<zii> They way you call doesn't matter*.
<shevy> did I already mention that I hate rewrites
brotspinne has joined #ruby
saschagehlich has joined #ruby
<JasonBr0x> Hello, I got an error while compilinge ruby: ./ruby: symbol lookup error: /root/sources/ruby-1.9.3-rc1/.ext/i686-linux/enc/encdb.so: undefined symbol: rb_encdb_declare
<JasonBr0x> make: *** [rdoc] Error 127
<shevy> then rb_encdb_declare was not declared
nikeita has joined #ruby
<JasonBr0x> shevy: what that means exactly
<shevy> what OS are you on
<JasonBr0x> shevy: Red Hat Enterprise Linux ES release 4 (Nahant Update 5)
<shevy> hmm
<shevy> that function is in this file: http://rxr.whitequark.org/mri/source/encoding.c
<brotspinne> hello. can someone explain me the difference between defined? myobj.mymethod and myobj.respond_to?(:mymethod)?
<shevy> JasonBr0x not sure why encoding.c is not compiling for you
<shevy> JasonBr0x perhaps there is some earlier check that fails for you, make sure to look at config.log as well
<JasonBr0x> shevy: I haven't got any clue too :(
<shevy> sometimes the errors are hidden there
<JasonBr0x> shevy: ok let me check
<shevy> all I can say is that I can compile ruby from source without that error popping up :)
<shevy> brotspinne, dunno. .respond_to? acts on the object in question, defined? I think is more low level
<Hanmac> brotspinne: respond_to? as a sister named repsond_to_missing, its interesting on dynamic methods using method_missing
<Mon_Ouie> brotspinne: defined? isn't affected by how you redefine #respond_to?
<Mon_Ouie> But really, don't use it to check for methods
cantonic has joined #ruby
Gab0 has quit [Remote host closed the connection]
<Paradox> war were declared
<Hanmac> imo the only useful thing for defined? is defined?(super)
bullicon has joined #ruby
<Paradox> use method missing to print out strings from /dev/random
<brotspinne> shevy: Hanmac: Mon_Ouie: so from the behaviour side there is no difference?
<Paradox> ;p
<banisterfiend> Hanmac: it's cool for lots of things
<shevy> waaah... I finished the 200 lines of code rewrite finally
<banisterfiend> Hanmac: i use it to discover whether something is a local or a method
<brotspinne> Mon_Ouie: why I shouldn't use defined?
<shevy> brotspinne, defined? is strange
<Hanmac> brotspinne: its possible that respond_to? return true while defined? returns false
<shevy> I forgot why, but I remember that it was strange. I think it is cheating
<brotspinne> shevy: I only know it is an operator instead of a build in method. but why it is strange?
<shevy> I dont quite remember
<brotspinne> Hanmac: this is interesting. when is this the case?
<shevy> use .respond_to?
<Mon_Ouie> Whey you override respond_to?
<Hanmac> Mon_Ouie no i only need to override respond_to_missing
lxsameer has joined #ruby
<Mon_Ouie> No, defined? is aware of respond_to_missing? — which is the right way to do it
nyuszika7h has joined #ruby
<brotspinne> my question was about the difference without redefining or manipulating anything. so what is now the exact difference and why I should not use defined?
<Mon_Ouie> If you override respond_to?, defined? will still only use the actual methods and respond_to_missing?
<Mon_Ouie> Partly because there are people who wrongly override respond_to? instead of respond_to_missing?, and because respond_to? has a clearer intent
GeekOnCoffee has quit [Ping timeout: 244 seconds]
br4ndon has joined #ruby
elhu has quit [Ping timeout: 260 seconds]
justsee has quit [Quit: Leaving...]
<Hanmac> brotspinne sample: OpenStruct.new.xyz
<brotspinne> Mon_Ouie: you mean when someone intent to change the behaviour of defined? and respond_to? but instead of overwriting respond_to_missing he mistakenly overwrites respond_to? so that defined? does not work anymore like desired, right?
justsee has joined #ruby
fearoffish has joined #ruby
friskd has joined #ruby
<Mon_Ouie> Yeah. Actually, Hanmac's example shows that you can find that even in stdlib.
lxsameer has quit [Max SendQ exceeded]
<Mon_Ouie> I'd consider it a bug
friskd has quit [Client Quit]
<banisterfiend> Mon_Ouie: stdlib has some of the worst ruby code in it
<Mon_Ouie> I know
workmad3 has joined #ruby
robotmay has joined #ruby
lxsameer has joined #ruby
<Mon_Ouie> That's kind of a shame in fact
<brotspinne> Hanmac: can you explain me that? so openstruct overwrites the wrong method or what is going on there?
<Hanmac> defined? cant work with OpenStruct ... its not designed to work
elhu has joined #ruby
GeekOnCoffee has joined #ruby
<banisterfiend> Yeah, hopefully it'll be a non-issue when stdlib is gemified
<Mon_Ouie> It could work, if only they'd define respond_to_missing? properly
znouza_ has joined #ruby
<Mon_Ouie> Actually they don't define respond_to? either, so even #respond_to? is false
<shevy> the deeper one digs, the more crap is brought up to surface
<shevy> gemifying the stdlib could be nice even if only for more people scrutinizing it
<brotspinne> okay I didn't really get the openstruct example
<Hanmac> Mon_Ouie: xyz in my sample is only defined when its set
<Mon_Ouie> Yeah, but that's because they use #define_method
<Mon_Ouie> So respond_to? and defined? will work exactly the same way
<banisterfiend> brotspinne: you have two people saying somewhat opposing things, who do you trust Mon_Ouie or Hanmac?
arkiver has quit [Ping timeout: 260 seconds]
<brotspinne> I'm not often in irc. so maybe you can tell me that? :D
* workmad3 wonders what the original issue was
<brotspinne> workmad3: difference between defined? and respond_to?
withnale has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
<hoelzro> brotspinne: defined? is more general
mneorr has joined #ruby
withnale has joined #ruby
<Mon_Ouie> https://gist.github.com/3215078 <- here's a runnable example
<withnale> hi...
<banisterfiend> brotspinne: i think we should make them mud wrestle, and u take the advice of the winner
<Mon_Ouie> You'd like thiat
blacktulip has joined #ruby
<withnale> if I want to pass a logger object to a class to store, and use from that class, whats the best way to do it?
<banisterfiend> Mon_Ouie: Yeah.
<brotspinne> Mon_Ouie: cool I will look into this
<workmad3> Mon_Ouie: cool, so basically what that says is that the default respond_to? implementation is awesome and shouldn't be overridden :)
<Mon_Ouie> Yeah
<Mon_Ouie> In 1.9, that is; back in 1.8, there was no #respond_to_missing?
freeayu has quit [Ping timeout: 246 seconds]
<workmad3> yeah, but who uses 1.8 outside of legacy code now? :)
Rochefort has joined #ruby
<Mon_Ouie> Surprisingly, ack stdlib, there are two wrong redefinition (on in minitest/mock and another in DRb), and a right one (in delegate)
<banisterfiend> workmad3: we should make people who use 1.8 wear a t-shirt saying "Pig." on it
xorigin has joined #ruby
apacala has joined #ruby
<brotspinne> Mon_Ouie: okay got it. thanks!
havenn has quit [Remote host closed the connection]
<banisterfiend> Mon_Ouie: is teaching/helping people on #ruby a selfless act or is there some element of egoism involved as you demonstrate superior knowledge over other would-be teachers ?
JasonBr0x has left #ruby [#ruby]
<banisterfiend> what's your motivation Mon_Ouie
rashila has joined #ruby
flype has joined #ruby
<rashila> hi, I have created an engine which depends on faye-rails. I have added dependency to the gemspec file. When I install the gem to the dependencies are also installed, but undefined method error is shown for methods in the dependency gems.
<brotspinne> I forgot: Mon_Ouie wins!
jonathanwallace has joined #ruby
nikeita has quit [Quit: sleep]
<banisterfiend> :))
freeayu has joined #ruby
apacala has quit [Remote host closed the connection]
indian has quit [Ping timeout: 240 seconds]
apacala has joined #ruby
Nanuq has quit [Ping timeout: 245 seconds]
Morkel has quit [Quit: Morkel]
elsifaka has joined #ruby
<shevy> a good xkcd
jonathanwallace has quit [Ping timeout: 260 seconds]
<brotspinne> okay next battle. how is your indentation with the "private" keyword? in the same level as the class or one level or two level deeper?
adambeynon has joined #ruby
<banisterfiend> same level
<banisterfiend> brotspinne: and private isn't a keyword
<banisterfiend> it's a method ;)
<brotspinne> I'm so sorry
pskosinski has joined #ruby
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
<brotspinne> banisterfiend: is there actually a official way of doing this?
apacala has quit [Remote host closed the connection]
<brotspinne> I couldn't find anything
apacala has joined #ruby
<banisterfiend> brotspinne: the official way is not to indent it
iamlacroix has joined #ruby
Gurpartap has quit [Quit: Page closed]
ephemerian has joined #ruby
<brotspinne> banisterfiend: so like this? https://gist.github.com/22c3b97ab1788d16a38f
<banisterfiend> brotspinne: doesn't you editor enforce that for u?
iamjarvo has quit [Read error: Connection reset by peer]
<banisterfiend> brotspinne: what kind of editor are you using that it doesn't fix that for u?
<shevy> brotspinne, same level as def
<banisterfiend> brotspinne: same level as def
<shevy> btw brotspinne is a funny nick
<shevy> if banister could only understand german...
<brotspinne> shevy: :D but only for germans
<shevy> yeah :D
<banisterfiend> shevy: i speak fluent german: und
<hoelzro> shevy, brotspinne: is brotspinne some sort of cultural joke? I can translate the name, but I don't "get" it
<shevy> german has so crazy long words, it's boggling the mind
<brotspinne> banisterfiend: ah okay. you told first same level as the class
<shevy> Donaudampfschifffahrtsgesellschaft
<brotspinne> banisterfiend: this is my way too
<shevy> well actually
<Mon_Ouie> Is that German for Donut?
<banisterfiend> brotspinne: i didnt know what u mean, when u said 'class level' i assumed u meant indented with the rest of the class body
<brotspinne> Mon_Ouie: haha :D no
<brotspinne> hoelzro: a bread spider in german is like a ugly ugly women and mr. bean used this word too
<brotspinne> for the mona lisa
<shevy> Mon_Ouie hehe ... the donau... the danube, the river ... the old "austrian empire", k.u.k, wanted to get rich via transferring people around on the danube ... http://en.wikipedia.org/wiki/Donaudampfschiffahrtsgesellschaft
<shevy> founded in 1829 !
<shevy> and they had 200 steamboats at one point in history too
brotspinne has quit [Quit: brotspinne]
Banistergalaxy has joined #ruby
Criztian has quit [Remote host closed the connection]
<hoelzro> br4ndon: ah ha
mengu has joined #ruby
<hoelzro> thanks for the clarification =)
davidpk has joined #ruby
<Mon_Ouie> Wrong br<tab>
qwerxy has joined #ruby
<Bauer> Paradox: I have now this error: http://codepad.org/Z6TJc5hk and this one I am unsure how to resolve.. as the postgres headers are installed
<Mon_Ouie> Though that was because he left
<shevy> "Your PostgreSQL is too old. Either install an older version of this gem or upgrade your database."
<shevy> did you try this already Banistergalaxy
brotspinne has joined #ruby
<shevy> sorry
<shevy> did you try this already Bauer
<shevy> shouldnt do Ba<TAB> ...
<brotspinne> had a timeout :(
<shevy> KILL THE brotspinne!!!
<shevy> it's walking on the brot
dhruvasagar has quit [Ping timeout: 246 seconds]
<shevy> today banisterfiend will learn the word "Spinne"... which is german for spider, banisterfiend
<Bauer> hehe, hmm how do I isntall older version of the gem, shevy?
<brotspinne> I've missed the funny conversation
<shevy> you fetch the .gem file
<banisterfiend> shevy: i'm terrified of germans and their language
<shevy> Bauer, I think there is a subcommand to "gem" ... not sure which one
<banisterfiend> shevy: when i close my eyes i still hear the sound of heavy boots outside my door
dhruvasagar has joined #ruby
<shevy> gem install --version 1.1.1 # which surely won't work
<brotspinne> banisterfiend: what's about "arschgeil"?
mockra has joined #ruby
<shevy> banisterfiend eh ... germans are harmless. only when an austrian seizes power, will they become villains
<brotspinne> I'm off. cu
brotspinne has quit [Client Quit]
<Bauer> shevy: ok I will rephrase: how do I find out what is an older gem version to try?
<shevy> Bauer just try the earlier gems, if you can not upgrade postgre
<Bauer> shevy, but how do I find what is the earlier gems versions, so I can specify it?
<shevy> I did not write that gem in question, so you would have to ask the guys who wrote it
<shevy> well, one way is to look at a listing like rubyforge
<shevy> the other way is surely somehow with gem command, to ask it to install an older version
<shevy> I dont know the latter way because I always use the latest and greatest everywhere
<shevy> even ruby 1.9.x now!
TheFuzzball has quit [Disconnected by services]
TheFuzzb_ has joined #ruby
<shevy> Bauer, there you go: https://rubygems.org/gems/pg/versions
freeayu__ has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
<Bauer> my ruby IS 1.9.x! :P lol probably the newest thing on that antiquated machine :P
<Bauer> shevy how did you find it? I ran a search for "pg" there, and still sifting through the results..
chichou has joined #ruby
dhruvasa1ar has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
<Bauer> yay! that worked, using 13.0 :) thanks... hopefully nothing else
iori has quit [Remote host closed the connection]
<Bauer> grrrr, the bundle install cmd still requires 14 :(
<shevy> Bauer I googled for "gem pg"
freeayu has quit [Ping timeout: 260 seconds]
<shevy> I actually did not know that rubygems provides a listing too
<shevy> that was really the last thing I thought rubyforge did
dhruvasa1ar has quit [Client Quit]
<shevy> but now, I see that rubyforge is 100% useless
iori has joined #ruby
dhruvasagar has joined #ruby
<shevy> they should close it down officially
<Bauer> well, will continue debuggin it later after lunch :)
shashin has joined #ruby
<zaargy> foo = get_something() || "foo"
<zaargy> is that the right thing to do to set foo to "foo" if get_something returns nil?
berserkr has joined #ruby
lkba has quit [Quit: Bye]
<Mon_Ouie> Sure. It's actually nil or false though.
tonini has quit [Remote host closed the connection]
chichou has quit [Remote host closed the connection]
rashila has quit [Quit: ChatZilla 0.9.88.2 [Firefox 11.0/20120310010757]]
chichou has joined #ruby
ZachBeta has joined #ruby
Rochefort has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
cascalheira has joined #ruby
arkiver has joined #ruby
indian has joined #ruby
shashin has quit [Quit: shashin]
smu43 has joined #ruby
<smu43> Hi there
<smu43> Question
nari has quit [Ping timeout: 248 seconds]
<smu43> When developpping a gem, is there any way to link to the files I am modifying instead of packaging the gem and installing it ?
cousine has joined #ruby
cousine has quit [Remote host closed the connection]
<smu43> the same way one can do it with pip (python): http://www.pip-installer.org/en/latest/usage.html#edit-mode
<hoelzro> smu43: so you mean that you want to be able to use the files in your CWD as if there were packaged and installed, but without constantly rebuilding and installing?
<seoaqua> how to skip test-b when text-a fails with Rspec?
<smu43> hoelzo, yes exactly
<hoelzro> smu43: why not just set your RUBYLIB appropriately?
Vakaris has joined #ruby
<smu43> hoelzro, sorry, I mispelled your name
<hoelzro> no problem =)
<smu43> RUBYLIB you say ? I will take a look at that
<smu43> thanks a lot !
<hoelzro> I think that require 'rubygems' may consider the gem version first, so be careful
pratz has quit [Read error: Connection reset by peer]
pratz has joined #ruby
<smu43> you mean I should uninstall the gem first ?
<hoelzro> well, create a test script in your working directory
<hoelzro> set RUBYLIB to where your stuff is located
<hoelzro> and put this in your test script:
<hoelzro> require 'rubygems'; puts $FEATURES.select { |path| path =~ /$GEM_NAME/ }
sspiff has quit [Ping timeout: 272 seconds]
<hoelzro> (obviously substituting GEM_NAME)
<smu43> cool, thanks :)
<hoelzro> np
<hoelzro> oh, throw a require '$GEM_NAME' in there before the puts too
<smu43> ok
phanousit_ has joined #ruby
Markvilla_ has joined #ruby
<Mon_Ouie> Rubygems uses regular require first, and falls back to activating a gem only when that fails
phanousit has quit [Ping timeout: 240 seconds]
phanousit_ is now known as phanousit
uris has joined #ruby
Markvilla has quit [Ping timeout: 260 seconds]
Markvilla_ is now known as Markvilla
<hoelzro> Mon_Ouie: excellent, thanks for explaining!
<smu43> Mon_Ouie: yes, thanks !
cantonic has quit [Remote host closed the connection]
znouza_ has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
cantonic has joined #ruby
niklasb has joined #ruby
tndrbt has joined #ruby
shashin has joined #ruby
jonathanwallace has joined #ruby
tndrbt has quit [Client Quit]
jonathanwallace has quit [Ping timeout: 240 seconds]
znouza_ has joined #ruby
Foxandxss has joined #ruby
anderse_ has joined #ruby
mneorr has quit [Quit: Leaving.]
mneorr has joined #ruby
burgestrand has joined #ruby
TheFuzzb_ is now known as TheFuzzball
arkiver has quit [Remote host closed the connection]
klotho has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
arkiver has joined #ruby
x0F_ is now known as x0F
mpereira has quit [Ping timeout: 255 seconds]
emmanuelux has joined #ruby
Nanuq has joined #ruby
mockra has joined #ruby
elsifaka has quit [Ping timeout: 252 seconds]
lkba has joined #ruby
mockra has quit [Ping timeout: 264 seconds]
arietis has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
sspiff has joined #ruby
sspiff has joined #ruby
indian has quit [Ping timeout: 240 seconds]
Morkel has joined #ruby
cloud_droid has quit [Remote host closed the connection]
cloud|droid has quit [Remote host closed the connection]
chichou_ has joined #ruby
chichou has quit [Ping timeout: 264 seconds]
saschagehlich_ has joined #ruby
tvw has quit [Remote host closed the connection]
saschagehlich_ has quit [Client Quit]
saschagehlich has quit [Ping timeout: 252 seconds]
nateberkopec has joined #ruby
araujo has joined #ruby
Spooner has joined #ruby
banisterfiend is now known as My_Hearing
My_Hearing is now known as banisterfiend
pratz has quit [Ping timeout: 248 seconds]
Banistergalaxy has quit [Ping timeout: 240 seconds]
mucker has joined #ruby
arkiver has quit [Ping timeout: 260 seconds]
Criztian has joined #ruby
knoppix has joined #ruby
znouza_ has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fermion has joined #ruby
Rochefort has joined #ruby
clocKwize has joined #ruby
knoppix has quit [Quit: Leaving]
liluo has quit [Remote host closed the connection]
znouza_ has joined #ruby
mohits has quit [Read error: Connection reset by peer]
Squarepy has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<_br_> How do I turn a byte stream into a UTF-8 String? The byte stream was originally a UTF-8 encoded string.
<burgestrand> _br_: do you have the byte stream as a string?
arkiver has joined #ruby
<_br_> well when I get the data via the socket I get a string yes.
<_br_> looks a bit like unicode ... "{\u0000\"\u0000I\u0000D\u0000\"\u0000:\u0000\"\u00001\u0000\
Criztian has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
arkiver has quit [Max SendQ exceeded]
<burgestrand> _br_: for IO objects, I believe you should be able to set their encoding directly, and ruby should interpret it correctly, however if you have a string that ruby has set to a BINARY encoding, you can tell ruby it’s in UTF-8 by doing your_string.force_encoding("UTF-8")
<_br_> and in the middle some hex values?! \xC9l\xAC0
<_br_> I did a force_encoding("UTF-8") on it but didn't do the trick
arkiver has joined #ruby
<_br_> experiments with .unpack aren't quite either helping
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<burgestrand> _br_: \xC9l\xAC0 is invalid UTF-8
<_br_> jep I think so as well
<_br_> ah, maybe I need to set the socket to utf8 before..
<burgestrand> not necessarily, but you could
jonathanwallace has joined #ruby
<_br_> no, thats not it. Weird.
elhu has quit [Quit: Computer has gone to sleep.]
_bart has joined #ruby
<_bart> Hi, I'm checking the probability a word is gibberish by checking for multiple consonants in a word like so: http://rubular.com/r/RLTAIekGpw
<_bart> is there a smarter way to write this?
znouza_ has quit [Ping timeout: 250 seconds]
ZachBeta has joined #ruby
Archiloque_ has joined #ruby
jonathanwallace has quit [Ping timeout: 260 seconds]
preller has quit [Remote host closed the connection]
vish has joined #ruby
vish_ has joined #ruby
elsifaka has joined #ruby
elsifaka has quit [Client Quit]
davidpk has quit [Quit: Computer has gone to sleep.]
MarGarina has quit [Ping timeout: 246 seconds]
<shevy> hmm how to unset an instance variable? or entirely remove it? @foo = nil ... any better way?
Vakaris has quit [Ping timeout: 252 seconds]
shashin has quit [Ping timeout: 260 seconds]
<banisterfiend> shevy: remove_instance_variable
Archiloque_ has quit [Quit: Archiloque_]
vish has quit [Ping timeout: 244 seconds]
<Tasser> banisterfiend, remove_method in your fancy gist?
<banisterfiend> Tasser: what?
<banisterfiend> Tasser: god, i swear 90% of the things u say are incoherent
<shevy> cool
<banisterfiend> im not sure if it's just lack of proficiency in english or if you're missing a few neurons upstairs
<shevy> my local docu does not yet include remove_instance_variable :)
<Hanmac> shevy there is :remove_instance_variable
<Hanmac> because :remove_instance_variable is private?
heftig has joined #ruby
<shevy> hmm
Vakaris has joined #ruby
<shevy> makes sense I suppose
<Mon_Ouie> Yeah, ri doesn't show documentation for private methods, meaning it misses method like this one or attr_accessor
<shevy> bit weird syntax to use, to see :@foo ... remove_instance_variable(:@foo)
<shevy> hmm or perhaps not... I have such examples already ... object.instance_variable_set(:@a, 'dog')
<Mon_Ouie> And I doubt there's an actual point in making the remove_* methods private but not the *_get and *_set (the same happens for constants)
mockra has joined #ruby
<shevy> yeah a bit odd
<banisterfiend> Mon_Ouie: Yeah it's annoying, remove_const too
iamlacroix has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 240 seconds]
<Tasser> banisterfiend, you're just not on my niveau? ;-)
<Tasser> banisterfiend, https://gist.github.com/3197076 context
mehlah has joined #ruby
<banisterfiend> where is remove_instance_variable mentioned there? :)
mneorr has quit [Quit: Leaving.]
Foxandxss has quit [Changing host]
Foxandxss has joined #ruby
`heliar is now known as anyone
anyone is now known as `heliar
xcorex has joined #ruby
<Tasser> banisterfiend, context is only the gist
joesavage has joined #ruby
jjbohn has joined #ruby
MarGarina has joined #ruby
<joesavage> I have a directory which contains several directories for each category of my website, each of which has a number of articles inside - what would be the easiest way of generating an XML feed (sitemap-style) to list all these tutorials for use in client-side search functionality at a later date?
<joesavage> [in Ruby of course]
nari has joined #ruby
Banistergalaxy has joined #ruby
JarJar has quit [Quit: Leaving]
<workmad3> joesavage: probably using nokogiri's builder
<joesavage> workmad3: I'm not familiar, could you link me up?
Vakaris has quit [Ping timeout: 255 seconds]
<joesavage> Ooh looks interesting, thanks, I'll take a look and come back if I'm having problems dynamically doing everything with the directory structure and stuff!
seoaqua has quit [Ping timeout: 244 seconds]
seoaqua has joined #ruby
vish_ has quit [Quit: Leaving...]
shashin has joined #ruby
jjbohn is now known as jjbohn|afk
xcorex has quit [Remote host closed the connection]
telling has joined #ruby
telling has quit [Changing host]
telling has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
fralcon has joined #ruby
Vakaris has joined #ruby
nateberkopec has quit [Quit: Leaving...]
<_br_> Wow, this is ridiculous. C# JSON UTF8 Data via Byte array, socket to Ruby. Gives me serious headache.
Markvilla has quit [Quit: Markvilla]
elhu has joined #ruby
<burgestrand> _br_: the string you showed us before looked very weird, and not at all like raw UTF-8 bytes :o
Taranis has joined #ruby
<Spooner> joesavage : https://github.com/ddfreyne/nanoc/blob/master/lib/nanoc/helpers/xml_sitemap.rb (done with standard builder though, but might give you a few pointers).
br4ndon has quit [Ping timeout: 246 seconds]
<_br_> burgestrand: Yes, its a good question where the error lies.
Markvilla has joined #ruby
nateberkopec has joined #ruby
<burgestrand> _br_: even if ruby got the encoding wrong, I’d expect it to be in BINARY and not anything else, so I wonder if the error happens before the data is sent on the wire to ruby, i.e. not ruby’s fault
<_br_> what is this anyway? hex values with three digits? \xA20\xB70
tze` has joined #ruby
<burgestrand> _br_: naw, just the bytes 0xA2, character 0, byte 0xB7 and character 0
<_br_> burgestrand: Hm, I am starting to think its not rubys fault either. Its really weird. This encoding stuff is a horrible mess.
Progster has joined #ruby
<_br_> burgestrand: I see..... thanks
<burgestrand> Hm, perhaps it’s not in UTF-8 but UTF-16?
<_br_> o.O
<burgestrand> Oh, naw, nvm
tze` has quit [Client Quit]
<burgestrand> For a second there I thought the character 0 = 0x00
<burgestrand> :p
<_br_> you gave me a small heartattack
<Spooner> Maybe it is UTF-24 :D
<_br_> ahhh
maucat has quit [Quit: 离开]
<bnagy> could be UTF-11
<Spooner> Oops, I meant UTF-12. Same thing, isnt' it?
emmanuelux has quit [Ping timeout: 252 seconds]
<_br_> <- exploded
Markvilla has quit [Client Quit]
<_br_> ok, time to blame the C# guy.
bullicon has quit [Quit: Computer has gone to sleep.]
sendoushi has joined #ruby
<workmad3> Spooner: heh
zii has left #ruby ["WeeChat 0.3.8"]
<workmad3> Spooner: don't forget UTF-9, for efficient unicode on DSP processors with 9-bit bytes :)
jjbohn|afk has quit [Quit: Leaving...]
ssspiff has joined #ruby
ssspiff has joined #ruby
<bnagy> yeah but UTF-9 is really just the same as three trytes
<Spooner> Oh yeah, I forgot that. I usually used UTF-9.5 for that, since I used the extra half a bit for error correction.
<workmad3> bnagy: err... two trytes, isn't it?
<workmad3> bnagy: hmm... actually, ignore me, would need to work that out more :)
<_br_> the horror... horror....
nateberkopec has quit [Quit: Leaving...]
arkiver has quit [Ping timeout: 260 seconds]
sspiff has quit [Ping timeout: 260 seconds]
<bnagy> _br_: what's the data supposed to be, anyway?
tvw has joined #ruby
jonathanwallace has joined #ruby
<bnagy> I'm tempted to ask why you're using raw sockets, but the answer will only irritate me
<workmad3> bnagy: for efficientz binary processingz!!!
`brendan has joined #ruby
<_br_> I don't want to use raw sockets but the other braindamaged people here insist.
sendoushi has quit [Remote host closed the connection]
<bnagy> ok well tcp etc doesn't respect serialisation boundaries
<_br_> That stuff is supposed to be a json, and now I can read part of it. But seems the japanese payload was converted to unicode and that garbled it?! omfg.
<bnagy> I'm assuming you looked at all this
<_br_> jep
<bnagy> you need a streaming processor, which is a pita
<_br_> I think its now a problem on the server side again. So its ok....
<shevy> I am happy, today I learned something new in ruby
<_br_> bnagy: tell me about it.... making this clear to C# people is...... impossible.
<hoelzro> shevy: what's that?
<bnagy> can you convince them to use netstrings or something?
<shevy> hoelzro, the remove_instance_variable() part
<hoelzro> ah
Vakaris has quit [Ping timeout: 255 seconds]
<_br_> bnagy: I can try ;o;
<bnagy> at least then you have some idea when you have your message
<bnagy> it's super simple, len,data (literal comma)
<bnagy> sorry len:data,
<_br_> Thanks... I'll try. Lets see what happends.
<bnagy> then you can verify that you at least have the correct raw for the serialised object
wataken44 has quit [Remote host closed the connection]
<bnagy> imvho json sucks donkey balls
<bnagy> msgpack is way better and faster
<bnagy> but I dunno about C# support
jonathanwallace has quit [Ping timeout: 260 seconds]
<_br_> bnagy: Jep. That was the first think I tried to convince them. Lets use msgpack. Answer, doesn't work.. <insert bs explanation>
<_br_> bnagy: Anyway, thanks for the help appreciate it. Lets give netstrings a try..
<bnagy> json is a whiny bitch about non utf8 data
wataken44 has joined #ruby
<bnagy> well netstrings is only a way to make sure your raw is correct
<bnagy> it doesn't help with your serialisation
vectorshelve has quit [Quit: Page closed]
<_br_> actually, I am suspecting also that these guys are garbling the data from their $win encoding to utf8.
<_br_> sign. bbl
mneorr has joined #ruby
br4ndon has joined #ruby
strife25 has joined #ruby
jds has joined #ruby
rutkla has quit [Read error: Connection reset by peer]
mpereira has joined #ruby
geekbri has joined #ruby
clocKwize has quit [Quit: clocKwize]
geekbri has quit [Remote host closed the connection]
geekbri has joined #ruby
clocKwize has joined #ruby
vjacob has left #ruby ["Leaving"]
TheFuzzball has quit [Ping timeout: 252 seconds]
indian has joined #ruby
Tomasso has joined #ruby
jds has quit [Quit: jds]
jds has joined #ruby
jds has quit [Client Quit]
jds has joined #ruby
robbyoconnor has quit [Ping timeout: 246 seconds]
Vakaris has joined #ruby
freeayu has joined #ruby
ken_barber has quit [Remote host closed the connection]
Rochefortes has joined #ruby
freeayu__ has quit [Ping timeout: 246 seconds]
mockra has joined #ruby
tomb_ has quit [Quit: Computer has gone to sleep.]
a_a_g has quit [Quit: Leaving.]
arkiver has joined #ruby
burgestrand has quit [Quit: Leaving.]
ken_barber has joined #ruby
indian has quit [Ping timeout: 264 seconds]
mehlah has quit [Quit: Leaving...]
ken_barber has quit [Remote host closed the connection]
Rochefort has quit [Ping timeout: 255 seconds]
Squarepy has quit [Read error: Connection reset by peer]
jstew has joined #ruby
Squarepy has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
krusty_ar has joined #ruby
sendoushi has joined #ruby
<_br_> bnagy: AHAhaahahahaahahahaa
<_br_> bnagy: Guess what.
<_br_> "Oh, my bad. I thought it was UTF8 seems its little endian UTF16"
AlbireoX`Laptop has quit [Remote host closed the connection]
<_br_> *facepalm*
jds has quit [Quit: jds]
<hoelzro> ...
nwest has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
nikeita has joined #ruby
ananthakumaran has joined #ruby
nikeita has quit [Client Quit]
<bnagy> ew
<bnagy> that's ok, ruby has utf16le easily available, right?
Morkel has quit [Quit: Morkel]
<bnagy> doesn't make netstrings not a good idea, either way :P
<bnagy> it's very convenient for stuff like tcp where you don't know how much data you're getting per packet, you can just read the length, then read(len);read(1) and check that it's ','
<_br_> True, I am not worrying about the ruby side. Its just that the C# guys are like, yes. We are sending you utf8. Are you sure?! Really?! Hm, look here it is in the code ... oh...
<_br_> I was reading the djb spec of netstring, sounds pretty reasonable...
<bnagy> I used to use messagepack over netstrings when I had some EM streaming stuff
<bnagy> now I just use zmq and things where it is guaranteed to deliver a full message :/
<_br_> those guys can't wrap their head around msgpack or zeromq. Forget it. ;.;
Vakaris has quit [Ping timeout: 248 seconds]
<seoaqua> suppose i define a method '[]' how to use it within the class?
ZachBeta has quit [Quit: Computer has gone to sleep.]
<hoelzro> seoaqua: self[key] = value?
<bnagy> well zmq I accept is a brainfuck, but msgpack is just a drop in serialisation replacement
moshef has joined #ruby
<seoaqua> hoelzro, oh ,i wrote 'self.[key]' . thanks
<_br_> bnagy: true, but useless in this case. Dealing here with Monkeys apparently.
<seoaqua> hoelzro, it works :)
flip_digits has joined #ruby
bullicon has joined #ruby
beakerman has joined #ruby
ken_barber has joined #ruby
<workmad3> seoaqua: the valid ways to call it are self[key] or self.[](key) :)
Vert has joined #ruby
tommyvyo has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
<_bart> bnagy: str.encode("UTF-16BE", :undef =>:replace, :invalid=>:replace, :replace=>"?").encode("UTF-8")
nateberkopec has joined #ruby
<banisterfiend> workmad3: if it was c u'd also be able to call it like: key[self]
ABK has quit [Ping timeout: 248 seconds]
<banisterfiend> iirc
<hoelzro> yup
elhu has quit [Ping timeout: 252 seconds]
kpshek has joined #ruby
vlad_starkov has joined #ruby
elhu has joined #ruby
centipedefarmer has joined #ruby
<_bart> Let's say I have this array of hashes: {:text => "Boo", :probability => 1.0}, {:text => "Yaa", :probability => 1.0}, {:text => "Banana", :probability => 0.5}
uris has quit [Quit: leaving]
<_bart> how do I get the one with the highest probability? (and all of them like in the example)
linoj has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
<banisterfiend> _bart: max_by
<hoelzro> doesn't Enumerable.max accept a block as well?
<banisterfiend> _bart: array.max_by { |h| h[:probability] }
<Spooner> array.max_by {|h| h[:probability] }
phanousit has quit [Quit: phanousit]
<banisterfiend> hoelzro: it's: Enumerable#max :) (actually max_by, but # is used to delineate instance methods)
<hoelzro> banisterfiend: ah, thanks
crankycoder has joined #ruby
crankycoder has quit [Remote host closed the connection]
crankycoder has joined #ruby
fralcon has quit [Quit: fralcon]
jonathanwallace has joined #ruby
<_bart> okay now something fun, that max_by works great, but now I want the highest .length of the :text when there are two "winners".
<_bart> {:text => "Something", :probability => 1.0}, {:text => "Yaa", :probability => 1.0}, {:text => "Banana", :probability => 0.5}
<withnale> How can I convert an array of hashs into a merged single hash?
<_bart> "Something" should in this case win
<withnale> i.e. when I make a method definition 'def fn(a, b, *c)'
devdazed has joined #ruby
jgarvey has joined #ruby
<bnagy> withnale: ary.inject &:merge
Rochefortes has quit [Remote host closed the connection]
<tommylommykins> withnale: hash_arr.each_with_object(Hash.new) {|old_hash, new_hash| old_hash.each_pair {|k, v| new_hash[k] = v}}
<tommylommykins> or something like that
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<Spooner> _bart: a.group_by {|h| h[:probability]}.max_by { |p, h| p }[1].max_by {|h| h[:text].length }[:text]| h[:text].length }[:text]
<Muz> a.max_by { |h| h[:probability] && h[:text].length }
<Spooner> Oops: a.group_by {|h| h[:probability]}.max_by { |p, h| p }[1].max_by {|h| h[:text].length }[:text]
jonathanwallace has quit [Ping timeout: 248 seconds]
<Spooner> Muz that will just evaluate as true for all of the hashes.
verbad has joined #ruby
<Spooner> Or rather just find the one with the longest text. Oops.
gmci has joined #ruby
<Muz> Oh whoops, yeah
<Spooner> Ack, simpler than my one slightly (and what I think Muz meant) a.max_by { |h| [h[:probability], h[:text].length] }
<bnagy> this sound like sort with a block .first
<bnagy> oh yeah or that which is the same :)
pabloh has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 264 seconds]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
jrist-afk is now known as jrist
Rochefort has joined #ruby
lxsameer has joined #ruby
freeayu has quit [Quit: 离开]
peterhellberg has joined #ruby
<JonnieCache> Spooner: ooh didnt know you can recursively compare arrays like that
<JonnieCache> very clever
<JonnieCache> doesnt sound very fast though
<Spooner> Speed rarely matters, JonnieCache, unless it matters :)
<bnagy> twss
<JonnieCache> hah true. thats why we're using ruby i guess
fbernier has joined #ruby
<Muz> Rule 1. Make it work, make it fast.
<Muz> Premature optimisation is the bane of al programming.
<Muz> *all
<shevy> I think speed can come almost automatically with a clean design
lxsameer has quit [Ping timeout: 260 seconds]
<peterhellberg> Also, fast is rarely the same thing for every stakeholder in a project.
erichmenge has joined #ruby
habib has joined #ruby
<Muz> Also fast is rarely heard of in Ruby.
<peterhellberg> :)
Nanuq has quit [Ping timeout: 245 seconds]
<Muz> There's "acceptable" and then varying levels of "dog slow" in my books for Ruby. If speed's a concern, Ruby's probably not the right tool for any large/critical item.
ortho_stice has joined #ruby
jimeh has quit [Ping timeout: 246 seconds]
hynkle has joined #ruby
<shevy> yeah
Nanuq has joined #ruby
<peterhellberg> I often think my code is too slow and in need of optimization, then it often turns out to be an order of magnitude faster than the old solution…
<shevy> I wanted to write a bash replacement in pure ruby
mockra has joined #ruby
<peterhellberg> There are a LOT of low hanging fruit out there…
<shevy> but listing the content of directories is a lot faster in bash than in my pseudo shell :(
<JonnieCache> peterhellberg: what, in terms of slow code waiting to be replaced you mean?
ttilley has quit [Ping timeout: 245 seconds]
w400z has joined #ruby
<Spooner> shevy: Bash already is a good implementation of the Bash shell.
<JonnieCache> bash is basically a C layer over the posix api. youre going to struggle to make it faster
<peterhellberg> JonnieCache: I mean slow business processes replaced by a simpler solution in Ruby…
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<shevy> there is like a 0.4 seconds delay before all 600 of my .mp3 files are listed in my ruby-shell. there is about a 0.0 seconds delay when I do the same in bash... not sure why so far, but I have this feeling that, no matter how much I do, ruby would always be slower here
Guest97636 has quit [Quit: it puts the packet in the socket or else it gets the close() again]
ttilley has joined #ruby
* hoelzro had a bit of deja vu there
<peterhellberg> JonnieCache: There is obviously room for improvements when it comes to speed, but I’ve found that it rarely matters
<hoelzro> shevy: did you implement ls in Ruby?
Markvilla has joined #ruby
<JonnieCache> shevy: the ruby is going to have to do everything bash is doing, and then a whole lot of overhead
<JonnieCache> so its always going to be slower really
<shevy> hoelzro kinda.
gift has joined #ruby
<hoelzro> shevy: why not just shell out to ls, then? it'll go a *lot* faster
<shevy> one class tries to act as ls replacement
<shevy> hmm
liluo has joined #ruby
<shevy> I could try that
ken_barber has quit [Remote host closed the connection]
infinitiguy has joined #ruby
<banisterfiend> JonnieCache: hey jonnie
<banisterfiend> wat's up
ken_barber has joined #ruby
<JonnieCache> not a great deal
jonathanwallace has joined #ruby
<shevy> yeah JonnieCache ... and not only that, I always wonder if my ruby style is a very slow style or not
<JonnieCache> its not hot here any more so i can actually work properly
<JonnieCache> on the downside, its not hot anymore
<shevy> if ruby would be as fast as C!
mockra has quit [Ping timeout: 240 seconds]
chee has quit [Ping timeout: 245 seconds]
uris has joined #ruby
justsee has quit [Quit: Leaving...]
<hoelzro> shevy: I think the speed comes down to what you're doing
<peterhellberg> shevy: Unfortunately it isn’t, and I don’t think it will be in the foreseeable future.
imami|afk has quit [Ping timeout: 246 seconds]
<hoelzro> ex. a naive implementation of Sieve of Eratosthenes will be slow in Ruby because you're creating a bunch of data over and over
<JonnieCache> banisterfiend: hows you?
<hoelzro> whereas in C I would use a bitmap
<banisterfiend> JonnieCache: bored as a baby horse, do u know any good movies or documentaries?
<Spooner> Ruby is designed for convenience, not speed. You can write it in a faster style, but then it loses all elegance and terseness, so you might as well use something else.
gheegh has joined #ruby
iori has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 246 seconds]
<peterhellberg> Intel Fortran is probably a better bet ;)
andrewhl has joined #ruby
banseljaj has joined #ruby
<peterhellberg> Faster than C!
Guest40040 has joined #ruby
<JonnieCache> banisterfiend: have you seen breaking bad? if you want something to watch id reccommend that
<JonnieCache> not a movie or docu though
<banisterfiend> JonnieCache: Yeah, seen it. Not this season though
<banisterfiend> somehow im not interested in this season
<JonnieCache> this season is goooood
<JonnieCache> theyre all good
JustinCampbell has joined #ruby
<peterhellberg> http://shootout.alioth.debian.org/ <- Lots of interesting benchmarks
<banisterfiend> JonnieCache: did u watch GOT too?
jimeh has joined #ruby
ken_barber has quit [Ping timeout: 248 seconds]
<hoelzro> GOT += 1
<JonnieCache> no. i dont watch too many drama shows. i already waste too much time with other stuff
<m4rtijn> anyone seen misfits ? I liked it
twinturbo has quit [Ping timeout: 260 seconds]
<banisterfiend> JonnieCache: wouldn't really describe it as drama..
<banisterfiend> it's kind of epic fantasy
<banisterfiend> like LOTR, but with more political stuff
<hoelzro> banisterfiend: have you read the books?
<banisterfiend> hoelzro: no
<JonnieCache> i meant drama as in, "a thing with a story that isnt a comedy or a genre thriller"
<gheegh> Question. I've got an array of hashes. I'd like to generate from it an array of hashes.. where each has has the key… and a list of other keys that are within say 500 of the primary key.. Is there a way to do this other than a massive amount of iterations over the array? The array can be 30k items long…
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
emmanuelux has joined #ruby
<gheegh> Clarification: An array of "integers as strings" = hashes. https://gist.github.com/3217018
<JonnieCache> there's The Killing which is supposedly very good
<Spooner> gheegh : They are not Hashes, as we'd call them, which was confusing :)
phao has joined #ruby
<JonnieCache> if you dont mind subtitles. or you speak danish :)
carloslopes has joined #ruby
phao has left #ruby ["Not Here"]
<gheegh> Spooner: Yeah, i realized that calling it a hash was confusing.. since there is a hash.. and that's what I want to go to.. :-)
ken_barber has joined #ruby
<bnagy> gheegh: it will be slow :P
ken_barber has quit [Remote host closed the connection]
ken_barber has joined #ruby
liluo has quit [Remote host closed the connection]
hynkle has quit [Read error: Connection reset by peer]
<bnagy> which usually suggests that your algorith is broken
rippa has joined #ruby
<gheegh> bnagy: Yeah, trying to sort out the best way to do this.. i tried a simple iteration.. but that was exceedingly painful.. and inefficient..
stefanp_ has joined #ruby
<bnagy> I don't think it's inefficient
<Spooner> Why on earth do you want to group based on hash codes?
jimeh has quit [Ping timeout: 248 seconds]
<bnagy> it's a hugely high order algorithm
<shevy> gheegh try to keep all your data structures as simple as possible
<peterhellberg> gheegh: So you want to get a single list of strings where the integer representation is somewhere between -250 and +250 away from a given number?
<Spooner> I mean nearest to hash codes.
krusty_ar_ has joined #ruby
<gheegh> pteterhellberg: yep.
<shevy> I have seen access stuff like @hash['foo'][0]['bar'][1]['bla'] some days ago here on #ruby
cantbecool has joined #ruby
<gheegh> Spooner: they are hashes of documents.. i'm doing duplicate detection.
<bnagy> I think he wants h={};ary.each {|e| h[e]=ary.select {|i| (i.to_i - e.to_i).abs < 500}}
<bnagy> or similar
<banisterfiend> bnagy: hey wanna watch a movie with me
<Spooner> gheegh: But unless your hash generation is odd, being within 500 of another hash doesn't imply the original data was in any way similar.
<peterhellberg> gheegh: Why are your digests strings in the first place?
krusty_ar has quit [Ping timeout: 260 seconds]
<bnagy> gheegh: oh right. use ssdeep or something
<gheegh> bnagy: it's a lot faster than manualy comparing documents
<bnagy> or cosine similarity
<bnagy> or one of the million well studied ways to do this :)
stefanp has quit [Ping timeout: 265 seconds]
<peterhellberg> gheegh: And I’m with Spooner on this one. What makes digests numerically close to each other signify?
sncz has quit []
<gheegh> bnagy: the hashes are simhashes actually..
<peterhellberg> s/makes/does/
<bnagy> gheegh: well you've got an n*2 problem, so it'll be slow, like I said
<bnagy> it's simple to write (as above)
<bnagy> I would only do it on demand
<bnagy> you can also parallelize
hynkle has joined #ruby
<Tasser> ... use jruby for that
<gheegh> right.. might make sense to run through and cluster..
<Axsuul> How would I go about initializing an instance variable within an object from a mixin?
<bnagy> I do something like this, and I used NCD
<bnagy> which is more accurate than ssdeep, definitely so for binary files
<Axsuul> The instance variable needs to be initialized when the object gets init
<bnagy> you could google normalized compression distance and then do that with xz
sspiff has joined #ruby
liluo has joined #ruby
<bnagy> you can optimise by only considering files that are also within X of each other in size
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
lxsameer has quit [Quit: Leaving]
<Tasser> Axsuul, ||=
asobrasil has joined #ruby
<gheegh> bnagy: thanks.
mparodi has joined #ruby
ssspiff has quit [Ping timeout: 260 seconds]
<Tasser> bnagy, isn't Parallel intelligent enough to figure out the threads/processes stuff itself?
<mparodi> Why should I choose Ruby and not Java?
<m4rtijn> mparodi, you dont have to
<JonnieCache> normalized compression distance. interesting...
<GeekOnCoffee> mparodi: because you like simple and elegant code
<mparodi> m4rtijn, ?
<mparodi> I have to
<m4rtijn> why?
<mparodi> because I have to develop a project, and I can choose one of them to work with
<Muz> mparodi: because the project you're working on is more suitably done with Ruby, and not Java with bullshit subjective measures aside.
<Muz> What is the project?
<mparodi> ok, let me explain you a little more
lorandi has joined #ruby
<m4rtijn> just specify the domain of the project - make a pro / con list of the languages.. then choose
<m4rtijn> you shouldnt ask in here.. :p
<bnagy> Tasser: no
<JonnieCache> because you like being able to do simple programming tasks without an order, signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters.
<Tasser> bnagy, hm, oke
<bnagy> well not ime anyway
Nanuq has quit [Ping timeout: 245 seconds]
<bnagy> I only have that in for jruby / mri
ortho_stice has left #ruby [#ruby]
bbttxu has joined #ruby
<Progster> can you add bools together easily?
<mparodi> next semester I'll take a course that requires to build a project (no, I still don't know what it is!) but I have to choose a language first
<Tasser> Progster, define
<bnagy> no, nor with difficulty
<Tasser> mparodi, use jruby if you want to be able to use both
<Muz> mparodi: in that case, what's your programming background like?
<m4rtijn> mparodi, what shit uni are you at.. decide the language before the project?
<mparodi> in any case, the project will be adapted so it's best developed in that language (it's not the same project regardless the language)
<shevy> mparodi and what is the project about?
<bnagy> that is the most retarded thing I have ever heard
<bnagy> but in any case, choose ruby
<mparodi> haha
<bnagy> if you turned out to be wrong you can cheat and use jruby and still win
<Muz> mparodi: to put the foam-at-the-mouth fanboyism in perspective, join ##java and ask the same question. ;)
<m4rtijn> :)
<shevy> what is this
<shevy> noone knows what this project is about
dv310p3r has joined #ruby
<shevy> WRITE 99 BOTTLES OF BEER
<Tasser> shevy, we're joining a collective troll
<Hanmac> if you want elegant, choose ruby, if you want speed make an c-ext gem and then choose ruby
<JonnieCache> just choose JVM bytecode as your language. then you'll have a choice of excellent tools at your disposal
<shevy> must be some fake project indeed
<m4rtijn> gtg
<m4rtijn> bye
m4rtijn has quit [Quit: Verlassend]
jimeh has joined #ruby
<mparodi> I want to choose ruby but I have to convince 14 people to do that so I'm looking for arguments to do so :P
<bnagy> mparodi: try google
<Tasser> mparodi, oh, that's a different story.
<bnagy> or learn the language and then reason yourself
<workmad3> mparodi: first question - are they actually receptive to learning a new language at the moment?
<shevy> mparodi what.is.this.project.about?
<shevy> notice that my question is valid ruby code
<shevy> try this with java
<mparodi> well, I think so but they prefer Java because they already know Java...
<mparodi> workmad3, ^
<shevy> 14 people and noone knows what this project is about
* Hanmac sings "everything java can, can ruby do better ..."
<workmad3> shevy: NoMethodError: Unknown local variable or method 'what'
<Spooner> Is the project large enough that learning a new language, even one that would enable faster development, wouldn't increase dev time and effort?
<shevy> workmad3, hah you miss the what object!
<shevy> i wanna know what this project is about
<shevy> but he won't tell us
<Hanmac> "14 people and noone knows what this project is about" sound after a group of politicans
chimkan has joined #ruby
<bnagy> shevy: it's actually a social engineering project about trolling programmers
uris has quit [Quit: leaving]
<shevy> lol
<Spooner> shevy : It is "print a line of text onto the screen". Definitely hugely simpler in Ruby :)
<workmad3> shevy: def method_missing(method, *args); ([method] + args).join(" "); end; this is now also valid ruby
<shevy> I think his real mission is to probe #ruby
<shevy> then he'll do the same with #java
<JonnieCache> workmad3: that is horrendous
<Muz> ##java. Oracle won't let them have an official presence on Freenode. :p
<workmad3> JonnieCache: :D
cantbecool has quit [Quit: Textual IRC Client: www.textualapp.com]
<shevy> really??
<JonnieCache> did sun used to let them have one?
<shevy> java today is no longer the java when Sun was in charge
<JonnieCache> im imagining larry ellison busting in and shutting the place down
<JonnieCache> haha
<shevy> mparodi you should use ruby because matz is cool
<Hanmac> imo java was better when it was under the sun
johnernaut has joined #ruby
<shevy> perl was better off when larry was young
<mparodi> <shevy> but he won't tell us <- I don't know. the process is: your group choose the language, the professors give you a client that wants a product that fits in that language
<bnagy> haha
<bnagy> choose brainfuck
<shevy> ...
<Tasser> \o/ brainfuck
<mparodi> lol
<shevy> so you have a professor
<workmad3> mparodi: ok, so this is group coursework...
<shevy> who says "Hey my student slaves. You will get a project, but you won't know which one. You must pick a language in advance."
<workmad3> mparodi: do you actually have time to learn a new language in the timescale for this?
<shevy> this professor is a criminal
<Hanmac> yeah ... choose "C" and the prof wants a website
<shevy> OH
<shevy> PHP!!!
<shevy> GIVE HIM PHP!
<bnagy> also... 15 people per project?
<bnagy> YIKES
<Muz> If you choose Ruby, I bet the project is a failed web-startup site for noo-meedja.
<shevy> add one subtle bug for it
<mparodi> workmad3, I would say yes unless you think it's impossible to learn Ruby from less than 10% to more than 80% in a couple of weeks :)
stopbit has joined #ruby
mrwalker has quit [Remote host closed the connection]
<bnagy> shevy: you don't need to
<bnagy> PHP is self bugging
w400z has quit [Quit: Computer has gone to sleep.]
<shevy> depends... you can learn the basics of ruby in 3 days
<JonnieCache> to knock out a rails website you dont actually need to know much ruby at all
<shevy> but to really learn everything ruby has to offer... 2 weeks would seem not enough
<workmad3> mparodi: and, more importantly... do you have time, as a group of 14 (which is quite a large team) for all of you to learn how to work as a good team, while all also learning a new language and also implementing a project
vlad_starkov has joined #ruby
<workmad3> mparodi: couple of weeks... that's probably enough to learn a good 10% of what ruby has to offer
<mparodi> it has been done before...
<shevy> mparodi, today I learned about remove_instance_variable()
<JonnieCache> i had to do a project like that at uni with about 6 people. it sucked. i ended up having to do 80% of the work because they were useless
berserkr has quit [Quit: Leaving.]
<shevy> hahaha
<shevy> I know how that goes...
<shevy> we were four and everyone had to finish 25% of the same project
<Hanmac> shevy whats ruby ... even if you think you know everything, it has a function you dont know
<workmad3> mparodi: I'm not asking 'has it been done with a different team', I'm asking do *you* have time
<Spooner> That is higher education for you, JonnieCache, it prepares you for the real world of work, where you will always have to carry the idiots.
<JonnieCache> to be fair it was a software engineering class so that was kind of the point - getting experience working in a team with people you dont choose
chimkan has quit [Quit: chimkan]
<shevy> somehow you would think that 4 * 25% would equal 100%, but somehow we never finished completely...
<workmad3> mparodi: different teams, with different people, do something shocking... they work *differently*
<mparodi> <workmad3> mparodi: I'm not asking 'has it been done with a different team', I'm asking do *you* have time <- me? yes
awarner has joined #ruby
<workmad3> mparodi: 'you' in the sense of 'your group'
<shevy> oh yeah I learned something... don't rely on others when you want to get things done (unless you constantly kick them in the nuts, then things could proceed...)
<workmad3> mparodi: when talking about teams 'you' is always a collective you
<shevy> ok
<shevy> mparodi will do 100% of the work in ruby
<shevy> :)
<shevy> let the others write in java
dhruvasagar has quit [Ping timeout: 255 seconds]
<Spooner> I remember that my project team refused to consider SVN (it was a while ago :D) and decided that emailing a .zip was the most efficient way to collaborate. Those were the days!
<shevy> you'll need only "0% of the code they need
<shevy> 20%
iamjarvo has joined #ruby
<workmad3> shevy: the learning curve is asymtotic :)
<shevy> yeah so he better get started today
<mparodi> <Spooner> I remember that my project team refused to consider SVN (it was a while ago :D) and decided that emailing a .zip was the most efficient way to collaborate. Those were the days!
<mparodi> lol
<shevy> mparodi, go start learn ruby now
maxmmurphy has joined #ruby
<shevy> Spooner my team also thought that emails would be great
<workmad3> mparodi: you don't need to repeat someone's entire sentence to reply btw...
<mparodi> (it happened to me too >_>)
<shevy> but one guy in my team never replied at all...
<banisterfiend> shevy: u have a team? ppl pay for u to write code? :P
noyb has quit [Quit: Leaving.]
<Hanmac> git or hg are VERY better then svn
<shevy> banisterfiend was not for programming
<JonnieCache> mparodi: you might be best off with java then. if they wont even accept SVN over zipfiles they're not going to like ruby over java
<banisterfiend> shevy: ah, then maybe it made sense not to use version control ;)
<shevy> the only thing I could have done related to programming would have been to populate excel files via ruby
<Spooner> hanmac No, they were not. Not having been implemented at the time makes them infinitely worse than SVN!
<workmad3> Hanmac: they are... but they also have a steeper learning curve, especially if you're coming from no SCM
<Muz> shevy: win32ole!
<shevy> Muz ewwwwww
<mparodi> JonnieCache, it is, in fact, the same kind of "software engineering class" you had
<Hanmac> svn its a bit monotheism imo ...
nari has quit [Ping timeout: 252 seconds]
<workmad3> Hanmac: and in fairness, sometimes SVN is a good tool
<JonnieCache> mparodi: theyre asking you to do the whole waterfall development model right?
<Spooner> I'm not suggesting anyone should use it any more. It was better than the alternative at the time (CVS or some other ancient crap).
<JonnieCache> with pages and pages of UML?
Nanuq has joined #ruby
<workmad3> Spooner: visual sourcesafe!!!
<Spooner> UML! What a great joy.
<Spooner> Oh yeah, I used that at work a few years later. At uni, however, noone was really interested in any tools that weren't taught (and graded) in the class.
<workmad3> Spooner: visual sourcesafe to store all your diagrams from your UML CASE tool :D
carlyle has joined #ruby
<JonnieCache> so many hours of my life wasted doing UML. the fact that it took place in my youth, which is apparently the most valuable time you get, is just salt in the wound
<peterhellberg> IBM Rational ClearCase!
<mparodi> JonnieCache, yes, from the very beginning... analysis, design, development, testing, etc, etc, etc. all of that well documented in endless documents
sspiff has quit [Ping timeout: 260 seconds]
<workmad3> mparodi: yay, you have a software engineering course that is about 2 decades out of date :D
<shevy> oh god
<Spooner> workmad3 Yep, I did exactly that at work :) Amusingly, I had to correct my bosses UML, but then he explained that it was generated for appearances, not because it was useful, so it being right was pointless :D
habib has quit [Read error: Operation timed out]
<mparodi> workmad3, how does it work nowadays?
<JonnieCache> workmad3: its still wanted by BigCorps and theyre the ones that dictate university curricula
<shevy> (1) you get the problem (2) you solve it (3) you sit on the beach and relax
<shevy> JonnieCache :(
<shevy> ZOMBIE CODERS
<JonnieCache> agreed
<workmad3> mparodi: seriously? you want me to in effect give you a 3 month university course in a few minutes over IRC???
<mparodi> I would say it's not the correct approach with big projects
<mparodi> shevy, ^
<shevy> how big :)
<shevy> rails size?
<mparodi> was rails like that?
<shevy> rails is pretty big
<shevy> dunno. it was smaller in the past
<shevy> I think they rewrote some other project
<shevy> and then called that project "rails"
<workmad3> mparodi: and I *know* this stuff is at least a 3 month university course... because I've actually taught agile methods @ uni, in a 6 week course and that was barely enough to give the essentials
LBRapid has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
sspiff has joined #ruby
sspiff has joined #ruby
<bnagy> agile is wank
<mparodi> yep, it's a 4 month course in fact
uris has joined #ruby
strnx has quit [Excess Flood]
verbad has quit []
<JonnieCache> shevy: they merged rails 2 with merb 1 to make rails 3. it actually reduced the codebas substantially though
<JonnieCache> *codebase
<shevy> ok
<shevy> but I mean rails-0.x or something like that
<shevy> I really forgot how rails started
andrewhl has quit [Remote host closed the connection]
<workmad3> JonnieCache: some bigcorps still want it, but fewer, and there's a lot of medium businesses that want agile skills... a lot of leeds and yorkshire won't touch CS graduates for example, because they need to untrain them too much, they'd rather just get other science and engineering graduates and train them properly
* Hanmac has multible projects ... all of them are "rails-size" :P
<JonnieCache> workmad3: yeah its a joke. CS courses are so pointless. fortunately I worked that out early and spent most of my time doing stupid shit, and only went to the good lectures
statarb3 has joined #ruby
statarb3 has joined #ruby
<JonnieCache> not to say all CS courses are pointless. just most of them
joshman_ has joined #ruby
<shevy> hehe
<workmad3> JonnieCache: most of them have a point... but the point isn't software engineering
<shevy> not all girls are evil. just most of them
<hoelzro> workmad3: indeed
w400z has joined #ruby
<workmad3> JonnieCache: it's dubious (IMO) whether most CS courses even need to bother teaching programming... it's not really needed for a lot of academic CS work
<bnagy> if CS is preparing you for vocational programming then it's a stupid course
<workmad3> JonnieCache: and it's something that CS courses aren't very good at teaching :)
<bnagy> that's why they put the 'S' in there
<JonnieCache> my CS degree wasnt a proper one at all tbh
<JonnieCache> thinking back, actual Computer Science was a minority of the material
<bnagy> if you want to get a job you can just take a 3 week rails bootcamp and buy a clipon tie
<workmad3> JonnieCache: a lot of my CS degree was actual CS... logic, language theory, database theory, formal methods
havenn has joined #ruby
twinturbo has joined #ruby
<workmad3> JonnieCache: I even did a quantum computing course, that was sort of interesting :)
<hoelzro> workmad3: that sounds pretty cool
<workmad3> hoelzro: large amounts of linear algebra
<hoelzro> I'm pretty happy with my CS education
<hoelzro> we covered a lot of useful, as well as interesting, stuff
_bart has quit [Read error: Operation timed out]
<JonnieCache> yeah we did cover all that stuff. there was SO MUCH crappy software engineering stuff, and really basic courses about networking etc
baroquebobcat has joined #ruby
<bnagy> that is the best prank ever, whoever came up with that is a genius
<workmad3> hoelzro: the only problem was I didn't realise it was linear algebra until just before the exam... I'm pretty good at linear algebra, but I had issues with the notation :)
<JonnieCache> in the second and third year it was a lot better
vlad_starkov has quit [Remote host closed the connection]
<bnagy> quantum computing == ambush linear algebra
<workmad3> JonnieCache: first year tends to be an 'equalizer'
burgestrand has joined #ruby
<workmad3> bnagy: quantum physics is masses of linear algebra
<JonnieCache> quantum physics is supposedly just probability theory with complex numbers
<bnagy> odds of ever seeing a quantum computer -> 0, odds of needing linear algebra, though?
<workmad3> bnagy: however, it's complex linear algebra (as in, complex numbers)
<JonnieCache> i cant verify that though :)
<JonnieCache> workmad3: I did get to do a lot of cool stuff though, like music technology, generative creativity, and robotics
cantonic has quit [Read error: Operation timed out]
<workmad3> JonnieCache: there's probabilities that come into play when doing observations, and there's transformations that are linear (and I think, some non-linear) algebra on phase spaces for the system as the system evolves without observation
jjbohn has joined #ruby
w400z has quit [Quit: Computer has gone to sleep.]
<workmad3> JonnieCache: and there's some really, really weird results that come out of it as a whole :)
kevinbond has joined #ruby
<workmad3> bnagy: they have built some quantum computers... but yeah, I'm doubtful they'll become household items anytime soon
<joesavage> I'm creating a client-side search system which utilises a Ruby-generated XML file. I don't want to put the content for every article inside this XML file (people could easily duplicate my content, view without advertisements elsewhere, etc), but I need some indication on the words used in the article so the search is actually useful. Is there any easy way to pick out keywords from a large section of text, easily, using Ruby?
kevinbond has left #ruby [#ruby]
<JonnieCache> i love physics. it blows my mind. i watched a thing about black hole entropy the other day and I had to go and have a lie down
<workmad3> bnagy: but then, they said the same about normal computers only about 50 years ago...
<workmad3> JonnieCache: ditto :D
<workmad3> JonnieCache: relativity is, IMO, almost as mind-blowing as quantum physics, but it's the quantum stuff that gets the reputation for strangness
<JonnieCache> workmad3: i only recently worked that out. relativity is easier to understand but the implications are harder to see
<JonnieCache> thats why black hole entropy is so mad: it sort of combines the two. and it brings entropy into it just to seal the deal :)
<workmad3> JonnieCache: I love the idea that, at the speed of light, time and distance become almost meaningless
sailias has joined #ruby
GoBin has joined #ruby
davidpk has joined #ruby
mockra has joined #ruby
<bnagy> uh
<workmad3> joesavage: I'm not sure that semantic reasoning technology is at the point where any programming language has the capabilities to usefully pick out keywords in large sections of text
charliesome_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<JonnieCache> workmad3: well massless particles dont really travel at all. they really even exist as objects as I understand it, theyre just pairs of events, emission and absorbtion
<bnagy> which is why 'search engines' will never take off
<joesavage> workmad3: Darn - I don't really want to have a massive array or hash or something which contains the count for different words -- do you have any suggestions for any kind of solution to my problem?
<JonnieCache> s/really/dont really
sspiff has quit [Remote host closed the connection]
<workmad3> bnagy: search engines have a different problem ;)
strnx has joined #ruby
<JonnieCache> joesavage: extracting keywords is a complex business. fortunately there are APIs to do it http://www.alchemyapi.com/api/keyword/
<workmad3> joesavage: most people do keyword categorisation manually
<JonnieCache> joesavage: theres also this library http://www.gnu.org/software/libextractor/
cascalheira has quit [Ping timeout: 260 seconds]
<JonnieCache> tbh youd be best off getting an intern to do it or something
<workmad3> I guess if you had a large body of pre-categorised content, you could actually do some reasoning by doing some comparison with the existing content to try and figure out categories
<workmad3> wouldn't surprise me if that's the sort of stuff google does at times :)
kpshek has quit []
<workmad3> but then... not many people have either the dataset or the computing resources of google to hand...
nari has joined #ruby
ryh has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
sernin has joined #ruby
mneorr has quit [Quit: Leaving.]
jonathanwallace has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
verto|off is now known as verto
bsp has joined #ruby
mockra has quit [Remote host closed the connection]
moshef has quit [Read error: Connection reset by peer]
Synthead has joined #ruby
SCommette has joined #ruby
moshef has joined #ruby
moshef has quit [Client Quit]
jimeh has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
yakko has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
Cache_Money has joined #ruby
macer1 has joined #ruby
<macer1> hi
<macer1> how can I decrypt des md5 salted msg in ruby?
<macer1> I tried but failed
<Spooner> macer1 : Paste up the code you have failed with?
vlad_starkov has joined #ruby
Squarepy has quit [Ping timeout: 248 seconds]
MarGarina has quit [Ping timeout: 248 seconds]
joshfng has joined #ruby
<workmad3> macer1: 'decrypt'?
<workmad3> oh, salted
joshfng has quit [Client Quit]
<macer1> decrypt error
chimkan_ has joined #ruby
MarGarina has joined #ruby
verto is now known as verto|off
centipedefarmer has quit [Quit: Leaving]
Bofu has quit [Ping timeout: 264 seconds]
<shevy> WAAAH
<shevy> @@x = 123456789
<shevy> matz uses lots of class variables
<shevy> :(
<shevy> @@x, @@y, @@z = @@y, @@z, w
mathie has quit [Quit: Sleeping...]
<Spooner> He invented them. He wants to get his money worth!
<shevy> ok
<shevy> I am going to suggest addition of @@@foo
mutexkid has joined #ruby
<shevy> the more @ the more powerful
<hoelzro> shevy: it's just like pointers!
jimeh has joined #ruby
Squarepy has joined #ruby
<Spooner> How about 5@foo - which is a nice clean shorthand!
<shevy> heeh
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<shevy> nah
<shevy> pointers are more confusing than class variables
<Spooner> For getting a lot of @ery.
<sernin> I like the term @ery
<hoelzro> Spooner: I think it should use Unicode instead: @⁵foo
<Spooner> We already had this discussion. Ruby should standardise to use UTF-9 using three trytes!
<hoelzro> oh, I must have missed that
<hoelzro> but UTF-9 would still be Unicode =)
<macer1> any ideas with that des?
w400z has joined #ruby
emmanuelux has quit [Ping timeout: 240 seconds]
<workmad3> hoelzro: and introduces the possibility of a UTF-36 :D
<bnagy> macer1: salt makes no sense in this context
Asher has quit [Ping timeout: 276 seconds]
<bnagy> you might mean IV
<macer1> emm
<bnagy> in which case your key and IV are the wrong way around
<macer1> this is what I am trying to implement
<bnagy> although I dunno why you concat them if you're just going to split them up afterwards
<macer1> PBEWithMD5AndAes
<macer1> DES*
Asher has joined #ruby
fearoffish has quit [Read error: Operation timed out]
<macer1> there it is, generate key, key = key+salt and md5 that 5 times
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<workmad3> yay, non-standard encryption functions making use of broken, insecure hashes :D
<Spooner> Explicit self. I knew there was a reason I didn't like Python.
<workmad3> Spooner: there are so many reasons, why pick just one?
<hoelzro> I think explicit self is a silly reason not to like something =)
<Spooner> That was the one that leapt out at me though.
<hoelzro> there are better reasons to not care for Python, imo
maxmmurphy has quit [Quit: maxmmurphy]
<otters> all the underscores
ephemerian has quit [Quit: Leaving.]
internet_user has joined #ruby
<macer1> ehh :/
<otters> whitespace sensitivity?
<Spooner> Explicit end is a bit crap in Ruby though, just for comparison.
bglusman has joined #ruby
<hoelzro> my biggest reason is the broken lambdas
<otters> that too
kvirani has joined #ruby
<otters> and if __name__ == "__main__"
_bart has joined #ruby
<hoelzro> along with funky scoping issues in nested functions
<otters> and pass
johnlcox has joined #ruby
<_bart> So I have this regexp for detecting usernames in urls: http://rubular.com/r/vLwGRvmQda
andrewhl has joined #ruby
<_bart> how do I improve it to NOT match the last row of test string
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
<shevy> by cuddling the otter of course
<otters> I don't understand what the regex is supposed to match
<shevy> itself!
<shevy> a moebius regex
<otters> and it appears as though you're using [|] instead of (|)
<workmad3> otters: ruby is whitespace sensitive... compare a =~ b and a = ~b
<shevy> indeed
<_bart> I do that because when I use (|) it'll show up in the matches.
<shevy> it even warns about mismatched indent
<otters> right, that example is totally comparable to the fact that every line in python must be properly indented
<bnagy> macer1: if you have a test input and output I guess I could look at it
<otters> exactly the same problem
<Hanmac> otters as far as i know there is no __name__
<shevy> otters, well python is stricter :)
<workmad3> _bart: you suck at regex :P
<otters> _bart: but then [...] is just the character set "username|"
<macer1> bnagy: you don't play minecraft :P?
<bnagy> no
<workmad3> _bart: [] is charset, not grouping :)
mneorr has quit [Ping timeout: 264 seconds]
<shevy> DiamondShell.new if __FILE__ == $PROGRAM_NAME
<macer1> wait, I will prepare some sample inputs
jonathanwallace has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<_bart> Spooner: thanks!
Asher has quit [Ping timeout: 260 seconds]
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
<Spooner> _bart : [\/|\=] should be [\/=]
<workmad3> otters: yes, but python has whitespace-delimited blocks, rather than just 'whitespace sensitivity' :)
<Spooner> [x|y] is x, | or y
<Spooner> It doesn't work like (|)
<_bart> ah okay
mathie has joined #ruby
<macer1> hmm now how to encode something into it -.-
<Spooner> _bart : so http://rubular.com/r/dKXsVGiBy6
<workmad3> otters: not saying you don't have a point... it gets a bit annoying in python for that (although it was less annoying than I thought it would be when I did some python), but dissing on 'whitespace sensitive' leaves openings in the argument
ukwiz has joined #ruby
<otters> okay
<otters> to be fair, haskell is the same way, but it doesn't annoy me there
deryl has joined #ruby
<Spooner> I find it actually quite nice in YAML/HAML/Slim to have indention meaningful.
<otters> Perhaps because Haskell is functional
<ukwiz> how do I force all access to ruby on a system (opensuse) to use 1.9?
<sernin> Remove all other versions?
<bnagy> hhah opensuse
chimkan_ has quit [Ping timeout: 260 seconds]
<otters> Nature, uh, uh, uh, finds a way.
Goles has quit [Quit: Computer has gone to sleep.]
jgrevich has joined #ruby
newbie|2 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
vlad_starkov has joined #ruby
<ukwiz> I was told that it is a bad idea to remove the "system installed" version
ananthakumaran has joined #ruby
<sernin> but in essence you're overriding the 'system installed' version by forcing 1.9
<sernin> so that point is moot
<bnagy> well you can either use an OS package that is up to date, or use rbenv / rvm etc
<deryl> you could use rvm as well in a multi-user install configuration. You can force root to use a specific RVM controlled ruby as well, BUT that is NOT a supported configuration. (Most distribs still default to using 1.8.7-p### for the *system* ruby, which means any 1.9 specific code will not work and can cause problems.)
revans has joined #ruby
<_bart> Spooner: heh I get it now, it was pretty stupid, but I didn't noticed because [a|b], does select a or b just like (a|b) does but also '|'. :p
<bnagy> if you use rvm as a system install you have a very high chance that everything will be Just Fucked
<bnagy> rbenv handles that better, you can just link it into usr local or wherever
aganov has quit [Quit: aganov]
<deryl> bnagy: exactly. which is why its not a supported config by the Project
<bnagy> or just use ruby-build directly
<deryl> well, its no less of a chance with rbenv than with rvm.
<Spooner> _bart : Yeah, it works with single-character sets (sort of). I hope you find (?:xx|yy) useful in the future though.
<bnagy> personally, I'd use ruby-build directly into usr local, but ymmv
<bnagy> tbh I don't like forcing a system version
<deryl> me either
chimkan has joined #ruby
<ukwiz> bnagy: I am thinking more of things like apache
<Spooner> deryl I found someone only yesterday, using yum on CentOS, that had Ruby 1.8.5 :)
strife25 has joined #ruby
<deryl> Spooner: damn!
<shevy> hehe
<bnagy> isn't apache a user?
<deryl> bnagy: on most systems its run under www-data
<ukwiz> yes...
<deryl> or 'nobody'
<bnagy> not to mention, I would normally run apache chroot :P
<Spooner> deryl It mostly worked, but had odd bugs where gems actually tried to do anything clever :)
<shevy> weakling!
<shevy> ALL POWER TO THE APACHE
<deryl> Spooner: hehe
rutkla has joined #ruby
<deryl> or the gems were using something that old a version of ruby didn;t support (e.g new hash syntax etc)
<deryl> is it etcetera or ectera (etc or ect)
<sernin> it is etc
<bnagy> etc
<deryl> always get that confused
<bnagy> et cetera and others
<deryl> got it :) thanks
<bnagy> don't they teach latin in schools these days?
<deryl> nope. I'm 41. haven't been in school in ages hehe
<sernin> technically
<sernin> et alia is 'and others', referring to people
<Spooner> deryl : I think it was something like instance_variable_get, which was introduced in 1.8.6 back when Adam was a lad.
<deryl> and they definitely don't teach it in the Army unless you go to the Defence Language Institute
<sernin> et cetera is 'and other things'
<deryl> Defense
<bnagy> sernin: that would usually be inter alia
<deryl> Spooner: ahh yeah that would cause issues
<deryl> sernin: oo. believe it or not i've never heard of et alia
<ukwiz> if you remember et is and, then you should always get it right
<bnagy> cetera is closest to 'the rest' but pff colloquial translation
jjbohn has quit [Ping timeout: 260 seconds]
<sernin> inter alia is 'among' others. :)
jonathanwallace has quit [Remote host closed the connection]
GoBin has quit [Quit: Verlassend]
<bnagy> sernin: yeah, and is also a latin phrase that is used as opposed to one you made up to try and look smart
mneorr has joined #ruby
<bnagy> but whatever gets you hard, bro
<sernin> bnagy: et al. ?
jjbohn has joined #ruby
robbyoconnor has joined #ruby
arkiver has quit [Quit: Leaving]
<bnagy> sernin: that is an extremely good point and I retract my earlier statement
<ukwiz> I am trying to use rvm, but want to ensure that things like apache, cron jobs, etc use 1.9.3
<deryl> now that one i know. et al means 'everything' right?
<bnagy> ukwiz: honestly, don't
<bnagy> no, it means what sernin said before, just abbreviated
jprovazn is now known as jprovazn_away
<deryl> ukwiz: dude, I was (and am still listed as) part of the RVM project and I will tell you, bnagy is correct. don't.
<sernin> ukwiz: that'll probably cause subtle and unexpected breakage. package maintainers assume things about the state of other packages in the distro
<deryl> sernin++
fearoffish has joined #ruby
<deryl> doesn't opensuse have something similar to debian's update-alternatives?
<bnagy> what does suse use, anyway? yum?
ecksit has quit [Quit: Laters.]
shevy has quit [Read error: Operation timed out]
<deryl> OS has ruby19 packages so wouldn't he be able to install those and then update-alternatives to point the main ruby at the 1.9?
<bnagy> that is the Hanmac Approved Method I think
<deryl> bnagy: I believe it does. like centos
nateberkopec has quit [Quit: Leaving...]
SQLStud has joined #ruby
tomb_ has joined #ruby
<deryl> but if nothing else its still rpm, so he could d/l the pkgs on his own and install using rpm directly
<deryl> its the symlink changes i am not sure how he'd do
<bnagy> :(
<bnagy> it all sounds like shit
<deryl> its pkgs so, you're right :)
robbyoconnor has quit [Remote host closed the connection]
statarb3 has quit [Quit: Leaving]
cbuxton has joined #ruby
robbyoconnor has joined #ruby
mikepack has joined #ruby
berserkr has joined #ruby
<deryl> damn, its not until you cut the crap out of it that you realize just how much you use your middle finger when typing. just popped the damned seal again, it feels like.
<macer1> hah, fixed my des enc
<deryl> nope, no blood, but damned sure hurts tapping keys with it
<macer1> first, md5::digest not hexdigest and iv and key are same(key[0..8])
nateberkopec has joined #ruby
_bart has quit [Ping timeout: 240 seconds]
<Synthead> is there a way to test if a is either 'this' or 'that' in a way other than a == 'this' or a == 'that' ?
<bnagy> ['this','that'].include? a
<hoelzro> Synthead: ['this', 'that'].include? a
<bnagy> WINS
<hoelzro> jynx
<deryl> lol
<deryl> hot on the heels of each other
<otters> how much overhead is that?
davidcelis has quit [Quit: K-Lined.]
<deryl> as in execution speed of the check? idk
canigetawitness has quit [Quit: leaving]
monkegjinni has joined #ruby
linduxed has quit [Quit: WeeChat 0.3.7]
<macer1> what is the most pretty way to md5 something 5 times :P?
<deryl> open pry and require benchmark and test
<workmad3> Synthead: or even a =~ /th(is
<workmad3> |at)
<workmad3> (except without the newline, obviously :P)
<deryl> workmad3: doesn't that do a replace though?
<hoelzro> macer1: inject?
<workmad3> deryl: no
<hoelzro> macer1: why would you want to, though?
<Synthead> workmad3: ahhh, that's more what I was thinking, haha
bluOxigen has quit [Ping timeout: 252 seconds]
<bnagy> macer1:res=5.times { md5 shit }
<macer1> this returns 5
<macer1> ...
<macer1> not the md5
<bnagy> ohwait that sux
<bnagy> inject is correct
<hoelzro> WINS
<hoelzro> =P
<otters> inject?
<deryl> 5.times { md5 shit} as well?
<otters> o_o
ckrailo has joined #ruby
<macer1> 5.times { digest = Digest::MD5.hexdigest("hi")} returns 5
<macer1> how to do the inject?
<bnagy> although 5.times {res=md5(res)} might work
<hoelzro> (1..5).inject(data) { |a, b| md5 a }
<hoelzro> I think
<otters> that would
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<workmad3> hoelzro: that looks right, although I'd probably have gone for |a, _
<workmad3> |
<hoelzro> workmad3: oh, thanks for the tip!
<workmad3> gah, keep hitting return stupidly today :(
<Synthead> a = 'that'; a =~ /(this|that)/ returns 0. why?
<bnagy> macer1: it might, but you need to check the value of digest
<otters> it's the vertical bar
<ukwiz> bnagy: yes it is shit, which is why I am still using python for most things rather than ruby. unfortunately things like sass need ruby, as does tracks which I am using
<hoelzro> is _ a special variable in Ruby, or just a convention?
<workmad3> otters: yeah, it is... it's just above return on this kb
<macer1> @_@
<hoelzro> |a,| would also work, right?
<otters> same
<workmad3> hoelzro: it's a bit of both :)
Stalkr_ has joined #ruby
<hoelzro> workmad3: oh? in what way is it special?
<macer1> how to do this with inject?
<workmad3> hoelzro: _ stores the result of the last expression, at least in IRB
<workmad3> hoelzro: but I tend to use it for a block param I want to ignore :)
<hoelzro> (1..5).inject(data) { |a,| md5 a }
<hoelzro> macer1: ^^
<hoelzro> workmad3: we use it for that in Lua as wel
<hoelzro> *well
Jay_Levitt has joined #ruby
<macer1> looks like works
<bnagy> macer1: where md5 is probablt Digest::MD5.hexdigest( a )
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<deryl> ok folks. later. got stuff to do for this last leg of the move. hopefully we can be out of here and home today.
peterhellberg has quit [Remote host closed the connection]
ckrailo has quit [Client Quit]
<bnagy> happy trails, or whatever you people say :)
deryl has quit [Quit: Time To Go, Too Bad, So Sad!]
maesbn has quit [Remote host closed the connection]
nari has quit [Ping timeout: 240 seconds]
havenn has quit [Read error: Connection reset by peer]
gift has quit [Quit: it puts the packet in the socket or else it gets the close() again]
Cache_Money1 has joined #ruby
Cache_Money has quit [Ping timeout: 260 seconds]
havenn has joined #ruby
chimkan___ has joined #ruby
rutkla has quit [Ping timeout: 260 seconds]
tk__ has quit [Quit: ばいばい]
<hoelzro> macer1: btw, why do you want to md5 something 5 times over?
<bnagy> because retarded minecraft crypto
<macer1> it is an encryption
<hoelzro> ...
<macer1> not this is
<macer1> ..
chimkan has quit [Ping timeout: 248 seconds]
chimkan___ is now known as chimkan
<macer1> des with salted md5
<y2k> :x
<macer1> this is just file encryption :x
<bnagy> all the awesomeness of plain DES with the added daunting complexity of 5 count them FIVE MD5 rounds
devdazed has joined #ruby
<bnagy> honestly these people are effing retards
shevy has joined #ruby
locriani has quit [Remote host closed the connection]
<bnagy> that's crypto from like 1992
ckrailo has joined #ruby
d3vic3 has joined #ruby
<macer1> emm
havenn has quit [Read error: Connection reset by peer]
aantix has joined #ruby
<macer1> it is not important, the password for this is 'passwordfile'
<macer1> this is crypted just to not be viewable in text editor
<macer1> not to be undecryptable
JohnBat26 has quit [Ping timeout: 264 seconds]
<Spooner> Why not just use Caesar cipher instead then? A lot less hassle :D
havenn has joined #ruby
<workmad3> rot13 ftw!
<workmad3> or base64 encoding
xaq has joined #ruby
<sernin> There need to be more @'s in your cipher
kevinbond has joined #ruby
<otters> I'm going to make a cipher that encrypts the file, then converts it to binary with @ for 1 and ' ' for 0
jonathanwallace has joined #ruby
<shevy> cool
<macer1> :D
burgestrand has quit [Quit: Leaving.]
<shevy> a ciphering otter
<macer1> hehe
und3f has quit [Quit: Leaving.]
und3f has joined #ruby
Spooner has quit []
Cache_Money1 has quit [Ping timeout: 240 seconds]
cakehero has joined #ruby
mikemac has quit [Ping timeout: 272 seconds]
ckrailo has quit [Quit: Leaving...]
mengu has quit [Quit: Konversation terminated!]
quest88 has joined #ruby
pdtpatrick has joined #ruby
ckrailo has joined #ruby
wallerdev has joined #ruby
burgestrand has joined #ruby
* Muz grumbles about cleaning up other people fucking shitty code.
<Muz> You can tell this code is utter gash because the people that wrote it are oblivious of case statements for one. And /everything/ is a global.
<otters> maybe they came from PHP?
<otters> "oh, that thing has a dollar sign, it must be a variable"
wvms has quit [Quit: wvms]
<Muz> I don't think their background is one fraught with experience.
jgrevich has quit [Quit: jgrevich]
<shevy> man
nir has joined #ruby
<shevy> I love that Muz makes '.'
<shevy> It gives his observations a kind of professional touch
* Muz is starting to think shevy is coming onto him,.
<otters> speaking of periods, I should probably have breakfast
<shevy> though it is PHP... PHP is an awful language
<shevy> the worse language encourages more horrible results
<GeekOnCoffee> perl puts $ in front of vars too
<otters> yeah, but not all
<otters> at least it has sigils that mean things
<otters> PHP is just
blazes816 has joined #ruby
<shevy> perl is awful too
<shevy> but PHP got the www focus right at least
<otters> perl's not bad
<otters> it's too bizarre to be bad
<otters> my load average is 4.95
savage- has joined #ruby
<Muz> Whenever otters writes anything, I get http://mustaqila.li/crap/otters.jpg in my mind.
<otters> That's pretty much what I intended
w400z has quit [Read error: Connection reset by peer]
w400z has joined #ruby
chimkan has quit [Quit: chimkan]
<hoelzro> perl isn't *that* bizarre =)
<bperry> I like malbolge
<hoelzro> don't forget that Ruby has Perl heritage =)
maxmmurphy has joined #ruby
<hoelzro> bperry: heh
Morkel has joined #ruby
<otters> yeah, well, I have ape heritage
<otters> but I don't go around blabbing about it
<bperry> a teacher was getting on to me in high school for not doing a paper, and I told her I would rather rewrite linux in brainfuck than write her paper
dhruvasagar has joined #ruby
<bperry> got detention :(
verbad has joined #ruby
benson has joined #ruby
<bperry> GO FIGURE
GlenK has joined #ruby
<otters> for saying "fuck"?
<bperry> probably that and being disrespectful and not doing the work she asked me to
<GlenK> hi. is there a difference between collect and map?
davidcelis has joined #ruby
<hoelzro> GlenK: I think they're synonymous
<GlenK> k, thanks.
<otters> collect is named so for the *ect family of methods
burgestrand has quit [Quit: Leaving.]
Morkel has quit [Client Quit]
stkowski has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
<hoelzro> I thought it was because Smalltalk had collect?
<otters> wouldn't know
<otters> collect, reject, accept, select
<otters> or whatever the hell it is
<banisterfiend> otters: 'accept' ? :)
<otters> it almost ends in ect
kvirani has quit [Remote host closed the connection]
<otters> whether it's an Array method or not I do not remember
<hoelzro> banisterfiend: accept == select, iirc
<otters> accept doesn't exist after all
<hoelzro> oh, sure enough
<otters> inspect, then
kevinbond has left #ruby [#ruby]
skrite has quit [Quit: WeeChat 0.3.7]
bradhe has quit [Remote host closed the connection]
hoelzro is now known as hoelzro|away
verbad has quit [Quit: Computer has gone to sleep.]
ttilley is now known as ttilley_off
robbyoconnor has quit [Remote host closed the connection]
w400z has quit [Read error: Connection reset by peer]
w400z has joined #ruby
devdazed has joined #ruby
chimkan_ has joined #ruby
w400z has quit [Read error: Connection reset by peer]
banghouse has joined #ruby
<macer1> how can I get a fully hex dump of byte string
<macer1> because it is dispalying half hex half ascii
w400z has joined #ruby
<macer1> and I want to paste this to some hex editor
twinturbo has quit [Quit: twinturbo]
robbyoconnor has joined #ruby
<otters> String#bytes
Eldariof-ru has quit [Ping timeout: 246 seconds]
rakm has joined #ruby
<otters> "str".bytes.map{|b|"x#{b.to_s(16)}"}.join(" ")
xorigin has quit [Quit: leaving]
havenn has quit [Remote host closed the connection]
thisirs has joined #ruby
robotmay has quit [Remote host closed the connection]
<macer1> thanks
w400z has quit [Read error: Connection reset by peer]
<macer1> anyone here was using bindata? I have a small problem with number
w400z has joined #ruby
w400z has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Read error: Connection reset by peer]
w400z has joined #ruby
eph3meral has joined #ruby
Z_Mass has joined #ruby
<eph3meral> so I'm trying to do a simple HTTP get request, but the URL that I'm hitting, when I go to it in my browser, automatically has me download a file
wallerdev has quit [Quit: wallerdev]
<eph3meral> is there a way to have ruby's Net::HTTP class detect that the browser is trying to have me download a file and do so also?
bsp has left #ruby [#ruby]
crankyco_ has joined #ruby
crankycoder has quit [Read error: Connection reset by peer]
Beoran_ has quit [Ping timeout: 252 seconds]
<GlenK> so I was sorta expecting this to work on an array of strings: "words.sort {|a, b| a.length < b.length}" Ha, it's not of course.
revans has quit [Quit: Linkinus - http://linkinus.com]
<macer1> how to decode this? ""\x18\e\x9D\x1C\xE3\xBE}W" it is actually 10 and linuks
<macer1> actually rest of the string decodes normally to utf-8
<macer1> which is weird
<bnagy> GlenK: words.sort_by &:length
Fretta has joined #ruby
<GlenK> bnagy: assuming I wanted to do it the way I'm trying, what's going wrong there?
<bnagy> use <=> not <
jeff_sebring has joined #ruby
wallerdev has joined #ruby
jblack has quit [Ping timeout: 264 seconds]
brianpWins has joined #ruby
Hanmac has quit [Ping timeout: 240 seconds]
kevinbond has joined #ruby
darren_ has joined #ruby
crankyco_ has quit [Read error: Connection reset by peer]
minijupe has joined #ruby
ph^ has joined #ruby
lorandi has quit [Quit: Leaving]
<GlenK> bnagy: thanks
w400z has quit [Quit: Computer has gone to sleep.]
Araxia has joined #ruby
carloslopes has quit [Quit: Leaving.]
<joesavage> How can I make use of something like pygments to highlight certain code snippets in a static site generation system where I have access to Ruby helper methods like Frank [https://github.com/blahed/frank]?
crankyco_ has joined #ruby
w400z has joined #ruby
anderse_ has quit [Quit: anderse_]
<banisterfiend> joesavage: ruby has coderay
cbuxton has quit [Ping timeout: 260 seconds]
<macer1> can ruby be included in osx .app?
<macer1> in the Frameworks or something
artOfWar has joined #ruby
<joesavage> banisterfiend: I'll take a look into Coderay then, but as far as I'm aware my problem is the same - how can I make use of the syntax highlighting that Coderay offers to highlight certain code snippets in my articles in a system like Frank?
Hanmac has joined #ruby
<JonnieCache> check out what I just bought: http://www.youtube.com/watch?v=N5OoOv_Y1RM
jwmann has joined #ruby
<shevy> pr0n?
<shevy> what the heck is that
w400z has quit [Client Quit]
<JonnieCache> it is what it looks like
Beoran_ has joined #ruby
<JonnieCache> a very gimmicky percussion instrument :)
TPFC-SYSTEM has joined #ruby
lunitikcalm has joined #ruby
bradhe has joined #ruby
d3vic3 has quit [Quit: leaving]
maletor has joined #ruby
lunitikcalm has quit [Remote host closed the connection]
centipedefarmer has joined #ruby
lunitikcalm has joined #ruby
<joesavage> banisterfiend: CodeRay.scan seems to scan individual files, but how can I make it scan my whole article and only highlight the code snippets?
<JonnieCache> joesavage: put the code snippits inside some kind of tags
cbuxton has joined #ruby
<banisterfiend> joesavage: it scans strings
Squarepy has quit [Read error: Connection reset by peer]
Squarepy_ has joined #ruby
<banisterfiend> joesavage: CodeRay.scan("code string", :ruby).html
jarek has joined #ruby
havenn has joined #ruby
<JonnieCache> there is a good railscast on syntax highlighting
<JonnieCache> its not specific to rails
<jarek> Hi
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
<jarek> is there something like console.dir() from JavaScript in Ruby?
<joesavage> JonnieCache: I can put the snippets in HTML tags, but how can I target these sections? I can't just call coderay.scan on the whole "yield"
Squarepy_ is now known as squarepy
<banisterfiend> jarek: present directory, or what?
<banisterfiend> jarek: maybe u want: Dir.pwd
<joesavage> banisterfiend: I need it to scan for all the code snippets in an article though, I can't just use CodeRay.scan to surround every code snippet
<JonnieCache> joesavage: put them in <code> tags and then grab them out using nokogiri
havenn has quit [Remote host closed the connection]
<jarek> banisterfiend: I would like to see all properties and methods of an object (including those that were inherited)
<JonnieCache> but i think coderay does that anyway tbh
<joesavage> JonnieCache: I was rather hoping CodeRay would do it automatically, I wouldn't know how to do it using nokogiri, but I can't find out how
<banisterfiend> jarek: is this inside the repl? or just in a program?
<jarek> banisterfiend: just inside the repl
<banisterfiend> jarek: then look at pry: http://pry.github.com and its 'ls' command
DrShoggoth has joined #ruby
answer_42 has joined #ruby
quest88 has quit [Quit: quest88]
<jarek> banisterfiend: thanks
havenn has joined #ruby
<JonnieCache> joesavage: Nokogiri::HTML(document_as_a_string).css('code').each {|c| c.content = CodeRay.scan(c.content) }
<JonnieCache> thats probably wrong somewhere but thats the general idea
sgronblo1 has quit [Ping timeout: 252 seconds]
<JonnieCache> doing it in one line like that probably isnt really advisable either
<JonnieCache> in fact that wont work. you need to keep a reference the nokogiri document object so you can render it back to html again
<joesavage> JonnieCache: Actually it turns out that the Railscasts that someone talked about a while back has a really good helper method for it
kenichi has joined #ruby
jhunter has quit [Ping timeout: 264 seconds]
<macer1> does ruby openssl cipher have encoding?
<macer1> because decrypting in python returns string1\nstring2 and in ruby hex crap
ianbrandt has joined #ruby
jhunter has joined #ruby
br4ndon has quit [Ping timeout: 260 seconds]
Guest40040 is now known as chee
chee has quit [Changing host]
chee has joined #ruby
Hawklord has joined #ruby
Spooner has joined #ruby
mahmoudimus has joined #ruby
kevinbond has quit [Ping timeout: 240 seconds]
adeponte has joined #ruby
nyuszika7h has joined #ruby
adeponte has quit [Remote host closed the connection]
uris has quit [Quit: leaving]
kevinbond has joined #ruby
adeponte has joined #ruby
minijupe has quit [Quit: minijupe]
ringotwo has joined #ruby
ringotwo has quit [Remote host closed the connection]
Rochefort has quit [Remote host closed the connection]
mneorr has quit [Quit: Leaving.]
ringotwo has joined #ruby
Criztian has joined #ruby
kenichi has quit []
sgronblom has joined #ruby
verto|off is now known as verto
mrsolo has joined #ruby
kenichi has joined #ruby
whitedawg has joined #ruby
kevinbond has left #ruby [#ruby]
elhu has quit [Ping timeout: 252 seconds]
jarek has quit [Ping timeout: 248 seconds]
<_br_> macer1: Probably, did you check .encoding for the object you are sending?
bier has quit [Ping timeout: 240 seconds]
twinturbo has joined #ruby
<macer1> I forced to utf8
<macer1> ;/
<_br_> as well in python?
<macer1> no
<macer1> dunno what python uses
<macer1> but it decrypts to string1\nstring2
oposomme has joined #ruby
oddmunds has quit [Ping timeout: 248 seconds]
<_br_> probably python uses utf8 internally. But still its better to check.
davidpk has joined #ruby
<macer1> ehh
<macer1> so what I can do
sailias has quit [Quit: Leaving.]
apok has joined #ruby
<macer1> part decrypts normally
<macer1> part not
<_br_> hm weird.
verto is now known as verto|off
<_br_> did you try to see how the payload should look like if you just use python?
ph^ has quit [Remote host closed the connection]
<macer1> "\x18\e\x9D\x1C\xE3\xBE}Wtesting1@gmail.com\x00\npasswordz1"
verto|off is now known as verto
<macer1> actually the email is linukstesting1@gmail.com
<macer1> this is weird
<_br_> wth
<macer1> yeah :)
<_br_> is this some utf8 vs utf16 issue?
jlogsdon has joined #ruby
<macer1> no
<macer1> it is originally utf8
oddmunds has joined #ruby
jarred has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
adamkittelson has joined #ruby
<eph3meral> ok, so I've been googling for a bit, but I don't see any immediate/apparent solution aside from possibly trying to clean this JSON myself with regex
<eph3meral> but, that seems... well.. problematic at best
<macer1> maybe it is something with openssl -.-
mrsolo has quit [Quit: This computer has gone to sleep]
awarner has quit [Remote host closed the connection]
Bosma has joined #ruby
verbad has joined #ruby
cj3kim has quit [Client Quit]
<_br_> eph3meral: Hm, maybe its a serialization issue? I'm not sure how you are transporting it from ruby to python. Why don't you shoot with msgpack at it?
<_br_> Sorry, not sure where to ask this otherwise. In the HTTP protocol, am I correct in assuming that accept header tells the server what the client wants to hear (e.g. application/json) and content-type tells the server what the client sends the server (e.g. application/xml) ? (building a rest api at the moment)
mrsolo has joined #ruby
jarek_ has joined #ruby
ephemerian has joined #ruby
jarek_ has quit [Changing host]
jarek_ has joined #ruby
jarek_ has quit [Client Quit]
t0mmyvyo has joined #ruby
jarred has quit [Ping timeout: 246 seconds]
qwerxy has quit [Ping timeout: 252 seconds]
<GlenK> Can someone help me out here? http://www.fpaste.org/ej7o/ I'm kinda lost. so far I added the "pair[0] + " " + pair[1] part.
<GlenK> I was thinking that would get passed to yield, but I just get an empty array being spit out.
bier has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
<Spooner> GlenK You can just do array.map {|a| a.join " " } but maybe that isn't your intention
paolooo has joined #ruby
<GlenK> Spooner: yeah, it's an exercise from this rubymonk website. I'm not supposed to use map.
<eph3meral> _br_, der, python? :)
<Spooner> Oh I see. You aren't actually modifying result at all.
<eph3meral> hmm, what's message pack?
bricker88 has joined #ruby
<eph3meral> basically the issue is that this JSON has a bunch of "blank commas"
<Spooner> You probably want result << yield(pair)
<GlenK> Spooner: ha. now I real real stupid
<eph3meral> arrays like [,,,"hello",,0,,,,,,102010010,,]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<eph3meral> which, are well formed, but still, there's nested arrays, it's kind of a mess
<eph3meral> *otherwise* it basically seems to be well formed JSON
<GlenK> Spooner: thanks.
<eph3meral> er, except perhaps with the exception of non quoted numbers, though I'm not sure if *everything* has to be quoted in JSON does it?
ProLoser|Work has joined #ruby
sgronblom has quit [Ping timeout: 252 seconds]
<Spooner> eph3meral: That doesn't look like proper json to me.
test432432425 has joined #ruby
<Spooner> [nil, ""].to_json => "[null,\"\"]"
<Spooner> So what those missing values are supposed to be is anyone's gues.
<eph3meral> Spooner, er, well it's basically not, but... at least it is in fact well formed
mathie has quit [Quit: Sleeping...]
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
<eph3meral> just wondering if there's a way to parse this that's already established
<eph3meral> or if I'm gonna have to roll my own
no-1 has joined #ruby
<Spooner> You can't automatically parse soething that doesn't follow the actual spec :)
wilmoore has joined #ruby
bricker88 has quit [Client Quit]
ttilley_off is now known as ttilley
<eph3meral> sure, but seems like other folks may have potentially figured this out
<Spooner> And no, it isn't well formed.
nir has quit [Ping timeout: 255 seconds]
test432432425 has quit [Changing host]
test432432425 has joined #ruby
<eph3meral> i've seen this is in more than one place
bricker88 has joined #ruby
tcopp has joined #ruby
<eph3meral> it's regular
<eph3meral> it's computer parsable
tommyvyo has quit [Quit: Computer has gone to sleep.]
<Spooner> You _can_ parse it, but that doesn't mean that it is valid json.
<eph3meral> that's what I mean
<eph3meral> i didn't say "well formed json"
<eph3meral> i just said well formed, you're nit picking
<Spooner> Everything is well-formed according to a schema which isn't a standard :D
oposomme has quit [Ping timeout: 240 seconds]
test432432425 has quit [Client Quit]
apok has quit [Remote host closed the connection]
apok has joined #ruby
wilmoore has quit [Remote host closed the connection]
<Spooner> But to answer your original query, if you have badly formed json, your only recourse would be to manually convert it to something which is well formed or parse it yourself.
jarek has joined #ruby
wilmoore has joined #ruby
denysonique has joined #ruby
kvirani has joined #ruby
whitedawg has quit [Quit: Leaving.]
br4ndon has joined #ruby
tvw has quit [Remote host closed the connection]
no-1 has quit [Quit: Leaving]
carloslopes has joined #ruby
oposomme has joined #ruby
<Spooner> I'd guess s.gsub("[,", "[null,").gsub(",,", ",null,") is a simple way to "fix" it, assuming those characters aren't found in strings.
bullicon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
rutkla has joined #ruby
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
guillaum has joined #ruby
guillaum has quit [Client Quit]
workmad3 has quit [Ping timeout: 252 seconds]
BlackShadow has joined #ruby
<Spooner> I love the fact that sensible devs have to spend their lives struggling to compensate for the insensible devs who find it too much of a struggle to follow simple schema :)
<eph3meral> that's the problem
<eph3meral> assuming ,, is never found in a string
oposomme has quit [Ping timeout: 265 seconds]
carloslopes has quit [Quit: Leaving.]
nyuszika7h has joined #ruby
carloslopes has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
zemanel has joined #ruby
<heftig> Spooner: even then those gsubs won't work
<heftig> this seems to be better: "[,,,,,]".gsub(/([\[,])(?=[,\]])/, "\\1null")
zipace has joined #ruby
Morkel has joined #ruby
jarred has joined #ruby
nir has joined #ruby
wallerdev has quit [Quit: wallerdev]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<Spooner> Oh wow, yeah, mine really doesn't work :D
linoj_ has joined #ruby
wallerdev has joined #ruby
<Spooner> I probably should have tested it :$
<eph3meral> but again, checking that it's not inside a string...
headius has joined #ruby
<eph3meral> that's just, that's basically impossible without writing a parser
bluOxigen has joined #ruby
Wizek has quit [Ping timeout: 246 seconds]
pdtpatrick has quit [Quit: pdtpatrick]
awarner has joined #ruby
<Spooner> It isn't text that is likely to be in a string, so you might be alright.
linoj has quit [Read error: Operation timed out]
linoj_ is now known as linoj
br4ndon has quit [Ping timeout: 252 seconds]
jarred has quit [Ping timeout: 246 seconds]
otters has quit [Ping timeout: 255 seconds]
blazes816 has quit [Quit: Leaving]
shashin has quit [Quit: shashin]
Filuren has joined #ruby
_JamieD_ has joined #ruby
Filuren has quit [Read error: Connection reset by peer]
cbuxton has quit [Ping timeout: 246 seconds]
cbuxton has joined #ruby
paolooo has quit [Quit: Page closed]
tommyvyo has joined #ruby
paolooo has joined #ruby
clocKwize has quit [Quit: clocKwize]
Eldariof-ru has joined #ruby
preller has joined #ruby
Filuren has joined #ruby
Stalkr_ has quit [Ping timeout: 248 seconds]
<eph3meral> yeh, I basically agree
<eph3meral> if it is in a string, someone is a douchebag :P
tiripamwe has joined #ruby
<eph3meral> hmm, wow
paolooo has quit [Quit: Page closed]
<eph3meral> getting an error apparently JSON.parse can't deal with UTF-8
<joesavage> Quick question, anyone know how to turn line numbers on when using Pygments.rb?
<eph3meral> or rather, the string I have is ASCII-8bit
powee has joined #ruby
chrisbolton has joined #ruby
arturaz has quit [Ping timeout: 260 seconds]
stephenjudkins has joined #ruby
powee has quit [Client Quit]
paolooo has joined #ruby
br4ndon has joined #ruby
Markvilla has quit [Quit: Markvilla]
nobitanobi has joined #ruby
mascool has joined #ruby
jbw has quit [Ping timeout: 264 seconds]
MarGarina has quit [Ping timeout: 252 seconds]
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
Hawklord has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
verto is now known as verto|off
redpanda has joined #ruby
Speed has joined #ruby
lkba has quit [Ping timeout: 264 seconds]
stefanp- has joined #ruby
cbuxton1 has joined #ruby
tcopp has left #ruby [#ruby]
stefanp_ has quit [Ping timeout: 265 seconds]
bluOxigen has quit [Ping timeout: 260 seconds]
cbuxton has quit [Ping timeout: 240 seconds]
bluOxigen has joined #ruby
havenn has quit [Remote host closed the connection]
chrisja has joined #ruby
jgrevich has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
stefanp has quit [Ping timeout: 265 seconds]
elhu has joined #ruby
voodoofish430 has joined #ruby
jonathancutrell has joined #ruby
<jonathancutrell> Hey folks.
Hawklord has joined #ruby
<jonathancutrell> What is commonly accepted as the right way to parse and filter a dom (scraping) in ruby?
<jonathancutrell> Hpricot I assume.
mrsolo has joined #ruby
SCommette has quit [Quit: SCommette]
<shevy> ack
<shevy> XML!!!
otters has joined #ruby
<banisterfiend> shevy: wanna be friends?
elhu has quit [Client Quit]
<shevy> does that mean I have to look at pictures you link :(
jbw has joined #ruby
sidusnare has joined #ruby
ringotwo has quit [Read error: Connection reset by peer]
ringotwo has joined #ruby
<banisterfiend> shevy: Yeah.
<sidusnare> anyone have sugestions for s good quick Ruby 101 book for someone who already knows several programing languages?
<banisterfiend> sidusnare: 'the ruby programming language'
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
jbohn has joined #ruby
<shevy> that scares me too much
Eiam has joined #ruby
<sidusnare> banisterfiend: the oriley book ?
jjbohn|thedarkne has joined #ruby
jjbohn has quit [Read error: Connection reset by peer]
<banisterfiend> sidusnare: Yeah.
adeponte has quit [Remote host closed the connection]
<banisterfiend> sidusnare: it's great
chriskk has left #ruby [#ruby]
adeponte has joined #ruby
leembarnes has joined #ruby
Araxia has quit [Read error: No route to host]
kpshek has joined #ruby
Lubinski has joined #ruby
redpanda has quit [Remote host closed the connection]
SCommette has joined #ruby
<banisterfiend> sidusnare: what languages do u know already?
pdtpatrick has joined #ruby
mparodi has quit [Quit: Leaving]
<banisterfiend> sidusnare: maybe we can give u a quick scoot through of some of what ruby brings to the table
<leembarnes> @find eas
centipedefarmer has quit [Quit: This computer has gone to sleep]
paolooo has quit [Quit: Page closed]
sailias has joined #ruby
johnlcox has quit [Read error: Connection reset by peer]
<sidusnare> banisterfiend: bash php python perl c c++ (in order of proficiency)
jbohn has quit [Ping timeout: 264 seconds]
johnlcox has joined #ruby
<banisterfiend> sidusnare: weird :P
redpanda has joined #ruby
redpanda has quit [Remote host closed the connection]
<banisterfiend> maybe not if you're a sysadmin actually
<banisterfiend> that looks about right for a sysadmin
adeponte has quit [Ping timeout: 248 seconds]
<sidusnare> yep
RubyPanther has quit [Ping timeout: 240 seconds]
phinfonet has joined #ruby
<Hanmac> sidusnare if you can python you will learn ruby very easy ... ruby is like pythons little twin-sister
<banisterfiend> Hanmac: ruby is python's hotter, dirtier younger sister, you can do things to her that python would call the cops on you for trying
<Hanmac> or like banister said :P
theRoUS has quit [Ping timeout: 264 seconds]
chichou has joined #ruby
chriskk has joined #ruby
redpanda has joined #ruby
chichou_ has quit [Ping timeout: 260 seconds]
havenn has joined #ruby
erratic has joined #ruby
darren_ has quit [Remote host closed the connection]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
chichou has quit [Remote host closed the connection]
<BlackShadow> Hello ppl! I'm learning python , but when i get to wxPython and trying to create some UI it's very complicated and seems that i never get used to doing it this way, what frameworks in ruby exist so i can compare?
<banisterfiend> BlackShadow: look into 'shoes' maybe
<Hanmac> there exist an wxRuby too but imo its outdated
<Spooner> Now if there is something Ruby fails at, it is having a decent GUI binding.
Asher has joined #ruby
Naeblis has joined #ruby
<banisterfiend> Asher: hey boy, my bro is in chicago
Naeblis has left #ruby ["Leaving"]
<banisterfiend> Asher: u should travel out and hang with him, take him for a night on the town and cruise around those obscene american fast food joints eating artificial sugar froth
fermion_ has joined #ruby
<banisterfiend> together
havenn has quit [Remote host closed the connection]
<davidcelis> mmmmm, artificial sugar froth
ryh has quit [Remote host closed the connection]
<sidusnare> I didn't like wxPython, it was simple enough, but wasnt integrated well, didnt trap exceptions
chimkan_ has quit [Quit: chimkan_]
<BlackShadow> Shoes look much easier, for me.
<Hanmac> BlackShadow ... i am building an wxRuby rebuild that should work with newest wx ... but it is not finish yet ...
xaq_ has joined #ruby
sgronblom has joined #ruby
ttilley is now known as ttilley_off
Squarepy_ has joined #ruby
xaq has quit [Ping timeout: 260 seconds]
<BlackShadow> where i can find descriptions for built-in methods and so on, like on docs python i mean, can't find this on a ruby website
Spooner has quit [Ping timeout: 240 seconds]
<matti> There is a Ruby Documentation web site.
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
xaq_ has quit [Remote host closed the connection]
joesavage has quit [Ping timeout: 245 seconds]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
Guest56159 is now known as mksm
<eph3meral> how can I *ensure* that the ENTIRETY of a string is encoded a certain way?
mksm has quit [Changing host]
mksm has joined #ruby
xaq has joined #ruby
<eph3meral> i keep getting these weird errors when using JSON.parse on a string that I thought was encoded UTF-8
<eph3meral> but apparently has some ASCII-8bit encoded characters in it?
<eph3meral> JSON::ParserError: Caught Encoding::CompatibilityError at ',null,null,null,"4bd': incompatible character encodings: UTF-8 and ASCII-8BIT
<eph3meral> when I puts .encoding on the string I'm trying to parse, it says UTF-8
BlackShadow has quit [Remote host closed the connection]
<fowl> string#force_encoding
cakehero has quit [Quit: Leaving...]
adeponte has joined #ruby
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<eph3meral> fowl, i tried that, i'm still getting errors
squarepy has quit [Ping timeout: 260 seconds]
sgronblom has quit [Ping timeout: 264 seconds]
fbernier has quit [Ping timeout: 260 seconds]
<eph3meral> i ran string.force_encoding('UTF-8') and then JSON.parse(string)
ryh has joined #ruby
<eph3meral> i still get that above error about incompatible encodings
<fowl> i dunno :x
xaq has quit [Remote host closed the connection]
RubyPanther has joined #ruby
xaq has joined #ruby
johnlcox_ has joined #ruby
BlackShadow has joined #ruby
linoj has quit [Remote host closed the connection]
_bart has joined #ruby
linoj has joined #ruby
jeff_sebring has quit [Quit: Leaving]
kjellski has joined #ruby
redpanda has quit [Remote host closed the connection]
xmesg has left #ruby ["Leaving"]
redpanda has joined #ruby
ttilley_off is now known as ttilley
conor_ireland has joined #ruby
mutexkid has quit [Ping timeout: 240 seconds]
Criztian has quit []
dankest has joined #ruby
cakehero has joined #ruby
johnlcox has quit [Ping timeout: 246 seconds]
jarek has quit [Quit: jarek]
manizzle has quit [Read error: No route to host]
beneggett has joined #ruby
xaq has quit [Remote host closed the connection]
xaq has joined #ruby
Markvilla has joined #ruby
mascool has quit [Quit: leaving]
johnlcox_ has quit [Remote host closed the connection]
mutexkid has joined #ruby
johnlcox has joined #ruby
adeponte has quit [Remote host closed the connection]
xaq has quit [Read error: Connection reset by peer]
havenn has joined #ruby
SeySayux has quit [Quit: SeySayux]
fridim_ has joined #ruby
chussenot has joined #ruby
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby
fbernier has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
TheFuzzball has joined #ruby
xaq has joined #ruby
TheFuzzball has quit [Max SendQ exceeded]
mehlah has joined #ruby
TheFuzzball has joined #ruby
lorandi has joined #ruby
macer1 has quit [Read error: Operation timed out]
Filuren is now known as Stalkr_
zipace has quit [Read error: Connection reset by peer]
<eph3meral> fowl, so force_encoding actually *changes* the entire string, properly?
<eph3meral> like, it converts? or does it simply "set" the encoding name?
fbernier has quit [Ping timeout: 264 seconds]
<fowl> i dunno but when i had that problem force_encoding got me past it
bluOxigen has quit [Ping timeout: 240 seconds]
robert_ has quit [Ping timeout: 264 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
bluOxigen has joined #ruby
nacengineer has quit [Ping timeout: 252 seconds]
Squarepy_ is now known as squarepy
squarepy is now known as Squarepy
Wizek has joined #ruby
blazes816 has joined #ruby
ph^ has joined #ruby
nadirvardar has joined #ruby
adeponte has joined #ruby
robert_ has joined #ruby
robert_ has quit [Changing host]
robert_ has joined #ruby
bier has quit [Ping timeout: 252 seconds]
chicochicote has joined #ruby
Lubinski has quit [Ping timeout: 255 seconds]
Lubinski has joined #ruby
leembarnes has left #ruby [#ruby]
chussenot has quit [Ping timeout: 260 seconds]
burgestrand has joined #ruby
BlackShadow has quit [Remote host closed the connection]
chichou has joined #ruby
kylesnav has joined #ruby
<kylesnav> Switching from Python to Ruby for rails, any suggestions/tips
bluenemo_ has joined #ruby
<matti> kylesnav: #rubyonrails might help more :)
ryanf has joined #ruby
<havenn> kylesnav: Test first. Use blocks.
wangr has quit [Read error: Connection reset by peer]
dotnull has joined #ruby
wangr has joined #ruby
kirun has joined #ruby
RichGuk has quit [Ping timeout: 265 seconds]
bluenemo has quit [Ping timeout: 260 seconds]
havenn has quit [Remote host closed the connection]
hynkle has quit [Quit: Computer has gone to sleep.]
chussenot has joined #ruby
mosheee has joined #ruby
ttilley is now known as ttilley_off
mosheee is now known as Guest77101
havenn has joined #ruby
RichGuk has joined #ruby
havenn has quit [Remote host closed the connection]
cascalheira has joined #ruby
reuf has joined #ruby
anderse has joined #ruby
theRoUS has quit [Quit: Leaving]
ananthakumaran has quit [Quit: Leaving.]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
kylesnav has quit [Quit: Leaving.]
tndrbt has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
xaq has quit [Remote host closed the connection]
xaq has joined #ruby
verbad has quit []
<shevy> dumdedum
<chicochicote> getting a OpenSSL::Cipher::CipherError when using capistrano 2.12 with ruby 1.9.3, anyone knows what could that be?
lunitikcalm has quit [Remote host closed the connection]
Guest77101 has quit [Remote host closed the connection]
chimkan_ has joined #ruby
theRoUS has quit [Remote host closed the connection]
Stalkr_ has quit [Read error: Connection reset by peer]
mosheeee has joined #ruby
mxweas has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
minijupe has joined #ruby
<sernin> chicochicote: Uh, the server isn't offering the cipher that the client expects? Pretty vague.
xaq has quit [Read error: Connection reset by peer]
xaq has joined #ruby
fratello has joined #ruby
conor_ireland has quit [Quit: conor_ireland]
<chicochicote> sernin: sorry, the actual error msg is 'data not multiple of block length'
thetabyte has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
<fratello> i have a problem
<thetabyte> Hello all. I'm looking for a method to determine whether I am in the development environment while developing a gem.
tcopp has joined #ruby
<thetabyte> I know that the gemspec can add development dependencies, so there must be some way of determining whether you are in the dev environment
<sernin> chicochicote: You'd need to post some code/examples, and I highly suspect that your problem is server configuration, not ruby
<thetabyte> I need a line of code inside my gem to run conditionally if you are inside the dev environment
<fratello> can anyone help-me?
<blazes816> thetabyte: try #rubyonrails
<thetabyte> It's not Rails
<thetabyte> It is an independent gem
<blazes816> oh, sorry, misread
havenn has joined #ruby
tester has joined #ruby
tester has left #ruby [#ruby]
<thetabyte> No problem. I have a gem that I'm creating. And I want to run a line of code *only* if it's in the gem's development environment, *not* after I've built it
<blazes816> I'd just set a constant. DEV=true, then check that it exists and is true
<fowl> fratello: what exactly are you doing there
cascalheira has quit [Remote host closed the connection]
<sernin> thetabyte: set an environment variable, read it with the ENV hash
<Synthead> { 'a' => 1, 'b' => 2 }.select { |k, v| v == 2 }
<Synthead> => [["b", 2]]
<thetabyte> But where would I set that environment variable?
<blazes816> unless you have an evn handler set up already
<Synthead> is this the intended output? I'm looking for a hash
<blazes816> thetabyte: in bash
<sernin> thetabyte: From the script, if you like, or even from the command line.
<fowl> thetabyte: you run it like DEV=true ruby script.rb
<otters> Synthead: yeah, you have to Hash[] again
<thetabyte> ah, ok. Thanks for the help!
<otters> unfortunately
<otters> Hash[{'a' => 1, 'b' => 2}.select{|k,v|v==2}]
LBRapid has quit [Quit: Farewell.]
dhruvasagar has joined #ruby
<sernin> thetabyte: from the script you can manipulate things using the ENV hash
<Synthead> otters: ooh, interesting
<fratello> fowl: i try to install one module using gem install
<otters> Synthead: Hash[] is a smart constructor
<fratello> fowl: sorry, my english is poor
tcopp has left #ruby [#ruby]
tcopp has joined #ruby
<fowl> fratello: im not sure whats going on there try installing ffi through gems instead of bundler
<otters> Synthead: you could redefine Hash#select as def select *a, &blk; Hash[self.to_a.select(*a, &blk)]; end
<otters> because Hash#select is just to_a.select anyways
sendoushi has quit [Read error: Connection reset by peer]
Araxia has joined #ruby
<fratello> fowl: when i try to install ffi using gem install, i get the same error
jimeh has quit [Ping timeout: 240 seconds]
verto|off is now known as verto
wangr_ has joined #ruby
<burgestrand> fratello: what operating system?
tewecske has joined #ruby
wallerdev has quit [Quit: wallerdev]
<fratello> burgestrand: CentOS release 5.8 (Final)
zeen has quit [Ping timeout: 252 seconds]
<banisterfiend> otters: not on 1.9
wangr has quit [Ping timeout: 246 seconds]
chicochicote has quit [Quit: Page closed]
<burgestrand> fratello: try install libffi with yum: yum install libffi-devel
<burgestrand> fratello: then try to install again: gem install ffi
<otters> banisterfiend: really? I'm using 1.9 and that worked
<banisterfiend> otters: on 1.9 Hash#select returns a Hash
<fratello> burgestrand: ok, i'll try
<shevy> my cuddly cuddly otter
<otters> banisterfiend: you jest!
mpereira has quit [Ping timeout: 255 seconds]
<banisterfiend> otters: no
<otters> Oh wow, you don't jest after all
<otters> nowei
<otters> why did it return an array in previous ruby versions?
fantazo has joined #ruby
<fratello> burgestrand: working... thanks a lot
xorigin has joined #ruby
<burgestrand> fratello: :)
dekroning has quit [Ping timeout: 240 seconds]
<banisterfiend> otters: for consistency with map, etc
jimeh has joined #ruby
tcopp has left #ruby [#ruby]
<banisterfiend> burgestrand: let's get high
<burgestrand> banisterfiend: vampire blood, go!
<banisterfiend> lemme get my bong
brianstorti has joined #ruby
chichou has quit [Remote host closed the connection]
manizzle has joined #ruby
chichou has joined #ruby
verto is now known as verto|off
zeromodulus has joined #ruby
mpereira has joined #ruby
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
fearoffish has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
savage- has quit [Remote host closed the connection]
chichou has quit [Ping timeout: 264 seconds]
verto|off is now known as verto
blacktulip has quit [Remote host closed the connection]
blacktulip has joined #ruby
berserkr has quit [Quit: Leaving.]
Goles has joined #ruby
wallerdev has joined #ruby
briansto_ has joined #ruby
savage- has joined #ruby
kidoz has joined #ruby
brianstorti has quit [Ping timeout: 252 seconds]
ukwiz has quit [Quit: Leaving]
conor_ireland has joined #ruby
rd34 has joined #ruby
brianstorti has joined #ruby
[eko] has joined #ruby
rook_flood has joined #ruby
havenn has quit [Remote host closed the connection]
briansto_ has quit [Ping timeout: 240 seconds]
havenn has joined #ruby
Goles has quit [Client Quit]
chussenot has quit [Read error: Connection reset by peer]
strnx has quit [Excess Flood]
hynkle has joined #ruby
scrr has quit [Read error: Connection reset by peer]
lkba has joined #ruby
jimeh has quit [Ping timeout: 240 seconds]
playmuc has joined #ruby
Stalkr_ has joined #ruby
Araxia has quit [Read error: Connection reset by peer]
nacengineer has joined #ruby
azulsoljah_w has joined #ruby
<Synthead> Is there such thing as Pathname.mountpoint? in ruby 1.8?
<Hanmac> why do you want to use 1.8?
strnx has joined #ruby
<Synthead> Hanmac: working on other peoples' code
Araxia has joined #ruby
redpanda has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 252 seconds]
Gab0 has joined #ruby
<Hanmac> Synthead ... yeah it should be there in 1.8 too ... but i dont recoment the usage of 1.8
ph^ has quit [Remote host closed the connection]
<azulsoljah_w> talk test
adeponte has quit [Remote host closed the connection]
<blazes816> azulsoljah_w: not working
adeponte has joined #ruby
<azulsoljah_w> blazes816: damnit
BrokenCog has joined #ruby
stephenjudkins has joined #ruby
<blazes816> azulsoljah_w: ah, there you go. you fixed it!
<azulsoljah_w> blazes816: genious
baphled has joined #ruby
phinfonet has quit [Quit: phinfonet]
abdulkarim has joined #ruby
BrokenCog has quit [Client Quit]
romain1189 has joined #ruby
Z_Mass has quit [Ping timeout: 248 seconds]
greenysan has joined #ruby
tndrbt has quit [Quit: tndrbt]
manizzle has quit [Remote host closed the connection]
pdtpatrick has quit [Quit: pdtpatrick]
jorge has joined #ruby
<kapowaz> anyone here upgraded to Xcode 4.4 ? I seem to have lost my gcc…
<banisterfiend> kapowaz: install command line tools
vlad_starkov has quit [Remote host closed the connection]
<kapowaz> oh, it needs to be reinstalled?
<kapowaz> bleh
Squarepy has quit [Quit: Leaving]
i0n has quit [Quit: Lost terminal]
rook_flood has quit [Quit: bye~~]
<y2k> hello everyone :)
t0mmyvyo has joined #ruby
<burgestrand> kapowaz: you can install gcc-4.2 from homebrew/dupes if you need a non-llvm gcc
redpanda has joined #ruby
<kapowaz> burgestrand: I might well do — gem install thin -v 1.3.1 is failing
<kapowaz> I've got ruby 1.9.2-p290 as my default
rakm has quit [Quit: Computer has gone to sleep.]
<kapowaz> I can't remember if it was recommended to go to 1.9.3 as a default now
<burgestrand> I’ve been using 1.9.3 as default for about a year, been doing it at work for ~10 months.
seoaqua has quit [Quit: Leaving]
<burgestrand> … I think. It feels very long.
<burgestrand> Naw, not that long.
<burgestrand> Since january maybe.
<kapowaz> well, maybe that was a poor way of putting it… :)
kidoz has quit [Quit: Ухожу я от вас]
chimkan_ has quit [Quit: chimkan_]
<kapowaz> I mean, recommended in the sense that it eliminates issues building native extensions with LLVM?
pdtpatrick has joined #ruby
tiripamwe has quit [Ping timeout: 250 seconds]
vlad_starkov has joined #ruby
<burgestrand> What I’ve heard using anything *but* 1.9.3 will cause issues with LLVM. Funnily enough I’ve never had any issues with either one. :/
abra has joined #ruby
jasonLaster has joined #ruby
manizzle has joined #ruby
<jasonLaster> I'm having a hard time understanding the documentation for "finish"
verto is now known as verto|off
brianstorti has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<burgestrand> What finish?
<burgestrand> jasonLaster: ^
dankest has quit [Quit: Leaving...]
pozic has joined #ruby
<jasonLaster> burgestrand: finish in rdebug
<jasonLaster> or actually, the debugger gem as well.
answer_42 has quit [Remote host closed the connection]
pdtpatrick has quit [Ping timeout: 246 seconds]
<pozic> How do I puts helloworld without the newline?
anderse has quit [Quit: anderse]
<jasonLaster> pozic: print
s0ber has quit [Read error: Connection reset by peer]
<pozic> jasonLaster: thanks, you have helped the world get rid from a few lines of Perl.
<jasonLaster> just doing my job.
phinfonet has joined #ruby
s0ber has joined #ruby
workmad3 has joined #ruby
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
ttilley_off is now known as ttilley
xaq has quit [Remote host closed the connection]
xaq has joined #ruby
Dreamer3 has joined #ruby
mehlah has quit [Quit: Linkinus - http://linkinus.com]
<lectrick> I want to write a "which_is_faster" method, which takes 2 blocks. Is that feasible? :)
<workmad3> lectrick: you can't take 2 blocks
<workmad3> lectrick: however, you *can* take two proc objects or lambda objects
<workmad3> lectrick: which can look reasonable with 1.9 stabby lambda syntax :)
gmci has joined #ruby
<workmad3> lectrick: e.g. 'which_is_faster ->{this}, ->{or_this}'
<lectrick> ooooh.
<fowl> or proc{}
<workmad3> fowl: or even Proc.new{}, or lambda{} :)
<workmad3> several different syntaxes... but my personal opinion (which may be because I've had to do far too much coffeescript recently) is for the stabby lambda when you're taking a couple of methods
<lectrick> def hi_i_take_2_blocks(block1,block2); block1.call; block2.call; end; hi_i_take_2_blocks(lambda{puts 'block1 here'},lambda{puts 'block2 here'})
<lectrick> I guess I should rename that hi_i_take_2_lambdas eh
yugui_zzz is now known as yugui
<workmad3> lectrick: 'hi_i_take_2_callables'
<workmad3> lectrick: because, in fairness, you don't care if it's a proc, a lambda, a method object or what... just that it has a call method, making it a callable ;)
<lectrick> what if I took a block which contained 2 blocks
<otters> the word "lambda" is replaced by "->"?
<lectrick> /lol
<otters> Is that it?
ph^ has joined #ruby
<workmad3> otters: not quite
tomb_ has quit [Quit: Computer has gone to sleep.]
<lectrick> that's mostly it yes. But also, the args are passed differently
<otters> how's that
<workmad3> otters: lambda{|foo,bar| stuff} == ->(foo,bar){stuff}
<lectrick> so lambda{|arg1, arg2| ...} becomes ->(arg1,arg2) { ... }
<banisterfiend> 1.9 syntax is beautiful
<banisterfiend> i raelly like ->
<otters> oh, that is nice
<otters> I actually would have switched the args and the ->
<otters> but that might've made parsing ambiguous
dankest has joined #ruby
<workmad3> banisterfiend: it's annoyingly close to CS without quite being the same, same as the new hash syntax with JSON :)
<workmad3> otters: yeah, I'd have preferred (arg1,arg2)->{stuff} too :)
stopbit has quit [Read error: Connection reset by peer]
urbann has joined #ruby
<otters> or (\(arg1, arg2) -> stuff)
<otters> /troll
<workmad3> otters: but also yeah... could have caused problems if you're using a greedy tokeniser in the VM
burgestrand has quit [Quit: Leaving.]
<banisterfiend> workmad3: yeah i'd be happy with either (x)->{} or ->(x){}
enroxorz has quit [Quit: Leaving]
<otters> Well, I don't know, I try to raise my tokenisers to be patient
stopbit has joined #ruby
<workmad3> banisterfiend: (x)-> is CS, ->(x) is ruby... and I'm switching between them a lot at the moment, frequently even in the same day
<otters> CS?
<banisterfiend> workmad3: interesting what CS app are you working on?
<workmad3> banisterfiend: the only thing stopping me going crazy is that I don't tend to use stabby lambdas a lot in ruby :)
<workmad3> otters: coffeescript
<otters> oh
<banisterfiend> oh
<workmad3> banisterfiend: internal product dev...
<banisterfiend> i thought u meant c sharp
<otters> coffeescript feels so weird
<banisterfiend> workmad3: i think c sharp also uses a similar syntax
<otters> heh, CS instead of C# is hardly shorter
<workmad3> banisterfiend: that's c# :)
chrisja has quit [Quit: leaving]
<workmad3> banisterfiend: or cJava :)
<banisterfiend> yeah, but i couldn't think of what else CS stood for
tomb_ has joined #ruby
<minijupe> please help with this segmentation error. https://gist.github.com/3219791
<workmad3> </troll>
<otters> computer science?
<pozic> I think the whole proc lambda {} is a mess in Ruby.
<banisterfiend> i thnk c# uses => though
lupine_85 has quit [Excess Flood]
<workmad3> minijupe: help? with a segfault? wow, you're hopeful
<pozic> Same with the function call syntax foo(12,"dsds") { dasdasd }
<workmad3> otters: how about this 'I learnt CS, not CS on my CS course' :D
<otters> exactly
<otters> I'd like to see a CS course that teaches coffee fucking script
<minijupe> workmad3: was in #heroku, they think it's a ruby issue
tiripamwe has joined #ruby
<otters> pozic: that looks like fairly simple syntax to me
<workmad3> minijupe: they're probably right
redpanda has quit [Remote host closed the connection]
anderse has joined #ruby
xorgnak has joined #ruby
<pozic> otters: sure, because you are already used to it.
<banisterfiend> workmad3: didn't ruby's -> syntax exist before CS's though?
<banisterfiend> so technically it's CS's fault
<pozic> otters: it reads great.
<banisterfiend> though you probably werne't laying blame
<otters> well, I mean
<pozic> otters: but that's it.
<otters> function(arg1, arg2, arg3)
<workmad3> minijupe: however, segfaults are fracking hard to debug
<otters> it's C-like
<pozic> otters: but that's completely different.
<pozic> otters: the { } part is an argument.
<otters> yeah
<pozic> otters: and you cannot have multiple of those, AFAIK.
jimeh has joined #ruby
<pozic> otters: as such, these are artificial restrictions.
<workmad3> minijupe: and that's when you can manage to reproduce them locally...
<pozic> otters: which in turn increase cognitive load.
<otters> blocks?
nir has quit [Quit: Ex-Chat]
<minijupe> workmad3: this came up when I "updated" rvm
<minijupe> I think
<pozic> Smalltalk is at least consistent.
<otters> sure, but you can pass lambdas/procs as arguments too
<pozic> otters: a proc is just a lambda which allows yield?
<otters> having a built-in block syntax just makes it simpler for the functions that require a single block
<otters> which is quite a few
lupine_85 has joined #ruby
<pozic> Seems rather silly to introduce special keywords for that.
anderse has quit [Client Quit]
<workmad3> otters: heh :) exactly what I was going to say
<otters> well, yeah, I don't know why there's proc AND lambda
<fowl> pozic: they also handle 'return' differently
<fowl> otters: its worth looking into..
<workmad3> fowl: and lambda checks argument cardinality
<pozic> fowl: return generates an element in proc?
mneorr has joined #ruby
<fowl> unless you have ->(*) {}
<pozic> fowl: like all co-routine implementations do.
<otters> fowl: I mean, I know the technical reasons, but the philosophy escapes me
<otters> or rather, I know the differences
sidusnare has left #ruby [#ruby]
wilmoore has quit [Remote host closed the connection]
<pozic> I don't think Python has special lambdas.
<workmad3> pozic: no, return in a proc (attempts to) return from the scope the block is defined in, return in a lambda returns just from the block's scope
lunitikcalm has joined #ruby
<pozic> workmad3: uh, what?
Eldariof-ru has quit []
<pozic> I will just read the manual, but that sounds like a mess.
<workmad3> pozic: it's a little bit of cruft, yes
<Mon_Ouie> def foo; proc { return 1 }.call * 2; end # foo returns 1
<Mon_Ouie> def foo; lambda { return 1 }.call * 2; end # foo returns 2
proghat has joined #ruby
<pozic> Ok, they are sort of like continuations.
TorpedoSkyline has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
<Mon_Ouie> They are nothing more than lambda functions
<pozic> Or 'one shot continuations'.
<workmad3> lambda acts more like a normal method
<pozic> Yeah, I get it.
<workmad3> proc acts a bit differently (in as I paraphrase, odd and sometimes annoying ways)
<pozic> I think I'd prefer delimited continuations :)
<urbann> hi all
<Mon_Ouie> Ruby does have continuations and coroutines concepts — see #callcc and Fibers and Enumerator
<urbann> do anybody know the Thor action for overriding a file?
<pozic> Mon_Ouie: also delimited ones?
<Mon_Ouie> I don't know what that is
<TorpedoSkyline> Hey everyone, I'm trying to figure out this problem with Ruby. The goal is to take the arrays created by the Hero object and combine the names of each hero into a full name. I'm not making this stuff up. XD http://pastie.org/4367234
<pozic> Mon_Ouie: google knows, basically a generalization of continatuons.
<pozic> Mon_Ouie: continuations.
akem has quit [Ping timeout: 246 seconds]
<jlogsdon> @TorpedoSkyline @names.join(' ')?
beneggett has quit [Quit: Computer has gone to sleep.]
<banisterfiend> pozic: procs are lambdas with non-local returns
<TorpedoSkyline> jlogsdon, that would be it in def full_name, but what should I be doing in def names?
vlad_starkov has quit [Remote host closed the connection]
<urbann> now I do remove_file foo.rb and then create_file foo.rb but that is an ugly solution
<TorpedoSkyline> jlogsdon to then pass the names to the full_name function?
havenn has joined #ruby
<jlogsdon> why do you need to pass anything to full_name? You have the list of names in @names from the initializer
<jlogsdon> just use it in the full_names method
<pozic> banisterfiend: yes, 'one shot continuations' as they are called in the scheme community.
<jlogsdon> heroes.each { |hero| puts hero.full_name }
andrewhl has quit [Remote host closed the connection]
<jlogsdon> would print each hero's full name on a line
uris has joined #ruby
andrewhl has joined #ruby
<TorpedoSkyline> jlogsdon, I don't need to use .map anywhere?
<blazes816> heroes.map(&:full_name).join(' ')
bluOxigen has quit [Ping timeout: 255 seconds]
<jlogsdon> oh. you want heroes to become an array of full names
deadSnowman has quit [Ping timeout: 248 seconds]
<jlogsdon> rather, names to return an array of names
<TorpedoSkyline> jlogsdon, yes that's what I'm looking for.
<jlogsdon> yeah, what blazes816 said (minus the join at the end, unless you want a really long string)
<blazes816> isn't that what he wants?
grzywacz has joined #ruby
<jlogsdon> just heroes.map(&:full_name) would return an array of the full names
<TorpedoSkyline> Ok, let me give that a shot...
<blazes816> idk why he would, but I though that's what he wanted
<blazes816> maybe I'm just confused
<jlogsdon> blazes816: that would be a long string of all the names, appearing to be one name
<blazes816> yeah, which I though he wanted.
<jlogsdon> maybe join("\n") or join(', '(
<jlogsdon> maybe
xaq_ has joined #ruby
proghat has quit []
<jlogsdon> but he can figure that out ^_^
<blazes816> i miss read it
<TorpedoSkyline> jlogsdon, blazes816, I'm doing this thing called RubyMonk and it's kind of terrible.
conor_ireland has quit [Quit: conor_ireland]
<TorpedoSkyline> They have really abstract problems they want you to figure out that are more confusing then helpful.
<jlogsdon> :|
deadSnowman has joined #ruby
<workmad3> TorpedoSkyline: sounds interesting
<TorpedoSkyline> workmad3 lol why?
pdtpatrick has joined #ruby
bluenemo_ has quit [Remote host closed the connection]
<workmad3> TorpedoSkyline: is it just the 'unsolved problems' things?
<TorpedoSkyline> Anyway, here's the link with the containing problem if any one wants to look. http://rubymonk.com/learning/books/1/chapters/9-more-ruby/lessons/42-functional-programming-in-ruby
<TorpedoSkyline> no, it's more of a full on introduction to Ruby workmad3
<workmad3> TorpedoSkyline: I was meaning the 'really abstract problems' you were referring to :)
andrewhl has quit [Ping timeout: 252 seconds]
<TorpedoSkyline> workmad3, it's the way they try to explain it though… It was really good until they got to lambdas.
<workmad3> TorpedoSkyline: ah, fair enough
krz has joined #ruby
ken_barber has quit [Remote host closed the connection]
xaq has quit [Ping timeout: 264 seconds]
ken_barber has joined #ruby
pdtpatrick has quit [Read error: Connection reset by peer]
<workmad3> TorpedoSkyline: good example problems for blocks and lambdas that fit in with a mostly procedural OO book are quite hard
<TorpedoSkyline> workmad3, they are hard… I've been beating my head against the wall for a couple days on this section.
<workmad3> TorpedoSkyline: especially as lambdas and anonymous functions really come from a different style of coding... really useful, but not something you can (IMO) easily build a foundation for out of pure OO
<Hanmac> :P defined?(-4) #=> "expression"; defined?(- 4) #=> "method"
<TorpedoSkyline> so workmad3, is this something I'll come across a lot in Ruby or is the more of a brain stretch? ;P
<workmad3> Hanmac: awesome :D
<TorpedoSkyline> Because I can do a good bit of Ruby code, but this is… weird.
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
<workmad3> TorpedoSkyline: you'll actually come across blocks a lot in idomatic ruby
<shevy> method { the_block }
pskosinski has joined #ruby
dankest has quit [Quit: Leaving...]
<shevy> lambdas you will see less often, blocks a lot
<TorpedoSkyline> workmad3, Yeah, I use blocks all the time
<workmad3> TorpedoSkyline: you've probably already come across them a lot without realising... .each {|item| do_stuff} is a block
<TorpedoSkyline> Everytime I use do each. ;P
<TorpedoSkyline> Yes
xorigin has quit [Quit: leaving]
<shevy> .each do
jlogsdon has quit [Remote host closed the connection]
<workmad3> TorpedoSkyline: lambdas are basically just a way of wrapping a block in an object so you can store it and use it later
revans has joined #ruby
<urbann> No Thor users here? Is this the right channel to ask questions about Thor ?
* Hanmac wishs that he could make a proc without an binding ...
<Hanmac> urbann i think you should ask in an celtic channel :P
Rajesh_ has joined #ruby
<workmad3> Hanmac: thor isn't celtic
<workmad3> Hanmac: thor is nordic
<workmad3> do people not know their pantheons here? :P
* matti does
macer1_ has joined #ruby
fbernier has joined #ruby
undert has quit [Ping timeout: 248 seconds]
Rajesh_ has quit [Max SendQ exceeded]
* workmad3 hopes he isn't questioned on celtic patheism... he's crap on the celts
<TorpedoSkyline> ok, thanks workmad3. I'll be around with more questions. ;P
<shevy> Thor Wauki is fighting Loki on channel 3 right now!
cakehero has quit [Quit: Computer has gone to sleep.]
* matti looks at shevy and rolls eyes
Rajesh_ has joined #ruby
<macer1_> hmm, if I have a class a, and b,c,d inherits a how can I make b,c,d have method do_blabla
<macer1_> by putting it in a?
<macer1_> I mean
<workmad3> TorpedoSkyline: ok... once you've gotten your head around lambdas in an OO sense, you can blow/expand your mind by reading about the lambda calculus ;)
<macer1_> b,c,d have constanst Id
<urbann> what was the answer on the question?
<macer1_> and a method to read the id
cakehero has joined #ruby
<TorpedoSkyline> workmad3, oi. XD
<TorpedoSkyline> I never took calculus. ;P
<macer1_> *nevermind*
<workmad3> TorpedoSkyline: lambda calculus != the calculus of differentiation and integration
<matti> LOL
Morkel has quit [Quit: Morkel]
jonathanwallace has quit [Remote host closed the connection]
<matti> workmad3: Are you seriously explaining this to him?
* matti lost hope in future of IT
<TorpedoSkyline> Something I should read? =P
anderse has joined #ruby
<workmad3> TorpedoSkyline: there any many different calculuses (calculii?), with calculus being a method of reasoning or calculation
geekbri has quit [Remote host closed the connection]
anderse has quit [Client Quit]
nyuszika7h has joined #ruby
brianstorti has joined #ruby
<workmad3> matti: not everyone knows this sort of maths
<TorpedoSkyline> Wow, ok.
<TorpedoSkyline> This is why people go to college for a computer science degree, matti?
stephenjudkins has joined #ruby
<workmad3> TorpedoSkyline: I wish my uni had done a course on lambda calculus and functional programming while I was there :(
jamiejackson has joined #ruby
<TorpedoSkyline> workmad3, I'm still just trying to figure all this stuff out. I had no clue there was such a thing as lambda calculus.
<workmad3> TorpedoSkyline: if you think you can understand that lambda calculus intro, go for it, it's probably worth a shot :)
<macer1_> if I have a one class(name it A) and some classes inherits from it, how in method that is in A class get an object of class that inherits class A?
<macer1_> x.X
<TorpedoSkyline> I'll give it a shot, I don't know how far I'll get though.
<jamiejackson> just playing with ruby to try to learn the language. i have a pipe-delimited string i want to split into an array, but i also want to strip leading and trailing whitespace from its members....
<jamiejackson> str.split('|').each {|val| val.strip}
headius has quit [Quit: headius]
<jamiejackson> i know that's not right (it does the operation, but it doesn't modify the array's members). what's the trick to modifying the array members?
<workmad3> TorpedoSkyline: if you don't get very far, the important thing to take away is that lambda calculus is a model for computation (there are several models for computation... the one most people are familiar with is the turing machine, which is probably conceptually easier, while the lambda calculus is simpler because it relies on less machinery)
fratello has quit [Quit: Leaving]
<TorpedoSkyline> ok… That makes sense.
thetabyte has quit [Quit: leaving]
<TorpedoSkyline> Yeah, it does. Turing require a huge amount to computing power (from what I've heard)
Rajesh_ has quit [Max SendQ exceeded]
<TorpedoSkyline> *requires
<Hanmac> jamiejackson: str.split('|').map(&:strip)
<workmad3> TorpedoSkyline: 'machinery' in an abstract sense
<workmad3> TorpedoSkyline: we're talking about abstract models here, not physical constructs ;)
<jamiejackson> thanks, Hanmac, i need to read up on map, then.
jonathanwallace has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
<TorpedoSkyline> workmad3, I've only heard of Turing in the sense of a computer that is powerful enough to understand and react to human speech as well as a human.
romain1189 has quit [Quit: romain1189]
<workmad3> TorpedoSkyline: that's the turing test, not the turing machine ;)
<TorpedoSkyline> >.<
* TorpedoSkyline slaps TorpedoSkyline around a bit with a large trout
sevvie has joined #ruby
<workmad3> TorpedoSkyline: turing turns up a lot... he was a pioneer in computing :)
<TorpedoSkyline> Thanks for bearing with me workmad3. I have so much I need to study and learn about, but I'm going to stick to it. ;)
cantonic has joined #ruby
<workmad3> TorpedoSkyline: heh :) it's fun for me to exercise this knowledge at times
i0n has joined #ruby
reuf has quit [Quit: Leaving]
i0n has quit [Changing host]
i0n has joined #ruby
<TorpedoSkyline> lol ;P
Rajesh_ has joined #ruby
<TorpedoSkyline> well thanks anyway! I've got to head out, so I'll talk to you all later.
<workmad3> TorpedoSkyline: if you're not careful, I'll branch off into amateur physics and maths too... you wanted a ramble about affine transformations in linear algebra, right?
<TorpedoSkyline> LOL! XD
<TorpedoSkyline> No, let's hold off on that! =P
<Hanmac> workmad3: @ turing i dont know if this is related but i like this: http://de.wikipedia.org/wiki/Kara_%28Programmierumgebung%29 ...
<workmad3> aww :(
rippa has quit [Ping timeout: 246 seconds]
<TorpedoSkyline> lol heading out guys, talk later. ;P
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<infinitiguy> Hi guys - I'm just learning ruby and looking at some example scripts. What does the @ sign signify? for example in something like:
<infinitiguy> def initialize(credentials)
<infinitiguy> @credentials = credentials
<infinitiguy> end
<macer1_> infinitiguy: global variable
<infinitiguy> neat.
<Hanmac> macer_1 lose exp for wrong answer
dhruvasagar has quit [Ping timeout: 246 seconds]
<barefoot> indeed
<Hanmac> infinitiguy its an instance variable not a global one
<macer1_> global to instance
<macer1_> :S
Criztian has joined #ruby
dhruvasagar has joined #ruby
<Hanmac> no there is nothing global there
<infinitiguy> oh - so the variable is only valid during execution of the class?
<workmad3> Hanmac: quick bit of googling... Kara seems to be programming with finite state machines, which is another model of computation :)
emmanuelux has joined #ruby
<jamiejackson> Hanmac: I don't understand the "&:strip" part of "str.split('|').map(&:strip)". What's that mean, or how do I look up what it means?
<macer1_> there is class Packet and PacketX inherits Packet, how to read from Packet method constant of PacketX?
chichou has joined #ruby
<workmad3> jamiejackson: .map(&:strip) == .map {|i| i.strip}
jstew has quit [Quit: leaving]
verbad has joined #ruby
<workmad3> macer1_: with great difficulty... constants are looked up with lexical scope
<Hanmac> workmad3 it has a turing version too ...
blacktulip has quit [Remote host closed the connection]
<workmad3> Hanmac: cool :)
<macer1_> welll what I can use other than constants
<macer1_> def self.id
<jamiejackson> workmad3: thanks. does the former syntax have a name?
<macer1_> ?
* Hanmac want to make an finite state machine engine in ruby ...
<workmad3> Hanmac: that's the great thing about models of computation... you're able to transform them into each other ;)
<workmad3> Hanmac: and there are several state machine gems in ruby... AASM, StateMachine...
rakm has joined #ruby
<macer1_> of course I can make a method def with_id; return sthing + id;end and add this to every class that is a Packet
<macer1_> but DRY
<Hanmac> macer1_ you dont need to
<ggreer> let's say I want a templating language with inheritance, but I don't want to use rails (I'm using sinatra right now). what would be a good templating language to try?
<ggreer> haml and erb don't seem to have built-in support for partials or inheritance
<macer1_> Hanmac: what are you proposing?
xorgnak has quit [Ping timeout: 260 seconds]
bbttxu has quit [Quit: bbttxu]
fbernier has quit [Ping timeout: 240 seconds]
<Hanmac> workmad3 do you know the RPGMaker? i thought it would be funny when all the Events are finite state machines ... :P
zemanel has quit [Quit: zemanel]
wmoxam_ has joined #ruby
TrueColors has joined #ruby
Rajesh_ has quit [Max SendQ exceeded]
jorge has quit [Remote host closed the connection]
<macer1_> actually the goal is to make method to get the packet contents + id at the end
<TrueColors> http://pastebin.com/jVAkhmgn is there a reason why my regex thingy isn't doing it's thing?
<macer1_> but when putting method in the parent class I can't access the constant with id
<workmad3> Hanmac: that always sounds fun :)
<TrueColors> basically if $5 had a-z in it, and if $5 == $5.upcase, then call self.send
<TrueColors> without the regex if statement, it works fine.
<TrueColors> So I'm relatively baffuffled.
adeponte has quit [Remote host closed the connection]
<workmad3> Hanmac: of course, you can always transform a system made up of several FSMs into a system made up of one FSM...
<TrueColors> and without the .nil? it errors about undefined method upcase for nilClass
<Hanmac> hm ... but i want that every event can have its own states
banseljaj is now known as imami|afk
baphled has quit [Ping timeout: 264 seconds]
<workmad3> Hanmac: yeah, it's more a point about how these things can be transformed and be equivalent
baphled has joined #ruby
<havenn> TrueColors: Do you have a test you could give us that ought match that regex?
<havenn> TrueColors: test string***
<TrueColors> literally anything
strife25 has quit [Quit: Computer has gone to sleep.]
<TrueColors> such as blehFOO
<TrueColors> anything is allowed within $5, it's just to check to see if it contains letters.
und3f has quit [Quit: Leaving.]
<havenn> TrueColors: http://rubular.com/r/x1dwe6q6Vl
Rajesh_ has joined #ruby
<TrueColors> no not that bit.
<TrueColors> erm
<macer1_> Hanmac: ?
<TrueColors> :JLT!JLT@phpfreaks-d3671c31.karoo.KCOM.COM PRIVMSG #spam :i dunno
<TrueColors> that bit works fine.
locriani has quit [Remote host closed the connection]
<TrueColors> it's the if statement im on about
<workmad3> Hanmac: several small FSMs can be transformed into one large FSM that encompasses all the small ones (basically, take the starting states for all the FSMs, that's state 1, then transition one state machine, that's state2, and so on until you've exhaustively assigned a single state to all the possible combinations of states)
<TrueColors> line 2 of my paste.
xaq_ has quit [Remote host closed the connection]
<workmad3> Hanmac: I'm kinda stuck in an abstract theory mindset at the moment btw :)
cakehero has quit [Quit: Computer has gone to sleep.]
<Hanmac> TrueColors: $5 =~ /^[[:upper:]]+$/
<TrueColors> but wouldn't that return true if the string ONLY contained ?
sailias has quit [Ping timeout: 246 seconds]
<TrueColors> as in the actual ? symbol
ZachBeta has joined #ruby
adeponte has joined #ruby
stkowski has quit [Quit: stkowski]
<Hanmac> it matchs "ABC" but not "Ab" and no "AB1" and no "1AB"
<workmad3> TrueColors: no... it would return true if the string consists only of 1 or more uppercase letters
carlyle has quit [Remote host closed the connection]
<workmad3> (or, more accurately, it'll give you the position of the first match, which will be truthy)
johnlcox_ has joined #ruby
beneggett has joined #ruby
carlyle has joined #ruby
<TrueColors> hmm...
<Hanmac> want someone ask me whats the difference between [A-Z] and [[:upper:]] ?
<TrueColors> that'll be why my $4 used between that if and the end, isn't doing it's thing.
<workmad3> Hanmac: wouldn't surprise me it [[:upper]] is locale aware
<jamiejackson> ".map(&:strip)" can you point me to the documentation for this syntax? i'm not how/if i would chain methods, as in .map { |i| i.strip.reverse }
<workmad3> Hanmac: otherwise, don't know... expressivity?
<Hanmac> yeah it can match Æ too
hndsmrob has joined #ruby
<TrueColors> is it possible to use the $things that are outside the if... a way to stop the if statement by returning a list of matches
<TrueColors> other than creating variables.
<havenn> TrueColors: ('blehFOO' =~ /^[[:upper:]]+$/).nil? #=> true; ('FOO' =~ /^[[:upper:]]+$/).nil? #=> false
<havenn> TrueColors: Use instance variables not global variables?
<sernin> $ is global IIRC
zemanel has joined #ruby
nricciar_ has joined #ruby
<TrueColors> the $ are the only things i can use when using regex i think.. not sure.
<TrueColors> I'm new to ruby :P
briansto_ has joined #ruby
<fowl> TrueColors: you can also use matches = string.match(/.../)
jasonLaster has quit [Read error: Connection reset by peer]
<fowl> but $1, $2, $' $` etc are cool with me
<fowl> extra points for perlish
<sernin> TrueColors: Look up the MatchData class
cakehero has joined #ruby
jasonLaster has joined #ruby
<workmad3> Hanmac: it matches Æ on your machine... it doesn't on mine (different system locale :) )
<Hanmac> sernin they look global but only valid in the given scope
johnlcox has quit [Ping timeout: 260 seconds]
stat1x has quit [Ping timeout: 260 seconds]
stat1x has joined #ruby
<workmad3> Hanmac: guess that answers whether it's locale aware ;)
<sernin> Hanmac: ahhh, that's a rather important distinction
brianstorti has quit [Ping timeout: 240 seconds]
jorge has joined #ruby
Rajesh_ has quit [Max SendQ exceeded]
aantix_ has joined #ruby
<workmad3> the regex $ vars are a bit magical
mneorr has quit [Quit: Leaving.]
aantix_ has quit [Read error: Connection reset by peer]
xaq has joined #ruby
stkowski has joined #ruby
<TrueColors> http://pastebin.com/3uHiEfnE >< I'm confused what i should do.
<fowl> store your matches before they're destroyed
<TrueColors> ok.
<TrueColors> so create variables.
aantix_ has joined #ruby
<TrueColors> like
<TrueColors> four = $4
<fowl> that's what variables are for yes
<TrueColors> i think.
* Hanmac is going to fall asleep for the rest of the month
<workmad3> Hanmac: ah, I told a lie... I'd managed to check :upper: against æ, not Æ... oops :)
* fowl lights a fire under Hanmac bed
aantix has quit [Ping timeout: 246 seconds]
aantix_ is now known as aantix
jonathancutrell has quit [Quit: jonathancutrell]
<TrueColors> Ok, I made that change, the if statement matches for even "foo" without quotes.
cbuxton1 has quit [Quit: Leaving.]
<TrueColors> Even though it has no uppercase characters.
<TrueColors> it also matches ? on it's own.
<TrueColors> I don't want it to match "?", "foo", "blahFOO" but only match "LALALAL ALA WEGIEOW" and so forth.
bradhe_ has joined #ruby
<TrueColors> including "OJOFAHGOAD # ? [[]];#;'] LALALA"
<TrueColors> without quotes.
<TrueColors> thats why I had that check to see IF IT CONTAINED LETTERS.
<Hanmac> fowl i have a very deep sleep ... when i was a child i fell out of my bunk bed ... it doesnt wake me up
<TrueColors> if so, proceed with the uppercase thing.
linoj_ has joined #ruby
Manhose has joined #ruby
Speed has quit [Remote host closed the connection]
<TrueColors> oh wait
<TrueColors> i know what .nil? does now i think
<fowl> TrueColors: are you writing an irc bot
bradhe has quit [Ping timeout: 250 seconds]
<TrueColors> yeah but not for here dont worry. it works, but someone requested a "caps bot" so was doing it for laughs and giggles.
<lectrick> How do I get the second pair of a Hash instance?
carloslopes has quit [Quit: Leaving.]
<Hanmac> lectrick you cant because you cant trust the order of pairs
<TrueColors> Fixed it, I put it how i originally had it, but just set variables for the $thingys
<lectrick> Hanmac: In Ruby 1.9land you sort of can
linoj has quit [Ping timeout: 260 seconds]
Spooner has joined #ruby
<Hanmac> lectrick yeah, somehow but i still would not trust it
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
linoj_ has quit [Ping timeout: 246 seconds]
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Russell^^ has joined #ruby
rd34 has quit [Quit: rd34]
<Hanmac> lectrick: {:one => 1,:two => 2}.each.tap(&:next).next
johnlcox_ has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
adeponte has quit [Remote host closed the connection]
johnlcox has joined #ruby
TrueColors has quit [Quit: Dear Pringles, now that I am an adult I am no longer able to fit my hand in your tube.]
Lubinski has quit [Quit: Leaving]
jarred has joined #ruby
jarred has quit [Client Quit]
bbttxu has joined #ruby
<workmad3> lectrick: the better phrasing of Hanmac's objection is 'there isn't conceptually a second pair in a hash, because hashes are conceptually unordered... the fact that 1.9 made the order determinate doesn't mean you should rely on this fact'
thone has joined #ruby
<lectrick> Hanmac: We are clever today eh
<workmad3> lectrick: a.k.a. please stop abusing poor, defenceless data structures
<lectrick> workmad3: LOL ok
_JamieD_ has quit [Quit: _JamieD_]
<jamiejackson> is there a more shorthand way to populate a hash from an array than the following? h['a'], h['b'], h['c'] = [1,2,3]
mneorr has joined #ruby
<jamiejackson> maybe a way to factor out the hash's name?
<workmad3> jamiejackson: ary = ['a',1,'b',2,'c',3]; hsh = Hash[ary]
otters has quit [Read error: Connection reset by peer]
<workmad3> jamiejackson: or, if you have the keys and values in separate arrays, Hash[keys.zip(values)]
otters has joined #ruby
oddmunds has quit [Ping timeout: 255 seconds]
<jamiejackson> workmad3: nice, i'll look that up, thanks.
<Spooner> workmad3 : Hash is {} after thhose
thone_ has quit [Ping timeout: 240 seconds]
nfk has quit [Quit: yawn]
<workmad3> Spooner: damn, I thought it could accept a flat array
<heftig> needs to be *ary
jlogsdon has joined #ruby
<Spooner> Ah yeah, that works.
<workmad3> heftig: ah, thanks :)
<workmad3> Spooner: [['a',1],['b',2],['c',3]] also works btw
oddmunds has joined #ruby
<Spooner> I didn't say it didn't :)
<workmad3> Spooner: :)
<Spooner> No, I did asy those, implying both the flat and zipped version didn't work, whereas the zipped does, as you say. My mistake.
mneorr has quit [Ping timeout: 248 seconds]
<heftig> you can either give Hash[] a single array, which must contain key-value pairs; or an even number of arguments, which must be keys and values alternating
<workmad3> heftig: thanks, I'd forgotten you needed to splat a flat array :)
mneorr has joined #ruby
cjlicata has joined #ruby
tommyvyo has joined #ruby
mneorr has quit [Client Quit]
internet_user has quit [Remote host closed the connection]
cjlicata has quit [Remote host closed the connection]
<Spooner> While we are being clever with hashes, I have something that works, but seems painfully inefficient: [{prob: 5}, {prob: 2}].map {|h| [h] * h[:prob] }.flatten.sample (that is, pick a random hash, based on relative probabilities defined in those hashes). Any less horrible way to do it?
internet_user has joined #ruby
br4ndon has joined #ruby
<havenn> TrueColors: I'd check for absence of lowercase: https://gist.github.com/3220931
carlyle has quit [Ping timeout: 264 seconds]
vlad_starkov has joined #ruby
Russell^^ has quit [Quit: Russell^^]
<Spooner> It isn't a performance bottleneck though, so I'm not too worried. Just thought there might be a nicer way to do it than produce a huge array :)
adeponte has joined #ruby
nadirvardar has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<heftig> Spooner: hang on, got an algo for that
sdwrage has joined #ruby
br4ndon has quit [Client Quit]
<Spooner> If it isn't a one-liner, I'll stick with the simple, if slow, method :)
<heftig> it's simple
burgestrand has joined #ruby
<Spooner> Great. Thanks.
<heftig> first, do target = rand(a.inject(0){|m,h| m + h[:prob]})
SQLStud has quit [Quit: Leaving]
<heftig> to get a value between 0 and (sum of all probs - 1)
bglusman has quit [Remote host closed the connection]
wvms has joined #ruby
vlad_starkov has quit [Ping timeout: 248 seconds]
havenn has quit [Remote host closed the connection]
bglusman has joined #ruby
<heftig> then just a.find { |h| target -= h[:prob]; target < 0 }
SQLStud has joined #ruby
<heftig> steps through the array, reducing target by prob until it's < 0
<heftig> then returns the current element
<Spooner> Ah yes, the second part is the bit I didnt' think of. Yeah, that does the job a bit more cleanly.
<heftig> you can cache the sum of all probs somewhere, so you don't need to calculate it all the time
azulsoljah_w has left #ruby [#ruby]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
havenn has joined #ruby
johnlcox has quit [Ping timeout: 246 seconds]
rutkla has quit [Ping timeout: 246 seconds]
phanousit has joined #ruby
johnlcox has joined #ruby
briansto_ has quit [Ping timeout: 260 seconds]
<macer1_> how to implement longs in bindata??
phanousit has quit [Client Quit]
infinitiguy has quit [Quit: Leaving.]
minijupe has quit [Quit: minijupe]
mjbamford has joined #ruby
caveat- has quit [Remote host closed the connection]
balki_ has joined #ruby
alanp_ has joined #ruby
i0n has quit [Read error: Operation timed out]
jonathanwallace has quit [Remote host closed the connection]
ylluminate has joined #ruby
havenn has quit [Remote host closed the connection]
caveat- has joined #ruby
asobrasil has left #ruby [#ruby]
delinquentme has joined #ruby
jjbohn|thedarkne has quit [Quit: Leaving...]
<delinquentme> Hey! I'm wondering about the life of a ruby script ... say I've got a script running a few very simple commands
<delinquentme> and I just want to put in massive delays in between the commands
<delinquentme> like hours.
balki has quit [Ping timeout: 240 seconds]
alanp has quit [Ping timeout: 240 seconds]
<delinquentme> if its deployed on say heroku ... will that script stop for any reason before its finished executing?
<Spooner> delinquentme : Fine in Ruby. Only a problem in Ruby running inside, say, Rails.
pk1001100011 has joined #ruby
ProLoser|Work has left #ruby [#ruby]
<Spooner> Which would time out.
pskosinski has quit [Ping timeout: 246 seconds]
chichou has quit [Remote host closed the connection]
<delinquentme> yeah and thats how I was planning on initiating the script on heroku
revans has quit [Quit: Linkinus - http://linkinus.com]
chichou has joined #ruby
kjellski has quit [Read error: Connection reset by peer]
grzywacz has quit [Remote host closed the connection]
kjellski has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
Banistergalaxy has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
<Spooner> You would presumably have to start a new Ruby process, unless you need to pass data back to the web request.
<burgestrand> You could just start a thread in the background to execute the commands.
Banistergalaxy has joined #ruby
stopbit has quit [Quit: Leaving]
mehlah has joined #ruby
<burgestrand> That way you don’t need to bother about request timeouts, even if rails happens to abort your action somehow.
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
mjbamford has quit [Quit: Leaving...]
chichou has quit [Ping timeout: 264 seconds]
TorpedoSkyline has joined #ruby
jasonLaster has quit [Remote host closed the connection]
joshman_ has quit [Read error: Operation timed out]
jasonLaster has joined #ruby
alphabitcity has joined #ruby
urbann has quit [Ping timeout: 240 seconds]
burgestrand has left #ruby [#ruby]
burgestrand has joined #ruby
burgestrand has quit [Quit: Leaving.]
jasonLaster has quit [Read error: Connection reset by peer]
jasonLas_ has joined #ruby
<TorpedoSkyline> So here's a question. Let's say I have an array that looks like this: ["1","2","3","4"]. Now I want to pair them into a string showing "12" and "34". How would this be done in Ruby?
burgestrand has joined #ruby
<TorpedoSkyline> Because they're not in their own arrays like [["1","2"],["3","4"]], I'm interested to know this.
Wizek has quit [Ping timeout: 246 seconds]
jasonLas_ has quit [Remote host closed the connection]
jasonLaster has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
<delinquentme> burgestrand, you're saying just as in a normal ruby thread process ... spool them off like that?
bglusman has quit [Remote host closed the connection]
<delinquentme> thats not a bad idea
<Spooner> TorpedoSkyline : a\fs29 .each_slice(2).map(&:join)\fs29
<burgestrand> Not process. Thread.
ph^ has quit [Remote host closed the connection]
<Spooner> a .each_slice(2).map(&:join) (oops copy-and-paste)
pk1001100011 has quit [Ping timeout: 260 seconds]
<TorpedoSkyline> Spooner, lol! The last one?
<TorpedoSkyline> Thanks btw. ;)
<Spooner> ["1","2","3","4"].each_slice(2).map(&:join) => ["12", "34"]
<Spooner> If that is what you mean.
<TorpedoSkyline> Ah, sweet! That's it. Thanks.
sepp2k1 has quit [Remote host closed the connection]
<delinquentme> kk burgestrand thanks
ethicalhack3r has joined #ruby
towelrod has joined #ruby
<alphabitcity> anyone know of a good place to read about error handling in libraries? i'm writing a gem and am trying to figure out the best practices .. i notice some people create classes for each error type
mutexkid has quit [Quit: mutexkid]
dankest has joined #ruby
<ckrailo> any of yall seeing IPv6 addresses in rack's request after upgrading to mountain lion? (i see 0:0:0:0:0:0:0:1%0) i need to get it back to IPv4...
fridim_ has quit [Ping timeout: 246 seconds]
bowlowni has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
bowlowni has joined #ruby
AlbireoX`Laptop has joined #ruby
jamiejackson has quit [Ping timeout: 245 seconds]
dv310p3r has quit [Ping timeout: 260 seconds]
chichou has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
yfeldblum has joined #ruby
greenysan has quit [Ping timeout: 240 seconds]
<Spooner> alphabitcity : Not sure, but I'd make sure all my exception classes inherited from MyGemError, so they are easy to catch if the user wants to handle them all together. And don't create new ones for existing problems; only stuff which is specific to your gem.
johnlcox has quit [Remote host closed the connection]
balki_ is now known as balki
<alphabitcity> thanks, good point..i noticed the instagram ruby gem does that (https://github.com/Instagram/instagram-ruby-gem/blob/master/lib/instagram/error.rb)
chichou has quit [Remote host closed the connection]
Vert has quit [Ping timeout: 252 seconds]
<alphabitcity> was hoping for an article of some sort with tips like that :)
chichou has joined #ruby
<Spooner> And as there, make sure you inherit from StandardErorr, not Exception.
wmoxam_ has quit [Quit: leaving]
Goles has joined #ruby
AlbireoX`Laptop has joined #ruby
emsilva has joined #ruby
<alphabitcity> ok, will do. thank you
jellosea has joined #ruby
<Spooner> I'm surprised everyone else doesn't have an opinion though.
DrShoggoth has quit [Quit: Leaving]
mosheeee has quit [Ping timeout: 255 seconds]
<alphabitcity> any chance you can give me some quick feedback on my approach with this gem? https://github.com/maxstoller/referly … specifically whether you think the proxy approach is acceptable
<alphabitcity> haven't seen that pattern in many other gems
tiripamwe has quit [Quit: Leaving]
thisirs has quit [Remote host closed the connection]
chichou has quit [Ping timeout: 250 seconds]
verbad has quit [Quit: Computer has gone to sleep.]
<yfeldblum> is there an option to the csv stdlib in ruby-1.9 to *force* it *never* to quote values? the force_quotes: true option typically means the output will not be quoted if i strip out any special characters beforehand, but it *will* quote any blank values ... is there a way to force the lib *not* to quote any values, even blank values?
johnlcox has joined #ruby
ken_barber has quit [Remote host closed the connection]
<chee> i'm very bad at thinking in objects, guys
<Spooner> alphabitcity : the API looks pretty normal. Reminds me of ActiveRecord (which I don't use, so I might be very off the mark :D).
<macer1_> when I am creating gem, and requiring it in other program all files will be included yes?
baphled has quit [Ping timeout: 248 seconds]
<alphabitcity> Spooner: great, that's what I was shooting
<macer1_> or I need in gem to require_relative the files?
<alphabitcity> Spooner: thanks for looking
<Spooner> macer1_ : All it does is require the main file (usually lib/my_gem.rb). You still have to require all the other files.
jonathanwallace has joined #ruby
<macer1_> hmm
<macer1_> ok
cpruitt has joined #ruby
<macer1_> is require_relative 'file.rb' good?
nobitanobi has quit [Quit: Leaving.]
emsilva has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Spooner> It will also ensure that lib/ is in the path, so you can use regular require too (but rr is better, of course).
<Spooner> What do you mean by "good"? Depends what you want it to do :D
ken_barber has joined #ruby
<macer1_> :/
<macer1_> oh
<macer1_> in path you sau
<TorpedoSkyline> Ok, another question. I've figured this out using other methods besides inject, but here it goes. I have an array: ["emperor", "joshua", "abraham", "norton"] and I want to use inject to combine them and capitalize them. array.inject("") { |result, each| result << " " << each.capitalize } but the problem is that there's now a space at the beginning of this new string.
<macer1_> say*
<macer1_> I will try
johnlcox has quit [Remote host closed the connection]
kvirani has quit [Remote host closed the connection]
<macer1_> also if there is lib/mcp/protocol/protocol.rb can I can call in other part of gem require 'mcp/protocol'?
johnlcox has joined #ruby
<TorpedoSkyline> How does one do this without concatenating a space at the beginning of it? I have my own solution without inject here: http://pastie.org/4367790
<Spooner> No, because you can't require a directory.
davidpk has quit [Quit: Computer has gone to sleep.]
<macer1_> Spooner: do you know any good gem examples to look at?
<Spooner> You could do require_relative "mcp/protocol/protocol" or require "mcp/protocol/protocol"
<Spooner> Assuming you are doing it in lib/mcp.rb, of course.
<macer1_> it is more complicated than that
yugui is now known as yugui_zzz
<macer1_> :D
sent-hil has joined #ruby
jonathanwallace has quit [Ping timeout: 252 seconds]
<macer1_> lib/mcp/protocol/protocol.rb lib/mcp/protocol/protocol29/packets.rb(this need to require the protocol.rb)
banisterfiend has quit [Remote host closed the connection]
<Spooner> It would either require "mcp/protocol/protocol" or require_relative "../protocol"
<macer1_> I asked if that first one
<Spooner> It is just standard Ruby behaviour, macer1_
TheFuzzball has quit [Read error: Connection reset by peer]
<macer1_> hmm
<macer1_> the first one makes sense :P
<TorpedoSkyline> Ah wait, unless memo.empty? might work.
x77686d has joined #ruby
wallerdev has quit [Quit: wallerdev]
Markvilla has quit [Quit: Markvilla]
yugui_zzz is now known as yugui
<macer1_> Spooner: I must rethink my gem folders organisation...
fermion_ has quit [Quit: Computer has gone to sleep.]
nohonor has joined #ruby
jarednorman has joined #ruby
<Spooner> TorpedoSkyline : array.each_slice(2).map {|name| name.map(&:capitalize).join " " }.join " "
jorge has quit [Remote host closed the connection]
nari has joined #ruby
<TorpedoSkyline> Spooner, can't use that because the code school requires that I use .inject. I ended up using this: http://pastie.org/4367831
<TorpedoSkyline> I'm trying another solution using .rstrip!
<Spooner> If it is for school, why are you asking me to do it for you? :D
lunitikcalm has quit [Remote host closed the connection]
<TorpedoSkyline> Spooner, not like "education school". I'm doing the RubyMonk thing. ;P
beneggett has joined #ruby
<Spooner> inject is a pretty poor fit for what you want to do.
<TorpedoSkyline> It is. It's terrible.
<TorpedoSkyline> So many better ways to do it from what I'm seeing.
Guest91275 has quit [Quit: Guest91275]
<Spooner> array.map(&:capitalize).join " " is probably the best way (without considering the names as actual names.
<Spooner> The way you posted works. As does .lstrip at the end of your original idea.
TheFuzzball has joined #ruby
<TorpedoSkyline> Spooner, now I'm seeing you use (&:capitalize) and I've never seen that done before.
x77686d_ has joined #ruby
<Spooner> It is just shorthand for {|s| s.captitalize }
Filuren has joined #ruby
Stalkr_ has quit [Read error: Connection reset by peer]
[Neurotic] has joined #ruby
Filuren is now known as Stalkr_
<TorpedoSkyline> Spooner
<TorpedoSkyline> You just blew my mind.
jrajav has joined #ruby
x77686d has quit [Ping timeout: 252 seconds]
x77686d_ is now known as x77686d
x77686d has left #ruby [#ruby]
<TorpedoSkyline> This school does some terrible stuff.
bowlowni has quit [Remote host closed the connection]
towelrod has quit [Quit: Leaving]
jorge has joined #ruby
conor_ireland has joined #ruby
ylluminate has quit [Ping timeout: 240 seconds]
bontaq has joined #ruby
<yfeldblum> TorpedoSkyline, you can pass any object you like in the "proc slot", that is, the argument slot which is normally filled up by the block you pass to a method, simply by passing it last in the arguments list and using the & prefix
<yfeldblum> TorpedoSkyline, the object must only respond to #to_proc, which must return an instance of Proc
<yfeldblum> TorpedoSkyline, so you can pass a symbol as the last argument, prefixed with &, and the symbol gets passed as though it were the block passed to the method
jgarvey has quit [Quit: Leaving]
jrist is now known as jrist-afk
<yfeldblum> TorpedoSkyline, ruby will call to_proc on the symbol, which returns a Proc, and ruby actually passes that resulting Proc instance into the method in the proc slot
wallerdev has joined #ruby
<macer1_> what is an good alternative of jeweler
fantazo has quit [Remote host closed the connection]
<yfeldblum> macer1_, why not just have a gemspec?
<macer1_> why not
<Spooner> macer1_ : I use Gem::PackageTask
<macer1_> jewler generates outdated dependecies
<yfeldblum> macer1_, if you run `bundle gem NEW_GEM_NAME` it will make a skeleton gem directory structure, including a good-to-go gemspec template
<macer1_> oh
<macer1_> it was there all time? -.-
SCommette has quit [Quit: SCommette]
ryh has quit [Read error: Connection reset by peer]
ken_barber has quit [Remote host closed the connection]
<macer1_> yfeldblum: big thx
adeponte has quit [Remote host closed the connection]
<yfeldblum> macer1_, cheers
<macer1_> my code is working but packaging it to gem is a little hard ;)
ryh has joined #ruby
adeponte has joined #ruby
niklasb has quit [Ping timeout: 246 seconds]
ethicalhack3r has quit [Quit: Leaving]
adeponte has quit [Read error: Connection reset by peer]
SQLStud has quit [Read error: Connection reset by peer]
burgestrand has quit [Quit: Leaving.]
adeponte has joined #ruby
<Spooner> It is a little fiddly at first, but you get used to it.
<TorpedoSkyline> yfeldblum, thanks. I'm going to have to read that over a couple times, but I'll get it. ;P
TomRone has quit [Remote host closed the connection]
sent-hil has quit [Remote host closed the connection]
burgestrand has joined #ruby
<Spooner> Some of that is implementation detail though. You only actually need to know that &:capitalize runs #capitalize on the object passed to the block :)
chrisbolton has quit [Quit: chrisbolton]
w400z has joined #ruby
GlenK has quit [Ping timeout: 240 seconds]
ylluminate has joined #ruby
<macer1_> how can I package it to .gem or some container?
<macer1_> and install ofc.
andrewhl has joined #ruby
Criztian has quit [Remote host closed the connection]
<Spooner> In your Rakefile: spec = Gem::Specification.load Dir['*.gemspec'].first
<Spooner> Gem::PackageTask.new spec do
<Spooner> end
<Spooner> And then you get the tasks to build and install.
ryh has quit [Remote host closed the connection]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<macer1_> it is all?
<yfeldblum> Spooner, it's how you call methods in ruby, not just the implementation - you can pass *any* object in the proc slot which responds to to_proc, and ruby will pass the resulting proc into the method in the proc slot
<macer1_> Spooner: undef. Gem
<macer1_> I need to require something in rakefile
<yfeldblum> macer1_, if you run `bundle gem NEW_GEM_NAME`, bundler will also generate a new Rakefile in the new gem skeleton dir, which includes a gem-building task, as well as task for building the gem, tagging and pushing the git tag, and releasing to rubygems.org
<Spooner> You need to require "rubygems" if you are on 1.8.7, but that should be all.
<macer1_> yfeldblum: the rakefile was empty
<macer1_> and I generated that way
<macer1_> so why??
Rezwan has joined #ruby
locriani has quit [Ping timeout: 248 seconds]
<macer1_> OK, I writed the package task, works
<macer1_> however I want to have all the tasks yfeldblum said :P
TomRone has joined #ruby
<macer1_> hm?
<yfeldblum> macer1_, the generated Rakefile should look like this:
<macer1_> but it doesn't
<yfeldblum> #!/usr/bin/env rake
<yfeldblum> require "bundler/gem_tasks"
<macer1_> no, it does
eggie5 has joined #ruby
<macer1_> :P
<macer1_> but where are all that magic tasks :D?
uris has quit [Quit: leaving]
<yfeldblum> macer1_, they're defined in the file lib/bundler/gem_tasks.rb in the bundler gem
<macer1_> so...
<macer1_> I don't have to define them?
Stalkr_ has quit [Read error: Connection reset by peer]
<yfeldblum> macer1_, you can if you want, or you can let bundler define them for you
infinitiguy has joined #ruby
<macer1_> Bundler::GemHelper.install_tasks paste that there?
infinitiguy has quit [Client Quit]
<eggie5> i want to get all the numbers in-between a range from a sorted list of numbers. short of a loop w/ an if(left <= number <= right) what are some other ways to do this?
<yfeldblum> macer1_, yes
<macer1_> how can I list rake cmds avaible?
<macer1_> to check if it's working
justsee is now known as justsee|away
<macer1_> it looks like it doesn't work because rake package fails
awarner has quit [Remote host closed the connection]
jorge has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
akem has joined #ruby
Jay_Levitt has quit [Quit: Leaving...]
<yfeldblum> macer1_, rake --tasks
<macer1_> ok
<macer1_> it is early indev alpha but can I release it to rubygems? it will be easier to manage
jorge has joined #ruby
chimkan has joined #ruby
<yfeldblum> macer1_, why is that?
<macer1_> because I can just type gem install mcp
mxweas has quit [Quit: Leaving...]
<macer1_> oh ok pushed
<macer1_> with warning ;p
<yfeldblum> macer1_, you can install it with `rake install`
<yfeldblum> macer1_, without pushing to rubygems.org
fermion_ has joined #ruby
<macer1_> ok
<macer1_> :P
<yfeldblum> macer1_, which you probably shouldn't do if it's too early
nobitanobi has joined #ruby
dotnull has quit [Read error: Connection reset by peer]
ringotwo has quit [Remote host closed the connection]
kirun has quit [Quit: Client exiting]
sent-hil has joined #ruby
chichou has joined #ruby
SCommette has joined #ruby
akem has quit [Ping timeout: 264 seconds]
<macer1_> ehh, now bunlder is saying about error in Gemfile
<macer1_> I have completly no idea what could i brok
<macer1_> broke*
jasonLaster has quit [Remote host closed the connection]
<macer1_> nevermind, fixed it :P
jasonLaster has joined #ruby
jorge has quit [Remote host closed the connection]
sgronblom has joined #ruby
jasonLaster has quit [Read error: Connection reset by peer]
jasonLaster has joined #ruby
greenysan has joined #ruby
jorge has joined #ruby
jasonLaster has quit [Remote host closed the connection]
jasonLaster has joined #ruby
<aces23up> is there a difference between the way obj.instance_variables returns stuff from 1.8.7 to 1.9.3?
akem has joined #ruby
JohnRedcorn has joined #ruby
wvms has quit [Read error: Connection reset by peer]
greenysan has quit [Ping timeout: 240 seconds]
jonathanwallace has quit [Remote host closed the connection]
wvms has joined #ruby
adeponte has quit [Remote host closed the connection]
adeponte has joined #ruby
mxweas has joined #ruby
justsee|away is now known as justsee
_adeponte has joined #ruby
adeponte has quit [Read error: No route to host]
<yfeldblum> aces23up, yes, 1.9 returns an array of symbols but 1.8 returns an array of strings
JohnRedcorn is now known as enroxorz
savage- has quit [Remote host closed the connection]
<aces23up> yfeldblum gotcha, ok wanted to make sure it wasn't me who broke the code..
savage- has joined #ruby
<aces23up> ok thats where its breaking thanks.
oz has quit [Quit: brb]
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
JustinCampbell has quit [Remote host closed the connection]
graspee has joined #ruby
jasonLaster has quit [Remote host closed the connection]
jasonLaster has joined #ruby
chimkan has quit [Quit: chimkan]
nobitanobi has quit [Read error: Connection reset by peer]
mwilson_ has quit [Excess Flood]
jasonLas_ has joined #ruby
mwilson_ has joined #ruby
nobitanobi has joined #ruby
mwilson_ has quit [Excess Flood]
jasonLas_ has quit [Remote host closed the connection]
mwilson_ has joined #ruby
jasonLas_ has joined #ruby
<macer1_> if I want a syntax for using like this: mcp.connect(localhost,port) do {chat "hello"; chat "trololo";} will the "chat" just call the chat method on returned object?
jasonLas_ has quit [Remote host closed the connection]
jasonLas_ has joined #ruby
blazes816 has quit [Quit: Leaving]
jasonLaster has quit [Ping timeout: 260 seconds]
<aces23up> is this correct?
<aces23up> instance_variables.include?(:@args)
<keyvan> that syntax is wrong first of all, you either use "do" and "end" or "{" and "}"
<enroxorz> macer1_ i believe it calls the chat method
<macer1_> awesome, thx
<enroxorz> and what kevan said
<macer1_> keyvan: I always confuse that. I mean without do
<macer1_> too much bash
<enroxorz> dont bash bash bro
jasonLas_ has quit [Ping timeout: 246 seconds]
<davidcelis> zsh > bash
<macer1_> what that amazing is zsh doing
brianpWins has quit [Quit: brianpWins]
<keyvan> and yeah it just calls chat, whatever it is in that scope where the block gets called, in fact the #connect method there shall be defined to take a block, (def connect(host, port, &block)) where you can do whatever with the block, doesnt have to be limited to some automatically returned object or whatever
<enroxorz> oooooh. dem be fightin text. as for your question i believe chat method will be called, not returned
minijupe has joined #ruby
<macer1_> keyvan: interesting
<macer1_> and then I somehow call the block?
<keyvan> block.call
<davidcelis> or you yield to it
<keyvan> err yea what davidcelis says seems more correct
<davidcelis> yield if block_given?
<macer1_> def initialize(args = {}, &block)
<davidcelis> args = {} ??
<davidcelis> why would you name an options hash "args"?
<macer1_> I mean
<macer1_> ...
<yfeldblum> aces23up, it's not recommended to do it that way ... prefer to use `instance_variable_defined?(:@args)`
<davidcelis> do you mean *args
<macer1_> yes
<davidcelis> def initialize(*args, &block)
<keyvan> then it'd be an array, not a hash, no?
<aces23up> yfeldblum thanks.
<keyvan> oh wait, sorry, nvm
<davidcelis> yes, it would be an array
<keyvan> expanded list of arguments
<davidcelis> spl*t
<macer1_> also after the block is end the object is destroyed?
<macer1_> when using bla.connect {do something with bla}
<keyvan> object destruction is handled by the GC, if u retain a reference to it, it wont be destroyed, otherwise it is (correct me if wrong)
<davidcelis> destroyed?
<davidcelis> no
centipedefarmer has joined #ruby
<macer1_> hmm maybe that way
<macer1_> if block given
<macer1_> call the block and close the socket at the end
<macer1_> without block user will must close the socket using method
nari has quit [Ping timeout: 252 seconds]
<keyvan> macer1_ yea thats nice, similar to File.open, if u use the block style of doing work with a File, it calls File#close for you automatically, otherwise you do it yourself.
<macer1_> cool
seanstickle has joined #ruby
xaq has quit [Remote host closed the connection]
<aces23up> yfeldblum this is frustrating.
<aces23up> i can't seem to get it to work.
<aces23up> it reports its there in the puts but not when i use it.
sent-hil has quit [Remote host closed the connection]
<aces23up> yfeldblum could you take a look and see what I'm doing wrong?
hndsmrob has left #ruby [#ruby]
`brendan has joined #ruby
_bart has quit [Quit: _bart]
<seanstickle> What is this ":@args" construct you're using?