<blithen>
Yes, but I was having problems with it not being on the same line before the gsub was added. if the pastebin wasn't clear enough I wanted it to look like "Shipper: f On 10/22/2012" o:
ionte has quit [Ping timeout: 252 seconds]
<Spooner>
#{shipper+" on "+stripdate.to_s} => #{shipper} on #{stripdate}
davidcelis has quit [Quit: K-Lined.]
<Spooner>
And what is the point of your gsub? It won't do anything.
blazes816 has quit [Quit: blazes816]
maletor has quit [Quit: Computer has gone to sleep.]
<blithen>
I didn't paste the entire source code, it does do something. o:
<gogiel>
Spooner: shipper.rstrip
<Spooner>
gogiel : Not my question ;)
<blithen>
And spooner that seems to be a no go, it still puts it as two lines.
h4mz1d has quit [Ping timeout: 252 seconds]
mrsolo has quit [Quit: Leaving]
tyfighter has quit [Quit: tyfighter]
<blithen>
rstripped worked. Thanks guys. :)
<Spooner>
blithen : Yes, but that wasn't what I was fixing, but rather odd code. As people have said, shipper presumably has a newline at the end. Yeah.
<blithen>
Well I'm still pretty nooby when it comes to cody so odd code is more like normal code for me. :P
<blithen>
coding* not cody. e.e
ionte has joined #ruby
_bart has quit [Quit: _bart]
apok has quit [Remote host closed the connection]
apok has joined #ruby
<chessteach>
\q
chessteach has quit [Quit: leaving]
ebobby has quit [Ping timeout: 240 seconds]
caleb_io has quit [Quit: Leaving...]
stkowski has quit [Quit: stkowski]
BSaboia has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
yoklov has quit [Quit: computer sleeping]
artOfWar has quit [Remote host closed the connection]
medik has quit [Quit: Leaving]
`brendan has joined #ruby
kamsky has joined #ruby
recycle has quit [Remote host closed the connection]
recycle has joined #ruby
h4mz1d has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
kaawee has quit [Ping timeout: 260 seconds]
cbuxton has joined #ruby
slainer68 has joined #ruby
medik has joined #ruby
recycle has quit [Ping timeout: 276 seconds]
tjbiddle has quit [Ping timeout: 260 seconds]
blithen has quit [Quit: Avoiding death]
aantix has quit [Ping timeout: 260 seconds]
tpe11etier has joined #ruby
nitti has joined #ruby
jjang has quit [Remote host closed the connection]
sailias has joined #ruby
slainer68 has quit [Ping timeout: 252 seconds]
pothibo has quit [Quit: pothibo]
bemson has quit [Quit: bemson]
amacgregor_osx has quit [Read error: Operation timed out]
sailias has quit [Client Quit]
irleif has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Ping timeout: 255 seconds]
yshh has joined #ruby
havenn has joined #ruby
chichou has quit [Remote host closed the connection]
nitti has quit [Ping timeout: 256 seconds]
ejholmes has quit [Quit: ejholmes]
beneggett has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
headius has joined #ruby
timonv has joined #ruby
amacgregor_osx has joined #ruby
ebobby has joined #ruby
ebobby is now known as Guest44968
medik has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
dmiller has quit [Remote host closed the connection]
oGMinor has joined #ruby
<oGMinor>
I have a simple ruby script running in the background at 1-2% cpu (as shown in top) is that normal?
<oGMinor>
Or did I fuck up?
shadoi has quit [Ping timeout: 260 seconds]
medik has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Read error: Connection reset by peer]
dakine has joined #ruby
kiyoura has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
<waxjar>
depends entirely on what it's doing oGminor
beneggett has quit [Quit: Computer has gone to sleep.]
<oGMinor>
Thats what I suspected. Its probably reasonable for FSSM since its doing real time checks on a directory
yakko has quit [Remote host closed the connection]
davidcelis has joined #ruby
<oGMinor>
Best solution I can think of is put a delay between the checks so it only checks for updates every 5 minutes or something
cardoni has quit [Quit: cardoni]
BSaboia has quit [Quit: Fui embora]
Guest44968 has quit [Ping timeout: 255 seconds]
<waxjar>
i'd put a delay on it yeah. if you're constantly checking you're gonna be in the market for a new hard drive soon :P
IrishGringo has quit [Read error: Operation timed out]
artnez has quit [Read error: Connection reset by peer]
artnez has joined #ruby
IrishGringo has joined #ruby
zodiak has quit [Quit: Leaving]
dmiller has joined #ruby
dmiller_ has joined #ruby
mercwithamouth has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
c0rn_ has joined #ruby
Butch128 has joined #ruby
rakl has quit [Quit: sleeping]
<Butch128>
Is there a ruby equivalent to jquerys $.param method? I'm trying to properly encode a form post body from an array like { 0 => [1,2,3] }
<waxjar>
it's probably the correct way then, i reckon
drbawb has quit [Ping timeout: 246 seconds]
<kamsky>
hi guys, any advice about a parser generator??, i.e.: parslet, citrus, etc
apok_ has joined #ruby
ewokchewy has quit [Quit: Leaving]
<waxjar>
i'm thinking x[] is just a convention that makes it easier for web frameworks to know what to convert to an array and what not?
<heftig>
it's from php
arubin- has quit [Quit: Connection closed for inactivity]
<heftig>
$x[] = 3; appends an element to array $x
Araxia has quit [Quit: Araxia]
apok_ has quit [Read error: Connection reset by peer]
<heftig>
it's stupid, really.
apok has quit [Ping timeout: 256 seconds]
<waxjar>
heh
<heftig>
from the times of register_globals
sailias has joined #ruby
apok has joined #ruby
BSaboia has joined #ruby
<Spooner>
Perhaps the question should be "what is the starndard way to transmit an array in Rails/Sinatra/whatever" rathert than trying to fit into another system?
timonv has quit [Remote host closed the connection]
<heftig>
i'd say just as shown. assign multiple values to the same name
awarner has quit [Remote host closed the connection]
<kamsky>
hi guys, any advice about a parser generator??, i.e.: parslet, citrus, etc
iamjarvo has quit [Quit: Computer has gone to sleep.]
alvaro_o_ has quit [Quit: Ex-Chat]
yaymukund has left #ruby [#ruby]
ryanlecompte has joined #ruby
jamesaxl has quit [Ping timeout: 256 seconds]
glyytchy has joined #ruby
nitti has joined #ruby
ZubKonst has joined #ruby
mmitchell has quit [Remote host closed the connection]
caleb_io has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
awarner has joined #ruby
poRz has joined #ruby
ZubKonst_ has quit [Ping timeout: 260 seconds]
maletor has joined #ruby
teedex has joined #ruby
love_color_text_ has quit [Remote host closed the connection]
erichmenge has quit [Quit: Be back later]
nitti has quit [Ping timeout: 264 seconds]
schronicles47 has joined #ruby
love_color_text_ has joined #ruby
bapa has quit [Read error: Connection reset by peer]
bapa has joined #ruby
awarner has quit [Remote host closed the connection]
naquad has quit [Excess Flood]
mikepack has quit [Remote host closed the connection]
love_color_text_ has quit [Ping timeout: 240 seconds]
sicentendu has joined #ruby
baroquebobcat has joined #ruby
cardoni has joined #ruby
naquad has joined #ruby
hbpoison has joined #ruby
bapa has quit [Quit: No Ping reply in 180 seconds.]
apok has quit [Ping timeout: 255 seconds]
bapa has joined #ruby
love_color_text_ has joined #ruby
love_color_text_ has quit [Changing host]
love_color_text_ has joined #ruby
caleb_io has quit [Quit: Leaving...]
lucianosousa has quit [Quit: lucianosousa]
mikepack has joined #ruby
caleb_io has joined #ruby
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
rkneufeld has quit [Quit: Computer has gone to sleep.]
<jgrevich>
I'm running "gi --local /path/to/my.gem" and am getting "Unable to resolve dependencies" errors. When using --local, do the dependencies have to be local too?
<Paradox>
roooby
marcuspat has joined #ruby
iamjarvo has joined #ruby
mfcabrera has joined #ruby
mfcabrera has quit [Client Quit]
h4mz1d has quit [Ping timeout: 264 seconds]
n_blownapart has joined #ruby
<davidcelis>
RUBBIE'
aharris6 has quit [Remote host closed the connection]
Cultofmetatron has joined #ruby
icole has quit [Remote host closed the connection]
otters has joined #ruby
CaptainJet has quit []
<n_blownapart>
hi . a bit confused about this sample program. does line 7 never get printed anywhere? or if it does, where? thanks : http://pastie.org/5101643
jenrzzz has joined #ruby
sent-hil has quit [Remote host closed the connection]
marcuspat has quit [Quit: marcuspat]
marcuspat has joined #ruby
<codefyre>
n_blownapart, in newfile
dhruvasagar has joined #ruby
<n_blownapart>
codefyre: thanks, one sec
quanticle has joined #ruby
<n_blownapart>
codefyre: I'm still a beginner. how would I get it as output?
<codefyre>
on terminal ?
<n_blownapart>
codefyre: yeah
<codefyre>
just puts instead of f.puts
quanticle has left #ruby [#ruby]
<n_blownapart>
codefyre: ok , but normally I would have newfile = File.new("newfile.rb") to create a new file in the current directory, right?
JonnieCache has joined #ruby
cardoni has quit [Quit: cardoni]
<codefyre>
yes , or the way you did it in the previous pasteie
beneggett has joined #ruby
otters has quit [Ping timeout: 240 seconds]
joofsh has quit [Remote host closed the connection]
aharris6 has joined #ruby
<n_blownapart>
codefyre: you're saying that that prog. would create a new file with just newfile = "newfile" ?
<codefyre>
no
cardoni has joined #ruby
<codefyre>
in the previous pastie lines 6-8 create the file
manizzle has joined #ruby
<n_blownapart>
codefyre: confused. the file is internal, only within the scope of lines 5 to 16, right? sorry
<codefyre>
ohh i didn't notice that u delete it further down
<codefyre>
File.open would create a file if it doesn't exist
rabidpraxis has quit [Remote host closed the connection]
<n_blownapart>
codefyre: but where would I find that file?
ckrailo has joined #ruby
<codefyre>
as you deleted it , you won't find it anywhere
<codefyre>
n_blownapart , this is the line where is gets deleted, File.unlink(newfile)
<n_blownapart>
codefyre: ok, that's what I meant by "internal" within scope of lines 5 to 16. Am I somewhat correct in saying it that way?
<codefyre>
no , its more like a temporary file , gets created , used and deleted
skaczor has quit [Ping timeout: 260 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
<n_blownapart>
ok I think I get it . thanks codefyre !
<codefyre>
n_blownapart: :-)
h4mz1d has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
freezey has joined #ruby
rabidpraxis has joined #ruby
jameshyde has joined #ruby
khakimov has joined #ruby
aharris6 has quit [Remote host closed the connection]
dagnachewa has joined #ruby
n_blownapart has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
wallerdev has quit [Quit: wallerdev]
nitti has joined #ruby
perryh has quit [Excess Flood]
perryh has joined #ruby
krz has joined #ruby
nitti has quit [Ping timeout: 256 seconds]
therod has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
caleb_io has quit [Quit: Leaving...]
lukec has joined #ruby
mmitchell has joined #ruby
lewis1711 has joined #ruby
<lewis1711>
so am I just stupid, or are rubys module visibility rules really hard to remember?
rking has joined #ruby
kil0byte has joined #ruby
ryanlecompte has joined #ruby
mmitchell has quit [Ping timeout: 256 seconds]
mikepack has quit [Remote host closed the connection]
<heftig>
lewis1711: hmm?
jgrevich has quit [Quit: jgrevich]
<lewis1711>
heftig: you know,. how you have to do "def self.method_name" to make them public. stuff like that
<heftig>
what. where?
<lewis1711>
and I can't even remember how to call methods defined in the module. they seem somehwat pointless outside of mixins
<lewis1711>
I mean a method in a module. to make it accessible by ModuleName.methodname
<heftig>
you're in a class/module context. "def foobar" will create an instance method, not a singleton method
<lewis1711>
I never actually thought to try attr_accessor
<heftig>
what
<lewis1711>
uh
hbpoison has quit [Ping timeout: 260 seconds]
headius has quit [Quit: headius]
fboudreau is now known as starship
<lewis1711>
the whole thing makes no sense to me. why is "def foo" public in a class, but not a module?
<heftig>
there's no difference
<heftig>
you can't call ClassName.foo either
arubin has quit [Quit: Computer has gone to sleep.]
<davidcelis>
lewis1711: wot
<davidcelis>
lewis1711: what do you mean not in a module
kiyoura has quit [Quit: Leaving]
glyytchy has quit [Quit: glyytchy]
nazty has quit [Quit: Leaving]
nazty has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
kamsky has quit [Ping timeout: 240 seconds]
stephenjudkins has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
<lewis1711>
heftig: ok that sort of makes sense
quest88 has quit [Quit: quest88]
carlyle has quit [Remote host closed the connection]
sambio has quit []
carlyle has joined #ruby
joeycarmello has quit [Remote host closed the connection]
codefyre has quit [Ping timeout: 240 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Ping timeout: 260 seconds]
sicentendu has quit [Quit: sicentendu]
carlyle has quit [Remote host closed the connection]
stephenjudkins has quit [Quit: stephenjudkins]
h4mz1d has quit [Ping timeout: 272 seconds]
slainer68 has joined #ruby
FifthWall has joined #ruby
Targen_ has quit [Ping timeout: 256 seconds]
slainer68 has quit [Ping timeout: 256 seconds]
beneggett has joined #ruby
mahmoudimus has joined #ruby
teedex has quit [Remote host closed the connection]
fir_ed has quit [Read error: Connection reset by peer]
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
lukec has quit [Quit: lukec]
maletor has joined #ruby
Butch128 has left #ruby [#ruby]
baroquebobcat has quit [Remote host closed the connection]
psycho_one has quit [Remote host closed the connection]
joeycarmello has joined #ruby
therod has quit [Ping timeout: 276 seconds]
seanyo has quit [Ping timeout: 260 seconds]
areil has joined #ruby
awestroke has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
brianpWins has joined #ruby
joeycarmello has quit [Ping timeout: 268 seconds]
gabrielrotbart has quit [Remote host closed the connection]
paolooo has quit [Quit: Page closed]
codefyre has joined #ruby
ping-pong has joined #ruby
FifthWall has quit [Quit: Zzzzzzzzzzzzz]
marcuspat has quit [Quit: marcuspat]
djdb has joined #ruby
booyakah has quit [Ping timeout: 245 seconds]
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
answer_42 has joined #ruby
adaro has quit [Quit: adaro]
g-ram has quit [Quit: Computer has gone to sleep.]
freezey has quit [Quit: freezey]
Mon_Ouie has quit [Ping timeout: 260 seconds]
stnly has joined #ruby
jgrevich has joined #ruby
bapa has quit [Ping timeout: 252 seconds]
therod has joined #ruby
|Monie| has quit [Quit: Quit]
aharris6 has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
therod has quit [Ping timeout: 256 seconds]
Astral__ has quit [Ping timeout: 260 seconds]
mohanmcgeek has joined #ruby
xpen has quit [Remote host closed the connection]
mohanmcgeek has left #ruby [#ruby]
xpen has joined #ruby
Astral has joined #ruby
bapa has joined #ruby
justsee has quit [Quit: Leaving...]
knirhs has joined #ruby
thecreators has quit [Quit: thecreators]
Astral is now known as Guest78983
vlad_starkov has quit [Ping timeout: 244 seconds]
hbpoison has joined #ruby
maesbn has joined #ruby
stephenjudkins has joined #ruby
vlad_starkov has joined #ruby
Shrink has quit [Ping timeout: 245 seconds]
kil0byte has quit [Ping timeout: 255 seconds]
tpe11etier has quit [Quit: tpe11etier]
hbpoison has quit [Ping timeout: 265 seconds]
answer_42 has quit [Remote host closed the connection]
xpen has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
nemesit has joined #ruby
vlad_starkov has quit [Ping timeout: 252 seconds]
xnm has quit [Ping timeout: 245 seconds]
schronicles47 has quit [Ping timeout: 246 seconds]
answer_42 has joined #ruby
kil0byte has joined #ruby
zigomir has joined #ruby
elico has joined #ruby
jprovazn_away is now known as jprovazn
lukeholder has joined #ruby
locriani has joined #ruby
stephenjudkins has quit [Ping timeout: 252 seconds]
hukl has joined #ruby
Chryson has quit [Quit: Leaving]
<lukeholder>
Hi all. I am creating a gem on jruby that requires .java file. Where is the best/standard place for these in the gem? any github jruby gem examples would be appreciated.
<Spami>
Awestroke not exactly, i'm trying to add a field birthday:integer to my model 'people'
Guest51000 has quit [Quit: Leaving...]
maletor has quit [Quit: Computer has gone to sleep.]
timonv has quit [Remote host closed the connection]
Companion has joined #ruby
bradhe has quit [Ping timeout: 276 seconds]
<awestroke>
Spami: rails g migration AddBirthdayToPeople , edit the migration file, then run rake db:migrate
Zai has quit [Disconnected by services]
nitti has joined #ruby
SeySayux has quit [Read error: Connection reset by peer]
Villadelfia has quit [Read error: Connection reset by peer]
<Spami>
Awestroke Yep ! exactly what i was looking for. thanks !
<JonnieCache>
patrick99e99: you may want to upgrade to the latest ruby 1.9 you shouldnt have to do require rubygems these days
xpen has quit [Remote host closed the connection]
carlzulauf has quit [Ping timeout: 252 seconds]
hbpoison has joined #ruby
xpen has joined #ruby
xpen_ has joined #ruby
<patrick99e99>
JonnieCache: yeah.. I am on 1.9.3, but I just needed to quickly debug a homebrew script to verify something.. Im done now and can move on with my life
nitti has quit [Ping timeout: 244 seconds]
sertaconay has quit [Ping timeout: 260 seconds]
ralphvdh has joined #ruby
fermion has joined #ruby
Villadelfia has joined #ruby
SeySayux has joined #ruby
xpen has quit [Ping timeout: 245 seconds]
daniel_- has quit [Quit: WeeChat 0.3.9]
billycravens has joined #ruby
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
carlzulauf has joined #ruby
reinaldob has joined #ruby
Takehiro has quit [Remote host closed the connection]
dakine has quit [Quit: Leaving]
chussenot has quit [Quit: chussenot]
<ojongerius>
ha, I have to run an Ruby script on a range of boxes, and have to support 1.8.5 *and* 1.9.x versions. I've changed require_relative to something like: 'require File.join(File.dirname(__FILE__), './../lib/common.rb')'
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
<ojongerius>
which works fine, apart from 1.9x if I invoke it using a relative path like 'bin/foo.rb'
amacgregor_osx has quit [Remote host closed the connection]
<ojongerius>
absolute works, '../bin/foo.rb' works too (osx, Ruby 1.9.x)
<ojongerius>
hints appreciated :)
Takehiro has joined #ruby
timonv has joined #ruby
rippa has joined #ruby
Spami_ has joined #ruby
mengu has joined #ruby
chussenot has joined #ruby
Spami has quit [Ping timeout: 246 seconds]
kaawee has quit [Ping timeout: 256 seconds]
sagax has joined #ruby
hsbt is now known as hsbt_away
banisterfiend has joined #ruby
a_a_g has quit [Quit: Leaving.]
hsbt_away is now known as hsbt
tvw has quit [Ping timeout: 256 seconds]
<workmad3>
ojongerius: the best way to support both 1.9 and 1.8 isn't to try and implement your own require_relative (which is difficult)
billycraven has joined #ruby
k0nichiwa has joined #ruby
<workmad3>
ojongerius: instead, you should sort out your LOAD_PATH (which is recommended even on 1.9)
<k0nichiwa>
hello im trying to use a script to build a library, get this syntax error ./build_curl:15: syntax error, unexpected ':', expecting ')'
<k0nichiwa>
first there was "finK' .. now its homebrew
moshee has quit [Ping timeout: 256 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
<k0nichiwa>
somebody mus t not like port, but its worked fantastic for me for the most part
moshee has joined #ruby
<k0nichiwa>
the only thing i dont like about it is i have to reinstall everything sometimes =)
<Xeago>
port blows up with complex dependencies
<becom33>
I was wondering if there are any IDE for ruby for GUI like netbeans
<Xeago>
there is rubymine
<k0nichiwa>
maybe thats why i have to reinstall
<Xeago>
mostly
<Xeago>
port is not actively maintained either
<Xeago>
and fink focuses on making linux software workable under osx
<Xeago>
e.g. patches
<k0nichiwa>
everything ive installed with port after going to mountain lion has gone smoothly for me
<k0nichiwa>
so i cant complain
<Xeago>
that is not what homebrew does (by design)
<k0nichiwa>
however i did have to resintall EVERYTHING after siwthcing from 10.6.8 to 10.8.2
<workmad3>
k0nichiwa: that's not surprising
<Xeago>
not at all..
<k0nichiwa>
maybe not suprising, but also not desirable
<Xeago>
k0nichiwa: come back once you have 10 different gcc's, 15 llvm's and some cc's
<Xeago>
port will blow up
<k0nichiwa>
why would i have 10 different gccs
<Xeago>
don't get me wrong, I loved ports before
<workmad3>
k0nichiwa: it's not something that macports can solve
<Xeago>
k0nichiwa: dependencies
<workmad3>
k0nichiwa: (the reinstalling thing)
<k0nichiwa>
nothing ive installed so far has installed a gcc i dont think
rippa has quit [Ping timeout: 244 seconds]
<Xeago>
it depends on which ports you use ofcourse
hsbt_away is now known as hsbt
robotmay has quit [Ping timeout: 256 seconds]
ping-pong has joined #ruby
fatninja has quit [Excess Flood]
fatninja has joined #ruby
fatninja has quit [Changing host]
fatninja has joined #ruby
timonv has quit [Remote host closed the connection]
mmitchell has joined #ruby
justsee has quit [Quit: Leaving...]
robotmay has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
Progster has joined #ruby
reinaldob has joined #ruby
samphippen has joined #ruby
frogprince_mac has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
dekroning has quit [Ping timeout: 260 seconds]
margle has quit [Quit: Computer has gone to sleep.]
fbernier has quit [Read error: Connection reset by peer]
kaawee has joined #ruby
sertaconay has joined #ruby
tk__ has joined #ruby
margle has joined #ruby
lolzie has joined #ruby
Astral has joined #ruby
Astral is now known as Guest96551
beit has joined #ruby
timonv has joined #ruby
<becom33>
is it possible write pure ruby code web files
kil0byte has joined #ruby
<hoelzro>
becom33: you mean serve up a page from a pure Ruby application?
tiripamwe has quit [Ping timeout: 256 seconds]
xpen_ has quit [Remote host closed the connection]
Astral_ has quit [Ping timeout: 264 seconds]
<becom33>
I mean like rail is a web ruby framework right
fantazo has quit [Remote host closed the connection]
<becom33>
the thing is I have classes for a application . I dont want to write new classes to do the same thing to use ruby and rails
k0nichiwa has quit [Ping timeout: 268 seconds]
<becom33>
I wondering if its possible to write web app using pure ruby without any framework so I can use those classes
<lolzie>
becom33: of course, but is it a good idea?
<becom33>
lolzie, why is that ?
<Xeago>
becom33: you probably want a framework that handles all the web/http related stuff
<Xeago>
like rack
<Xeago>
rails is build on rack fyi
<becom33>
hmm
<Xeago>
you don't want to reinvent apache/nginx/lighttpd in ruby
kil0byte_ has quit [Ping timeout: 265 seconds]
<becom33>
ok
<Xeago>
rack has a clean syntax
<Xeago>
that let's you get out of the way easily
<becom33>
X-Jester, but thats the web service
<becom33>
not the application
<Xeago>
you could also look at sinatra, which offers a friendlier dsl
dmilith has left #ruby ["oOo oOo oOo"]
<Xeago>
and gollum which does stuff differently but is designed for API's
<Xeago>
sinatra is also based on rack btw
sgupta has quit [Read error: Connection reset by peer]
Shrink has joined #ruby
Shrink has quit [Changing host]
Shrink has joined #ruby
<JonnieCache>
i think becom33 means he wants to just execute .rb files and dump the stdout back to apache like with php
<Xeago>
there's cgi for that
nari_ has joined #ruby
timonv has quit [Remote host closed the connection]
rakunHo has quit [Read error: Connection reset by peer]
<morf>
mod_ruby?
<Xeago>
does more than just dump stdout back
<Xeago>
but would generally serve the same scenario
verto|off is now known as verto
timonv has joined #ruby
hbpoison has joined #ruby
tiripamwe has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
<crocket>
Where does gem install packages?
<crocket>
The installation location seems to differ among distros.
<becom33>
ok Im very confused
sertaconay has quit [Ping timeout: 256 seconds]
ABK has joined #ruby
kil0byte has quit [Ping timeout: 264 seconds]
samphippen has quit [Ping timeout: 255 seconds]
<kramutils>
crocket: run gem environment
<heftig>
crocket: by default they go to $prefix/lib/ruby/gems/1.9.1/gems
<becom33>
i wrote a simple application with pure ruby . I wanted a multi platform GUI . so I thought ok I'll use GTK+,JRUBY..etc . but then I got to know its a too much work for the user to use the application . the simplest thing I got in mind is a web application . which would do fine coz almost every OS has browers and easy UI . so now I have classes for my privous application . I want use the same classes and build a web application
Xeago_ has joined #ruby
<becom33>
what would guys suggest me to do
samphippen has joined #ruby
<sonne>
becom33, if you're willing to refactor your code to comply with MVC you might want to check rails
hbpoison has quit [Ping timeout: 264 seconds]
<crocket>
thanks
<crocket>
How can I configure INSTALLATION DIRECTORY of gem?
tiripamwe has quit [Read error: Connection reset by peer]
<workmad3>
crocket: you'd need to set GEM_HOME
<workmad3>
crocket: and you'd then need to keep that setting in your GEM_PATH so that rubygems knows where to look for your gem
Xeago has quit [Ping timeout: 240 seconds]
<tagrudev>
becom33, or sinatra if you're doing something small and you want to build it fast :)
<morf>
i wish i ppl asked less stupid questions and searched google more...
<crocket>
workmad3, GEM_HOME is not set.
<crocket>
workmad3, Can it be configured at build time?
djbpython has quit [Ping timeout: 256 seconds]
<workmad3>
crocket: no, it's an environment variable
<workmad3>
crocket: it'll default to the directory heftig said
<lolzie>
morf: perhaps this calls for a new open source project
<crocket>
workmad3, There should be a default value.
reinaldob has quit [Remote host closed the connection]
<lolzie>
morf: a bot which automatically scans questions, Googles, and determines if it's blatantly Googlable
<tagrudev>
biliv it or nut di bus can swim
<lolzie>
Then kicks mofos that should've googled
<workmad3>
crocket: if the environment variable isn't set, then rubygems will default to installing to the directory heftig said
<workmad3>
crocket: but a build process can't easily provide a default value for an environment variable (at least not easily provide a persistent one)
kil0byte has joined #ruby
<morf>
scary
<kramutils>
crocket: GEM_PATH and GEM_HOME should be set in ~/.gemrc or /etc/gemrc - see gem help environment
<JonnieCache>
lolzie: you could actually do that if you were conservative
Guest6717 has quit [Quit: Leaving...]
<lolzie>
JonnieCache: by attributing it to being "conservative" you just totally put me off the idea. haha
<lolzie>
But no, the way I see it, if we're not letting nature ensure only survival of the fittest anymore, then we've got to pick up the slack ourselves
WhereIsMySpoon has quit [Changing host]
WhereIsMySpoon has joined #ruby
<lolzie>
And enforce the transcendence of dumbassery into intellect
<JonnieCache>
lolzie: i mean youd have to be conservartive with your string matching
dekroning has joined #ruby
<JonnieCache>
otherwise youd look a tit when you called people stupid and then fed them wrong answers
<lolzie>
Creating this bot could be the next step for humanity's evolution of consciousness.
<lolzie>
Or maybe I'm getting a little ahead of myself
darth has joined #ruby
darth is now known as Guest32405
rkneufeld has joined #ruby
<workmad3>
lolzie: probably... do you have PhDs in AI and Machine Learning?
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<lolzie>
workmad3: I have 3 years of work experience in McDonalds, and I have been told that I may be eligible for the fasttrack to manager role
<workmad3>
lolzie: eh, close enough... :P
<lolzie>
I am optimistic that I will play this pivotal role in forever transforming our species
<crocket>
lolzie : What do you do at the Mac?
<crocket>
transforming our species?
<lolzie>
crocket: I am a specialist with the burgers. Although I am gradually aggrandising my skillset to encompass fries
<workmad3>
lolzie: you have practice transforming our species... from skilled, tool using beings that hunt on the savvanah to mindless cretins that consume large quantities of fat
tiripamwe has joined #ruby
adambeynon has quit [Quit: Computer has gone to sleep.]
<lolzie>
workmad3: you just completely depressed me in one sentence
freeayu__ has joined #ruby
<workmad3>
lolzie: you're welcome :P
<workmad3>
lolzie: I'd really enjoy a Big Mac right now though... :)
adambeynon has joined #ruby
freeayu has quit [Ping timeout: 276 seconds]
<lolzie>
workmad3: I'd love to spend a few months in old caveman times
rkneufeld has quit [Quit: Computer has gone to sleep.]
reinaldob has joined #ruby
<lolzie>
Provided that I can return to this spacetime bodily unscathed
nanderoo has joined #ruby
kil0byte_ has joined #ruby
allyraza has quit [Ping timeout: 256 seconds]
mikekelly has quit [Ping timeout: 272 seconds]
banisterfiend has quit [Ping timeout: 245 seconds]
kil0byte has quit [Ping timeout: 268 seconds]
mikekelly has joined #ruby
larissa has joined #ruby
<JonnieCache>
what so you could get involved with mankinds evolution from the start>
<JonnieCache>
?
<JonnieCache>
what would you do?
<withnale>
Hi. if I want to stub puts to capture output and later evaluate it with should , is that possible using mocks with cucumber?
ssspiff has quit [Remote host closed the connection]
baphled has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
nitti has joined #ruby
Progster has quit [Ping timeout: 252 seconds]
ABK has quit [Ping timeout: 245 seconds]
hbpoison has joined #ruby
fbernier has joined #ruby
Morkel has quit [Quit: Morkel]
nitti has quit [Ping timeout: 256 seconds]
<JonnieCache>
you should be able to literally just stub or orverride Kernel.puts
<DefV>
you are able
<DefV>
just.. don't
samphippen has quit [Quit: Computer has gone to sleep.]
sambio has joined #ruby
sailias has joined #ruby
<JonnieCache>
why not
<JonnieCache>
this is testing remember anything goes ;)
<JonnieCache>
actually though its probably better to mess about with stdout rather than puts
mercwithamouth has joined #ruby
noxoc has quit [Ping timeout: 256 seconds]
nari_ has quit [Ping timeout: 248 seconds]
haxrbyte has joined #ruby
Juul has quit [Ping timeout: 246 seconds]
d2dchat has joined #ruby
Spooner has joined #ruby
skaczor has joined #ruby
carlzulauf has quit [Ping timeout: 244 seconds]
Elhu has joined #ruby
mark_locklear has joined #ruby
baroquebobcat has joined #ruby
carlzulauf has joined #ruby
haxrbyte has quit [Ping timeout: 246 seconds]
<shevy>
I wanna mess with a girl
armenb has quit [Ping timeout: 276 seconds]
bbttxu has quit [Quit: bbttxu]
<becom33>
hey shevy
<whackatre>
lo
awestroke has quit [Remote host closed the connection]
<shevy>
becom33!!!
<shevy>
you are back!
<shevy>
now a ruby guru aha? :)
<becom33>
no :/ still in a mess
anachronistic has joined #ruby
<becom33>
now with web platform mess
<shevy>
hehehe
<shevy>
I am in some kind of mess too
reinaldob has quit [Remote host closed the connection]
<shevy>
I am gonna have to ask a smart guy soon
<becom33>
hehe
timonv has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Computer has gone to sleep.]
bbttxu has joined #ruby
<becom33>
shevy, what do you know about ruby web applications
<mparodi__>
I'm trying to run COVERAGE=true rspec spec
bradhe has joined #ruby
chendo_ has quit [Ping timeout: 245 seconds]
<shevy>
i dont know rspec
tiripamwe has quit [Ping timeout: 245 seconds]
sailias has quit [Ping timeout: 256 seconds]
<mparodi__>
does anybody?
pothibo has joined #ruby
healpay has quit [Quit: Leaving]
chendo_ has joined #ruby
foofoobar has joined #ruby
<foofoobar>
Hi. I opened a url with open-uri. How can I read now just the first line?
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
Zplay has joined #ruby
tommyvyo has joined #ruby
d2dchat has quit [Remote host closed the connection]
<burgestrand>
mparodi__: looks like you have a json-related issue of some kind, and multi_json is the culprit.
<mparodi__>
burgestrand, what would you try to solve it?
<Zplay>
Hello, I'm new to ruby. I have a project that I would like to try with ruby1.9 but when I use "bundle install" I get this error "Error Bundler::HTTPError during request to dependency API", I know it is related to rubygems servers. But is it possible to use 1.9 without this dependency API ?
bradhe has quit [Ping timeout: 248 seconds]
<burgestrand>
foofoobar: the returned object is an IO. You could do #readline on it.
<Spooner>
Zplay : You can manually install all the gems required (gem install foo -v "= 1.8.5"), but that might take some time.
kil0byte has joined #ruby
<burgestrand>
Zplay: you can use bundler without it, it’s not an actual error.
<burgestrand>
Zplay: bundler works fine even without the dependency API, it’s just slower.
justsee has quit [Quit: Leaving...]
<burgestrand>
mparodi__: not sure.
<burgestrand>
mparodi__: reading the source of simplecov/multijson to see what the issue is.
armenb has joined #ruby
<Zplay>
burgestrand and Spooner thank you, I'll try to understand why it's not working.I thought my error was due to this dependency server
kil0byte_ has quit [Ping timeout: 248 seconds]
<Spooner>
Zplay : I've found everything gemmy to be a bit flakey recently (e.g. gem push), because of the one server function being down. Waiting and trying later has worked.
<burgestrand>
mparodi__: might be an issue with multijson itself
<burgestrand>
I’ve had this issue happen to myself as well before. What I believe is happening is that you are requiring your files (multi_json, and simplecov, in this case), and after you’ve done this you require bundler in some way.
<burgestrand>
When you require bundler, it will change your load paths — problem is, multi_json will try to load additional files later, and somehow bundler does not recognize multi_json as being in the Gemfile (perhaps another version?), so those files won’t be available after setting up bundler.
<burgestrand>
mparodi__: in short, use: bundle exec rspec spec
<mparodi__>
bundle exec rspec spec <-- printed a LOT of things
<mparodi__>
rspec ./spec/controllers/projects_controller_spec.rb:76 # ProjectsController#create No missing attributes for project. Creates a new project for Client 1
<mparodi__>
rspec ./spec/controllers/projects_controller_spec.rb:91 # ProjectsController#my_projects Shows the projects for client identified by id = 1
<burgestrand>
mparodi__: and an error, I suspect?
<mparodi__>
like this ^
<burgestrand>
mparodi__: pastie it if you can
<mparodi__>
okay
<burgestrand>
mparodi__: actually, it might just be your tests running
* burgestrand
shrug
<burgestrand>
mparodi__: why are you running against rspec master?
<mparodi__>
yes, but there's no coverage
<mparodi__>
I mean, it doesn't say anything about that
<mparodi__>
ah, maybe adding COVERAGE=true
<mparodi__>
lol
<burgestrand>
mparodi__: ;)
tungd has joined #ruby
<mparodi__>
yep
<mparodi__>
alright, thank you!
shtirlic has quit [Remote host closed the connection]
<burgestrand>
mparodi__: the actual error is a load order problem, but using bundle exec should resolve the issue or show you the real error
<burgestrand>
mparodi__: if you ever want to track down the issue I believe you are requiring some files in your spec_helper.rb (or somewhere else) before you require your rails application (config/environment.rb)
arielpts has quit [Ping timeout: 256 seconds]
<mparodi__>
spec_helper starts like that:
<mparodi__>
if ENV['COVERAGE']
<mparodi__>
require 'simplecov'
<mparodi__>
SimpleCov.start 'rails'
locriani_ has quit [Remote host closed the connection]
<burgestrand>
mparodi__: yeah, that’s your problem, and I believe simplecov recommends you to do it this way, but it’s wrong to require the gem before you reqire config/environment at line #9
hsbt is now known as hsbt_away
<burgestrand>
mparodi__: or at least very shaky because it’ll cause the problem you have if you ever not use bundle exec (which is recommended when using bundler, however :))
<mparodi__>
it doesn't work if I put it like in this paste ^
slyd3r has joined #ruby
<clocKwize>
guys, is it possible to get the binding of the method calling my method, without explicitly passing it in?
irleif has quit [Quit: Computer has gone to sleep.]
<burgestrand>
mparodi__: yeah, probably something related to simplecov and when files are required, and something that simplecov (imo) should fix to avoid this happening. But now you know why it happens and how to solve it :)
<clocKwize>
I tried def mymethod(b = binding) but that gets the binding of the method lol
<mparodi__>
yep, thanks
<burgestrand>
clocKwize: binding of caller, tricky things in ruby
<burgestrand>
clocKwize: you don’t want to rely on this at all for anything other than debugging
<Spooner>
clocKwize : And unless you are writing a hacking tool, like pry, you probably shouldn't need it.
ffranz has joined #ruby
hsbt_away is now known as hsbt
tungd has quit [Ping timeout: 256 seconds]
<clocKwize>
hmm, I see
<clocKwize>
I just don't want to have to pass it in every time, for syntactic sugar
hatoishi has quit [Quit: leaving]
cantonic_ has joined #ruby
hsbt is now known as hsbt_away
<Spooner>
clocKwize : Yeah, but passing it manually also probably means you have a problem with the design. Or you might as well just use global vars everywhere ;)
_bart has joined #ruby
joelio has joined #ruby
<clocKwize>
Spooner, its an unusual problem domain.. The solution is unusual :)
syskk_ has joined #ruby
syskk_ has quit [Changing host]
syskk_ has joined #ruby
IrishGringo has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
Zai has joined #ruby
<clocKwize>
I've never touched bindings before, it just seems like it would simplify the beauty of the code you have to write
<joelio>
this is basically calling posts within activerecord in the callback from what I can understand, but my knwoledge is limited
iamjarvo has joined #ruby
<joelio>
is " ::Posts.call(env) " actually calling itself?
* joelio
confused
<Spooner>
Well, I can't really comment on that, but using a binding like that does smell(definitely when implicit and isn't great when passed, to tell the truth). There are reasons to use it involved with writing hacking tools, as I've said.
LennyLinux has quit [Remote host closed the connection]
<Spooner>
joelio : :: prefix means look for Posts in the global scope, not as Application::Posts
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<Spooner>
clocKwize : It is a bit like using eval ;) Yeah, you need it sometimes, but 9/10 it is a weak solution.
<clocKwize>
I'll be using eval too ;)
awarner has joined #ruby
<joelio>
Spooner: Thanks!
<clocKwize>
eval and binding basically go handi n hand right..
Zplay has quit [Quit: Konversation terminated!]
jeffreybaird has joined #ruby
<Spooner>
Well, eval uses the local binding if not specified. Certainly binding likes eval, but eval doesnt' specifically like binding.
ben_alman has quit [Excess Flood]
<clocKwize>
basically our business teams want to be able to see how a calculation was performed, which might have come from the results of like 5 variables, methods, which are also calcuations.. I don't want to expose all the individual calculations everywhere, I want to build up Formula objects, which contain the expression and the binding, and an array of other Formula used, so from a single Formula object, you can get its parts and display them easily
kil0byte_ has joined #ruby
chimkan_ has joined #ruby
<clocKwize>
but instead of doing Formula.new("number_of_cats * breeding_factor(days_passed)", number_of_cats, breeding_factor, days_passed), I want to do Formula.new("expr")
carlyle has joined #ruby
<clocKwize>
any of those variables could also be another Formula object
tungd has joined #ruby
<clocKwize>
you could print it as number_of_cats = 5, days_passed = 10, breeding_factor(x) = 0.01 * days_passed, answer = x
<clocKwize>
without exposing crap loads of stuff everywhere so it can be accessed
kil0byte has quit [Ping timeout: 252 seconds]
_bart has quit [Quit: _bart]
syskk has quit [Read error: Connection reset by peer]
dnstbr has joined #ruby
uuair has quit [Remote host closed the connection]
linoj has quit [Ping timeout: 264 seconds]
jameshyde has joined #ruby
uuair has joined #ruby
arielpts has quit [Excess Flood]
v0n has joined #ruby
moshef has joined #ruby
arielpts has joined #ruby
arielpts has quit [Excess Flood]
jameshyde has quit [Read error: Connection reset by peer]
arielpts has joined #ruby
arielpts has quit [Excess Flood]
carlyle has quit [Remote host closed the connection]
arielpts has joined #ruby
arielpts has quit [Excess Flood]
xpen has quit [Remote host closed the connection]
arielpts has joined #ruby
d2dchat has joined #ruby
bigmcq77 has quit [Quit: Computer has gone to sleep.]
syskk has joined #ruby
syskk has quit [Changing host]
syskk has joined #ruby
carlyle has joined #ruby
ben_alman has joined #ruby
<Spooner>
Well, you can extract number_of_cats, breeding_factor, days_passed from "number_of_cats * breeding_factor(days_passed)" easily enough (scan(/\w+)) and eval them to get the actual values. You could even go through all the const_defined?, respond_to?, etc to work out more exactly what they are without needing to touch eval.
linoj has joined #ruby
<Spooner>
(since eval tells you the result, not gives you the actual method object, say).
<Spooner>
clocKwize : I've seen much worse uses of caller_binding though. Had a few people wanting to eval code in the context of the caller to manipulate variables before now ;)
sagax has quit [Quit: Ухожу я от вас]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
baphled has joined #ruby
jgarvey has joined #ruby
bigmcq77 has joined #ruby
<clocKwize>
Spooner, I'm actually using math_engine gem to parse the expressions
jrist-afk is now known as jrist
<clocKwize>
but eval() will be executed in the context of the Formulae method, not the caller of that right?
Cultofmetatron has joined #ruby
hsbt_away is now known as hsbt
carlyle has quit [Remote host closed the connection]
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
<Spooner>
Yeah.
mikepack has joined #ruby
LouisGB has joined #ruby
timonv has quit [Remote host closed the connection]
bradhe has joined #ruby
sailias has joined #ruby
yoklov has joined #ruby
_bart has joined #ruby
ZubKonst_ has joined #ruby
g-ram has joined #ruby
hsbt has quit [Ping timeout: 268 seconds]
deryl-android has joined #ruby
<Spooner>
clocKwize : I can't see a way around it. Carry on and sorry for wasting your time :$
chussenot has joined #ruby
bradhe has quit [Ping timeout: 252 seconds]
yekta has joined #ruby
foofoobar has quit [Quit: Computer has gone to sleep]
ZubKonst has quit [Ping timeout: 256 seconds]
foofoobar has joined #ruby
flype has joined #ruby
hsbt has joined #ruby
awarner has quit [Remote host closed the connection]
uuair has quit [Quit: uuair]
uuair has joined #ruby
kil0byte has joined #ruby
eph3meral has quit [Quit: eph3meral]
seanyo has joined #ruby
Servidorv has joined #ruby
hbpoison has quit [Ping timeout: 264 seconds]
<Servidorv>
hey guys
<Servidorv>
good morning
<Spooner>
Good afternoon.
<Servidorv>
oh is morning here in argentina
<Servidorv>
:)
xclite has joined #ruby
<Servidorv>
hey what does .clone does??
Xeago_ has quit [Remote host closed the connection]
<Spooner>
MAkes a shallow copy. Mostly the same as .dup, but can be different.
<Servidorv>
oh ok
Xeago has joined #ruby
kil0byte_ has quit [Ping timeout: 260 seconds]
<Servidorv>
thanks
<clocKwize>
Spooner, No problem - good to hear I'm not doing something in a sub-optimal way ;)
<workmad3>
servidorv: .clone copies tainted and frozen state, .dup copies tainted state, otherwise the (default) implementation is the same, afaik :)
<Spooner>
clocKwize : I'm not all-knowing, sadly. I just like to jump up and down a bit ;)
deryl-android is now known as deryl
roflmaus has joined #ruby
Neomex has joined #ruby
lolmaus has quit [Read error: Connection reset by peer]
<clocKwize>
:)
Neomex has quit [Client Quit]
flype has quit [Ping timeout: 252 seconds]
mmitchell has joined #ruby
saispo has quit [Ping timeout: 260 seconds]
<Xeago>
clocKwize: consider wrapping simple values, like variables in formulae before using them
<Xeago>
e.g. Formula.new "text_representation", 4
<Xeago>
f3 = f1 * f2
<Xeago>
and f3 holds references to f1
foofoobar has quit [Quit: bb]
<Xeago>
and can thus ultimately retrieve the whole callstack
<Xeago>
you have to proxy arithmetic methods but other than that it is easy to maintain the state
<Xeago>
only on definitions it requires wrapping the variable
<Xeago>
it allows you to do very clean math
<Spami_>
damn
<Xeago>
clocKwize: imo that is way cleaner than using reflection based stuff
linoj has joined #ruby
<clocKwize>
I guess I could extend FixNum, BigDecimal to have a #to_formulae, and if a Formulae#*/+-(other) where other isn't a Formulae , it could call .to_formulae
<Xeago>
yea that aswell
<clocKwize>
good plan, stan
<Xeago>
is it possible to retrieve the variable name, when given a variable :O?
<clocKwize>
i was just thinking this
<workmad3>
clocKwize: don't bother with testing if it's a formulae
<JonnieCache>
Xeago: what do you mean, "given a variable"
kramutils has quit [Read error: Connection reset by peer]
<workmad3>
clocKwize: and define a 'to_formulae' on your Formulae class that returns itself ;)
<JonnieCache>
one can get a variable name, as a string or symbol, or one can get an object which happens to be in a variable
<lupine_85>
a = "moo" ; def b(x) ; assert_equal "a", find_original_name_of_x(x) ; end ; b(a) I guess
<clocKwize>
workmad3, heh :)
<lupine_85>
but why on earth would you do that?
<JonnieCache>
variables arent objects generally
<lupine_85>
this is ruby. they really are
<Xeago>
to construct a formula, which consists of a name and a value
<clocKwize>
lupine_85, read up
<clocKwize>
Xeago, don't think there'd be any way of working back to find out how that Formulae was made, even though it would read nicer
anachronistic has quit [Quit: anachronistic]
<Spooner>
No, the problem is that you are asking for the variable name of an expression. x has already been evaluated to, say, 5, by the time it is passed to find_original_name_of(x).
<Xeago>
which would make Formula.new('a',2)*three result into 6 as a formula
<Xeago>
clocKwize: why not?
<Xeago>
in the *+/etc methods
<Xeago>
you can construct a new formula having both sides as children
genshu has quit [Ping timeout: 256 seconds]
<Xeago>
(left and right)
mark_locklear has quit [Remote host closed the connection]
<Xeago>
we humans read in infix notation, if you need an infix parser, there are several. I wrote one in obj-c at github.com/xeago
<clocKwize>
yes, but if I do x = 1, y = 2 z = Formulae.new x * y, how would I know they are called x and y?
<JonnieCache>
i havent totally followed this but it sounds to me like you need to learn lisp
<workmad3>
clocKwize: you wouldn't
<Xeago>
clocKwize: you'd have to wrap atleast on of x and y in a formulae first
<lupine_85>
if you weren't dealing with singleton objects (instances of Fixnum), ObjectSpace + object_id + local_variables + bindings would be able to put it together, but you'd need to be insane to do it
<clocKwize>
oh I see
<Xeago>
and then you can .to_formulae the other
starship has quit [Ping timeout: 246 seconds]
<clocKwize>
I'd have to define root values as Formulae.new("x", 1)
<Xeago>
and then construct a new formula out of both of the two
<Xeago>
yes
<Xeago>
then simply x*y would give z which is a formula
<clocKwize>
yeah that would work, bit nasty ;p
starship has joined #ruby
<Xeago>
it keeps it clean (from the outside)
chimkan_ has quit [Ping timeout: 272 seconds]
<workmad3>
clocKwize: you'd need to 'taint' your calculation ;)
<Xeago>
and the uglyness is confined
axl_ has joined #ruby
<clocKwize>
Xeago, adding methods to core classes isn't confined :P
carlyle has joined #ruby
<Xeago>
we're basically wrapping singleton objects, to taint them
samphippen has quit [Quit: Computer has gone to sleep.]
<workmad3>
clocKwize: adding a single method to a few core classes for type-casting them appropriately is reasonably confined
<Xeago>
yes it is, .to_formula is just sugar
<Xeago>
you could also have a initializer with 1 param figure it out
<Xeago>
but that would read worse
<Xeago>
and might construct worse objectgraphs than .to_formula
<Xeago>
which will return self on a formula
<clocKwize>
maybe -_-
<Xeago>
you might even be able to do x=5
<Xeago>
x.to_formula!
<Xeago>
depending on ruby restrictions
<workmad3>
Xeago: no, you won't be able to do that
<Xeago>
boog
<Xeago>
s/g/h
<Spooner>
And once we get to Ruby 2.0 these methods can be confined (That is in 2.0 in the end, isnt it?), so you aren't being evil for long ;)
<workmad3>
but you could do x = 5.to_formula as your starting point
otters has joined #ruby
<Xeago>
meh workmad3, i'm tired, out of inspiration lol ;D
<clocKwize>
Xeago, to tell you the truth, I just like the sound of the work Formulae
<clocKwize>
and right now I'm only playing with this idea, so haven't thought too much about the classes name
<Xeago>
imo, that doesn't look too bad either
<clocKwize>
i just don't like defining everything twice
<Xeago>
but it is a bit more wordy than what was proposed here
<clocKwize>
yeah, this was quicker to implement, I'll extend it to that
<Xeago>
an other options
<Xeago>
is to use a block
chin-tastic has joined #ruby
<Xeago>
and method_missing
<Xeago>
to eval it in some context
iamjarvo has quit [Quit: Computer has gone to sleep.]
<Xeago>
that would be ugly tho :D
<clocKwize>
ooo
<clocKwize>
thats not a terrible ideal
<clocKwize>
idea*
e_dub has joined #ruby
<Xeago>
it is terrible!
<clocKwize>
nah
<clocKwize>
be a good way to get the root values
<Xeago>
Spooner, JonnieCache, this sounds terrible right?:P
<Spooner>
What does?
<clocKwize>
or not.. duno
<clocKwize>
:p
<clocKwize>
need to think more
<Xeago>
using a block and method_missing
samphippen has joined #ruby
<Xeago>
Formula.new { value * other }
zomgbie has joined #ruby
<clocKwize>
wouldn't evaluate in the binding it was defined in though, so it'd be a bit weird
Virunga has joined #ruby
morozovm has joined #ruby
<Xeago>
which is why it would turn out ugly
<Xeago>
I think your best off with what workmad3 said
<Xeago>
x = 1.to_formula
<clocKwize>
yeah
<Xeago>
and then x * 3
<Spooner>
But you still haven't got the binding. I did think of that. You could do Formula.new &->{ value * other } though and that would pull in the binding.
invisime has joined #ruby
<clocKwize>
Xeago, but with that, how would I know it was called x?
marcuspat has quit [Quit: marcuspat]
<clocKwize>
Spooner, scary syntax! :P
timmow has quit [Ping timeout: 252 seconds]
<Spooner>
Xeago : But then you don't have the text of the variables used, do you?
<Xeago>
formula.new then
<Xeago>
;p
<Xeago>
as was my initial proposal :D
<clocKwize>
1.to_formulae("x")
<clocKwize>
but meh
zomgbie has quit [Client Quit]
<Xeago>
might aswell use Formula.new("x",1)
<Xeago>
alternatively, write a preprocessor for your ruby code
iamjarvo has joined #ruby
<Xeago>
/me trololol
<Xeago>
what /me doesn't work in my client
<Xeago>
oh go
<JonnieCache>
fail
<Spooner>
Or just do Formula.new("x", binding) ;)
<JonnieCache>
what client is that?
joshman_ has joined #ruby
<clocKwize>
Xeago, did you ctrl+enter? :P
<Xeago>
might be
* Xeago
test
* Xeago
another
chussenot has quit [Quit: chussenot]
<Xeago>
another was with ctrl
<clocKwize>
hm
<clocKwize>
odd.
<Xeago>
limechat for the ones wondering
<Xeago>
tho sometimes use irssi or some recent other text based client
<clocKwize>
xchat is ok
uuair has left #ruby [#ruby]
<clocKwize>
if you cba to find something better
<Xeago>
I am arsed a ton!
uuair has joined #ruby
chin-tas` has joined #ruby
<Xeago>
used mIRC when I was <16
Ankhers has joined #ruby
<Xeago>
tried it recently and I just got scared
chimkan_ has joined #ruby
colinbm has quit [Quit: colinbm]
<clocKwize>
I was using mIRC when I was 13 yo1
<clocKwize>
!*
<clocKwize>
I paid for mIRC
<clocKwize>
it was worth it.
<whackatre>
wow lol
<whackatre>
how old r u guys btw
<clocKwize>
I'm 27
<Spooner>
There wasn't an Internet when I was 13 ;)
timmow has joined #ruby
<whackatre>
because it seems like most people on irc (especially freenode) are between the ages of twenty to thirty
dmerrick has joined #ruby
<Spooner>
whackatre : 40 here.
<Xeago>
blog.xeago.nl/posts/me
<clocKwize>
Spooner, you act a lot more mature than most, now I know why ;)
dekroning has quit [Ping timeout: 252 seconds]
<whackatre>
damn. that's pretty cool. :)
sertaconay has joined #ruby
acrocity- has joined #ruby
<Xeago>
shameless advertizing!
chimkan_ has left #ruby [#ruby]
<shevy>
no
<clocKwize>
my most admired developer is 60 and asked me for a reference for a new contract at a start up today haha
<shevy>
he does not eat animals, that's why
<clocKwize>
(talking of old programmers)
chin-tastic has quit [Ping timeout: 244 seconds]
<Spooner>
clocKwize : Acting more mature than the average denizen of the Internet is not that hard :D
<shevy>
all the growth hormones in meat changes people
<clocKwize>
Spooner, true :)
Guest32405 has quit [Quit: Leaving...]
<shevy>
mIRC was great
<Xeago>
MSL was fun
<Xeago>
back when I could not think of programming
<shevy>
xchat is no longer actively maintained :(
zomgbie has joined #ruby
acrocity has quit [Ping timeout: 246 seconds]
punkrawkR has quit [Read error: Connection reset by peer]
* Xeago
never liked xchat, slow sluggish
<shevy>
I'd wish there would be good ruby bindings for GUI solutions
<clocKwize>
shevy, yeah, I can tell. I'd like to build something better, but that is so cliché
<Xeago>
there's shoes shevy
<clocKwize>
haha shoes
<e_dub>
jruby has them shevy
<shevy>
last time I tried shoes, I could not even run the examples
<clocKwize>
its awesome if you want to put a button on a window and have it work half the time
<shevy>
hmm I was scared of having to use java... I really dont use java at all
Neomex has joined #ruby
<Xeago>
don't have to use java
yekta has quit [Quit: yekta]
<shevy>
there is redcar too though
<Xeago>
just java api's
<shevy>
for jruby?
asteve has joined #ruby
<e_dub>
shevy, you dont. yeah, it imports the java shit into ruby objects
hbpoison has joined #ruby
<Xeago>
yea
<clocKwize>
jruby is awesome, its just the java virtual machine, you don't actuall have to touch any java stuff at all
earthquake has joined #ruby
stopbit has joined #ruby
<Xeago>
also gtk2+ bindings
<whackatre>
i like jruby. :)
<clocKwize>
(unless you want to do anything with java GUI frameworks for example)
<Xeago>
then there is Qt
<Xeago>
which is such a pita
<Spooner>
clocKwize : In fairness, even though you don't have to use Java, you do need to read Java documentation if you want to use any libraries.
<clocKwize>
yeah
locriani has joined #ruby
krz has quit [Quit: krz]
chichou has quit [Remote host closed the connection]
<clocKwize>
one thing I like about windows.. you use win32 api, or a wrapper around it.
bigmcq77 has quit [Quit: Computer has gone to sleep.]
<Spooner>
shevy : Just use my fidgit gem. It sucks and is even more flakey than Shoes, but it isn't Shoes ;)
<clocKwize>
not a choice of Gtk, Qt, etc etc etc
chussenot has joined #ruby
<workmad3>
clocKwize: you can use Gtk and Qt on windoze too
chin-tas` is now known as chin-tastic
<e_dub>
spooner, saw something yesterday though, they are working on writing specific jruby documentation for the java libraries... pretty awesome
<shevy>
Spooner lol
<Xeago>
win32 api is horrible..
darth has joined #ruby
wwkeyboard has left #ruby ["WeeChat 0.3.8"]
<Xeago>
also shevy
<Xeago>
MacRuby!
darth is now known as Guest67186
<shevy>
man
<shevy>
I dont have a mac
<clocKwize>
workmad3, true, but i don't like having the choice.. I want 1 thing for the OS that looks the same and acts the same for every application
asteve has quit [Disconnected by services]
<Xeago>
clocKwize: go with html5
<workmad3>
clocKwize: right... so not the win32 api then :P
<Xeago>
or even html5
<shevy>
linux is so horrible, sadly there is nothing better
<Xeago>
err html
<Xeago>
shevy: lol
<Xeago>
you sound like linus
<clocKwize>
workmad3, i think it does a good job, from a user point of view (not from an api/developer point of view0
<shevy>
linus actually made great work
<shevy>
kernel... git ...
<clocKwize>
haha, some guy sitting behind me juts got called out for whistling a one direction song
<Xeago>
clocKwize: than use html2 :O
<workmad3>
clocKwize: ah, so you don't know that in certain places, the win32 api will look at your program name and *change its behaviour*
<Xeago>
it was perfect at it's time
<shevy>
but linus does not dare touch the GUI stuff
<Xeago>
shevy: and rightfully so
<shevy>
:(
<Xeago>
I don't need graphical stuff
earthquake has quit [Remote host closed the connection]
<shevy>
!!!
<Xeago>
if I want graphical stuff, I go to adobe or flash
<shevy>
!!!!!!!!!
<Xeago>
or my local printer
<shevy>
see, I am without words
<Xeago>
that is optionally 3d
<clocKwize>
workmad3, as long as it only affects MS apps, I don't mind. its dirty as hell, but whatever.
<Xeago>
:D
<workmad3>
Xeago: if I want graphical stuff, I go to javascript and canvas
<workmad3>
clocKwize: nope, it's not just MS apps
<Xeago>
workmad3: that is the new stuff :D, it didn't reach shell junkies yet
<workmad3>
clocKwize: it's to preserve backwards compatible, buggy behaviour for legacy apps
<Xeago>
canvas doesn't render on my 80*24
Morkel has joined #ruby
nitti has joined #ruby
<workmad3>
Xeago: <nocanvas> tags ftw!!!!
<clocKwize>
workmad3, that is nasty then.. thats what you get for having 1 version of an API and building on top of it for 20 years
<workmad3>
Xeago: or maybe we need a new <ncurses> tag :P
<Xeago>
workmad3: please!
<clocKwize>
they should have apps link to user32.v8.dll or something
<workmad3>
clocKwize: some of these things are pre-dll ;)
<Xeago>
applications should distribute their ui toolkitting
<clocKwize>
nice
<Xeago>
than it is as flexible as it comes
AlbireoX has joined #ruby
<Xeago>
!
<Xeago>
if need be, just use assembler and talk directly to the screen and the gpu
supd has quit [Quit: Konversation terminated!]
stnly has quit [Ping timeout: 255 seconds]
<workmad3>
Xeago: yeah, lets go back to the 80's and distribute primitive OSes with our crap because we didn't want to go through the OS :)
<Xeago>
:D
<Xeago>
it was soo flexible
kiwnix has joined #ruby
erichmenge has joined #ruby
<clocKwize>
:)
<Xeago>
booting from an application floppy!
<workmad3>
Xeago: back-breakingly flexible...
<Xeago>
:D
bradhe has joined #ruby
<workmad3>
Xeago: don't forget to load your custom TSRs!!!
stnly has joined #ruby
* Xeago
has no idea what a TSR is, he was fairly young at that time, and only knew how to boot into win95 and play cs
<clocKwize>
I've just got it tracing back to expressions and variables
<clocKwize>
Ideally I want to be able to output this as formatted html elements, and you can JS to say expression.recalculate_with(cats: 5) and it'll update the html and recalculate the answer
<clocKwize>
and I asking too much?
morozovm has quit [Read error: Connection reset by peer]
<Xeago>
clocKwize: no
<Xeago>
that is entirely possible
<clocKwize>
:p
<Xeago>
however
kaushik_ has joined #ruby
<Xeago>
I would not take your current stuff
<clocKwize>
at the moment I'm exposing things in several classes, so the UI can display the values, to manually display a calculation
<Xeago>
it is too wordy
Serial_Killer_C has joined #ruby
<clocKwize>
Xeago, nor would I, its a POC :P
morozovm has joined #ruby
<Xeago>
your representation of a formula is oretty ugly :3
bradhe has quit [Ping timeout: 256 seconds]
<Xeago>
what more are you trying to do within the poc?
<clocKwize>
probably at the end of this part
<Xeago>
define part
<Xeago>
tbh, I'd make this in javascript if that was your goal
irleif has joined #ruby
<Xeago>
and then use the same technique
<clocKwize>
the actual fact it can be done without too much crap
<clocKwize>
I don't think doing all the business calculations logic on the client side is a good idea >.<
chussenot has quit [Quit: chussenot]
tagrudev has quit [Quit: Wrong cable. FUCK]
<clocKwize>
once the Formulae set is built, it can be translated to javascript and can be recalculated in javascript
g-ram has quit [Quit: Computer has gone to sleep.]
dmiller_ has quit [Ping timeout: 252 seconds]
nari_ has joined #ruby
chussenot has joined #ruby
<clocKwize>
need a nice visitor type thing to walk over the structure and display it in a useful way too..
<Xeago>
clocKwize: store left and right of a formula
<Xeago>
then do a infix walk over your tree
timonv has joined #ruby
<Xeago>
I wonder how +/*! precedency is done in ruby
AlbireoX has quit [Remote host closed the connection]
<Xeago>
and whether it holds if done one custom objects
beneggett has joined #ruby
<clocKwize>
Xeago, I do already, math_engine does it, and has a nice visitor pattern to calculate, or display, or whatever you fancy. (I wrote that too)
AlbireoX has joined #ruby
<Xeago>
clocKwize: look at github.com/xeago/prefixer, it is in obj-c but it is well documented
<Xeago>
see the reducing part
* Xeago
never thought I'd link to that..
<clocKwize>
math_engine is a recursive decent parser that builts an AST then has a visitor walk it to do something useful
<clocKwize>
haha :P
<Xeago>
I also build an AST, and reduce it :)
mengu has quit [Read error: Operation timed out]
roflmaus has quit []
<clocKwize>
I just read that and still don't understand exactly what it does :D
<Xeago>
also read the readme
<Xeago>
it's fairly well written
<Xeago>
readme took .8 time of all the programming work
<clocKwize>
I read that
stnly has quit [Read error: Operation timed out]
<clocKwize>
its very long winded, and I still don't understand exactly what it does
<Xeago>
it parses an infix expression (1+2*4+b/c)
<Xeago>
builds an AST, to give a prefix output
<Xeago>
optionally reducing it
uuair has quit [Remote host closed the connection]
<clocKwize>
I see, just had to look at what infix meant :D
zodiak has joined #ruby
uuair has joined #ruby
<clocKwize>
but yes, thats what math_engine does, without the output prefix part =]
<clocKwize>
interested how you parsed
iamjarvo has quit [Quit: Computer has gone to sleep.]
<Xeago>
clocKwize: this is the most optimized way I could think of
samphippen has quit [Read error: Connection reset by peer]
AlbireoX has quit [Ping timeout: 276 seconds]
<Xeago>
I also had a few other versions
filipe has joined #ruby
<Xeago>
but they required more time and memory
earthquake has joined #ruby
<clocKwize>
ah, that requires spaces between everything?
samphippen has joined #ruby
uuair_ has joined #ruby
<Servidorv>
hey guys if i have multi mothod defined with the same param (posts)
<Xeago>
yea, that was specified in the assignment
g-ram has joined #ruby
<Xeago>
as it was about building the AST
<Servidorv>
will each of the method modifi the original posts???
<Xeago>
not parsing text ;p
stnly has joined #ruby
mib_mib has quit [Quit: Page closed]
<clocKwize>
fair enough :)
<clocKwize>
I'm doing a compiler course at the moment
<Xeago>
the magic happens at 105
<Xeago>
where I don't get a dangling branch
uuair has quit [Read error: Connection reset by peer]
<Spooner>
servidorv : None of them will affect anything, since the posts parameter would be a variable local to the method.
moshef has quit [Quit: moshef]
<Servidorv>
oh ok so unless i call that method it wont modify my posts var
kiwnix has quit [Remote host closed the connection]
<Spooner>
servidorv : No, noone of them affect a posts var. I think either you are describing the situation badly or I'm completely confused, because "my posts var" doesn't make sense in this context.
kiwnix has joined #ruby
<clocKwize>
Spooner, I'm confused too. servidorv, can you gist it?
<Servidorv>
ok i have like 5 mothod like this one extract_relevant_info(posts)
samphippen has quit [Quit: Computer has gone to sleep.]
<clocKwize>
becom33, its asynchronous. The browser will start up while the execution continues, sinatra will probably be running by the time the browser loads the page
<clocKwize>
(that was a guess)
<Xeago>
clocKwize: that is indeed the case most of the time
bapa has quit [Read error: Connection reset by peer]
<Xeago>
however it might race
<clocKwize>
yeah
Guest67186 has quit [Quit: Leaving...]
<clocKwize>
if sinatra just feels like being a shit
<clocKwize>
it might be too slow
bapa has joined #ruby
syskk has quit [Read error: Connection reset by peer]
<clocKwize>
best way would clearly be a callback from sinatra to say its started
<clocKwize>
but I cant see one that exists
<clocKwize>
:p
<Spooner>
clocKwize : You could parse the startup text ;)
<Xeago>
doesn't it always say, Sinatra version has taken the stage or something/
havenn has joined #ruby
<Spooner>
I wasn't being serious.
<Xeago>
booh
<clocKwize>
Spooner, I for 1 didn't believe you were being serious :p
<Spooner>
clocKwize Thank you!
<clocKwize>
maybe submit a pull request to have sinatra take a callback out of run!'s opts and execute it.
zigomir has quit [Read error: Operation timed out]
<clocKwize>
that is probably more involved that question asker wants to get.
aharris6 has joined #ruby
Synthead has joined #ruby
<Spooner>
I'd be surprised if there wasn't an easy way to get a callback on activation. Finding it might be more difficulty.
<Xeago>
you could simply ask the kernel if the port is in use
morf has quit [Quit: eof]
<clocKwize>
monkeypatch puts!
<Xeago>
while not_in_use
<clocKwize>
Xeago, the problem is run! blocks, so your code will never be reached
<clocKwize>
guess you could have another thread
maletor has joined #ruby
<Xeago>
in a seperate process ;p
<Xeago>
there's no need for that to be coupled to sinatra
elux has quit [Quit: Bye!]
maesbn has quit [Remote host closed the connection]
<Xeago>
anything that requires something to be done after a port is claimed is a valid usecase for this
aharris6 has quit [Remote host closed the connection]
<clocKwize>
Spooner, I read that - I still think configure is called before the server is started, as you can set ports in it. the race condition probably still exists but will be slightly less likley to happen :P
bradhe has joined #ruby
<clocKwize>
wow, I've spent a lot of today on irc and not working
reinaldob has joined #ruby
<Xeago>
clocKwize: welcome :)
bapa has quit [Quit: No Ping reply in 180 seconds.]
<clocKwize>
and I've thrown away my Formulae stuff, for now.
<Spooner>
clocKwize: Ah, yes, I sis wonder about configure. However, most of the time in startup is reading all the dependent files from requiring gems, so it would probably be called late on.
<clocKwize>
true
<clocKwize>
maybe not slightly less likely but way less likely :P
bapa has joined #ruby
jameshyde has joined #ruby
rbennacer has joined #ruby
jameshyde has left #ruby [#ruby]
zzyybb has joined #ruby
zzyybb has quit [Client Quit]
<rbennacer>
hello, how can i pick the first number of a string ? ex "3242324 hello" it want to pick 3242324
a_a_g has joined #ruby
<Spooner>
rbennacer : Lazy way is "3242324 hello".to_i
<clocKwize>
hehe
rh1n0 has joined #ruby
<clocKwize>
I was about to say the same
<clocKwize>
should really use a regexp or something though O.o
<rbennacer>
what would happen to the hello?
<clocKwize>
the first number might be after the hello?
<rbennacer>
what if there is another number?
timonv has joined #ruby
<rbennacer>
yes
bradhe has quit [Ping timeout: 240 seconds]
<Spooner>
rbennacer : You didnt' ask that question.
recycle has quit [Remote host closed the connection]
<Xeago>
he did but provided insufficient examples
Neomex has quit [Quit: Neomex]
tpe11etier has joined #ruby
<clocKwize>
str.scan(/[0-9]+/)
<clocKwize>
.first
tiripamwe has joined #ruby
<Spooner>
"hello 3242324"[/\d+/].to_i will pick the first number then.
zommi has quit [Quit: Leaving.]
amacgregor_osx has quit [Remote host closed the connection]
filipe has joined #ruby
<clocKwize>
or str.match(/[0-9]+/).to_s.to_i
darth has joined #ruby
darth is now known as Guest87417
<clocKwize>
Spooner, didn't know the [] accepted a regexp. Learn something every day :p
uuair has quit [Quit: uuair]
beneggett has joined #ruby
CaptainKnots has quit [Quit: bazinga!]
rippa has joined #ruby
<DefV>
you can even do
<DefV>
nvm
maletor has quit [Quit: Computer has gone to sleep.]
<Xeago>
Spooner: it doesn't allow chaining, which is what a shorthand would be imo
ejholmes has quit [Quit: ejholmes]
<Spooner>
Xeago : But simplifying a[:k1].nil? and a[:k1][:k2].nil? doesn't make sense since the latter will raise an exception if the former is true.
chin-tastic has quit [Ping timeout: 245 seconds]
justsee has quit [Quit: Leaving...]
<Xeago>
exactly, hence true should be returned
theRoUS has quit [Read error: Operation timed out]
<dimka>
Ok
<dimka>
s/and/or/
chrishunt has quit [Quit: Leaving...]
arubin- has joined #ruby
kkiero has quit [Read error: Operation timed out]
kkiero has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
<dimka>
So how coffeescript syntax could be applied here?
samphippen has quit [Quit: Computer has gone to sleep.]
morozovm has quit [Read error: Connection reset by peer]
enricostn has quit [Remote host closed the connection]
morozovm has joined #ruby
teedex has joined #ruby
beakerman has joined #ruby
<Spooner>
Well, sadly there isn't a simpler syntax in Ruby. The usual way to do this check is something like: if (value = a[:k1] && a[:k1][:k2] && a[:k1][:k2][:k3]);... end
amacgregor_osx has quit [Remote host closed the connection]
Servidorv has quit [Quit: Take my advice. I don't use it anyway]
maletor has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
yoklov has quit [Quit: bye!]
lukec has quit [Client Quit]
bluOxigen has quit [Ping timeout: 246 seconds]
burgestrand has quit [Quit: Leaving.]
seme has joined #ruby
<seme>
hey guys... does anyone use things like jeweler to manage their entire gem lifecycle?
<seme>
I'm looking for direction as I'm new and don't really know what is the current state of the art
hasse has joined #ruby
chussenot has joined #ruby
<atmosx>
I don't know what is jeweler
rakl has joined #ruby
<seme>
jeweler is, "Opinionated tool for creating and managing Rubygem projects"
Ziioynx has joined #ruby
<seme>
I have found a lot of sites talking about but I've also found some good docs on bundler about using that approach... not sure if there is a "best" way or not but I'd rather use whatever is popular with the boarder community
<hasse>
I have a ruby script that needs like 20 environment variables. I don't wanna input them every time I run the script. Is it possible to load them from a file or something?
dylanjha has quit [Quit: Leaving...]
h4mz1d has joined #ruby
<Mon_Ouie>
What about using neither? You pretty much just have a gemspec file to write and a version to bump upon each release
khakimov has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
recycle has joined #ruby
erichmenge has joined #ruby
havenn has quit [Remote host closed the connection]
sambio has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
dylanjha has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
Serial_Killer_C has quit [Remote host closed the connection]
ralphvdh has quit [Ping timeout: 244 seconds]
sagax has joined #ruby
mensvaga has quit [Ping timeout: 245 seconds]
AlbireoX has quit [Ping timeout: 245 seconds]
<mensvaga_>
I need to write a simple web form / app that has 2 or 3 steps. It doesn't talk to a database, it makes rest calls.
bradhe has joined #ruby
<mensvaga_>
Are there any sinatra tutorials on how to do a multi-staged form, with data verification on a per-stage basis?
jrist-afk is now known as jrist
Serial_Killer_C has joined #ruby
mensvaga has joined #ruby
vonsar has joined #ruby
GuidovanPossum has joined #ruby
carlyle has joined #ruby
wallerdev has joined #ruby
havenn has quit [Remote host closed the connection]
theRoUS has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
falkenbt has quit [Ping timeout: 245 seconds]
<mensvaga>
Is there a sinatra tutorial that shows how to do a multi-stage web form with some data verification in the middle?
yshh has quit [Remote host closed the connection]
Spooner has joined #ruby
<mensvaga>
I'm not going to be connecting to a database, I'm going to be making rest calls in between each step.
carlyle_ has quit [Ping timeout: 245 seconds]
carlzulauf has quit [Ping timeout: 248 seconds]
mensvaga_ has quit [Ping timeout: 245 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
cakehero has joined #ruby
F1skr has joined #ruby
carlzulauf has joined #ruby
Slydder has joined #ruby
morozovm has quit [Read error: Connection reset by peer]
<Slydder>
hey all. I am trying to get a Routing map translated from rails 2 to 3. could someone take a look at this and tell me if I am close: http://pastie.org/5104566
stephenjudkins has joined #ruby
morozovm has joined #ruby
ewokchewy has joined #ruby
nitti_ has joined #ruby
irleif has joined #ruby
cbuxton has joined #ruby
ejholmes has quit [Quit: ejholmes]
pskosinski has quit [Remote host closed the connection]
<Slydder>
hey all. I am trying to get a Routing map translated from rails 2 to 3. could someone take a look at this and tell me if I am close: http://pastie.org/5104566
<Spooner>
Slydder : Rails specific questions are more likely to be answered in #rubyonrails - also spamming is not encouraging people to answer.
nitti has quit [Ping timeout: 265 seconds]
JonnieCache has quit [Ping timeout: 260 seconds]
havenn has joined #ruby
<Slydder>
it would seem that #rails is dead as well. so thanks.
Slydder has left #ruby [#ruby]
sepp2k1 has joined #ruby
headius has joined #ruby
chrishunt has quit [Quit: Leaving...]
jordan_ has joined #ruby
<therod>
you should try #rubyonrails
jordan_ has quit [Remote host closed the connection]
sepp2k has quit [Ping timeout: 240 seconds]
<Spooner>
therod Don't bother, they've already left and they ignored my suggestion to go to #rubyonrails. A bit petulant, if you ask me ;)
<seme>
ok so there are a few other gem packages that help building gems such as hoe echoe... any thoughts on those?
mib_mib has joined #ruby
anderse has quit [Quit: anderse]
kil0byte_ has quit [Read error: No route to host]
mjb2k has joined #ruby
shevy has quit [Ping timeout: 240 seconds]
gccostabr has joined #ruby
artnez has joined #ruby
d3vic3 has quit [Quit: leaving]
the_jeebster has joined #ruby
<mib_mib>
hi guys, i have a memcache client object that i want to wrap, so in production mode it points to memcache, but in development mode it doesn't cache anything, and i'm trying to use a delegator - how do i do this without using method_missing?
<dangerousdave>
I have two arrays of different objects, but both types of object have an associated time. I would like to display the contants of both arrays mixed together and ordered by time.
baphled has joined #ruby
<Spooner>
dangerousdave : (a + b).sort_by &:time
<the_jeebster>
dangerousdave: either use concat to shove the contents of one array into the other or concatenate the whole array and flatten
artnez has quit [Client Quit]
<Spooner>
the_jeebster : Not sure you are answering the question asked on any level.
<the_jeebster>
Spooner: sure I am. just left out the sort_by
<the_jeebster>
unless I'm not understanding his question correctly. it sounded like he wanted to display contents of both arrays sorted by time
changedNicks has quit [Changing host]
changedNicks has joined #ruby
<Spooner>
the_jeebster : Where is the need to flatten coming from?
changedNicks is now known as sweet_kid
dmiller has quit [Remote host closed the connection]
<the_jeebster>
if he concatenates the entire array object into the other array
<the_jeebster>
just providing options for how to do it; not the most efficient. concatenating is better
morozovm has quit [Read error: Connection reset by peer]
morozovm has joined #ruby
aantix has quit [Remote host closed the connection]
aantix has joined #ruby
reinaldob has quit [Remote host closed the connection]
<Spooner>
the_jeebster : You can do a.push *b if you want to append one array onto another efficiently. (a << b).flatten is more complicated and no more efficient even than a + b.
<matti>
Meh
<Spooner>
Hey matti!
morozovm has quit [Read error: Connection reset by peer]
<the_jeebster>
Spooner: you're right, it's not efficient. didn't know about push splat, interesting
<the_jeebster>
was just trying to help :o
daniel_- has joined #ruby
schaerli has joined #ruby
morozovm has joined #ruby
Serial_K_ has joined #ruby
<matti>
Hi Spooner
<matti>
:-/
<Spooner>
Though now I think about it, I'm not sure pushing a splat doesn't end up being just the same, since I'm not sure how spatting takes place (whether it just creates a new list of arguments from the array...hmm).
shevy has joined #ruby
moshef has quit [Quit: moshef]
<Mon_Ouie>
a.push(*b) -> a.concat b
<Spooner>
the_jeebster : Sorry, I did come over a little too hard there regarding your answer.
<the_jeebster>
eh, we're all trying to help and be the most efficient at the end of the day anyways. being critical is healthy
<shevy>
eating potato is healthy too!
coffer has quit [Remote host closed the connection]
<linnea>
should this dirtyText2 = dirtyText.delete "-","\s" work?
Nanuq has quit [Ping timeout: 245 seconds]
<dangerousdave>
Spooner: the_jeebster: thanks
<linnea>
hmmm or it is delete("-"+"\s") =
<Spooner>
linnea : Depends what dirtyText is and what you are expecting it to do.
Nanuq has joined #ruby
<the_jeebster>
sweet potato
<linnea>
Spooner: it is string and I want to remove - characters and whitespaces
morozovm has quit [Quit: morozovm]
<shevy>
linnea that is odd
<Spooner>
linnea : You want dirtyText.gsub! /[-\s]/, ''
kil0byte has joined #ruby
<dangerousdave>
Spooner: the_jeebster: how can I determine the objects type to determine what i can do with it?
pskosinski has joined #ruby
<linnea>
Spooner: I had gsub but then I read this delete argument in doc
<danm_408>
./lds.rb:58:in `<main>': undefined method `<<' for nil:NilClass (NoMethodError)
<shevy>
k then << can not work because you work on a nil, I assume that options[:user] is not set
<danm_408>
I'm trying to concatenate strings
timmow has quit [Ping timeout: 252 seconds]
sent-hil has joined #ruby
<shevy>
if you would have a string, << would work, but you have nil, not a string object
the_jeebster has joined #ruby
<Spooner>
danm_408 : That means that options[:user] is nil, not a String.
bemson has joined #ruby
sambio has joined #ruby
Spooner has quit []
robotmay has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
<danm_408>
nevermind on that...
aldodelgado has joined #ruby
<danm_408>
/var/lib/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ber/core_ext/string.rb:23:in `encode': "\x82" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError) from /var/lib/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ber/core_ext/string.rb:23:in `raw_utf8_encoded' from /var/lib/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ber/core_ext/string.rb:15:in `to_ber'
<danm_408>
from /var/libgems/1.9.1/gems/net-ldap-0.3.1/lib/net/ltdap.rb:1396:in `block in search' from /var/lib/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap.rb:1367:in `loop' from /var/lib/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap.rb:1367:in `search' from /var/lib/gems/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap.rb:637:in `search' from ./lds.rb:61:in `<main>'
gccostabr has quit [Ping timeout: 246 seconds]
frogprince has left #ruby [#ruby]
havenn has joined #ruby
Skooljester has joined #ruby
timonv has joined #ruby
brianpWins has joined #ruby
passbe has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
Rizzle has joined #ruby
havenn has quit [Remote host closed the connection]
Skooljester has left #ruby [#ruby]
artnez has joined #ruby
_Mon_Ouie_ has quit [Ping timeout: 244 seconds]
areil has quit [Remote host closed the connection]
_Mon_Ouie_ has joined #ruby
<shevy>
danm_408 yeah Encoding error
<shevy>
these are annoying
kil0byte has quit [Remote host closed the connection]
slainer68 has joined #ruby
teedex has quit [Remote host closed the connection]
seme has quit [Quit: Lost terminal]
radic_ has quit [Remote host closed the connection]
emmanuelux has joined #ruby
g-ram has joined #ruby
linoj has quit [Quit: linoj]
radic has joined #ruby
emmanuelux has quit [Read error: Connection reset by peer]
reinaldob has joined #ruby
adambeynon has joined #ruby
bradhe_ has joined #ruby
mrsolo has quit [Quit: Leaving]
bradhe has quit [Ping timeout: 246 seconds]
savage- has quit [Remote host closed the connection]
reinaldob has quit [Remote host closed the connection]
bradhe has joined #ruby
teedex has joined #ruby
ryanlecompte has joined #ruby
chrishunt has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
nateberkopec has joined #ruby
havenn has joined #ruby
bradhe_ has quit [Ping timeout: 255 seconds]
alvaro_o has joined #ruby
passbe has joined #ruby
daniel_-_ has joined #ruby
akemEikko has joined #ruby
<danm_408>
shevy: how do I handle those?
brianpWins has quit [Quit: brianpWins]
Tuxist has joined #ruby
reuf has joined #ruby
sent-hil has quit [Remote host closed the connection]
akem has quit [Ping timeout: 256 seconds]
pskosinski has quit [Quit: A few unofficial Red Eclipse 1.3.1 (r4131) servers: http://altred.tk/toggle.rb]
fantazo has joined #ruby
pskosinski has joined #ruby
mark_locklear has joined #ruby
fermion has quit [Quit: P]
daniel_- has quit [Ping timeout: 264 seconds]
enroxorz-work has joined #ruby
<enroxorz-work>
hey guys, what the least jerkish way to announce a gem release that is brand spanking new?
akemEikko has quit [Client Quit]
Serial_K_ has quit [Remote host closed the connection]
nitti_ has quit [Remote host closed the connection]
snearch has joined #ruby
hakunin_ is now known as hakunin
akem has joined #ruby
CaptainKnots has joined #ruby
CaptainKnots has quit [Changing host]
CaptainKnots has joined #ruby
timonv has quit [Remote host closed the connection]
Serial_Killer_C has joined #ruby
DrShoggoth has quit [Quit: Leaving]
SCommette has joined #ruby
<shevy>
danm_408 well Encoding things really suck
alfism has joined #ruby
uuair has quit [Quit: uuair]
<shevy>
danm_408 I usually use "# Encoding: ASCII-8BIT" and hope that it will leave me alone
<shevy>
btw looks as if you have debian :P
Niamkik has joined #ruby
teedex has quit [Remote host closed the connection]
<shevy>
enroxorz-work a simple way is to use the ruby mailing list
<shevy>
"Due to the problems shown above, perhaps Struct should be taken out of Ruby paradigm all together."
xorigin has joined #ruby
becom33 has quit [Quit: Leaving]
QKO has quit [Ping timeout: 272 seconds]
ltsstar has quit [Quit: ltsstar]
nitti has joined #ruby
linoj has joined #ruby
_bart has quit [Read error: Connection reset by peer]
_bart has joined #ruby
teedex has joined #ruby
ltsstar has joined #ruby
justsee has quit [Quit: Leaving...]
_bart has quit [Remote host closed the connection]
_bart has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
justinmcp has quit [Ping timeout: 246 seconds]
<waxjar>
any bundler wizards? i'm running `bundle install --deployment` on a server with little memory, which causes it to crash. any ideas on how to avoid this?
CaptainKnots has quit [Quit: bazinga!]
swarley has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
justinmcp has joined #ruby
alanp_ is now known as alanp
marius has joined #ruby
spacebug_ has quit [Ping timeout: 256 seconds]
jrn has joined #ruby
pskosinski has quit [Quit: A few unofficial Red Eclipse 1.3.1 (r4131) servers: http://altred.tk/toggle.rb]
<jrn>
hi
jrn is now known as Guest86151
lukec has quit [Quit: lukec]
theRoUS has quit [Ping timeout: 260 seconds]
kpshek has quit []
TriTodd is now known as todd
maletor has joined #ruby
sent-hil has joined #ruby
todd is now known as Todd
judd7 has quit [Quit: judd7]
teedex has quit [Remote host closed the connection]
kirun has joined #ruby
<swarley>
I think I'm getting a little menacing with my function names
<shevy>
real men compile from source AND write everything on their own :)
<shevy>
I am a half-man, I reuse what others wrote
<shevy>
debian folks are too scared of compiling, so they are like windows users
Xeago has quit [Remote host closed the connection]
nitti has quit [Remote host closed the connection]
Xeago has joined #ruby
margle has joined #ruby
ckrailo has joined #ruby
dreinull has joined #ruby
margle has quit [Client Quit]
matti has left #ruby ["8-X"]
<dreinull>
are there any useful versioning gems that work with orms?
mparodi_ has quit [Quit: Leaving]
morozovm has joined #ruby
Xeago has quit [Ping timeout: 264 seconds]
burgestrand has joined #ruby
awestroke is now known as Adys_
<dreinull>
I'm not on rails so this is not exactly a #rails question :)
Adys_ has quit [Remote host closed the connection]
cdzombak has quit []
crodas has quit [Ping timeout: 246 seconds]
<danm_408>
shevy: I've used ubuntu, debian based isn't the same as debian
<danm_408>
and I got tired of source compiles for freebsd
rbennacer has left #ruby ["Leaving"]
clocKwize1 has joined #ruby
<shevy>
oh I would not recommend freebsd
<shevy>
I found linux in general easier than bsd for instance
morozovm has quit [Client Quit]
<shevy>
what gentoo does is, to use emerge to compile from source, which is written in python
<shevy>
we'd need that for ruby :\
rippa has quit [Ping timeout: 272 seconds]
apok_ has joined #ruby
caleb_io has quit [Quit: Leaving...]
teedex has joined #ruby
c0rn_ has joined #ruby
<Guest86151>
after all I must admit, Ubuntu is the best choice, starting with a minimal ubuntu installation, you can do everything
Guest86151 is now known as zappenduster
clocKwize has quit [Ping timeout: 265 seconds]
apok has quit [Ping timeout: 255 seconds]
apok_ is now known as apok
ltsstar has quit [Quit: ltsstar]
akem has quit [Read error: Connection reset by peer]
akemEikko has joined #ruby
baroquebobcat has joined #ruby
akemEikko has quit [Max SendQ exceeded]
freezey has quit [Quit: freezey]
Guest66451 is now known as ixx
<dreinull>
netbsd killed my ibook a few months back.
dreinull has quit [Read error: Connection reset by peer]
caleb_io has joined #ruby
tvw has joined #ruby
dreinull has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
akemEikko has joined #ruby
danm_408 has quit [Quit: leaving]
bluOxigen has joined #ruby
seanyo has quit [Ping timeout: 265 seconds]
crodas has joined #ruby
freezey has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
c0rn_ has quit [Quit: Computer has gone to sleep.]
<shevy>
really? you mean, destroyed it?
headius has joined #ruby
jslowe has joined #ruby
Serial_Killer_C has joined #ruby
akem has joined #ruby
mengu has joined #ruby
K3n has joined #ruby
akemEikko has quit [Read error: Connection reset by peer]
tpe11etier has quit [Ping timeout: 256 seconds]
<dreinull>
shevy: yes, killed my graphics card
airtanah_ has joined #ruby
<dreinull>
I didn't pay attention while installing and some bad settings probably took their toll
g-ram has quit [Quit: Computer has gone to sleep.]
Russell^^ has joined #ruby
Appineer has quit [Remote host closed the connection]
<dreinull>
It was an old 2001 dual usb so I needed a small and fast os that would run on it
Jamone has quit [Quit: Quit]
<linnea>
dreinull: whyyy would you install netbsd over mac os?
<linnea>
ah 2001 :D
airtanah has quit [Ping timeout: 240 seconds]
apok has quit [Remote host closed the connection]
<dreinull>
linnea: panther was the last supported os X and i couldn't find any new packages for it
apok has joined #ruby
<dreinull>
couldn't even install a proper ruby on it because old macports packages had disappeared
<linnea>
:)
artnez has quit [Quit: artnez]
wallerdev has quit [Quit: wallerdev]
<linnea>
i killed my macbook with coffee
<linnea>
oh no coffee, cola
<dreinull>
it's a myth that in the future you will be able to get sources for old data even if its open source
lukec has joined #ruby
<dreinull>
things just disappear from the net
robertotauille has quit [Quit: Leaving...]
<dreinull>
I'd hate that. I killed mine with style :)
<K3n>
sometimes you have luck with the web.archive wayback machine ;)
<dreinull>
OpenBSD was nice and fast but a bit too nerdy and a pain to admin
<linnea>
dreinull: yeah, but I got money back from insurance company, I bet you didn't :D
<dreinull>
linnea: no, but I still have it and also that precious wifi card in it.
elux has joined #ruby
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
headius has quit [Quit: headius]
<linnea>
yeah I also have that macbook. :) but it doesnt have hd and buttons inst working
<dreinull>
could you run it as a server?
akem has joined #ruby
<linnea>
dreinull: i cant get power on
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
<dreinull>
linnea: what a pity.
<linnea>
yeah :(
doodlehaus has joined #ruby
Targen has joined #ruby
<linnea>
dreinull: if it was working I would like to use it my tv computer
doodlehaus has quit [Remote host closed the connection]
caleb_io has quit [Quit: Leaving...]
akem has quit [Max SendQ exceeded]
<shevy>
god I hate libtool .la files. when I compile something with an absolute path, libtool expects that .la file to be at that path too, and if it is not there, it complains and the compilation dies
akem has joined #ruby
<shevy>
a friend once killed my laptop with beer
Neomex has joined #ruby
<dreinull>
!friend
<shevy>
haha he was half-drunk at that time and placed his beer near the laptop before, then he turned around and pushed his glass over that way
alfism has quit [Quit: alfism]
hakunin has quit [Remote host closed the connection]
<dreinull>
you remind me of something
dakine has quit [Ping timeout: 248 seconds]
<dreinull>
cheers
jmccune has joined #ruby
thillux_ has joined #ruby
c0rn_ has joined #ruby
mmitchel_ has quit [Read error: Connection reset by peer]
mmitchell has joined #ruby
khakimov has joined #ruby
k0nichiwa has quit [Ping timeout: 255 seconds]
ejholmes has joined #ruby
Takehiro has quit [Remote host closed the connection]
thillux has quit [Ping timeout: 248 seconds]
Targen has quit [Ping timeout: 244 seconds]
juancarloscruzd has joined #ruby
K3n has quit [Quit: K3n]
vonsar has quit [Quit: This computer has gone to sleep]
artnez has joined #ruby
bluOxigen has quit [Ping timeout: 252 seconds]
vonsar has joined #ruby
bradhe_ has quit [Remote host closed the connection]
k0nichiwa has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
Nanuq has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
Nanuq has joined #ruby
Virunga has quit [Remote host closed the connection]
apok_ has joined #ruby
blacktul_ has joined #ruby
slainer68 has quit [Remote host closed the connection]
wallerdev has joined #ruby
krawchyk has quit [Remote host closed the connection]
Tuxist has quit [Remote host closed the connection]
xorigin has quit [Quit: leaving]
apok has quit [Ping timeout: 248 seconds]
blacktulip has quit [Ping timeout: 248 seconds]
apok_ is now known as apok
jgarvey has quit [Quit: Leaving]
ping-pong has quit [Ping timeout: 244 seconds]
<shevy>
what is puts doing
<shevy>
it calls .to_s on an object?
carloslopes has joined #ruby
carloslopes has left #ruby [#ruby]
<shevy>
aha... there must be defined a def to_s method
nitti has joined #ruby
<shevy>
is there a way to find out: "If the user uses puts, do this or that instead"?
<swarley>
that works too, if the number wont be floating
<ksaw123>
yeah that fine.
<ksaw123>
how can i reference what the user inputs?
<ksaw123>
i have the method I just don't know how to use it hah
nanderoo has quit [Remote host closed the connection]
<swarley>
which method?
<ksaw123>
def is_i?
dangerousdave has quit [Quit: Leaving...]
sertaconay has joined #ruby
<ksaw123>
http://pastie.org/5105446 im trying to require number input only, so a user can't enter a word
Trioke has quit [Ping timeout: 268 seconds]
nemesit has quit [Quit: Leaving...]
vonsar has joined #ruby
<blazes816>
ksaw123: Integer(gets.chomp)
<blazes816>
and it will raise an exception if what was given is not an integer
<blazes816>
/ can't be coerced into one
<ksaw123>
im required to use Reg ex though
headius has joined #ruby
tommyvyo has joined #ruby
juancarloscruzd has quit []
h4mz1d has joined #ruby
knite has joined #ruby
Xeago has quit [Remote host closed the connection]
bbttxu has joined #ruby
ewokchewy has quit [Quit: Leaving]
ralphvdh has quit [Ping timeout: 244 seconds]
ewokchewy has joined #ruby
blacktulip has quit [Remote host closed the connection]
swarley has quit [Ping timeout: 246 seconds]
Virunga has quit [Remote host closed the connection]
fantazo has quit [Ping timeout: 244 seconds]
caleb_io has quit [Quit: Leaving...]
caleb_io has joined #ruby
[Neurotic] has joined #ruby
mark_locklear has quit [Remote host closed the connection]
<knite>
I have a tree-like data structure and don't want to maintain a reference to a node's children AND parents. but I do occasionally want to refer to a node's parent. is there a way to get an object's container? e.g., I have a class Foo with a @children variable of more Foos. can I do something to a Foo inside @children to get the parent Foo?
iamjarvo has quit [Quit: Computer has gone to sleep.]
<blazes816>
ksaw123: /\d+/ will match only numbers
<chessguy>
no, they would have no knowledge of the object that contains them
workmad3 has quit [Ping timeout: 255 seconds]
<chessguy>
@knite
<knite>
chessguy: so my only choice is to maintain parent and child references?
Zai has quit [Disconnected by services]
<chessguy>
knite: as far as i can tell from your description, yes
<chessguy>
doesn't sound so bad
<ksaw123>
blazes816: ty
rakl has quit [Quit: sleeping]
<knite>
chessguy: I still have nightmares about implementing doubly-linked lists in C++...:-)
<chessguy>
knite: haha
c0rn_ has joined #ruby
nitti has joined #ruby
elux has quit [Quit: Bye!]
rkneufeld has joined #ruby
c0rn_ has quit [Client Quit]
c0rn_ has joined #ruby
c0rn_ has quit [Client Quit]
tommyvyo has quit [Quit: Computer has gone to sleep.]
emergion has joined #ruby
elaptics`away is now known as elaptics
Cultofmetatron has quit [Remote host closed the connection]
<havenn>
If you don't feel like paying for #to_sym you can get an #intern: 'student'.intern #=> :student
sepp2k1 has quit [Remote host closed the connection]
mmitchell has joined #ruby
atmosx has quit [Quit: lost in yarn]
JonnieCache has joined #ruby
BSaboia has joined #ruby
ralphvdh has joined #ruby
mmitchell has quit [Ping timeout: 244 seconds]
the_jeebster has quit [Quit: Leaving.]
und3f has quit [Quit: Leaving.]
jenrzzz has joined #ruby
omry has joined #ruby
tommyvyo has joined #ruby
chichou has quit [Remote host closed the connection]
chessguy has quit [Remote host closed the connection]
miphe has left #ruby ["Leaving"]
ralphvdh has quit [Ping timeout: 255 seconds]
nari_ has joined #ruby
amacgregor_osx has joined #ruby
sertaconay has quit [Ping timeout: 244 seconds]
saschagehlich has quit [Ping timeout: 240 seconds]
IrishGringo has joined #ruby
axl_ has quit [Quit: axl_]
andrewh has quit [Ping timeout: 260 seconds]
tvw has quit [Remote host closed the connection]
andrewh has joined #ruby
Xeoncross has quit [Quit: Ex-Chat]
awarner has quit [Remote host closed the connection]
apok has quit [Quit: apok]
k0nichiwa has quit [Ping timeout: 246 seconds]
cableray has quit [Quit: cableray]
jkyle has joined #ruby
jkyle has left #ruby [#ruby]
lupine_85 has quit [Excess Flood]
Takehiro has joined #ruby
xpen has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
chin-tastic has quit [Ping timeout: 260 seconds]
lupine_85 has joined #ruby
Takehiro has quit [Ping timeout: 246 seconds]
mjb2k has quit [Quit: Leaving]
BSaboia has quit [Quit: Fui embora]
elaptics is now known as elaptics`away
F1skr has quit [Quit: WeeChat 0.3.9]
Jonah11_ has joined #ruby
<Jonah11_>
i'm looking for a hash method analogous to Array#map that would allow me to rewrite this more compactly: http://pastie.org/5106100
rabidpraxis has quit [Remote host closed the connection]
swarley has joined #ruby
poRz has quit [Remote host closed the connection]
poRz has joined #ruby
<heftig>
Jonah11_: Hash#map
poRz has quit [Remote host closed the connection]
<Jonah11_>
heftig, i didnt see that listed in the docs
Synthead has quit [Quit: p33 ba115]
bradhe_ has quit [Remote host closed the connection]
<heftig>
map is a method of Enumerable, included in both Array and Hash
jjang has joined #ruby
<Jonah11_>
heftig, ah right, forgot about that
<Jonah11_>
heftig, ty
manizzle has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
mva3212 has quit [Remote host closed the connection]
jenrzzz has joined #ruby
iamjarvo has joined #ruby
lkba has quit [Ping timeout: 255 seconds]
Spooner has joined #ruby
caleb_io has joined #ruby
rabidpraxis has joined #ruby
sent-hil has quit [Remote host closed the connection]
mensvaga has left #ruby [#ruby]
poRz has joined #ruby
JonnieCache has quit [Ping timeout: 252 seconds]
jimeh2 has quit [Read error: Operation timed out]
ilyam has joined #ruby
pothibo has joined #ruby
darthdeus has quit [Quit: Leaving...]
Cultofmetatron has quit [Remote host closed the connection]
rabidpraxis has quit [Ping timeout: 272 seconds]
Cultofmetatron has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
bbttxu has quit [Quit: bbttxu]
jarred_ has joined #ruby
zodiak has quit [Read error: Connection reset by peer]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
bemson has quit [Quit: bemson]
x0F_ is now known as x0F
nitti has joined #ruby
eignerchris has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
Goles has joined #ruby
bemson has joined #ruby
hasse has quit [Ping timeout: 245 seconds]
awarner has joined #ruby
erichmenge has joined #ruby
ablankfield has joined #ruby
<ablankfield>
Anyone active?
<Spooner>
Nope, we are all bots and zombies.
slainer6_ has quit [Remote host closed the connection]
<maskact>
Spooner is correct.
<Spooner>
That is bots and zombies, not bots or zombies ;)
nitti has quit [Ping timeout: 264 seconds]
jonathanwallace has joined #ruby
<Spooner>
But seriously, ablankfield, if you have a question, you can just ask.
awarner has quit [Remote host closed the connection]
somazero has quit [Remote host closed the connection]
skaczor has quit [Remote host closed the connection]
reinaldob has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
<ablankfield>
sorry, I was trying to join ruby on rails too
<ablankfield>
I'm new to ruby/rails and I'm just looking for help with a few things i don't understand
<swarley>
Spooner; i actually planned out my library today. I made a huge flowchart for every syntatical possibility
<ablankfield>
this isn't like the ubuntu channel where you get your face chewed off for mentioning another channel or going off topic, is it?
<swarley>
No lol
<ablankfield>
wheewww, home sweet home
ephemerian has quit [Quit: Leaving.]
<swarley>
Yeah, we're probably the most easy going of the programming language communities
<swarley>
(in my experiences at least)
<ablankfield>
I knew ruby had to be kickass
<Spooner>
swarley : Unless you say Python is better than Ruby, then we are on you like a pitbull ;)
<swarley>
LOL
<swarley>
Well, language wars are never pretty
<swarley>
which is why i dont like to take part in them
<swarley>
different languages serve different purposes, and that's that. Alls said and done
<ablankfield>
one thing that has really peaked my curiosity is object oriented programming. The problem is I don't quite get what makes it different from a functional or standard language
teedex has quit [Remote host closed the connection]
Xeago has quit [Read error: Connection reset by peer]
<swarley>
Ah, well there is a biiiig difference from functional. and by standard i'm going to assume you mean procedural
anachronistic has joined #ruby
Xeago has joined #ruby
<ablankfield>
well, I'm kinda new to programming so I'm not sure exactly what I mean lol
Trioke has quit [Ping timeout: 245 seconds]
<ablankfield>
I've messed with html and css a bunch and tried learning java and javascript but both of those kinda hurt to think about
`brendan has joined #ruby
<swarley>
Hm, well the best way to figure it out is to just keep learning and ask questions as you get them
<ablankfield>
but i like playing in the terminal so when I tried playing with ruby it was pretty fun
<swarley>
Well, java is a weird mix of procedural and object orientation in my opinion, i know people will tell you its all OO, and i'm sure it is. But its ugly and hard to work with OO.
<swarley>
In my opinion at least
elico has quit [Quit: elico]
<ablankfield>
yeah, I mostly picked ruby because of it being a high level language
therod has joined #ruby
<ablankfield>
kinda hoping if the syntax was easy it would click alil better
<swarley>
Its one of the languages that you dont have to make an ordeal of to read a file
rkneufeld has joined #ruby
pfaff has quit [Quit: Leaving.]
Chryson has joined #ruby
<swarley>
My judge for how high level a language is, is generally how easy it is to create a socket
ralphvdh has joined #ruby
<ablankfield>
a socket?
maletor has quit [Quit: Computer has gone to sleep.]
<ablankfield>
also I feel like a newb when it comes to programming so I ask a lot of questions
<swarley>
A socket is a networking type IO stream, like when you connect to a web server to transfer data, you transfer the data through a socket
<swarley>
Its no problem
Xeago has quit [Ping timeout: 252 seconds]
<ablankfield>
like ftp?
<swarley>
In ruby you would do something like, TCPSocket.new("www.google.com", 80) there are of course, way easier ways to get the web page at google.com than opening a socket directly, but sockets have more uses than just web