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/
TangoArgentino joined #ruby
<shadoi>
epitron: 1.9.3 changes that behavior, str[n] gives you the string. chr.ord gives you the value.
<epitron>
shadoi: meh! :)
ikaros joined #ruby
TangoArgentino left #ruby
<epitron>
i almost never use string[integer]
<epitron>
string[/regexp/] or string["substr"] occasionally
<epitron>
string.split is the most frequent one
<epitron>
and string =~ /regexp/
<epitron>
string.scan is great too
<epitron>
and who can forget string.gsub
<epitron>
you getting all these, dekroning?
statbot joined #ruby
<dekroning>
epitron: ai oops
<dekroning>
epitron: sorry let me read -)
<dekroning>
epitron: right, thanks
<epitron>
i just realized you wanted to turn it into hex
<epitron>
there's a few ways to do that
<dekroning>
epitron: yes I want to turn it in to hex, because i'm receiver binary data from some hardware device over a socket
<epitron>
"%x" % integer
<epitron>
or integer.to_s(16)
<dekroning>
ah great!
<epitron>
"the whole string".bytes.map{|b| b.to_s(16)}.join(" ")
<epitron>
that'll give you a hexdump looking thing
<dekroning>
epitron: perfect, that was what I was looking for, thanks a lot epitron
<epitron>
np!
conor_ireland joined #ruby
strife25 joined #ruby
dyer joined #ruby
raythecat joined #ruby
statbot joined #ruby
raythecat joined #ruby
statbot joined #ruby
sythe joined #ruby
sythe joined #ruby
Skaag joined #ruby
earcar joined #ruby
randym joined #ruby
elliot98 joined #ruby
elliot98 joined #ruby
thomasfedb joined #ruby
bwlang joined #ruby
andrewvos joined #ruby
hadees joined #ruby
bafilius joined #ruby
jbw joined #ruby
replore_ joined #ruby
kevinbond joined #ruby
axilla joined #ruby
cjs226 joined #ruby
nelsnelson joined #ruby
statbot joined #ruby
Behi joined #ruby
dotnull joined #ruby
statbot joined #ruby
statbot joined #ruby
brownies joined #ruby
igotnolegs joined #ruby
<blueadept>
how do you make to_json pretty?
<blueadept>
its all scrambled together, i'd like to read it according to the structure
<blueadept>
hm, maybe i'll just get a fireox addon
iocor joined #ruby
<envygeeks>
blueadept: you can use pp and it will pretty print it, you can also use coderay but I don't know if coderay pretty prints before it colours it
mxweas_ joined #ruby
<blueadept>
pp?
<blueadept>
pretty print?
<blueadept>
ok
<andrewvos>
awesome_print
<blueadept>
^ i'll try that too
<andrewvos>
gem install awesome_print
<andrewvos>
It's a pleasure :)
statbot joined #ruby
<envygeeks>
blueadept: yes pp is built into ruby just do require 'pp' pp myhash.to_json awesome print is good too but for quick pretty printing inside of things like an repl I always prefer pp
* brownies
gives envygeeks some punctuation
fixl joined #ruby
<elliot98>
ok, trying to understand how "a = b || {}" works
<elliot98>
a becomes either b or an empty hash, ok, but why doesn't it become true or false?
wayne[mo1ile] joined #ruby
mytec joined #ruby
<elliot98>
basically shouldn't b || {} be a test?
<envygeeks>
elliot98 not in a definition
<elliot98>
envygeeks: aha...ruby ain't C
<drizz>
OH SHI
<drizz>
ITS NOT?
<drizz>
FUCK
JumpMast3r joined #ruby
<elliot98>
nope, ruby has four letters, c, when is only c
<blueadept>
actually you know what
<blueadept>
render :json => works well too
<Avi`>
elliot98: wait, whats b have to be in order for a to become b and not an empty hash?
<Avi`>
something other than false/nil?
<elliot98>
well, b's gotta be something
fl0w joined #ruby
<Avi`>
right
<Avi`>
egh ill just go to irb and try out some examples
<elliot98>
how does one destroy an object?
<elliot98>
b.destroy!
<elliot98>
?
<envygeeks>
elliot98, set it to nil and the GC will collect it eventually when it wants to use the space...it's a lazy GC. You can really only force a destroy (and even Ithink that's lazy) if it's an instance variable, method or constant
<Avi`>
so it looks like b || {} is basically doing an "if b exists use it, otherwise use {}"
<elliot98>
Avi`: yep, seem so...pretty cool
<elliot98>
print (b || {}) prints b
<envygeeks>
well if b exists implies that it checks if it's defined but it will raise if b is undefined
<Avi`>
yes it does raise
<Avi`>
but it also assigns a = {}
<elliot98>
print (b && {})
<elliot98>
prints }|
<elliot98>
prints {}
<Avi`>
now if only i could find an easy way to say if x != 10 && != 12 && != 13
<Avi`>
basically compare everything on the right to one value on the left
<Avi`>
hmm dats not what my irb did
<Avi`>
llemme retry
<Avi`>
oh, i had just done a valid a = b || {}
<Avi`>
so a was still {} =[
<elliot98>
Avi`: I think COBOL has that kind of syntax
<Avi`>
elliot98: its just one of those things where every once in awhile i find myself having to make that kind of comparison and i sigh and wonder why languages don't have some mechanism for it
<elliot98>
COBOL does natively
<elliot98>
but true, that style should exist in other languages as well
<Avi`>
too bad i needed this most often in javascript
dagnachewa joined #ruby
esparkman joined #ruby
Liothen joined #ruby
<envygeeks>
you could always do if(String({test: 1}) == String({test: 1})) { alert('Yes!') } in JavaScript
looopy joined #ruby
RyuGuns joined #ruby
<envygeeks>
oh I guess that won't work it doesn't cast it like to_s
kennethreitz joined #ruby
_kinderman joined #ruby
LowKey joined #ruby
jay_zawrotny joined #ruby
<dekroning>
epitron: I have another nice one now :-)
<dekroning>
i'm reading a hex value, which is a signed byte value
<dekroning>
0xCF
<epitron>
you want to convert it to a byte?
<dekroning>
which converts to 207 decimal when i'm using unsigned int, however I would like to know what the value is, when i treat it as a signed byte
<dekroning>
yeah :)
<epitron>
well, you could pack and unpack it
spike2251 joined #ruby
<epitron>
but 2's complement is pretty straight forward
<dekroning>
right
<epitron>
here's a simple way
<epitron>
n = 207
<epitron>
n -= 255 if n[7] == 1
radic joined #ruby
<epitron>
(i can't remember how to do 2's complement, and wikipedia is a giant mess)
<dekroning>
hehe I was also looking at the wikipedia page
<dekroning>
that trick is nice! I didn't know you could get to the individual bits on a integer
<dekroning>
like n[7]
<epitron>
yeah, that is a funny little trick
<epitron>
ah, 2's complement is just: invert the bits, add 1
<epitron>
in ruby, that ends up being messier than the n -= 255 thing :)
h4mz1d joined #ruby
albemuth joined #ruby
notbrent joined #ruby
<Avi`>
is there a single word to convey the concept of 'work has not yet started'
mikeycgto joined #ruby
mikeycgto joined #ruby
pac1 joined #ruby
philcrissman joined #ruby
looopy joined #ruby
abstrusenick joined #ruby
h4mz1d joined #ruby
wyhaines joined #ruby
<envygeeks>
lazy
fixl joined #ruby
fowl_mouth joined #ruby
cdepue joined #ruby
DaZ joined #ruby
minijupe joined #ruby
mxweas_ joined #ruby
ryanf_ joined #ruby
stephenjudkins joined #ruby
<Avi`>
hahah
<dekroning>
epitron: thanks a lot for your help
andrewhl joined #ruby
pen joined #ruby
rgrinberg joined #ruby
pencilcheck joined #ruby
davidcelis joined #ruby
yfeldblum joined #ruby
genexp joined #ruby
Cervajz joined #ruby
genexp left #ruby
<mxweas_>
is there a string method for finding commonalities between two strings? ie 'world hello world' and '124. hello 35' would return 'hello'
<davidcelis>
mxweas_: Use regex
<davidcelis>
string.match(/hello/) for example
<davidcelis>
oh
<mxweas_>
as they both share that portion
<mxweas_>
how would I go about pulling that one off?
<davidcelis>
kinda jumped the gun on that
<mxweas_>
both strings a returned from a web service. I don't know what they are beforehand.
<mxweas_>
I have metadata on a song. But sometimes the song title includes crap before/after. I'd like to compare this song title to a post I'm pulling the song from.
<mxweas_>
because the post will have the song title, but it will have different crap before/after :P
<mxweas_>
so basically something that finds a common string between two strings if one exists
<mxweas_>
ryanf_: sounds right. Wikipedia is down for me :|
<blueadept>
what can i do to push the x only if it's greater than 1?
<blueadept>
<< if x > 0, fails
<ryanf_>
pages_backward << x if x > 0
<blueadept>
ahh
<blueadept>
haha
<blueadept>
that was dumb, sorry there
<blueadept>
i should have known that
<envygeeks>
I blame the heroin
headius joined #ruby
<blueadept>
hmm
Knodi joined #ruby
<blueadept>
undefined method `>' for -2...3:Range
<mitchty>
what exactly is page_backward_array?
nerdy_ joined #ruby
<blueadept>
i'm building my own pagination
<blueadept>
i generate an array of numbers either +5 forward or backward, then to make sure i dont have any 0s or negative numbers, i'm looping through it and building a new array with those constraints
<blueadept>
i've done this before in javascript
pen joined #ruby
<mitchty>
%w/-1 -2 0 1 2 3/.map{|x| x.to_i}.select {|x| x > 0} easier way
<blueadept>
and i can do it in a block of lines
<blueadept>
but i'm trying to do it in one line
<mitchty>
dup the array and select the stuff thats > 0
<blueadept>
ahh
<blueadept>
let me try that then
<envygeeks>
why not just do: %w/-1 -2 0 1 2 3/.map{|x| x.to_i }.delete_if {|x| x < 1}
<mitchty>
envygeeks: same difference really
<blueadept>
whats the %w/-1 -2 0 1 2 3/ part mean?
<mitchty>
it builds an array split by spaces
<mitchty>
of strings, aka "-1", "-2", its for when i'm too lazy to write out an array with commas
<blueadept>
oh ok
<mitchty>
blueadept: have a look at select, select! (inplace), reject of which delete_if is an alias iirc, and reject! which operates in place as well in Array
alanp joined #ruby
wyhaines joined #ruby
<blueadept>
awesome that worked
<blueadept>
very cool, thanks!
<blueadept>
also, what is the difference between [1?5] and Array(1?5) ?
looopy joined #ruby
<mitchty>
assuming you mean Array(1,5), the latter is invalid syntax
<mitchty>
Array([1,5]) would return the array [1,5], the only real use for it is if you want to easily arrayify a single element or nil to itself or an empty array
brianlong joined #ruby
<mitchty>
aka if you passed in nil, you get a new empty array, if you pass Array() an array, you get the array, a string you get a new array with that string etc...
<banisterfiend>
mitchty: what's wrong with just [-1, -2, 0, 1, 2, 3]
<banisterfiend>
why all this %w/ / BS?
<banisterfiend>
it looks ugly too
<blueadept>
i think thats for IRC
looopy_ joined #ruby
<blueadept>
er whatever
<mitchty>
it was for demonstration
<mitchty>
also %w// is an easy way to get an array of strings
<banisterfiend>
Yeah but didnt he want an array of ints?
<blueadept>
well yea ints
<mitchty>
banisterfiend: yes, hence the map call
<blueadept>
these are simply page numbers
<banisterfiend>
just seems kind of lulzy to build an array of strings of numbers and then CONVERT it to an array of ints
<banisterfiend>
when it's not much more effort to just get an array of ints from teh beginning
<envygeeks>
IF YOU DONT WANT TO DO IT THE HARDWAY DONT DO IT AT ALL
<banisterfiend>
it's not like you have to quote every int, you just separate it by a comma
<blueadept>
wait a minute
<banisterfiend>
i can understand wanting to use the %w// syntax for building array of strings, but not for arrays of ints
<blueadept>
.map builds me an array of number strings?
<blueadept>
?!
<blueadept>
yeah why do i have to do a to_i
<mitchty>
oh god you don't, it was just for a one line demonstration of select
brianlong left #ruby
<blueadept>
oh ok
<blueadept>
heh
<banisterfiend>
mitchty: well you wayy overcmplicated it IMO
<banisterfiend>
so it's not surprising he was confused
<RyuGuns>
What is a good editor for Ruby/Python?
<blueadept>
textmate
<crankycoder>
vim
<envygeeks>
fuck that noise
<envygeeks>
vim
<blueadept>
vim if you're a freak of nature
<crankycoder>
alright fine. then emacs.
<RyuGuns>
lol
<mitchty>
banisterfiend: feel free to demonstrate, would you like ranges? (-5..10).select {|x| x > 1} i pointed him to the relevant Array methods
<RyuGuns>
A graphical editor, preferably. lol
<blueadept>
oh come on
<blueadept>
textmate + expose
<banisterfiend>
mitchty: that's pretty nice
<blueadept>
you can have like 10 textmate windows open
<blueadept>
and just expose to switch between them
<blueadept>
plus it looks cool when you do it
abstrusenick joined #ruby
<RyuGuns>
Nevermind, Geany works fine for ruby, and gedit has syntax highlighting.
<crankycoder>
i honestly never really understood the appeal of textmate
<RyuGuns>
:)
<envygeeks>
when I want to be fancy and feel like one of those high-class people I use gedit
CannedCorn joined #ruby
hadees joined #ruby
macmartine joined #ruby
abstrusenick joined #ruby
<blueadept>
actaully if forgot the reason i started using textmate, i think it was just because i saw some blogger using it
<blueadept>
haven't really had a reason to stop using it
<blueadept>
most everyone does bundles for any sort of syntax you want
<blueadept>
so i guess its convenient no matter what language you happen to be using
cableray joined #ruby
<blueadept>
including DSLs
brownies joined #ruby
<envygeeks>
well, a DSL shouldn't need a special syntax highlighter
<envygeeks>
unless you're falling back on the Rakefile/Makefile/Gemfile/Fuckthisnoextensionbullshitfile
<blueadept>
hm, well maybe not a DSL per se, i mean more like other languages
<blueadept>
like template languages
<blueadept>
yeah DSL doesn't really fit that context you're right
albemuth joined #ruby
libertyprime joined #ruby
p0y joined #ruby
linoj joined #ruby
radic_ joined #ruby
mxweas_ joined #ruby
Shamgar joined #ruby
iamjarvo joined #ruby
akem joined #ruby
<andrewhl>
if I wanted to fill out a web form, in other words submit an http request, and then click on a link, can that be done with ruby?
jimmy1980 joined #ruby
brownies joined #ruby
<heftig>
andrewhl: mechanize
<andrewhl>
cool, thanks
fixl joined #ruby
peterwald joined #ruby
nonotza joined #ruby
bwlang joined #ruby
ghosTM55 joined #ruby
randym joined #ruby
linoj joined #ruby
x0F_ joined #ruby
abstrusenick joined #ruby
Kichael joined #ruby
rohit joined #ruby
jgrimes joined #ruby
otakutomo joined #ruby
wyhaines joined #ruby
roaminghorse joined #ruby
Ruthenium joined #ruby
Cervajz joined #ruby
riush joined #ruby
RyuGuns left #ruby
rohit left #ruby
h4mz1d joined #ruby
stephenjudkins joined #ruby
pen joined #ruby
S2kx joined #ruby
Gekz_ joined #ruby
<Gekz_>
hey guys, I'm a Python programmer that wants/needs to learn Ruby
<Gekz_>
is there a good introductory text geared towards people like me? :P
<iamjarvo>
Gekz: maybe ruby koans
CannedCorn joined #ruby
mksm_ joined #ruby
<Gekz>
looks cool :D
mksm joined #ruby
Crisco joined #ruby
<Crisco>
I'm learning ruby, and I was wondering if I can use the typical naming convention for variables that I use in C/C++. the first letter is always lowercase, and any subsequent word starts uppercase
<Crisco>
or does it either have to be all lowercase for variable and all uppercase for constant
btanaka joined #ruby
<macmartine>
Crisco: You can do whatever you want, but I'd suggest following the conventions
eywu joined #ruby
havenn joined #ruby
CannedCorn joined #ruby
_numbers joined #ruby
banisterfiend joined #ruby
<_numbers>
any1 know how to launch firefox in xvnc from selenium
<Ruthenium>
Crisco: first letter has to be uppercase for constants
<Ruthenium>
others don't matter
<Crisco>
Ruthenium: same for variables?
apucacao joined #ruby
td123 joined #ruby
<td123>
say I want to learn ruby.. which book would you recommend? is there a K&R of ruby? also I would like it to be updated for a recent version of ruby if possible
<banisterfiend>
td123: the k&r of Ruby is "the ruby programming language"
<banisterfiend>
td123: by flanagan & matz
youlysses joined #ruby
<Ruthenium>
Crisco: if the first letter is lowercase it's a variable
<Ruthenium>
if the first letter is uppercase, it's a constant
<Crisco>
Ruthenium: thank you
<Crisco>
all the tutorials show all lowercase or all uppercase
<Crisco>
I wasn't sure if it could be a mixture
<Crisco>
now I just need to break my habit of putting a semicolon at the end of each line
youlysses left #ruby
<apucacao>
I have a class which represents youtube or vimeo videos. I defined a uri= method in which I need to do some parsing to extract the video_id and site name (either youtube or vimeo). I found the addressable gem that allows me to easily parse a URI. Because youtube and vimeo uris are quite different I would like to have a separate parsing method for each. How can I to this? How do I branch to a separate parsing method based on the URI?
<td123>
banisterfiend: thanks, I'll check it out and if I like it, I'll go buy a dead tree version :) it is priced low on amazon so that's another plus
roadze joined #ruby
Dawerio joined #ruby
wmoxam joined #ruby
beseku joined #ruby
GolF joined #ruby
muraii joined #ruby
brownies joined #ruby
skrewler joined #ruby
glacius joined #ruby
stephenjudkins joined #ruby
Sailias joined #ruby
crankycoder joined #ruby
spike2251 joined #ruby
jay_zawr1tny joined #ruby
lidashuang joined #ruby
apucacao joined #ruby
wuqian joined #ruby
jimmy1980 joined #ruby
tonini joined #ruby
wuqian joined #ruby
nonotza joined #ruby
PaciFisT joined #ruby
quest88 joined #ruby
mikepack joined #ruby
smgt joined #ruby
sarmiena_ joined #ruby
Spockz joined #ruby
tonini joined #ruby
skinnymuch joined #ruby
stringoO joined #ruby
marting joined #ruby
stephenjudkins joined #ruby
ksinkar joined #ruby
stephenjudkins joined #ruby
<shevy>
Crisco ALL_UPPERCASE for constants is easier to read for the eyes
Azure|netbook joined #ruby
Azure joined #ruby
<shevy>
Gekz work through http://pine.fm/LearnToProgram/?Chapter=01 once quickly, if you already know python, ruby will be very easy, the thinking part is a bit different, like rather than "for bla in ble" you will tend to work with enumerators ... array.each array.map and so on
<shevy>
I once wanted to update that tutorial
<shevy>
hmm
<luckyruby>
should I use Hash#delete_if if I want to remove two or more keys in one go?
Spockz joined #ruby
mgingras joined #ruby
yxhuvud joined #ruby
mgingras left #ruby
ChampS_ joined #ruby
Cervajz joined #ruby
pen joined #ruby
sonkei joined #ruby
Spockz joined #ruby
Spockz_ joined #ruby
nadirvardar joined #ruby
Spockz joined #ruby
Draco_ joined #ruby
spike2251 joined #ruby
<rpowell>
hey does anyone know where I can get a good PDF+ePub version of The Pragmatic Programmer?
fridim_ joined #ruby
Spockz joined #ruby
Draco_ joined #ruby
eldariof joined #ruby
<_numbers>
in ruby how do i pass arguments while skipping optional ones? e.g. def f(a=1,b=2,c=3,d=4); end; f(arg1, , , arg4);
replore joined #ruby
andy_ joined #ruby
Spockz joined #ruby
<shevy>
_numbers ruby does not have named parameters
<shevy>
_numbers two tricks you can use though. a hash, or * splat operator
<shevy>
and with hash, well you can specify default values for that hash
manizzle joined #ruby
crescendo joined #ruby
<_numbers>
ok thx so optional args are specified last and i have to supply all of them if i want to get to the one at the end
<_numbers>
or else change how the function is defined using splat operator
Spockz joined #ruby
nari joined #ruby
stephenjudkins joined #ruby
kevinbond joined #ruby
xpot joined #ruby
asQuirreL joined #ruby
r45c4l joined #ruby
<r45c4l>
hello friends, I am trying to make some programe work but getting errors all the time, here is the OP, can any one guide me http://pastebin.com/tDbYT8pg
michael_mbp joined #ruby
arash joined #ruby
stephenjudkins joined #ruby
Jrz joined #ruby
maletor joined #ruby
stoffus joined #ruby
Spockz joined #ruby
SaneWarning joined #ruby
stoffus joined #ruby
sandstrom joined #ruby
<r45c4l>
any one please who can help me
JumpMast3r joined #ruby
fixl joined #ruby
<wmoxam>
r45c4l: what version of gems?
<r45c4l>
ohh thank God
<r45c4l>
well i have installed 1.9.1
<r45c4l>
wait
<r45c4l>
ruby1.9.1 is already the newest version
<r45c4l>
i installed via apt-get
otakutomo joined #ruby
JohnBat26 joined #ruby
<yxhuvud>
ruby and gem version numbers has nothing to do with each other.
<yxhuvud>
that htey happen to be similar at the moment is a coincidence.
<r45c4l>
shevy, and wmoxam thats a little bouncer for me :P
BiHi joined #ruby
<wmoxam>
shevy: " Ruby packages in Debian are named using the Ruby library compatibility version, which is sometimes confusing for users who do not follow Ruby development closely"
<r45c4l>
in simple words can i say that i uninstall the previous version and install 1.9.3 shevy wmoxam
<wmoxam>
:p
<wmoxam>
r45c4l: no
<r45c4l>
then wmoxam
_debo joined #ruby
<wmoxam>
r45c4l: you probably already have it installed
<wmoxam>
r45c4l: " Ruby packages in Debian are named using the Ruby library compatibility version, which is sometimes confusing for users who do not follow Ruby development closely"
<wmoxam>
1.9.1 is the library compatibility version
d3c joined #ruby
<shevy>
wmoxam that long sentence confuses me even more
<wmoxam>
Debian hasn't shipped the actual 1.9.1 interpreter for a long time
<r45c4l>
hehee i agree with shevy
<r45c4l>
:P
* wmoxam
will repeat
<wmoxam>
1.9.1 is the library compatibility version
<shevy>
r45c4l I am sure you can somehow remove the old ruby version
moondiamond_ joined #ruby
<wmoxam>
arrrrgggg
<wmoxam>
shevy: no
<shevy>
you cant?
<wmoxam>
the debain 1.9.1 package IS the latest version
<r45c4l>
yeah let me try to do that shevy otherwise i will come back to bug u and wmoxam :P
<shevy>
1.9.1 is their latest version?
<shevy>
that's what... 3 years old?
<wmoxam>
1.9.1 only denotes library compatibility
<r45c4l>
no lates is 1.9.3 shevy
<wmoxam>
shevy: NO
<shevy>
good!
<shevy>
then r45c4l will be happy :)
<wmoxam>
I don't know how I can make it more clear
<wmoxam>
1.9.1 only denotes library compatibility, not the interpreter version
<shevy>
what
<r45c4l>
:P hehe ok then let me mess it up a little more so that i can trouble both of u shevy and wmoxam hehe
<shevy>
people can use 1.8.7 with 1.9.1 library compatibility?
<wmoxam>
just like installing the ruby1.8 package on debian doesn't install ruby 1.8, it installs Ruby 1.8.7
<wmoxam>
got it?
wayne joined #ruby
<wmoxam>
shevy: NOOO
<shevy>
I think debian makes life much harder than it ought to be made
<wmoxam>
shevy: no, it really doesn't
<wayne>
why's that shevy?
<asQuirreL>
hey guys, is there a overlapping pattern allowing equivelant of gsub? :P
<shevy>
when I do "apt-get install ruby" I want it to default to the latest version always
<wayne>
shevy, you should try slackware!
<shevy>
nah
<asQuirreL>
shevy: why don't you use rvm?
<shevy>
I compile from source wayne
<wayne>
you can do that on slackware too
<asQuirreL>
oh, that's why :P
<wmoxam>
shevy: no, you need to denote the compatibility version
<shevy>
asQuirreL I have no need for rvm, my ruby versions go into /Programs/Ruby/VERSION_HERE
<wayne>
in fact, you probably have to.
<wmoxam>
:p
<wmoxam>
Debian actually has somewhat sane Ruby packages now
<wmoxam>
it didn't in the past
p1d joined #ruby
<shevy>
wmoxam I lately tried PC-BSD
<shevy>
that was sooooo confusing
<wmoxam>
shevy: why?
<wmoxam>
it's just freebsd under neither, no?
<shevy>
wmoxam I am not sure how, I managed to break it within 1 hour. They have a graphical application called "appcafe", you use it to install packages easily. After 1 hour I quitted it, and it refused to restart
<shevy>
then I tried to compile some things from source, which somewhat worked (one has to use "gmake" rather than "make")
<shevy>
but then suddenly it could not find any library under /usr/local/lib
<shevy>
wmoxam yeah it's freebsd in essence
<wmoxam>
gmake == GNU make
heftig joined #ruby
<wmoxam>
on BSD the default make is BSD make
<r45c4l>
hey wmoxam and shevy did u guys heard abt that nmap thingy ??
<r45c4l>
it was really shocking that download.com will do something like that
<wmoxam>
r45c4l: why would anyone download it from download.com?
<wmoxam>
it's in pretty much every package manager
ihji joined #ruby
<r45c4l>
wmoxam, see its true that we do have indipendent sites for there products but still people who are not so much computer friendlly just go to google and search
spike2251 joined #ruby
<r45c4l>
no doubt if u pick up any IT magazine you will get hell lot of adds of download.com
<wmoxam>
r45c4l: well, ppl should have some knowledge if they are going to use nmap
<wmoxam>
:p
zommi joined #ruby
<r45c4l>
yeah thats very true but belive me wmoxam i know my colleagues who still use zenmap even though they are working as pen testers
<r45c4l>
coz its hard for them to just remember simple syntex and and the basic difference of scanning methods
jay_zawrotny joined #ruby
siddick joined #ruby
ph^ joined #ruby
<shevy>
remembering things is hard
<shevy>
I try to avoid it when possible
<r45c4l>
shevy i think there is nothing wrong if u dont remeber all the syntax and all and i too believe its not so important, i think its much about your approach towards the work
Morkel joined #ruby
jayne joined #ruby
<r45c4l>
atleast zenmap help them so that they dont have to go to google and invest 1 minute
<r45c4l>
:P
Pip joined #ruby
batlock666 joined #ruby
djdb joined #ruby
Pip_ joined #ruby
Barakas joined #ruby
stephenjudkins joined #ruby
<Harzilein>
so, as gems seem to have conceptually replaced freestanding "libraries" or "modules", i wonder if i should still consider them a standard feature. as in: i just want to put anonymous files in some library directory (say, as a user) and want them to work. this works with a regular vendor ruby, but when i use rvm it looks like the only way i'm supposed to install stuff is through gems.
<Harzilein>
s/them/these/
mafolz joined #ruby
<Barakas>
hi, I'm looking for an example to play (list records, add records, ...) with a DNS (Active Directory ... :/). I found the Rubydns library but I don't really know how to use it for a Microsoft DNS ! Any ideas ? Thanks for help !
pencilcheck joined #ruby
<Harzilein>
any comments if i'm expecting something exotic here? is it unreasonable for me to ask the rvm maintainers for documentation on where to put my libraries so they can get autoloaded (and my scripts so they can only get found when i'm using the correct environment for them to run in)?
<shevy>
Harzilein, well you can use setup.rb to install libraries too
<shevy>
I use that myself
<shevy>
I dont use rvm though
<shevy>
Harzilein, with setup.rb they get installed into SITE_DIR
roaminghorse joined #ruby
<shevy>
if you have a certain structure
<shevy>
lib/name_of_project/*
<shevy>
lib/foobar/*
<shevy>
require 'foobar'
<Harzilein>
shevy: SITE_DIR is unset while using rvm
<shevy>
and typically they have a foobar.rb file too
ChampS_ joined #ruby
d3c joined #ruby
<siddick>
\join chef
<banisterfiend>
siddick: you will never be forgiven for that typo
stephenjudkins joined #ruby
<Harzilein>
so, setup.rb was never deprecated, right?
<shevy>
Harzilein hmm no, but everyone tends to use gems these days
<shevy>
so setup.rb will be forgotten into the void eventually
stephenjudkins joined #ruby
<Harzilein>
shevy: i'm completely baffled at one thing, that everyone seems to assume people want to elevate their humble scripts to "projects"/"packages"
<shevy>
well, for single .rb files this is overkill
Ch4rAzZz joined #ruby
<Harzilein>
shevy: as if there are no situations where even getting a version number is considered too much red tape
Telling joined #ruby
saschaheylik joined #ruby
<Harzilein>
shevy: when i explained that view in #rvm, my wish was considered as one for "custom gem like stuff".
jimmy1980 joined #ruby
<shevy>
Harzilein yeah no idea, I don't use RVM myself and won't have a need to use it either. If I need any rvm-like functionality, I write a ruby script. And version changes I can do by switching symlinks from i.e. /Programs/Ruby/Current to point at 1.8.7x or 1.9.3x etc..
<Harzilein>
shevy: of course wanting to add stuff to rvm would always look like adding "gem like" stuff, because from what it looks like all that is handled is gems
<shevy>
Harzilein though I am sure they have valid reasons for decisions like not using SITE_DIR
pi3r joined #ruby
<Harzilein>
well, i meant that they don't explicitely set it even though i have a user install of rvm
Spockz joined #ruby
pen joined #ruby
saschaheylik left #ruby
saschaheylik joined #ruby
raythecat joined #ruby
enikar joined #ruby
Seisatsu joined #ruby
timonv joined #ruby
visof joined #ruby
dark3rdre4ms joined #ruby
takyokoo joined #ruby
Manhose joined #ruby
sandstrom joined #ruby
sandstrom joined #ruby
bosphorus joined #ruby
nicoulaj joined #ruby
pen joined #ruby
mxweas_ joined #ruby
rpowell joined #ruby
mklappstuhl joined #ruby
ognevsky joined #ruby
Ammar01 joined #ruby
cyri_ joined #ruby
siddick joined #ruby
bastilian joined #ruby
Telling joined #ruby
iocor joined #ruby
Morkel_ joined #ruby
dazoakley joined #ruby
Manhose_ joined #ruby
Adman65 joined #ruby
maletor joined #ruby
james_cotterill joined #ruby
nemski joined #ruby
moondiamond_ left #ruby
fff joined #ruby
<fff>
llo
trivol joined #ruby
<derchiller>
llo ^^
<fff>
hi
roadze joined #ruby
Spockz joined #ruby
fff left #ruby
_debo joined #ruby
kevinbond joined #ruby
<visof>
hello
<visof>
can i start array with 0 elements ?
<Afal>
yes!
<visof>
foo = Array.new(0) , to can do something like foo[23] += 1 ?
<visof>
or even foo[2323] += 1
<rippa>
yes
<visof>
rippa: how?
<visof>
like i saied?
<visof>
said?
Anon671 joined #ruby
workmad3 joined #ruby
<rippa>
Array.new(100) {0}
<derchiller>
visof: an empty array would be the following: x = Array or x = []
<rippa>
array with 100 zero elements
<visof>
thanks guys
<rippa>
or just
<rippa>
[0] * 100
<Tasser>
derchiller, x = Array won't give you an empty array
<derchiller>
u're right
<banisterfiend>
anyone here have experience with opensource legal issues?
<derchiller>
my answer was wrong
<Tasser>
banisterfiend, oh, what are you hacking with this time? ^^
<Tasser>
he hacked himself.
banisterfiend joined #ruby
Helius joined #ruby
trivol_ joined #ruby
jimmy1980 joined #ruby
bwright joined #ruby
EddieS joined #ruby
Pip joined #ruby
ank_ joined #ruby
jbpros joined #ruby
<visof>
rippa: what is i want unlimited length not just 100 ?
<rippa>
I don't think it's possible with Array
<rippa>
it's not a Hash
<rippa>
if you do array[1000000] = 1
<rippa>
you just created a 1000001-size array
<rippa>
while if you do hash[1000000] = 1
<rippa>
you create 1-size hash
<andrewvos>
banisterfiend: What issues you having?
adambeynon joined #ruby
ChampS_ joined #ruby
adambeynon joined #ruby
<banisterfiend>
andrewvos: there's a host processor and an auxiliary processor. The host processor is responsible for pushing some initializtion (startup) code to the auxiliary processor.
hurikhan|Work joined #ruby
<banisterfiend>
The host processor runs a C library that does this which is gplv2, it has hardcoded in a header file the startup code (binary) that will be pushed to the auxiliary processor.
<heftig>
visof: you want a map (dictionary), not a list. use a hash
<banisterfiend>
andrewvos: now this is the issue, the startup code (binary) is actually compiled code of non-proprietary software
<visof>
ok
<banisterfiend>
andrewvos: but we (personally) have the 'free use' of this proprietary software to use as we want.
<visof>
i'm trying to write very some brainfuck interpreter in ruby but i don't know how can i implement [ loop
<visof>
can anyone help
<visof>
i can paste my current code ?
<banisterfiend>
andrewvos: The issue is whether the binary code for the auxiliary processor we store in the .h file is 'tainted' by gplv2, i.e we're forced to release the original proprietary source code
<banisterfiend>
andrewvos: sorry where i said non-proprietary before, i meant just 'proprietary'
<visof>
can anyone check the code and help me how can i do the missing part?
iocor joined #ruby
<banisterfiend>
andrewvos: yeah so in summary. Our C source code (licensed under gplv2) contains the binary of proprietary software. Is the source code of the proprietary software tainted by gplv2?
michael_mbp joined #ruby
<heftig>
visof: is this an assignment?
<visof>
heftig: what do you mean?
<heftig>
visof: as in, homework.
vitoravelino joined #ruby
<visof>
haha , no, i'm learning programming for my own
<heftig>
visof: anyway, you will have to match the brackets. easiest if you read the entire program first.
<Axsuul>
Is there any way to pass something into an array by reference? Example of what I'm trying to do: http://codepad.org/Ly0BTcAR
<Axsuul>
nm i get it
<Axsuul>
I think im creating a new object
S1kx joined #ruby
S1kx joined #ruby
<Axsuul>
nm, thanks
Manhose joined #ruby
banisterfiend joined #ruby
<heftig>
Axsuul: bar.replace("2")
ognevsky joined #ruby
<Axsuul>
thanks, yea that would work
<heftig>
method of a few core classes (at least array, hash, string)
<heftig>
Axsuul: it won't work with arbitrary objects
<Axsuul>
heftig: hmm can you give an example?
ikaros joined #ruby
<heftig>
Axsuul: of what?
radic joined #ruby
jsaak joined #ruby
<Axsuul>
ah nevermind i got it, thanks
trivol joined #ruby
mengu joined #ruby
vitoravelino joined #ruby
Jrz joined #ruby
<Tasser>
does anyone know why puppet choose to implement their own language and not use plain ruby?
ramusara joined #ruby
<banisterfiend>
Tasser: isn't chef the same as puppet but using ruby
randym joined #ruby
<Tasser>
banisterfiend, possible
<workmad3>
banisterfiend: puppet is written in ruby too :)
<Tasser>
yes, it is
<banisterfiend>
workmad3: i mean the configuration language
<workmad3>
oh, yeah
<workmad3>
Tasser: I believe the reason was because they were targetting at people who may not want to learn ruby for sys-admin tasks
<workmad3>
and because having their own language gave them a bit more control over things like enforcing order, playing with dependency resolution... but I use chef anyway, didn't like puppet :)
<Tasser>
workmad3, just do enough dsl and you get pretty far...
<workmad3>
Tasser: I don't think the config language worked out so well for them though, because from what I've heard, for a lot of puppet tasks you need to write your own resource definitions, which is in ruby anyway :)
<Tasser>
well, whatever. Looks like ruby to me
<workmad3>
oh, and there are some differences between how chef and puppet do their jobs... for example, I think puppet will try and figure out the smallest set of changes to run, while chef will just run all recipes every time
mikejw joined #ruby
gayasentinel joined #ruby
<mikejw>
what does it mean if I deploy a rails app using passenger on apache and all I see is a directory listing for 'public'?
<workmad3>
which makes it more important in chef to write recipes that can be run repeatedly to the same effect
<workmad3>
mikejw: that you haven't set up either the vhost or the passenger module correctly
<mikejw>
hmm well I've followed the documentation exactly
piotrj joined #ruby
<visof>
heftig: around
<Tasser>
mikejw, #rubyonrails
<mikejw>
thanks
<visof>
how can i do the looping [
<visof>
?
tk___ joined #ruby
nari joined #ruby
_debo joined #ruby
<Tasser>
visof, huh?
Pip joined #ruby
randym_ joined #ruby
Cy joined #ruby
<Cy>
Hi, can anybody tell me why the output for this script is the same for str and orig? http://pastebin.com/DpaB3BJd
<Tasser>
Cy, ruby works via references
<Cy>
Thanks Tasser got it now
<visof>
i'm trying to write very some brainfuck interpreter in ruby but i don't know how can i implement [ loop Tasser
<visof>
can anyone check the code and help me how can i do the missing part?
<Tasser>
visof, I suppose you'll have to look for the other, right?
<Tasser>
visof, so have fun with context-free grammars ;-)
<visof>
Tasser: yeah
Cy left #ruby
<dotemacs>
Hi, trying to create a gem and I see that people include {spec/feature} files with them. But since the gem I wrote uses VCR, for stubbing external API calls, if I do include the specs, then gem creation bombs out with Gem::Package::TooLongFileName. This is due to the limit of the files names that are allowed to be included with the gem being only up to 100 characters in size and my VCR cassettes a
<dotemacs>
re named after the examples they support. So what should I do, just omit the specs from the gem or ... ? Thanks
fermion joined #ruby
RomD joined #ruby
nelsnelson joined #ruby
<dotemacs>
any ideas?
fixl joined #ruby
nelsnelson joined #ruby
<rpowell>
quick question, I have an array full of FixNums and I want to get the sum of them all
<rpowell>
how do I do that quickly?
iocor joined #ruby
<rpowell>
I mean I could do like `array.each { |item| some_external_var += item }`
<rpowell>
but surely there's a better way?
<nelsnelson>
[1,3,4].reduce(:+)
randym joined #ruby
_SHO_ joined #ruby
Pip joined #ruby
Pip joined #ruby
banisterfiend joined #ruby
tatsuya_o joined #ruby
Seisatsu joined #ruby
ciunix joined #ruby
<ciunix>
hi all I'd like to install some gems in my ubuntu desktop. I did "gem install slim" and it was ok, after when I try to use it eg. require "slim" I get an error
<ciunix>
could you help me to solve that?
fortysixandtwo joined #ruby
ognevsky_ joined #ruby
<shevy>
ciunix what ruby version are you using
<ciunix>
I'm using ruby 1.8.7
<shevy>
ciunix before the line with require "slim"
<shevy>
try to insert:
<shevy>
require "rubygems"
<shevy>
and see if that has fixed the issue
<ciunix>
ok I try
<ciunix>
it's fantastic... It works
<shevy>
good! a solved problem is a good problem
<ciunix>
yes
<ciunix>
where are you from
<shevy>
austria
<ciunix>
uh where
<ciunix>
uh we are closed
<ciunix>
i'm italian
<shevy>
where from Italy?
<ciunix>
near milan
<shevy>
Treviso is my favourite town
<ciunix>
I never been there
<shevy>
I am more in the northeastern area... though Trieste is not beautiful at all (Castle Miramare is nice though)
<shevy>
most of the Bioruby guys from Italy are in Milano
<ciunix>
eheh
<ciunix>
yes in milano is happening some of good at this time
<shevy>
:)
<shevy>
never been there
<Tasser>
ciunix, did you vote for berlusconi?
<ciunix>
a lot of guys are trying to build some IT startup
<shevy>
in Milano?
<ciunix>
in milan
<ciunix>
yes
<shevy>
seems to be the IT center of Italy :)
<shevy>
New York in Italy hehe
<ciunix>
No I don't vote berlusconi
<ciunix>
no I don't think so
<ciunix>
but it's a beginning
<ciunix>
we are in a big financial crysis then people start to own business
<shevy>
hmm
<shevy>
reshuffling the distribution of wealth!
<ciunix>
eheh
hinogi joined #ruby
<Tasser>
shevy, nah, crisis often polarize the distribution
clockwize joined #ruby
<shevy>
reshuffling means ... can happen by a distribution to many ... or by distributing to few :)
<shevy>
Tasser watch your savings!
<ciunix>
mm It could be a good idea if the distribution were distribuited to all.. In this way all could benefit and then the wealth could increase
<ciunix>
ok too much philosophyc eheh
benlangfeld joined #ruby
<shevy>
ciunix there are like 10000 different philosophies and ideas
<ciunix>
yes it's true
mikespokefire joined #ruby
x0F_ joined #ruby
xissburg joined #ruby
cdepue joined #ruby
robyonrails joined #ruby
jbw joined #ruby
fermo joined #ruby
trivol joined #ruby
mklappstuhl joined #ruby
peterwald joined #ruby
ChampS_ joined #ruby
Spockz joined #ruby
maxok joined #ruby
smgt joined #ruby
Shrink joined #ruby
stephenjudkins joined #ruby
Kanolesic joined #ruby
io_syl joined #ruby
_debo joined #ruby
tonini joined #ruby
io_syl joined #ruby
ikaros joined #ruby
visof joined #ruby
ph^ joined #ruby
vitoravelino joined #ruby
Seisatsu joined #ruby
flip_digits joined #ruby
crankycoder joined #ruby
cynosure joined #ruby
stringoO joined #ruby
fermion left #ruby
Zimsky left #ruby
randym joined #ruby
asQuirreL joined #ruby
BiHi joined #ruby
fl0w joined #ruby
gkunno joined #ruby
crankycoder joined #ruby
krz joined #ruby
Zimsky joined #ruby
flippingbits joined #ruby
banisterfiend joined #ruby
tburns joined #ruby
trivol joined #ruby
Guest35080 joined #ruby
mksm joined #ruby
g0bl1n joined #ruby
xpot joined #ruby
Rango joined #ruby
jgrimes joined #ruby
jgrimes joined #ruby
p0y joined #ruby
pen joined #ruby
jensn joined #ruby
rickmasta joined #ruby
Pip joined #ruby
ggtoo joined #ruby
Natch| joined #ruby
jtrudeau joined #ruby
nonotza joined #ruby
Natch| joined #ruby
smgt joined #ruby
amacgregor joined #ruby
_SHO_ joined #ruby
Silker joined #ruby
nanderoo joined #ruby
trivol joined #ruby
nicoulaj joined #ruby
Alvo joined #ruby
<Alvo>
hi, i see "require 'msf/core'"
<Alvo>
but 'msf/core' is a directory containing rb files, and ruby is saying it cannot find the file 'msf/core'
<Alvo>
how can i fix that?
DaZ joined #ruby
<Tasser>
Alvo, you require ruby files (without the .rb suffix)
<Alvo>
Tasser but it is a directory
bosphorus joined #ruby
<Alvo>
Tasser i downloaded an example
<Alvo>
or actually what i want to get to work, not an example, so i'd like to get exactly this to work
crankycoder joined #ruby
bwlang joined #ruby
<shevy>
Alvo you don't require directories
tommyvyo joined #ruby
<shevy>
usually if you tend to have a directory called foobar/
<shevy>
you also have a file foobar.rb
<shevy>
which then loads the .rb files inside foobar/ (or foobar/lib )
<banisterfiend>
sepp2k: "after a certain age a man must take responsibility for his face"
mksm joined #ruby
Manhose_ joined #ruby
Alvo left #ruby
<sepp2k>
banisterfiend: Is that your way of telling me that you're sick of seeing my ugly visage?
Manhose__ joined #ruby
<banisterfiend>
sepp2k: no, i just wanted to type something german and profound (nietzsche) in your direction so that you would think i was well read and intelligent
<sepp2k>
I don't think that's by Nietzsche.
awesome_ joined #ruby
<banisterfiend>
sepp2k: you're right it's albert camus
Natch| joined #ruby
Manhose_ joined #ruby
bbttxu joined #ruby
<banisterfiend>
sepp2k: but it's almost more impressive to attribute the quote to the wrong person but a still person who writes about the same kind of thing as it implies i've read widely enough to be familiar with a number of authors, instead of just clinging desperately to one little quote and one little author
<banisterfiend>
i reached into the ocean of my knowledge and pulled out a lobster instead of a crayfish
<sepp2k>
That's one way to spin it :p
kstt joined #ruby
mdel joined #ruby
jwmann joined #ruby
iamjarvo joined #ruby
malkomalko joined #ruby
<kstt>
for your information, funkr brings functional programming structures to ruby (algebraic data types, pattern matching, functors, monoids, monads ...) : http://rubygems.org/gems/funkr
theRoUS joined #ruby
james_cotterill joined #ruby
iocor joined #ruby
strife25 joined #ruby
<ccooke>
kstt: any documentation for the capabilities that isn't just reading the code?
<kstt>
there is documentation, though it isn't great for sure
workmad3 joined #ruby
tomzx joined #ruby
Manhose__ joined #ruby
benlangfeld joined #ruby
negaduck joined #ruby
benlangfeld joined #ruby
<negaduck>
hi! what does this mean? "Sinatra::Templates#erubis is deprecated and will be removed, use #erb instead.
<negaduck>
If you have Erubis installed, it will be used automatically."
<iamjarvo>
this is a bit off topic but whats the best way to ping a url and fake a get request
<HNDavid>
what do you mean, fake a get request?
kstt left #ruby
albemuth joined #ruby
roaminghorse joined #ruby
dotnull joined #ruby
<workmad3>
iamjarvo: pinging and a HTTP GET request are two very different things...
<iamjarvo>
so there is this contest and for some reason they allowed unlimited voting and i inspected and got the url to vote for the group i support. So i was thinking of building something to just ping the url every so often during the day
<iamjarvo>
so that can be accomplished with curl right?
daniel_hinojosa1 joined #ruby
vitoravelino joined #ruby
cdepue joined #ruby
expea joined #ruby
<koala_man>
iamjarvo: yes
dazoakley joined #ruby
sbanwart joined #ruby
Manhose joined #ruby
<iamjarvo>
koala_man: it keeps failing thought
Manhose_ joined #ruby
fetimo joined #ruby
banisterfiend joined #ruby
bier|tp joined #ruby
bier joined #ruby
Shrink joined #ruby
rippa joined #ruby
<koala_man>
iamjarvo: could be a post rather than a get
booginga joined #ruby
caveat- joined #ruby
<iamjarvo>
thanks
dnjaramba joined #ruby
<workmad3>
iamjarvo: that's not pinging
banisterfiend joined #ruby
xissburg joined #ruby
<iamjarvo>
workmad3: you mean i have the terminology wrong or strategy
<workmad3>
iamjarvo: terminology :)
<workmad3>
iamjarvo: a ping is a specific type of network request
<JonnieCache>
confusingly, people do seem to use ping as a generic term these days
<iamjarvo>
ooo i see. request keeps failing
BrokenCog joined #ruby
csavola joined #ruby
<JonnieCache>
use firebug or something to see what a real vote looks like, then replicate that exactly
<workmad3>
JonnieCache: true, but that doesn't make it right :)
<JonnieCache>
if the people are competant it will use a csrf token or something like rails does, and you wont be able to do it
<JonnieCache>
if you make your poll easily riggable with cURL in 2011 you deserve to have your poll rigged imo
<workmad3>
iamjarvo: and if you vote again, does that value change?
<iamjarvo>
nope
<iamjarvo>
it just moves the order
<iamjarvo>
abut the params are always the same
<workmad3>
iamjarvo: yeah, this deserves hacking :)
JumpMast3r joined #ruby
enroxorz joined #ruby
* workmad3
wonders if a mechanize script would be a bit easier
p0y joined #ruby
<iamjarvo>
well i was just going to fire a script every so often
<iamjarvo>
witht he curl
Ankhers joined #ruby
rooijaro_ joined #ruby
apok joined #ruby
<JonnieCache>
you probably need to find out what other headers are being sent, Referer is a good candidate
<workmad3>
that's why I was wondering if mechanize would be easier :)
<iamjarvo>
workmad3: like something that goes to the page and does it?
blischalk joined #ruby
Jrz joined #ruby
<JonnieCache>
yeah that could work. selenium also.
<workmad3>
iamjarvo: mechanize is a library for doing that sort of stuff, yeah :)
<workmad3>
iamjarvo: doesn't need FF installed like selenium would though
<JonnieCache>
the form uses javascript though
soimort joined #ruby
Helius joined #ruby
<iamjarvo>
yea jquery ajax
<iamjarvo>
i would be interested in that
<workmad3>
ah, selenium would make sense then :)
fetimo_ joined #ruby
<workmad3>
or maybe capybara-webkit
<JonnieCache>
that value in the url might be a session identifier, it might hook into the cookies as well
<JonnieCache>
there's a few different ways it could work
<workmad3>
iamjarvo: selenium would probably be the easiest tbh... you could install the selenium recorder in your browser, record a session of going to the site (maybe with login, etc)
<workmad3>
iamjarvo: and then you have a script you can just run repeatedly :)
<v0n>
{True,False}Class are too funny. I still don't understand why there's no Boolean class :)
james_cotterill joined #ruby
<JonnieCache>
v0n: you mean as a parent class for TrueClass and FalseClass?
<iamjarvo>
workmad3: alright i will give it a try
<workmad3>
v0n: why would you need one?
Cervajz joined #ruby
<v0n>
JonnieCache, why not
<workmad3>
v0n: after all, it would increase the number of classes involved there by 50% for no real gain in a duck-typed language
niklasb joined #ruby
<v0n>
workmad3, when you want to act on booleans, you have to check if v.is_a?(TrueClass) || v.is_a?(FalseClass)...
<JonnieCache>
ahh that is one good reason. but why would you need to do that?
<JonnieCache>
this isnt java ;)
<workmad3>
v0n: or you just rely on truthy and falsy values ;)
stepnem joined #ruby
<v0n>
workmad3, JonnieCache what about Fixnum, Integer, Bignum? =)
<iamjarvo>
so this is an extra noob question
<iamjarvo>
i need to patch my version of ruby
ckrailo joined #ruby
<v0n>
JonnieCache, I'm building queries, and if the value is a boolean it should stay like that or if it's a string it should be replaced by "%#{str}%" (something like that)
<linduxed>
what does the @ in @object mean?
<iamjarvo>
and i have the link to the the path how do i go about doing that
<workmad3>
v0n: Fixnum and Bignum share a lot of implementation though :)
<linduxed>
something about instance variables?
<linduxed>
or class variables?
<workmad3>
linduxed: @ defines an instance variable
<JonnieCache>
v0n: Numeric actually has behaviour though. Boolean would just be an abstract class.
<linduxed>
workmad3: ok
Manhose joined #ruby
p0y_ joined #ruby
<JonnieCache>
v0n: have a look at ruby's case statement. it can do some powerful things
<JonnieCache>
you can case on obj.is_a? and things iirc
benlangfel joined #ruby
banisterfiend joined #ruby
btanaka joined #ruby
<v0n>
JonnieCache, I know, but I don't get your point
<JonnieCache>
im just generally saying if you embraced duck typing more in your design the problem might not seem so bad
<JonnieCache>
but i dont think i really understand your problem so maybe you should just ignore me
ceej joined #ruby
banisterfiend joined #ruby
<v0n>
JonnieCache, I get your point. did you mean using something like `case v; when true, false then "boolean"`?
<spyvrsspy>
Im parsing a log file, and I want to grab lines that have a phrase in it, and then I want to only break down the lines w/ that phrase with more regex
<rb2k>
hey, anybody using god to monitor processes?
<rb2k>
I was wondering if there are "default" stop / restart tasks
<kenperkins>
can someone help me parse this error? I don't really know gems at all, but I need ruby-shadow for puppet to manage passwords: https://gist.github.com/1443610
<rb2k>
restart is usually just a stop + a start
<rb2k>
kenperkins: you need the ruby-dev package
<kenperkins>
I thought I had that, brb
<kenperkins>
thanks!
<spyvrsspy>
csavola, can I pass a varaible to Time.mktime?
altivec joined #ruby
poppiez joined #ruby
youdonotexist joined #ruby
io_syl joined #ruby
<poppiez>
when doing loop do end how do you skip an iteration? I know I can do "break" to exit it
headius joined #ruby
statbot joined #ruby
<rippa>
poppiez: continue
davidcelis joined #ruby
thone joined #ruby
<rippa>
or not
<rippa>
poppiez: next
<poppiez>
ah nice, thx :)
eywu joined #ruby
<iamjarvo>
workmad3: got the ide running :)
<ggtoo>
popiez
chsonnu joined #ruby
craigglennie joined #ruby
iocor joined #ruby
rushed joined #ruby
robbyoconnor joined #ruby
becom33 joined #ruby
rubyruy joined #ruby
<becom33>
in the word "Hello1New" how can I just grab the number "1" and store it in a variable ?
<shevy>
becom33 there are many ways
albemuth joined #ruby
<becom33>
shevy: a good way please ?
<shevy>
x = "Hello1New" # => "Hello1New"; x =~ /(\d+)/ # => 5; $1 # => "1"
<shevy>
No, I don't make a "good" way. I show you one way. It is up to someone else to decide if it is good or bad.
dasfugufish joined #ruby
<becom33>
does have name for that method ur using ? shevy
<shevy>
This example uses a regex. With () you catch the interesting part and store it in a variable.
<shevy>
$1 is the first variable, $2 the second captured group
<becom33>
thanx
<becom33>
I'll look it up
<shevy>
becom33, see this example:
<shevy>
x = "Hello1New5Old" # => "Hello1New5Old"
<shevy>
x =~ /(\d+).+(\d+)/ # => 5
<shevy>
$1 # => "1"
<shevy>
$2 # => "5"
ank joined #ruby
<shevy>
the first () goes into $1, the second () goes into $2 and so on
<becom33>
alright :)
DrShoggoth joined #ruby
Beoran_ joined #ruby
thepix joined #ruby
fetimo joined #ruby
cbuxton joined #ruby
adamkittelson joined #ruby
fra000 joined #ruby
quest88 joined #ruby
JumpMast3r joined #ruby
linoj joined #ruby
linguini joined #ruby
julian-delphiki joined #ruby
<linguini>
I've never ran the ruby debugger before; does it exist? Can it attach to a running ruby process?
<hydrozen>
how can I run a shell command though Ruby and output the output of the command on the fly?
<sandstrom>
I've got some encoding problems. When I read the csv into ruby this character "\232" appears. I'm pretty certain it is an "ö" (if you can read that). UniversalDetector (gem) tells me it's iso-8859-2, but they typically don't look like that (\232) when shown as utf 8.
<swills>
how many rubygems are there? http://rubygems.org/stats says 31,497 but i think that's counting all verions and i just want to count latest version of each
statbot2 joined #ruby
Pip_ joined #ruby
Pip_ joined #ruby
<Clooth>
write a scraper, swills
statbot2 joined #ruby
<swills>
oh wait, gem list --remote | wc -l
<shevy>
:)
<swills>
31127
<shevy>
not bad
<shevy>
30k projects
<shevy>
how many are on CPAN?
<swills>
wonder why the 370 difference
<swills>
http://www.cpan.org/ says The Comprehensive Perl Archive Network (CPAN) currently has 102,006 Perl modules in 23,897 distributions, written by 9,388 authors, mirrored on 269 servers.
<shevy>
oh
<shevy>
getting there :)
<shevy>
what means in "23.897" distributions?
<swills>
distribution = .tar.gz
<swills>
or whatever
<swills>
they package multiple modules in each distribution
<swills>
so Foo::Bar and Foo::Baz are modules but the're both in the Foo-1.2.tar.gz distribution
<swills>
i wish the rubygems.org/stats page were more extensive
GreaseMonkey joined #ruby
statbot2 joined #ruby
<Black>
Is there one of your who knew a class which allors to manage UDP as TCP (ie with a server and a connection)? For your help, in advance, thanks
sodani joined #ruby
guilloti1e138 joined #ruby
joallard joined #ruby
kirun joined #ruby
Sirecote joined #ruby
dankest joined #ruby
Morkel joined #ruby
strife25_ joined #ruby
statbot2 joined #ruby
dv_ joined #ruby
statbot2 joined #ruby
Tuxist joined #ruby
macmartine joined #ruby
mickn joined #ruby
mickn joined #ruby
mickn joined #ruby
banisterfiend joined #ruby
sbanwart joined #ruby
tburns joined #ruby
michael_mbp joined #ruby
badabim joined #ruby
apucacao joined #ruby
crodas joined #ruby
Gate joined #ruby
hadees joined #ruby
bafilius_ joined #ruby
tatsuya_o joined #ruby
statbot joined #ruby
nelsnelson joined #ruby
workmad3 joined #ruby
axl_ joined #ruby
AutoMan joined #ruby
axl__ joined #ruby
ChampS_ joined #ruby
axl___ joined #ruby
sodani left #ruby
ciunix joined #ruby
<ciunix>
Could you help me in installing rubygems in my ubuntu 11.04 and ruby 1.9.2?
mickn joined #ruby
sandstrom joined #ruby
sandstrom joined #ruby
AutoMan left #ruby
rpowell joined #ruby
Adkron joined #ruby
fra000 joined #ruby
RORgasm joined #ruby
<ciunix>
I I'm a newbie in ruby, I'm trying to write some code.. I created 2 files foo.rb and bar.rb.. I'm trying to write require "bar" in foo.rb but I get some error.. could you explain me why?
apucacao joined #ruby
_kinderman_ joined #ruby
havenn joined #ruby
seivan joined #ruby
bier|tp joined #ruby
lucasgonze joined #ruby
Spockz joined #ruby
cdepue joined #ruby
luxurymo_ joined #ruby
yekta joined #ruby
Jake232 joined #ruby
Knodi joined #ruby
PaciFisT joined #ruby
atmosx joined #ruby
banisterfiend joined #ruby
ceej joined #ruby
yekta joined #ruby
Dreamer3 joined #ruby
tburns_ joined #ruby
swills left #ruby
Telling joined #ruby
Cervajz joined #ruby
<Afal>
try require_relative instead of require
eignerchris joined #ruby
Spockz joined #ruby
wallerdev joined #ruby
froy joined #ruby
afomi joined #ruby
bluebie joined #ruby
Targen_ joined #ruby
ryansch joined #ruby
gener1c joined #ruby
<gener1c>
ls
<gener1c>
wtf did i just write
<gener1c>
i am tryng to run a ruby script that accesses files with crontab
luckyruby joined #ruby
ChampS_ joined #ruby
<gener1c>
but it doesnt work since crontab runs it using absolute path and not from inside its dir
<gener1c>
how do i fix it?
RomD` joined #ruby
zykes- joined #ruby
<zykes->
hmmm, doesn't Alias in apache work with Phusion apps ?
grekko joined #ruby
<zykes->
or is that not possible ?
kennethreitz joined #ruby
chrxn joined #ruby
yfeldblum joined #ruby
senj joined #ruby
hinogi joined #ruby
hinogi joined #ruby
yfeldblum joined #ruby
workmad3 joined #ruby
<SegFaultAX|work>
Is it just me or does the Rack documentation suck. Like, really suck.
<zykes->
SegFaultAX|work: i think so as well :p, trying to get puppet-dashboard running as a Alias on nginx
<zykes->
ehm, apache
<zykes->
anyone know how ?
<gener1c>
i want to run a ruby script with crontab and the ruby script opens a file in the same dir without using absolute path
<gener1c>
how do i do that?
<gener1c>
add in crontab a line that adds that dir to PATH?
dyer joined #ruby
youlysses joined #ruby
h4mz1d joined #ruby
pen_isident joined #ruby
rb2k joined #ruby
<yfeldblum>
your ruby script can do `File.dirname(__FILE__)` to find out the directory containing the ruby script file
decaf joined #ruby
decaf left #ruby
<zykes->
noone running phusion ?
DDAZZA joined #ruby
Spockz joined #ruby
<shevy>
zykes- I dont, probably most others neither
Spockz joined #ruby
<zykes->
shevy: what's the usual thing then to run a ruby webapp under ?
manizzle joined #ruby
<shevy>
zykes- no idea. I use ruby-cgi
nanderoo left #ruby
<ReinH>
what
<ReinH>
use rack
<shevy>
what for
<zykes->
ReinH: i think that's what it runs
<zykes->
isn't that with phusion ?
<ReinH>
rack is an adapter layer between servers and frameworks
<ReinH>
puppet-dashboard runs rails
<ReinH>
so you can deploy it any way a rails app can be deployed
<ReinH>
I should know. I wrote it.
yekta joined #ruby
<zykes->
you wrote pdb ?
<ReinH>
yep
<zykes->
got any config example of it running under Alias x x ?
<ReinH>
nope
<zykes->
is it possible to run rails stuff under a Alias in apache ?
<ReinH>
not afaik
<ReinH>
you use virtual hosts
minijupe joined #ruby
<yfeldblum>
rack is a common interface for connecting any webapp you may want to write in ruby to any appserver (thin, unicorn, goliath, etc) you may want to use to host the app
<zykes->
ReinH: I have a ssl vhost, I want several things to run under there
<ReinH>
...
<ReinH>
ok then read the part on deploying to a sub URI
<ReinH>
RTFM dude
Tachyx joined #ruby
<zykes->
already done that, but it requires setting a different doc root then the one already in use for the vhost, which i think doesn't work or ? I can't seem to get it to work at least
stephenjudkins joined #ruby
altivec joined #ruby
<zykes->
so yeah ReinH already did
ph^ joined #ruby
apucacao joined #ruby
jgrimes joined #ruby
DDAZZA joined #ruby
xyzodiac joined #ruby
atmosx joined #ruby
Manhose joined #ruby
lkb joined #ruby
nighty- joined #ruby
Pip joined #ruby
wallerdev joined #ruby
macmartine joined #ruby
stringoO joined #ruby
headius joined #ruby
eywu1 joined #ruby
eywu1 left #ruby
eywu1 joined #ruby
eywu1 joined #ruby
Azure joined #ruby
<zykes->
ReinH: but SubURI should be the appropriate thing ?
n3m joined #ruby
bbttxu joined #ruby
Manhose_ joined #ruby
zleslie joined #ruby
<zleslie>
Hi
snitko joined #ruby
<andrewvos>
zleslie: Just ask the question :)
<zleslie>
I set an environment variable with ENV["BLA"]. Then I run a subshell and the ENV["BLA"] is not available
<zleslie>
andrewvos: :) yes yes, I was typing
<zleslie>
So how do I get my backtick subshell to receive the environment variable
<zleslie>
?
_kinderman joined #ruby
QaDeS joined #ruby
fragrant joined #ruby
perryh joined #ruby
<fragrant>
Hi, i have to ask a newbie question , obj[:key] , is it a array or hash ? How can i check whether it's empty or not , blank or not has an element or not ?
mikewintermute joined #ruby
macmartine joined #ruby
<Liothen>
obj[:key].empty?
<udk>
fragrant: try this: p obj.class :)
<udk>
fragrant: given that you now know its a hash, google for "rdoc hash" and you'll get a page with all its methods and examples
<udk>
or you can use rdoc locally too
<Liothen>
also obj[:key].nil? works well too
Mcilvena joined #ruby
pete` joined #ruby
pjeide joined #ruby
<iamjarvo>
has anyone read this book Build Awesome Command-Line
<iamjarvo>
Applications in Ruby
<Liothen>
yes
<pjeide>
Hey guys, what do you think about this? I am having issues with my Ruby installation. One moment I can ruby -v, the next I can't (LoadError)