piotr__ has quit [Remote host closed the connection]
<swarley>
Ah, KbReturn
Heero has quit [Quit: Leaving]
elux has joined #ruby
michaelmartinez has joined #ruby
newUser1234 has quit [Ping timeout: 255 seconds]
newUser1234 has joined #ruby
<Spooner>
swarley, #gosu is probably the best place for Chingu questions.
michaelmartinez has left #ruby [#ruby]
Rumsteak has joined #ruby
<swarley>
ah, alright.
<Spooner>
swarley, You can use the Chingu input handling. It is nicer (e.g. on_input(:return) { bleh }
Targen has quit [Read error: Connection reset by peer]
rockets has joined #ruby
bonty_ssh has quit [Remote host closed the connection]
<swarley>
Yeah, but I wanted to make a catch-all for users to do the_state.hook(:down, Button::KbReturn, Button::KbEnter) { puts "you pressed enter" }
mmitchell has joined #ruby
freerobby has quit [Ping timeout: 264 seconds]
<swarley>
But I'm sure that chingu has support for that, that I overlooked
rotham has quit [Quit: Leaving]
<Spooner>
on_input(:return, :enter) { bleh }
<Spooner>
or possibly you need to pass in an array. I don't remember right now.
<swarley>
ah. I should probably just let it use that then
Emmanuel_Chanel has joined #ruby
<Spooner>
Actually, probably is an array, so you can do: on_input([:return, :enter], :move_down)
<swarley>
Also, I was looking at Fidget and I was thinking about submitting a patch for the text that creates a string of character objects to make it delete correctly
zastern has quit [Ping timeout: 245 seconds]
mmitchell has quit [Ping timeout: 245 seconds]
classix has quit [Ping timeout: 260 seconds]
classix has joined #ruby
evenix has joined #ruby
DrCode has quit [Remote host closed the connection]
kofno has quit [Remote host closed the connection]
slainer68 has joined #ruby
Mattix has joined #ruby
jbueza has quit [Quit: Leaving.]
_veer has joined #ruby
_veer has joined #ruby
newUser1234 has quit [Remote host closed the connection]
newUser1234 has joined #ruby
kofno has joined #ruby
evenix has quit [Ping timeout: 245 seconds]
kristofers has quit []
cloke_ has joined #ruby
nari has joined #ruby
<jblack>
Hello. I'm trying to learn how to use activerecord. My learning code is at http://pastebin.ca/2355249
rickruby has joined #ruby
<jblack>
Right now I'm trying to figure out how to use a belongs_to that I have defined. I would think I could do something like... "pp Sosmanual.first.clientstate", but no such luck
elux has quit [Quit: Leaving...]
cloke has quit [Ping timeout: 264 seconds]
cloke_ is now known as cloke
whowantstolivefo has quit [Ping timeout: 252 seconds]
momomomomo has quit [Quit: momomomomo]
tylersmith has quit [Quit: tylersmith]
al3xnull has joined #ruby
<fryguy>
jblack: belongs_to needs to have a has_one or has_many on the other end for it to do what you want
newUser1234 has quit [Ping timeout: 245 seconds]
snorkdude has joined #ruby
<fryguy>
not strictly true, but going down this line of thinking will help you realize what you are doing wrong
tevio has quit [Remote host closed the connection]
elux has joined #ruby
<kaneda^>
hey all, i'm doing code academy and the question asks me to make something that sorts an array, and then reverses it if the rev flag is set to true: http://pastie.org/7443246
Xeago_ has joined #ruby
<kaneda^>
it keeps telling me it doesnt alphabetize the list if i dont give it a second param, but it seems like it ought to be
tevio has joined #ruby
slainer68 has quit [Ping timeout: 245 seconds]
rismoney has quit [Read error: Connection reset by peer]
<kaneda^>
is code academy wrong or am i making a dumb mistake somewhere?
yshh has quit [Remote host closed the connection]
idkazuma has quit [Remote host closed the connection]
<swarley>
it shouldn't reverse unless you're giving a true argument
<swarley>
the rev=false means it is false by default
<kaneda^>
right
<jblack>
fryguy: Ok. for what it's worth, I'm trying to work with an existing table that predates my employment by years.
tish has joined #ruby
<kaneda^>
swarley, the response is "Oops, try again! It looks like your method doesn't default to alphabetizing an array when it doesn't receive a second parameter."
<fryguy>
kaneda^: what's the return value of that function supposed to be
<kaneda^>
if i dont pass anything it should leave it sorted
<jblack>
what I read seems to imply that one should use belongs_to and has_one according to where one has the foreign key
<kaneda^>
fryguy, the alphabetized list if rev = false, or the reverse if rev = true
<fryguy>
kaneda^: it's not going to be returning that
<kaneda^>
fryguy, what's up with it?
<fryguy>
it's going to be returning the value of rev intsead
<swarley>
it doesn't return the array
<swarley>
it returns nil
<swarley>
[4] pry(main)> alphabetize arr
<swarley>
=> nil
<kaneda^>
swarley, it sorts in place
Xeago has quit [Ping timeout: 256 seconds]
<fryguy>
kaneda^: that doesn't make it magically return the array from the function
<kaneda^>
i didnt mean to put the puts there
<swarley>
ew
<jblack>
I found the problem. I had the wrong capitalization for the foreign key.
<kaneda^>
fryguy, it's sorted in place, i assume it's past as a pointer in reality and i can sort it in place locally and have it effect the outer reference
<fryguy>
kaneda^: right, but what is code academy expecting?
<kaneda^>
fryguy, good question
maletor has joined #ruby
<kaneda^>
it told me to rewrite the previous method, in which i simply reversed the sorting order with the comparator
elux has quit [Quit: Leaving...]
<fryguy>
kaneda^: you probably had an implicit return in the previous method
<kaneda^>
fryguy, there's such a thing in ruby?
<fryguy>
if a return value isn't specified, ruby returns the value of the last statement executed in a function
Xeago_ has quit [Remote host closed the connection]
<ccooke>
kaneda^: your current method will either return the reversed list or nil
rockets has quit [Remote host closed the connection]
<kaneda^>
keep in mind i moved the puts down a line, and that line now reads simply "alphabetize(arr)"
<ccooke>
kaneda^: because the if is the last expression in the method, and it will return nil if rev is not true
Ontolog has quit [Remote host closed the connection]
<kaneda^>
ccooke, and if i dont care about the value of the return?
<Vivekananda>
Hey everyone
<Vivekananda>
what does sortby(&:downcase) mean in ruby ?
<fryguy>
kaneda^: you might not, but it sure seems like code academy does
al3xnull has quit [Remote host closed the connection]
<ccooke>
kaneda^: you might not, but that may not be the contract that you're writing to
<kaneda^>
fryguy, ah, so that's probably it
<swarley>
that's like saying
<kaneda^>
ccooke, indeed, i'll try that
<Vivekananda>
I meant a.sortby(&:downcase)
<swarley>
sortby {|x| x.downcase }
banjara has quit [Quit: Leaving.]
<kaneda^>
yah, i just needed to return the arr, indeed, thanks guys
<swarley>
&:method is syntax sugar for doign that
<swarley>
You almost never want to modify in place
nga4 has quit [Ping timeout: 264 seconds]
<kaneda^>
just to be clear, sorting in place would change the outer reference in ruby?
<fryguy>
kaneda^: yes
<kaneda^>
k, good
<ccooke>
Vivekananda: the & operator in ruby is a shorthand for calling the to_proc method on the object
<fryguy>
which is why it's usually bad
<kaneda^>
fryguy, indeed, but it's intentional here
<Vivekananda>
ccooke: ok so now I want to read about this & operator
<Vivekananda>
:)
<ccooke>
Vivekananda: Not everything has a to_proc, but Symbols have one that sends the Symbol to the argument
<ccooke>
Vivekananda: it's magic.
<kaneda^>
the unless foo.is_a? Integer kind of syntax is really confusing, although it's meant to be straightforward
<ccooke>
Vivekananda: it really should work everywhere, bevause that would be Better.
yfeldblum has quit [Ping timeout: 245 seconds]
mattbl has joined #ruby
mikepack has quit [Remote host closed the connection]
freerobby has joined #ruby
<ccooke>
Vivekananda: but unfortunately it is magic, so it only works in a few places as syntactic sugar.
<kaneda^>
ruby is actually harder to learn if you're fluent in python, i think -_-
<swarley>
def alphabetize(array, reverse=nil) array.dup.sort {|a,b| a <=> b }.tap {|x| x.reverse! if reverse } end
<kaneda^>
arr.each do |x| <-- why not for x in foo:
<ccooke>
kaneda^: the inverse is also true
<swarley>
w00t, my overly complicated solution
<ccooke>
kaneda^: from experience :-)
<kaneda^>
ccooke, i'd imagine, yah
yfeldblum has joined #ruby
<swarley>
kaneda^, for modifies it's scope
<ccooke>
kaneda^: they *look* very similar, but really work very differently
<kaneda^>
swarley, doesnt that imply a code block, and therefore has a scope as well?
<swarley>
objects created in a for loop are brought out into the upper scope
adam12_ has joined #ruby
<swarley>
Objects created in a proc don't effect the upper scope
DarkFoxDK has quit [Read error: Operation timed out]
cmyers has quit [Read error: Operation timed out]
DarkFoxDK has joined #ruby
billy_ran_away has quit [Read error: Operation timed out]
tealmage has quit [Remote host closed the connection]
<swarley>
that looks like an i (in my browser) but I'm manipulating j as an array in the outer scope
<kaneda^>
i see, you're pushing i into the j array
jdsanders has joined #ruby
<kaneda^>
what's the j ||=[] syntax?
<swarley>
yes
tealmage has joined #ruby
<swarley>
that means if j is undefined then it should be assigned []
drPoggs has quit [Quit: Goodbye]
i_s has joined #ruby
<swarley>
or if it's value is false
<kaneda^>
nice!
<swarley>
its*
<kaneda^>
that's nifty, actually
<Vivekananda>
ccooke: I am reading all you are writing but
<swarley>
It's useful in hashes
<Vivekananda>
understanding is
<kaneda^>
bash can do that, i cant think of a way to do it in python without looking for key in dict
<Vivekananda>
so i am trying to read more about it
indyrl has joined #ruby
<swarley>
especially if you have a hash of arrays, I often do (hash[key] ||= []) << value
drPoggs has joined #ruby
<Vivekananda>
Hwo ddo I do this and not do that to change things
zomgbie has joined #ruby
billy_ran_away has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
NiteRain has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
markalanevans has quit [Ping timeout: 256 seconds]
rburton- has joined #ruby
<ccooke>
Vivekananda: heh. It's nearly 2am here, and I started on the maintenance I'm doing at 16:00. The current conference call has been going five hours, with no end in sight.
<ccooke>
Vivekananda: Sense is debatable. Sentience is doubtful.
<kaneda^>
swarley, i end up doing if(key in dict): dict[key] = initial; else: dict[key] <someop> <someval>
banjara has joined #ruby
<kaneda^>
definitely not as elegant
<fryguy>
kaneda^: use defaultdict
tealmage has quit [Ping timeout: 256 seconds]
tjbiddle_ has joined #ruby
<rawng>
say I have a 3x3 array and another array e.x. [1, 1], how can I pass the [1, 1] array to the 3x3 array an index?
<ccooke>
Vivekananda: But to answer your *question*, & is a shorthand way to tell Ruby that a method parameter must be a Proc.
<kaneda^>
fryguy, that's like foo = Hash.new(0)
<kaneda^>
yes?
<fryguy>
kaneda^: yes
Hanmac1 has joined #ruby
<ccooke>
Vivekananda: if the parameter isn't a proc, it will try to cast it to a Proc - which uses the to_proc method (just as casting to string uses to_s)
<kaneda^>
k, cool
<rawng>
3x3 array *as* an index*
<ccooke>
Vivekananda: if the object you used with & has a to_proc, all is well. If not, you get a method missing exception
<kaneda^>
fryguy, i'll end up finishing the code academy in 3 sittings, not sure what to do after that
mrsolo has quit [Quit: Leaving]
<ccooke>
Vivekananda: a nice example of the functionality is to - say - define a to_proc method on the Regexp class, then call a method with method( &/regex/ )
zomgbie has quit [Ping timeout: 264 seconds]
Hanmac2 has quit [Ping timeout: 246 seconds]
Skofo has joined #ruby
<jdsanders>
Hi folks! How can I convert a positive or negative number to a string of bits of a certain length in Ruby 1.9? In 1.8, I can just do "%0#{length}b" % num, but in 1.9 I get something like "..1101" for negative numbers
r0bby has joined #ruby
hmarr has quit []
<swarley>
rawng, array_1[array_2[0]][array_2[1]]
al3xnull has quit [Remote host closed the connection]
<rawng>
swarley: thanks
tjbiddle has quit [Ping timeout: 264 seconds]
<swarley>
no problem
dustint has quit [Read error: Operation timed out]
<jdsanders>
"%0#{length}b" % (2**length + (num + 1)) almost works, but it actually gives me a string that is length + 1 characters long, with the first character being a 1
tjbiddle_ has quit [Ping timeout: 245 seconds]
mando_ has quit [Remote host closed the connection]
<ccooke>
Vivekananda: Horrible, not actually useful but good example: "class Regexp; def to_proc; Proc.new { |obj| self.match(obj) }; end;end", then try [ "one", "two", "three" ].map &/o/
<jdsanders>
oh, looks like I can mask it off
<jdsanders>
& 2**length
kofno has quit [Remote host closed the connection]
<kaneda^>
jdsanders, +1 i think
<kaneda^>
& 2**length + 1
<kaneda^>
if you're going for 2s compliment
<jdsanders>
hmm, so here's my final solution: "%0#{length}b" % ((2**length + (num + 1)) & 2**length)
<jdsanders>
I think the +1 part is inside the parens
<jdsanders>
it seems a bit redundant
<jdsanders>
but it seems to work
<jdsanders>
i'm surprised that "%08b" would ever give a string of length 9!
<jdsanders>
that seems buggy to me
<kaneda^>
hrm, so if i define something like foo[:bar] = baz, i cannot also say foo["bar"], it must be :bar
<swarley>
jdsanders, you're expanding it :p
<ccooke>
Vivekananda: does that help slightly?
havenwood has quit [Remote host closed the connection]
<swarley>
kaneda^, yes, :bar is a different object than "bar"
<havenwood>
balr0g: I didn't read the whole stack overflow.
<balr0g>
havenwood: so i'll try the commands you told me right now...
<havenwood>
balr0g: I assume you are running latest rvm (`rvm get latest`) and have installed the reqs (`rvm requirements`)?
<kaneda^>
havenwood, when i try to run "symbol_AZ = Hash[(:a..:z).to_a.zip((1..26).to_a)]" i get an argumenterror
<kaneda^>
but code academy does not return an error
<Vivekananda>
btw when I try String.chars in pry it says #[Enumerator....] .what does this mean ?
sambio has quit []
<havenwood>
kaneda^: That works on my machine. Makes me wonder if you are using Ruby 1.9+?
krainboltgreene has joined #ruby
d2dchat has quit [Remote host closed the connection]
<kaneda^>
havenwood, i didnt realize the :foo syntax is only 1.9
<havenwood>
Vivekananda: #chars method returns an instance of the Enumerator class.
<kaneda^>
i'm using 1.8.7 right now
<havenwood>
kaneda^: Yup, unfortunately that is still an issue until 1.8 is End-of-Life'd in June.
<havenwood>
kaneda^: Switch to 2.0.0 if you can!
<kaneda^>
havenwood, good to know
<kaneda^>
havenwood, i'm just learning, so i'll start with the standard as it exists today
<kaneda^>
i still havent learned python 3 ;p
<havenwood>
kaneda^: 2.0 is the standard.
sleetdrop has quit [Quit: Computer has gone to sleep.]
f0ster has quit [Remote host closed the connection]
Domon has quit [Ping timeout: 245 seconds]
<kaneda^>
havenwood, ok
<havenwood>
kaneda^: 1.8 is deprecated. 1.9 was a very-long-running release candidate for 2.0. 2.0.0-p0 is the latest stable version of Ruby and is backward compatible with 1.9.
<kaneda^>
ah, also good to know, ty
magik- has joined #ruby
<Vivekananda>
hmm
tmiller has joined #ruby
Dreamer3 has joined #ruby
chandankumar has joined #ruby
<havenwood>
kaneda^: Yeah, 1.8 to 1.9 is a big change. 1.9 to 2.0 is smooth.
<kaneda^>
cool, 1.9+ it is
estjang has joined #ruby
estjang has quit [Remote host closed the connection]
estjang has joined #ruby
jonahR has quit [Quit: jonahR]
Astral_ has quit [Ping timeout: 256 seconds]
Astralum has joined #ruby
jonahR has joined #ruby
mattbl has joined #ruby
mattbl has quit [Client Quit]
c0rn has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Ping timeout: 276 seconds]
BSaboia has quit [Read error: Connection reset by peer]
ffranz1 has joined #ruby
Mattix has quit [Read error: Connection reset by peer]
hamakn has joined #ruby
ffranz1 has quit [Client Quit]
Mattix has joined #ruby
ffranz has quit [Ping timeout: 245 seconds]
rupee has quit [Ping timeout: 245 seconds]
zomgbie has joined #ruby
dmiller has quit [Ping timeout: 240 seconds]
subbyyy has joined #ruby
mercwithamouth has joined #ruby
freerobby has joined #ruby
d2dchat has joined #ruby
zomgbie has quit [Ping timeout: 245 seconds]
PanPan has joined #ruby
soulofpeace has joined #ruby
chipotle has joined #ruby
<balr0g>
havenwood: i executed the commands you told me... get latest, requeriments, install yaml, reinstall 2.0 ... still the same problem: http://pastebin.ca/2355282
<balr0g>
havenwood: but i think this has to be with the version of ruby... that last paste makes reference to 1.9.3 and when i executed the previous commands, all references were to 2.0.0
<rawng>
I asked a question about a using array elements as an index for another earlier
ttt_ has quit [Remote host closed the connection]
ttt_ has joined #ruby
hach has joined #ruby
<Vivekananda>
rawng: you telling me ?
unstable has joined #ruby
<lukeholder>
Vivekananda you are not passing the words into the block
<bnagy>
Vivekananda: omfg read some docs already
<rawng>
i had a 3x3 array, and did array1[array2[0], array2[1]] = string. instead of replacing the specified array element (in this case array1[1, 1]) with the string, it replaced array1[1] with three strings
tommyvyo has joined #ruby
<Vivekananda>
lol
<bnagy>
go read all of Enumerable, right now
<rawng>
Vivekananda: no
<Vivekananda>
:p
markalanevans has joined #ruby
btaitelb has joined #ruby
<Vivekananda>
bnagy: ok sorry
<lukeholder>
Vivekananda: h.each {|key, value| puts "#{key} is #{value}" }
<Vivekananda>
I guess I missing something very dumb
<rawng>
how can I place the specified object into array[1, 1] without the above behavour?
<Vivekananda>
okay reading
<bnagy>
Vivekananda: pay particular attention to map - we almost never use indicies to iterate over stuff in ruby
freerobby has joined #ruby
<Vivekananda>
bnagy: that is just a replaceble analogy there and I do know that should not use
<bnagy>
rawng: would you be able to gist / pastie some code? I'm not sure exactly what you're trying
<Vivekananda>
indices. but can easily be replaced with words.each
chandankumar has quit [Ping timeout: 245 seconds]
<rawng>
bnagy: ... I think i just figured it out. I hate how answers come to me just after typing the question...
<bnagy>
Vivekananda: so do so, poof problem solved
NataLia has joined #ruby
<rawng>
anyway i misread the output, it replaced array1[1] with one string, not three. and I think it messed up because I assigned to array1[index, index] instead of array1[index][index]
<lukeholder>
Vivekananda: thats iterating the array (no need to count the length of the array to iterate) and passing each array item (string word) into the block
<Vivekananda>
so word.downcase will work and word[0] will but
<Vivekananda>
word[x] wont
<lukeholder>
word[x] would be targeting a letter because word is a string in the block
<Vivekananda>
lukeholder: I am not needed to count the array and I know that. I am concerned with the word problem
<Vivekananda>
but I hope bnagy does not come back to tell me you are still here
<Vivekananda>
:)
nga4 has quit []
jblack has quit [Ping timeout: 256 seconds]
freakazoid0223 has quit [Read error: Operation timed out]
nga4 has joined #ruby
<bnagy>
Vivekananda: your code blows up because you off-by-one'd
<lukeholder>
Vivekananda: does that clarify?
<bnagy>
otherwise it's 'fine' it's just wrong and non-idiomatic
<Vivekananda>
so if x = 0 I say word[0] it returns "rats" but if I say word[x] it will be wrong
krainboltgreene has quit [Quit: Computer has gone to sleep.]
<right1>
it was advertised to me that sinatra was supposed to be simple enough that anyone could be a proficient user of it by skimming the docs
<right1>
ofc i havent used it so i cant say anything
Arzaga has joined #ruby
Tricon has quit [Quit: Leaving...]
NataLia has quit [Ping timeout: 256 seconds]
classix has quit [Ping timeout: 256 seconds]
jhn has joined #ruby
r0bby has joined #ruby
<Vivekananda>
lukeholder: nope. my initial element is not one string but an array of strings . Also I tried two things -- http://eval.in/15920
<Vivekananda>
have a look
zomgbie has joined #ruby
arya_ has joined #ruby
<bnagy>
Vivekananda: words.length is still going to be out of bounds, no matter how many ways you rejig it
Tricon has joined #ruby
<lukeholder>
Vivekananda: why did you post your pry output into that??
<bnagy>
you either need to do (0 ... words.length) ( note third dot ) OR NOT USE INDICIES
ant384 has quit [Ping timeout: 246 seconds]
dmiller has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
rsahae has quit [Quit: rsahae]
aemeredith has joined #ruby
<Vivekananda>
bnagy: but in the eval I posted above I am getting an output based on the index enumerator itself isnt it ?
aemeredith has quit [Read error: Connection reset by peer]
<Vivekananda>
lukeholder: sorry did not realize you needed it. I was just trying eval
tommyvyo has quit [Quit:]
aemeredith has joined #ruby
markalanevans has joined #ruby
<bnagy>
Vivekananda: I don't know how many more times I can say the same thing. If an Array is length 5, ary[5] will be nil, because indicies start at 0, so ary[4] is the last elem
mercwithamouth has quit [Ping timeout: 245 seconds]
willw00 has quit [Ping timeout: 256 seconds]
<bnagy>
you are walking off the end of your array, so ary[5] is returning nil
zorino has joined #ruby
<bnagy>
you then try nil.chars, which fails, because nil doesn't have that method
eliasp has quit [Read error: Connection reset by peer]
<bnagy>
that's why they included the crazy triple dot range
eliasp has joined #ruby
jonahR has quit [Quit: jonahR]
gr4yscale has joined #ruby
chandankumar has joined #ruby
endzyme has quit [Remote host closed the connection]
d2dchat has quit [Remote host closed the connection]
xkickflip has joined #ruby
Arzaga has quit [Quit: Computer has gone to sleep.]
michaelmartinez has joined #ruby
<Vivekananda>
bnagy if you just said this initially would have understood -- " If an Array is length 5, ary[5] will be nil, because indicies start at 0, so ary[4] is the last elem"
<Vivekananda>
or even
<Vivekananda>
"you are walking off the end of your array, so ary[5] is returning nil"
<bnagy>
have you tried messing with syntax? like describe( Validations ) or using {} ?
<kenneth>
and obj[field] contains {test: :val}
<bnagy>
oh sorry looking at the wrong file :D
veinofstars has quit [Quit: veinofstars]
<bnagy>
oh.. um.. yeah ok, so where's the block?
<kenneth>
pooh wait
<kenneth>
i just had an idea
freerobby has joined #ruby
<kenneth>
it could be a block argument not a regular argument and i need to do &opts[:with]…
<kenneth>
rubber duckie debugging lol
<kenneth>
been stuck on this since like noon :X
<kenneth>
OMG YES THAT WAS IT
<kenneth>
jesus
<kenneth>
haha thanks bnagy
<kenneth>
you're my rubber duckie
JoeTheGuest has quit [Read error: Operation timed out]
JoeTheGuest_ is now known as JoeTheGuest
chrishough has joined #ruby
<kenneth>
all my tests pass now :)
shock_one has joined #ruby
markalanevans has quit [Quit: markalanevans]
<bnagy>
how is that rubber duckie? Is was exactly what I said ;)
classix has joined #ruby
zorino has left #ruby [#ruby]
callmeivan has quit [Ping timeout: 252 seconds]
GoGoGarrett has quit [Remote host closed the connection]
rippa has joined #ruby
freeayu has joined #ruby
aemeredith has joined #ruby
aemeredith has quit [Remote host closed the connection]
malou_ has quit [Remote host closed the connection]
aemeredith has joined #ruby
mois3x has joined #ruby
freerobby has quit [Ping timeout: 245 seconds]
shevy has joined #ruby
krz has joined #ruby
hach has quit [Quit: leaving]
malou_ has joined #ruby
tylersmith has joined #ruby
GhettoCode has joined #ruby
callmeivan has joined #ruby
<gr4yscale>
hey guys, if i'm trying to write a mock server for integration testing with sinatra and i want to be able to mock out some basic JSON objects, have some pagination on some endpoints, be able to handle a multipart file upload, and serve up files…what are the best libraries to work with to date?
arya_ has quit [Ping timeout: 248 seconds]
<gr4yscale>
is datamapper still in?
tommyvyo has quit [Quit:]
<gr4yscale>
looks like sinatra will serve up files out of the box
kseifried has joined #ruby
veinofstars has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
<gr4yscale>
i'm mostly concerned with the portion where i generate JSON; i mean i can capture responses to txt files and serve up files if that method is a great deal simpler
<gr4yscale>
serve up canned responses from files*
classix has quit [Ping timeout: 256 seconds]
randomautomator has joined #ruby
classix has joined #ruby
arya has joined #ruby
<rawng>
how expensive are objects in ruby? will maintaining ~250 fairly simple objects be an unreasonable thing to do and maintain program responsiveness/ not use loads of memory?
wargasm has joined #ruby
rippa has joined #ruby
<rawng>
i'm making a simple roguelike that only processes information upon keypress for now
randomautomator has quit [Read error: Connection reset by peer]
<bnagy>
rawng: don't worry about it
aemeredith has quit [Remote host closed the connection]
<bnagy>
if you're worried about creating objects then you're using the wrong language :D
d2dchat has joined #ruby
<rawng>
hah, okay then
<bnagy>
rawng: also, you should look at celluloid
<bnagy>
mainly because I've always wished I had enough free time to write a roguelike on it :D
Skofo has quit [Quit: Leaving]
<bnagy>
it's a perfect model for that problem
<bnagy>
well ok, maybe it's not if you want it turn based...
<bnagy>
but still, it ould be so coool :)
<rawng>
hmm.. I haven't proceeded in development far enough to hit concurrency problems
<rawng>
true, it would be
jamesfung14 has quit [Ping timeout: 255 seconds]
arya_ has joined #ruby
<rawng>
the only obvious thing that jumps out is using a thread to get input, but i've already got nonblocking input worked out
michaelmartinez has joined #ruby
michaelmartinez has quit [Client Quit]
<bnagy>
nah it's the whole Actor model, you can just encode everything in the statemachines for your PC / NPCs
arya has quit [Ping timeout: 248 seconds]
randomautomator has joined #ruby
randomautomator has quit [Remote host closed the connection]
randomautomator has joined #ruby
tevio has quit [Read error: Connection reset by peer]
wesside has quit [Quit: Computer has gone to sleep.]
kushalkhandelwal has joined #ruby
tevio has joined #ruby
jonathanwallace has joined #ruby
ukd1 has joined #ruby
magik- has joined #ruby
chandankumar is now known as chandankumar|afk
eliasp has quit [Read error: Connection reset by peer]
eliasp has joined #ruby
ShonM has quit [Quit: ShonM]
Kirotan has quit [Ping timeout: 252 seconds]
marcdel has joined #ruby
r0bby has quit [Ping timeout: 245 seconds]
indyrl has quit [Quit: Leaving.]
michaelmartinez has joined #ruby
ukd1 has quit [Ping timeout: 245 seconds]
ananthakumaran has joined #ruby
d2dchat has quit [Remote host closed the connection]
echevemaster has joined #ruby
echevemaster has quit [Changing host]
echevemaster has joined #ruby
michaelmartinez has quit [Client Quit]
freerobby has joined #ruby
michaelmartinez has joined #ruby
zmanfx has quit [Ping timeout: 245 seconds]
reset has quit [Ping timeout: 245 seconds]
krainboltgreene has joined #ruby
pothibo has quit [Quit: pothibo]
rellin has joined #ruby
tomsthumb has joined #ruby
<rellin>
My brain is farting so hard. Does anyone know the name of that feature where you can append plaintext/non-ruby code at the bottom of your .rb file and open it?
shock_one has quit [Ping timeout: 256 seconds]
tmiller has quit [Remote host closed the connection]
<balr0g>
how to uninstall/remove a ruby installed by sources compilation?
mockra has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 248 seconds]
tmiller has joined #ruby
c0rn has joined #ruby
arya has joined #ruby
ph^ has joined #ruby
vlad_starkov has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
newblue has joined #ruby
tmiller has quit [Ping timeout: 256 seconds]
<balr0g>
i need help, how bas is to delete ~/.rvm/gems/ruby-2.0.0-p0/ and ~/.rvm/gems/ruby-2.0.0-p0@global/ i was trying to uninstall my ruby installation, now im getting error installing from RVM, please help!
mercwithamouth has joined #ruby
ph^ has quit [Ping timeout: 256 seconds]
aytch has quit [Read error: Connection reset by peer]
tagrudev has joined #ruby
akhet has quit [Remote host closed the connection]
kushalkhandelwal has quit [Ping timeout: 256 seconds]
aytch has joined #ruby
whowantstolivefo has joined #ruby
jdunck has joined #ruby
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
<Pierreb>
for this http://eval.in/15941 How can i save "PS" "hummina" "561" "LCNostra" "Gildarts" "299" "ResDogs" "51A/72A" into variables?
dmiller has quit [Ping timeout: 264 seconds]
ARCADIVS has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
chandankumar has quit [Quit: Leaving]
thinkclay has quit [Quit: Leaving.]
kenneth has joined #ruby
Zolo has joined #ruby
Zolo has quit [Remote host closed the connection]
StarkYang has quit [Remote host closed the connection]
braoru has joined #ruby
jhn has quit [Ping timeout: 252 seconds]
lukeholder has quit [Quit: Computer has gone to sleep.]
tootooroo has joined #ruby
KevinSjoberg has joined #ruby
newblue has quit [Quit: leaving]
aganov has joined #ruby
moted has quit [Quit: moted]
crise has joined #ruby
pyrac has quit [Quit: pyrac]
randomautomator has quit [Read error: Connection reset by peer]
crise has left #ruby [#ruby]
Domon has joined #ruby
gabrielrotbart has quit [Read error: Connection reset by peer]
<bnagy>
what do you mean by 'into variables'? How do you want to use those strings?
gabrielrotbart has joined #ruby
anonymuse has quit [Quit: Leaving...]
stacky has joined #ruby
freeayu has quit [Ping timeout: 256 seconds]
agarie has quit [Remote host closed the connection]
crise has joined #ruby
crise has left #ruby [#ruby]
gr4yscale has joined #ruby
pyrac has joined #ruby
<balr0g>
i deleted ~/.rvm/gems/ruby-2.0.0-p0/ dir, how bad is that, and how to solve that to install with RVM, please help...
pyrac has quit [Client Quit]
cha1tanya has joined #ruby
freerobby has joined #ruby
freeayu has joined #ruby
ph^ has joined #ruby
Tentra has joined #ruby
<bnagy>
balr0g: rvm has its own channel
<bnagy>
but you could try just recreating the dir and reinstalling your gems?
vlad_starkov has quit [Remote host closed the connection]
asphxia^^ has joined #ruby
dmiller has joined #ruby
freerobby has quit [Ping timeout: 252 seconds]
p8952 has quit [Quit: Leaving]
<kseifried>
anyone know of a tarantula like fuzzer that will crawl your ruby app and shove weird data into things to see how it breaks?
puppeh has joined #ruby
<bnagy>
kseifried: have you looked at flog / flay?
Gue______ has joined #ruby
<kseifried>
no, rubygems?
dmiller has quit [Ping timeout: 240 seconds]
Gue______ is now known as shellox_
<kseifried>
niiiiiiiice
<kseifried>
bnagy, : know of anything else?
<kseifried>
oh I like this
martinklepsch has joined #ruby
<bnagy>
not offhand, but you could check the other zenspider stuff
<kseifried>
ok yeah flay.. that looks useful
<bnagy>
some of the testing wonks hang out in #ruby-lang as well
<kseifried>
I'm a security wonk. tried tarantula, looks nice but it;'s out of date and semi broken :P
<kseifried>
so can't reccomend it in the article
<kseifried>
telling people about broken softaware is not so much fun
<bnagy>
you're talking about source-code manipulation, right, not actually fuzzing real interfaces?
<kseifried>
mostly yeah
<kseifried>
whatever, if it works and is good
browndawg has quit [Ping timeout: 256 seconds]
ukd1 has joined #ruby
<bnagy>
ok, that side isn't really my area :)
<kseifried>
1) writing it up for an article and 2) always looking for good tools
<kseifried>
bnagy, : so basically anything to try I'm interested in
<kseifried>
whether or not it is cost effective is another matter
yacks has quit [Read error: Connection reset by peer]
<kseifried>
like brakeman, love that shit
yacks has joined #ruby
kushalkhandelwal has joined #ruby
zodiak has quit [Ping timeout: 248 seconds]
beiter has joined #ruby
zomgbie has joined #ruby
jdunck has quit [Quit: Computer has gone to sleep.]
<Pierreb>
bnagy: i want to be able to to use the info gathered, for example relay part of it to a different channel and so on
ukd1 has quit [Ping timeout: 256 seconds]
<bnagy>
Pierreb: well you can get an array out of it with like str.squeeze.split
sivoais has quit [Ping timeout: 260 seconds]
elliot98 has quit [Quit: Konversation terminated!]
<Pierreb>
bnagy: ok thx
<bnagy>
if those are some kind of field values then you can get a Hash with Hash[ field_names.zip str.squeeze.split ]
<bnagy>
if you had field names like fields= %w( name address shoe_size favourite_fish )
zodiak has joined #ruby
<kseifried>
bnagy, : your twitter pic looks like one of my kids when I don't let him take his outside toys inside
voodoofish has quit [Ping timeout: 245 seconds]
<Pierreb>
ok ill play aroudn with it a bit
KazW has quit [Read error: Connection reset by peer]
tjbiddle has quit [Read error: Connection reset by peer]
KazW has joined #ruby
chandankumar has joined #ruby
angusiguess has joined #ruby
Elhu has joined #ruby
Elhu has quit [Client Quit]
tjbiddle has joined #ruby
aytch has quit [Remote host closed the connection]
yashshah has quit [Read error: Connection reset by peer]
yashshah_ has joined #ruby
tjbiddle has quit [Ping timeout: 245 seconds]
aemeredith has quit [Remote host closed the connection]
aemeredith has joined #ruby
dr_bob has joined #ruby
xkickflip has quit [Read error: Connection reset by peer]
Hanmac has quit [Quit: Leaving.]
xkickflip has joined #ruby
aytch has joined #ruby
kiri has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
<rawng>
if I create an object and stick it in an array without assigning a variable to it, can I later invoke that objects methods on its array index?
<rawng>
typed all that up, haven't checked for typos yet
neku has joined #ruby
samuel02 has joined #ruby
Vainoharhainen has joined #ruby
JohnBat26 has joined #ruby
Seisatsu has joined #ruby
<Seisatsu>
hi
<Seisatsu>
what's MV*
GoGoGarrett has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
Fuzai has joined #ruby
<Boohbah>
何?
Seisatsu has left #ruby ["Leaving"]
<Fuzai>
if I have an array of 10 elements and I want to take the 5th element and exchange it for the 4th element ( move it down in the queue ) is there an easy way with ruby to do this?
skroon has joined #ruby
<bnagy>
rawng: oic - yeah that code doesn't do what you think it does
<skroon>
hi
<bnagy>
rawng: you could debug this by doing p some_wall_obj.methods.include? :glyph for example
arturaz has joined #ruby
<bnagy>
rawng: I think you're probably aiming for class Wall < Gobject maybe?
malou_ has joined #ruby
<rawng>
*smacks forehead*
browndawg has joined #ruby
drPoggs has quit [Quit: Goodbye]
<rawng>
I was searching around the internet for ruby inheritance and things said to use << which ruby complained about
<rawng>
so I commented it out
aytch has quit [Ping timeout: 264 seconds]
mneorr has joined #ruby
drPoggs has joined #ruby
<bnagy>
rawng: basically Wall is its own class, and in it's initialize you create a Gobject instance and never do anything with it - so Wall is just more or less a blank Object
monkegjinni has joined #ruby
d2dchat has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
monkegjinni has joined #ruby
<rawng>
yes.. that makes sense. setting the superclass correctly now brings up some other errors with passing arguments to Gobject's constructor (if that's what you call the initialize method)
<rawng>
so I'll go hunt those now
<rawng>
thanks for all the help mate, even if it's been ridiculously simple every time
<rawng>
hrm, I've seen people overriding new in examples on the web
<rawng>
but i'll take your word for it
<rawng>
i'll take a look canton7
<bnagy>
you can, but you shouldn't ( override new )
<kenneth>
class Wall; def initialize(currentloc); super("env", "#", currentloc); end; end
<bnagy>
and new is a class method anyway
<canton7>
rawng, unless you know what you're doing, and are prepared to allocate the required memory / whatever other funky stuff you need to do, don't try and do #new's job
kornnflake has quit [Ping timeout: 255 seconds]
gadgetoid_ has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<kenneth>
eh, i guess canton7 beat me to it
<kenneth>
:p
axxT has quit [Ping timeout: 256 seconds]
<kenneth>
did a better job too, i forgot `< Gobject`
angusiguess has quit [Read error: Connection reset by peer]
<Boohbah>
rawng: i've seen goatse on the web, but that doesn't make it pretty :)
Gadgetoid has quit [Remote host closed the connection]
gadgetoid_ is now known as gadgetoid
gadgetoid is now known as Gadgetoid
angusiguess has joined #ruby
<canton7>
:P
<canton7>
I didn't spot the fact he was defining #new the first time around...
snearch has joined #ruby
swex has quit [Remote host closed the connection]
brianpWins has joined #ruby
puppeh has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
<kenneth>
i got fucked earlier because `when` is a language keyword and you can't override it as a method :(
<kenneth>
my otherwise beautiful code had to be sullied by `run_when` instead of `when`
EPIK has quit [Read error: Connection reset by peer]
estjang has left #ruby [#ruby]
crazysim has quit [Ping timeout: 256 seconds]
wesside has quit [Quit: Computer has gone to sleep.]
<rawng>
tried super, just in the wrong way. I guess i shouldn't code on so little sleep : /
EPIK has joined #ruby
fivetwentysix has quit [Read error: Connection reset by peer]
<bnagy>
rawng: super by itself will pass the exact arguments the class was given in initialize
danneu has quit [Ping timeout: 256 seconds]
tjbiddle has quit [Quit: tjbiddle]
fivetwentysix has joined #ruby
<bnagy>
if you want to pass different ones, you can, and if you want to pass no args to the superclass you have to super()
G has quit [Ping timeout: 256 seconds]
dr_bob has joined #ruby
<bnagy>
which is pretty much the only time I can think of in ruby where you should have empty parens
adam12_ has quit [Ping timeout: 256 seconds]
<kenneth>
sleepy time, night y'all
monkegjinni has joined #ruby
G has joined #ruby
crazysim has joined #ruby
bijumon has quit [Quit: Coyote finally caught me]
Neandre has joined #ruby
dr_bob has quit [Client Quit]
timmow has joined #ruby
mois3x has quit []
bijumon has joined #ruby
dawkirst has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
drale2k has quit [Quit: Leaving...]
dr_bob has joined #ruby
adam12 has joined #ruby
pi3r has joined #ruby
vlad_starkov has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
freeayu__ has joined #ruby
vlad_starkov has joined #ruby
Neandre has quit [Remote host closed the connection]
Neandre has joined #ruby
freeayu has quit [Ping timeout: 252 seconds]
Animawish has quit [Quit: Animawish]
freerobby has joined #ruby
<dawkirst>
Hello, trying to understand something fundamental. If f1 and f2 are instances of File, and I call .open on the same binary file for writing, what will happen? How is the concurrency handled?
freeayu__ has quit [Read error: Connection reset by peer]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
anderse has joined #ruby
Axsuul has quit [Ping timeout: 255 seconds]
<hoelzro>
dawkirst: do you mean f1 = File.open('foo.bin') f2 = File.open('foo.bin')?
arya has quit []
<hoelzro>
(with the write flag set, that is)
<dawkirst>
hoelzro, yes. Or even 'foo.txt'. Say that both f1 and f2 then try to call .write? At the same time.
<hoelzro>
I'm not sure if Ruby does anything on top of the standard library
<hoelzro>
either way, it's probably OS dependant
freeayu has joined #ruby
<hoelzro>
on Linux (iirc), single calls to write are atomic
<dawkirst>
hoelzro, that makes sense.
razibog has joined #ruby
snearch has quit [Quit: Verlassend]
<Hanmac1>
it also when buffing is used, depends on wich f1 or f2 is closed first
rellin has quit [Ping timeout: 240 seconds]
<dawkirst>
Then just a silly question on top of that: what is the de facto flat file persistence approach used by most Rubyists (e.g., no database, just flat files)?
mulinux has joined #ruby
ukd1 has quit [Remote host closed the connection]
<dawkirst>
I'm trying to understand the thought process more than the technical aspects, by the way.
<Hanmac1>
dawkirst: it depens on the size of the project and the amont of data
Mon_Ouie has joined #ruby
ukd1 has joined #ruby
mulinux has quit [Killed (idoru (Spam is off topic on freenode.))]
freerobby has quit [Ping timeout: 252 seconds]
<dawkirst>
Hanmac1, makes sense.
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
<bnagy>
basically, Don't Do That
maxmanders has joined #ruby
<bnagy>
dawkirst: imho people tend to use YAML for config files etc, and then 'it depends' for other persistence
lmf40 has joined #ruby
threesome has joined #ruby
<dawkirst>
bnagy, so always try to go for some sort of SQL or NoSQL persistence?
<bnagy>
if 'no database' is allowed to include 'no database server' then I use TokyoCabinet, but it;s old
droppedonmyhead has quit [Quit: droppedonmyhead]
ukd1 has quit [Ping timeout: 256 seconds]
<bnagy>
but it's got a really nice wrapper gem, and it's just to replace bdb, for me
mneorr has joined #ruby
<dawkirst>
bnagy, any newer equivalents?
* Hanmac1
uses also xml for database stuff
banjara has quit [Client Quit]
<bnagy>
well KyotoCabinet is the new one, but the API is less awesome
banjara has joined #ruby
<dawkirst>
Ok, thanks.
<bnagy>
Hanmac1: what do you use to write out XML?
tevio has quit [Remote host closed the connection]
<Hanmac1>
bnagy the builder of nokogiri
<bnagy>
dawkirst: there's also sqlite, but it's awful
banjara has quit [Client Quit]
banjara has joined #ruby
hogeo has quit [Remote host closed the connection]
skum has joined #ruby
<bnagy>
Hanmac1: hrmmm. I was trying to use nokogiri to read, modify and write out apple's XML files - but I couldn't get the writing to work
<rawng>
well, it's not much bit it's my first ruby program that does anything
<rawng>
not bad for a day or two into ruby i'd say
chandankumar has quit [Quit: Leaving]
<bnagy>
rawng: nice :)
<rawng>
if anyone runs it, it sort of misbehaves outside of 24x80 line terminals
<pi3r>
Hi, I know it's not the place, but does someone knows a little about github api ?
<bnagy>
there's lot of things 'wrong' with it, but the only thing I would worry about at this stage is getting rid of those horrible $globals
<rawng>
haha yeah
<rawng>
I'm more concerned about the architecture of the thing, but why are globals such a bad thing?
<bnagy>
rawng: the rest of the OO looks OK
<rawng>
i see that a lot in discussions
Vainoharhainen has quit [Ping timeout: 264 seconds]
tonini has quit [Remote host closed the connection]
<Fuzai>
because they make it easy for "real" coders to complain when there is nothing else to complain about :p
<bnagy>
they're just ugly, and they're usually a sign that the person who wrote the code doesn't understand about scope and visibility
<rawng>
Fuzai: zing!
whitedawg has joined #ruby
rippa has quit [Read error: Connection reset by peer]
<rawng>
mmh, fair enough
<bnagy>
so if you see globals there's almost always going to be lots more horror in store :)
enriclluelles has joined #ruby
r0bby_ has quit [Read error: Connection reset by peer]
<Fuzai>
I use a few globals and very selectively. I'm sure if I posted my usage examples i would be crucified, but for me it makes my life alot easier then trying to chase things
Proshot has joined #ruby
ehaliewicz has quit [Remote host closed the connection]
<Fuzai>
but i do avoid them as much as I can
rippa has joined #ruby
rickruby has quit [Remote host closed the connection]
kushalkhandelwal has quit [Remote host closed the connection]
<Hanmac1>
in my current code i avoid own globals at any cost ... i use "static" methods as global replacement ;P
Kirotan has quit [Ping timeout: 264 seconds]
kushalkhandelwal has joined #ruby
<dawkirst>
bnagy, what about stuff like AWS S3 via some wrapper gem?
Faris9 has quit [Quit: Faris9]
<bnagy>
dawkirst: the s3 gem is provided by amazon, and it was written by some asshat Java programmer
<bnagy>
it is awful
<bnagy>
but yeah, you could use that :) That
<bnagy>
's more a matter of 'where to put it' than 'how to persist' though
Kirotan has joined #ruby
tonini has joined #ruby
ttt_ has quit [Read error: Connection reset by peer]
ttt__ has joined #ruby
<dawkirst>
you referring to the aws-sdk gem? I guess yes: 'where to put it' is the right question.
<bnagy>
"splat" ( * ) converts between collections and argument arrays
swex has quit [Ping timeout: 256 seconds]
monkegjinni has quit [Remote host closed the connection]
<cmyers_>
hey all, I'm looking to cache some large binary artifacts on disk. I want to have integrity, not have t worry about umask and crap, and maybe have a sane strategy for expiry (but artifacts are immutable, so no dirty detection needed).
kushalkhandelwal has quit [Remote host closed the connection]
<cmyers_>
Anyone know of any libraries that do stuff like this in ruby?
kushalkhandelwal has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
<cmyers_>
(say I was writing my own impl. of gem, maven, ivy, etc - that sort of thing)
robscomputer_ has quit [Remote host closed the connection]
<Fuzai>
why not mysql binary blobs?
love_color_text has joined #ruby
entr0py_ has joined #ruby
<cmyers_>
because I don't have a database at all, this is a script.
robscomputer_ has joined #ruby
matayam has quit [Remote host closed the connection]
emka has joined #ruby
<emka>
Tjena
<Fuzai>
maybe sqlite then with binary blobs
<cmyers_>
also, the database won't scale to this size, and the artifacts are easier to pull ofver http/https
<cmyers_>
also, once the files are fetched, I want to pass their paths to other things that expect them to be on disk
thebastl has joined #ruby
<Fuzai>
how big is large?
<cmyers_>
so really what I want is libraries that will write the files, check their hashes, ensure their permissions are correct, and clean them up when teh cache gets too big.
<bnagy>
hdfs or something?
<Fuzai>
sounds pretty simple
<cmyers_>
the average artifact is probably around 1-5MB, but outliers are as big as 300MB to 2GB
freerobby has joined #ruby
<bnagy>
basically you want a filesystem abstraction, or what?
kushalkhandelwal has quit [Remote host closed the connection]
<emka>
How do I retrieve object/hash var by a string? In php I can do $object->{$my_string}
<cmyers_>
yeah, something like that. I'm glad to write it myself, just want to know if something already exists
<Fuzai>
sounds to me like you could make a simple script, and then use find -delete to kill the old objects
<cmyers_>
I've seen something like this written like 4 times before, and nobody has ever done it without terrible bugs
elaptics`away is now known as elaptics
<cmyers_>
so I'd like to reuse battle-hardened code if it is out there
niceguyjames has joined #ruby
kushalkhandelwal has joined #ruby
<bnagy>
emka: h={}; h['foo'] = 3; h['foo']
<Hanmac1>
bnagy do you know the double splat? (**) ;P
thebastl_ has joined #ruby
thebastl_ has quit [Remote host closed the connection]
<bnagy>
cmyers_: If it were me I'd look into the clustered filesystems
<bnagy>
the integrity and expiry thing I guess are the tricky bit, but one might support it
bean has quit [Read error: Connection reset by peer]
<bnagy>
and they'll have better APIs and bindings than 'normal' filesystems
<cmyers_>
I've thought about bringing a network filesystem or distributed downoad mechanism into the mix (like bittorrent between dev desktops to distribute artifacts)
pyrac has quit [Quit: pyrac]
<emka>
bnagy: and from an object?
<cmyers_>
still have to actually shove the files somewhere
ttt__ has quit [Remote host closed the connection]
<bnagy>
emka: not 100% sure what you're asking... maybe this
<cmyers_>
and it will probably have to work cross-platform - probably on windows via jruby-compete, and sane RVM setup for linux/mac
dr_bob has joined #ruby
<bnagy>
cmyers_: ok then I would definitely look into something that's above the 'normal' FS, trying to reconcile windows perms with umask etc sounds awful
thebastl has quit [Ping timeout: 264 seconds]
chussenot has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
<cmyers_>
yes, taht is the source of most bugs I've seen in previous failures
Davey has quit [Quit: Computer has gone to sleep.]
matayam has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
martinklepsch has joined #ruby
banjara has quit [Quit: Leaving.]
yann_ck has joined #ruby
banjara has joined #ruby
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
banjara has quit [Client Quit]
pcarrier has joined #ruby
kushalkhandelwal has joined #ruby
banjara has joined #ruby
<EstanislaoStan>
Hmm, maybe that isn't what I need to do. Here's an explanation of my problem. I'm programming a basic chat server. I'm using a thread to check to see if any new people have connected. I then want to make threads for each new person that will watch their Socket#accept for any new messages.
<EstanislaoStan>
But I just end up getting locked into my deepest thread, watching only one person.
<EstanislaoStan>
For new messages.
jdunck has quit [Quit: Computer has gone to sleep.]
atyz has joined #ruby
<bnagy>
sounds like basically you need an array of handler threads
<bnagy>
although, tbh, I wouldn't Thread this, I'd use select
<bnagy>
actually I wouldn't even use select, I'd use one of the million higher level gems :D
<bnagy>
join is really only for threads that will exit the program if you don't join em, and you're in an infinite loop, so that won't happen
<EstanislaoStan>
Ok.
<EstanislaoStan>
Fuzai: That would probably be the easier solution. But I'm doing this as barebones as I can because it's just a way to get better at Ruby mostly. If I really needed a chat server that looks great though.
neku has quit [Read error: Connection reset by peer]
kushalkhandelwal has quit [Remote host closed the connection]
<Fuzai>
I use em-websocket for a project
neku has joined #ruby
<Fuzai>
and it works really really well
slainer68 has joined #ruby
<bnagy>
EstanislaoStan: also, tip of the day - the construct for an infinite loop is 'loop do', no need to muck about with your x variable
<Fuzai>
honestly everything i've done with eventmachine takes the hardwork out of it while still giving you the layout that you think would work
kushalkhandelwal has joined #ruby
charliesome has joined #ruby
Pierreb has quit [Quit: Page closed]
pskosinski has quit [Ping timeout: 256 seconds]
danneu has joined #ruby
cha1tanya has joined #ruby
<Fuzai>
i've got a application that uses eventmachine to start a websocket server and an irc client in the same app to give me two ways to controll the application
<Fuzai>
and it works beautifully
<EstanislaoStan>
bnagy: Wow! That fixed it. What exactly was the problem? To me it still looks like it shouldn't work because I wouldn't think the higher level thread would be able to run with the lower level thread in an infinite loop.
robscomputer_ has quit [Ping timeout: 264 seconds]
<bnagy>
EstanislaoStan: as soon as you joined your first connect thread it stopped your main loop, waiting for that client handler to 'finish'
tealmage has joined #ruby
<bnagy>
basically you blocked your main loop
tevio has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
danneu has quit [Ping timeout: 252 seconds]
kushalkhandelwal has quit [Remote host closed the connection]
alup has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
kushalkhandelwal has joined #ruby
<EstanislaoStan>
Is it because they're both threads that it can run while its parent thread is running?
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
tealmage has quit [Ping timeout: 276 seconds]
<EstanislaoStan>
bnagy: I guess I don't quite understand threads yet.
browndawg has quit [Ping timeout: 256 seconds]
<bnagy>
EstanislaoStan: when you spawn a Thread it wanders off into the background and just does whatever it does with no further supervision
eka has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
whitedawg has quit [Quit: Leaving.]
<EstanislaoStan>
bnagy: Ok. So it's not actually inside of another thread.
browndawg has joined #ruby
camilasan has joined #ruby
<bnagy>
no, it's not. Try this: t=Thread.new { Thread.new { loop do; puts '2'; sleep 1; end }; loop do; puts '1'; sleep 2; end }
<bnagy>
then wait for a while and do t.kill ( killing the 'outer' thread )
enricllu_ has joined #ruby
stacky has quit [Ping timeout: 245 seconds]
monkegjinni has quit [Read error: Connection reset by peer]
banjara has quit [Quit: Leaving.]
dhruvasagar has joined #ruby
banjara has joined #ruby
freerobby has joined #ruby
monkegjinni has joined #ruby
yugui is now known as yugui_zzz
mneorr_ has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
enriclluelles has quit [Ping timeout: 256 seconds]
kushalkhandelwal has joined #ruby
mneorr_ has quit [Remote host closed the connection]
timmow_ has joined #ruby
mneorr_ has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
mneorr has quit [Ping timeout: 260 seconds]
andy_fc has joined #ruby
<EstanislaoStan>
bnagy: Ok. I see. Thanks!
<bnagy>
np
jgrevich has quit [Ping timeout: 260 seconds]
blacktulip has joined #ruby
andy_fc has quit [Quit: andy_fc]
jgrevich has joined #ruby
Al__ has joined #ruby
andy_fc has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
duosrx has joined #ruby
hogeo has joined #ruby
Elhu has joined #ruby
gyre007 has joined #ruby
fixl has joined #ruby
andy_fc has quit [Client Quit]
andy_fc has joined #ruby
hmarr has joined #ruby
stacky has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
mengu has joined #ruby
kushalkhandelwal has joined #ruby
jgrevich_ has joined #ruby
jgrevich has quit [Ping timeout: 256 seconds]
jgrevich_ is now known as jgrevich
adambeynon has joined #ruby
Astral_ has joined #ruby
security has joined #ruby
eskp has left #ruby [#ruby]
megha has quit [Ping timeout: 245 seconds]
kushalkhandelwal has quit [Remote host closed the connection]
security is now known as megha
kushalkhandelwal has joined #ruby
Astralum has quit [Ping timeout: 264 seconds]
echevemaster has quit [Quit: Leaving]
rdark has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
daemoen has quit [Ping timeout: 240 seconds]
DrCode has joined #ruby
casheew has quit [Read error: Connection reset by peer]
smt has joined #ruby
daemoen has joined #ruby
blaxter has joined #ruby
btaitelb has quit [Quit: btaitelb]
casheew has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
keymone_ has joined #ruby
ttt has joined #ruby
kushalkhandelwal has joined #ruby
postmodern has quit [Quit: Leaving]
robustus has quit [Ping timeout: 276 seconds]
Gadgetoid has quit [Ping timeout: 245 seconds]
zomgbie has joined #ruby
freerobby has joined #ruby
matayam has quit [Remote host closed the connection]
robustus has joined #ruby
Guedes has quit [Ping timeout: 256 seconds]
gregorg has quit [Quit: Quitte]
ngcazz has joined #ruby
Gadgetoid has joined #ruby
bonty_ssh has quit [Remote host closed the connection]
maxmanders has joined #ruby
chipotle has quit [Quit: cya]
freerobby has quit [Ping timeout: 256 seconds]
greenarrow has quit [Quit: IRC is just multiplayer notepad]
Zai00 has joined #ruby
gyre008 has joined #ruby
razibog has quit [Quit: Leaving.]
greenarrow has joined #ruby
gyre007 has quit [Ping timeout: 256 seconds]
kushalkhandelwal has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
<emka>
´/j rails
rezzack has quit [Quit: Leaving.]
coderhut has joined #ruby
kushalkhandelwal has joined #ruby
quazimodo has joined #ruby
brianpWins has quit [Quit: brianpWins]
pcarrier has quit [Ping timeout: 276 seconds]
ananthakumaran has quit [Ping timeout: 256 seconds]
ananthakumaran has joined #ruby
pcarrier has joined #ruby
love_color_text has quit [Remote host closed the connection]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
dopie has joined #ruby
<dopie>
Greetings Earth citizens
shreya has joined #ruby
ttt has quit [Remote host closed the connection]
RagingDave has joined #ruby
jlebrech has joined #ruby
<EstanislaoStan>
Hello.
tonini has quit [Remote host closed the connection]
<shreya>
Hi . I have a table named concept in my mysql database. What should my class A be named , where I will do class A < ActiveRecord::Base ? Please help
marcdel has quit []
<EstanislaoStan>
Is it possible to change the name of a windows command prompt using ruby without downloading a Gem?
kushalkhandelwal has quit [Remote host closed the connection]
kushalkhandelwal has joined #ruby
cha1tanya has quit [Ping timeout: 264 seconds]
<dopie>
I have a question, is there already a site where users can upload images and then i select the pictures that the users upload and post it on the web
<Fuzai>
?
<Fuzai>
like imgur?
<dopie>
hold on
<elaptics>
shreya: your table needs to be called "concepts" to call the class Concept. Otherwise you have to set the table name specifically in the class (which can then be named whatever)
<dopie>
hmmm i guess... buti wold want them to upload the images to a certain account than i approve it and then have it shown on a specific website
casheew has quit [Read error: Connection reset by peer]
Gue______ has joined #ruby
<shreya>
elaptics: Ok, Ill look at that
casheew has joined #ruby
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
<elaptics>
shreya: iirc you set the table name in the class with self.table_name = "concept"
<shreya>
ok thanks :)
matayam has joined #ruby
<EstanislaoStan>
I have a chat client and server that I wrote, but the amount of time it takes my server to update a text response for and relay it to all the clients seems absurd. I am running multiple threads, but I still feel like it should be faster. http://pastie.org/7452145
KevinSjoberg has joined #ruby
gyre008 has quit [Remote host closed the connection]
<shreya>
elaptics: and what if I need multiple tables in my query ?
monkegjinni has joined #ruby
atr has joined #ruby
nomenkun_ has joined #ruby
<elaptics>
shreya: that's nothing to do with setting the table names. Once you have set that up and have your active record objects then you just use the AR query interface to construct the queries
<shreya>
ok
nomenkun has quit [Read error: Operation timed out]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
freerobby has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
Fuzai has quit [Remote host closed the connection]
F1skr has joined #ruby
hogeo has quit [Ping timeout: 256 seconds]
Al__ has quit [Quit: Al__]
freerobby has quit [Ping timeout: 252 seconds]
rking1 has joined #ruby
rking has quit [Quit: WeeChat 0.4.0-rc1]
rking1 is now known as rking
<elaptics>
shreya: you're better to use the active record methods because it'll help minimise sql injection, etc
monkegji_ has quit [Read error: Connection reset by peer]
<elaptics>
for example, escaping the user inputs like from params - which I'm guessing is coming from user input
Al__ has joined #ruby
whitedawg has joined #ruby
andy_fc has quit [Quit: andy_fc]
<elaptics>
shreya: is this a rails app you're talking about here?
monkegjinni has joined #ruby
<shreya>
elaptics: apologies but I am new to rails . Can it be done in such a complex query ? And no , its a webapp in which we plan to use rails to handle get calls from ui , then return results after querying from the db
<elaptics>
shreya: the #rubyonrails channel is probably a more appropriate place to discuss rails specific things but yes, it can handle queries like you have there
<Dreamer3>
hmmm
EstanislaoStan has quit []
<Dreamer3>
what methods does ruby have to figure out your running context?
camilasan has quit [Remote host closed the connection]
jgrevich has quit [Remote host closed the connection]
Amnesthesia has left #ruby [#ruby]
Proshot has joined #ruby
emka has quit [Quit: emka]
lkba has joined #ruby
<withnale>
I'm trying to use ruby to hand over to a ssh session...
<withnale>
I want to run exec("ssh -t hostname CATALINA_HOME=/var/tmp/path exec /bin/bash -il")
<Hanmac1>
hm is there a nice way to hide some modules from the ancestor list?
anderse has quit [Quit: anderse]
<withnale>
It works but it doesn't provide the environment variable. If I do the same line on the command line, I have access to the CATALINA_HOME variable
<hoelzro>
Hanmac1: sounds confusion-inducing.
<withnale>
Any ideas how I can resolve this?
<hoelzro>
withnale: I don't think that the command passed to ssh is executed via a shell
<Hanmac1>
hoelzro like i use some chain { def abc; end } stuff that makes anoymous modules, defines the methods into them, and than prepend them to the class ... but the bad thing is that they appear in klass.ancestor ... which i do not want so :/
monkegjinni has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
<Hanmac1>
for sample the entire test case ;P .. but i think the "test_changed_events" is the most interesting part
kushalkhandelwal has quit [Ping timeout: 245 seconds]
thebastl has joined #ruby
PanPan has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931]]
tvw has quit []
tonini has joined #ruby
<celinedior>
hi everyone. dumb question: how to mass assign params via console in rails 4? got this mass assigment warning without 'attr_accsessible' and deprecation warning with it
craig has joined #ruby
<craig>
Hi all, How stable is Ruby 2.0?
sk87 has joined #ruby
sk87 has left #ruby [#ruby]
chussenot has quit [Quit: chussenot]
AndChat| has joined #ruby
d34th4ck3r has joined #ruby
<JonnieCache>
stable in terms of not crashing?
ereslibre has joined #ruby
ereslibre has quit [Changing host]
ereslibre has joined #ruby
ereslibre has quit [Client Quit]
<JonnieCache>
its been fine for me, and ive got heard anyone else complaining
<JonnieCache>
*not heard
<craig>
Is it compatible with most gems?
<JonnieCache>
yes afaik
<craig>
great
<JonnieCache>
its a much smaller change than 1.8 -> 1.9
<JonnieCache>
despite the major version number change
<craig>
Good, I use 1.9.3 now but im about to start a new project for a client and its going to be large so im wanting to start as up to date as possible
ereslibre has joined #ruby
freerobby has quit [Ping timeout: 252 seconds]
ereslibre has quit [Changing host]
ereslibre has joined #ruby
<JonnieCache>
2.0 is a good idea especially for large projects because it loads much faster
Banistergalaxy has quit [Ping timeout: 245 seconds]
<craig>
Great, I will use that then. Thanks for your help
monkegjinni has quit [Read error: Connection reset by peer]
<JonnieCache>
i mean obviously it is new so you should be slightly careful
<JonnieCache>
but i imagine you will be fine
<craig>
Yeah its going to be a while until its a fully live project so hopefully by then any bugs are ironed out anyway
monkegjinni has joined #ruby
atr has quit [Ping timeout: 248 seconds]
Domon has quit [Remote host closed the connection]
craig has quit [Quit: Page closed]
nari has quit [Ping timeout: 245 seconds]
nalaginrut_ has joined #ruby
threesome has quit [Read error: Operation timed out]
butblack has quit [Ping timeout: 252 seconds]
Al__ has quit [Quit: Al__]
glitch273 has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
glitch273 has left #ruby ["Leaving"]
atno has joined #ruby
mmitchell has joined #ruby
whitedawg has quit [Quit: Leaving.]
maxmanders has joined #ruby
d34th4ck3r has quit [Ping timeout: 276 seconds]
nalaginrut has quit [Ping timeout: 245 seconds]
Al__ has joined #ruby
atr has joined #ruby
monkegjinni has quit [Remote host closed the connection]
maxmanders has quit [Quit: Computer has gone to sleep.]
thibauts has joined #ruby
mmitchell has quit [Ping timeout: 264 seconds]
maxmanders has joined #ruby
ttt has quit [Remote host closed the connection]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
evenix has joined #ruby
jonahR has joined #ruby
kleini1073 has joined #ruby
jonahR has quit [Client Quit]
Gue______ has joined #ruby
Al__ has quit [Quit: Al__]
chandankumar has joined #ruby
Al__ has joined #ruby
kleini1073 has quit [Remote host closed the connection]
chussenot has joined #ruby
Xeago has joined #ruby
maligree has joined #ruby
rickmasta has quit [Quit: Leaving...]
threesome has joined #ruby
arya has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
girija has joined #ruby
vlad_starkov has joined #ruby
tonini has quit [Remote host closed the connection]
hmarr has quit [Ping timeout: 252 seconds]
hmarr has joined #ruby
angusiguess has quit [Ping timeout: 245 seconds]
kofno has joined #ruby
yshh has quit [Remote host closed the connection]
freerobby has joined #ruby
yann_ck has quit [Quit: Computer has gone to sleep.]
_2abou_samra is now known as crassus
andikr has quit [Read error: Operation timed out]
pac1 has joined #ruby
atr has quit [Ping timeout: 264 seconds]
andikr has joined #ruby
ereslibre has quit [Quit: ereslibre]
soulofpeace has quit [Ping timeout: 276 seconds]
monkegjinni has joined #ruby
martinklepsch has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 256 seconds]
sleetdrop has quit [Ping timeout: 264 seconds]
tvw has joined #ruby
camilasan has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
emka has joined #ruby
supergiantrobot has quit [Read error: Connection reset by peer]
kushalkhandelwal has joined #ruby
arya has quit [Ping timeout: 248 seconds]
atr has joined #ruby
chandankumar is now known as chandankumar|col
pyrac has joined #ruby
unflores has joined #ruby
drale2k has joined #ruby
beiter_ has joined #ruby
Gue______ is now known as shellox
arya has joined #ruby
beiter has quit [Ping timeout: 255 seconds]
beiter_ is now known as beiter
d34th4ck3r has joined #ruby
fivetwentysix has quit [Ping timeout: 256 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
lmf40_ has joined #ruby
devyn has quit [Ping timeout: 276 seconds]
lmf40 has quit [Ping timeout: 264 seconds]
neku has quit [Read error: Connection reset by peer]
devyn has joined #ruby
neku has joined #ruby
gyre007 has joined #ruby
rawng has quit [Quit: WeeChat 0.4.1-dev]
tonini has joined #ruby
rcs is now known as Guest
Guest is now known as 16SAA533U
cantonic_ has joined #ruby
chrisja has joined #ruby
slainer68 has joined #ruby
tealmage has joined #ruby
cantonic has quit [Ping timeout: 255 seconds]
cantonic_ is now known as cantonic
pskosinski has joined #ruby
heliumsocket has joined #ruby
emka has quit [Quit: emka]
haxrbyte has quit [Read error: Connection reset by peer]
pi3r has quit [Quit: Leaving]
haxrbyte has joined #ruby
tealmage has quit [Ping timeout: 276 seconds]
divout has quit [Remote host closed the connection]
tonini has quit [Ping timeout: 248 seconds]
Elhu has joined #ruby
chase-work has quit [Quit: Computer has gone to sleep.]
<hoelzro>
sorry; I just got back from holiday and I have a lot of catching up to do =/
zomgbie has quit [Read error: Connection reset by peer]
pi3r has joined #ruby
haxrbyte_ has quit [Ping timeout: 256 seconds]
tommyvyo has quit [Client Quit]
solidoodlesuppor has joined #ruby
mark_locklear has joined #ruby
BizarreCake has joined #ruby
tommyvyo has joined #ruby
lessless_ has quit [Remote host closed the connection]
peta_ has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
love_color_text has quit [Read error: Connection reset by peer]
tommyvyo has quit [Client Quit]
d34th4ck3r has quit [Quit: Konversation terminated!]
icrazyhack has joined #ruby
andikr has quit [Ping timeout: 240 seconds]
kushalkhandelwal has quit [Ping timeout: 256 seconds]
gommo has joined #ruby
gommo has quit [Remote host closed the connection]
shreya_ has joined #ruby
shreya has quit [Ping timeout: 245 seconds]
jetblack has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
EPIK has quit [Ping timeout: 252 seconds]
carloslopes has joined #ruby
kushalkhandelwal has joined #ruby
jonahR has joined #ruby
jonahR has quit [Client Quit]
haxrbyte has joined #ruby
divout has joined #ruby
geekbri has joined #ruby
rickmasta has joined #ruby
angusiguess has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
maxmanders has joined #ruby
haxrbyte has quit [Remote host closed the connection]
monkegjinni has quit [Read error: Connection reset by peer]
atr has quit [Ping timeout: 245 seconds]
moos3 has joined #ruby
monkegjinni has joined #ruby
JeanMertz has quit [Read error: Operation timed out]
krawchyk has joined #ruby
coderhut has quit [Quit: Page closed]
chandankumar|col is now known as chandankumar
monkegjinni has quit [Read error: Connection reset by peer]
k610 has joined #ruby
supergiantrobot_ has joined #ruby
monkegjinni has joined #ruby
ARCADIVS has quit [Quit: WeeChat 0.3.8]
ngcazz has quit [Ping timeout: 245 seconds]
yshh has joined #ruby
Anarch has joined #ruby
wedgeV has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
kpshek has joined #ruby
heliumsocket has quit [Quit: heliumsocket]
lolmaus has joined #ruby
krz has quit [Quit: krz]
moos3 has quit [Quit: Computer has gone to sleep.]
dummies_freelanc has joined #ruby
yshh has quit [Ping timeout: 264 seconds]
KazW has quit [Quit: Later all!]
<lolmaus>
I would like to cycle through each character in a string and replace some of them. Is it possible to make .each_char not return a copy of a character but pass a refernce to an existing character so that i can modify it directly?
andy_fc has quit [Quit: andy_fc]
monkegjinni has quit [Ping timeout: 264 seconds]
<hoelzro>
lolmaus: I think you could use gsub with a block
lolmaus has quit [Read error: Connection reset by peer]
roflmaus has joined #ruby
jnoob22 has joined #ruby
Czupa has joined #ruby
tealmage has joined #ruby
tmiller has joined #ruby
tealmage has quit [Remote host closed the connection]
<rickmasta>
I want to check if a date is part of this week, or the next. What would be the ideal way of doing that?
<rickmasta>
Oh I guess I could do if datea.cweek == Time.now.cweek
alexhanh_ has quit [Remote host closed the connection]
xpen has joined #ruby
v0n has joined #ruby
andy_fc has joined #ruby
andikr has joined #ruby
paper_ has quit [Remote host closed the connection]
workmad3 has joined #ruby
sambao21 has joined #ruby
tootubular has joined #ruby
freerobby has joined #ruby
rudisimo has joined #ruby
jpcamara has joined #ruby
dhruvasagar has joined #ruby
justsee has quit [Ping timeout: 240 seconds]
<roflmaus>
>> "A quick brown fox jumps over the lazy dog.".gsub!(/./) { |char| (char.next if (char.downcase >= "a" and char.downcase <= "z")) or char }
leeder-krenon has quit [Read error: Connection reset by peer]
yashshah_ has quit [Ping timeout: 260 seconds]
yashshah- has joined #ruby
yshh has joined #ruby
andy_fc has quit [Quit: andy_fc]
freerobby has joined #ruby
cmarques has joined #ruby
<mklappstuhl>
I want to pass the exact start and end time of a day to a function ideally based on a previous input like Date.today or Date.new(2012,1,1)
monkegjinni has quit [Remote host closed the connection]
browndawg has joined #ruby
hmarr has joined #ruby
<mklappstuhl>
How would I go about that
monkegjinni has joined #ruby
io_syl has joined #ruby
_nitti has joined #ruby
akashj87 has joined #ruby
daddycat has quit [Read error: Operation timed out]
havenwood has joined #ruby
daddycat has joined #ruby
ananthakumaran1 has joined #ruby
ariedler has joined #ruby
csaunders has joined #ruby
pioz has joined #ruby
csaunders has left #ruby [#ruby]
andy_fc has joined #ruby
ananthakumaran has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
sambao21 has joined #ruby
Matip has joined #ruby
v0n has quit [Ping timeout: 245 seconds]
andy_fc_ has joined #ruby
andy_fc has quit [Read error: Connection reset by peer]
andy_fc_ is now known as andy_fc
braoru has quit [Quit: Leaving]
freeayu has quit [Read error: Connection reset by peer]
freerobby has quit [Ping timeout: 264 seconds]
kushalkhandelwal has quit [Ping timeout: 256 seconds]
hiyakashi has joined #ruby
sambao21 has quit [Ping timeout: 245 seconds]
Mattix has quit [Ping timeout: 252 seconds]
Guest34980 has quit [Changing host]
Guest34980 has joined #ruby
Guest34980 is now known as z
kpshek has quit []
elux has joined #ruby
ariedler has quit [Remote host closed the connection]
megha has quit [Ping timeout: 255 seconds]
dummies_freelanc has quit [Ping timeout: 256 seconds]
puppeh has quit [Remote host closed the connection]
<shevy>
Hanmac1 I need working, good GUI bindings for ruby
interactionjaxsn has joined #ruby
angusiguess has joined #ruby
adamjleonard has joined #ruby
<Hanmac1>
shevy that mean you want me to work and document with rwx again?
spanner has joined #ruby
freerobby has joined #ruby
failshell has joined #ruby
puppeh has joined #ruby
dummies_freelanc has joined #ruby
chrishunt has quit [Quit: ZzZzZz...]
<shevy>
Hanmac1 dont need docu, just working examples
megha has joined #ruby
<shevy>
that way I learned ruby-gnome
chrishunt has joined #ruby
<shevy>
but I can no longer compile ruby-gnome :(
<shevy>
fxruby died, qtruby is unusable... tcl/tk is an ugly pile of ...
<Hanmac1>
ther are some working samples in rwx ... but not enough
rking has quit [Quit: BRB rebooting IRC]
Hanmac has quit [Quit: Leaving.]
DrCode has quit [Ping timeout: 276 seconds]
Hanmac has joined #ruby
Kruppe has joined #ruby
rking has joined #ruby
daddycat has quit [Quit: daddycat]
pduin has quit [Remote host closed the connection]
puppeh has quit [Remote host closed the connection]
ph^ has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
ph^ has joined #ruby
sambao21 has joined #ruby
sambao21 has quit [Client Quit]
mechcozmo has joined #ruby
ph^ has quit [Remote host closed the connection]
<mechcozmo>
Hello, is there a better way to search through a file than to go line-by-line and see if it matches a regex?
codecop has quit [Read error: Connection reset by peer]
heliumsocket has quit [Quit: heliumsocket]
<ericwood>
grep
<ericwood>
but that's basically what it does
sambao21 has joined #ruby
<ericwood>
regex is quite fast, though
<shevy>
ok Hanmac
msch has quit [Ping timeout: 256 seconds]
<shevy>
why are there two Hanmacs
monkegjinni has quit [Remote host closed the connection]
veinofstars has joined #ruby
<shevy>
Hanmac1 you need to add docu, even if it is only little. better to document 5% than 0% :D
DrCode has joined #ruby
<mechcozmo>
ericwood: I'm doing this project to help (re)learn ruby, I know I could bash together something with grep and awk
NiteRain has joined #ruby
<mechcozmo>
**probably
<ericwood>
ah
kpshek has joined #ruby
frem has joined #ruby
<ericwood>
yeah, regex is fast, so linearly searching the file isn't as bad as you think
<ericwood>
there's probably a more clever solution
Muz has quit [Ping timeout: 256 seconds]
_nitti has quit [Remote host closed the connection]
<Hanmac1>
shrvy thats why i asked you about docu but you said that you like samples more
rking has quit [Quit: Sorry about all the quit-noise. Still migrating to new VPS]
crodas has quit [Ping timeout: 248 seconds]
<Hanmac1>
shevy the other one is my Home PC waiting for me
rking has joined #ruby
monkegjinni has joined #ruby
allure has joined #ruby
allure has quit [Changing host]
allure has joined #ruby
<shevy>
Hanmac1 samples are better, yeah, but I mean like something like an "overview" for your project
<mechcozmo>
I also have to search the file for multiple things; Title, Subhead, Credit, etc.
<shevy>
at that github page, there is not even a README for instance
love_color_text has quit [Remote host closed the connection]
mklappstuhl has quit [Read error: Operation timed out]
crodas has joined #ruby
h8R has quit [Quit: Leaving]
ariedler has joined #ruby
Muz has joined #ruby
<mechcozmo>
Would it be better/faster to slam it into a single line (remove all line breaks)? The files are pretty simple HTML and Classic ASP.
jtharris has joined #ruby
<Hanmac1>
shevy you are wrong, there is a README at github, but without content ;P
mulinux has joined #ruby
<mechcozmo>
So I could run multiple Regexs (Regexii? whatever) on the single chunk of text
mneorr_ has quit [Remote host closed the connection]
haxrbyte has quit [Remote host closed the connection]
pcarrier has quit [Quit: Computer has gone to sleep.]
<hoelzro>
regexen ;)
<momomomomo>
well
<hoelzro>
mechcozmo: try benchmarking
<momomomomo>
include? works great
haxrbyte has joined #ruby
mulinux has left #ruby [#ruby]
<momomomomo>
but, I'm currently debating whether or not to use something else, since I want to fuzzy match individual groupings of words
monkegjinni has quit [Remote host closed the connection]
<momomomomo>
for a similar project, mechcozmo
<mechcozmo>
hoelzro: I may not care that much, we'll see :-P
<shevy>
Hanmac1 :P
<momomomomo>
is this user / web input mechcozmo? I'd make sure to escape it before working with it...
phasma has quit [Ping timeout: 240 seconds]
monkegjinni has joined #ruby
fcoury_ has quit [Ping timeout: 260 seconds]
<mechcozmo>
momomomomo: No, this is all static text
<momomomomo>
right, from a file that someone else made? mechcozmo
<andrew12>
is there any simple library to do 2d animations? i want something SIMPLE. I'm basically making a rectangle for each row on the screen, trying to visualize different sorting algorithms. I tried shoes but it's really slow...
_nitti has joined #ruby
entr0py_ has quit [Ping timeout: 252 seconds]
<mechcozmo>
momomomomo: It's content from an old web site that the database has since been lost. I'm pulling it down and cleaning it up so it can be put back in to a simple database (SQLite) and eventually on to something else (via another script, via API calls)
browndawg has joined #ruby
fcoury__ has joined #ruby
aganov has quit [Read error: Connection reset by peer]
<mechcozmo>
I'm 110% confident that there won't be any issues with malicious data momomomomo, and 'accidentally' bad data will be rejected along the way by APIs that filter.
<andrew12>
I tried that one, it seemed to be slower than shoes
acrussell has joined #ruby
wesside has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
<momomomomo>
if you just want certain parts of the html
ffranz has joined #ruby
<andrew12>
probably because I had to make a new Gosu::Image, an RMagick::Image, and an RMagick::Draw each frame… if I didn't it would overwrite what was already on the screen
Roa has quit [Ping timeout: 245 seconds]
<mechcozmo>
momomomomo: It's ASP-flavoured HTML
monkegjinni has quit [Remote host closed the connection]
woolite64__ has quit [Read error: Connection reset by peer]
<mechcozmo>
momomomomo: Does it still work with that?
wesside has quit [Client Quit]
tonini has quit [Read error: Connection reset by peer]
k3rn3lito has quit [Ping timeout: 240 seconds]
woolite64__ has joined #ruby
chandankumar has quit [Quit: Leaving]
<momomomomo>
I don't know what that means, but nokogiri will parse it as xml if you want - and/or you can use loofah to remove or escape unknown tags
<mechcozmo>
ASP is another programming language
Roa has joined #ruby
<momomomomo>
of course
<peta_>
I noticed that when I do something like ::SomeModule ruby looks for SomeModule in the root namespace. Is this correct?
<momomomomo>
I don't know what the 'asp-flavored html' looks like.
<peta_>
Where can I find an official documentation about this trick? Is there a special name for it?
<momomomomo>
right. require 'foo' … y = Foo::SomeMethodInFoo(some_variable_for_the_method)
csmrfx has quit [Ping timeout: 264 seconds]
paper_ has quit [Remote host closed the connection]
markalanevans has joined #ruby
andy_fc has joined #ruby
jerius has joined #ruby
frem has joined #ruby
F1skr has joined #ruby
Caelum has joined #ruby
supergiantrobot_ has joined #ruby
keymone_ has joined #ruby
Zai00 has joined #ruby
nanothief has joined #ruby
mfridh has joined #ruby
AllStruck has joined #ruby
martxel has joined #ruby
smt has joined #ruby
beasty_ has joined #ruby
mpajor_op5 has joined #ruby
v2px has joined #ruby
txdv has joined #ruby
elaptics has joined #ruby
mose has joined #ruby
randym_ has joined #ruby
mantovani has joined #ruby
speakingcode-wor has joined #ruby
jrabbit has joined #ruby
katherinem13 has joined #ruby
Nom- has joined #ruby
matrixise has joined #ruby
<shevy>
'"global scope" just means the constant is defined on the Object class. So ::SomeModule is shorthand for Object::SomeModule'
<peta_>
last night I stumbled a strange particularity that I am trying to explain to myself now
csmrfx has joined #ruby
sawamur has joined #ruby
cbot_ has joined #ruby
<momomomomo>
erm sorry, make that some class in foo
Caelum has quit [Max SendQ exceeded]
paper has joined #ruby
Caelum has joined #ruby
tonini has quit [Remote host closed the connection]
<peta_>
momomomomo: aah…exactly this is what I found out
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
kaichanvong has quit [Ping timeout: 252 seconds]
moos3 has joined #ruby
<momomomomo>
yep - shevy 's link explains it well
<shevy>
peta_ hmm I dont use ::Foo myself often
<peta_>
okay then. (I am compiling a brief blog post about it and just wanted to make sure that I didn't oversee something important)
pioz has quit [Quit: This computer has gone to sleep]
<shevy>
Hanmac, do you use ::Foo often?
kaichanvong has joined #ruby
<momomomomo>
lol peta_ you're teaching people about this specifically, and you're not sure of how it works?
hamed_r has quit [Ping timeout: 260 seconds]
<momomomomo>
please make sure that it's not misleading / misinforming!
pioz has joined #ruby
<peta_>
shevy: I can't think of many use cases for it neither … but my app broke laste night because of a sideeffect caused by this. So knowing about it helps me in the future
paper has quit [Read error: Connection reset by peer]
paper has joined #ruby
malcolmva has joined #ruby
mklappstuhl has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
mneorr has joined #ruby
sawamur has quit [Remote host closed the connection]
yeban has quit [Ping timeout: 260 seconds]
flowerhack has quit [Ping timeout: 255 seconds]
moshef has joined #ruby
joshwines_ has quit [Ping timeout: 240 seconds]
<peta_>
momomomomo: hehe … not really. I know that it works and that a post about it might eventually save another Ruby noob soul in the future. I just wanted to make sure that the "::" prefix could really be explained as "shortcut to the global scope"
andikr has quit [Remote host closed the connection]
platzhirsch has joined #ruby
<platzhirsch>
When does one normally require 'rubygems' ?
mneorr has quit [Ping timeout: 245 seconds]
backjlack has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
asteve has joined #ruby
elaptics`away is now known as elaptics
<peta_>
platzhirsch: For working with the RubyGems platform or for automagically resolving/downloading/installing dependencies
<peta_>
(someone blame me if i am wrong)
<havenwood>
platzhirsch: In 1.8 you'd have to always `require 'rubygems'`, now you don't.
<platzhirsch>
ah ok
<peta_>
oops
<Hanmac1>
platzhirsch: with 1.9 rubygems is normaly requrid per default, but you can deactivate it if you want
love_color_text has joined #ruby
mneorr has joined #ruby
mikecmpbll has quit [Ping timeout: 256 seconds]
<platzhirsch>
good, then I will throw this line out, just following an API tutorial
jlast has joined #ruby
mneorr has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
MissionCritical has joined #ruby
carlyle has joined #ruby
jpfuentes2 has joined #ruby
danslo has quit [Quit: danslo]
dhruvasagar has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<asteve>
what's the proper way to close an open file?
<asteve>
f = File.open("file", 'r').read; template = ERB.new(f); do I need an f.close?
<MrZYX>
pass a block to the open call or call #close on the return value of open
<apeiros>
Joel: don't google. use proper docs. e.g. ri (shell), rdoc.info or ruby-doc.org
dhruvasagar has quit [Ping timeout: 258 seconds]
markalanevans has quit [Quit: markalanevans]
momomomomo has quit [Ping timeout: 264 seconds]
tomsthumb has joined #ruby
<Joel>
...
crazymykl has quit [Remote host closed the connection]
momomomomo has joined #ruby
carloslopes has quit [Remote host closed the connection]
<mechcozmo>
momomomomo: loofah doesn't help me
<momomomomo>
what's going on?
pyrac has joined #ruby
<mechcozmo>
parsing out bits from an ASP-flavored HTML document
<momomomomo>
and the issue?
<mechcozmo>
You linked me to loofah, but I don't have a sanitization issue.
jekotia has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
mneorr has quit [Ping timeout: 256 seconds]
crazymykl has joined #ruby
<momomomomo>
if you wanted to remove extraneous tags, you can use loofah
<momomomomo>
otherwise, use nokogiri to parse xml
<momomomomo>
or to parse the page as http
<momomomomo>
whichever you like
<mechcozmo>
I don't care about removing them, I can just skip them while parsing.
jeffreylevesque has joined #ruby
<mechcozmo>
Yeah, looks like Nokogiri might be the closest to PHP's DOMDocument
<momomomomo>
then skip loofah (which implements nokogiri) and go straight to nokogiri?
<Hanmac1>
shevy i have good and bad news for you ... they are that i had beginning with my newnewnew script engine and that i already have 7 files ... but they need prepend
mando_ has joined #ruby
<mechcozmo>
Yup
<momomomomo>
bueno!
mtlatif has joined #ruby
<mechcozmo>
Now before I get too deep into this rabbit hole; does Nokogiri have a way to go tag-by-tag and inspect the name of that tag?
<mechcozmo>
Even though HTML != XML Xpath will still work?
slainer68 has joined #ruby
<momomomomo>
note: I'm not sure if this is what will work for you, but this works for me. Your path down the 'rabbit hole' is just my recommendation… read the docs before you jump in
cha1tanya has quit [Quit: Leaving]
<mechcozmo>
momomomomo: These files almost predate CSS :-/
wolcanus has quit [Remote host closed the connection]
yshh has quit [Read error: Connection reset by peer]
andy_fc has quit [Quit: andy_fc]
virtuose has joined #ruby
thetristan has joined #ruby
eykosioux has joined #ruby
<mechcozmo>
momomomomo: I'm just worried that Xpath won't work on an HTML document, the docs only talk about XML
<Joel>
xpath works on html.
<mechcozmo>
Ok, thanks Joel
Kristo_ has joined #ruby
xerxas has joined #ruby
mneorr has joined #ruby
<momomomomo>
it works on html, as Joel & docs show - try it on one document: require 'nokogiri'; f = open 'path/to/document'; doc = Nokogiri::HTML(f); #try some stuff; f.close
<momomomomo>
that, I didn't know Joel - pretty cool
alup has quit [Quit: Leaving]
sambao21 has quit [Quit: Computer has gone to sleep.]
<mechcozmo>
It's the one reason I still keep Firefox around :-)
Kristo_ has quit [Client Quit]
notbrent has joined #ruby
kosai03 has joined #ruby
ant384 has quit [Quit: Leaving.]
generalissimo has quit [Remote host closed the connection]
_maes_ has joined #ruby
d2dchat has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
apeiros has quit [Remote host closed the connection]
carloslopes has joined #ruby
_nitti has quit [Remote host closed the connection]
ShonM has quit [Quit: ShonM]
threesome has quit [Ping timeout: 245 seconds]
spider-mario has joined #ruby
devdazed has quit [Ping timeout: 255 seconds]
eykosioux has quit [Remote host closed the connection]
_nitti has joined #ruby
dhruvasagar has joined #ruby
RORgasm has joined #ruby
thinkclay has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
tk_ has joined #ruby
devdazed has joined #ruby
adamjleonard is now known as adamjleonard|bbl
soulofpeace has joined #ruby
msch has joined #ruby
ctp has joined #ruby
akashj87 has quit [Read error: Connection reset by peer]
akashj87 has joined #ruby
<e-dard>
Is anyone familiar with perftools.rb?
sambao21 has joined #ruby
pcarrier has quit [Quit: Computer has gone to sleep.]
brennanMKE has joined #ruby
adamjleonard has joined #ruby
<e-dard>
I'm profiling some code which takes around 130 seconds. However, according to the output non of the profiled methods are accounting for that time.
<e-dard>
One thing perftools is doing is filtering out any calls that occur less than 60 times, is it possible there are some infrequently called methods that are long running?
devdazed has quit [Ping timeout: 256 seconds]
adamjleonard|bbl has quit [Ping timeout: 248 seconds]
btaitelb has joined #ruby
<waxjar>
sure
pcarrier has joined #ruby
devdazed has joined #ruby
nateberkopec has joined #ruby
pcarrier has quit [Client Quit]
nalaginrut_ is now known as nalaginrut
leonard has joined #ruby
randomautomator has joined #ruby
leonard is now known as Leo
Al__ has joined #ruby
randomautomator has quit [Read error: Connection reset by peer]
randomautomator has joined #ruby
memborsky has quit [Quit: Leaving]
geekbri_ has joined #ruby
ph^ has joined #ruby
mityaz has joined #ruby
paper has quit [Remote host closed the connection]
lunarjar has quit [Max SendQ exceeded]
lunarjar has joined #ruby
kushalkhandelwal has joined #ruby
geekbri has quit [Ping timeout: 276 seconds]
andy_fc has joined #ruby
hiroyuki has joined #ruby
Davey has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
Hanmac2 has joined #ruby
generalissimo has joined #ruby
codecop has joined #ruby
Stuif has joined #ruby
platzhirsch has quit [Quit: Leaving.]
girija has quit [Ping timeout: 240 seconds]
Hanmac has quit [Ping timeout: 256 seconds]
jdunck has joined #ruby
shinobi_one has quit [Ping timeout: 256 seconds]
blahwoop has joined #ruby
jbueza has joined #ruby
wallcloc_ has joined #ruby
ukd1 has joined #ruby
hiroyuki_ has joined #ruby
wallclockbuilder has quit [Ping timeout: 245 seconds]
br4ndon has joined #ruby
shinobi_one has joined #ruby
tylersmith has joined #ruby
zomgbie has joined #ruby
ehaliewicz has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
wyhaines has joined #ruby
hamakn has quit [Ping timeout: 255 seconds]
mattbl has joined #ruby
mneorr has quit [Remote host closed the connection]
sayan has quit [Read error: Connection reset by peer]
samuel02 has quit [Remote host closed the connection]
llaskin has left #ruby [#ruby]
ngcazz has quit [Ping timeout: 245 seconds]
hasse has quit [Ping timeout: 245 seconds]
echevemaster has joined #ruby
paper has quit [Ping timeout: 245 seconds]
mark_locklear has joined #ruby
alvaro_o has joined #ruby
geekbri_ has quit [Remote host closed the connection]
Speck has joined #ruby
geekbri has joined #ruby
Vivekananda has quit [Quit: Ex-Chat]
wallcloc_ has quit [Remote host closed the connection]
Hanmac1 has quit [Ping timeout: 240 seconds]
droppedonmyhead has joined #ruby
jpcamara1 has joined #ruby
jpcamara has quit [Read error: Connection reset by peer]
troessner has quit [Quit: Leaving]
discopig has quit [Read error: Connection reset by peer]
jtreminio has joined #ruby
kristofers has joined #ruby
mahmoudimus has joined #ruby
security is now known as megha
<jtreminio>
Afternoon y'all. If you had to choose one book/online series for a developer to go through front-to-back and go from 0 to productive (not expert, but writing semi-basic to moderate code), which would you recommend?
chandankumar has joined #ruby
workmad3 has joined #ruby
love_color_text has joined #ruby
love_color_text has quit [Read error: Connection reset by peer]
duosrx has quit [Remote host closed the connection]
ariedler has joined #ruby
peta_ has joined #ruby
Zolo has joined #ruby
kpshek has joined #ruby
hogeo_ has joined #ruby
jpcamara1 has quit [Ping timeout: 264 seconds]
GhettoCode has quit [Quit: Computer has gone to sleep.]
ebobby has joined #ruby
d34th4ck3r has joined #ruby
lmf40 has joined #ruby
andy_fc has quit [Quit: andy_fc]
jtharris has quit [Quit: WeeChat 0.4.0]
hogeo has quit [Ping timeout: 248 seconds]
chussenot has joined #ruby
spoonman has joined #ruby
ebobby has left #ruby [#ruby]
Neandre has quit [Remote host closed the connection]
nomenkun_ has quit [Remote host closed the connection]
maligree has quit [Quit: I just remembered I'm sleep deprived.]
ananthakumaran1 has quit [Quit: Leaving.]
Bry8Star_ has quit [Remote host closed the connection]
jpcamara has joined #ruby
sambao21 has joined #ruby
Davey has joined #ruby
Bry8Star has joined #ruby
enebo has quit [Read error: Connection reset by peer]
enebo has joined #ruby
brennanMKE has joined #ruby
tonini has joined #ruby
mikepack has quit [Remote host closed the connection]
GhettoCode has joined #ruby
banjara has joined #ruby
tenmilestereo has joined #ruby
thetristan has quit [Quit: thetristan]
paper has joined #ruby
dmiller1 has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Ping timeout: 264 seconds]
alvaro_o has quit [Quit: Ex-Chat]
silkwood has joined #ruby
kofno has quit [Remote host closed the connection]
<silkwood>
what would be the ruby equivalent of this perl line? split(";",@tokens,2)
ngcazz has joined #ruby
kofno has joined #ruby
<MrZYX>
tokens.split(';', 2)
<ngcazz>
hey
<ngcazz>
is there any easy way to turn a hash into a ostruct recursively?
jerius has quit []
browndawg has joined #ruby
momomomomo has quit [Quit: momomomomo]
shock_one has quit [Ping timeout: 260 seconds]
Zolo has quit [Remote host closed the connection]
Zolo has joined #ruby
Zolo has quit [Read error: Connection reset by peer]
Zolo has joined #ruby
jtreminio has left #ruby ["Leaving"]
thetristan has joined #ruby
mfletcher has left #ruby [#ruby]
Hanmac has joined #ruby
dallasm_ has joined #ruby
dmiller1 has quit [Ping timeout: 260 seconds]
gr4yscale has quit [Ping timeout: 248 seconds]
kenneth has joined #ruby
apeiros has joined #ruby
ngcazz has quit [Quit: Page closed]
chussenot has quit [Quit: chussenot]
jlast_ has joined #ruby
brennanMKE has quit [Remote host closed the connection]
carlyle has quit [Remote host closed the connection]
BizarreCake has quit [Ping timeout: 240 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
forrest has joined #ruby
rdark has quit [Quit: leaving]
<wsterling>
NEWB question: Is it a good or bad idea to deploy an application as a gem if its primary purpose in life is to be used directly as an application and not a library?
robscomputer_ has joined #ruby
RubNoob has joined #ruby
k610 has joined #ruby
<RubNoob>
hello - has anyone set up a self-hosted Travis-CI instance connected to a self-hosted GitLab instance?
hmarr has quit []
<MrZYX>
RubNoob: there's #travis-ci
breakingthings has joined #ruby
sambao21 has joined #ruby
m8 has joined #ruby
<mechcozmo>
Are there any additional options to invoke when using nokogiri? Right now Tidy is outperforming it. Nokogiri is littering its output with multiple repeated cases of \r\n
Nanuq has joined #ruby
<mechcozmo>
I think it might be the file's line endings are from Windows, but I don't know how to convert or force Ruby/Nokogiri to adapt
interactionjaxsn has quit [Remote host closed the connection]
_yinzer1 has joined #ruby
interactionjaxsn has joined #ruby
baphled has joined #ruby
insulator has joined #ruby
ruckerz has quit [Ping timeout: 256 seconds]
<peta_>
I have a class that has a `render` method. I created an alias_method :to_s, :render. Now I want that subclasses can override the `render` method without having to repeating alias_method :to_s, :render
internetishard has joined #ruby
<peta_>
is this possible?
thams has joined #ruby
<paper>
peta_: instead of setting making to_s an alias make it a method
<paper>
peta_: i.e: def to_s; render; end
<peta_>
OMG
pcarrier has quit [Quit: Computer has gone to sleep.]
<peta_>
of course
<peta_>
I am stupid :D
<paper>
hehe
haxrbyte has quit [Read error: Connection reset by peer]
<wuest>
Obvious answers are the easiest to overlook, sometimes
<peta_>
was so fixated on this fancy alias_method :to_s, :render foo
btaitelb has quit [Quit: btaitelb]
<peta_>
:D
<peta_>
a use-case for it will come … i am sure
sepp2k has joined #ruby
ruckerz has joined #ruby
interactionjaxsn has quit [Ping timeout: 255 seconds]
alvaro_o has quit [Read error: Connection reset by peer]
pcarrier has joined #ruby
drewhhh has quit [Ping timeout: 264 seconds]
alvaro_o has joined #ruby
Czupa has joined #ruby
alvaro_o has quit [Read error: Connection reset by peer]
_nitti has quit [Remote host closed the connection]
duosrx has joined #ruby
wolcanus_ has quit [Remote host closed the connection]
sambao21 has joined #ruby
brhelwig has quit [Remote host closed the connection]
<mechcozmo>
How can I convert file endings in Ruby? gsub!("/\r\n?/", "\n") is not changing from Windows to Unix
wsterling has quit [Remote host closed the connection]
mattbl has joined #ruby
dallasm_ has quit [Read error: Connection reset by peer]
Faris9 has joined #ruby
tealmage has joined #ruby
dallasm_ has joined #ruby
jonahR has quit [Quit: jonahR]
rsahae has quit [Quit: rsahae]
duosrx has quit [Ping timeout: 256 seconds]
<peta_>
we must teach siri to write the code we dictate
ChristianS has joined #ruby
memristor has joined #ruby
brhelwig has joined #ruby
tonini has quit [Remote host closed the connection]
Vainoharhainen has joined #ruby
mockra has quit [Ping timeout: 276 seconds]
Shammah has joined #ruby
<apeiros>
mechcozmo: "//" is a string containing slashes
<apeiros>
ruby has a real regex literal. just /\r\n?/
<apeiros>
no quotes
jarin has quit [Quit: WeeChat 0.4.0]
jarin has joined #ruby
dallasm_ has quit [Remote host closed the connection]
<canton7>
mechcozmo, iirc File.read does EOL conversion on windows? Might want to make sure you're reading in binary mode
<mechcozmo>
apeiros: thanks, didn't know that!
<mechcozmo>
canton7: I'm reading Windows encoding on a Mac
Nisstyre-laptop has joined #ruby
<mechcozmo>
canton7: Not sure if it should do it or not, but Nokogiri's output was bad because of it
EvanR has joined #ruby
Guest38345 has joined #ruby
mockra has joined #ruby
mneorr has quit [Remote host closed the connection]
shinobi_one has joined #ruby
tubbo has joined #ruby
havenwood has quit [Remote host closed the connection]
<EvanR>
is there an easy way to do this "a \"b\" \\\"c" -> "\"a \\\"b\\\" \\\\\\\"c\""
<EvanR>
trying to print json into yaml with erb (rails uhg)
<rubious>
EvanR: What the shit is that
KazW has quit [Remote host closed the connection]
danman has quit [Quit: danman]
ruckerz has joined #ruby
<rubious>
There has got to be a conversion gem or something
Morkel_ has joined #ruby
<EvanR>
in haskell there is the show function which produces a string representation of values, when used on strings it escapes quote, backslashes, and puts quotes around it all
<EvanR>
but .to_s in ruby does not do this
<EvanR>
ring a bell?
jtharris has quit [Quit: WeeChat 0.4.0]
chrishough has quit [Quit: chrishough]
silkwood has quit [Quit: Page closed]
pitzips has joined #ruby
<Hanmac>
mechcozmo & canton7 File.read normaly does use "r" wich converts, you may need File.read(path, :mode =>"r")
davetherat has quit [Remote host closed the connection]
<shinobi_one>
EvanR: you could simply write a method that escapes quotes and backslashes and puts quotes around it?
davetherat has joined #ruby
<EvanR>
shinobi_one: its fairly hairy to write it seems
<EvanR>
seems like a basic string formatting thing
<EvanR>
to have
<shinobi_one>
EvanR: have you looked at gsub?
adambeynon has joined #ruby
Morkel has quit [Ping timeout: 245 seconds]
Morkel_ is now known as Morkel
Vainoharhainen has quit [Read error: Connection reset by peer]
skum has joined #ruby
<EvanR>
shinobi_one: yes you could use two gsubs right?
<EvanR>
its still hairy
<EvanR>
very confusing
skum has quit [Read error: Connection reset by peer]
<EvanR>
mainly because of the way you literally write out backslashes and quotes
<mechcozmo>
Hanmac, when I do 'content = File.read(filepath, :mode=>"r")' I get an error '`read': can't convert Hash into Integer (TypeError)'
Vainoharhainen has joined #ruby
<mechcozmo>
The docs say that it's right, so I think I'm doing something wrong
<mechcozmo>
Not sure what, though
jtharris has joined #ruby
Vainoharhainen has quit [Client Quit]
<supki>
EvanR: inspect?
ph^ has quit [Remote host closed the connection]
<mechcozmo>
This whole learning thing can sometimes be a real pain in the arse
paper has quit [Read error: Connection reset by peer]
wsterling has joined #ruby
paper has joined #ruby
<EvanR>
supki: thank you!
chussenot has quit [Quit: chussenot]
<EvanR>
i knew i was missing something obvious
<shinobi_one>
supki: oh right!
love_color_text has joined #ruby
pioz has quit [Quit: This computer has gone to sleep]
chussenot has joined #ruby
Davey has joined #ruby
<shevy>
EvanR sex?
kushalkhandelwal has quit [Remote host closed the connection]
<supki>
EvanR: it doesn't escape unicode though
<shinobi_one>
shevy: sounds fun.
<shevy>
man I try to escape unicode whenever I can
<shevy>
but now UTF-8 is the ruby standard :(
kushalkhandelwal has joined #ruby
chrishough has joined #ruby
<EvanR>
supki: i dont think it needs to do that
<EvanR>
yaml can handle it
_maes_ has joined #ruby
<supki>
EvanR: well, since you mentioned show :]
<EvanR>
yeah show does way more shit
shinobi_one has left #ruby [#ruby]
momomomomo has joined #ruby
<EvanR>
json.generate escapes control characters
<EvanR>
i think
<EvanR>
JSON.generate
thebastl has quit [Remote host closed the connection]
nomenkun has joined #ruby
<qohelet_>
I have a = [3,6,9,12,15,18]. How can I print the array replacing a[rand(0..5)] with "x"? (Need kids to understand the mathematical expression and type the right number)
heliumsocket has quit [Quit: heliumsocket]
<paper>
qohelet_: what kids? i dont see any kids
stoic_squirrel has joined #ruby
<qohelet_>
my kids lol :D
<paper>
a
<qohelet_>
trying to make some math exercise for them
bradleyprice has joined #ruby
<Hanmac>
qohelet_: hm you can do a[rand(0..5)] = "x" ;P
reset has joined #ruby
shinobi_one has joined #ruby
knapper_tech has quit [Ping timeout: 276 seconds]
snearch has joined #ruby
kushalkhandelwal has quit [Remote host closed the connection]
drewhhh has joined #ruby
_maes_ has quit [Ping timeout: 258 seconds]
workmad3 has joined #ruby
<qohelet_>
uhm
Davey has quit [Ping timeout: 252 seconds]
<qohelet_>
ok but in that case it will permanently change the array, so that i have to make another array b = a, change the element in b, then mapping the index of the element replaced and return a[changed element] if they want to know the correct answer
thebastl has joined #ruby
IrishGringo has quit [Ping timeout: 252 seconds]
Shammah has quit [Remote host closed the connection]
mechcozmo has quit [Ping timeout: 252 seconds]
unflores has joined #ruby
unflores has quit [Client Quit]
kushalkhandelwal has joined #ruby
kpshek has quit []
wallclockbuilder has joined #ruby
celinedior has quit [Quit: celinedior]
xibalba has joined #ruby
timonv has quit [Remote host closed the connection]
<xibalba>
Hey folks, i'm reading through the ruby book right now. I'm wondering if there is a way to interactively explore an Object in Ruby durring run time? VisualStudio has an option that allows you to do this with the .NET framework, is there something similiar for Ruby?
ehellman has quit []
<Spooner>
xibalba, Look at the pry gem.
haxrbyte has joined #ruby
busybox42 has quit [Quit: leaving]
<xibalba>
ok
kpshek has joined #ruby
busybox42 has joined #ruby
<Spooner>
And/or the debugger gem, depending on exactly what you want.
mechcozmo has joined #ruby
busybox42 has quit [Client Quit]
cbot_ has quit [Read error: Connection reset by peer]
dmiller1 has quit [Ping timeout: 264 seconds]
busybox42 has joined #ruby
cbot_ has joined #ruby
Elhu has joined #ruby
kpshek has quit [Read error: Connection reset by peer]
kpshek has joined #ruby
eldariof has quit []
dmiller1 has joined #ruby
Axsuul has joined #ruby
postmodern has joined #ruby
TheFuzzball has joined #ruby
ferdev has joined #ruby
rsahae has joined #ruby
<xibalba>
when i run object.inspect is the Hex code the objectId?
<tzanger>
good afternoon... I am very much a ruby newb... I'm trying to install "redmine crm" (http://redminecrm.com/projects/cms/pages/1) and I'm tryign to run bundle install but it's giving me an error saying it can't find the liquid gem, although "bundle list" shows it
timmow has joined #ruby
heliumsocket has joined #ruby
enriclluelles has joined #ruby
busybox42 has quit [Quit: leaving]
jarin has joined #ruby
<tzanger>
the exact error is "Could not find gem 'liquid (~> 2.4.1) ruby' in the gems available on this machine."
<tzanger>
now I'm not able to see what "~>" means... >= and <= are understandable
wolcanus has joined #ruby
Xeago has joined #ruby
<Hanmac>
tzanger: ~> means 2.4.* is okay, but 2.5.* is to high
sambao21 has joined #ruby
mikepack has joined #ruby
<otters>
mechcozmo: I don't think File.read takes a hash
<tzanger>
Hanmac: ok, but if I'm showing 2.5.0, 2.3.0 does that mean that 2.4.x is the only version that is supported?
majikbytes has joined #ruby
<mechcozmo>
otters: It doesn't
zomgbie has joined #ruby
<mechcozmo>
otters: it takes an Integer
mando has joined #ruby
<otters>
yeah
elaptics`away is now known as elaptics
Bry8Star has joined #ruby
<Hanmac>
otters: it does but only as last argument ... (it works better on ruby2)
<otters>
oh
<mechcozmo>
so File.read(path, "r") doesn't work either
<otters>
yeah
<mechcozmo>
oh… I've got… let me check
<otters>
because "r" is implied by read
<otters>
why would you specify "r"
<otters>
that's for open(...)
<mechcozmo>
file line ending conversion stuff
hasse has joined #ruby
<mechcozmo>
it's been a bitch to handle
io_syl has joined #ruby
davetherat has quit [Remote host closed the connection]
<peta_>
Spooner: reopening seems not to work on nested classes
<Spooner>
peta_, It does, but I don't know how you are doing it.
<Hanmac>
because my ruby i awsome i can do this File.read(path,:mode => "r+")
<peta_>
not proper, then
<peta_>
:D
chandankumar has quit [Quit: Leaving]
ryannielson has quit [Quit: ryannielson]
angusiguess has quit [Ping timeout: 276 seconds]
roflmaus has quit []
niceguyjames has joined #ruby
<peta_>
OMG … I forgot to require the according file to make the reopening take effect
<peta_>
sorry for nagging
carloslopes has quit [Remote host closed the connection]
<Spooner>
That'll do it, peta_ :D
codecop has quit [Remote host closed the connection]
<paper>
peta_: be careful of Spooner, he ruins little boys like you
<paper>
good and naughty, alike
benlieb has quit [Quit: benlieb]
<peta_>
I learned PHP before, so I defend myself :D
<Hanmac>
peta_: we are all sorry for you ;P
vlad_starkov has joined #ruby
benlieb has joined #ruby
tenmilestereo has quit [Quit: Leaving]
IrishGringo has quit [Read error: Operation timed out]
codecop has joined #ruby
krawchyk has quit [Remote host closed the connection]
ph^ has joined #ruby
Nisstyre-laptop has quit [Quit: Leaving]
Czupa has quit [Remote host closed the connection]
generalissimo is now known as Guest31337
nezumi has joined #ruby
huoxito has quit [Quit: Leaving]
wesside has quit [Quit: Computer has gone to sleep.]
codecop has quit [Remote host closed the connection]
ph^ has quit [Ping timeout: 264 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
backjlack has quit [Remote host closed the connection]
btaitelb has joined #ruby
tealmage has quit [Remote host closed the connection]
yashshah- has quit [Read error: Connection reset by peer]
<Hanmac>
apeiros: i begin with an newer scriptengine ... without instance_method or instance_exec and without alias or eval ... i use prepend and its seems to work nice too ... do you want to look over it?
Nisstyre-laptop has joined #ruby
yashshah- has joined #ruby
<mechcozmo>
I'm also one of those PHP people :-P
<mechcozmo>
It's not so bad
<tzanger>
ok, what does ~> mean exactly?
<tzanger>
not greater than?
yalue has quit [Read error: Connection reset by peer]
<MrZYX>
~> x.y = >= x.y && < (x+1).0 iirc
<MrZYX>
~> x.y.z = >= x.y.z && < (x+1).(y+1).0
<MrZYX>
and so forth
jpfuentes2 has quit [Ping timeout: 252 seconds]
<Spooner>
"~> 1.2.3" = 1.2.3 up to 1.2.infinity
LnL has joined #ruby
evenix has quit [Read error: Operation timed out]
stkowski has quit [Quit: stkowski]
<tzanger>
hm ok
sambao21 has joined #ruby
<Spooner>
"~> 1.2" = 1.2.x up to 1.inf.x
blahwoop has joined #ruby
<spike|spiegel>
[1.2.3,1.3) is far more elegant
atno has quit [Quit: Leaving]
atno has joined #ruby
dustint has quit [Remote host closed the connection]
busybox42 has quit [Quit: leaving]
angusiguess has joined #ruby
chrishough has quit [Quit: chrishough]
busybox42 has joined #ruby
<tzanger>
and wow this stuff is picky
dustint has joined #ruby
<tzanger>
you can't have a gem specify = x.y.z and another say ~>x.y
kenneth has quit [Ping timeout: 255 seconds]
<Spooner>
Yes, that is how it keeps things working, by keeping the correct gems running.
momomomomo has joined #ruby
<tzanger>
Spooner: but =1.3.1 and ~>1.3 seem to satisfy both requirements
<tzanger>
(if I have 1.3.1)
EvanR has left #ruby [#ruby]
<Spooner>
No, ~>1.3 matches both 1.3.0 and 1.9.9
thone has joined #ruby
jbueza has quit [Quit: Leaving.]
jbueza has joined #ruby
jbueza has quit [Max SendQ exceeded]
<Spooner>
Oh, I see. Yes, they should both match 1.3.1
<tzanger>
but if I have 1.3.1 installed, doesn't 1.3.1 satisfy ~>1.3?
zomgbie has quit [Read error: Connection reset by peer]
jbueza has joined #ruby
<Spooner>
I believe it should do.
<tzanger>
also tried =1.3.1 and >=1.3 and it failed the same way
ruckerz has quit [Ping timeout: 245 seconds]
<Spooner>
However, the Gemfile.lock contains the actual version used (as opposed to the valid versions specified in the Gemfile).
<tzanger>
hm ok. I thoguht Gemfile.lock was just a lockfile
<tzanger>
(I didn't bother to look at it for that reason)
<MrZYX>
try bundle update gemname
ruckerz has joined #ruby
<tzanger>
is Gemfile.lock generated (i.e. can I blow it away) ?
mercwithamouth has joined #ruby
<MrZYX>
yes and you shouldn't need to blow it away
<Spooner>
Yeah, though if you got it from the repository, then it should define the absolute versions to use.
thone_ has quit [Ping timeout: 260 seconds]
<Hanmac>
Gemfile and the locks anoy me :(
<MrZYX>
bundle install and bundle update should be all that's needed to bring it into the state you need, unless you're in a merge conflcit
<tzanger>
Im not sure what I'm in. :-)
spider-mario has quit [Remote host closed the connection]
<MrZYX>
in recent versions bundler refuses to run if you got a merge conflict in the .lock ;)
<tzanger>
yeah I think that's what I"m doing
<tzanger>
You cannot specify the same gem twice with different version requirements. You specified: rspec (= 1.3.1) and rspec (>= 1.3)
<tzanger>
that's what happens if I try "bundle update"
<Eiam>
I have a route where users can ask for arbitrary groupings of the data thats returned back to them, e.g. /feed/data/group_by/<something here> . I'm trying to think of a way that they can pass in n-object levels, e.g. they may want to group by c, in the object { a: { b: { c:"hello"}}} or by a higher level attribute, like { a:"world"}, is there some sane way I can express that in a URL and be able to pass that to my group_by
<Eiam>
block?
drewhhh has quit [Ping timeout: 255 seconds]
<MrZYX>
that's a version conflict and not a merge conflict
teddyp1cker has quit [Read error: Connection reset by peer]
<spike|spiegel>
tzanger: sounds like a bug to me
bradleyprice has quit [Remote host closed the connection]
love_color_text has quit [Remote host closed the connection]
<tzanger>
spike|spiegel: I have not got enough experience to be able to state such a thing. It looks like an old version of redmine backlogs is what's killing me
<MrZYX>
tzanger: did you specify rspec twice in the Gemfile (double check that) or is it really pulled in as a dependency?
<tzanger>
MrZYX: well one plugin specifies rspec as =1.3.1 and this other one wants ~>1.3 and bundle is cussing me out about it
Elhu has joined #ruby
carloslopes has joined #ruby
timeout has joined #ruby
chrishough has joined #ruby
Nisstyre-laptop has quit [Ping timeout: 276 seconds]
<tzanger>
is there a nice "this is ruby, this is what rails is, this is what bundles are, these are the major players in the filesystem and how things are generally tied together" type document?
carloslopes has quit [Remote host closed the connection]
<atmosx>
is there any gem for ruby + octave?
Faris9 has quit [Ping timeout: 258 seconds]
pcarrier has quit [Quit: Computer has gone to sleep.]
<Eiam>
okay lets try this. say I have an array of attributes in an object, like ["hello","world"] and an object {"hello":{ "world":1"},"test":2}, and I want to use the array to access the attributes in the hash ?
lunarjar has quit [Ping timeout: 258 seconds]
<atmosx>
fryguy: fails to build on macosx for some reason
<atmosx>
anyway
<tzanger>
spike|spiegel: :-)
<blahwoop>
anybody know how to get postgres to start when i boot my computer for OS X
<tzanger>
Hanmac: yes, but for example what a Gemfile is, how they interact (all this =1.3.1 and >= 1.3 still not making anything happy, for example) what exactly rake does.. I think I understand how my parents felt when I was trying to explain electronics to them :-)
<atmosx>
blahwoop: how did you install ps in your mac?
<blahwoop>
homebrew
<atmosx>
ah no idea then. I use macports
<blahwoop>
nooooo!
<atmosx>
however, you could crate a startup item easily, it's pure XML
hmarr has joined #ruby
sailias has quit [Ping timeout: 248 seconds]
jpfuentes2 has joined #ruby
<blahwoop>
how do i do that
nomenkun has quit [Remote host closed the connection]
<tzanger>
hm, with rails 2.3.14 is the correct invocation in routes.rb not "ActionController::Routing::Routes.draw do |map|" ? I the app explodes with "uninitialized constant Rails::Plugin::ActionDispatch"
hasse has quit [Ping timeout: 245 seconds]
stoic_squirrel has joined #ruby
<epochwolf>
atmosx: there's already one in /System/Library/LaunchDaemons
<atmosx>
blahwoop: check that file out, change the paths (if don't use the std pg) and launch it.
<atmosx>
via launchctl
<Boohbah>
>> n = 0; n.zero? ? p 0 : p n
<eval-in>
Boohbah => /tmp/execpad-f293a11979ea/source-f293a11979ea:2: syntax error, unexpected tINTEGER, expecting keyword_do or '{' or '(' ... (http://eval.in/16055)
jonathanwallace has joined #ruby
<Boohbah>
how do i fix my syntax error?
rudisimo has quit [Quit: Leaving.]
mahmoudi_ has joined #ruby
<jbourassa>
Hi people. I'm trying to run a server from within ruby by creating a subprocess (I'm using Open4 FWIW). The server boots just fine, but I can't get to read the input (IO class) without freezing my current execution. Here's a sample : https://gist.github.com/jbourassa/f472b756bb76dade93ef - any clue?
tommyvyo has joined #ruby
<blahwoop>
which line shoudl i be looking at
s0ber has quit [Ping timeout: 255 seconds]
s0ber_ is now known as s0ber
<blahwoop>
im inside the file
<blahwoop>
bunch of <dict> <key>
mahmoudimus has quit [Ping timeout: 245 seconds]
tevio has quit [Remote host closed the connection]
choobie has quit [Remote host closed the connection]
philcrissman has joined #ruby
busybox42 has quit [Quit: leaving]
busybox42 has joined #ruby
<blahwoop>
i dont seee any ondemand
hamakn__ has quit [Remote host closed the connection]
thetristan has quit [Quit: thetristan]
niceguyjames has quit [Quit: Computer has gone to sleep.]
stkowski has joined #ruby
dustint has quit [Ping timeout: 276 seconds]
<atmosx>
blahwoop: can you post the file on github or somewhere online?
<blahwoop>
sure
<atmosx>
and also let me know how to you launch postrgress now
<blahwoop>
pgadmin III
artofraw has quit [Remote host closed the connection]
<Boohbah>
what is wrong with my ternary expression?
mattbl has quit [Quit: This computer has gone to sleep]
<Boohbah>
>> n, r = 0, 1; n == 0 ? p n : p r
<eval-in>
Boohbah => /tmp/execpad-31758fddc861/source-31758fddc861:2: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '(' ... (http://eval.in/16065)
niceguyjames has quit [Quit: Computer has gone to sleep.]
<`p>
that and learning to program through ruby colored glasses are the 2 best ruby books
<atmosx>
pandawarrior: I guess there should be a ruby-2.0 version better wait
<pandawarrior>
cool
<spike|spiegel>
meh, not much to wait for
<pandawarrior>
i was thinking of the site ruby the hard way
<pandawarrior>
any thoughts?
<atmosx>
pandawarrior: but tell him to have a look at online tutorials first, I'm pretty sure he won't need any sort of intro… ruby is reallyyyy easy for a perl dev
<pandawarrior>
basically
<pandawarrior>
i want to start a project with him
<atmosx>
you wanna go for RoR?
Nisstyre-laptop has quit [Ping timeout: 256 seconds]
gr4yscale has joined #ruby
<pandawarrior>
and i want to do the project in ruby with rails
<atmosx>
web frameworks etc?
<pandawarrior>
so i can improve my skills
<pandawarrior>
and get a job as a ror dev
<pandawarrior>
but they want a quick resource so that they can learn the basics
<pandawarrior>
so if i want his help i have to go find they right material
<pandawarrior>
atmosx: yeah ror too
<spike|spiegel>
NO! 'and get a job as a developer' not 'ror developer'
bean__ has quit [Quit: Computer has gone to sleep.]
<atmosx>
okay, take a sneak peak at ruby (that's very easy) and then all you have to do is jump to rails… learn about MVC, skeletons etc and you're all set. The inner parts is not a big deal. CSS/HTML5 masterry would be a bit tricky, at least that's what kills me in my small sinatra projects.
<pandawarrior>
he 'gets' sinatra as dancer is sinatra
danneu has quit [Ping timeout: 276 seconds]
tootubular has quit [Quit: tootubular]
<atmosx>
but if you know ruby RAils is fairly easy to understand, I mean all you have to do is spend time on it. (direclty)
<pandawarrior>
spike|spiegel: i can't get a job as any kind of devloper right now
<pandawarrior>
it's v depressing, but that's another story
brhelwig has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
brhelwig has joined #ruby
<atmosx>
pandawarrior: seriously, for a 10-year perl dev, creating backend for web applications in ruby is a 2-weeks (max) job.
<pandawarrior>
atmosx: yes that's why i need to boot strap his knowledge so we can do projects
<atmosx>
pandawarrior: well there are plenty of books about rails
<atmosx>
but I don't think you really need any, there's tons of resources online
hamakn has joined #ruby
pcarrier has quit [Quit: Computer has gone to sleep.]
<pandawarrior>
any quic and dirty run throuhs you'd recommend?
<pandawarrior>
spike|spiegel: oh, just interested as you were saying no to rails
<atmosx>
pandawarrior: yeah koans is good. But rails is not really hard… it has a skeleton in order for you do to achieve some things in a certain way that makes dev faster, Everything is in place (databases with activerecord, tests, etc). Once you get the minset the coding part is easy
<pandawarrior>
atmosx: the blog guid and the koans should be just right
<pandawarrior>
cheers
<spike|spiegel>
pandawarrior: I meant be a developer and not a developers on a single platform.
<atmosx>
pandawarrior: good luck
forrest has quit [Quit: Leaving]
<pandawarrior>
atmosx: thank you
<atmosx>
pandawarrior: you're welcome
Stuif has quit [Ping timeout: 240 seconds]
<pandawarrior>
spike|spiegel: ah i understand what you mean
* atmosx
closes vim and goes to bed
frem has quit [Quit: Computer has gone to sleep.]
adamjleonard has quit [Quit: Leaving...]
monkegjinni has quit [Remote host closed the connection]
breakingthings has quit []
<pskosinski>
How can I check what version of a gem I have installed?
<pandawarrior>
but if you want to go into web development, in ruby you are almost always going to be a rails dec
mercwithamouth has joined #ruby
monkegjinni has joined #ruby
asteve has quit [Quit: Computer has gone to sleep.]
<pandawarrior>
pskosinski: gem -v
<atmosx>
pskosinski: gem list (see the versions )
<pskosinski>
thanks :)
<atmosx>
pskosinski: you might have more than 1
kirun has quit [Quit: Client exiting]
<atmosx>
pskosinski: usually some gems that rely on other gems, use specific versions to avoid blowing everything up (which creates a huge mess but anyway)
alanp has quit [Read error: Connection reset by peer]
<pskosinski>
ok, thanks
alanp has joined #ruby
tealmage has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
TheFuzzball has joined #ruby
hamakn has quit [Ping timeout: 248 seconds]
thinkclay has joined #ruby
rsahae has quit [Quit: rsahae]
dmiller has quit [Read error: Operation timed out]
TheFuzzball has quit [Remote host closed the connection]
yashshah- has quit [Ping timeout: 264 seconds]
chrisja has quit [Quit: leaving]
monkegjinni has quit [Ping timeout: 256 seconds]
mmitchell has quit [Remote host closed the connection]
rsahae has joined #ruby
<paper>
Hanmac: u here?
pavilionXP has joined #ruby
wallerdev has joined #ruby
RagingDave has quit [Quit: Ex-Chat]
kpshek has quit []
wesside has joined #ruby
tealmage_ has joined #ruby
tealmage has quit [Ping timeout: 255 seconds]
jbourassa has quit [Quit: jbourassa]
nobitanobi has quit [Remote host closed the connection]