riotjones has quit [Read error: Connection reset by peer]
riotjone_ has joined #ruby
riotjone_ has quit [Read error: Connection reset by peer]
riotjones has joined #ruby
Levandia has joined #ruby
zzxc_ has quit [Ping timeout: 265 seconds]
riotjones has quit [Read error: Connection reset by peer]
riotjones has joined #ruby
icebourg has quit []
<Levandia>
So I'm reading the set.rb file and I came across this, @hash ||= Hash.new which is the first line under the constructor of the class Set.
<Levandia>
What's the point of doing @hash ||= Hash.new
riotjones has quit [Read error: Connection reset by peer]
<Levandia>
It's the first line already.
<Levandia>
Where else should it exist?
riotjones has joined #ruby
arescorpio has quit [Excess Flood]
SubjectiveBias has joined #ruby
thumpba has joined #ruby
shuber_ has joined #ruby
towski_ has joined #ruby
cgrieger^away has quit [Ping timeout: 265 seconds]
thumpba_ has quit [Ping timeout: 264 seconds]
riotjones has quit [Ping timeout: 265 seconds]
thatslif_ has left #ruby [#ruby]
cgrieger^away has joined #ruby
Papipo has joined #ruby
SubjectiveBias has quit [Ping timeout: 256 seconds]
shuber_ has quit [Ping timeout: 244 seconds]
tagrudev has joined #ruby
krz has joined #ruby
Papipo has quit [Ping timeout: 256 seconds]
iamninja_ has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
iamninja_ has joined #ruby
byprdct has joined #ruby
tubuliferous has joined #ruby
jtdowney has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
bmurt has quit []
danman has quit [Quit: danman]
tubuliferous_ has joined #ruby
havenwood has joined #ruby
tubuliferous_ has quit [Ping timeout: 240 seconds]
shakes has quit [Quit: Leaving]
lidenskap has joined #ruby
Robert__ has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
oo_ has quit [Ping timeout: 255 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lidenskap has quit [Ping timeout: 250 seconds]
lavros has quit [Ping timeout: 258 seconds]
oo_ has joined #ruby
kenndel_ has quit [Ping timeout: 258 seconds]
krz has quit [Read error: Connection reset by peer]
lavros has joined #ruby
krz has joined #ruby
shock_one has joined #ruby
shock_on_ has joined #ruby
shock_one has quit [Read error: Connection reset by peer]
GaryOak_ has joined #ruby
<weaksauce>
Levandia that was in initialize?
<weaksauce>
no real point then.
<Levandia>
weaksauce, Yea, first line.
<weaksauce>
and hash.new is not as readable as {} to me
failshell has joined #ruby
GaryOak_ has quit [Ping timeout: 246 seconds]
swgillespie has joined #ruby
Sawbones has quit [Remote host closed the connection]
polymute has joined #ruby
<Levandia>
weaksauce, Are you sure? I'm talking about set.rb
<Levandia>
Check it out.
Sawbones has joined #ruby
<weaksauce>
link?
<weaksauce>
Levandia^
failshell has quit [Ping timeout: 265 seconds]
chinmay_dd has joined #ruby
redhands has quit [Quit: WeeChat 1.1.1]
thatslif_ has joined #ruby
nomadic has quit [Changing host]
nomadic has joined #ruby
Channel6 has quit [Quit: Leaving]
hewenhong has joined #ruby
wlanboy_ has quit [Changing host]
wlanboy_ has joined #ruby
oo_ has quit [Quit: Leaving...]
<Levandia>
weaksauce, Your Ruby lib folder..
<Levandia>
:P
tyfighter has quit [Quit: tyfighter]
<weaksauce>
ha. well I didn't want to search for it if you had a web link
<weaksauce>
I can't think of a time where that wouldn't be nil at the start of an initialize method unless it's called later on when copying something?
chinmay_dd has quit [Remote host closed the connection]
<weaksauce>
I don't know the esoteric ruby things though Levandia
thatslifeson has joined #ruby
thatslif_ has quit [Ping timeout: 250 seconds]
BlackGear has joined #ruby
BlackGear has quit [Max SendQ exceeded]
tyfighter has joined #ruby
shuber_ has joined #ruby
arup_r has joined #ruby
krz has quit [Ping timeout: 265 seconds]
tubuliferous has quit [Ping timeout: 265 seconds]
krz has joined #ruby
<Levandia>
weaksauce, Hmm?
shuber_ has quit [Ping timeout: 272 seconds]
<Levandia>
jhass, Here?
lidenskap has joined #ruby
Sawbones has quit []
_blizzy_ has joined #ruby
lidenskap has quit [Remote host closed the connection]
sevenseacat has quit [Quit: Me dun like you no more.]
io_syl_ has quit []
bayed has quit [Quit: Connection closed for inactivity]
chinmay_dd has joined #ruby
SubjectiveBias has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
jayeshsolanki has joined #ruby
jgt has joined #ruby
<havenwood>
Levandia: The answer lies in SortedSet.
chinmay_dd has quit [Remote host closed the connection]
casadei has joined #ruby
jeromelanteri_ has joined #ruby
jeromelanteri_ has quit [Client Quit]
jeromelanteri_ has joined #ruby
nfk has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
GriffinHeart has joined #ruby
charliesome has joined #ruby
RegulationD has joined #ruby
charliesome has quit [Client Quit]
exile-bot-2 has joined #ruby
gizless has joined #ruby
exile-bot-2 has quit [Remote host closed the connection]
iasoon has joined #ruby
casadei has quit [Ping timeout: 244 seconds]
exile-bot-2 has joined #ruby
charliesome has joined #ruby
charliesome has quit [Client Quit]
exile-bot-2 has quit [Remote host closed the connection]
gizmore has quit [Ping timeout: 255 seconds]
exile-bot-2 has joined #ruby
exile-bot-2 has quit [Remote host closed the connection]
exile-bot-2 has joined #ruby
vickleton has joined #ruby
tubuliferous has joined #ruby
chinmay_dd has joined #ruby
riotjones has joined #ruby
riotjones has quit [Read error: Connection reset by peer]
neworder has joined #ruby
<shevy>
shell scripts are so weird
riotjones has joined #ruby
<shevy>
yesterday I discovered that /usr/bin/startx is a shell script; it was failing for me because it relied on mcookie.
<neworder>
Inisde a class initialize method, is doing self.name= "John' and @name = 'John' the same?
<shevy>
mcookie, there was one line here: mcookie=`/usr/bin/` which obviously won't work
<shevy>
neworder it depends on what the method called .name= is doing
<shevy>
but for default ruby, yeah. @name = 'foo' is faster though
<shevy>
whereas if you use the method, you can add additional checks in the method for instance. the self.name= part is necessary because ruby would not otherwise know that you are invoking a method in the first case; you could assign a local variable called name ... name='John'
<neworder>
I see, didn't understand this part "depends on what the method called .name= is doing'
Papipo has quit [Remote host closed the connection]
<shevy>
well, it is a method yes?
<shevy>
in the simplest case it looks like this:
<neworder>
yup
<shevy>
def name=(i)
<shevy>
@name = i
<shevy>
end
Papipo has joined #ruby
<shevy>
this is what you get via attr_writer :name
chinmay_dd has quit [Remote host closed the connection]
<shevy>
but it's a method. you can do more things than that, like call other methods, sanitize the input before accepting it etc...
<shevy>
for such a simple case, attr_writer :name should be the easiest way
tubuliferous has quit [Ping timeout: 276 seconds]
riotjones has quit [Ping timeout: 246 seconds]
<neworder>
ok thanks
lkba has joined #ruby
lidenskap has quit [Remote host closed the connection]
<neworder>
@name = 'foo'
Stalkr_ has quit [Quit: Leaving...]
<neworder>
This isn't invoking any method right?
<neworder>
as opposed to self.name='foo'
<neworder>
which is invoking the name= method
<neworder>
Just to confirm that I understood correctly :P
slawrence00 has joined #ruby
<apeiros>
neworder: correct
<neworder>
=)
<apeiros>
and the name= method may do anything. it might even do something else than @name = value
jenrzzz has joined #ruby
el3k0n has joined #ruby
<neworder>
apeiros I see. @name = value This is what attr_writer :name does right?
<neworder>
So does that mean I can overwrite it
<apeiros>
neworder: correct. and attr_accessor.
<apeiros>
yes. or define it yourself.
<neworder>
ok thanks
axsuul has quit [Ping timeout: 264 seconds]
jayeshsolanki has quit [Ping timeout: 244 seconds]
thatslifeson has joined #ruby
GaryOak_ has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
2) use do / end for side effects and { / } for when you care about the return value
<shevy>
'Hello world!'
<shevy>
end
<shevy>
you could not do this:
<shevy>
get '/' {
<shevy>
'Hello world!'
<shevy>
}
failshell has quit [Ping timeout: 265 seconds]
<jhass>
Levandia: that means @authors is never initialized
lkba_ has joined #ruby
shuber_ has quit [Ping timeout: 240 seconds]
<Levandia>
jhass, Should I do something like, @authors ||= '' above the join line?
<jhass>
depends on your usecase
parduse has quit []
<Levandia>
My use case is the code I sent..
<neworder>
ok thanks
turtil has joined #ruby
<jhass>
you might want to keep @authors as an array and only join it for presentation
<jhass>
in any case, you most likely want to initialize it in your initialize method
lkba has quit [Ping timeout: 256 seconds]
<Levandia>
With what value?
KayJ has joined #ruby
<jhass>
you don't show how you use that, so I can't give a clear recommendation whether you should stay with your stringing together or switch to maintaining it as an array
KayJ has quit [Client Quit]
<jhass>
so the answer is whatever allows you to concatenate more values to it
hewenhong has quit [Remote host closed the connection]
<jhass>
I guess, having it as a string is still smelly to me here though
<jhass>
def authors; @authors.join(' '); end seems more flexible
<jhass>
and then @authors = []; and @authors.concat names
<Levandia>
It's from Eloquent Ruby book.
<jhass>
literally? that's sad
<Levandia>
Sad?
<jhass>
yeah
<Levandia>
I don't think so.
<Levandia>
It also states that many people don't use Ruby as it should be used.
claptor has quit [Quit: this channel is bakas]
<SpicyMagpie>
what are you trying to do?
<jhass>
+= over << for an internal string, "#{}" around something that returns a string, no initialization of a variable
affenhoden has joined #ruby
<jhass>
quite sad example to come literally from a book
<Levandia>
jhass, Read the comment, # Most of the class omitted...
<jhass>
that, if at all, only invalidates my last point
el3k0n has quit [Ping timeout: 264 seconds]
roshanavand has quit [Quit: Konversation terminated!]
<SpicyMagpie>
that example doesn't make sense to me, what book are you using?
<jhass>
and maintaining a list of thing as string internally is not a good example either
parduse has quit []
<jhass>
*of things
<Levandia>
jhass, "Once it has the array of author’s names, add_authors uses the array method join to combine the elements into a single space-delimited string, which it then appends onto @author."
<jhass>
I know what it does
<Levandia>
spicymagpie, The greatest book.
chinmay_dd has joined #ruby
<SpicyMagpie>
which one?
<Levandia>
jhass, Yes just saying that he states that, so it might just be an example.
<Levandia>
spicymagpie, Eloquent Rubyl
<Levandia>
Ruby*
noonius has joined #ruby
<jhass>
it's in a book, of course it's an example
<jhass>
I'm saying it's probably not a good one
<SpicyMagpie>
indeed it's not a good one.
<Levandia>
spicymagpie, Eloquent Ruby is not a good one? You are funny.
<Levandia>
jhass, Probably.
<jhass>
I never read it, but if all examples are like that...
<SpicyMagpie>
Levandia: the example isn't.
<SpicyMagpie>
lists of things are either arrays or hashes; if you have a list of names, it's an array.
<jhass>
eh, maybe not call a map a list ;)
<jhass>
even though hash is ordered in ruby
<Levandia>
A map is a linked list
<jhass>
no
<Levandia>
Yes.
<Levandia>
And don't argue that because that's what I study :)
<jhass>
a map is often implemented as a an array of linked lists
mandarinkin has joined #ruby
<Levandia>
Array? No, you are wrong here.
<SpicyMagpie>
a map is an array of linked lists
<jhass>
*often implemented as!
<jhass>
that's a detail, not relevant when looking at the abstract datatype
<SpicyMagpie>
well, are strings enumerable?
spider-mario has quit [Ping timeout: 264 seconds]
<jhass>
one could say strings are a list of codepoints
<neworder>
I saw this frequently
<neworder>
%w(a b c)
<shevy>
simpler way to create array
<neworder>
What's the %w
<shevy>
['a','b','c']
<shevy>
which one do you prefer
<jhass>
neworder: a percent literal
<shevy>
I think the w is from perl qw "quoted words"
<shevy>
I can't get the ' ' to work... do I misremember that? space could not be used as delimiter?
<shevy>
neworder please never use ~
Levandia has joined #ruby
dorei has joined #ruby
roshanavand has joined #ruby
affenhoden has quit [Quit: leaving]
oo_ has quit [Remote host closed the connection]
redlegion has quit [Ping timeout: 256 seconds]
banister has joined #ruby
davedev24_ has joined #ruby
c_nick1 has left #ruby [#ruby]
c_nick has joined #ruby
<c_nick>
How to go Polymorphism in ruby.. i am defining two function def loadLibrary and def loadLibrary(param) but it keeps telling me expecting 1 out of 0 args
<apeiros>
c_nick: you can't.
<apeiros>
you have to do the logic in a single load_library method
<apeiros>
e.g. by using default values, or *vararg
<apeiros>
or by defining differently named methods, of course.
hololeap has quit [Ping timeout: 256 seconds]
<apeiros>
c_nick: also note that loadLibrary is against ruby conventions. we use snake_case for method names.
roshanavand has quit [Quit: Konversation terminated!]
<apeiros>
Levandia: you'll stumble over that pattern in many other places too. where presentation is the last step and should remain separate. or otherwise stuff becomes really complex.
noonius has joined #ruby
<jhass>
Levandia: -> = "better written as"
<apeiros>
re `"#{expr}" -> expr.to_s`. assume expr := `:foo`. then instead of "#{:foo}", you'd better write :foo.to_s
xxneolithicxx has quit [Ping timeout: 255 seconds]
shock_one has quit [Ping timeout: 255 seconds]
<apeiros>
(well, :foo.to_s would of course best be written as "foo")
<adaedra>
how much time before people print with system("echo #{string}")
<shevy>
I use `` !
<apeiros>
adaedra: why'd you use that over a syscall?!?
<Levandia>
apeiros, And it's true that to_s calls the initializer from String, ye?
<Levandia>
In other words, creating a new object.
noonius has quit [Client Quit]
<apeiros>
depends on the to_s in question
<apeiros>
but usually it'll return a new string, yes
<Levandia>
What does it depend on?
<apeiros>
on the implementation of the to_s, of course
<apeiros>
class Foo; def initialize; @str = "foo"; end; def to_s; @str; end; end
noonius has joined #ruby
<apeiros>
this to_s does not create a new string. it returns an existing string.
<apeiros>
IMO a bad idea. but it's possible.
<shevy>
adaedra lol that pic
<shevy>
you can't use such a mascot though
<shevy>
people don't believe it to be the ultimate evil
<shevy>
it's not scary at all
turtil has quit [Ping timeout: 256 seconds]
Notte has quit [Remote host closed the connection]
jayeshsolanki has quit [Quit: bye!]
bigsky has quit [Ping timeout: 272 seconds]
scottymeuk is now known as Scottymeuk
Scottymeuk is now known as scottymeuk
sevenseacat has joined #ruby
<apeiros>
Levandia: btw., you do realize that in "#{non_string_expr}", the conversion to string in #{} happens through calling to_s on non_string_expr anyway?
<Levandia>
apeiros, Well, how else would the conversion happen?
<toretore>
i thought #{} was a bit more involved than that?
<apeiros>
toretore: nope
<apeiros>
#{foo} basically is foo.instance_of?(String) ? foo : foo.to_s
<toretore>
what if to_s doesn't return a string?
<apeiros>
actually not sure about that instance_of?. might be kind_of?.
<apeiros>
try it? :)
<toretore>
class Foo; def to_s; 5; end; end; "#{Foo.new}"
<toretore>
>> class Foo; def to_s; 5; end; end; "#{Foo.new}"
<Levandia>
apeiros, It's the other way around I guess?
<Levandia>
try_convert calls to_s
<apeiros>
anything specific in the ~120 methods in that documentation?
<apeiros>
Levandia: no
konsolebox has joined #ruby
<apeiros>
try_convert calls to_str
<apeiros>
and try_convert is unrelated to #{}
<Levandia>
Huh? Read what I said.
<apeiros>
14:39 Levandia: try_convert calls to_s
<apeiros>
I did. and that's wrong.
tubuliferous has quit [Ping timeout: 265 seconds]
<apeiros>
so what else should I read what you said?
<apeiros>
to_s != to_str. just in case.
<Levandia>
to_str, "Returns the receiver."
<Levandia>
What does that even mean?
<apeiros>
it returns self
claw has quit [Ping timeout: 255 seconds]
<Levandia>
I see.
<apeiros>
receiver.method(argument) { …block… }
<apeiros>
that's the naming of things
<apeiros>
the receiver is what you call the method on.
roshanavand has quit [Quit: Konversation terminated!]
<apeiros>
note: String#to_str saying "returns the receiver" does not imply that other classes' to_str return the receiver.
el3k0n has quit [Quit: Sto andando via]
roshanavand has joined #ruby
<toretore>
that'd be quite useless
<apeiros>
sure. but I've seen confusion wrt that before. "why does a.foo not do the same as b.foo? it's the same method!" (well, no, it's only the same method name)
AlphaAtom has joined #ruby
doodlehaus has joined #ruby
<adaedra>
OOP is hard
[k- has joined #ruby
iamninja_ has quit [Read error: Connection reset by peer]
iamninja_ has joined #ruby
AlphaAtom has quit [Client Quit]
<c_nick>
Levandia: I need to load a Dll at the start how will i know its been loaded properly or not ?
AlphaAtom has joined #ruby
<Levandia>
c_nick, If you do it in C, I can help you. I don't know much how you do it in Ruby.
wjlroe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lidenskap has joined #ruby
reset has joined #ruby
simpyll has joined #ruby
oo_ has joined #ruby
doodlehaus has quit [Remote host closed the connection]
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DynamicMetaFlow has joined #ruby
<Levandia>
Is there any sort of standard or manual for Ruby as there is for C? Where you can look up such stuff more in-depth?
<apeiros>
there's a manual for C?
<apeiros>
there's an ISO standard for ruby. but I think that covers ruby 1.8
<shevy>
awww
<shevy>
we are so quickly getting outdated
shock_one has joined #ruby
<Levandia>
apeiros, Standard.
lidenskap has quit [Ping timeout: 244 seconds]
<Levandia>
So there isn't something similar for Ruby_
<Levandia>
?
<apeiros>
"there's an iso standard" - "so there is no standard"
<apeiros>
sometimes I'm not sure whether people are capable of reading…
affenhoden has quit [Quit: leaving]
<sevenseacat>
lol
<Levandia>
apeiros, You asked if there was a manual for C, I said standard.
<apeiros>
aha
<apeiros>
is that the one which has all those "undefined behavior" in it? :)
<Levandia>
It's the law book of the language, so of course.
<Levandia>
And UB is good :)
<apeiros>
I have a different opinion. but I guess it's both the wrong place and pointless to argue about that ;-)
<Levandia>
If you are an experienced C developer, you like UB so yea :)
<apeiros>
you know about stockholm syndrome, yes?
<apeiros>
I'm an experienced user of C programs, so I don't like UB :-p
<Levandia>
No idea, I'm just doing my PhD in Sthml, Sweden.
<Levandia>
You don't understand UB :)
yaw has joined #ruby
yaw has left #ruby [#ruby]
<sevenseacat>
o.O
<apeiros>
you don't know what I understand or don't understand
umgrosscol has joined #ruby
<Levandia>
I pretty much do from what you claim.
<apeiros>
you overestimate your abilities
<apeiros>
also all those ad-hominem is undesired in this channel. so stop it.
<sevenseacat>
please do :)
ndrei has joined #ruby
<Levandia>
apeiros, I know my abilities very well :)
<sevenseacat>
sigh
<sevenseacat>
Levandia: please stop.
<neworder>
I wanna learn some hacking (for fun)
<neworder>
Where to I start
<neworder>
Where do I start*
vdamewood has quit [Quit: Life beckons.]
<neworder>
(using Ruby)
<jhass>
neworder: start by defining hacking. My definition includes most regular (for fun) programming
<neworder>
oh no, not that one
<apeiros>
neworder: I started with something I needed. that worked out well for me.
<jhass>
or using anything in unintended ways actually
<neworder>
Intruding into other machines
<neworder>
government systems
<sevenseacat>
yeah no.
<Levandia>
:p
<neworder>
Not even sure if that's possible
<apeiros>
oh, you mean hacking as in cracking, not as in writing code. I see.
<jhass>
neworder: join #metasploit (it's written in Ruby) and never mention that you did here again
SubjectiveBias has quit [Ping timeout: 258 seconds]
<havenwood>
Answer: Nikkei Linux (http://itpro.nikkeibp.co.jp/linux/): "...my development is paced by magazine articles on Nikkei Linux Magazine (Japanese)." ~Matz
pardusf has quit []
sohrab has quit [Ping timeout: 272 seconds]
ValicekB has quit [Read error: No route to host]
sohrab has joined #ruby
cosmicexplorer has quit [Remote host closed the connection]
HotCoder has quit [Ping timeout: 250 seconds]
cosmicexplorer has joined #ruby
TheNet has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TheNet has joined #ruby
ghr has joined #ruby
CustosLimen has joined #ruby
ghr has quit [Read error: Connection reset by peer]
ValicekB has joined #ruby
Cache_Money has joined #ruby
User458764 has joined #ruby
SouL_|_ has quit [Read error: Connection reset by peer]
_blizzy_ has quit [Ping timeout: 265 seconds]
ChoiKyuSang has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
ChoiKyuSang has joined #ruby
hectortrope has joined #ruby
tubuliferous has joined #ruby
bb010g has joined #ruby
hectortrope has quit [Client Quit]
nullset68 has joined #ruby
sohrab has quit [Ping timeout: 276 seconds]
shuber_ has joined #ruby
hectortrope has joined #ruby
axl_ has joined #ruby
hectortrope has quit [Changing host]
hectortrope has joined #ruby
sohrab has joined #ruby
lkba_ has quit [Read error: Connection reset by peer]
tubuliferous has quit [Ping timeout: 240 seconds]
diegoviola has joined #ruby
tejasmanohar has quit [Quit: WeeChat 1.1.1]
shuber_ has quit [Ping timeout: 240 seconds]
Zimsky_ has quit [Ping timeout: 276 seconds]
Zimsky_ has joined #ruby
SouL_|_ has joined #ruby
unshadow has joined #ruby
idafyaid has joined #ruby
antgel has quit [Ping timeout: 265 seconds]
xxneolithicxx has joined #ruby
thatslifeson has joined #ruby
nullset68 has quit [Quit: WeeChat 0.4.2]
Narzew has joined #ruby
tubuliferous has joined #ruby
amclain has joined #ruby
Igorshp has joined #ruby
<havenwood>
DeBot: !hangman gems
<DeBot>
␣␣␣␣␣␣␣␣␣␣␣␣ [] 0/12
DerisiveLogic has joined #ruby
asmodlol has quit [Ping timeout: 255 seconds]
<havenwood>
Waiting for the gem to be: Rails
Igorshp has quit [Remote host closed the connection]
<havenwood>
DeBot: rails
<DeBot>
li␣␣␣␣s␣␣␣␣␣ [ra] 2/12
<havenwood>
DeBot: gh
<DeBot>
li␣␣␣␣s␣␣␣␣␣ [ragh] 4/12
DerisiveLogic has quit [Remote host closed the connection]
<havenwood>
DeBot: e
<DeBot>
li␣␣e␣s␣␣␣e␣ [ragh] 4/12
DerisiveLogic has joined #ruby
<havenwood>
DeBot: _-
<DeBot>
li␣␣e␣s␣␣␣e␣ [ragh_-] 6/12
<havenwood>
DeBot: r
<DeBot>
li␣␣e␣s␣␣␣e␣ [ragh_-] 6/12
<havenwood>
DeBot: l
<DeBot>
li␣␣e␣s␣␣␣e␣ [ragh_-] 6/12
<havenwood>
Guessing the same letters multiple times strategy isn't working...
asmodlol has joined #ruby
GaryOak_ has joined #ruby
duggiefresh has quit [Remote host closed the connection]
unshadow has quit [Ping timeout: 264 seconds]
<havenwood>
Definitely ruled out Rails.
BlackGear has quit [Quit: ZZZzzz…]
unshadow has joined #ruby
<havenwood>
DeBot: o
<DeBot>
li␣␣e␣so␣␣e␣ [ragh_-] 6/12
<havenwood>
DeBot: u
<DeBot>
li␣␣e␣so␣␣e␣ [ragh_-u] 7/12
<havenwood>
DeBot: t
<DeBot>
li␣␣e␣so␣␣et [ragh_-u] 7/12
<havenwood>
sonnet?
<havenwood>
DeBot: n
<DeBot>
li␣␣e␣so␣␣et [ragh_-un] 8/12
scripore has quit [Quit: This computer has gone to sleep]
zzxc_ has joined #ruby
parduse has joined #ruby
xxneolithicxx has quit [Ping timeout: 255 seconds]
<havenwood>
^ It downloads the pkgsrc archive, checks shasum and gpg sig, sets up PATH and installs manpages automatically. It should *just work* except for balking at you not having gpg installed but you can skip that step.
SegFaultAX has joined #ruby
<havenwood>
Then you have a nice Ruby 2.2 package available, as well as some eleven thousand other packages.
noonius has joined #ruby
<xxneolithicxx>
shevy: to be fair, hes making an apples to oranges comparison
scripore has joined #ruby
codecop has joined #ruby
<xxneolithicxx>
shevy: C++ doesnt have a CPAN/rubygems/pypy repo, otherwise if it did it probably would have a lot of those extras
<xxneolithicxx>
shevy: imagine where python/ruby/perl would be without those repos?
rdark has quit [Quit: leaving]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
subtwo has joined #ruby
<adaedra>
havenwood: why not using homebrew?
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ghr has joined #ruby
blueOxigen has joined #ruby
bluOxigen has quit [Ping timeout: 256 seconds]
AxonetBE has joined #ruby
<AxonetBE>
I use chruby with passenger and when I run /usr/local/bin/passenger-config I got Could not find rake (>= 0.8.1) amongst [bundler-1.9.4 ... ) but when I run gem list rake 10.x is installed
User458764 has joined #ruby
<bronson>
AxonetBE: bundle exec passenger config?
_blizzy_ has joined #ruby
<AxonetBE>
then it works but passenger is not in my gemfile
<AxonetBE>
bronson: but I have strange behaviour where I don't find the error. Sometimes my app is not starting because he is using ruby 1.9... instead of 2.2 but when I run then cap restart app everything works fine...
<shevy>
xxneolithicxx we'd have something like boost in ruby!
shuber_ has quit [Remote host closed the connection]
<xxneolithicxx>
shevy: true but that would only add core functionality at a faster pace and would pale in comparison to what true repos bring
<bronson>
AxonetBE: usually that's because some tool spawned a non-login subshell, so chruby din't get a chance to install its hooks.
<AxonetBE>
bronson: ok and how to find this/fix this?
<bronson>
You could play with: bash -l -c "my-command-to-try"
<bronson>
that forces the command to be run in a login subshell.
<bronson>
if that fixes it, you can decide whether you're done now or whether you need to fix whatever is spawning wrong.
lavros has quit [Quit: leaving]
<AxonetBE>
bronson: ok but how to find which command
<AxonetBE>
because I have the feeling that I got this error randomly
<havenwood>
adaedra: Around 11,000 binaries compared to brew's 3,000 packages (more and more of which are available as binaries, yay!). Also brew's nontraditional install location and inability to support multiple users.
<havenwood>
adaedra: Really just options. And I like taking advantage of OS X's BSD lineage.
fedexo has joined #ruby
<havenwood>
adaedra: I'm a brew user.
dudedudeman has joined #ruby
<jhass>
shevy: the arch wiki is great in general
<bronson>
AxonetBE: I have no idea what your deploy environment looks like.
<bronson>
just gotta poke stuff until you figure it out.
<bronson>
(that said, I switched from passenger to unicorn because I found it way too hard to debug these sorts of things...)
<xxneolithicxx>
oh gosh, i remember using either homebrew or brew once when i used to use my mac, the slowest damn thing in the world to install stuff
ascarter has joined #ruby
<xxneolithicxx>
*i think it was compiling a shit load of stuff though
<AxonetBE>
but what is strange in the error is that he is usign /usr/local/lib/ruby/gems/1.9.1/ and /home/deploy/.gem/ruby/2.2.0/gems/ together
<havenwood>
xxneolithicxx: They've started "pouring bottles" so not everything has to compile now, yeah. :)
<bronson>
xxneolithicxx: I see you haven't used Gentoo. :)
<xxneolithicxx>
bronson: no definitely not lol. i have no intention to either
<xxneolithicxx>
i use ubuntu/rhel mainly
Cache_Money has quit [Quit: Cache_Money]
<havenwood>
No takers for some good times with pkgsrc and OS X this fine Sunday?!
<havenwood>
Works alongside Homebrew.
<xxneolithicxx>
ill take ur hardware, you can keep the OS X :-)
dseitz has joined #ruby
finnnnnnnnnnn has joined #ruby
<havenwood>
BYOH
chinmay_dd has quit []
finnnnnnnnnnn has quit [Client Quit]
<xxneolithicxx>
ok, that definitely doesnt have OS X so i dont think id be much help
<bronson>
havenwood: I don't quite get it... why would I use pkgsrc?
TuxOtaku has quit [Read error: Connection reset by peer]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
TuxOtaku has joined #ruby
shadeslayer has quit [Ping timeout: 272 seconds]
User458764 has joined #ruby
<bronson>
looks pretty useful for the bsds that dont have a lot of software pre-packaged... but I've always been able to find a ppa or homebrew script for the stuff I need.
<havenwood>
bronson: Over 10,000 quality binary packages that have been battle hardened on NetBSD. Or if you wanted to have the same package manager easily used by multiple users.
tubuliferous_ has joined #ruby
dudedudeman has quit [Ping timeout: 272 seconds]
shadeslayer has joined #ruby
<havenwood>
bronson: Why use brew over pkgsrc?
c_nick has left #ruby [#ruby]
<bronson>
because it's pronounceable? :)
<bronson>
Mostly just momentum. A package manager is pretty critical infrastructure. I'd have to see a very compelling reason to switch.
<bronson>
I've never been dissatisfied with the quantity of packages on homebrew. Really, my biggest complaint with it is upgrades.
quimrstorres has joined #ruby
weaksauce has joined #ruby
Rollabunna has quit [Remote host closed the connection]
quimrstorres has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 264 seconds]
<havenwood>
bronson: It's nice having options that harmoniously work beside each other. A good fallback in the very least. :) (If Fink and MacPorts aren't your thing.)
veleno has joined #ruby
quimrstorres has joined #ruby
<bronson>
Hm, joyent? They are very good on promising the world but I haven't been happy when I've relied on their stuff.
<veleno>
hello. i need to measure how long it takes to exeucte a call to ‘sytem(..)’. i’ve tried like this https://gist.github.com/vschiavoni/cf3d4149a2c6ac223fb0 but it seems to somehow be wrong: the ELAPSED line is only printed once I ctrl^c the program
phizzbuzz has quit [Ping timeout: 258 seconds]
dudedudeman has joined #ruby
<havenwood>
bronson: They've been quiet about this it seems. Maybe they don't want to further foster that rep. Dunno.
idafyaid has quit [Read error: Connection reset by peer]
idafyaid has joined #ruby
tuelz has joined #ruby
<waxjar>
havenwood: is pkgsrc as up-to-date as brew?
shuber_ has quit [Ping timeout: 272 seconds]
<tuelz>
I'm working on some old code and there's a method which accepts the param <<-D it looks like the block is just a string which ends with D, what exactly is happening here? Is this just weird syntax for passing a string to a method?
SubjectiveBias has quit [Ping timeout: 245 seconds]
<havenwood>
waxjar: For example brew is on 2.2.2 and pkgsrc is on 2.2.1. I haven't surveyed in general.
<apeiros>
tuelz: that's a here-doc
<apeiros>
it's a string literal
veleno has quit [Read error: Connection reset by peer]
<waxjar>
havenwood: fair enough.
xjstin has joined #ruby
subtwo has quit [Quit: (null)]
<tuelz>
apeiros: thanks
Igorshp has joined #ruby
anaeem1 has quit [Remote host closed the connection]
axl_ has quit [Quit: axl_]
anaeem1_ has joined #ruby
axl_ has joined #ruby
<waxjar>
havenwood: script seems to be missing a " on line 37 :p
jjoohhnn has quit [Quit: Leaving]
<havenwood>
waxjar: oops, thanks!
<havenwood>
waxjar: fixed
Igorshp has quit [Remote host closed the connection]
<apeiros>
and yes, attr_* defines instance methods. so methods defined that way are only available once you used include/extend with the module.
mblewitt has quit [Quit: WeeChat 1.1.1]
rkazak_ has joined #ruby
idafyaid has quit [Remote host closed the connection]
idafyaid has joined #ruby
<apeiros>
having actually read the scrollback now…
<apeiros>
> TheNet: how do I set namespaced variables that aren't constants?
lidenskap has quit [Remote host closed the connection]
robustus has quit [Ping timeout: 255 seconds]
<gert7>
@@class_variables?
<apeiros>
TheNet: you can't. constants are the only *namespaced* variables. however, other variables have scoping rules too. and you can create variables belonging to a namespaced object
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Narzew has joined #ruby
<TheNet>
apeiros yep, learning that now. thanks gert7 and apeiros
<apeiros>
@@cvars are one way. @ivars are IMO better. see the example code above.
psy_ has joined #ruby
<gert7>
if you're gonna access them like Table::TABLE_MAX_SIZE
<gert7>
that's a constant, useful for cheap enums
<apeiros>
that'd be a constant in either a class or module
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
JDiPierro has joined #ruby
SubjectiveBias has joined #ruby
<apeiros>
(and that class or module being assigned to constant itself)
<TheNet>
anyone know if there are any StringIO methods that write to STDOUT other than print, puts, and write?
robustus|Off has joined #ruby
<apeiros>
huh? no StringIO method writes to STDOUT
robustus|Off is now known as robustus
bogdanteleaga has quit [Ping timeout: 246 seconds]
<apeiros>
ok. my mistake - there's one: StringIO#display. but that's the only one. all others write to the StringIO. otherwise, what'd be the point?
<gert7>
stringIO = take a String and pretend it's a file?