Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<any-key> from snake to camelCase:
<any-key> foo = s.split('_'); foo[0] + foo[0..foo.size].map(&:capitalize).join
<any-key> where s is the input string
<any-key> I'm sure there's a more clever way of doing that
<any-key> oops
<any-key> foo = s.split('_'); foo[0] + foo[1..foo.size].map(&:capitalize).join
carlyle has joined #ruby
<any-key> off by one :P
etrece has joined #ruby
<waxjar> there must be a gem though, like active support but without the overhead
<waxjar> thank though, any-key :)
<any-key> not really...it's such a simple task
<any-key> s.partition(/[A-Z][a-z]*/).map(&:downcase).join('_')
<waxjar> exactly :p
<any-key> that goes from camelCase to snake_case
<any-key> tada
<any-key> that took me waaay too long
<Hanmac> i would do snake tocamel so: s.split('_').each.with_index.map {|o,i| i.zero? ? o : o.capitalize}.join
<any-key> Hanmac: I like that solution better
<Hanmac> my or yours?
<any-key> mine was silly and created a variable when it shouldn't have :|
<any-key> Hanmac: yours
<any-key> waxjar: so now you've got everything you need!
<Hanmac> hm was the ruby way snake or camelcase?
<any-key> snake
<any-key> camel for class names
<any-key> snake for everything else
<any-key> basically: if it's capitalized, camel case it, else snake case it
banisterfiend has joined #ruby
iocor_ has joined #ruby
<Hanmac> hm ... maybe i need an converter, because my method missing is used with Camelcase proberties, (so it mimic attr methods) maybe i add snake case detection
gregoryf has joined #ruby
pu22l3r has joined #ruby
<any-key> you definitely should; snake case is how most ruby is done
mxweas_ has joined #ruby
minijupe has joined #ruby
orospakr has joined #ruby
rickmasta has joined #ruby
wookiehangover has joined #ruby
twelvechairs has joined #ruby
Pip has joined #ruby
<artOfWar> having trouble installing mysql2 gem in ruby, I faintly remember coming across some tool like rvm which can be used to install but cannot remember, any help?
dmn001- has joined #ruby
twelvechairs has joined #ruby
pu22l3r has joined #ruby
fayimora has joined #ruby
randym has joined #ruby
seanstickle has joined #ruby
mxweas_ has joined #ruby
orospakr has joined #ruby
andman has joined #ruby
Ammar01 has joined #ruby
unixjazz has joined #ruby
Willejs has joined #ruby
y3llow has joined #ruby
eignerchris has joined #ruby
voodoofish430 has joined #ruby
nfluxx has joined #ruby
ed_hz_ has joined #ruby
philips has joined #ruby
nyrb has joined #ruby
elliot98 has joined #ruby
v0n has joined #ruby
ElderFain has joined #ruby
voodoofish has joined #ruby
d34th4ck3r has joined #ruby
ReachingFarr has joined #ruby
theishi has joined #ruby
wvdschel has joined #ruby
heftig has joined #ruby
soulcutter has joined #ruby
Kageroc has joined #ruby
Tick-Tock has joined #ruby
vandemar has joined #ruby
dfr has joined #ruby
eregon has joined #ruby
jbpros has joined #ruby
iaj has joined #ruby
indeterminate has joined #ruby
JonSchuff has joined #ruby
lavaman has joined #ruby
araujo has joined #ruby
khem_ has joined #ruby
dhodgkin has joined #ruby
Fraeon has joined #ruby
Guest23751 has joined #ruby
milkshak1s has joined #ruby
beernutty has joined #ruby
jhowarth has joined #ruby
alaska has joined #ruby
tomaw has joined #ruby
ec has joined #ruby
tshirtman has joined #ruby
sebastian_pl has joined #ruby
pkondzior has joined #ruby
Veejay has joined #ruby
thomasfedb has joined #ruby
kuzushi has joined #ruby
Drakevr has joined #ruby
froy has joined #ruby
joschi has joined #ruby
marienz has joined #ruby
aef has joined #ruby
<etrece> what error are you getting?
denom has joined #ruby
y3llow has joined #ruby
looopy has joined #ruby
mitchty has joined #ruby
hadees has joined #ruby
beernutz has joined #ruby
pabloh has joined #ruby
rbarrero has joined #ruby
<rbarrero> hi all
<rbarrero> I'm new to Ruby and i'm trying to write a chef recipe
<rbarrero> so far so good, but I need access to data that lies outside the recipe
nfluxx has joined #ruby
<rbarrero> so I'm doing the following:
<rbarrero> ip_address = node.attribute? "cloud" ? node['cloud']['local_ipv4'] : node['ipaddress']
<rbarrero> and later using like this #{ip_address}
<rbarrero> but it's value is: false
Willejs has joined #ruby
nyuszika7h has joined #ruby
mattonrails has joined #ruby
ascarter_ has joined #ruby
ZachBeta has joined #ruby
<banisterfiend> pabloh: no
<banisterfiend> pabloh: they're scoped to top level
<pabloh> banisterfiend: ok, thx
<pabloh> if just one main object per running script then?
<pabloh> s/if/its
<banisterfiend> pabloh: Yes
headius has joined #ruby
vraa_ has joined #ruby
replore has joined #ruby
<cloke> is there a more concise way to write "a << x.y if x.y" I feel like I shouldn't have to check for each one
<banisterfiend> cloke: google for andand
<cloke> banisterfiend: thanks, that looks interesting
`brendan has joined #ruby
<Eiam> I've got a regex i want to run on a file that rubular helped me figure out.. but i've got no idea how to get ruby -ne to.. act on whats piped in?
<Eiam> i tried cat file | ruby -ne 'print $1 if $_ =~/[0-9]{7,8}/' but no dice
<Eiam> (i want all 7-8 digit numbers in the file
<Eiam> )
Pip has quit ["It's not your problem."]
<moshee> Eiam, use $< or $stdin
laen_ has joined #ruby
stephenjudkins has joined #ruby
randym has joined #ruby
tectonic has joined #ruby
Karmaon has joined #ruby
caiges has joined #ruby
<Eiam> hmm no dice… cat all.txt | ruby -ne 'print $1 if $stdin =~ /[0-9]{7,8}/' > anotherTest.txt
<Eiam> the regex matches fine in rubular
<Eiam> (on the same dataset)
Indian has joined #ruby
<moshee> try grep? lol
<Eiam> =(
sythe has joined #ruby
sythe has joined #ruby
KL-7 has joined #ruby
mikepack has joined #ruby
adeponte has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
dagnachewa has joined #ruby
ZachBeta has joined #ruby
gregoryf has quit [#ruby]
werdnativ has joined #ruby
Guest84974 has joined #ruby
alup_ has joined #ruby
a215 has joined #ruby
a215 has joined #ruby
TheTFEF has joined #ruby
<Hanmac> hm what is the diffrence between rb_string_value_ptr and rb_string_value_cstr? ... currently none of them works currect for me :(
<banisterfiend> Hanmac: what are you trying to do piggy
<Hanmac> using an ruby object as wxInputStream child
jetblack has joined #ruby
<banisterfiend> Hanmac: i use RSTRING_PTR
<banisterfiend> the macro
_|christian|_ has joined #ruby
libertyprime has joined #ruby
looopy has joined #ruby
laen_ has joined #ruby
yawniek has joined #ruby
jetblack has joined #ruby
rbarrero has quit ["Leaving"]
Wandering_Glitch has joined #ruby
<Hanmac> hmmm ok i tryed it but for some reason wx does not read it currectly ... maybe i should ask the wx guys ... :/
khakimov has joined #ruby
marknyc has joined #ruby
jetblack has joined #ruby
kiggyd has joined #ruby
<kiggyd> anyone here watching the debates right now? our startup is doing this live dial testing (just go on your smartphone or tablet to m.heartbyte.com and tune into CNN). we publish the results to our blog www.heartbyte.com/blog
<seanstickle> There's a debate?
<seanstickle> Again?
<kiggyd> seanstickle: yup
<seanstickle> They gotta stop having those.
Targen has joined #ruby
CreativeEmbassy has joined #ruby
<td123> presidential candidate debates.. I would love them to throw some actual hard questions at them and not be afraid of checking facts and calling bullshit
patrick99e99 has joined #ruby
<td123> if a real debate like that actually happened, I would get the dvd and watch it live :P
<patrick99e99> is there any way to yield a block to an object? in other words.. foo = Foo.new; foo do |blah| ... Is there any ruby magic that would allow this sort of thing?
philcrissman has joined #ruby
nari has joined #ruby
liluo has joined #ruby
banisterfiend has joined #ruby
DeeJayTwo has joined #ruby
briankbuckley has joined #ruby
dotnull has joined #ruby
<twelvechairs> patrick99e99: sure you can do 'def doo(&block); yield' but whats the use-case.... is this the right way to do it?
<td123> huh, I didn't know you can define a method and a variable with the same name :)
<td123> and they will be seperate
<banisterfiend> td123: Yeah
<patrick99e99> twelvechairs: hmmmmm yeah might not be the right way to do it...
<banisterfiend> patrick99e99: what you trying to do homie
jergason has joined #ruby
<patrick99e99> banisterfiend: well I have config data for a rails app, and right now it's in a constant.. APP_CONFIG[:foo] for example.. but I was just dealing with some nested config options and had some thing like a_method APP_CONFIG[:foo][:bar], APP_CONFIG[:foo][:baz], APP_CONFIG[:foo][:lol]
ta8let has joined #ruby
<patrick99e99> and I was thinking, it sure would be nice if I just had a method that I could do something like app_config(:foo) do |config| ...
<patrick99e99> and be able to just do config[:lol], config[:baz], etc within that block
ta8let has quit [#ruby]
kiggyd has quit [#ruby]
<patrick99e99> and was just trying to imagine how I might do that...
kerframil has joined #ruby
daniel_hinojosa has joined #ruby
<banisterfiend> def app_config(key); yield APP_CONFIG[key]; end
<patrick99e99> but I am not too crazy about having a global object method doing that...
<patrick99e99> banisterfiend: is it kind of evil to have that method just existing in .. what? MAIN? it would be somewhere out in the top-level-land...
M- has joined #ruby
<banisterfiend> patrick99e99: if you just defined it on top-level that's ok
philcrissman has joined #ruby
Evixion` has joined #ruby
<banisterfiend> but if you defined it on Object that's not so cute
<patrick99e99> banisterfiend: hmm.. ok..
<banisterfiend> patrick99e99: to define it on top-level use: def self.app_config; end
<banisterfiend> to define it on Object use def app_config; end
<twelvechairs> patrick99e99: of course you can do it, but that sounds like a lot of hassle for little gain to me...
savage- has joined #ruby
rushed has joined #ruby
tommyvyo has joined #ruby
<banisterfiend> twelvechairs: how is it a hassle
shtirlic has joined #ruby
<banisterfiend> patrick99e99: btw i think u have a slightly busted notion of top-level, read this article http://banisterfiend.wordpress.com/2010/11/23/what-is-the-ruby-top-level/
<twelvechairs> banisterfiend: whole new methods just to avoid a few [:foo]s?
<banisterfiend> twelvechairs: i often write tiny little helper methods to make my code cleaner
macmartine has joined #ruby
<banisterfiend> though in his case he could get by with just a local
<banisterfiend> my_foo = APP_CONFIG[:foo]
<banisterfiend> my_foo[:bar]
chrxn has joined #ruby
<twelvechairs> banisterfiend: well, its hard to know without the specifics really. may end up with more lines of code, may end up with fewer. May end up with clearer code, or it may just obfuscate the structure... 's all i am saying.
werdnativ has joined #ruby
emmanuelux has joined #ruby
ZachBeta has joined #ruby
randym_ has joined #ruby
ekaleidox has joined #ruby
CheeToS has joined #ruby
ZachBeta has joined #ruby
fermion has joined #ruby
TheTFEF has joined #ruby
andrewhl has joined #ruby
MasterIdler_ has joined #ruby
Hanmac1 has joined #ruby
pu22l3r has joined #ruby
mickn has joined #ruby
<banisterfiend> twelvechairs: do you use ruby-debug
frishi has joined #ruby
alanp has joined #ruby
dv310p3r has joined #ruby
PragCypher has joined #ruby
randym has joined #ruby
idletom has joined #ruby
philcrissman has joined #ruby
chrxn has joined #ruby
andrewhl has joined #ruby
sythe has joined #ruby
sythe has joined #ruby
pdtpatr1ck has joined #ruby
phantomfakeBNC has joined #ruby
tomzx has joined #ruby
vraa__ has joined #ruby
v4n_ has joined #ruby
<v4n_> hi
<v4n_> is there a pure ruby alternative to mechanize?
jcromartie has joined #ruby
<v4n_> I'm bored about compiling nokogiri with libxslt etc just to parse a single HTML page
sythe has joined #ruby
sythe has joined #ruby
mattonrails has joined #ruby
minijupe has joined #ruby
sythe has joined #ruby
pu22l3r has joined #ruby
sythe has joined #ruby
sythe has joined #ruby
IceD^^ has joined #ruby
bigkm has joined #ruby
adamkittelson has joined #ruby
cook1es has joined #ruby
havenn has joined #ruby
milkpost_ has joined #ruby
mxweas_ has joined #ruby
mikepack has joined #ruby
Shin-LaC has joined #ruby
<Shin-LaC> guys
<Shin-LaC> let's say I want to associate a value with an arbitrary object
<Shin-LaC> actually, with many such objects
<Shin-LaC> I might use a dictionary with the objects as keys
notjohn has joined #ruby
<Shin-LaC> but can I have weak references there?
<Shin-LaC> wait, why didn't I google this
ZachBeta has joined #ruby
wyhaines has joined #ruby
no-name- has quit ["Leaving"]
namidark has joined #ruby
<Shin-LaC> hmm
<namidark> So I wanted to start doing some data mining into some h5 files (from the million song dataset) and I can't find anything from a few google searches for ruby that can read .h5 files -- does anyone have any pointers?
<Shin-LaC> I could have a hash full of WeakRefs
<Shin-LaC> but then the WeakRef objects would stick around
<Shin-LaC> even if the referred objects themselves got gced
blueadept has joined #ruby
blueadept has joined #ruby
<Shin-LaC> basically, I want to attach some value to exceptions as they are raised
<Shin-LaC> but the raised object can be anything
<Shin-LaC> not necessarily an exception
<Shin-LaC> so adding a variable to the Exception class may not be enough
<Shin-LaC> I could add a variable to the object, if it's not an instance of Exception
<Shin-LaC> but maybe the best approach is to associate the value with the object indirectly
<Shin-LaC> using a hash
<Shin-LaC> what might be the best way of doing this?
radic has joined #ruby
ZachBeta has joined #ruby
macmartine has joined #ruby
_srp has joined #ruby
MissionCritical has joined #ruby
ZachBeta has joined #ruby
manizzle has joined #ruby
rohit has joined #ruby
mikepack has joined #ruby
adeponte has joined #ruby
kawa_xxx has joined #ruby
rohit has joined #ruby
havenn has joined #ruby
crankycoder has joined #ruby
whh has joined #ruby
al3xnull has joined #ruby
twelvechairs has joined #ruby
anahue has joined #ruby
IAD has joined #ruby
rickmasta has joined #ruby
maletor has joined #ruby
coreydaley has joined #ruby
_srp has joined #ruby
waxjar has joined #ruby
strife25 has joined #ruby
anahue has quit [#ruby]
jcromartie has joined #ruby
ElitestFX has joined #ruby
ElitestFX has joined #ruby
Karmaon has joined #ruby
Karmaon has joined #ruby
jergason has joined #ruby
savage- has joined #ruby
TooR4u has joined #ruby
<TooR4u> Hi .. i am new to ruby. Installed RVM and ruby1.9.2. Now i am trying to set the default version to 1.9.2 by using the following command.
<TooR4u> rvm --default use 1.9.2
<TooR4u> but i am getting the following error
<TooR4u> RVM is not a function, selecting rubies with 'rvm use ...' will not work.
<TooR4u> btw, i am using the rvm from /usr/local/rvm/bin
mdesrosiers has joined #ruby
bigkm has joined #ruby
ElitestFX has joined #ruby
bigkm has joined #ruby
td123 has joined #ruby
gianlucadv has joined #ruby
pen has joined #ruby
Seisatsu has joined #ruby
apok has joined #ruby
tomoyuki28jp has joined #ruby
<tomoyuki28jp> Is there a way to do it in a shorter way: params[:foo] && params[:foo][:bar]
pp01bit has joined #ruby
munx has joined #ruby
Ankhers has joined #ruby
ed_hz_ has joined #ruby
<rohit> TooR4u: I suggest asking RVM related questions #rvm lots of helpful folks there
badabim has joined #ruby
sdfsdsf has joined #ruby
<TooR4u> rohit, Thank you .. :)
<banisterfiend> rohit: you're a helpful character
i8igmac has joined #ruby
pencilcheck has joined #ruby
looopy_ has joined #ruby
Targen has joined #ruby
mikepack has joined #ruby
_srp has joined #ruby
mohits has joined #ruby
SegFaultAX has joined #ruby
n3m has joined #ruby
_srp has joined #ruby
nfluxx has joined #ruby
mdesrosiers has quit [#ruby]
Deele has joined #ruby
randym has joined #ruby
nfluxx has joined #ruby
dipix has joined #ruby
CacheMoney has joined #ruby
stephenjudkins has joined #ruby
examancer has joined #ruby
Divinite has joined #ruby
ameba has joined #ruby
charlenopires has joined #ruby
vraa__ has joined #ruby
sabooky has joined #ruby
charlenopires has joined #ruby
sabooky has joined #ruby
<sabooky> I want to do the equivalent of a string.scan(/regex/) but instead of getting strings back I want to get matchData object back.
<sabooky> Need to walk a file backwards using regex, noting the location of the match, then removing the match
<sabooky> hmm... string.scan(/regex/) {|x| p $~ } seems to work
sonkei has joined #ruby
gianlucadv has joined #ruby
<ReinH_> why not just use #match ?
gokul has joined #ruby
tonini has joined #ruby
Divinite has joined #ruby
afex has quit [#ruby]
rohit has joined #ruby
x0F_ has joined #ruby
djdb has joined #ruby
asuka_ has joined #ruby
rramsden has joined #ruby
<CacheMoney> I have [master] $ in my command prompt after the directory name. I'm not sure how I did this, how do I remove this Git versioning control?
pen has joined #ruby
PragCypher has joined #ruby
yxhuvud has joined #ruby
scalebyte has joined #ruby
examancer has joined #ruby
<scalebyte> RubyPanther: you could help me out probably...
<RubyPanther> serialize sucks
<scalebyte> RubyPanther: i havent done serialize at all.. need help to complete the task !!
<examancer> only because it defaults to YAML... yuck for serializing into a database column
<scalebyte> i can give the ryt answer reputation in so worth 500
<scalebyte> RubyPanther: You can be up for a so rep worth 500 !!
<RubyPanther> scalebyte: You're using procedural design instead of OOP, that is why it is not easy
<RubyPanther> I have no idea what you're talking about
<scalebyte> RubyPanther: i am working on rails... what i need is each other has userpreference corresponding to him so it has to be displayed and he needs to update it using checkboxes and then the updated values needs to be updated to db using form and submit tag
<scalebyte> user*
thone_ has joined #ruby
<scalebyte> RubyPanther: could u help me firstly with how I can convert the attribute names of a class into string array
zakwilson_ has joined #ruby
kawa_xxx has joined #ruby
porco has joined #ruby
<scalebyte> RubyPanther: cud u help me ?
rippa has joined #ruby
bluOxigen has joined #ruby
randym has joined #ruby
odinswand has joined #ruby
leon1024 has joined #ruby
startling has joined #ruby
Mohan has joined #ruby
kawa_xxx_ has joined #ruby
eldariof has joined #ruby
<pen> what does =~ means?
<pen> I saw some people wrote @var =~ 'blah
<pen> '
<pen> @var =~ 'blah'
Alantas has joined #ruby
scalebyte has joined #ruby
<scalebyte> RubyPanther: anyidea hw could i fetch the names of all the attributes of a class into string ?
<RubyPanther> pen: it is like a magic flying whale that examines your data and gives it a number if it is happy
<RubyPanther> scalebyte: what are you talking about?
<RubyPanther> scalebyte: try it and lets see what you get first
<pen> RubyPanther: what?
<pen> RubyPanther: is there a doc for this?
twelvechairs has joined #ruby
<burgestrand> pen: string pattern match, where 'blah' is supposed to be a regex
<RubyPanther> scalebyte: I already told you, you're using procedural design instead of OOP, that is why you are flailing
<scalebyte> RubyPanther: so hw should be my approach ?
<scalebyte> RubyPanther: help me hero !!
<RubyPanther> scalebyte: you need to actually read a Ruby book before you even get started, and then get a rails recipes book so you have someplace to start from on this stuff
twelve_chairs has joined #ruby
<RubyPanther> grasshopper, I cannot drink for you, I can only show you the water
<scalebyte> RubyPanther: i understand bt for now i need to get this done or else il b fired :(
CheeToS has joined #ruby
csprite has joined #ruby
Mekkis has joined #ruby
ostapbender has joined #ruby
<RubyPanther> scalebyte: how did you get the job?
undersc0re has joined #ruby
<RubyPanther> Is there a reason for sympathy? Was it supposed to be a Java job?
<scalebyte> RubyPanther: after my engineering interview test and what not.. I am not bad bt they expect more in less time
<RubyPanther> Surely you understand at least what OOP means.
<scalebyte> RubyPanther: i am not a java developer i love java but nw i work with ruby on rails
<scalebyte> RubyPanther: i do... but u cud help a newbie a lil so that i could learn !!
<csprite> man seems easier to install ruby on windows than nix
<RubyPanther> do I get half the pay?
<scalebyte> RubyPanther: sure.. :0 just give ur account number
shobhitg1 has joined #ruby
<scalebyte> RubyPanther: this is the user_preference.rb https://gist.github.com/1891247
<RubyPanther> csprite: seems about the same... a couple clicks or commands...
nixmaniack has joined #ruby
ostapbender has quit [#ruby]
twelvechairs has joined #ruby
<RubyPanther> scalebyte: see in particular fields_for
<CacheMoney> is pastie.org working for anyone else?
<examancer> hasn't worked for me since i found gist
<examancer> :-)
_srp has joined #ruby
nixmaniack has joined #ruby
<Alantas> 503 here.
<scalebyte> RubyPanther: thanks but that is where i am stuck up with !!
<scalebyte> i mean since userpreferences are serialized attrributes how can i list them using do ?
mxweas_ has joined #ruby
<RubyPanther> scalebyte: impossible, there was nothing about it in your paste
<scalebyte> but even when i try doing @user.preferenes.each do |x| {} i get error
senny has joined #ruby
<RubyPanther> why would you say do |x| {} is that Ruby?
mxweas_ has joined #ruby
mafolz has joined #ruby
<scalebyte> RubyPanther: https://github.com/plataformatec/simple_form this should work i guess
randomx has joined #ruby
<randomx> hi
thecreators has joined #ruby
<randomx> hi hi
<examancer> hrumph
<banisterfiend> randomx: you were the first of the gang with a gun and your hand and the first to do time, and the first of the gang to die
unixjazz has joined #ruby
c0rn has joined #ruby
KL-7 has joined #ruby
ph^ has joined #ruby
andersen has joined #ruby
Morkel has joined #ruby
symb0l has joined #ruby
d34th4ck3r has joined #ruby
trivol has joined #ruby
mxweas_ has joined #ruby
Indian has joined #ruby
pdelgallego has joined #ruby
<randomx> hi
maletor has joined #ruby
gianlucadv has joined #ruby
zommi has joined #ruby
_srp has joined #ruby
banseljaj has joined #ruby
Asher1 has joined #ruby
Spockz` has joined #ruby
Asher has joined #ruby
Sliker has joined #ruby
saurb has joined #ruby
kawa_xxx has joined #ruby
berkes has joined #ruby
vraa_ has joined #ruby
bier has joined #ruby
Jrz has joined #ruby
medik has joined #ruby
Helius has joined #ruby
saurb has quit [#ruby]
larstobi has joined #ruby
al3xnull has joined #ruby
stoffus has joined #ruby
tilde` has joined #ruby
workmad3 has joined #ruby
pi3r has joined #ruby
v01d` has joined #ruby
c0rn has joined #ruby
akemrir has joined #ruby
d3vic3 has joined #ruby
noyb has joined #ruby
p0y has joined #ruby
<p0y> whats a good gem in terminal color printing
<Divinite> Hey!
<Divinite> I'm having a problem with ruby compiling native gems
statarb3 has joined #ruby
akem has joined #ruby
marten has joined #ruby
pp01bit has joined #ruby
dbr has joined #ruby
<Divinite> Looks as though I have to compile my own version of ruby *sigh*
mecenesiak has joined #ruby
dzhulk has joined #ruby
BiHi has joined #ruby
flippingbits has joined #ruby
ed_hz_ has joined #ruby
star_girls has joined #ruby
star_girls has quit [#ruby]
bairui has joined #ruby
<bairui> hi, guys. any pointers to current materials on using gtk2 from ruby?
<bairui> in particular, i want to use glade
davidcelis has joined #ruby
Ripp__ has joined #ruby
nemesit has joined #ruby
sprysoft_david has joined #ruby
ephemerian has joined #ruby
darthdeus has joined #ruby
Kambus has joined #ruby
visof has joined #ruby
visof has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
Caius has joined #ruby
skim1776 has joined #ruby
<skim1776> which tool is used for bug tracking in the ruby world?
undersc0re has joined #ruby
johndbritton has joined #ruby
kawa_xxx has joined #ruby
<Tasser> skim1776, github issues ^^
<skim1776> Tasser, I mean, is there some kind of a tool for managing bug database during the dev process?
adeponte has joined #ruby
<shevy> bairui you can use ruby-gtk
<shevy> also there are glade bindings
<shevy> but I dont know how well they work as I dont use XML shit
csherin has joined #ruby
<bairui> thanks, shevy... i just found that libglade was deprecated in favour of GtkBuilder... I'm looking in to that now...
<shevy> ah yes
<shevy> depends on what version you use
<shevy> libglade/ directory is still there in rubygnome2-0.19.4
znow has joined #ruby
<znow> im getting errors when I do "$ rvm install ruby-1.9.3-p125" .... Error with bunzip2
<bairui> hmm... this sounds... messy
<bairui> i might have better luck shelling out to gtk-server
<Tasser> skim1776, tests? :-)
<shevy> bairui why? works for me, I just compiled it and ran a sample
<shevy> the main reason it was deprecated was because ruby-gtk is lacking manpower
<shevy> so it is easier for kou to maintain less things (that are more important)
<bairui> with different versions using different interfaces... i am not sure if my dev env (arch) is using the same EVERYTHING as my target env (puppy)
NotreDev has joined #ruby
<NotreDev> how do i output a value in a block that would be appended to an array?
<rippa> what?
<rippa> explain
<davidcelis> NotreDev: be more explicit
<NotreDev> well i know that i can create an array before hand, and use the block to append to the array, but i thought i remembered a convenience to build an array from a block
<NotreDev> article_ids = articles.each { |a| a.id }
<Tasser> NotreDev, s/each/map/
gyre007 has joined #ruby
waxjar has joined #ruby
<NotreDev> bingo
<NotreDev> thanks a ton Tasser
<Tasser> NotreDev, just read your code ^^
rohit has joined #ruby
<NotreDev> sorry i spend 99% of my time in python, though blocks are enjoyable, i never remember the right keywords to google
<Tasser> NotreDev, rubydocs.info/frames/core
virunga has joined #ruby
<NotreDev> :)
<NotreDev> cheers
odinswand has joined #ruby
ameba has joined #ruby
dreamr has joined #ruby
skim1776 has quit [#ruby]
bluenemo has joined #ruby
bluenemo has joined #ruby
jbw_ has joined #ruby
dazoakley has joined #ruby
<undersc0re> NotreDev: Ruby!
<undersc0re> I'm an ex-pythonist
<undersc0re> Ruby is my preferred sex toy
<NotreDev> ruby's definitely interesting
<undersc0re> yep
havenn has joined #ruby
<undersc0re> I'm not a "professional" Rubyist or anything but..
<undersc0re> I love it
<undersc0re> NotreDev: Ruby has some nice Qt bindings
emmanuelux has joined #ruby
<undersc0re> Except I seem to be the only one who ever messes with hose
<undersc0re> s/hose/those/
jlebrech has joined #ruby
<NotreDev> i have played with qt bindings in a long time, and it thrills me
<NotreDev> *haven't :)
<undersc0re> lol
<Alantas> I took Qt/Ruby for a spin a few months back, but I'm sticking with Gtk.
<undersc0re> lol Gtk
<undersc0re> Alantas: I personally prefer toolkits that look fabulous on any OS.
<undersc0re> I'm into the whole multi-platform development thing
<Alantas> So you're into Java?
* Alantas hides!
<undersc0re> .
<undersc0re> Ya ok
<undersc0re> I was going to take a Java class for lulz this year
<Alantas> I'm only tinkering with it for personal-use projects anyway. (Or, put another way: I'm not making stuff for just any OS. Hehe.)
<undersc0re> I could have taken a C# class too!
<undersc0re> Alantas: same here
Divinite has joined #ruby
<undersc0re> My attention span can't stay long on one project tbh
<undersc0re> Every time I start a project, a couple weeks later it dies
Mohan has joined #ruby
ameba has joined #ruby
<undersc0re> but then again, I've stayed with Ruby longer than any other language.
<omry_> whats the standard way of running on ruby script from another?
tayy has joined #ruby
<Alantas> Same here. If it isn't done by the time my initial enthusiasm goes away, *it* does.
<undersc0re> omry_: ?
<undersc0re> Could you please go into detail
<Alantas> omry_: You can 'require' the other script and incorporate its functionality into your program, if that's what you're after. Otherwise, probably just invoke it with the shell, like any other program.
<undersc0re> yeah, thats what I was thinking Alantas
<undersc0re> Depends on how he wants to do it
virunga has joined #ruby
<undersc0re> I should work on my IRC logger bot
Mekkis has joined #ruby
<Hanmac> but if you have >1.9 then PLEASE use require_relative
<undersc0re> ^
<Alantas> require File.join(File.dirname(__FILE__), "derp.rb") # ftw
<NotreDev> I have a MySql::Result, and I'm expecting a scalar (one value returned). The docs i'm looking at aren't incredibly helpful. How would I get this one value as an integer? (docs: http://tmtm.org/en/mysql/ruby/)
workmad3 has joined #ruby
<undersc0re> Alantas: thats one of the many ways to do that
<undersc0re> :p
<omry_> Alantas, thanks. I`ll probably do that.
<omry_> undersc0re, just writing a few simple scripts, and I want to call one from the other in a loop. I guess shell execution is the way to hgo
<omry_> go
<Alantas> NotreDev: So, it's a table with one column? Or one row? Or both? What?
<undersc0re> I usually use: Dir["./src/*.rb"].each { |file| require file }
kiela has joined #ruby
<Alantas> undersc0re: That's relative to the calling directory, not the directory of the script file itself.
<undersc0re> oh
<undersc0re> yeah
kerframil has joined #ruby
<NotreDev> qr.fetch_row()[0].to_i
<undersc0re> Alantas: I was just showing that because it depends how he wants to do said thing
<omry_> undersc0re, will require work if I call it multiple times?
<omry_> (for the same file)
<undersc0re> omry_: Well, it requires all the files that are in Dir["My_Dir/*.rb"]
<undersc0re> since I did Dir["./src/*.rb"].each
<Alantas> omry_: Call it in a loop? What does it do? If it's a method or something, you can just 'require' it once and call it directly.
<undersc0re> yeah
<omry_> Alantas, think bash scripts, but in ruby. just a bit of code I want to call
<omry_> Alantas, what you propose is fine for real code, just a bunch of silly one time scripst :)
daglees has joined #ruby
daglees has joined #ruby
Mekkis has joined #ruby
ameba has joined #ruby
TheTFEF has joined #ruby
TheTFEF has joined #ruby
tvo has joined #ruby
tvo has joined #ruby
c0rn has joined #ruby
<Tasser> hm, how do I convert a string to an integer (codepoint, not parse) again?
<linduxed> ok so let's say i want to describe fruits
<linduxed> one fruit might contain vitamin E in a quantity of 50g
<Stefunel> that's one badass fruit
<undersc0re> yea
<linduxed> another fruit might contain vit A _and_ vit E in 20g and 70g
<linduxed> Stefunel: yeah i know :-P it's just an example
<Alantas> Tasser: In pre-1.9, use array indexing to pick out the byte.
<Stefunel> maybe mg :)
tatsuya_o has joined #ruby
<Tasser> Alantas, yeah, but I'm not one of the ancient arts
<linduxed> so the point is that some might contain x in amount y and some might contain a,b in amounts c,d
<Hanmac> i would use an hash to store this
<undersc0re> yeah
randym has joined #ruby
<undersc0re> Tasser: use a hash to store this data
<linduxed> i don't want every fruit to store the possibly-zero amount of vit a,b,c..., so how should i store this info?
<Alantas> linduxed: Hash. If the amount is zero, then you'd simply not add a key for it in the hash.
<undersc0re> set the fruits that don't contain said vitamin to nil?
<undersc0re> well 'nil
<Alantas> You can set a Hash's default value to 0, too.
<undersc0re> "nil" *
<undersc0re> yeah
<linduxed> hmmm
<Alantas> vitamins = Hash.new(0); vitamins["A"] # 0
<linduxed> but that is the question, should i include nil-vitamins?
<linduxed> it that safer in a way?
soulcutter has joined #ruby
<linduxed> or is it just a waste of space?
<Tasser> " Die # I wonder why the first char won't be stripped away - [194, 160, 68, 105] # codepoints
<Hanmac> linduxed: you dont need to include nil vitamins, the Hash takes care of this
<Alantas> linduxed: What do you mean? If it only has vitamin Q, then that's all you'd set in the hash.
<Alantas> vitamins["Q"] = 50
ameba has joined #ruby
<linduxed> Alantas: ok, i was thinking of doing vitamin["A"] = 0
<Hanmac> IMO symbols are better: vitamins[:Q] = 50
<linduxed> Hanmac: yeah that's an idea too i guess
<Hanmac> linduxed: no you must not if you use Hash.new(0)
<Alantas> linduxed: That would set a key. If the hash's default is 0, then it's superfluous to set it explicitly.
eldariof has joined #ruby
<Alantas> Hanmac: There's no harm in it, it's just unneeded.
<Alantas> Well, no harm beyond giving the hash more to keep track of. You'll get the same result out of ["A"] either way.
<Alantas> If you're reading from a file or from user input or something, you could just make the assignment conditional: vitamin[name] = value unless value == 0
<Hanmac> hm but normaly if you parse a string you only need to put this keys in for them you have values
QaDeS has joined #ruby
<Alantas> Unless you've got zillions of fruits and/or vitamin types, it's not really that big a deal to add more keys.
flippingbits has joined #ruby
sawjig has joined #ruby
arturaz has joined #ruby
aers has joined #ruby
dotemacs has joined #ruby
tk_ has joined #ruby
Spockz has joined #ruby
EddieS has joined #ruby
<dotemacs> hi
<Alantas> Greetings and salutations.
<dotemacs> great, theres people here :)
<dotemacs> let me ask you something
<zaargy> is there a better way to express this? https://gist.github.com/1892145
<zaargy> looks clumsy
<Alantas> zaargy: role_packages.each_value{ |package| puts package["instances"]; etc }
<dotemacs> wrote this: https://github.com/dotemacs/viljushka/blob/master/lib/viljushka/boc.rb and I figure since it's pretty much doing almost the same thing, I squashed it all into method_missing. But it's looking fugly. What would be a better way to do it?
<dotemacs> thanks
vraa_ has joined #ruby
<zaargy> ah ha
<zaargy> Alantas: thanks
senny has joined #ruby
<zaargy> hmm i need the key as well though
<Alantas> each_pair{ |key, value|
<zaargy> oh
<zaargy> right, got it!
iocor has joined #ruby
Talvino has joined #ruby
<linduxed> Alantas: well... i'm writing this rails thing, and i'm trying to figure out how i should write the model. actually it's not fruits it's all about, but ores and minerals, but fruits was a simpler real world example. the problem i face is that while i easily filled my database with the mineral details of name and price (which would correspond to my previous example as vitamin name and... price/gram... i guess
<linduxed> :-P), i'm being a lot more hesitant as to how to fill the database with this info: http://joonicks.eu/eve/oretab
<Alantas> dotemacs: That's a pretty fugly way to do it. You could just do it as a bunch of one-liners.
<Alantas> def to_cyr arg; convert(arg, Latin, Cyrillic); end
<Alantas> Or whatever the logic is.
<Alantas> One line apiece. And perhaps some alias()ing so to_cyr() and po_vuku() are the same.
Spockz_ has joined #ruby
<dotemacs> Alantas: yea, it was like that originally, but I switched to using method_missing then added a few more methods... but you are right, I'll revert it back
<dotemacs> thanks
serpa has joined #ruby
<Alantas> In the middle of that would be to use case/when in method_missing.
<Alantas> case arg; when /^(to_cyr|po_vuku)$/ then convert(dup, Latin, Cyrillic); when etc
<Alantas> Or, for that matter: case arg; when "to_cyr", "po_vuku" then ...
<dotemacs> yea, i thought of that, but the fuglyness factor still remains, i thing reverting back to methods might be nicer on the eye
<dotemacs> thanks again
<dotemacs> oops /thing/think/
* Alantas nods.
<Alantas> linduxed: Well, looking at that table, there's few enough entries on the X axis that you might just as well give them all explicit 0s.
gyre007 has joined #ruby
<Alantas> Even so, it'd work most naturally as a Hash, which already allows for sparse storage in this case, by setting a 'default' of 0.
Cypher has joined #ruby
<Alantas> If there's a meaningful difference between "this is a legitimate mineral to have, it just doesn't have any" and "this isn't a legitimate mineral to have", though, then you'd probably want to stick with the default-default (nil) for the latter and explicit 0 for the former.
<znow> ERROR: Error running 'bunzip2 < I get this when I do rvm install ruby-1.9.3-p0 ???
<Alantas> znow: Is that all it says?
<znow> Alantas: sec, pasting
<Alantas> (I'm thinking, maybe your system doesn't have bunzip2, but then, that'd be pretty rare.)
briankbuckley has joined #ruby
twelvechairs has joined #ruby
TheTFEF has joined #ruby
<Alantas> It says, in the same line: please read /usr/herp/derp/extract.log.
tayy has joined #ruby
<znow> Alantas: okay.. errhh so... what do I do?
<dotemacs> znow you read it :)
<dotemacs> and see what is says
<znow> dotemacs: wow... but nothing in it
<dotemacs> ok
<dotemacs> do you have permissions to write to the destination directory?
<znow> im on root user
<dotemacs> ok, are you overwriting an existing rvm install
<dotemacs> ?
tvw has joined #ruby
<znow> could be... but when i wanted earlier to do rvm use bla bla, it said rvm wasnt installed
<dotemacs> can you do mv /usr/share/ruby-rvm /var/tmp/ruby-backup
<dotemacs> and try again?
etehtsea has joined #ruby
<znow> dotemacs: yes, sec
tvo has joined #ruby
<dotemacs> type rvm info in your terminal and see what that gives you, as in is rvm there
<dotemacs> 'rvm info'
havenn has joined #ruby
<znow> dotemacs: its printing endles loop of lines out
<dotemacs> what is, 'rvm info' ?
<znow> dotemacs: /usr/bin/rvm: line 54: /usr/share/ruby-rvm/scripts/rvm: No such file or directory just continuing to output this line
pen has joined #ruby
<dotemacs> then you haven't installed rvm properly
<znow> dotemacs: oh sec
<znow> dotemacs: yeah but if I do rvm install ruby-1.9.3-p125 it outputs the line aswell in an endless loop
<Alantas> You told him to move /usr/share/ruby-rvm, and the script is (duly) saying there's nothing in it.
<dotemacs> znow do this: move /usr/share/ruby-rvm
<dotemacs> then install rvm from the start
<dotemacs> following the official web site
<znow> yeah sec
ikaros has joined #ruby
<dotemacs> once you have it up and running
<dotemacs> do rvm info
<dotemacs> if you are getting 'healthy' output
<dotemacs> then proceed with the install of ruby
Deele has joined #ruby
<znow> dotemacs: yeah alot better now, sec
<znow> configuring - looking bright
timonv has joined #ruby
<dotemacs> ok, so from the sounds of it, you didn't install rvm right the first time around
Mon_Ouie has joined #ruby
<znow> dotemacs: apparently not, but my apps went running fine... :p
<dotemacs> ok, thats strange
<znow> dotemacs: yeah.
<shevy> haha
<shevy> do you have more than one ruby installation?
<znow> shevy: not that I know of
<dotemacs> znow run 'which ruby'
timonv has joined #ruby
<znow> dotemacs: its compiling ruby atm
<dotemacs> ok, but can you do it anyways, that way if you do have a ruby version installed that wasn't installed by rvm, you'll find out where it lies
timonv has joined #ruby
<dotemacs> if nothing returns, then what probably happened, you started your apps via some version of ruby, then when you 'messed' up rvm, the paths were lost, but the executable was still in memory and running
<znow> dotemacs: okay... it takes ages for it to compile ... :S
<dotemacs> did you run 'which ruby' while the compile is running?
<dotemacs> just for curiosity sake
JStoker_ has joined #ruby
<dotemacs> if you do it, you'll win :)
<znow> dotemacs: now I did :) which ruby Install of ruby-1.9.3-p125 - #complete You have new mail in /var/mail/root root@danielg:/var/www/apps/advicecapital/current# which ruby /usr/bin/ruby root@danielg:/var/www/apps/advicecapital/current#
<dotemacs> ok, so you do have system ruby
divout has joined #ruby
Spockz has joined #ruby
<znow> but but
<dotemacs> if this /usr/bin/ruby is what 'which ruby' returned
<znow> dotemacs: but it seems to be using 1.8 gemspec gems or what its called
<znow> dotemacs: Retrieving rubygems-1.8.17 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 246k 100 246k 0 0 601k 0 --:--:-- --:--:-- --:--:-- 2936k Extracting rubygems-1.8.17 ... Removing old Rubygems files...
hukl has joined #ruby
hukl has joined #ruby
<dotemacs> ok, is this undesirable ?
<dotemacs> gems version and ruby version are two different things
<znow> well it wont let me install therubyracer , it fails Installing therubyracer (0.9.10) with native extensions
<znow> oh okay
<znow> dotemacs: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
<dotemacs> you can and probably will have ruby 1.8 with gems 1.8; also ruby 1.9.3 with gems 1.8
<znow> ok
<dotemacs> znow that was a gems build error for the gems themselves or for a particular gem?
<znow> particular gem
<znow> pasting output
<znow> I will be back in max 10 min, need to get some lunch, ok?
<dotemacs> hhahah, cool, no problem
<znow> <3
<znow> brb
<dotemacs> dont know your distribution/OS
<dotemacs> but i'd say some javascript dependancy is missing
<dotemacs> my suspicion is that whatever is required by rubyracer for the asset pipeline...
robert__ has joined #ruby
<dotemacs> so you need some dependancy by your OS
robert__ has joined #ruby
<banisterfiend> Hanmac: guten evening
<Hanmac> you are good ... currently the bells are ringing
gener1c has joined #ruby
cantonic has joined #ruby
<znow> dotemacs: back
<dotemacs> beautiful
<dotemacs> everybody was all: 'hey where did znow go?'
<dotemacs> :)
<znow> xD
<znow> and not it installed the ruby racer perfectly
<znow> now*
<znow> lovely
<dotemacs> what did you do to do it? and what OS / distribution are you on ?
<znow> ubuntu latest... dunno, ran that command
<dotemacs> ah ok
<dotemacs> by 'that command' you mean the command from the url i posted above?
<znow> yup
<dotemacs> great, thanks
tayy_ has joined #ruby
nari has joined #ruby
<znow> dotemacs: my actual issue is, that the whenever gem, with capistrano, wont be run...
mwyrobek has joined #ruby
<znow> dotemacs: if you have experience with that gem, I would really like your help, and btw, thanks so far!
undersc0re has joined #ruby
josephwilk has joined #ruby
rippa has joined #ruby
<dotemacs> i can't say that i have
<dotemacs> but the way to troubleshoot it
<dotemacs> is to find out if it will install manually by using the steps you use in your capistrano recipe
<dotemacs> my guess is that it won't that's why your capistrano recipe is failing
<znow> my capistrano recipe? you mean the capfile or?
<dotemacs> yea, the steps where you tell capistrano to run
apeiros_ has joined #ruby
<Tasser> apeiros_, hey ;-)
<apeiros_> hi Tasser
De`off has joined #ruby
<znow> dotemacs: but activemode-3.2 is installed?
<dotemacs> znow: something is broken in your ActionMailer gemspec
<dotemacs> see if it still has those 'crazy' date formats
<dotemacs> that you sed-ed out earlier
<znow> dotemacs: sudo sed -i 's/ 00:00:00.000000000Z//' /var/lib/gems/1.8/specifications/* yeah?
<znow> dotemacs: yeah looking better now
<Tasser> shouldn't "&#8211;" be unescaped by nokogiri?
<znow> dotemacs: not really, when I dpo cap deploy, it still gives errors... http://pastebin.com/HmRjeJ5Z
fr0gprince_mac has joined #ruby
d34th4ck3r has joined #ruby
<znow> do*
bairui has quit ["WeeChat 0.3.6"]
<dotemacs> znow: don't run that command in /var/lib/gems... but run it where your gems actually reside
<dotemacs> znow: it gives the same errors
<dotemacs> znow: something is messed up in your gems
<znow> dotemacs: yeah
<dotemacs> znow: run rvm info, and see where the gemset is specified
<dotemacs> as in, what directory your gems are in
<znow> gem: "/usr/share/ruby-rvm/rubies/ruby-1.9.3-p125/bin/gem"
<znow> gem: "/usr/share/ruby-rvm/gems/ruby-1.9.3-p125"
<znow> GEM_HOME: "/usr/share/ruby-rvm/gems/ruby-1.9.3-p125"
<dotemacs> ok, so run sed in that directory not /var/lib...
<dotemacs> do you know what that sed command actually does ?
<dotemacs> if you understand that, it'll help
<znow> dotemacs: nope
tayy has joined #ruby
<dotemacs> sed takes the 00:00... string and removes it from all the gems under a 'dir'
<znow> ah ok
charlenopires has joined #ruby
rohit has joined #ruby
<znow> dotemacs: so... what to do with this whenever?
<dotemacs> znow: what i think is happening with your setup is: you have a system ruby and rvm ruby and each one of these have their own gemsets (or they should) so ...
milktrader has joined #ruby
<dotemacs> i think that you are using gems from the system ruby for a application that's meant to use the rvm ruby and its gems
<znow> dotemacs: okay, how can I remove the system ruby??
<dotemacs> don't, leave it
<znow> dotemacs: okay
<dotemacs> just make sure you use the rvm ruby and its gems
<znow> okay
<dotemacs> compare the output of rvm's gemset and which 'some executable'
<dotemacs> compare the directories
<dotemacs> see the paths
<znow> yeah?
<dotemacs> hhaha
jroes has joined #ruby
<dotemacs> im saying, try to troubleshoot it a bit by yourself :)
<znow> dotemacs: got no clue on where to start, what to do if I get started or anything, really :(
<znow> dotemacs: just needed to get my whenever gem working :p
randym has joined #ruby
<dotemacs> ok, you want to run whenever gem, and that is a executable ruby script
<jroes> it's been a late night, this might be a stupid question. is there a stdlib method to pull back Hash entries where key.include? [ :some, :list, :of, :keys ] ?
<jroes> seems like h.assoc is close
<dotemacs> this will be installed in a certain path
<znow> dotemacs: yes... well I need it to work with crapistrano aswell.... so it runs my cron rake task
Sliker has joined #ruby
<dotemacs> ok, step one, can you run that whenever command as a user from the command line ?
<znow> as another user than root or?
<dotemacs> whatever user your cap file runs it as
<znow> dotemacs: 0,30 * * * * /bin/bash -l -c 'cd /var/www/apps/advicecapital/releases/20120223112806 && RAILS_ENV=production bundle exec rake stock_info_update --silent >> /var/www/apps/advicecapital/releases/20120223112806/log/cron.log 2>&1'
<dotemacs> ok, that is a cron entry
<znow> it outputs that when I do "whenever"
<dotemacs> whose crontab is it
<dotemacs> ?
<dotemacs> roots?
<znow> mine
<znow> hmm
<znow> yeah I guess
<dotemacs> mine being root ?
<znow> oh sec
<znow> need to go as deploy
jroes has quit [#ruby]
<znow> hmm
<dotemacs> ok, run 'crontab -u deploy -l'
<dotemacs> that will list user deploy's crontab entries
<znow> doesnt lists any
<znow> list*
<dotemacs> well, who wrote this app, you ?
<znow> yes
<znow> I tried getting whenever to work
<znow> but no chance
<dotemacs> ok, why do you want this command to run?
<znow> because it needs to run a rake task that updates stock info in a table
<znow> so the stocks on the site, can get updated every 30 mins
<znow> from Yahoo stocks
<dotemacs> cool
<dotemacs> who needs to run this
<dotemacs> a user?
<znow> no the whenever gem
<dotemacs> and which user?
Rishi_ has joined #ruby
<dotemacs> ok, but whenever gem is just a wrapper for cron
<znow> well deploy user, I pressume, which is used for deploying
<dotemacs> ok
<dotemacs> so as a user deploy
<dotemacs> try to run that command
<dotemacs> cd /var/www/apps/advicecapital/releases/20120223112806 && RAILS_ENV=production bundle exec rake stock_info_update --silent >> /var/www/apps/advicecapital/releases/20120223112806/log/cron.log 2>&1'
<dotemacs> without the last "'"
<dotemacs> and see if it works
<znow> sh: cannot create /var/www/apps/advicecapital/releases/20120223112806/log/cron.log: Permission denied
<dotemacs> there you go :)
<dotemacs> what does that tell you?
<znow> that deploy doesnt have the perms for the log folder
<dotemacs> right, so what do you need to do to fix that?
<znow> I would do chown -R log ?
<znow> or chown -R the dir
<dotemacs> ok, set the permissions the way you think is the best, as it's your box
<dotemacs> but make sure that you can write to that dir
<dotemacs> then run the command again
<znow> what would you prefer?
<znow> chown or chmod or?
<znow> and what dir?
<dotemacs> what is cron.log?
<znow> a file
<dotemacs> cool
<dotemacs> and where will it reside?
<znow> log/
al3xnull has joined #ruby
<dotemacs> ok, and do all the directories above it
<dotemacs> have the permissions that allow you as the deploy user to write to it?
gokul has joined #ruby
<znow> yes, apparently, since it can deploy fine without whenever
<dotemacs> well you can find out
<znow> yeah ls -a or?
<dotemacs> go to that directory and do 'touch i-am-the-best'
<Tasser> dotemacs, 'touch myself'
<dotemacs> if it creates a file, you are golden
Sliker has joined #ruby
<dotemacs> Tasser: that will do too :)
<znow> dotemacs: it can
<znow> as the deploy user
<dotemacs> great
<znow> and the cron.log is created aswell
<znow> so the permissions?
<dotemacs> can you try to change to deploy user and try to do the same?
<znow> im at the deploy user, touching myself... lol :D... but yeah I could create a file
<dotemacs> sorry, you confirmed that the file creation works as the deploy user?
<dotemacs> cool
<znow> $ cd /var/www/apps/advicecapital/releases/20120223112806 && RAILS_ENV=production bundle exec rake stock_info_update --silent >> /var/www/apps/advicecapital/releases/20120223112806/log/cron.log 2>&1 sh: cannot create /var/www/apps/advicecapital/releases/20120223112806/log/cron.log: Permission denied
<znow> dotemacs: yeah it says that about the permission denied....
<dotemacs> yea, i can see, im thinking
<dotemacs> it is permissions issue, but i don't know what exactly is stopping you
<dotemacs> as in what prevents you
<Tasser> dotemacs, sudo ;-)
<dotemacs> maybe, but if he can write as deploy user initially
<Tasser> hmmm
<dotemacs> why can't he write when it runs subsequently
<Tasser> ls -a n stuff
<Tasser> pastie plz
<znow> just ls -a?
<Tasser> in the correct folder - .. relative to logs
<znow> as the deploy user
undersc0re has joined #ruby
<Tasser> znow, mkdir logs
<dotemacs> who is user 1000
<Tasser> ehhh
<Tasser> znow, sorry
<linduxed> just a name thing, if i write out a bunch of "Scenario: runs on the toaster" without any actual testing, would those be called "test stubs" or "story headlines"?
<Tasser> znow, ls -a /var/www/apps/advicecapital/shared/
<linduxed> or maybe something else?
<linduxed> in my cucumber file that is
<znow> Tasser: . .. cached-copy log pids system
<Tasser> znow, -a
<znow> yeah it was ls -a
MrGando has joined #ruby
<dotemacs> ls -la
<Tasser> hups
<Tasser> hmmm
<Tasser> znow, whoami
briankbuckley has joined #ruby
<znow> root
<Tasser> znow, and in the deploy context?
<Tasser> znow, my question is 'which user are you when you deploy'
<znow> I deploy from another machine
<znow> Tasser: http://pastebin.com/HmRjeJ5Z <- Capfile at top
eka has joined #ruby
<Tasser> hmmm
<dotemacs> maybe try to run the whenever command after the use_sudo directive?
<znow> all though, ive been told to use "clockwork" gem instead of whenever...
<znow> dotemacs: yeah sec, ill change that
Guest53368 has joined #ruby
chellomere has joined #ruby
<znow> dotemacs: same error
<chellomere> can you get an array or object or something containing the variables available in the current scope?
ameba has joined #ruby
<Tasser> chellomere, local_variables
<chellomere> Tasser, thank you
<Tasser> chellomere, why doy ou want them?
<dotemacs> can you do something which will spit them out to stdout
<dotemacs> then you'll see what the issue is
<banisterfiend> Tasser: hey tassy what's the dilly
<chellomere> Tasser, because I have two situations where I want to validate a rails record differently, and I want to see if there's a way I can differentiate them
<Tasser> chellomere, kind of argh
<Tasser> banisterfiend, more canadian beer ;-)
<dotemacs> znow: the issue is this, you are running a command and appending to a file, a user executing the command does not have the permissions to write to the cron.log
<banisterfiend> Tasser: are you swiss-german, swiss-french or swiss-italian
<Tasser> banisterfiend, make a guess
<dotemacs> znow: you need to find out what user is executing the whenever command
<banisterfiend> Tasser: Jew.
<dotemacs> znow: try to execute 'echo $USER' if you can
<znow> dotemacs: yeah okay... i will try the clockwork gem, and see if that works :) ill tty in a bit
tuxaddicted has joined #ruby
<chellomere> Tasser, yes, it's not an optimal situation :(
<Tasser> banisterfiend, I still have my prepuce
<dotemacs> znow: that's not solving the issue
<dotemacs> :)
<znow> dotemacs: hmm... still about the cron.log stuff?
<dotemacs> yea
pu22l3r has joined #ruby
<Tasser> banisterfiend, so you're the kind that would kill a thousand jews and a clown?
tvo has joined #ruby
tvo has joined #ruby
<dotemacs> guys dont joke about stuff like this, you'll get barred from entering the US :)
<chellomere> Tasser, instance_variables is what I wanted, googling local_variables made me find it, thank you :)
<Hanmac> i understand why the clown, but why the jews?
<Tasser> Hanmac, see? no one cares about the clowns ^^
wenbert has joined #ruby
<Hanmac> i readed that they have tested children, and clowns are one of the most feared things
<Tasser> Hanmac, s/readed/read/
pdelgallego has joined #ruby
rohit has joined #ruby
<Tasser> sorry, I'm in a linguistics lecture :-)
<Mon_Ouie> You are a lecture?
<Tasser> they don't write, so I'm not
norex has joined #ruby
norex has joined #ruby
nanderoo has joined #ruby
tvo has joined #ruby
tayy_ has joined #ruby
akem has joined #ruby
vootey has joined #ruby
p0y has joined #ruby
hSATAC has joined #ruby
<znow> dotemacs: so I need to edit the perms of shared/log yeah or?
<dotemacs> znow: sorry
<dotemacs> ?
<znow> dotemacs: for the cron.log file
<dotemacs> make sure you can write to it
<dotemacs> from the gem
<dotemacs> any way you can
<dotemacs> that will give you a hint on how to proceed
<znow> well as per the capfile
milkpost_ has joined #ruby
<znow> set :user, "deploy" set :use_sudo, true set :admin_runner, "root"
<znow> and deploy could create a file within log/
jcromartie has joined #ruby
notjohn has joined #ruby
zomgbie has joined #ruby
fermion has joined #ruby
niklasb has joined #ruby
Spockz has joined #ruby
arussel has joined #ruby
justfielding has joined #ruby
<arussel> I have data in a bytea in postgres, I want to create a jpg from. ATM, i write to the file opened with "wb", but without success.
`brendan has joined #ruby
M- has joined #ruby
statarb3 has joined #ruby
<`brendan> morning
<arussel> the output is bytes (0->f) when the jpeg would look like "
<arussel> any idea ?
havenn has joined #ruby
hSATAC has joined #ruby
BiHi has joined #ruby
QaDeS has joined #ruby
Indian has joined #ruby
ryannielson has joined #ruby
davidpk has joined #ruby
philcrissman has joined #ruby
strife25 has joined #ruby
linoj has joined #ruby
lateau__ has joined #ruby
anderse has joined #ruby
Foxandxss has joined #ruby
kawa_xxx has joined #ruby
pi3r has joined #ruby
codebeake has joined #ruby
<codebeake> anyone know why sometimes test::unit loses dots under 1.9.x ?
glosoli has joined #ruby
<codebeake> I've heard it can be because of timecop, but I don't use that Gem
waxjar has joined #ruby
nowthatsamatt has joined #ruby
dazoakley has joined #ruby
neurodrone has joined #ruby
<znow> dotemacs: so what should I do?
Mon_Ouie has joined #ruby
tommyvyo has joined #ruby
shlevy has joined #ruby
<shlevy> In YAML, how do I represent the string 1234,5? it always gets translated as the fixnu 12345
<codebeake> "1234,5"
<shlevy> codebeake: That wont't include the quotes?
<codebeake> "\"1234,5\"
<codebeake> whatever you need
<codebeake> also check yamllint.com
<shlevy> codebeake: Thanks
<codebeake> (Formatting a european currency amount?)
rippa has joined #ruby
tcurdt has joined #ruby
<shlevy> Nope, escaping it doesn't work
<shlevy> codebeake: No, string-encoded parameter list in a legacy app :(
<codebeake> ah
<shlevy> 1st param is 123, second is 4
<codebeake> so what *exact* format are you looking for ?
<apeiros_> shlevy: that's definitively not yaml doing it
<apeiros_> YAML.load(%{"1234,5"}) # => "1234,5"
<apeiros_> (using %{} for the string to make quoting clearer)
shell0x_ has joined #ruby
runa has joined #ruby
<shevy> yeah for strings in yaml, enclosing in "" is enough
<runa> heyas. I have "class Foo < Array" but Foo.new.map{...} returns an Array, not a Foo. any hints?
<apeiros_> runa: you'll have to define map in terms of your Foo class
<shlevy> Hmm, strange
<runa> apeiros_: like def map; foo = self.class.new; self.each{|x| foo << yield x}; end ?
<runa> erm, return foo at the end
<shlevy> apeiros_, shevy: Thanks
<shevy> yay shlevy! we conquer the ruby!
hSATAC has joined #ruby
fxn has joined #ruby
<apeiros_> shlevy: for example, yes
p0y_ has joined #ruby
banisterfiend has joined #ruby
<runa> apeiros_: is this a bug or a feature? :)
<apeiros_> you can also use replace(super)
<apeiros_> runa: the superclass does not and should not know about subclasses
<apeiros_> so it is how it should be. neither bug nor feature.
<runa> apeiros_: well, it didn't sounded too complicated to do a 'self.new' instead of 'Array.new'. thanks anyway!
MrGando has joined #ruby
Paul-Atreides has joined #ruby
<apeiros_> runa: you should think a second more about how Array#map is actually implemented
* shlevy runs grep -r shevy\> ~/irclogs/freenode | grep shlevy and smiles
<dotemacs> znow, sorry was out for a bit, where are you now?
<znow> im at work
<znow> xD
bluenemo_ has joined #ruby
bluenemo_ has joined #ruby
<znow> well... trying out clockwork gem
<apeiros_> runa: also, who guarantees that the subclass has an each or an << that works the same as Arrays?
fayimora_ has joined #ruby
<runa> apeiros_: I understand. It was not what I expected, but I understand.
<apeiros_> runa: as for the replace approach: def map; Foo.new.replace(super); end
<runa> apeiros_: ah. I like your code better than mine. thanks
<apeiros_> oh, don't forget: return enum_for(__method__) unless block_given? (first line)
<runa> apeiros_: thanks!
krusty_ar has joined #ruby
fayimora has joined #ruby
<runa> apeiros_: thanks for the interesting part of this morning ;)
Jamoka has joined #ruby
Nss has joined #ruby
geekbri has joined #ruby
caiges has joined #ruby
pen has joined #ruby
daniel has joined #ruby
justfielding has joined #ruby
daniel has quit [#ruby]
iocor has joined #ruby
Mekkis has joined #ruby
justfielding has joined #ruby
tatsuya_o has joined #ruby
tatsuya_o has joined #ruby
workmad3_ has joined #ruby
eldariof has joined #ruby
crankycoder has joined #ruby
charlenopires has joined #ruby
jlebrech has joined #ruby
<shevy> what
<shevy> you two been kissing?
runa has quit [#ruby]
d34th4ck3r has joined #ruby
mgraham has joined #ruby
sergeykish has joined #ruby
mattonrails has joined #ruby
<omry_> I`m trying to iterate on a yaml file with the exmple from here : http://juixe.com/techknow/index.php/2009/10/08/jamming-with-ruby-yaml/
<omry_> gives me undefined method `each_pair'
EddieS_ has joined #ruby
<omry_> any idea?
<canton7> omry_, have a look at the yml variable: "p yml"
wyhaines has joined #ruby
<omry_> canton7, contains data
td123 has joined #ruby
seanstickle has joined #ruby
<canton7> omry_, yeah, helpful. What sort of data? :P
<omry_> the data I put into the file?
<omry_> its pretty big
<canton7> I'm after the basic structure of the output of YAML::load
<omry_> [{"db-central-2"=>[{"dest"=>"misc-myisam"}, {"forums"=>["phpbb_acl_groups",
cantbecool has joined #ruby
cantbecool has quit [#ruby]
<pschneider_> omry_, yml seems like an Array instead of a Hash
<pschneider_> I think each_pair only works on a Hash
<omry_> okay
<omry_> how do I iterate that then?
<pschneider_> yml.each
<omry_> thanks
CannedCorn has joined #ruby
<pschneider_> yml.each { |elem| elem.each_pair {} }
<CannedCorn> is there anything better than sinatra for ruby in terms of micro frameworks
visof has joined #ruby
visof has joined #ruby
Jackneill has joined #ruby
pdtpatr1ck has joined #ruby
<sergeykish> I want to debug rails application. It should be easy to set breakpoints with rdebug and run some code in console. But things are really complicated. `bundle exec` calls Kernel.exec, `rails c` calls Kernel.exec. Each exec call drops debug. And it's hard to find them - 'b Kernel.exec' doesn't breaks. What can I do?
<CannedCorn> i find the whole thing somewhat lame, we get it, the guy was a singer
<canton7> omry_, it all depends on how you wrote your yaml file. Yours is written with a list at the top-level, so YAML::load gives you an array as the output. Had your yaml file had a set of key/value pairs at the top level, as on the site you linked, YAML::load would have given you a hash
<omry_> canton7, gotcha
<omry_> makes sense. I would rather get a standard node type, but it is what it is :)
zommi_ has joined #ruby
Paul-Atreides has quit [#ruby]
Sailias_ has joined #ruby
zomgbie has joined #ruby
theRoUS has joined #ruby
csexton has joined #ruby
<Kageroc> hello community... I am trying to write a script that logs into a cisco device looks at some things and outputs some things based off what it found. I knot thats very vaugh :) I am looking for someone who would write this for me and I will pay very well! I would like it done in ruby. Anyone willing to assist?
<theRoUS> ruby 1.8.7: is there any way to hook variable access via '@'? i.e., intercept a reference such as '@foo = 12' ?
<banisterfiend> theRoUS: no, but u can hook accessors, like self.foo = 12
<banisterfiend> just do that instead
fermion has joined #ruby
<theRoUS> banisterfiend: understood, but i would like to have the variables be special objects and control all access to them to keep them from being overwitten
<theRoUS> too bad @ doesn't invoke instance_variable_get/set ..
<banisterfiend> theRoUS: too bad i guess
tomzx has joined #ruby
<CannedCorn> guys, is there anything better than sinatra out there in terms of micro frameworks for ruby?
_obiJuan has joined #ruby
c64 has joined #ruby
arussel has quit ["ERC Version 5.3 (IRC client for Emacs)"]
<c64> Hi guys!
<c64> Using reXML
<seanstickle> CannedCorn: for what purpose?
<c64> artifactURL = doc.elements['search-results/data/artifact/resourceURI/']
<seanstickle> c64: I am sorry to hear that
<shevy> CannedCorn that's already quite small :P but define "better"
charlenopires has joined #ruby
<shevy> I guess you can rip out the "get "/" do" part and have your own super micro super mioni framework
<shevy> *mini
<CannedCorn> for building a small app that can handle requests with a templating engine
<c64> Does reXML have a way to return the text without the tags
<CannedCorn> just wondering if there are any alternatives
<CannedCorn> sinatra may be the best, but i find the whole taking the stage... and whatnot hokey
<seanstickle> the whole "taking the stage" ?
philcrissman has joined #ruby
davidpk has joined #ruby
denom has joined #ruby
notjohn has joined #ruby
philcrissman_ has joined #ruby
iocor has joined #ruby
<Tasser> CannedCorn, there is cramp
<omry_> canton7, http://fpaste.org/wLyC/ , trying to iterate second level
banseljaj has joined #ruby
philcrissman_ has joined #ruby
briankbuckley has joined #ruby
mnemonikk has quit ["rcirc on GNU Emacs 24.0.93.1"]
jgarvey has joined #ruby
ceej has joined #ruby
p0y has joined #ruby
`brendan has joined #ruby
charlenopires has joined #ruby
tayy has joined #ruby
llaskin has joined #ruby
<llaskin> https://gist.github.com/1893156 @bpool is of type "element" based on the gist correct?
jcromartie has joined #ruby
Cypher has joined #ruby
charlenopires has joined #ruby
<banisterfiend> oh my gosh
<banisterfiend> 1.8.7 is a clusterfuck
cek has joined #ruby
shlevy has quit [#ruby]
<banisterfiend> proc { |&block| }.arity #=> 1
<cek> id like to have my own gemcutter server. how?
<banisterfiend> cek: google for gemfury
<apeiros_> banisterfiend: it took you so many years to figure that out?
<dotemacs> cek
philcrissman_ has joined #ruby
<dotemacs> cek you can do it, it's all on the rubygems guides
<banisterfiend> apeiros_: i've never run into something as glaring as this afaicr
<dotemacs> cek gemfury is a fee based service
<cek> it's all, where?
<dotemacs> rubygems.org
<dotemacs> on that page :)
<dotemacs> hahah
<llaskin> neone neone?
<dotemacs> i don't get what you are asking, if you read the page it's all there
<cek> dotemacs, they propose me to run geminabox , but i'd like to use starndard gem push
<cek> gem push --host in my case
<dotemacs> gem in a box
_pdelgallego has joined #ruby
<dotemacs> is a separate gem
dv310p3r has joined #ruby
pp01bit has joined #ruby
<dotemacs> you can host gems on a 'regular' box just with gem(1) installed
_pdelgallego has joined #ruby
<pp01bit> what &Block mean when used as an argument
<cek> dotemacs, that's what i'm asking. is "gem push" or "rubygems.org" something special?
<cek> are they opensource, why is it so hard to get a copy running locally?
carlyle has joined #ruby
<workmad3_> pp01bit: it explicitly marks the argument as the block argument for the method call
asobrasil has joined #ruby
<dotemacs> i dont know what kind of issues you are having but rubygems is open source, yes
adambeynon has joined #ruby
<dotemacs> 'gem push' is a comman to push your own gem to a rubygems.org
<dotemacs> i don't know what you are trying to do
<pp01bit> thnks
<workmad3_> pp01bit: and calls to_proc on it
hukl_ has joined #ruby
iocor has joined #ruby
nixmaniack has joined #ruby
<codebeake> banisterfiend, pry .. right ?
<banisterfiend> codebeake: what's your q?
<codebeake> (not related to pry… actually but you might find this intersting, or have *some* clue whats going on) https://gist.github.com/295a284c0e0d345d105d
<banisterfiend> this is just pure ruby
<codebeake> would pry behave the same way ? (I'm having a *really* hard time to debug missing dots in test::unit output)
<v0n> hi
eldariof has joined #ruby
PragCypher has joined #ruby
<v0n> Should a Gemfile.lock be committed?
<codebeake> v0n, yes - that's the point!
tcurdt has quit [#ruby]
<banisterfiend> codebeake: i dont knwo what your'e asking me
<v0n> codebeake, ok thx :)
<codebeake> why doesn't the debugger work when using method to turn the method into a proc ?
crankyco_ has joined #ruby
<codebeake> ohh, I see - useless comment on my 2nd chunk of code, sorry - the debugger doesn't work in the 2nd block, it's simply skipped
<banisterfiend> codebeake: that wasn't clear from your gist at all
<heftig> v0n: it records the current versions of the gem in use, so deploying from the repo results in the same environment
<banisterfiend> codebeake: i still have no idea what you're asking me because you're not telling me what you're doing inside the debugger
<codebeake> just trying to get it to stop
<codebeake> so I can debug, as one woud expect
<banisterfiend> codebeake: so you're saying that your debugger doesn't stop at the breakpoint? so you dont end up inside the example method?
<codebeake> right, but only in the 2nd case
kf8a has joined #ruby
kpshek has joined #ruby
<banisterfiend> codebeake: the method isn't being called in the second case
<banisterfiend> youer' just adding it to a list
tayy_ has joined #ruby
<codebeake> ping listeners should call it
PaciFisT has joined #ruby
ascarter has joined #ruby
<banisterfiend> codebeake: oh ok
justfielding has joined #ruby
<banisterfiend> let me try that in pry
visof has joined #ruby
<omry_> trying to figure out how to iterate yaml. can anyone tell me how to do this simple bit? http://fpaste.org/XX5m/
<omry_> (already have the yaml file loaded)
<shevy> nono
<shevy> you dont iterate over yaml
<omry_> what if I want to?
<shevy> the yaml code there becomes ruby code when you load it from a .rb file via YAML.load_file() you see?
philips has joined #ruby
<codebeake> banisterfiend, hold on - I might have bug in my test case
<shevy> if you dont want to use it as yaml, you just read it in like via File.readlines
<banisterfiend> yeah it's not getting called at all
<codebeake> (trying to replicate some really, really difficult to undertand code from test::unit, here)
<codebeake> yep, the global isn't working as I expected, that's my bad… hold on
<shevy> omry_ do you have irb
<omry_> shevy, the keys are part of the data in my case.
<omry_> their names are not hard coded.
<shevy> you turn the yaml data into ruby code
llaskin has quit [#ruby]
<shevy> omry_ have you used ruby before?
<omry_> a bit
DrShoggoth has joined #ruby
<codebeake> (Sorry banisterfiend, still debugging here, too)
Karayusuf has joined #ruby
nyrb has joined #ruby
<codebeake> damnit, so I can't understand why this isn't working in test::unit :S
jds_ has joined #ruby
<codebeake> I can debug *anywhere* Except the methods they use as callbacks
orange33 has joined #ruby
<shevy> omry_ start irb
<omry_> done
<shevy> then load the file into the x variable
<shevy> require 'yaml'; x = YAML.load_file("name_of_your_yaml_file_here.yml")
<shevy> then do require 'pp'; and ... pp x
<omry_> dnoe
<shevy> do you see the data structure of x?
<omry_> yes
mklappstuhl has joined #ruby
<omry_> now, how do I access the key name?
<mklappstuhl> Hey
<omry_> as I said, the key is not hard coded.
<omry_> its not
<banisterfiend> codebeake: i got it working by removing the &
<shevy> x is a Hash
<orange33> Is there a one-liner that will let me init an array based on a range, then remove a couple of elements and return the result? Like (1..5).to_a.slice!(1,2) to return [1,4,5]?
<codebeake> yeah, likewise -
<codebeake> damnit
<shevy> omry_ you can iterate over a hash by using .each_pair for instance
<shevy> x.each_pair {|key, value| puts key}
<orange33> And really I'd rather not use the index, I'd rather specify the actual values I want removed. Both slice() and delete() of course return the affected elements and not the original array.
<codebeake> ahh, one thought - maybe test::unit is being loaded before debugger
<omry_> okay. gotcha
<omry_> thanks shevy
<codebeake> so it's a noop when the proc is made from the method, verrryy early in the bootup
<orange33> Like if delete() took an array. But it appears to only take a single value.
_pdelgallego has joined #ruby
tayy has joined #ruby
<banisterfiend> codebeake: oh i know why
<banisterfiend> codebeake: duh
<banisterfiend> :)
<shevy> omry_: there are also other ways. you can get all keys by doing x.keys too. but as you want to iterate, you can use .each or .each_pair (this is part of the module Enumerator by the way, very typical of ruby code to use .each to iterate over a collection)
Drewch has joined #ruby
<banisterfiend> codebeake: push(block) not push(&block)
<banisterfiend> codebeake: push doesnt take a block so it's being ignored
<codebeake> yep, but they're not doing that, that's my mistake
<orange33> So a one-liner that gives me an array of 1 to 10, but deletes 4 and 5, for example. I can do it in two lines but I'm trying to find one.
<banisterfiend> codebeake: ?
<banisterfiend> codebeake: with that change it now works for me, anyway
<rippa> orange33: (1..5).to_a.tap {|i| i.slice!(1,2)}
<codebeake> yeah, sure - so the example works
<codebeake> which is a shame, because that's *not* woking in test::unit
<sergeykish> hi! how can I break on Kernel.exec in rdebug? 'b Kernel.exec' doesn't work
<banisterfiend> codebeake: are you sure? i bet it's a similar bug
<codebeake> I guess not in my, and only my copy of test::unit :)
<banisterfiend> codebeake: show your code
<codebeake> it's a rails project, which `rake test` only outputs the `P` (skipped), summary and "Loading suite....." lines
<codebeake> everything else, dots and failures are skipped
<codebeake> so I'm spelunking around in the Test::Unit gem trying to figure out why
<banisterfiend> codebeake: what is your native language btw?
<codebeake> English, yours ?
<banisterfiend> english
<codebeake> ok, (am I using bad grammar toda?t)
<codebeake> today* sorry
<banisterfiend> no, it's more, you didnt provide nearly enough information in your problem description for me to make sense of what u were talking about
Jooka has joined #ruby
<banisterfiend> so i figured there was some kind of language/cultural barrier
<codebeake> ah, sorry -
<codebeake> https://github.com/test-unit/test-unit/blob/master/lib/test/unit/ui/console/testrunner.rb#L79 < this is what I'm trying to debug, I want to get in that method test_finshed, so I can see what it receives, and how to fix it (or what's broken with the env, etc)
<orange33> rippa: That works. Thanks!
<codebeake> the method body is lower down in that file
marcamilly has joined #ruby
ascarter has joined #ruby
<codebeake> but - like I said, right now i'm working under the assumption that Kernel.debugger in 1.9 is a noop, and that when the method is captured into the proc, and pushed to the list, it's being pushed with noop debugger implementation, before ruby-debug loads and qualifies the whole thing
<codebeake> (investigating now)
<Kageroc> Does anyone in this chat room have spare cycles write a script for me? I would pay well.
<banisterfiend> codebeake: try pry then
<banisterfiend> codebeake: just put binding.pry where u had debugger
<banisterfiend> not because pry is better, but just to rule out debugger being the culprit
<codebeake> weird thing, and somehow off topic - is that I can modify that implementation to have `exit 1`, and still run the tests, and they still pass
<codebeake> it's like changing the source code of that method body has no effect
cousine has joined #ruby
luxurymode has joined #ruby
snip_it has joined #ruby
<Tasser> codebeake, so it's not called
<codebeake> Tasser, cheers - we worked that out with banisterfiend - but there's something weird in test unit still
<codebeake> (and, no way to turn a proc back into code, right?)
<codebeake> not even some weird AST or something simiar
<Tasser> codebeake, nope, it's not stored
<banisterfiend> codebeake: if the proc is defined in a file you can
<banisterfiend> codebeake: pry can do that, your_proc.source
<codebeake> well, I've reloaded the proc.source_location, and it's *defininitely* got a debugger in there :)
<codebeake> but I think its' somehow the Kernel.debugger (which I believe is a noop, but haven't verified yet)
<banisterfiend> codebeake: then verify it
<codebeake> ok "undefined local object or variable debugger" (out of the box)
<codebeake> so I'm straight out of ideas :S
<codebeake> gonna take a walk, then try pry
<codebeake> ping you if I find anything interesting though banisterfiend
<banisterfiend> im not really looking at it
<banisterfiend> sorry, ive got my own annoying problem
<banisterfiend> namely: proc { |&block| }.arity #=> 1
<codebeake> no, of course not - but I'm pretty sure this is interesting, once I figure out the answer :)
<codebeake> so I'll ping you if it turns out to be anything more than my own stupidity :)
<banisterfiend> thanks
<codebeake> and good luck with your arity problem :)
TaTonka has joined #ruby
<pp01bit> hi, looking at method signature, how can one determine the type of argument to pass?
<codebeake> pp01bit, you can't
<codebeake> look at how the method uses the variable, and send something that conforms to that API
mkscrg has joined #ruby
mklappstuhl has joined #ruby
<pp01bit> do u think that's a weak aspect of ruby compared to other language
<Mon_Ouie> Ruby is far from being the only dynamically typed language
<pp01bit> of course, there are pros and cons of being a dynamically typed language
ph^ has joined #ruby
spanner has joined #ruby
<banisterfiend> pp01bit: i really dont think anyone is in the mood for this kind of bland argument
Guest23751 has joined #ruby
<banisterfiend> Mon_Ouie: can you think of any way to tell teh difference between proc { |&block| } and proc { |x| } ?
<banisterfiend> in 1.8 they both return arity 1
<banisterfiend> but i need some way to distinguish between the two
<Mon_Ouie> In 1.9 the first one has arity = 0
<banisterfiend> yeah
<banisterfiend> unfortunately i have to support 1.8 :/
<banisterfiend> i get test failures on 1.8 only
hukl has joined #ruby
medik has joined #ruby
josemota has joined #ruby
<banisterfiend> oh
<banisterfiend> i can just rescue the exception and retry with one less arity
<banisterfiend> Mon_Ouie: hehe
ckrailo has joined #ruby
<banisterfiend> yeah that worked
tayy_ has joined #ruby
virunga has joined #ruby
<Hanmac> PS: you can raise a warnig " your ruby version should be updated"
<shevy> Mon_Ouie knows everything
mklappstuhl has joined #ruby
d34th4ck3r has joined #ruby
notjohn has joined #ruby
<rippa> banisterfiend: http://i.imgur.com/s2nFW.png
<banisterfiend> rippa: that's only on 1.9
<banisterfiend> i dont have that luxury in 1.8
<rippa> аууды ифв ьфт
<rippa> feels bad man
mikepack has joined #ruby
<shevy> when is it time to kill 1.8!!
<rippa> shevy: when 2.0
<rippa> jk
popat has joined #ruby
<rippa> the answer is never
<rippa> some people just don't want to upgrade
<Mon_Ouie> ruby18.
<Mon_Ouie> Create a ruby18countdown.com
punkrawkR has joined #ruby
neurodrone has joined #ruby
charlenopires has joined #ruby
whitenoise has joined #ruby
<whitenoise> why is this giving me an undefined method error? http://pastie.org/3438118
<whitenoise> it says loadConfig is undefined
looopy has joined #ruby
IAD1 has joined #ruby
<Mon_Ouie> And it is undefined
<Mon_Ouie> You defined an instance method called like that, but not a class method
<Mon_Ouie> And self is the class at the point where you call it
krusty_ar has joined #ruby
<Mon_Ouie> The module*, actually
wyhaines has joined #ruby
justfielding has joined #ruby
<Mon_Ouie> You should probably use module_function here
havenn has joined #ruby
jcromartie_ has joined #ruby
Silowyi has joined #ruby
charlenopires has joined #ruby
medik has joined #ruby
munx has joined #ruby
iocor has joined #ruby
JohnBat26 has joined #ruby
<codebeake> nice one rippa
aldodelgado has joined #ruby
xybre has joined #ruby
xybre has joined #ruby
<whitenoise> Mon_Ouie: I just did this: http://pastie.org/3438200
al3xnull has joined #ruby
CheeToS has joined #ruby
jcromartie_ has joined #ruby
TaTonka_ has joined #ruby
Azure|netbook has joined #ruby
Azure|netbook has joined #ruby
Synthead has joined #ruby
looopy has joined #ruby
lkba has joined #ruby
jamielinux has joined #ruby
NotreDev has joined #ruby
renan_saddam has joined #ruby
silverhand has joined #ruby
renan_saddam has quit ["Linkinus - http://linkinus.com"]
<silverhand> What regex method returns the substring it finds?
<canton7> #match returns a match object which contains it. You can use string#[] with regex and an offset to get a match also (e.g. "hello"[/(el)l/, 1] )
jergason has joined #ruby
renan_saddam has joined #ruby
briankbuckley has joined #ruby
kf8a has joined #ruby
<renan_saddam> Is normal that "Hey John" =~ /^Hey/ returns 0 and "\nHey John" =~ /^Hey/ returns 1 ?
ciaran_lee has joined #ruby
<Hanmac> yeah it is normal and correct
Mohan has joined #ruby
<renan_saddam> oh, it returns the position of the match
<renan_saddam> thanks Hanmac and canton7
pentesticles has joined #ruby
<Tasser> renan_saddam, anything but false and nil are true
ascarter has joined #ruby
tayy has joined #ruby
apok has joined #ruby
viuo has joined #ruby
jergason has joined #ruby
kenperkins has joined #ruby
eywu has joined #ruby
rbennacer has joined #ruby
ed_hz_ has joined #ruby
<rbennacer> can anyone help me with rails routes?
renan_saddam has quit ["Linkinus - http://linkinus.com"]
<deryldoucette> #rubyonrails
ryan0x2 has joined #ruby
<Hanmac> this channel needs a bot for that questions
mattonrails has joined #ruby
apeiros_ has joined #ruby
workmad3 has joined #ruby
CacheMoney has joined #ruby
<Tasser> apeiros_, do you approve?
<apeiros_> of?
glosoli has joined #ruby
<Tasser> apeiros_, see Hanmac
<apeiros_> I've just joined
andrewvos has joined #ruby
<andrewvos> banister`sleep: Heeeeeeelp
<andrewvos> banister`sleep: Are you really asleep?
<andrewvos> OK guess I'll try #pry
andrewvos has quit [#ruby]
<apeiros_> Tasser: thanks for the backlog. I approve, but I'm not the channel owner :-(
kr1shnak has joined #ruby
a215 has joined #ruby
csprite has joined #ruby
d34th4ck3r has joined #ruby
<shevy> yeah Hanmac
silverhand has quit [#ruby]
<shevy> I suggest a bot called butler !
_srp has joined #ruby
<Hanmac> if an user message includes rails then it should redirect the user
ank has joined #ruby
Sliker has joined #ruby
<shevy> hehe
<shevy> and kick ban
nicoca has joined #ruby
<apeiros_> o0
<apeiros_> no need to be mean shevy. they're just people looking for answers.
nicoca has quit [#ruby]
<Afal> it should also advise people to use pry half the time ;)
<deryldoucette> definitely do *not* understand the hostility towards rails. if anything rails has helped draw *more* people to using Ruby.
<shevy> ok let's talk about rails
<Afal> every time I look here someone mentions pry
<shevy> rails is best used in combination with pry
<Afal> rails is ok
<deryldoucette> straight ruby apps are excellent material for pry use as well
gokul has joined #ruby
<shevy> rails without pry sucks
looopy has joined #ruby
jgrevich has joined #ruby
bluOxigen has joined #ruby
bluOxigen has joined #ruby
jergason has joined #ruby
<Tasser> apeiros_, soooo what? ^^
willej has joined #ruby
<shevy> I am aware of everything man
<shevy> nothing escapes my attention
<willej> I have a hash, {"PopsRId"=>1, "PopId"=>38} what is the easiest way of extracting the two keys, values to variables with the values?
<shevy> in fact, I know what underwear all of you wear
<shevy> willej not sure what you want? with hash.keys you get all keys ...
nw has joined #ruby
<fxn> shevy: of course, it was a rhetorical question
<apeiros_> willej: don't do that.
n3m has joined #ruby
<shevy> fxn, I actually don't use rails :)
<willej> i want to make two variables PopsRID = value and PopId = value
<apeiros_> and: there's no real way anyway.
<shevy> it's like wicked black magic to me
<willej> oh, i can just do the hash[key]
<willej> and it will return the value?
<fxn> willej: PopsRID is a constant
<apeiros_> PopsRID, PopId = hash.values_at("PopsRID", "PopId")
<shevy> willej I see, you want to name new variables based on that. I thinkt here is no elegant clean way for this
PragCypher has joined #ruby
<shevy> hmm
<shevy> perhaps const_set
ikaros has joined #ruby
<krusty_ar> you cant normally create variable names, that's what arrays and hashes are for
<krusty_ar> (local variables that is)
thebope has joined #ruby
<shevy> perhaps something like hash = ("PopsRID", "PopId"); hash.keys.each {|key| Object.const_set(key, hash.values_at(key))}
sungji has joined #ruby
KL-7 has joined #ruby
<shevy> oh screw the last part
<apeiros_> shevy: a) .each_key, b) .each { |key, value|
p0y has joined #ruby
_srp has joined #ruby
cloke has joined #ruby
milkpos__ has joined #ruby
cloke_ has joined #ruby
cloke_ has joined #ruby
moshee has joined #ruby
skitrees has joined #ruby
<willej> cheers for the help
<ReachingFarr> Is anyone here running Ruby on Windows?
marcamilly has joined #ruby
youdonotexist has joined #ruby
drknus has joined #ruby
<willej> you've cleared the room by mentioning windows… ;)
<ReachingFarr> willej: It appears so.
araujo has joined #ruby
araujo has joined #ruby
SebHK has joined #ruby
enherit has joined #ruby
davidcelis has joined #ruby
forever-d has joined #ruby
<Sailias_> ReachingFarr, i used to, but just ask your question. If someone can help they will
albemuth has joined #ruby
<ReachingFarr> Sailias_: I need to know the format of the output from the `caller()` function.
<shevy> ReachingFarr well a bit, I am just making sure that my projects work on windows too. but windows is so annoying...
andrewhl has joined #ruby
<shevy> ["caller_to_block.rb:10"]
<shevy> caller() returns an array with strings, limited with : to show the line number of the call
briankbuckley has joined #ruby
<ReachingFarr> shevy: Right, but shouldn't there be a drive letter at the beginning of the file path?
<shevy> there is no file path AFAIK, just the filename foo.rb
<ReachingFarr> And is there ever anything like "caller_to_block.rb:10:somethingelse"?
<shevy> oh
<shevy> you are right
<shevy> I invoked from / and it gives me the full path
<ReachingFarr> shevy: OK, so there is a drive letter, but nothing after the line number, correct?
<shevy> is there a drive letter? I dont know
<shevy> but here, there is nothing after the line number
<shevy> I'd need to test on my laptop, but it's downstairs, and I am lazy ;-)
pdtpatr1ck has joined #ruby
<ReachingFarr> shevy: OK, thanks. Someone submitted a patch to my project to make it work under Windows but I have no way of testing it :-(
forever-d has quit [#ruby]
Helius has joined #ruby
<shevy> WHERE ARE THE WINDOWS RUBY USERS HERE!
<shevy> that should help :)
<shevy> but I think they are hiding
anderse has joined #ruby
<Hanmac> why dont know how irc works
herbnerder has joined #ruby
adeponte has joined #ruby
znow has joined #ruby
eignerchris has joined #ruby
<robacarp> ruby works on windows?
crdueck has joined #ruby
<znow> when I run sudo god etc to start god it fails, but when I run god without sudo I get: Daniel:advicecapital znowm4n$ god -c config/ac.god -D I [2012-02-23 18:26:08] INFO: Loading config/ac.god E [2012-02-23 18:26:08] ERROR: Failed to create pid file directory: Permission denied - /var/www <- how can I fix the permission for this?
<robacarp> windows works for something?
kr1shnak has quit [#ruby]
undersc0re has joined #ruby
<robacarp> znow: uh, you should probably change the pid director to /var/run
maletor has joined #ruby
<znow> robacarp: ah okay, sec!
<robacarp> or, more likely, /var/run/god/ or somethin
blueadept has joined #ruby
<crdueck> how can i pass a global variable from ruby into a bash command like this: "$rubyvar = xxx ... %x[bash_command $rubyvar]"
<znow> robacarp: atm its PID_DIR = "#{RAILS_ROOT}/log" <-
<znow> so I just change it to /var/run/god or?
marcamilly has joined #ruby
briankbuckley has joined #ruby
soulcutter has joined #ruby
Eiam has joined #ruby
<robacarp> znow: aaahh, okay, well...so your rails app is in /var/www then?
<znow> robacarp: yup
<znow> /var/www/apps to be exact
Targen has joined #ruby
<robacarp> so how does `sudo god` fail?
codebeake has quit [#ruby]
<robacarp> yea, thats what I expected
<robacarp> znow: does your god need to run as root?
jitesh_shetty has joined #ruby
<robacarp> heh, that sounds weird
skim1776 has joined #ruby
<znow> robacarp: not that I know of http://pastebin.com/Rk039qVA
<robacarp> man, its been so long
<znow> robacarp: :p since when?
<shevy> crdueck dont think there is a way. but you could generate a shell script, and load that from another shell script
tayy has joined #ruby
<robacarp> since I delt with god scripts
marcamilly_ has joined #ruby
<znow> robacarp: oh hehe
skim1776 has quit [#ruby]
<crdueck> shevy: well i need to use ruby specific methods, and then i need to call a bash function. i dont think i can do it just in bash
<robacarp> znow: well, your god script is going to try and run the clock.rb as user 'appuser'
<znow> robacarp: oh okay... so I can change that to another user?
<robacarp> well, you can just change that in th egod script on line ~22. But I don't know that you should change it.
nixmaniack has joined #ruby
<znow> aaaaaah fuck... ive must have been shithigh right now..... ive made my god script for my server, not for my local machine... wtf
SegFaultAX|work has joined #ruby
<robacarp> the question is, who owns the app directory /var/www/apps/advicecapital/current/log
<znow> and im trying to run it on here
<robacarp> oh, well that would do it
<znow> ffs....
<znow> xD
<znow> ok give me a sec
pdkl has joined #ruby
<krusty_ar> ReachingFarr: shevy, look for a Luis Lavena
pdkl has quit [#ruby]
lkba has joined #ruby
looopy has joined #ruby
stkowski has joined #ruby
billy_ran_away has joined #ruby
z3r has joined #ruby
<znow> robacarp: ah alot better, all though appusetr etc doesnt exist, can I use root?
havenn_ has joined #ruby
apok has joined #ruby
csherin has joined #ruby
<robacarp> znow: well I don't really see why not, but unless you need it for some reason I wouldn't do it as root in production
<robacarp> and pid file permissions isn't really a good reason...
<znow> robacarp: can I use my deploy user?
<robacarp> in fact that is probably exactly what you sohuld do.
<robacarp> becaues the directory structure will be owned by that user
vjacob has joined #ruby
<znow> robacarp: ah yeah
Araxia has joined #ruby
hasrb has joined #ruby
etehtsea has joined #ruby
munx has joined #ruby
mxweas_ has joined #ruby
paTimu has joined #ruby
paTimu has quit [#ruby]
badabim has joined #ruby
<dotemacs> znow: most of the issues you seem to be hitting are unix related rather than ruby related. Invest some time in learning about unix/linux, then try puppet/chef, it will help you out a lot
<znow> dotemacs: yeah, hehe know what you mean, all though I got it working now :-)
<robacarp> good advice, even if it does come from an emacs user :-P
<znow> edited the appuser to my deploy user, and it seems to load find. well im on osx ;)
<znow> but pure newbie on a mac
<znow> since its my first
looopy has joined #ruby
<cloke_> if I have a nested hash and some values in the hash are arrays of hashes themselves, is there an easy way to just retrieve all values of the hash?
munx has joined #ruby
<dotemacs> ok, but what happens now when you have to change something? this is where puppet/chef come in, look into it when you get some time, you'll find it useful/helpful
<znow> dotemacs: true that :-)
<robacarp> cloke_: .keys
emocake has joined #ruby
macmartine has joined #ruby
<skitrees> hmm, is there a way to figure out if an error was thrown during throw/catch?
<cloke_> robacarp: I'm looking for the values, which .values works, but the nested arrays aren't flattened into values themself
<skitrees> begin/rescue/end may be too much for what I need, but throw/catch looks like it will be too little
headius has joined #ruby
<skitrees> I basically want to be able to get out of a deeply nested situation (which throw/catch is good for) but I also want to report on what the particular problem was, I also need to see if there *was* a problem, or whether the block ended successfully
<robacarp> cloke_: well, you can .flatten them....but without actually looking at the dataset I've no idea what you're really after
seagreen has joined #ruby
<seagreen> ad
seagreen has quit [#ruby]
<dotemacs> cloke_: theres array1.flatten, you can use on the arrays
<skitrees> also, where do I find the list of possible exceptions
<skitrees> also, given that I can raise "some string"
<skitrees> what do I use to catch said exception?
<skitrees> if I raise a string, is it just the general exception class?
coreydaley has joined #ruby
eignerchris_ has joined #ruby
<cloke_> robacarp: {"a" => "b", "c" => [{"d" => "e", "f" => "g"}]} and I want to convert that into ["b", "e", "g"]. all I care about are the values in the hash
<cek> ROB
aprescott has joined #ruby
aprescott has quit [#ruby]
shobhitg has joined #ruby
briankbuckley has joined #ruby
<crdueck> how can i pass a global variable from ruby into a bash command like this: "$rubyvar = xxx ... %x[bash_command $rubyvar]"
<canton7> cloke_, is there meant to be an array in there?
eldariof has joined #ruby
mxweas_ has joined #ruby
shobhitg has joined #ruby
<robacarp> cloke_: well, so what you want is not the keys but the values, but you need to flatten it first.
<cloke_> canton7: yeah, it will be an array of hashes, but I didn't want to keep typing :)
nfluxx has joined #ruby
<canton7> cloke_, will any of the sub-hashes have hashes as a value in them?
shobhitg has joined #ruby
<robacarp> skitrees: there are a handful of standard ruby exceptions available
<canton7> (i.e. {'a' => [{'b' => [{'c' => 'd'}]}]} )
shobhitg has joined #ruby
<robacarp> I use argumentError frequently
<cloke_> canton7: in my case no.
<Hanmac> i had an macro for type error
nixmaniack has joined #ruby
Russell^^ has joined #ruby
shobhitg has joined #ruby
<cloke_> canton7: basically I am trying to take a response from mongo and get all the values in a document and all the values from the embedded documents
<robacarp> cloke_: well, if you want to live dangerously you could write a recursive function...but you didn't hear that from me.
<cloke_> robacarp: that's what I have now. just thought I would ask as I don't like that solution
bglusman has joined #ruby
ed_hz_ has joined #ruby
mgraham has joined #ruby
<robacarp> yea, truth be told you're probably fine running it that way....but when it gotcha's its going to really gotcha
<canton7> cloke_, yeah, I ended up going recursive: http://pastie.org/3439180
alfism has joined #ruby
pleiades has joined #ruby
vjacob has joined #ruby
<cloke_> canton7: thanks, that is slightly better than what I have
booginga has joined #ruby
rbennacer has quit ["Leaving"]
<canton7> cloke_, line 10 should probably be another call to rec_flatten, looking at it
iocor has joined #ruby
<canton7> cloke_, updated
cbuxton has joined #ruby
tvo has joined #ruby
sterNiX has joined #ruby
adamkittelson has joined #ruby
ascarter has joined #ruby
Targen has joined #ruby
kenichi has joined #ruby
<robacarp> the first rule of recursive programming is to remember that you've already written the program you are about to write.
ph^ has joined #ruby
<canton7> hehe
Sailias_ has joined #ruby
undersc0re has joined #ruby
gianlucadv has joined #ruby
voodoofish430 has joined #ruby
glosoli has joined #ruby
danishkhan has joined #ruby
geekbri has joined #ruby
hooper has joined #ruby
shadoi has joined #ruby
aldodelgado has quit [#ruby]
eignerchris has joined #ruby
kadema has joined #ruby
hron84 has joined #ruby
shadoi1 has joined #ruby
<Hanmac> shevy dont use php ... it cant calc with hex numbers ... "echo (0x00+2);"
Targen has joined #ruby
<tshirtman> php is full of braindead things like this…
lorandi has joined #ruby
tymelx has joined #ruby
minijupe has joined #ruby
<minijupe> is the variable _ used internally for anything in ruby?
<minijupe> I find myself wanting a short default variable in constructs like this: collection.select {|_| permitted_to? :create, _ }
TaTonka has joined #ruby
<minijupe> Is there any default variable defined so I can skip the |var| declaration or is there any reason not to use _ ?
lorandi has joined #ruby
<any-key> what's wrong with |var| ?
<any-key> for single function calls you can do &:whatever
<any-key> so like foo.map(&:id)
<matled> Hanmac: what does php print for you in this case?
<any-key> and you've got yourself a combinator :)
<Hanmac> matled: 4 but it should print 2
<matled> % php -r 'echo (0x00+2)."\n";'
<matled> 2
<minijupe> any-key: I was familiar with the &: but I was just hoping that (and I hate perl) there was some default var defined so I could skip the |var| bit of those blocks
<any-key> take a look at the $ variables (globals)
<any-key> although they suck and you should avoid them
<undersc0re> ^^
<any-key> being a little verbose is a good thing
<any-key> if I saw you use a $ variable like that I'd punch you in your silly face :P
medik has joined #ruby
<Hanmac> matled whats your php version?
<matled> PHP 5.2.6-1+lenny16 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 3 2012 08:19:55)
arussel has joined #ruby
<heftig> PHP 5.3.10 with Suhosin-Patch (cli) (built: Feb 6 2012 19:22:23)
<matled> oh, you're right. on another machine i get this too
fridim_ has joined #ruby
<Hanmac> hm i tiinnk the bug is new in 5.3
<matled> PHP 5.3.3-7+squeeze8 has this problem for me too
<arussel> We put the content of a JPEG into a postgres DB, how can create a JPEG back in ruby ?
<arussel> I tried this: image = Image.from_blob(tuple['data'])
<Hanmac> https://bugs.php.net/bug.php?id=61095 << thats the bug
<arussel> but got: no decode delegate for this image format
<arussel> with and without: SET bytea_output = 'escape';
zuymanto has joined #ruby
CodeZombie has joined #ruby
<minijupe> What is the default behavior of _ in an enumerable block. This seems to indicate that it is the first element of the enumerable? http://pastie.org/3439536
cook1es has joined #ruby
stephenjudkins has joined #ruby
visof has joined #ruby
n3m has joined #ruby
Mrono has joined #ruby
Mrono has quit [#ruby]
davidpk has joined #ruby
idletom has joined #ruby
bagratte has joined #ruby
thebope has joined #ruby
jergason_ has joined #ruby
nfluxx_ has joined #ruby
Jackneill has joined #ruby
stephans has joined #ruby
Ankhers has joined #ruby
Speeda has joined #ruby
zuymanto has quit [#ruby]
Sailias_ has joined #ruby
hukl has joined #ruby
pggbee has joined #ruby
hobodave has joined #ruby
<whitenoise> ActiveRecord question: how do you handle migrations, etc, if you aren't in a Rails application and using rake for it?
odinswand has joined #ruby
dreamr has joined #ruby
Karayusuf has joined #ruby
ephemerian has joined #ruby
tayy has joined #ruby
vraa has joined #ruby
shobhitg has joined #ruby
mengu has joined #ruby
JohnBat26 has joined #ruby
<RubyPanther> whitenoise: the simplest thing is to just install rails and not use the server, but still have the generators, console, etc
viuo has joined #ruby
<apeiros_> whitenoise: just invoke migration.up/.down
tvw has joined #ruby
ribayr has joined #ruby
minijupe has joined #ruby
theRoUS has joined #ruby
twqla has joined #ruby
otakutomo has joined #ruby
tayy_ has joined #ruby
<whitenoise> apeiros_: and i see I can make a Rakefile where I can actually manipulate the database as usual
<apeiros_> of course
<whitenoise> so, question
<apeiros_> not much magic there
<whitenoise> basically, a while back I made a MUD library. Now, I'm rewriting it to use a database, and the lib is a framework rather than coded values, reads a config for behavior rather than just execute, etc.
<whitenoise> so basically, i took a lib and turned it into a framework.
malkomalko has joined #ruby
<whitenoise> I'm wanting to add in a 'web' functionality with an ajax client and all, and I want the website for the app to read from the same database as the application.
<whitenoise> should I have two different Rakefiles and setups for that?
<whitenoise> and, if I do something like rake db:migrate in one, is it going to trash the app's tables from the web, etc, even though they don't reference the same tables?
<whitenoise> or can those two things co-exist
ttm has joined #ruby
<epochwolf|vps> whitenoise: you'll need to run the migration in both applications to update db/schema.rb
<whitenoise> epochwolf|vps: but theres nothing wrong with the logistics of ActiveRecord outside of Rails for the app, and in the web/ directory of the app lies Rails for the website
<epochwolf|vps> whitenoise: as long as the models are the same, it should be okay.
<whitenoise> epochwolf|vps: well, the app will have models that the web doesn't and vice versa, but they will be tied with a common model.
<epochwolf|vps> eh, just be careful then
luckyruby has joined #ruby
<whitenoise> or, really, I guess they could both have the same models
<whitenoise> I would just never call the Rails models from the app
<epochwolf|vps> whitenoise: I've done two rails apps out of the same database.
<epochwolf|vps> it worked fine.
workmad3 has joined #ruby
imsplitbit has joined #ruby
<whitenoise> ok
Karmaon has joined #ruby
hadees has joined #ruby
Drewch has joined #ruby
ed_hz_ has joined #ruby
ctp has joined #ruby
Jay_Levitt has joined #ruby
hadees has joined #ruby
hadees_ has joined #ruby
hadees__ has joined #ruby
<whitenoise> epochwolf|vps: i grabbed a Rakefile from the internet and set up a database.yml, but its not working
<whitenoise> its telling me to install activerecord-mysql-adapter gem?
<whitenoise> which is not a valid gem.
<epochwolf|vps> whitenoise: you need the mysql2 gem.
hadees__ has joined #ruby
gabeh_ has joined #ruby
<epochwolf|vps> whitenoise: active record needs a the proper database client gem. It doesn't install one by default.
<whitenoise> mysql2 gem seems to be broken?
<epochwolf|vps> whitenoise: not sure. I use postgresql.
<epochwolf|vps> I do know that rails 3 requires the mysql2 gem.
<whitenoise> i guess i could always just require 'rails'
<whitenoise> instead of just 'active_record'
<whitenoise> but that seems like a huge waste
<epochwolf|vps> whitenoise: you're using 1.9.3-p0, I'm not sure the mysql2 gem can compile with that ruby version.
<epochwolf|vps> whitenoise: some research shows you're trying to compile the gem with a 64 bit flag against a 32bit mysql
virunga has joined #ruby
fayimora has joined #ruby
kirun has joined #ruby
<whitenoise> epochwolf|vps: ah..how would I undo that via the gem install command?
<epochwolf|vps> whitenoise: you need to reinstall mysql.
<whitenoise> ew
vraa has joined #ruby
<epochwolf|vps> your ruby is most likely compiled 64bit.
<epochwolf|vps> your gem will need to be compiled the same way.
<epochwolf|vps> so you need to reinstall mysql with a 64bit version.
al3xnull has joined #ruby
<whitenoise> my ruby is x86_64, yep
<whitenoise> so i would need to install a 64 bit version of MySQL
* Hanmac thinks if ruby would be currect configured then you could install ruby for amd64 and i386
<robert_> shevy :D
<epochwolf|vps> Hanmac: whitenoise is using a mac.
<epochwolf|vps> there is no amd64
<epochwolf|vps> It
<epochwolf|vps> It's either 32bit or 64bit
<Hanmac> you know what i mean
<epochwolf|vps> Hanmac: you really don't want to be doing that with rvm. It will still trying to compile everything 64bit because that's the system default.
<epochwolf|vps> you'll need to have compile flags on everything.
zomgbie has joined #ruby
<Hanmac> *come to the multiarch side, you can be both 32 and 64 bit*
<whitenoise> i figured it out, gents.
<whitenoise> without having to reinstall mysql
nacengineer has joined #ruby
<whitenoise> solution: rvm reinstall 1.9.3-p0 --32
thebope has joined #ruby
cook1es has joined #ruby
mxweas_ has joined #ruby
larstobi has joined #ruby
<epochwolf|vps> Hanmac: osx runs both 32 and 64 bit applications. You just can't use libraries that are different archs.
<epochwolf|vps> can't compile against*
babyboom has joined #ruby
<Hanmac> with linux i can install diffent archs
<babyboom> Hi
<whitenoise> epochwolf|vps: the gems i installed previously will be fine, yes?
<epochwolf|vps> Hanmac: you can do the same with a mac.
<epochwolf|vps> whitenoise: no, you'll have to recompile them.
<whitenoise> Hanmac: mac is just a pretty overly friendly linux
<whitenoise> i used linux exclusively for about 5 years
<whitenoise> then when I got a job in web development/design, I got a Mac
kickinChickenz has joined #ruby
<Hanmac> in my first job they asked me if i want an windows or linux pc ... i chouse the last linux one
justinmcp has joined #ruby
* epochwolf|vps works on mac, deploys to linux.
stephenjudkins has joined #ruby
<whitenoise> epochwolf|vps: now its telling me i don't have libyaml
<whitenoise> blehh
* epochwolf|vps blinks
thebope has joined #ruby
<Hanmac> epochwolf|vps i requested in ruby-dev to make the ruby lib multiarch in debian ... but i get no answer
strife25 has joined #ruby
<shevy> whitenoise how do you like linux vs. mac so far?
<shevy> I am on linux since 7 years
<shevy> before that, windows. never touched a mac so far
<epochwolf|vps> Hanmac: uh… ruby and debian don't like eachother.
<robert_> hii shevy :D
<shevy> yo robert_ whatcha hacking on?
<robert_> a project using sequel.
Evixion has joined #ruby
<whitenoise> shevy: i love mac. the hardware is great (its a solid system). it's user-friendly in a good way, no clutter like in Windows, it's pretty streamlined and customizable. and then you have your terminal. configuring things can be a little weird, because the file structure is openbsd, rather than the linux one. caused a few issues when configuring mysql and php and all that.
<whitenoise> shevy: but, basically, I paid $2000 for 1) a really nice system, 2) a crazy warranty 3) and a nice OS
<shevy> hehe
<whitenoise> there are the negatives, of course, like the security vulnerabilities of Macs. They have yet to beef them up at all. I use a nice firewall config and ClamXAV
* epochwolf|vps purchased his MBA for $900 from a guy in chicago >.>
<shevy> ok I can't compete with that. my box here has cost around 250 euro (excluding monitor though which is another +120, mouse and keyboard for +20)
<whitenoise> also, all the software and OS updates are really cheap, compared to Windows. In Windows where you might pay $200-250 for something, you pay $30 on Mac.
<whitenoise> I still have a $1700 main system I built. i7 proc, 16GB of ram, 500GB drive, 30GB SSD for OSs, 1GB Nvidia, lots of fans
<whitenoise> it runs Linux.
<shevy> wow
<shevy> that's a lot of ram
<whitenoise> yes
<shevy> my cheap machine here is already so blazingly fast, I am content :)
<whitenoise> I do a lot of information security stuff, and in my scenarios I use a lot of Virtual Machines.
<whitenoise> so its not uncommon for me to eat 10GB of RAM just from virtualized systems
<shevy> wow
<shevy> and people laugh when I say I want a RubyOS
<kapowaz> anybody know of any library for generating random numbers that conform to a given distribution (e.g. normal)?
MasterIdler has joined #ruby
hasrb has joined #ruby
Divinite has joined #ruby
<Divinite> Hey all, I'm having some trouble compiling native extentions.
<Divinite> Why does ruby require so much memory?
ahemard has joined #ruby
<shevy> virtual memory?
<shevy> what is that, do you compile in a virtual environment?
<Divinite> Nope, I have a vps
<Divinite> OpenVZ
<Divinite> From 123systems.
<Divinite> shevy:
<shevy> yeah very weird
<shevy> when I compile ruby, I never got such a problem
<shevy> 500 MB Ram is surely more than enough, my current OS has 3 gig
<Divinite> Can I tell it to use less memory?
<shevy> hmm
<shevy> good question
<shevy> what do you have in $CFLAGS ?
<Divinite> It doesn't seem to accept my cflaga
<Divinite> *cflags
<shevy> -fomit-frame-pointer -frerun-loop-opt -pipe -fPIC -pthread
<shevy> and I think I usually use optimization O2
<Divinite> I turned off pipe, uses more memory
<Divinite> Wasn't there a way you could limit the amount of memory gcc can take shevy?
<shevy> I think so
<shevy> ulimit?
<shevy> or is that bash
<Divinite> Unlimited
nacengineer has joined #ruby
<shevy> ah could be bash... ulimit -s
<Divinite> It is bash, but it's set at unlimited
oposomme has joined #ruby
gaspar|work has joined #ruby
<Divinite> shevy: What is ulimit?
<shevy> Divinite something with stack
<shevy> (hahaha)
<Divinite> shevy: Lol. :P
<shevy> I actually never had the error you have Divinite
<shevy> of course I had plenty of other errors
<shevy> one of my favourite is "broken pipe"
<Divinite> That one is annoying!
<shevy> ohhhh /usr/bin/ruby1.8 extconf.rb
<shevy> you use debian right?
<Divinite> Yes.
<shevy> hmm
<shevy> you know what
<shevy> let's blame debian for now
<Divinite> shevy: Why, is that bad?
<shevy> dunno but they repackage things a lot
<shevy> what is "ldd /usr/bin/ruby1.8" showing for you?
tvw has joined #ruby
TaTonka has joined #ruby
<shevy> here is what I have http://pastie.org/3440404
ascarter has joined #ruby
<shevy> gcc version 4.6.1 (Debian 4.6.1-10)
<shevy> my gcc is debian based too ;P
<shevy> I am trying to slowly get rid of all that is debian though
<heftig> ulimits are going to kill the process
<shevy> finally a man who knows those things has arrived
pantsman has joined #ruby
pantsman has joined #ruby
<Divinite> shevy:
<gaspar|work> Hey guys, I'm running ~7 sinatra apps on my server (1.9.3) with virtually no traffic, they have 3000 daily visits combined. My memory usage is close to 1GB, is there any way to optimize it?
<shevy> link does not work use pastie.org instead ?
<gaspar|work> I'm running 1.9.3 via rvm with passenger
hadees has joined #ruby
rushed has joined #ruby
<Divinite> Hmm
<Divinite> shevy: What about now?
<shevy> works now
<shevy> man, debian and their naming scheme ... /usr/lib/libruby1.8.so.1.8
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
<shevy> can someone explain why it uses the same number TWICE?
<shevy> interesting Divinite
<shevy> my ruby uses no libruby*.so*
<Divinite> Yes...
startling has joined #ruby
<Hanmac> but i want install my libruby.so in both archs
<shevy> hmm
<td123> shevy: debian probably pkgs ruby1.8 and 1.9
<shevy> but td123 they could use libruby.so.1.8 or?
<td123> shevy: libruby -> 1.9 libruby1.8 -> 1.8
jacktrik has joined #ruby
<shevy> I need to test that hypothesis :)
<td123> shevy: how would you disambiguate -lruby ?
<shevy> anyone of you has a debian system with ruby 1.9.x ?
<td123> sorry, just arch here
<whitenoise> from googling and tinkering, looks like mysql 2.8.1 gem is broken.
kickinChickenz has quit ["Leaving"]
<whitenoise> which means raking with mysql is broken.
<whitenoise> or activerecord period, i guess
<Divinite> shevy: So.. Compile ruby myself?
Tripp has joined #ruby
<shevy> Divinite well I dunno
<shevy> I always compile ruby myself
<shevy> others are using RVM
<shevy> you could try that
Tripp has quit [#ruby]
<Divinite> I like compiling it myself. But should I 'destroy' Debian and install Ubuntu?
<td123> you shouldn't switch to an os just to get a programming working
<td123> s/an/another/
<td123> and I meant program
<td123> fail
ephemerian has joined #ruby
udante has joined #ruby
daniel_hinojosa has joined #ruby
tripp has joined #ruby
<shevy> Divinite well good question
<Divinite> What'd you think?
<shevy> Divinite you could always do this:
<shevy> compile ruby into a prefixed directory
hadees has joined #ruby
<shevy> for instance, ruby-1.8.7p358 I compile via "./configure --prefix=/Programs/Ruby/1.8.7p358"
jergason has joined #ruby
<Divinite> Alright, I'll try!
<shevy> you could then use that ruby to check if the compilation continues with that problem you had
<shevy> RVM is doing something somewhat similar btw, it compiles into its own managed directory afaik
undersc0re has joined #ruby
Gekz has joined #ruby
Deele has joined #ruby
prakriti has joined #ruby
<Divinite> shevy: It's going to take a while, memory problems
<Hanmac> divinite on what system did you build? (sorry if i ask again)
<Divinite> Hanmac: Debian.
havenn_ has joined #ruby
<Divinite> I didnt build it. apt-get install ruby.
workmad3 has joined #ruby
<epochwolf|vps> yikes
<Hanmac> ruby is only an meta package ... i think you need ruby1.8 or ruby1.9 ... ?
ajourc has joined #ruby
gayasentinel has joined #ruby
<Divinite> I'm building now.
<shevy> Divinite you and your memory problems!
<shevy> who else has memory problems
<Hanmac> me, but i am an heavy internet browser, so FF and eclispe are eat my ram(en)
imdude has joined #ruby
daglees has joined #ruby
daglees has joined #ruby
<undersc0re> Hanmac: lol firefox
<undersc0re> it's the slowest browser now!
<undersc0re> IE9 is faster
<Hanmac> but Ie9 is not safe enough
<Hanmac> and has not the great extendsions i need
imdude has quit [#ruby]
remink has joined #ruby
munx has joined #ruby
<startling> Hanmac: aurora or nightly might be a little nicer to your machine
<heftig> aurora eats 1180MB here
<Hanmac> i have an nightly trunk ... but i think currently not running ...
<Hanmac> my current firefox version is 11
<shevy> Hanmac whoa eclipse
<shevy> that thing EATS RAM LIKE CHILDREN
<ajourc> Is there any synonym to "$_" (bash) for the last object used ? :P
<heftig> irb has _
<ajourc> heftig: so goood !
<ajourc> thanks
<Hanmac> shevy yeah it is, but currently an good thing is you have more then one big lib where you are working on
<Hanmac> currently firefox needs ~600MB ... (ok many tabs open) ... the ugly thing is that Xorg needs >350MB oO
vraa has joined #ruby
willej has joined #ruby
<ajourc> heftig: Do u know where can I find the doc about "_" ?
<heftig> probably none
hadees has joined #ruby
<ajourc> :(
<heftig> it's set by irb, not ruby
<ajourc> Oh ok ...
<ajourc> heftig: So, it's impossible to write : "puts a if _" :-(
hasrb has joined #ruby
<heftig> sure, but _ will be the result of whatever you last wrote in IRB
<ajourc> Ok, thanks heftig
<ajourc> I can be useful
vraa has joined #ruby
startling has joined #ruby
<ajourc> And good to know :)
Sliker has joined #ruby
bbttxu has joined #ruby
badabim_ has joined #ruby
minijupe has joined #ruby
stringoO has joined #ruby
virunga has joined #ruby
Targen has joined #ruby
willej has joined #ruby
cozmic has joined #ruby
udante has joined #ruby
stephenjudkins has joined #ruby
<cozmic> http://pastie.org/private/zkgvizhpuhs1vp508osg - Can anyone help me with this? Why are all the hands empty inside main but not inside Bridge.initialize? :/
<canton7> cozmic, why are you inheriting from Array? That's not very common practice
workmad3 has joined #ruby
<cozmic> it's homework :)
<canton7> cozmic, ok... What's the exact problem?
<cozmic> when main runs, all the hands are empty
<canton7> cozmic, what is main?
* Hanmac solves the equalisation: homework is not very common pactice
banister`sleep has joined #ruby
<canton7> cozmic, also, in lines 148-153, you probably want to be assigning to instance variables
<cozmic> the piece of code outside the classes?
nixmaniack has joined #ruby
<heftig> cozmic: you're using local variables instead of instance variables
<heftig> in Bridge
<canton7> also, I'm not entirely sure why Bridge has a private initialize
<heftig> canton7: that's actually correct
<cozmic> so I can't use attr_accessor?
<heftig> cozmic: you're writing to the wrong variables
<canton7> cozmic, attr_accessor :var creates an accessor for @var
<heftig> you should use @deck instead of deck, et cetera
<cozmic> ahh..
barnex has joined #ruby
<cozmic> thank you
<canton7> cozmic, just as you did on lines 16 and 17 ;)
<cozmic> right :D
<barnex> Hello, I'm trying to make my first gem (bunch of capistrano recipes) and I'm trying to follow this example: https://github.com/timriley/capistrano-mycorp
<barnex> But I don't really get where the name used to require the gem comes from.
<heftig> also, using camelCase for anything but class names mostly considered bad style AFAIK
<canton7> yeah, ruby's very keen on snake_case
<canton7> (for everything but class and module names, where it becomes CamelCase)
<barnex> Could you point me to some resources about this or explain it? The gem name is capistrano-mycorp and it can be required as 'capistrano/mycorp'... is there some convention saying that - will translate to /?
tommyvyo has joined #ruby
<heftig> barnex: no.
<barnex> So where does the capistrano part comes from in this gem? I believe the mycorp part comes from the directory name used in /lib/
<barnex> what is used when I do "require 'gem-x'"? the name from .gemspec?
<heftig> no, it should just be searched for in the include paths ($:)
rushed has joined #ruby
Ripp__ has joined #ruby
simao has joined #ruby
sarkis has joined #ruby
<burgestrand> barnex: often, if it’s inside the lib/ dir of a gem, it will be required
<sarkis> is it always a good idea to go with gemsets for everything?
arckie has joined #ruby
<sarkis> im thinking some gems like vagrant should be available always
<burgestrand> barnex: assuming you have lib/boogieboogieboo.rb in a gem, even if the gem is named bonkers, you can require 'boogieboogieboo'
macmartine has joined #ruby
havenn_ has joined #ruby
liluo has joined #ruby
CannedCorn has joined #ruby
senthil has joined #ruby
<senthil> do we test what error msg is raised in rspec or simply that a error class is raised?
kylemcgill has joined #ruby
<senthil> i.e. expect {}.to raise_error(OpenAuth2::UnknownProvider)
emocake has joined #ruby
ChloeD has joined #ruby
simao has joined #ruby
<burgestrand> senthil: I don’t test exception messages anymore, they’re not the important part and I find they change and break tests that should not have needed breaking
emmanuelux has joined #ruby
<senthil> burgestrand: you're prob. right
Toerkeium has joined #ruby
<Toerkeium> hello guys
<canton7> if everything throws Exception with varying messages, and you want to check that the right exception is thrown, then I guess it's worth checking. If you throw meaningful exceptions, though, I can't see the point
<Toerkeium> do you know why do I get this error when I try to "gem install mysql" ? http://www.pastebin.ca/2121129
<robacarp> Toerkeium: you likely need to install the mysql-dev libs for your system
<robacarp> Toerkeium: possibly: #apt-get install libmysqlclient-dev
<robacarp> eh, no #
<Toerkeium> robacarp: fixed, thank you!
<barnex> Ok, so I'm trying to add my newly created gem to bundler
<barnex> Like this:
<robacarp> Toerkeium: well that was easy.
<barnex> gem 'wyborny-recept', :path => '/home/barnex/kod/wyborny_recept/'
<Toerkeium> robacarp: yeah :)
<barnex> where /home/barnex/kod/wyborny_recept/ is the root directory containing my .gemspec file
<barnex> But bundler complains that: Could not find gem 'wyborny-recept (>= 0) ruby' in source at /home/barnex/kod/wyborny_recept.
phantomfakeBNC has joined #ruby
<barnex> that 'ruby' part seems weird to me ;o
<burgestrand> barnex: does your gemspec contain the right name and version?
<burgestrand> barnex: can you build your gemspec with "gem build" successfully?
<barnex> hmm
emocakes has joined #ruby
<barnex> I used bundler to setup my gem directory and I can build it with 'rake build'
wyhaines has joined #ruby
<burgestrand> And you’re sure the name is correct?
<burgestrand> For one I’d double-check the underscore vs. dash
<barnex> not sure. But the directory name, the module name and the spec.name in .gemspec are 'wyborny_recept'
<burgestrand> barnex: open your gemspec
<burgestrand> barnex: gem.name = 'whatever', what does it say?
hmans has joined #ruby
<burgestrand> Oh, nevermind.
<barnex> wyborny_recept.
<banister`sleep> burgestrand: sup burg diggity dogg
<burgestrand> barnex: you have wyborny-recept in your Gemfile, but wyborny_recept in your gemspec
<barnex> no, sorry :D
<barnex> It does say wyborny_recept in the gemfile
<barnex> I misspelled in on the IRC only
<barnex> bundler generated the proper names everywhere for me.
<barnex> but i noticed that the config uses git to decide which files to add
<barnex> and I haven't commited yet
<burgestrand> Wild goose chase
<burgestrand> ;o
<burgestrand> banister`sleep: \o.
<burgestrand> banister`sleep: writing READMEs is hard
<banister`sleep> burgestrand: yeah i suck at it
<banister`sleep> burgestrand: is this for hallon?
<burgestrand> barnex: if you point to the gem with :git, you need to make sure to commit or bundler won’t see the changes
wallerdev has joined #ruby
d34th4ck3r has joined #ruby
<burgestrand> barnex: if you point to it with :path, it should not matter
<burgestrand> banister`sleep: yeah, I’ve tried meating it up a little bit lately: https://github.com/Burgestrand/Hallon
<barnex> the gemspec uses git to determine files, I guess it does matter :o
<barnex> but it haven't solved the problem
hck89 has joined #ruby
<banister`sleep> burgestrand: seems very good
samsonjs has joined #ruby
<burgestrand> barnex: show the Gemfile
<senthil> canton7: the error in question was unnamed constant, i was including a list of included modules in the msg and was trying to decide if to test that or not
<banister`sleep> burgestrand: for the wiki though it doesnt appear u have a landing page with links to the other wiki pages?
<barnex> burgestrand: the Gemfile that I use to require this gem?
<barnex> or the one inside the gem?
<burgestrand> barnex: yeah
<burgestrand> banister`sleep: ah yes, I haven’t looked at the other wiki pages in ages :x
<burgestrand> banister`sleep: I should probably do that, thanks :)
seanstickle has joined #ruby
<banister`sleep> np
willej has joined #ruby
booginga has quit ["Leaving"]
<burgestrand> barnex: your Gemfile says wyborny-recept
<burgestrand> barnex: your gemspec says wyborny_recept
<burgestrand> I told you this five minutes ago ._.
<barnex> ;o
geekbri has joined #ruby
<barnex> oh
<barnex> Ok, I'm dumb
* robacarp bashes FedEx WebServices on a rock.
<barnex> Was thinking about other gemfile, sorry.
tilde[afk] has joined #ruby
bigkm has joined #ruby
randym has joined #ruby
a1ph4g33k has joined #ruby
Squarepy has joined #ruby
strife25 has joined #ruby
stephenjudkins has joined #ruby
sungji has joined #ruby
marcamilly has joined #ruby
<seanstickle> Why use Nokogiri?
<seanstickle> This is what Mechanize is built for.
asobrasil has quit [#ruby]
idletom has joined #ruby
<robacarp> mechanize is sweet
<shevy> mechanize has a dependency on nokogiri though
Sliker has joined #ruby
<robacarp> yea. sadly all the documentation for all that stuff is way out of date....
<shevy> broke for me when I tried to switch to the latest nokogiri. hpricot on the other hand worked fine :(
<shevy> yeah
<robacarp> but I was able to stumble through a few scrapers awhile back
<shevy> bitrot decay happens fast
<robacarp> lemme see what I used...
<shevy> anyone remembers rfpdf?
<shevy> last update in 2008 or something like that. I am considering cleaning up the code and releasing a more recent version
willej has joined #ruby
<robacarp> shevy: do it. I'm likely going to need to do a bunch of pdfs in the future...
<shevy> yeah
<robacarp> anyway, looks like the last scraper I did I used Mechanize.
<robacarp> it was last november.
<robacarp> wow, time flies.
<seanstickle> Is there any way to use pdflatex on Heroku?
frode15243 has joined #ruby
<seanstickle> Or does it lock out all that external stuff...
<seanstickle> :(
<RubyPanther> Hpricot is a lot better unless you're generating XML IMO
<shevy> but it is dead isn't it?
<seanstickle> robacarp: yeah, thought so
Nss has joined #ruby
snoopDog55 has joined #ruby
snoopDog55 has quit [#ruby]
Sliker has joined #ruby
emocake has joined #ruby
badabim_ has joined #ruby
al3xnull has joined #ruby
<RubyPanther> shevy: it is so well written, it still compiles on new Ruby versions. It behaved itself and was ready for the future automatically!
Toerkeium has joined #ruby
<Toerkeium> guys, any place to find out how to setup ruby on apache?
<RubyPanther> working code doesn't die, it just gets more "stable"
shevy2 has joined #ruby
<robacarp> ^^
<Toerkeium> thanks RubyPanther
<Toerkeium> I thought it was everything magically done :P)
philcrissman has joined #ruby
theRoUS has joined #ruby
<Toerkeium> nice, thank you
lorandi has joined #ruby
<Toerkeium> what's the common file extension for ruby pages served by a web server?
stephans has joined #ruby
<seanstickle> .rb
cousine has joined #ruby
<Toerkeium> thanks seanstickle
<Toerkeium> it thought it was as easy as php the install procedure
snip_it has joined #ruby
etrece has joined #ruby
<shevy2> Toerkeium well you can also use .cgi !
<seanstickle> But my guess, Toerkeium , is that you don't know what you're doing yet, with the install.
<seanstickle> Because it's not like PHP, drop a file here and point browser at it.
<Toerkeium> seanstickle: , true
minijupe has joined #ruby
<Toerkeium> how does it works seanstickle? it's more like a tomcat install?
<seanstickle> Toerkeium: more along that line yeah
<seanstickle> Toerkeium: but less weighty
M- has joined #ruby
<Toerkeium> there's no way, I'll have to read ;:)
<Toerkeium> I didn't know even the file extension for it
<Toerkeium> shevy: I found how to install the mod_ruby
<Toerkeium> once I setup the module, it's all about apache config?
theRoUS has joined #ruby