Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
wyhaines has joined #ruby
hadees has joined #ruby
hooper has joined #ruby
willej has joined #ruby
ctp has joined #ruby
eywu1 has joined #ruby
techhelp has joined #ruby
<techhelp> I've been struggle with the following error. Google no help.
<techhelp> [exec] /Library/Ruby/Site/1.8/rubygems/version.rb:187:in `initialize': Malformed version number string ~> 0.4.7 (ArgumentError)
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/lockfile_parser.rb:88:in `new'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/lockfile_parser.rb:88:in `parse_spec'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/lockfile_parser.rb:55:in `parse_source'
willej has joined #ruby
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/lockfile_parser.rb:20:in `send'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/lockfile_parser.rb:20:in `initialize'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/lockfile_parser.rb:14:in `each'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/lockfile_parser.rb:14:in `initialize'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/definition.rb:40:in `new'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/definition.rb:40:in `initialize'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/dsl.rb:131:in `new'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/dsl.rb:131:in `to_definition'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/dsl.rb:8:in `evaluate'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/definition.rb:17:in `build'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler.rb:138:in `definition'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler.rb:126:in `load'
<techhelp> [exec] from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler.rb:117:in `setup'
a1ph4g33k has quit [#ruby]
<techhelp> sorry for the long paste
<banister`sleep> techhelp: STOP
levity_island has joined #ruby
<banister`sleep> techhelp: now you have to quit the channel and never come back
<banister`sleep> techhelp: that was ridiculous
<techhelp> sorry
<Toerkeium> this page you sen't me before talks about a phusion passenger (http://www.modrails.com/documentation/Users%20guide%20Apache.html#install_passenger)
<Toerkeium> I need to read a level before that!
<Toerkeium> any helpful link?
willej_ has joined #ruby
<Toerkeium> banister`sleep? seanstickle?
<ckrailo> uh oh dont ask seanstickle he'll mean you.
<seanstickle> :P
<Toerkeium> he looks like a intelligent guy, who realized I didn't know anything about ruby? huh?
<Toerkeium> heh
charlenopires has joined #ruby
<Toerkeium> seriously, a place to read about how it works?
<Toerkeium> ok, thanks anyway
<ckrailo> i've never worked with passenger
<ckrailo> so no idea from me :(
charlenopires_ has joined #ruby
<Toerkeium> how do you work with ruby ckrailo?
wmoxam has joined #ruby
waxjar has joined #ruby
<ckrailo> Toerkeium: uhhh on a mac with rvm and gems like rackup in a framework? O.o
<Toerkeium> heh ok
tomzx has joined #ruby
<Toerkeium> imagine when I start coding in ruby
<Toerkeium> don't think I won't come back :P
<ckrailo> Toerkeium: there's some tuts on the interwebz. rubykoans, ruby-warrior, etc.
cook1es has joined #ruby
<Toerkeium> ckrailo: does this phusion passenger module changes they way code is executed? I mean, if you upload your apps on a server using this module, will they work? or it's just an easy way to setup ruby on apache?
randym has joined #ruby
mayfield has joined #ruby
<ckrailo> i have no clue how to use ruby and apache
<ckrailo> we use nginx for our ruby stuff, and i dont set that up either.
<Toerkeium> ok, thanks for answering ckrailo
<Toerkeium> I'll leave for a beer and take care of this stuff tomorrow
<Toerkeium> have a good night
<ckrailo> you too :)
Karmaon has joined #ruby
laen_ has joined #ruby
jamielinux has quit [#ruby]
daglees has joined #ruby
eignerchris_ has joined #ruby
pu22l3r has joined #ruby
cousine has joined #ruby
pu22l3r has joined #ruby
carlyle has joined #ruby
h4mz1d has joined #ruby
adamkittelson has joined #ruby
werdnativ has joined #ruby
kaneda_ has joined #ruby
Gekz has joined #ruby
Gekz has joined #ruby
willej has joined #ruby
MrGando has joined #ruby
milkpost has joined #ruby
gmcintire has joined #ruby
vraa has joined #ruby
banister`sleep has joined #ruby
briankbuckley has joined #ruby
wmoxam has joined #ruby
jankly has joined #ruby
youdonotexist has joined #ruby
eywu has joined #ruby
ckrailo has joined #ruby
Azure has joined #ruby
vraa has joined #ruby
liluo has joined #ruby
td123 has joined #ruby
banister`sleep has joined #ruby
<banister`sleep> burgestrand: commands can now take blocks :D https://gist.github.com/238dc7431a386a2609fb
dnordstrom has joined #ruby
thebope has joined #ruby
wmoxam has joined #ruby
samsonjs_ has joined #ruby
gmcintire has joined #ruby
<shevy> hmm I just think I had a good idea
<shevy> given that harddiscs are so huge anyway
<shevy> when I compile something, I'll copy the results of everything, if "make" finishes successfully
<shevy> then I can at a later time, just do "make install" but also "make clean"
<shevy> for every program that is compiled
<epochwolf|vps> shevy: isn't that how compiling works already?
<epochwolf|vps> everything I've compiled saves stuff to a build folder.
<shevy> epochwolf|vps well yeah
<shevy> I kinda removed everything after compilation was finished, to save space
<epochwolf|vps> shevy: make a script that does "./configure && make && make install && make clean"
startling has joined #ruby
<shevy> hmm why the "make clean" part?
<epochwolf|vps> if you want to clear up disk space after you're done.
<epochwolf|vps> I assume that's what you want to do.
<epochwolf|vps> This is why *nix systems have shell scripting. If you want to automate something. Write a script.
<shevy> ah
Squee-D has joined #ruby
<shevy> I dont think I need to clear up the disk space really
<startling> if you don't make clean, though, you'll probably have a faster build next time
<epochwolf|vps> shevy: then don't run make clean?
<shevy> yeah! and I could just restore to an earlier working point (when I manage to break something)
<shevy> imagine even this, I could make snapshots of when the system worked... and when it did not... and revert again when some things (in some days or weeks) suddenly no longer work!
<epochwolf|vps> startling: I feel like I'm sitting in a logic vacuum.
<epochwolf|vps> shevy: it's called backups.
ribayr has joined #ruby
<shevy> I have backups, but no idea how things fit into it all anymore... take this error I am struggling wiht: gdk-pixbuf-2.23.5/gdk-pixbuf/.libs/lt-gdk-pixbuf-query-loaders: symbol lookup error: /usr/lib/libgmodule-2.0.so.0: undefined symbol: g_private_replace
<shevy> it all makes me angry what I did too
<shevy> I just need to jump back ONE hour in time!
<startling> epochwolf|vps: ? sorry if I missed some context, I came here pretty recently
<startling> shevy: version control?
<epochwolf|vps> startling: it could just be my job.
<shevy> startling yeah one day hopefully
<startling> shevy: why not now?
<epochwolf|vps> startling: or maybe it's this room :)
<shevy> because right now I have no idea what is all going on and I feel like reinstalling everything
* epochwolf|vps hugs his mac and time machine.
<startling> shevy: and install git while you're at it
tvw has joined #ruby
<startling> epochwolf|vps: ah, I thought you meant because of what I said.
pdtpatr1ck has joined #ruby
norex has joined #ruby
nari has joined #ruby
looopy has joined #ruby
frishi has joined #ruby
shobhitg has joined #ruby
memalloc has joined #ruby
liluo has joined #ruby
werdnativ has joined #ruby
QaDeS_ has joined #ruby
macmartine has joined #ruby
fermion has joined #ruby
memalloc has quit [#ruby]
CheeToS has joined #ruby
snip_it has joined #ruby
norex has joined #ruby
mxweas_ has joined #ruby
jacortinas has joined #ruby
samsonjs has joined #ruby
otakutomo has joined #ruby
h4mz1d has joined #ruby
shobhitg has joined #ruby
ksysk has joined #ruby
cousine has joined #ruby
gen0cide_ has joined #ruby
kylemcgill has joined #ruby
cook1es has joined #ruby
heftig has joined #ruby
heftig has joined #ruby
andrewhl has joined #ruby
cobragoat has joined #ruby
ksysk has quit [#ruby]
looopy has joined #ruby
lastk has joined #ruby
_|christian|_ has joined #ruby
<lastk> someone using the gem isolate?
looopy has joined #ruby
gh has joined #ruby
gh has quit [#ruby]
cloke has joined #ruby
marcamilly has joined #ruby
looopy has joined #ruby
pu22l3r_ has joined #ruby
tymat has joined #ruby
Jay_Levitt has joined #ruby
fayimora has joined #ruby
shadoi has joined #ruby
werdnativ has joined #ruby
<lastk> hi guys, how I can run my tests with ruby test.rb instead of rspec teste.rb
pp01bit has joined #ruby
luckyruby has joined #ruby
austinbv has joined #ruby
mikeycgto has joined #ruby
mikeycgto has joined #ruby
<austinbv> how is 1.9.3?
saurb has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
bbttxu has joined #ruby
eywu has joined #ruby
milkpost has joined #ruby
<senthil> damn, does active_support really take 1 entire sec to load?
<shevy> austinbv complicated as always
<shevy> senthil sounds pretty fast
<austinbv> senthil: pretty good for how awesome it is
<shadoi> senthil: 1.9.3 improves load times drastically
Drewch has joined #ruby
Drewch has quit [#ruby]
Drewch has joined #ruby
<senthil> shevy: faraday, json, rspec all take 0.5 sec, AS alone takes 1 sec
<senthil> shadoi: am using 1.9.3 performance patched version
<shadoi> senthil: nasty
<shadoi> senthil: I use extlib and/or exctract the parts of AS I need these days.
<shadoi> extract*
<senthil> I must be doing something wrong, all I want is active_support/inflector, which loads instantly in pry, but takes a while
al3xnull has joined #ruby
startling has joined #ruby
<senthil> when used with rspec
jpreyer has joined #ruby
mikeycgto has joined #ruby
mikeycgto has joined #ruby
<senthil> shadoi: I want #constantize and #camelize, the later depends on .../inflections.rb, i.e. an entire file, so I was a bit hesitant
<shadoi> extlib has alternatives
<senthil> shadoi: i'm looking at it, doesn't have String#constantize
<shadoi> but… it does seem odd it takes longer in rspec
Dreamer3 has joined #ruby
<senthil> shadoi: exactly! i'm only requiring activesupport/inflector, not sure what's happening
<shadoi> you could try the profiler to see where it's spending time…
<senthil> shadoi: yea good idea...think entire sys might need a restart
Squee-D has joined #ruby
mikepack has joined #ruby
libertyprime has joined #ruby
libertyprime has joined #ruby
libertyprime has joined #ruby
samsonjs has joined #ruby
looopy has joined #ruby
senthil has joined #ruby
<senthil> shadoi: i'm an idiot, it was vcr, not AS
maletor has joined #ruby
<shadoi> :)
libertyprime has joined #ruby
austinbv has joined #ruby
libertyprime has joined #ruby
philcrissman has joined #ruby
philcris_ has joined #ruby
bbttxu_ has joined #ruby
v0n has joined #ruby
stephenjudkins has joined #ruby
asteros has joined #ruby
sdwrage has joined #ruby
radic_ has joined #ruby
ribayr has joined #ruby
excel542 has joined #ruby
mxweas_ has joined #ruby
davidcelis has joined #ruby
elake has joined #ruby
libertyprime has joined #ruby
akem has joined #ruby
adrakoa has joined #ruby
<adrakoa> hi
<senthil> wow, 'bundle install --path vendor' && 'bundle package' halves the time to run specs
ryanf has joined #ruby
<senthil> when specs are run w/ 'bundle exec rspec' ofcourse
<senthil> anyone else doing this?
austinbv has joined #ruby
matti has joined #ruby
looopy has joined #ruby
wenbert has joined #ruby
brondsem has joined #ruby
p0y has joined #ruby
adamkittelson has joined #ruby
munx has joined #ruby
philcrissman has joined #ruby
Sigma00 has joined #ruby
ascarter has joined #ruby
_|christian|_ has joined #ruby
_srp has joined #ruby
divout has joined #ruby
niklasb_ has joined #ruby
markstewie has joined #ruby
niklasb has joined #ruby
niklasb has joined #ruby
Know1edge has joined #ruby
rohit has joined #ruby
M- has joined #ruby
snip_it has joined #ruby
gokul has joined #ruby
kasansweat has joined #ruby
<kasansweat> How does one successfully retrieve a string containing ampersands (in my case, its filepaths) from an array? Been googling this for a while, can't figure it out. Thanks!
epochwolf has joined #ruby
albemuth has joined #ruby
rippa has joined #ruby
rohit has joined #ruby
b33r_g0ggl3z has joined #ruby
c0rn has joined #ruby
CannedCorn has joined #ruby
denom has joined #ruby
banister`sleep has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
nixmaniack has joined #ruby
nfluxx_ has joined #ruby
Squee-D has joined #ruby
kp666 has joined #ruby
KL-7 has joined #ruby
ieo has joined #ruby
nirjhor has joined #ruby
<nirjhor> can someone please tell me what's wrong here: http://dpaste.com/707509/
shobhitg has joined #ruby
<epochwolf> nirjhor: looks fine, do you really need one of us to do your heomwork?
shobhitg has joined #ruby
<nirjhor> nonono, it isn't getting run
<nirjhor> nirjhor@nirjhor-K40IJ:~/Ruby$ ruby cf.rb
<nirjhor> cf.rb:20: syntax error, unexpected keyword_else, expecting keyword_end
<nirjhor> nirjhor@nirjhor-K40IJ:~/Ruby$
<shadoi> nirjhor: use elsif instead of else when there's an additional condition
<epochwolf> heh… I missed that.
<epochwolf> I've never seen that mistake before.
<nirjhor> cf.rb:20: syntax error, unexpected keyword_elsif, expecting keyword_end
<nirjhor> :(
<epochwolf> LOL
<nirjhor> still can't run
<epochwolf> nirjhor: yuo replaced the wrong else :)
<epochwolf> if something … elsif something… else … end
<nirjhor> HAHA
<nirjhor> sorry :)
Squee-D has joined #ruby
<nirjhor> epochwolf: man I guess my 2nd logic is faulty. because it always returns 0.0 :S
maletor has joined #ruby
<nirjhor> celsius = ((fahrenheit - 32)*(5/9)).to_f
<nirjhor> this one
maletor has joined #ruby
<rippa> nirjhor: 5/9 == 0
no-name- has joined #ruby
<rippa> it's integer division
<nirjhor> got it
<nirjhor> 5.0
<nirjhor> should have been like this
Deele has joined #ruby
<nirjhor> how to append some given string into an array?
<nirjhor> like, I need to write a program which takes some input , and calculate the positive and negative integers
<nirjhor> any clue how to begin?
knix has joined #ruby
knix has joined #ruby
De`off has joined #ruby
austinbv has joined #ruby
<rippa> nirjhor: array << string
ericmuyser|air has joined #ruby
knix has quit [#ruby]
<ericmuyser|air> did I break tryruby or is this output correct? http://o7.no/yhnTBE
<nirjhor> thanks :)
td123 has joined #ruby
<rippa> ericmuyser|air: it broke
stephenjudkins has joined #ruby
n8ji has joined #ruby
xkws49er has joined #ruby
rohit has joined #ruby
<xkws49er> what is uninitialized constant SchoolsController? Routing Error?
cobragoat has joined #ruby
ed_hz_ has joined #ruby
ryanf has joined #ruby
dipix has joined #ruby
caiges has joined #ruby
<nirjhor> why is it not breaking? http://dpaste.com/707511/
<nirjhor> any idea guys , please?
<epochwolf> nirjhor: because "0" does not equal 0
lewis1711 has joined #ruby
<epochwolf> ruby doesn't to type coercion when comparing objects (unless javascript and php)
<epochwolf> unlike* (not unless)
<nirjhor> so , how to fix it? I modified : number = gets.chomp.to_i
RubyPanther has joined #ruby
nirjhor has quit [#ruby]
o_bs has joined #ruby
liluo has joined #ruby
<lewis1711> so I have a big raw string dump of... I think it's html, honestly I am ignorant of net stuff so I have no clue. Anyway, what's the best way of getting all the subtrings of that between two particular tags, like <img> </img> for example
adeponte has joined #ruby
Divinite has joined #ruby
stephenjudkins has joined #ruby
_srp has joined #ruby
b33r_g0ggl3z has joined #ruby
x0F__ has joined #ruby
rohit has joined #ruby
akem has joined #ruby
Marco has joined #ruby
banister`sleep has joined #ruby
enherit has joined #ruby
MasterIdler_ has joined #ruby
triptec has joined #ruby
mxweas_ has joined #ruby
badabim has joined #ruby
* Divinite is recompiling ruby and this time puts in CFLAGS=-O2
<Divinite> Seriously...
<Divinite> Now it works...
<denysonique__> puppt or chef?
<denysonique__> puppet or chef?*
<any-key> swedish chef
<Divinite> Chef
<burgestrand> sprinkle
<any-key> borkborkbork!
<lewis1711> does ruby use a particular "dialect" of regular expression?
<Divinite> No idea lewis1711
<burgestrand> lewis1711: oniguruma
<lewis1711> no I mean the syntax
Seisatsu has joined #ruby
randym has joined #ruby
Squee-D has joined #ruby
whh has joined #ruby
djdb has joined #ruby
<denysonique__> I like sprinkle
<denysonique__> but
<denysonique__> it uses the keyword apt to install a package...
<denysonique__> I beleive it should a keyword install istead
<Divinite> What does sprinkle do?
<denysonique__> which would automatically pick up the appropriate package manager (pacman in my case)
Drakx has joined #ruby
Drakx has joined #ruby
<Divinite> denysonique: That would be extremely useful.... Thanks for pulling my attention to it :)
patrick99e99 has joined #ruby
ben225 has joined #ruby
<Divinite> denysonique__: I meant you sorry
yxhuvud has joined #ruby
nfluxx has joined #ruby
thone has joined #ruby
Ripp__ has joined #ruby
scalebyte has joined #ruby
tonini has joined #ruby
zakwilson_ has joined #ruby
<scalebyte> What does it mean if I do Time.now + 1 ??
<scalebyte> I mean adding 1 to a datetime object ?
<scalebyte> it is the same bt it still doesnt return an error...so what does it mean ?
<scalebyte> RubyPanther: ^^^ That one is an interesting doubt... U might like it :)
<RubyPanther> scalebyte: you could always just ask google
<RubyPanther> if not the stdlib docs
<scalebyte> RubyPanther: mate this is not a method... u cannot simply skim through the doc to find an explanation to it... am just adding + 1 to a date object and its returning the same values !! nothing happens no error
<RubyPanther> scalebyte: Ruby doesn't have non-method operators, everything is a method.
<scalebyte> RubyPanther: Time.now + 1 which method is this ? unary?
<RubyPanther> if you have pickaxe ver 2 it is page 644
<RubyPanther> look up "unary" and you'll know
austinbv has joined #ruby
<RubyPanther> Learn Ruby, it is fun
wenbert has joined #ruby
<scalebyte> RubyPanther: i have done this b4 :) I just dont think anything has an explanation referenced on this !1
<RubyPanther> scalebyte: programming is not _only_ doing it is also reading. As in, a whole book on the language. So that you can identify an instance method when you see one
<RubyPanther> lol very good
<RubyPanther> why you would search for pages with the number one, I don't know, but close enough right?
<scalebyte> RubyPanther: i mean i have this issue with me...http://stackoverflow.com/questions/9426325/namedscope-retrieving-inconsistent-data-from-the-model-rails-2-1 and I was seeeking a solution to Time object + 1 behalf of that
<RubyPanther> scalebyte: if you connect links to non-space chars like that they don't turn into links in most IRC clients
odinswand has joined #ruby
<scalebyte> RubyPanther: mate got it :)
<scalebyte> RubyPanther: Time.now + x adds x second to the time object :)
<RubyPanther> According to the manual, that is correct.
flaccid has joined #ruby
<flaccid> with resolv, i'm trying to figure out how to use it to simply get the system's current nameservers using config_info=nil http://www.ruby-doc.org/stdlib-1.9.3/libdoc/resolv/rdoc/Resolv/DNS.html#method-c-new but im' not sure how to pull out the nameservers ?
pdtpatr1ck has joined #ruby
madhatter has joined #ruby
rickmasta has joined #ruby
bluOxigen has joined #ruby
wenbert has joined #ruby
daniel_hinojosa has joined #ruby
drieddust has joined #ruby
sdwrage has quit [#ruby]
KL-7 has joined #ruby
daglees has quit ["Leaving"]
CheeToS has joined #ruby
Lord-Harlot has joined #ruby
Richmond has joined #ruby
senny has joined #ruby
aroop has joined #ruby
maletor has joined #ruby
Helius has joined #ruby
jeekl has joined #ruby
jeekl has joined #ruby
liluo has joined #ruby
banseljaj has joined #ruby
ph^ has joined #ruby
b33r_g0ggl3z has joined #ruby
tectonic has joined #ruby
<flaccid> trying to work out how to get the nameservers out of nameservers = Dnsruby::Resolver.new.config
adamjleonard has joined #ruby
Morkel has joined #ruby
ryanf has joined #ruby
lewis1711 has quit ["Leaving."]
dr_bob has joined #ruby
MH35 has joined #ruby
<MH35> Hello
mikeric has joined #ruby
<MH35> Hello!
ephemerian has joined #ruby
<MH35> Hi
<dr_bob> hi
axl_ has joined #ruby
<MH35> How should I detect OS(WinXP, Vista, 7, Mac OS X, Linux, etc.)?
tvw has joined #ruby
mafolz has joined #ruby
bier has joined #ruby
nirjhor has joined #ruby
<nirjhor> Can anyone tell me what's wrong here? http://dpaste.com/707533/
etehtsea has joined #ruby
<nirjhor> epochwolf|vps: I finished it other way round, will you check? http://dpaste.com/707533/
araujo has joined #ruby
araujo has joined #ruby
<MH35> What is wrong?
adeponte has joined #ruby
zommi has joined #ruby
<MH35> I see. In Ruby, ++ operator is not defined.
<MH35> ++ should be += 1
odinswand has joined #ruby
gianlucadv has joined #ruby
<MH35> I see. The loop condition is wrong.
<nirjhor> MH35: thanks . let me try
Asher has joined #ruby
<nirjhor> MH35: now it is running, but it is breaking without asking for the input
nemesit has joined #ruby
<MH35> OK. I fixed the code.
adeponte has joined #ruby
<nirjhor> MH35: where it is?
Jackneill has joined #ruby
shruggar has joined #ruby
<nirjhor> MH35: let me check. thanks btw
Karmaon has joined #ruby
<MH35> Does the code work?
<nirjhor> MH35: yah man
Spockz` has joined #ruby
<nirjhor> MH35: thanks
saurb has quit [#ruby]
zxiest[a] has joined #ruby
<zxiest[a]> Hello everybody :-)
<zxiest[a]> Do you guys know how I can list the variables I declared in console?
<MH35> You're welcome. By the way, how should I detect the OS in Ruby?(eg. WinXP, Vista, 7, Mac OS X, Linux etc.)
<nirjhor> nirjhor@nirjhor-K40IJ:~/Ruby$ ruby -v
<nirjhor> ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]
<nirjhor> see?
<MH35> I see.
vandemar has joined #ruby
senthil has joined #ruby
stephenjudkins has joined #ruby
scalebyte has joined #ruby
M- has joined #ruby
<CheeToS> nirjhor: I'm picking up ruby and decided to make some other changes: http://dpaste.com/707535/
pi3r has joined #ruby
<nirjhor> CheeToS: cool :D
<MH35> Cool!
nirjhor has quit [#ruby]
Nss has joined #ruby
csherin has joined #ruby
d3vic3 has joined #ruby
twqla has joined #ruby
FND has joined #ruby
JohnBat26 has joined #ruby
cachemoney has joined #ruby
flaccid has joined #ruby
flaccid has joined #ruby
lewis1711 has joined #ruby
francisfish has joined #ruby
<lewis1711> if I have some string "this is in [brackets]", is there anyway I could extract "brackets" by telling it to extract everything inside "[" and "]"? I know about string.split but that uses just one delimiter
francisfish has joined #ruby
berkes has joined #ruby
<FND> lewis1711: I guess you'd use regex for that
phantomfakeBNC has joined #ruby
<FND> lewis1711: /\[(.*?)\]/.match("foo [bar] baz")
stephenjudkins has joined #ruby
<lewis1711> I was told to avoid regular expression on html
<lewis1711> grammar 3 langue and grammar 2 language.. or something
<FND> oh yes, you don't wanna parse HTML with regex
<Mon_Ouie> Regexp will work as long as you don't have nested structures
<FND> but you don't wanna parse HTML with anything like split either
shruggar has joined #ruby
<FND> so I guess you need to elaborate on your goals/situation
<lewis1711> extract the text between tags in an HTML string dump
<Mon_Ouie> (Though Ruby's regexp allow you to do that with group callback, but that's more complicated than writing a "normal" parser)
<lewis1711> say between <img> and </img> for example
<lewis1711> nothing too tricky
<Mon_Ouie> Use a library like Nokogiri for parsing it
<lewis1711> is it actually that tricky that I'd need a library? fair enough
<lewis1711> (I did try and install nokogiri but it error'd out on the compile)
<Mon_Ouie> It's more that there is no reason not to use a library instead of solving that problem again
<Mon_Ouie> There's even one in stdlib if you can't use an external dependency
<dr_bob> REXML
<lewis1711> sounds good to me. I have no problem using external dependencies but yeah
<lewis1711> what's it called?
<Mon_Ouie> <dr_bob> REXML <- like that
Helius has joined #ruby
<lewis1711> that's XML only though right?
<lewis1711> a quick google suggests so
<lewis1711> I'll just try and get nokogiri working, if there's nothing else
<Mon_Ouie> I'm pretty sure it can parse HTML too
<lewis1711> doesn't look like it
<dr_bob> Hmm... REXML is for XML only. It will of course parse proper XHTML. For practical HTML Nokogiri is better.
<Mon_Ouie> Hm, maybe not
<Mon_Ouie> If it doesn't compile, you're probably missing a C library
xiaog1 has joined #ruby
<lewis1711> I have the two needed. it didn't give a very specific message
ukwiz has joined #ruby
BiHi has joined #ruby
FND has quit [#ruby]
csherin has joined #ruby
visof has joined #ruby
Mekkis has joined #ruby
Barzogh has joined #ruby
<lewis1711> http://pastebin.com/xtHCGYqV if anyone could offer insight onto why that compile failed, would be much obliged. "make: *** [nokogiri.o] Error 1" isn't much to go off for me
<stephenjudkins> lewis1711: never use a regexp for parsing XML or HTML
<lewis1711> yeah I know
<lewis1711> stephenjudkins: yeah i read that when googling. and I never intented to use regexp
<stephenjudkins> you're using rubinius. i suspect nokogiri will not work with rubinius
<lewis1711> I'm using rubinius!?
<stephenjudkins> though I may be wrong
<lewis1711> lets see..
<stephenjudkins> "/home/lewis/.rvm/rubies/rbx-head/bin/rbx extconf.rb"
<stephenjudkins> anyways, ask in #rubinius if that's the case
<lewis1711> do you have any idea how to check what engine you're usiong?
<lewis1711> I never inteded to be using rubinius, though I may have downloaded it to mess with
<stephenjudkins> `rvm info`
Spockz` has joined #ruby
<lewis1711> ruby: "/home/lewis/.rvm/rubies/ruby-1.9.2-p180/bin/ruby"
<lewis1711> doesn't look like it.
<scalebyte> somebody help me with my question ^^^^^^^^^^^^^^^^^^^^^^^^^^
<stephenjudkins> lewis1711: well, the paste you put above clearly shows it compiling against rubinius
<lewis1711> yeah..
nixmaniack has joined #ruby
<lewis1711> I see that's where the clash is
<lewis1711> stephenjudkins: thanks for figuring out the problem
Helius has joined #ruby
<stephenjudkins> np
Helius has joined #ruby
<stephenjudkins> #rvm is helpful if it's acting funny
<lewis1711> I"ll just remove rubinius, I need HD space anyway
sat has joined #ruby
<lewis1711> aha, installed and all working well
Squee-D has joined #ruby
jbw_ has joined #ruby
EddieS has joined #ruby
tayy has joined #ruby
jlebrech has joined #ruby
zxiest has joined #ruby
tweeKula has joined #ruby
fr0gprince_ has joined #ruby
Shrink has joined #ruby
Shrink has joined #ruby
tatsuya_o has joined #ruby
ikaros has joined #ruby
ni-ka has joined #ruby
ni-ka has quit [#ruby]
adambeynon has joined #ruby
ni-ka has joined #ruby
<ni-ka> hey! is there any way to check that I am currently running jruby on windows? (RbConfig::CONFIG['host_os'] is either mingw or jruby, but jruby for all operating systems)
rippa has joined #ruby
tayy has joined #ruby
ameba has joined #ruby
tk_ has joined #ruby
xiaog1 has quit [#ruby]
iocor has joined #ruby
paissad has joined #ruby
randym has joined #ruby
workmad3 has joined #ruby
sayakb_ has joined #ruby
wenbert has joined #ruby
vitorave` has joined #ruby
_musee has joined #ruby
rohit has joined #ruby
odinswand has joined #ruby
telling has joined #ruby
telling has joined #ruby
fr0gprince_ has joined #ruby
Emmanuel_Chanel has joined #ruby
csherin_ has joined #ruby
csherin_ has joined #ruby
berserkr has joined #ruby
twqla has joined #ruby
<shevy> ni-ka I think headius on #ruby-lang may know, he maintains jruby
tvo has joined #ruby
tvo has joined #ruby
flaccid_ has joined #ruby
MH35 has quit ["Leaving..."]
dhruvasagar has joined #ruby
mbursi has joined #ruby
<ni-ka> shevy: thx, somehow the same command returns the correct values now, weird...
_2easy has joined #ruby
hukl has joined #ruby
<shevy> hehe
<shevy> mysteries!
<shevy> it's also why I dont like metamagic programming
<ni-ka> Now, looks like I have a rather complicated problem... I'm using bundler to install a gem that has native extensions under windows. However, the gem compile process conflicts with git being on the path (as it also provides mingw) and that leads to mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x421963)
<ni-ka> but I need git on the path to execute bundler...
arturaz has joined #ruby
<shevy> ewww bundler
<shevy> that shit never worked for me so far
<canton7> so long as i don't track my lockfile, it seems to work okay... The minute you've got a tracked lockfile and multiple platforms, though, it falls over
aers has joined #ruby
virunga has joined #ruby
dhruvasagar has joined #ruby
Talvino has joined #ruby
bozhidar has joined #ruby
boboxx has joined #ruby
g0bl1n has joined #ruby
<ni-ka> what command do I need to run to install a gem with native extensions the way bundler would do it, but after manually cloning the gem git to a local directory?
Shrink has joined #ruby
<ni-ka> so that bundler does not need git
<ni-ka> seems to be rake install...
fr0gprince_mac has joined #ruby
josemota has joined #ruby
briankbuckley has joined #ruby
iocor has joined #ruby
twelvechairs has joined #ruby
Foxandxss has joined #ruby
fayimora_ has joined #ruby
ni-ka has joined #ruby
Jay_Levitt has joined #ruby
undersc0re has joined #ruby
undersc0re has joined #ruby
cek has joined #ruby
<cek> propose a html -> text simple renderer
Talvino has joined #ruby
<cek> that is, indented text goes a bit to the right, then bold text is quoted by *, etc... much like lynx or links do
sterNiX has joined #ruby
mengu has joined #ruby
canton7 has joined #ruby
<Tasser> can textile do tables?
Norrin has joined #ruby
kidoz has joined #ruby
PragCypher has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
nirjhor has joined #ruby
emmanuelux has joined #ruby
<nirjhor> the following program is showing multiplication of n*n. How can I make it stop at n*10? http://dpaste.com/707570/
<twelvechairs> nirjhor: if max < 10 then max2=max else max2=10 end
<twelvechairs> nihr: then replace the max with max2 after |y|
<nirjhor> twelvechairs: thanks
lorandi has joined #ruby
Helius has joined #ruby
iocor has joined #ruby
rohit has joined #ruby
schlecht has joined #ruby
vraa has joined #ruby
<nirjhor> what is the abbreviation of this line: sum +=1./i;
<schlecht> :
<schlecht> :/
<odinswand> i'd like to start contributing to a ruby project on github to get my skills up
<odinswand> can anyone recommend me a reasonably small project i can cut my teeth on?
<nirjhor> odinswand: diaspora :P
ctp has joined #ruby
Guest77208 has joined #ruby
<nirjhor> anyone knows how to convert this to ruby? http://dpaste.com/707582/
<canton7> nirjhor, two ways: http://pastie.org/3444823
TheTFEF has joined #ruby
<nirjhor> Afal: doesn't work. always outputs 1
Silker has joined #ruby
<canton7> Afal, you've got integer division in there, rather than floating-point
<nirjhor> canton7: thanks man :)
<Afal> yeah I suppose that needs to be changed to an integer ¬_¬
<Afal> *float
<canton7> nirjhor, turns out you don't need the .chomp in mine -- the .to_i takes care of that
<nirjhor> canton7: got it :D
<nirjhor> canton7: using chomp is a good rule of thumb\
<canton7> yeah, that's why it went in :P
rohit has joined #ruby
peterhil has joined #ruby
banister`sleep has joined #ruby
frishi has joined #ruby
nirjhor has quit [#ruby]
pu22l3r has joined #ruby
eka has joined #ruby
MrGando has joined #ruby
lewis1711 has quit ["Leaving."]
emmanuelux has joined #ruby
adambeynon has joined #ruby
mklappstuhl has joined #ruby
saimon has joined #ruby
TaTonka has joined #ruby
emocake has joined #ruby
looopy has joined #ruby
Synthead has joined #ruby
pu22l3r has joined #ruby
davidpk has joined #ruby
ecolitan has joined #ruby
virunga has joined #ruby
mklappstuhl has joined #ruby
pencilcheck has joined #ruby
pu22l3r_ has joined #ruby
nemesit has joined #ruby
IAD has joined #ruby
mklappstuhl has joined #ruby
Sailias_ has joined #ruby
kpshek has joined #ruby
BiHi has joined #ruby
randym has joined #ruby
bozhidar has joined #ruby
at5l has joined #ruby
banseljaj has joined #ruby
pu22l3r has joined #ruby
nixmaniack has joined #ruby
crankycoder has joined #ruby
vraa has joined #ruby
visof has joined #ruby
visof has joined #ruby
mklappstuhl has joined #ruby
seanstickle has joined #ruby
<banseljaj> coi lei melbi prenu
undersc0re has joined #ruby
vraa has joined #ruby
PragCypher has joined #ruby
snearch has joined #ruby
robotmay has joined #ruby
tommyvyo_ has joined #ruby
sacarlson has joined #ruby
Karmaon has joined #ruby
Nss has joined #ruby
<sacarlson> in ubuntu 11.10 seems ruby-glade2 has been depricated, so if so where might I find the equivilant to the command ruby-glade-create-template used to create a ruby template program from a glade xml file?
<seanstickle> Ruby::Tk
<seanstickle> And a lot of magic.
td123 has joined #ruby
<sacarlson> seanstickle: so ruby::tk has this conversion for glade files? I already have a glade I developed in the older ruby-glade2 I'm trying to port it into the new libs
<seanstickle> Ah, no.
flippingbits has joined #ruby
<sacarlson> bummer my new software I just finished 3 days ago was depricated before I even finished it, or will they replace ruby glade support at some point in the future?
jmampost_ has joined #ruby
nari has joined #ruby
<seanstickle> ruby-glade3 doesn't exist yet?
libertyprime has joined #ruby
<sacarlson> seanstickle: not in the ubuntu ppa they don't but maybe I should look in other places
workmad3 has joined #ruby
QaDeS has joined #ruby
enroxorz has joined #ruby
bbttxu_ has joined #ruby
rippa has joined #ruby
bluOxigen has joined #ruby
bulll has joined #ruby
bozhidar has joined #ruby
tvo has joined #ruby
<pencilcheck> anyone here know rake?
<seanstickle> Prolly.
<pen> I wonder how to construct a rule that take .o and then search the source .c in another directory with custom prefix?
bozhidar` has joined #ruby
austinbv has joined #ruby
speggey has joined #ruby
QKDLab has joined #ruby
<QKDLab> s tried to define: def each_row; self.to_a.each end
<QKDLab> but this doesn work with blocks
<QKDLab> whats wrong?
emocake has joined #ruby
drknus has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
albemuth has joined #ruby
milkpost has joined #ruby
Jay_Levitt has joined #ruby
init0 has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
<workmad3> QKDLab: def each_row(&blk); self.to_a.each(&blk); end
ryannielson has joined #ruby
rbanffy has joined #ruby
phantomfakeBNC has joined #ruby
cantbecool has joined #ruby
fayimora_ has joined #ruby
wroathe has joined #ruby
mgraham has joined #ruby
cantbecool has quit [#ruby]
<rippa> def each_row; self.to_a.each; end
glosoli has joined #ruby
<rippa> wouldn't this work the same?
<rippa> or even
<rippa> def each_row; to_a.each; end
<Tasser> rippa, don't forget the block
<rippa> Tasser: but #each usually returns enumerator
<rippa> which takes block by itself
n3m has joined #ruby
<rippa> or not
<rippa> so yeah
<rippa> still need to pass the block
shruggar has joined #ruby
ni-ka has joined #ruby
<Tasser> rippa, yep
d-snp has joined #ruby
akem has joined #ruby
akem has joined #ruby
looopy has joined #ruby
theRoUS has joined #ruby
berserkr has joined #ruby
<mklappstuhl> can anyone point me to some general implementation of a to_json method?
jamie_ has joined #ruby
udante has joined #ruby
mattonrails has joined #ruby
mady has joined #ruby
Sailias_ has joined #ruby
kf8a has joined #ruby
tomzx has joined #ruby
neunzehnprozent has joined #ruby
<pen> what's the differences between system and sh?
mady has quit [#ruby]
carlyle has joined #ruby
neunzehnprozent has quit ["Linkinus - http://linkinus.com"]
udante has joined #ruby
jgarvey has joined #ruby
niklasb has joined #ruby
viuo has joined #ruby
bbttxu_ has joined #ruby
aibo has joined #ruby
jcromartie has joined #ruby
<theRoUS> you can use #block_given? to find out if a block was passed without '&block') being listed in the method declaration. is there anyway to actually get the block *object* (i.e., Proc instance) ?
iocor has joined #ruby
asobrasil has joined #ruby
aroop has joined #ruby
Indian has joined #ruby
omry_ has joined #ruby
libertyprime has joined #ruby
nricciar has joined #ruby
rcrossan has joined #ruby
Sailias_ has joined #ruby
<Tasser> theRoUS, &block
rbanffy has joined #ruby
<rcrossan> anyone aware of online reference that can help me trouble shoot this error "NameError: undefined local variable or method `driver' for"
waxjar has joined #ruby
briankbuckley has joined #ruby
<seanstickle> Posting the code that throws that error would be a good start.
<rcrossan> one sec, I'll link it
radic has joined #ruby
enherit has joined #ruby
sonkei has joined #ruby
<jamie_> rcrossan: lines 25 & 28 should be `el = @driver...`
looopy has joined #ruby
<seanstickle> ^^
undersc0re has joined #ruby
<rcrossan> oh snap, missing the '@'
<jamie_> rcrossan, easily done!
<rcrossan> guess that figures from working all night without sleep
<rcrossan> thanks
<jamie_> no problem
o_bs has joined #ruby
ed_hz_ has joined #ruby
robotmay has joined #ruby
briankbuckley has joined #ruby
axl_ has joined #ruby
theRoUS has joined #ruby
Sliker has joined #ruby
mklappstuhl has joined #ruby
_john has joined #ruby
bglusman has joined #ruby
carlyle has joined #ruby
Jay_Levitt has joined #ruby
eeadc has joined #ruby
looopy has joined #ruby
vereteran has joined #ruby
kaichanvong has joined #ruby
MetaCosm has joined #ruby
eeadc has joined #ruby
snip_it has joined #ruby
LBRapid has joined #ruby
fr0gprince_mac has joined #ruby
mkscrg has joined #ruby
jenglish has joined #ruby
ceej has joined #ruby
snip_it has joined #ruby
Dreamer3 has joined #ruby
clockwize has joined #ruby
briankbuckley has joined #ruby
mikepack has joined #ruby
davidpk has joined #ruby
nsaeki has joined #ruby
fayimora has joined #ruby
boboxx has quit [#ruby]
spanner has joined #ruby
tangledhelix has joined #ruby
wyhaines has joined #ruby
frequency9 has joined #ruby
shruggar1 has joined #ruby
iocor has joined #ruby
punkrawkR has joined #ruby
<sacarlson> can someone point me to the continued development of ruby glade, seems it's depricated in ubuntu 11.10, if it's stoped I may do some work on it myself
<deryldoucette> i do believe that ruby-glade is no longer being worked on
lkba has joined #ruby
senthil has joined #ruby
<sacarlson> deryldoucette: well I still need the replacement for ruby-glade-create-template but renamed to the gtk2 equivilant
<deryldoucette> sacarlson: then you probably will have to do it yourself since dev has stopped
<deryldoucette> trying to think of the other one taht was stopped for windows too. FX or something like that
<sacarlson> deryldoucette: yes it's looking that way but what other tool do we have that can create gui separate from the code?
crankyco_ has joined #ruby
ni-ka has quit [#ruby]
TaTonka has joined #ruby
ckrailo has joined #ruby
<sacarlson> deryldoucette: seems the python glade is still supported so I don't think the gui delelopment has ended just the ruby binding seem missing
<deryldoucette> qtRuby, shoes, Tk, wxRuby, RubyCocoa ect. (all depends on your pltform but there are quite a few out there)
marcamilly has joined #ruby
v0n has joined #ruby
<deryldoucette> the other one i have *heard* of (and heard decent things) but never used myself, is bowline
<sacarlson> deryldoucette: qtruby I might check that, but I already have code developed on glade that I would like to port to ubuntu 11.10 and hopfully beyond
Silowyi has joined #ruby
briankbuckley has joined #ruby
<shevy> ewwww glade
<deryldoucette> ok gotta walk my rottweiler. later
virunga has joined #ruby
<sacarlson> deryldoucette: ok will do but I hate to throw away all the work I've already invested in glade just to port to something that is very much different
<deryldoucette> sacarlson: well if your upstream has stopped development, unless YOU are going to take that part over too, not much choice but TO retool
eywu has joined #ruby
vraa_ has joined #ruby
<shevy> if it's just glade being used for ...
<shevy> what do you use it for. the layout of the widgets?
<sacarlson> deryldoucette: from my view it seems glade has just moved to gtk2 so it seems all that is needed is a small rewrite to ruby-glade-create-template to change the code to the gtk2 libs
ly- has joined #ruby
jenglish has quit [#ruby]
Sliker has joined #ruby
<sacarlson> my guess is that it's already in development but I just don't know where it has gone to
sonkei has joined #ruby
nitestarr has joined #ruby
CheeToS has joined #ruby
<shevy> sacarlson, write to the mailing list
<shevy> kou will surely reply
<sacarlson> shevy: mailing list of who?
<shevy> ruby gtk bindings
geekbri has joined #ruby
blischalk has joined #ruby
<sacarlson> shevy: we have bindings for ruby gtk already it's just the glade xml file bind that I see missing
<shevy> well rubygnome2-0.19 has them still :D
mikeycgto has joined #ruby
<sacarlson> shevy: rubygnome2-0.19 is that still in ubuntu 11.10 , i'll check
<shevy> dunno if that is still in ubuntu
<sacarlson> shevy: or I need two systems to continue to develope my ruby code?
<shevy> I compiled the source
<shevy> well kinda I suppose, as development has moved away from glade already
<shevy> it is no longer part of the official tarball
macmartine has joined #ruby
<sacarlson> shevy: just bad luck on my side to decide to pick glade as a deveolpment tool not realizing it's short life
<shevy> yeah no idea, but I once looked at it, saw it required XML and decided not to use it
eldariof has joined #ruby
<shevy> sacarlson you could try a slow transition?
<sacarlson> shevy: what's wrong with xml? it's still used in many other apps?
<shevy> like, convert the XML file into a yaml file, or direct ruby code, where you give the widgets a name
<shevy> XML is overly verbose
<shevy> I dunno if it is used in other apps but I see no inherent advantage in using XML over a less verbose format
MrGando has joined #ruby
<rippa> xml looks ugly as fuck
<rippa> especially those closing tags
<shevy> I think what mistake glade did was to rely on only one format to express something
<shevy> because drag-and-drop GUI design is not bad in itself
nixmaniack has joined #ruby
<sacarlson> shevy: I really don't care what format they put the gui design in as long as the graphics is designed in a wysywig format you can see before you write any code
<shevy> yeah that is understandable
notjohn has joined #ruby
<sacarlson> shevy: and later change the apperance without any change or little change to the code
nixmaniack has joined #ruby
eugynon has joined #ruby
<sacarlson> shevy: makes it posible to port to mobile and other devices with no change in ruby code
<shevy> well
Sliker has joined #ruby
<shevy> you can do the same by clever layout in your ruby code too without glade
<sacarlson> shevy: well that sounds like a longer learning curve that I hope to skip
skitrees has joined #ruby
<shevy> hehe
kaneda_ has joined #ruby
theRoUS has joined #ruby
Nss has joined #ruby
<sacarlson> my plan it to attempt to manualy convert from libglade to gtk2 and if that works I'll see what's needed to change ruby-glade-create-template to work in gtk2, I just hope I'm not working on something some is already doing
ed_hz_ has joined #ruby
emocake has joined #ruby
abstrusenick has joined #ruby
shobhitg has joined #ruby
JohnBat26 has joined #ruby
gianlucadv has joined #ruby
qawsedrf has joined #ruby
<qawsedrf> hello, what is this all about - http://blog.steveklabnik.com/posts/2012-02-23-rest-is-over ?
coreydaley has joined #ruby
MasterIdler has joined #ruby
skitrees has joined #ruby
Seisatsu has joined #ruby
<shevy> what should it be about
<shevy> it's one blog post in a sea of 100000000000000000 others
patrick99e99 has joined #ruby
patronus has joined #ruby
<robacarp> shevy: you don't read all the internet?
alex__c2022 has joined #ruby
<qawsedrf> shevy: LOL
<shevy> robacarp nah
<shevy> I think there is only one blog I read regularly which is kinda a political satire & news feed in one
kenperkins has joined #ruby
<shevy> too much noise in the other :(
<shevy> though I do look at reddit if there are cool things
<shevy> but 95% is boring too
<robacarp> news.ycombinator?
samsonjs_ has joined #ruby
<robacarp> I cant stand reddit much anymore
rtl has joined #ruby
cantbecool has joined #ruby
cantbecool has quit [#ruby]
caiges has joined #ruby
<qawsedrf> reddit sucks. they need to die so that more and more people end up wasiting less and less time
burgestrand has joined #ruby
<shevy> heheeh
Sliker has joined #ruby
|--| has joined #ruby
_srp has joined #ruby
davidpk has joined #ruby
|--| has joined #ruby
sonkei has joined #ruby
JohnBat26 has joined #ruby
CharlieSu has joined #ruby
adamjleonard has joined #ruby
<CharlieSu> question. I've created my own class and I'd like to know how to create two instances of the class and test whether or not they're the same.. Do I need to override a function to enable this? Currently I can create to instances w/ all the same attributes and they aren't equivalent.
Drewch has joined #ruby
theRoUS has joined #ruby
<elektronaut> charliesu: you can override ==
kp666 has joined #ruby
<CharlieSu> elektronaut: do you have any examples of this?
hukl_ has joined #ruby
adambeynon has joined #ruby
wilmoore has joined #ruby
mxweas_ has joined #ruby
<elektronaut> charliesu: something like this? https://gist.github.com/1901999
Norrin has joined #ruby
<elektronaut> err, an error there. i edited it
ascarter has joined #ruby
akemrir has joined #ruby
francisfish has joined #ruby
techhelp has joined #ruby
`brendan has joined #ruby
techhelp has joined #ruby
techhelp has quit [#ruby]
banseljaj has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
iocor has joined #ruby
munx_ has joined #ruby
<CharlieSu> elektronaut: thanks bud.. turns out the contents of the method are this simple for my purposes.. ' self.instance_values == compare.instance_values '
<elektronaut> that should do the trick
eldariof has joined #ruby
davidcelis has joined #ruby
<shevy> guys
<shevy> would it be better to modify any instance variable only via a method call?
Targen has joined #ruby
<robacarp> it depends on how critical to the operation of the space shuttle the variable is
<canton7> presumably you're talking from inside the class containg the instance variable? Depends... I've seen some bad side-effects with people using the variable's accessor to access the variable from inside the class. Unintended consequences etc
<shevy> robacarp, well I mean in general. I often have a need to check whether an @ivar has proper values, because other parts of the code depend on those variables having sane values
wyhaines has joined #ruby
<robacarp> shevy: yea, in that case, I'd have a setter
<shevy> via attr_* ? or do you use your own setter
glosoli has joined #ruby
<robacarp> for me, if its something like a switch/magic number setting to instruct the class what to do I make a restricted accessor that raises an ArgumentError when it gets a bad value
bashdy has joined #ruby
<robacarp> if its something that allows the class to interface with an outside object (a login name or password, for example) I just use a standard accessor
glosoli has joined #ruby
<robacarp> I've also used read-only accessors where possible.
<robacarp> the thing is, if someone is using your class and they want to screw with things they can just subclass it and override whatever they want....but at that point its their fault when it breaks
<shevy> well read-only is a lot easier to me
<shevy> because the dataset of the @ivar in question is most likely already sanitized and proper
glosoli has joined #ruby
<shevy> I am just wondering in general. I see a lot of ruby code that goes like this:
<shevy> def initialize
<shevy> # a bazillion of @foo = bla, here
Sliker has joined #ruby
<shevy> I find there is this slight tendency in some objects to become more and more complicated
<shevy> like the one I am trying to rewrite right now!
kjellski has joined #ruby
tridentino has joined #ruby
looopy has joined #ruby
<robacarp> yea
hosiawak has quit ["ERC Version 5.3 (IRC client for Emacs)"]
adeponte has joined #ruby
jgrevich has joined #ruby
pi3r has joined #ruby
DefV has joined #ruby
briankbuckley has joined #ruby
nixmaniack has joined #ruby
glosoli has joined #ruby
mklappstuhl has joined #ruby
<ckrailo> anybody know how to get hpricot not to turn accented characters into escaped HTML entities?
<ckrailo> (or how to reverse the process)
eignerchris has joined #ruby
stephenjudkins has joined #ruby
Marco has joined #ruby
ericmuyser|air has joined #ruby
maletor has joined #ruby
iocor has joined #ruby
themadcanudist has joined #ruby
carlyle has joined #ruby
cbuxton has joined #ruby
jwmann has joined #ruby
<themadcanudist> hey guys… if i hash.to_s can I read that string representation back in to a hash?
_obiJuan has joined #ruby
banseljaj has joined #ruby
<Muz> Not reliably, no.
BlissOfBeing has joined #ruby
<themadcanudist> Muz: really?!
nanderoo has joined #ruby
<themadcanudist> why can it only reliably map one way?
samsonjs_ has joined #ruby
<Muz> Have you /looked/ at the output of the function?
bluenemo_ has joined #ruby
<shevy> themadcanudist .to_s distorts the data in this example
<shevy> you lost the information key => value
<shevy> and there is no additional information stored in the string to restore the original dataset. unless you had some simple convention in your hash, or know how it used to be
<jlebrech> i'm serialising my array wrong https://gist.github.com/1901940 any ideas?
<themadcanudist> oh, you know what… i'm not using to_s… this class outputs the object as a hash with key/value pairs
<themadcanudist> when i call the to_s method in it
<shevy> jlebrech what do you mean? you store the hash in an array here
<shevy> if you dont need the array, dont store it in an array
<themadcanudist> it's different than a straing Hash object using the to_s method.
<themadcanudist> straight*
Nss has joined #ruby
csprite has joined #ruby
<rcrossan> errror: Selenium::WebDriver::Error::NoSuchElementError: Unable to find element with link text - my code is here git clone git://gist.github.com/1902204.git gist-1902204. I am thinking there is something wrong with line 25 to execute a jquery to open my menu even though I'm not getting an error for that line, it doesn't appear to be working.
<themadcanudist> thanks
<jlebrech> but the json it's returning [{"a":1,b ... json values not objects
<shevy> hmm
ephemerian has joined #ruby
mxweas_ has joined #ruby
<shevy> I dont know json very well, no idea how json stores objects
adamkittelson has joined #ruby
cloke_ has joined #ruby
cloke has joined #ruby
<eugynon> Hi folks, i am learning ruby and im new to programming. I have a problem with a craps simulator. right after first roll, if it hits "point" it continues to roll. http://pastie.org/3448048 Anyone got a good solution? :)
apok has joined #ruby
gakins has joined #ruby
_srp has joined #ruby
glosoli has joined #ruby
MrGando has joined #ruby
<shevy> eugynon a few things
<gakins> Looking to understand "self" better... I've found a few blogs, stackoverflow posts.. still a bit unclear so I'm trying some things out in IRB. Anyone have any particularly good articles on using "self"?
<shevy> when you have a case structure, align the when right below case
<shevy> example:
<shevy> case foo
<shevy> when 'bla'
<shevy> ok eugynon?
<jlebrech> i got my arrays and hashes the wrong way round
<jlebrech> :)
<eugynon> here is the problem http://pastie.org/3448074 btw
<shevy> he dont listen :(
<eugynon> shevy, do you mind me ask why? i feel its easier to read that way ... heh
<shevy> yes
<shevy> because you have one "end" to close the "case"
<shevy> and if you look at the else there, it looks as if you mis-align
<shevy> the author is chris2 btw he tends to be on #ruby-lang
_srp has joined #ruby
<shevy> next thing:
<eugynon> okey, ill look it up. thanks for sharing
<shevy> I think you use too many variables
mklappstuhl has joined #ruby
<shevy> point = firstRoll
<shevy> puts "Your point is " + point.to_s
<cek> ROB
glosoli has joined #ruby
<shevy> it is better to use as few variables as possible, unless you have a clear need for them
ericmuyser|air has joined #ruby
<eugynon> shevy, yeah i guess thats true. Learning C at school these days, and in the evening i try to learn ruby ... hard stuff ;)
<shevy> also, I would not recommend to put a case/when structure into a loop
ReachingFarr has quit [#ruby]
<shevy> what I would do is (a) make a loop (b) handle the input via a method
<shevy> use methods to "componentize" your code into logical (sub)groups
daniel_hinojosa has joined #ruby
<shevy> eugynon I can see that but in C it is often better to also use very small functions
<shevy> that do one thing (ideally only one thing, or as little as possible) very well
<eugynon> yeah, i guess that code (and i hope it) could be written easier than i have
<shevy> I'd also use another way to name your methods
<eugynon> i do think i make thinks much more complex than they need to be
<shevy> rather than "def rollDice" I would use "def roll_dice"
<cek> when you use a class variable, you kill a child in Africa
<shevy> yeah
<eugynon> hehe
<cek> not funny
SegFaultAX|work has joined #ruby
_srp has joined #ruby
<eugynon> naming variables - thats a matter of taste, eh?
<shevy> eugynon also
<shevy> case rollDice
<eugynon> mhm
<shevy> ^^^ what is your intention here?
<shevy> eugynon you can name things how you want to, ruby does not care
<shevy> but when you ask others to look at things, try to have beautiful code ;)
<shevy> it's good to have to explain code
<eugynon> aye, thats true. heh
<eugynon> ill write that down :)
<shevy> can you explain your intention in "case rollDice"?
<seanstickle> eugynon: 2 things are hard in computer science: cache invalidation, and naming things.
hooper has joined #ruby
<eugynon> well, it is supposed to break if you hit point or 7....
<eugynon> thats all i can tell about it
<eugynon> :/
<shevy> yeah I guess so
<shevy> it's a bit confusing
<shevy> You rolled: 7
<shevy> You lose
<shevy> but indeed
<shevy> it exited when it had 7
<eugynon> how would you write that code, if you care to show?
<shevy> wait
<shevy> before we can do that
veronatii has joined #ruby
<shevy> we first must question "point" variable
<shevy> in your code you do:
<shevy> when point
<shevy> are you sure that point exists?
<eugynon> yeah, after first roll... sec ill place a puts inside there
<eugynon> nm it puts that after declearing point
<eugynon> firstRoll rules
<shevy> but
<shevy> point is only defined in the else clause
<shevy> how can it exist outside the else clause?
<eugynon> hmm
Ripp__ has joined #ruby
<shevy> the answer is - it does not, because your code did not
<shevy> yet, further below, you use it:
<shevy> case rollDice
<shevy> when point
<shevy> before you think of a rewrite it is best to make sure the current code is correct
skitrees has joined #ruby
<eugynon> so i cant use point outside case firstRoll?
vraa has joined #ruby
aroop has joined #ruby
nonotza has joined #ruby
shadoi has joined #ruby
d34th4ck3r has joined #ruby
<shevy> eugynon, this is the first rewrite http://pastie.org/3448257
<shevy> you could, if you defined it outside
<eugynon> well, when i puts point inside while keepRoll it gives me my point....
<eugynon> ill take a look
rushed has joined #ruby
<eugynon> okey, thats pretty nice
adamjleonar has joined #ruby
seitensei has joined #ruby
<shevy> eugynon ah yeah
<eugynon> :D
<shevy> you exit in all the cases where point is not defined
<d34th4ck3r> is this page: http://rubysoc.org/index, up to date?
<shevy> but I hate your code eugynon ;)
<canton7> You're got two methods called roll_dir in there?
<eugynon> that im pretty sure of... lols
<canton7> *You've
<shevy> "The Ruby Summer of Code program is designed to help fund student development of Ruby and/or Rails projects in the summer of 2010."
<canton7> *roll_die, ack typing fail
<shevy> d34th4ck3r, guess it is two years old
havenn has joined #ruby
<shevy> canton7 oh true
<shevy> the second is copy pasted
<d34th4ck3r> shevy: where I know about rubysoc to be held this year?
<shevy> canton7, shows you how much I tried to think :) I edited now http://pastie.org/3448257
<eugynon> shevy, i feel your code is .. abit more OO than mine
<shevy> d34th4ck3r sorry no idea
<shevy> eugynon yeah but you can use methods alone too
<shevy> I like classes because you can use them lateron
<d34th4ck3r> anyone else, where can I learn about rubysoc ?
<shevy> if you only have methods you dont have a real structure. you can put them into modules, but I think modules are crippled classes
hadees has joined #ruby
<eugynon> shevy, my code looks more like a perl script ... or, a very bad one ... heh.
ph^ has joined #ruby
<robacarp> anyone written C extensions for ruby on OSX Lion? I'm getting architecture compatibility errors...I think its because of rvm and the system ruby being 1.8...
<shevy> eugynon as long as things work
<eugynon> shevy, well, i thought so when i wrote it - but i see i have a long way to go
<shevy> the only real way to get better at ruby is to write code on your own
shaatar has joined #ruby
<shevy> well make simple transitions
tvo has joined #ruby
tvo has joined #ruby
skitrees has joined #ruby
<shevy> small methods when possible. align methods together into a module or a class (class is easier)
<eugynon> aye, this is my second code, so not a pro yet ;)
<shevy> that code can be simplified too
<eugynon> i tried to write a class at first, but i felt it was "too much"
samsonjs has joined #ruby
<shevy> eugynon my own code often confuses me
<canton7> there's a lot to be said for not diving straight into OOP. There's a good discussion and a few links at http://www.reddit.com/r/programming/comments/q2q1g/dont_distract_new_programmers_with_oop/
SeanTAllen has joined #ruby
<shevy> eugynon, I am rewriting this class http://pastie.org/3448318 right now. I hate it. it is way too complicated and I already rewrote it twice :(
<eugynon> aha, so maybe i should stick to C for now, while we are learning it at school .. heh
BrianE has joined #ruby
<canton7> C is good, in that it makes you realise why, and more importantly when, you need objects
<shevy> "def sanitize_dataset" goes especially on my nerves
<shevy> it's a good example how NOT to write a method too ;)
Russell^^ has joined #ruby
<shevy> 100 lines of code!
<canton7> that's very enterprisy code :P
<shevy> what the class is trying to do, basically, is to sanitize an incomplete dataset
<shevy> for instance, @use_autogen whether to use system "autogen" or not
nfluxx has joined #ruby
drizz has joined #ruby
<shevy> and it should be either true or false
kaktus has joined #ruby
<canton7> def url5; @remote_urls[4]; end -- ouch
<shevy> @build_static whether to build static or not
<shevy> yeah, I think that is dead code
<shadoi> shevy: that could do with some class composition, a configuration class for example
andrewhl has joined #ruby
msch has joined #ruby
<shadoi> half that class is setting up it's state
<shevy> yeah it's kinda the only thing it does
<shevy> or should do
<shevy> I have high hopes in my rewrite though :P
shobhitg has joined #ruby
<shadoi> You may be able to break up the types of configurations into separate classes as well, things that don't need to change aside from behaving a certain way.
Muz has joined #ruby
Muz has joined #ruby
shobhitg has joined #ruby
<canton7> there seems to be an awful lot of duplication between @dataset and, well, everything else, though I might be missing something
<shevy> yeah
<shevy> I think I wanted to have the same information in both every key of @dataset, and also the instance-variables back then
<shevy> :\
sawjig has joined #ruby
<eugynon> shevy, this is what i get when i run your code pastie-3448257.rb:19: stack level too deep (SystemStackError) ... im using ruby 1.9.2 if that matters
<shevy> eugynon hehe
hukl has joined #ruby
<eugynon> :)
<shevy> you use that version http://pastie.org/3448257 ?
<shevy> or the old one with two times the same method
<eugynon> lemme double check that mate
havenn_ has joined #ruby
<eugynon> aye, its the new one
tuxaddicted has joined #ruby
clockwize has joined #ruby
<eugynon> but it was nice to read, at least :P
<eugynon> i guess ill stick to C and learn more about programming basics... Althou i think ruby was more fun to write
<shevy> odd
ascarter has joined #ruby
<shevy> oh yeah
<shevy> I am dumb
themadcanudist has quit [#ruby]
<shadoi> eugynon: that's certainly learning the hard way. :)
<shevy> sticking to C is good
<shevy> I did ruby first and could not find the motivation to properly learn C
<robacarp> eugynon: hmm... learning the basics in C...well, okay
danishkhan has joined #ruby
FreschFN has joined #ruby
<eugynon> robacarp, we are learning programming basics at my school.... deitels book on C is the literature..
clockwize has joined #ruby
<eugynon> thanks shadoi :)
wallerdev has joined #ruby
<robacarp> eugynon: oh, well thats another story.
<robacarp> you'll do fine
<geekbri> It's certainly always worth reading Ritchie's book on C if you want to learn it :)
<shadoi> That's definitely not targeted at beginners though.
<robacarp> yea, no
<Drewch> Is ruby worth diving into for network programming?
munx has joined #ruby
<deryldoucette> err? its the definitive book on C and ANSI C book (white bible) walks you through everything clean and clear
<Drewch> I'm the opposite, a C programmer
<deryldoucette> *I* taught myself pretty well using it
iocor has joined #ruby
<deryldoucette> (and I consider myself a pretty hard-to-teach-egghead)
<shevy> Drewch ruby is cool for pretty much everything
shruggar has joined #ruby
Araxia has joined #ruby
<eugynon> cheers deryldoucette hehe
<seanstickle> Deitel's books should be avoided always.
<geekbri> Drewch: I've written some pretty robust network recievers in ruby. It was enjoyable... would do again :)
<eugynon> that book is pretty well explained
<Drewch> How is ruby's libraries?
<deryldoucette> the deitel books all just seem to way overly complicate things in an effort to make them easier to understand.
<deryldoucette> big fail to me
<seanstickle> Condescending crap books.
<Drewch> I know a bit of python and like using Scapy.. do you guys know what Scapy is? It's basically allows you to create and send out raw packets
<Drewch> I'm wondering what Ruby has to offer in that area
<shadoi> Drewch: look into PacketFu on ruby for similar functionality.
kapowaz has joined #ruby
<shadoi> I use it for a number of UDP and TCP based services.
<shadoi> As well as ZeroMQ
Divinite has joined #ruby
<geekbri> Well zeromq isn't ruby specific, you can use that with any language that has a binding
<shadoi> Drewch: there's some nice bleeding edge stuff by @bascule called Celluloid and DCell also.
Helius has joined #ruby
<shadoi> geekbri: sort of like TCP and UDP ;)
<Drewch> Thanks shadoi, gonna look into it now for a bit
shadoi1 has joined #ruby
simao has joined #ruby
<Drewch> basically I want to get really into either ruby or python, and right now I use scapy a lot for sending malformed packets to mobile devices to crash them
<shadoi> anyway, nio4r which Celluloid-IO is built on is a non-blocking IO native lib which looks very promising.
<Drewch> but stuff like SiriProxy is written in Ruby, so I want to move over but I want to make something like scapy
<Divinite> Drewch: How would that work?
<eugynon> shevy, here is my first ruby code ... http://pastie.org/3448584 lolz
<Divinite> *crashing mobile devices
<robacarp> Drewch: in the last year ruby has really come of age in terms of threading and networking
<eugynon> shevy, just wanted to share more of my nice code :D
<Drewch> Divinite through code inspection, I work for a major mobile phone company
<robacarp> I think you'd probably enjoy ruby networking
Pallium has joined #ruby
gianlucadv has joined #ruby
<Divinite> Drewch: Nice! Now that you mention it..
<robacarp> but I consider myself a ruby fan...so...I'm sorta biased
<shadoi> Drewch: most pythonistas I know think Ruby is too insane.
<shadoi> I find python too terse and limiting most of the time.
<Drewch> Divinite: and I check out the path packets take through the firmware, and when I see some code where someone messed up size of something or a check, I try to make a packet to take that path
<Drewch> Divinite: and you'd be shocked at what you can do :P
<Divinite> Drewch: I'm only 15! And of course a proud (newbie) rubiest!
minijupe has joined #ruby
senthil has joined #ruby
shruggar has joined #ruby
voodoofish430 has joined #ruby
<Drewch> Divinite: hehe, a good age to get into network programming, stick with it
cbuxton has joined #ruby
<Divinite> Drewch: I will :)
sizz_ has joined #ruby
simao has joined #ruby
<Drewch> shadoi: thanks for the resources, all look pretty cool
ReTFEF has joined #ruby
<Drewch> shadoi: They seem pretty high level though, would I be able to rewrite the datalink layer info in the packets?
apucacao has joined #ruby
<Drewch> shadoi: I basically need to send out a completely raw packet, skip my stack completely
xkws49er has joined #ruby
<xkws49er> If I have a one to many and I have s = School.last and s.children returns a collection... How do I get the last child in the collection... "the right way"
Marco has joined #ruby
nixmaniack has joined #ruby
<Divinite> xkws49er: Wait your turn!
<Drewch> Divinite: Good, let me know if you have any questions on it :)
Marco_ has joined #ruby
jduncan has joined #ruby
vraa_ has joined #ruby
PragCypher has joined #ruby
Marco has joined #ruby
simao has joined #ruby
<jduncan> how can I find the easiest way to tie a changeset to a versioned release? eg. what version of ruby incorporates changeset r28203?
rramsden has joined #ruby
simao has joined #ruby
Marco_ has joined #ruby
ryanf has joined #ruby
mengu_ has joined #ruby
<Divinite> Ok, I have to go download some stuff, may go offline!
KL-7 has joined #ruby
<jduncan> anyone?
<jduncan> how can I find the easiest way to tie a changeset to a versioned release? eg. what version of ruby incorporates changeset r28203?
shruggar has joined #ruby
<robacarp> Divinite: you say yo uwork for a mobile phone company? I know several people that work at those types of places here in boulder
mrsolo has joined #ruby
quizme has joined #ruby
Sliker has joined #ruby
hasrb has joined #ruby
<quizme> is there a way to create anonymous functions that don't leak in values from the scope in which it was created?
clockwize has joined #ruby
viuo has joined #ruby
fridim_ has joined #ruby
Divinite has joined #ruby
<quizme> e.g.: a = 42; ->(){ puts a }[] NameError: undefined local variable or method `a' for main:Object
<Divinite> Back, can someone point me to "why the lucky stiff"'s soundtrack?
n3m has joined #ruby
<Drewch> robacarp where is boulder?
<robacarp> Drewch: eh, Colorado, USA?
<quizme> module X; ->{ puts a }[]; end <-- i guess you could do something like this
<Drewch> robacarp oh ok, I work on Ontario
<deryldoucette> Drewch: anywhere near Port Elgin, ON?
jduncan has quit ["Backing away quietly"]
sizz has joined #ruby
<Drewch> deryldoucette close enough i guess
<Drewch> lol
<Divinite> Drewch: Can you point me to it?
<Drewch> Divinite point you to what
<Divinite> Drewch: Why the lucky stiff ruby soundtracks.
<deryldoucette> Drewch: its where i'm at. seems i'm like the only ruby guy in town hehe
<Drewch> deryldoucette hehe nice
themadcanudist has joined #ruby
tavist0 has joined #ruby
glosoli has joined #ruby
ryanf has joined #ruby
werdnativ has joined #ruby
shadoi has joined #ruby
stephenjudkins has joined #ruby
idletom has joined #ruby
cgk_ has joined #ruby
<cgk_> Is there a way to have a variable pre-defined and available to an irb command-line?
<cgk_> So that it is defined to whatever the scope is that irb is in once you are at the irb prompt?
trivol has joined #ruby
badabim has joined #ruby
<RubyPanther> cgk_: probably but normally you would provide something like that as a method that returns your value, then you can just mix it in
<RubyPanther> cgk_: you can add an ~/.irbrc
<cgk_> That's fine, but then how would you automatically mix-in to irb's scope without having the user run/require/Include?
fayimora has joined #ruby
<cgk_> I guess just throw a require+Include into the .irbrc?
<cgk_> (trying it now)
<RubyPanther> cgk_: yeah the .irbrc is in Ruby
kjellski has joined #ruby
<RubyPanther> I use it for Wirble.init :init_colors => true
<cgk_> Ah yes, this works thank you
Divinite has joined #ruby
Drewch has quit ["[Textual IRC Client: http://www.textualapp.com/]"]
Drewch has joined #ruby
burgestrand has joined #ruby
mikeric has joined #ruby
havenn has joined #ruby
nobitanobi1 has joined #ruby
<nobitanobi1> Hi there. Is there any clean way to iterate over a collection with 'each' but avoid taking into account the last element?
Mac_ has joined #ruby
<nobitanobi1> so iterate over all the elements, except the last one
Drewch has quit ["[Textual IRC Client: http://www.textualapp.com/]"]
Drewch has joined #ruby
kirun has joined #ruby
workmad3 has joined #ruby
ph^ has joined #ruby
kidoz has joined #ruby
clockwize has joined #ruby
jacktrik has joined #ruby
pdtpatr1ck has joined #ruby
PragCypher has joined #ruby
al3xnull has joined #ruby
themadcanudist has quit [#ruby]
<Mon_Ouie> Maybe not that clean, but inject { |cur, prev| yield prev; cur }
<rippa> Mon_Ouie: that ignores first
<rippa> not last
<rippa> inject { |cur, prev| yield cur; prev }
robbyoconnor has joined #ruby
wilmoore has joined #ruby
robbyoconnor has joined #ruby
<nobitanobi1> rippa thanks
<nobitanobi1> when I do this a=b in ruby, if I do any changes to a, they will be reflected in b too right?
<Mon_Ouie> Oh, should rather be |prev, cur| then
<Mon_Ouie> Yes, because they are both variables referring to the same object
<nobitanobi1> so, how can I avoid that?
<nobitanobi1> create a new object for a
<Mon_Ouie> You copy b
<Mon_Ouie> e.g. using dup
<rippa> unless it's an immediate
<Mon_Ouie> Or use method that don't modify a
<nobitanobi1> dup
<nobitanobi1> let's see
<rippa> b = 2; a = b.dup #=> TypeError
<Mon_Ouie> (I mean non-destructive method, like #reject instead of #reject!)
<Mon_Ouie> But b is immutable anyway
<burgestrand> rippa: immediates are immutable anyway
<Mon_Ouie> So you don't risk modifying it
<burgestrand> ^
<burgestrand> makes no sense to try and dup it
<Mon_Ouie> Well, technically they have ivars — but hopefully nobody uses them
<rippa> what if your code does not know type of passed object?
<rippa> dup and rescue?
<burgestrand> this is ruby, what do you mean?
n3m has joined #ruby
<Mon_Ouie> Then it probably knows it won't modify them
<rippa> makes sense
shobhitg has joined #ruby
nachox has joined #ruby
shobhitg1 has joined #ruby
<nachox> i think i hit https://github.com/rack/rack/issues/291 using ubuntu 10.04.4, is there a workaround?
Jake232 has joined #ruby
baroquebobcat has joined #ruby
enroxorz has quit [#ruby]
briankbuckley has joined #ruby
nemesit has joined #ruby
CoverSlide has joined #ruby
statix has joined #ruby
adman65 has joined #ruby
adman65 has joined #ruby
lkba has joined #ruby
hukl has joined #ruby
jacktrik has joined #ruby
nemesit has joined #ruby
hukl_ has joined #ruby
Marco has joined #ruby
shruggar has joined #ruby
nedbat has joined #ruby
hukl_ has joined #ruby
ghanima has joined #ruby
d34th4ck3r has joined #ruby
PragCypher has joined #ruby
Indian_ has joined #ruby
banseljaj has joined #ruby
rcj_ has joined #ruby
bwlang has joined #ruby
caveat- has joined #ruby
headius has joined #ruby
veronatii has joined #ruby
axl_ has joined #ruby
leonid[sunp]_ has joined #ruby
leonid[sunp]_ has quit [#ruby]
mattonrails has joined #ruby
kuranai has joined #ruby
davidpk has joined #ruby
Redjack1964 has joined #ruby
theRoUS has joined #ruby
caveat- has joined #ruby
<Redjack1964> hello everyone. Someone can tell me what is the difference between a public instance method and a public class method?
ascarter has joined #ruby
<burgestrand> Redjack1964: public class methods are also public instance methods, but a public instance method is not necessarily a public class method *adds to the confusion*
<burgestrand> Give me a minute :)
berkes has joined #ruby
<burgestrand> Redjack1964: http://codepad.org/IJQRaP0n
<Redjack1964> burgestrand: actually i ask that because i've seen on the ruby-doc website in "core" section on the left there is instance methods and class methods (which begin by "#" and instance methods by " :: " )
yoklov has joined #ruby
<burgestrand> Redjack1964: yeah, my code example is applicable then :)
<tdmackey> w/din 32
<burgestrand> Redjack1964: also, you use #instance_method and .class_method in language, sometimes ::class_method but it’s not too common anymore
<Redjack1964> burgestrand: ah ! I think i understand now :) . It's looks like to "static method" in java or C++ for example, i'm right?
<burgestrand> the reason for that is probably many people discourage you from using Class::class_method call style as opposed to Class.class_method call style, because :: is often called "constant lookup"
<burgestrand> Redjack1964: it looks like one yes, but it’s not the same thing
<burgestrand> Redjack1964: it often helps to think of it as one when starting out though, so you’re not wrong :)
linopolus has joined #ruby
axl_ has joined #ruby
dexcs has joined #ruby
<Redjack1964> burgestrand: thank you for your answer :)
Seisatsu has joined #ruby
bwlang has joined #ruby
hsimon has joined #ruby
TaTonka has joined #ruby
Marco has joined #ruby
_|christian|_ has joined #ruby
TaTonka has joined #ruby
bwlang_ has joined #ruby
ddv has joined #ruby
dexcs has joined #ruby
<Mon_Ouie> burgestrand: For the record, he was referring to instance methods when he mentioned static methods
<burgestrand> Mon_Ouie: ._.
tavist0 has quit [#ruby]
<Mon_Ouie> (he was answered on #ruby.fr afterwards)
Azure has joined #ruby
rickmasta has joined #ruby
Marco has joined #ruby
Redjack1964_ has joined #ruby
luckyruby has joined #ruby
Redjack1964_ has joined #ruby
Redjack1964_ has joined #ruby
bwlang_ has joined #ruby
tinhead has joined #ruby
saimon has joined #ruby
Nss has joined #ruby
setient has joined #ruby
workmad3 has joined #ruby
csmrfx has joined #ruby
<tinhead> I can find current namespace in rake using the construct specified here http://stackoverflow.com/questions/8399868/how-do-i-get-the-current-namespace-in-rake, but this information is not available within a task. Is there a way to get the namespace nesting within a rake task?
<csmrfx> Hay 8)
h4mz1d has joined #ruby
<csmrfx> What ever happened to that statically typed ruby for the jvm?
denom has joined #ruby
<tinhead> csmrfx: http://www.mirah.org/
<csmrfx> hey tinhead
stephans has joined #ruby
apeiros_ has joined #ruby
LBRapid has joined #ruby
aim-On has joined #ruby
trivol has joined #ruby
PragCypher has joined #ruby
ryannielson has quit [#ruby]
<csmrfx> what's next, somebody writes a static ruby compiler for OCaml or something!
sand1 has joined #ruby
<werdnativ> is there a standard method to get a file in a set of load paths? (My own paths, not $: )
fayimora has joined #ruby
<csmrfx> environ "PATH"?
<csmrfx> heh, I mean, you mean the PATH variable or equivalent of your environment?
sungji has joined #ruby
<gate> werdnativ: Dir.glob(['/usr/bin/*', '/usr/local/bin/*'])
<werdnativ> yeah! thanks gate.
<werdnativ> I was also looking at stdlib Find
<gate> Hm, i've never used that one. Looks like it would be pretty useful, though
rtl has joined #ruby
<gate> for my purposes Dir.glob has always been sufficient
twqla has joined #ruby
doomviking has joined #ruby
sterNiX has joined #ruby
workmad3 has joined #ruby
sterNiX has joined #ruby
<shevy> same here
CannedCorn has joined #ruby
pu22l3r has joined #ruby
bwlang_ has joined #ruby
sand- has joined #ruby
stephenjudkins has joined #ruby
Silker has joined #ruby
axl_ has joined #ruby
imami has joined #ruby
Nisstyre has joined #ruby
havenn has joined #ruby
sand1 has joined #ruby
milkpost has joined #ruby
Indian_ has joined #ruby
moshee has joined #ruby
sandpy has joined #ruby
techhelp has joined #ruby
banister`sleep has joined #ruby
chimkan has joined #ruby
<techhelp> what's the difference between "def abc" vs "def self.abc" inside a class file?
<gate> techhelp: one defines an "instance method" the other defines a "class method"
<gate> so the first would be MyClass.new.abc
<shevy> techhelp in the second case, you can do Foo.abc
<gate> the second would be MyClass.abc
<shevy> it reads shorter
<techhelp> thanks guys, you're the best
<shevy> so people tend to like it
conor_ireland has joined #ruby
<shevy> rails is full of that
<gate> But also means that you can't use instance state
<techhelp> "def self.abc" is like static method in java?
<gate> -_^ I have done my best to lose all my Java skills, but I think so, yes
lastk has joined #ruby
tweeKula has joined #ruby
eywu has joined #ruby
techhelp has quit [#ruby]
<shevy> hehehe
<shevy> need to keep such quotes in mind
<shevy> "I have done my best to lose all my Java skills"
ph^ has joined #ruby
techhelp has joined #ruby
visof has joined #ruby
<gate> Every time I have used Java outside of college its been torture
xkws49er has joined #ruby
<gate> Oh, i'll just use a regexp.. nope... I'll just use a reduce... damnit....
hadees has joined #ruby
markstewie has joined #ruby
gomix has joined #ruby
banister`sleep has joined #ruby
bwlang has joined #ruby
zxiest has joined #ruby
banister`sleep has joined #ruby
Seisatsu has joined #ruby
havenn has joined #ruby
<csprite> anyone got ruby-opengl working with ruby 1.9.3 on linux
<shevy> hmm
<shevy> I may have to learn java for work eventually. I'll try to use the smallest minimum subset of java that is possible
startling has joined #ruby
<gomix> jenkins or cruisecontrol.rb (or cruisesontrol) ?
<gomix> for ci job for rails devel?
liluo has joined #ruby
<deryldoucette> travis-ci.org
<deryldoucette> hooks right into github too
<deryldoucette> or jenkins if you want standalone at home on your own network type setup
glosoli has joined #ruby
fayimora_ has joined #ruby
ph^ has joined #ruby
narshlob has joined #ruby
<gomix> deryldoucette: thanks
<deryldoucette> np
<narshlob> can anyone explain what putting an instance of Matrix next to a [0,0] array does? ex: (Matrix[ [1,1], [1,0] ]**(8)) [0,0]
<gate> shevy: I'll adjust my statment for you. Java is not a bad language. Its libraries, community, lack of conventions, molasas-slow editors, glacial server environments and the fact that it eats memory like a 400 Lb. man who just gave up weight watchers make it effing horrendous to work with.
hukl has joined #ruby
<deryldoucette> in fact i have to set up a few jenkins nodes myself
<deryldoucette> once i finish updating the autoinstaller for this project
<shevy> hehe
<heftig> narshlob: x[3,4] calls x.[](3,4)
<heftig> it's a method named []
<narshlob> ohhhhhhh
<narshlob> ok.
pedahzur has joined #ruby
<pedahzur> Ruby newbie here...I'm trying to build a gem with rake, and getting this: rake aborted! no such file to load -- hoe What package/gem am I missing?
<deryldoucette> hoe
<hooper> language..
bwlang has joined #ruby
iMe has joined #ruby
friskd has joined #ruby
<workmad3> hooper: a hoe is a farming implement...
<deryldoucette> as well as a gem
<workmad3> yeah... not to be mistaken with a ho ;)
shobhitg has joined #ruby
<deryldoucette> lol
avoit has joined #ruby
<aces1up> i am running YAML:load on this yaml_dump_string: --- |\nmytest\r\n\n when it loads it into my string its stripping
<avoit> Guys, I don't find the method to extract only last 10 items from an array
<aces1up> \r\n , how can i stop this behavior?
<aces1up> i am running YAML:load on this yaml_dump_string: --- |\nmytest\r\n\n when it loads it into my string its stripping \r\n from string, how can i stop this behavior... posted again as last was wrong.
<workmad3> avoit: ary[-10..-1]
alek_b has joined #ruby
<avoit> Thanks workmad3
<workmad3> avoit: or ary.last(10)
<avoit> Oh, nice
pantsman has joined #ruby
pantsman has joined #ruby
bwlang_ has joined #ruby
nottrollin has quit ["Linkinus - http://linkinus.com"]
briankbuckley has joined #ruby
<pedahzur> deryldoucette: OK, that's what I thought, but I don't see a hoe package. (This is Debian/Ubuntu)
cespare has joined #ruby
<deryldoucette> idk, i don't use system packages, and *especially* debian or ubuntu's packages for ruby, any gems, ect ect
<pedahzur> deryldoucette: oh
<pedahzur> I'll go ask them. :)
<deryldoucette> A) they repackage to hell, breaking things up far far far too much (which eventually causes problems) B) gems get updated too much and C) i don't like the OS changing packages underneath me on updates
<deryldoucette> cool
<deryldoucette> apt-cache search hoe
<deryldoucette> see what comes up
<pedahzur> deryldoucette: Nothing to do with ruby hoe. :)
<deryldoucette> he called me a hoe! quick get 'im!
axl__ has joined #ruby
hasrb has joined #ruby
<pedahzur> *ruby's hoe
<voodoofish430> Are there any good articles on how to use modules?
<pedahzur> better? :)
<deryldoucette> hehe
<avoit> Is there any good practices about storage an API's ID/Token. I'm coding an api client and don't wanna store it in my script file. I need a more secure way
<RubyPanther> avoit: there is no secure way, usually people put it in a yaml config file
seivan has joined #ruby
<workmad3> avoit: make sure your server is secure... if it's not, you shouldn't be doing your requests from it anyway
<RubyPanther> it is a scary world, we cower behind electric fences and firewalls
<gate> pedahzur: hoe is a rubygem
<workmad3> RubyPanther: and we kid ourselves that they'll protect us
<RubyPanther> workmad3: might as well keep our chins up unless we're going to turn off the power. :)
<deryldoucette> zzt
eywu has joined #ruby
jacktrik has joined #ruby
stkowski has joined #ruby
<avoit> RubyPanther / workmad3 : But if I create a github api client which is used in a terminal, with authentification. So, I store the password in a config file ? It's weird
<pedahzur> gate: I figured as much. Just trying to figure out where to find it on Debian.:)
virunga has joined #ruby
<workmad3> avoit: not really
<workmad3> avoit: or, if it's immediately user-facing, you request the password when the user starts the client
<RubyPanther> avoit: normally github is using public/private key auth, and that already relies on the shell account being secured.
<avoit> workmad3: And I don't store it ? So each time he uses the client, he need to type the password :/
jamw has joined #ruby
<workmad3> avoit: basically, yes
<RubyPanther> read access to the private key is no different than read access to a password file
rramsden has joined #ruby
<burgestrand> unless you password protect the private key
<RubyPanther> plaintext passwords are bad where they are in a database that might be discovered separately from the individual user accounts
stephenjudkins has joined #ruby
<burgestrand> plaintext passwords are always bad :x
<RubyPanther> You're still highly vulnerable if somebody gets control of your shell account.
* burgestrand nods
eywu has joined #ruby
<medik> Hm, I trying to write a simple http daemon in ruby. It seems like ruby are ignoring different statements, and I dont know why.
<medik> Here is the code: http://pastie.org/3450589
<burgestrand> medik: probably because you’re telling it to
<medik> burgestrand: how?
<avoit> RubyPanther: If he can access to the config file, it's a problem about my host security and not about my code <= is it what u mean ?
<burgestrand> medik: no idea, which statement is being ignored? when?
<RubyPanther> avoit: yes
<avoit> RubyPanther: Not wrong ...
<burgestrand> medik: I’d also strongly advice you to give File.open a block instead of explicitly closing it, it’s safer
<gate> pedahzur: well, I don't know how your system is set up, but generally its `gem install hoe`
<RubyPanther> avoit: you could encrypt it, but then you'd have to store your encryption key in the app...
<RubyPanther> if it is for a bank, yeah, build an onion. :)
<deryldoucette> he wants to use the debian *package* for it and A) i don't think there is one, and B) even if there was it would be an older one
<medik> For example, when I trying to get an http request from the server, it ignores check_req(req)
<medik> burgestrand: Ah, okay. And how do I do that?
<burgestrand> medik: how do you know? you’re only handling one case in your check_req, an "else" in there would be useful for debugging :)
<avoit> RubyPanther: Do u have any advice about encrypt in ruby ?
<medik> burgestrand: That is true, I should check it up
incomprehensibly has joined #ruby
<incomprehensibly> hey, I just realized
<incomprehensibly> what's the difference between
<workmad3> medik: or if you only want to read the contents, use File.read(file)
<incomprehensibly> a [3] # calling method a with a singleton list
<incomprehensibly> a[3] # calling method [] on object a withi argument 3
<burgestrand> workmad3: isn’t his "b" mode for BINARY encoding though, or am I assuming wrong?
<burgestrand> Can probably do File.read(file, :encoding => "BINARY") though
Sailias has joined #ruby
<burgestrand> medik: ^
<workmad3> burgestrand: or File.read(file, :mode => "rb")
<burgestrand> Oh, cool, IO.read takes :mode too :d
<RubyPanther> avoit: I would just use OpenSSL in the Ruby stdlib if I was going to encrypt it
<workmad3> burgestrand: I just checked the method, the hash is passed through to the open command :)
<burgestrand> :)
<medik> burgestrand: You were right, it did not ignore check_req(req) but it seems like it did not take the regex
ikaros has joined #ruby
<medik> hm
seanstickle has joined #ruby
<burgestrand> medik: it probably does, but it might not match
<burgestrand> or actually, it doesn’t
<burgestrand> medik: try it here for your input: http://rubular.com/
<medik> hm, okay!
<medik> Ah, an regex tester :)
wyhaines has joined #ruby
Natch| has joined #ruby
<burgestrand> medik: you can also use %r|regexp| (or many other delimiters instead of |) if you want to avoid escaping your /’s in your regex
Retistic has joined #ruby
<workmad3> I'm quite fond of %r{} myself
<burgestrand> Yeah, I like curly braces too
<burgestrand> No idea why I used pipes
* apeiros_ likes %r foo
<apeiros_> and if only for shits & giggles :)
Silker has joined #ruby
<burgestrand> pft :p
<Retistic> whats the difference between open_timeout and read_timeout in Net
<Retistic> i can't seem to find the open_timeout attribute in the docs
<apeiros_> open_timeout is the timeout for getting a connection
<burgestrand> timeout for open and timeout for read perhaps?
<medik> burgestrand: Hehe, but it did actually match. Weird enough,
<medik> but I could try to change delimiters too, just to see
<burgestrand> medik: all I can tell you is ruby won’t lie for lulz :p
<medik> I believe you :)
<medik> ;)
<Retistic> apeiros_: got it, so a Timeout::Error doesn't indicate which timeout occured?
Schmidt has joined #ruby
linduxed has joined #ruby
<RubyPanther> Nobody likes the stick forest :/ /\/\//
<medik> burgestrand: Yeey, I found the problem :D
<burgestrand> medik: what was it? :)
j3r0m3 has joined #ruby
saimon has joined #ruby
<medik> looks like it came up another string than the "GET /foo HTTP/1.1" string in check_req(req)
<medik> User-Agent: curl/7.20.1 (i686-pc-linux-gnu) libcurl/7.20.1 OpenSSL/0.9.8n zlib/1.2.3 libidn/1.5
<medik> burgestrand: ^
<RubyPanther> proto, path = "http://example.com".match(/\A(?:(\w+):\/\/)?(.*)/).to_a[1..-1] # <3 lol
<burgestrand> oh :)
<burgestrand> URI.parse :x
nedbat has joined #ruby
<medik> burgestrand: Thank you for your help ! :)
a215 has joined #ruby
fridim_ has joined #ruby
<burgestrand> medik: \o/
Schmidt has joined #ruby
<medik> burgestrand: \o/
Natch| has joined #ruby
axl_ has joined #ruby
Asher has joined #ruby
linduxed has joined #ruby
wroathe has joined #ruby
stringoO has joined #ruby
manhunter has joined #ruby
QKO has joined #ruby
<manhunter> hi, is ruby writen/created using C language?
<manhunter> downloaded 1.9.3
<manhunter> extracted and saw many .c and .h files
<gate> manhunter: ruby's interpreter is written in C, yes
savage- has joined #ruby
incomprehensib-1 has joined #ruby
<shevy> hmm
<shevy> we should interconnect with one another more!
<gate> ... I feel like I'm missing some context there.
flagg0204 has joined #ruby
<workmad3> manhunter: the 1.9.3 standard interpreter is written in C
<shevy> gate I mean the ruby community taken as a whole
<manhunter> gate: But i saw many .c file not only one for interpreter.
chimkan___ has joined #ruby
<workmad3> manhunter: there are other interpreters written in other languages though
<gate> manhunter: you are looking at the interpreter
<gate> All those .c and .h files create the interpreter and std libs
<manhunter> extracting ruby-1.9.3 i see many .c files, are all those for ruby interpreter?
<gate> manhunter: it is quite complex
ascarter has joined #ruby
fr0gprince_mac has joined #ruby
bbttxu_ has joined #ruby
ccapndave has joined #ruby
ccapndave has quit [#ruby]
<gate> manhunter: are you looking for a walkthrough of what the code does? That's a little over my head since I haven't tried to alter MRI (matz ruby interpreter)
chrxn has joined #ruby
bhunt has joined #ruby
manhunter has quit ["WeeChat 0.3.6"]
<shevy> I think he has 5 questions and he randomly shuffles these
charlenopires has joined #ruby
<shevy> oh
<shevy> he left #ruby but stays on #ruby-lang :(
PaciFisT has joined #ruby
MrGando has joined #ruby
<nedbat> what's the diff between #ruby and #ruby-lang?
<shevy> #ruby-lang is the official channel
albemuth has joined #ruby
wroathe has joined #ruby
clockwize has joined #ruby
wmoxam has joined #ruby
ascarter has joined #ruby
tinhead has joined #ruby
Liothen_ has joined #ruby
briankbuckley has joined #ruby
Liothen has joined #ruby
ryanf has joined #ruby
<apeiros_> #ruby is the bigger channel
<workmad3> #ruby is where the cool kids hang out :)
<gate> #ruby is what I typed it just to see if the channel existed. I'm guessing that is a common story.
shevy has joined #ruby
havenn has joined #ruby
jlebrech has joined #ruby
chimkan___ has joined #ruby
Mchl has joined #ruby
chimkan_ has joined #ruby