<cjhanks>
wildcard1: Thanks or the tip, it looks like it will do what I like. But the lack of ease makes me want to just abandon ruby support.
<wildcard1>
that's unfortunate
denken has quit [Quit: leaving]
<shevy>
I tried .slice and wondered why it wasnt working, then I realized I needed more beer before trying to ponder about this
<heftig>
alternatively, join(" ") }.join("\n")
<heftig>
then the last line won't be terminated by a newline
denken has joined #ruby
taoru has joined #ruby
Asher has quit [Ping timeout: 252 seconds]
jarred has quit [Quit: jarred]
<shevy>
I am out of beer :(
<burgestrand>
cjhanks: rb_define_singleton_method, if by module method you mean one invokable without an instance?
<burgestrand>
(core has a "module_function" as a separate thing, which is both a class method on the module it is defined on, as well as a private instance method on the object the module is included into)
lenovodroid has quit [Remote host closed the connection]
<burgestrand>
(… but that ain’t a module method)
xandy is now known as xAndy
jfl0wers has joined #ruby
daniel_hinojosa has quit [Ping timeout: 265 seconds]
<reppard>
apparently the webdriver is dependent on the firefox version
<reppard>
which might explain some issues i've had at work with firefox crashing on me from time to time =)
swex has quit [Ping timeout: 252 seconds]
xAndy is now known as xandy
snorkdude has quit [Quit: snorkdude]
chriskk has joined #ruby
emsilva has quit [Quit: Computer has gone to sleep.]
Russell^^ has quit [Quit: Russell^^]
<ner0x>
Yeah, tried it with chrome: End of File error.
stevechiagozie has joined #ruby
marr has quit [Ping timeout: 265 seconds]
kil0byte has joined #ruby
jfl0wers has quit [Quit: jfl0wers]
adkron has joined #ruby
love_color_text has joined #ruby
tenmilestereo has quit [Quit: Leaving]
<ner0x>
Yeah, it doesn't work with selenium out of the box.
jfl0wers has joined #ruby
GlenK has quit [Quit: leaving]
matip_ has joined #ruby
emsilva has joined #ruby
becom33 has quit [Ping timeout: 246 seconds]
love_color_text has quit [Remote host closed the connection]
xemu2 has joined #ruby
otters has joined #ruby
postmodern has joined #ruby
miskander has quit [Quit: miskander]
ttt has joined #ruby
matip has quit [Ping timeout: 265 seconds]
xemu has quit [Ping timeout: 252 seconds]
eka has quit [Quit: Computer has gone to sleep.]
slainer68 has joined #ruby
eka has joined #ruby
sailias has quit [Read error: Connection reset by peer]
sailias has joined #ruby
eka has quit [Client Quit]
jonahR has joined #ruby
jenrzzz has joined #ruby
slainer68 has quit [Ping timeout: 250 seconds]
becom33 has joined #ruby
thinkclay has quit [Quit: Leaving.]
moshee has quit [Ping timeout: 260 seconds]
icole has quit [Remote host closed the connection]
moshee has joined #ruby
icole has joined #ruby
joallard has quit [Quit: Ex-Chat]
kmurph has joined #ruby
Iszak has quit []
jrajav has joined #ruby
Noldorin has quit [Quit: Computer has gone to sleep.]
icole has quit [Ping timeout: 250 seconds]
krz has joined #ruby
statarb3 has quit [Ping timeout: 246 seconds]
jarred has quit [Quit: jarred]
jenrzzz has quit [Ping timeout: 250 seconds]
Hanmac1 has joined #ruby
Takehiro has joined #ruby
thecreators has quit [Remote host closed the connection]
zeade has joined #ruby
Hanmac has quit [Ping timeout: 255 seconds]
adeponte has quit [Remote host closed the connection]
Takehiro has quit [Ping timeout: 246 seconds]
<aedorn>
I need a way to test code against a web server that fails in some way... Sometimes it sends bad data, sometimes an unexpected response, etc. I don't suppose anyone made something like that for testing purposes?
snorkdude has joined #ruby
snorkdude has quit [Client Quit]
Averna has joined #ruby
adkron has quit [Ping timeout: 244 seconds]
<reppard>
aedorn: could you not stub response codes?
Noldorin has joined #ruby
havenn has quit [Remote host closed the connection]
stevechiagozie has quit [Ping timeout: 256 seconds]
<aedorn>
reppard: no, not for this. I need something I can run for X amount of time and get Y amount of different things happening. Well, okay, I could stub it all out it would just take forever
<ner0x>
reppard: Got poltergeist up and running. Faster and I can page.driver.render("#{file}") if I need to see it.
<felipe_Brz>
is there a way to catch the 'undefined local variable' exception with a function just like you can method_not_found?
lawliet has quit [Quit: lawliet]
Averna has quit [Quit: Leaving.]
sn0wb1rd has joined #ruby
toekutr has joined #ruby
<reppard>
reppard: very nice, glad you got it worked out
<reppard>
one of the teams at work uses poltergeist but i haven't done much with it
<ner0x>
It's pretty easy to set up. No actual browser but that slows down testing anyway.
<reppard>
oops, -reppard * ner0x
<ner0x>
Realistically I just wanted to see what the page looked like during certain phases of the integration test.
<ner0x>
Since I can render it out, no harm no foul.
<reppard>
we use selenium and i hate the browser popping up for every test so i usually set up an x virtual frame buffer
<ner0x>
I feel like I'm the only one who still uses Test::Unit
jarred has joined #ruby
<reppard>
ner0x: i'm pretty sure the koans are still using test unit ;)
<ner0x>
Good enough. I like straight syntax. The wordy coding annoys me.
<reppard>
i love Test::Unit
<reppard>
the only thing i like more with rspec is the string definitions
<reppard>
if a test method name is really long using snake case is annoying sometimes
bigmac has joined #ruby
<reppard>
but i prefer assert to .should
<matip_>
I can't find why gem install stanford-core-nlp doesn't work. here is the log: http://paste.kde.org/632012/ . any idea?
<felipe_Brz>
is there a channel for general programming ?
<ner0x>
reppard: snake case? _ _ _ _?
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
<reppard>
ner0x: yeah
<ner0x>
reppard: test 'thing is to do this why not' do in Test::Unit?
matip_ is now known as matip
matip has quit [Changing host]
matip has joined #ruby
<reppard>
ner0x: does that work? never tried like that
<reppard>
i've always seen def test_this_should_do_something
jimeh has quit [Quit: Computer has gone to sleep.]
<reppard>
matip: you try setting the path when you exec gem install?
jarred has quit [Quit: jarred]
<reppard>
gem install blah blah JAVA_HOME=/path/
* matip
is trying ^
<matip>
same error
<ner0x>
reppard: Yes, that works.
charliesome has joined #ruby
<reppard>
perhaps i'll be revisiting Test::Unit
<reppard>
I was thinking about giving minitest a good run
<ner0x>
reppard: Minitest didn't really give a good enough reason for me to switch. Cucumber was a no way. RSpec I didn't really like. I guess I'm picky.
jarred has joined #ruby
<matip>
reppard, why are you asking? isn't it common to install gems as root?
stevechiagozie has joined #ruby
<reppard>
Cucumber didn't make sense to me as when I was learning that stuff I had no business end to present too
<reppard>
matip: it all depends
<matip>
on..?
<ner0x>
matip: Not really
jarred_ has joined #ruby
<matip>
what do you do instead?
<reppard>
your gems dont have to be glabally installed anyway
jarred_ has quit [Client Quit]
<ner0x>
matip: Look up rvm
<reppard>
you can put them in vendor/bundle
<reppard>
on a per project basis
<reppard>
root not needed
<eph3meral>
felipe_Brz: not really
<ner0x>
reppard: He's better off learning rvm realistically. He might not need multiple versions but it's stil the easiest option.
<eph3meral>
felipe_Brz: you might check #algorithms though
<reppard>
ner0x: indeed..or rbenv
<reppard>
=)
<felipe_Brz>
eph3meral: hmmm i see... but somewhere to discuss programming language theory, is there anywhere like that?
<postmodern>
reppard, if your going to go the rbenv route, just use ruby-build + chruby
<ner0x>
reppard: Right.
<reppard>
postmodern: that is a fair argument
jarred has quit [Ping timeout: 245 seconds]
<reppard>
doesn't seem to be much difference to me though
<postmodern>
reppard, rbenv shims seem to confuse a lot of people
<reppard>
you use ruby-build with rbenv
<postmodern>
reppard, chruby doesn't use shims, it just manipulates PATH
<reppard>
ahh i gotcha
<reppard>
i see that now
<reppard>
hmm, i kind of like the shims
<postmodern>
reppard, also if you use ruby-build directly, you can install rubies into /opt/rubies/ instead of ~/.rbenv/versions/
<postmodern>
reppard, i kind of like not having to type `rbenv rehash` all the time :P
<reppard>
postmodern: thats why i created an alias ;)
<reppard>
but yeah
<reppard>
rehash kind of threw me off at first
dmiller has quit [Remote host closed the connection]
<reppard>
exec $SHELL works too
mrdtt has joined #ruby
<shevy>
if ($text =~ /([A-Z]{3})/) { print "The string has $1 substring";}
<shevy>
perl
<felipe_Brz>
how would I go about iterating through a hash and, for each key,value, create a variable named "key" that holds value ? i thought there would be something analogous to what map does for arrays
<shevy>
ruby is perl cleaned-up
<eph3meral>
ruby is python that doesn't suck
<shevy>
felipe_Brz you cant use something like .each_pair {|key,value|
<shevy>
felipe_Brz ?
freeayu has joined #ruby
<felipe_Brz>
shevy: well but how would I create a variable
<eph3meral>
felipe_Brz: there's always /list btw
<shevy>
felipe_Brz also, .map is more "apply on each element"
The_8473 has joined #ruby
<shevy>
felipe_Brz you know how to create a variable in ruby. foo = "xyz", foo is a variable
<eph3meral>
felipe_Brz: map is basically to "transform" an array… you still get an array back, very similar to the original, but each item in the array is slightly different from what it was
The_8472 has quit [Ping timeout: 246 seconds]
<eph3meral>
felipe_Brz: lol, you don't know how to create variables?
ner0x has quit [Quit: Leaving]
<shevy>
he knows
<shevy>
he just forgot it
<felipe_Brz>
well
<shevy>
it can happen when the brain is confused about something else
<felipe_Brz>
can I mention php here or will i be stoned?
<eph3meral>
felipe_Brz: have you done any beginner's tutorials yet?
<eph3meral>
haha, stoned
<eph3meral>
most likely
<shevy>
felipe_Brz you wont need php
cakehero has quit [Quit: Computer has gone to sleep.]
<felipe_Brz>
i'll mention anyway because i think it's the only way
<shevy>
you asked how to iterate through a hash.
<shevy>
use .each_pair {|key,value|}
<felipe_Brz>
shevy: yes ok, i think my true doubt lies in creating a variable dinamically
<shevy>
.each_pair {|key,value| x = "bla "+key}
katherinem13 has quit [Quit: katherinem13]
<shevy>
now you have a "dynamic" variable
<reppard>
eww
<reppard>
meta!!!
katherinem13 has joined #ruby
<felipe_Brz>
but I don't know the name of the variable i will create!
<shevy>
he wont need eval :)
<shevy>
felipe_Brz it is not needed either, you could always use an array for those variables too
<shevy>
and then use accessor methods to access that array
<reppard>
felipe_Brz: why do you need to dynamically create variables? can you not just call the keys you need?
<felipe_Brz>
reppard: i can but it is a bit unwieldy
<shevy>
felipe_Brz if you really want to use totally dynamic names, then you have to use eval() most likely, but that is awful, I tell you. try it once, then you understand
<reppard>
i've only found eval useful for creating regex from strings
<shevy>
felipe_Brz it may be best if you could say from where you start, and what end goal you want to achieve
<felipe_Brz>
i have a hash with string keys and string values, and I wish I could create a variable for each pair, where the name of the variable is |key| and the value is |value|
<shevy>
oops
<reppard>
ryanf: i know but that doesn't always play nice with gets
<shevy>
ignore the result, the result is ok, just irb giving the wrong thing that I pasted
<shevy>
# b: 12 c: 14 a: 10
nfk has quit [Quit: yawn]
<shevy>
ok hash with string keys, string values
benlieb has quit [Quit: benlieb]
<shevy>
let's go step by step
<reppard>
felipe_Brz: i guess what i dont understand is why you need to do this when you have a key and a value already
<reppard>
both of which can be modified if need be
<reppard>
whats the point in having the collection in the first place you know?
<shevy>
now the question is... why you really need variables haha
<shevy>
ok so you want to create
<shevy>
a = 5
<shevy>
b = 6
<shevy>
one simple way via
<shevy>
instance_variable_set
<felipe_Brz>
reppard: yes i know I'm making a shell script and i've stored lots of options in a string string hash now I want to turn the |key|s into variables so I can use them more easily
<shevy>
this will be felipe_Brz first real class in ruby!
<reppard>
shevy: haha
<felipe_Brz>
hehe
<shevy>
let's make sure he understand reppard's code
<shevy>
felipe_Brz, you understand: def self.[] key
<shevy>
?
<shevy>
the [] part
<felipe_Brz>
lets see
<shevy>
:)
<reppard>
it would have to be within a class obviously
<felipe_Brz>
that's you overriding the [] thing?
<reppard>
so class OptionsClass or something
<shevy>
yeah within class FelipeLikesRuby
<shevy>
ok but how is the [] thing called felipe_Brz
<reppard>
or that =)
<shevy>
)in a general way)
<felipe_Brz>
array accessor yes?
<shevy>
well
<felipe_Brz>
array notation
<shevy>
for an array yes... but here we have a new class
<shevy>
your own class!
<shevy>
but this is ok as an answer
<shevy>
you could write def self.[] key but also def self.[](key)
francisfish has quit [Ping timeout: 260 seconds]
ry4nn has joined #ruby
<shevy>
and call it on your instance like foo['bla']
<shevy>
well actually
<shevy>
FelipeLikesRuby['bla']
<shevy>
reppard is a clever man
<shevy>
and not on your instance, sorry
<shevy>
as def self was used
<shevy>
without self, it would be on the instance
cakehero has joined #ruby
<shevy>
tada!
<felipe_Brz>
shevy reppard i see, that'll get the job done. thanks for helping
<reppard>
anytime!
<shevy>
class FelipeLikesRubyMoreThanPhpNow
<shevy>
class FelipeNowThinksThatRubyIsMoreFunToo
<shevy>
hmmm
<shevy>
noone uses such long names though
<felipe_Brz>
i use php to do some stuff but i never thought it was better than ruby
<felipe_Brz>
php is sort of like a frankestein that has had a few limbs attached here and there
mrdtt has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
mrdtt_ has joined #ruby
<felipe_Brz>
thing is, i get a lot done with it hehe
<shevy>
as a language in total, probably not... but php is still very useful, if you can look past the fact that it is not as beautiful as ruby
<shevy>
yeah I know :(
<shevy>
I'd wish ruby would have the same focus on the WWW
<swarles>
I don't
blischalk has quit [Quit: blischalk]
<swarles>
That makes for shitty languages
<swarles>
Like.... PHP
<xybre>
For debugging purposes, I'm trying to get some information on a context, variables and such. Problem is, it seems to be executing in the wrong context.
<shevy>
no, PHP never had any real design. it always lacked someone capable of thinking
<shevy>
oh an eval riddle
<shevy>
we need someone clever
<autumn>
swarles: however ask someone who has used little more and to them, it is the holy grail
<shevy>
reppard, Hanmac1
<xybre>
Yeah, eval "Should" be able to evaluate in the context given to it, but it seems oblivious.
<swarles>
Well, of course it's a good tool. But the web should be something it just happens to do well
mrdtt_ has quit [Client Quit]
<swarles>
Like how Perl just happens to be good for CGI
<shevy>
ok
<shevy>
but perl was before php :(
mrdtt has joined #ruby
<xybre>
perl happens to be good for regex.
<shevy>
there used to be really nice browser games in perl
<swarles>
yes, but that doesnt matter
<swarles>
what..
<ryanf>
xybre: object.send :binding does not do what you want it to
<ryanf>
xybre: every object in the system has a private binding method, but they're all the same -- it's just the top-level "binding" method that you can invoke anywhere to get your current binding
<shevy>
old AM Mari archmage... you had one mage, 5 colours. if all forts were down, you were dead. you used spells to summon, attack etc... the mechanics were not the main thing, but people rallied together in guilds, on IRC. that was awesome
<shevy>
aaaah ryanf is the smart man able to help :)
<xybre>
ryanf: Ah. Wonderful.
* xybre
headdesks
<shevy>
top-level binding... my brain needs to remember that
<shevy>
"Briefly, in a glimpse, I understood the whole universe. Then I realized I had a headache ..."
<shevy>
but fear not, in 1000 years the human overlords will chuckle about our limited intelligence
jrajav has joined #ruby
<aedorn>
hmmm... I think the only reason Perl is on my system is for ack
<shevy>
hehe
<shevy>
aedorn what distribution you use
xemu2 has quit [Ping timeout: 252 seconds]
tchebb has quit [Ping timeout: 252 seconds]
jblack has joined #ruby
<aedorn>
Sabayon
<shevy>
ah gentoo is this right ... hmmm
<aedorn>
yeah, pretty much
<shevy>
if it would be debian, apt/dpkg I think uses perl
havenn has joined #ruby
jrajav has quit [Client Quit]
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
<shevy>
hmm but come to think about it... it seems as if perl is used less and less
<aedorn>
I wanted something that I didn't feel like I had to fight every 10 seconds to get something done, but not so complex as to require lots of time to reload the whole system if needed.
xpen has joined #ruby
<shevy>
uh, but doesn't gentoo force a lot of extra time? since you must compile + setup more
becom33_ has joined #ruby
<reppard>
set up puppet and run away
<aedorn>
shevy: Yes, but Sabayon is binary based with their own repositories. It does inherit from Gentoo, and you're more than welcome to compile from source, but you certainly don't have to
cjhanks has left #ruby ["Leaving"]
<shevy>
ah
malte_ has quit [Quit: malte_]
<shevy>
that sounds a bit like a merge of gentoo + archlinux
<reppard>
i've only installed that on one box and didn't use it for very long
<reppard>
seemed stable from what i could tell
<swarles>
pacman -S is how you install
<swarles>
-Ss is search
<xybre>
I guess there's no way of getting around an Object method :/
<becom33_>
after "echo" there can be anything . I just want check if any one the tmp array function are listed after echo
<aedorn>
eh.. it's more like a merge of Gentoo and Ubuntu. Sabayon makes it super easy
freakazoid0223 has joined #ruby
becom33_ is now known as becom33
<shevy>
xybre everything is an object, even a method! and a message of a method object to another method object!
<reppard>
xybre: how do you mean? its ruby..theres usually away
ryanf has joined #ruby
<reppard>
not saying its a good idea but you can pretty much do anything
<reppard>
haha
<shevy>
eval() inside an eval() inside a loop()
moos3 has quit [Quit: Computer has gone to sleep.]
<swarles>
Yeah. I've been known to get the id of objects when I'm somewhere and I can't access it directly
<swarles>
and use ObjectSpace._id2ref
adeponte has joined #ruby
<xybre>
shevy: of course. I was just trying to call methods on objects in general without having to inject a special method into Object itself to get the context.
<becom33>
hey shevy some help ?
<xybre>
Still can't get local_variables from a context yet though.
<becom33>
after "echo" there can be anything . I just want check if any one the tmp array function are listed after echo
<xybre>
reppard: metaprogramming voodoo :) Getting local_variables from a context passed into a method.
cakehero has quit [Quit: Computer has gone to sleep.]
<shevy>
becom33, there must be an error here:
<shevy>
v = tmp.find { |m| line =~ /echo [A-Za-z\s\W]+ #{Regexp.escape(m)}/ }
<shevy>
are you sure this code works?
<shevy>
because it seems as if .find returns nil
<shevy>
so line is probably nil
<xybre>
For debug purposes, I jsut want to be able to log the locals in a method, and the instance variables in the object, without having to pass them all in one at a time.
<becom33>
shevy, no thats why Im asking you a help
<reppard>
man that is beautiful
<becom33>
regex is wrong
<rismoney>
anyone use win32api ?
<shevy>
becom33 well
<shevy>
becom33 I am not sure what you want to do there
<reppard>
my head hurts now
<reppard>
goodnight eveyone
reppard has quit [Quit: leaving]
<shevy>
becom33 cant you try to change that regex
<becom33>
i want check if any of tmp array values are in the string after echo
<shevy>
I dont like your variable names ;)
<becom33>
Im trying Im getting nil all the time
regedarek has quit [Read error: Operation timed out]
Nisstyre-laptop has quit [Ping timeout: 252 seconds]
ananthakumaran has joined #ruby
<becom33>
|line| line this is very wrong
freakazoid0223 has quit [Quit: Leaving]
zastern has joined #ruby
twoism has joined #ruby
<shevy>
why
<shevy>
what are you trying to do
nari has joined #ruby
<becom33>
string is "echo $stuff" i wanted to check if any of the tmp array values are after the echo in string . the thing is the string is dynamic so before or after echo there can be anything since those are php and html codes special chars also can be there
<shevy>
I am not quite able to grasp it yet
<shevy>
let me break it down so that my brain can understand
<becom33>
ok
<shevy>
the string is ... string = "echo $stuff"
<becom33>
yes thats one of the simples string , since the string is dynamic it could be like this also "echo <h1>$stuff</h1> $more"
regedarek has joined #ruby
<aedorn>
v = tmp.find { |m| line =~ /echo.*#{Regexp.escape(m)}/ }
<shevy>
wow
<shevy>
aedorn was able to understand it :)
<becom33>
aedorn, let me try that
<becom33>
yes that works like a baby
<aedorn>
shevy: keyword searching ;)
phelps has joined #ruby
staafl has quit [Ping timeout: 252 seconds]
huangjs has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
swarles has quit [Ping timeout: 244 seconds]
twoism has quit [Remote host closed the connection]
becom33 has quit [Ping timeout: 246 seconds]
twoism has joined #ruby
kokainepizza has quit [Quit: My pooter is sleep.]
<aedorn>
I feel like porting Ruby to OS/2.
<aedorn>
(except someone already did that so nevermind)
sgxrtm has joined #ruby
twoism has quit [Ping timeout: 252 seconds]
becom33 has joined #ruby
fire has quit [Read error: Operation timed out]
RoUS has quit [Ping timeout: 260 seconds]
Guest5080 has quit [Ping timeout: 255 seconds]
<shevy>
aedorn cool
joofsh has quit [Remote host closed the connection]
sgxrtm has quit [Quit: ChatZilla 0.9.89 [Iceweasel 10.0.4/20120426170919]]
felipe_Brz has quit [Remote host closed the connection]
<aedorn>
wiiw: scroll up some .. it's under the header of Options.
Fezzler has quit [Client Quit]
eroc has quit [Quit: eroc]
<wiiw>
aedorn: find it , thank you
cyong has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
Blue_Ice has quit [Ping timeout: 246 seconds]
ananthakumaran has quit [Ping timeout: 255 seconds]
staafl has quit [Ping timeout: 260 seconds]
ananthakumaran has joined #ruby
pen has joined #ruby
kiyoura has quit [Ping timeout: 252 seconds]
crackfu has joined #ruby
atno has quit [Quit: Leaving]
BoomCow has quit [Quit: This computer has gone to sleep]
nicholas has joined #ruby
nicholas is now known as nicholas__
g_bleezy has joined #ruby
RoUS has joined #ruby
RoUS has quit [Changing host]
RoUS has joined #ruby
Guest5080 has joined #ruby
<nicholas__>
i'm a clang developer trying to figure out why ruby doesn't build (using ruby from svn). could anyone help debug? miniruby fails like so:
<nicholas__>
/home/nicholas/ruby/lib/optparse.rb:1280:in `define': undefined method `append' for nil:NilClass (NoMethodError)
sayan has joined #ruby
Noldorin has quit [Quit: Computer has gone to sleep.]
havenn has quit [Ping timeout: 265 seconds]
ananthakumaran has quit [Quit: Leaving.]
becom33 has quit [Ping timeout: 255 seconds]
<RubyPanther>
nicholas__: check the configure output for a missing dependency
tjbiddle has joined #ruby
wiiw has left #ruby [#ruby]
moshee has quit [Remote host closed the connection]
elico has joined #ruby
<nicholas__>
there are various things it is "checking for ..." but doesn't find, and it's not clear that any of those are dependencies
<nicholas__>
is there something particular i should notice?
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
havenn has joined #ruby
toekutr has quit [Remote host closed the connection]
becom33 has joined #ruby
<nicholas__>
yeah, this config output looks fine to me. let me know if you want me to pastebin something (config.log/status?)
jgrevich_ has joined #ruby
BoomCow has joined #ruby
Hanmac1 is now known as Hanmac
toekutr has joined #ruby
jgrevich has quit [Ping timeout: 265 seconds]
jgrevich_ is now known as jgrevich
slainer68 has joined #ruby
stevechiagozie has quit [Ping timeout: 246 seconds]
Astral_ has quit [Read error: Connection reset by peer]
Astral_ has joined #ruby
sayan has quit [Read error: Connection reset by peer]
slainer68 has quit [Read error: Operation timed out]
pablo_ has quit [Read error: Connection reset by peer]
Astral__ has joined #ruby
frem has quit [Quit: Computer has gone to sleep.]
kil0byte has quit [Read error: Connection reset by peer]
kil0byte has joined #ruby
ananthakumaran has joined #ruby
Astral_ has quit [Ping timeout: 240 seconds]
nomenkun has joined #ruby
becom33 has quit [Ping timeout: 264 seconds]
becom33 has joined #ruby
wf2f has quit []
<aedorn>
hmmm gitlab vs github ... opinions?
nomenkun has quit [Ping timeout: 260 seconds]
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
mercwithamouth has joined #ruby
jrunning has joined #ruby
sayan has joined #ruby
xpen has quit [Ping timeout: 265 seconds]
IrishGringo has joined #ruby
Takehiro has joined #ruby
bigmcq77 has quit [Quit: Computer has gone to sleep.]
ninegrid_ has quit [Ping timeout: 265 seconds]
cyong has quit [Quit: Leaving.]
RoUS has quit [Read error: Operation timed out]
Guest5080 has quit [Ping timeout: 246 seconds]
pcarrier has quit [Ping timeout: 260 seconds]
crackfu has quit [Quit: Leaving...]
mengu has quit [Quit: This computer has gone to sleep]
pcarrier has joined #ruby
bigmcq77 has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
richardr has joined #ruby
<richardr>
Hi there
<richardr>
I have two JSON files. They do not follow the same structure. Both feature multiple levels of nesting. One occasionally repeats a key (at various levels) called "src". What I'd like to do, is simply recursively search for all the keys "src" within my JSON file, in Ruby, and have the opportunity, once I know the value of this key, to manipulate / replace that value with something else.
nick_h has quit [Ping timeout: 260 seconds]
rakl has joined #ruby
<richardr>
Any help would be greatly appreciated, I'm thinking I need to do something with map
<richardr>
I'm just unsure on how to keep the iteration going, while getting back values that I can manipulate directly (the original object) based on the value itself
nick_h has joined #ruby
yacks has quit [Ping timeout: 252 seconds]
Bry8Star has quit [Read error: Connection reset by peer]
kil0byte_ has joined #ruby
<aedorn>
there's nothing to do that by default ... the two options you can do are a recursive find/replace, or something a bit more meta
<richardr>
A little tricky though, any pointers on some find / replace magic that could help me out highly appreciated
<richardr>
The actual file replacement I sort of have a handle on, but the actual recursion and place to make that replacement I'm a little lost on at the moment
kil0byte has quit [Ping timeout: 255 seconds]
dmerrick has joined #ruby
<richardr>
I imagine this is bad practice, but the only idea I have so far is do a regular expression find / replace. But I think some form of deep search is a much better approach, if somebody has the logic
Bry8Star has joined #ruby
becom33 has quit [Ping timeout: 260 seconds]
sorbo_ has quit [Quit: sorbo_]
<aedorn>
how are you reading the JSON files in?
<richardr>
aedorn: They come in as JSON strings, I can use JSON.parse, or use them as strings ... whatever makes it easier to parse
<richardr>
aedorn: but at the time of parsing, I have both JSON files available
pcarrier has quit []
<Hanmac>
richardr: so they are eigher in src or meta/src? (or other locations too?)
<richardr>
Hanmac: "src" could potentially appear anywhere in the structure, but always keyed "src", does that make it very difficult?
iamjarvo has quit [Quit: Leaving.]
kumarat9pm has joined #ruby
<richardr>
Hanmac: for the first JSON file, while nested, it is consistent
<Hanmac>
for the first i have this: h.each_value {|v| (v[0]["src"] || v[0]["meta"]["src"])[0,0]="http://domain.com/"}
<Hanmac>
(i dont mean for the first json)
huoxito has joined #ruby
kumarat9pm has left #ruby [#ruby]
<richardr>
Hanmac: thanks, really appreciate this help .. I will start working with this (but unfortunately "src" could appear in a parent key named "meta", or "randomkey" I wouldn't know
<richardr>
potentially
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
mercwithamouth has quit [Ping timeout: 244 seconds]
<aedorn>
yeah.... string, gsub replace, then parse seems like your best choice for that since you're looking at multiple data types. Okay, maybe not the best way, but certainly the quickest
<aedorn>
richardr: his method will recurse on any enumerable with each_value, so passing the hash will also work
rippa has joined #ruby
wallerdev_ has joined #ruby
wallerdev has quit [Read error: Connection reset by peer]
wallerdev_ is now known as wallerdev
tjbiddle has quit [Quit: tjbiddle]
<aedorn>
actually, wait.. no.. hash has its own each_value... soooo right. Ignore me. I should just watch TV in silence
<richardr>
aedorn: I appreciate the thought on this though, thanks heaps!
cj3kim has quit [Quit: This computer has gone to sleep]
<aedorn>
You'll just have to watch out if you have more nested levels using that .. so array->hash->array->hash->array->hash probably is not going to work. Hopefully none of your data structures will go that far anyway
fire is now known as megharsh
s4muel_ has quit [Remote host closed the connection]
<richardr>
aedorn: I don't imagine it'll be nested more than 3 times, it was just that the keys are not necessarily consistent - or known to me that contain "src"
s4muel has joined #ruby
scruple has quit [Quit: Leaving]
<richardr>
@meta = JSON.parse(@meta).each_value {|r|r.each{|v| find_key(v, "src").replace("http://domain.com")}} <- Because I need to utilise that value, loop through 1.json, find the appropriate domain before replacing (quite a bit of logic here) if I assign src = find_key() can I manipulate that and it still manipulates the original object in memory, or is it just a copy?
<richardr>
Sorry if that doesn't make sense
tjbiddle has joined #ruby
zg has joined #ruby
tjbiddle has quit [Client Quit]
zg has left #ruby [#ruby]
elico has quit [Ping timeout: 246 seconds]
starburst has joined #ruby
h4mz1d has quit [Ping timeout: 252 seconds]
zeade has quit [Quit: Leaving.]
daniel_hinojosa has quit [Ping timeout: 260 seconds]
sayan has quit [Remote host closed the connection]
<JohnTeddy>
What is a reputable/good ruby project to work on?
rippa has quit [Ping timeout: 240 seconds]
tintin has joined #ruby
tintin has left #ruby [#ruby]
cj3kim has joined #ruby
Spaceghostc2c has quit [Excess Flood]
<RubyPanther>
JohnTeddy: one you start and give a good name
friskd has joined #ruby
<RubyPanther>
if somebody works on a project, it is because they needed it, or needed features/bug fixes and did a fork/fix/pull request
<RubyPanther>
There is actually a long line of people waiting for an interesting but incomplete project to wander along
Spaceghostc2c has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
<Hanmac>
i also works on my projects for fun
adeponte has quit [Remote host closed the connection]
<havenn>
JohnTeddy: Looking for a larger or smaller project?
zeade has joined #ruby
solidresolve has quit [Remote host closed the connection]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
solidresolve has joined #ruby
rippa has joined #ruby
havenn has quit [Remote host closed the connection]
<Hanmac>
my projects are good, but i dont know if they are reputable :D
Asher2 has quit [Quit: Leaving.]
<neurotech>
I'm trying to get my head around nokogiri. I'm trying to scrape some basic content and just want the text, not the actual markup. https://gist.github.com/4386057
emmanuelux has quit [Quit: emmanuelux]
<neurotech>
How can I make my erb render the scraped content as just text, not text+markup? (here's my erb currently https://gist.github.com/4386059 )
Catnaroek has quit [Quit: brb peepls n poopls!!1]
<neurotech>
Trying to run that gives me "undefined local variable or method `name'"
Catnaroek has joined #ruby
<BoomCow>
name isnd't defined
IrishGringo has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
<neurotech>
It's working, but it's still bringing in the markup
samuel02 has joined #ruby
dhruvasagar has joined #ruby
<neurotech>
hmm
gluxon has joined #ruby
<BoomCow>
not sure what you mean
<richardr>
Hanmac: Is there a more efficient / correct way to achieve this? http://pastie.org/private/vatyaoqlmmovcyixladq second part is parsing 1.json to get the real file names for replacement
<BoomCow>
you should only be scraping the text
cableray has quit [Quit: cableray]
<BoomCow>
neurotech, in irb, name = => "Earthshaker"
<richardr>
Hanmac: for the last value in replace_key, it's strange if I do k.replace("domain.com") replaces it, if I pass in "src" which .debug is reporting correctly in my terminal it replaces it with an empty string ...
<xybre>
Looks like the big thing is putting the handler to sleep.
<xybre>
Removing their pause makes the whole thing explode, but even a small sleep will keep it going.
phelps has joined #ruby
ryanf has quit [Ping timeout: 244 seconds]
phelps has quit [Ping timeout: 255 seconds]
LouisGB has joined #ruby
Chryson has joined #ruby
sn0wb1rd has quit [Read error: Connection reset by peer]
Bry8Star_ has joined #ruby
sn0wb1rd has joined #ruby
phelps has joined #ruby
Bry8Star has quit [Ping timeout: 276 seconds]
Bry8Star_ is now known as Bry8Star
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
pen has quit [Read error: Connection reset by peer]
francisfish has joined #ruby
pen has joined #ruby
lolmaus has joined #ruby
phelps has quit [Ping timeout: 252 seconds]
Nisstyre-laptop has quit [Quit: Leaving]
Bry8Star_ has joined #ruby
Bry8Star has quit [Ping timeout: 276 seconds]
Bry8Star_ is now known as Bry8Star
phelps has joined #ruby
fivetwentysix has joined #ruby
<fivetwentysix>
Is it better to fork / thead when wanting to make x amount of simultaneous API calls
yshh has quit [Read error: Connection reset by peer]
cableray has quit [Quit: cableray]
mercwithamouth has quit [Ping timeout: 246 seconds]
yshh_ has joined #ruby
xaq has quit [Remote host closed the connection]
zeade has joined #ruby
cousine has joined #ruby
Bry8Star_ has joined #ruby
richardr has joined #ruby
ryanf has joined #ruby
Spaceghostc2c has quit [Excess Flood]
pen has quit [Remote host closed the connection]
phelps has quit [Ping timeout: 252 seconds]
<richardr>
I have a JSON string (or can easily use JSON.parse to get a hash), how would I add nested values that don't already exist in the structure? I receive errors along the lines of: undefined method `[]' for nil:NilClass
Xeago has joined #ruby
Bry8Star has quit [Ping timeout: 276 seconds]
becom33 has quit [Quit: Leaving]
cousine has quit [Remote host closed the connection]
codebiff has joined #ruby
codebiff has quit [Client Quit]
Spaceghostc2c has joined #ruby
phelps has joined #ruby
becom33_ has joined #ruby
ryanf has quit [Ping timeout: 265 seconds]
tyman has joined #ruby
<becom33_>
how can I get the selected folder and sub folder file to be listed in a array . for a example .php .html .tpl files inside the folders need to be listed in the array
eka has joined #ruby
zeade has quit [Ping timeout: 260 seconds]
jgrevich has quit [Remote host closed the connection]
zeade has joined #ruby
zeade has quit [Client Quit]
marr has joined #ruby
richardr has quit [Remote host closed the connection]
<havenn_>
becom33_: Dir['*.{php, html, tpl}']
<havenn_>
fivetwentysix: Depends, I guess. You are deciding between forking and threading for making a remote API call?
<fivetwentysix>
havenn_: yep
banisterfiend has joined #ruby
mockra has joined #ruby
<heftig>
i'd say threads, they have less weight
<fivetwentysix>
can I use active record with postgres in threads?
<heftig>
yes
<banisterfiend>
heftig: i read that on linux context switching b/w processes and between threads takes more or less the same time
phelps has quit [Ping timeout: 250 seconds]
<heftig>
banisterfiend: forking is still costlier, though
nomenkun has joined #ruby
pskosinski has joined #ruby
<heftig>
and context switches between threads of the same app don't cause a TLB flush, I believe
<heftig>
s/app/process/
chussenot has joined #ruby
<pskosinski>
Hello. Can I open file with path like: foo/bar.txt in Windows? Will it work? Or I need to change / to \ ? ^^
oposomme has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
<JohnTeddy>
I am trying to pass this rspec exercise.
_whitelogger has joined #ruby
<Hanmac>
/regexliteral with group capture/ =~ string
Morkel has joined #ruby
<Hanmac>
/(?<number>\d+)/ =~ "4a"; p number#=> "4"
xandy is now known as xAndy
jessta has quit [Ping timeout: 246 seconds]
Shrink has joined #ruby
<banisterfiend>
Hanmac: ah ok
jessta has joined #ruby
<Hanmac>
its only works with regex literals, it does not work with regex variables
<banisterfiend>
Hanmac: do u sometimes wish u were a regex literal
ryanf has joined #ruby
matrixise has quit [Ping timeout: 244 seconds]
mockra has joined #ruby
mjolk has joined #ruby
mjolk is now known as Guest55957
nomenkun_ has joined #ruby
matrixise has joined #ruby
ryanf has quit [Ping timeout: 260 seconds]
Guest55957 has quit [Read error: Connection reset by peer]
nomenkun has quit [Ping timeout: 255 seconds]
baphled has joined #ruby
mockra has quit [Ping timeout: 260 seconds]
mjolk2 has joined #ruby
timonv has quit [Ping timeout: 264 seconds]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
arturaz has joined #ruby
arturaz has quit [Read error: Connection reset by peer]
arturaz has joined #ruby
banisterfiend has quit [Ping timeout: 256 seconds]
becom33_ has quit [Ping timeout: 260 seconds]
<pskosinski>
What can be problem when exit function is not killing script?
elaptics`away is now known as elaptics
maesbn has quit []
<mjolk2>
what do you mean pskosinski ?
lushious has quit [Ping timeout: 252 seconds]
<mjolk2>
such as when the OS kills the process and not the ruby script itself?
<pskosinski>
I have a class, a method and in that method: exit. And when I executed method script is not finishing working.
oposomme has joined #ruby
lushious has joined #ruby
apeiros_ has joined #ruby
<mjolk2>
why are you using a method to simply exit?
havenn_ has quit [Ping timeout: 260 seconds]
<mjolk2>
brb
<pskosinski>
Well… not only exit, also clean. ^^
<pskosinski>
But on the end is exit.
yshh_ has quit [Read error: Connection reset by peer]
yshh has joined #ruby
pen has joined #ruby
mengu has joined #ruby
vlad_starkov has joined #ruby
yshh has quit [Remote host closed the connection]
<mjolk2>
So you have basically an exit dispatcher?
<mjolk2>
Why use that as a submethod?
<mjolk2>
Instead of just expose and parameterize it for general use within the class?
banisterfiend has joined #ruby
<pskosinski>
"Instead of just expose and parameterize it for general use within the class?" Whaaat…?
phelps has quit [Ping timeout: 255 seconds]
<pskosinski>
Anyway I modified script so it is just going to the end and finishing. But still curious why exit was not working. :< I see that I can't exit when I have opened a connection.
<pskosinski>
Seems logical.
thufir_ has joined #ruby
<mjolk2>
Use a pastebin or something
<mjolk2>
The way that you're doing your exit sounds a bit crazy
<mjolk2>
Because the callee is trying to close the caller
kmurph has quit [Quit: kmurph]
Morkel has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
phelps has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
thufir_ has quit [Remote host closed the connection]
<pskosinski>
Before I was trying to add "exit" on the end of disconnect and execute disconnect from do_something.
Morkel has quit [Read error: Connection reset by peer]
Morkel_ has joined #ruby
<pskosinski>
But instead of @handler.shutdown I had @handler.close and it wasn't closing connection :( Looks like I was using outdated tutorial
slainer68 has quit [Remote host closed the connection]
<pskosinski>
What is crazy? :p
<mjolk2>
this isn't how you were describing it, but that's fine anyway
<pskosinski>
Well… sorry then.
<mjolk2>
No need to be sorry
pen has quit [Remote host closed the connection]
Takehiro has quit [Remote host closed the connection]
codebiff has joined #ruby
EhyehAsherEhyeh has joined #ruby
codebiff has quit [Client Quit]
phelps has quit [Ping timeout: 255 seconds]
berserkr has joined #ruby
pasties has quit [Ping timeout: 260 seconds]
phelps has joined #ruby
lenovodroid has joined #ruby
s1n4 has joined #ruby
Morkel_ has quit [Quit: Morkel_]
Morkel has joined #ruby
mockra has joined #ruby
EhyehAsherEhyeh has quit [Ping timeout: 256 seconds]
phelps has quit [Ping timeout: 252 seconds]
Shoobdidoo has joined #ruby
phelps has joined #ruby
Shoobdidoo has quit [Client Quit]
Jasko has quit [Read error: Connection reset by peer]
m_m has joined #ruby
mockra has quit [Ping timeout: 265 seconds]
Jasko has joined #ruby
lenovodroid has quit [Ping timeout: 265 seconds]
<m_m>
Hi . How i can get answers from my regex as an array for example i need street name and house number i have regex but i have Street and umber as a one string.
nicoulaj has joined #ruby
Catnaroek has quit [Quit: brb]
oposomme has quit [Quit: Leaving...]
Apocalypse has quit [Read error: Connection reset by peer]
pasties has joined #ruby
<apeiros_>
m_m: use capturing groups
<apeiros_>
that's sequences with () around them. see MatchData#captures
visof has joined #ruby
<visof>
Hello everyone
phelps has quit [Ping timeout: 250 seconds]
<mjolk2>
m_m assign the response of your regex match to a variable?
<visof>
I tried to define method that work for list of integers that,s called sum I do class Array; def self.sum;self.inject(:+);end;end
<visof>
But I got sum isn't defined for array
<mjolk2>
as for street name/number in the same string, good luck with addresses like "44 West 33rd Street, apt||#||suite 431"
<visof>
What have I done wrong in this?
oposomme has joined #ruby
lenovodroid has joined #ruby
<visof>
Can anyone help please
BBonifield has quit [Ping timeout: 252 seconds]
chussenot has quit [Quit: chussenot]
phelps has joined #ruby
<m_m>
No i have only a few kind of addresses. my regex for one of them : /([a-z]|[A-Z])+\s([0-9])+([a-z]|[A-Z])*\s*\/\s*[0-9]$/ and example : Sudecka 103b/1
nick_h has quit [Ping timeout: 260 seconds]
BBonifield has joined #ruby
nick_h has joined #ruby
<mjolk2>
oh god
dhruvasagar has quit [Ping timeout: 246 seconds]
fivetwentysix has quit [Ping timeout: 256 seconds]
<mjolk2>
where to start
<apeiros_>
visof: you defined it as a class method
<apeiros_>
instead of an instance method
Banistergalaxy has quit [Ping timeout: 252 seconds]
hoelzro|away is now known as hoelzro
Banistergalaxy has joined #ruby
<apeiros_>
m_m: ([a-z]|[A-Z])+ --> [a-zA-Z]+
insulator has joined #ruby
<mjolk2>
also, what's with all the * \s ?
phelps has quit [Ping timeout: 265 seconds]
<apeiros_>
and ()+ will not work nicely. it captures only the last match
wermel has joined #ruby
<apeiros_>
you usually want (…+)
<visof>
apeiros_ I want it to apply for all integer lists how can I do this
nick_h has quit [Ping timeout: 265 seconds]
<apeiros_>
visof: don't know what you mean by that
<apeiros_>
but the first step would certainly be to define it as an instance method, not a class method
<m_m>
I see now. It captures only the last letter from my street name.
nick_h has joined #ruby
<visof>
Ok
<m_m>
So how i can get a full street name ?
<m_m>
Oh. {1,} work fine.
phelps has joined #ruby
krz has quit [Quit: krz]
<whitequark>
m_m: {1,} is equivalent to +
_64k has joined #ruby
_64k has quit [Client Quit]
sepp2k has joined #ruby
phelps has quit [Ping timeout: 255 seconds]
_64k has joined #ruby
phelps has joined #ruby
Alenah has joined #ruby
s1n4 has quit [Ping timeout: 244 seconds]
_64k has quit [Read error: Connection reset by peer]
_64k_ has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
katze_t4 has quit [Read error: Connection reset by peer]
slainer68 has quit [Read error: Operation timed out]
phelps has joined #ruby
malte_ has joined #ruby
stevechiagozie has joined #ruby
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
vlad_starkov has joined #ruby
lkba has quit [Ping timeout: 264 seconds]
neiled has quit [Quit: Computer has gone to sleep.]
RoUS has joined #ruby
RoUS has joined #ruby
RoUS has quit [Changing host]
vlad_starkov has quit [Ping timeout: 250 seconds]
phelps has quit [Ping timeout: 250 seconds]
stevechiagozie has quit [Ping timeout: 246 seconds]
phelps has joined #ruby
sayan has quit [Remote host closed the connection]
nilg has quit [Ping timeout: 245 seconds]
Xeago has quit [Remote host closed the connection]
phelps has quit [Ping timeout: 255 seconds]
mockra has joined #ruby
byterussian has left #ruby [#ruby]
lenovodroid has quit [Ping timeout: 256 seconds]
mockra has quit [Ping timeout: 245 seconds]
phelps has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Guest5080 has joined #ruby
Jasko has joined #ruby
mengu has quit [Ping timeout: 255 seconds]
slainer68 has joined #ruby
vlad_starkov has joined #ruby
hotovson has joined #ruby
sayan has joined #ruby
becom33 has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
<becom33>
Im using a output module to style the output . I use the module in some instance classes . but I cant use it in instance class says undefined method
<emocakes>
have you defined it becom?
<becom33>
instance classes no
fyolnish has quit [Remote host closed the connection]
<becom33>
I use them as Class.method(para)
<becom33>
emocakes,
nomenkun has quit [Remote host closed the connection]
EhyehAsherEhyeh has joined #ruby
nomenkun has joined #ruby
stevechiagozie has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
EhyehAsherEhyeh has quit [Read error: Connection reset by peer]
<pskosinski>
In case of using TCPSocket, if I will lose internet connection, TCPSocket is not "closing itself". Can I somehow check if connection is established?
phelps has joined #ruby
haxrbyte has joined #ruby
EhyehAsherEhyeh has quit [Ping timeout: 264 seconds]
haxrbyte_ has quit [Read error: Connection reset by peer]
<becom33>
got it Hanmac thanks :D
Vert has quit [Ping timeout: 252 seconds]
knirhs has joined #ruby
kil0byte has quit [Ping timeout: 255 seconds]
banisterfiend has quit [Remote host closed the connection]
caemir has left #ruby ["Je pars..."]
Shrink has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
stevechiagozie has joined #ruby
zmbmartin has joined #ruby
<zmbmartin>
How do I parse a datetime with format of MM/dd/yyyy HH:mm (24 hour notation)?
<zmbmartin>
If I try DateTime.parse("MM/dd/yyyy HH:mm") I get an invalid date error
<Hanmac>
zmbmartin: look at strptime
ffranz has joined #ruby
hotovson has quit [Remote host closed the connection]
nfk has joined #ruby
mpfundstein has quit [Ping timeout: 260 seconds]
stevechiagozie has quit [Ping timeout: 246 seconds]
kil0byte has joined #ruby
<zmbmartin>
Hanmac: Thanks
kil0byte_ has joined #ruby
phelps has quit [Ping timeout: 252 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
kil0byte has quit [Ping timeout: 255 seconds]
kil0byte_ has quit [Ping timeout: 250 seconds]
adkron has joined #ruby
phelps has joined #ruby
kil0byte has joined #ruby
kirun has joined #ruby
dreinull has joined #ruby
insulator has quit [Remote host closed the connection]
<dreinull>
what's the method again that uses a preformatted string and replces parts of it (useful for aligning stuff for ascii output)?
cakehero has joined #ruby
Virunga has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
vlad_starkov has joined #ruby
x0F_ is now known as x0F
<Hanmac>
dreinull look at []= .... s="abc";s[1]="d" ; s#=> "adc"
<Hanmac>
or look at sub/gsub
<dreinull>
Hanmac: seems like I'm looking for printf
Siphonblast has quit [Quit: quit()]
<dreinull>
I always try to find it under String...
Siphonblast has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
Banistergalaxy has quit [Ping timeout: 255 seconds]
vlad_starkov has joined #ruby
kil0byte has quit [Ping timeout: 265 seconds]
jonteru has joined #ruby
Banistergalaxy has joined #ruby
jonteru has left #ruby [#ruby]
<Hanmac>
dreinull: "a%sc" % "b" #=> "abc"
phelps has quit [Ping timeout: 245 seconds]
mockra has joined #ruby
<apeiros_>
sprintf aka String#%
<Hanmac>
but i like % more
daniel_- has quit [Ping timeout: 256 seconds]
<dreinull>
sorry, my machine is about to crash. Thanks for the hints
kil0byte has joined #ruby
adambeynon has joined #ruby
<apeiros_>
dreinull uses a premillenial operating system?
mockra has quit [Ping timeout: 244 seconds]
<dreinull>
oh, seems to have recovered
phelps has joined #ruby
<dreinull>
apeiros_: no :)
<dreinull>
apeiros_: my mac every once in a while decides to send a random character to the OS. Like pressing a key non-stop
s1n4 has quit [Quit: leaving]
cakehero has quit [Quit: Computer has gone to sleep.]
<dreinull>
but I managed to kill tmux and end that nightmare
lenovodroid has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
Villadelfia has quit [Ping timeout: 255 seconds]
Goles has joined #ruby
kil0byte_ has joined #ruby
kil0byte has quit [Ping timeout: 245 seconds]
SeySayux has quit [Ping timeout: 246 seconds]
<Hanmac>
apples are banana-ware, they does after-ripen at the customers ... and like real bananas some one are allready over ther date :P
phelps has quit [Ping timeout: 265 seconds]
samphippen has quit [Ping timeout: 252 seconds]
samphippen has joined #ruby
Villadelfia has joined #ruby
* apeiros_
wonders what linux is then - lets the consumer do the riping
fire has joined #ruby
<apeiros_>
cuckoo-ware?
phelps has joined #ruby
iamjarvo has joined #ruby
Catnaroek has quit [Ping timeout: 246 seconds]
kil0byte_ has quit [Ping timeout: 255 seconds]
SeySayux has joined #ruby
enroxorz-work has joined #ruby
Morkel has quit [Quit: Morkel]
jfl0wers has joined #ruby
kil0byte has joined #ruby
iPhoneMRZ has joined #ruby
iPhoneMRZ has quit [Client Quit]
<shevy>
becom33 hi, nope was sleeping, wanted to wake up 4 hours earlier... but fell asleep again... grr
<becom33>
ha ha cool cool
ttt has quit [Remote host closed the connection]
phelps has quit [Ping timeout: 250 seconds]
kil0byte_ has joined #ruby
chussenot has joined #ruby
tenmilestereo has joined #ruby
phelps has joined #ruby
kil0byte has quit [Ping timeout: 250 seconds]
iPhoneMRZ has joined #ruby
iPhoneMRZ has quit [Client Quit]
daniel_- has joined #ruby
iPhoneMRZ has joined #ruby
bean has joined #ruby
justincampbell has joined #ruby
Virunga has quit [Remote host closed the connection]
adkron has quit [Ping timeout: 252 seconds]
samphippen has quit [Ping timeout: 252 seconds]
zmbmartin has left #ruby [#ruby]
samphippen has joined #ruby
burgestrand has joined #ruby
kil0byte_ has quit [Ping timeout: 255 seconds]
NiteRain has quit [Ping timeout: 246 seconds]
WhereIsMySpoon has quit [Changing host]
WhereIsMySpoon has joined #ruby
phantasm66 has quit [Quit: *sleeeep….]
dsdeiz has joined #ruby
oktapodi has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
phelps has quit [Ping timeout: 255 seconds]
kil0byte has joined #ruby
ner0x has joined #ruby
phelps has joined #ruby
adeponte has joined #ruby
chussenot has quit [Quit: chussenot]
<dreinull>
% and sprintf are a mess. How am I supposed to understand all that. Managed to format my String but this is terrible.
oktapodi has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 250 seconds]
daveturnbull has quit [Quit: daveturnbull]
stat1x has quit [Read error: Connection reset by peer]
tk__ has joined #ruby
phelps has quit [Ping timeout: 250 seconds]
caveat- has quit [Quit: leaving]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
hotovson has joined #ruby
mikecmpbll has joined #ruby
stevechiagozie has joined #ruby
<_axx>
i'm wondering, is net/ssh removed in ruby 1.9.2? i get in error requiring it. is there a gem or something? :)
Virunga has joined #ruby
banisterfiend has joined #ruby
phelps has joined #ruby
<dsdeiz>
hi all, anyone using dropbox-sdk? how does one store the access token?
elsifaka has quit [Read error: Connection reset by peer]
caveat- has joined #ruby
adamnbowen has joined #ruby
elsifaka has joined #ruby
Vert has joined #ruby
elsifaka has quit [Read error: Connection reset by peer]
elsifaka has joined #ruby
sayan has quit [Ping timeout: 256 seconds]
elsifaka has quit [Max SendQ exceeded]
elsifaka has joined #ruby
ananthakumaran has joined #ruby
jrajav has joined #ruby
<_axx>
oh, stupid me... it isn't a stdlib
oposomme has quit [Quit: Leaving...]
grieve has joined #ruby
phelps has quit [Ping timeout: 255 seconds]
neurotech has quit [Remote host closed the connection]
oposomme has joined #ruby
vlad_sta_ has joined #ruby
mengu has joined #ruby
<bean>
_axx: I believe so, one sec, I think I had to install a gem for it the other day
<bean>
_axx: yeah, I did "gem install net-ssh"
stat1x has joined #ruby
benlieb has joined #ruby
phelps has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
C0deMaver1ck has joined #ruby
C0deMaver1ck has joined #ruby
C0deMaver1ck has quit [Changing host]
malte_ has quit [Quit: malte_]
banisterfiend has joined #ruby
mksm has quit [Ping timeout: 255 seconds]
vlad_starkov has quit [Ping timeout: 260 seconds]
<_axx>
bean: yeah, thanks! :)
<bean>
npnp
nari has quit [Read error: Operation timed out]
daniel_- has joined #ruby
Virunga has quit [Remote host closed the connection]
Virunga has joined #ruby
busybox42 has joined #ruby
Iszak has joined #ruby
iamjarvo has quit [Quit: Leaving.]
phelps has quit [Ping timeout: 265 seconds]
<rismoney>
is it possible to make a string utf16le in ruby 1.8.7?
banisterfiend has quit [Ping timeout: 260 seconds]
Virunga has quit [Ping timeout: 256 seconds]
NiteRain has joined #ruby
<Hanmac>
rismoney i dont think so
phelps has joined #ruby
syamajala has joined #ruby
s1n4 has joined #ruby
joshman_ has joined #ruby
slainer6_ has joined #ruby
kokainepizza has joined #ruby
slainer68 has quit [Ping timeout: 256 seconds]
C0deMaver1ck has quit [Ping timeout: 265 seconds]
thone has joined #ruby
<Mon_Ouie>
Depends on what you mean by that. Ruby 1.8 doesn't know about encondings. Strings are just strings of bytes. So you can just put the data in whatever encoding you like.
<Mon_Ouie>
You just have to make sure that you don't mix up different, incompatible encodings.
mksm has joined #ruby
phelps has quit [Ping timeout: 250 seconds]
_nitti has joined #ruby
thone_ has quit [Ping timeout: 255 seconds]
mikecmpbll has quit [Quit: Computer has gone to sleep.]
willob has joined #ruby
alesguzik has joined #ruby
phelps has joined #ruby
arturaz has quit [Remote host closed the connection]
stopbit has joined #ruby
Apocalypse has quit [Quit: Input/Output Error]
s1n4 has quit [Quit: leaving]
Guest25886 has quit [Quit: Guest25886]
iamjarvo has joined #ruby
AlSquire has joined #ruby
Apocalypse has joined #ruby
C0deMaver1ck has joined #ruby
C0deMaver1ck has joined #ruby
C0deMaver1ck has quit [Changing host]
lusory has quit [Ping timeout: 264 seconds]
mockra has joined #ruby
miskander has joined #ruby
miskander has quit [Client Quit]
vlad_starkov has joined #ruby
vlad_sta_ has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby
miskander has joined #ruby
nomenkun has quit [Ping timeout: 245 seconds]
rippa has joined #ruby
ananthakumaran1 has joined #ruby
mockra has quit [Ping timeout: 256 seconds]
chussenot has joined #ruby
nomenkun has joined #ruby
tndrbt has joined #ruby
vlad_starkov has quit [Ping timeout: 252 seconds]
ananthakumaran has quit [Ping timeout: 264 seconds]
nomenkun has quit [Read error: Connection reset by peer]
vlad_sta_ has quit [Ping timeout: 255 seconds]
nomenkun has joined #ruby
Jackneill has joined #ruby
Jackneill has quit [Changing host]
Jackneill has joined #ruby
<dsdeiz>
hi, if a function returns two variables how do i set a variable for each returned variable?
sayan has joined #ruby
<apeiros_>
method, not function. you do `a, b = foo()`
<dsdeiz>
awesome, thx!
_nitti has quit [Remote host closed the connection]
lorn has quit [Ping timeout: 260 seconds]
_nitti has joined #ruby
lorn has joined #ruby
blaxter has quit [Quit: foo]
AndChat| has joined #ruby
chussenot has quit [Quit: chussenot]
lkba has joined #ruby
<justincampbell>
can i curry a proc with all arguments without executing it?
Banistergalaxy has quit [Ping timeout: 244 seconds]
Gue______ has joined #ruby
Gue______ is now known as asteve
asteve has quit [Changing host]
asteve has joined #ruby
elico has joined #ruby
alexspeller has joined #ruby
statarb3 has quit [Ping timeout: 256 seconds]
blaxter has joined #ruby
nick_h has quit [Ping timeout: 255 seconds]
nick_h has joined #ruby
<burgestrand>
justincampbell: wrap it in another proc
<tangorri>
I'm using ruby under windows and pik, but I got problem with bundler
<swarley>
[1] pry(main)> l = "gnome-classic.desktop".chomp(".desktop")
<swarley>
=> "gnome-classic"
<shevy>
Hanmac, a bundler problem again, you must help
<markit>
canton7: ARGH, right
<tangorri>
'bundle install --path .\gems' ok, but then ruby can't find the gems ...
<markit>
ok, not is all rational
<swarley>
but seriously
<markit>
world isn't ending ;P
<shevy>
markit not today, but it will one day *evil laugh here*
<tangorri>
Hanmac please help :D
sailias has quit [Quit: Leaving.]
* markit
takes note of all the above bright suggestions
<swarley>
markit; the one i gave you is probably the most readable way to do it lol
<Hanmac>
he was fooling you ... i never used or needed bundler
<shevy>
shameless self-promotion ;P
<swarley>
shevy; well it is true :p
aldodelgado has joined #ruby
<canton7>
tangorri, bundler is about installer gems per-project, not system-wide. Your app needs to include bundler, and maybe execute a function (can't remember) before 'require' will start using the app's local gem cache
<canton7>
s/installer/installing
<shevy>
Hanmac but you like bundler very much!
<tangorri>
canton the same project works on linux and osx
<brotspinne>
markit: you don't even need select and map. you could use %x[ls /usr/share/xsessions/].scan(/(.*)\.desktop$/i).flatten
<dsdeiz>
in dropbox, the path returns /Public/directory/file.ext, how do i just retrieve 'file'?
<canton7>
tangorri, I don't know what you're trying to do, but it looks like you're getting gem and bunder mixed up
statarb3 has joined #ruby
<tangorri>
canton7 mixed up ?
<tangorri>
I just try to run my app
<canton7>
tangorri, what are you actually trying to do? This looks like an XY problem
<atmosx>
XY = it's a male!!!!!
ffranz1 has quit [Quit: Leaving]
bluOxigen has quit [Ping timeout: 265 seconds]
<brotspinne>
markit: I'm interested in your final solution
lenodroid has joined #ruby
<tangorri>
canton7 well I need some gems to run my app, so I do as usual, I use Gemfile and bundler
ffranz has joined #ruby
* atmosx
never uses a gemfile and a bundler, heroku app apart.
ffranz has quit [Remote host closed the connection]
AndChat| has quit [Read error: Connection reset by peer]
<canton7>
tangorri, ok cool. So why are you surprised when the gems aren't installed system-wide
lenodroid has quit [Read error: Connection reset by peer]
lenodroid has joined #ruby
Banistergalaxy has joined #ruby
<tangorri>
because I run bundle install ... :/
<tangorri>
so the gem should be there
<markit>
brotspinne: I will adopt yours, but when I asked for help some days ago I was interested in using regexp, so I took note of the interesting tips you all gave me
dr_neek has quit [Quit: dr_neek]
<canton7>
Like I said, *that doesn't install gems system-wide. only per-app*
ffranz has joined #ruby
<brotspinne>
;)
<tangorri>
they are on ./gems dir but not found
lenodroid has quit [Read error: Connection reset by peer]
atmosx has quit [Quit: And so the story goes…]
<canton7>
the 'gem' tool won't know how to find gems installed with bundler. Because they're not installed system-wide
<tangorri>
really ?
<canton7>
How many more times do I need to repeat this?
_64k has joined #ruby
<tangorri>
all right !
<tangorri>
thanks
<tangorri>
I go it
<canton7>
cool!
<tangorri>
got it now :D
<canton7>
bundler installs a set of app-specific gems to an app-specific cache. You then configure the app to require those gems, rather than the system gems
<canton7>
that's the whole premise
<tangorri>
you are right, my memory fooled me
<tangorri>
I need to binstubs or something
<canton7>
iirc bundler *can* install gems system-wide, but the --path you passed probably precludes that
fire has joined #ruby
<tangorri>
yes
cakehero has joined #ruby
<tangorri>
just need to use bundle exec
<tangorri>
hmmm bundle exec each time ?
havenn has joined #ruby
<slainer68>
tangorri: NO NO, don't press the red button!
<slainer68>
xD
<tangorri>
:)
thinkclay has joined #ruby
atmosx has joined #ruby
<canton7>
tangorri, when running your app?
<tangorri>
yes
<canton7>
tangorri, in your app, you should have 'require "bundler/setup"' before requiring your gems. That'll make sure the right gems are required
<cout>
the RED button is for loading and unloading only. there shall be no pressing of the WHITE button.
bluOxigen has joined #ruby
<tangorri>
ok let me check that
friskd has joined #ruby
alexspeller has quit [Remote host closed the connection]
healpay has quit [Remote host closed the connection]
sayan has quit [Quit: Leaving]
<tangorri>
well the app runs ok
danneu has quit [Quit: WeeChat 0.3.8]
alexspeller has joined #ruby
<brotspinne>
dsdeiz: you can use '.*' instead of '.ext' in my answer
elaptics is now known as elaptics`away
<brotspinne>
dsdeiz: so the extension can be anything
<canton7>
That's better than the idiom I see a lot, File.basename(file, File.extname(file))
<pskosinski>
I have a script and without modifying it much I want to add kind of "watchman" checking every minute if something happened and if so then kill process. I was thinking about making subprocess using fork and share needed data from main process using pipe. Subprocess would check every minute if something happened and if so it would kill main process and exit. Is it good idea, i there something better?
alexim has quit [Ping timeout: 256 seconds]
eldariof has quit [Read error: Operation timed out]
<tangorri>
hmmm now shotgun has problem
<pskosinski>
Simply my script, when connection dies, is "staying in place". :< And I want to kill it.
Banistergalaxy has quit [Read error: Connection reset by peer]
<pskosinski>
freezing *
<pskosinski>
Or can I do something like… threads? Two independent scripts in one? ^^ No idea, I was never doing it.
alexspeller has quit [Read error: Connection reset by peer]
brotspinne has quit [Quit: brotspinne]
Banistergalaxy has joined #ruby
nomenkun has quit [Remote host closed the connection]
Iszak has joined #ruby
nomenkun has joined #ruby
<pskosinski>
Or is here someone playing with TCPSocket? Because I have no idea how to check is connection still exists, what is it's state… in case when internet connection dies.
<pskosinski>
check if *
kmurph has joined #ruby
kmurph has quit [Client Quit]
BoomCow has joined #ruby
elico has joined #ruby
berserkr has quit [Quit: Leaving.]
freeayu has quit [Remote host closed the connection]
atmosx has quit [Ping timeout: 260 seconds]
tk__ has quit [Quit: ばいばい]
_nitti has quit [Remote host closed the connection]
lusory has joined #ruby
Jake232 has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
BoomCow has quit [Ping timeout: 260 seconds]
cbosh has quit [Ping timeout: 255 seconds]
pcarrier has joined #ruby
yacks has joined #ruby
frightenedmonkey has joined #ruby
mockra has joined #ruby
philcrissman has quit [Remote host closed the connection]
danneu has joined #ruby
BoomCow has joined #ruby
iamjarvo has quit [Quit: Leaving.]
gyre008 has joined #ruby
_nitti has joined #ruby
<pskosinski>
Or I will show where exactly is problem: http://wklej.org/id/907555/ I have internet connection, I am creating it using TCPSocket.new, then in loop I am trying to get data from socket. But when my internet connection dies data never arrives so @handler.gets takes forever. :<
_bart has quit [Ping timeout: 260 seconds]
<pskosinski>
IT's waiting all the time for data which will never appear.
gyre007 has quit [Read error: Operation timed out]
<pskosinski>
No idea how to fix it. :<
gyre008 has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
gyre007 has joined #ruby
daniel_- has quit [Ping timeout: 246 seconds]
mayfield has joined #ruby
kjellski has joined #ruby
<danneu>
pskosinski: `while line = @handler.gets`
kiyoura has joined #ruby
<pskosinski>
Oh, if so, then I misunderstood and it's not waiting but I have bug. :< Will try, ty
Noldorin has joined #ruby
cbosh has joined #ruby
<danneu>
I can't answer your question, but you don't need the !eof? check since #gets won't assign `line` when it's eof
pwelch has joined #ruby
notVert has joined #ruby
<danneu>
Of course, inside that while condition, you'd process_server_output(line)
<pskosinski>
Well, it's same. :(
<pskosinski>
hm
<danneu>
pskosinski: Ohhh, you want it to move on when, say, your internet conn dies. I misunderstood question
sayan has joined #ruby
<pskosinski>
Yes, when connection dies, I have no idea how to check if it died.
notVert_ has joined #ruby
<pskosinski>
I am for sure getting some data every minute, if I have connection. So if I won't get anything during minute I can kill process…
<danneu>
It'd answer that question a 100 times over
<pskosinski>
Ok, thanks, will read.
miskander has quit [Quit: miskander]
danneu has left #ruby ["WeeChat 0.3.8"]
<pskosinski>
Meh, I have no $30 for it now. :<
chimkan has joined #ruby
philips_ has quit [Excess Flood]
pappaeciccia has joined #ruby
pappaeciccia has quit [Client Quit]
notVert has quit [Ping timeout: 252 seconds]
mpfundstein has joined #ruby
rdegraci has quit [Quit: rdegraci]
JohnBat26 has joined #ruby
nomenkun_ has joined #ruby
elico has quit [Remote host closed the connection]
banisterfiend has joined #ruby
Morkel has joined #ruby
elaptics`away is now known as elaptics
slainer68 has quit [Remote host closed the connection]
<pskosinski>
And as I see connection has all the time state "ESTABLISHED", Ruby is not changing its state when internet connections dies… So I guess that I can't rely on it and just do about what I was talking in the beginning? :< ok
nomenkun has quit [Ping timeout: 256 seconds]
mpfundst1in has joined #ruby
chimkan has quit [Ping timeout: 250 seconds]
nga4 has joined #ruby
mrdtt has quit [Quit: mrdtt]
Umren has joined #ruby
Sou|cutter has joined #ruby
dsdeiz has quit [Ping timeout: 252 seconds]
slash_nick has joined #ruby
<slash_nick>
Hey guys... anyone know of any Digital Signals Processing (DSP) gems for Ruby?
d2dchat has joined #ruby
atmosx has joined #ruby
nick_h has quit [Ping timeout: 255 seconds]
nomenkun_ has quit [Remote host closed the connection]
blazes816 has joined #ruby
banisterfiend has quit [Ping timeout: 256 seconds]
zeade has joined #ruby
bean__ has joined #ruby
bean has quit [Read error: Connection reset by peer]
bean__ is now known as bean
nick_h has joined #ruby
benlieb has quit [Quit: benlieb]
benlieb has joined #ruby
zz_chrismcg is now known as chrismcg
fire has quit [Quit: WeeChat 0.3.9.2]
philips_ has joined #ruby
Vert has joined #ruby
mockra has quit [Remote host closed the connection]
_64k has quit [Quit: _64k]
<markit>
may I use .include?(/regex/) ? seems not to work
jfl0wers has quit [Read error: Operation timed out]
dsdeiz has joined #ruby
arietis has joined #ruby
friskd has quit [Quit: friskd]
xemu has joined #ruby
akemrir has quit [Quit: WeeChat 0.3.9.2]
sayan_ has quit [Quit: Leaving]
jblack has joined #ruby
kjellski has quit [Quit: This computer has gone to sleep]
gyre007 has quit [Read error: Operation timed out]
<pskosinski>
If someone remembers about what I was talking, solution is simple and looks like this: http://wklej.org/id/907646/ Nice.
gyre007 has joined #ruby
Proshot has joined #ruby
Russell^^ has quit [Quit: Russell^^]
<mpfundstein_home>
pskosinski: just out of curiosity. what was the purpose?
miskander has joined #ruby
<jcrawford>
what does the term monkey patching refer to in Ruby? I ask because I have seen it used and people are doing nothing more than extending classes or overriding methods in Jekyll and I am not quite sure why overloading/extending is called monkey patching
Vert has joined #ruby
banisterfiend has joined #ruby
<jcrawford>
it appears the term really means modifying the run-time code of a dynamic language, surely that does not apply to Jekyll code would it?
notVert has quit [Ping timeout: 252 seconds]
notVert has joined #ruby
<pskosinski>
mpfundstein_home: I am establishing a connection. And getting from it data in a loop. It should be killed when I'm not getting anything for X seconds. But connection_handler.gets is "freezing" script (waiting for data, but if my connection crashed data will never come). So it's best way from ways about which I was reading, to do something like this. :p
fire has quit [Quit: WeeChat 0.3.9.2]
Russell^^ has joined #ruby
<pskosinski>
crashes *
<pskosinski>
It's just waiting for execution 300 seconds and if app won't be executed returning nil.
<pskosinski>
execution won't be finished *
<cout>
jcrawford: I think the term was originally derogatory
ananthakumaran1 has quit [Quit: Leaving.]
Shadow_S has joined #ruby
_64k has quit [Quit: _64k]
<cout>
I think the first time I heard it was in 2005 or 2006
<delinquentme>
and they're using symbols as keys within a hash... and the article states that hashes will re-instantiate the keys if they're not symbols
Vert has quit [Ping timeout: 252 seconds]
<delinquentme>
thus it says the advantage of a symbol is to save memory and NOT reinstantiate a key within a hash
Vert has joined #ruby
<jcrawford>
WorkGroup: not sure why that would run only once unless there was an error you have no break out clause
<delinquentme>
that part makes sense ... but i just tried overwriting values in my hashes and the object ids stayed the same
_bart has joined #ruby
<WorkGroup>
jcrawford with while true it also not run
<shevy>
delinquentme show the example? you used strings as keys?
AlSquire has quit [Quit: This computer has gone to sleep]
<delinquentme>
yeah
sepp2k has quit [Ping timeout: 255 seconds]
<jcrawford>
delinquentme: a symbol is just a pointer/label, if you use strings for your keys it will use more and more memory as it will not use the same string location in memory. A symbol will always point to the same memory location
mercwithamouth has quit [Ping timeout: 246 seconds]
_nitti has quit [Remote host closed the connection]
IceDragon has joined #ruby
digiwth has quit [Ping timeout: 244 seconds]
__BigO__ has joined #ruby
becom33 has joined #ruby
digiwth has joined #ruby
chriskk has joined #ruby
havenn has quit [Ping timeout: 260 seconds]
breakingthings has joined #ruby
kjellski has quit [Quit: This computer has gone to sleep]
syamajala has quit [Remote host closed the connection]
jerius has quit []
tenmilestereo has joined #ruby
rismoney has quit [Ping timeout: 245 seconds]
sailias has quit [Quit: Leaving.]
postmodern has quit [Quit: Leaving]
voodoofish430 has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
yacks has quit [Remote host closed the connection]
angelixd_ is now known as angelixd
toekutr has joined #ruby
daniel_- has quit [Ping timeout: 244 seconds]
mksm has quit [Ping timeout: 265 seconds]
dr_neek has joined #ruby
Jake232 has quit [Quit: Computer has gone to sleep.]
ryanf has joined #ruby
jerius has joined #ruby
pskosinski has joined #ruby
_nitti has joined #ruby
mksm has joined #ruby
ryanf has quit [Ping timeout: 255 seconds]
ffranz has quit [Quit: Leaving]
Tomasso has joined #ruby
arturaz has joined #ruby
jcrawford has quit [Excess Flood]
jcrawford has joined #ruby
bean has joined #ruby
johnmilton has joined #ruby
sailias has joined #ruby
malte_ has joined #ruby
tanathos has joined #ruby
sayan has quit [Remote host closed the connection]
<Tomasso>
i launch a process that dies after some time from a ruby script i would like the script to relaunch it, but the script itself dies.. hoe should i call it so the script does not become the parent process ?
<pskosinski>
Anyway code pasted by banisterfiend works for me. :< 1.9.3
phelps has joined #ruby
alesguzik has quit [Quit: leaving]
gyre007 has joined #ruby
kmurph has joined #ruby
tenmilestereo has quit [Ping timeout: 246 seconds]
havenn has joined #ruby
<banisterfiend>
IceDragon: thanks
<IceDragon>
your welcome
<banisterfiend>
you're*
<banisterfiend>
;)
kenneth has joined #ruby
<kenneth>
hey there
<IceDragon>
*cries*
<kenneth>
is there a way to include a module on an instance?
_64k has joined #ruby
<banisterfiend>
kenneth: extend
<banisterfiend>
kenneth: instance.extend MyModule
eldariof has quit []
<kenneth>
awesome, thanks banisterfiend
alexspeller has joined #ruby
<IceDragon>
I think extend and include are private.
<banisterfiend>
include is, extend is not
blaxter has quit [Quit: foo]
<IceDragon>
odd
gyre007 has quit [Ping timeout: 246 seconds]
Siphonblast has quit [Ping timeout: 245 seconds]
havenn has quit [Ping timeout: 260 seconds]
<kenneth>
other question, can you do something like module First::Second; end if you want to avoid doing module First; module Second; end; end
<banisterfiend>
IceDragon: a little bit, but the rationale is that 'include' is meant only to be used when defining a class, so it should only appear inside the class body
<banisterfiend>
kenneth: yes
<banisterfiend>
kenneth: but there are a few quirks
_nitti has quit [Remote host closed the connection]
nomenkun has joined #ruby
krawchyk has quit [Remote host closed the connection]
snearch has quit [Quit: Verlassend]
headius has quit [Quit: headius]
sailias has quit [Quit: Leaving.]
Jackneill has quit [Quit: Leaving]
dr_neek has quit [Ping timeout: 260 seconds]
dr_neek has joined #ruby
_nitti has joined #ruby
cascalheira has quit [Quit: Leaving...]
zeade has joined #ruby
aldodelgado has quit [Quit: aldodelgado]
<mpfundstein_home>
shevy: nooooo waaay :D i come from a C background
thatguycraig has left #ruby [#ruby]
tvw has quit [Remote host closed the connection]
<Hanmac>
then you may like that you can extend ruby with c code
skcin7 has quit [Ping timeout: 252 seconds]
<jrajav>
It would be more interesting if you could extend c code with ruby ;)
<mpfundstein_home>
Hanmac: yeah but every scripting language can do that. i am more interested in the "beauty" behind ruby. and the smalltalk roots
<kenneth>
jrajav: who says you can;t?
<banisterfiend>
mpfundstein_home: ask questions like 'how do i...' and we'll tell u the ruby-ish way to do it
bigmcq77 has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby
<Hanmac>
i like the code blocks {}
Sou|cutter has joined #ruby
dankest has joined #ruby
Sou|cutter has quit [Client Quit]
<shevy>
haha
<shevy>
Hanmac is the ultimate C++-Ruby person
<shevy>
but
<shevy>
he HATES writing documentation :(
<mpfundstein_home>
;-)
<mpfundstein_home>
as long as he writes self documenting code i am fine
<banisterfiend>
mpfundstein_home: he's teutonic, writing docs in english is hard work
<mpfundstein_home>
banisterfiend: sure. i just studied the book metaprogramming in ruby. it is pretty awesome. Obj C has a couple of similiar concepts
<banisterfiend>
mpfundstein_home: Yeah, obj-c and ruby have a lot in common
<mpfundstein_home>
smalltalk roots
<mpfundstein_home>
:-)
<banisterfiend>
yeah
krawchyk has joined #ruby
<mpfundstein_home>
what i like is that you can tune it like crazy. i mean ActiveRecord is an awesome piece of work. Or Sinatra.
sailias has quit [Client Quit]
kmurph has quit [Quit: kmurph]
sailias has joined #ruby
<banisterfiend>
mpfundstein_home: if you like smalltalk, u might enjoy pry (http://pryrepl.org) which is somewhat influenced by it
<mpfundstein_home>
thx
havenn has joined #ruby
rondale_sc has quit [Ping timeout: 246 seconds]
zeade has quit [Ping timeout: 272 seconds]
sailias has quit [Client Quit]
<Hanmac>
mpfundstein_home i use ruby for GUI Programmnig and 3D
JMcAfreak has quit [Quit: leaving]
alesguzik has joined #ruby
xAndy is now known as xandy
Morkel has quit [Quit: Morkel]
sailias1 has joined #ruby
<mpfundstein_home>
Hanmac: nice but i am more at home on the server depops side
chessguy has joined #ruby
<mpfundstein_home>
Hanmac: did some OpenGL in the past. but only 2D and in C. It was kinda obvious that scripting languages will emerge on that field as well
heftig has quit [Quit: leaving]
cantonic_ has joined #ruby
heftig has joined #ruby
cantonic has quit [Ping timeout: 250 seconds]
cantonic_ is now known as cantonic
sailias1 has quit [Ping timeout: 244 seconds]
richardr has joined #ruby
Sou|cutter has joined #ruby
Sou|cutter has quit [Changing host]
Sou|cutter has joined #ruby
sailias1 has joined #ruby
nwertman has joined #ruby
IceDragon has quit [Quit: Space~~~]
havenn has quit [Ping timeout: 246 seconds]
Sou|cutter has quit [Client Quit]
jenrzzz has quit [Ping timeout: 252 seconds]
manouch has joined #ruby
<manouch>
hi... is it possible to "catch" a return out of a block when i evaluate it?
<manouch>
i'd need to finalize things before unwinding the stack
mercwithamouth has joined #ruby
Sou|cutter has joined #ruby
kirun has quit [Quit: Client exiting]
sorbo_ has joined #ruby
Noldorin has quit [Quit: Computer has gone to sleep.]
Tomasso has quit [Ping timeout: 245 seconds]
cascalheira has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
tyman has joined #ruby
tyman has left #ruby [#ruby]
krawchyk has quit [Remote host closed the connection]
AlSquire has joined #ruby
xandy is now known as xAndy
jduan1981 has joined #ruby
DrShoggoth has joined #ruby
dr_neek has quit [Quit: dr_neek]
philcrissman has joined #ruby
eliqtrope has joined #ruby
xAndy is now known as xandy
<eliqtrope>
hi all, is there a way to modify self?
Noldorin has joined #ruby
alexspeller has quit [Remote host closed the connection]
<banisterfiend>
eliqtrope: give an example what u mean
thinkclay has quit [Quit: Leaving.]
<_nitti>
self.modify
<_nitti>
modify(self)
<_nitti>
way too broad
<sorbo_>
eliqtrope: you can't change the value of self. it always points to the current object, and you can't make it point to something else.
mjolk2 has quit [Quit: This computer has gone to sleep]
mjolk has joined #ruby
mjolk is now known as Guest37355
<objectivemo>
hi
<mpfundstein_home>
hi
<objectivemo>
I have a quick question. So basically I have the freeze method to freeze an object, but I can reference another object and lose the frozen object, which is cool but it means I can do this
<richardr>
jcrawford: thanks - that matches it. what is the easiest way to escape in Ruby?
<jcrawford>
review.rb:108:in `alias_method': undefined method `destination' for module `Jekyll' (NameError)
picca has joined #ruby
<objectivemo>
mpfundstein_home: I found out that no reference can be frozen, only objects can be frozen
<objectivemo>
so I cannot have defensive programming as I did in say Java or C++
<mpfundstein_home>
jcrawford: ok, i'd have to dig deeper
<jcrawford>
richardr: Regex.escape?
<objectivemo>
best way is to do encapsulation on that object
sorbo_ has quit [Quit: sorbo_]
<richardr>
jcrawford: thanks
<jcrawford>
mpfundstein_home: i can paste the entire class if ya wish
<mpfundstein_home>
objectivemo: encapsualte
<objectivemo>
exactly
<mpfundstein_home>
objectivemo: but ruby is fairly open
emergion has quit [Quit: Computer has gone to sleep.]
<mpfundstein_home>
objectivemo: someone can do whatever he wants. u can also access private instance variable from whereever you want if you know the tricks
<mpfundstein_home>
jcrawford: small piece is ok
<jcrawford>
i would be open to suggestions, I am new to Ruby and just trying to extend Jekyll so that I can have it the way I want :)
<objectivemo>
would have loved to use A::B without having that being able to change
<mpfundstein_home>
objectivemo: @@ is not good use for a class variable
<mpfundstein_home>
objectivemo: make it like this:
<mpfundstein_home>
mom
<objectivemo>
mom?
<Diranged>
need a quick hand.. i need to convet an array of strings like this [ "foo=bar", "abc=123" ] into json that looks like this: { "foo": "bar", "abc": "123" }
<Diranged>
in a ruby template btw..
<Diranged>
ive been mucking around with it.. and i can get close, but not quite there.. is there something simple im missing?
<objectivemo>
mpfundstein_home: hmmm, this looks really cool and geeky, I am just about to start chapter 4 of "The Well-Rounded Rubyist" which is all about modules, but I know exactly what you are doing here, even though I would not be able to make something like that myself now. Thanks for that
<mpfundstein_home>
whitequark: O.o good one
<Diranged>
objectivemo: thanks, looking into how i can get that into a ruby template
<objectivemo>
Diranged: np
<objectivemo>
Diranged: You really should be using a hash instead of an array though, using a hash makes life easier as there are already a lot of stuff made for it that you can just chose without reinventing the wheel
* mpfundstein_home
thinks whitequarks solution is awesome.
<mpfundstein_home>
s = [ "a=b", "c=d" ]
<mpfundstein_home>
a = Hash[s.map { |elem| elem.split('=', 2) }]
<mpfundstein_home>
puts a
<mpfundstein_home>
great
<fomatin>
hey guys, i'm just getting started with ruby/rails. i have a repo that i am trying to have working locally
emergion has joined #ruby
<fomatin>
but I'm having some trouble with the gems
<mpfundstein_home>
objectivemo: look at whitequarks solution. one line of code
<objectivemo>
I just tried it now on irb
<Diranged>
whitequark's is easier to use.. i like it..
<objectivemo>
that is fantastic, really loving ruby when you see things like that, thanks whitequarks
<mpfundstein_home>
yes
<fomatin>
i tried installing rvm, but then when i tried `rake`, it said it couldn't even find rake
<mpfundstein_home>
thats why i am so interested in ruby
<mpfundstein_home>
its functional and oop
mengu has quit [Quit: Konversation terminated!]
daniel_hinojosa has joined #ruby
<fomatin>
oh nvm, i'll try railsinstaller.org and come back again
<objectivemo>
I'm really interested in it because it is not as rigid as Java and C# (languages I use professionally). I find for instance, for me to create a unit test in those two languages, I have to create the objects and methods first before I can compile and run the tests, I don't need to do that with ruby :D
<objectivemo>
fomatin: which platform are you on? Windows, Linux or Mac?
brendan_ has quit [Remote host closed the connection]
<fomatin>
mac
tommyvyo has quit [Ping timeout: 252 seconds]
<Diranged>
thanks guys.. that second example worked perfectly
<Diranged>
its exactly what i needed
daniel_- has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
thinkclay has joined #ruby
d2dchat has quit [Remote host closed the connection]
<mpfundstein_home>
objectivemo: switch to a job where u can use ruby. we are hiring at the moment in amsterdam :-) / joking
<mpfundstein_home>
objectivemo: read "metaprogramming in ruby". it is so inspiring
<objectivemo>
mpfundstein_home: funny, I quit my job to learn ruby than ruby on rails :P
<objectivemo>
fomatin: There is a better way
d2dchat has joined #ruby
<fomatin>
objectivemo, would love to hear it :)
<mpfundstein_home>
i am not using rails atm. only sinatra with sinatra-syncrony
<fomatin>
I'm coming from node, not really familiar with ruby/rails
jgrevich has quit [Read error: Connection reset by peer]
Bosma has quit [Client Quit]
markit has left #ruby ["Konversation terminated!"]
bradleyprice has joined #ruby
daniel has joined #ruby
jgrevich_ has quit [Read error: Operation timed out]
jgrevich has joined #ruby
daniel is now known as Guest46092
<Guest46092>
i'm trying to switch to rbenv, i've done everything i can to try and remove all traces of rvm but gem install still ends up recreating ~/.rvm ??!
bigmcq77 has quit [Quit: Computer has gone to sleep.]
Guest46092 is now known as dspp
<dspp>
clear
<reppard>
dspp: do you have any leftovers in your bashrc?
<dspp>
no, im using zsh but i removed the leftovers from both zshrc and bashrc
<dspp>
ach, no i didnt
<dspp>
just found a leftover i missed
nilg has quit [Remote host closed the connection]
<reppard>
just for fun do ack rvm ~/
<reppard>
=)
alexwh_ has left #ruby ["PART #archlinux-offtopic :PRIVMSG *status :help"]
alexwh has quit [Quit: Quitting]
benlieb has quit [Quit: benlieb]
picca has quit [Remote host closed the connection]
Spaceghostc2c has quit [Excess Flood]
eka has quit [Ping timeout: 252 seconds]
x82_nicole has joined #ruby
_nitti has joined #ruby
_nitti has quit [Remote host closed the connection]
Spaceghostc2c has joined #ruby
eka has joined #ruby
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
benlieb has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
d2dchat has quit [Remote host closed the connection]
alexwh has joined #ruby
alexwh is now known as Guest90234
buibex has joined #ruby
breakingthings has quit []
melkor has joined #ruby
Guest90234 has quit [Client Quit]
<melkor>
I'm using ubuntu and I am trying to setup a rails environment. Should I just use the default packages or should I download and install a different version?
tommyvyo has joined #ruby
alanp_ has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
alanp_ has joined #ruby
alanp has quit [Read error: Connection reset by peer]
alanp_ is now known as alanp
rondale_sc_ has left #ruby [#ruby]
<melkor>
Oh, I see, the package is called 1.9.1 but the actual version is 1.9.2.
<shevy>
melkor I think the reason it has that name, 1.9.1, is because of backwards C API compatibility
jerius has quit []
<shevy>
though 1.9.2 is outdated as well :)
Goles has joined #ruby
Goles has quit [Max SendQ exceeded]
<melkor>
shevy: the package says version 1.9.3, but the ruby website says 1.9.2. My webhost is 1.9.2 so I think the best will just be to use the ubuntu default.
Goles has joined #ruby
<shevy>
wait... the ruby website says that?
<shevy>
latest source tarball URL is this: ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p362.tar.bz2
<jcrawford>
hey guys, i have a list of directory names from a ruby command, i am using .each on them now I need to figure out how to take this directory name and create a valid class name from it for instance if a directory is named php then it would try to create an object of phpArticle, any assistance on something I can read on how to do this?
Goles has quit [Remote host closed the connection]
_set has joined #ruby
<shevy>
jcrawford can you make the question shorter. you have directory named "php", string. You append "Article" to this string, so you now have string "phpArticle"
<jduan1981>
melkor: have you considered rvm or rbenv to manage different versions of ruby/rails?
<shevy>
jcrawford first problem is - classes in ruby must start with a capitalized character
<Quadlex>
jcrawford: Yes
<melkor>
jduan1981: not even a little bit.
<jcrawford>
shevy: it's that simple? then i can use string.new
<Quadlex>
jcrawford: There is a way to create an object and then "attach" an instance of a class to it
<jduan1981>
with rvm/rbenv, you can switch back and forth between different versions of ruby/rails
<melkor>
jduan1981: maybe I will try that soon, I first want to do the basics.
Spaceghostc2c has quit [Excess Flood]
<gnul0ver>
does yaml come with rails to use with irb ?
<jcrawford>
thanks
<shevy>
hmm but melkor ... the first paragraph reads "The current stable version is 1.9.3", anyway nevermind that, latest is 1.9.3p362, ruby 2.0 will not be too far away though so be prepared :)
<shevy>
jcrawford if you want a string yeah
<shevy>
you can turn the string into a constant
<shevy>
Object.const_get "bar".upcase'
<jcrawford>
actually a better idea :)
<reppard>
melkor: i think part of the basics are setting up an environment and sometimes that means a version manager
<jcrawford>
if i have dir which is a string variable such as 'php' can i do something like this
<jcrawford>
self.articles.dir << article
<shevy>
class Bar; end; bar = Object.const_get "bar".capitalize; p bar # Bar
<reppard>
its alot easier to set up a version manager now then fight with a global install later
<jcrawford>
sorry self.articles[dir] << article
samuel02 has quit [Remote host closed the connection]
<shevy>
"If most things on the menu disgust you, what on earth are you still doing at the table? The door is right over there, try not to slam it on your way out."
cloaked1 has joined #ruby
gnul0ver has left #ruby ["Leaving"]
<shevy>
"Or was it CoffeeScript we're protesting this week? Or Bundler? Oh fuck it, down with SOMETHING! YEAH!"
<shevy>
except that the bundler install way didn't work
<shevy>
rails is too large for ruby :(
mercwithamouth has joined #ruby
philcrissman has joined #ruby
<cloaked1>
New to Ruby here so apologize for the n00b question. I would like to pass the template name for an erb template to a method and then let said method render the template. However, I'm having a very difficult time getting this value to pass correctly so that the filename is correctly understood by the method. this doesn't work: def method(template); erb :template end; method(:filename)
<cloaked1>
the following also doesn't seem to work... def method(template); erb template end; method(filename)
<cloaked1>
so just not sure how to properly call this method so that it can properly use the passed argument as the filename.
sorbo_ has joined #ruby
joshman_ has quit [Quit: Computer has gone to sleep.]
jimeh has quit [Quit: Computer has gone to sleep.]
tommyvyo has quit [Quit: Computer has gone to sleep.]
<melkor>
What is a good webserver for testing ruby on rails applications? I would prefer not to instal apache on this computer.
philcrissman has quit [Remote host closed the connection]
<Quadlex>
melkor: Rails comes with WebRAT by default
<Quadlex>
Start a new Rails application and type rails server
<reppard>
i thought it was WEBrick
<lupine>
webrick, you mean?
<Quadlex>
Yes, that
<lupine>
webrat is a web mocking framework IIRC
<Quadlex>
You mean like the RIAA?
<lupine>
anyway, webrick is vaguely fine. you can always install thin or mongrel
<melkor>
great.
<lupine>
rack apps are generally not built to be run without a real web server in the way though, so keep that in mind
<lupine>
(e.g., by default, clients can set X-Forwarded-For HTTP headers, and if you don't strip them out, they'll be used to override request.request_ip)
eliqtrope has quit [Quit: Page closed]
<lupine>
that's fun to find out a month inbto running a web service with ip-based authentication
<JohnTeddy>
Why does my output_data method only output two lines to the file?
<JohnTeddy>
Shouldn't it output the entire original file?
<melkor>
wow, ruby comes with gems by defualt.
<mpfundstein_home>
JohNTeddy: can you also provide the csv's
<mpfundstein_home>
?
_alejandro has joined #ruby
<lupine>
unfortunately
tommyvyo has joined #ruby
<JohnTeddy>
mpfundstein_home: sorry, (I just updated the gist with the csv data)
mengu has joined #ruby
mengu has quit [Remote host closed the connection]
<shevy>
sometimes old code I wrote makes me angry
jenrzzz has joined #ruby
<reppard>
shevy: same here, i try not to keep it around
<mpfundstein_home>
JohnTeddy: it prints out a whole bunch of numbers
<mpfundstein_home>
JohNteddy: And crashes after a while
slainer68 has joined #ruby
<shevy>
reppard hahah yeah :D I can so relate to that...
<shevy>
right now I wonder if I should just remove it, rather than maintain it
havenn has joined #ruby
<reppard>
i'm looking at a bunch of old project euler solutions....shiver
elico has joined #ruby
<JohnTeddy>
mpfundstein_home: yes, how do I get it to dump the results into event_attendees_clean.csv ?
<reppard>
back when i did stuff like puts "Elapsed : " + (Time.new - time).to_s + " secs"
michaelhf has joined #ruby
<reppard>
instead of "Elapsed: #{Time.new - time} secs"
LennyLinux has quit [Remote host closed the connection]
<mpfundstein_home>
JohnTeddy: first you validate your input csv
<shevy>
haha
<shevy>
I still do the first a lot reppard
<objectivemo>
shevy: repaid: why make you angry, should you not feel happy at the way your progressed
<mpfundstein_home>
JohnTeddy: first you validate your input csv
dougireton has quit [Quit: Leaving.]
<mpfundstein_home>
2,11/12/08 13:23,SArah,Hankins,pinalevitsky@jumpstartlab.com,414-520-5000,2022 15th Street NW,Washington,DC,20009
jenrzzz has quit [Ping timeout: 264 seconds]
<mpfundstein_home>
invalid byte sequence in US-ASCII
<melkor>
what is a good way to download the api?
<shevy>
objectivemo hmm, there are some useful things in the old code, but I would have to refactor and fix a few things... this is the part I dislike
alexspeller has joined #ruby
<shevy>
I'd rather be in a situation where I'd never have to make any changes
<JohnTeddy>
mpfundstein_home: So something in the file is causing a problem?
<JohnTeddy>
mpfundstein_home: I validate it by putting it through more regex?
<mpfundstein_home>
this one
<mpfundstein_home>
5160,2/2/09 10:38,Dylan,Musial,dcrookes@jumpstartlab.com,,522 Detroit St,Ann Arbo,MI,
<mpfundstein_home>
he is ably to write
<mpfundstein_home>
see the last ,
<reppard>
shevy: or atleast wrote code readable enough that it wasn't a pain to change
<mpfundstein_home>
thath shouldnt be there. ther eshould be a \n
_64k has quit [Quit: _64k]
<melkor>
Found it.
AndChat|41600 has joined #ruby
<JohnTeddy>
mpfundstein_home: So the last , is causing problems?
<JohnTeddy>
I see.
<mpfundstein_home>
probably. its just a guess
moos3 has joined #ruby
<JohnTeddy>
5160,2/2/09 10:38,Dylan,Musial,dcrookes@jumpstartlab.com,814-571-1000,522 Detroit St,Ann Arbo,MI,48104
<jcrawford>
hey guys i have self.articles = {} in my init, then i am using it like this self.articles[type] << article but I am getting an error about a nilclass: site_extension.rb:104:in `block (2 levels) in read_articles': undefined method `<<' for nil:NilClass (NoMethodError)
<JohnTeddy>
That ends with a zipcode in the source file.
_64k has joined #ruby
<jcrawford>
line 104 is just that line above that has the <<
<jcrawford>
type is set to a string verified with puts type.class and puts type to make sure it was set
nwertman has joined #ruby
<mpfundstein_home>
the problem is in your
<mpfundstein_home>
clean_ methods
alexspeller has quit [Ping timeout: 252 seconds]
Tomasso has quit [Read error: Connection reset by peer]
dougireton has joined #ruby
jenrzzz has joined #ruby
danneu has joined #ruby
nomenkun has quit [Remote host closed the connection]
<mpfundstein_home>
both of them generate garbage
AndChat|41600 has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
<JohnTeddy>
I got rid of the 'p variable' stuff, and made it just variable
rjfranco has joined #ruby
<JohnTeddy>
mpfundstein_home: They clean up the zipcodes and phone numbers
mengu has joined #ruby
<JohnTeddy>
At least when I run those methods individually, they output the correct results
<mpfundstein_home>
yeah but if you command them out
<mpfundstein_home>
667 records are writing
<mpfundstein_home>
written*
jfl0wers_ has quit [Ping timeout: 244 seconds]
nwertman has quit [Ping timeout: 255 seconds]
<JohnTeddy>
'command them out', what do you mean?
<JohnTeddy>
(note, this is my biggest program I've written yet)
dmiller has quit [Remote host closed the connection]
C0deMaver1ck has quit [Remote host closed the connection]
<jcrawford>
ok figured that out but now i have another problem. I am storing the articles in a hash by type such as "php" or "ruby" so I am doing self.articles.each { |type| type.each { |article| .... } } and i have tried the longer do method as well, however when it gets to articles it see's the string php for some reason, along with the article in the type array... {"php"=>[<Article: /articles/php//2012/12/this-is-a-test>], "ruby"=>[]}
emmanuelux has joined #ruby
<JohnTeddy>
I see, I don't need to iterate
<JohnTeddy>
I made each individual method separately, and was testing it
<JohnTeddy>
thanks mpfundstein_home
michaelhf has quit [Remote host closed the connection]