nguerin has quit [Remote host closed the connection]
krainboltgreene has joined #ruby-lang
ryanf has quit [Ping timeout: 252 seconds]
esad has quit [Quit: Computer has gone to sleep.]
ryanf has joined #ruby-lang
Dreamer3 has quit [Quit: Computer has gone to sleep.]
queuetue has quit [Read error: Connection reset by peer]
Sambalero has joined #ruby-lang
savage- has quit [Remote host closed the connection]
Sambalero has quit [Remote host closed the connection]
piyush__ has quit [Ping timeout: 272 seconds]
Sambalero has joined #ruby-lang
banisterfiend has joined #ruby-lang
lsegal has joined #ruby-lang
Dreamer3 has joined #ruby-lang
krz has joined #ruby-lang
kvirani has quit [Remote host closed the connection]
neocoin has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
justinmcp has joined #ruby-lang
ryanf has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 264 seconds]
savage- has joined #ruby-lang
Rezwan has quit [Read error: Connection reset by peer]
chimkan has quit [Quit: chimkan]
sailias has joined #ruby-lang
ramonmaruko has quit [Remote host closed the connection]
yorickpeterse has joined #ruby-lang
Dreamer3 has quit [Quit: Leaving...]
ryanf has quit [Ping timeout: 240 seconds]
sailias has quit [Ping timeout: 272 seconds]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
woollyams has joined #ruby-lang
paulp has joined #ruby-lang
headius has joined #ruby-lang
igotnolegs has quit [Quit: Computer has gone to sleep.]
ltd- has quit [Ping timeout: 252 seconds]
ltd- has joined #ruby-lang
Weems has quit [Read error: Connection reset by peer]
piyush__ has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
jxie has joined #ruby-lang
ryanf has joined #ruby-lang
jxie has quit [Ping timeout: 244 seconds]
jxie has joined #ruby-lang
headius has quit [Quit: headius]
piyush__ has quit [Ping timeout: 272 seconds]
rippa has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
towski has joined #ruby-lang
Criztian has joined #ruby-lang
Dreamer3 has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
kristofferrr has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
paulp has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
paulp has joined #ruby-lang
hhatch has joined #ruby-lang
brianpWins has joined #ruby-lang
Weems has joined #ruby-lang
Weems has quit [Changing host]
Weems has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
singpolyma has quit [Ping timeout: 248 seconds]
ryanf has joined #ruby-lang
srbartlett has joined #ruby-lang
paulp has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
diegoviola has quit [Quit: leaving]
piyush__ has joined #ruby-lang
Sambalero has quit [Remote host closed the connection]
flak has joined #ruby-lang
singpolyma has joined #ruby-lang
flak is now known as Guest12356
rippa has quit [Ping timeout: 255 seconds]
cirwin has joined #ruby-lang
Guest12356 has quit [Ping timeout: 250 seconds]
banisterfiend has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 246 seconds]
srbartlett has quit [Remote host closed the connection]
yugui_zzz is now known as yugui
naz has quit [Read error: Connection reset by peer]
banisterfiend has quit [Remote host closed the connection]
kain has quit [Quit: This computer has gone to sleep]
brianpWins has quit [Quit: brianpWins]
banisterfiend has joined #ruby-lang
kain has joined #ruby-lang
krainboltgreene_ has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
Z33K|Lux has quit []
paulp has joined #ruby-lang
towski has quit [Ping timeout: 240 seconds]
krainboltgreene has quit [Ping timeout: 245 seconds]
krainboltgreene_ is now known as krainboltgreene
krz has quit [Quit: krz]
banisterfiend has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby-lang
piyush__ has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby-lang
pemeon has joined #ruby-lang
j342 has joined #ruby-lang
j342 has quit [Client Quit]
dreinull has joined #ruby-lang
ryanf has quit [Quit: broken pipes |||]
charliesome has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
workmad3 has joined #ruby-lang
Doobie has quit [Ping timeout: 272 seconds]
woollyams has quit [Quit: Computer has gone to sleep.]
Doobie has joined #ruby-lang
Doobie has quit [Ping timeout: 272 seconds]
wallerdev has quit [Quit: wallerdev]
Doobie has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
Hakon has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
tbuehlmann has joined #ruby-lang
cantonic has joined #ruby-lang
gregmoreno has quit [Read error: Connection reset by peer]
gregmoreno has joined #ruby-lang
heftig has quit [Ping timeout: 246 seconds]
queuetue has joined #ruby-lang
woollyams has joined #ruby-lang
rhalff has joined #ruby-lang
cirwin has quit [Ping timeout: 272 seconds]
woollyams has quit [Client Quit]
heftig has joined #ruby-lang
heftig has quit [Ping timeout: 246 seconds]
esad has joined #ruby-lang
d3vic3 has joined #ruby-lang
pemeon has quit [Read error: Connection reset by peer]
jxie has quit [Quit: leaving]
kristofferrr has quit [Quit: ❤]
mssola has joined #ruby-lang
sandbags has quit [Remote host closed the connection]
corecode has left #ruby-lang [":wq"]
dc5ala has joined #ruby-lang
yxhuvud has joined #ruby-lang
cantonic has quit [Read error: Connection timed out]
cantonic has joined #ruby-lang
kain has quit [Quit: This computer has gone to sleep]
gsav has joined #ruby-lang
queuetue_ has joined #ruby-lang
queuetue has quit [Ping timeout: 272 seconds]
queuetue_ is now known as queuetue
krainboltgreene has quit [Quit: krainboltgreene]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
Elihu5991 has joined #ruby-lang
Elihu5991 has quit [Client Quit]
Elihu5991 has joined #ruby-lang
Elihu5991 has quit [Client Quit]
Hakon has quit [Ping timeout: 240 seconds]
mssola has quit [Remote host closed the connection]
kristofferrr has joined #ruby-lang
<kristofferrr>
Is it possible to document what types a class' instance variables returns without setting attr_reader for each of them individually?
workmad3 has quit [Read error: Operation timed out]
<apeiros_>
kristofferrr: what for? if you don't provide a method to access them, you can't access them…
<kristofferrr>
No, what I mean is I currently set about 10 instance variables with a single attr_reader. To document them I'd have to set them one at a time.
<apeiros_>
but sure, you can document them e.g. in your class documentation. but it is unusual to document the internals of a class, since the point of having them is to not need to know the internals…
<apeiros_>
kristofferrr: ah, I see
<apeiros_>
I'm not aware of a way, no. I never really checked, though.
<kristofferrr>
Damn.
mssola has joined #ruby-lang
mssola has quit [Client Quit]
banisterfiend has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend` has joined #ruby-lang
<Mon_Ouie>
I think it's clearer to someone reading the code if you only have one attr per call to attr_*
<Mon_Ouie>
unless they are very closely related (e.g. attr_reader :x, :y to represent a point)
<banisterfiend`>
Mon_Ouie: i agree with u monny, that's also better for documentation purposes
Banistergalaxy has quit [Ping timeout: 272 seconds]
<kristofferrr>
Well they pretty much are all closely related.
<kristofferrr>
But I guess I'll split them up anyway.
workmad3 has joined #ruby-lang
th3g33k has joined #ruby-lang
ltd- has quit [Ping timeout: 246 seconds]
Banistergalaxy has joined #ruby-lang
beiter has joined #ruby-lang
areil has joined #ruby-lang
workmad3 has quit [Read error: Operation timed out]
ruurd has joined #ruby-lang
melter has quit [Ping timeout: 264 seconds]
stardiviner has joined #ruby-lang
ltd has joined #ruby-lang
naz has joined #ruby-lang
postmodern has quit [Quit: Leaving]
<kristofferrr>
Also, if anyone knows of some exemplary documented source code on GitHub I'd love to get a link to see how it's done right ;)
<Eising>
Hey there. I need a bit of advice on how to convert a string to a string of hexadecimal. I can do a String#unpack('H*') and get all the hex values as letters, but I need them as actual \0x values as a string. Any idea?
ruurd has quit [Quit: Leaving...]
<apeiros_>
what?
jxie has joined #ruby-lang
ruurd has joined #ruby-lang
hramrach has quit [Ping timeout: 276 seconds]
hramrach has joined #ruby-lang
<Eising>
I'm working with a thermal printer over a serial connection, and I found out that it works better if I send text as escaped hexadecimal instead of ascii. As in serialport.write "\x65\x16" etc...
<Eising>
however, I'm having trouble converting ascii to that format
<apeiros_>
I'm still not sure what you try to do. you want to go from "6516" to "\x65\x16"?
<apeiros_>
@ Eising
beiter has quit [Quit: beiter]
<apeiros_>
um, yeah, 10min no reply on a follow-up question… timeout
ruurd has quit [Quit: Leaving...]
ltd has quit [Ping timeout: 240 seconds]
voker57 has quit [Read error: Connection reset by peer]
apeiros_ has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
fgomez has joined #ruby-lang
heftig has joined #ruby-lang
phromo has left #ruby-lang [#ruby-lang]
ruurd has quit [Quit: Leaving...]
Eising has left #ruby-lang [#ruby-lang]
fgomez has quit [Ping timeout: 246 seconds]
Denommus has joined #ruby-lang
sailias has quit [Quit: Leaving.]
<Denommus>
hi
lcdhoffman has quit [Quit: lcdhoffman]
ruurd has joined #ruby-lang
dv310p3r has joined #ruby-lang
kristofferrr has quit [Quit: ❤]
fgomez has joined #ruby-lang
fgomez has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
<mistym>
How can I pass a variable into a class when creating an anonymous class?
<mistym>
var = 'foo'; klass = Class.new {def bar; p var; end}; klass.new.bar => "undefined local variable or method `var'"
<banisterfiend`>
mistym: Class.new { define_method(:bar) { p var } }
lcdhoffman has quit [Client Quit]
<mistym>
banisterfiend`: Thanks!
fgomez has joined #ruby-lang
kvirani has joined #ruby-lang
dv310p3r has quit [Quit: Leaving]
kvirani has quit [Remote host closed the connection]
ruurd has quit [Quit: Leaving...]
ruurd has joined #ruby-lang
neocoin has joined #ruby-lang
ttilley_off is now known as ttilley
neocoin has quit [Remote host closed the connection]
neocoin has joined #ruby-lang
workmad3 has joined #ruby-lang
neocoin has quit [Ping timeout: 250 seconds]
snorkdude has joined #ruby-lang
<Denommus>
my feedzirra is giving this error: NameError: uninitialized constant ActiveSupport::Deprecation
<Denommus>
from /home/yuri/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.7/lib/active_support/core_ext/module/deprecation.rb:7:in `deprecate'
<Denommus>
how could I solve it?
kvirani has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
gregoryostermayr has joined #ruby-lang
gregoryostermayr has quit [Client Quit]
Leeky is now known as Leeky_afk
pemeon has quit [Remote host closed the connection]
VegetableSpoon has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
relix has quit [Quit: Connection closed for inactivity]
workmad3 has joined #ruby-lang
rippa has joined #ruby-lang
mistym has quit [Remote host closed the connection]
chimkan has joined #ruby-lang
workmad3 has quit [Ping timeout: 244 seconds]
wallerdev has joined #ruby-lang
wallerdev has quit [Client Quit]
wallerdev has joined #ruby-lang
neocoin has joined #ruby-lang
savage- has quit [Remote host closed the connection]
<certainty>
banisterfiend`: interesting. I would have thought that the closure would be available in the first method definition
<banisterfiend`>
certainty: methods aren't closures in ruby
<certainty>
banisterfiend`: yeah but class.new{ } creates a closure, no?
<banisterfiend`>
certainty: yeah but that only applies to the class body, not methods within it ;)
<certainty>
i see
chimkan has quit [Quit: chimkan]
tbuehlmann has quit []
chimkan has joined #ruby-lang
<certainty>
banisterfiend`: is it just me or is that a bit unintuitive? Do you know the rationale behind that? Don't method know anything about their lexical environment, when they are created?
jtoy has joined #ruby-lang
<banisterfiend`>
certainty: just that def blah; end is not a closure
<banisterfiend`>
same as class Blah ;end is not a closure
<banisterfiend`>
is closuer is only created when a block is used
<banisterfiend`>
and neither of those are blocks
Nisstyre has quit [Quit: Leaving]
<certainty>
banisterfiend`: yeah, maybe it's just be being thick in that regard. It's ruby after all and not some other language i might know
<certainty>
thanks for the clarification
<certainty>
s/be/me/
jackhammer2022 has joined #ruby-lang
lsegal has joined #ruby-lang
brianpWins has joined #ruby-lang
snorkdude has quit [Remote host closed the connection]
kain has joined #ruby-lang
sevvie has joined #ruby-lang
sora_h is now known as s0ra_h
heftig has quit [Ping timeout: 245 seconds]
heftig has joined #ruby-lang
tjadc has joined #ruby-lang
ini has joined #ruby-lang
malev has joined #ruby-lang
iniy has joined #ruby-lang
ini has quit [Ping timeout: 250 seconds]
fgomez has quit [Quit: Lost terminal]
Sambalero has quit [Remote host closed the connection]
Sambalero has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
workmad3 has joined #ruby-lang
dejongge has joined #ruby-lang
areil has quit [Remote host closed the connection]
havenn has joined #ruby-lang
ini has joined #ruby-lang
iniy has quit [Ping timeout: 246 seconds]
malev has quit [Remote host closed the connection]
<ryanf>
freedrull: my point was that even though nil.to_s is "", nil.to_str raises an error
<nofxx>
Mon_Ouie, oh, nevermind... you can't to_a single objects... fixnum, string [param].flatten does
asahi has joined #ruby-lang
<freedrull>
oh i see. are the 'long' conversion methods supposed to be more strict or something?
<Mon_Ouie>
I don't like that […].flatten idea — consider nested arrays (granted, you can say how deep you want to go now)
gsav has joined #ruby-lang
<Mon_Ouie>
freedrull: Yes, for example String#+ can add a string with something that responds to #to_str
outsmartin has quit [Quit: Leaving.]
<ryanf>
freedrull: yeah, hash is a weird case since there's no to_h though
<ryanf>
but I think to_hash is itself a relatively recent addition
<freedrull>
oh i see
<ryanf>
and there's no way to have a longer conversion method name than to_hash, so it should probably stay reserved for strict conversion :)
<freedrull>
so if there were a to_h, it might be more liberal and convert nil to {}
<ryanf>
yeah maybe
bytephilia has joined #ruby-lang
sevvie has joined #ruby-lang
<asahi>
hello. I have gem.add_development_dependency "mechanize" in my gemspec file but when I add my gem to a Gemfile and run bundle, it's not including mechanize. does anyone have a suggestion?
d3vic3 has joined #ruby-lang
<ryanf>
on the other hand, using ObjectSpace in a rails env with a bunch of gems loaded reveals lots more classes with #to_hash defined, so in real life people might just use it however
<nofxx>
asahi, add_dependency, no development
<ryanf>
asahi: add_development_dependency will only install the gem if you run bundler in the directory of the gem itself
<ryanf>
yeah
<ryanf>
for it to be installed when you're just using the gem, it has to be a real dependency
<asahi>
I see. thanks
agile has quit [Read error: No route to host]
jtoy has quit [Quit: jtoy]
jtoy has joined #ruby-lang
jtoy has quit [Read error: Connection reset by peer]
jtoy has joined #ruby-lang
Sambalero has joined #ruby-lang
lun__ has quit [Remote host closed the connection]
jtoy has quit [Read error: Connection reset by peer]
jtoy has joined #ruby-lang
singpolyma has quit [Ping timeout: 272 seconds]
ruurd has quit [Ping timeout: 272 seconds]
pemeon has quit [Read error: Connection reset by peer]