ntus1017 has quit [Remote host closed the connection]
atmosx has quit [Quit: And so the story goes…]
yshh has quit [Remote host closed the connection]
nomenkun has quit [Ping timeout: 264 seconds]
freerobby has quit [Ping timeout: 240 seconds]
heftig has quit [Ping timeout: 260 seconds]
s3m73x has quit [Remote host closed the connection]
pcarrier_ has joined #ruby
ehaliewicz has joined #ruby
heftig has joined #ruby
s3m73x has joined #ruby
iamjarvo has joined #ruby
marr has quit [Ping timeout: 256 seconds]
Kar- has quit [Remote host closed the connection]
blitz has quit [Ping timeout: 268 seconds]
RORgasm has joined #ruby
aryaLovesJoel has quit [Ping timeout: 248 seconds]
blitz has joined #ruby
v0n has joined #ruby
serp` has joined #ruby
huoxito has joined #ruby
tomzx_mac has quit [Quit: tomzx_mac]
poga has joined #ruby
RORgasm has quit [Ping timeout: 248 seconds]
ntus1017 has joined #ruby
Xeago has quit [Remote host closed the connection]
aryaLovesJoel has joined #ruby
Xeago has joined #ruby
tomzx_mac has joined #ruby
Hanmac1 has joined #ruby
brennanMKE has quit [Remote host closed the connection]
pcarrier_ has quit [Quit: Computer has gone to sleep.]
IceDragon has quit [Ping timeout: 256 seconds]
IceDragon has joined #ruby
Hanmac has quit [Ping timeout: 268 seconds]
amedeiros has joined #ruby
sailias has joined #ruby
iamjarvo has quit [Quit: Leaving.]
Xeago has quit [Ping timeout: 240 seconds]
AlSquire has quit [Quit: This computer has gone to sleep]
mansi has joined #ruby
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
truedeity has joined #ruby
krisfremen has quit [Remote host closed the connection]
krisfremen has joined #ruby
krisfremen has quit [Changing host]
krisfremen has joined #ruby
amedeiros has quit [Ping timeout: 268 seconds]
amedeiros has joined #ruby
freerobby has joined #ruby
Speed has quit [Ping timeout: 240 seconds]
n_blownapart has joined #ruby
amedeiros has quit [Ping timeout: 240 seconds]
amedeiros has joined #ruby
brennanMKE has joined #ruby
wallerdev has joined #ruby
slainer68 has quit [Remote host closed the connection]
nicolabe has joined #ruby
takezawa has quit [Remote host closed the connection]
larissa has joined #ruby
tkuchiki has joined #ruby
kenmaz has joined #ruby
jimg has joined #ruby
lewix has joined #ruby
Weems has quit [Ping timeout: 252 seconds]
nicolabe has quit [Read error: Connection reset by peer]
amedeiros has quit [Ping timeout: 268 seconds]
nbe_ has quit [Ping timeout: 245 seconds]
nicolabe has joined #ruby
takezawa has joined #ruby
amedeiros has joined #ruby
takezawa has quit [Remote host closed the connection]
MrZYX is now known as MrZYX|off
faulkner has quit [Ping timeout: 276 seconds]
kenmaz has quit [Ping timeout: 256 seconds]
sam113101_ has joined #ruby
<sam113101_>
test
serp` has quit [Quit: serp`]
<sam113101>
looks like it's working
serp` has joined #ruby
hogeo has joined #ruby
bklane has quit [Remote host closed the connection]
amedeiros has quit [Ping timeout: 268 seconds]
<sam113101>
I like it when I do things and it works as expected
hogeo has quit [Remote host closed the connection]
hogeo has joined #ruby
_Renegade has quit [Quit: _Renegade]
aedorn has quit [Quit: Leaving]
__class__ has quit [Read error: Connection reset by peer]
fermion has joined #ruby
Weems has joined #ruby
_class_ has joined #ruby
Nisstyre-laptop has joined #ruby
nari has quit [Ping timeout: 252 seconds]
Nisstyre-laptop is now known as Nisstyre
_class_ is now known as __class__
jso has quit [Ping timeout: 245 seconds]
nicolabe has quit [Ping timeout: 245 seconds]
sambao21 has joined #ruby
chipotle_ has joined #ruby
timkohrumel has joined #ruby
jso has joined #ruby
chipotle_ has quit [Excess Flood]
chipotle_ has joined #ruby
chipotle_ has quit [Excess Flood]
buzzybron has joined #ruby
chipotle_ has joined #ruby
chipotle_ has quit [Excess Flood]
chipotle_ has joined #ruby
chipotle_ has quit [Excess Flood]
mansi has quit [Remote host closed the connection]
agjacome has joined #ruby
chipotle_ has joined #ruby
chipotle_ has quit [Excess Flood]
nomenkun has joined #ruby
mansi has joined #ruby
takezawa has joined #ruby
chipotle_ has joined #ruby
chipotle_ has quit [Excess Flood]
truedeity has quit []
Treeson has joined #ruby
serp` has quit [Quit: serp`]
sepp2k has quit [Quit: Leaving.]
timkohrumel has quit [Ping timeout: 245 seconds]
Soliah has joined #ruby
akashj87__ has joined #ruby
chipotle_ has joined #ruby
chipotle_ has quit [Max SendQ exceeded]
jimg has quit [Remote host closed the connection]
sam113101 has quit [Quit: WeeChat 0.4.0]
chipotle_ has joined #ruby
chipotle_ has quit [Max SendQ exceeded]
C0deMaver1ck has joined #ruby
C0deMaver1ck is now known as Guest14976
chipotle_ has joined #ruby
nomenkun has quit [Ping timeout: 240 seconds]
mansi has quit [Ping timeout: 245 seconds]
akashj87_ has quit [Ping timeout: 256 seconds]
mfridh has quit [Read error: Operation timed out]
ner0x has joined #ruby
icole has joined #ruby
tspike has joined #ruby
slainer68 has joined #ruby
horofox_ has left #ruby [#ruby]
Nisstyre has quit [Quit: Leaving]
linsy has quit [Ping timeout: 268 seconds]
yshh has joined #ruby
nbe has joined #ruby
gildo has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
jonahR has joined #ruby
yacks has quit [Ping timeout: 245 seconds]
sevenseacat has joined #ruby
yacks has joined #ruby
Spooner has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 248 seconds]
<n_blownapart>
hi I have a deck of cards class that gets shuffled and dealt. http://pastie.org/8050339 ; Then I have a testing class: http://pastie.org/8050343 ; finally a 3rd file with a 'cardtest' class. I know the require/require_relative/load business is wrong but can't figure out how to get the files to load. thanks
<taoshi>
but that way i get 'wrong number of arguments'
fermion has quit [Quit: Computer has gone to sleep.]
<n_blownapart>
hi I have a deck of cards class that gets shuffled and dealt: http://pastie.org/8050339 ; Then I have a testing class: http://pastie.org/8050343 ; finally a 3rd file with a 'cardtest' class: http://pastie.org/8050346. I know the require/require_relative/load business is wrong but I'm confused on how to get the files to load. what is wrong? thanks.
agjacome has quit [Quit: leaving]
GeissT has joined #ruby
<bnagy>
oh, yeah damage is a bad name. You can read damageA B C though
<bnagy>
n_blownapart: srsly, stop doing that
<bnagy>
if nobody answers your question do NOT paste it every fricking 30 mins
<bnagy>
we're ALL STILL HERE
freerobby has quit [Quit: Leaving.]
richiebkr has joined #ruby
adkron_ has joined #ruby
<taoshi>
bnagy: dont getit :( instance.damage calls the method, i dont have method damageA and so on
sambao21 has joined #ruby
viszu has quit [Read error: Connection reset by peer]
DanKnox is now known as DanKnox_away
<taoshi>
bnagy: i dont get how to get the asnwer of the method damage with the arguments that i create the instance
adkron has quit [Ping timeout: 246 seconds]
<bnagy>
taoshi: you have a damageA method - it's declared in shorthand by attr_reader
serp` has joined #ruby
Hanmac has joined #ruby
<n_blownapart>
bnagy: sorry I'm frustrated and can't see the problem.
jesly has joined #ruby
Domon has joined #ruby
<bnagy>
n_blownapart: good for you, princess
<taoshi>
oh that was just a test.. i have only the damage method
<bnagy>
whether you're frustrated, calm or have antlers doesn't change the fact that it's bad behaviour
pipework has joined #ruby
hawtin has quit [Ping timeout: 252 seconds]
Hanmac1 has quit [Ping timeout: 240 seconds]
sam113101 is now known as sam113101_afk
sam113101_afk is now known as sam113101
n_blownapart has quit [Remote host closed the connection]
ttt has joined #ruby
krisfremen has quit [Read error: Connection reset by peer]
<`p>
you're welcome, i was specifically directing that to you actually : |
<taoshi>
haha i know
RORgasm has quit [Ping timeout: 252 seconds]
Sherwyn has quit [Ping timeout: 264 seconds]
adkron has joined #ruby
amedeiros has quit [Ping timeout: 248 seconds]
Nisstyre has joined #ruby
machuga|away is now known as machuga
amedeiros has joined #ruby
ssvo has quit [Ping timeout: 256 seconds]
<taoshi>
bnagy: im trying to pass 2 args in the instance creation, name and damage.. and in the initialize i get the values, then damage is passed to the apply_damage
billy_ran_away has quit [Ping timeout: 245 seconds]
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
adkron has joined #ruby
adkron_ has joined #ruby
<jcromartie>
although generally in OO design the purpose of an inner/nested class is for internal details relevant to the enclosing class only
adkron__ has quit [Ping timeout: 245 seconds]
adkron___ has quit [Ping timeout: 248 seconds]
<pontiki>
ubuntu is still at 1.8.7, too
<r0bgleeson>
jcromartie: you can say the same about a module containing other classes.
tylersmith has quit [Remote host closed the connection]
<jcromartie>
r0bgleeson: why?
<jcromartie>
modules are intended to be used as namespaces, no?
lewix has joined #ruby
<r0bgleeson>
yeah, sometimes, but classes can act fine as a namespace. pry for example uses 'Pry'(a class) as its namespace.
<pontiki>
jcromartie: no, public classes inside other public classes are just as public
amedeiros has quit [Ping timeout: 240 seconds]
<pontiki>
a class does not hide internal classes
<r0bgleeson>
if there is no need for 'Pry' to be a class, I'd make it a module.
mikepack has quit [Remote host closed the connection]
byprdct has joined #ruby
<r0bgleeson>
pontiki: not without private_constant :d
splvenky has joined #ruby
<jcromartie>
pontiki: I'm not talking about access modifiers, just typical OO design, but I guess if it's conventional to use classes as namespaces then go nuts
<r0bgleeson>
it's not conventional
<r0bgleeson>
but it's not a bad design choice either
<jcromartie>
eh
wr has quit [Quit: Leaving]
<r0bgleeson>
sometimes it makes more sense to use class instead of module
lewix has quit [Ping timeout: 276 seconds]
kasper has quit [Remote host closed the connection]
<r0bgleeson>
if you don't need a class use a module is my general rule of thumb for that type of stuff
mikepack has joined #ruby
kasper has joined #ruby
<pontiki>
If you can do module Foo; class Bar; end ;end
<havenwood>
jcromartie: I think its fine to do so when you want to namespace on a constant that you also need to instantiate. For sure modules for namespacing is the way more common case.
happyvenky has joined #ruby
<pontiki>
and do Foo::Bar
lyanchih has joined #ruby
Gugster has quit [Quit: ~]
<pontiki>
why do you think you couldn't do module Foo; class Bar; class Baz; end; end; end, and then Foo::Bar::Baz?
danslo has joined #ruby
<r0bgleeson>
pontiki: i understand his point, he is saying (normally) an inner class might be a helper class, you _could_ make it private if you wanted to (at least >= 1.9.3)
<pontiki>
sure you could
<pontiki>
i could think a few reasons why that may be
<pontiki>
but it's not a given
<r0bgleeson>
yeah true
wharfrat has quit [Quit: leaving]
splvenky has quit [Ping timeout: 256 seconds]
<jcromartie>
I'm NOT talking about access modifiers
<jcromartie>
I'm just talking about API design
kasper has quit [Ping timeout: 252 seconds]
<jcromartie>
not really even any reason to make it private
<pontiki>
you can design your API to whatever depth you need
<pontiki>
you need to fulfill it's contract
<r0bgleeson>
(with classes or modules)
chimkan has joined #ruby
<r0bgleeson>
and don't forget, a class _is_ a module
<r0bgleeson>
it inherits from Module
<jcromartie>
sure thing
<pontiki>
exactly
<havenwood>
Made a little PStore wrapper gem for stupid-simple persisting of Ruby objects. Guess I shoulda made it a class not a module and made YAML::Store an option... Curious for any feedback though: http://havenwood.github.io/persist/
brennanMKE has quit [Remote host closed the connection]
geoffrey has joined #ruby
<pontiki>
actually, havenwood, the way you've done it seems fine.
<pontiki>
more complex needs a body can just use PStore itself, really
<pontiki>
i think dead simple wrappers are pretty useful
geoffrey has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
burlyscudd has joined #ruby
<havenwood>
pontiki: Yay, glad you think so! I was worried it was too trivial a difference from PStore to be worth doing. I guess the hope would be to be useful for someone who'd never seen PStore and wasn't doing fancy things.
Shirakawasuna has quit [Ping timeout: 245 seconds]
io_syl has quit [Ping timeout: 252 seconds]
Opettaja has quit [Quit: WeeChat 0.4.1]
kadoo has joined #ruby
kadoo has quit [Client Quit]
Opettaja has joined #ruby
hamakn has quit [Read error: Connection reset by peer]
<havenwood>
I need to take a page from r0bgleeson's book and add instructions for MessagePack with Bindi. :)
mduvall has quit [Quit: mduvall]
<havenwood>
I wanna actually use MessagePack for something. Seems awesome I just haven't had a chance.
lyanchih has quit [Quit: lyanchih]
<havenwood>
Wrap ALL THE THINGS! \o/
vlad_starkov has quit [Ping timeout: 252 seconds]
cj3kim has joined #ruby
thams has joined #ruby
ssvo has joined #ruby
IceDragon has quit [Quit: Space~~~]
sailias has quit [Ping timeout: 264 seconds]
aspiers has quit [Ping timeout: 245 seconds]
cj3kim has quit [Remote host closed the connection]
lyanchih has joined #ruby
aspiers has joined #ruby
<r0bgleeson>
havenwood: bindi looks cool
tommyvyo has joined #ruby
<havenwood>
r0bgleeson: I kinda code spiked it and left it in dire need of some love. I need to write test coverage... >.> and maybe go straight through the redis gem instead of ohm.
buzzybron has quit []
v0n has quit [Ping timeout: 240 seconds]
kofno has quit [Ping timeout: 256 seconds]
viszu has quit [Quit: Leaving.]
<r0bgleeson>
havenwood: yeah… i don't know much about ohm
<r0bgleeson>
i wouldn't think you'd need anything but the redis library
<r0bgleeson>
it's a really good library
paissad_ has quit [Quit: This computer has gone to sleep]
buzzybron has joined #ruby
<havenwood>
r0bgleeson: Yeah, I'm kinda using Ohm for no good reason since I'm not using its ORM stuff at all.
<r0bgleeson>
havenwood: i used the redis docs (redis.io) and everything mapped cleanly to the ruby redis library
paissad_ has joined #ruby
<havenwood>
r0bgleeson: Simple benchmarks of serializing to Redis versus PStore or YAML::Store were crazy favorable to Redis, of course.
<r0bgleeson>
what does YAML::Store use?
<r0bgleeson>
filesystem as well?
<havenwood>
r0bgleeson: Nice, I'll look at that and convert it over.
<havenwood>
r0bgleeson: Yup, same.
negative273 has quit [Ping timeout: 245 seconds]
happyvenky has quit [Ping timeout: 264 seconds]
redgirl has joined #ruby
kofno has joined #ruby
Inside has joined #ruby
<Inside>
so.. weird question
lyanchih has quit [Quit: lyanchih]
<Inside>
if I have an erm.. static method and then within that method I declare a small helper function
<Inside>
why does helper function need to be self.func_name
<Inside>
I thought its scope is local to the inside of that class?
davedev24 has quit [Remote host closed the connection]
JumpMast3r has joined #ruby
banisterfiend has quit [Ping timeout: 264 seconds]
syamajala has joined #ruby
beilabs_ has quit [Ping timeout: 248 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
adkron__ has joined #ruby
poga has quit [Remote host closed the connection]
<Inside>
hmmm
<Inside>
I don't see why def doesn't work in this case at all :(
<r0bgleeson>
Inside: when you want to define a method at runtime you should use define_method, it is a method itself, so you would say define_method(:some_name) { body }
adkron has quit [Ping timeout: 246 seconds]
<Inside>
I mean I guess this doesn't have to a function created at run-time, I just wanted to place it close to where its gets used.
sambao21 has joined #ruby
adkron_ has quit [Ping timeout: 240 seconds]
<r0bgleeson>
that works as well
* Inside
flops.
tylersmith has joined #ruby
adkron has joined #ruby
io_syl has joined #ruby
<treehau55>
i have a question about making a cli program
<treehau55>
i want to just pass in the name of my program and the options
eldariof has joined #ruby
chipotle_ has joined #ruby
<r0bgleeson>
treehau55: the options are available in ARGV, it is array
<Inside>
you want to get the value of the arguments?
<Inside>
it's ARGV, as r0bgleeson said
<treehau55>
are you guys familiar with the pickaxe book?
k-man has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
<pontiki>
treehau55: look at thor, methadone, GLI, even rake
k-man has joined #ruby
cyong has joined #ruby
<treehau55>
so I have a ruby shebang set up in a file inside of a bin, it only works from the command line by name if I move it to /usr/bin, but how do other ruby programs do it so that it just works from gems installed from say the home directory. do I have to make it a gem myself?
<havenwood>
treehau55: /usr/bin is in your PATH, as is your gem directory
<pontiki>
treehau55: it should be set executable and placed someone on your PATH
<pontiki>
if you have craeted it as a gem, you should be just need to install it
<treehau55>
okay so in the future if I want other people to be able to use my program I should probably make it a gem, then if they install it as a gem, they will have it available to their cli, correct?
<treehau55>
i wnat to avoid having to have users modify their path
mduvall has joined #ruby
tylersmith has quit [Ping timeout: 264 seconds]
beilabs_ has joined #ruby
banghouse has quit [Remote host closed the connection]
<L8D>
And whenever I use it, it causes both the clone and original objects to have the parent_id
<L8D>
Actually, Both the clone and the original share the exact same object_id
<hackeron>
is there a ruby way to check how full a filesystem is in percentage?
negative273 has quit [Quit: Leaving]
<sevenseacat>
because youre just returning self from clone
<sevenseacat>
not actually cloning anything
<L8D>
`df`.split(" ")[12]
<sevenseacat>
do you mean clone = self.clone ?
binw__ has joined #ruby
<sevenseacat>
or self.dup
<L8D>
`df`.split(" ")[11]
vlad_starkov has joined #ruby
<L8D>
Ooh, haven't seen self.dup
Zespre has quit [Ping timeout: 256 seconds]
* L8D
plays checks if he can/should use self.dup
<L8D>
checks*
<L8D>
:s/plays //g
RORgasm has quit [Ping timeout: 268 seconds]
andikr has joined #ruby
Zespre has joined #ruby
braoru has joined #ruby
ayaz has joined #ruby
beilabs_ has joined #ruby
<L8D>
self.dup fixed the sharing-the-same id problem, but I still have 'clone.parent_id = self.id' setting both self and clone
<L8D>
's parent_ids
<L8D>
Is that intended behaivour?
jimg has quit [Remote host closed the connection]
ChristianS has quit [Excess Flood]
brennanMKE has quit [Remote host closed the connection]
<L8D>
hackeron: `df`.split(" ")[11]
ChristianS has joined #ruby
binw_ has quit [Ping timeout: 252 seconds]
Shirakawasuna has joined #ruby
jdunck has joined #ruby
<L8D>
Or better yet: `df`.split(" ")[11].to_i
mduvall has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
<L8D>
Nevermind, it did fix it
<hackeron>
L8D: I meant a ruby way, not running a linux process - preferably something platform independent
<L8D>
Okay...
tomzx_mac has quit [Ping timeout: 268 seconds]
<hackeron>
L8D: also that shows me percentage on ubuntu but not on mac osx
<L8D>
what do you get on mac? o.O
tonini has joined #ruby
<hackeron>
irb(main):001:0> `df`.split(" ")[11]
<hackeron>
=> "248390464"
<L8D>
Try 12 then...
Zespre has quit [Ping timeout: 252 seconds]
<hackeron>
L8D: I won't it to work on both mac and linux reliably, but also no: irb(main):002:0> `df`.split(" ")[12]
Zespre has joined #ruby
<hackeron>
=> "222573016"
saarinen has joined #ruby
<L8D>
Try 13...
<L8D>
Hm...
<hackeron>
lol, funny man
<L8D>
Yes, I understand you need it cross-platform...
<L8D>
hackeron: Well, if you want it to work cross platform, you're going to have to end up scanning the entire hard drive and gaining a sum of every file's size.
<hackeron>
I can see a gem sys-filesystem which lets me do something like mb_available = stat.block_size * stat.blocks_available / 1024 / 1024 -- to get amount of MB available, but can't see a way to get the total number of MB available to calculate a percentage
bubbajones has quit [Ping timeout: 276 seconds]
breadtk has quit [Read error: Operation timed out]
RORgasm has joined #ruby
cj3kim has joined #ruby
<L8D>
Whereas using something like sys-filesystem or the system command `df`, which use the systems built-in monitoring system.
girija has joined #ruby
<L8D>
So either not use a gem, and just regex df to find the %, or use sys-filesystem in an obscure manor.
bigkevmcd has joined #ruby
<hackeron>
well, how do I get the total number of MB with sys-filesystem?
Zespre has quit [Ping timeout: 245 seconds]
<L8D>
I'm not sure...
mduvall has quit [Quit: mduvall]
rrecio has joined #ruby
Zespre has joined #ruby
breadtk has joined #ruby
bubbajones has joined #ruby
cj3kim has quit [Ping timeout: 240 seconds]
Jackneill has joined #ruby
RORgasm has quit [Ping timeout: 268 seconds]
subbyyy has quit [Ping timeout: 264 seconds]
Zespre has quit [Ping timeout: 240 seconds]
mafolz has joined #ruby
jarin has joined #ruby
Zespre has joined #ruby
beilabs_ has quit [Ping timeout: 268 seconds]
bubbajones has quit [Ping timeout: 256 seconds]
jarin has quit [Client Quit]
burlyscudd has joined #ruby
sayan has quit [Read error: Connection reset by peer]
<rrecio>
Other day I went to a quora page which subject was why don't google use ruby? They were mostly saying its because of higher cost of infrastructure. What you guys think about that?
<rrecio>
(..) and because ruby is slow.
sambao21 has quit [Quit: Computer has gone to sleep.]
hogeo has quit [Remote host closed the connection]
Zespre has quit [Ping timeout: 245 seconds]
burlyscudd has quit [Ping timeout: 264 seconds]
Zespre has joined #ruby
<sevenseacat>
i think it's misinformed.
blaxter has quit [Ping timeout: 240 seconds]
<r0bgleeson>
rrecio: there's some truth in it
<r0bgleeson>
rrecio: but it isn't really that simple
rrecio_ has joined #ruby
mansi has joined #ruby
saarinen has quit [Quit: saarinen]
<r0bgleeson>
rrecio: the focus of ruby is developer happiness & productivity, there's some trade offs to pay for that.
oceanbreeze has joined #ruby
Zespre has quit [Ping timeout: 260 seconds]
beilabs_ has joined #ruby
rrecio has quit [Ping timeout: 245 seconds]
rrecio_ is now known as rrecio
richiebkr has joined #ruby
Zespre has joined #ruby
mansi has quit [Ping timeout: 256 seconds]
jarin has joined #ruby
filipe has joined #ruby
<oceanbreeze>
Hello guys. I am looking at the source code of an application, and found this expression class_eval <<-RUBY, __FILE__, __LINE__+1 i dont really understand, can you explain to me please
dr_bob has joined #ruby
krz has quit [Ping timeout: 245 seconds]
saarinen has joined #ruby
<hackeron>
anyone knows how do I get the total number of megabytes on the filesystem with sys-filesystem?
<r0bgleeson>
oceanbreeze: are you confused about __FILE__ and __LINE__ stuff or class_eval in general?
linsy has joined #ruby
jimg has joined #ruby
krz has joined #ruby
Zespre_ has joined #ruby
Zespre has quit [Ping timeout: 256 seconds]
blaxter has joined #ruby
<oceanbreeze>
whole expression
tonini has quit [Quit: Lost terminal]
spike|spiegel has quit [Quit: WeeChat 0.4.1]
io_syl has quit [Ping timeout: 248 seconds]
<r0bgleeson>
oceanbreeze: there's a lot of different parts to explain but to give you a short answer it evaluates a string in the context of a class or module.
<jarin>
oceanbreeze: It's adding methods to a class, and the __FILE__ and __LINE__+1 let it know what line number and file to output if there are any errors
tylersmith has joined #ruby
<jarin>
Er r0bgleeson is more correct than me about the first part
persand has joined #ruby
io_syl has joined #ruby
<jarin>
But yeah you need the __FILE__ and __LINE__+1 because it doesn't know where it's at until you actually put that module into a class
<jarin>
So without that you will not get very good error messages
<jarin>
At least that is my understanding of it
redgirl has joined #ruby
bubbajones has joined #ruby
jalcine has joined #ruby
Zespre_ has quit [Ping timeout: 248 seconds]
jacobw has quit [Quit: WeeChat 0.4.0]
Zespre has joined #ruby
sayan has joined #ruby
<jarin>
Without it you will get errors like: # (eval):1:in `name': undefined local variable or method `undefined_method' for # (NameError)
alanjc has quit [Ping timeout: 260 seconds]
dormiens is now known as alanjc
<jarin>
With it, it will look like: # foo.rb:3:in `name': undefined local variable or method `undefined_method' for # (NameError)
tylersmith has quit [Ping timeout: 245 seconds]
jesly has quit [Quit: Leaving.]
jimg has quit [Remote host closed the connection]
richiebkr has quit [Quit: richiebkr]
dhruvasagar has joined #ruby
<r0bgleeson>
jarin: it sets __FILE__ and __LINE__ in the enclosing string or block as well, i think that is also important (besides the error reporting stuff)
<oceanbreeze>
Aha, and _FILE_ is a refference to a file object? And _LINE_ is a refference to line in that _FILE_ object?
<oceanbreeze>
So i case error will occure, error will be written in line of file? :)
<r0bgleeson>
__FILE__ is just a string
<r0bgleeson>
__LINE__ is a fixnum
dormiens has joined #ruby
<r0bgleeson>
oceanbreeze: in the backtrace, the file(path) and line number will be used
jprovazn has joined #ruby
<jarin>
r0bgleeson: Ah ok I didn't know about that part, that is also important :)
zigomir has joined #ruby
m8 has joined #ruby
<rrecio>
What about the -RUBY part?
jds has joined #ruby
<rrecio>
What is this
<r0bgleeson>
that's a doc string
<r0bgleeson>
erh
<r0bgleeson>
sorry
<r0bgleeson>
heredoc
<r0bgleeson>
just syntax for a multi-line string
tvw has joined #ruby
<jarin>
I never understood what the advantage of evaluating it as a string was, I guess string interpolation is useful in that case
bubbajones has quit [Ping timeout: 252 seconds]
Zespre has quit [Ping timeout: 256 seconds]
<jarin>
ok yeah never mind I get it now
<r0bgleeson>
jarin: it is actually done for performance reasons, string is cheaper than proc
<jarin>
Ah ok nice
<r0bgleeson>
looks ugly as hell though
<jarin>
Always much to learn in metaprogramming haha
Zespre has joined #ruby
huoxito has quit [Quit: Leaving]
<r0bgleeson>
metaprogramming can end up confusing
<r0bgleeson>
i try to use it sparingly
arturaz has joined #ruby
tonini has joined #ruby
saarinen has quit [Quit: saarinen]
kadoo has joined #ruby
senayar has joined #ruby
fridim_ has quit [Ping timeout: 246 seconds]
Zespre_ has joined #ruby
<Paradox>
yo dawg we heard you like programming so we put some ruby in your ruby so you can make programs with your programs
Zespre has quit [Ping timeout: 264 seconds]
<rrecio>
... and that's how the matrix was created.
kasper has joined #ruby
kadoo has quit [Ping timeout: 268 seconds]
<oceanbreeze>
haha
airtonix has quit [Ping timeout: 264 seconds]
Zespre has joined #ruby
Zespre_ has quit [Ping timeout: 245 seconds]
banghouse has joined #ruby
boblu has joined #ruby
banghouse is now known as Guest34910
richiebkr has joined #ruby
richiebkr has quit [Client Quit]
Guest34910 has quit [Remote host closed the connection]
airtonix has joined #ruby
Domon has quit [Remote host closed the connection]
kpwz has quit [Ping timeout: 252 seconds]
kpwz has joined #ruby
Zespre has quit [Ping timeout: 248 seconds]
echevemaster is now known as echevemaster_afk
Zespre has joined #ruby
Domon has joined #ruby
bubbajones has joined #ruby
threesome has quit [Ping timeout: 245 seconds]
sevenseacat has left #ruby [#ruby]
sevenseacat has joined #ruby
<rrecio>
Thats all for today folks. Thanks for your attention!
rrecio has quit [Quit: You just hate me cause I'm caucasian.]
Zespre has quit [Ping timeout: 248 seconds]
Zespre_ has joined #ruby
richiebkr has joined #ruby
bubbajones has quit [Ping timeout: 260 seconds]
dagobah has joined #ruby
stayarrr has joined #ruby
beilabs_ has quit [Ping timeout: 248 seconds]
charliesome has joined #ruby
bubbajones has joined #ruby
Zespre has joined #ruby
Zespre_ has quit [Ping timeout: 276 seconds]
JohnBat26 has joined #ruby
tonini has quit [Ping timeout: 248 seconds]
bubbajones has quit [Ping timeout: 260 seconds]
burlyscudd has joined #ruby
Zespre has quit [Ping timeout: 246 seconds]
Zespre has joined #ruby
lessless has joined #ruby
pootler_1 has quit [Ping timeout: 248 seconds]
<lessless>
how to securely access a potentially nonexistent hash element w/o raising en error?
pootler__ has quit [Ping timeout: 252 seconds]
airtonix_ has joined #ruby
airtonix has quit [Ping timeout: 245 seconds]
niceguyjames has joined #ruby
beilabs_ has joined #ruby
burlyscudd has quit [Ping timeout: 276 seconds]
<havenwood>
lessless: by default nil is returned if the key isn't found
stayarrr has quit [Quit: Leaving...]
<havenwood>
lessless: what do you mean by securely?
ffio has joined #ruby
<lessless>
havenwood, I mean nested elements
<lessless>
like some['element']['that']['probably']['do_not_exist']
<lessless>
NoMethodError: undefined method `[]' for nil:NilClass
Shirakawasuna has quit [Ping timeout: 252 seconds]
mansi has joined #ruby
hoelzro_ is now known as hoelzro
Mon_Ouie has quit [Ping timeout: 245 seconds]
aryaLovesJoel has quit []
arya has joined #ruby
jdunck has quit [Quit: Computer has gone to sleep.]
<hackeron>
MrZYX: yeh, that one's docs aren't much better, lol
<MrZYX>
time to read some code :P
browndawg has joined #ruby
ananthakumaran has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Ping timeout: 268 seconds]
<MrZYX>
ruby is just not yet there as gui app language, sadly
browndawg has quit [Client Quit]
<MrZYX>
I could imagine nice APIs with blocks as callbacks etc
linusoleander has joined #ruby
jwest has joined #ruby
ananthakumaran has joined #ruby
<linusoleander>
How is Ruby is handling recursive calls?
<linusoleander>
Will I have any problems if I used it over a long period of time?
tylersmith has quit [Ping timeout: 268 seconds]
<MrZYX>
there's a stacklimit, yeah, so no tail recursion
lyanchih has quit [Quit: lyanchih]
tkuchiki has joined #ruby
gildo has joined #ruby
<linusoleander>
MrZYX: Aha, that's true
<linusoleander>
Thanks
Zespre_ has joined #ruby
Zespre has quit [Ping timeout: 245 seconds]
<hackeron>
MrZYX: this isn't a gui app :)
mklappstuhl has joined #ruby
k-man has quit [Read error: Connection reset by peer]
<MrZYX>
well, the true solution to your problem is probably not writing a ruby script but configuring udisks properly, but who am I preventing you from writing ruby? :P
jimg has quit [Remote host closed the connection]
k-man has joined #ruby
<linusoleander>
Is there a way to implement a safe tail recursion script in ruby?
kil0byte has joined #ruby
<MrZYX>
use a loop
<MrZYX>
tail recursion is the functional style to write loops
<linusoleander>
MrZYX: The code is async, so a loop won't work
<MrZYX>
do you have a minimal example?
arya has joined #ruby
Zespre_ has quit [Ping timeout: 248 seconds]
<linusoleander>
MrZYX: I think I can scale down my current script, hold on
medk has joined #ruby
statarb3 has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
Zespre has joined #ruby
statarb3 has quit [Remote host closed the connection]
statarb3 has joined #ruby
statarb3 has quit [Read error: Connection reset by peer]
<linusoleander>
MrZYX: On line 7 (or if something goes wrong) I want it to wait for a while and start over again
mklappstuhl has quit [Ping timeout: 248 seconds]
<MrZYX>
maybe I'm missing something but that's not recursive
devoldmx has quit [Ping timeout: 256 seconds]
<MrZYX>
you call eventmachine, that call returns
<linusoleander>
MrZYX: I know, It's what I'm trying to implement on line 7
<Xeago>
on line 7 he wants to restart it
Zespre_ has joined #ruby
ldnunes has quit [Ping timeout: 240 seconds]
<MrZYX>
you call the callback function, pass it a block, that saves it somewhere, and returns
<MrZYX>
your function returns
<MrZYX>
eh, method
<Xeago>
linusoleander: there is no reason to use non-blocking methods if you are just waiting for it to finish
niklasb has joined #ruby
Zespre has quit [Ping timeout: 268 seconds]
mark_locklear has joined #ruby
berdario has joined #ruby
<MrZYX>
some later point: the stored callback gets executed, outside of the process methods callstack
DrCode has quit [Ping timeout: 240 seconds]
<MrZYX>
but I might be missing something since I never actually used eventmachine
<linusoleander>
Xeago: It's just an example code, my real application includes over 900 current requests per minute
jbpros has joined #ruby
<berdario>
Hi, I upgraded ubuntu, and now rbenv always crashes, complaining that the old system ruby isn't what it was before
pootler_ has quit [Quit: Lost terminal]
pootler__ has quit [Quit: Lost terminal]
s_e has quit [Read error: Connection reset by peer]
kpshek has joined #ruby
<Xeago>
linusoleander: doesn't matter what the real code is, if you are waiting on the result of IO, use blocking IO or interleave it
s_e has joined #ruby
Alina-malina has quit [Read error: Connection reset by peer]
JumpMast3r has quit [Ping timeout: 264 seconds]
TheFuzzball has quit [Ping timeout: 264 seconds]
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
tacos1de has quit [Ping timeout: 240 seconds]
<berdario>
I'm looking into the shell scripts that make rbenv run... but I can't find where has it stored the assumption of the system version of being the old one
<linusoleander>
MrZYX: Any idea?
nfk has quit [Remote host closed the connection]
__main__ has quit [Ping timeout: 248 seconds]
rmnuvg_ has quit [Ping timeout: 264 seconds]
Kabaka has quit [Ping timeout: 240 seconds]
JumpMast3r has joined #ruby
dfdf has joined #ruby
<Xeago>
linusoleander: you probably want a task queue
nfk has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
ananthakumaran1 has joined #ruby
L8D has quit [Ping timeout: 264 seconds]
ericmathison has quit [Ping timeout: 264 seconds]
tommylommykins has quit [Ping timeout: 264 seconds]
ananthakumaran has quit [Ping timeout: 252 seconds]
<Xeago>
where you can queue up your tasks, and have multiple workers process a task
tommylommykins has joined #ruby
ntus1017 has quit [Remote host closed the connection]
ericmathison has joined #ruby
L8D has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<linusoleander>
That doesn't sound like my original problem
<MrZYX>
linusoleander: so the http.callback call blocks until the passed block is executed?
rmnuvg has joined #ruby
F1skr has joined #ruby
<linusoleander>
MrZYX: No
TheFuzzball has joined #ruby
<MrZYX>
then it's not recursive
tacos1de has joined #ruby
kloeri has quit [Remote host closed the connection]
<MrZYX>
no matter what you do inside
kloeri has joined #ruby
<berdario>
weeeird... changing the global to "system" and then changing it back to a custom ruby, appears to have fixed it
teedex has joined #ruby
Zespre has joined #ruby
Zespre_ has quit [Ping timeout: 252 seconds]
Alina-malina has joined #ruby
DrCode has joined #ruby
<berdario>
no, it still crashes -_-
nezumi has quit [Ping timeout: 252 seconds]
<linusoleander>
MrZYX: I know that it's not recursive atm
<MrZYX>
linusoleander: _no matter what you do inside_
Sherwyn has joined #ruby
kayloos has joined #ruby
daxim has joined #ruby
Trynemjoel has joined #ruby
JustinAiken has joined #ruby
carloslopes has joined #ruby
<daxim>
what's the gem equivalent command-line of `cpan .`? specifically, I want to install a checkout of <https://github.com/ewilhelm/fpm>
mklappstuhl has joined #ruby
<MrZYX>
only guessing what cpan . does: gem build fpm.gemspec
<berdario>
I think it's absurd to require a certain patchset just to run a piece of code
<daxim>
that seems to work, MrZYX++
Zespre has joined #ruby
spyk has joined #ruby
<wuest>
berdario: I imagine that it provides you context regarding what patchset the code is known to work well under, rather than implying a hard requirement.
taoshi has quit [Quit: leaving]
spyk has left #ruby [#ruby]
LennyLinux has joined #ruby
<berdario>
wuest: true, but it would be better to provide context through the README
<berdario>
this way, I'm forced to change the file
<wuest>
README? What do you think this is, C? ;)
<wuest>
I agree with you, to note.
<berdario>
(that is under VCS, so if I'll ever want to do a pull request, I'll have keep in mind not to add this change)
<MrZYX>
linusoleander: EventMachine::Timer.new(30) doesn't block either so perform returns before the block is executed
<L8D>
I have a problem/question
<MrZYX>
linusoleander: so still no recursion
<linusoleander>
MrZYX: So?
Freijo is now known as Fraeon
<L8D>
Let's say I have 4 variables, x, y, a, and d
LennyLinux has quit [Remote host closed the connection]
<L8D>
and d represents a distance to travel...
RORgasm has quit [Ping timeout: 252 seconds]
<L8D>
How can I calculate how much to add to x and y based on the angle and distance?
JustinAiken has quit [Quit: Leaving.]
<L8D>
I'm more looking for a functon that takes a and d, and return x and y
pyrac has joined #ruby
devoldmx3 has quit [Ping timeout: 245 seconds]
geekbri has joined #ruby
teedex has quit [Remote host closed the connection]
<berdario>
uhm... the gemfile requires rake 0.9, I have already installed rake 0.9.6 and it installed 0.9.2.2
<berdario>
why is that?
Zespre has quit [Ping timeout: 252 seconds]
osvico has quit [Ping timeout: 252 seconds]
<ellipse>
radians
<ellipse>
@L8D
devoldmx has joined #ruby
<L8D>
is radians what I'm looking for?
<MrZYX>
berdario: most likely some other dependency you have restricts the requirement down to .2.2
<ellipse>
Googling radians will aid you on your quest, yes.
ramblex has joined #ruby
<MrZYX>
berdario: read your Gemfile.lock
<berdario>
MrZYX: is there an easy way to see which dependency restri...
<berdario>
thanks
* L8D
is now looking at the wikipedia article
<L8D>
this is what I'm looking for...
<L8D>
thank you
Zespre has joined #ruby
<linusoleander>
MrZYX: I think you should do some reading about EM :)
<ellipse>
np
<berdario>
MrZYX: there's only one rake item, and it's under "specs:"
browndawg has joined #ruby
subbyyy has joined #ruby
<berdario>
to me, it seems to mean that the restriction doesn't come from other packages, isn't it?
Spami has joined #ruby
Spami has joined #ruby
<MrZYX>
linusoleander: http://eventmachine.rubyforge.org/EventMachine/Timer.html the first sentence demonstrates that you can cancel a timer and that it never executes the block because of that, that means the call returns before the block is executed, that means the block is executed outside the call stack of your current method, that means it's no recursion but a loop somewhere
mikecmpbll has joined #ruby
<MrZYX>
berdario: gist your Gemfile and Gemfile.lock then
boblu has quit [Ping timeout: 245 seconds]
<L8D>
I see how radians are relevant, but I don't see how using will help me solve my problem.
obs has joined #ruby
<linusoleander>
MrZYX: "Somewhere" as my code or in EM?
<linusoleander>
MrZYX: Yeah, they have an event loop somewhere
greywolf` has joined #ruby
<MrZYX>
berdario: okay looks like the lock was built when .2.2 was the latest version, if you want to get to .6 run bundle update rake
hattusili_III has quit [Read error: Connection reset by peer]
generalissimo has quit [Remote host closed the connection]
atno has quit [Remote host closed the connection]
icole has joined #ruby
Zespre has quit [Ping timeout: 248 seconds]
Zespre_ has joined #ruby
<berdario>
MrZYX: uhhhh... you're right... I checked the git status, and indeed Gemfile.lock was already there (I thought it was created when I ran bundle install)... thanks!
browndawg has quit [Read error: Connection reset by peer]
sailias has quit [Remote host closed the connection]
devoldmx has joined #ruby
mansi has quit [Ping timeout: 260 seconds]
allanm has joined #ruby
iamjarvo has joined #ruby
teedex has joined #ruby
browndawg has quit [Read error: Connection reset by peer]
browndawg has joined #ruby
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
ttt has joined #ruby
Zespre has quit [Ping timeout: 245 seconds]
relix has joined #ruby
daxim has quit [Read error: Connection reset by peer]
DaniG2k has quit [Quit: Leaving.]
Zespre has joined #ruby
serp` has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
m8 has quit [Read error: Connection reset by peer]
m8 has joined #ruby
buzzybron has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
jastix has joined #ruby
adkron has joined #ruby
ttt has quit [Ping timeout: 252 seconds]
Fire-Dragon-DoL1 has joined #ruby
Fire-Dragon-DoL1 has quit [Client Quit]
<L8D>
Is it possible to define your own methods for standard classes?
jlast has joined #ruby
kristiandelay has joined #ruby
_Renegade has joined #ruby
tylersmith has joined #ruby
Zespre has quit [Ping timeout: 241 seconds]
__main__ has joined #ruby
matthewrobbins has quit [Ping timeout: 248 seconds]
browndawg has left #ruby [#ruby]
Sherwyn has quit [Remote host closed the connection]
Zespre has joined #ruby
<tobiasvl>
L8D: sure
<tobiasvl>
go right ahead
adambeynon has joined #ruby
<zets>
L8D: yeah, that's one of the nice things about ruby
icecandy has quit [Remote host closed the connection]
breakingthings has joined #ruby
<L8D>
HOW?
ldnunes has joined #ruby
tylersmith has quit [Ping timeout: 245 seconds]
<L8D>
How can you deinfe your own methods for standard classes?
<L8D>
define*
atno has joined #ruby
<tobiasvl>
the way you define any old method
<tobiasvl>
class String; def foo; return; end; end
<L8D>
That works? And doesn't break the String class?
ayaz has quit [Read error: Operation timed out]
<tobiasvl>
it works. what do you mean "break"?
<joonty>
tobiasvl: I'm guessing L8D isn't used to languages where you can open up existing classes
<L8D>
cause the String class to not have it's original methods
<L8D>
o.O
<L8D>
OMG
<tobiasvl>
L8D: it keeps its original methods
<L8D>
Ruby is awesome
<zets>
it won't override any of String's current functionality
adambeynon has quit [Client Quit]
jerius has joined #ruby
<L8D>
10.times { puts "Ruby is awesoe" }
adambeynon has joined #ruby
Zespre has quit [Ping timeout: 264 seconds]
<MrZYX>
in fact you can dynamically define methods on any object, that's how class methods work in ruby
<L8D>
.gsub(/awesoe/, "awesome"
devoldmx has quit [Remote host closed the connection]
<L8D>
)
atno has quit [Remote host closed the connection]
<L8D>
Is there any way to prevent that then?
Zespre has joined #ruby
<L8D>
prevent the overriding of existing class methods
<MrZYX>
a = "foo"; b ="bar"; def a.yay; puts "yay"; end; a.yay #=> yay; b.yay #=> NoMethodError
<MrZYX>
no
teedex has quit [Remote host closed the connection]
<L8D>
Well crap
synthetix has joined #ruby
subbyyy has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Remote host closed the connection]
lyanchih has joined #ruby
atno has joined #ruby
ner0x has joined #ruby
jbpros has quit [Quit: jbpros]
burlyscudd has joined #ruby
obs has quit [Quit: Konversation terminated!]
synthetix has quit [Remote host closed the connection]
yalue has joined #ruby
<tobiasvl>
sure there is
<L8D>
what?
ayaz has joined #ruby
lkba has joined #ruby
<MrZYX>
tobiasvl: how?
devoldmx has joined #ruby
<tobiasvl>
String.freeze
<L8D>
Can you do that for specific methods?
Zespre has quit [Ping timeout: 240 seconds]
Zespre has joined #ruby
Raboo has joined #ruby
tomzx_mac has joined #ruby
mansi has joined #ruby
pootler_ has joined #ruby
lewix has quit [Remote host closed the connection]
kpshek has quit []
iamjarvo1 has joined #ruby
Zespre_ has joined #ruby
wmoxam has joined #ruby
tk_ has joined #ruby
Zespre has quit [Ping timeout: 268 seconds]
lyanchih has quit [Quit: lyanchih]
teedex has joined #ruby
otha has joined #ruby
<tobiasvl>
ah, no.
takezawa_ has joined #ruby
Coolhand has quit [Remote host closed the connection]
hamakn_ has joined #ruby
<otha>
kkkkk
<otha>
kkkkk
niklasb has quit [Ping timeout: 248 seconds]
adambeynon has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
obs has joined #ruby
obs has quit [Client Quit]
serp` has quit [Quit: serp`]
vlad_starkov has joined #ruby
zai_ has joined #ruby
<otha>
oml
iamjarvo1 has quit [Ping timeout: 248 seconds]
Zespre_ has quit [Ping timeout: 240 seconds]
takezawa has quit [Ping timeout: 245 seconds]
hamakn has quit [Ping timeout: 252 seconds]
Mattx has joined #ruby
Zespre has joined #ruby
kenmaz has joined #ruby
carlyle has joined #ruby
dfdf has quit [Remote host closed the connection]
joast has quit [Quit: Leaving.]
workmad3 has joined #ruby
zai has quit [Ping timeout: 276 seconds]
kasper has joined #ruby
browndawg has joined #ruby
axl_ has joined #ruby
denver has joined #ruby
danslo has joined #ruby
joast has joined #ruby
Matip has quit [Ping timeout: 240 seconds]
pyrac has quit [Quit: pyrac]
splittingred has joined #ruby
johnrlive has quit [Remote host closed the connection]
mansi has quit [Remote host closed the connection]
umttumt has joined #ruby
kenmaz has quit [Ping timeout: 276 seconds]
lyanchih has joined #ruby
Zespre_ has joined #ruby
johnrlive has joined #ruby
Zespre has quit [Ping timeout: 276 seconds]
bklane has joined #ruby
girija has quit [Ping timeout: 276 seconds]
tommyvyo has joined #ruby
codecop has quit [Remote host closed the connection]
haxrbyte has quit [Remote host closed the connection]
Nisstyre has quit [Quit: Leaving]
hogeo has quit [Remote host closed the connection]
johnrlive has quit [Remote host closed the connection]
Niamkik_ has quit [Ping timeout: 255 seconds]
pragu has joined #ruby
pragu has quit [Client Quit]
Zespre_ has quit [Ping timeout: 264 seconds]
jrhe has joined #ruby
<jrhe>
Hi. What is the recommended way of storing database queries in the database itself? Point in question is that I have a load of reports that need to be run in an app than themselves are sql snippets / active record relations. Is there some way I can serialise them and deserialise them?
<jrhe>
The relation itself rather than the data returned.
Zespre has joined #ruby
davedev24 has quit [Read error: Connection reset by peer]
pipework has joined #ruby
davedev24 has joined #ruby
failshell has joined #ruby
<ccooke>
jrhe: a Better Solution would be stored procedures, to be honest
<jrhe>
ccooke: Why?
adambeynon has joined #ruby
<ccooke>
because stored procedures were designed to do what you're talking about - be callable, pre-determined blocks of SQL.
<jrhe>
ccooke: I still need to be able to tie it to an activerecord model instance
<ccooke>
Storing sql *in* sql means you're going to have to take *great* care not to allow SQL injection attacks
<jrhe>
Which contains the name of the query and whatnot
Coolhand has joined #ruby
niklasb has joined #ruby
asteve has joined #ruby
obs has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
matthewrobbins has joined #ruby
Zespre has quit [Ping timeout: 260 seconds]
teedex has quit [Remote host closed the connection]
<jrhe>
ccooke: Surely so long as I use prepare I should be ok?
ewag has quit [Remote host closed the connection]
icole has joined #ruby
Zespre has joined #ruby
<ccooke>
jrhe: No, that's no defence at all.
sambao21 has joined #ruby
teedex has joined #ruby
<ccooke>
the problem is that SQL-in-SQL is more fragile, requires more complex code and requires you to - at some level - accept that you're going to be executing SQL that's not been entirely deemed as "safe"
<ccooke>
wheras a stored procedure is built-in to the DB.
<jrhe>
ccooke: I will research it. I don't see quite how it will alleviate that problem but I don't think I know enough about stored procedures.
<ccooke>
there are compromises, of course. It all depends on what you need. But the general advice is always *not* to store SQL in a DB
<ccooke>
jrhe: what sort of SQL do you actually need to store?
Niamkik has joined #ruby
ewag has joined #ruby
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
otha has left #ruby [#ruby]
lewix has joined #ruby
freerobby has joined #ruby
<ccooke>
is it *really* arbitrary, or could you actually handle it with (effectively) a number of functions and the parameters to them?
<jrhe>
ccooke: Its all reporting queries so mainly selecting fields from a bunch of joined tables which meet some condition. No updates, inserts etc.
rdark has joined #ruby
icole has quit [Ping timeout: 245 seconds]
obs has quit [Quit: Konversation terminated!]
<ccooke>
jrhe: is there commonality in the tables and the way they're joined?
geoffrey has joined #ruby
<jrhe>
ccooke: Cheers for the help btw, you are helping me ask the right questions! Nope, other than that they are selects it can be pretty arbitrary. Its basically looking over a rails apps database and generating reports from it. They can be from any tables, composed in anyway.
Zespre has quit [Ping timeout: 245 seconds]
<ccooke>
jrhe: Could you handle it by - effectively - having a few functions that spat out generic SQL to do the select, then return only the data the report asked for?
kil0byte_ has joined #ruby
geoffrey has quit [Client Quit]
<jrhe>
ccooke: Too much data, would be better to do it at a db level for efficiency
<ccooke>
jrhe: that's not the point :-)
v0n has joined #ruby
<ccooke>
jrhe: could it be done that way?
<jrhe>
yes
<jrhe>
but I think it would be very very very very slow
obs has joined #ruby
Zespre has joined #ruby
<ccooke>
the reason I ask is, if your were to implement the generic select as a stored procedure and then use that in another SQL statement, the DB does all the optimisation
<jrhe>
Ahh right I see
fuzzyhorns has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
<ccooke>
you can even have the stored procedure take a list of field names to return and have it generate its code directly
tw1sted has joined #ruby
akells` has joined #ruby
<ccooke>
then you could get your report structrue down to the name of a stored procedure to call, plus the parameters to pass to it.
TakumoKatekari has joined #ruby
kil0byte has quit [Ping timeout: 252 seconds]
pipework has quit [Remote host closed the connection]
<ccooke>
the downside is you'd need a new stored procedure every time a *completely* new report was used, but every report that's on effectively the same data can use the same function
<jrhe>
ccooke: It seems that AR adapters implement a select method, maybe this would do the same
<ccooke>
(and stored procedures are fully turing complete, so you *can* have them change the structure they generate based on parameters)
AndChat| has joined #ruby
pentameter has joined #ruby
mklappstuhl has quit [Read error: Connection reset by peer]
Roa has quit [Ping timeout: 246 seconds]
arturaz has quit [Quit: Leaving]
burlyscudd has quit [Quit: Leaving.]
Jb___ has joined #ruby
k3rn3lito has quit [Ping timeout: 264 seconds]
dr_bob has quit [Quit: Leaving.]
d4x has joined #ruby
<d4x>
Hi
akells` has quit [Ping timeout: 240 seconds]
KevinSjoberg has joined #ruby
k3rn3lito has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
Zespre has quit [Ping timeout: 260 seconds]
lewix has quit [Ping timeout: 245 seconds]
burlyscudd has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
<d4x>
anyone can help me to convert a file size to human readable string, using number_to_human_size in ActionView::Helpers::NumberHelper :?
niklasb has quit [Ping timeout: 245 seconds]
DaniG2k has joined #ruby
vlad_sta_ has joined #ruby
tonini has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby
zets has quit [Ping timeout: 248 seconds]
tylersmith has joined #ruby
axl_ has quit [Quit: axl_]
Zespre has quit [Ping timeout: 260 seconds]
akells` has joined #ruby
axl_ has joined #ruby
jinie is now known as jinie_
vlad_starkov has quit [Ping timeout: 245 seconds]
Zespre has joined #ruby
Cyrus has quit [Quit: Cyrus.sleep()]
enebo has joined #ruby
alex__c2022 has joined #ruby
thams has quit [Quit: thams]
tootubular has joined #ruby
h8R has quit [Quit: Leaving]
snearch has quit [Quit: Verlassend]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
adkron has quit [Ping timeout: 240 seconds]
momomomomo has joined #ruby
scrollback has quit [Remote host closed the connection]
juarlex has quit [Ping timeout: 276 seconds]
scrollback has joined #ruby
sheep_ has joined #ruby
burlyscudd has quit [Quit: Leaving.]
jtharris has joined #ruby
tylersmith has quit [Ping timeout: 264 seconds]
mwlang has joined #ruby
cmarques has joined #ruby
Zespre has quit [Ping timeout: 245 seconds]
Zespre has joined #ruby
mklappstuhl has joined #ruby
chipotle_ has joined #ruby
<mwlang>
does anyone know where 'getopts' comes from or how to figure it out? I installed a gem that apparently doesn't declare all its dependencies correctly.
chipotle_ has quit [Max SendQ exceeded]
interactionjaxsn has joined #ruby
kobain has joined #ruby
chipotle_ has joined #ruby
<mwlang>
I found and installed the "getopt" gem, but that wasn't it.
chipotle_ has quit [Max SendQ exceeded]
tomzx_mac has quit [Ping timeout: 256 seconds]
teedex has quit [Remote host closed the connection]
<mwlang>
momomomomo: I did not know about that…will check it out.
Zespre has joined #ruby
Markvilla has joined #ruby
end_guy has joined #ruby
<mwlang>
momomomomo: it didn't take any further action.
<momomomomo>
mwlang: http://rvm.io/rvm/install - The docs are very helpful, especially if you haven't installed dvm before
sarkis has joined #ruby
<mwlang>
that's what I followed to install rvm
<momomomomo>
Gotta run, if you still have issues, and you've installed all of the correct libraries - and still have issues, come back and ask
<mwlang>
might be a problem in that I attempted the multi-user install.
vlad_sta_ has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
<mwlang>
ok
dr_bob has joined #ruby
ner0x has quit [Ping timeout: 245 seconds]
mendel has joined #ruby
philcrissman_ has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
fomatin has joined #ruby
Zespre has quit [Ping timeout: 256 seconds]
akemrir has quit [Quit: WeeChat 0.4.1]
Zespre has joined #ruby
andikr has quit [Read error: Connection reset by peer]
serp` has joined #ruby
tagrudev has quit [Remote host closed the connection]
<jrhe>
ccooke: I know its turing complete but that doesn't say much to its usefulness!
<jrhe>
ccooke: turns out my db doesnt support prepare anyway
<jrhe>
jrhe: Investigating stored procs now
Tarential has quit [Excess Flood]
burlyscudd has quit [Quit: Leaving.]
Tarential has joined #ruby
spider-mario has joined #ruby
Astralum has joined #ruby
RORgasm has joined #ruby
timkohrumel has joined #ruby
pitzips has joined #ruby
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
KarlHung1s is now known as KarlHungus
<joshu>
probably a silly question but I'm using postgres for the first time. If you create new entries and then delete them. Is it normal that the next next entries don't being at id 1? If that makes sense?
awarner has joined #ruby
rhys has joined #ruby
timkohrumel has quit [Read error: Connection reset by peer]
Zespre has quit [Ping timeout: 246 seconds]
timkohrumel has joined #ruby
Zespre has joined #ruby
devoldmx has quit [Remote host closed the connection]
generali_ has joined #ruby
devoldmx has joined #ruby
KevinSjoberg has joined #ruby
timmow has quit [Remote host closed the connection]
DaniG2k has quit [Read error: Connection reset by peer]
kenmaz has joined #ruby
RORgasm has quit [Ping timeout: 256 seconds]
DaniG2k has joined #ruby
braoru has quit [Quit: Leaving]
fomatin has quit [Quit: Computer has gone to sleep.]
sambao21 has quit [Quit: Computer has gone to sleep.]
RORgasm has joined #ruby
serp` has quit [Quit: serp`]
burlyscudd has joined #ruby
casheew has quit [Read error: Connection reset by peer]
Zespre_ has joined #ruby
mklappst_ has joined #ruby
aganov has quit [Quit: aganov]
mklappstuhl has quit [Read error: Connection reset by peer]
redgirl has quit [Quit: This computer has gone to sleep]
ner0x has joined #ruby
Zespre has quit [Ping timeout: 260 seconds]
Shirakawasuna has joined #ruby
_maes_ has joined #ruby
Zespre has joined #ruby
Shirakawasuna has quit [Read error: Connection reset by peer]
ewag_ has joined #ruby
maroloccio has joined #ruby
ewag has quit [Ping timeout: 256 seconds]
timmow has joined #ruby
nimor has joined #ruby
tylersmith has joined #ruby
tspike has joined #ruby
oceanbreeze has joined #ruby
mikecmpbll has joined #ruby
Zespre has quit [Ping timeout: 245 seconds]
Zespre has joined #ruby
bklane has quit [Remote host closed the connection]
kadoo has joined #ruby
rh1n0 has joined #ruby
haxrbyte has joined #ruby
Nitrodex has quit [Read error: Connection reset by peer]
oceanbreeze has quit [Client Quit]
tylersmith has quit [Ping timeout: 245 seconds]
_Renegade has quit [Quit: _Renegade]
bionhart has quit [Remote host closed the connection]
tk_ has quit [Quit: ばいばい]
berdario has quit [Ping timeout: 256 seconds]
Zespre has quit [Ping timeout: 246 seconds]
kadoo has quit [Client Quit]
carloslopes has quit [Remote host closed the connection]
rdark has quit [Ping timeout: 245 seconds]
Zespre has joined #ruby
kadoo has joined #ruby
timmow_ has joined #ruby
rippa has joined #ruby
geggam has joined #ruby
<rh1n0>
Hello rubyists. Im trying to create bash scripts using ruby. Is it possible to use a heredoc to create a multiline script or bash (for example) invocation?
jimg has joined #ruby
timmow has quit [Read error: Connection reset by peer]
tspike has quit [Ping timeout: 240 seconds]
<rh1n0>
i was previously creating a file and piping the contents to the file then executing the file but that seems wrong
Markvilla has quit [Read error: Connection reset by peer]
kadoo has quit [Ping timeout: 248 seconds]
thams has joined #ruby
jimg has quit [Ping timeout: 246 seconds]
alekst has joined #ruby
freeayu has quit [Remote host closed the connection]
bigoldrock has joined #ruby
zai_ has quit [Read error: Connection reset by peer]
kil0byte_ has joined #ruby
ferr has joined #ruby
<ferr>
hi
GeissT_ has quit [Quit: MillBroChat AdIRC User]
dirk2 has joined #ruby
falkoner has joined #ruby
kiela has quit [Ping timeout: 252 seconds]
tommyvyo has quit [Quit:]
kil0byte has quit [Ping timeout: 260 seconds]
ssvo has joined #ruby
mikepack has joined #ruby
tommyvyo has joined #ruby
kiela has joined #ruby
io_syl has joined #ruby
dr_bob has quit [Quit: Leaving.]
nimor has quit [Quit: nimor]
<Spooner>
rh1n0, Why on earth you'd want to do that, when you could just run Ruby to do it, is anyone's guess ;)
<rh1n0>
Spooner because i couldn't figure out how to do it with bash :)
<rh1n0>
just curious
<Spooner>
Are you trying to run Ruby from bash or bash from Ruby?
Zespre_ has joined #ruby
Zespre has quit [Ping timeout: 256 seconds]
<rh1n0>
bash from ruby
<rh1n0>
pragmatic bash programming - NOT :)
pipework has joined #ruby
<ccooke>
Heh.
<Spooner>
Yeah, but anything you can do in bash you can do better in Ruby. Isn't it better to ask how to do whatever you think you need bash to do in Ruby?
<rh1n0>
i have a bunch of bash scripts I'm using for amazon autoscaling. I want to trigger them from a ruby file being used for user-data when an instance is launched. I could do it in ruby but would need to re-write my bash scripts.
<ccooke>
Spooner: there are definitely times when it's better to use shell than bash
pitzips has quit [Ping timeout: 268 seconds]
<ccooke>
I've been writing bash fragments in ruby for the last three weeks for work, actually
<Spooner>
Oh right, just running scripts. Thought you meant heredocing the scripts inside the Ruby and then running them in sh.
<joonty>
yup, like named pipes
<joonty>
in fact, command redirection in general
<ccooke>
rh1n0: I can't share the code (atm), but yes, a here doc is fine
kiela has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 268 seconds]
chrishough has joined #ruby
<rh1n0>
thanks all - at least I know I'm not losing my mind yet
<ccooke>
Spooner: my use case is maintenance. When doing maintenance on servers, you're working with files, folders, processes, signals, etc.
<rh1n0>
ccooke: right - this is all server stuff I'm doing
<ccooke>
Spooner: shell has better tools for dealing with that than anything else, and whats more practically *everyone* can do a bit of shell script.
atno has quit [Ping timeout: 240 seconds]
<ccooke>
What shell lacks is the ability to synchronise invocation across multiple locations and ways to pass data back to subsequent scripts
sheep_ has quit [Remote host closed the connection]
<ccooke>
So I have all of that in Ruby
<rh1n0>
Storimer's book on ruby processes is very good though - I'm sure you could do everything needed in ruby i just don't have the time to rewrite the scripts yet
binaryplease has quit [Ping timeout: 260 seconds]
<ccooke>
rh1n0: even if you *can* do it, that doesn't mean ruby is the right tool for the job. In this case, it simply isn't.
<rh1n0>
ccooke: very true
Reisen has joined #ruby
DanKnox_away is now known as DanKnox
carloslopes has joined #ruby
<ccooke>
the best part of the code I'm writing is that only I (and anyone who admins the system) need to understand ruby. All the people who create a maintenance need to know is a little shell and some documentation on the shell builtins I'm suppplying.
kemist has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tootubular has quit [Quit: tootubular]
sambao21 has quit [Quit: Computer has gone to sleep.]
chrisja has joined #ruby
sambao21 has joined #ruby
Guest14976 has quit [Changing host]
Guest14976 has joined #ruby
tvw has quit []
jesly has quit [Ping timeout: 268 seconds]
axl_ has quit [Quit: axl_]
Guest14976 is now known as C0deMaver1ck
Beoran has joined #ruby
davedev24 has quit [Remote host closed the connection]
b0oh has left #ruby [#ruby]
chrishough has quit [Quit: chrishough]
johnnyfuchs has joined #ruby
<joelteon>
np
johnrlive has joined #ruby
BSaboia has joined #ruby
Beoran__ has quit [Ping timeout: 260 seconds]
DomKM has quit [Quit: Leaving.]
jesly has joined #ruby
sambao21 has quit [Client Quit]
tw1sted has quit [Ping timeout: 246 seconds]
Roa has quit [Ping timeout: 276 seconds]
k3rn3lito has quit [Ping timeout: 256 seconds]
axl_ has joined #ruby
mafolz has quit [Ping timeout: 256 seconds]
Dummies_freelanc has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
BarneyRubble has joined #ruby
k3rn3lito has joined #ruby
dpritchett has joined #ruby
slainer68 has quit [Remote host closed the connection]
gildo has quit [Ping timeout: 252 seconds]
cmarques has joined #ruby
chrishough has joined #ruby
morad has joined #ruby
niceguyjames has quit [Quit: Computer has gone to sleep.]
<BarneyRubble>
basic haml q i am stuck on - to make this <div class="foo bar" is ok I can do it in a loop fine - but i need <div class="foo bar0" then bar1,2,3 etc using the iterator i - and i keep rearranging it and nothing is working - i understand the syntax is ruby so can anyone suggest a method for me to try?
<joelteon>
.foo{:class => "bar#{i}"}
ainame has joined #ruby
ainame has quit [Client Quit]
JohnBat26 has joined #ruby
ghr has quit [Quit: Computer has gone to sleep.]
<BarneyRubble>
will try
geoffrey has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davedev24 has joined #ruby
icole has joined #ruby
<joelteon>
yeah, you can combine .class and :class => "..."
chichou has joined #ruby
ssvo has joined #ruby
ainame has joined #ruby
richiebkr has joined #ruby
geoffrey has joined #ruby
jdunck has quit [Ping timeout: 276 seconds]
timonv has joined #ruby
mahmoudimus has joined #ruby
ainame has quit [Client Quit]
Dummies_freelanc has quit [Ping timeout: 252 seconds]
ainame has joined #ruby
dmiller has quit [Remote host closed the connection]
<BarneyRubble>
joelteon, that is new syntax to me but it worked, almost perfect, that gives me - div class='bar0 foo' van i force it to div class='foo bar0' ?
morad has quit []
<joelteon>
why would you do that?
timonv has quit [Remote host closed the connection]
<BarneyRubble>
dont have a reason except it is in the html i need to generate
blaxter has quit [Ping timeout: 248 seconds]
saarinen has joined #ruby
<MrZYX>
it's equivalent
<davidcelis>
BarneyRubble: HTML doesn't care how classes are ordered
<davidcelis>
it's the same
Roa has quit [Ping timeout: 245 seconds]
icole has quit [Ping timeout: 276 seconds]
<BarneyRubble>
learn smth new every day
k3rn3lito has quit [Ping timeout: 246 seconds]
arietis has joined #ruby
alup has quit [Quit: Leaving]
AlSquire has quit [Read error: Connection reset by peer]
AlSquire has joined #ruby
relix has joined #ruby
codecop has joined #ruby
krisfremen has quit [Ping timeout: 252 seconds]
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
codezombie has joined #ruby
k3rn3lito has joined #ruby
mikepack has joined #ruby
berdario has joined #ruby
gildo has joined #ruby
Acidtrux is now known as bklang
linusoleander has quit [Quit: linusoleander]
carlyle has joined #ruby
rupee has joined #ruby
<codezombie>
is there a good way in ruby via regex to match a pattern, but don't count duplicates? For example, this pattern: (?=(\w{4})) that works, but returns duplicates. I'd like to do something like... /(?=(\w{4}){1})/ However, this doesn't work. The result from the first regex returns over 100k results. Looping through 100k results to remove duplicates is really, really slow in ruby. I'd like to speed it up.
dhruvasagar has joined #ruby
timonv has joined #ruby
ry4nn has joined #ruby
krisfremen has joined #ruby
slash_nick has joined #ruby
slash_nick has joined #ruby
slash_nick has quit [Changing host]
tw1sted has joined #ruby
nimor has joined #ruby
<apeiros>
codezombie: a) how do you remove the duplicates? b) use scan + Set
hakunin has quit [Ping timeout: 252 seconds]
hakunin has joined #ruby
dmiller has joined #ruby
<codezombie>
apeiros: I've tried a few ways to remove the duplicates... 1st, by using a select block, and checkout the count with array.count(str). 2nd, byt using delete_if with and checking the count. 3rd by using a regex to find the duplicate entries, and then looping over just the returned duplicates, and calling delete... All of that was really slow.
<codezombie>
apeiros: can you elaborate a bit more on + Set?
richiebkr has quit [Quit: richiebkr]
<codezombie>
ah nvm
wsterling has joined #ruby
<apeiros>
codezombie: well, no wonder that's slow. why didn't you simply use Array#uniq?
<codezombie>
however, set won't work because I need to remove all instance of the duplicate... so, in the instance of %w[a b c a] I should only return %w[b c]
<apeiros>
it's O(n), unlike your O(n^2) or worse custom solutions…
pipework has quit [Remote host closed the connection]
asteve has quit [Ping timeout: 256 seconds]
<codezombie>
apeiros: because uniq leaves one of the duplicate values... if > 1 exists, remove them all.
<apeiros>
o0
<codezombie>
yeah, so to my example... %w[a b c a] should result in %w[b c]
niceguyjames has joined #ruby
berdario has quit [Ping timeout: 256 seconds]
<apeiros>
I'm not sure whether your explanation still makes sense - might just me being tired, though.
mrsolo has joined #ruby
Zai00 has quit [Quit: Zai00]
Liquid-- has quit [Ping timeout: 240 seconds]
<codezombie>
k, let me try this way... take this into account: "a,b,c,a". There's 2 a's in the array. I want to remove them both, and leave only the unique values, resulting in "b,c".
richiebkr has joined #ruby
richiebkr has quit [Client Quit]
JustinAiken has joined #ruby
<codezombie>
I'm not sure how to break it down other than that. :/
<apeiros>
I don't see the connection to your initial question
<apeiros>
but for your current question, you'd use a counting hash
DomKM has joined #ruby
<apeiros>
h = Hash.new(0); ary.each do |item| h[item] += 1 end; h.select { |k,v| v == 1 }.keys
sambao21 has joined #ruby
alex__c2022 has quit [Quit: alex__c2022]
wsterling has quit [Read error: Connection reset by peer]
<codezombie>
apeiros: it's a simplified version. basically, "a,b,c,a" is the result of the first regex (?=(\w{4})). 4 being a arbitrary number, just specifiying length to match. Could be 1, could be 100... Anyhow, I'd like to (if possible) modify the regex to not return the duplicates, so no further processing is required.
burlyscudd has quit [Quit: Leaving.]
wsterling has joined #ruby
<codezombie>
I think I need more caffeine.
<codezombie>
loops, no matter what I do in them are slow, since the number of iterations can be 100k+
persand has joined #ruby
persand has quit [Client Quit]
timonv has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
trent has quit [Quit: WeeChat 0.3.2]
axl_ has quit [Quit: axl_]
<codezombie>
apeiros: thanks again, that works perfectly
LarsSmit has joined #ruby
Al__ has quit [Quit: Al__]
AlHafoudh has joined #ruby
havenwood has joined #ruby
geoffrey has joined #ruby
mikk has joined #ruby
axl_ has joined #ruby
generali_ has quit [Remote host closed the connection]
io_syl has joined #ruby
saarinen has quit [Quit: saarinen]
boblu has quit [Ping timeout: 256 seconds]
rh1n0 has quit [Quit: -- I'm out --]
adambeynon has joined #ruby
terrellt has quit [Ping timeout: 252 seconds]
krisfremen has quit [Read error: Operation timed out]
mikk has quit [Ping timeout: 240 seconds]
hattusili_III has joined #ruby
saarinen has joined #ruby
davedev24 has quit [Remote host closed the connection]
mengu has joined #ruby
davedev24 has joined #ruby
jdunck has joined #ruby
rupee is now known as waffleblotter
jbpros has joined #ruby
waffleblotter is now known as wafflerust
wafflerust is now known as waffleblotter
enebo has quit [Quit: enebo]
burlyscudd has joined #ruby
mark_locklear has joined #ruby
jacobw has joined #ruby
terrellt has joined #ruby
richiebkr has joined #ruby
emmanuelux has joined #ruby
burlyscudd has quit [Client Quit]
burlyscudd has joined #ruby
thoughtpunch has joined #ruby
werdnativ has joined #ruby
waffleblotter is now known as rsut
splittingred has quit [Quit: splittingred]
krisfremen has joined #ruby
krisfremen has quit [Changing host]
krisfremen has joined #ruby
jbpros has quit [Ping timeout: 256 seconds]
icole has joined #ruby
hattusili_III has quit [Ping timeout: 256 seconds]
rdark_ has joined #ruby
rsut has quit [Quit: Leaving]
xardas has quit [Remote host closed the connection]
jimg has joined #ruby
rupee has joined #ruby
iamjarvo has joined #ruby
rdark has quit [Ping timeout: 264 seconds]
richiebkr has quit [Read error: Connection reset by peer]
jrhe has quit [Quit: jrhe]
elliptical has quit [Read error: Connection reset by peer]
BSaboia has quit [Ping timeout: 268 seconds]
ellipse has joined #ruby
richiebkr has joined #ruby
hattusili_III has joined #ruby
rdark_ has quit [Ping timeout: 246 seconds]
jimg has quit [Ping timeout: 264 seconds]
berdario has joined #ruby
ramblex has quit [Remote host closed the connection]
splittingred has joined #ruby
niklasb has joined #ruby
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tootubular has joined #ruby
RORgasm has quit [Ping timeout: 245 seconds]
dmiller has quit [Remote host closed the connection]
RORgasm has joined #ruby
rdark has joined #ruby
estebanrules has joined #ruby
mocfive has joined #ruby
caleon has joined #ruby
jbpros has joined #ruby
robscomputer has quit [Ping timeout: 276 seconds]
jesly has quit [Quit: Leaving.]
mfletcher has joined #ruby
heftig has quit [Quit: Quitting]
bradleyprice has joined #ruby
<MarcWeber>
is there a standard way to run compilers using rake, such as ocamlopt?
MarcWeber has left #ruby [#ruby]
MarcWeber has joined #ruby
hattusili_III has quit [Ping timeout: 256 seconds]
heftig has joined #ruby
brotatos has joined #ruby
adambeynon has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akells` has quit [Remote host closed the connection]
axl_ has quit [Ping timeout: 240 seconds]
heftig has quit [Client Quit]
sayan has quit [Ping timeout: 245 seconds]
atmosx has joined #ruby
heftig has joined #ruby
<Xeago>
which patch version of 1.9.3 is recommended
<Xeago>
392?
fermion has quit [Ping timeout: 245 seconds]
ferdev has joined #ruby
<lectrick>
Does anyone have any opinion on exposing simple sequential integer ID's (database ID's) in an API (or not)?
sideshowcoder has quit [Read error: Operation timed out]
<lectrick>
I'm wondering when the time is to consider GUID's
daaaan_ is now known as daaaan
jbpros has quit [Quit: jbpros]
<Xeago>
lectrick: usually GUIDs come in to play once you have to generate keys across multiple locations at the same tim
<Xeago>
e
atmosx has quit [Client Quit]
<havenwood>
Xeago: Why no p429?
<lectrick>
Since API's are partly to facilitate interoperability between systems, I felt that database ID collision suddenly becomes more of a factor
<lectrick>
Xeago: ^
davedev24 has quit [Remote host closed the connection]
rezzack has joined #ruby
<Xeago>
havenwood: more widespread use, seemed to be the most popular one of the 1.9.3 series
<Xeago>
but 429 is fine I spose
<Xeago>
lectrick: tell your API consumers to treat keys as variable length strings, they won't generate them
s3m73x has quit [Remote host closed the connection]
fermion has joined #ruby
<Xeago>
Don't get how those would collide?
nomenkun has joined #ruby
zigomir has joined #ruby
<Xeago>
If I remember correctly the standardized ISO has 56bits more than plenty for most usecases
pkrnj has joined #ruby
<lectrick>
Xeago: If we expose simple database ID's, and they wanted to import any of that data and it was relational, ID collision becomes an issue mitigated by UUID's
BizarreCake has quit [Ping timeout: 246 seconds]
rdark has quit [Ping timeout: 240 seconds]
axl_ has joined #ruby
Voodoofish430 has left #ruby [#ruby]
<Xeago>
lectrick: still don't see the problem, if you are generating the ID's on atomically (on 1 machine or multiple in communication) there is no problem
sideshowcoder has joined #ruby
alex__c2022 has joined #ruby
rdark has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
tobiasvl has quit [Ping timeout: 260 seconds]
axl_ has quit [Client Quit]
chipotle_ has joined #ruby
chipotle_ has quit [Max SendQ exceeded]
browndawg has quit [Ping timeout: 240 seconds]
Oddnoun_ has joined #ruby
chipotle_ has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
Oddnoun has quit [Ping timeout: 240 seconds]
Oddnoun_ is now known as Oddnoun
kadoo has joined #ruby
chipotle_ has quit [Client Quit]
kadoo has quit [Max SendQ exceeded]
Pequinno has joined #ruby
mwlang has quit [Quit: mwlang]
kadoo has joined #ruby
<BarneyRubble>
another basic question, this time of concepts not syntax, can haml and scss share variables?
sambao21 has quit [Quit: Computer has gone to sleep.]
icole_ has joined #ruby
milardovich has joined #ruby
<MrZYX>
I guess that's more a #RubyOnRails question
rdark has quit [Ping timeout: 268 seconds]
Squarepy has joined #ruby
tobiasvl has joined #ruby
guilleiguaran__ is now known as guilleiguaran_
<Mon_Ouie>
MarcWeber: There's the rule syntax to specify how to use it (like make's rules if you're familiar with them) and inside those rules you'd just use the #sh method to call your compiler with the input file
bionhart has quit [Remote host closed the connection]
z has joined #ruby
thejefflarson___ has quit [Ping timeout: 276 seconds]
Naeblis has quit [Ping timeout: 264 seconds]
fermion has quit [Quit: Computer has gone to sleep.]
chiel has joined #ruby
cool has joined #ruby
z is now known as Guest37788
madnificent has quit [Ping timeout: 248 seconds]
caveat- has joined #ruby
devoldmx has quit [Quit: Bye]
strax has joined #ruby
dnyy has quit [Ping timeout: 264 seconds]
swistak35 has joined #ruby
nyuszika7h_ has joined #ruby
chuk has joined #ruby
devoldmx has joined #ruby
_rgn has quit [Ping timeout: 262 seconds]
rcsheets has quit [Ping timeout: 240 seconds]
Kabaka has joined #ruby
jerius has quit [Ping timeout: 268 seconds]
sonne has quit [Ping timeout: 248 seconds]
patbr0wn has quit [Ping timeout: 245 seconds]
18WADFR2B has quit [Ping timeout: 246 seconds]
Bish has joined #ruby
rdark has quit [Ping timeout: 240 seconds]
patbr0wn has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
mtlatif__ has joined #ruby
prime has quit [Ping timeout: 246 seconds]
rcsheets has joined #ruby
sumark has quit [Remote host closed the connection]
alex88 has joined #ruby
dpritchett has quit [Quit: This computer has gone to sleep]
burlyscudd has joined #ruby
guilleiguaran__ has joined #ruby
ZadYree has joined #ruby
Spami has joined #ruby
nyuszika7h_ is now known as nyuszika7h
jtharris has quit [Quit: WeeChat 0.4.0]
martxel has joined #ruby
sumark has joined #ruby
prime has joined #ruby
parus has joined #ruby
martxel is now known as Guest28377
sonne has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
rcsheets has left #ruby [#ruby]
niklasb has joined #ruby
saarinen has quit [Quit: saarinen]
byprdct has quit [Ping timeout: 240 seconds]
rdark_ has quit [Ping timeout: 252 seconds]
sambao21 has joined #ruby
fermion has joined #ruby
relix has joined #ruby
vlad_starkov has joined #ruby
atno has quit [Quit: Leaving]
rdark has joined #ruby
JumpMast3r has joined #ruby
atno has joined #ruby
Doc_X has quit [Read error: Connection reset by peer]
dirk1 has quit [Quit: Leaving.]
atno has quit [Client Quit]
Voodoofish430 has quit [Read error: Connection reset by peer]
busybox42 has quit [Read error: Operation timed out]
iamjarvo has joined #ruby
ndngvr has quit [Read error: Operation timed out]
Doc_X has joined #ruby
ddd has quit [Read error: Operation timed out]
uxp has quit [Read error: Operation timed out]
chrishough has quit [Quit: chrishough]
xibalba has quit [Ping timeout: 252 seconds]
Voodoofish430 has joined #ruby
CreamTart has quit [Read error: Operation timed out]
pitzips has quit [Ping timeout: 276 seconds]
atno has joined #ruby
jbpros has quit [Read error: Connection reset by peer]
uxp has joined #ruby
jbpros has joined #ruby
bricker has quit [Quit: leaving]
d2dchat has joined #ruby
sayan has joined #ruby
yacks has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
busybox42 has joined #ruby
CreamTart has joined #ruby
yacks has joined #ruby
xibalba has joined #ruby
ddd has joined #ruby
JustinAiken has joined #ruby
JustinAiken has quit [Client Quit]
estebanrules has quit [Quit: estebanrules]
Havoc_ has joined #ruby
scipi0 has quit [Ping timeout: 264 seconds]
jdunck has quit [Ping timeout: 276 seconds]
mocfive has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
Guest37788 has quit [Changing host]
Guest37788 has joined #ruby
tw1sted has joined #ruby
jdunck has joined #ruby
Guest37788 is now known as z
myappleguy has left #ruby [#ruby]
ferr has joined #ruby
brennanMKE has quit [Remote host closed the connection]
brice_ has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
mocfive has joined #ruby
jasonkuhrt has joined #ruby
<brice_>
hi guys
mmlac-bv has quit [Quit: mmlac-bv]
johnrlive has joined #ruby
vlad_starkov has joined #ruby
<MrZYX>
hi
kevinykchan has quit [Quit: Computer has gone to sleep.]
<brice_>
im new to ruby/irc
<brice_>
so..what do you guys talk about here? haha
brianpWins has joined #ruby
<MrZYX>
ruby!
bricker has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<havenwood>
brice_: About the new look of Github repos... what do you think?!
paissad_ has quit [Ping timeout: 246 seconds]
sayan has quit [Ping timeout: 256 seconds]
<MrZYX>
it's active already for you?
<havenwood>
MrZYX: Ya, a banner popped up offering.
<havenwood>
MrZYX: I figured it did for everyone? Maybe they're doing a gradual rollout?
<brice_>
nothing changed for me yet
<MrZYX>
according the the blog post they do
<MrZYX>
did get the banner yet
<MrZYX>
did you recall the link? :P
<MrZYX>
*do you
cantonic has joined #ruby
eldariof has quit [Ping timeout: 240 seconds]
<havenwood>
hrm, nope
<brice_>
MrZYX and havenwood: hi guys, i still dont know much about github. i just got into ruby/rails last month.
Dekade has joined #ruby
jtharris has joined #ruby
<havenwood>
brice_: Lots of great Ruby to read on the Githubs and open source projects to contribute to.
Davey has quit [Quit: Computer has gone to sleep.]
<brice_>
havenwood: what does it mean to contribute? im still a noob...what do i have to contribute? haha
<havenwood>
brice_: A great thing to contribute early on is documentation!
<brice_>
havenwood: is contributing like offering advice?
<havenwood>
brice_: I had fun doing manpages for chruby and ruby-install. Been meaning to write a less-pathetic manpage for gem.
Spami has quit [Ping timeout: 264 seconds]
bionhart has joined #ruby
fermion has quit [Quit: Computer has gone to sleep.]
<havenwood>
brice_: Contributing is everything from opening an Issue ticket with a feature idea or bug you've noticed, to fixing typos in the README.md, or adding code.
<brice_>
havenwood: ohh i see
paissad_ has joined #ruby
<brice_>
havenwood: i can def do spell check..
<havenwood>
brice_: Fixing README typos is a way to contribute if you can't write code at all but you can spell! (I can't.)
workmad3 has joined #ruby
<brice_>
havenwood: hahah. what would you say are good ways to practice coding in ruby?
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Evixion has joined #ruby
Kar- has joined #ruby
obs has quit [Quit: Konversation terminated!]
Criztian has joined #ruby
Weems has quit [Changing host]
Weems has joined #ruby
mfletcher has left #ruby [#ruby]
JustinAiken has joined #ruby
yekta has quit [Quit: yekta]
jimg has joined #ruby
axl_ has quit [Quit: axl_]
Floydzy has quit [Quit: Floydzy]
boblu has quit [Ping timeout: 264 seconds]
failshell has joined #ruby
chichou has quit [Remote host closed the connection]
bklane has joined #ruby
brice_ has left #ruby ["Leaving"]
Al__ has joined #ruby
JustinAiken has quit [Client Quit]
cj3kim has quit [Remote host closed the connection]
daniel_hinojosa has quit [Ping timeout: 246 seconds]
zeade has quit [Quit: Leaving.]
pentameter has quit [Read error: Connection reset by peer]
thoolihan has joined #ruby
zeade has joined #ruby
jimg has quit [Ping timeout: 240 seconds]
Jackneill has quit [Ping timeout: 264 seconds]
ivanoats has joined #ruby
cj3kim has joined #ruby
zmike123 has quit [Quit: Выходжу]
chrishough has joined #ruby
mansi has joined #ruby
PigDude has left #ruby [#ruby]
vlad_starkov has quit [Remote host closed the connection]
brbcoding has quit [Ping timeout: 245 seconds]
zer0-day has quit [Quit: zer0-day]
timonv has quit [Remote host closed the connection]
cofin has joined #ruby
JustinAiken has joined #ruby
cofin has quit [Client Quit]
xardas has joined #ruby
xardas has quit [Changing host]
xardas has joined #ruby
v0n has quit [Read error: Operation timed out]
ndngvr has joined #ruby
JustinAiken has quit [Client Quit]
amedeiros has quit [Ping timeout: 256 seconds]
harrymoreno_ has joined #ruby
harrymoreno has quit [Ping timeout: 256 seconds]
harrymoreno_ is now known as harrymoreno
byprdct has quit [Read error: Connection reset by peer]
k610 has joined #ruby
anonymuse has joined #ruby
kayloos has quit [Remote host closed the connection]
nomenkun has quit [Remote host closed the connection]
kpshek has joined #ruby
huoxito has quit [Quit: Leaving]
brennanMKE has quit [Read error: Connection reset by peer]
bricker_ has joined #ruby
brennanMKE has joined #ruby
kirun has quit [Quit: Client exiting]
Apane has joined #ruby
threesome has joined #ruby
cj3kim has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 276 seconds]
byprdct has joined #ruby
brennanM_ has joined #ruby
brennanMKE has quit [Ping timeout: 252 seconds]
atno has quit [Remote host closed the connection]
atno has joined #ruby
ner0x has quit [Quit: Leaving]
geekbri has quit [Remote host closed the connection]
bricker_ is now known as bricker
thoolihan has quit [Quit: thoolihan]
tw1sted has quit [Quit: tw1sted]
AlHafoudh has quit [Quit: Computer has gone to sleep.]
chipotle_ has joined #ruby
`MArceLL` has joined #ruby
falkoner1 has left #ruby [#ruby]
Zai00 has quit [Quit: Zai00]
mocfive has quit [Remote host closed the connection]
RORgasm_ has joined #ruby
RORgasm has quit [Read error: Connection reset by peer]
mocfive has joined #ruby
krawchyk_ has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 248 seconds]
kasper has quit [Remote host closed the connection]
TheFuzzball has quit [Ping timeout: 276 seconds]
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
mmlac-bv has quit [Quit: mmlac-bv]
milardovich has quit [Quit: Leaving]
v0n has joined #ruby
Guga_ has joined #ruby
carlyle has quit [Remote host closed the connection]
estebanrules has joined #ruby
Kovensky has quit [Ping timeout: 252 seconds]
phasma has joined #ruby
mroth has joined #ruby
freerobby has quit [Quit: Leaving.]
heidar has joined #ruby
vlad_starkov has joined #ruby
karnowski has joined #ruby
moeSeth has joined #ruby
bluehavana has joined #ruby
TheHodge has joined #ruby
Spaceghost|cloud has joined #ruby
carloslopes has quit [Remote host closed the connection]
im0b has joined #ruby
wyan has quit [Read error: Operation timed out]
zphobic has quit [Read error: Operation timed out]
zphobic has joined #ruby
notbrent__ has joined #ruby
Guest85414__ has joined #ruby
yeban has joined #ruby
mark_locklear has quit [Ping timeout: 252 seconds]
motto has joined #ruby
fcoury__ has joined #ruby
Bry8Star{T2 has joined #ruby
geggam has quit [Remote host closed the connection]
dnyy has joined #ruby
Al__ has quit [Read error: Connection reset by peer]
xerxas has joined #ruby
freerobby has joined #ruby
geoffw8_ has joined #ruby
mansi has quit [Read error: Connection reset by peer]
rwz__ has joined #ruby
Al__ has joined #ruby
mmitchel_ has joined #ruby
prophile has quit [Read error: Operation timed out]
mansi has joined #ruby
vaicine has quit [Read error: Operation timed out]
mansi has quit [Read error: Connection reset by peer]
burlyscudd has quit [Quit: Leaving.]
[Neurotic] has joined #ruby
JustinAiken has joined #ruby
mansi has joined #ruby
mansi has quit [Read error: Connection reset by peer]
Naeblis has joined #ruby
vaicine has joined #ruby
mansi has joined #ruby
mmitchell has quit [Ping timeout: 252 seconds]
thejefflarson___ has joined #ruby
mmlac-bv has joined #ruby
m8 has quit [Ping timeout: 264 seconds]
NimeshNeema has joined #ruby
mansi has quit [Read error: Connection reset by peer]
JustinAiken has quit [Client Quit]
mansi has joined #ruby
coreinfo99 has quit [Ping timeout: 255 seconds]
keyvan has joined #ruby
dmiller has quit [Remote host closed the connection]
prophile has joined #ruby
Hanmac1 has quit [Ping timeout: 245 seconds]
ELLIOTTCABLE has quit [Remote host closed the connection]
wyan has joined #ruby
ELLIOTTCABLE has joined #ruby
mikepack has quit [Remote host closed the connection]
_rgn has joined #ruby
mwlang has joined #ruby
mikepack has joined #ruby
<mwlang>
I have installed a gem that is failing when encountering the following line: "require 'getopts'" This is on Ruby 2.0. Does anyone know what provides getopts?
wsterling has quit [Read error: Connection reset by peer]
hattusili_III has quit [Ping timeout: 240 seconds]
adambeynon has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<DrIDK>
is it possible to create : my_stuff :namer
citizensinspace has joined #ruby
<pontiki>
DrIDK: is the question you're asking "how does a DSL work?"
jbpros has quit [Quit: jbpros]
<pontiki>
DSL == Domain Specific Language
amedeiros has quit [Ping timeout: 256 seconds]
<DrIDK>
pontiki, I dont know what's a DSL.. so, I will search it as a keyword , thx
vlad_starkov has quit [Ping timeout: 264 seconds]
nowthatsamatt has quit [Quit: nowthatsamatt]
<pontiki>
you are welcome
<pontiki>
martin fowler might be the name to start with in that regard
<slash_nick>
It seems like he's wanting to create his own class methods to call inside the class... methods like "attr_reader :blah", "format :json", "helper do;end"
saarinen has quit [Quit: saarinen]
<pontiki>
that's how you do it
atyz has joined #ruby
<pontiki>
rspec provides a DSL, capybara provides a DSL, many many areas have had DSLs made; rake and thor have DSLs, and so on
scrollback has quit [Remote host closed the connection]
scrollback has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
jimg has joined #ruby
DrIDK has quit [Remote host closed the connection]
jerius has quit [Ping timeout: 248 seconds]
<wuest>
Is there an interface in ruby to sigsuspend/equivalent functionality? Not seeing one, but maybe there's something esoteric in stdlib I haven't found...
wmoxam has quit [Ping timeout: 245 seconds]
nfk is now known as Harima_Kenji
kindjal has joined #ruby
niceguyjames has joined #ruby
amedeiros has joined #ruby
TheFuzzball has joined #ruby
<pontiki>
Process class, maybe? trapping the SIG?
<pontiki>
haven't done that, but that's where i'd start
DrCode has joined #ruby
<wuest>
Yeah, been digging there. And just trapping the SIG doesn't block, leading to busy waiting, which is what I want to avoid.
chrisja has quit [Quit: leaving]
brotatos has quit [Read error: Operation timed out]
jimg has quit [Ping timeout: 268 seconds]
arya_ has quit [Ping timeout: 248 seconds]
zets has quit [Ping timeout: 252 seconds]
iamjarvo has joined #ruby
adkron has quit [Ping timeout: 246 seconds]
amedeiros has quit [Ping timeout: 260 seconds]
amedeiros has joined #ruby
AndChat| has quit [Ping timeout: 245 seconds]
Aaaarg has joined #ruby
tw1sted has joined #ruby
chichou has joined #ruby
Banistergalaxy has joined #ruby
chipotle_ has joined #ruby
<pontiki>
crikey, i found something in the debugger
thoughtpunch has quit [Remote host closed the connection]
bklane_ has joined #ruby
freerobby has quit [Quit: Leaving.]
terrellt has quit [Ping timeout: 248 seconds]
amedeiros has quit [Ping timeout: 264 seconds]
generalissimo has joined #ruby
amedeiros has joined #ruby
athst has joined #ruby
amedeiros has quit [Read error: Connection reset by peer]
adkron has joined #ruby
bklane has quit [Ping timeout: 264 seconds]
Guest28377 is now known as martxel
martxel has quit [Changing host]
martxel has joined #ruby
elliptical has quit [Read error: Connection reset by peer]
atyz has joined #ruby
ellipse has joined #ruby
Alina-malina has quit [Ping timeout: 246 seconds]
atyz has quit [Read error: Connection reset by peer]
atyz has joined #ruby
wmoxam has quit [Ping timeout: 256 seconds]
amedeiros has joined #ruby
LucasTT_ is now known as LucasTT_away
lewix has quit [Remote host closed the connection]
coreinfo99 has joined #ruby
johnnyfuchs has quit [Remote host closed the connection]
Aaaarg has quit [Quit: Aaaarg]
tw1sted has quit [Quit: tw1sted]
shadoi has quit [Quit: Leaving.]
shadoi has joined #ruby
amedeiros has quit [Ping timeout: 256 seconds]
fermion has joined #ruby
chxane has joined #ruby
amedeiros has joined #ruby
devoldmx has joined #ruby
pkrnj has joined #ruby
jimg has joined #ruby
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
ivanoats has quit [Remote host closed the connection]
DonRichie has quit [Quit: Verlassend]
devoldmx3 has quit [Ping timeout: 252 seconds]
axl_ has quit [Quit: axl_]
dmiller has quit [Remote host closed the connection]
Dummies_freelanc has joined #ruby
Dummies_freelanc has quit [Max SendQ exceeded]
bklane_ has quit [Remote host closed the connection]
amedeiros has quit [Ping timeout: 246 seconds]
tatsuya_o has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
amedeiros has joined #ruby
v0n has quit [Read error: Operation timed out]
<Eiam>
in SomeHash.reduce({},:update) whats the :update do?
ntus1017 has joined #ruby
Aaaarg has joined #ruby
ivanoats has joined #ruby
byprdct has quit [Ping timeout: 252 seconds]
mklappstuhl has quit [Ping timeout: 240 seconds]
ELLIOTTCABLE has quit [Remote host closed the connection]
amedeiros has quit [Ping timeout: 248 seconds]
ELLIOTTCABLE has joined #ruby
amedeiros has joined #ruby
ArchBeOS has joined #ruby
jacobw has quit [Quit: WeeChat 0.4.0]
zigomir has quit [Ping timeout: 264 seconds]
sailias has joined #ruby
ravster has joined #ruby
dmiller has joined #ruby
patbr0wn has quit [Ping timeout: 252 seconds]
wsterling has quit [Remote host closed the connection]
amedeiros has quit [Read error: Operation timed out]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amedeiros has joined #ruby
jrhe has joined #ruby
<Spooner>
Eiam, It is equivalent to [hash1, hash2, hash3].reduce({}) {|m, e| m.update e } (Doesn't actually make sense if it is a hash being reduced, not an Array of Hashes).
jrhe has quit [Client Quit]
bradleyprice has joined #ruby
lewix has joined #ruby
predator117 has joined #ruby
<Eiam>
err, yeah it was array of hashes
<Eiam>
okay so update is being called on a hash
Aaaarg has quit [Quit: Aaaarg]
gyre007 has joined #ruby
amedeiros has quit [Ping timeout: 240 seconds]
nezumi has joined #ruby
mocfive has quit [Remote host closed the connection]
<Eiam>
(wasn't aware of .update) which is apparently hte same as merge?
jonathanwallace has quit [Ping timeout: 252 seconds]
<pontiki>
as slash_nick points out, may want to emulate symbolize as well?
devoldmx has joined #ruby
<mindeavor>
if I'm developing a gem, and I have json files inside the gem's directory, how can I load them from code inside the gem's lib/ folder?
amedeiros has quit [Ping timeout: 240 seconds]
<havenwood>
mindeavor: require_relative
Fire-Dragon-DoL1 has joined #ruby
Fire-Dragon-DoL1 has left #ruby [#ruby]
<pontiki>
are you looking how to find the files?
amedeiros has joined #ruby
_maes_ has joined #ruby
Fire-Dragon-DoL1 has joined #ruby
burlyscudd has quit [Ping timeout: 276 seconds]
<pontiki>
i don't think requiring json files will do much good
Fire-Dragon-DoL1 has quit [Client Quit]
<pontiki>
as they aren't ruby
<havenwood>
hehe
niklasb has quit [Ping timeout: 240 seconds]
<mindeavor>
pontiki: yes. For example, in lib/myfile.rb, I'd like to load a json file
bklane has joined #ruby
<havenwood>
pontiki: good point >.>
<pontiki>
look at File.expand_path
sambao21 has quit [Quit: Computer has gone to sleep.]
<pontiki>
for instance File.expand_path(__FILE__, '../..')
cj3kim has quit [Remote host closed the connection]
<havenwood>
mindeavor: do you know the names of the json files or are you globbing them?
<pontiki>
oops
<havenwood>
mindeavor: Ruby 2.0?
patbr0wn has joined #ruby
<pontiki>
for instance File.expand_path(File.dirname(__FILE__), '../..')
<mindeavor>
havenwood: I do know the names, and I'm running 1.9
<pontiki>
that should give you the root directory of your gem
<mindeavor>
pontiki: Would I put that inside the main lib/gem_name.rb file?
devoldmx has quit [Ping timeout: 252 seconds]
<Apane>
So, I'm using feedzirra gem (https://github.com/pauldix/feedzirra) for parsing and displaying RSS data. However, I'm having trouble displaying different feeds. The code in my view is displaying FeedEntry.all, albeit, I'd like to display several different feeds under different headers. Here's the gist of it: https://gist.github.com/anonymous/5801535
<pontiki>
so: json_files = Dir.glob(#{File.expand_path(File.dirname(__FILE__),'../..')}/*.json)
Inside has joined #ruby
<mindeavor>
thanks pontiki, I will try that now
<pontiki>
that's not quite it, but i think you get the idea?
<mindeavor>
I think so. we'll see
<pontiki>
like that thing in the Dir.glob needs to be in quotes
richiebkr has joined #ruby
amedeiros has quit [Ping timeout: 246 seconds]
<pontiki>
mindeavor: where you put it may change the depth of the '../..' part
amedeiros has joined #ruby
<pontiki>
lib/ should be '../..'; lib/gem_name should be '../../..' i think?
<havenwood>
mindeavor: In Ruby 2.0 you can use __dir__, when you upgrade: File.join(__dir__, '../whatev.json')
Norrin has quit [Excess Flood]
DanKnox is now known as DanKnox_away
<pontiki>
^
<pontiki>
so much nicer that File.dirname(__FILE__) all over!
<mindeavor>
havenwood: thanks for the info, though I'd rather my gem not require 2.0
banisterfiend has joined #ruby
<havenwood>
mindeavor: ah, yes - good point
atyz has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
atyz has joined #ruby
huoxito has joined #ruby
hattusili_III has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
Norrin has joined #ruby
<havenwood>
pontiki: Also replaces expand_path too, so __dir__ instead of File.expand_path(File.dirname(__FILE__))