<MrZYX>
calling .encode and let it drop invalid characters might help
<pskosinski>
I wonder how I made DOS executable from txt file >.>
cofin has quit [Quit: cofin]
<MrZYX>
file extensions are for humans only (for the most part) :P
rangle has joined #ruby
tylersmith has quit [Ping timeout: 245 seconds]
DrCode has quit [Ping timeout: 240 seconds]
bashdy has joined #ruby
bashdy has quit [Client Quit]
DrCode has joined #ruby
slainer68 has joined #ruby
kil0byte has joined #ruby
DonRichie has quit [Ping timeout: 256 seconds]
DonRichie has joined #ruby
iamjarvo1 has joined #ruby
Xeago has quit [Remote host closed the connection]
jamesfung14 has quit [Ping timeout: 256 seconds]
pierre1 has quit [Ping timeout: 256 seconds]
m8 has quit [Quit: Sto andando via]
mklappstuhl has quit [Remote host closed the connection]
iamjarvo1 has quit [Ping timeout: 260 seconds]
mockra_ has joined #ruby
bigmac has quit [Ping timeout: 264 seconds]
arya has quit [Ping timeout: 248 seconds]
mockra has quit [Ping timeout: 276 seconds]
AgentWillyWonka has joined #ruby
fixl has joined #ruby
<epitron>
and filemanagers, webservers, commandline utilities...
arya has joined #ruby
pierre1 has joined #ruby
<epitron>
but yes, humans are definitely the most part of all those things
icole has joined #ruby
emmanuelux has joined #ruby
<Quadlex>
As in all things, be holistic when considering them
slainer68 has quit [Remote host closed the connection]
<Quadlex>
Geek holistic. "What systems need the file extention?" "Have I picked encodings that will support the greatest good"
mockra_ has quit [Remote host closed the connection]
<Quadlex>
"Will my UI cause my users to cry tears of blood?"
<epitron>
i thought dollars were the only things that mattered
<epitron>
Quadlex you have opened my eyes
guiocavalcanti has quit [Remote host closed the connection]
guiocavalcanti has joined #ruby
connor_goodwolf has quit [Read error: Operation timed out]
<Quadlex>
epitron: You can buy my book for more enlightenment and spiritual guidance at http://www.37signals.com
atno has quit [Ping timeout: 252 seconds]
atno has joined #ruby
dross has quit [Ping timeout: 248 seconds]
<epitron>
speaking of which, i must go attain gustatory enlightenment and metabolic harmony
Guedes has quit [Ping timeout: 260 seconds]
<epitron>
(brb food)
<Quadlex>
Universe::Salutations::Good.Namaste
davedev24 has quit [Remote host closed the connection]
cj3kim has quit [Remote host closed the connection]
guiocavalcanti has quit [Ping timeout: 256 seconds]
undersc0re97 has joined #ruby
<epitron>
send(:remove_const, :Universe)
aef_ has quit [Ping timeout: 252 seconds]
johnrlive has quit [Remote host closed the connection]
cj3kim has joined #ruby
[Neurotic]_ has quit [Quit: Connection closed for inactivity]
idkazuma has quit [Remote host closed the connection]
atno has quit [Remote host closed the connection]
arya has quit []
<jokke>
hey i'm using yaml dump to serialize some objects. One of them uses missing_method to define methods on the fly, much like OpenStruct. I need to assign all attributes that were created for that object in init_from(coder) but i have no clue how to iterate through the key value pairs in coder...
pcarrier_ has quit [Ping timeout: 264 seconds]
peta_ has quit [Quit: peta_]
mikepack has joined #ruby
justsee has joined #ruby
pcarrier_ has joined #ruby
<jokke>
ah never mind :)
<jokke>
map
breakingthings has joined #ruby
browndawg has joined #ruby
browndawg has quit [Client Quit]
monkegjinni has quit [Remote host closed the connection]
dr00bie has joined #ruby
Peej has quit [Remote host closed the connection]
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
eka has joined #ruby
rking1 has quit [Ping timeout: 246 seconds]
Peej has joined #ruby
mixel has joined #ruby
jonathanwallace1 has quit [Ping timeout: 252 seconds]
<epitron>
map is actually for transforming the key/values... each is just for iterating
<jokke>
nope
<jokke>
not with a coder object
<epitron>
ok!
<jokke>
it's confusing
<epitron>
that i believe
TJNII has left #ruby ["How much is that pickle in the window? The one that's on top of the pail. How much is that pickle in the window? I do hope that pickle's for sale."]
cantonic has quit [Quit: cantonic]
pskosinski has quit [Ping timeout: 264 seconds]
mockra has joined #ruby
slainer68 has joined #ruby
akells` has joined #ruby
hogeo has joined #ruby
icole has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 256 seconds]
danslo has quit [Quit: danslo]
tylersmith has joined #ruby
alx- has quit [Read error: Connection reset by peer]
bradhe has quit [Remote host closed the connection]
Alex- has joined #ruby
akells` has quit [Ping timeout: 264 seconds]
moos3 has joined #ruby
jonathanwallace1 has joined #ruby
jeremywrowe has quit [Ping timeout: 256 seconds]
slainer68 has quit [Ping timeout: 264 seconds]
tylersmith has quit [Ping timeout: 256 seconds]
moos3 has quit [Client Quit]
Quadlex is now known as AwayLex
phipes has joined #ruby
Cultofmetatron has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
Cultofmetatron has joined #ruby
sam113101 has quit [Read error: Connection reset by peer]
Rumsteak_ has joined #ruby
devoldmx3 has joined #ruby
sam113101 has joined #ruby
Rumsteak has quit [Ping timeout: 246 seconds]
Rumsteak_ is now known as Rumsteak
jmsbrwr has quit [Ping timeout: 276 seconds]
chessguy has left #ruby ["Leaving..."]
AlbireoX has quit [Ping timeout: 256 seconds]
AlbireoX has joined #ruby
Dummies_freelanc has quit [Ping timeout: 256 seconds]
Kricir has joined #ruby
AlbireoX`Laptop has joined #ruby
mikepack has quit [Remote host closed the connection]
crazymykl has quit [Remote host closed the connection]
crazymykl has joined #ruby
yashshah has joined #ruby
AlbireoX has quit [Ping timeout: 276 seconds]
sailias has joined #ruby
Alex- has quit [Quit: Alex-]
bradhe has joined #ruby
G14291 has joined #ruby
slash_nick has quit [Ping timeout: 256 seconds]
<rgrinberg>
is anybody here a user of the snoo lib to acccess the reddit api?
<rgrinberg>
im submitting some links with snoo and not getting an error or anything but the links are not showing up
banisterfiend has quit [Read error: Connection reset by peer]
bradhe has quit [Ping timeout: 256 seconds]
JZTech101 has quit [Ping timeout: 248 seconds]
yashshah has quit [Read error: Connection reset by peer]
yashshah has joined #ruby
subbyyy has joined #ruby
Hanmac has joined #ruby
johnrlive has joined #ruby
guiocavalcanti has joined #ruby
mercwithamouth has quit [Read error: Operation timed out]
johnrlive has quit [Read error: Operation timed out]
cj3kim has quit [Remote host closed the connection]
Hanmac1 has quit [Ping timeout: 248 seconds]
guiocavalcanti has quit [Remote host closed the connection]
guiocavalcanti has joined #ruby
jmsbrwr has joined #ruby
jetblack has quit [Ping timeout: 252 seconds]
splittingred has joined #ruby
prk has joined #ruby
nickynamey has joined #ruby
phipes has quit [Quit: phipes]
ariedler has quit [Remote host closed the connection]
guiocavalcanti has quit [Ping timeout: 264 seconds]
Hanmac1 has joined #ruby
yashshah has quit [Ping timeout: 260 seconds]
nari has joined #ruby
Daemoen has joined #ruby
<rgrinberg>
nvm figured it out
ARCADIVS has quit [Quit: WeeChat 0.3.8]
Hanmac has quit [Ping timeout: 260 seconds]
fixl has quit [Remote host closed the connection]
w|t has joined #ruby
w|t has quit [Max SendQ exceeded]
emergion has joined #ruby
w|t has joined #ruby
dhruvasagar has quit [Ping timeout: 248 seconds]
yashshah has joined #ruby
mockra has joined #ruby
cj3kim has joined #ruby
big-red has quit []
larissa has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
mockra has quit [Ping timeout: 264 seconds]
falood has joined #ruby
slainer68 has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
brunoro has quit [Ping timeout: 240 seconds]
tylersmith has joined #ruby
Kricir has quit [Remote host closed the connection]
emergion has quit [Quit: Computer has gone to sleep.]
prk has quit [Ping timeout: 248 seconds]
emergion has joined #ruby
kil0byte has quit [Remote host closed the connection]
phipes has joined #ruby
eykosioux has quit [Remote host closed the connection]
eykosioux has joined #ruby
emergion has quit [Client Quit]
fixl has joined #ruby
tylersmith has quit [Ping timeout: 276 seconds]
horofox_ has quit [Quit: horofox_]
<devoldmx3>
/join #jbpm
<devoldmx3>
/
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
chipotle_ has joined #ruby
atno has joined #ruby
eykosioux has quit [Ping timeout: 256 seconds]
slainer68 has quit [Ping timeout: 256 seconds]
mklappstuhl has joined #ruby
yashshah_ has joined #ruby
yashshah has quit [Read error: No route to host]
n_blownapart has joined #ruby
lyanchih has joined #ruby
robustus has quit [Ping timeout: 252 seconds]
n_blownapart has quit [Remote host closed the connection]
pierre1 has quit [Read error: Connection reset by peer]
robustus has joined #ruby
yashshah_ has quit [Remote host closed the connection]
yashshah- has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<Pip>
bnagy, If I installed some gems into some local user home directory, but there are some gems in /usr/lib/ruby/gems, so how to update two groups of gems without messing up each group
<bnagy>
if you want to manage multiple rubies and sets of gems you should look into chruby or rbenv or something
rakl has joined #ruby
<Pip>
I don't use multiple rubies, only ruby 2.0
<bnagy>
then I don't know how you would have installed gems into two different places :)
<Pip>
ruby ships with rubygem and some basic gems in its installation directory
rakl has quit [Client Quit]
rburton- has joined #ruby
<Pip>
But I installed some gems in my local user directory .gem
<Pip>
So later, if there are some gems need to be updated, how to separately update them
<bnagy>
if you just installed ruby 'normally' then don't worry about it. gem will do the right thing
iamjarvo1 has joined #ruby
cj3kim has joined #ruby
iamjarvo1 has quit [Client Quit]
iamjarvo1 has joined #ruby
iamjarvo1 has quit [Client Quit]
iamjarvo has joined #ruby
<Pip>
bnagy, does it have anything to do with option --user-install or something?
mockra has joined #ruby
<bnagy>
no idea what that option is
hogeo has quit [Remote host closed the connection]
<bnagy>
I've only ever used --prefix=
rakl has joined #ruby
nettoweb has quit [Quit: nettoweb]
katsrc has joined #ruby
phipes has quit [Quit: phipes]
bigmac has joined #ruby
phipes has joined #ruby
Davey has joined #ruby
d2dchat has joined #ruby
<Pip>
thanks
Pip has quit [Quit: Leaving]
bradhe has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
chrishunt has quit [Quit: ZzZzZz...]
pkrzywicki has quit [Ping timeout: 256 seconds]
banghouse has quit [Remote host closed the connection]
dik_dak has quit []
RiftyMcF3arless has quit [Ping timeout: 256 seconds]
dik_dak has joined #ruby
Hanmac has joined #ruby
kofno has joined #ruby
bradhe has quit [Ping timeout: 248 seconds]
freeayu has joined #ruby
SAUCYSALAMANDER has quit [Read error: Connection reset by peer]
Hanmac1 has quit [Ping timeout: 256 seconds]
lyanchih has quit [Quit: lyanchih]
d11wtq has quit [Ping timeout: 241 seconds]
DanKnox_away is now known as DanKnox
devoldmx3 has quit [Quit: Bye]
hamakn has joined #ruby
dmiller has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
<DanKnox>
looks like your @wetout = "default" is commented out
slainer68 has joined #ruby
brianherman has quit [Read error: Connection reset by peer]
synthetix has quit [Remote host closed the connection]
<baordog>
when I have that uncommented it just renders the word default
<baordog>
and not my view
<macmartine>
b/c that's what the variable is set to
chandankumar has joined #ruby
<macmartine>
what are you expecting?
brianherman has joined #ruby
<baordog>
It should render my view and put the variable in where I tell to
<macmartine>
it outputs what the variable is set to, which is you said, is "default"
<baordog>
but none of the other stuff in my view. It literally just takes me to a page with the word "Default"
<macmartine>
it doesn't render the selects when you uncomment that variable, but it does when it's commented out?
<baordog>
Instead of the whole page with default replacing the <%= wetout %>
<baordog>
yes, it renders when it's commented out
slainer68 has quit [Ping timeout: 256 seconds]
<macmartine>
well, your html is badly formed for one
<baordog>
but not the <%= wetout %> part. That's entirely missing. Even when I send the form it's missing.
kobain has quit [Ping timeout: 245 seconds]
<macmartine>
you have two <form> tags but only one </form>
<macmartine>
oh, nm
RiftyMcF3arless has joined #ruby
kobain has joined #ruby
kobain has quit [Client Quit]
<DanKnox>
well posting the form isn't going to do much because you just redirect back to the index page
<DanKnox>
and don't store anything
<DanKnox>
@wetout is not going to exist after the redirect
ocnam has joined #ruby
<baordog>
am I not storing the contents of wetout in a variable?
dik_dak has quit []
larissa has quit [Quit: Leaving]
<DanKnox>
yeah but the variables get garbage collected and disappear after each request
<DanKnox>
HTTP is stateless
<DanKnox>
which means each request knows nothing of the last
<DanKnox>
if you want to store information between requests you need to persist it somewhere
mockra has joined #ruby
w|t has quit [Ping timeout: 246 seconds]
<DanKnox>
in your case a cookie would probably be your best bet
araujo has quit [Quit: Leaving]
mockra_ has quit [Ping timeout: 264 seconds]
<baordog>
Really? that sounds like an extra layer of complexity. What I'm trying to make is this app that takes a few a parameters and puts output into the text box. It's going to be a big pile of generated code in the end. Really think a cookie is best?
bricker`LA has quit [Read error: Connection reset by peer]
bricker`1A has joined #ruby
w|t has joined #ruby
browndawg has joined #ruby
<DanKnox>
in that case just get rid of the redirect
<DanKnox>
render the page after the post
<baordog>
So when I hit post, I just get the contents of the variable. Is there a way to tell it to re-render the original page with the updated variable? That was what I was trying with the redirect.
Cultofmetatron has quit [Remote host closed the connection]
<baordog>
hahah she works. :D
<DanKnox>
yeah just erb :weather
<baordog>
Thanks! any tips for getting my generated results into the text box?
<DanKnox>
what do you mean?
<DanKnox>
what type of data will it be?
<baordog>
In the end it will be code for a different program. I want it in the text box so it can be easily copy/pasted into someone's IDE. The same way youtube embeds work.
<DanKnox>
It sounds like you could just <textarea><%= @generated_code %></textarea>
<DanKnox>
or if you really want a text box <input type="text" value="<%= @variable %>">
<baordog>
ah I didn't know you could nest like that
Davey has quit [Quit: Computer has gone to sleep.]
<DanKnox>
yeah you can output the variables wherever you please
<DanKnox>
gotta run
<DanKnox>
glad to hear you got it working
<DanKnox>
good luck with the rest
AwayLex is now known as Quadlex
<baordog>
thanks!
<DanKnox>
no problem
lewis has joined #ruby
lewis is now known as lewix
pkill has joined #ruby
DanKnox is now known as DanKnox_away
sailias has quit [Quit: Leaving.]
jonathanwallace1 has quit [Ping timeout: 248 seconds]
<DanKnox>
ikea_meatballs: it seems like i've been running into rspec bugs more frequently lately… it's a sad day when you can't trust your test suite
<apeiros>
line 47: Statsd.incrememnt( metric, (v).to_i ) # incrememnt?
<ikea_meatballs>
DanKnox: Ha
<ikea_meatballs>
Thank you
<joshmyers>
ha
<apeiros>
and `Trollop::options` is ugly. don't use :: for method invocation. use .
<DanKnox>
I have literally spent an hour or two trying to figure out what was wrong with my code just to finally realize it was an rspec bug
<joshmyers>
nice apeiros :)
<apeiros>
re refactor: `channels.select { |k,v| v["ChannelSize"] >= opts[:crit] }.map { |k,v| "#{k}: #{v["ChannelSize"]}"}.join(";").gsub("CHANNEL.", "")` is repetitive. parametrize `opts[:crit]` and do it only once.
<DanKnox>
on several occasions
<joshmyers>
ja was thinkign that
<joshmyers>
put it in a method?
<ikea_meatballs>
i just can't mock it.
<ikea_meatballs>
it's too coo
mklappstuhl has quit [Ping timeout: 256 seconds]
<apeiros>
joshmyers: I don't think I'd put it into a method, no
<apeiros>
*if*, then I'd make a proper Channel class and operate on it.
<apeiros>
but at the current size of the script, that seems overkill.
<joshmyers>
is a little
<DanKnox>
ikea_meatballs: what are you trying to mock?
<ikea_meatballs>
Resque
<joshmyers>
apeiros: how can I parameterise line 53 onwards without putting in a method/creating a class?
<ikea_meatballs>
DanKnox: Resque.mock!(:enqueue)
<apeiros>
joshmyers: just use a variable
<ikea_meatballs>
it's so annoying!
codecop has joined #ruby
<DanKnox>
i believe the mock method is somewhat deprecated
<apeiros>
joshmyers: yes, I create a class which has 2 members (:name and :size) and an additional method (to_s)
<apeiros>
the 2 members lets the struct create 4 methods: name, name=, size and size=
kil0byte has joined #ruby
<joshmyers>
ok with ya until the last bit.. ;)
<apeiros>
i.e., Foo = Struct.new(:foo, :bar) is (almost) equivalent to: class Foo; attr_accessor :foo, :bar; end
<joshmyers>
ahh
robottinosino has joined #ruby
thone_ has joined #ruby
blacktulip has quit [Ping timeout: 252 seconds]
<joshmyers>
apeiros: line 39, whats the _k for?
zeeraw has joined #ruby
<apeiros>
joshmyers: local variables starting with _ indicate that they're not used
<apeiros>
your json is a hash, so select gets key/value pairs. but I don't use the key. hence I mark the variable as unused.
<joshmyers>
ahhhh
<joshmyers>
excellent
<MrZYX>
#values ;P
<apeiros>
some editors pick up on unused variables. this tells them that it is known to the coder that the variable is not used and it won't warn you about it.
<joshmyers>
cool
<apeiros>
MrZYX: meh. longer, less efficient, not easier to read IMO.
thone has quit [Ping timeout: 248 seconds]
<apeiros>
MrZYX: actually also broken
<apeiros>
i need the hash after
<MrZYX>
in this case, yeah
<joshmyers>
also (&:size) what does this do?
<joshmyers>
sorry for all the questions :)
<apeiros>
.map(&:size) is equivalent to .map { |item| item.size }
<joshmyers>
ah kk
<apeiros>
basically, .map(&obj) tells ruby to call obj.to_proc and pass the resulting proc as a block to map
krainboltgreene has quit [Ping timeout: 240 seconds]
swex has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
shevy has quit [Read error: Connection reset by peer]
gr4yscale has joined #ruby
AlbireoX has quit [Remote host closed the connection]
ToApolytoXaos has joined #ruby
swex has joined #ruby
cj3kim has quit [Remote host closed the connection]
backjlack has quit [Remote host closed the connection]
jaredrhine has quit [Remote host closed the connection]
DanKnox is now known as DanKnox_away
artofraw has joined #ruby
<artofraw>
could you think of a case where an object_id would not be unique?
jaredrhine has joined #ruby
horofox_ has quit [Quit: horofox_]
Xeago has joined #ruby
pandawarrior has joined #ruby
<pandawarrior>
hello all!
<apeiros>
artofraw: long runtime
<apeiros>
object_id's can potentially be recycled
<pandawarrior>
i'm reading the poodr book and it says: "Always wrap instance variables in accessor methods instead of directly referring to variables...... ", "Hide the variables, even from the class that defines them, by wrapping them in methods."
ikea_meatballs has quit [Quit: ikea_meatballs]
<pandawarrior>
but that sometimes causes instances variable to loose their assignments
<pandawarrior>
"lib/prime_number.rb:30:in `block in mark_non_primes': undefined method `+' for nil:NilClass (NoMethodError)
<pandawarrior>
from lib/prime_number.rb:24:in `times'
<pandawarrior>
from lib/prime_number.rb:24:in `mark_non_primes'
<pandawarrior>
from lib/prime_number.rb:37:in `<main>'"
<pandawarrior>
from lib/prime_number.rb:14:in `list_primes'
ferdev has joined #ruby
<apeiros>
marked_prime += 1 # this is where you get the error, not where you said
tylersmith has quit [Ping timeout: 248 seconds]
<apeiros>
and that doesn't work because `marked_prime += 1` becomes `marked_prime = marked_prime+1`, and `marked_prime = ` *always* assigns to a local variable
<artofraw>
ofcourse
<artofraw>
self.marked_prime +=1
<pandawarrior>
in the original version that's where it was falling over
<apeiros>
it *never* calls the method `marked_prime=`
<pandawarrior>
?
<pandawarrior>
line 8: @marked_prime = 2
<apeiros>
well, then change it to `self.marked_prime += 1` and show that exception
<artofraw>
yeah, the interpreter can't guess that u refer to the accessor method and not want to assign a new local var..
idkazuma has quit [Remote host closed the connection]
<apeiros>
pandawarrior: @marked_prime is NOT the same as marked_prime
<pandawarrior>
oh...
<apeiros>
marked_prime # either a method or a local variable
<apeiros>
@marked_prime # always an instance variable
<pandawarrior>
so why wrap them in accessor methods, like the book says if the interpreter can't decipher when i'm revering to the method?
<pandawarrior>
wrong question...
<pandawarrior>
question is
<pandawarrior>
how can i fix this?
<pandawarrior>
also wrong question
<pandawarrior>
it was already answered by apeiros
cj3kim has quit [Ping timeout: 276 seconds]
<pandawarrior>
okay so here's a question. @marked_prime and marked_prime are *not* the same thing… But I thought that creating an accessor method on an instance variable meant that you can can access to an instance variable through a method… so my question is, how come Ruby got confused?
lkba has joined #ruby
F1skr has joined #ruby
pcarrier_ has quit [Quit: Computer has gone to sleep.]
<MrZYX>
because ruby can't decide if foo is a method call or a local variable, it looks the same. Remember the NoMethod error message, it says "undefined local variable or method". You still want to wrap into accessors though because then you can entirely change how the value is stored, for example instead of storing it into an instance variable, read and write it into a text file everytime, without changing anything except your accessesors
<pandawarrior>
ah i see
<pandawarrior>
riiiight okay that's why i use self.foo to tell Ruby, hey it's a method i want, and that method happens to be an accessor method, which happens to be a wrapper for my instance method
<pandawarrior>
okay that makes sense
<apeiros>
you only need the self. for assigning
<apeiros>
since `foo = value` will always assign to a local variable
<apeiros>
while `self.foo = value` always calls the method `foo=`
<apeiros>
with just `foo`, ruby will look whether there is a local variable of that name and use that, else it will try to call the method of that name
<apeiros>
personally, I prefer using @foo over using the accessor methods
<apeiros>
MrZYX stated a reason for why to prefer the accessor over the ivars, though.
<pandawarrior>
i wonder if i change the initialze to marked_prime = 2, it that would mean i don't need to use self.marked_prime later...
Leighton has quit [Quit: Leaving]
<apeiros>
no.
davetherat has quit [Remote host closed the connection]
<apeiros>
as said already. foo= is *always* lvar assignment
davetherat has joined #ruby
<pandawarrior>
yu[
ebouchut has quit [Quit: This computer has gone to sleep]
<pandawarrior>
yup tried it and it failed
<MrZYX>
most prominent example would something like a password= accessor that hashes the value right away
<pandawarrior>
lol
<apeiros>
that's actually a prominent example of a bad usecase
<apeiros>
since there assigned value != returned value
<pandawarrior>
oh grown ups are fighting.. lol i'm just a noob, here
<pandawarrior>
artofraw apeiros and MrZYX thanks for your insights, always educational :)
<MrZYX>
if I'm not allowed to change the value in the accessor there's really no point using one in the first place
falood has quit [Remote host closed the connection]
Drakevr has joined #ruby
Drakevr has joined #ruby
Drakevr has quit [Changing host]
Sicp has joined #ruby
shevy has quit [Remote host closed the connection]
akashj87 has joined #ruby
<pandawarrior>
do you guys write tests first and then the code, or write small bits of the code, then tests, then more code etc?
<pandawarrior>
i find tdd incredibly difficult.
sepp2k has joined #ruby
<MrZYX>
try to start with an highlevel integration test, like assert SomeClass.new.some_method, "some expected value"
<apeiros>
MrZYX: the point of why it's a bad example IMO is that `x = password; user.password = x; user.password != x`
<apeiros>
a better example would be e.g. a clock
<apeiros>
which might store the time as seconds since 0:00, or as hours,minutes,seconds
<pandawarrior>
MrZYX: i can do that, because i almost always know what the data should at least look like, an array, a string, a value etc
Leighton has joined #ruby
<apeiros>
but since you can't use ivars externally anyway, and internally should be small and simple enough to easily let you refactor, I don't see any value of using methods internally too
<Sicp>
how can I say uh..the end of the element before the last element of the stack?
<Sicp>
I know that @stack[-1] is the last element
<Sicp>
@stack[-2]..?
sayan has joined #ruby
<Sicp>
I should try it, nevermind
Cache_Money has quit [Ping timeout: 276 seconds]
<Sicp>
yea it's -2
<pandawarrior>
Also do you guys think i should test every method, even private ones that are used internally in combination with public facing methods?
<pandawarrior>
for instance, should i test the #create_range_of_prime_candidates and #mark_non_primes private methods or just the #list_primes method?
<Sicp>
that's what ought to happen when it reads ((a),a,(a,a))$ <-- you can run it just fine it doesn't need anything more than Ruby
<Sicp>
yet it reads ((a, <-- how the fuck did it run over that right paren!
falood has joined #ruby
<Sicp>
it's right there specified in the case! when you read ) do etc..!
<Sicp>
reading it doesn't depend on anything else, it's just that when you see it, do this. the stack doesn't need to have anything inside for it to be able to read that char, it's just plain old reading!
tylersmith has quit [Ping timeout: 260 seconds]
daniel_- has joined #ruby
niklasb has joined #ruby
<Sicp>
been at this since thursday dudes!
timonv has quit [Remote host closed the connection]
sayan has quit [Ping timeout: 252 seconds]
zeeraw has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
hamed_r has joined #ruby
mockra has joined #ruby
nlv has quit [Remote host closed the connection]
<artofraw>
so apeiros about before (object_id), you mean that object_ids are garbage-collected when their objects are garbage_collected too?
arya has quit [Ping timeout: 248 seconds]
mockra_ has quit [Ping timeout: 264 seconds]
arya has joined #ruby
<artofraw>
so it could happen that in a system that runs for long-periods, an object_id in a certain time could point to an object different than it was pointing let's say 2 days ago?
moos3 has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
akashj87_ is now known as akashj87
<MrZYX>
Sicp: you're running into a situation you don't expect, try adding an else everywhere
Sicp has quit [Ping timeout: 246 seconds]
matchaw has quit [Remote host closed the connection]
Rumsteak has quit [Quit: Rumsteak]
mboers has quit [Quit: mboers]
lyanchih has quit [Quit: lyanchih]
mercwithamouth has quit [Ping timeout: 248 seconds]
akashj87_ has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
nomenkun has joined #ruby
akashj87 has quit [Ping timeout: 276 seconds]
nomenkun has quit [Remote host closed the connection]
ctp has joined #ruby
grobb has joined #ruby
kofno has joined #ruby
dangerousdave has joined #ruby
LennyLinux has quit [Remote host closed the connection]
grobb has quit [Client Quit]
shellox has joined #ruby
<shellox>
hi
monkegjinni has quit [Remote host closed the connection]
mockra_ has joined #ruby
ananthakumaran has joined #ruby
<shellox>
I use ruby 2.0 on OS X mountain lion and can't load the atom gem
ananthakumaran1 has quit [Ping timeout: 256 seconds]
<shellox>
SyntaxError: /Users/pb/.rvm/gems/ruby-2.0.0-p0/gems/atom-0.3/lib/atom.rb:41: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n'
<Sicp>
this is supposed to run as a sequence, according to a grammar rule, it does not accept stuff in random order or separately; you cannot start with an 'a' for example
justsee has quit [Remote host closed the connection]
<MrZYX>
using your sample input
tylersmith has joined #ruby
<MrZYX>
I don't even pretend to have tried to understand the grammar
moos3 has quit [Quit: Computer has gone to sleep.]
<Sicp>
ok
<Sicp>
dude, you're right
Neomex has joined #ruby
Neomex has quit [Client Quit]
alexwh has joined #ruby
monkegjinni has joined #ruby
<Sicp>
man..
banisterfiend has quit [Remote host closed the connection]
tylersmith has quit [Ping timeout: 256 seconds]
Xeago has quit [Read error: Connection reset by peer]
<krainboltgreene>
Sicp: Just a comment, but you could use a lot more composition objects in that source.
crazymykl has quit [Quit: Konversation terminated!]
ebouchut has quit [Quit: This computer has gone to sleep]
<krainboltgreene>
Sicp: Turn those if/else blocks into objects that take data, make choices and return data. I bet you'll find some code reusability.
freeayu has quit [Ping timeout: 240 seconds]
<krainboltgreene>
Sicp: Also, some of these methods take arguments, but don't use them.
<krainboltgreene>
Sicp: Like calculate_state
pskosinski has joined #ruby
<Sicp>
it's using parsing_stack
<Sicp>
I thought I refer to it by "parsing_stack" and then inside I say @parsing_stack..right?
<krainboltgreene>
Sicp: The code I'm looking at only uses @parsing_stack.
<krainboltgreene>
No.
<Sicp>
I'm not even working on the same object am I
eka has joined #ruby
<Sicp>
oh..
<krainboltgreene>
parsing_stack is a local variable, @parsing_stack is an instance variable.
havenwood has quit [Ping timeout: 256 seconds]
crazymykl has joined #ruby
timonv has joined #ruby
freeayu has joined #ruby
<krainboltgreene>
Sicp: I heavily suggest spending time breaking your code into smaller, more manageable, easier to test pieces.
<Sicp>
yea I wrote this in one go
<Sicp>
cause the parsing table is infront of me, if you abide by it, all the strings generated from the grammar will parse
<Sicp>
so it seemed really repetitive and simple, but long and apparently complicated
hamed_r has quit [Quit: Leaving]
postmodern has quit [Quit: Leaving]
<Sicp>
ok, so here's the problem, it's just like I suspected at the beginning..it isn't sticking around the input long enough to do all of the steps required for that input
<Sicp>
some input goes through 3 steps before being pushed into the stack and considered "read"
<Sicp>
like the )
mockra_ has joined #ruby
<Sicp>
first time it comes up against one of those input, it fails to continue correctly because it just kept moving to the next char in the input, as is expected from my input.each_char loop
osvico has joined #ruby
<Sicp>
so how do I control the reading
<MrZYX>
maybe you need retry ?
<Sicp>
it's a keyword like continue and next?
<MrZYX>
let me double check, but iirc
<krainboltgreene>
Sicp: I especially suggest breaking this up, if you've got issues you can't figure out.
_jgr has joined #ruby
<krainboltgreene>
No, retry is for a begin/rescue block.
eka has quit [Quit: Computer has gone to sleep.]
crazymykl has quit [Quit: Konversation terminated!]
<krainboltgreene>
Basically, redo the begin portion.
<Sicp>
that's it, the problem is that one; I know it..I suspected it in the beginning but now it's clearer
mockra has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
<MrZYX>
ah, it was redo, right
<Sicp>
I need to say when it can move onto the next input, like Java's reader.next()
<krainboltgreene>
You're probably not going to be able to solve this by slapping more in there.
<krainboltgreene>
Write tests.
<Sicp>
I tried before to set the currently-being-read character inside the loop, but that's just going to read it again
<Sicp>
it isn't the issue, krainboltgreene; the issue is that the reading is not stopping (as is natural), I just want to say when it can read and move on and when it ought to read the same char again
<krainboltgreene>
OK.
<esaym153>
On a linux server I installed all the ruby rails gems but nothing is executable from the command line (ie. typing rake or rails). Is there anything else I need to do? Add a path to my shell?
<Sicp>
Enumerator has .next
<Sicp>
cool
<MrZYX>
Sicp: Don't use .each then, use Enumerator#next #peek, #rewind
<MrZYX>
Sicp: .each_char without a block should return an Enumerator
mockra_ has quit [Ping timeout: 276 seconds]
<Sicp>
it did
<Sicp>
pretty smrt
_veer has joined #ruby
_veer has joined #ruby
poga has joined #ruby
arya has joined #ruby
<Sicp>
but what I'm thinking of is that it will still be iterating automatically over the input when I get in a loop
user_ is now known as skaby
tomkad has quit [Quit: Leaving]
<Sicp>
whatever the loop is, it's going to start off with input.next, and that will be bound by the condition above it (whether the stack is empty yet or not; or over the length of the string...)
bluOxigen has quit [Ping timeout: 246 seconds]
<Sicp>
ah nevermind
<MrZYX>
that's why I mentioned #peek and #rewind
<MrZYX>
both can solve that
<MrZYX>
eh wait, forget #rewind
nomenkun has quit [Ping timeout: 248 seconds]
<Sicp>
I dont have to be looping, the cases where I call .next will alone finish the input
mixel has quit [Quit: mixel]
threesome has joined #ruby
SeptimusSeptum has joined #ruby
LennyLinux has quit [Remote host closed the connection]
undersc0re97 has quit [Quit: WeeChat 0.4.0]
mixel has joined #ruby
<nfk>
canton7, i now understand what that code does but i'm not quite sure what you wanted to tell me with it
undersc0re97 has joined #ruby
<canton7>
nfk, I'm demonstrating that it's not just method that take a &block argument, and how brackets are important for that reason
<canton7>
that's all
poga has quit [Remote host closed the connection]
falood has joined #ruby
mahlon has joined #ruby
machuga is now known as machuga|away
poga has joined #ruby
LennyLinux has joined #ruby
LennyLinux has quit [Remote host closed the connection]
emergion has quit [Quit: Computer has gone to sleep.]
gasbakid_ has joined #ruby
falood has quit [Remote host closed the connection]
banisterfiend has joined #ruby
chandankumar has quit [Excess Flood]
gasbakid has quit [Ping timeout: 256 seconds]
chandankumar has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
AndChat| has joined #ruby
banisterfiend has joined #ruby
<Sicp>
ok, now all I need is something that will prompt Ruby to bring me back to the beginning case statement whenever the input changes (whenever I set the char to be string.next)
<Sicp>
redo's and retry's are coming up invalid here
<Sicp>
it should be next
Banistergalaxy has quit [Ping timeout: 256 seconds]
bluOxigen has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
yshh_ has quit [Remote host closed the connection]
tylersmith has quit [Ping timeout: 256 seconds]
monkegjinni has quit [Remote host closed the connection]
r0bglees0n has joined #ruby
bjeanes has joined #ruby
yshh has joined #ruby
akashj87_ has joined #ruby
chandankumar has joined #ruby
akashj87_ has quit [Read error: Connection reset by peer]
Morrolan has joined #ruby
akashj87__ has quit [Ping timeout: 256 seconds]
lyanchih has joined #ruby
gyre007 has joined #ruby
sailias has quit [Quit: Leaving.]
tk_ has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
kidoz has quit [Quit: Ухожу я от вас]
Xeago has joined #ruby
workmad3 has joined #ruby
picca_ has joined #ruby
picca_ has quit [Client Quit]
iamjarvo has quit [Quit: Leaving.]
bradhe has joined #ruby
chandankumar has quit [Read error: Connection reset by peer]
jbpros has quit [Quit: jbpros]
mercwithamouth has quit [Ping timeout: 248 seconds]
poga has quit [Remote host closed the connection]
gyre008 has joined #ruby
gyre008 has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
bradhe has quit [Ping timeout: 256 seconds]
BSaboia has joined #ruby
gyre007 has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
gyre007 has joined #ruby
<Sicp>
MrZYX, thanks, it's done
s3m73x has quit [Read error: Connection reset by peer]
gasbakid_ has joined #ruby
<Sicp>
know what it turned out to be? after the issue with controlled reading? the "unless @parsing_stack[-1] == some_char @parsing_stack.pop" was not doing what it's supposed to do
Davey has joined #ruby
<Sicp>
I had to use "@parsing_stack.pop until @parsing_stack[-1] == some_char"
gasbakid has quit [Ping timeout: 245 seconds]
mockra has joined #ruby
mockra_ has quit [Ping timeout: 260 seconds]
CaptainKnots has quit [Quit: bazinga!]
codecop has quit [Remote host closed the connection]
dagnachew has quit [Read error: Connection reset by peer]
piatek has joined #ruby
bluOxigen has quit [Ping timeout: 264 seconds]
eykosioux has joined #ruby
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
mockra_ has joined #ruby
falood has quit [Remote host closed the connection]
Kricir has joined #ruby
yacks has quit [Ping timeout: 264 seconds]
megha has joined #ruby
icecandy has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 276 seconds]
havenwood has joined #ruby
yangchenyun has left #ruby [#ruby]
tylersmith has joined #ruby
Neomex has joined #ruby
tylersmith has quit [Ping timeout: 256 seconds]
falood has joined #ruby
cj3kim has joined #ruby
subbyyy has joined #ruby
yacks has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
_veer has joined #ruby
_veer has quit [Changing host]
_veer has joined #ruby
teddyp1cker has joined #ruby
agjacome has joined #ruby
Cultofmetatron has joined #ruby
cj3kim has quit [Ping timeout: 252 seconds]
arubin has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
Neomex has quit [Quit: Neomex]
decentrality has joined #ruby
Neomex has joined #ruby
johnrlive has joined #ruby
Neomex has quit [Client Quit]
alexmreis has joined #ruby
teddyp1cker has left #ruby ["Konversation terminated!"]
axeman- has joined #ruby
Hanmac1 has joined #ruby
mockra has joined #ruby
piatek has quit []
mockra_ has quit [Ping timeout: 256 seconds]
Hanmac has quit [Ping timeout: 276 seconds]
havenwood has quit [Read error: Connection reset by peer]
kiri has quit [Ping timeout: 264 seconds]
havenwood has joined #ruby
falood has quit [Remote host closed the connection]
kiri has joined #ruby
cpruitt_ has joined #ruby
brunoro has joined #ruby
arya has quit [Ping timeout: 260 seconds]
Hanmac1 has quit [Ping timeout: 248 seconds]
Hanmac has joined #ruby
cpruitt has quit [Ping timeout: 246 seconds]
cpruitt_ is now known as cpruitt
dangerousdave has quit [Quit: Leaving...]
ariedler has joined #ruby
axeman- has quit [Remote host closed the connection]
browndawg1 has joined #ruby
tbrock has joined #ruby
<tbrock>
hey guys, what is the best way to create methods in a parent class that access constants or class instance variables on subclasses
arya has joined #ruby
browndawg has quit [Ping timeout: 245 seconds]
<tbrock>
this always seems to be a problem for me
<MrZYX>
self.class::CONSTANT
sjhuang has left #ruby [#ruby]
<tbrock>
is that typically done?
lyanchih has quit [Quit: lyanchih]
<MrZYX>
never had the need or saw code that had the need, just know it should work that way
daniel_- has joined #ruby
alexmreis has quit [Quit: Leaving.]
showtime has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tbrock>
MrZYX basically what I'm looking to do is define an attribute for the class
Opettaja has joined #ruby
<tbrock>
then have it be accessible both by instances of the class, as well as class methods
<banisterfiend>
tbrock: use @@var
<tbrock>
awful right?
<tbrock>
its a constant though
alexmreis has joined #ruby
<MrZYX>
I also often see that often done through methods
<MrZYX>
eh, - one often
<tbrock>
def attr_whatever; value; end?
<MrZYX>
yeah
<tbrock>
ugh
<tbrock>
lamesauce
<tbrock>
ok
<MrZYX>
allows to provide a default value in the base and only override in the child as needed
<tbrock>
@@var is verboten, id rather do class instance variables
umren has joined #ruby
<tbrock>
I'm not so much concerned about default values
bakingbread has quit [Remote host closed the connection]
<tbrock>
just that all children have a constant attribute that needs to be accessible
johnrlive has quit [Remote host closed the connection]
jcromartie has quit [Quit: Computer has gone to sleep.]
<waxjar>
sounds like you need to think your API over tbrock
mercwithamouth has quit [Ping timeout: 252 seconds]
kil0byte has joined #ruby
<tbrock>
lets say you are creating an odm for instance
<tbrock>
there would be a model base class that all the other models extend
<tbrock>
you need class methods to find and create instances of that model from a database table, lets say users
<tbrock>
and you need to have instances know where to save themselves, also in that table, users
bakingbread has joined #ruby
bakingbread has quit [Changing host]
bakingbread has joined #ruby
<tbrock>
where would you set the attribute describing the table in Users < Model::Base?
blacktulip has joined #ruby
<tbrock>
or how rather
<tbrock>
my inclination is to say class User; TABLE='users'; end
<tbrock>
we are, of course, not using inflection here'
<waxjar>
the attribute is the name of the table?
<tbrock>
yeah
<MrZYX>
I think AR does this through an attribute accessor on the singleton class, i.e. class User < ActiveRecord::Base; self.table_name = 'users'; end
arya has quit [Ping timeout: 248 seconds]
alexmreis has quit [Quit: Leaving.]
<MrZYX>
so a class variable effectively
arya has joined #ruby
<tbrock>
i see
<tbrock>
self.tablename in that context is a class variable or class instance variable?
workmad3 has quit [Ping timeout: 246 seconds]
mockra has quit [Remote host closed the connection]
arya__ has joined #ruby
gr4yscale has quit [Quit: Computer has gone to sleep.]
sayan has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
dustint has joined #ruby
BizarreCake has quit [Ping timeout: 245 seconds]
end_guy has joined #ruby
sayan_ is now known as sayan
nightfly has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
Emmanuel_Chanel has joined #ruby
kofno has quit [Ping timeout: 256 seconds]
eldariof has quit []
havenwood has joined #ruby
`p has quit [Ping timeout: 256 seconds]
lethjakm1 has joined #ruby
Dummies_freelanc has joined #ruby
dustint has quit [Ping timeout: 240 seconds]
sayan has quit [Read error: Connection reset by peer]
<lethjakm1>
hey, is there any way in ruby hashes to not specify a key and have it go to the first unused number?
eldariof has joined #ruby
jgrevich has joined #ruby
<lethjakm1>
like with php's unassociative arrays?
<lethjakm1>
er
<catphish>
lol
<lethjakm1>
associative
<lethjakm1>
need more coffee
<catphish>
that's almost an array
tommyvyo has joined #ruby
<lethjakm1>
catphish: it pretty much is. PHP combined the two.
nathancahill has quit [Read error: Connection reset by peer]
<lethjakm1>
but php's arrays suck too...
<catphish>
so you want an array with holes in?
<catphish>
where you can fill the holes?
<lethjakm1>
umm, actually I just want to be able to add children to a hash and not have to specify which number it is. what I previously did is make a hash with a [:children] element that points to an array of hashes.
<catphish>
you could just use an array, set items in the array to nil when you want to delete them
<MrZYX>
you might want to read the surrounding explanations of the whole system...
mikepack has quit [Remote host closed the connection]
grobb has joined #ruby
<havenwood>
mr_mustard: What are you trying to do?
peteyg has joined #ruby
<havenwood>
mr_mustard: You've got an #on_save class method as well as instance method. Do you intend to call `Persist.on_save` as well as `Persist.new.on_save`? I'm confused by the code.
agarie has joined #ruby
joshcheek has joined #ruby
<zastaph>
havenwood, didnt even know ST3 was out
<zastaph>
havenwood, ubuntu
<havenwood>
zastaph: I think it is in alpha, bout to be beta. I use TM2 or vim, but ST seems nice.
zeeraw has joined #ruby
<havenwood>
zastaph: Only thing I've used on Ubuntu was gedit + gmate, which was nice but didn't really have the polish of TM or ST.
<zastaph>
havenwood, dont think they did as SublimeCodeIntel is a third party plugin
joshcheek has quit [Read error: Connection reset by peer]
<mr_mustard>
havenwood: I'd like to be able to set listeners using both a class definition or an individual instance
joshcheek has joined #ruby
<mr_mustard>
but the on_save call inside the Persist definition is cleaner with "on_save { aux }" instead of "on_save { |o| o.aux }"
<shmoon>
MrZYX: when you say there's a way to give the process abiliy, is it something like a program owned by root that does some chroot() call with setuid bits set, so when executed by normal users with`x` rights on the file will cause the file to execute with privileges of root ?
browndawg has quit [Quit: Leaving.]
CaptainKnots has quit [Quit: bazinga!]
Cultofme_ has quit [Ping timeout: 256 seconds]
devoldmx3 has joined #ruby
<MrZYX>
the setuid flag works by changing the uid the process is running under. Capabilities allow to use certain syscalls regardless of the user
tomzx_mac has joined #ruby
CaptainKnots has joined #ruby
BSaboia has quit [Remote host closed the connection]
Cultofmetatron has joined #ruby
devoldmx has quit [Ping timeout: 256 seconds]
nettoweb has joined #ruby
pinpin404 has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 240 seconds]
mikepack has joined #ruby
nettoweb has quit [Client Quit]
eldariof has joined #ruby
pinpin404 has joined #ruby
nezumi has joined #ruby
eykosioux has quit [Remote host closed the connection]
eykosioux has joined #ruby
Emmanuel_Chanel_ has joined #ruby
breakingthings has joined #ruby
hogeo_ has joined #ruby
slash_nick has quit [Ping timeout: 248 seconds]
hogeo has quit [Ping timeout: 248 seconds]
Emmanuel_Chanel has quit [Ping timeout: 276 seconds]
eykosioux has quit [Ping timeout: 256 seconds]
codecop has joined #ruby
tylersmith has joined #ruby
eykosioux has joined #ruby
lethjakman has quit [Ping timeout: 252 seconds]
mr_mustard has quit [Remote host closed the connection]
chandankumar has quit [Quit: Leaving]
Emmanuel_Chanel_ is now known as Emmanuel_Chanel
daniel_- has quit [Ping timeout: 264 seconds]
dmiller has joined #ruby
seanwash has joined #ruby
devoldmx has joined #ruby
ikea_meatballs has joined #ruby
seanwash has quit [Client Quit]
apeiros_ has joined #ruby
devoldmx3 has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 245 seconds]
JZTech101 has joined #ruby
mikepack has quit [Remote host closed the connection]
sailias has joined #ruby
alexgordon has joined #ruby
<zastaph>
how do I avoid "unable to convert "\x88" FROM ASCII-8BIT to UTF-8 when installing gems for ruby 2.0.0p0 ?
<zastaph>
it seems to be RDoc related
eykosioux has quit [Remote host closed the connection]
<MrZYX>
uhm, do you want the docs?
sailias has quit [Client Quit]
<zastaph>
gem install mygem installs ri documentation by default
cheese1756 has quit [Excess Flood]
eykosioux has joined #ruby
tjbiddle_ has joined #ruby
<MrZYX>
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc would be the quickest workaround if not I guess
<zastaph>
something just seems to be broken with ruby 2.0 and RDoc 4
<MrZYX>
else the usual game, ensure the system locale is correct, Encoding.default_external/internal reports the right thing
<zastaph>
yes i've read many posts about people with the same problem, and its related to ruby 2.0 and RDoc 4
<MrZYX>
I'd just ignore it I guess :P
tjbiddle has quit [Ping timeout: 256 seconds]
tjbiddle_ is now known as tjbiddle
<r0bglees0n>
zastaph: do you use ri docs?
cheese1756 has joined #ruby
cooldman224 has quit [Remote host closed the connection]
<zastaph>
didn't use them yet.. but i also get some issues with my own ruby code, it just seems to prefer ASCII-8BIT, even when I have # encoding: UTF-8 in my files, though I know that's file encoding not string encoding
eykosioux has quit [Ping timeout: 256 seconds]
<zastaph>
it seems to me that ruby encoding handling changed around 1.9.3, and 2.0 is supposed to be 1.9.3 compatible, but well.. it gets weird with encodings when using older gems
<MrZYX>
yes, the fallback default changed from ascii to utf8
mocfive has joined #ruby
yacks has joined #ruby
mocfive has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
joshcheek has quit [Quit: joshcheek]
mad_hatter_ has quit [Quit: Leaving.]
bhaak has quit [Read error: Operation timed out]
kiwnix has quit [Quit: Leaving]
larissa has joined #ruby
[[thufir]] has quit [Quit: Leaving.]
bradhe has joined #ruby
mockra has joined #ruby
mockra has quit [Remote host closed the connection]
prk has joined #ruby
adambeynon has joined #ruby
pinpin404 has quit [Ping timeout: 256 seconds]
bhaak has joined #ruby
pinage404 has joined #ruby
crazysim has quit [Ping timeout: 256 seconds]
L8D has joined #ruby
Bauer1 has joined #ruby
eykosioux has joined #ruby
Michael_ has quit [Read error: Connection reset by peer]
Michael_ has joined #ruby
maetthew has joined #ruby
Bauer has quit [Ping timeout: 256 seconds]
johnkary has quit [Quit: @johnkary]
mixel has quit [Quit: mixel]
arya has quit [Ping timeout: 246 seconds]
eykosioux has quit [Remote host closed the connection]
daniel_- has joined #ruby
eykosioux has joined #ruby
bluOxigen has joined #ruby
FunkySayu has quit [Ping timeout: 246 seconds]
ColKurtz has joined #ruby
tomkad has joined #ruby
FunkySayu has joined #ruby
arya has joined #ruby
Michael_ has quit [Remote host closed the connection]
tylersmith has quit [Remote host closed the connection]
rhys has joined #ruby
Michael_ has joined #ruby
blueOxigen has joined #ruby
BonSequitur has joined #ruby
[[thufir]] has joined #ruby
bluOxigen has quit [Ping timeout: 245 seconds]
Hanmac1 has joined #ruby
m8 has quit [Read error: Connection reset by peer]
reisl has joined #ruby
cj3kim has quit [Remote host closed the connection]
ColKurtz has quit [Quit: sleeping]
cj3kim has joined #ruby
Hanmac has quit [Ping timeout: 256 seconds]
cj3kim has quit [Remote host closed the connection]
johnrlive has quit [Remote host closed the connection]
Rumsteak has joined #ruby
apeiros_ has quit [Ping timeout: 264 seconds]
tommyvyo has quit [Quit:]
jroes has joined #ruby
TomRone has quit [Ping timeout: 246 seconds]
greenarrow|2 has joined #ruby
cj3kim has joined #ruby
curtis has quit [Remote host closed the connection]
greenarrow has quit [Ping timeout: 264 seconds]
thesheff17_ has quit [Quit: Leaving]
iamjarvo1 has joined #ruby
<jroes>
hey guys, not sure if anyone has used the fftw3 gem on ruby 2, was curious if I'm doing something wrong. getting an error "cannot load file fftw3/fftw3" when I require 'fftw3' in my code
<jroes>
it's a native extension, maybe something went wrong during the installation process? I'm not sure exactly how to check
iamjarvo1 has quit [Client Quit]
blueOxigen has quit [Ping timeout: 252 seconds]
apeiros has joined #ruby
mduvall has joined #ruby
mduvall has quit [Client Quit]
mduvall has joined #ruby
TomRone has joined #ruby
bluOxigen has joined #ruby
rakl has joined #ruby
rippa has joined #ruby
prk has quit [Ping timeout: 256 seconds]
apeiros has quit [Ping timeout: 245 seconds]
larissa has quit [Remote host closed the connection]
reisl has quit [Remote host closed the connection]
workmad3 has joined #ruby
crazymykl has joined #ruby
mixel has joined #ruby
thesheff17 has quit [Ping timeout: 246 seconds]
end_guy has quit [Remote host closed the connection]
Cultofmetatron has quit [Ping timeout: 256 seconds]
larissa has joined #ruby
computer has joined #ruby
mockra has joined #ruby
eliasp has quit [Read error: Operation timed out]
choobie has quit [Quit: choobie]
nezumi has quit [Ping timeout: 248 seconds]
bolD_ has joined #ruby
<bolD_>
ïðèâåò
<computer>
Hi, I'm reading through the minitest gem, and there's one bit of code I don't understand. In the infect_an_assertion function, what is the use of the "current" method do? -- Here is infect_and_assertion https://github.com/seattlerb/minitest/blob/master/lib/minitest/spec.rb#L6 -- And current is defined on line 84 (it just calls Thread.current).
<pencil1>
Like most of the newbies I am stuck how to practise/learn ruby, can someone please suggest a project to practise ruby?
<Spami>
guys, when I do: which thin i get => /var/lib/gems/1.8/bin//thin
vi-config has quit [Quit: This computer has gone to sleep]
<Spami>
but when I try to do gem uninstall thin, it says that i do have thin installed on my system
<Spami>
any idea ?
<MrZYX>
pencil1: do you have something you every day?
<MrZYX>
*you do
<MrZYX>
Spami: multiple rubies installed?
<Spami>
yes
<Spami>
first 1.8.x and now 1.9.x
<MrZYX>
then I guess your gem hits another ruby than the 1.8 one
<chee>
Spami: that's a great idea.
<pencil1>
MrZYX: nope :(
ColKurtz has joined #ruby
<chee>
a great question
<Spami>
chee, mind to explain ?
<chee>
oh sorry
<chee>
wrong user
<pencil1>
MrZYX: I find the need to program ocassinally
<chee>
i meant to highlight MrZYX
<havenwood>
Spami: I like chruby for easily setting environment variables to point at the Ruby you'd like to use: https://github.com/postmodern/chruby
<chee>
Spami: i am sorry, i am sure you are worthwhile too
<mikef>
i have a ruby app served by nginx + passenger, i'd like to set the access-control-allow-origin headers , where do i do this? in nginx or in some ruby file?
withnale has quit [Read error: Connection reset by peer]
<chee>
MrZYX: that's a great way of coming up with a first project in a language
mityaz has quit [Quit: See ya!]
echevemaster has joined #ruby
echevemaster has quit [Changing host]
echevemaster has joined #ruby
<MrZYX>
yep, solving personal problems is the best motivator
TomRone has quit [Ping timeout: 256 seconds]
mockra has joined #ruby
apeiros_ has joined #ruby
<havenwood>
Spami: Or to set a bunch of shims there is rbenv, if you don't want to go the environment variable route.
<Spami>
havenwood, I actually installer ruby first with aptitude install, and after I switched to dvm, but now I guess my env I kind of messed up
apeiros has quit [Read error: Connection reset by peer]
<MrZYX>
did you install rvm as root?
<Spami>
yes
<havenwood>
What is the apt-get version selector tool again?
mockra has quit [Remote host closed the connection]
<MrZYX>
that's where your problems come from then
<Spami>
fuck
lethjakman has joined #ruby
<Spami>
MrZYX, should I remove everything and restart with a clean install ?
<MrZYX>
yup
<havenwood>
Spami: Ah, RVM. Be sure to install RVM via the script on RVM's page rather than using the apt-get package!
apeiros_ has quit [Read error: Connection reset by peer]
blacktulip has quit [Ping timeout: 240 seconds]
<Spami>
havenwood, i know :( I was going to fast
withnale has joined #ruby
apeiros has joined #ruby
atno has quit [Ping timeout: 260 seconds]
DanKnox_away is now known as DanKnox
blacktulip has joined #ruby
TomRone has joined #ruby
nezumi has joined #ruby
apeiros_ has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
eldariof has quit [Ping timeout: 248 seconds]
emmanuelux has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Remote host closed the connection]
ebouchut has quit [Quit: This computer has gone to sleep]
infecto has joined #ruby
bradhe has joined #ruby
tylersmith has joined #ruby
<pencil1>
gentle bounce
timonv has quit [Remote host closed the connection]
C0deMaver1ck has quit [Remote host closed the connection]
C0deMaver1ck has joined #ruby
C0deMaver1ck is now known as Guest67597
<computer>
MrZYX: thanks. I haven't learned about threads yet so I don't really understand what's happening in there.
<MrZYX>
then just interpret it as a normal hash or key-value store in this specific case
bradhe_ has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
apeiros_ has quit [Read error: Connection reset by peer]
pinage404 has quit [Ping timeout: 246 seconds]
ebouchut has joined #ruby
ebouchut has quit [Client Quit]
backjlack has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
backjlack has quit [Remote host closed the connection]
speakingcode has quit [Ping timeout: 264 seconds]
backjlack has joined #ruby
greenarrow|2 is now known as greenarrow
Squarepy has joined #ruby
pinage404 has joined #ruby
<canton7>
infecto, why recursively?
Xeago_ is now known as Xeago
<infecto>
hmm I was just running through some exercises to improve my ruby knowledge
speakingcode has joined #ruby
<infecto>
my biggest question was is there a better way to account going up and down depending on if start_num is > or <
<canton7>
ah fair enough. not something I'd recommend in practice
<infecto>
oh yeah of course
<canton7>
you could go from min(start, end) to max(start, end)
<canton7>
then reverse at the end if necessary... stinks a bit though
<canton7>
also, I'd use #concat rather than +=
<infecto>
why concat?
<canton7>
as it modifies the object, rather than throwing it away and creating a new one
<infecto>
ahhhh ok
<infecto>
that makes sense, thanks!
<canton7>
(same with strings and + vs <<, although most of the time you use interpolation and it's not an issue)
<waxjar>
why dont you just return from the if clauses infecto? nums will always be an empty Array, right?
chrishunt has quit [Quit: ZzZzZz...]
<canton7>
there's that, as well :P
<infecto>
hmmm true i should that, good point
<infecto>
ty
grobb has quit [Read error: Connection timed out]
chrishunt has joined #ruby
ericmathison has joined #ruby
mduvall has quit [Quit: mduvall]
speakingcode has quit [Ping timeout: 248 seconds]
grobb has joined #ruby
speakingcode has joined #ruby
mduvall has joined #ruby
tomkad has quit [Quit: Leaving]
pencil1 has left #ruby [#ruby]
ericmath1son has joined #ruby
atno__ has joined #ruby
nkts has quit [Read error: Connection reset by peer]
nkts has joined #ruby
thesheff17 has joined #ruby
vi-config has joined #ruby
havenwood has quit [Remote host closed the connection]
lkba has joined #ruby
atno has quit [Ping timeout: 260 seconds]
havenwood has joined #ruby
devoldmx3 has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
daniel_- has quit [Ping timeout: 245 seconds]
geggam has quit [Ping timeout: 240 seconds]
devoldmx has quit [Ping timeout: 256 seconds]
havenwood has quit [Ping timeout: 256 seconds]
grobb has quit [Quit: grobb]
<computer>
MrZYX: what I don't understand is, infect_an_assertion takes "new_name" and defines it in terms of "meth". Say, "assert_equal". What's the reason they didn't just call "meth" through Minitest::Assertions where it's defined? something like "when Proc === self then; Minitest::Assertions.#{meth}(*args, &self)"
ggordan has joined #ruby
<computer>
I'm trying to play with the minitest code on my machine, but I can't get it to work. The gem tutorials I read say run "gem build", but there's no .gemspec for minitest... I trued running the tests directly "ruby test_name.rb" and it won't run either.
ericmathison has quit [Quit: leaving]
ericmath1son has quit [Quit: leaving]
ericmathison has joined #ruby
prk has joined #ruby
<MrZYX>
try ruby -Ilib where lib is the path to minitests lib directory
Hanmac has joined #ruby
Hanmac1 has quit [Ping timeout: 245 seconds]
<computer>
MrZYX: I just get a blinking cursor.
<MrZYX>
well instead of just plain "ruby"
rakl has quit [Quit: sleeping]
<MrZYX>
so test_name.rb or whatever thereafter
umren has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
eliasp has joined #ruby
havenwood has joined #ruby
<computer>
MrZYX :( nope, can't get anything to run. I cloned the minitest repo from github and I'm in the directory, but I can't figure out how to run the tests or make the code run.
thesheff17 has quit [Ping timeout: 252 seconds]
<MrZYX>
did you try a simple `rake`?
phipes has joined #ruby
<computer>
first thing I did. I get "rake aborted! cannot find such file -- hoe ..."
rhys has quit [Quit: Leaving]
<MrZYX>
gem install hoe
devoldmx has joined #ruby
Michael_ has quit [Remote host closed the connection]
brian_000_ has quit [Quit: Leaving]
lewix has quit [Remote host closed the connection]
<computer>
derp I'm an idiot. Ok, so the tests are running now. thnx
bradhe has quit [Remote host closed the connection]
chrishunt has quit [Quit: ZzZzZz...]
pskosinski has quit [Ping timeout: 240 seconds]
phipes has quit [Quit: phipes]
prk has quit [Read error: Connection reset by peer]
cofin has joined #ruby
akells` has joined #ruby
havenwood has joined #ruby
m8 has quit [Quit: Sto andando via]
lewix has joined #ruby
<Spami>
So I did a new install with rvm but now when I try to do gem install blabla i get: "bash: gem: command not found" should just run "aptitude install libgemplugin-ruby" ?
codecop has quit [Remote host closed the connection]
tbrock has quit [Ping timeout: 256 seconds]
nkts has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
bradhe has quit [Remote host closed the connection]
nkts has joined #ruby
<havenwood>
Spami: What do you get for?: rvm current
Cache_Money has quit [Ping timeout: 248 seconds]
<Spami>
havenwood, system
blacktulip has quit [Remote host closed the connection]
<havenwood>
Spami: You already installed a Ruby with RVM?
<Spami>
yes
<Spami>
havenwood, i did: rvm install ruby-head
<havenwood>
Spami: So now set a default: rvm use --default ruby
<havenwood>
Spami: So now set a default: rvm use --default ruby-head
lewix has quit [Ping timeout: 245 seconds]
<havenwood>
Spami: And confirm your selection by checking: rvm current
<Spami>
got damn it
<MrZYX>
uh ruby-head as default.... living on the bleeding edge
<Spami>
i still get system
<havenwood>
Spami: rvm use ruby-head
<havenwood>
Spami: Then check: rvm current
computer has quit [Quit: Leaving]
<Spami>
yes
<Spami>
working
<Spami>
thanks
akells` has quit [Ping timeout: 264 seconds]
monkegjinni has joined #ruby
jonathanwallace1 has joined #ruby
spider-mario has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
mad_hatter_ has quit [Quit: Leaving.]
suporte85 has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 256 seconds]
Opettaja has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
mogsy has quit [Ping timeout: 264 seconds]
mogsy has joined #ruby
lewix has joined #ruby
eykosioux has quit [Remote host closed the connection]
eykosioux has joined #ruby
mneorr_ has quit [Ping timeout: 256 seconds]
nicoulaj has quit [Remote host closed the connection]
katsrc has joined #ruby
JZTech101 has quit [Ping timeout: 256 seconds]
ColKurtz has quit [Quit: sleeping]
noname001 has quit [Remote host closed the connection]
decentrality has quit [Quit: decentrality]
eykosioux has quit [Ping timeout: 256 seconds]
eliasp has quit [Remote host closed the connection]
duply has quit [Read error: Connection reset by peer]
phipes has joined #ruby
suporte85 has joined #ruby
bradhe has joined #ruby
bigkm has joined #ruby
Banistergalaxy has joined #ruby
JZTech101 has joined #ruby
pevjan has joined #ruby
teclator has quit [Read error: Operation timed out]
subbyyy has quit [Ping timeout: 256 seconds]
tylersmith has joined #ruby
[Neurotic]_ has joined #ruby
[Neurotic]_ is now known as [Neurotic]
TomHoss has joined #ruby
slash_nick has quit [Ping timeout: 252 seconds]
<Spami>
havenwood, another thing, So I go with gem install bundler, everything works and when I do bundle install I get: RROR: Gem bundler is not installed, run `gem install bundler` first.
tylersmith has quit [Ping timeout: 248 seconds]
daniel_- has quit [Ping timeout: 264 seconds]
decentrality has joined #ruby
gyre007 has quit [Ping timeout: 256 seconds]
nazty has quit [Read error: Connection reset by peer]
kristofers has quit []
LennyLinux has quit [Remote host closed the connection]
Rumsteak has quit [Quit: Rumsteak]
eykosioux has joined #ruby
dik_dak has joined #ruby
Rumsteak has joined #ruby
monkegjinni has quit [Remote host closed the connection]
zeeraw has quit [Ping timeout: 245 seconds]
bradhe has quit [Ping timeout: 245 seconds]
momomomomo has joined #ruby
<havenwood>
Spami: What do you get for?: echo $GEM_PATH; which bundle, which gem, rvm current
<Spami>
nothing
<Spami>
well not true: /usr/bin/which /home/bitcoinalerts/.rvm/bin/rvm
<Spami>
nothing else
nazty has joined #ruby
<havenwood>
Spami: Just check?: rvm current
tjbiddle has quit [Quit: tjbiddle]
<Spami>
ruby-head
<havenwood>
Spami: And? which gem?
mogsy has quit [Ping timeout: 276 seconds]
<havenwood>
**: which gem
<Spami>
/home/bitcoinalerts/.rvm/bin/gem
Michael_ has quit [Remote host closed the connection]
<havenwood>
Spami: which bundle
<Spami>
/home/bitcoinalerts/.rvm/bin/bundle
davetherat has quit [Remote host closed the connection]
mogsy has joined #ruby
KingMarc has joined #ruby
davetherat has joined #ruby
Michael_ has joined #ruby
pablo_ has joined #ruby
<havenwood>
Spami: Hrm, you might want to try #rvm. Maybe a gemset issue? Might try?: rvm all-gemsets do rvm gemset pristine
shammancer has quit [Ping timeout: 276 seconds]
KingMarc has quit [Client Quit]
postmodern has joined #ruby
<Spami>
havenwood, thanks. I just figured out that I had to do: /bin/bash --login
<Spami>
no idea why
Squarepy has joined #ruby
Michael_ has quit [Ping timeout: 248 seconds]
chipotle_ has quit [Quit: cya]
noname001 has joined #ruby
<Xeago>
Finally, got water again!
idkazuma has joined #ruby
bluOxigen has quit [Ping timeout: 240 seconds]
ColKurtz has joined #ruby
peta_ has quit [Quit: peta_]
bradhe has joined #ruby
bradhe has quit [Remote host closed the connection]
DrCode has quit [Remote host closed the connection]
chrishunt has joined #ruby
bradhe has joined #ruby
tylersmith has joined #ruby
d11wtq has quit [Ping timeout: 276 seconds]
robottinosino has quit [Ping timeout: 256 seconds]
idkazuma has quit [Remote host closed the connection]
DanKnox_away is now known as DanKnox
pierre1 has quit [Quit: Leaving]
akells` has joined #ruby
pierre1 has joined #ruby
airlok has joined #ruby
DrCode has joined #ruby
pierre1 has quit [Read error: Connection reset by peer]
pierre1 has joined #ruby
subbyyy has joined #ruby
mogsy has quit [Ping timeout: 276 seconds]
johnkary has joined #ruby
prk has joined #ruby
pinage404 has quit [Remote host closed the connection]
tockitj has quit [Ping timeout: 256 seconds]
dik_dak has quit []
arya has quit [Ping timeout: 264 seconds]
Michael_ has joined #ruby
bradhe has quit [Remote host closed the connection]
gstamp has joined #ruby
pevjan has quit [Remote host closed the connection]
tbrock has joined #ruby
threesome has quit [Read error: Operation timed out]
slainer68 has quit [Remote host closed the connection]
subbyyy has quit [Ping timeout: 264 seconds]
pierre1 has quit [Quit: Leaving]
tommyvyo has joined #ruby
pevjan has joined #ruby
showtime has joined #ruby
TomHoss has quit [Quit: TomHoss]
TomHoss has joined #ruby
Ontolog has joined #ruby
Matip has joined #ruby
Ontolog has left #ruby [#ruby]
slocate has joined #ruby
nari has joined #ruby
Mattix has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 256 seconds]
mboers has joined #ruby
guiocavalcanti has quit [Remote host closed the connection]
Cultofmetatron has joined #ruby
guiocavalcanti has joined #ruby
hogeo_ has quit [Remote host closed the connection]
Cultofme_ has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Ping timeout: 256 seconds]
cj3kim has quit [Remote host closed the connection]
eka has joined #ruby
TomHoss has left #ruby [#ruby]
Cultofme_ has joined #ruby
guiocavalcanti has quit [Ping timeout: 248 seconds]
Cultofmetatron has quit [Ping timeout: 248 seconds]
Squarepy has quit [Quit: Leaving]
Darlal has joined #ruby
predator217 has joined #ruby
phayte has joined #ruby
airlok has quit [Remote host closed the connection]
predator117 has quit [Ping timeout: 264 seconds]
fermion has quit [Quit: Computer has gone to sleep.]