<helpa>
Hi rubyquest. We in #ruby would really appreciate it if you did not use pastebin during your time with us.
<helpa>
Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
funburn has quit [Ping timeout: 250 seconds]
doodlehaus has quit [Ping timeout: 252 seconds]
<sevenseacat>
Radar: didnt think helpa was supposed to spit that stuff here
<Radar>
sevenseacat: According to apeiros it's A-OK
lordkryss has quit [Quit: Connection closed for inactivity]
pwnz0r has quit [Remote host closed the connection]
tubulife- has quit [Remote host closed the connection]
pwnz0r has joined #ruby
tubuliferous has joined #ruby
bronson has joined #ruby
zorak8 has quit [Read error: Connection reset by peer]
zorak8 has joined #ruby
delianides has joined #ruby
pwnz0r has quit [Ping timeout: 246 seconds]
oo_ has quit [Remote host closed the connection]
krz has quit [Quit: WeeChat 1.0.1]
delianides has quit [Read error: Connection reset by peer]
Musashi007 has joined #ruby
bronson has quit [Ping timeout: 246 seconds]
oo_ has joined #ruby
hvxgr has joined #ruby
martinbmadsen has joined #ruby
yourwebdevguy has quit [Ping timeout: 246 seconds]
<ProteusX>
awesomenuts assemble! + beer = happy me
jonr22 has joined #ruby
krz has joined #ruby
Spami has joined #ruby
justin_pdx has quit [Quit: justin_pdx]
justin_pdx has joined #ruby
iterator_ has joined #ruby
zapata has quit [Quit: leaving]
Channel6 has quit [Quit: Leaving]
jonr22 has quit [Ping timeout: 256 seconds]
iteratorP has quit [Ping timeout: 240 seconds]
doodlehaus has joined #ruby
sandelius has joined #ruby
iterator_ has quit [Ping timeout: 246 seconds]
milesmatthias has joined #ruby
doodlehaus has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
mostlybadfly has joined #ruby
Morkel has joined #ruby
Musashi007 has quit [Quit: Musashi007]
juanpaucar has joined #ruby
milesmatthias has quit [Ping timeout: 252 seconds]
coderhs has joined #ruby
juanpaucar has quit [Ping timeout: 244 seconds]
nii2361 has quit [Ping timeout: 255 seconds]
tobago has joined #ruby
coderhs has quit [Ping timeout: 250 seconds]
emocakes has joined #ruby
rorra has quit [Quit: rorra]
ramfjord has quit [Ping timeout: 256 seconds]
justin_pdx has quit [Quit: justin_pdx]
relix has joined #ruby
SOLDIERz_ has joined #ruby
jusmyth has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
coderhs has joined #ruby
tubuliferous has quit [Remote host closed the connection]
tubuliferous has joined #ruby
gkra has joined #ruby
NoNMaDDeN has joined #ruby
elaptics is now known as elaptics_away
digitalcake has joined #ruby
<shevy>
triangles2 don't think so; but you can use use .reject afterwards
NoNMaDDeN has quit [Ping timeout: 255 seconds]
TheRinger has quit [Quit: Konversation terminated!]
<digitalcake>
I was wondering if I'm using the apartment gem and have two AR models in to different schemes can I have a foreign keys with the two?
TheRinger has joined #ruby
Musashi007 has joined #ruby
tagrudev has joined #ruby
TheRinger has quit [Client Quit]
nii2361 has joined #ruby
apeiros_ has joined #ruby
psy_ has quit [Remote host closed the connection]
ptrrr has joined #ruby
<digitalcake>
looks like I cant from the way I'm trying. it would look as if I need to make sure it nows to look in the different scheme when looking for the other table.
Dakuan_ has joined #ruby
last_staff has joined #ruby
mike32 is now known as bobitto
<bobitto>
wow
lyuben_ has joined #ruby
bronson has joined #ruby
riotjon__ has quit [Quit: Leaving...]
hmnhf has quit [Ping timeout: 265 seconds]
tubuliferous_ has quit [Remote host closed the connection]
ghostpl_ has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
claptor has quit [Quit: this channel is bakas]
nii2361 has quit [Ping timeout: 264 seconds]
krz has quit [Quit: WeeChat 1.0.1]
apeiros_ has quit [Remote host closed the connection]
agrinb_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
Mia has quit [Write error: Connection reset by peer]
agrinb has joined #ruby
ghostpl_ has quit [Ping timeout: 245 seconds]
krz has joined #ruby
sameerynho has joined #ruby
codecop has joined #ruby
codecop_ has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dumdedum has joined #ruby
The_Phoenix has joined #ruby
apeiros_ has quit [Ping timeout: 250 seconds]
lxsameer has quit [Ping timeout: 252 seconds]
agrinb has quit [Ping timeout: 256 seconds]
relix has joined #ruby
Dakuan_ has quit [Remote host closed the connection]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
digitalcake has quit [Quit: Leaving.]
wldcordeiro has joined #ruby
ptrrr has quit [Quit: ptrrr]
hanmac1 has joined #ruby
Macaveli has joined #ruby
milesmatthias has joined #ruby
ki0 has joined #ruby
zorak8 has quit [Ping timeout: 245 seconds]
ki0_ has joined #ruby
ki0 has quit [Read error: Connection reset by peer]
<flughafen>
moin shevy certainty sevenseacat a
<sevenseacat>
hallo
jusmyth has quit [Quit: Leaving.]
<flughafen>
how was everybodyy's weekdn
<sevenseacat>
busy busy busy
<sevenseacat>
workin' on mah book
<flughafen>
ooh! i know someone famous!
<flughafen>
what's your book on ? rails?
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sevenseacat>
i'm not famous
<sevenseacat>
!r4ia
<helpa>
Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
milesmatthias has quit [Ping timeout: 265 seconds]
Dakuan_ has joined #ruby
<flughafen>
sweet
<flughafen>
how far is it?
<sevenseacat>
nearly finished
krz has quit [Ping timeout: 252 seconds]
towski_ has joined #ruby
bMalum has joined #ruby
<shevy>
yo flughafen - don't take off early, learn from Berlin
<shevy>
does the book feature cats?
<flughafen>
shevy: what happened?
<shevy>
flughafen it has an unfinished flughafen!!!
<flughafen>
ah, yeah
* flughafen
want s to move back there
<shevy>
although I think jhass said Berlin has two airports anyway? Austria does not even have one in town or at the town borders; it has a somewhat nearby airport in Schwechat but that takes about 25-35 minutes or so to reach by train
SouL has joined #ruby
<shevy>
sorry, I meant *Vienna
<certainty>
moin
<shevy>
moin certitty
juanpablo__ has joined #ruby
coderhs has quit [Ping timeout: 256 seconds]
<ineb>
To put the discussion back to topic: You can reach most towns in Austria via Rails
towski_ has quit [Ping timeout: 252 seconds]
<flughafen>
shevy: there were 3, tegel, some other i can't remember and schonefeld
<flughafen>
tegel and shonefeld are still open, but this one is supposed to replace all 3
<shevy>
cool, even 3
<shevy>
I am beginning to slowly understand how this could be messed up :D
lemur has quit [Remote host closed the connection]
sngeth has quit [Ping timeout: 264 seconds]
bruno- has joined #ruby
ayaz has joined #ruby
nii2361 has joined #ruby
ayaz has quit [Max SendQ exceeded]
bal has joined #ruby
emocakes has quit [Ping timeout: 246 seconds]
tubuliferous_ has joined #ruby
hrendalf has joined #ruby
ayaz has joined #ruby
sinkensabe has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
codecop has quit [Quit: Išeinu]
codecop_ has quit [Quit: Išeinu]
hmnhf has joined #ruby
codecop has joined #ruby
pentanol has quit [Quit: leaving]
fabrice31 has joined #ruby
tubuliferous_ has quit [Ping timeout: 264 seconds]
hs366 has joined #ruby
Musashi007 has quit [Quit: Musashi007]
charliesome has quit [Quit: zzz]
KramerC has quit [Ping timeout: 256 seconds]
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
AlphaTech has quit [Quit: Connection closed for inactivity]
Dakuan_ has quit [Remote host closed the connection]
freezevee has joined #ruby
<freezevee>
Hi guys, I just wanted to share my first Rails-based open source application which is a case/ticket management system I built for my work and decided to release it in public. The github link is https://github.com/chrisvel/ticketbox. I appreciate your opinion so don't bother to tell me !
<zmyrgel>
I'm trying to debug public key login issue using net-ssh
jonr22 has joined #ruby
aiguu has quit [Quit: WeeChat 1.1.1]
<zmyrgel>
I have a simple script which logins using pub key and downloads single file from remote server
<zmyrgel>
the script works from my local linux laptop but from windows server it needs to run I can't get the pub key login to work
<sandelius>
is rubys autoload being depreciated or not?
MatthewsFace has quit [Ping timeout: 246 seconds]
<zmyrgel>
I think the pub key permissions should be ok on windows side as using cygwin and openssh client with the pub key works
BTRRY has quit [Remote host closed the connection]
fabrice31_ has joined #ruby
<zmyrgel>
whats extra curious about this is that once I fail to login from windows side, the local version can't login for a few tries
<freezevee>
I meant don't hesitate to tell me !
plashchynski has joined #ruby
MyMind has quit [Ping timeout: 256 seconds]
andikr has joined #ruby
bronson has joined #ruby
jonr22 has quit [Ping timeout: 256 seconds]
MyMind has joined #ruby
bMalum has joined #ruby
<zmyrgel>
the debug output shows that it tries to auth with public with fingerprint so the script finds the key but for some reason won't authenticate with it
bMalum has quit [Read error: Connection reset by peer]
<bobitto>
freezevee , hide password in config file
fabrice31 has quit [Ping timeout: 264 seconds]
mikepack has joined #ruby
ptrrr has joined #ruby
<freezevee>
bobitto: it's a local one, nothing to be worried about
<freezevee>
bobitto: but I am still searching for a way to manage them
<sandelius>
apeiros_ ahh nice. Is there an announcement anywhere?
relix has joined #ruby
<shay->
hi, I have a multilined string, I want to gsub all ips and print them, but if no ip mathces in a line I want to print nothing, how can I do that?
BTRE has joined #ruby
martinbmadsen has quit [Ping timeout: 255 seconds]
exadeci has joined #ruby
bim has joined #ruby
<apeiros_>
sandelius: I'd assume it's in NEWS/CHANGELOG in the ruby source. no idea otherwise.
antgel has joined #ruby
Pumukel has quit [Ping timeout: 245 seconds]
hrendalf has quit [Read error: Connection reset by peer]
<apeiros_>
shay-: use gsub with a block
byprdct has quit [Ping timeout: 246 seconds]
<shay->
apreios: I am trying to, but how can I check if there war no hit? if match.nil? || match.empty "" else Regexp.last_match[1] end -- seems to be the wrong approach
bim has quit [Ping timeout: 252 seconds]
<apeiros_>
shay-: pro-tip: use tab completion for nicks. mine is not apreios
<apeiros_>
gsub will only invoke the block when there is a hit
<shay->
apeiros: real pro tip ;) thx haha
<apeiros_>
so there's no point in checking whether there was a match
<shay->
apeiros_: ok got it, so I have to sdave it in a diffeent vairable, thx
<apeiros_>
if you want to invoke the block even if there's no ip in the line, change your regex
<shay->
apeiros_: thanks works now
riotjones has joined #ruby
danjordan has joined #ruby
ghr has joined #ruby
terlar has joined #ruby
plashchynski has quit [Quit: plashchynski]
marr has joined #ruby
krz has quit [Read error: Connection reset by peer]
danjordan has left #ruby [#ruby]
lyuben_ has quit [Read error: Connection reset by peer]
lyuben_ has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
gfawcettpq has quit [Ping timeout: 240 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
<apeiros_>
hs366: depends on the specific case. if one was always better, we wouldn't have both
<shevy>
btw, you probably wanted if kind == 0
<hs366>
yes
<shevy>
hs366 you can also use hanmac coding style :)
<shevy>
it means to use as few characters as possible
juanpablo__ has quit [Ping timeout: 256 seconds]
hrendalf has quit [Remote host closed the connection]
toretore has joined #ruby
<hs366>
let me make it first then i can share it in my gist and you correct me if i'm wrong
<hs366>
brb
Musashi007 has joined #ruby
sngeth has quit [Ping timeout: 246 seconds]
jimms has joined #ruby
martinbmadsen has joined #ruby
vtunka has joined #ruby
rdark has joined #ruby
jgt2 has joined #ruby
RDash has joined #ruby
duncannz has quit [Remote host closed the connection]
<hanmac1>
hs366: you can use something like that: list.each{|h| h['Kind']=["A","C"][h['Kind']] } but that changes the original array and its hash objects
jimms has quit [Remote host closed the connection]
agrinb has joined #ruby
jgt1 has quit [Ping timeout: 250 seconds]
jmhmccr has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 272 seconds]
tubuliferous has joined #ruby
davedev24_ has quit [Remote host closed the connection]
AlexRussia has joined #ruby
bim has joined #ruby
oo_ has quit [Remote host closed the connection]
Zai00 has joined #ruby
agrinb has quit [Ping timeout: 245 seconds]
jimms has joined #ruby
Dakuan has joined #ruby
wicope has joined #ruby
tubuliferous has quit [Ping timeout: 245 seconds]
oo_ has joined #ruby
araw has quit [Quit: araw]
bim has quit [Ping timeout: 252 seconds]
bMalum has quit [Quit: bMalum]
senayar has joined #ruby
jimms_ has joined #ruby
jimms has quit [Read error: Connection reset by peer]
vdamewood has joined #ruby
bMalum has joined #ruby
yeticry has quit [Ping timeout: 244 seconds]
bobitto is now known as kolorados
yeticry has joined #ruby
wottam has joined #ruby
jonr22 has joined #ruby
wottam has quit [Read error: Connection reset by peer]
elaptics_away is now known as elaptics
plashchynski has joined #ruby
jonr22 has quit [Ping timeout: 256 seconds]
bMalum has quit [Quit: bMalum]
jimms_ has quit [Ping timeout: 245 seconds]
startupality has joined #ruby
User458764 has joined #ruby
AlexRussia has quit [Ping timeout: 246 seconds]
basiclaser has joined #ruby
bim has joined #ruby
AlexRussia has joined #ruby
bim has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
charliesome has quit [Quit: zzz]
charliesome has joined #ruby
Hijiri has quit [Ping timeout: 256 seconds]
rdark has quit [Quit: leaving]
juanpaucar has joined #ruby
rdark has joined #ruby
nii2361 has joined #ruby
Hijiri has joined #ruby
PeterTs has joined #ruby
msgodf has joined #ruby
ghostpl_ has joined #ruby
lkba_ has quit [Ping timeout: 246 seconds]
n008f4g_ has joined #ruby
xlogic has joined #ruby
juanpaucar has quit [Ping timeout: 250 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
startupality has quit [Quit: startupality]
xlogic has quit [Client Quit]
gfawcettpq has joined #ruby
alex88_ has joined #ruby
Eiam has quit [Read error: Connection reset by peer]
kaleido has quit [Read error: Connection reset by peer]
ghostpl_ has quit [Ping timeout: 264 seconds]
kaleido has joined #ruby
davedev24_ has joined #ruby
alex88 has quit [Ping timeout: 245 seconds]
jsaak has quit [Ping timeout: 246 seconds]
wlanboy has quit [Ping timeout: 244 seconds]
amystephen has joined #ruby
workmad3 has joined #ruby
wlanboy has joined #ruby
last_staff has joined #ruby
User458764 has joined #ruby
reinaldob has joined #ruby
spider-mario has joined #ruby
freezevee has quit []
spiderbyte has joined #ruby
reinaldob has quit [Ping timeout: 252 seconds]
jsaak has joined #ruby
zacts has quit [Quit: leaving]
The_Phoenix has quit [Read error: Connection reset by peer]
reinaldob has joined #ruby
davzie has left #ruby ["WeeChat 0.3.0"]
agrinb has joined #ruby
NoNMaDDeN has joined #ruby
codecop has joined #ruby
PeterTs has quit [Quit: return]
oo_ has quit [Remote host closed the connection]
martianixor has quit [Quit: Leaving]
User458764 has quit [Ping timeout: 244 seconds]
bim has joined #ruby
NoNMaDDeN has quit [Ping timeout: 246 seconds]
oo_ has joined #ruby
agrinb has quit [Ping timeout: 265 seconds]
bal has quit [Ping timeout: 252 seconds]
bruno- has joined #ruby
User458764 has joined #ruby
bal has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
selu has joined #ruby
lkba has joined #ruby
alex88_ has quit [Read error: Connection reset by peer]
techsethi has joined #ruby
mjuszczak has joined #ruby
rjc_ has joined #ruby
FaresKAl- has joined #ruby
FaresKAlaboud has quit [Read error: Connection reset by peer]
mjuszczak has quit [Read error: Connection reset by peer]
<emilkarl>
Hi, I would like an array of objects with set keys… this is my example, but when I loop it i get an array with both the key and the object. How should this be done correct? http://pastie.org/10029856
c0m0 has joined #ruby
<gregf_>
emilkarl: thats a hash of hashes
<apeiros_>
emilkarl: {} is Hash, not Array
<emilkarl>
but isant bar and foo the keys for each value in the first hash?
<apeiros_>
emilkarl: and you can use either of: `hash.each do |key, value|` `hash.each_key do |key|` or `hash.each_value do |value|`
Takle has quit [Remote host closed the connection]
<emilkarl>
aah ok
<apeiros_>
emilkarl: yes, in the hash assigned to foo, :bar and :boo are the keys
<emilkarl>
hash.each do |key, value|
<emilkarl>
solved it...
doodlehaus has joined #ruby
<emilkarl>
I added each_with_index but that also include and int index.
<emilkarl>
thanks!
Takle has joined #ruby
Takle has quit [Remote host closed the connection]
Soda has joined #ruby
tesuji has joined #ruby
<apeiros_>
each_with_index puts all arguments each yields into the first argument and the index in the second
<apeiros_>
it'd be: `hash.each_with_index do |key_value, index| key, value = *key_value …`
<apeiros_>
you can write that simpler by using decomposition:
<apeiros_>
`hash.each_with_index do |(key, value), index| `
<apeiros_>
but I think index isn't what you want anyway.
arup_r_ has joined #ruby
bronson has joined #ruby
olivier_bK has joined #ruby
arup_r_ has quit [Client Quit]
arup_r has quit [Ping timeout: 272 seconds]
arup_r has joined #ruby
<certainty>
you can remember that easily from the name. the index comes last in the name
keen_ has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
ghostpl_ has joined #ruby
ghostpl_ has quit [Remote host closed the connection]
<apeiros_>
and `obj.keys == 0` makes no sense (it'll never be true, Hash#keys always returns an array)
<tobiasvl>
`diff.myhash.each` doesn't make a lot of sense either
<gregf_>
certainty: thats confusing at times cuz with some methods the object comes first. like so, .inject({}){ |hash, str| ... and with each_with_object({}) { |str, hash| ...
<apeiros_>
indeed
<kolorados>
obj.key
<tobiasvl>
hs366: there is a lot of things wrong with that code
<tobiasvl>
I doubt it even runs
<apeiros_>
I *know* it doesn't run
<tobiasvl>
haha yeah wait, eslif
<gregf_>
hs366: did you try what hanmac1 suggested?
<tobiasvl>
missed that
drawingthesun has joined #ruby
<hs366>
hanmac1 ?
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<hs366>
can you explain a little bit more in last part : %w{A C}[h["Kind"]];h
<hs366>
i don't get it
SouL_ has joined #ruby
<workmad3>
undeadaedra: I think the stdlib json relies on native libraries, so it's possible it didn't compile
SouL has quit [Read error: Connection reset by peer]
<gregf_>
hs366: its not too difficult. %w{A C} is ["A", "C"]
arup_r has quit [Remote host closed the connection]
<workmad3>
undeadaedra: also, if you installed through something like ubuntu packages, it's possible you don't have the complete stdlib there (as package maintainers have a habit of carving up ruby into lots of small, odd packages and making it difficult to get a complete ruby environment)
<hs366>
yah but what is the [h["k"]]
<gregf_>
and h["Kind"] contains 0, 1, 2 whatever(indexes).btw, it was hanmac1's intelligence ;)
The_Phoenix has joined #ruby
<undeadaedra>
workmad3: sounds like that
<undeadaedra>
well, it sucks.
<gregf_>
>> h["Kind"] = 1; ["A", "C"][h["Kind"]]
<eval-in_>
gregf_ => undefined local variable or method `h' for main:Object (NameError) ... (https://eval.in/300693)
<workmad3>
undeadaedra: most people tend to recommend not using ubuntu packages unless you have a very good reason to do so (such as you're installing a ruby application through the package manager and don't need a dev environment)... the recommendation is generally to use rvm, ruby-build or ruby-install to install, and rvm, rbenv or chruby to set up your ruby environment variables
milesmatthias has quit [Ping timeout: 255 seconds]
rkgudboy has quit [Ping timeout: 246 seconds]
lanemeyer has joined #ruby
juanpablo__ has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
PhaseCode has quit [Read error: Connection reset by peer]
dEPy has quit [Client Quit]
AlexRussia has joined #ruby
PhaseCode has joined #ruby
Tuxero has left #ruby [#ruby]
Takle has quit [Remote host closed the connection]
rkgudboy has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
razieliyo has joined #ruby
razieliyo has joined #ruby
anaeem1 has joined #ruby
rohitkashyap has joined #ruby
withnale_ has joined #ruby
zorak8 has joined #ruby
rohit has quit [Ping timeout: 265 seconds]
juanpablo__ has quit [Ping timeout: 255 seconds]
delianides has joined #ruby
yalue has joined #ruby
delianides has quit [Read error: Connection reset by peer]
delianides has joined #ruby
rkgudboy has quit [Ping timeout: 256 seconds]
max96at|off is now known as max96at
anaeem1 has quit [Ping timeout: 244 seconds]
senayar has joined #ruby
sanguisdex has quit [Quit: Leaving.]
bruno- has joined #ruby
delianides has quit [Ping timeout: 240 seconds]
Mia has joined #ruby
Mia has joined #ruby
sankaber has joined #ruby
beginner has quit [Ping timeout: 252 seconds]
charliesome_ has joined #ruby
beginner has joined #ruby
beginner has quit [Changing host]
beginner has joined #ruby
charliesome has quit [Ping timeout: 272 seconds]
Hirzu has quit [Ping timeout: 265 seconds]
tesuji has quit [Ping timeout: 265 seconds]
vtunka has quit [Quit: Leaving]
jimms has joined #ruby
Macaveli has joined #ruby
beginner has quit [Max SendQ exceeded]
sanguisdex has joined #ruby
rohitkashyap has quit [Ping timeout: 256 seconds]
sanguisdex has quit [Remote host closed the connection]
beginner has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iamninja has quit [Quit: WeeChat 1.1.1]
centrx has joined #ruby
tkuchiki has quit [Ping timeout: 246 seconds]
Hirzu has joined #ruby
davedev24_ has quit [Remote host closed the connection]
iamninja has joined #ruby
iamninja has quit [Client Quit]
NoNMaDDeN has joined #ruby
vtunka has joined #ruby
tubuliferous has joined #ruby
iamninja has joined #ruby
beginner has quit [Max SendQ exceeded]
Joufflu has quit [Read error: Connection reset by peer]
beginner has joined #ruby
SouL has joined #ruby
iamninja has quit [Client Quit]
kolorados has quit [Ping timeout: 240 seconds]
werelivinginthef has joined #ruby
iamninja has joined #ruby
bMalum has quit [Remote host closed the connection]
<avril14th>
gregf_: thanks :)
tubuliferous has quit [Ping timeout: 246 seconds]
revoohc has joined #ruby
bMalum has joined #ruby
silkfox has joined #ruby
HOrangeJewce has joined #ruby
QualityAddict has quit []
paulfm has quit [Read error: Connection reset by peer]
bMalum has quit [Client Quit]
Takle has joined #ruby
paulfm has joined #ruby
mengu has joined #ruby
delianides has joined #ruby
R1ck has joined #ruby
vt102 has joined #ruby
zenith_ has joined #ruby
oo_ has quit [Remote host closed the connection]
werelivinginthef has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
lkba_ has quit [Read error: Connection reset by peer]
lkba has joined #ruby
<R1ck>
heya. I have this 3rd party Ruby app (Ruby/Sinatra/Redis/jQuery) - what would be the best way to host this with high-availability? Heroku or some apache mod_rails setup?
<jhass>
start with finding a host that has HA, then see how you can run your stuff there
_dropp` has joined #ruby
jonr22 has joined #ruby
jerius has joined #ruby
tlarevo has quit []
Takle has quit [Remote host closed the connection]
bMalum has joined #ruby
<R1ck>
actually, I'd want to implement the HA myself
juanpaucar has joined #ruby
wolf4ood_ has quit [Quit: (null)]
jerematic has joined #ruby
dblessing has joined #ruby
jonr22 has quit [Ping timeout: 265 seconds]
it0a has joined #ruby
bayed has joined #ruby
_maes_ has joined #ruby
<centrx>
That's an interesting concept
banister has joined #ruby
mary5030 has joined #ruby
<jhass>
R1ck: then you need to start by defining what that means to you
techsethi has joined #ruby
SOLDIERz_ has joined #ruby
thefynx has joined #ruby
basiclaser has quit [Quit: Connection closed for inactivity]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sameerynho has quit [Ping timeout: 272 seconds]
livathin_ has quit [Remote host closed the connection]
livathinos has joined #ruby
jerematic has quit [Remote host closed the connection]
sdothum has joined #ruby
jimms has quit [Remote host closed the connection]
agrinb has joined #ruby
<R1ck>
well.. if this app starts up, you can browse it.. if it crashes or the node crashes, I need to have another node/instance that takes over - I could do this with a keepalived setup (if I can find a way to share Redis between nodes)
<jhass>
What if Redis crashes?
<R1ck>
same, ofcourse.. another instance would have to take over
<jhass>
What if it's DDoS'ed?
<DefV>
what if there's a split brain
<Nilium>
I have had to deal with redis crashing. It is not pretty.
<R1ck>
DDoS is a problem for the ISP
<jhass>
(or postedd to HN for that matter)
oo_ has joined #ruby
<jhass>
nope
<jhass>
it might be very possible that your app, not the ISP is the bottleneck
<centrx>
R1ck, If you are the only person managing it, it's not high-availability
<jhass>
but choosing the right ISP is part of the considerations of setting up HA
<Nilium>
Any denial-of-service like attack is something you need to handle. If the ISP handles it ahead of time, so much the better, but they owe you nothing.
<centrx>
High-availability doesn't get to say "oh our ISP screwed up"
<centrx>
You have two ISPs, three,...
a5i has joined #ruby
<R1ck>
this DDoS stuff is a bit out of the scope, this is a hypothetical setup for a client
<R1ck>
not a real-world issue (yet)
arup_r has joined #ruby
<jhass>
no, DDoS or sudden popularity is not out of scope of HA considerations
Feyn has quit [Quit: Leaving]
<banister>
jhass redis never crashes
<R1ck>
agreed
<ericwood>
redis is awesome
<DefV>
redis just quits when it feels like it
<jhass>
banister: but the memory of the box it runs on might
werelivinginthef has joined #ruby
<DefV>
redis also just clears all data at random sometimes
<DefV>
I love redis, but I wouldn't trust it with my data for 1 second
<Nilium>
If a write fails, redis will go into read-only mode and then promptly murder itself
<jhass>
that's the next consideration, what type of hardware to use
<banister>
jhass redis has a direct line to God
<jhass>
banister: ah, there's the problem, gotcha
<R1ck>
jhass: so if the app itself has no built-in protection against DDoS or sudden popularity, you would protect it how? by setting request limits in apache/nginx or something?
<Nilium>
It's somehow less useful than a filesystem consistency error in most Linux distributions, where the filesystem goes readonly
<Nilium>
Except in those cases, the OS won't die
<Nilium>
It'll just be really hard to shut down
<DefV>
it's funny that someone asks about HA and we all go on a nerdrage of our own
<DefV>
seems like we've all got stories to tell
<Nilium>
I'm too busy thinking of how adorable beanstalkd is
ndrei has quit [Quit: Lost terminal]
<R1ck>
I appreciate everyones nerdrage ;)
<Nilium>
Which is an odd way to describe a job queue but I'm pretty sure it's appropriate for beanstalkd
emilkarl has quit [Quit: emilkarl]
<jhass>
R1ck: that's why I said you need to start by defining what HA means to you, what your worst case scenario you still want to handle looks like
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
ndrei has joined #ruby
BlackGear has joined #ruby
n008f4g_ has joined #ruby
relix has joined #ruby
sameerynho has joined #ruby
doodlehaus has joined #ruby
BlackGear has quit [Max SendQ exceeded]
BlackGear has joined #ruby
<ericwood>
our one true thoughtleader
BlackGea_ has joined #ruby
_dropp` is now known as dropp
BlackGea_ has quit [Max SendQ exceeded]
Rapier- has joined #ruby
emilkarl has joined #ruby
BlackGea_ has joined #ruby
BlackGea_ has quit [Max SendQ exceeded]
BlackGear has quit [Ping timeout: 256 seconds]
BlackGea_ has joined #ruby
BlackGea_ has quit [Max SendQ exceeded]
BlackGear has joined #ruby
razieliyo has quit [Ping timeout: 255 seconds]
sameerynho has quit [Quit: Leaving]
adriancb has joined #ruby
anaeem1 has joined #ruby
BlackGear has quit [Max SendQ exceeded]
BlackGear has joined #ruby
BlackGear has quit [Max SendQ exceeded]
BlackGear has joined #ruby
c0m0 has quit [Ping timeout: 252 seconds]
ismaelga has joined #ruby
BlackGear has quit [Max SendQ exceeded]
ych4k3r has joined #ruby
jspdown has joined #ruby
fryguy9 has joined #ruby
bihi has left #ruby [#ruby]
BlackGear has joined #ruby
BlackGear has quit [Max SendQ exceeded]
BlackGear has joined #ruby
zorak8 has quit [Ping timeout: 252 seconds]
uri_ has joined #ruby
BlackGear has quit [Max SendQ exceeded]
ptrrr has joined #ruby
BlackGear has joined #ruby
shredding has joined #ruby
discr33t has joined #ruby
stef204 has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
BlackGear has quit [Max SendQ exceeded]
sanguisdex has joined #ruby
BlackGear has joined #ruby
BlackGear has quit [Max SendQ exceeded]
<discr33t>
hey guys, kinda new to ruby here and i have a task that i'm not sure how to complete. i have an array of files that have integers as content. i want to add the total of all of the files together as a new variable. . . any ideas
BlackGear has joined #ruby
<jhass>
discr33t: no attempt yet?
milesmatthias has joined #ruby
ojacobson has joined #ruby
<centrx>
Use the Unix program cat and be done
BlackGear has quit [Max SendQ exceeded]
Megtastique has joined #ruby
Megtastique has quit [Max SendQ exceeded]
sambao21 has joined #ruby
BlackGear has joined #ruby
<jhass>
discr33t: have a look at Enumerable#map, File.read, String#to_i and Enumerable#inject
Megtastique has joined #ruby
<discr33t>
jhass: so far i've done this http://pastebin.com/iV26CaLg which just gives me the individual disk size in GB
BlackGear has quit [Max SendQ exceeded]
<helpa>
Hi discr33t. We in #ruby would really appreciate it if you did not use pastebin during your time with us.
<helpa>
Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
BlackGear has joined #ruby
jspdown has quit []
<discr33t>
jhass: now i'm trying to figure out how to iterate over the sizefile to give me total space
BlackGear has quit [Max SendQ exceeded]
ptrrr has quit [Read error: Connection reset by peer]
<jhass>
yeah, my memory is right, Q is the default
<undeadaedra>
Q is ””, q is ’'
<undeadaedra>
without weird unicode replacements, of course.
BlackGear has joined #ruby
<undeadaedra>
iirc,
<jhass>
yes
<jhass>
not the point I was trying to make
BlackGear has quit [Max SendQ exceeded]
<discr33t>
jhass: i'll rewrite that part using file.join. for my current task though would i want something like total_size = sizefile.map and go from there?
BlackGear has joined #ruby
<undeadaedra>
you just want the total size ? As the sum of all files ?
<hanmac1>
jhass: its funny to use spaces for that ;P
vt102 has quit [Remote host closed the connection]
<jhass>
discr33t: sizefile is a string, why would you map over it?
<discr33t>
jhass: i would have to turn sizefile into an array to get the sizefile for each device
BlackGear has quit [Max SendQ exceeded]
<hanmac1>
jhass: hm for inject when using + or * a default value is allways useful
CustosLimen has joined #ruby
<jhass>
discr33t: doesn't Dir.entries do that already?
BlackGear has joined #ruby
spyderman4g63 has joined #ruby
fantazo has joined #ruby
BlackGear has quit [Max SendQ exceeded]
<jhass>
hanmac1: hard to imagine a running system without anything that at least pretends to be a blockdevice though
spyderman4g63 has quit [Remote host closed the connection]
<discr33t>
yes, Dir.entries is creating an array of all entries in that directory, in this case /sys/block
BlackGear has joined #ruby
* hanmac1
makes fingerquotes at the word "pretends" ;P
bim has joined #ruby
<jhass>
how about mapping over that?
spyderman4g63 has joined #ruby
BlackGear has quit [Max SendQ exceeded]
BlackGear has joined #ruby
arup_r has quit [Remote host closed the connection]
<discr33t>
jhass: if I map over that, wouldn't i be mapping over everything in the directory and not just the entires that have "/device" and "/size" in them?
codecop has quit [Remote host closed the connection]
BlackGear has quit [Max SendQ exceeded]
<hannes___>
hey, does anyone know how I can tell rvm to ignore project specific rvmrcs?
BlackGear has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
blackmesa has joined #ruby
techsethi has quit [Quit: techsethi]
BlackGear has quit [Max SendQ exceeded]
<hannes___>
oh nvm got it
fuzzyhorns2 has joined #ruby
Limix has joined #ruby
BlackGear has joined #ruby
<fuzzyhorns2>
my google is failing me, can anyone recommend good guides for writing gems that use methods of the host app?
DouweM has joined #ruby
BlackGear has quit [Max SendQ exceeded]
<fuzzyhorns2>
my use case is i'm writing a gem that needs to take an auth method from the app that is hosting the gem
<fuzzyhorns2>
and i'm unsure of the best way to handle that
BlackGear has joined #ruby
<hannes___>
fuzzyhorns2: what do you mean 'host'? Like an app that's using the gem?
<fuzzyhorns2>
hannes___: yeah, is there another name for that?
bronson has joined #ruby
BlackGear has quit [Max SendQ exceeded]
agrinb has quit [Remote host closed the connection]
BlackGear has joined #ruby
<hannes___>
fuzzyhorns2: I don't know if ruby-people actually say it like that, but it strikes me as a rather odd use of 'host'
sambao21 has joined #ruby
n80 has joined #ruby
BlackGear has quit [Max SendQ exceeded]
<undeadaedra>
Well gems are libraries, so the application, no ?
hidomel has joined #ruby
BlackGear has joined #ruby
<fuzzyhorns2>
sure, the host application
<hannes___>
fuzzyhorns2: anyway; How do you intend to invoke the method? Might be as simple as just having a method that takes a proc?
basiclaser has joined #ruby
BlackGear has quit [Max SendQ exceeded]
<fuzzyhorns2>
i was considering that, hannes___
rbennacer has joined #ruby
BlackGear has joined #ruby
rbennacer has quit [Remote host closed the connection]
<fuzzyhorns2>
but i am unsure it will work
BlackGear has quit [Max SendQ exceeded]
rbennacer has joined #ruby
<fuzzyhorns2>
basically the gem needs to borrow the current user id from the host application, which is dynamic based on who is using the app at that time
<fuzzyhorns2>
if i have a proc that enters the gem via configuration, idk if it'll have that dynamic current user id in scope
DerisiveLogic has joined #ruby
BlackGear has joined #ruby
<fuzzyhorns2>
im prob putting this in a confused way too
BlackGear has quit [Max SendQ exceeded]
bronson has quit [Ping timeout: 245 seconds]
BlackGear has joined #ruby
sngeth has joined #ruby
BlackGear has quit [Max SendQ exceeded]
BlackGear has joined #ruby
mengu has quit [Remote host closed the connection]
<jhass>
fuzzyhorns2: it often helps to drop the abstractions, what's your gem doing, what's your app doing, what's your app doing with your gem and why and when do you need to transport the user id
oo_ has quit [Remote host closed the connection]
BlackGear has quit [Max SendQ exceeded]
stef204 has joined #ruby
BlackGear has joined #ruby
davedev24_ has joined #ruby
BlackGear has quit [Max SendQ exceeded]
<banisterfiend>
apeiros can i get your help with something?
craigp has quit [Ping timeout: 264 seconds]
<centrx>
don't do it, it's a trap!
BlackGear has joined #ruby
bMalum has joined #ruby
a346 has joined #ruby
bim has quit [Remote host closed the connection]
<jhass>
banisterfiend: didn't you learn yet that you ask channels on IRC, not people?
BlackGear has quit [Max SendQ exceeded]
<banisterfiend>
jhass my experience with that approach is the signal to noise ration is much too low ;)
BlackGear has joined #ruby
bim has joined #ruby
<banisterfiend>
esp on #rubyonrails you get a lot of nonsense, wrong answers all mixed in with a heavy load of condescension and snarkiness
<undeadaedra>
banisterfiend: still better than poking randomly people with questions someone else can answer
BlackGear has quit [Max SendQ exceeded]
<jhass>
^
agrinb has quit [Ping timeout: 256 seconds]
<jhass>
if you can recognize the none-sense, just filter it out
<banisterfiend>
undeadaedra he's more a friend than a random person.
BlackGear has joined #ruby
<undeadaedra>
this is IRC, not MSN Messenger
<apeiros_>
banisterfiend: busy at work at the moment. if you ask in #rubyonrails, I'll try to take a look.
DaniG2k has joined #ruby
<jhass>
or phrase your question in a way that shows that you'll be able to filter the none-sense, keeps it away in the first place in my experience
BlackGear has quit [Max SendQ exceeded]
BlackGear has joined #ruby
agrinb has joined #ruby
bMalum has quit [Client Quit]
BlackGear has quit [Max SendQ exceeded]
aspiers has quit [Quit: WeeChat 0.4.1]
aspiers has joined #ruby
BlackGear has joined #ruby
oo_ has joined #ruby
BlackGear has quit [Max SendQ exceeded]
juanpablo__ has joined #ruby
bMalum has joined #ruby
BlackGear has joined #ruby
crazydiamond has joined #ruby
BlackGear has quit [Max SendQ exceeded]
ghostpl_ has quit [Read error: Connection reset by peer]
Dakuan has quit [Remote host closed the connection]
BlackGear has joined #ruby
ghostpl_ has joined #ruby
varunwachaspati has quit [Ping timeout: 264 seconds]
<eval-in_>
jhass => /tmp/execpad-4b770176cd5b/source-4b770176cd5b:2: warning: don't put space before argument parentheses ... (https://eval.in/300785)
<undeadaedra>
jruby works, rvm not
dfinninger has joined #ruby
<undeadaedra>
rbx*
sambao21 has quit [Quit: Computer has gone to sleep.]
discr33t has quit [Quit: Page closed]
silkfox has joined #ruby
discr33t has joined #ruby
Ankhers has joined #ruby
discr33t has quit [Client Quit]
tjbiddle has joined #ruby
discr33t has joined #ruby
iamjarvo has joined #ruby
tubuliferous has joined #ruby
senayar has quit [Remote host closed the connection]
paulfm has joined #ruby
jerematic has joined #ruby
n008f4g_ has quit [Ping timeout: 245 seconds]
rhllor has quit [Quit: rhllor]
<discr33t>
jhass: i was looking at this http://paste.mrzyx.de/puggcjzmj and line 15 sets the path to /sys/block/$devicename/device/size, is that correct?
uri__ has quit [Ping timeout: 264 seconds]
mengu has joined #ruby
<jhass>
discr33t: do you know glob patterns?
zcm has joined #ruby
aclearman037 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discr33t>
jhass: i'm familiar with them
<jhass>
Dir[] takes glob patterns and I just construct one there
<jhass>
/sys/block/{sda,sdb}/size, something like that
<jhass>
it returns an array of matching files
tubuliferous has quit [Ping timeout: 245 seconds]
jerematic has quit [Remote host closed the connection]
oo_ has joined #ruby
mikepack has joined #ruby
jimms has joined #ruby
<discr33t>
jhass: i understand that. and that is the path i need (/sys/block/{sda,sdb}/size. my question is blockdevices looks like it is being set to /sys/block/{sda, sdb}/device and sizes being set to blockdevices/size which would give the path /sys/block/sda/device/size for example
renegadeandy has joined #ruby
jimms has quit [Remote host closed the connection]
Rephiax has quit [Ping timeout: 256 seconds]
<discr33t>
i'm just trying to understand line 15 better
oo_ has quit [Remote host closed the connection]
<jhass>
no
mjuszczak has quit []
<jhass>
discr33t: do you have pry or irb?
<discr33t>
jhass: i have irb
<jhass>
run line 6, then copy over line 11-13
<jhass>
look at the output
aclearman037 has joined #ruby
DEA7TH has quit [Ping timeout: 246 seconds]
DEA7TH has joined #ruby
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
crueber has joined #ruby
phale has joined #ruby
tkuchiki has joined #ruby
<discr33t>
jhass: ok so that only returns ["sda"] on my test box which only has one hard drive
<phale>
discr33t: That is an array.
yourwebdevguy has joined #ruby
yourwebdevguy has joined #ruby
senayar has joined #ruby
<phale>
With one element ;)
makerop has joined #ruby
serivich has quit [Ping timeout: 246 seconds]
bruno- has quit [Ping timeout: 264 seconds]
<undeadaedra>
:o
<discr33t>
phale: i understand that. . . i just wasn't sure what lines 11-13 were doing
<phale>
You have now created a string. The string contains the two elements, concatenated with ","
<jhass>
discr33t: discr33t try just the inner Dir on line 15 next
<jhass>
sorry
dc has quit [Remote host closed the connection]
snath has joined #ruby
jonr22 has joined #ruby
davedev2_ has joined #ruby
davedev24_ has quit [Ping timeout: 252 seconds]
paulfm has joined #ruby
<DEA7TH>
I have a function which needs to return two values, the second of which is optional - sometimes it is used, sometimes it isn't. What is the convention for doing that in Ruby? I suppose I could always return [val1, val2] and sometimes just ignore val2, that would work but I'm not sure if that's conventional.
<discr33t>
jhass: if i add just the inner Dir the output is now ["/sys/block/sda/size"]
zenith_ has quit [Ping timeout: 244 seconds]
jmhmccr has joined #ruby
werelivinginthef has quit [Remote host closed the connection]
<DEA7TH>
Or pass a boolean, if true then return [val1, val2] else return val1
<jhass>
discr33t: now do blockdevices.zip(Dir[..])
OrbitalKitten has joined #ruby
<jhass>
maybe reassign blockdevices to multiple values manually ;)
<discr33t>
jhass: that gives me [["sda", "/sts/block/sda/size"]]
<DEA7TH>
my function doesn't know whether the caller will need the second value
<phale>
oh right
<phale>
suppose you could use an optional argument
<phale>
def function(blablabla, want_other_value = false) return other_value if want_other_value == true end
<phale>
you don't have to type in the second argument, or you can
jonr22 has quit [Ping timeout: 256 seconds]
<DEA7TH>
it's more like
<jhass>
discr33t: run to_h on it
robustus has quit [Ping timeout: 255 seconds]
<discr33t>
jhass: ok, i see what it is doing now. for each device it is creating an array of the device name and the path to the size file for that device
krisquigley has quit [Remote host closed the connection]
<DEA7TH>
def function(blablabla, want_other_value = false) if (want_other_value) return [value, other_value] else return value end
krisquigley has joined #ruby
<discr33t>
jhass: when i add .to_h i get an undefined method
<phale>
oh
zorak8 has joined #ruby
<DEA7TH>
or I could always return both values and sometimes ignore the latter
<phale>
yeah that should work
<phale>
but you can just do
<centrx>
discr33t, What version of Ruby are you running?
<phale>
return want_other_value ? [value, other_value] : value
<phale>
shorter, concise.
zcm has quit [Quit: Bye]
Limix has quit [Quit: Limix]
<discr33t>
centrx: 1.8.7 (i now not most recent but all of this is for Puppet)
sigurding has joined #ruby
<centrx>
discr33t, Okay in 1.8 you have to do: Hash[*array_of_pairs.flatten]
<phale>
DEA7TH: my example should work just fine
<centrx>
iirc
<jhass>
discr33t: oh, no Ruby 2.1 or 2.2 I gather
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<discr33t>
jhass: unfortunately not. . . . haven't done the testing to have puppet run under ruby 2.x yet so we're still on 1.8.7
<jhass>
blergh, too much multi-tasking
<centrx>
discr33t, Also Ruby 1.8 is ancient and end-of-life
AlexRussia has quit [Ping timeout: 244 seconds]
eighthbit has joined #ruby
<discr33t>
centrx: i know, we plan to move up to 1.9.3 and eventually 2.x very soon. we just have to do all of our testing with puppet to make sure it won't break anywhere
<havenwood>
Ruby 1.9 is paste End-of-Life and Ruby 2.0 is in maintenance mode. 2.1+!
robustus has joined #ruby
tkuchiki has quit [Read error: Connection reset by peer]
<havenwood>
past*
lmickh has joined #ruby
adamjleonard has joined #ruby
rhllor has joined #ruby
jerematic has joined #ruby
stoddart has joined #ruby
<makerop>
has anyone had any trouble with json 1.8+, and ubuntu?
krisquigley has quit [Ping timeout: 264 seconds]
<makerop>
I cant get the gem to install/compile
<discr33t>
in this line i need to drop the .to_h and replace it with Hash[*array_of_pairs.flatten]? blockdevices.zip(Dir["#{sysfs_block_directory}/{#{blockdevices.join(",")}}/size"]).to_h
<stoddart>
hi everybody
<centrx>
discr33t, yes, where array_of_pairs is what the zip returns
* apeiros_
notices that the laptop is attached to the keyboard
<centrx>
~!@#--#@!~
<apeiros_>
I'm not _quite_ sure what that emoticon means :D
<gregf_>
DEA7TH: does it matter how many values the that you are returning contains? you can always check that in the caller?
<undeadaedra>
It means you broke your keyboard
<undeadaedra>
And your laptop
justin_pdx has joined #ruby
tjohnson has joined #ruby
<gregf_>
something like:
<gregf_>
DEA7TH: def foo x; return x ? ["foo"] : ["foo", "bar"];end; [ nil, 1].each { |x| p foo x }
tagrudev has quit [Remote host closed the connection]
<discr33t>
centrx: so something like this? size = blockdevices.zip(Dir["#{sysfs_block_directory}/{#{blockdevices.join(",")}}/size"]); Hash[size.flatten]
<DEA7TH>
gregf_: I'll give a gist implementation of what I want.....
nii2361 has quit [Ping timeout: 256 seconds]
<gregf_>
DEA7TH: sure ;)
bruno- has joined #ruby
* hanmac1
takes his shotgun for the chance when 1.8 does respawn again
tobago has quit [Remote host closed the connection]
<centrx>
discr33t, yes, but the * is necessary (splat)
Dakuan has quit [Remote host closed the connection]
<havenwood>
DEA7TH: .rb extension on your filename
<DEA7TH>
ok, now it works
Rephiax has joined #ruby
dfinninger has quit [Remote host closed the connection]
<phale>
autism
<undeadaedra>
:o
<jhass>
DEA7TH: in general I would keep return values uniform, no matter the parameters
<jhass>
for whether I'd make an exception in your case, well, you didn't show your case ;)
sambao21 has joined #ruby
<DEA7TH>
In my case, the method is returning values which might have been missing from the database. If they were missing, it first gathers them from Google maps. Some of the time I also need to know whether missing values were gathered.
phale has left #ruby ["Leaving"]
<DEA7TH>
I need that to display a message to the user.
sambao21 has quit [Client Quit]
kaleido has joined #ruby
<jhass>
sounds like you want a messenger object as result
paradoja has joined #ruby
yourwebdevguy has left #ruby ["Leaving"]
aclearman037 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<DEA7TH>
jhass: you mean, wrap the value and the message in something? Does Ruby have this in its standard libraries, or do I have to implement it myself?
<jhass>
def query; QueryResult.new(data, more_data, fetched_missing?); end; result = query; if result.fetched_missing?; puts "yo, sorry that it took longer"; end;
<jhass>
just implement it yourself, Struct comes in handy
<Willd>
canton7: Seeing as there was no graceful code to handle if there was no private address, I just changed it t check if it was a ipv4 address instead
<canton7>
coolies
<Willd>
canton7: You'll have to excuse my ignorance, first time touching actual code in ruby :#
<canton7>
it's probably trying to be helpful and only do broadcasty things on interfaces connected to your local network
Hirzu_ has quit [Ping timeout: 265 seconds]
serivich has quit [Ping timeout: 272 seconds]
wallerdev has joined #ruby
<Willd>
canton7: Yeah, I'm ignoring that for the moment, the university wifi can probably handle it :)
<canton7>
heh
jerematic has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Takle has joined #ruby
psy has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
psy has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
<claw>
anybody knows how i can calculate the bytesize of a string ?
iamjarvo has quit [Max SendQ exceeded]
<claw>
as if it was a textfile
IrishGringo has joined #ruby
x1337807x has joined #ruby
psy has joined #ruby
x1337807x has quit [Client Quit]
iamjarvo has joined #ruby
<eam>
claw: "string".b.size
<musl>
If you've got your encodings setup correctly, slurping the file into a string and ... what eam said.
<LiquidInsect>
Question of style: Is it ok for a predicate method to change something when called? I'm in a new-to-me codebase and I'm trying to resist the urge to rename every method that ends in a ? but isn't idempotent
<hanmac>
yeah i didnt notice
dfinninger has quit [Remote host closed the connection]
B1n4r10 has joined #ruby
<jhass>
LiquidInsect: I'd say it's unexpected indeed
doodlehaus has quit [Ping timeout: 244 seconds]
Rarikon has joined #ruby
<hanmac>
LiquidInsect: hm imo methods that named "abc?" should be no-op methods imo ... they shouldnt change anything and return only an booleanlike value
byprdct has joined #ruby
a346 has joined #ruby
hidomel has joined #ruby
beneggett has quit [Ping timeout: 244 seconds]
<jhass>
relying on truthiness for them is fine with me
<jhass>
but side-effects, meh
<LiquidInsect>
That's what I thought
<LiquidInsect>
yeah... I'm going to have to take an axe to this thing
<catphish>
LiquidInsect: it's certainly unusual to have ? methods be anything but simple checks
<LiquidInsect>
The rest of it is like someone read metaprogramming ruby and thought how awesome it would be if everything was written that way
lizander has joined #ruby
mhib has quit [Quit: Wychodzi]
taiansu has joined #ruby
<catphish>
lol
hib has joined #ruby
brb3 has quit [Quit: <.<]
epistrephein has quit []
Xoro has quit [Ping timeout: 252 seconds]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brb3 has joined #ruby
<jhass>
sounds like my code!
<jhass>
except that I never read that book
<LiquidInsect>
it's a fantastic book... if you're trying to qwrite a DSL or something
shadeslayer has quit [Ping timeout: 264 seconds]
hib has quit [Client Quit]
<LiquidInsect>
not so much if you're just building another rails app
shadeslayer has joined #ruby
hidomel has quit [Ping timeout: 245 seconds]
andikr has quit [Remote host closed the connection]
OrbitalKitten has joined #ruby
ghr has quit [Read error: Connection reset by peer]
ereslibre_laptop is now known as ereslibre
werelivinginthef has quit [Remote host closed the connection]
ghr has joined #ruby
OrbitalKitten has quit [Client Quit]
mhib has joined #ruby
mhib has quit [Client Quit]
catphish has quit [Quit: Leaving]
riotjones has quit [Remote host closed the connection]
mhib has joined #ruby
Rarikon has quit [Read error: Connection reset by peer]
n008f4g_ has joined #ruby
bim has joined #ruby
OrbitalKitten has joined #ruby
ghr has quit [Ping timeout: 272 seconds]
dANO_ has quit []
a346 has quit [Read error: Connection reset by peer]
eighthbit has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
c0m0 has quit [Ping timeout: 256 seconds]
bim has quit [Remote host closed the connection]
lyuben_ has joined #ruby
Takle has joined #ruby
SegFaultAX has quit [Excess Flood]
SegFaultAX has joined #ruby
benlieb has quit [Quit: Leaving]
bim has joined #ruby
ghostpl_ has quit [Remote host closed the connection]
rbennacer has quit [Remote host closed the connection]
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
x1337807x has joined #ruby
Limix has quit [Quit: Limix]
bronson has joined #ruby
chthon has quit [Ping timeout: 264 seconds]
epistrephein has joined #ruby
eighthbit has joined #ruby
Jackneill has joined #ruby
SouL_ has joined #ruby
rbennacer has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
bronson has quit [Ping timeout: 252 seconds]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ki0 has joined #ruby
Takle has quit [Ping timeout: 246 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
jerius has quit [Quit: /quit]
bim has quit [Remote host closed the connection]
Xoro has joined #ruby
Takle has joined #ruby
RegulationD has quit [Remote host closed the connection]
taiansu has quit [Read error: Connection reset by peer]
<elfuego>
but it isn’t working out
Outlastsheep is now known as zz_Outlastsheep
taiansu has joined #ruby
Mives has joined #ruby
<Hirzu>
What are you trying to achieve?
NoNMaDDeN has joined #ruby
jerius has quit [Quit: /quit]
<Hirzu>
with rspec, you can atleast create stubs rather easily for intances of a class, or modify the existing class for tests.
jerius has joined #ruby
<Hirzu>
Not sure how it works in before each, maybe it does.
eighthbit has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
elfuego: I guess the expectation later overrides the stub? try adding .and_return there
<phale>
you dont
mengu has quit []
<jhass>
elfuego: an actual problem description (like error messages you get) would help though
<phale>
error: I am dumb and I can't program properly In Ruby
zorak8 has quit [Read error: Connection reset by peer]
<jhass>
phale: ?
<Alina-malina>
what secure web framework would you suggestfor ruby, to start developing webapps and services online?
<phale>
;)
zorak8 has joined #ruby
oetjenj has joined #ruby
<jhass>
Alina-malina: what insecure do you know?
<jhass>
what makes them insecure?
<elfuego>
jhass: undefined local variable or method `add_to_mdc'
<Hirzu>
stub name should atleast be symbol?
<Alina-malina>
i dont know any
<jhass>
elfuego: what Hirzu said
sivoais has quit [Ping timeout: 255 seconds]
eighthbit has joined #ruby
<phale>
elfuego: I assume add_to_mdc doesn't exist
<jhass>
Alina-malina: can you get less abstract about your project then?
<phale>
duh
iliketur_ has quit [Quit: zzzzz…..]
mitchellhenke has quit [Ping timeout: 245 seconds]
ghostpl_ has joined #ruby
<Alina-malina>
well its an app that works with angularjs and php right now, but i need to replace php with something more serious, i looked only python flask, but i also need to know ruby frameworks as well to compare and decide what to choose
sambao21 has quit [Quit: Computer has gone to sleep.]
caveat- has quit [Ping timeout: 245 seconds]
<jhass>
Alina-malina: still too vague to suggest one thing over the other really
sinkensabe has joined #ruby
<phale>
jhass: I want to program, oh boy where do I start :D
<jhass>
phale: in your mind, searching for an idea
ndrei has joined #ruby
sivoais has joined #ruby
<Alina-malina>
jhass, what frameworks do you use to develop website backend?
sambao21 has joined #ruby
eighthbit has quit [Client Quit]
<phale>
Okay I got an idea
caveat- has joined #ruby
<jhass>
Alina-malina: only rails, sinatra and rack directly so far, but we got many more
<phale>
i want to make my own language, and I'll cal it ruby!
zorak8 has quit [Read error: Connection reset by peer]
<baweaver>
Alina-malina: This is going to probably get me some flak, but don't replace PHP if you don't really need to
<jhass>
phale: nobody stopping you, good luck!
<phale>
ruby != Ruby
<phale>
so i can't get sued, right?
<baweaver>
the 'serious language' conundrum doesn't help your end user
sigurding has joined #ruby
zorak8 has joined #ruby
eighthbit has joined #ruby
<phale>
int main(void) { Ruby programming language start program and load everything, but first help me by printing this "hello, world\n", Then return 0. }
<baweaver>
Professional work entails making certain compromises, Facebook being one of the most famous ones out there.
<Alina-malina>
hmmmm, well i am tired of php code, i am looking right now into python flask, i have website that works fine on php, but it is kinda website not app, so i want to make an API to serve the app that i am currently working on with angular.js, i dont want php to do the job, so i need some API oriented solution, preferably on ruby
<baweaver>
depending on how much you have invested already, starting over may be a very bad idea
<baweaver>
the question is what your app is and what your current load is
<baweaver>
if it's for fun, sure, burn it all
ghostpl_ has quit [Ping timeout: 265 seconds]
sinkensabe has quit [Ping timeout: 246 seconds]
<arup_r>
> "1,4,5,".split(",")
<baweaver>
if you already have customers to a significant margin, you're asking for problems
<elfuego>
phale: it exist, but I want to fake the object
milesmatthias has quit [Remote host closed the connection]
<baweaver>
Alina-malina: You do realize PHP can do RESTful APIs as well right? There's a thing about Turing Complete languages.
eighthbit has quit [Client Quit]
<centrx>
PHP is crap
<phale>
elfuego: You can do that.
Tuxero has joined #ruby
<phale>
With a text editor.
<baweaver>
centrx: irrelevant
<jhass>
elfuego: stub and receive takes a symbol, instead you call a non-existing method
<Hirzu>
If I was asked, getting away from PHP is never bad idea
<baweaver>
Depending on whether or not there's a large user base it's a very bad idea
_maes_ has joined #ruby
sivoais has quit [Ping timeout: 252 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iamjarvo has joined #ruby
<baweaver>
refactoring and rewriting an entire codebase does no good for your customer
twistedpixels has quit [Changing host]
twistedpixels has joined #ruby
<baweaver>
other than appease some religious zealotry.
<baweaver>
The safer way would be to factor out services and do it piece by piece if you're already a large company.
<baweaver>
if it's a small audience, early stage, or for fun I would ditch it
<Hirzu>
yep, doing it in controlled manner, definately.
<baweaver>
now would I ever start with it? Not a chance
<Hirzu>
:)
<centrx>
Companies refactor and rewrite entire codebases even without changing language
iliketurtles has joined #ruby
<baweaver>
but not everyone has the capacity to wantonly replace an entire codebase
<baweaver>
change the language and framework and you get more than just code
lkba has quit [Ping timeout: 245 seconds]
<baweaver>
you get deployment
<baweaver>
server setup
<baweaver>
tooling
<baweaver>
testing practices
<phale>
omg
<phale>
I can't program anymore!!!
atomiccc has joined #ruby
altamic has joined #ruby
<baweaver>
tons of fun bits that probably never come up until you're up at 2am supporting something you have no idea how it works.
<Hirzu>
Depending on size of codebase, it might be a long period of painful hybrid codebase. Not nice.
sivoais has joined #ruby
phutchins has quit [Ping timeout: 256 seconds]
<phale>
Programmin is for noobs
<phale>
;)
<baweaver>
I agree that PHP isn't a good language, but the all at once approach has a higher than average likelihood of screwing something up a lot worse.
<Hirzu>
agreed
<baweaver>
consider Twitter and Rails
taiansu has quit [Remote host closed the connection]
<phale>
I love twatter
<baweaver>
they steadily migrated parts to Scala, chunking off into services
<Hirzu>
If it has good coverage of automated UI tests, it helps a bit.
<phale>
twitter*
<baweaver>
It does
<baweaver>
still a royal pain though
<phale>
baweaver: stop trolling
<phale>
goa way
taiansu has joined #ruby
<baweaver>
another candidate for my mute list already?
aclearman037 has joined #ruby
adamjleonard has quit [Ping timeout: 246 seconds]
<baweaver>
the point is, be pragmatic
shadoi1 has joined #ruby
mjuszczak has joined #ruby
<phale>
baweaver: I'm serious
<phale>
I'll get apeiros to ban you.
aclearman037 has quit [Client Quit]
<centrx>
PHP is siouerus business
<jhass>
phale: why don't you go and do something productive?
<baweaver>
We're having a discussion. I'm merely stating that dumping an entire codebase 'because PHP' isn't always a good idea.
<baweaver>
I don't like PHP, I don't use PHP, I don't intend to.
<phale>
I am
aclearman037 has joined #ruby
<baweaver>
Problem is you can substitute PHP and Rails with Rails and Scala
<baweaver>
or any other combination
<Fraeon>
Dumping code because it's PHP is always a good idea
<Fraeon>
Just like dumping an employee that's an ISIS supporter
* baweaver
facepalms
<centrx>
baweaver, PHP is uniquely bad
<baweaver>
It is
<phale>
baweaver: stop trolling or i'll hack op and ban u
<phale>
brb
<baweaver>
You notice I don't disagree there
<eam>
I'm not sure I'd say "uniquely" bad, but it certainly isn't good
<eam>
there's a lot of bad stuff out there
<baweaver>
I'm saying for a large company the 'burn it all' approach doesn't work
<phale>
since when did this channel go from ruby discussion to shitty web application developing language discussion?
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mistermocha has joined #ruby
jerematic has quit [Remote host closed the connection]
parduse has quit []
Jiyuhen has joined #ruby
bronson has quit [Ping timeout: 245 seconds]
wldcordeiro_ has quit [Quit: Leaving]
gz_rain has joined #ruby
oetjenj has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
agrinb has quit [Ping timeout: 256 seconds]
rbennacer has quit [Remote host closed the connection]
hiyosi has joined #ruby
crueber has quit [Quit: Leaving.]
agrinb has joined #ruby
Aswebb_ has joined #ruby
patrick99e99 has joined #ruby
parduse has joined #ruby
agrinb has quit [Remote host closed the connection]
stylo has joined #ruby
<stylo>
hi
atomi has quit [Quit: restart bbiab]
Sid05 has quit [Quit: Sid05]
<stylo>
So the latest ruby releases got all performance improvements?
<stylo>
I just want to know
Sid05 has joined #ruby
ojacobson has quit [Quit: Leaving...]
<wallerdev>
what do you mean by latest?
<wallerdev>
2.2.1?
<stylo>
yes
<wallerdev>
compared to 2.2.0?
<wallerdev>
or what
<wallerdev>
haha
craigp has quit [Remote host closed the connection]
<wallerdev>
i dont think there were major performance implications in 2.2.1?
lizander has quit [Quit: lizander]
gz_rain has quit []
bim has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
jespada has joined #ruby
nii2361 has joined #ruby
atomi has joined #ruby
Sid05 has quit [Client Quit]
dfinninger has quit [Remote host closed the connection]
kolorados has quit [Quit: Leaving]
patrick99e99 has quit [Quit: leaving]
sambao21 has quit [Quit: Computer has gone to sleep.]
lucianosousa has joined #ruby
patrick99e99 has joined #ruby
hmsimha has joined #ruby
sngeth has quit [Ping timeout: 245 seconds]
apeiros_ has quit [Remote host closed the connection]
nii2361 has quit [Ping timeout: 264 seconds]
apeiros_ has joined #ruby
CustosLimen has quit [Quit: Leaving]
rbennacer has joined #ruby
symbol has quit [Ping timeout: 264 seconds]
jerematic has joined #ruby
DouweM has quit [Read error: Connection reset by peer]
sngeth has joined #ruby
serivich has joined #ruby
Vulcan090 has joined #ruby
milesmatthias has quit [Remote host closed the connection]
mistermocha has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
mistermocha has joined #ruby
ghostmoth has quit [Quit: ghostmoth]
zachrab has quit [Remote host closed the connection]
bim has joined #ruby
lnr has joined #ruby
dj_zubehoer has quit []
<weaksauce>
is there a way to find out where the rake task is actually running?
<weaksauce>
the source location
plashchynski has joined #ruby
baweaver has quit [Remote host closed the connection]
relix has quit [Read error: Connection reset by peer]
relix has joined #ruby
Mives has quit [Quit: WeeChat 1.1.1]
BlackMustard has joined #ruby
<jhass>
mh, try p caller
<Radar>
^
baroquebobcat has quit [Quit: baroquebobcat]
<stylo>
ok
graydot has quit [Quit: graydot]
Takle has joined #ruby
symbol has joined #ruby
n80 has joined #ruby
Takle has quit [Read error: Connection reset by peer]
symbol has quit [Client Quit]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graydot has joined #ruby
ptrrr has quit [Quit: ptrrr]
BlackMustard has quit []
jerematic has quit [Remote host closed the connection]
<zenspider>
huh. I'm trying to push something to github and it just HANGS on a particular object
<zenspider>
4795/5122 ... just sits there
BlackMustard has joined #ruby
BlackMustard has quit [Max SendQ exceeded]
Yzguy_ has joined #ruby
HOrangeJewce has joined #ruby
Aswebb_ has quit []
<dogweather>
zenspider: is it way freaking big? GitHub has various limits
hidomel has joined #ruby
BlackMustard has joined #ruby
BlackMustard has quit [Max SendQ exceeded]
<zenspider>
not that I know of... but *shrug* not my code. I'm just trying to push about 2 years worth of updates + a small branch on my side
BlackMustard has joined #ruby
BlackMustard has quit [Max SendQ exceeded]
BlackMustard has joined #ruby
BlackMustard has quit [Max SendQ exceeded]
<zenspider>
wow... it's really just sitting there :(
avahey has joined #ruby
adriancb has joined #ruby
agrinb has joined #ruby
Cache_Money has joined #ruby
<jhass>
zenspider: no network activity? (check an external monitor)
hidomel has quit [Ping timeout: 250 seconds]
serivich has quit [Ping timeout: 255 seconds]
Sawbones has joined #ruby
<dogweather>
try `du -sh` in the root directory and see how much space it's using
<zenspider>
jhass: maybe? I can't tell
<zenspider>
too much chatting on my laptop :)
Limix has quit [Quit: Limix]
<zenspider>
it's about 87 meg even after running my `git skinny` thingy.
<zenspider>
so, not that big really
werelivinginthef has joined #ruby
<jhass>
zenspider: probably don't have nethogs available?
<jhass>
lists traffic per process/app
<jhass>
quite handy
<zenspider>
activity monitor def shows SOMETHING going on while it is running, but the actual git processes involved don't register any packets. prolly not talking at the right level for activity monitor
claw has quit [Ping timeout: 250 seconds]
plashchynski has quit [Quit: plashchynski]
<zenspider>
apparently not. not even in homebrew
<jhass>
yeah, probably uses linux specifc api
<zenspider>
welp... it's pushing SOMETHING. the numbers update periodically on total size written... but DAMN ... never seen it this slow
<zenspider>
this is worse than svn
nilobject has joined #ruby
<zenspider>
and I say that as someone who's run svn in the last week
jottr has quit [Ping timeout: 272 seconds]
<jhass>
did you dare to ctrl+c and retry yet?
shtirlic has quit [Ping timeout: 252 seconds]
<jhass>
sometimes you just seem to hit a slow box at GH
claw has joined #ruby
juanpablo__ has quit [Quit: (null)]
Phage has quit [Ping timeout: 252 seconds]
Trieste has quit [Ping timeout: 252 seconds]
msimkins has quit [Ping timeout: 252 seconds]
juanpablo__ has joined #ruby
<zenspider>
jhass: twice :(
<zenspider>
I'm not a patient person
artmann_ has quit [Quit: No Ping reply in 210 seconds.]
<jhass>
ah, bummer
artmann has joined #ruby
CustosLimen has joined #ruby
Guest9519 has quit [Ping timeout: 252 seconds]
werelivinginthef has quit [Ping timeout: 264 seconds]
rbennacer has quit [Remote host closed the connection]
Hijiri has quit [Ping timeout: 252 seconds]
Trieste has joined #ruby
rbennacer has joined #ruby
<jhass>
might just delete fork and fork again
shtirlic has joined #ruby
ElderFain has quit [Excess Flood]
<jhass>
though I'd let it sit for 20 minutes or so personally
revoohc has quit [Quit: revoohc]
Olipro has joined #ruby
<zenspider>
yup. I'm getting paid to push :)
ElderFain has joined #ruby
Sawbones has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
GaryOak_ has quit [Remote host closed the connection]
<zenspider>
no such thing
rbennacer has joined #ruby
juanpablo___ has quit [Ping timeout: 272 seconds]
lucianosousa has quit [Ping timeout: 252 seconds]
zorak8 has quit [Ping timeout: 272 seconds]
cpt_yossarian has quit [Ping timeout: 256 seconds]
mitchellhenke has joined #ruby
meschi has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
meschi has joined #ruby
<jhass>
git log should show related commits anyhow
<jhass>
git log lib/ruby/...
BlackMustard has joined #ruby
mikepack has quit [Remote host closed the connection]
<jhass>
er git log -- lib/ruby
serivich has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
coderhs has joined #ruby
oetjenj has joined #ruby
juanpaucar has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby
thiagovsk has quit [Quit: Connection closed for inactivity]
krisquigley has joined #ruby
<zenspider>
git log lib/ruby/1.9/openssl/ext/core
<zenspider>
fatal: ambiguous argument 'lib/ruby/1.9/openssl/ext/core': unknown revision or path not in the working tree.
<zenspider>
I DO get output with the -- added... hrm. but the commets were from feb 2013 :)
<zenspider>
can't I just merge shit on github and then push my differences?
jottr has joined #ruby
charliesome has joined #ruby
<zenspider>
ya know... at the very least, I can nuke my fork and re-fork
<zenspider>
that'll do just as well I'd think
<jhass>
yeah, that's what I meant earlier
BlackMustard has left #ruby [#ruby]
<jhass>
you could open a PR from upstream to your fork though
meschi has quit [Remote host closed the connection]
<zenspider>
hrm
plashchynski has quit [Quit: plashchynski]
meschi has joined #ruby
<jhass>
you basically go to compare view for that choose your fork as base and upstream as the other one
<jhass>
but that's about as much work as reforking anyway
patrick99e99 has quit [Quit: leaving]
relix has joined #ruby
iliketurtles has joined #ruby
krisquigley has quit [Ping timeout: 265 seconds]
baweaver has joined #ruby
bruno- has quit [Ping timeout: 245 seconds]
graydot has quit [Quit: graydot]
cpt_yossarian has joined #ruby
ghr has quit [Ping timeout: 256 seconds]
nii2361 has joined #ruby
sngeth has quit [Ping timeout: 256 seconds]
<JimmyNeutron>
I'm not clear on how this is sorting reverse: Ex. fruits = ["orange", "apple", "banana", "pear", "grapes"] fruits.sort! { |fruit_1, fruit_2| fruit_2 <=> fruit_1 } I understand the <=> does a comparison and returns -1, 0, 1
zorak8 has joined #ruby
<JimmyNeutron>
but how does it gets places back into the array?
<zenspider>
how? who cares? It just does
<JimmyNeutron>
i'm trying to understand it instead of just doing it to get the correct answer. :)
bim has quit [Remote host closed the connection]
<jhass>
JimmyNeutron: a, b, if the block returns a negative number, a < b, a is sorted before b, if the block returns a positive number, a > b, b is sorted before a
<Cat_1>
What is "orange" < "apple"
Sawbones has quit [Remote host closed the connection]
<zenspider>
JimmyNeutron: there's a difference between understanding WHAT sort does vs HOW it does it. implementation detail.
<JimmyNeutron>
jhass, So it's automatically put into place base on the return value?
<zenspider>
unless you're in a CS course and you're trying to write a sort algorithm... in which case, don't use ruby's sort
<jhass>
well, "automatically", the entire point of that method is to sort
lucianosousa has joined #ruby
thumpba has quit [Ping timeout: 246 seconds]
<jhass>
the block return values determine which elements are considered bigger than the others