margle has quit [Quit: Computer has gone to sleep.]
justinmcp has joined #ruby
undersc0re97 has joined #ruby
chimay has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
icole has quit [Ping timeout: 264 seconds]
Solnse2 has joined #ruby
sepp2k has joined #ruby
justinmcp has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
Solnse has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 252 seconds]
pskosinski has joined #ruby
Solnse2 has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
<RubyPanther>
are you sure it isn't an advertisement?
postmodern has quit [Quit: Leaving]
eroc has joined #ruby
<pmros>
sorry
<pmros>
it's disgusting
<RubyPanther>
most GUIs are
<pmros>
it's depend on user
reset has quit [Quit: Leaving...]
margle has joined #ruby
arturaz has quit [Remote host closed the connection]
samphippen has joined #ruby
<shevy>
pmros did you make a gem?
<pmros>
yes, I did
lggr has quit [Ping timeout: 245 seconds]
<shevy>
oh dang
<pmros>
troshka
<shevy>
Error installing troshka: troshka requires Ruby version >= 1.9.0.
<shevy>
I am currently on 1.8.x again
<pmros>
oh, I'm sorry
<pmros>
it does requiere ruby version >= 1.9.0
postmodern has joined #ruby
dfmoser has joined #ruby
<pmros>
RubyPanther, shevy, thank you for your feedback
<pmros>
I've to go
<pmros>
see you!
pmros has quit [Quit: Konversation terminated!]
lggr has joined #ruby
prtksxna has joined #ruby
Xeago has joined #ruby
jgrevich has quit [Quit: jgrevich]
margle has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ruby
pskosinski has quit [Read error: Connection timed out]
pskosinski has joined #ruby
bluOxigen has joined #ruby
JonnieCache has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
AMfish has joined #ruby
lggr has joined #ruby
mvangala has quit [Ping timeout: 248 seconds]
Companion has quit [Ping timeout: 252 seconds]
JonnieCache has quit [Ping timeout: 246 seconds]
eroc has quit [Quit: eroc]
timonv has quit [Remote host closed the connection]
Companion has joined #ruby
Companion has joined #ruby
Companion has quit [Changing host]
lggr has quit [Ping timeout: 240 seconds]
vlad_starkov has joined #ruby
lggr has joined #ruby
LouisGB has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
<shevy>
hmm
piotr_ has joined #ruby
margle has joined #ruby
sspiff has quit [Remote host closed the connection]
lggr has joined #ruby
awestroke has quit [Remote host closed the connection]
arietis has joined #ruby
AndChat| has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
robustus has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
AndChat- has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
Banistergalaxy has joined #ruby
lggr has joined #ruby
AndChat| has quit [Ping timeout: 256 seconds]
margle has quit [Quit: Computer has gone to sleep.]
AndChat- has quit [Ping timeout: 256 seconds]
ryanf has quit [Quit: leaving]
Zai_ has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
AndChat| has joined #ruby
vlad_starkov has joined #ruby
AndChat- has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
niklasb has joined #ruby
lggr has joined #ruby
futilegames has joined #ruby
SeySayux_ has joined #ruby
Banistergalaxy has quit [Ping timeout: 256 seconds]
Xeago has quit [Read error: Connection reset by peer]
SeySayux has quit [Ping timeout: 240 seconds]
AndChat| has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
SeySayux_ is now known as SeySayux
Villadelfia has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby
AndChat| has joined #ruby
eldariof has joined #ruby
Villadelfia has joined #ruby
AndChat- has quit [Ping timeout: 260 seconds]
justinmcp has joined #ruby
Iszak has joined #ruby
Iszak has quit [Changing host]
Iszak has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
dpk has joined #ruby
a_a_g has joined #ruby
reuf has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
Xeago has quit [Read error: Connection reset by peer]
bigmeow has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
Xeago has joined #ruby
fantazo has quit [Remote host closed the connection]
morozovm has joined #ruby
a_a_g1 has joined #ruby
a_a_g1 has quit [Client Quit]
a_a_g has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby
AndChat- has joined #ruby
bigmeow has joined #ruby
awestroke has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
AndChat| has quit [Ping timeout: 260 seconds]
x0F_ is now known as x0F
lggr has quit [Ping timeout: 256 seconds]
Banistergalaxy has quit [Ping timeout: 240 seconds]
seme has joined #ruby
seme is now known as Guest29553
<arietis>
is there any email address parser for ruby?
<arietis>
i have .doc file with e-mails
<arietis>
and i wanna parse it out
lggr has joined #ruby
colinbm has quit [Quit: colinbm]
Guest29553 is now known as _seme
ltsstar has joined #ruby
Neomex has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
futilegames_ has joined #ruby
futilegames has quit [Ping timeout: 256 seconds]
futilegames_ is now known as futilegames
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
<_seme>
hey guys can anyone think of a reason that (from irb) when I type instances[0][:instance].inspect it prints "\"NA0 (SSL) \"" and "NA0 (SSL) ".strip prints "NA0 (SSL)" but instances[0][:instance].strip prints "NA0 (SSL) ".... freaking anonying :)
IPGlider has joined #ruby
<_seme>
and I've tried strip! with the same result
IPGlider is now known as Guest4365
murz has quit [Quit: Leaving...]
<_seme>
I'm about ready to pull my hair out
bigmeow has quit [Ping timeout: 244 seconds]
Guest4365 has quit [Client Quit]
ltsstar has quit [Ping timeout: 260 seconds]
IPGlider_ has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
arturaz has joined #ruby
fixl has joined #ruby
bigmeow has joined #ruby
hackeron has quit [Remote host closed the connection]
IPGlider_ is now known as IPGlider
lggr has joined #ruby
timonv has joined #ruby
Banistergalaxy has joined #ruby
AndChat| has joined #ruby
icole has joined #ruby
grizlo42 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 252 seconds]
<_seme>
ok I think I figured it out
<_seme>
it appears that there is a bug in strip where it doesn't actually strip teh remaining whitespace on a string that ends with some multi-byte (ie UTF8) characters
AndChat- has quit [Ping timeout: 240 seconds]
Banistergalaxy has quit [Ping timeout: 252 seconds]
Xeago has quit [Remote host closed the connection]
LouisGB has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
vjt has quit [Ping timeout: 272 seconds]
Xeago has joined #ruby
Hamed-R has quit [Ping timeout: 246 seconds]
chussenot has joined #ruby
nilg has quit [Ping timeout: 256 seconds]
daniel_- has joined #ruby
Virunga has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Eplemosen has joined #ruby
lggr has joined #ruby
moshee has quit [Ping timeout: 246 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
chussenot has quit [Ping timeout: 255 seconds]
gyre008 has joined #ruby
Banistergalaxy has joined #ruby
<gyre008>
have a question..I need to include a path to libraries to my ruby file but can't figure out how to do that...
AndChat- has joined #ruby
<gyre008>
im a ruby n00b
<gyre008>
sysad…not a programmer
<apeiros_>
$LOAD_PATH is what ruby searches for libraries
<apeiros_>
it's a plain array, so you can modify it within ruby code. alternatively you can use the -I (capital i) option with the ruby executable.
<apeiros_>
another alternative would be to use gems.
lggr has quit [Ping timeout: 240 seconds]
AndChat| has quit [Ping timeout: 252 seconds]
<gyre008>
apeiros_, thanks…basically I have the following file https://gist.github.com/3847899 which is located in /usr/sbin …and I need it to be aware of the libraries which are in /usr/lib/ruby/vendor_ruby/chef/
Banistergalaxy has quit [Ping timeout: 260 seconds]
triptec has joined #ruby
mucker has joined #ruby
A124 has joined #ruby
Dawne has joined #ruby
lggr has joined #ruby
<gyre008>
not really sure what to do :)
ChampS666 has joined #ruby
Virunga has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
AndChat| has joined #ruby
Xeago has quit [Remote host closed the connection]
ltsstar has quit [Remote host closed the connection]
ltsstar has joined #ruby
sagax has quit [Quit: Ухожу я от вас]
Boohbah is now known as Guest86326
lggr has quit [Ping timeout: 264 seconds]
JonnieCache has quit [Ping timeout: 256 seconds]
icole has quit [Ping timeout: 264 seconds]
lggr has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
arturaz has quit [Remote host closed the connection]
lggr has joined #ruby
daniel_- has quit [Ping timeout: 246 seconds]
kitofr_ has joined #ruby
kitofr has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 260 seconds]
rTypo has joined #ruby
rTypo has quit [Changing host]
rTypo has joined #ruby
lggr has joined #ruby
deadalus has joined #ruby
kitofr has joined #ruby
deadalus has quit [Changing host]
deadalus has joined #ruby
kitofr_ has quit [Ping timeout: 245 seconds]
Neomex has quit [Quit: Neomex]
codefyre has joined #ruby
hackeron has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Virunga has joined #ruby
lggr has joined #ruby
dfmoser has quit [Quit: dfmoser]
dfmoser has joined #ruby
IPGlider has quit []
jimeh2 has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
zommi has quit [Quit: Leaving.]
chimay has quit [Remote host closed the connection]
emergion has joined #ruby
lggr has joined #ruby
timonv has quit [Remote host closed the connection]
chimay has joined #ruby
jimeh2 has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 246 seconds]
JonnieCache has joined #ruby
daniel_- has joined #ruby
AMfish has quit [Ping timeout: 260 seconds]
psychouroboros has joined #ruby
timonv has joined #ruby
deadalus has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
bluenemo has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
justinmcp has quit [Remote host closed the connection]
eldariof has quit []
bluOxigen has joined #ruby
Jork1 has joined #ruby
icole has joined #ruby
lggr has joined #ruby
hgf has joined #ruby
eldariof has joined #ruby
timonv has quit [Remote host closed the connection]
icole has quit [Ping timeout: 252 seconds]
F1skr has joined #ruby
hackeron_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 248 seconds]
daniel_- has quit [Ping timeout: 245 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
hackeron has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
justinmcp has joined #ruby
_seme has quit [Ping timeout: 256 seconds]
icole has joined #ruby
icole has quit [Read error: Connection reset by peer]
gmci has joined #ruby
icole has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9]
lggr has quit [Ping timeout: 260 seconds]
F1skr has joined #ruby
lggr has joined #ruby
icole has quit [Ping timeout: 256 seconds]
piotr__ has joined #ruby
timonv has joined #ruby
piotr_ has quit [Ping timeout: 246 seconds]
jimeh2 has joined #ruby
etherdev has joined #ruby
etherdev has quit [Client Quit]
Oprr has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
`brendan has quit [Read error: Connection reset by peer]
`brendan has joined #ruby
lggr has joined #ruby
framling has quit [Quit: Lost terminal]
AMfish has joined #ruby
justinmcp has quit [Remote host closed the connection]
framling has joined #ruby
`brendan has quit [Ping timeout: 264 seconds]
<_bart>
boo!
demian`_ has quit [Quit: demian`_]
timonv has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
timonv has joined #ruby
margle has joined #ruby
jimeh2 has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
rTypo has quit [Read error: No route to host]
rTypo has joined #ruby
answer_42 has quit [Remote host closed the connection]
answer_42 has joined #ruby
rTypo has quit [Read error: Connection reset by peer]
rTypo has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
Dawne has quit [Quit: Leaving.]
timonv has quit [Remote host closed the connection]
lggr has joined #ruby
arkiver has joined #ruby
alex__ has joined #ruby
jcoglan has quit [Quit: Leaving]
rTypo has quit [Ping timeout: 245 seconds]
psychouroboros is now known as deadalus
deadalus has quit [Changing host]
deadalus has joined #ruby
elico has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
ChampS666 has quit [Ping timeout: 246 seconds]
BMF has joined #ruby
triptec has quit [Quit: triptec]
lggr has joined #ruby
ChampS666 has joined #ruby
futilegames has quit [Quit: futilegames]
maxok has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
codefyre has quit [Quit: Leaving]
anandhegde has joined #ruby
lggr has joined #ruby
axl_ has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9]
JonnieCa1he has joined #ruby
apeiros_ has quit [Remote host closed the connection]
alex__ has quit [Ping timeout: 264 seconds]
joofsh has joined #ruby
sashman has quit [Ping timeout: 276 seconds]
t0rc has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
kain has joined #ruby
lggr has joined #ruby
<kain>
hello, I have a normal ruby class with instance methods calling external services and they can potentially throw the same set of exceptions. I'd like to know what's the best way to have those exceptions rescued in a common place in the code
chimkan_ has joined #ruby
<t0rc>
best way is the way that works best for your application.
AMfish has quit []
jimeh2 has joined #ruby
arkiver has quit [Quit: Leaving]
<kain>
t0rc, actually I'm trying to unite in a single instance method all the actions that performs the external calls to have a single place where to rescue from, but it's getting hairy
<JonnieCache>
the problem with that is all your code will have to pass through that single place
<JonnieCache>
which will suck
chimkan_ has left #ruby [#ruby]
<JonnieCache>
probably
<kain>
ye
<t0rc>
yeah that seems like it would get a little hairy
alex__ has joined #ruby
<JonnieCache>
unless for example its a server which has some sort of dispatch method that runs everything
<JonnieCache>
thats how rails allows you to catch all exceptions in the applicationcontroler
Criztian has quit [Remote host closed the connection]
<kain>
canton7, I like the second solution, thanks
elico has quit [Quit: elico]
<vectorshelve>
what is yield exactly ?
<canton7>
called, of course, as do_risky_thing{ my_risky_func }
bigmeow has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 252 seconds]
<canton7>
vectorshelve, calls the block passed to that method
<kain>
yeah I thought about going with a block
<kain>
nice thanks, going back to the implementation ;)
jimeh2 has quit [Ping timeout: 264 seconds]
hgf has left #ruby [#ruby]
Puck6633 has joined #ruby
lggr has joined #ruby
vectorshelve has quit [Ping timeout: 240 seconds]
vectorshelve has joined #ruby
JonnieCache has quit [Quit: Lost terminal]
<vectorshelve>
sorry got logged offf.. what is yield
bigmeow has joined #ruby
<Puck6633>
It's a keyword (I think) that runs the block attached to current method. I think it has other uses but that's the main one.
<burgestrand>
That’s the one use.
timonv has joined #ruby
<burgestrand>
vectorshelve: ^
<vectorshelve>
Puck6633: cool.. any simple example you could give.. I have seen yield being used more often in rails as well
<canton7>
vectorshelve, so `def my_method; yield; end` is equivalent to `def my_method(&block); block.call; end`
<vectorshelve>
canton7: hmm... getting it.. any use case?
gyre008 has left #ruby ["Leaving"]
<canton7>
think of all the library methods you know which take a block
lggr has quit [Ping timeout: 248 seconds]
<vectorshelve>
canton7: nice.. got it..
<canton7>
methods which take a block use one of those 2 ways to call it
<vectorshelve>
well.. is there any way other than through ruby mechanize that I can get results from a web page.. since I dont have an API. This is for writing a gem
<vectorshelve>
canton7: isnt ruby mechanize better than open-uri and net/http ?
<canton7>
probably. more complex for sure
<canton7>
quazimodo, #map ?
<vectorshelve>
canton7: and also.. I will have to parse html at some point using dom elements.. which isnt I believe quite a consistent way to do it.. ryt.. wt if tomorrow they change the page ? :-/
<canton7>
vectorshelve, parsing html = nokogiri
<quazimodo>
oh cool
<quazimodo>
canton7: /me hugs you
<quazimodo>
also [1..5] to make [1, 2, 3, 4, 5] ?
<vectorshelve>
canton7: well.. why did u say mechanize is complex.. I can use it without having to explicitly use nokogiri :)
<vectorshelve>
canton7: is there an api for good dictionary? I am trying to write a gem for dictionary
<t0rc>
I've got a few functions, such as searching/locating files, that are shared throughout my program so I've placed them in a module. Is there any common naming scheme to follow with things like this? i.e. like calling it "FileActions" or something?
<t0rc>
(the module that is)
lggr has quit [Ping timeout: 244 seconds]
<canton7>
vectorshelve, it *is* more complex than net/http. That's not to say it's harder to use, just that it does mroe
<canton7>
quazimodo, (1..5).to_a
<vectorshelve>
canton7: ok
alex__ has left #ruby ["Leaving"]
lggr has joined #ruby
rakunHo has quit [Remote host closed the connection]
<quazimodo>
canton7: ah
postmodern has quit [Quit: Leaving]
vectorshelve has quit [Quit: Page closed]
emmanuelux has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
prtksxna has quit [Remote host closed the connection]
lggr has joined #ruby
icole has joined #ruby
iamjarvo has joined #ruby
conor_ireland has joined #ruby
icole has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 255 seconds]
margle has quit [Quit: Computer has gone to sleep.]
<shevy>
doesn't json have some way to deserliaze and load from a file, like yaml has?
sonnym has joined #ruby
<jrajav>
shevy: That seems superfluous, reading from a file belongs in modules for reading from a file
<jrajav>
Modular code, DRY, blah blah
lggr has quit [Ping timeout: 260 seconds]
<canton7>
both the json and yaml libs can load from an io-like object iirc
<shevy>
I really dont know, I only use yaml so far :)
<shevy>
anything except XML really
wallerdev has joined #ruby
relix has joined #ruby
dotemacs has joined #ruby
SeanTAllen has joined #ruby
lggr has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
mahmoudimus has joined #ruby
hakunin has joined #ruby
ZubKonst has quit [Read error: Connection reset by peer]
<t0rc>
canton7: right so that gets me reading in JSON and sending that hash back to JSON but I mean more converting objects to JSON, etc. I think to_json method or is that outdated? and just use the JSON, and go to and from the hashmap?
Z0idberg has quit [Read error: Connection reset by peer]
anildigital_work has joined #ruby
<bnagy>
json sucks balls
fcoury has joined #ruby
<canton7>
it has its place
lggr has joined #ruby
<bnagy>
true, if I'm looking for a really slow format that doesn't handle binary data and is worse in every measurable way than yaml and Marshal
<bnagy>
json every time
zigomir has joined #ruby
<t0rc>
!war
glyytchy has joined #ruby
<canton7>
don't mock. json's a subset of yaml
<canton7>
the more compact subset, in fact
<canton7>
so if you want to use yaml, but want to send it over a socket and don't want all that whitespace
<canton7>
json!
<shaman42>
seems to me that json is THE markup for api's
<bnagy>
:|
<bnagy>
msgpack
<shaman42>
<- iOS dev who has to parse json responses about every fking day.
<t0rc>
canton7: to turn my custom class into a valid JSON string, what must I do? that's my question. I can read in using JSON.parse, to get a Hash. Should I modify that hash inside my object, and just run to_json on that object again? or should I instead create a method that explicitly generates something else? Seems modifying the hash may provide more problems with more complex members.
dnstbr has quit [Quit: Computer has gone to sleep.]
ScottNYC has joined #ruby
<canton7>
t0rc, ah I see. if the default #to_json doesn't do want you want, just define your own for your class
<canton7>
in terms of deserializing, not sure
<ScottNYC>
whats best practice, installing ruby and gems system wide, or installing as user, or installing ruby system wide and gems as user?
r1ddl3r has joined #ruby
thunderstrike has joined #ruby
verbad has joined #ruby
<bnagy>
imho always install everything as a user
<t0rc>
That has to depend on setup ScottNYC. I would prefer user.
<canton7>
bnagy, msgpack looks interesting. is it ruby-only?
<ScottNYC>
no
ryanlecompte has quit [Remote host closed the connection]
<canton7>
ah no, I see
lggr has quit [Ping timeout: 256 seconds]
<ScottNYC>
ruby gems everything
<bnagy>
canton7: no they have stuff for quite a few langs
<canton7>
sweet, looks nice. does take away from the human-readable element though
verbad has quit [Client Quit]
<bnagy>
yeah, it's not for that
Markvilla has joined #ruby
<bnagy>
I use yaml for that stuff :/
ScottNYC has quit [Remote host closed the connection]
<atmosx>
xuser: your code doesn't work. I tried it. It comes out with 2 errors.
grizlo42 has joined #ruby
<xuser>
atmosx: you tried my last paste?
<xuser>
weird it works for me
<canton7>
xuser, it's good practice generally to use @price not price there
<atmosx>
at line 11, ruby doesn't know what 'price' is. That's why you setup @price = price, in order to use @price all over your scope which is your class in this example.
<canton7>
atmosx, see line 3
<canton7>
the method 'price' is defined
<atmosx>
then price is a string, if you don't convert it to an integer or float (float is more suitable in your case) ruby doesn't know how to add a string to an integer. Stupid ruby!
ph^ has joined #ruby
<canton7>
atmosx, why is it a string?
<xuser>
canton7: so 'price' in line 11 is a method right?
<canton7>
looks like a float for me
<canton7>
xuser, correct
lggr has quit [Ping timeout: 256 seconds]
<canton7>
xuser, and it's the method generated by your 'attr_accessor' on line 3
<xuser>
canton7: that was my doubt, thanks, I'll take your advice of using @price instead of price there
quest88 has joined #ruby
jamjam has quit [Ping timeout: 245 seconds]
ph^ has quit [Remote host closed the connection]
<atmosx>
canton7: hmm didn't work for me, I had to do the changes I mentioned to make it work. However, you're right. attr_accessor is defined and I used quotes '' which make the number a string :-P
iamjarvo has quit [Ping timeout: 245 seconds]
BMF has joined #ruby
lggr has joined #ruby
<xuser>
atmosx: well yes, I actually had @price = Float(price) there :)
<xuser>
in the initialize method
jamjam has joined #ruby
<atmosx>
xuser: then you're all set I guess.
zodiak has joined #ruby
tommyvyo has joined #ruby
kain has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
fridim_ has quit [Ping timeout: 260 seconds]
prtksxna has quit [Remote host closed the connection]
cascalheira has joined #ruby
Matoch has joined #ruby
cascalheira has quit [Client Quit]
joeycarmello has joined #ruby
hadees has joined #ruby
Takehiro has quit [Remote host closed the connection]
<burgestrand>
mensvaga: careful converting things to_sym willy-nilly. Symbols are not garbage collected, so if you have no control of what things may be converted your application will eventually eat up all your RAM.
<aharris_>
@param.map, sorry. just noticed you had it in an instance variable.
davidcelis has quit [Quit: K-Lined.]
<burgestrand>
mensvaga: as far as parameters from web requests goes they are usually passed as strings for this very reason.
Jork1 has joined #ruby
<mensvaga>
burgestrand: I'm using sinatra, and the usage example shows param[:some_variable]
<burgestrand>
mensvaga: both sinatra and rails allow access to the request parameters with both symbols and string
<burgestrand>
mensvaga: internally, they are both converted to strings
jrajav has quit []
lggr has quit [Ping timeout: 252 seconds]
<mensvaga>
Ah, I haven't exactly run the part of the program that grabs the parameters; I was writing it and then saw the symbol thing.
cburyta has quit [Ping timeout: 246 seconds]
<mensvaga>
If I can refer to it by just a regular string key, that's moar awesome.
<mensvaga>
Symbols in ruby are over used and mostly misunderstood.
<Xeago>
'they look so pretty'
<Xeago>
is what my colleagues say
<burgestrand>
They’re gold in my editor.
<burgestrand>
I mean, come on. Gold.
<savant>
persinally I like pokemon silver
<savant>
but to each his own
<mensvaga>
I haven't been coding ruby for long, but when a "seasoned" ruby programmer explained symbols to me, I said, "an immutable, non-garbage collected hash table of strings designed to cut down on memory usage?"
<mensvaga>
him, "Huh?"
<mensvaga>
err, immutable strings
ph^ has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
<mensvaga>
lunacy for beginners. Complete lunacy.
irleif has quit [Quit: Computer has gone to sleep.]
<shevy>
well
<shevy>
mensvaga, keep in mind the most important thing about symbols
<shevy>
they are BORING
Agis__ has quit [Quit: Agis__]
<shevy>
so if one uses fancy words to describe them
<shevy>
they still remain a boring thing to have
futilegames has quit [Quit: futilegames]
<shevy>
newcomers are so excited "whoa COOL A SYMBOL MAN... how could I have lived without it for all my life!"
jimeh2 has joined #ruby
irleif has joined #ruby
<mensvaga>
They're terrible.
BMF has quit [Remote host closed the connection]
kain has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
jimeh2 has quit [Ping timeout: 244 seconds]
bbttxu has joined #ruby
Takehiro has joined #ruby
jamjam has quit [Ping timeout: 246 seconds]
<Xeago>
I guess the following meaning when I first started ruby: symbols are used as identifications of values
lggr has joined #ruby
<atmosx>
Whoah! a SYMBOL! How could i have lived without using a symbol all my life!!!
<atmosx>
I don't use symbols actually, at all..
<atmosx>
but anyway
sepp2k has quit [Remote host closed the connection]
<Xeago>
which is imo, the easiest explanation, wil it is incomplete it is completely correct
<Xeago>
s/wil/while*
daniel_- has joined #ruby
hmans has joined #ruby
awarner has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
JonnieCache has joined #ruby
rabidpraxis has joined #ruby
erichmenge has joined #ruby
_md has joined #ruby
erichmenge has quit [Client Quit]
kain has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 255 seconds]
hadees has quit [Quit: hadees]
davidcelis has joined #ruby
Takehiro has quit [Remote host closed the connection]
lggr has joined #ruby
mikepack has quit [Remote host closed the connection]
<RubyPanther>
I think it is a very valuable thing to have code identifiers that are clearly different than the data, it aids separation
davidcelis has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
conor_ireland has quit [Quit: conor_ireland]
<RubyPanther>
And in C you get your identifiers as some type of integer with a fixed size, so it is also very practical and you don't have to worry about using short identifiers
davidcelis has joined #ruby
iamjarvo has joined #ruby
cascalheira has joined #ruby
ph^ has quit [Ping timeout: 256 seconds]
jamjam has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
reset has joined #ruby
Matoch has quit [Quit: Matoch]
t0rc has quit [Ping timeout: 244 seconds]
zii has quit [Read error: Connection reset by peer]
zii has joined #ruby
Takehiro has joined #ruby
mengu has quit [Quit: Konversation terminated!]
hadees has joined #ruby
lggr has joined #ruby
kain has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Remote host closed the connection]
<booyakah>
Anyone know a gem for Minecraft?
<booyakah>
nvm found one :P
chimkan__ has quit [Quit: chimkan__]
haxrbyte has joined #ruby
<shevy>
atmosx they have two nice advantages though
<shevy>
one, they are more efficient in a hash
<shevy>
two, if you get a string back from an object, you can modify it. but if you get a symbol back, you can't quite sensibly modify it, so it leaks out less from the object
<shevy>
not that I actually ever return a symbol from any of my methods hmmmmmmmm
* shevy
scratches his head.
rippa has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 260 seconds]
<workmad3>
shevy: you could return a frozen clone of the data
nlpplz has joined #ruby
morozovm has quit [Quit: morozovm]
<shevy>
poor clone... I'd rather have a warm clone than a frozen one :(
<shevy>
sorry workmad3 I am out of beer, and it makes me... funny in awkward ways :P
<workmad3>
:)
joeycarmello has quit [Remote host closed the connection]
lggr has joined #ruby
apeiros_ has joined #ruby
und3f has quit [Quit: Leaving.]
wedtm is now known as wedtm|away
awestroke has quit [Remote host closed the connection]
dmiller has quit [Ping timeout: 246 seconds]
t0rc has joined #ruby
apeiros_ has quit [Remote host closed the connection]
cburyta has joined #ruby
Zai_ has joined #ruby
<_bart>
'2010-blabla-20-10', I know I can match this using (\d{4}-blabla-\d{2}-\d{2}) but is it possible to remove the 'blabla' from the result? I tried to wrap it in (?:..) but that didn't work
lggr has quit [Ping timeout: 255 seconds]
Iszak has quit [Quit: Computer has gone to sleep.]
<_bart>
I thought (\d{4}-(?:blabla)-\d{2}-\d{2}) would remove blabla from the captured match.
bluenemo has quit [Remote host closed the connection]
Neomex has quit [Quit: Neomex]
Nisstyre-laptop has quit [Read error: Connection reset by peer]
rabidpraxis has quit [Remote host closed the connection]
murz has joined #ruby
lggr has joined #ruby
CodeFriar has quit [Quit: Leaving...]
cburyta has quit [Ping timeout: 246 seconds]
haxrbyte has quit [Ping timeout: 256 seconds]
Takehiro has quit [Remote host closed the connection]
Iszak has joined #ruby
Iszak has quit [Changing host]
Iszak has joined #ruby
Iszak has quit [Client Quit]
haxrbyte has joined #ruby
ph^ has joined #ruby
dmiller has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
no_worries has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
heftig has quit [Quit: leaving]
heftig has joined #ruby
mikepack has joined #ruby
lggr has joined #ruby
haxrbyte has quit [Ping timeout: 245 seconds]
icole has joined #ruby
margle has joined #ruby
ph^ has quit [Ping timeout: 260 seconds]
LouisGB has joined #ruby
eldariof has quit []
lggr has quit [Ping timeout: 264 seconds]
parzorep has quit [Quit: parzorep]
jimeh2 has joined #ruby
lggr has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
reset has quit [Quit: Leaving...]
jbw has quit [Ping timeout: 246 seconds]
margle has joined #ruby
iamjarvo has quit [Ping timeout: 260 seconds]
joeycarmello has joined #ruby
hgf has joined #ruby
Morkel has quit [Quit: Morkel]
r1ddl3r has quit [Ping timeout: 245 seconds]
timonv has quit [Remote host closed the connection]
Mon_Ouie has quit [Read error: Connection reset by peer]
jimeh2 has quit [Ping timeout: 264 seconds]
daslicious has joined #ruby
mikeycgto has quit [Ping timeout: 260 seconds]
Mon_Ouie has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
bladder has joined #ruby
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
lggr has joined #ruby
hadees has quit [Quit: hadees]
answer_42 has quit [Quit: WeeChat 0.3.9]
SegFaultAX|work has quit [Ping timeout: 248 seconds]
goraxe has joined #ruby
joeycarm_ has quit [Ping timeout: 260 seconds]
Virunga has quit [Remote host closed the connection]
AlbireoX has quit [Remote host closed the connection]
nilg has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<burgestrand>
_bart: it doesn’t, it just forms a capturing group without capturing the group
s0ber_ has joined #ruby
<burgestrand>
_bart: I would suggest you use two groups (one for the part before blabla, one for the part after), and concatenate them to retrieve your final result
bradyl0ve has joined #ruby
ph^ has joined #ruby
lggr has joined #ruby
s0ber has quit [Ping timeout: 260 seconds]
s0ber_ is now known as s0ber
Nisstyre-laptop has joined #ruby
nilg has quit [Remote host closed the connection]
nilg has joined #ruby
atmosx has quit [Quit: WeeChat 0.3.8]
monkegjinni has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Computer has gone to sleep.]
ltsstar has quit [Quit: ltsstar]
lggr has quit [Ping timeout: 245 seconds]
grizlo42 has quit [Quit: Leaving.]
thone has quit [Ping timeout: 240 seconds]
icole has quit [Remote host closed the connection]
lggr has joined #ruby
dangerousdave has quit [Ping timeout: 252 seconds]
noyb has quit [Quit: Lost terminal]
joeycarmello has joined #ruby
Dawne has joined #ruby
zigomir has quit [Quit: Leaving]
fkrauthan has joined #ruby
Jork1 has quit [Quit: Jork1]
c0rn_ has quit []
<fkrauthan>
Hey I have a problem. If I do ruby -v it says: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] but if I do a bundle install it says: Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3
no_worries has quit [Remote host closed the connection]
dmiller has quit [Remote host closed the connection]
pskosinski has quit [Quit: A few unofficial Red Eclipse 1.3.1 (r4131) servers: http://altred.tk/toggle.rb (and no more global banning for saying that main dev is not very smart, what is truth anyway)]
My_Hearing has quit [Ping timeout: 246 seconds]
t0rc has quit [Quit: WeeChat 0.3.9]
lggr has joined #ruby
alanp_ has quit [Ping timeout: 252 seconds]
cascalheira has quit [Ping timeout: 246 seconds]
skogis has quit [Ping timeout: 246 seconds]
katherinem13 is now known as katherinem13_afk
burgestrand has quit [Read error: Connection reset by peer]
sent-hil has quit [Remote host closed the connection]
burgestrand has joined #ruby
eikko has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
icole has joined #ruby
<RubyPanther>
fkrauthan: that could mean something like, you have rvm and you didn't install bundler with rvm's gem but you did install it with the system gem
bradyl0ve has joined #ruby
iblue has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
Forevernade has joined #ruby
Liquid_X has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
justinmcp has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
Liquid_X has joined #ruby
<fkrauthan>
Hmm I think I have something really wrong on my server
thillux has quit [Remote host closed the connection]
Orcris has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
deadalus has quit [Ping timeout: 252 seconds]
shoe has joined #ruby
<shoe>
Which Enumerable method does this? [:a, :b, :c, :d].foo([2, 0, 1]) -> [:c, :a, :b]
c0rn_ has quit []
ForevernadeAFK has joined #ruby
tommyvyo has joined #ruby
AlbireoX has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Forevernade has quit [Ping timeout: 256 seconds]
<heftig>
shoe: Array has values_at
<heftig>
[:a, :b, :c, :d].values_at(*[2, 0, 1])
josh^ has joined #ruby
sashman has quit [Remote host closed the connection]
lggr has joined #ruby
<shoe>
heftig: aha! thanks. I couldn't remember.
sashman has joined #ruby
deadalus has joined #ruby
kirun has quit [Quit: Client exiting]
Synthead has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
bier has quit [Ping timeout: 260 seconds]
hadees has joined #ruby
Foxandxss has joined #ruby
lggr has joined #ruby
emmanuelux has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
wedtm is now known as wedtm|away
icole has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
gmci has quit [Ping timeout: 246 seconds]
gmci has joined #ruby
mikepack has quit [Remote host closed the connection]
lggr has joined #ruby
icole has joined #ruby
bier has joined #ruby
zodiak has quit [Ping timeout: 246 seconds]
niklasb has quit [Read error: Operation timed out]
A124 has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
Criztian has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 260 seconds]
niklasb has joined #ruby
lggr has joined #ruby
<A124>
Anyone knows anything about bindings and extensions? I need to adjust one to read and output strings instead of taking file handles. Anyone to give a hand?