<bricker88>
Yes, I generally like to use reverse_merge, because it seems most concise
gavit has quit [Read error: Connection timed out]
bricker88 has quit [Quit: Leaving.]
shiki has quit [Remote host closed the connection]
gavit has joined #ruby
Liothen_ has joined #ruby
iamjarvo has joined #ruby
tommyvYo has joined #ruby
tommyvYo has joined #ruby
tommyvYo has quit [Changing host]
recycle has joined #ruby
Juul has joined #ruby
nari has quit [Ping timeout: 240 seconds]
Liothen has quit [Ping timeout: 260 seconds]
brianpWins has quit [Quit: brianpWins]
opus has quit [Quit:]
mssola has quit [Quit: Konversation terminated!]
bluebie has joined #ruby
kenichi has quit [Remote host closed the connection]
deo has joined #ruby
butblack has joined #ruby
<adeponte>
Hey all. I have a ruby file with a bunch of top level defined classes and modules defined in a file called foo.rb. I want to encapsulate all the things defined in that file without editing that file. Is there a way I can take a require that file inside a module in another file to scope all those classes to that containing module?
<adeponte>
I tried to do a straight require of foo.rb inside the containing module and that didn't seem to scope it.
banisterfiend has quit [Remote host closed the connection]
<Axsuul>
encapsulate?
<Axsuul>
do you just want to require that file?
<Axsuul>
if so, you need require_relative
banisterfiend has joined #ruby
ryan0x2 has quit [Remote host closed the connection]
graspee has quit [Quit: leaving]
davidcelis has joined #ruby
nwest has joined #ruby
Patteh has joined #ruby
shadoi has joined #ruby
chessguy has joined #ruby
andrewhl has joined #ruby
ianbrandt has quit [Quit: ianbrandt]
banisterfiend has quit [Ping timeout: 244 seconds]
krusty_ar has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
havenn has quit [Read error: Connection reset by peer]
adamkittelson has quit [Remote host closed the connection]
havenn has joined #ruby
graspee has joined #ruby
Juul has quit [Ping timeout: 268 seconds]
robbyoconnor has quit [Read error: Connection reset by peer]
<adeponte>
Axsuul: yeah, so I have a file foo.rb which has a bunch of classes defined in it Scope, Event, etc. Stuff that should be namespaced inside a module but isn't
<Axsuul>
adeponte: do you have pseudo code you can show
<Axsuul>
or just any code
<adeponte>
Axsuul: let me get you a pastie real quick
havenn has quit [Ping timeout: 260 seconds]
Synthead has quit [Quit: p33 ba115]
gavit has quit [Read error: Connection timed out]
<adeponte>
Axsuul: https://gist.github.com/3420747 that is the file that I want to include inside of a module some how. Note: It has its own requires at the top. I am not sure if that is a problem
<Squee->
is there some kind of thing like easy_install? or CPAN/
shadoi has quit [Read error: Connection reset by peer]
<wallerdev>
find is included in the stdlib
<wallerdev>
so you would just do require 'find'
<Cache_Money>
Are there any algorithms (Beyond just a 'word count') that I can run on a list of terms (1 to many words) with a corresponding weighted-value ?
<Squee->
Sorry if i sound like an idiot
<wallerdev>
but rubygems is the main tool used to install libraries
<Squee->
i'm just reading perl code and learning the basics
<Seich>
Squee-: take a look at ruby gems
thomas is now known as woman
<Squee->
i learn faster by example
<Cache_Money>
I've heard of MapReduce but wanted to see if there was anything similar in ruby...
locriani_ has joined #ruby
locriani has quit [Read error: Connection reset by peer]
woman is now known as thomas
<Squee->
Damn, this laptop is fucked
<wallerdev>
Cache_Money: not really sure what you're asking, how do you want them weighted?
<Squee->
have to pkill Chrome all the time
<Squee->
it just hangs up
abahkaiyisah has joined #ruby
<Squee->
I wish i had a cache of money..
<wallerdev>
dont we all :p
mrdodo has quit [Remote host closed the connection]
circlicious has joined #ruby
<circlicious>
how do i .each to get both array element and index in the block?
<banisterfiend>
circlicious: each_with_index
<circlicious>
thanks bai
<circlicious>
banisterfiend:
headius has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
<Cache_Money>
wallerdev: They are already weighted. However, the same concept might be represented in multiple ways. For example, the Thanksgiving dish 'yams' might be listed along with 'sweet potatoes' but it's the same type of dish.
<Cache_Money>
Not to mention having to deal with singular/plural differences
<bluebie>
he can recite it from memory by tapping it out through his feet as little voltages if you sit him on top of something piezoelectric like a quartz crystal!
<wallerdev>
lol
<wallerdev>
interesting
<bluebie>
ruby helped teach him nyan cat's song, by reading in a midi version and explaining it more simply to his little mind (which can't run ruby, sadly)
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
Matt_ has joined #ruby
Matt_ is now known as Guest93953
cousine has quit [Remote host closed the connection]
g_rotbart has quit [Read error: Connection reset by peer]
<lectrick>
How do I alias a class method without using class << self ?
<wallerdev>
you could use class_eval
<abahkaiyisah>
hi all goodmorning
maletor has quit [Quit: Computer has gone to sleep.]
<wallerdev>
morning
uris has joined #ruby
<fowl>
lectrick: this is the last one you get for free: String.instance_eval do alias f try_convert end
<lectrick>
wallerdev: banisterfiend: I tried this: String.respond_to?(:try_convert) #=> true. OK so String.class_eval{ alias_method :whatever, :try_convert } ... fail
<lectrick>
ah shit you're right
<lectrick>
fowl: beer++
coyo has joined #ruby
<banisterfiend>
fowl rules
<banisterfiend>
differences between instance_eval and class_eval are a bit subtle
<lectrick>
fowl: banisterfiend: it's still failing
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<wallerdev>
String.class_eval{ alias :whatever :upcase }
<wallerdev>
"apple".whatever #=> "APPLE"
g_rotbart has joined #ruby
<wallerdev>
or am i missing something
<lectrick>
is it possible that alias works but not alias_method ?
<fowl>
lectrick: i remember it like this, class_eval will run as if you called class, if you want the metaclass you dont have to eval stuff to define methods on class, def String.myClassMethod() :WHOO end
<banisterfiend>
wallerdev: he said a class method
<wallerdev>
oh my bad
<banisterfiend>
wallerdev: that aliases an *instance* method
<lectrick>
String.instance_eval do alias_method :f, :try_convert end # definitely fails, but alias by itself works
<banisterfiend>
lectrick: yes it's possible, it's the truth
<banisterfiend>
lectrick: alias will work inside instance_eval to alias a class method, but alias_method will only alias instance methods
<banisterfiend>
that's why i said teh differences between class_eval and instance_eval were subtle
<lectrick>
interesting and subtle
g_rotbart has quit [Remote host closed the connection]
Bosox20051 has quit [Quit: Leaving]
<banisterfiend>
but no issue for fowl, that's why he's up there
<banisterfiend>
and you're down there
<banisterfiend>
;)
<fowl>
lol
Guest93953 has quit [Ping timeout: 244 seconds]
g_rotbart has joined #ruby
<lectrick>
well we have an additional problem. i'm trying to do it dynamically so alias_method "_original_#{cm}", cm
<lectrick>
banisterfiend: ^
<banisterfiend>
lectrick: best to use Method / UnboundMethod objects for that anyway
<lectrick>
i don't think i can alias a computed value
<banisterfiend>
aliasing methods to do decoration is yucky
<lectrick>
well this is stab 1. I can pretty it up in stab 2
<banisterfiend>
lectrick: if you open the metaclass you can do that
<banisterfiend>
you have to open the metaclass because you need the 'self' to be the metaclass
<lectrick>
banisterfiend: I've tried class << klass to open the metaclass but then it doesn't know what 'cm' is
sepp2k has quit [Ping timeout: 260 seconds]
<banisterfiend>
instance_eval can't help with that
<al2o3cr>
-e:1:in `eval': undefined method `dynamic' for class `Object' (NameError), from (eval):1:in `block in <main>', from (eval):1:in `instance_eval', from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<banisterfiend>
lectrick: at this point u need to gist some code
t30325 has quit [Remote host closed the connection]
<lectrick>
fowl: ok so in this case cm was actually equal to :try_convert
Chryson has quit [Quit: Leaving]
<fowl>
ok
<fowl>
>> cm=:try_convert; String.instance_eval { alias_method "_original_#{cm}", cm }
<al2o3cr>
-e:1:in `eval': undefined method `try_convert' for class `String' (NameError), from (eval):1:in `block in <main>', from (eval):1:in `instance_eval', from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<iamjarvo>
i am trying to wrap my head around the definition of a singleton class on a class itself like this http://pastie.org/private/czqgxen2jsyqiy4cgumbdw is method basically a class method?
locriani_ has quit [Quit: Leaving...]
locriani has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
<fowl>
iamjarvo: yes
<fowl>
iamjarvo: same as doing class Klass; def self.method()
<iamjarvo>
fowl: thanks, wanted to make sure
<banisterfiend>
lectrick: ok?
<iamjarvo>
is there a reason someone would do that?
<fowl>
for methods at least, class << Klass puts you in the scope (similar to a matrix)
tomsthumb_ has joined #ruby
<lectrick>
banisterfiend: yeah, trying to wrap head around/play with it, gimme a sec and thank you in advance
<iamjarvo>
but if self.method is the same thing and much clearer
<fowl>
a.) different strokes for different folks, b.) written by japs, expect crazyness :p
<iamjarvo>
lol
<banisterfiend>
iamjarvo: because u can do stuff inside there
<banisterfiend>
iamjarvo: like alias methods, and so on. The difference is that the 'self' is the metaclass
<banisterfiend>
when you do: def self.method(); end the 'self' is still just the class
wpaulson_ has joined #ruby
jasonkuhrt has joined #ruby
mrdodo has joined #ruby
wpaulson has quit [Read error: Connection reset by peer]
wpaulson_ is now known as wpaulson
<coyo>
question, is ruby fast enough for major games? or should i use ruby for scripting only?
<seanstickle>
coyo: yes
<coyo>
seanstickle: really? o:
<coyo>
cool!
<coyo>
wait. that was a math answer.
<coyo>
:P
<coyo>
games or scripts?
<Spooner>
coyo : Look at gosu (and the answer is "it depends on what you expect").
<coyo>
Spooner: thank you. so "it depends"
sepp2k has joined #ruby
<seanstickle>
Everything does.
<coyo>
i dont mind linking to native libraries for what i want to do, especially opengl, openal, and whatno.
<coyo>
*whatnot
<Spooner>
coyo : The one thing is that the CRuby garbage collector is going to be a pain.
<coyo>
Spooner: is rubinius stable enough to use in game development?
<Spooner>
You don't need to. Gosu uses opengl/openal itself.
<coyo>
looking at gosu
<Cache_Money>
coyo: what kind of games are you developing?
<headius>
there's several graphics library wrappers for JVM that work in JRuby
<Spooner>
coyo : I do a lot of game dev on Ruby, because I'm a mascochist. Mainly been building Ashton (Gosu extension with new shiny OpenGL stuff like shaders) recently.
<coyo>
ruby is pretty popular, so i figure if i can build a relatively high performance game engine for rubyists, it would be a welcome addition.
gavit has joined #ruby
<banisterfiend>
coyo: ruby already has a high performance game engine :)
brianpWins has quit [Ping timeout: 244 seconds]
brianpWins_ is now known as brianpWins
<coyo>
banisterfiend: oh? i think you may have mentioned it before, but i forgot. what is it?
<banisterfiend>
coyo: well it depends what u mean by 'engine' i guess, but 'gosu' and 'chingu' and 'gamebox' come to mind
<coyo>
okay.
<coyo>
looking at them.
yaymukund has joined #ruby
<Spooner>
Gosu is relatively high performance, but it is limited (e.g. no thought of shaders). People just don't have that much interest in Ruby as a game-making langauge. As I say, the garbage collector will punish you :)
<banisterfiend>
also check out Ray
Z_Mass has joined #ruby
zach_ has joined #ruby
mxbtty has quit [Quit: Leaving.]
zach_ is now known as Guest62986
<Spooner>
coyo #gosu #gamebox are the only other channels I'm aware of that might interest you.
<headius>
ideally most of your perf is going to be bound up in the graphics library, but if you'd doing a lot of heavy logic in ruby you'll want a fast one
t7373 has quit [Remote host closed the connection]
t82885 has joined #ruby
kpshek has joined #ruby
kpshek has quit [Client Quit]
Chryson has joined #ruby
dimensiOn has left #ruby [#ruby]
<Spooner>
headius : Absolutely. Rendering 10k quads is quick. Managing 100 objects (e.g. moving things aroudn the screen and dealing with animation and such) gets slow :(
uris has quit [Quit: leaving]
BadQuanta has joined #ruby
Spooner has quit []
<BadQuanta>
Hello all. :)
gavit has quit [Read error: Connection timed out]
<Cache_Money>
Spooner: Sweet game! Alpha Channel is awesome
tomkersten has joined #ruby
banisterfiend has quit [Remote host closed the connection]
gavit has joined #ruby
banisterfiend has joined #ruby
banghouse has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
tomkersten has left #ruby [#ruby]
banisterfiend has joined #ruby
brianpWins has quit [Quit: brianpWins]
opus has quit [Quit:]
<coyo>
headius: okay.
tomkersten has joined #ruby
banisterfiend` has joined #ruby
tomkersten has left #ruby [#ruby]
<coyo>
i wish there were more OpenXL style libraries
yosafbridge has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
Bosma has quit [Ping timeout: 272 seconds]
mephux has quit [Quit: w0ots...]
Musfuut has quit [Ping timeout: 250 seconds]
mephux has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
yosafbridge has joined #ruby
Musfuut has joined #ruby
Musfuut is now known as Guest78690
wvms has quit [Read error: Connection reset by peer]
ttilley has quit [Read error: Connection reset by peer]
mahmoudimus has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
schleppy has joined #ruby
nobitanobi has joined #ruby
t82885 has quit [Remote host closed the connection]
t1053 has joined #ruby
havenn has quit [Remote host closed the connection]
nobitanobi has quit [Read error: Connection reset by peer]
butblack has quit [Quit: butblack]
nobitanobi has joined #ruby
bwlang has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
t-mart has quit [Ping timeout: 260 seconds]
beneggett has joined #ruby
Guedes has quit [Quit: Saindo]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Nanuq has joined #ruby
ryanf has joined #ruby
locriani has quit [Remote host closed the connection]
headius has quit [Quit: headius]
ananthakumaran has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
arvidkahl has quit [Quit: arvidkahl]
nobitanobi has joined #ruby
gavit has quit [Read error: Connection timed out]
cid404 has quit [Ping timeout: 252 seconds]
gavit has joined #ruby
a_a_g has joined #ruby
sazboom has quit [Ping timeout: 246 seconds]
mahmoudimus has joined #ruby
M- has quit [Read error: Connection reset by peer]
nobitanobi has quit [Read error: Connection reset by peer]
M- has joined #ruby
nobitanobi has joined #ruby
SirFunk_ has quit [Read error: Connection timed out]
k_89 has joined #ruby
SirFunk has joined #ruby
mahmoudimus has quit [Client Quit]
maletor has joined #ruby
macmartine has joined #ruby
Matt_ has joined #ruby
headius has joined #ruby
havenn has joined #ruby
Matt_ is now known as Guest95735
ringotwo has quit [Remote host closed the connection]
headius has quit [Client Quit]
yosafbridge has quit [Ping timeout: 260 seconds]
Kichael has joined #ruby
Tref has joined #ruby
Araxia has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
yosafbridge has joined #ruby
t1053 has quit [Remote host closed the connection]
nobitanobi has joined #ruby
t17892 has joined #ruby
<maletor>
Why am I seeing GC collection take 200 seconds on some requests to my web applicaiton?
n_blownapart has joined #ruby
havenn has quit [Ping timeout: 240 seconds]
gavit has quit [Read error: Operation timed out]
eywu has quit [Read error: Operation timed out]
<bnagy>
nobitanobi: if it's at initialize time maybe ArgumentError, if it's something weird that happens later then RuntimeError
<Axsuul>
maletor: you dont have enough memory probably
<Axsuul>
maletor: and you're using swap
gavit has joined #ruby
kn330 has quit [Remote host closed the connection]
<Axsuul>
maletor: you can also tweak GC settings for ruby
reset has quit [Ping timeout: 244 seconds]
<maletor>
not on heroku you can't
drago757 has quit [Quit: drago757]
<maletor>
heroku will swap out memory
<maletor>
is that likely the cause of slow gc execution?
<maletor>
even 200 seconds?
<maletor>
Axsuul:
<Axsuul>
maletor: are you on the free heroku plan
<maletor>
paid
mmitchel_ has quit [Remote host closed the connection]
mmitchell has joined #ruby
<maletor>
Azure: why
<maletor>
Axsuul: why
<Cache_Money>
Spooner: Why won't my Local Scores store on ALphaChannel? All scores are erased after app is closed (which happens automatically after I die 3 times).
<Azure>
Wha... oh.
<Axsuul>
maletor: the paid heroku plan is slow as shit, that's why :) you gotta ask heroku why GC is taking that long, it's their system, but their support is top notch they should get back to you immediately
igotnolegs has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
<maletor>
Axsuul: asking now
<n_blownapart>
hi I have a basic question about method definition and using attr_reader : question pertains to line 6 , thanks: http://pastie.org/4565944
<n_blownapart>
^^ ps I hope banister_et.al isn't on....
seanstickle has quit [Quit: seanstickle]
<bnagy>
and the question itself is...?
mmitchell has quit [Ping timeout: 272 seconds]
havenn has joined #ruby
jorge_ has quit [Remote host closed the connection]
JonnieCache|home has quit [Ping timeout: 252 seconds]
itcharlie has quit [Quit: Leaving]
<n_blownapart>
bnagy: thanks the question is whether you use attr_reader or explicitly write the "method" on lines 6-8, is this technically a method? (the book refers to it as a method). Or is it more that you are ascribing a value that @number holds to c on line 11 ?
macmartine has joined #ruby
wvms has left #ruby [#ruby]
cj3kim has joined #ruby
<bnagy>
attr_reader :foo is shorthand for def foo;@foo;end
<bnagy>
c.number and just 'number' on line 11 are both method calls
maletor has quit [Quit: Computer has gone to sleep.]
<bnagy>
the second one is actually self.number
<bnagy>
but you protected that method, which conflicts with attr_reader
<n_blownapart>
ok thanks bnagy but in terms of nomenclature, is that formally a method? It is very basic but crucial: I didn't know you could write a method using attr_ and friends...
c0rn_ has joined #ruby
JonnieCache|home has joined #ruby
aantix has joined #ruby
<n_blownapart>
as for the protected method, banisterfiend had me do it this way: http://pastie.org/4553678 (line 14-15)
<bnagy>
is what a method?
<bnagy>
attr_reader is a method. both instances of number on line 11 are methods
<n_blownapart>
bnagy: so attr_reader can "create" a method automatically?
<bnagy>
yes except without the ""
<bnagy>
go ahead and implement attr_reader yourself, it will help you understand
gavit has quit [Read error: Connection timed out]
TPFC-SYSTEM has joined #ruby
macmartine has quit [Read error: Connection reset by peer]
gavit has joined #ruby
d3vic3 has quit [Read error: Operation timed out]
<n_blownapart>
bnagy: it was causing confusion. I thought you were essentially just creating a variable to ascribe values to objects...that you use the shortcut to create an assigning variable for a value.
arvidkahl has joined #ruby
chimkan_ has joined #ruby
cj3kim has left #ruby ["Leaving"]
<n_blownapart>
^^ like Person.name, for example . bnagy
<lectrick>
How can I tell if my method was called from inside another method or inside a class definition?
<bnagy>
lectrick: check out caller
<n_blownapart>
so I guess on the right side of any dot operator must be a method...it is never considered just a value being ascribed? bnagy
locriani has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
<iamjarvo>
banisterfiend`: thanks
<bnagy>
n_blownapart: more or less yes. obj.anything anything is a method
<bnagy>
but also things like obj[3] .[] is a method. Etc.
d3vic3 has joined #ruby
<banisterfiend`>
iamjarvo: I DIDNT DO ANYTHING
<n_blownapart>
bnagy: ok thanks that fact got past the goalie. (yeah I understood the implicit dot with [] and .=== etc.) so why did you say that making it protected conflicts with attr_reader?
<iamjarvo>
banisterfiend`: answered a question earlier about class << Klass
<bnagy>
normally attr_reader defines standard instance methods
cj3kim has joined #ruby
<banisterfiend`>
iamjarvo: 1 hour earlier?
<banisterfiend`>
:)
<iamjarvo>
yea haha
gmci has quit [Quit: Computer has gone to sleep.]
<n_blownapart>
bnagy: but it works so it is not illegal, I guess...
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
gmci has joined #ruby
t17892 has quit [Remote host closed the connection]
t40002 has joined #ruby
cj3kim has quit [Client Quit]
meskyanichi has quit [Quit: Leaving...]
nullsign has quit [Quit: Lost terminal]
pricees has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
mike4_ has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
maletor has joined #ruby
savage- has joined #ruby
<n_blownapart>
thanks very much bnagy
patient has quit [Quit: leaving]
mxbtty has joined #ruby
denstark has quit [Ping timeout: 246 seconds]
burgestrand has quit [Quit: Leaving.]
TandemAdam has quit [Quit: Leaving]
nobitanobi has quit [Read error: Connection reset by peer]
Cache_Money has quit [Ping timeout: 272 seconds]
nobitanobi has joined #ruby
bwlang has quit [Quit: bwlang]
Squee- has quit [Quit: This computer has gone to sleep]
luxurymode has joined #ruby
denstark has joined #ruby
pingfloyd has joined #ruby
pingfloyd has quit [Changing host]
pingfloyd has joined #ruby
Guest95735 has quit [Ping timeout: 260 seconds]
yasushi has joined #ruby
ringotwo has joined #ruby
Pentacles has joined #ruby
yaymukund has quit [Quit: leaving]
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
nobitanobi has quit [Client Quit]
maletor has quit [Quit: Computer has gone to sleep.]
gavit has quit [Read error: Connection timed out]
Pentacles is now known as Squee-
gavit has joined #ruby
dhruvasagar has quit [Remote host closed the connection]
k_89 has quit [Quit: Leaving]
rump has quit [Quit: rump]
sdwrage has quit [Ping timeout: 268 seconds]
havenn has quit [Remote host closed the connection]
reset has joined #ruby
n_blownapart has quit [Remote host closed the connection]
denstark has quit [Read error: Operation timed out]
reset has quit [Client Quit]
apok has joined #ruby
banisterfiend` has quit [Read error: Connection reset by peer]
Zespre_ has joined #ruby
Zespre has quit [Ping timeout: 245 seconds]
ananthakumaran has quit [Quit: Leaving.]
reset has joined #ruby
reset has quit [Client Quit]
havenn has joined #ruby
apok has quit [Quit: apok]
<quazimodo>
if i have attributes foo, bar, zed and i also have a variable foo = "stuff", bar = "things", zed = "wow" is it possible to do something conceptually like attribute_name_to_variable(instance.foo) which will eval to "stuff"
banisterfiend has joined #ruby
<quazimodo>
kinda using the attribute name and variable as a hash key
luxurymode has quit [Quit: Computer has gone to sleep.]
yasushi has quit [Remote host closed the connection]
<Hanmac>
OR: instance.send("foo")
chare has quit [Quit: Leaving]
eywu has joined #ruby
denstark has joined #ruby
jorge has joined #ruby
<quazimodo>
variable_get("#{name}") might beit
<banisterfiend>
quazimodo: u need the @
recycle has joined #ruby
<quazimodo>
oh, k
jorge has quit [Ping timeout: 244 seconds]
xaxxon has joined #ruby
bricker88 has joined #ruby
<quazimodo>
ok, so what If i did this in a simple scirpt
burgestrand has joined #ruby
gavit has quit [Read error: Connection timed out]
<quazimodo>
mylist=['foo','bar','zed']; foo=1; bar=2; zed=3; mylist.each do |i|; some_variable_get_method("#{i}") ?
s1n4 has joined #ruby
<quazimodo>
erm, with thi@
gavit has joined #ruby
<Hanmac>
when you use attr_accessor or attr_reader you yould use send
<quazimodo>
oh ok works :D
<quazimodo>
so what do you do for non instance variables?
<quazimodo>
like locally scoped ones
iamjarvo has quit [Ping timeout: 244 seconds]
arvidkahl has quit [Quit: arvidkahl]
<quazimodo>
local_variables.something eh
banisterfiend has quit [Read error: Connection reset by peer]
<bnagy>
the cleanest way would be to use eval
<bnagy>
which is not clean
<bnagy>
which means it's a bad design
burgestrand has quit [Ping timeout: 244 seconds]
<quazimodo>
bnagy: oh?
<bnagy>
mylist.map {|e| eval e}
denstark has quit [Ping timeout: 240 seconds]
<quazimodo>
ok
<bnagy>
[1,2,3]
<quazimodo>
hrm ok
<quazimodo>
its in my ruby seed.rb
<bnagy>
hehehe eval e
<quazimodo>
s/ruby/rails
ryanf has quit [Ping timeout: 240 seconds]
banisterfiend has joined #ruby
burgestrand has joined #ruby
pricees has quit [Quit: leaving]
abahkaiyisah has quit [Ping timeout: 245 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
<quazimodo>
bnagy well lets just agree that it blows chunks (which I see it clearly does)
<quazimodo>
and I'll steer right clear of that
gmci has quit [Quit: Computer has gone to sleep.]
<Hanmac>
using a list of local variables and then use eval to get them looks like bad design
nirix has quit [Ping timeout: 260 seconds]
<quazimodo>
Hanmac: yeah its just to populate the db with test data, tbh i got lazy
gmci has joined #ruby
denstark has joined #ruby
<Hanmac>
"why did you not escape the user input?" - "i got lazy"
jarred has quit [Ping timeout: 268 seconds]
ibash has joined #ruby
<bluebie>
o_o
brianpWins has joined #ruby
<bluebie>
oh man quazimodo that's scary if you ever let anyone else maintain that code
ananthakumaran has joined #ruby
ibash has quit [Client Quit]
c0rn_ has quit [Quit: Computer has gone to sleep.]
hemanth has quit [Quit: Leaving]
macmartine has joined #ruby
ibash has joined #ruby
Tearan has quit [Quit: Sleepy Badger....]
ggreer has quit [Read error: Operation timed out]
<quazimodo>
bluebie: oh no i'm still learning guys. I'll do it the way you guys suggest
AngryParsley has joined #ruby
jeff_sebring has quit [Quit: Leaving]
chimkan_ has quit [Quit: chimkan_]
<bluebie>
It's okay ^_^
yxhuvud has joined #ruby
<quazimodo>
is it normal to use case statements in ruby
<bluebie>
you'd be surprised how bad people are about escaping user input!
<quazimodo>
or is that looked at as being shitty
<bluebie>
I owned my uni's security course's site with an xss vulnerability
circlicious has quit [Ping timeout: 246 seconds]
<bluebie>
case are useful!
<bluebie>
use them!
end3r- has quit [Ping timeout: 248 seconds]
<bluebie>
case statements in ruby don't have the downsides and dangers of similar statements in other languages - they're really quite great
<quazimodo>
so
andrewhl has quit [Remote host closed the connection]
<quazimodo>
[myvar = ] case or myvar case ?
eywu has left #ruby [#ruby]
gavit has quit [Read error: Connection timed out]
machty has joined #ruby
<bluebie>
varible = case
<quazimodo>
gotcha
cid404 has joined #ruby
denstark has quit [Read error: Operation timed out]
<bluebie>
if you want to assign the return value to a variable
gavit has joined #ruby
<bluebie>
if you want to compare something with your when's you put the thing after 'case' to compare with (could be a variable)
<Hanmac>
you could do an case without an case-statement .... case ;when ... works too but i DONT recomend that
<quazimodo>
hrm
<bluebie>
they're functionally pretty similar to if, elsif, else. They're just a neat syntax which lines everything up neatly if you need to do a bunch of things like that
chimkan has joined #ruby
<quazimodo>
oh right, easy peasy
<banisterfiend>
bluebie: not rly, case uses ===
c0rn_ has joined #ruby
<banisterfiend>
so it behaves very differently in a bunch of cases
<quazimodo>
hrm
<bluebie>
banisterfiend: differently to what exactly?
<bluebie>
==?
<bluebie>
if doesn't imply or encourage you to use any particular boolean operators
<banisterfiend>
bluebie: well, if requires an expression to match again, case (in the common use) requires an object in each case that is matched against with ===
<bluebie>
quazimodo: if you use case when stuff for comparisons (like case some_var; when 'foo'….) look in to the === operator - it's a bit like == but it does some extra stuff like evaluate regexes - that's what case uses instead of == when doing comparisons like that
a_a_g has quit [Quit: Leaving.]
DanielVartanov has joined #ruby
busybox42 has quit [Quit: Leaving.]
circlicious has joined #ruby
mohits has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
<banisterfiend>
quazimodo: you can do things like: x = 5; case x; when (1..10); puts "number is between 1 and 10"; end; end
<quazimodo>
argh my emacs ruby mode is broken... tabbing is Mc Fucked
<quazimodo>
banisterfiend, bluebie : ruby is ... ridiculous
<DanielVartanov>
Guys, I have a question which has been driving me crazy for days. This famous gist: https://gist.github.com/3356675 (Haskell-like list comprehensions in Ruby). What does that "def -@" and "def +@" mean? What @ signs does? My head is at the point of blowing up, please help
<banisterfiend>
quazimodo: y dat
gvz has joined #ruby
adamkittelson has quit [Remote host closed the connection]
<quazimodo>
the sheer amount of syntax available for one
<bluebie>
quazimodo: you don't have to use all of it o_o
<banisterfiend>
quazimodo: like what
<bluebie>
english has a lot of words
<bluebie>
I don't use most of them!
<quazimodo>
not syntax
<quazimodo>
grammar
<quazimodo>
the amount of grammar in ruby is scary for a humble python/lispy/c kinda guy
<Hanmac>
DanielVaranov: its for the unary
<bluebie>
use python if that's what makes you happy :)
<quazimodo>
bluebie: rails project atm
<quazimodo>
its ok ill learn ruby
<bluebie>
oh company stuff?
<quazimodo>
sorta
Gate has quit [Read error: Operation timed out]
<banisterfiend>
quazimodo: what in particular do you find confusing
<banisterfiend>
quazimodo: just that ruby has switch statemetns as well as if statemetns?
<banisterfiend>
expressions*
<DanielVartanov>
Hanmac: ha! so simple, and so strange I didn't know that. Thank you, dide!
gavit has quit [Read error: Connection reset by peer]
<banisterfiend>
quazimodo: just put them on separate lines? ruby will just look to the next line if it needs to
<bluebie>
just do it
brianpWins has joined #ruby
<banisterfiend>
quazimodo: also, it's stupid to make a ternary operator multiline
<banisterfiend>
quazimodo: they're designed -- in any langauge -- to be for short little if/else expressions
<quazimodo>
see, i didn't know that
<bluebie>
yeah just use an if else statement
<banisterfiend>
quazimodo: well, if you had used 'ternary' in any other langugae (like C for example) you would know that :P
* quazimodo
learnt something new
<banisterfiend>
it's not unique to ruby
<quazimodo>
banisterfiend: genearally didnt
luckyruby has quit [Remote host closed the connection]
<bluebie>
quazimodo: More often than not if you just write something which might work, it will. Ruby is designed to try and make sense of anything sensible
<bluebie>
that's why it has so much grammar
<quazimodo>
bluebie: yeah it seemed that way
adamkittelson has joined #ruby
<quazimodo>
its a really cool language to be honest. I think I need to spend more time and read through core language methods, then look at rails' base activerecord methods
<quazimodo>
that should clear it up a lot
DanielVartanov has left #ruby [#ruby]
<bluebie>
but yeah, blah = if bla.etc?\n thing1\n else\n thing2\n end would work great too
<quazimodo>
then ill see how enumerator works in this lang
chimkan has quit [Quit: chimkan]
<quazimodo>
bluebie: lol whata mess
<bluebie>
it looks nicer when you use real newlines instead of \n :P
<bluebie>
and nice indentation!
<bluebie>
enumerator is the bomb!
<bluebie>
I was so happy when I figured out I could 10.times.map { |x| x * 5 } #=> [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]
Eldariof-ru has joined #ruby
<quazimodo>
oh there's another one
<quazimodo>
the stuff inside { } can tat be multiline?
Gate has joined #ruby
Gate has quit [Changing host]
Gate has joined #ruby
<bluebie>
sure
klaas has joined #ruby
<quazimodo>
and do you *have to* leave the { } there?
<bluebie>
{ } is only different to do end in order of precedence I think
<quazimodo>
or is an indentation lever onough
<bnagy>
Enumerable is where the documentation is, not Enumerator
<bluebie>
use do end if it works nicely
<bluebie>
do end is designed for multiline big things
<quazimodo>
10.times.map do |x|
<banisterfiend>
bluebie: Array.new(10) { |i| i * 5 }
<bluebie>
indentation is never meaningful in ruby. Ruby does not see it at all
Squee- has left #ruby ["Leaving"]
<banisterfiend>
bluebie: is the idiomatic way to do it
<quazimodo>
bluebie: oh ok
<bluebie>
banisterfiend: I feel like that's less clear
<banisterfiend>
bluebie: ..ok :)
<banisterfiend>
bluebie: then this: (0..10).map { |v| v * 5 }
<quazimodo>
so i *could* do foo = 10.times.map do |x|; x; done
noyb has joined #ruby
<banisterfiend>
bluebie: i find that perfectly readable
<bluebie>
Hanmac: nice hack
<quazimodo>
HRM
<quazimodo>
i see!
Takehiro has quit [Remote host closed the connection]
<banisterfiend>
quazimodo: what kind of thing would you like to do ?
<quazimodo>
so |x| < thhis assignes whatever the stuff outside the { evaluates to
fantazo has quit [Remote host closed the connection]
<bluebie>
quazimodo: Sure. You can even remove those semicolons pretty sure - it's clear enough what each thing does
<bluebie>
|x| is your argument list
t40002 has quit [Remote host closed the connection]
<bluebie>
like when you do def some_method(x)
t53083 has joined #ruby
aantix has quit [Quit: aantix]
<bluebie>
when #each (or whatever) calls the block, it passes in some number of arguments or maybe none, and those are populated via the block's argument list if you specify one, otherwise you don't get them
<quazimodo>
does if |x| is a list of arguments, how does the contents of the block seem to act on each element individualy?
azm has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
<bluebie>
the block is run repeatedly for methods like each
<bluebie>
so each time it's called, like a method, x is set to a different thing
quazimodo has quit [Read error: Connection reset by peer]
<banisterfiend>
quazimodo: blocks are more or less equivalent to lambdas in lisp
elhu has joined #ruby
<bluebie>
they're called Proc's when you assign them to a variable tho
quazimodo has joined #ruby
<bluebie>
'block' is the syntax thing where you jsut shove one on to the end of a method call
<bluebie>
and then MAGIC
<bluebie>
yeild is crazy o_o
<bluebie>
oh connection reset
<bluebie>
yay
<quazimodo>
i think 10.times.map { |x| puts x } will take each element that 10.times puts into x, prints it and at the end returns an array of whatever the last statement in the bloc returned
<quazimodo>
you made ruby so, so much less confusing for me
<bluebie>
just a minute ago you called me a jerk!
<bluebie>
fine fine
<bluebie>
all is forgiven :D
<fowl>
bluebie: why did you wrap the lambda in parens
<quazimodo>
yeah it was in an affectionate tone!
<bluebie>
fowl: clarity for noob
jeekl has joined #ruby
<banisterfiend>
bluebie: look at your parameter list you moron
<bluebie>
banisterfiend: ah shit
<bluebie>
thanks banisterfiend
<banisterfiend>
:P
jarred has joined #ruby
<bluebie>
that was weird
<bluebie>
I wonder what it was waiting for
<bluebie>
what could possibly make that statement make sense
<bluebie>
sorry quazimodo - that lambda's arguments list needed some commas because I suck
tagrudev has joined #ruby
<jarred>
Whenever I try to install a gem with MacRuby (I need this specific Ruby implementation for a project), I get an error that looks like this https://gist.github.com/ad206b304abc87f35e57. This is with MacRuby 0.12, as well as MacRuby's nightly build. How do I fix this?
<bluebie>
asked the macruby channel?
<banisterfiend>
bluebie: your argument list had commas
<banisterfiend>
bluebie: clearly quazimodo rewrote the code from scratch but messed it up :)
<banisterfiend>
it's his own fault, not yours :)
<bluebie>
Oh okay!
<bluebie>
my irc client cut off the log already
djdb has joined #ruby
<quazimodo>
GUS i now stand and work
<quazimodo>
my spine feels automatically better
t53083 has quit [Remote host closed the connection]
<bluebie>
standing desker aye?
lurch_ has joined #ruby
t15675 has joined #ruby
<quazimodo>
since 4 hours ago, es
<quazimodo>
so better
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
Banistergalaxy has joined #ruby
<banisterfiend>
bluebie: bbs
maesbn has joined #ruby
burgestrand has quit [Read error: Connection reset by peer]
burgestrand1 has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
burgestrand1 has quit [Client Quit]
mengu has quit [Remote host closed the connection]
<quazimodo>
bluebie: ok so what about the Class.select method
<JonnieCache|home>
its not hard in itself its what it could do to the large scale design of a program that the problem
<quazimodo>
JonnieCache|home: I'm not sure what the implications are, even abstractly
<bluebie>
wait
<JonnieCache|home>
normally objects get where they are because either theyve been made there, or passed there through some usual way. now suddenly any object can pop up anywhere
<quazimodo>
some *place* should keep track of what objects you instantise, so... i mean i dont get it?
<bluebie>
does Customer.select only find objects you already loaded recently or does it find ones in your SQL server too?
<bluebie>
like, are they converting a block in to an SQL query O_O
<quazimodo>
bluebie: it looks through the sql afaik
<bluebie>
okay I'm impressed
<quazimodo>
lots of what rails does is in sql it appears
<JonnieCache|home>
.select isnt one of the sql generating methods
<JonnieCache|home>
well it is, but it doesnt work like that
<bluebie>
quazimodo: Unlike PHP, ruby/rails is persistent - objects aren't just created, they also need to be garbage collected and removed
<JonnieCache|home>
besides you said its on Class
<bluebie>
how's it work?
savage- has quit [Remote host closed the connection]
<JonnieCache|home>
there is a .select method in activerecord, corresponding to the SELECT statement in sql
denstark has quit [Ping timeout: 248 seconds]
<JonnieCache|home>
but i dont think it takes a block like that
igotnolegs has quit [Quit: Computer has gone to sleep.]
<bluebie>
I've seen attempts to make it take a block
<bluebie>
but they all seem pretty dodgy
<quazimodo>
JonnieCache|home: yeah that select may use :attribute => "bla"
<quazimodo>
i cant remember now
<bluebie>
O_o
<bluebie>
NEVERMIND NOTHING INTERESTING HAPPENING
t15675 has quit [Remote host closed the connection]
<bluebie>
go back to what you were doing everyone
sebicas has quit [Quit: sebicas]
<quazimodo>
yeah thats right
t77679 has joined #ruby
<quazimodo>
the activerecord .select i think needs :attribute => "bla"
<bluebie>
It's not on Class, it's on ActiveRecord::Base or something related to that
<JonnieCache|home>
ohhhhh
<JonnieCache|home>
thats not what you said
<quazimodo>
JonnieCache|home: forgive me, im a nooblet
<quazimodo>
:(
<JonnieCache|home>
:)
<JonnieCache|home>
dont worry
<bluebie>
nooblet
<bluebie>
is a great word
td123 has joined #ruby
<JonnieCache|home>
yeah that'll just be part of the sql query building, for when you actually need to give a specific SELECT statement
<quazimodo>
i dont even know if it's called select in active record
<JonnieCache|home>
usually you dont need to do that though
<bluebie>
quazimodo: When you start feeling the need to be confused some more, check out Markaby - it's the ActiveRecord of building html with only ruby code
<JonnieCache|home>
wtf thats an odd description
<JonnieCache|home>
its a templating language like many others
<bluebie>
like ActiveRecord it makes accidental cross site scripting vulnerabilities much less frequent, and makes everything more awesome!
* quazimodo
hates the rails help page
<bluebie>
mm sort of
<bluebie>
more of a builder really
greenysan has joined #ruby
denstark has joined #ruby
<quazimodo>
bluebie: html .... can have xss vulnerabilites? are you high?
t17502 has quit [Remote host closed the connection]
cascalheira has joined #ruby
t43522 has joined #ruby
bambanx has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
jgrevich has quit [Quit: jgrevich]
justinmcp has joined #ruby
apok has quit [Quit: apok]
Takehiro has quit [Remote host closed the connection]
parus has quit [Remote host closed the connection]
elaptics`away is now known as elaptics
bradhe has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
GoldenCider has quit [Quit: GoldenCider]
kyktommy has joined #ruby
Eldariof27-ru has joined #ruby
cid404 has joined #ruby
cascalheira has quit [Ping timeout: 260 seconds]
Eldariof59-ru has quit [Read error: Operation timed out]
paolooo has joined #ruby
twinturbo has quit [Quit: twinturbo]
qwerxy has joined #ruby
zeromodulus has quit [Remote host closed the connection]
zeromodulus has joined #ruby
JonnieCache|home has left #ruby [#ruby]
JonnieCache|home has joined #ruby
bricker88 has quit [Quit: Leaving.]
sent-hil has joined #ruby
DuoSRX has joined #ruby
<sent-hil>
If I open up a module in rspec spec_helper.rb, and redefine a method, when I call super in there, shouldn't it call the module's original method?
<sent-hil>
Oddly its called super on RSpec example group
<hoelzro>
sent-hil: super only calls the superclass' method
<hoelzro>
it doesn't help you if you redefine something
<sent-hil>
hoelzro: it doesn't call super in context of the current module?
pskosinski has joined #ruby
dekroning has joined #ruby
justinmcp has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
<hoelzro>
hmm...I guess it will work if you're implementing a method that a module provides
_bart has quit [Quit: _bart]
gmci has quit [Quit: Computer has gone to sleep.]
JonnieCache|home has quit [Quit: Lost terminal]
<dekroning>
I'm a bit confused about object serialization. I have a object graph about a basic Person object which has some composed relationship with ContactInformation (and some other composed object relations), would I be able to serialize the whole Person object graph into something like yaml or json ?
<sent-hil>
hoelzro: yea, Goliath::TestHelper provides a with_api method, but when I redefine it in spec_helper.rb, it can't find the original with_api method or any of the Goliath::TestHelper methods
khakimov has quit [Quit: Computer has gone to sleep.]
bambanx has quit [Ping timeout: 272 seconds]
csmrfx has joined #ruby
<csmrfx>
8)
<csmrfx>
If you had to crawl a tree of webpages under foo.org/bar/ for string "ybur", what would you use?
<Muz>
Mechanize and Nokogiri could probably do that. Depending on your definition of "crawl".
M- has quit [Quit: This computer has gone to sleep]
havenn has joined #ruby
<csmrfx>
Just follow links within the domain
Advocation_ has joined #ruby
bambanx has joined #ruby
<bnagy>
following links, eh?
<bnagy>
hmm sounds like the kind of thing a SPAMMER WOULD DO
Advocation has quit [Ping timeout: 260 seconds]
Advocation_ is now known as Advocation
<bnagy>
burn im!
dross has quit [Ping timeout: 240 seconds]
ephemerian has joined #ruby
<bnagy>
fwiw I have never done any significant webstuff, but I found capybara really easy to use for that kind of thing
* csmrfx
spams bnagy with all the javascript bugs he needs to fix on a site made by people who have never heard of template logic
<bnagy>
and with capybara-webkit / poltergeist it's JS capable
<csmrfx>
whoa
<bnagy>
and the capybara DSL is sweeet if you know 0 like me
fayimora has joined #ruby
<csmrfx>
I was looking at phantom for making a javascript testing suite
<csmrfx>
uh phantom.js
<csmrfx>
oh, thats what poltergeist is
<bnagy>
you would probably like poltergeist then
<csmrfx>
mehh, pack it in a gem
havenn has quit [Ping timeout: 244 seconds]
ananthakumaran has quit [Ping timeout: 244 seconds]
<bnagy>
I had to make a search engine automation thing, and burgestrand made it threadsafe for me. Want?
t62225 has quit [Remote host closed the connection]
suraj has quit [Read error: Connection reset by peer]
adambeynon has joined #ruby
<bnagy>
"Hello, 'World'".gsub("'",'\\\\\'') is the retarded nonblockform one
<JonnieCache>
so i can connect it to my monitor
t6194 has joined #ruby
<bnagy>
if in doubt, MOAR SLASH
<banisterfiend>
JonnieCache: oh ok. Wii's are cheap as chips these days
<banisterfiend>
u can get one for like $100
<Prajjwal>
bnagy: Haha. Never got to five slashes.
<shevy>
lol
<Prajjwal>
bnagy: And thank you, that works in the script.
<bnagy>
four to make \\ to make one real \ and one cause the ' was inside ''
[Neurotic] has quit [Quit: Leaving]
<bnagy>
Prajjwal: please use the block form
<banisterfiend>
JonnieCache: are you jonathan davies?
<Prajjwal>
bnagy: Yeah, thats the one I just put in the script. Works now. Thanks.
<JonnieCache>
damn why do i always forget not to type my real name into things
<bnagy>
banisterfiend the trolly nick outer
mneorr has joined #ruby
pskosinski has quit [Ping timeout: 245 seconds]
davidcelis has joined #ruby
<JonnieCache>
its not really a secret google knows who i am
vlad_starkov has quit [Remote host closed the connection]
<JonnieCache>
but id rather not promote it
<banisterfiend>
JonnieCache: i just got an issue filed by u :P
<banisterfiend>
sorry
<banisterfiend>
just came up in my email now
elhu has quit [Ping timeout: 244 seconds]
<banisterfiend>
JonnieCache: btw, to prevent loading of plugins, use: pry --no-plugins
habib has joined #ruby
<JonnieCache>
GODDAMMIT why didnt i see that in --help
<shevy>
JonnieCache I shall forever remember you as Jonnie The Cache, with the slick winchester rifle and the cowboy looks
<JonnieCache>
i looked at it a bunch of times how unbelivably embarrasing
<banisterfiend>
JonnieCache: cos it doesnt have a short form, it's easy to miss it i guess
<bnagy>
*unbelievably
* bnagy
rubs salt into the wounds
<banisterfiend>
JonnieCache: thanks tho, we def. need to improve that situation
vitoravelino is now known as vitoravelino`afk
<banisterfiend>
(regarding out of date plugins)
<banisterfiend>
JonnieCache: what is your avatar meant to be btw
<JonnieCache>
just thought there should be a github issue for someone to find when they google "pry stack level too deep"
<JonnieCache>
its the middle of a record
<JonnieCache>
an unmarked whitelabel record, the best kind ;)
himsin has joined #ruby
<banisterfiend>
k00
elhu has joined #ruby
davidcelis has quit [Ping timeout: 244 seconds]
pskosinski has joined #ruby
tiripamwe has joined #ruby
Guest37999 has joined #ruby
habib has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<banisterfiend>
JonnieCache: do u have a record player
<JonnieCache>
i have at least 3 i think. 1 is broken and two are in someone elses house
<JonnieCache>
1210s are getting more expensive now, i should really get mine back off this guy
<JonnieCache>
before he disappears or something
kyb3r has quit []
<JonnieCache>
i used to play a lot of vinyl, now i just use a laptop to dj. its a real shame because its not as fun but its more practical. also a lot of tune tunes i want dont exist on vinyl these days
<banisterfiend>
JonnieCache: you're a dj?
<JonnieCache>
sort of. just around the local area at my friends events
davidcelis has joined #ruby
<JonnieCache>
the last gig i did was the opening of a new skatepark. i played classic hiphop to ~100 very talented kids
<JonnieCache>
i think they wanted dubstep though
jjang has quit [Ping timeout: 240 seconds]
<Muz>
It's all about the Skillrex.
<Muz>
He's the best dubstepper ever.
yasushi has joined #ruby
nirix has quit [Quit: Computer has gone to s…zZzZz]
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
Banistergalaxy has joined #ruby
devopensource has joined #ruby
Rochefort has joined #ruby
Prajjwal has quit [Quit: Leaving.]
mneorr has quit [Read error: No route to host]
mneorr1 has joined #ruby
ugo has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
<JonnieCache>
you're going to have to troll harder, dubstepper is a legit term from before the US takeover :P
<JonnieCache>
try "i love skrillex, he makes the best dubsteps"
paolooo has quit [Quit: Page closed]
<JonnieCache>
or describe them as "dubstep songs" that will really annoy some people
paolooo has joined #ruby
arkiver has quit [Ping timeout: 260 seconds]
mneorr has joined #ruby
bluebie has joined #ruby
bluefish_ has joined #ruby
butblack has joined #ruby
mneorr1 has quit [Ping timeout: 244 seconds]
shiki has joined #ruby
ugo has left #ruby [#ruby]
timonv has quit [Remote host closed the connection]
butblack has quit [Ping timeout: 260 seconds]
tbrock has quit [Remote host closed the connection]
vectorshelve has quit [Quit: Page closed]
arkiver has joined #ruby
liluo has quit [Remote host closed the connection]
nari has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
mrdodo has joined #ruby
shiki has quit [Ping timeout: 268 seconds]
shiki has joined #ruby
Asher1 has joined #ruby
mrdodo has quit [Read error: Operation timed out]
Jay_Levitt has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
t6194 has quit [Remote host closed the connection]
kvirani has joined #ruby
t2978 has joined #ruby
shiki_ has joined #ruby
shiki has quit [Read error: Connection reset by peer]
d3vic3 has quit [Ping timeout: 244 seconds]
virunga has joined #ruby
charliesome has joined #ruby
d3vic3 has joined #ruby
cantonic has quit [Quit: cantonic]
d3vic3 has quit [Client Quit]
berserkr has joined #ruby
fridim_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
virunga has quit [Remote host closed the connection]
banisterfiend has joined #ruby
Matt_ has joined #ruby
Matt_ is now known as Guest22700
yasushi has quit [Remote host closed the connection]
<JonnieCache>
banisterfiend: once our friends were struggling to decide what to put in room 3 at a club event they were doing. they couldnt afford any more artists so they did "midi kareoke"
<JonnieCache>
im sure you can guess what that entailed :D
<banisterfiend>
hehe
classix has joined #ruby
rohit has joined #ruby
kpshek has joined #ruby
arkiver has quit [Ping timeout: 252 seconds]
<JonnieCache>
peterhellberg: jesus 46 million views electro house really is popular now isnt it
<JonnieCache>
the video probably has a lot to do with it
dpk has joined #ruby
meskyanichi has joined #ruby
<JonnieCache>
he must be making BANK off those adverts. he has the interstitial ones
Rochefort has quit [Remote host closed the connection]
BiHi has joined #ruby
Cymew has joined #ruby
Rochefort has joined #ruby
liluo has joined #ruby
Foxandxss has joined #ruby
<peterhellberg>
JonnieCache: Yeah, it is turning into a Internet sensation
nanderoo has joined #ruby
devopensource has quit [Ping timeout: 246 seconds]
specialGuest has joined #ruby
tk_ has joined #ruby
<Cymew>
Can someone tell me why I just get an exception and why nothing outside the while loop ever gets executed? http://pastebin.com/S2qfTC3k
<ivancho>
hi, could somebody help me with a find in a collection?I'm a newbye and i dont find examples like this.Thanks! (last line in this code)https://gist.github.com/3424786
quazimodo has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
<Cymew>
I see many finds on google about reading files and they differ slightly and I wonder why my way throws an exception...
<invisime>
hoelzro: actually, I just want to pass a --with-otherlibrary-dir type option to extconf.rb so I can link a custom c-only shared object that my ruby .so depends on.
<hoelzro>
invisime: so you want to be able to say ruby extconf.rb --with-otherlibrary-dir=/path/to/dir?
jorge_ has joined #ruby
<invisime>
hoelzro: yep.
naz has joined #ruby
cantonic_ has joined #ruby
<hoelzro>
well, extconf.rb is just a Ruby program, so you can pass it whatever you want
erichmenge has quit [Quit: Be back later]
ph^ has quit [Ping timeout: 268 seconds]
Stalkr_ has joined #ruby
<Spooner>
invisime : You don't need to pass the argument to extconf.rb, but you do need to add it to your $CFLAGS or $LFLAGS inside extconf.rb. No point passing anything to it, since rubygems, when compiling it, won't pass anything to it.
<invisime>
hoelzro: right, but this is in a gem, so it's getting called during 'gem install mygem' so there's probably a gemspec option or something.
nari has quit [Ping timeout: 240 seconds]
<hoelzro>
ah ha
Takehiro has quit [Remote host closed the connection]
<invisime>
Spooner: so I should just manually add stuff to $LDFLAGS and $LIBS?
<Spooner>
invisime : Are you including the library in the gem or expecting the user to have it externally?
<invisime>
externally.
<invisime>
it'll be included in part of a larger install process.
naquad has quit [Excess Flood]
<Spooner>
Then it should surely be in a set place in the filesystem?
robustus has joined #ruby
<invisime>
yep.
cantonic has quit [Ping timeout: 260 seconds]
cantonic_ is now known as cantonic
withnale has quit [Read error: Connection reset by peer]
<Spooner>
So you shouldn't need to pass anything in to tell the gem where it is.
mneorr has quit [Quit: Leaving.]
<Spooner>
The user would only need to pass in a value, at compile time, if the library was in a user-defined location that you couldn't guess.
danielpunt has quit [Remote host closed the connection]
naquad has joined #ruby
<invisime>
ok, Spooner, I went forward with just hard-coding the paths into the extconf.rb because I know where they'll be, but then it doesn't copy the other .so into the lib directory of my gem at install time.
insecurlex has joined #ruby
<invisime>
Spooner: also, I'm ending up having to explicitly set the LD_LIBRARY_PATH prior to runtime for it to even find the other .so.
<Spooner>
It shouldn't need to, should it? You can use the .so where it is, can't you?
mahmoudimus has joined #ruby
kvirani has quit [Remote host closed the connection]
thunderstrike has quit [Read error: Connection reset by peer]
<invisime>
Spooner: not exactly, the gem's .so doesn't know where the other .so is. so I'm relying on the LD_LIBRARY_PATH environment variable to tell the C code where to look for the other .so.
thunderstrike has joined #ruby
<invisime>
Spooner: that is, if I run ldd on my gem's .so, it tells me the other so is not found. unless I set the LD_LIBRARY_PATH environment variable first.
MarGarina has joined #ruby
<Spooner>
Personally, I've not created a gem of that type. I've either used pure rubyfied-C or used standard libraries (like OpenGL).
<Spooner>
Or included external source in my gem directly.
<invisime>
Spooner: yeah, it doesn't seem like many people have done this kind of thing.
jprovazn has quit [Quit: Leaving]
mahmoudimus has quit [Client Quit]
<Spooner>
It isn't the most friendly way. Have you considered just including the source in your gem?
t62352 has quit [Remote host closed the connection]
rohit has left #ruby ["Leaving"]
t56060 has joined #ruby
<banisterfiend>
Spooner: Hey Bil, what's up
<Spooner>
invisime : Sorry, I meant that if you are setting LD_LIBRARY_PATH, then it doesn't matter if the external .so is in its original position or if you copy it into your gem and set the path to that location (this sounds like a bad idea)
<invisime>
Spooner: can't really be done. we're relying on an external tool to create this other .so because it interacts with some proprietary hardware.
mahmoudimus has joined #ruby
<Spooner>
Right, so you can't build it on the average user's machine?
triptec has quit [Ping timeout: 248 seconds]
johnlcox has joined #ruby
apeiros_ has quit [Remote host closed the connection]
<Spooner>
banisterfiend : Getting a bit out of my depth on C extensions right now :D
joshman_ has joined #ruby
<invisime>
Spooner: our end user is a low-resource device that would take 2 weeks to build it.
jasonLaster has quit [Remote host closed the connection]
<Spooner>
invisime : In that case, I'd just include it in the gem. There is no reason for the user to manually download and install a pre-compiled library, if you can easily include it in the gem itself.
_hasny has joined #ruby
<invisime>
Spooner: I'll be setting up a build script later that symlinks gcc to a cross-compiling gcc.
rakunHo has quit [Remote host closed the connection]
MarGarina has quit [Ping timeout: 252 seconds]
MarGarina has joined #ruby
thatRD has joined #ruby
<banisterfiend>
Spooner: wanna watch a scifi?
dpk has quit [Quit: Asleep at the keyboard.]
<invisime>
Spooner: [c binary that we get from a configuration program] -> [some c code that we want to not rebuild very often] -> [the gem's c code that we can build as often as necessary] -> [the ruby code that handles the plugin portions]
v0n has quit [Ping timeout: 246 seconds]
<invisime>
Spooner: so we can remove that second box, but it would still mean that we need to link to a second binary in the gem, because we can't make that first box c source.
<Spooner>
invisime : Yeah, so just include the compiled .so in the gem and you don't need to mess around nearly so much (and, in particular, it saves the user an unnecessary extra stage).
areil has joined #ruby
jprovazn has joined #ruby
<invisime>
Spooner: exactly. but we still need to link it to the c code that we're making.
<invisime>
Spooner: I don't think it will magically just know to use the .so in the same directory. :-/
<Spooner>
Right, I thought you were arguing against making it simpler, not going back to how to manage the library path. Sorry.
ph^ has joined #ruby
jasonLaster has quit [Ping timeout: 272 seconds]
SCommette has joined #ruby
mneorr has joined #ruby
<invisime>
no, I have no problem with dropping the second box. our C guy insists it's a good idea though. but either way, I end up just having to link to a single .so from my gem's .so. which doesn't seem to be very easy to do.
<Spooner>
invisime : You should just be able to do $LDFLAGS << %< -L"#{File.expand_path("../lib", __FILE__)"> in your extconf and then have_library("nameofmyso")
cantonic has quit [Quit: cantonic]
<Spooner>
Assuming you have "ext/lib/nameofmyso.so"
<Spooner>
"ext/mygem/lib/nameofmyso.so" even
mmitchell has joined #ruby
<invisime>
yeah, it needs a header file too, but I think I see where you're going with this.
<invisime>
(it's very hard to google for symbols.)
<Hanmac>
shevy he means ruby script -> binary file
<shevy>
invisime it may come from perl
otters has quit [Read error: Connection reset by peer]
<shevy>
foo = %w( a bc def )
xixo has quit [Client Quit]
v0n has joined #ruby
thatRD has quit [Quit: leaving]
<shevy>
foo = %w( a bc def ) # => ["a", "bc", "def"]
<invisime>
right.
<shevy>
foo = %Q( a bc def ) # => " a bc def "
<Spooner>
Hanmac : Nope, not a chance. Ruby "executables" just include the source and run it with ruby.exe, so it wouldn't be hidden.
triptec has joined #ruby
<invisime>
I know that one. but I don't know where it's documented.
<hoelzro>
there's %q, %Q, %w, %s, %r, and %x, afaik
<Muz>
Hanmac: not that that would serve as a security measure.
<shevy>
invisime, perhaps it means ... "w for words", "Q for quotes"
otters has joined #ruby
<mikekelly>
Where does #tap get its name from ?
<hoelzro>
equivalent to '', "", [], :'', //, and 11
<shevy>
mikekelly from Magic the Gathering
<hoelzro>
respectively.
havenn has quit [Ping timeout: 245 seconds]
<mikekelly>
shevy: ?
<Spooner>
hanmac And the only "executables" are on Windows/OSX anyway.
joshman_ has joined #ruby
<shevy>
mikekelly you have to "tap" a card for mana in magic the gathering
ph^ has quit [Ping timeout: 245 seconds]
<shevy>
or to announce that a creature attacks
<Muz>
s/card/land/
stopbit has joined #ruby
<invisime>
also, calling turning a card sidewise "tapping" it is patented.
<Spooner>
AND even if you had a C executable, it wouldn't hide the password anyway, unless you encrypted it anyway.
<invisime>
so every other card game uses "exhaust".
<shevy>
"to tap" is an english word
<Spooner>
invisime : Some use kneel/stand.
havenn has joined #ruby
<Hanmac>
Spooner ... i could make an *.c file that includes the code and run the ruby code directly with the lib features ... but i think the pwd is still readable in the binary file right?
<invisime>
but the definition of "tapping" to mean turn a card sideways is patented.
<mikekelly>
is that methaphor supposed to make sense to me
<mikekelly>
because I still don't get it despite your explanation
<hoelzro>
Hanmac: yes; you can see it with the strings command
<shevy>
what metaphor?
Urtokk has joined #ruby
<hoelzro>
I thought that #tap was supposed to be like an Ethernet tap
<shevy>
well in ruby you tap objects :D
<hoelzro>
allowing you to listen in on traffic
<shevy>
and out drops self
cakehero has joined #ruby
<Spooner>
Hanmac : With a hex editor, for sure. And you'd presumably pass the password out of the c (whether encrypted or not) to pass as an argument to the Ruby, so you could intercept it easily.
<shevy>
so that you can chain .foo {}.bla {}.tap {whatever}
<mikekelly>
ok, so basically the name is non-intuitive
andrewhl has quit [Remote host closed the connection]
<shevy>
I dunno who chose that name
<shevy>
matz?
<shevy>
nobu?
<banisterfiend>
mikekelly: it means to tap into a call chain
<banisterfiend>
it makes sense
* mikekelly
shrugs
<shevy>
nobu seems to be the MRI guy these days :P
<shevy>
and shoue... sho... shogeda... shueda... that s* japane dude, he is also here on #ruby I think
<mikekelly>
banisterfiend: ok fair enough
<shevy>
*japanese
zommi has quit [Quit: Leaving.]
<banisterfiend>
peterhellberg: i like this
<Spooner>
Hanmac : I guess you could include a .so or .exe that contained the encrypted password and call those FROM Ruby, but it would have to do everything it needed to do with it in C, rather than coming out to Ruby again. Client-side ruby is not secure :D
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<peterhellberg>
“The primary purpose of this method is to “tap into” a method chain, in order to perform operations on intermediate results within the chain.”
<Spooner>
Hanmac : I'm always amazed how many people ask me how to obfuscate their Ruby code too and complain that the executables you can make don't do so. I think they assume their code is like gold and to let others see it would make them not be able to steal it, unlike all the great open source code out there. Ironically, any of these people's code that I've seen is dreadful, so I have to assume it is more about the embarrassment of it being peer r
<peterhellberg>
csmrfx: Not specifically, but what is your problem? (And how do you want to cache it?)
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<invisime>
Spooner: +5 for truth
<csmrfx>
Problem is that theres tons of requests in format of jQuery{#long unique string here} with responses like jQuery({#long unique string here}{much longer non unique string content}), peterhellberg
<csmrfx>
so, everybody gets the same content, but it is not cached, costing a zillion
geggam has quit [Quit: Leaving]
MarGarina has quit [Ping timeout: 240 seconds]
<peterhellberg>
csmrfx: You are probably talking about JSONP, not JSON
<csmrfx>
yes
<Hanmac>
Spooner do you think my c++-ruby-ext code of my bindings are mebarressing too?
<Spooner>
Still, I look forward to the day when we can ship .rbc files (like Python's .pyc) so I don't have to read their code and my stuff can start up a bit faster!
<peterhellberg>
Just cache the JSON and use a fast JSON-P middleware/generator
<Spooner>
Hanmac : I don't know what you mean.
MarGarina has joined #ruby
axl_ has joined #ruby
t34551 has quit [Remote host closed the connection]
<Spooner>
Hanmac : You didn't ask _me_ how to obfuscate it though, so it might be OK :P
kvirani has joined #ruby
t35790 has joined #ruby
<peterhellberg>
csmrfx: I’m usually doing that with Redis, but any (fast) data store will do
<csmrfx>
peterhellberg: ok
beneggett has quit [Quit: Computer has gone to sleep.]
cantonic has joined #ruby
<Hanmac>
i mean do i need to be shamed for my c++ruby-ext code?
<Spooner>
I'm by far not an expert on C extension code and since you have the source on github, it isn't hidden from the prying eyes of people who might laugh at it!
punkrawkR has joined #ruby
aganov has quit [Remote host closed the connection]
<Spooner>
So I have no problem with it at all :D
ndngvr has quit [Read error: Connection reset by peer]
banisterfiend has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
krusty_ar_ has joined #ruby
<Hanmac>
i used C-Macros for a bit "obfuscating" :P
<Spooner>
Hanmac : You might tempt me to try Ogre for my next game though.
thatRD has joined #ruby
<Spooner>
Oh yeah, MACROS will do that nicely.
krusty_ar has quit [Ping timeout: 260 seconds]
tagrudev has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
ndngvr has joined #ruby
apeiros_ has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
<Spooner>
Hanmac : How are you getting on with it? Any idea when it will be released (libogre-ruby, that is)?
paolooo has joined #ruby
luxurymode has joined #ruby
sazboom has joined #ruby
<Hanmac>
i dont know .. when its ready :P currently its an one-man project :P but i keep forward
theRoUS has quit [Ping timeout: 260 seconds]
<Spooner>
I am not so interested in real 3D though, mainly because I don't have any modelling or texturing skills and I think I'd have to invest a stupid amount of time in getting up to the same level (mostly useless) at those as I am in 2D. I may start adding 3D elements to my 2D Gosu games, but using raw OpenGL. I am interested in Ogre in abstract though and particularly on what could be achieved with it using Ruby behind it.
Cache_Money has joined #ruby
fbernier has joined #ruby
thatRD has quit [Quit: thatRD]
circlicious has left #ruby [#ruby]
thatRD has joined #ruby
adac has joined #ruby
berserkr has quit [Quit: Leaving.]
Guest22700 has quit [Ping timeout: 244 seconds]
Drakx has quit [Read error: Connection reset by peer]
<invisime>
Spooner: so I've added to the $LDFLAGS and $CFLAGS, the -L and -I flags with the locations of my lib and include directories respectively, but when I subsequently call have_library, it doesn't find the lib.
<Spooner>
Does have_library expect .lib rather than .so? (I don't know).
jorge_ has quit [Remote host closed the connection]
<Hanmac>
invisime ... there is an mkmf.log ... post it
thatRD has quit [Client Quit]
<hoelzro>
Spooner: I think it takes what it can get
<Spooner>
hoelzro : OKey.
<hoelzro>
it probably tries .lib and .dll on Windows, and .a and .so on Linux
mahmoudimus has joined #ruby
thatRD has joined #ruby
<Spooner>
invisime : You could try without have_library and see if it works anyway (since you have the paths set up right, it _should_ just work). Another guess which probably won't work though.
bluenemo has quit [Ping timeout: 265 seconds]
<invisime>
right now, it's silently failing. :-/
<Spooner>
As Hanmac says, there should be a log generated
coalhada has joined #ruby
mahmoudimus has quit [Client Quit]
itnomad has joined #ruby
<invisime>
Spooner: ok, found it. it's in my gem install folder. I'll post it shortly.
adeponte has quit [Remote host closed the connection]
<cool>
regardless, I think I understand this now
<shevy>
cool well you can give any number "abc"[3,1323236236236236] # => ""
<shevy>
"abc"[2,1323236236236236] # => "c"
<shevy>
"abc"[2,1] # => "c"
bbttxu has joined #ruby
<shevy>
"abc"[-2,+51] # => "bc"
<shevy>
hehe
<Hanmac>
shevy:
<Hanmac>
>> "abce"["c"]
<al2o3cr>
(String) "c"
<matti>
shevy: Show off ;p
<Hanmac>
>> "abce"["d"]
<al2o3cr>
(NilClass) nil
<shevy>
hey
<matti>
shevy: :)
<shevy>
I dont think I have seen "abce"["b"] before
<Hanmac>
but it exist :P
MarGarina has quit [Ping timeout: 246 seconds]
_hasny has quit [Quit: Leaving.]
venkatk_ has quit [Quit: This computer has gone to sleep]
<Hanmac>
only for your entertainment XD
<Spooner>
It is more commonly used with a regexp "abce"[/b|c/] => "b"
pricees has joined #ruby
<cool>
shevy: ab is any empty array?
<Spooner>
Otherwise, it would be cleaner to use "abce".include? "b"
<cool>
oh, sorry. its a string
MarGarina has joined #ruby
sepp2k has quit [Remote host closed the connection]
<cool>
and in ruby, I guess we can treat strings as arrays?
<CodeFriar>
I'm trying to write a class that includes a module. That module needs to be able to call new on the including class. However, when i make that call, it tries to create a new instance of the module
<shevy>
cool the [] operator will work on Array and String objects in ruby
<CodeFriar>
which isn't even possible
<Spooner>
No, it is just that a lot of the operations on Array are the same on String (even if they are implemented differently).
<shevy>
cool and yeah, you can count in both ways pretty much [start, end]
<shevy>
well actually not end
<shevy>
but start+number
<shevy>
[5,1] one position
kyktommy has quit [Quit: kyktommy]
<Hanmac>
cool: the only difference ... Strings are not enumerable anymore
<CodeFriar>
how is that happening? I can't even call self.class.new
<Spooner>
Hanmac : Presumably because you need to specify if they are bytes or chars nowadays? (so you need to #chars or #bytes them (or #each_byte, #each_char), before they can enumerate?)
<shevy>
CodeFriar, what error message do you get
rajmahendra has joined #ruby
<CodeFriar>
shevy: wrong number of arugments (1 for 0)
jprovazn has quit [Ping timeout: 245 seconds]
<banisterfiend>
cool: maybe #initialize requires a parameter
<rajmahendra>
hi is this a ruby lang irc channel ?
<banisterfiend>
CodeFriar: *
<csmrfx>
yes
<csmrfx>
> p "yes"
<rajmahendra>
I am using macpro and i have some issue with rvm.
<CodeFriar>
banisterfiend: *1* for *0*
<csmrfx>
>> puts "yes"
<al2o3cr>
(NilClass) nil, Console: yes
<rajmahendra>
anyone help me ?
<CodeFriar>
yet initialize is marked as initialize(options = {})
<shevy>
CodeFriar well then new() expects one argument (from def initialize)
<Hanmac>
rajmahendra: there is an #rvm channel too ... it may be more helpful
MarGarina has quit [Ping timeout: 252 seconds]
<csmrfx>
>> p "#rvm" @ rajmahendra
<al2o3cr>
-e:1:in `eval': (eval):1: syntax error, unexpected $undefined, expecting $end (SyntaxError), p "#rvm" @ rajmahendra, ^, from -e:1:in `<main>'
<banisterfiend>
CodeFriar: hmm
<CodeFriar>
shevy: that would be 0 for 1 arguments
<rajmahendra>
Hanmac: thank you :)
<Spooner>
CodeFriar : That doesn't mean it is definitely calling initialize on the module though.
<banisterfiend>
CodeFriar: play with it in a debugger
<csmrfx>
oh, no @ function
hynkle has joined #ruby
<Muz>
rajmahendra: rather than asking for help, actually describe your problem with useful information such as what you're trying, what you get, what you expected.
<shevy>
please notice that Muz properly finishes his sentences with a '.'
<Spooner>
There is nothing special in that, shevy.
<CodeFriar>
banisterfiend: in pry atm. it's referencing a user object only user object i know of is the module.
tomsthumb_ has joined #ruby
<shevy>
Spooner hah he is the only one who does
<rajmahendra>
i am unable to join #rvm channel it says you need to be identified with services
maesbn has quit [Remote host closed the connection]
himsin has joined #ruby
<shevy>
Spooner, even you don't do this always :D "<Spooner> cool it is 0 characters starting from index 2" <--- no '.' !!!
<Spooner>
shevy : Except me and everyone else who does (I append them in my mind, so I don't have to hit people with shovels every day).
<banisterfiend>
CodeFriar: mess with show-source on it
<shevy>
but you don't always!
<shevy>
I scrolled up!
<shevy>
now Muz on the other hand...
<Spooner>
Oh, you caught me out then.
<shevy>
my new mission is to see Muz not finish a sentence properly (one day...)
<Muz>
Oh dear.
<shevy>
:(
<rajmahendra>
I am using MacBookPro and i wanted to use awestruct so i installed rvm and then ruby and gem and then installed awestruct it worked for 2 days but 3rd day when i try to run awestruct the command prompet says 'command not found' is ther any reason why suddently gem is missing ?
jprovazn_ is now known as jprovazn_away
<Spooner>
You give shevy purpose. It is a reason for getting up in the morning!
<CodeFriar>
rajmahendra: your terminal session lost access to the rvm environment
<shevy>
rajmahendra but perhaps some setting was changed
<Spooner>
Muz: I doubt that is as important as your new goal (to give poor shevy something to do).
hynkle has quit [Ping timeout: 240 seconds]
<shevy>
I had the funniest errors once when I assigned to the TZ variable in bash... only later did I find out that bash assumes TZ to be the "time zone" variable...
<rajmahendra>
do i need to change anything for the setting ?
<shevy>
I'll get Muz one day... when he is drunk... or tired... he'll have one sentence without '.'
machty_ has joined #ruby
<CodeFriar>
rajmahendra: try restarting your terminal
v0n has quit [Ping timeout: 246 seconds]
machty has quit [Read error: Connection reset by peer]
machty_ is now known as machty
davidcelis has quit [Quit: K-Lined.]
bradhe has joined #ruby
<Spooner>
I realise now that shevy's quote of me doesn't start with a capital either. I must be drunk or tired!
<shevy>
Spooner Muz just has the most awesome discipline
<shevy>
he needs to be dragged down to our level
Criztian has quit [Remote host closed the connection]
<Spooner>
I must just imagine my perfection. My code indentation is probably dreadful too, but I see it as immaculate :P
bbttxu has quit [Quit: bbttxu]
<shevy>
hehe
<shevy>
you use 2 spaces?
<Spooner>
I _believe_ I do.
<shevy>
good!
<rajmahendra>
once i install rvm is ther any sys variable it creates ?
<shevy>
Muz, what indentation level do you use? 2 spaces?
<Spooner>
But I believed I always used capitalisation and full stops.
<rajmahendra>
if it sets any variable then i can set it manually on my .bashrc
ccooke has quit [Ping timeout: 245 seconds]
<CodeFriar>
rajmahendra: read the rvm installation docs
<Muz>
shevy: I do.
miho has joined #ruby
hynkle has joined #ruby
verbad has joined #ruby
havenn has quit [Remote host closed the connection]
verto is now known as verto|off
willb has quit [Ping timeout: 244 seconds]
wvms has left #ruby [#ruby]
<workmad3>
Spooner: my indentation is wonderful: <esc>G=gg<cr>:wqa :)
havenn has joined #ruby
otzy007 has joined #ruby
Cache_Money has quit [Ping timeout: 252 seconds]
ccooke has joined #ruby
halfie has left #ruby ["WeeChat 0.3.5"]
timonv has quit [Remote host closed the connection]
willb has joined #ruby
<Hanmac>
ruby CAN warn when the indentation is wrong ... but its not activated by default
t36845 has quit [Remote host closed the connection]
peterhellberg has quit [Remote host closed the connection]
yasushi has joined #ruby
_keith has joined #ruby
jorge_ has quit [Ping timeout: 246 seconds]
recycle has joined #ruby
iflista has joined #ruby
yasushi has quit [Remote host closed the connection]
al2o3cr has joined #ruby
mahmoudimus has joined #ruby
locriani has quit [Remote host closed the connection]
verbad has quit []
gqlewis has joined #ruby
eywu has joined #ruby
MarGarina has quit [Quit: leaving]
Guest37999 has quit [Ping timeout: 240 seconds]
emmanuelux has joined #ruby
Progster has quit [Ping timeout: 272 seconds]
havenn has quit [Remote host closed the connection]
robotmay has quit [Remote host closed the connection]
chussenot_ has joined #ruby
chussenot_ has quit [Client Quit]
Guest37999 has joined #ruby
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
chussenot has quit [Ping timeout: 240 seconds]
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
kuranai has joined #ruby
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
Takehiro has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
xorigin has quit [Quit: leaving]
Guest64451 has quit [Ping timeout: 272 seconds]
gvz has quit [Quit: Leaving]
apok has joined #ruby
<lectrick>
shevy: or banisterfiend: Any idea how I can make an instance method of a class see variables defined in the area where that method is called? https://gist.github.com/49ff8fc0d0a84df565a7 is an example
shevy has quit [Ping timeout: 252 seconds]
<lectrick>
argh this goes back to the Binding.of_caller thing, doesn't it. grrr
mmitchell has quit [Remote host closed the connection]
bigmeow has joined #ruby
<Spooner>
cool : I don't really understand why; it is just how it is. You can argue that index 5 is directly after the last element, but 6 is completely separate, but frankly I think it is just a case of "because that is how it works" (and Ruby failing on its promise of least surprise for noobies, even if it makes sense for some people on some higher plane).
<Spooner>
lectrick : If you need to do that, then the method is broken. That is what parameters are for...so use them.
<lectrick>
Spooner: I am redefining a method whose behavior changes based on its context though
<Spooner>
lectrick : Yes, but the caller should pass what it wants the instance to see. There isn't any sensible usecase (outside of tools like Pry) that really need you to see the external binding, rather than the external just passing more variables.
Synthead has joined #ruby
t63494 has quit [Remote host closed the connection]
<Hanmac>
lectrick you could use binding() but i not recomend that
sdwrage has joined #ruby
t32096 has joined #ruby
kuranai has quit [Remote host closed the connection]
Tref has joined #ruby
kuranai has joined #ruby
jorge_ has joined #ruby
dross has joined #ruby
<Spooner>
lectrick : The likelihood is that your design is flawed. Perhaps explain why you _need_ to access the external variables, rather than just asking the caller to pass in the vales you need to see. There is likely a much cleaner way to achieve what you want to do than hacking bindings.
savage- has joined #ruby
tayy has joined #ruby
DrShoggoth has joined #ruby
adac has quit [Ping timeout: 260 seconds]
<Hanmac>
Spooner: what is better: object.section(material) {|o| o.vector(...)} or object.section(material) { vector(...) } ? (the vector method add an new vector inside an Ogre::ManualObject) ... the first one uses yield, the other instance_eval ... or should i support both?¿
jonathanwallace has quit [Remote host closed the connection]
paolooo_ has joined #ruby
<lectrick>
Spooner: I'm 90% done with implementing Refinements in pure Ruby.
<lectrick>
The only hard part is scoping.
<Spooner>
I think you should either use yield. The problem with instance_eval is that you immediately give them the context of the object and potential to access private methods and variables. I have a magic wrapper to make instance_eval nicer though :) Keep meaning to make it a separate gem.
<Spooner>
I mean you should just use yield(self).
paolooo has quit [Ping timeout: 245 seconds]
qwerxy_ has quit [Read error: Connection reset by peer]
<Spooner>
Reminds me I should use public_send et al in there.
shevy has joined #ruby
adeponte has joined #ruby
jorge_ has quit [Remote host closed the connection]
<Hanmac>
hm ... maybe usefull ... but i think i will use yield ...
apok has quit [Quit: apok]
araujo has quit [Remote host closed the connection]
ibash has quit [Client Quit]
<Spooner>
Not sure why I felt I needed to avoid putting everything in method_missing, but we won't go there :) I'll try to get around to it one day then.
<Spooner>
(making dsl_wrapper gem, that is).
adamkittelson has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
Tref has quit [Quit: Tref]
iori has quit [Ping timeout: 245 seconds]
<Spooner>
lectrick : "I'm 90% done with implementing Refinements in pure Ruby." Just because it is nearly finished doesn't mean it is well-designed. What you are doing just smells fishy to me and is likely to cause no end of headaches for users in the future.
<Hanmac>
Spooner: what is funny too: an def inside a def with the same name :P
<lectrick>
Spooner: I have a comprehensive test suite? :)
Advocation has quit [Quit: Advocation]
<Spooner>
comprehensize test suites don't prove anything either. I have things that are broken with thousands of tests :P
<Hanmac>
lectrick from wich language do you port? sometime an wrapper is better than a porter *g
apeiros_ has joined #ruby
iori has joined #ruby
havenn has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
havenn has quit [Remote host closed the connection]
<Spooner>
Mainly because it is easier to test stuff that is simple to test a million times, than to test all the stuff that really is badly designed to be able to be tested (and here, I'm talking about my own bad designs).
<Spooner>
That is true; what language does it come from and what language/lib really needs to have access to the equivalent of the caller's binding?
<lectrick>
Spooner: You are probably right. I am mainly doing this as an exercise in my own metaprogramming skill.
xaxxon has quit [Quit: This computer has gone to sleep]
<lectrick>
Spooner: Yes, that's the one. I even have class methods working, which that blog entry says won't work
headius has joined #ruby
<lectrick>
But I do not have class scoped refinements working.
<lectrick>
I have refinements working in a block, but that's easy
maletor has joined #ruby
t32096 has quit [Remote host closed the connection]
jorge_ has joined #ruby
randomautomator has joined #ruby
t12914 has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<Spooner>
lectrick : Well, the goal is admirable (in that I can see it being very useful to monkeypatch Fixnum in my gem, without immediately breaking other gems).
kuranai has quit [Remote host closed the connection]
olrrai has joined #ruby
<lectrick>
Spooner: Yes, I've become smitten with this idea and that is where the obsession began lol.
kuranai has joined #ruby
<lectrick>
I'm sorry I ever read about it.
Xeago has quit [Ping timeout: 245 seconds]
<Spooner>
Interesting that the guy needed to patch the Ruby source to get it to work, even if your implementation is going to be a lot slower in pure Ruby (like that matters most of the time).
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
<lectrick>
Right. I'm going pure-Ruby and as much feature parity as I can figure out.
rajmahendra has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
<Mon_Ouie>
How do you implement lexical scoping?
<lectrick>
My implementation will only work in a single threaded scenario though. Perhaps the Ruby source patch works in a multithreaded situation, Spooner
ngoldman has joined #ruby
<lectrick>
Mon_Ouie: That's the hardest part. Actually that's arguably the entire problem. I'm basically faking it for now.
<Spooner>
lectrick : Fair enough, but CRuby, now we have fibers, gains a lot less from using threads than it used to.
havenn has joined #ruby
suppp has joined #ruby
schleppy has joined #ruby
TPFC-SYSTEM has joined #ruby
<lectrick>
Mon_Ouie: I'm trying to take advantage of things naturally going out of scope (like instance variables) causing the refinement stack to revert to an earlier version
ringotwo has quit [Remote host closed the connection]
<Spooner>
And your system is Ruby, not CRuby based, so should work on any Ruby platform. Hmm, well, I suppose this is a case where hacking (using bindings as you suggest) makes _some_ sense. I am not a great metaprogrammer, so I can't think of a better way to do it with or without bindings.
<lectrick>
Spooner: yeah :/
benatkin has quit [Ping timeout: 244 seconds]
<Hanmac>
my gems only work for CRuby :'(
locriani has quit [Ping timeout: 252 seconds]
<lectrick>
Spooner: This is not the first time I've run into where knowing the binding of the caller would be useful, but Binding.of_caller is apparently a fugly, slow hack
havenn_ has joined #ruby
<lectrick>
Spooner: Without explicitly passing it in, I mean.
benatkin has joined #ruby
kuranai has left #ruby [#ruby]
<Spooner>
Hanmac: You should stop writing C extensions when you could use ffi then :P (I'm considering rewriting an ffi gem I wrote as an extension because it is more than a bit flakey :D).
<Hanmac>
i dont think ffi works for C++ libs :D
<rking>
Hrm, having trouble seeing whether Ruby is weak on this one or if it's just *my* Ruby: In Coffee you can do the following (forgive multiline please, it'll be a total of 3 including this one):
<rking>
f
<rking>
arg: val
<juha_>
i'm trying to delete a row from mysql using a id (integer) coming from an user input (string), what would be the best way to escape that and to check that it is a number? id.is_a? Integer returns false because of string and if i force it to integer with id.to_i, mysql statement won't work
<juha_>
"can't convert Fixnum into String "
<rking>
(And you can continue on with the named params after that.) In Ruby I'd have to either put an "arg: val" on the same line as the "f", followed by a comma, or else backslash after "f", right?
mmitchell has joined #ruby
<Spooner>
rking : Or use brackets
<rking>
juha_: User input is always a sticky issue. I'd probably start with /^\d+$/ and go from there.
<rking>
Spooner: K, so Coffee: 1, Ruby: 0 on this one. =\
paolooo_ has quit [Quit: Page closed]
<Hanmac>
rking why is Coffee better?
paolooo has joined #ruby
<juha_>
rking: what i was thinking was a stupid hack like this: if id.to_i === 0 return false, but i still have the sql issue..
<juha_>
would id.to_i.to_s work?
recycle has quit [Remote host closed the connection]
recycle has joined #ruby
<rking>
Hanmac: Because this: f
<Spooner>
juha_ : The problem is that "0".to_i == 0
<rking>
arg1: val1
<rking>
arg2: val2
<rking>
Crap, bad indentation. =( Defeats purpose of multilining entirely. =(
<juha_>
Spooner: that's ok, in this case i don't have any rows with id 0
<chiel>
rking: just make a gist? :P
<juha_>
Spooner: ok for today, not ok next week
<Spooner>
juha_ : As someone said, use a regexp to pull out the number makes more sense.
<rking>
Hanmac: So of course it's going to win on the virtue of its optional commas. That's a thing that Jashkenas did that's pretty awesome IMO, taking optional semis to the next level.
<rking>
Hanmac: Yes, but I'm just micro-golfing the call at the moment, because this is such a common thing.
niklasb has joined #ruby
<rking>
What I've been doing in actual code is either finding a key that is clearly the most important, and putting it on the line with the method and having a trailing comma, or else backslashing
<Hanmac>
i hate languages that forces me to indent or to newline
<rking>
I heart such languages.
<rking>
Only ever run into trouble when doing print "foo" debugging
venkatk_ has joined #ruby
<Hanmac>
in ruby you are free to do
banghouse has joined #ruby
<rking>
And then it's a matter of a few << or >>'s in vim
[diecast] has joined #ruby
Takehiro has quit [Remote host closed the connection]
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
a_a_g has joined #ruby
<Spooner>
It is also the fact that CoffeeScript is significantly newer. If Ruby was designed today, rather than 20 years ago, I'm sure it would have sugar like that, but when it was made it had massive sugar compared to the alternatives. Still, doesn't excuse Ruby for not being cleaner, of course.
macer1 has quit [Changing host]
macer1 has joined #ruby
brisbin has joined #ruby
<nullsign>
Ruby is 20 years old?
recycle_ has joined #ruby
hmans has quit [Quit: Leaving...]
moshee has quit [Ping timeout: 245 seconds]
t12914 has quit [Remote host closed the connection]
<elaptics>
nearly
<rking>
Spooner: Yes, you're right. Hash args in particular are only 1.9-sugarized.
<elaptics>
1995 I think it was created
<Spooner>
Oh, no 1995 is only 17 years ago.
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
recycle has quit [Read error: Connection reset by peer]
t34993 has joined #ruby
Liothen has quit [Remote host closed the connection]
jenrzzz has joined #ruby
<rking>
Spooner: Ruby beats Coffee on optional parens in many cases, because of Coffee's (foolish?) adherence to the JS semantics that parenless, argless function members are references to the function, not function calls.
<rking>
Which is especially bad, IMO, because it ever so slightly discourages breaking methods up into smaller pieces.
Liothen has joined #ruby
Liothen has joined #ruby
Liothen has quit [Changing host]
verto|off is now known as verto
Takehiro has joined #ruby
opus has joined #ruby
c0rn_ has joined #ruby
apok has joined #ruby
mrsolo has joined #ruby
<Spooner>
rking : So you need to do coffee() or coffee(a, b) or coffee_method a, b ?
mucker has joined #ruby
ShiintoRyuu has joined #ruby
<rking>
coffee() and coffe a, b and @coffee_method a, b
<juha_>
nice, thanks guys
Criztian has joined #ruby
fantazo has quit [Remote host closed the connection]
<rking>
But it's a bit better with regard to letting you leave off parens for nested calls. I haven't actually figured out what Ruby's rules are for exploding with a syntax error in those cases.
krz has joined #ruby
bier_ has joined #ruby
<rking>
Coffee pretty much always has *an* interpretation, and when it's not the one you want you can add parens. (Though, to hate on the "f()" meme I usually put them outside, like "(f a, b)"
<rking>
)
banisterfiend has quit [Read error: Connection reset by peer]
bier has quit [Ping timeout: 244 seconds]
mike4_ has joined #ruby
kenichi has joined #ruby
<Hanmac>
rking: so it copy object-c too with this [shit: other] ? :P
<Spooner>
I used to do taht in Ruby, I have to admit. It made more logical sense on some level.
tnk1 has quit [Ping timeout: 272 seconds]
gift has quit [Remote host closed the connection]
tnk1 has joined #ruby
GoldenCider has joined #ruby
banisterfiend has joined #ruby
GoldenCider has quit [Remote host closed the connection]
havenn_ has quit [Remote host closed the connection]
hynkle has quit [Ping timeout: 252 seconds]
<rking>
I do it in Ruby also, to demonstrate the point. No admitting needed.
MoMo has quit [Quit: Connection closed for inactivity]
<rking>
Entering optional parens are almost always either fraidycatness or clinging-to-dusty-traditionness, IMO.
<Spooner>
I don't do it any more though. I omit parens as much as I can to avoid syntax fails though.
<rking>
Hanmac: I don't know ObjC, can you explain that?
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
bluenemo has quit [Remote host closed the connection]
pricees has quit [Ping timeout: 272 seconds]
fmcgeough has joined #ruby
hynkle has joined #ruby
ringotwo has joined #ruby
haxrbyte_ has quit [Ping timeout: 260 seconds]
<Hanmac>
rking its like C ... with more Shit inside :D
jenrzzz has quit [Ping timeout: 246 seconds]
sdwrage has quit [Quit: geekli.st/programmer]
<Spooner>
I am still in two minds though, about the whole omit-parens thing. I do feel that noobies are going to struggle with the rules over when they need and don't need parens. I'm still convinced that I parse code marginally better with the parens, though I do like removing all clutter on another level.
emmanuelux has quit [Ping timeout: 260 seconds]
Guedes has joined #ruby
jorge_ has quit [Remote host closed the connection]
<brisbin>
if there's some scenario where something always works except the few times it matters, i usually just do it the way that it always works (i.e. i use parens and i pretend and/or doesn't exist)
<brisbin>
that's just me though
<fowl>
>> def foo()end
<al2o3cr>
(NilClass) nil
<rking>
Spooner: The key for me on that one is that any subexpression that is that confusing is a code smell to be its own statement.
tayy has quit [Remote host closed the connection]
<Spooner>
rking : Reasonable argument.
gmci has joined #ruby
<rking>
Spooner: I'm a big fan of temp vars to explain bits, and then those graduate into methods the instant they're useful outside that method.
adac has joined #ruby
lurch_ has quit [Quit: lurch_]
<fowl>
rking: do you believe that your code grows like beautiful water lily?
Niamkik has joined #ruby
<Hanmac>
Spooner: some users remove to much () or they wonder that there is an difference between do...end and {...}
<rking>
Spooner: I've wanted for a while to get Ruby-parenists at the same table as mathematicians and let them try to argue for f(a) as being valid, as it relates to (1/2)+3
<rking>
fowl: Beautifuller, sometimes.
voodoofish430 has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
<Spooner>
Hanmac : Yeah, that does get people. The classic "meth frog {|x| ...}" confusion
arvidkahl has joined #ruby
ianbrandt has joined #ruby
<Hanmac>
fowl more like mushrooms ... in the dark and on dirt :P
<Spooner>
I moved from and/or recently, back to the &&|| because people seemed to hate on words. Not only does it force me to use a lot more parens, but &&|| just make me want to wretch when I have perfectly good and/or to use :) Think I might go back to and/or
<rking>
Yeah. A fungus is probably a much more appropriate analogy for my code.
Matt__ has joined #ruby
<rking>
Spooner: Yeah, both are useful.
apok has quit [Remote host closed the connection]
apok has joined #ruby
elhu has quit [Ping timeout: 244 seconds]
<Spooner>
I just find: "if x.is_a? Chicken and y.is_a? Banana" easier to grok than "if x.is_a?(Chicken) && y.is_a?(Banana)"
ibash has joined #ruby
sailias has joined #ruby
gift has joined #ruby
drohan has quit [Quit: Saliendo]
<Spooner>
But until recently, I hadn't done any non-ruby coding, so && just seemed alien (I've already started using // and # interchangeably in Ruby and C :/).
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
hynkle has quit []
hynkle has joined #ruby
alvaro_o has joined #ruby
himsin has quit [Ping timeout: 246 seconds]
hukl has joined #ruby
poga has joined #ruby
himsin has joined #ruby
xclite has quit [Remote host closed the connection]
<Hanmac>
Spooner ... and cousin of me make a "mod" to gcc so you could use "wenn()" instead of "if()"
machty_ has joined #ruby
mxbtty has joined #ruby
machty has quit [Read error: Connection reset by peer]
machty_ is now known as machty
<lectrick>
How do I hook into when a constant or class is defined? What's that event name/callback?
aantix has quit [Read error: Connection reset by peer]
t32014 has quit [Remote host closed the connection]
v0n has joined #ruby
sazboom has joined #ruby
Norrin has joined #ruby
tr4656 has joined #ruby
thomasfedb has joined #ruby
thorncp has joined #ruby
cfs has joined #ruby
pradeepto has joined #ruby
perryh has joined #ruby
nw has joined #ruby
crankycoder has joined #ruby
kstephens has joined #ruby
beandip has joined #ruby
uxp has joined #ruby
alexhanh has joined #ruby
lorn has joined #ruby
arubin_ has joined #ruby
daniel_hinojosa has joined #ruby
bigkevmcd has joined #ruby
poga has joined #ruby
luckyruby has joined #ruby
rd34 has joined #ruby
LouisGB has joined #ruby
faulkner has joined #ruby
scriabin has joined #ruby
adambeynon has joined #ruby
und3f has joined #ruby
gregorg has joined #ruby
cnf has joined #ruby
gurps has joined #ruby
zburt has joined #ruby
S1kx has joined #ruby
straind has joined #ruby
im0b has joined #ruby
fcoury has joined #ruby
lectrick has joined #ruby
binw has joined #ruby
happosade has joined #ruby
thomas has joined #ruby
clop has joined #ruby
LiquidInsect has joined #ruby
Paradox has joined #ruby
drizz has joined #ruby
schwap has joined #ruby
Nowaker has joined #ruby
zaargy has joined #ruby
fred has joined #ruby
Zol has joined #ruby
Scub has joined #ruby
AnswerGuy has joined #ruby
AwesomeG1rethMan has joined #ruby
yugui_zzz has joined #ruby
lobak has joined #ruby
Elfix has joined #ruby
sixteneighty has joined #ruby
elaptics has joined #ruby
oddraisin has joined #ruby
verto has joined #ruby
zz_chrismcg has joined #ruby
icambridge has joined #ruby
Jck_true has joined #ruby
ByteCrunch has joined #ruby
rakm has joined #ruby
AlbireoX has joined #ruby
nick_h has joined #ruby
dagobah has joined #ruby
ndngvr has quit [Max SendQ exceeded]
aantix has joined #ruby
neersighted has joined #ruby
Kabaka has joined #ruby
ndngvr has joined #ruby
th3xer0_ has quit [Quit: leaving]
apeschel has joined #ruby
thomas has quit [Quit: brb]
SegFaultAX has joined #ruby
nateberkopec is now known as sjkaliski
sjkaliski is now known as wyattisimo
thomas has joined #ruby
wyattisimo is now known as nateberkopec
sailias has quit [Ping timeout: 260 seconds]
tectonic_ has quit [*.net *.split]
himsin has quit [*.net *.split]
recycle_ has quit [*.net *.split]
headius has quit [*.net *.split]
Matt__ has quit [*.net *.split]
mneorr has quit [*.net *.split]
pyreal has quit [*.net *.split]
punkrawkR has quit [*.net *.split]
SCommette has quit [*.net *.split]
naz has quit [*.net *.split]
fermion has quit [*.net *.split]
yosafbridge has quit [*.net *.split]
anekos has quit [*.net *.split]
gentz has quit [*.net *.split]
TorpedoSkyline has quit [*.net *.split]
gogiel has quit [*.net *.split]
oddmunds has quit [*.net *.split]
RichieEvan has quit [*.net *.split]
jmeeuwen has quit [*.net *.split]
Poapfel has quit [*.net *.split]
alek_b has quit [*.net *.split]
deadSnowman has quit [*.net *.split]
eregon has quit [*.net *.split]
passbe has quit [*.net *.split]
SecretAgent has quit [*.net *.split]
alvaro_o has joined #ruby
tectonic_ has joined #ruby
himsin has joined #ruby
recycle_ has joined #ruby
headius has joined #ruby
Matt__ has joined #ruby
gogiel has joined #ruby
deadSnowman has joined #ruby
SCommette has joined #ruby
TorpedoSkyline has joined #ruby
jmeeuwen has joined #ruby
gentz has joined #ruby
Poapfel has joined #ruby
alek_b has joined #ruby
fermion has joined #ruby
punkrawkR has joined #ruby
SecretAgent has joined #ruby
pyreal has joined #ruby
oddmunds has joined #ruby
passbe has joined #ruby
mneorr has joined #ruby
anekos has joined #ruby
naz has joined #ruby
RichieEvan has joined #ruby
eregon has joined #ruby
yosafbridge has joined #ruby
doherty has joined #ruby
hukl has joined #ruby
<doherty>
Where can I find a good primer on testing in Ruby?
<rking>
Hrm.
<rking>
What are you looking for, a book? A quick'n'dirty web page intro?
<doherty>
A short webpage into should do.
* doherty
also searches for documentation on "ActionController::TestCase"
<rking>
Here's the very short version:
<rking>
Start writing assertions.
<rking>
You don't even need a test framework.
hukl- has joined #ruby
hynkle has quit []
anoldhacker has joined #ruby
<rking>
And in fact for some situations I don't bother, for example, say I'm writing a self-contained script, and I hit a part that really needs some unit tests, I'll probaly just write something like:
<doherty>
Yes, but I'm working on a project that already uses... some framework
hynkle has joined #ruby
<rking>
'asdf' == f('fdsa') or fail
Tref has joined #ruby
<doherty>
So, I should probably use the same thing :)
<rking>
Yes, definitely.
<rd34>
Can anyone suggest a good intro to file management with ruby? Like… just to look in a directory and read off the files there?
arubin_ has quit [Quit: leaving]
<rking>
My point is more that the practice is framework-agnostic.
hukl_ has quit [Ping timeout: 272 seconds]
<rking>
rd34: The Dir class API. You can do a glob like, Dir['foo/*'] and it will end up being an array of strings for all the files under foo/
Tref has quit [Client Quit]
_iori_ has quit [Remote host closed the connection]
Tref has joined #ruby
<rking>
doherty: What framework is it?
<doherty>
I'm not really sure :P
<rd34>
rking: Thanks, I'll look into that.
<doherty>
Is ActionController part of a testing framework?
<doherty>
looks like this is a rails thingy
Wizywig has joined #ruby
hukl has quit [Ping timeout: 265 seconds]
venkatk_ has quit [Quit: This computer has gone to sleep]
Godslastering has joined #ruby
<anoldhacker>
I'm getting a segmentation fault trying to link mini ruby on HEAD. make: *** [.rbconfig.time] Segmentation fault
<rking>
doherty: ActionController, itself, is a part of the Rails classes, yes. The ActionController::TestCase part is a child of ActiveSupport::TestCase, which is a child of Test::Unit::TestCase
uris_ has quit [Ping timeout: 244 seconds]
recycle_ has quit [Remote host closed the connection]
<rking>
So if you're using it then you're using basic Test::Unit. Which isn't a terrible place to start, though personally I'm liking RSpec.
<foolove>
i want to do a find and replace on a variable removing spaces in perl i know this is variable =~ s/stringtoreplace//; in ruby i am still learning :)
paolooo has quit [Quit: Page closed]
<brisbin>
see String#sub and String#gsub
hynkle has left #ruby [#ruby]
adac has quit [Ping timeout: 260 seconds]
<doherty>
You should not use a regular expression to remove spaces, that is slow - use a transliteration instead :)
* doherty
has no idea if Ruby does that
<brisbin>
does String have a #reject?
<rking>
doherty: "Premature optimization is the root of every all complete total meltdown of wasted time and lives and evil."
<brisbin>
that'd be neat
AngryParsley is now known as ggreer
<Hanmac>
>> "a long string with spaces".tr(" ","")
<al2o3cr>
(String) "alongstringwithspaces"
<doherty>
xD
<foolove>
brisban so i have to use gsub or sub
<doherty>
But how else can I have fun??!? #trolling
<rking>
But the .tr in this case is more expressive… I just wouldn't do it on performance grounds is all.
<brisbin>
foolove: you don't have to, someone else just gave you the command
<doherty>
okay, back to reading
<Mon_Ouie>
>> "a long string with spaces".delete " "
<al2o3cr>
(String) "alongstringwithspaces"
<brisbin>
foolove: as with most things in ruby, there's about 80 ways to doit
sdwrage has joined #ruby
<rking>
doherty: The challenge with testing on Rails is that the Unit Tests are very unlike the Controller tests which are very unlike the Acceptance tests.
mrdodo has joined #ruby
<doherty>
-__-
namidark has joined #ruby
<juha_>
i'm trying to encode a json string, but having problems with a simple thing as objects, i'm trying to get {"item":"hello world"} and only thing i have for now is "hello world" :D could someone guide me to the right direction?
<Hanmac>
okay ... delete works too
<brisbin>
unit tests and acceptance tests, that's all you really need
<anoldhacker>
rking: I get 652 lines.
DuoSRX has quit [Remote host closed the connection]
<foolove>
so this would work myvariable2parse = replace.gsub(/ /, "") <-- to remove spaces?
<rking>
doherty: If you can start with some simple Unit Testing, e.g. a Model with no Railsness in sight, you'll get a clearer picture of things. Then from there, add on some Capybara-based acceptance tests.
<namidark>
I'm trying to direct $stdout to a StringIO object so I can write some tests to validate the output of a class, but when I do somethign like: require 'stringio'; $stdout = fake = StringIO.new; p "foo"; $stdout = STDOUT; p fake.readlines; fake is still an empty array
und3f1 has joined #ruby
sailias has joined #ruby
und3f has quit [Ping timeout: 246 seconds]
<rking>
anoldhacker: Yep. Now look near the segfault for clues. Maybe it's trying to find a file and failing.
<brisbin>
namidark: fake.string is what you want
MissionCritical has joined #ruby
<rking>
anoldhacker: You might also have to "strace -f" to make sure it's following the forks fully.
<fowl>
juha_: you cant expect json.generate(some_string) to generate an object. json objects are hashes in ruby so you just do json.generate({"item" => some_string}) if you want to get a json object
<namidark>
brisbin: oh nice! :)
ian2 has joined #ruby
<anoldhacker>
rking: Now I have 1329 lines.. and no "segfault" string..
mrsolo has quit [Quit: This computer has gone to sleep]
<juha_>
fowl: yeah as i said, atm i'm having issues with objects
<rking>
anoldhacker: jist that.
<juha_>
fowl: i tried it the javascript way of {} and only got errors
<juha_>
fowl: oh wait, not sure why i wrote Hash.new there
jonathanwallace has joined #ruby
ian2 has left #ruby [#ruby]
<fowl>
juha_: ruby doesnt allow you to do hash.key = value, its hash[key] = value, you're thinking of an openstruct or lua tables or soemthing
axl_ has quit [Read error: Connection reset by peer]
<rking>
anoldhacker: Ahh yes, I see the pids showing up at line 298. That's what I was expecting to see, forgot that they don't show up before an actual fork.
<juha_>
fowl: or javascript :P
<juha_>
fowl: thanks
<anoldhacker>
If you're Hash is actually a Struct, you might....
<rking>
anoldhacker: I'm not sure what's up, here. It's going about doing some stats then exiting. Perhaps make is satisified that nothing needs to be built?
<fowl>
juha_: also you can do JSON(some_hash) to get the json for that hash/array or JSON(string_of_jsonness) to get a hash/array back
<rking>
anoldhacker: Does "make miniruby" continue to segfault?
<rking>
anoldhacker: Argh, I'm continuing to be dumb. At line 625 of your gist it shows the segfault. The tail end is just clean up I guess.
<anoldhacker>
Would it be helpful to tell make just to run one process?
flip_digits has joined #ruby
jarred has joined #ruby
flip_digits has quit [Client Quit]
sailias has quit [Quit: Leaving.]
jarred has quit [Client Quit]
ananthakumaran has joined #ruby
fearoffish has joined #ruby
<anoldhacker>
rking: Beats what I could do....
<rking>
anoldhacker: And in another Argh I'm wrong again. All that is doing is setting up the sigaction. I officially don't see a segfault here.
Takehiro has quit [Remote host closed the connection]
virunga has joined #ruby
<juha_>
got it working, nice
MarioEIU has quit [Quit: Leaving]
<anoldhacker>
rking: lovely. make -j 1 doesn't change the segfault, and doesn't blatantly change the strace out, either.
<fowl>
make -love
virunga has quit [Remote host closed the connection]
<fowl>
:>
<anoldhacker>
rking: I am curious about the stuff about 40 lines earlier: gettimeofday followed shortly by ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc69268) = -1 ENOTTY (Inappropriate ioctl for device)
banisterfiend has quit [Read error: Connection reset by peer]
_graham_ has quit [Ping timeout: 272 seconds]
<rking>
anoldhacker: That's the is_tty? check, I think.
<rking>
Perhaps it's related, though, since we're seeing different behavior when redirecting (it seems).
banisterfiend has joined #ruby
<rking>
anoldhacker: Are you running under tmux?
Matt__ has quit [Ping timeout: 240 seconds]
<rking>
(or, perhaps, with that nick, maybe you're running under screen?)
mrdodo has quit [Remote host closed the connection]
ged has joined #ruby
alindeman has joined #ruby
idoru has joined #ruby
RubyPanther has joined #ruby
eighty4_ has joined #ruby
__class__ has joined #ruby
_marvin_ has quit [Changing host]
_marvin_ has joined #ruby
ladder4_ has quit [Changing host]
ladder4_ has joined #ruby
<anoldhacker>
no, and if I were, that wouldn't do much. I'm @ home on DSL. And yes, I just heard about tmux a couple of weeks ago. :P
mrdodo has joined #ruby
verbad has joined #ruby
mmercer has joined #ruby
alienvenom has joined #ruby
sirecote has joined #ruby
t85553 has joined #ruby
preller has joined #ruby
richardcreme has joined #ruby
_br_ has joined #ruby
SeySayux has joined #ruby
Wizywig has quit [Changing host]
Wizywig has joined #ruby
ananthakumaran1 has joined #ruby
areil has quit [Remote host closed the connection]
fermion has quit [Quit: P]
t85553 has quit [Remote host closed the connection]
vitorave` is now known as vitoravelino`afk
<rking>
anoldhacker: No, what I'm getting at is the idea of running the strace straight to the terminal then using the tmux/screen buffer copy to then gist that.
<anoldhacker>
It's not make that is segfaulting. It is the linker.
<rking>
I mean to jist that, fowl.
t66829 has joined #ruby
ananthakumaran has quit [Ping timeout: 240 seconds]
<rking>
anoldhacker: But, the link being part of the "make" children, should show up under strace -f.
Cascador-afk is now known as Cascador
<anoldhacker>
K. I'll copy & paste.
verbad has quit []
<rking>
Yeah… I "xy problem"d you. Shoulda just said that then suggested tmux if you couldn't get enough scrollback.
Tearan has joined #ruby
Steppen has joined #ruby
chichou has quit [Remote host closed the connection]
Jay_Levitt has quit [Read error: Operation timed out]
sterex has joined #ruby
Speed has joined #ruby
cakehero has joined #ruby
<anoldhacker>
No. Actually, I was just going over --debug=j output, and it looks like miniruby works. It's the .rbconfig.time that is failing. And yes, make -d .rbconfig.time -j 1 segfaults.
<rking>
Oh, umm..
<rking>
So Plain "make miniruby -j 1" doesn't segfault?
Niamkik_ has quit [Quit: leaving]
<anoldhacker>
No. make miniruby works fine. "Nothing to do".
<rking>
Or it does, but as some sub-target that is doing "make .rbconfig.time" (‽)
<rking>
OK, then all is consistent.
<rking>
strace -f make -d .rbconfig.time 2>&1 | jist -c
Foxandxss has joined #ruby
weasels is now known as otters
otters has quit [Quit: WeeChat 0.3.8]
otters has joined #ruby
hmans has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
ananthakumaran1 has quit [Ping timeout: 265 seconds]
havenn has quit [Ping timeout: 252 seconds]
<anoldhacker>
-d? I get 38k lines...
<rking>
For victory and beyond!
imami|afk is now known as banseljaj
<rking>
(Actually, it's not necessary, but I'm past the point of wanting to see anything resembling terse output on this problem)
a_a_g1 has left #ruby [#ruby]
Criztian has joined #ruby
whomp has joined #ruby
wallerdev has joined #ruby
Tearan has quit [Quit: Sleepy Badger....]
Monie has quit [Read error: Connection reset by peer]
xclite has quit [Remote host closed the connection]
<rking>
And what normal stuff should I know about, like does this system regularly successfully compile other things?
Bish has joined #ruby
<anoldhacker>
I have successfully compiled several prior HEADs. I'm hacking a new method into Module, but I'm probably past the point of backing out my changes & trying again.
<rking>
If you stash your changes and retry the compile, does it work?
<anoldhacker>
We shall see...
sdwrage has left #ruby [#ruby]
kirun has joined #ruby
<whomp>
i was reading a 2010 article (http://merbist.com/2010/07/29/object-allocation-why-you-should-care/) about how ruby's naive GC, combined with a disregard for memory usage in frameworks and libraries, forces each programmer to be very careful with memory and creates large issues in the enterprise. is this still true?
verto is now known as verto|off
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz_ has joined #ruby
<Synthead>
is there a ruby equivalent to the bashism ${a:-empty} ? in other words, if a variable is empty, return 'empty', otherwise, return the variable?
<Synthead>
( var ? var : 'empty' ) would do this, but it's hackish imo
<otters>
var || 'empty'
<shevy>
whomp that articles always sounded like hateful FUD
mmitchell has joined #ruby
<whomp>
he mentions 300,000+ objects needed to run "hello, world" in rails
<rking>
whomp: That wouldn't surprise me terribly. Rails doesn't try to be lean on startup.
t66829 has quit [Remote host closed the connection]
<rking>
Takes about 15s for me every time.
t57089 has joined #ruby
<whomp>
is that the sort of thing which might force you to a different framework, as the startup grows?
zburt_ has joined #ruby
jenrzzz_ has quit [Client Quit]
<rking>
Meh. It's not a big deal.
<rking>
You can get your tests running quickly with Guard/Spork.
jorge_ has joined #ruby
<anoldhacker>
I hate it when that happens...
<rking>
The question is one of total optimization. I think you generally faster with Rails than with a lower-level tool, but then again, if you really know Rails, you can just pull in the pieces you want.
zburt has quit [Read error: Connection reset by peer]
zburt_ is now known as zburt
<anoldhacker>
make works fine on HEAD. So I've obviously failed in my attempt to cargo cult.
<shevy>
whomp perhaps if your startup is so successful but at this point your startup already rocks
<rking>
LOL, wait.
sailias has joined #ruby
<rking>
We're talking about two different types of "startup". I mean "time rails c".
<whomp>
time rails c
<whomp>
?
<shevy>
he goes a fast way, from hello world, to a startup
Z_Mass has joined #ruby
<fowl>
lol
<rking>
For once shevy assists in communication, rather than from detracting/deflecting it. Is today opposite day?
<rking>
whomp: I mean the time the rails classes take to load.
<shevy>
watched TV, suddenly SNOOOOOOOZE
<whomp>
ahh i see
Monie has joined #ruby
mmitchell has quit [Ping timeout: 276 seconds]
verto|off is now known as verto
<anoldhacker>
rking: Thanks for the help. Sorry for the mess.
<whomp>
much to ponder... thanks for help people
* anoldhacker
hangs head in shame, goes to get some food.
<shevy>
hehe
<shevy>
guilty eating
<rking>
anoldhacker: No biggie my man. Hopefully you can pinpoint the issue though. One of the things I detest is mysteries.
<shevy>
aha
<shevy>
rking, do you use rails?
<rking>
anoldhacker: Probably there's a good reason. linking shouldn't just up and segfault. The toolchain should guard against that the same as any other program, like a web browser, should guard against segfaults.
<rking>
shevy: Yes, though I'm still a bumbling n00bface with it.
himsin has quit [Ping timeout: 240 seconds]
tommyvYo has joined #ruby
qwerxy has joined #ruby
<rking>
whomp: With things like this I think "Hold, Break, Release" is appropriate. First you hold to a recommendation/convention/idea/etc., to see what it's like going with the flow. Then you break it, to find out the consequences and boundaries. At that point, you're released from the rule, free to make a wise judgment.
triptec has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
<rking>
If someone hasn't gotten the hang of Rails, I don't know if they can rightly say they're aware of the state of the art of web dev.
<whomp>
yeah, that's why i'm turning to others. it's just that these sort of decisions are hard to undo
<rking>
But after that I wouldn't be surprised if all if they move on to more taylored solutions. (Especially since most of Rails is just a collection of gems, that you can pull in however you want)
capsule_toy has joined #ruby
pricees has joined #ruby
jenrzzz has quit [Client Quit]
Xeago has joined #ruby
<rking>
Well, switching frameworks is definitely basically a rewrite, so that's true that it's hard to undo, but with web dev you're never *really* painted into a corner. It's all just making blobs of text that go over the TCP wire, not at all rocket science.
jonathanwallace has quit [Remote host closed the connection]
<rking>
"Oh no! I can't figure out how to turn that HTTP request into an HTTP response!!" ← Never been said.
<whomp>
yeah, just being cautious, scrambling to learn rails for a new deployment lol
sailias has quit [Ping timeout: 246 seconds]
<Xeago>
is there any logs/archives of #ruby?
jwmann has joined #ruby
<whomp>
i'll probably just use rails without any tweaks, and make it leaner as i need
jwmann has quit [Max SendQ exceeded]
<rking>
The risk, and a risk I'm actively in the process of getting bit by and paying down on, is that you'll see some task and invest a good chunk of time not doing it some obvious way because you're learning "the Rails way"
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
adac has joined #ruby
<rking>
A good example of that is the asset pipeline.
<whomp>
you mean, in a misguided attempt to do things the "rails way", you end up writing bad code?
<rking>
You can bypass it entirely same as you always did, just hard-coding paths to css and js and putting those files underneath the front-end web server. But learning the Sprockets stuff, with compilation from .sass and .coffee and minifying/caching everything, is more rewarding.
<rking>
whomp: No, I just mean that there are a bunch of things I already know how to do, but it takes me longer to do them in Rails because there are new things to learn.
<rking>
whomp: Routing is a great example of that.
sailias has joined #ruby
adac has quit [Read error: Connection reset by peer]
adaccada has joined #ruby
<apeiros_>
rails does have quite a big learning overhead
phinfonet has joined #ruby
<whomp>
yeah same, with any framework it's quite hard to know if you're things in the most concise, proper way
adaccada has quit [Read error: Connection reset by peer]
headius has joined #ruby
<rking>
It's a fairly complex wad of idioms, but they're nudging you in the right direction, towards using REST better, towards a closer mapping between concept and characters typed into config/routes.rb. Like learning any other language or vocabulary subset, there's an up-front cost.
ninegrid has joined #ruby
Eldariof27-ru has joined #ruby
<apeiros_>
na, rails is a big framework. other frameworks are smaller and have a lower overhead.
<apeiros_>
it usually means that they do less to, so don't get me wrong on that.
adaccada has joined #ruby
adaccada has quit [Remote host closed the connection]
<whomp>
yeah, but even zend php was a headache
<apeiros_>
but the overhead is definitively there
jenrzzz has joined #ruby
suppp has quit [Quit: suppp]
<apeiros_>
oh, well, php
<whomp>
XD
adaccada has joined #ruby
<apeiros_>
I'm refering to ruby frameworks
<apeiros_>
php is its own nightmare altogether
<whomp>
haha yeah
adaccada has quit [Read error: Connection reset by peer]
<whomp>
any books i should read to really get the hang of rails?
Eldariof59-ru has quit [Ping timeout: 244 seconds]
<rking>
Hanmac: What do you prefer?
rd34 has quit [Quit: rd34]
<whomp>
ah yes i was reading that one
aquaranto has joined #ruby
[diecast] has joined #ruby
<Hanmac>
i dont do webserver programming currently ... but i could do it in C :P
xclite has joined #ruby
jarred has joined #ruby
schleppy has quit [Quit: Leaving.]
Steppen has quit [Quit: leaving]
jarred_ has joined #ruby
krz has joined #ruby
pabloh has joined #ruby
cool has joined #ruby
<hashpuppy>
Hanmac: you work for dos equis?
<pabloh>
anybody with experience modifying an excel or ods file from ruby code?
<Hanmac>
no i never heard of them ... some underground organisation like Iluminati or FBI?
<hashpuppy>
the most interesting man in the world
* anoldhacker
KNOWS that rails is evil. Good paying, too!
<hashpuppy>
i don't usually do web server pgoramming, but when i do, i do it in C
<otters>
pgoramming
<hashpuppy>
it's a new thing
<otters>
pgo-ramming
<otters>
totally rammed this little pgo last night
<hashpuppy>
pgo is some hot neighbor of mine
jenrzzz has quit [Quit: crash]
kvirani has quit [Remote host closed the connection]
Jay_Levitt has joined #ruby
randym has joined #ruby
Araxia has joined #ruby
dnyy_ has joined #ruby
jarred has quit [Remote host closed the connection]
fcoury has joined #ruby
bbttxu has joined #ruby
enroxorz-work is now known as JohnRedcorn
Takehiro has joined #ruby
JohnRedcorn has left #ruby ["Leaving"]
xclite has quit [Remote host closed the connection]
carloslopes has joined #ruby
mxbtty has quit [Quit: Leaving.]
xclite has joined #ruby
Matt_ has joined #ruby
jjbohn|afk is now known as jjbohn
anildigital_work has joined #ruby
jenrzzz has joined #ruby
Takehiro has quit [Ping timeout: 272 seconds]
BrokenCog has quit [Quit: leaving]
davidboy has joined #ruby
berserkr has quit [Quit: Leaving.]
jarred_ has quit [Quit: jarred_]
mike4_ has quit [Ping timeout: 276 seconds]
<shevy>
otters you naughty naughty otters you!
xclite has quit [Remote host closed the connection]
virunga has joined #ruby
dhruvasagar has joined #ruby
coyo has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
mengu has joined #ruby
t57089 has quit [Remote host closed the connection]
t41372 has joined #ruby
jarred has joined #ruby
SeanTAllen has joined #ruby
Parhs has joined #ruby
Parhs has left #ruby [#ruby]
Tearan has joined #ruby
abahkaiyisah has joined #ruby
Yiq has joined #ruby
Tearan has quit [Client Quit]
<lectrick>
I still can't believe that my object's method can't know who called it unless that thing passes it into my method.
<Yiq>
so if u dont use something like appengine or heroku, u have to use your own server? isnt there somewhere you can just deploy your whole stack easily?
jarred has quit [Remote host closed the connection]
rcassidy has joined #ruby
<lectrick>
"caller" is way too rudimentary
denysonique has joined #ruby
sailias has quit [Quit: Leaving.]
uris has quit [Quit: leaving]
xclite has joined #ruby
hukl- has quit [Remote host closed the connection]
hukl has joined #ruby
bricker88 has joined #ruby
mxbtty has joined #ruby
mxbtty has quit [K-Lined]
MarioEIU has joined #ruby
kvirani has joined #ruby
Jay_Levitt has quit [Ping timeout: 246 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
banisterfiend has quit [Read error: Connection reset by peer]
cascalheir has joined #ruby
Yiq has quit []
linoj has quit [Quit: linoj]
qwerxy has quit [Quit: offski]
elaptics is now known as elaptics`away
elaptics`away is now known as elaptics
apucacao has joined #ruby
apucacao has left #ruby [#ruby]
uris has joined #ruby
apucacao has joined #ruby
hukl_ has joined #ruby
Proshot has joined #ruby
gqlewis has quit [Ping timeout: 272 seconds]
tiripamwe has joined #ruby
xclite has quit [Remote host closed the connection]
ShiintoRyuu has quit [Quit: Computer has gone to sleep.]
<Gadgetoid>
Is there really no way to specify additional OBJS and SRCS using mkmf?
banisterfiend has joined #ruby
xclite has joined #ruby
hukl- has joined #ruby
hukl has quit [Ping timeout: 260 seconds]
hukl- has quit [Remote host closed the connection]
hukl_ has quit [Read error: Connection reset by peer]
<Gadgetoid>
I had to hack my extconf.rb to hell and back
hukl has joined #ruby
nicoulaj has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<invisime1>
Gadgetoid: it seems that way. I ended up just manually adding stuff to two or three different globals.
yoklov has joined #ruby
invisime1 is now known as invisime
<Gadgetoid>
invisime: I actually loaded up the makefile and modified those lines, probably not ideal
banisterfiend has joined #ruby
<Gadgetoid>
So doing something like srcs = Dir.glob('WiringPi/wiringPi/*.c') and makefile.sub!('SRCS = ','SRCS = ' + srcs + ' ')
<invisime>
Gadgetoid: indeed. if you want to do that kind of thing, just add it to the globals that mkmf uses to populate those lines. it's (slightly) cleaner. still hackish, but you at least don't need to do any subbing.
ephemerian has joined #ruby
whomp has quit [Quit: Leaving]
answer_42 has quit [Quit: WeeChat 0.3.8]
ngoldman has quit [Remote host closed the connection]
pj has joined #ruby
ngoldman has joined #ruby
<Gadgetoid>
invisime: You mean $OBJS and $SRCS? true
lteo_ has left #ruby [#ruby]
hukl has quit [Ping timeout: 245 seconds]
<invisime>
for a list of globals that mkmf uses, type the following three lines into irb: defaults = global_variables
<invisime>
so I think it's $objs and $srcs (lowercase), but you'll want to double check your Makefile after doing hacks like this.
pj has left #ruby [#ruby]
<Gadgetoid>
Blast, it is! Thanks
pricees has left #ruby [#ruby]
jasonLaster has quit [Remote host closed the connection]
jasonLaster has joined #ruby
<invisime>
incidentally, Gadgetoid, do you know how to make it so a custom included .so file's path doesn't have to be included in the LD_LIBRARY_PATH environment variable in order to be linked properly when your extensions .so file is loaded, it can find the other .so?
bigfatfrock has joined #ruby
davidcelis has quit [Quit: K-Lined.]
ngoldman has quit [Ping timeout: 245 seconds]
mmitchell has joined #ruby
pricees has joined #ruby
hukl_ has joined #ruby
azm has quit [Ping timeout: 245 seconds]
<Gadgetoid>
invisime: I'm just monging the two together into one library
<Gadgetoid>
$srcs = Dir.glob('WiringPi/wiringPi/*.c') is far simpler! thanks
<Gadgetoid>
With the source of the custom .so residing in WiringPi/wiringPi/ just using: $objs = Dir.glob('WiringPi/wiringPi/*.c').map{ |file| file.sub('.c','.o') insures it's compiled into wiringpi.so
andrewpthorp has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
jasonLaster has quit [Ping timeout: 246 seconds]
dpk has quit [Quit: Asleep at the keyboard.]
Criztian_ has joined #ruby
<invisime>
sweet. so my problem is this: I can't just put the source for everything in one go because some of my code is generated by a third-party tool. so I have to link to that, but it's not in the standard library. I tried using find_library and specifying the path, but it didn't find the library there. :-/
paolooo has joined #ruby
banghouse is now known as banghouseFOOD
andrewpthorp has quit [Client Quit]
<Hanmac>
invisime try find_header before
andrewpthorp has joined #ruby
<invisime>
I kind of found a work around by just adding the appropriate -L -I and -lotherlibrary flags, but then the extension .so doesn't know where to find the libotherlibrary.so file at runtime unless I set the LD_LIBRARY_PATH environment variable.
<Gadgetoid>
Hmm, I'm new to this stuff :D
BrokenCog has joined #ruby
elaptics is now known as elaptics`away
<_keith>
mmm Ruby code looks so nice
<Mon_Ouie>
neither Ruby nor your OS can guess where your library is if it's not in a standard path
<Mon_Ouie>
or gcc, rather than Ruby
<_keith>
I need to spend more time on this stuff, I have spent too much with PHP trying to force OOP
<invisime>
Mon_Ouie: right, so how do I get gcc to tell the gem object where to look at compile time instead.
pyreal has quit [Quit: pyreal]
jwg2s has quit [Quit: jwg2s]
<invisime>
Hanmac: when I do that, it finds the header but not the library.
<Gadgetoid>
Doing all this stuff directly on a Raspberry Pi certainly slows it down :D
<BadQuanta>
invisime: From what I understood, you said it. You can either temporarily change LD_LIBRARY_PATH, permanently change it, or install the library so that it is in the LD_LIBRARY_PATH
<Mon_Ouie>
Maybe you don't want dynamic linking
<invisime>
BadQuanta: do you happen to know how to permanently change it?
paolooo has quit [Ping timeout: 245 seconds]
<BadQuanta>
Let me find out. Which distro are you running?
<Mon_Ouie>
See /etc/ld.so.conf*
<invisime>
Mon_Ouie: I know I don't. I'd much rather have source right here, but unfortunately, I don't have source. this library is generated by a third-party tool.
<BadQuanta>
invisime: Mind you, I'll be doing the same google searching you could have.
Speed has quit [Ping timeout: 252 seconds]
<BadQuanta>
looks like Mon_Ouie said it.
<invisime>
BadQuanta: nevermind then, I'll do it. that was why I prepended "do you happen to know..." :-)
bigfatfrock has left #ruby [#ruby]
hmans has joined #ruby
hmans has quit [Client Quit]
<BadQuanta>
invisime: Cool beans. :)
<invisime>
Mon_Ouie: so I want to do some kind of something with ldconfig then?
jwmann1 has joined #ruby
jwmann1 has quit [Max SendQ exceeded]
emmanuelux has joined #ruby
jwmann1 has joined #ruby
jwmann1 has quit [Max SendQ exceeded]
jwmann1 has joined #ruby
jwmann1 has quit [Max SendQ exceeded]
sailias has joined #ruby
und3f1 has quit [Quit: Leaving.]
SQLStud has joined #ruby
DuoSRX has quit [Remote host closed the connection]
krusty_ar is now known as minita17
banisterfiend has quit [Remote host closed the connection]
ninegrid has quit [Quit: leaving]
<Mon_Ouie>
Just running it I think
apucacao has quit [Quit: apucacao]
banisterfiend has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has quit [Read error: Connection reset by peer]
<elico>
I need some help with Berkley DB files.
ilyam has joined #ruby
burgestrand has joined #ruby
banisterfiend has joined #ruby
stopbit_ has quit [Read error: Connection reset by peer]
bricker88 has quit [Ping timeout: 276 seconds]
<elico>
working with Berkley DB files.
eywu has joined #ruby
<Muz>
What's the actual problem?
stopbit has joined #ruby
mucker has quit [Quit: leaving]
mahmoudi_ is now known as mahmoudimus
<elico>
I want to store\read domains in a Berkley DB file
<elico>
it's a domain blacklist
malcolmva has quit [Ping timeout: 276 seconds]
<elico>
so I need to read from a text file a list of domains and store them in DB
eywu1 has quit [Ping timeout: 244 seconds]
tiripamwe has quit [Ping timeout: 245 seconds]
<elico>
and then check if they exist...
<Hanmac>
invisime it may work to set the LD_LIBRARY_PATH inside your extconf.rb file ...
mmitchel_ has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
<elico>
currently i am working with mysql and storing the data in a reverse stat such as "dom.com" stored as "moc.mod" since mysql dosnt have a reverse index option.
<Hanmac>
invisime: normaly an lib, proprietary or not should be installed under /usr/lib, /usr/<arch>/lib or /usr/local/lib ... or do you want to ship it inside the gem?
beneggett has quit [Quit: Computer has gone to sleep.]
<shevy>
Hanmac the problem here is that they reference to state-of-the-art science like 200 years ago
jwmann has joined #ruby
<invisime>
Hanmac: that latter would be preferable, but I'd settle for either way.
jwmann has quit [Max SendQ exceeded]
<foolove>
does replace.gsub need a module
<shevy>
Hanmac they do not want to "learn" modern day science because they only want to attack a very small and narrow niche
<atmosx>
yeah but why should I initialize anything here
t41372 has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
<shevy>
atmosx, for version strings, I recommend VERSION or Version constant
mengu has quit [Remote host closed the connection]
elhu has quit [Client Quit]
<shevy>
because you want to use an instance variable
t1806 has joined #ruby
<Hanmac>
better: VERSION = "version 0.2-alpha".freeze
<shevy>
and they do not exist unless you give them a value
flip_digits has joined #ruby
jasonLaster has quit [Remote host closed the connection]
<shevy>
you should use a constant though :D
<invisime>
Hanmac: it shouldn't matter, it's in both places. and have_library doesn't find it. nor does find_library when I hand it an explicit path to search. :-/ I've basically had 0 success with getting have_library to work with this thing.
banisterfiend has joined #ruby
kenichi has quit [Remote host closed the connection]
jasonLaster has joined #ruby
urbann has quit [Remote host closed the connection]
flip_digits has quit [Client Quit]
<atmosx>
shevy: Yes, I'll go with the constant, thanks the hints :-) happy to clarify ruby basics hehe
MarioEIU has quit [Quit: Leaving]
<Hanmac>
currently it only looks in /usr/local/lib not in the sub dirs ... so the best would be symbolic links
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
hashpuppy has quit [Quit: hashpuppy]
<rcassidy>
>> p "ping"
<al2o3cr>
(String) "ping", Console: "ping"
<shevy>
atmosx, what I usually do is write a method called "def reset"
<shevy>
and call this from initialize()
<shevy>
at least for larger classes
<atmosx>
what does it do?
ciopte7 has joined #ruby
<shevy>
atmosx, I use it mostly to initialize all @ivars
hakunin has joined #ruby
<shevy>
I find it cleaner to put it into a method, than initialize them directly in def initialize
<shevy>
def initialize
<shevy>
@foo = "bla"
<shevy>
vs
<shevy>
def initialize
<shevy>
reset
<atmosx>
shevy: I need to see an example, a gist or someting
<shevy>
^^^ :)
<shevy>
it's really only that
<atmosx>
ah def initialize reset
<atmosx>
and then you define everything in reset
<shevy>
yeah
<shevy>
in the past I did this
<atmosx>
it's just another abstraction layer though
<shevy>
def initialize
<shevy>
initialize_instance_variables
<shevy>
but that was too long
<invisime>
is there some way to make bundler run the extconf.rb file for a local gem?
<shevy>
atmosx, yeah
<shevy>
atmosx, but many things are abstraction layers
<atmosx>
yes sure
<shevy>
atmosx, all methods are abstraction layers ;)
<atmosx>
haha true
<shevy>
but I like methods, they feel as if they make things much cleaner
<atmosx>
hmm Not sure if should I use FTS3 in sqlite3
jasonLas_ has joined #ruby
jasonLaster has quit [Read error: Connection reset by peer]
t1806 has quit [Remote host closed the connection]
kenichi has joined #ruby
juarlex has joined #ruby
andrewhl_ has quit [Remote host closed the connection]
[diecast] has quit [Changing host]
[diecast] has joined #ruby
[diecast] has joined #ruby
[diecast] has quit [Changing host]
<Axsuul>
adeponte: oh sick, thanks for letting me know
<Axsuul>
how did you ever find that gem =p
<Axsuul>
or is this yours
<adeponte>
Axsuul: yep, no problem. It is some other dudes code that I found in a super old project before gems really existed. So, I figured I would turn it into a gem and make everyones lives a little easier if they need this functionality.
<Axsuul>
adeponte: nice! you got a star from me
mmitchel_ has quit [Remote host closed the connection]
_keith has quit [Quit: _keith]
<adeponte>
Axsuul: :-) , he uses the same technique that I eventually arrived upon which is eval() the code inside of the module.
<adeponte>
Axsuul: couldn't find any other gems that do this so if you every discover any let me know
artOfWar has joined #ruby
artOfWar has quit [Changing host]
pwf has joined #ruby
<pwf>
has anyone seen this on mountain lion trying to 'gem install' something: xcrun: Error: failed to exec real xcrun
<Axsuul>
adeponte: will do
<pwf>
i have a fresh install, with command line tools installed and 'xcode-select --switch /usr/bin' has been run
<adeponte>
Axsuul: thx
zigidias has quit [Changing host]
zigidias has joined #ruby
coyo has quit [Changing host]
coyo has joined #ruby
krz has quit [Changing host]
krz has joined #ruby
Foxandxss has joined #ruby
Foxandxss has quit [Changing host]
t59678 has joined #ruby
beneggett has joined #ruby
Axsuul has quit [Remote host closed the connection]
TheFuzzball has joined #ruby
Axsuul has joined #ruby
tiripamwe has quit [Ping timeout: 240 seconds]
rippa has quit [Ping timeout: 276 seconds]
Asher1 has joined #ruby
xclite has quit [Remote host closed the connection]
GoGoGarr_ has quit [Remote host closed the connection]
<shevy>
rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
binaryplease has joined #ruby
lurch_ has joined #ruby
williamcotton has quit [Quit: williamcotton]
williamcotton has joined #ruby
mmitchell has joined #ruby
dpk has joined #ruby
<Mon_Ouie>
I still have some scripts that can't be ported to String#encode without writing all the transliteration table myself as opposed to using the one buit in iconv
andrewhl has joined #ruby
nohonor has joined #ruby
<Hanmac>
lectrick: what extensions gem?
brisbin has left #ruby [#ruby]
t59678 has quit [Remote host closed the connection]
<nohonor>
a wtf in "Programming Ruby 2nd Ed": 'a hash
<nohonor>
does not support multiple keys with the same value'
<nohonor>
what exactly is that supposed to mean
ibash has quit [Quit: ibash]
<Synthead>
rcassidy: did you take a look at the pastie?
krusty_ar has left #ruby ["I'm not here. This isn't happening"]
<rcassidy>
i did, Synth - is that a sql query in single quotes?
<rcassidy>
that gets run when someone puts in the --yer-mom flag
<Synthead>
rcassidy: yeah. I'm looking to have OptionParser return that if the user uses -y
<Synthead>
rcassidy: don't worry that it's sql for now :)
<rcassidy>
...return it?
<rcassidy>
like, immediately?
<Synthead>
rcassidy: yeah. like the effect of def this; 'this'; end
emmanuelux has quit [Ping timeout: 265 seconds]
i0n has quit [Changing host]
i0n has joined #ruby
<rcassidy>
Synthead: I just tried an explicit return and it didn't like that
Araxia has quit [Quit: Araxia]
<rcassidy>
maybe just set it as a variable somewhere and spit it out immediately after parsing if that flag is set?
Araxia has joined #ruby
<rcassidy>
what are you trying to do?
Markvilla has quit [Quit: Computer has gone to sleep.]
xbayrockx has joined #ruby
petrjanda has joined #ruby
<Synthead>
rcassidy: make my code efficient :)
hukl has joined #ruby
nicoulaj has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<Synthead>
rcassidy: could just use an instance variable though
recycle has quit [Remote host closed the connection]
insecurlex has joined #ruby
parus has joined #ruby
chare has joined #ruby
opus has quit [Ping timeout: 245 seconds]
<rcassidy>
i guess i don't understand the use case
sailias has quit [Quit: Leaving.]
<rcassidy>
is this user running the script from the command line? where is what you want to return *going*?
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
<rcassidy>
i mean it would be trivial to spit out the sql string to the command line upon finding the flag
xbayrockx1 has quit [Ping timeout: 244 seconds]
Xeago has quit [Remote host closed the connection]
opus has joined #ruby
hukl_ has quit [Ping timeout: 252 seconds]
<rcassidy>
like... option parser doesn't return anywhere useful so
<Synthead>
rcassidy: yeah, from the command line. it'd be nice to do puts options.parse(ARGV) and have the string returned instead of stating @query = "" a number of times, running options.parse(ARGV), then puts @query
kvirani has quit [Remote host closed the connection]
Guest92060 is now known as ged
Spooner has joined #ruby
<rcassidy>
well, i guess the only thing i could suggest to shorten your code would be
hukl_ has quit [Ping timeout: 248 seconds]
t67068 has quit [Remote host closed the connection]
<rcassidy>
you can change the 'end' of your optparse block to be 'end.parse!'
t73559 has joined #ruby
axl_ has joined #ruby
<workmad3>
rcassidy: ewww
<rcassidy>
lol
<Synthead>
haha
axl_ has quit [Read error: Connection reset by peer]
<rcassidy>
well, he's concerned about brevity
<Synthead>
how would that work?
hukl has joined #ruby
<workmad3>
rcassidy: I can sometimes, just about, accept a method call on a block using {}, but never on a do...end :P
zach_ has joined #ruby
<rcassidy>
workmad3: fair
zach_ is now known as Guest96098
<workmad3>
where's the code, anyway?
* workmad3
wants to poke
_keith has joined #ruby
<rcassidy>
the code's not much workmad - it's basically 'what's the best way to immediately return a value if a particular command line flag is specified'
<rcassidy>
'
<rcassidy>
also be succinct'
hukl- has quit [Ping timeout: 240 seconds]
axl_ has joined #ruby
apeiros_ has quit [Remote host closed the connection]
axl_ has quit [Read error: Connection reset by peer]
<rcassidy>
Synth you also don't really have to bother with setting the string to be an empty string - you can just set the variable and do something with it if it is defined
<al2o3cr>
-e:1:in `eval': No such file or directory - node -v (Errno::ENOENT), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
axl_ has joined #ruby
<workmad3>
:(
brasten has quit [Quit: brasten]
<rcassidy>
>> a=File.open("bot.err", "r"); a.gets
<al2o3cr>
(String) "[2012/08/21 13:23:34.716] !! [on handler] Registering handler with pattern `#<Cinch::Pattern:0x00000000c4d128 @prefix=nil, @pattern=/^>>(.+)/, @suffix=nil>`, reacting on `message`\n"
<workmad3>
>> `/usr/bin/node -v`
<al2o3cr>
-e:1:in `eval': Permission denied - /usr/bin/node -v (Errno::EACCES), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
drupin has joined #ruby
<drupin>
rake aborted!
<rcassidy>
workmad, most stuff is very well sandboxed.
<drupin>
fe_sendauth: no password supplied
<rcassidy>
we spent many an afternoon breaking it.
_keith has joined #ruby
<drupin>
what this means which password this needs
<krz>
which is a better convention: foobar(foo.id, foo.name, bar.id) or foobar(foo, bar) ?
brett has left #ruby [#ruby]
<workmad3>
rcassidy: yeah, I know... I was helping :)
<workmad3>
rcassidy: I know he's altered his sandboxing approach a lot now though
<rcassidy>
it's cool that i can read files though, shame i can't write
havenn has joined #ruby
<rcassidy>
oh wow it's nearly 6
<rcassidy>
peace all!
<workmad3>
bah
<workmad3>
it's 11pm :P
thatRD has quit [Ping timeout: 245 seconds]
<krz>
thoughts?
Seich has quit [Ping timeout: 265 seconds]
ph^_ has quit [Remote host closed the connection]
havenn_ has joined #ruby
<workmad3>
krz: chocolate is nice
<workmad3>
krz: coffee is also nice
brasten has joined #ruby
<Synthead>
krz: I like turtles
uris has quit [Quit: leaving]
<workmad3>
Synthead: it's turtles all the way down :)
recycle has joined #ruby
reactormonk has quit [Ping timeout: 276 seconds]
ibash has joined #ruby
ringotwo has quit [Read error: Connection reset by peer]
ringotwo has joined #ruby
thunderstrike has quit [Read error: Connection reset by peer]
DrShoggoth has quit [Quit: Leaving]
thunderstrike has joined #ruby
chessguy has joined #ruby
yoklov has quit [Quit: bye!]
yoklov has joined #ruby
uris has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
alanp has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
randomau_ has joined #ruby
mmitchell has quit [Remote host closed the connection]
randoma__ has joined #ruby
joshman_ has quit [Quit: Computer has gone to sleep.]
<lectrick>
The docs for binding say "Returns the binding associated with prc. Note that Kernel#eval accepts either a Proc or a Binding object as its second parameter.". But I tried eval 'whatever', b where b was a Proc and I got an error "wrong argument type Proc (expected Binding) (TypeError)"
itnomad has quit [Remote host closed the connection]
randomautomator has quit [Ping timeout: 248 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
<shevy>
I hope ruby 2.0 clears up stuff like iconv
randomau_ has quit [Ping timeout: 256 seconds]
havenn_ has quit [Remote host closed the connection]
banisterfiend has joined #ruby
recycle has quit [Remote host closed the connection]
reactormonk has joined #ruby
jorge has quit [Remote host closed the connection]
internet_user has quit [Remote host closed the connection]
MasterIdler__ has joined #ruby
MasterIdler__ has quit [Client Quit]
<elico>
but I have no clue on how to store the domains in a key pair DB such as BDB
<shevy>
I dont use databases much myself at all
<foolove>
with ruby mechanize how do i set content of mechanize get request
<elico>
data structure in file?
<shevy>
elico I use yaml usually when I need to store data in a file
workmad3 has quit [Ping timeout: 265 seconds]
<elico>
well it's 17mb of strings each line a string
<foolove>
i need to print the content of a page i get with mechanize
<shevy>
ok and the problem is specifically what with ruby
<shevy>
so far I only see database-related problems :P
theRoUS has quit [Ping timeout: 260 seconds]
seich- has joined #ruby
seich- is now known as seich
MasterIdler_ has quit [Ping timeout: 240 seconds]
nilg` has quit [Read error: Connection reset by peer]
<elico>
well you are right but BDB is in oracle hands.. and since a key pair is a common way to store data I assumed there is a nice men\women out there that can maybe give me a bit help to think on how to implement it..
pskosinski has joined #ruby
jamiltron has quit [Ping timeout: 276 seconds]
_keith has quit [Quit: _keith]
<elico>
shevy: are you still alive?
<shevy>
elico yeah but I use yaml whenever I can
drupin has left #ruby ["Leaving"]
<elico>
shevy: leave the yaml\other DB in side.. and more in the ruby world..
<shevy>
but where is the ruby question
<shevy>
you always mention the database :D
<elico>
Do you know a thing about trees?
<shevy>
they like water
<elico>
LoL
<shevy>
and the tallest reach around 120 m
banghouseFOOD is now known as banghouse
_keith has joined #ruby
<elico>
I want to store the domains in a sorted tree..
sazboom has joined #ruby
mrdodo has quit [Remote host closed the connection]
<shevy>
hmm I was wrong... " It has been named Hyperion and is 115.66 metres (379.5 ft) tall" only 115 metres
<shevy>
this all seems not very ruby-ish
<shevy>
in ruby you have Hashes and Arrays
<shevy>
so you have to fit whatever you have (your domains) into a hash or array perhaps
<elico>
i do know that..
<shevy>
you could make a specialized object perhaps and define <=> to sort in ways how you wish to see it sorted
<elico>
the problem is that i need a persistent storage for them..
<shevy>
well then make a class that loads and saves (restores) this dataset
<elico>
anoldhacker: the line you quoted ""dom.start_with?(domacl.chop) && dom.start_with?(domacl)""
bbttxu has quit [Quit: bbttxu]
xyxxy has joined #ruby
<elico>
is important and i will explain to you why..
matty5000 has joined #ruby
<xyxxy>
What does the following do? session[:user]
ilyam has quit [Ping timeout: 246 seconds]
adamkittelson has quit [Read error: Connection reset by peer]
<anoldhacker>
xyxxy: Pulls the user attribute from the session data. It yields nothing unless it had been previously set.
johnlcox has quit [Ping timeout: 252 seconds]
adamkittelson has joined #ruby
<anoldhacker>
Of course, that is assuming that you are using a certain gem that must not be named.
<elico>
the domain blacklist hold a dmoain name ".domain.com"
<elico>
for the "." to match be a joker for the whole subdomains.
<elico>
so a domain will never match the acl...
Ethan has quit [Quit: *poof*]
<elico>
but it must meet the acl..
jorge has joined #ruby
jeff_sebring has joined #ruby
<anoldhacker>
domacl.chop deletes the last charachter from a string, and returns that character. You are requiring that the last character of the domacl also be the first, or this will never work.
mmitchell has quit [Ping timeout: 276 seconds]
<elico>
there are two possibilities..
orf_ has joined #ruby
<elico>
for an acl.. a full match or a joker. full match checked first and then a match for a joker case
t-mart has joined #ruby
<orf_>
when can an assignment return false?
<orf_>
i.e under what conditions will this return: return unless a = b
<elico>
orf_: is it to me?
<workmad3>
orf_: when b contains either nil or false (or b is a method that returns nil or false)
andrewhl has quit [Remote host closed the connection]
<anoldhacker>
orf_: whenever b evaluates false in a boolean context. Usually either nil for false.
<anoldhacker>
eclio: That phrase does not accomplish this.
<xyxxy>
ty
lkba has joined #ruby
mikepack has quit [Remote host closed the connection]
<elico>
a sec anoldhacker i will look again in my code to think it over. when i wrote it i have some bug..
Guest79461 has quit [Ping timeout: 252 seconds]
jorge has quit [Ping timeout: 276 seconds]
mikepack has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
t20303 has quit [Remote host closed the connection]
jjang has joined #ruby
t87022 has joined #ruby
dhruvasagar has joined #ruby
mikepack has quit [Remote host closed the connection]
hadees has joined #ruby
nari has joined #ruby
SeanLazer has joined #ruby
thunderstrike has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
<elico>
anoldhacker: i must say i had something there that i dont remember caused this thing...
<elico>
but the more i think of it it makes me wonder why i ever added this..
jrajav has joined #ruby
RubyPanther has quit [Quit: self.exit(:stage=>:left)]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
SeanLazer has quit [Client Quit]
<anoldhacker>
I REALLY think like this is a case where denomalization is going to help a lot. If dom is mydom.com, then you store sub1.sub2.mydom.com, mydom.com. Or, you store .mydom.com, mydom.com. Either way, you match mydom.com.
<anoldhacker>
Well, I've got to go.
anoldhacker has left #ruby ["No matter how dark the night, somehow the Sun rises once again"]
SeanLazer has joined #ruby
opus has quit [Quit:]
brianpWins has quit [Quit: brianpWins]
<elico>
thanks
seanstickle has joined #ruby
binaryplease has quit [Ping timeout: 272 seconds]
uris has quit [Quit: leaving]
Guest9125 has quit [Ping timeout: 240 seconds]
binaryplease has joined #ruby
insecurlex has joined #ruby
Coolhand has quit [Remote host closed the connection]
cantonic has joined #ruby
Criztian has quit [Remote host closed the connection]
Criztian has joined #ruby
machty has quit [Quit: machty]
bbttxu has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
mxbtty has joined #ruby
axl_ has joined #ruby
xbayrockx has quit []
workmad3 has quit [Ping timeout: 246 seconds]
machty has joined #ruby
opus has joined #ruby
fantazo has joined #ruby
machty has quit [Client Quit]
Guest46682 has quit [Read error: Connection reset by peer]
Criztian_ has joined #ruby
jorge has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
niklasb has quit [Ping timeout: 265 seconds]
ttilley has quit [Quit: ttilley]
banisterfiend has quit [Read error: Connection reset by peer]
ckrailo has quit [Quit: Computer has gone to sleep.]
lurch_ has quit [Ping timeout: 245 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
tomsthumb_ has joined #ruby
nirix has joined #ruby
<axl_>
in ruby, how do i not print a new line character in a string ?
<elico>
"\n"
machty has joined #ruby
machty has quit [Client Quit]
LouisGB has quit [Ping timeout: 246 seconds]
<axl_>
elico: thanks. but i want to not have the \n
<axl_>
i was doing a puts and what i need is a print