commondream has quit [Remote host closed the connection]
<pontiki>
we had a term in our consulting practice for this: "They're in violent agreement"
sfarley has joined #ruby
netmask has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<jhass>
haha, I know that situation
<Senjai>
pontiki: hahahahaa
<pontiki>
indeed, i'm pretty sure everyone's lived through it, several times. it's still tough to recognize when one's in the midst of doing it yet again
<t-richards>
What's the most idiomatic way to express "append value 'foo' to array if it exists, otherwise, initialize array to ['foo']"?
dopie has joined #ruby
sfarley has quit [Remote host closed the connection]
<jhass>
array ||= []; array << value (; in IRC are newlines in code)
arooni-mobile has joined #ruby
<zenspider>
The most idiomatic way is to actually set your variables
<jhass>
that's a good idea too
wildroman2 has quit [Remote host closed the connection]
<volty>
>> (a =|| []).push(3)
<ruboto>
volty # => /tmp/execpad-2da003ca0818/source-2da003ca0818:2: syntax error, unexpected || ...check link for more (https://eval.in/387261)
fabrice31 has quit [Ping timeout: 244 seconds]
<t-richards>
zenspider: haha, if only it were that easy :)
marr has quit [Ping timeout: 272 seconds]
<eam>
sometimes it's a value of a hash/array
greensoup has quit [Ping timeout: 255 seconds]
<jhass>
volty: and there you destroyed my hope of that example not coming :(
<eam>
autoviv in ruby is somewhat clumsy
<jhass>
t-richards: why isn't it that easy?
<volty>
jhass: I understand, but I had to use it (somewhere, can't remember where) :)
serivichi has joined #ruby
<t-richards>
Like eam said, sometimes hash values aren't present and you have to deal with that
<volty>
generally i am against it
<jhass>
volty: it's often used in in inject/reduce misuse
<eam>
jhass: one example is the classic interview question: count word frequency in some text (initializing integers instead of array, but same fundamental issue)
<jhass>
which then usually is meant to be an each_with_object
<jhass>
eam: Hash.new(0) ?
<baweaver>
>> h = Hash.new { 0 }; h[:a] += 5; h[:b] += 10; h
<volty>
jhass: never there, i have (somewhere) very obscure code that catches some events on fly -- very particular, and exceptional
<eam>
its gets complicated
<t-richards>
jhass: thanks, exactly what I was looking for
<eam>
even moreso if you're doing multilevel hash/array stuff
<jhass>
t-richards: it's a local variable in your real code too?
<baweaver>
Always safer to use the block as it gets reevaluated as the default proc every time a key is missing
serivich has quit [Ping timeout: 272 seconds]
<eam>
baweaver: yeah, which is necessary if the values are Hash or Array
<t-richards>
jhass: No, I suppose my example was a bit misleading in that regard. My real "array" is really one of many values in a hash (that may or may not be present)
<jhass>
t-richards: Hash.new {|h, k| h[k] = [] }
<zenspider>
baweaver: it isn't always safer. fixnum is a fine example of that
<baweaver>
eam: pretty much, that tends to bite people a lot.
jlast has joined #ruby
<baweaver>
granted.
<t-richards>
I didn't want to go for a default hash value, since it's not going to be the same for all missing keys
<volty>
ah, yes, used with hashes too.
<baweaver>
anything that doesn't pass a value
<zenspider>
the problem with those forms (and understand I use them all the time) is that you now have a proc attached to the object so you can't marshal it w/o jumping through hoops
<volty>
I like hashes that grow alone :)
danielpclark has quit [Ping timeout: 246 seconds]
bronson has quit [Remote host closed the connection]
<volty>
(by themselves)
<zenspider>
t-richards: what you're describing is using a hash like an object. poorly. I suggest you use actual objects that retain their own logic and can maintain their own state.
<zenspider>
(not to say that hashes aren't objects... but you know what I mean)
<volty>
what for (that object)? @ t-richards
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<eam>
I think there's value in reusing simple structures over objects - easy to understand the interaction rules
<baweaver>
trying to use hashes deeply is a hack implementation of FP in most cases without the benefit of functional datastructures.
<eam>
I run into this issue in one-liner throwaway code all the time
<eam>
damn right it's a hack, but ... :)
<volty>
I do not want to promote to a class of mine an object that has to serve a trivial purpose
<baweaver>
It's called abstraction chicken
workmad3 has quit [Ping timeout: 252 seconds]
<baweaver>
will I finish before this all goes to hell or not
<t-richards>
jhass: I totally understand. This is all for a crappy jekyll plugin anyway - I'm not too concerned with extracting data into an object
<t-richards>
volty: Exactly this.
<jhass>
t-richards: check your target ;)
jlast has quit [Ping timeout: 255 seconds]
ajrob27 has joined #ruby
<t-richards>
jhass: I need to get a working proof-of-concept before I make it there :D
baweaver has quit [Remote host closed the connection]
sevenseacat has joined #ruby
<jhass>
nah, I mean zenspider was doing the follow up statement ;)
<volty>
yes, long live rude code that works. Class promotions only afterwards :)
dopie has quit [Quit: This computer has gone to sleep]
robustus has quit [Ping timeout: 264 seconds]
bayed has quit [Quit: Connection closed for inactivity]
theery has joined #ruby
<eam>
just redefine [] on the instance
<volty>
top - bottm & bottom - up — in parallel. Though it all depends on the problem and on one's skill.
bronson has joined #ruby
<jhass>
eam: how's that different from putting the logic you'd but there into the default_proc?
<eam>
it's uglier?
Yiota has joined #ruby
havenwood has quit [Ping timeout: 246 seconds]
<jhass>
hmm
<volty>
agree with jhass
<eam>
(it's a joke)
baweaver has joined #ruby
axl__ has quit [Quit: axl__]
shazaum_ has joined #ruby
<volty>
i found no value in defining instance methods
<eam>
it's a great way to mess with people
<_blizzy_>
I almost wish I kept the code the way it was
<t-richards>
s/mess with/infuriate
<_blizzy_>
I'm more confused than I was before.
scripore has joined #ruby
geiltalasdair has joined #ruby
robustus has joined #ruby
<volty>
very rarely you need an instance method, and just for readability
arooni-mobile has quit [Ping timeout: 248 seconds]
ajrob27 has left #ruby [#ruby]
<volty>
sorry _blizzy_ but I can't imagine something worse :)
<_blizzy_>
volty, it wasn't that bad to me.
axl__ has joined #ruby
<_blizzy_>
it seems like people think that big = bad
<_blizzy_>
:/
<volty>
_blizzy_: could be, if it was enough for you to only look at your code (did it work?)
axl__ has quit [Client Quit]
<_blizzy_>
volty, yes, minus one bug
<pontiki>
_blizzy_: are you using git or some other version control?
<volty>
_blizzy_: you didn't erase your old files, did you ?
geilt has quit [Ping timeout: 248 seconds]
<_blizzy_>
volty, no.
<_blizzy_>
pontiki, yes.
danielpclark has joined #ruby
rubie has quit [Remote host closed the connection]
blackmesa has quit [Quit: WeeChat 1.2]
rubie has joined #ruby
theery has quit [Remote host closed the connection]
<_blizzy_>
I'm stuck
<_blizzy_>
if I keep it the way it is, I'll get jumped on
<_blizzy_>
but if I change it, I'll be more confused
<_blizzy_>
:/
geilt has joined #ruby
geiltalasdair has quit [Read error: Connection reset by peer]
duoi has quit [Quit: duoi]
<Aeyrix>
<joepie91> snake case causes too much syntax cruft - it reduces readability
<Aeyrix>
;_;
<Aeyrix>
<joepie91> lowerCamelCase is okay
jenrzzz has quit [Ping timeout: 272 seconds]
<_blizzy_>
ugh, fuck this
<_blizzy_>
I'm confused and mad now
duoi has joined #ruby
GitGud is now known as GitStud
bronson has quit [Remote host closed the connection]
riskish has joined #ruby
duderonomy has joined #ruby
dopie has joined #ruby
<eam>
/win 1
<sevenseacat>
trollolololol?
<Aeyrix>
no
<Aeyrix>
he was serious
pengin has quit [Remote host closed the connection]
<Aeyrix>
he is serious
<Aeyrix>
he also prefers tabs
<Aeyrix>
i need emotional support, here
serivichi has quit [Quit: Leaving]
<pontiki>
_blizzy_: it's ok to put it up and away, work on something else for a while, take a walk, lay on the grass, etc
<eam>
wait what
<_blizzy_>
pontiki, it's not that
<jhass>
_blizzy_: it is, trust us
<pontiki>
_blizzy_: i think *everyone* gets cussing angry and confused
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki>
_blizzy_: what is it?
<pontiki>
am i lagged??
aryaching has joined #ruby
<_blizzy_>
WAIT
<volty>
as already said, he needs to implement a state-of-the-art tic-tac-toe game first. And my nose tells me that we are after same old whining «trollo-beginner» that happens from time to time.
oo_ has joined #ruby
Trynemjoel has quit [Ping timeout: 272 seconds]
<_blizzy_>
how am I trolling?
<volty>
:). have a good night
<_blizzy_>
....
volty has quit [Quit: Konversation terminated!]
<_blizzy_>
thank god
<Aeyrix>
Obligatory reminder on both sides that this is, first and foremost, a channel for learning and help.
<pontiki>
_blizzy_: i don't think the trolling claim was aimed at you...
<sevenseacat>
it wasn't.
sarmiena_ has quit [Ping timeout: 248 seconds]
oo_ has quit [Remote host closed the connection]
<pontiki>
Aeyrix: indeed.
ixti has quit [Ping timeout: 256 seconds]
oo_ has joined #ruby
commondream has joined #ruby
<pontiki>
some poeple come with their cup already overflowing demanding the teach keep filling it
<Radar>
get_team in a completely separate file with no indication of how it's linked to the original? Pass.
<_blizzy_>
I just noticed that they are not linked
<_blizzy_>
thanks, Radar
theery has quit [Remote host closed the connection]
nettoweb has joined #ruby
Rickmasta has joined #ruby
theery has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
jtdoncas has joined #ruby
PaulCapestany has joined #ruby
marciotex has joined #ruby
Agoldfish has quit [Quit: G'Bye]
nobitanobi has quit [Remote host closed the connection]
<_blizzy_>
ok, I updated the gist again, Radar c:
<Radar>
c:\\nope.jpg
<_blizzy_>
why nope?
<Radar>
a.rb and b.rb aren't the real filenames
<Radar>
And if I wanted to look at 150 lines of terrible code there's parts of the app that I work on erryday that are like that
<sevenseacat>
assuming the second file is the helpers.rb
<Radar>
sevenseacat: you know what they say about cliches
Igorshp has joined #ruby
* _blizzy_
sighs
<_blizzy_>
ok
<sevenseacat>
lol
<sevenseacat>
you make an ass out of you and... iche?
juanpaucar has quit [Remote host closed the connection]
<_blizzy_>
there I updated the gist with the correct file names
<_blizzy_>
and I wouldn't call it terrible code
Igorshp has quit [Remote host closed the connection]
<_blizzy_>
:/
<Aeyrix>
Radar: >:(
<Radar>
Aeyrix: _blizzy_ has been doing it long enough and should know better by now.
<sevenseacat>
i'd call it incomprehensible code, looking at it from the outside
<sevenseacat>
but anyway, whats the problem with it?
<Radar>
Steps to reproduce the problem plzkthx
<_blizzy_>
sevenseacat, may I pm you?
<sevenseacat>
I'd prefer you didn't.
<_blizzy_>
ok.
<sevenseacat>
if its about the code, we can discuss it here.
<_blizzy_>
it's not about the code.
<_blizzy_>
it's about something else.
freerobby has joined #ruby
<sevenseacat>
okay, sure.
<pontiki>
_blizzy_: 3 questions: 1) does it work? 2) how do you know it works? 3) do you understand why it works?
simplyaubs has quit [Quit: simplyaubs]
<al2o3-cr>
why is ws not an instance variable?
<_blizzy_>
I've been refactoring this code for the past hour
DoubleMalt has quit [Ping timeout: 256 seconds]
ziprar is now known as zipace
<_blizzy_>
why is ws not a instance variable? this is still a rough rough draft.
jenrzzz has joined #ruby
<_blizzy_>
I'm still making changes.
inoic has quit [Ping timeout: 244 seconds]
<al2o3-cr>
ah, okay dokay no worries :)
<sevenseacat>
so, whats the problem with it?
<_blizzy_>
well, I've been using byebug, and after the line where @team is assigned to get_team(), @team has a hash. however, a few lines down, @team gets reset to 'nil' for some reason.
<sevenseacat>
and where is that
<sevenseacat>
and where is it nil
<_blizzy_>
@team?
<zenspider>
you had to make him rename it... now the diffs aren't as good
dorei has quit []
<_blizzy_>
@team is nil at line 67
<sevenseacat>
and where are you setting it to not nil
<_blizzy_>
even though it is assigned a value at line 46.
<sevenseacat>
if you say 46 I'm goin gto be grumpyu
<_blizzy_>
.
<_blizzy_>
well then.
fabrice31 has joined #ruby
<sevenseacat>
they're two different branches of the same case statement
<sevenseacat>
only one will execute
<zenspider>
I really wouldn't call what you've done over the past hour "refactoring". you've moved one hunk of code to a different file as far as I can see
<_blizzy_>
zenspider, I'm splitting up the file
<_blizzy_>
into tiny methods
<zenspider>
not yet you're not
<_blizzy_>
I am.
<_blizzy_>
the file isn't as long as it was like 2 hours ago.
<sevenseacat>
if line 67 runs, like 46 isnt running.
<sevenseacat>
*line
fgo has joined #ruby
slackbotgz1 has quit [Remote host closed the connection]
<_blizzy_>
the method 'run' is being ran (heh) multiple times
slackbotgz has joined #ruby
<zenspider>
you know we can see all the revisions, right?
<_blizzy_>
yes.
<_blizzy_>
I know.
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Radar>
I don't see where the run method is being called at all.
<_blizzy_>
I'm not pasting entire files into gist. I'm only pasting what is needed to find the solution.
<sevenseacat>
ok, some more information
<sevenseacat>
where are you calling this run method from?
<Radar>
If we had some steps to reproduce the error that you're seeing that would really help us.
<sevenseacat>
_blizzy_: you're posting little enough o frustrate the people trying to help you
Igorshp has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
<Ox0dea>
scripore: Construct the new "alphabet" and translate to it from the standard one.
<scripore>
oh, that's neat. I wasn't aware of that method.
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Igorshp has joined #ruby
Scroff has joined #ruby
Igorshp has quit [Remote host closed the connection]
hatzopoulos has quit [Quit: Leaving]
greenbagels has joined #ruby
jlast has quit [Ping timeout: 252 seconds]
Igorshp has joined #ruby
<_blizzy_>
so what if I'm supposed to do if no one will attempt to help me find the bug, but no one will point out what exactly is wrong with my code? :/
greenbagels has quit [Max SendQ exceeded]
prereflect has joined #ruby
Deele has quit [Ping timeout: 256 seconds]
<pontiki>
take a break, come back tomorrow
Igorshp has quit [Remote host closed the connection]
findaway has quit [Quit: findaway]
<_blizzy_>
I'm trying to refactor my code, but it seems like I'm getting kicked down everytime I try. :/
<_blizzy_>
discourages me.
<_blizzy_>
pontiki, good idea.
Igorshp has joined #ruby
<Ox0dea>
I think it's a great idea. Give your background mind time to think things over.
<_blizzy_>
ok.
<_blizzy_>
and I'm trying to shorten the file.
<_blizzy_>
got it to around 130 atm. :)
<_blizzy_>
well, 132.
Igorshp has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 252 seconds]
eggoez has quit [Ping timeout: 246 seconds]
Scroff has quit [Ping timeout: 272 seconds]
prereflect has quit [Client Quit]
al2o3-cr has quit [Quit: WeeChat 1.2]
Igorshp has joined #ruby
<Ox0dea>
"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." -- Bill Gates
al2o3-cr has joined #ruby
findaway has joined #ruby
Igorshp has quit [Remote host closed the connection]
<_blizzy_>
well, people here seem to like that shorter == better.
<_blizzy_>
so IDK anymore. :/
<scripore>
@Ox0dea, thanks, it worked wonderfully!
<Ox0dea>
scripore: Nice! Are you handling capitals, though? :)
<scripore>
I added .downcase to the encoded string
<Aeyrix>
_blizzy_: People here like clean and segmented, better.
<Aeyrix>
The reason is twofold:
<Aeyrix>
A> Easier to read
Igorshp has joined #ruby
<Aeyrix>
B> Easier to debug <-- Important for this current situation
<Ox0dea>
scripore: That feels "hackish", but all right.
<_blizzy_>
Aeyrix, oh.
<Aeyrix>
You've been in and out of this channel for a while now with code of varying degrees of similarity. What isn't clicking?
<Aeyrix>
Someone isn't telling you something, or someone is telling you something and you're ignoring it.
<Aeyrix>
I don't know, I don't pay attention here all the time.
<Ox0dea>
The "someone" in there might well be _blizzy_.
<scripore>
hmm, I should probably make it better then. I have a lot of time.
Igorshp has quit [Remote host closed the connection]
<Aeyrix>
Ox0dea: The someone is anyone *except* _blizzy_, given the context of my statement.
l0oky has quit [Read error: Connection reset by peer]
<_blizzy_>
I'm not ignoring anyone.
<Ox0dea>
I meant to imply that he might've settled on his laurels, paltry though they may be, far too early.
<Aeyrix>
_blizzy_: Whether intentionally or unintentionally, you may well be.
<Aeyrix>
How many times have you asked for help with the codebase you've linked?
<Aeyrix>
Not today, but over time.
Igorshp has joined #ruby
<_blizzy_>
Aeyrix, just today actually.
<Aeyrix>
Ah.
<Aeyrix>
One thing that struck me is your lack of splitting things out into separate objects.
<Aeyrix>
Player should be an object. PlayerTeam should be an object.
<Aeyrix>
PlayerTeam should just be Team.
<Aeyrix>
A Player should own a Team.
Igorshp has quit [Remote host closed the connection]
greenbagels has joined #ruby
<zenspider>
"<_blizzy_> I know what refactoring means." == I'm done with this
<Aeyrix>
The Opponent should own a Team.
datanoise has joined #ruby
<Aeyrix>
_blizzy_: Do you see what I'm getting at here?
<Aeyrix>
Split it down into small, reusable, manageable chunks.
<_blizzy_>
Aeyrix, this is using a Pokemon simulator.
<_blizzy_>
and it's a bot.
<Aeyrix>
I know.
<Aeyrix>
I also know.
<_blizzy_>
oh.
<Aeyrix>
I read the code.
<_blizzy_>
atm I'm breaking it down into smaller chunks.
Igorshp has joined #ruby
<Aeyrix>
Let me get some lunch, then I'll take a stab at writing a skeleton to help you.
<Aeyrix>
If you're still around, I don't know what time it is for you.
<Aeyrix>
I'll be about an hour.
nobitanobi has joined #ruby
<_blizzy_>
well, it's actually 10 pm where I am, so I'm going to bed soon. but thanks for the offer. :)
<Aeyrix>
Okay.
Igorshp has quit [Remote host closed the connection]
<Aeyrix>
If you're still around when I get back, I'll page you.
astrobun_ has quit [Remote host closed the connection]
Guest55661 has quit [Client Quit]
yfeldblum has quit [Quit: Leaving...]
al2o3-cr has joined #ruby
juanpaucar has joined #ruby
yfeldblum has joined #ruby
gix has joined #ruby
Ox0dea has left #ruby ["WeeChat 1.3-dev"]
s2013 has joined #ruby
oo_ has joined #ruby
netmask has quit [Remote host closed the connection]
Sypheren has joined #ruby
wallerdev has joined #ruby
netmask has joined #ruby
theery_ has quit [Remote host closed the connection]
speakingcode has joined #ruby
juanpaucar has quit [Ping timeout: 264 seconds]
astrobun_ has joined #ruby
cpruitt has joined #ruby
GitStud has quit [Read error: Connection reset by peer]
GitStud has joined #ruby
netmask has quit [Ping timeout: 264 seconds]
DoubleMalt has joined #ruby
mrmargolis has quit [Remote host closed the connection]
theery has joined #ruby
hahuang65 has joined #ruby
bigmac__ has joined #ruby
x44x45x41x4E has joined #ruby
kp666 has joined #ruby
arescorpio has joined #ruby
workmad3 has joined #ruby
mary5030 has quit [Remote host closed the connection]
balazs has quit [Remote host closed the connection]
keen___________2 has joined #ruby
balazs has joined #ruby
duderonomy has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
RobertBirnie has joined #ruby
keen___________1 has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 276 seconds]
bruno- has joined #ruby
GitStud has quit [Quit: My name is your name]
netmask has joined #ruby
GitStud has joined #ruby
bruno- has quit [Ping timeout: 276 seconds]
<zenspider>
spanish?
<zenspider>
ooooh... the foods.
icebourg has joined #ruby
netmask_ has joined #ruby
al2o3-cr has quit [Ping timeout: 272 seconds]
DexterLB has joined #ruby
netmask has quit [Ping timeout: 244 seconds]
<Radar>
zenspider is talking to himself again. *phones the asylum*
rubie has joined #ruby
Scroff has joined #ruby
cpruitt has quit [Quit: cpruitt]
oo_ has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
<zenspider>
it's far too late for that...
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rubie has quit [Ping timeout: 265 seconds]
scripore has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
tubuliferous_ has joined #ruby
Scroff has quit [Ping timeout: 264 seconds]
DoubleMalt has quit [Ping timeout: 250 seconds]
Kache4 has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: zzz]
jlast has joined #ruby
tubuliferous_ has quit [Ping timeout: 265 seconds]
failshell has joined #ruby
findaway has quit [Quit: findaway]
DoubleMalt has joined #ruby
nso95 has quit [Quit: nso95]
jtdoncas has joined #ruby
jlast has quit [Ping timeout: 246 seconds]
geiltalasdair has quit [Quit: Leaving]
scripore has quit [Quit: This computer has gone to sleep]
geiltalasdair has joined #ruby
geiltalasdair has quit [Client Quit]
geiltalasdair has joined #ruby
yeticry has quit [Ping timeout: 264 seconds]
yeticry has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
kies has joined #ruby
failshell has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 246 seconds]
baweaver has joined #ruby
netmask has joined #ruby
gianlucadv has joined #ruby
netmask_ has quit [Ping timeout: 256 seconds]
5EXABJCO3 is now known as baweaver_
baweaver has quit [Disconnected by services]
ramblinpeck_ is now known as ramblinpeck
baweaver_ is now known as baweaver
peter_paule has joined #ruby
hahuang65 has joined #ruby
deric_skibotn has joined #ruby
hanmac has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
djbkd has joined #ruby
bluOxigen has joined #ruby
wallerdev has quit [Quit: wallerdev]
al2o3-cr has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
commondream has joined #ruby
RegulationD has joined #ruby
peter_paule has quit [Ping timeout: 244 seconds]
arescorpio has quit [Quit: Leaving.]
oo_ has joined #ruby
solarradiation has quit [Quit: Leaving]
RegulationD has quit [Ping timeout: 246 seconds]
commondream has quit [Ping timeout: 255 seconds]
devdazed has joined #ruby
wallerdev has joined #ruby
laurentide has joined #ruby
hanmac has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Sembei has joined #ruby
Pisuke has quit [Ping timeout: 255 seconds]
icarus has joined #ruby
s2013 has joined #ruby
jenrzzz has joined #ruby
yardenbar has joined #ruby
ndrei has joined #ruby
bkxd has joined #ruby
netmask has quit []
casadei has quit [Remote host closed the connection]
nveselinov has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
passbe1 has joined #ruby
balazs has quit [Remote host closed the connection]
<passbe1>
I'm developing a ruby console program and would like to pause execution until the user hits enter (or they control+c). googling has provided me with highline but would rather something a little simpler
<passbe1>
ruby v2.1.1
EllisTAA has joined #ruby
<bnagy>
gets
ghostpl has joined #ruby
deric_skibotn has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has joined #ruby
psy_ has quit [Ping timeout: 246 seconds]
Deele has joined #ruby
icebourg has quit []
choke has joined #ruby
nateberkope has joined #ruby
nateberkopec has quit [Read error: Connection reset by peer]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jlast has joined #ruby
<shevy>
:)
<shevy>
don't you love simple questions
<shevy>
passbe1 wake up man!
<jtperreault>
simple answers even better ;)
jcaho has joined #ruby
<shevy>
yeah, if it is possible; well I guess for the most part it will be possible for simple questions, unless it's a domain-specific question like about a rare gem
aryaching has quit [Ping timeout: 276 seconds]
* passbe1
rushes off to the documentation about gets
last_staff has joined #ruby
<passbe1>
cheers shevy and bnagy
<baweaver>
alo shevy
simplyaubs has joined #ruby
<Radar>
alo then wats this we have here now?
<Radar>
You just read that in a British accent
jacor has quit [Ping timeout: 248 seconds]
ghostpl has quit [Remote host closed the connection]
ghostpl has joined #ruby
<baweaver>
I randomly switch accents on BART to see how many people I can throw off
jlast has quit [Ping timeout: 264 seconds]
nobitanobi has quit [Remote host closed the connection]
juanpaucar has joined #ruby
gauke has joined #ruby
<flughafen>
moin
<shevy>
flughafen ready for take-off?
<flughafen>
shevy: no
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
juanpaucar has quit [Ping timeout: 264 seconds]
EllisTAA has quit [Quit: EllisTAA]
arooni-mobile has joined #ruby
fabrice31 has joined #ruby
psy_ has joined #ruby
djbkd has quit [Quit: My people need me...]
theery has quit [Remote host closed the connection]
EllisTAA has joined #ruby
failshell has joined #ruby
bkxd_ has joined #ruby
datanoise has joined #ruby
bkxd has quit [Ping timeout: 250 seconds]
fabrice31 has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
datanoise has quit [Ping timeout: 252 seconds]
failshell has quit [Ping timeout: 265 seconds]
<shevy>
:P
workmad3 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
ValicekB has quit [Read error: Connection reset by peer]
swgillespie has joined #ruby
khebbie has joined #ruby
freerobby has quit [Quit: Leaving.]
sandstrom has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
tagrudev has joined #ruby
passbe1 has left #ruby ["WeeChat 1.2"]
workmad3 has quit [Ping timeout: 248 seconds]
havenwood has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
saadq has joined #ruby
<saadq>
Is there a way to make iTerm be opaque on startup? Usually when I open iTerm, it opens as transparent
<flughafen>
saadq: try #rubyonrails
arooni-mobile has quit [Ping timeout: 248 seconds]
<saadq>
Alright
lxsameer has joined #ruby
acke has joined #ruby
bruno- has quit [Ping timeout: 244 seconds]
acke has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 264 seconds]
emergion has joined #ruby
<flughafen>
saadq: there is an actually an #iterm2
ValicekB has joined #ruby
<saadq>
flughafen: yeah, I meant iTerm 2 lol
gauke has quit [Quit: gauke]
krz has joined #ruby
<flughafen>
no i mean there is a chatroom #iterm2 with people in it
Scroff has joined #ruby
t0rrieri has quit [Quit: Be back later ...]
jds has joined #ruby
x44x45x41x4E has quit [Ping timeout: 252 seconds]
gaucheph__ has joined #ruby
tubuliferous_ has joined #ruby
balazs has joined #ruby
Scroff has quit [Ping timeout: 265 seconds]
Musashi007 has quit [Quit: Musashi007]
gaucheph has quit [Ping timeout: 248 seconds]
<saadq>
flughafen: I feel foolish
codecop has joined #ruby
jenrzzz has joined #ruby
codecop_ has joined #ruby
codecop_ has quit [Remote host closed the connection]
balazs has quit [Ping timeout: 264 seconds]
tubuliferous_ has quit [Ping timeout: 264 seconds]
nahtnam has joined #ruby
Xoro has quit [Read error: Connection reset by peer]
Xoro has joined #ruby
<flughafen>
it's ok
<krowv>
Is there a commandline way to easily view more information about a function? For example, say I want information on the spawn method. Can I access that easily similar to like a man page for C functions?
ghostpl has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
riotjones has joined #ruby
jtdoncas has quit [Ping timeout: 252 seconds]
noname has quit [Ping timeout: 276 seconds]
chinmay_dd has joined #ruby
<ledestin>
krowv ri is slow. what's your OS?
AlphaAtom has quit [Client Quit]
ghostpl has joined #ruby
<krowv>
ledestin, ubuntu 15.04
<ledestin>
krowv then your best choice is pry
saadq has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
abuzze has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
ejnahc has quit [Quit: leaving]
AlphaAtom has joined #ruby
ejnahc has joined #ruby
<krowv>
ledestin, ok, trying to use either ri or pry to view the spawn method.
ghostpl has quit [Remote host closed the connection]
ghostpl has joined #ruby
<krowv>
using ri: >> spawn
<krowv>
Nothing known about .spawn
gauke has joined #ruby
<krowv>
[1] pry(main)> show-method spawn
<krowv>
Error: Cannot locate this method: spawn.
<ledestin>
well, it's Process.spawn or something
<krowv>
I got the name from pry doing find-method
<krowv>
[3] pry(main)> show-method Process.spawn
<krowv>
Error: Cannot locate this method: spawn.
jlast has joined #ruby
ndrei has quit [Ping timeout: 276 seconds]
[k- has joined #ruby
<ledestin>
can you run it?
ndrei has joined #ruby
<sevenseacat>
`ri Kernel.spawn`
fgo has quit [Ping timeout: 244 seconds]
<sevenseacat>
or show-method would probably work too. as long as you actually know it's Kernel.spawn.
<krowv>
djellemah, ok, up to this point I've only installed debs containing ruby on my Ubuntu system
<[k->
yes, you need it because u set the @name
chris2 has quit [Ping timeout: 248 seconds]
<ledestin>
krowv I'd google for the error you have and see what's in store
<Sypheren>
but if you were to change it to def asdf, the code stops working
<djellemah>
krowv: probably there's an additional package. Maybe ruby-dev ?
<Aeyrix>
Sypheren: Of course.
<[k->
initialize is called by new
<Aeyrix>
Sypheren: Come on, take a guess.
<Aeyrix>
Why do you think this happens?
<certainty>
moin
<Aeyrix>
moin certainty
<Sypheren>
What I mean is
duncannz has joined #ruby
gauke has quit [Quit: gauke]
<[k->
Sypheren, try calling asdf before calling say_hi
<Sypheren>
Do certain names of methods affect things?
<Aeyrix>
Sypheren: Yes.
<Sypheren>
asdf is already called before say_hi
<Aeyrix>
Greeter.new will call Greeter#initialize automatically.
<Sypheren>
Is initialize one of those names?
<Aeyrix>
When you call Greeter#initialize, it sets the name.
<Aeyrix>
Look at what your code is doing.
ledestin has quit [Read error: Connection reset by peer]
<Aeyrix>
Initialize is taking the "name" parameter you passed to it, and assigning it to the class variable @name.
<krowv>
djellemah, I'm digging around...
<[k->
Greeter::new*
wallerdev has quit [Quit: wallerdev]
<Aeyrix>
say_hi is then using that variable.
<krowv>
ruby-dev is already installed. at least I'm on the right path now
<flughafen>
Sypheren: you're also passing "will" to Greeter, which is the initializer, every class gets one, either you write it or it's done automatically. you could just remove the initializer and have another function set_name ...
<Aeyrix>
global variable, not class variable, but irrelevant
<[k->
instance variable*
wldcordeiro has joined #ruby
<Sypheren>
I get what happens after the instance is set up
<flughafen>
Sypheren: and then don't pass the name to new()
<Mon_Ouie>
Also look at the error message that Ruby gives you
GitStud has quit [Ping timeout: 264 seconds]
<Sypheren>
Wrong number of arguments? :>
danielpclark has quit [Ping timeout: 255 seconds]
<Mon_Ouie>
Right. You give it one argument, and it expected zero.
<Sypheren>
Aeyrix, how would you pass it those arguments without an initialize method?
<Aeyrix>
You wouldn't.
<Aeyrix>
Or, you can, but you wouldn't in practicality.
<Aeyrix>
You keep the initialize method.
<Sypheren>
So it is required, if you need the class to have data put into it?
<Aeyrix>
#initialize is a constructor.
<krowv>
pry is still not cooperating. looking into it further
<sevenseacat>
if you want to pass stuff to new, then yes.
<Aeyrix>
It's designed to basically "set up" the class instance.
<Aeyrix>
It doesn't have to be *all* the data, but it should be as much as you have on hand when you go to initialize the class.
<Mon_Ouie>
How would ruby be able to guess that you want to set an instance variable called @name and not do something else in initialize?
<Sypheren>
I see!
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
avahey has quit [Quit: Connection closed for inactivity]
al2o3-cr has quit [Ping timeout: 250 seconds]
chris2 has joined #ruby
<krowv>
maybe I was just using pry wrong. If I go into the pry shell and then type ri spawn it loads
<krowv>
but if I try show-method spawn from the pry shell it fails
<krowv>
at any rate I can live with ri
failshell has quit [Ping timeout: 264 seconds]
* krowv
hugs #ruby
<djellemah>
krowv: show-method doesn't find methods implemented in C which are part of the core.
Xeago has joined #ruby
<Mon_Ouie>
It does find some of them (not sure why it doesn't have all of them)
<krowv>
djellemah, ok, that makes some sense.
gauke has joined #ruby
arup_r has joined #ruby
Macaveli has joined #ruby
<krowv>
I'm still new to ruby but I love staying in the commandline so I knew there had to be a way to view it. I caught myself googling for everything and I try not to do that. I like to know that I'm getting the exact API for the things I'm using
psy_ has joined #ruby
<djellemah>
krowv: also, for extra smiles, set up your EDITOR variable, and then in pry use edit instead of show-method. eg require 'csv'; edit CSV
negev has joined #ruby
<djellemah>
krowv: Oh. That doesn't work with ; because edit has to at the beginning of the line for pry to recognise it.
swgillespie has joined #ruby
<negev>
hi, i'm writing a non-rails application using rack. looking at this page: http://www.rubydoc.info/github/rack/rack/Rack/Static it seems to suggest that i can do: use Rack::Static, :urls => ["/media"] to handle static content automatically, but i can't see where to put this. does my main application class need to extend one of the rack classes in order to make the use method available?
<krowv>
djellemah, yeah, noticed an error when I tried
iamninja has quit [Ping timeout: 265 seconds]
Asher has quit [Quit: Leaving.]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
astrobu__ has joined #ruby
danielpclark has joined #ruby
fabrice31 has joined #ruby
swgillespie has quit [Client Quit]
Asher has joined #ruby
<djellemah>
negev: I'm not familiar with Rack, but I'm guessing 'use Rack::Static' needs to go in some kind of config block
astrobun_ has quit [Ping timeout: 265 seconds]
ndrei has joined #ruby
serivich has joined #ruby
fabrice31 has quit [Remote host closed the connection]
commondream has joined #ruby
roolo has joined #ruby
fabrice31 has joined #ruby
wldcordeiro has quit [Quit: Konversation terminated!]
<_mh_>
I would've guessed that as well, wasn't sure enough about it to suggest it though. From what I understand of rack, your .ru file kind of serves as a config file.
shredding has joined #ruby
commondream has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
rubie has joined #ruby
troulouliou_dev has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
skade has joined #ruby
AlphaAtom has joined #ruby
wildroman2 has joined #ruby
andikr has joined #ruby
wildroman2 has quit [Remote host closed the connection]
rubie has quit [Ping timeout: 265 seconds]
krandi has joined #ruby
wildroman2 has joined #ruby
skade has quit [Client Quit]
Xeago has quit [Read error: Connection reset by peer]
_ht has joined #ruby
wildroman3 has joined #ruby
skade has joined #ruby
wildroman3 has quit [Remote host closed the connection]
wildroman2 has quit [Read error: No route to host]
saadq has joined #ruby
wildroman2 has joined #ruby
simplyaubs has quit [Ping timeout: 246 seconds]
olistik has quit [Remote host closed the connection]
terlar has joined #ruby
Musashi007 has joined #ruby
simplyaubs has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
ndrei has joined #ruby
workmad3 has joined #ruby
bkxd_ has quit [Ping timeout: 264 seconds]
Xeago has joined #ruby
juanpaucar has joined #ruby
amclain has quit [Quit: Leaving]
ringarin has joined #ruby
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sdwrage has quit [Quit: Leaving]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 255 seconds]
Iskarlar has joined #ruby
hmnhf has joined #ruby
laurentide has quit [Quit: Leaving]
Hounddog has joined #ruby
juanpaucar has quit [Ping timeout: 246 seconds]
zeroDivisible has quit [Ping timeout: 255 seconds]
bnizzle has joined #ruby
User458764 has joined #ruby
OrbitalKitten has joined #ruby
iamninja has joined #ruby
jlast has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
alex88 has joined #ruby
baweaver has quit [Remote host closed the connection]
simplyaubs has quit [Quit: simplyaubs]
jenrzzz has quit [Ping timeout: 265 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jds has quit [Quit: Connection closed for inactivity]
Pathfinder has joined #ruby
<[k->
huehuehue
gaucheph has quit [Ping timeout: 246 seconds]
<[k->
I only read code
<[k->
I do not test
gaucheph has joined #ruby
davedev2_ has quit []
Siyfion has joined #ruby
jenrzzz_ has joined #ruby
chinmay_dd has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
bkxd has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
Xeago has joined #ruby
axl_ has joined #ruby
<[k->
what's the purpose of window_regex?
<[k->
you could use Hash#fetch which allows you to specify a default ^^
fabrice31 has quit [Ping timeout: 276 seconds]
yfeldblum has joined #ruby
lavros has quit [Ping timeout: 255 seconds]
jlast has quit [Ping timeout: 248 seconds]
fabrice31 has joined #ruby
axl_ is now known as nuth
lavros has joined #ruby
RegulationD has joined #ruby
nuth is now known as nutha
lkba_ has joined #ruby
jack_rabbit has joined #ruby
tesuji has joined #ruby
Zackio is now known as CaveJohnson
Iskarlar has joined #ruby
workmad3 has joined #ruby
yfeldblu_ has joined #ruby
einarj has joined #ruby
Mon_Ouie has quit [Ping timeout: 252 seconds]
gaucheph__ has joined #ruby
fabrice31 has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 252 seconds]
fabrice31 has joined #ruby
Iskarlar has quit [Client Quit]
mandarinkin2 has joined #ruby
RegulationD has quit [Ping timeout: 256 seconds]
skade has quit [Quit: Computer has gone to sleep.]
zeroDivisible has joined #ruby
yfeldblum has quit [Ping timeout: 256 seconds]
skade has joined #ruby
gaucheph has quit [Ping timeout: 265 seconds]
Xeago has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
pyo_ has joined #ruby
al2o3-cr has joined #ruby
zeroDivisible has quit [Client Quit]
zeroDivisible has joined #ruby
ht__ has joined #ruby
wallerdev has quit [Quit: wallerdev]
jenrzzz_ has quit [Ping timeout: 256 seconds]
_axx has left #ruby [#ruby]
marr has joined #ruby
Xeago has quit [Remote host closed the connection]
AlexRussia has joined #ruby
Xeago has joined #ruby
<User458764>
Hi, how do you read the first line of a CSV file? CSV.foreach[0]?
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k->
using the CSV from the stdlib?
rubie has joined #ruby
Xeago has quit [Remote host closed the connection]
<ljarvis>
User458764: you might just want #readline
Pathfinder has quit [Ping timeout: 252 seconds]
<ljarvis>
or gets/shift (they're all aliases)
Xeago has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
krandi has quit [Remote host closed the connection]
<ljarvis>
User458764: pretty much everything else will read in all rows (including foreach[0] which would be .to_a[0]), which obviously you want to avoid
rubie has quit [Ping timeout: 265 seconds]
pyo_ has quit []
ndrei has joined #ruby
Xeago has quit [Remote host closed the connection]
astrobun_ has quit [Remote host closed the connection]
commondream has joined #ruby
Xeago has joined #ruby
sinkensabe has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
SubjectiveBias has joined #ruby
gaucheph has joined #ruby
gaucheph__ has quit [Ping timeout: 248 seconds]
icosa1 has joined #ruby
olistik has quit [Remote host closed the connection]
icosa1 has quit [Remote host closed the connection]
icosa1 has joined #ruby
olistik has joined #ruby
n008f4g_ has joined #ruby
arup_r has quit [Remote host closed the connection]
olistik has quit [Remote host closed the connection]
poguez_ has quit [Quit: Connection closed for inactivity]
commondream has quit [Ping timeout: 256 seconds]
stan has joined #ruby
senayar has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
astrobun_ has joined #ruby
juanpaucar has joined #ruby
skade has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
meph has joined #ruby
quimrstorres has joined #ruby
krz has quit [Ping timeout: 250 seconds]
quimrstorres has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
lxsameer has quit [Quit: Leaving]
lxsameer has joined #ruby
juanpaucar has quit [Ping timeout: 264 seconds]
tkuchiki has quit [Remote host closed the connection]
oo_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
Iskarlar has joined #ruby
A205B064 has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 265 seconds]
danielpclark has quit [Ping timeout: 272 seconds]
aryaching has quit []
ndrei has quit [Ping timeout: 276 seconds]
quimrstorres has joined #ruby
ndrei has joined #ruby
Igorshp has joined #ruby
Xeago has quit [Remote host closed the connection]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
withnale_ has joined #ruby
krz has joined #ruby
wasamasa is now known as bagelmasa
balazs has joined #ruby
bagelmasa is now known as wasamasa
workmad3 has joined #ruby
mandarinkin2 has quit [Ping timeout: 248 seconds]
nofxx has quit [Ping timeout: 256 seconds]
Zai00 has joined #ruby
balazs has quit [Ping timeout: 265 seconds]
sepp2k has joined #ruby
hakunin has quit []
Bertg has joined #ruby
skade has joined #ruby
terlar has quit [Quit: WeeChat 1.2]
Xeago has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
jlast has joined #ruby
danielpclark has joined #ruby
Igorshp has quit [Remote host closed the connection]
failshell has joined #ruby
tkuchiki has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
OrbitalKitten has joined #ruby
Xeago has quit [Remote host closed the connection]
multi_io has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
jlast has quit [Ping timeout: 250 seconds]
multi_io has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
emergion has quit [Quit: Connection closed for inactivity]
<yorickpeterse>
morning kids
<yorickpeterse>
god I love Sequel
mandarinkin2 has joined #ruby
failshell has quit [Ping timeout: 252 seconds]
<yorickpeterse>
you want to customize how associations are loaded? You can do that!
<adaedra>
so much this
<adaedra>
Sequel is life
<yorickpeterse>
jeremyevans for president
<adaedra>
You should say that in #sequel :D
<shevy>
or #french_cuisine
<adaedra>
-_-
<shevy>
soon it is weekend
<shevy>
perhaps then I can write more ruby code again
txdv has quit [Quit: leaving]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
platzhirsch has joined #ruby
tedstriker has quit [Read error: Connection reset by peer]
olistik has joined #ruby
symm- has joined #ruby
OrbitalKitten has joined #ruby
tubuliferous_ has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
Xeago has quit [Remote host closed the connection]
langlands has joined #ruby
<ljarvis>
Jeremy is seriously awesome
lolmaus_ has joined #ruby
<ljarvis>
yorickpeterse: how are you customising them?
lolmaus has quit [Ping timeout: 256 seconds]
Macaveli has joined #ruby
tubuliferous_ has quit [Ping timeout: 276 seconds]
RandyT has quit [Ping timeout: 276 seconds]
doertedev has joined #ruby
RandyT has joined #ruby
eksperimental has joined #ruby
<eksperimental>
i have gotten segmentation fualts with ruby. does anybody know to deal with this.. it has been since i have updated ruby
dionysus69 has joined #ruby
<adaedra>
do a bug report
<apeiros>
eksperimental: if you're using native extensions, they might be the cause
<apeiros>
I'd try updating those first
<ljarvis>
#nocontext
<adaedra>
#hashtagsonirc
<apeiros>
?context eksperimental
<ruboto>
eksperimental, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
<apeiros>
ljarvis: ^
<ljarvis>
:(
<apeiros>
;-)
<apeiros>
hey! we make it easy for you!
j416 has joined #ruby
<eksperimental>
apeiros and ruboto: im running jekyll, im using the github-pages gem
<ljarvis>
what ruby version?
<ljarvis>
what other gems?
<ljarvis>
what platform?
<apeiros>
eksperimental: ruboto is a bot
* adaedra
feeds ruboto bits
<eksperimental>
ljarvis: i was using plain old ruby , and then I updated to rvm, to mimic github version
<apeiros>
?botsnack
<ruboto>
nomnomnomnom
<[k->
jhass said some command that triggered an env dump
<eksperimental>
ljarvis: it was happening with 2.2.2
<shevy>
apeiros that is now the third guy (eksperimental) who thinks that ruboto is a human rather than a bot
IanV0rn has joined #ruby
<Silex>
shevy: that happens with all helper bots in all help channels
<[k->
we can't help it if ruboto is cute
<apeiros>
shevy: yupp, I ponder adding a generic "I'm a bot, you don't need to address me" message when it's being addressed by a person the first time
IanV0rn has quit [Max SendQ exceeded]
<shevy>
Silex I can't remember the same for eval-in in a similar timespan before
<apeiros>
(and no command is matched)
hmnhf_ has joined #ruby
IanV0rn has joined #ruby
<shevy>
perhaps the nick appears too human like :)
sandstrom has quit [Quit: My computer has gone to sleep.]
<Silex>
shevy: yeah, "eval" bots are easier to recognize than "factoids" bots
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hmnhf_ has quit [Client Quit]
astrobun_ has quit [Ping timeout: 256 seconds]
<shevy>
we have a cloaked ninja bot here
krz has quit [Read error: Connection reset by peer]
IanV0rn has quit [Max SendQ exceeded]
<eksperimental>
ljarvis: i'm installing 2.2.2
dionysus69 has quit [Remote host closed the connection]
<ljarvis>
eksperimental: "eksperimental> ljarvis: it was happening with 2.2.2"
<eksperimental>
ljarvis: i haven't installed it before, i think it was 2.2.1
IanV0rn has joined #ruby
fabrice31_ has joined #ruby
<eksperimental>
but look at my log, it's mixxing 2.2.0 with 2.2.1, coul that be the source of the segfault?
<bnagy>
pygments looks pretty new, and it's posix shelling out to some python
<adaedra>
:D
khebbie has joined #ruby
<bnagy>
which seems like a good area to look for weirdness
iamninja has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Read error: Connection reset by peer]
<bnagy>
eksperimental: when you're upgrading and reinstaling everthing, also do same for python and pygments imho
oo_ has quit [Remote host closed the connection]
c0m0 has joined #ruby
husanu2 has joined #ruby
<bnagy>
although it should vendor it for you, hopefiulully
<bnagy>
thanks, lag
oo_ has joined #ruby
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ArchRogem has joined #ruby
Rickmasta has joined #ruby
<bnagy>
there are two registers there that are ascii, which is usually hilarity
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bnagy>
also, it looks like a 32 bit ruby. I don't know if that's important.
DoubleMalt has quit [Remote host closed the connection]
serivich has quit [Ping timeout: 272 seconds]
Bertg has joined #ruby
jlast has joined #ruby
oo_ has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
senayar has quit [Remote host closed the connection]
CamonZ has joined #ruby
symm- has quit [Read error: Connection reset by peer]
terlar has joined #ruby
fabrice31 has joined #ruby
<shevy>
hehe
chipotle has joined #ruby
<shevy>
detective bnagy is on the case
husanu2 has quit [Remote host closed the connection]
husanu2 has joined #ruby
symm- has joined #ruby
<bnagy>
actually, no, he's about to go for a run :)
oo_ has joined #ruby
andywww has joined #ruby
<andywww>
hi, i’m trying to get my head around the concept of modules.. please can someone take a quick look at this code and let me know if i’m in the right ballpark?
nobitanobi has quit [Remote host closed the connection]
oo_ has joined #ruby
<shevy>
amerikkka c-ruby!
<shevy>
it is lightning fast
<amerikkka>
what is cruby?
khebbie has quit [Ping timeout: 246 seconds]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
amerikkka: see first answer ruby-community.com/faq
<andywww>
shevy: if i needed to have module Foo(s) and then have Foo1, Foo2 etc
Zai00 has quit [Quit: Zai00]
<andywww>
but wanted Foo1 and Foo2 in different physical files
<andywww>
source files even
<andywww>
so pretty much: I need to include a module that includes a load of other modules and makes their functionality available
<shevy>
amerikkka just the C part of ruby so you have all of C!
<shevy>
andywww whether it is in one file or different ones makes no difference
<shevy>
just load them all properly
<shevy>
the pastie example already shows you how it works for one module and one class; just add more modules there? and once it all works, space it out into several separate files
<andywww>
i was hoping i might be able to do it heirarchically so i didn’t have to litter my AR base class with includes of all the different modules
doertedev has quit [Ping timeout: 264 seconds]
<andywww>
so effectively include them all in one ‘umbrella’ module, then include that in my class
<shevy>
a module and a class is functionally not that much of a difference by the way; you can use methods from both; you can use class methods as well, and you can use @ivars too in both
n008f4g_ has quit [Ping timeout: 256 seconds]
<shevy>
I used to think that @ivars are only for classes
<andywww>
AH
<andywww>
it was the ‘self’ that was killing mine
<andywww>
thanks for that
<shevy>
I like self
shellie_ has quit [Ping timeout: 256 seconds]
<shevy>
I tend to use: def self.foo more often than extend Name
slackbotgz has quit [Remote host closed the connection]
<shevy>
it feels as if I am in more minute control when I specify exactly what I need, rather than just use everything globally
<shevy>
(though only for extend... include is ok)
<andywww>
I’m used to using self. for ‘static’ methods
<andywww>
or class methods
<shevy>
yeah I prefer that myself :)
<andywww>
thats why i put it in the module
<andywww>
but clearly thats not cricket
ndrei has quit [Ping timeout: 252 seconds]
<shevy>
dunno... I rarely have a complicated use case where I need to combine many different modules in special ways
Bertg has joined #ruby
<shevy>
I have some examples of a single method, in one module, and then I use include to extend a class with that
<shevy>
like: include SaveFile, just because I don't want to write File.open with the block form
<andywww>
mines due to learning rails before properly learning ruby
<shevy>
aha
<shevy>
I never got into rails :(
Mon_Ouie has joined #ruby
<andywww>
need to put some time into learning the foundations really
sandstrom has joined #ruby
krz has joined #ruby
tvw has joined #ruby
ArchRogem has quit [Ping timeout: 265 seconds]
troulouliou_dev has quit [Remote host closed the connection]
<shevy>
if I am offline, it is either because my computer crashed or because I set the computer up anew, right now I am on some weird kubuntu thing (don't ask...)
krz has quit [Read error: Connection reset by peer]
Pathfinder has joined #ruby
IanV0rn has quit [Client Quit]
bkxd_ has joined #ruby
IanV0rn has joined #ruby
shredding has quit [Remote host closed the connection]
IanV0rn has quit [Max SendQ exceeded]
OrbitalKitten has joined #ruby
IanV0rn has joined #ruby
axilla has joined #ruby
ndrei has joined #ruby
elia has quit [Quit: Computer has gone to sleep.]
scripore has joined #ruby
zz_Outlastsheep is now known as Outlastsheep
JERKOPS has joined #ruby
<JERKOPS>
i'd liek to pwn sum fagz by makeing a rat in ruby is that possible?
<yorickpeterse>
what?
<JERKOPS>
can you maek a rat in ruby?
<yorickpeterse>
what's that in English?
<JERKOPS>
rat = tool that lets you controll the computer of another user without them knowing
<yorickpeterse>
and you want to do this to "pwn sum fagz"
Igorshp has quit [Remote host closed the connection]
<DylanJ>
/etc/init.d/earth stop # only solution
fantazo has quit [Quit: Verlassend]
<yorickpeterse>
(doomed)
<adaedra>
the horror!
Zai00 has joined #ruby
<[k->
have you considered my nick
<adaedra>
systemctl stop earth
<adaedra>
[k-: I give it a K
<[k->
My favourite letter!
<jhass>
systemctl isolate adeadra
<[k->
lol
<[k->
adeadra
<jhass>
(yes that's a valid command :P )
<ddv>
systemctl disable jhass
<adaedra>
jhass: you need a ^T
<diegoviola>
wow 1023 nicks here, when did we get so many people?
<[k->
we merged with #ruby-lang
<adaedra>
soon 1Ki nicks
<diegoviola>
[k-: I know :p
<[k->
‹i know›
<diegoviola>
nobody knows anything
<[k->
« another unbalanced bracket
<adaedra>
this I can help with
<adaedra>
»
<diegoviola>
so return can't be called from main because there's nothing to return to?
<[k->
it would take 2²²²² days to resolve them all
<adaedra>
diegoviola: main = global scope?
<pontiki>
so does someone have to go back and close all the brackets [k- has opened?
senayar has joined #ruby
gaucheph__ has joined #ruby
<[k->
»›” you'll never be done
<diegoviola>
what about break or exit then?
<adaedra>
exit is fine in the global scope
<diegoviola>
and break is mostly to break out of a loop?
<[k->
what do you mean by main
<adaedra>
yes
<diegoviola>
ok ty
<adaedra>
exit stops program execution from anywhere
<adaedra>
return from a method
ndrei has joined #ruby
<[k->
not if you inherited from BasicObject only
<adaedra>
why would you do that
<[k->
I don't know!
<[k->
to write a threadsafe Ruby from scratch?
gaucheph has quit [Ping timeout: 248 seconds]
<adaedra>
wut
TheHodge has joined #ruby
Zai00 has quit [Ping timeout: 255 seconds]
DoubleMalt has quit [Remote host closed the connection]
mdw has joined #ruby
sgambino has joined #ruby
<jhass>
diegoviola: it's simply, return returns a value from the current method (= there's none in main hence you can't call it), break returns a value from the method calling the current block (= it only works inside a block), next returns a value from the current block (= it only works inside a block), all three default to nil for the value if you give none
eksperimental has quit [Ping timeout: 264 seconds]
<diegoviola>
jhass: thanks
<diegoviola>
I see
DoubleMalt has joined #ruby
<[k->
you can't return from a proc
<diegoviola>
ok
<[k->
it gives you a localjumperror
<diegoviola>
and from a lambda?
<adaedra>
er, you can under some conditions, in fact
<diegoviola>
well a lambda is just a proc, no?
<jhass>
okay, granted, proc / lambda semantics complicate it a bit
sophiedeziel has quit [Remote host closed the connection]
Zai00 has joined #ruby
livathinos has joined #ruby
langland_ has joined #ruby
gaucheph__ has joined #ruby
akkad has quit [Excess Flood]
langlands has quit [Ping timeout: 252 seconds]
sfarley has quit [Remote host closed the connection]
gaucheph has quit [Ping timeout: 255 seconds]
[k-_ has joined #ruby
akkad has joined #ruby
Igorshp has joined #ruby
inoic has joined #ruby
skade has joined #ruby
<maloik>
Is anyone up to speed on apple developments? Are there any new macbook air's coming out in the next few months, say before october or so?
n008f4g_ has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alkan has joined #ruby
Soda has quit [Remote host closed the connection]
<alkan>
ne ayaksınız lan siz
<jhass>
?ot maloik
<ruboto>
maloik, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<flughafen>
is there anyway to not launch a browser with debugging with poltergeist?
<alkan>
alayınızın amına korum lan
<jhass>
alkan: this channel is English only, I'm sorry
<alkan>
hey shat up
<jhass>
!mute alkan
jlast has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<yorickpeterse>
at least the a is at the same place
<yorickpeterse>
also that took me forever to type
Pluto1010 has joined #ruby
x44x45x41x4E has joined #ruby
<ddv>
I highly doubt dvorak will make me type faster with 30 years of qwerty experience
Scrofff has joined #ruby
<yorickpeterse>
only one way to find out
luzidco has joined #ruby
Igorshp has joined #ruby
* flughafen
should try out different layouts now that i have a fancy blank keyboard
djellemah_ has joined #ruby
<ddv>
that was not possible with a non blank keyboard flughafen?
<flughafen>
it is. but it's weird if i'm looking at the keybboard
<jhass>
I agree it makes it easier
<Outlastsheep>
flughafen: are you going to sticker it manually when you find a nice layout?
<jhass>
flughafen: try neo 2, layer 3 is awesome for programming, in theory
Scroff has quit [Ping timeout: 246 seconds]
<flughafen>
Outlastsheep: no, my keyboard has a sorta-weird layout now, i have an image of it, that'll i reference if i get lost. but it's qwerty. but it didn't take my longer than a few days to figure it out
<Outlastsheep>
Everything's all dandy and great in theory :P
gaucheph has joined #ruby
<flughafen>
i never look at the image since a few days after i had it.
<Outlastsheep>
Oh, I already type blind mostly anyway. Blank layout wouldn't hurt to me.
<flughafen>
jhass: i'll look it up, is that what you're using?
senayar has quit [Remote host closed the connection]
<jhass>
I tried to learn neo 2 like three times now, but I look too much at the letters subconsciously for it to stick ...
<jhass>
should try again though
<flughafen>
Outlastsheep: yeah, me too. but, ifi'm not hitting the right key, my first reaction is to look down.
hck89 has joined #ruby
senayar has joined #ruby
<Outlastsheep>
flughafen: same here.
<Outlastsheep>
That's my que to go, crap.
<Outlastsheep>
Seeya all.
djellemah has quit [Ping timeout: 252 seconds]
<flughafen>
later
<flughafen>
jhass: what kind of keyboard do you use?
<jhass>
standard laptop inbuilt
Outlastsheep is now known as zz_Outlastsheep
gaucheph__ has quit [Ping timeout: 248 seconds]
<flughafen>
this is my layout: https://i.imgur.com/n41iBwH.jpg qwerty, but with a few changes of control, capslock and so on
husanu2 has joined #ruby
tomphp_ has joined #ruby
juanpaucar has joined #ruby
senayar has quit [Remote host closed the connection]
<pontiki>
ooooo your keyboard has a "fun" key!!
<tobiasvl>
funky
<pontiki>
"we put the fun in computing!"
husanu2 has quit [Remote host closed the connection]
<flughafen>
pontiki: jhass [k-_ i should map the "fun" key to debot: !hangman
acke has joined #ruby
husanu5 has joined #ruby
<pontiki>
totally
<[k-_>
DeBot only responds to DeBot
husanu5 has quit [Remote host closed the connection]
tomphp has quit [Ping timeout: 246 seconds]
<flughafen>
well, we should bribe jhass with cookies
* [k-_
looks at source code
husanu1 has joined #ruby
ghostpl has quit [Remote host closed the connection]
<_mh_>
bribes in cookies. Everybody got their kryptonite, I suppose.
<flughafen>
_mh_: have you had german lebkuchen?
mdw has quit [Remote host closed the connection]
<_mh_>
flughafen: sure, I have them every winter.
aryaching has joined #ruby
husanu1 has quit [Remote host closed the connection]
juanpaucar has quit [Ping timeout: 264 seconds]
quimrstorres has joined #ruby
<flughafen>
that's everybody's kryptonite
<_mh_>
the right ones? oh yes.
husanu4 has joined #ruby
Bertg has joined #ruby
pontiki has quit [Quit: <poit>]
<flughafen>
yeah, not the shitty ones, that are like 8 for 1euro, but good oens
IanV0rn has quit [Ping timeout: 255 seconds]
<flughafen>
there is a really good place that is open only from septembter to january and that's all they sell is lebkuchen, it's right around the corner from my work
<flughafen>
sweet lifecakes
startupality has joined #ruby
senayar has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
senayar has quit [Changing host]
senayar has joined #ruby
<_mh_>
flughafen: our office orders a big round in november. It's literally impossible to walk past the box when it's there.
aspiers has joined #ruby
<_mh_>
flughafen: and damn, now I want lebkuchen in June...
<flughafen>
there is a place in nurnberg, in the altstadt that sells good lebkuchen year round
husanu4 has quit [Remote host closed the connection]
<flughafen>
ik can't remember the name, not kebkuchenschmidt,
joonty has joined #ruby
<ddv>
!ot
<ddv>
as you can see I never use the bots in here
nertzy has joined #ruby
<flughafen>
?ot
<ruboto>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
husanu2 has joined #ruby
<flughafen>
?ot ddv
<ruboto>
ddv, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<yorickpeterse>
ok meh dvorak
<ddv>
:)
<yorickpeterse>
some keys are at really weird spots
<yorickpeterse>
lets try workman
<flughafen>
?ot yorickpeterse
<ruboto>
yorickpeterse, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<yorickpeterse>
oh come on
<flughafen>
haha, i command the power!
<[k-_>
?ot ruboto
<ruboto>
ruboto, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
djellemah__ has joined #ruby
<flughafen>
can someone ban rubuto?
<[k-_>
speaking about offtopic is offtopic!
<ddv>
even using the command can be considered offtopic
husanu2 has quit [Remote host closed the connection]
<centrx>
Where else can I speak so freely about PHP!?
artmann has joined #ruby
<[k-_>
kek
<centrx>
is flughafen a spamtroll
devdazed has quit [Quit: Computer has gone to sleep.]
<[k-_>
OMY
charliesome has quit [Quit: zzz]
<[k-_>
such accusation!
<[k-_>
flughafen is a full-fledge member of #ruby!
<flughafen>
centrx: i have some medication to sell you through my dead family members in nigeria that need you to inherit there money or else it'll get taken away by the government
husanu1 has joined #ruby
mdw has joined #ruby
<centrx>
Sign me up! Is there a web API I can use to access my account?
<flughafen>
yes, i just need your bank account info, original copy of your birth certificate, and passport
<ebarrett>
am i right in thinking you can't access variables in the outer scope without declaring them global?
djellemah_ has quit [Ping timeout: 244 seconds]
gaucheph__ has joined #ruby
<ebarrett>
or without using a closure...
<[k-_>
no
<centrx>
ebarrett, Use objects, not global
doertedev has joined #ruby
<flughafen>
ebarrett: my father, the king of europe has died. and he had 3 million outer scope variables that we can't keep here.
kies has quit [Ping timeout: 272 seconds]
husanu1 has quit [Remote host closed the connection]
<[k-_>
>> a = "hello"; class B; def hello; p a; end; B.new.hello
<ruboto>
[k-_ # => /tmp/execpad-7f50b96dbd52/source-7f50b96dbd52:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/387549)
<[k-_>
>> a = "hello"; class B; def hello; p a; end; end; B.new.hello
<ruboto>
[k-_ # => undefined local variable or method `a' for #<B:0x412a3f78> (NameError) ...check link for more (https://eval.in/387550)
husanu3 has joined #ruby
<[k-_>
thats weird
<jhass>
it's not
<jhass>
_local_ variables
<[k-_>
._.
<jhass>
not randomly into other scopes cascading variables
<[k-_>
doesnt ruby cascade if it cant find a variable
gaucheph has quit [Ping timeout: 248 seconds]
<centrx>
You're thinking of BASIC
Pluto1010 has quit [Quit: Leaving...]
<ebarrett>
so i gess ruby doesn't do lexical scoping.. hrm
<centrx>
ebarrett, Might be clearer if you provided a code example
aspiers has quit [Ping timeout: 246 seconds]
chinmay_dd has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
kp666 has quit [Remote host closed the connection]
Xeago has joined #ruby
husanu3 has quit [Remote host closed the connection]
<centrx>
Yeah scoping doesn't work like that in Ruby
husanu1 has joined #ruby
<ebarrett>
x is not global in this case, it's in module scope
Scroff has joined #ruby
JDiPierro has joined #ruby
Iskarlar has joined #ruby
<centrx>
ebarrett, actually, if you do @x = 1 then it would work
husanu1 has quit [Remote host closed the connection]
<que__>
i wanna make regexp and choose next word after match $' i saw this as use. but when i test it on https://repl.it/languages/Ruby it gives me nil .
langland_ has quit [Ping timeout: 256 seconds]
endash has quit [Quit: endash]
<que__>
is $` soped beeing used ?
husanux0 has joined #ruby
<centrx>
ebarrett, as the top-level object is a special object called "main", @x = 1 would define an instance variable on it which would be accessible in the methods
<centrx>
Never heard of it before, but it looks super cool
Pathfinder has quit [Ping timeout: 272 seconds]
langlands has joined #ruby
dblessing has joined #ruby
Scrofff has joined #ruby
RegulationD has joined #ruby
Pupeno_ has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
<[k-_>
Note: str =~ regexp is not the same as regexp =~ str. Strings captured from named capture groups are assigned to local variables only in the second case.
<que__>
the aaa is simulation of a readed file.
Scroff has quit [Ping timeout: 264 seconds]
JakFrist has joined #ruby
<[k-_>
$` is before match, $' is after match
Pupeno has quit [Ping timeout: 246 seconds]
<[k-_>
kinda like partition >.>
<pansophical>
how to check if a string is in a string "array" like structure
<yorickpeterse>
hm, workman layout is not that bad
<centrx>
pansophical, Can you be more specific?
nertzy has quit [Quit: This computer has gone to sleep]
<[k-_>
centrx++ coolness over 9000!
gaucheph has joined #ruby
<yorickpeterse>
_very_ slow at the moment though
sanguisdex has joined #ruby
hck89 has quit [Ping timeout: 276 seconds]
husanux0 has quit [Remote host closed the connection]
<que__>
[k-_: so i shold change the place ?
hck89_ has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
ghostpl has joined #ruby
<[k-_>
try it
<pansophical>
centrx: possibly but i'm not entirely familiar with ruby and i *will* sound hilarious likely, a parameter is passed by console and we have to check for validity from a list of possible values..
<centrx>
I'm already laughing hysterically!
<pansophical>
see? ;)
<ddv>
yet another sysadmin who doesn't understand ruby because they use puppet?
<[k-_>
pansophical: i dont understand your question
<bodie_>
anyone familiar with using ruby on gentoo? should I be using portage, rvm, chruby, or something else to manage my stuff? I'm leaning towards chruby but I don't know how it will interact with my system install. (and yes I have asked #gentoo)
<ljarvis>
?chruby
<ruboto>
I don't know anything about chruby
<havenwood>
ruboto: you do too!
<ljarvis>
?install
<ruboto>
I don't know anything about install
<que__>
[k-_: can You help me out with that rregexp grouping ?
<ljarvis>
ruboto: YO
<que__>
(aaa2) ^(\S+)$ i thought something like that
jud has quit [Ping timeout: 265 seconds]
<ljarvis>
Radar: thought you added those :(
<que__>
but guess what i am bad at regexp
hck89_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ljarvis>
?linuxinstall
<ruboto>
I don't know anything about linuxinstall
<bodie_>
:P
<bodie_>
?portage
<ruboto>
I don't know anything about portage
husanux7 has joined #ruby
<acovrig>
ljarvis: thanks, I think I got the div, but how do I get the ID? I have par = i.xpath(“…”), I can’t get anything from par[‘id’] or par[:id]. p par shows an ID though, so it found the div correctly.
<ljarvis>
bodie_: use chruby and ruby-install
<[k-_>
que__, i think /^aaa2(.*?)$/ will work. You can get the after text with $1
<[k-_>
you can also use named groups
<ljarvis>
acovrig: .xpath returns a collection iirc, so maybe you want .first[:id] or at_xpath(..).id
<ljarvis>
at_xpath(..)[:id] rather
tvw has quit []
rbennacer has quit [Ping timeout: 246 seconds]
whippythellama has quit [Ping timeout: 246 seconds]
<[k-_>
que__, eg /^aaa2(?<after>.*?)$/ will work. You can get the after text with regexp.match(string)[:after]
krz has quit [Quit: WeeChat 1.0.1]
Igorshp has quit [Remote host closed the connection]
<que__>
will check
ghostpl has quit [Remote host closed the connection]
arturhoo has joined #ruby
rbennacer has joined #ruby
devdazed has joined #ruby
mrmargolis has joined #ruby
<_blizzy_>
can anyone help me figure out why after line 41, my @team array resets to 'nil'? I've used byebug, and the @team does have the correct values, however, it resets once it goes back to the beginning of the switch/case (line 32)
husanux7 has quit [Remote host closed the connection]
Scrofff has quit [Remote host closed the connection]
<_blizzy_>
[k-_, it's to capture the current moves a Pokemon can use
<Aria>
\o _blizzy_.
<ljarvis>
_blizzy_: should that be "class Foo"
nfk has joined #ruby
<[k-_>
well then, a Pokemon class is in order
<_blizzy_>
.. ljarvis, yes
jahrichie has quit [Quit: Leaving.]
<_blizzy_>
hi Aria \o
senayar has quit [Remote host closed the connection]
mrmargol_ has joined #ruby
<_blizzy_>
I think I'll keep it without the Pokemon class
<[k-_>
if we had def Foo instead of class Foo, might as well just call it javascriptv7 TvT
fabrice31_ has joined #ruby
theahindle has joined #ruby
<ljarvis>
_blizzy_: @bar is private to @foo and local to any instance of it, the one you define in "run" is local to the main scope, which is why you generally shouldn't define instance variables like that
<ljarvis>
private to Foo*
<_blizzy_>
ljarvis, oh ok.
<theahindle>
Hi - I'm trying to parse a qif file, if I do puts transaction.payee it works, but if I do transaction.payee.downcase it says 'downcase doesn't exist for nil.Nil' - Is there a way of capturing the 'string' of transaction.payee so I can use it with downcase and include?
<ddv>
_blizzy_: gigantic switch structures are bad
<_blizzy_>
comments are for why
<ljarvis>
.. exactly
<havenwood>
_blizzy_: When there's something worth commenting upon.
<ljarvis>
you want to use them for "what"
<ddv>
_blizzy_: your code is the documentation
<ljarvis>
which they are not for
<_blizzy_>
I'd rather type 'ws' # web socket
<ljarvis>
:|
<ljarvis>
seriously?
<_blizzy_>
yes
ghostpl has joined #ruby
<_blizzy_>
but that's just me
<ljarvis>
that's the most insane thing I've heard this year
<ljarvis>
web_socket # this doesn't need a comment
mrmargol_ has quit [Ping timeout: 264 seconds]
<_blizzy_>
also @you kind of makes sense
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
<_blizzy_>
it's, well, you
<_mh_>
_blizzy_: Also, you might want to do some input sanitisation on your get_team method, you parse stuff from JSON and just assume it's the format you expect it to be
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_blizzy_>
_mh_, because I've checked it multiple times
Soda has quit [Remote host closed the connection]
<_blizzy_>
and it's the same format
<havenwood>
_blizzy_: In a month you'll still know what `web_socket` means. We'd know what it means now. Name things nicely!
<ljarvis>
people do it in Ruby too, that doesn't make it ok
<ljarvis>
right, bad, exactly
<_blizzy_>
I said !=
yardenbar has joined #ruby
<_blizzy_>
meaning not equals
<ljarvis>
lol
ReD-BoY_ has joined #ruby
jahrichie has joined #ruby
<_blizzy_>
:/
<ljarvis>
yes, big IS bad
<_blizzy_>
how is big bad?
Kricir has joined #ruby
<ljarvis>
how is big not bad?
<_blizzy_>
this will keep circling
ndrei has joined #ruby
<ljarvis>
correct
<ljarvis>
so lets get back to your code
<_blizzy_>
also, I'll keep my switch case
<adaedra>
You spin me right round ♪
<ljarvis>
that's fine, just extract the branches
<_blizzy_>
I'll still divide it up into little methods however.
<_blizzy_>
ok
<ddv>
_blizzy_: you should completely remove the gigantic switch mess
<_blizzy_>
ddv, I'll keep it and change it until it's better
<ljarvis>
^ disagree (at least, for refactoring)
gambl0re has joined #ruby
scripore has joined #ruby
<ljarvis>
pretty much everything in ruby is mutable so i shouldn't have to say this, but the mutable stuff happening in this code scares me
gambl0re has quit [Client Quit]
<_blizzy_>
I can't write perfect ruby code, and I know it's not to everyone's liking. I'm just trying to find this bug.
<adaedra>
freeze everything :o
freerobby has joined #ruby
<ljarvis>
yep, and we're helping
<ddv>
_blizzy_: there is no such thing as perfect code
<ljarvis>
lies
<ddv>
_blizzy_: well unless I wrote it obviously
<_blizzy_>
ddv, I know.
<_blizzy_>
ddv, pls
<adaedra>
There is perfect code
acovrig has quit [Quit: acovrig]
<adaedra>
It lies in /dev/null
<_blizzy_>
p "Hello World"
gambl0re has joined #ruby
<_blizzy_>
prefect ruby code
<ljarvis>
_blizzy_: not really, those pesky quotes.. perfect score 6/10
<_blizzy_>
heh
<havenwood>
_blizzy_: Only use `p` for debugging.
<_blizzy_>
havenwood, oh
<ljarvis>
p(obj) == puts(obj.inspect)
<ljarvis>
(basically)
<ReD-BoY_>
hi
<ljarvis>
hi
<_blizzy_>
hi
<ddv>
hi
<havenwood>
hi
<_blizzy_>
bye
<ddv>
combobreaker^
<adaedra>
aïe
<ReD-BoY_>
I would be happy if someone have exp with Hotel Booking Systems and PayPal
[k- has left #ruby [#ruby]
<ddv>
ReD-BoY_: ok cool
<ljarvis>
what a general question
<ReD-BoY_>
i don't need help for programming, just to help me understand some problem
<ReD-BoY_>
that i have with developer company
<ReD-BoY_>
and PayPal
tkuchiki has joined #ruby
<havenwood>
ReD-BoY_: Ruby?
<ReD-BoY_>
it's a common
<ReD-BoY_>
for hotel booking
<ddv>
ask the damn question
<havenwood>
ReD-BoY_: Ruby-related?
riotjones has quit [Quit: Leaving...]
<ReD-BoY_>
no, sorry, but i had no chance at other places
<ddv>
ask the damn question
jlast has quit [Read error: Connection reset by peer]
<havenwood>
ReD-BoY_: Say how this relates to Ruby or off with you! :)
penzur has joined #ruby
<ReD-BoY_>
Developer company tell me when they generate booking, the send directly booking to supplier or hotel and cannot handle
<ReD-BoY_>
if paypal
tkuchiki has quit [Remote host closed the connection]
<havenwood>
ReD-BoY_: There's a #ruby-offtopic channel if it doesn't relate to Ruby.
<ReD-BoY_>
responso with Pending status
<ReD-BoY_>
on the payment
<havenwood>
?ot ReD-BoY_
<ruboto>
ReD-BoY_, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<adaedra>
the damn question you should ask
susmus has joined #ruby
jlast has joined #ruby
rubie has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
troulouliou_dev has joined #ruby
<izzol>
hmm, there is any useful gem for testing NS records? I'm tyring to do this by rspec-dns but it has lot of issues :(
aganov has quit [Remote host closed the connection]
msgodf has joined #ruby
ponga has joined #ruby
juanpaucar has joined #ruby
<ljarvis>
izzol: what exactly are you trying to do?
<ddv>
testing NS records
<ljarvis>
i.e stdlib has resolv for this kind of stuff but hard to tell exactly what you want
<ljarvis>
ruby is like c, everything is pass by value
<_blizzy_>
then I'm confused on how to do this
<sevenseacat>
also, no
<ljarvis>
_blizzy_: you know you can run the code locally right?
<_blizzy_>
ljarvis, IK.
<ljarvis>
why don't you?
<sevenseacat>
youre not even calling change_foo_to_two
<adaedra>
because ivars are local to a class, and your change_foo_to_two is outside the class
mrmargolis has quit []
<havenwood>
?pry _blizzy_
<ruboto>
_blizzy_, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<ljarvis>
_blizzy_: you're setting an instance variable inside the class scope and not the instance scope
<ljarvis>
therefor the variable is an instance variable of class Foo
<adaedra>
_blizzy_: you know object principles?
<_blizzy_>
hmm, ok.
<ljarvis>
in Ruby, every class is an instance of Class
<_blizzy_>
no.
findaway has joined #ruby
jpfuentes2 has joined #ruby
mattarse has quit [Ping timeout: 250 seconds]
<ljarvis>
even Class
<adaedra>
you should read on that, it's a vague subject, not really explainable over IRC
<adaedra>
mh
mary5030 has joined #ruby
Iskarlar has joined #ruby
<adaedra>
vague => large
<ljarvis>
(but also fun/interesting)
<ljarvis>
or maybe that's just me
<adaedra>
some people hate oop
mary5030 has quit [Remote host closed the connection]
datanoise has joined #ruby
mary5030 has joined #ruby
sandstro_ has joined #ruby
pengin has joined #ruby
User458764 has joined #ruby
User458764 has quit [Max SendQ exceeded]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jphenow has joined #ruby
rippa has joined #ruby
User458764 has joined #ruby
<izzol>
ljarvis: works nice :-) I will need to do some tests on it but I guess I can simply include minitest.
jphenow has quit [Client Quit]
sandstrom has quit [Ping timeout: 244 seconds]
speakingcode has quit [Ping timeout: 276 seconds]
flughafen_ has joined #ruby
sonOfRa has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
mattarse has joined #ruby
sonOfRa has joined #ruby
<_blizzy_>
yes, I have ran this in the console. https://gist.github.com/NotBlizzard/0aef98ea062afeeb485a I've tried different things, and I still cant' figure out how I would change the instance variable using an outside method.
jahrichie has quit [Quit: Leaving.]
momomomomo has joined #ruby
ixti has joined #ruby
tkuchiki has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
casadei has joined #ruby
sinkensabe has quit [Remote host closed the connection]
gauke has quit [Quit: gauke]
umgrosscol has joined #ruby
mattarse has quit [Ping timeout: 246 seconds]
davedev24_ has joined #ruby
d10n-work has joined #ruby
juanpaucar has quit [Remote host closed the connection]
pengin has quit [Remote host closed the connection]
chinmay_dd has quit [Remote host closed the connection]
Scrofff has joined #ruby
ghostpl has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
sonOfRa has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 246 seconds]
<ljarvis>
_blizzy_: you can't (without metaprogramming)
catphish has joined #ruby
sonOfRa has joined #ruby
<ljarvis>
oh
<ljarvis>
it's an accessor derp
<ljarvis>
f.foo = ...
juanpaucar has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
<catphish>
i have an issue with net/ssh, if it executes a process in a remote server which then forks, the fork seems to receive a HUP when the ssh session closes
<_blizzy_>
thanks, ljarvis
<_blizzy_>
I feel slow now. c:
<catphish>
this doesn't seem to happen when running the same command using a normal ssh session
ndrei has joined #ruby
<adaedra>
because it reacts differently if not in a tty, I'd say
Scroff has quit [Ping timeout: 250 seconds]
<adaedra>
easy fix: nohup
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
peter_paule has joined #ruby
sevenseacat has quit [Quit: Me dun like you no more.]
<catphish>
i don't think it's the tty
pglombardo has joined #ruby
<catphish>
it works correctly if executed remotely over ssh with no tty
<catphish>
only seems to get HUPd if it's run from net/ssh
<catphish>
nohup is an option, but its messy
soulcake has quit [Ping timeout: 276 seconds]
<_mh_>
catphish: if you try to execute it with ssh remotemachine yourforkingcommand (without any -t or similar), do you have the same effect as with Net/SSH ?
soulcake has joined #ruby
<catphish>
see above
<adaedra>
I don't remember why NOHUP is emitted
<adaedra>
s/NO/SIG/
<catphish>
it might be the way i'm wrapping net/ssh, i'll double check
bkxd_ has quit [Ping timeout: 272 seconds]
msgodf has quit [Remote host closed the connection]
tomphp_ has joined #ruby
<catphish>
ah, it's fine it i run it in net/ssh *without* a pty
slawrence00 has joined #ruby
<catphish>
must be something to do with the way ptys are assigned and unassigned
<_mh_>
catphish: yes. Unless you found your problem?
SilasVasconcelos has joined #ruby
<ljarvis>
_blizzy_: sure, except now we can't see any of your code
atom3 has quit [Remote host closed the connection]
<ljarvis>
_blizzy_: also, you need to rename d and m variables
<_blizzy_>
ljarvis, doing it right now.
SilasVasconcelos has left #ruby [#ruby]
acke has quit [Remote host closed the connection]
<catphish>
_mh_: i have found my problem, i was calling channel.request_pty on the ssh channel, causing a pty to be assigned, when the pty was closed, it was emitting SIGHUP to the child process
atom3 has joined #ruby
sinkensabe has joined #ruby
<catphish>
_mh_: i have no idea why this does not happen when running in an interactive ssh session though
<ljarvis>
_blizzy_: also another style thing, for win/lose/tie you can write it like: when "win", "lose", "tie"
livathinos has quit []
tomphp has quit [Ping timeout: 256 seconds]
pocketprotector has quit [Quit: WeeChat 0.4.3]
trouloulious_dev has joined #ruby
findaway has left #ruby [#ruby]
tubuliferous_ has joined #ruby
andikr has quit [Remote host closed the connection]
pocketprotector has joined #ruby
tomphp_ has quit [Ping timeout: 255 seconds]
ndrei has quit [Ping timeout: 252 seconds]
<_mh_>
catphish: aaah! Good you did, then.
nettoweb has joined #ruby
<_mh_>
afk
troulouliou_dev has quit [Quit: Leaving]
ndrei has joined #ruby
maasha has quit [Ping timeout: 246 seconds]
Iskarlar has joined #ruby
thiagovsk has quit [Quit: Connection closed for inactivity]
Zarthus has quit [Quit: This night will fall like any other, daylight subsides and shadows crawl.]
fabrice31 has joined #ruby
tubuliferous_ has quit [Ping timeout: 252 seconds]
geiltalasdair has quit [Quit: Leaving]
geilt has joined #ruby
User458764 has joined #ruby
<ljarvis>
_blizzy_: one thing, data_without_split = data doesn't make much sense. When you split it on the next line, that doesn't change the old value of "data", you simply re-assign the return value of split() so that variable is moot, just refer to it as "data" throughout (or a better name because data is very generic)
fabrice31_ has quit [Ping timeout: 244 seconds]
Zarthus has joined #ruby
Iskarlar has quit [Client Quit]
atom3 has quit [Ping timeout: 276 seconds]
Zarthus has quit [Changing host]
Zarthus has joined #ruby
fabrice31 has quit [Remote host closed the connection]
atom3 has joined #ruby
ghostpl has joined #ruby
danielpclark has joined #ruby
Zarthus has quit [Client Quit]
Sembei has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
Zarthus has joined #ruby
Iskarlar has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
skade has joined #ruby
ddarkpassenger has joined #ruby
Xeago_ has quit [Remote host closed the connection]
skade has quit [Client Quit]
Sembei has joined #ruby
<ljarvis>
_blizzy_: here's how I'd write the battle class: https://gist.github.com/leejarvis/e365d8483bc1cdb693b2 separating all logic into separate methods, passing only the thing that changes (in this case, room); stuff like your websocket can be passed into your battle initializer
B1n4r10 has joined #ruby
Xeago has quit [Ping timeout: 272 seconds]
pyo_ has joined #ruby
hectortrope has quit [Quit: WeeChat 0.4.2]
axl_ has joined #ruby
dfockler has joined #ruby
skade has joined #ruby
User458764 has joined #ruby
senayar has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
slackbotgz has quit [Remote host closed the connection]
skade has quit [Client Quit]
rubie has joined #ruby
endash has quit [Quit: endash]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shock_one has joined #ruby
findaway has joined #ruby
MyMind has joined #ruby
dgutierrez1287 has quit [Ping timeout: 248 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jahrichie has joined #ruby
marr has quit []
senayar has joined #ruby
OrbitalKitten has joined #ruby
t0rrieri has joined #ruby
<jhass>
you probably can't, however depending on what the patterns for the first select are the second might be redundant (that is it's possible that if the items don't match any of the former two patterns they can't match the latter)
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
commondream has quit [Remote host closed the connection]
<_blizzy_>
I'm kind of upset because my bot was working
<_blizzy_>
but everyone wanted me to change it, now I have to keep fixing bug after bug. :/
<shevy>
haha
catphish has left #ruby ["Leaving"]
<slash_nick>
...
<ljarvis>
_blizzy_: well, you used version control right?
<_blizzy_>
ljarvis, yes.
<ljarvis>
so revert it back to "working"
<_blizzy_>
but if I change it back to the way it was
<_blizzy_>
I won't get help
<_blizzy_>
because it's 'shit'
<ljarvis>
hey you said that
<_blizzy_>
or 'horrible', or 'spaghetti'
ndrei has joined #ruby
<_blizzy_>
those two were said however.
<ljarvis>
no no, "shit" was correct
<_blizzy_>
..
<ljarvis>
but said by yourself
<_blizzy_>
so you also think its shit?
<ljarvis>
yes
<adaedra>
programming is not a straight process
<ljarvis>
but that besides the point
<adaedra>
errors are made, errors are fixed
<ljarvis>
^
<adaedra>
it's the circle of life
<umgrosscol>
Oh, hey _blizzy_
<_blizzy_>
hi umgrosscol
<umgrosscol>
_blizzy_: How is that code refactoring going?
<_blizzy_>
umgrosscol, ok.
pagios has left #ruby ["Leaving"]
theery has joined #ruby
<umgrosscol>
That's good to hear.
freezevee has joined #ruby
<ljarvis>
_blizzy_: so, how's is it not working now?
<ljarvis>
all you've done is rename some variables and move some code around
<ljarvis>
so it should be easy to identify the issue
<_blizzy_>
ljarvis, well, yeah, it's easy bugs, it's just cumbersome
<umgrosscol>
ljarvis: I always like to think that myself as well.
<_blizzy_>
^
<adaedra>
_blizzy_: it's also a work of patience :)
<umgrosscol>
ljarvis: Reality, compilers, and interpreters generally disagree with me.
<_blizzy_>
I got 99 bugs but the compiler ain't one
<freezevee>
I have a file called run.rb that parses data from a terminal command and exports it to json. Also I have another one web.rb with a sinatra path to show the json data, so I can use it as an API. How can I run the script that fetches the data as a deamon or service (ubuntu service) ?
<freezevee>
Should I merge the two files into one ?
flughafen_ has quit [Ping timeout: 255 seconds]
aapole has quit [Remote host closed the connection]
<ljarvis>
?context
<ruboto>
Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
flughafen_ has joined #ruby
shinnya has joined #ruby
<umgrosscol>
freezevee: You could encapsulate the behaviors in classes and have them as part of a single application. Then run that application as a service.
wildroman2 has quit [Remote host closed the connection]
davedev24_ has quit [Read error: Connection reset by peer]
davedev24_ has joined #ruby
<freezevee>
umgrosscol: what kind of service ? an O/S service in init.d ? or a Process.daemon ? I don't have previous experience in services so I am researching for the right way
<umgrosscol>
freezevee: There are two parts to your application, yes? One that fetches data and the other that exports it?
<freezevee>
I'll try gist it
enebo has joined #ruby
<freezevee>
Yes the one just grabs data and strips them from a command in terminal and exports it to json
icebourg has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
BigRonnieRon has joined #ruby
<freezevee>
The other simply starts sinatra and just attaches the File.read of the json to a route
BigRonnieRon has quit [Max SendQ exceeded]
<umgrosscol>
freezevee: init.d would probably be fine. Make sure the environment has the command from which the data is read.
<freezevee>
umgrosscol: it's pretty simple but helps me a lot
EagleDelta has joined #ruby
acke has joined #ruby
shock_one has quit [Remote host closed the connection]
shock_one has joined #ruby
BigRonnieRon has joined #ruby
marr has joined #ruby
<freezevee>
umgrosscol: I read the UPS status (in home) which are serial data with a single command
enebo has quit [Client Quit]
<freezevee>
then strip them , add them in a hash and save them to json
<freezevee>
and I want to read them every 5 seconds
pyo_ has quit []
<freezevee>
a cron job will also do the job but I've been reading so many different opinions in various websites that I don't know which to follow
langland_ has joined #ruby
<adaedra>
PEOPLE, THEY THINK DIFFERENT THINGS
<dfockler>
do what works until it doesn't
<umgrosscol>
freezevee: You could update the input data with a cron tab as well. Both are viable options actually. Just depends on where you want the timing mechanism. Do you want the OS or the application to handle it?
<freezevee>
umgrosscol: what is the difference ?
langlands has quit [Ping timeout: 252 seconds]
<freezevee>
I mean in execution. Is something that really matters ?
<freezevee>
What would you do ?
<umgrosscol>
freezevee: If you're using jruby, yes.
shock_one has quit [Ping timeout: 248 seconds]
<freezevee>
no simply ruby
pyon has quit [Ping timeout: 246 seconds]
<jhass>
every 5 seconds I wouldn't do as a cronjob
<umgrosscol>
freezevee: I'd probable leave it to the application if it was going to be something frequent. There is some overhead to spinning up ruby.
<jhass>
simply because spawning that many process can pollute your system quickly if they start hanging or something
<umgrosscol>
jhass: I hadn't thought of that angle.
User458764 has joined #ruby
<freezevee>
it makes sense
endash has joined #ruby
<jhass>
so ubuntu?
<freezevee>
so just leave an infinite loop and sleep for 5'' ?
<umgrosscol>
freezevee: You might want to utilize a pidfile. I think there is a small wrapper application for that in deb. Lemme look up what one of the other guys here has done.
<ljarvis>
I knew I was on to something
<apeiros>
ah, silly. since a && b is nil then too…
<jlebrech>
if statement for now?
<apeiros>
so yeah, must use proper branching then :)
<jlebrech>
:D
<apeiros>
a = b if b
<jlebrech>
that's clean enough, and less magic looking
pcfreak30 has quit [Read error: Connection reset by peer]
hectortrope has quit [Client Quit]
joonty has quit [Quit: joonty]
shock_one has quit [Ping timeout: 276 seconds]
zeroDivisible has quit [Ping timeout: 265 seconds]
<umgrosscol>
freezevee: I guess daemons takes care of that for you?
fgo has quit [Ping timeout: 244 seconds]
endash has quit [Quit: endash]
towski_ has joined #ruby
eGGsha is now known as eGGshke
<umgrosscol>
freezevee: Yeah. the daemonize gem is handling pidfiles for you. You can check out how it's doing that in the docs.
uptownhr has joined #ruby
eGGshke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<freezevee>
umgrosscol: any way I could do this without an external gem ?
flughafen_ has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
withnale_ has quit [Ping timeout: 246 seconds]
deric_skibotn has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<Sypheren>
Other than initialize, is there a list of special instance names somewhere?
moted has joined #ruby
momomomomo has quit [Ping timeout: 264 seconds]
<ljarvis>
Sypheren: initialize is the only special method you need to care about when it comes to class initialization
baweaver has quit [Remote host closed the connection]
<Sypheren>
ljarvis, but there aren't enough that there would be a list of them?
Igorshp_ has quit [Remote host closed the connection]
<ljarvis>
Sypheren: I'm not sure exactly what you're after, there are "special" methods in Ruby (i.e initialize, and methods that are hooks) but I'm not exactly sure what you want
<ljarvis>
this code makes no sense, you're assigning variables that are local to the method
danielpclark has quit [Ping timeout: 246 seconds]
<ljarvis>
they won't mutate the variables you pass in
momomomomo has joined #ruby
<_blizzy_>
ljarvis, even if I have attr_accessor in my class?
<ljarvis>
_blizzy_: yes, you're assigning local variables, they're lost when that method is finished
penzur has quit [Quit: Leaving]
<_blizzy_>
ljarvis, so how exactly would I assign them then? I'm confused on how to do this.
<_blizzy_>
oh
<_blizzy_>
return
symm- has quit [Ping timeout: 265 seconds]
<diegoviola>
can someone please give me an ELI5 about finite state machines, is this just another way to describe code that involves events, transitions and states?
iamninja has quit [Read error: Connection reset by peer]
Igorshp has quit [Remote host closed the connection]
<jhass>
I'm sure there are excellent blog articles about that if you spent 5 minutes on google
arup_r has joined #ruby
<ljarvis>
in 5 minutes you'll find them all
Zai00 has quit [Quit: Zai00]
<diegoviola>
so the universe is a finite state machine?
<ljarvis>
wow
<ljarvis>
you cant ask mere mortals that question
<diegoviola>
what?
<diegoviola>
ljarvis: why not?
<_blizzy_>
the universe is infinite but this battle is finished
<diegoviola>
umgrosscol: and the transitions, states, and so on
vasilakisfil has quit [Ping timeout: 256 seconds]
rjno has quit [Remote host closed the connection]
<momomomomo>
diegoviola: not modeling data, but states
<diegoviola>
momomomomo: right
<momomomomo>
event x happens, which transition the state to Z
<momomomomo>
so, if I'm a form, and someone creates me, then I'm at state 1
<umgrosscol>
diegoviola: "model data" is an ambiguous and loaded phrase. I'm not sure what you mean there. For example, a light bulb has three states: on, off, and broken.
thiagovsk has joined #ruby
<diegoviola>
so me going to get coffee and drinking can be modeled as a state machine
<momomomomo>
if someone reviews me and approves me, then maybe I go to state 2
<momomomomo>
then someone publishes me, and now I'm at state 3
renderful has joined #ruby
<umgrosscol>
diegoviola: On and off tx back and forth, but broken only tx to itself.
<arup_r>
any other way to download the gem ? so that I can resume my work :/
<shevy>
arup_r you can direct download a gem
<diegoviola>
umgrosscol: what do you mean by 'tx'?
<umgrosscol>
where tx is shorthand for transition or transfer in this case.
<momomomomo>
transaction
<momomomomo>
or transition
<diegoviola>
thanks
<_blizzy_>
may someone help me with instance variables?
<momomomomo>
_blizzy_: !ask
<momomomomo>
?ask
<ruboto>
Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<arup_r>
and then where to part what ...... I never install it manually
<shevy>
arup_r problem is, no gem called "multiple-dates-picker-rails" exists
<shevy>
simpy go to the project homepage at rubygems.org
charliesome has quit [Quit: zzz]
<shevy>
click on the "Download" section. That gem though does not exist, so you will have a hard time downloading it :>
<_blizzy_>
ok then. '@team' is returning nil. however, if I add a byebug to the script after it is assigned, it has the correct values. however, once the switch/case restarts back to the beginning, @team returns nil
<umgrosscol>
diegoviola: Generally yes, but you're edging into the realm of computer science that diverges from the applied programming aspect of it.
jahrichie has quit [Quit: Leaving.]
<momomomomo>
_blizzy_: heads up: that's not a great way to do things
<xomp>
Hello, would anyone be able to recommend a text editor that has syntax highlighting for Ruby in Ubuntu by chance? I'm more comfortable learning Ruby in Linux but do miss applications like Notepad++ for Windows with it's nice syntax highlighting.
<_blizzy_>
momomomomo, just requiring the file is not a great way?
<umgrosscol>
diegoviola: And things might not have a finite number of states, so your modeling may never complete.
<momomomomo>
_blizzy_: just defining random functions, with no class / module
<_blizzy_>
momomomomo, oh ok.
<_blizzy_>
let me put them in modules then
cndiv has joined #ruby
<momomomomo>
anyhow, _blizzy_ your issue is probably in your request_helper function
<momomomomo>
or get_team
<umgrosscol>
diegoviola: It's possible to write a program which only job is to create more states for itself.... in which case, your modeling would never complete. But you could probably heuristically box it in and say it has one state, "create new state" which only tx to itself.
<_blizzy_>
momomomomo, ok, let me try that. thanks.
<momomomomo>
it's too complex for me to sit and debug, but you might find pry helpful
gloscombe has quit [Read error: Connection reset by peer]
<momomomomo>
unless you're paying me, that is
<momomomomo>
:P
<momomomomo>
and I'm already on the clock for my employer
<slash_nick>
arup_r: make sense? you good to go now?
<arup_r>
slash_nick: you are right.. there Readme is wrong.. :)
gloscombe has joined #ruby
<slash_nick>
arup_r: you should give them a PR to fix things
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
<adaedra>
ok, found it
<arup_r>
back to work :)
anisha has quit [Quit: Leaving]
<arup_r>
what you found ?
<adaedra>
solution to my problem :)
ddarkpassenger has joined #ruby
<diegoviola>
I just tried aasm in ruby, it's very cool
<sphex>
hey. so, is setting Encoding.default_internal to a Unicode-compatible encoding the best way to make it so that concatenating arbitrary strings mostly works?
pengin has joined #ruby
sandstro_ has quit [Quit: My computer has gone to sleep.]
Xeago has quit [Remote host closed the connection]
<sphex>
I guess by default most things end up in the locale encoding and also mostly just works, but as soon as you get strings from elsewhere, concatenations can end up failing... :/
JDiPierro has quit [Remote host closed the connection]
drewo has joined #ruby
yqt has joined #ruby
alex88 has quit []
senayar has quit []
Xeago has joined #ruby
<slash_nick>
arup_r: way to go
quimrstorres has joined #ruby
<arup_r>
I know :)
nwhirschfeld has quit [Quit: No Ping reply in 180 seconds.]
quimrstorres has quit [Remote host closed the connection]
quimrstorres has joined #ruby
renderfu_ has joined #ruby
<das3in>
Hi I'm having a problem using variables in as dot-notation parameters in functions. Kinda new to Ruby, figure I'm missing something easy. Gist is self explanatory https://gist.github.com/das3in/1fa30caed86a64821e86
einarj has quit [Remote host closed the connection]
<apeiros>
das3in: we don't know what `event` is
renderful has quit [Ping timeout: 246 seconds]
<sphex>
das3in: I think try event.send condition, and make "paid" a symbol instead (:paid).
<apeiros>
das3in: btw., "paid" as a string will work too (send/public_send both convert to symbol). but :paid is better, then ruby doesn't have to convert.
<shevy>
speed trick!!!
MatthewsFace has joined #ruby
nwhirschfeld has quit [Client Quit]
j0n3 has quit [Read error: Connection reset by peer]
elia has joined #ruby
<das3in>
I actually had the conditions as strings before - as soon as I used public_send they started working. Good to know about symbols. Performance is waay past where I am now but that's good to know regardless
drbrain has joined #ruby
<das3in>
converted them all to symbols
pengin has quit [Remote host closed the connection]
<agent_white>
jhass is right, looks like a nose and eyeballs to me.
c0m0 has quit [Ping timeout: 246 seconds]
wildroman2 has joined #ruby
<shevy>
yeah
<shevy>
it's a smiling arab
<mark06>
what happened to #ruby-lang?
hectortrope has quit [Client Quit]
<Senjai>
mark06: It was merged
<shevy>
mark06 jhass sent everyone to #ruby
<agent_white>
\o/ yayay
<jhass>
and there I thought we would survive a week without the question :/
<Senjai>
s/sent/forced
<Senjai>
ftfy
<shevy>
haha
momomomomo has quit [Quit: momomomomo]
<havenwood>
mark06: It got several characters leaner.
<mark06>
Senjai, shevy: cool
<shevy>
in the past, people asked why there are two different channels
<Senjai>
jhass: does it forward here now?
<shevy>
now they ask - what happened to one channel
<shevy>
:)
<jhass>
Senjai: yeah
<Senjai>
shevy: Essentially, the other channel was less noob friendly, and more technical.
<apeiros>
?rubylang
<ruboto>
#ruby-lang has been merged with #ruby and redirects here. If you get an "you must be invited" error (or similar) when trying to join #ruby-lang: that's because you're already in #ruby and can't be forwarded.
<Senjai>
This kind of has a mix, but now we're forced to talk here, we scare people
<shevy>
I disliked the forced-registration-to-talk on #ruby-lang
OrbitalKitten has joined #ruby
elia has quit [Ping timeout: 256 seconds]
<mark06>
still there are people in #ruby-lang, better off making redirection to here
OrbitalKitten has quit [Client Quit]
<havenwood>
jhass: The output is backwards though.
<apeiros>
?rubylang mark06
<ruboto>
mark06, #ruby-lang has been merged with #ruby and redirects here. If you get an "you must be invited" error (or similar) when trying to join #ruby-lang: that's because you're already in #ruby and can't be forwarded.
OrbitalKitten has joined #ruby
<apeiros>
*** and redirects here ***, emphasis added…
benlieb_ has left #ruby [#ruby]
<havenwood>
jhass: Should be horizontally mirror image of what it is.
GitStud is now known as GitGud
<apeiros>
and the only people in #ruby-lang are staffers.
<sphex>
Encoding.default_external does not apply to files opened for writes?
<Senjai>
diegoviola: The tldr is, use /usr/bin/env ruby in 99% of cases
benlieb_ has joined #ruby
<atmosx>
> "-" * 50000000
mtakkman has joined #ruby
<apeiros>
mark06: seems you are right. for some reason forward seems to have dropped. it's back.
<apeiros>
mark06: so thanks for telling :)
Igorshp has quit [Ping timeout: 256 seconds]
<atmosx>
>> "-" * 50000000
<ruboto>
atmosx # => /tmp/execpad-88d89c8d53e8/source-88d89c8d53e8:1:in `inspect': failed to allocate memory (NoMemoryErr ...check link for more (https://eval.in/387737)
<apeiros>
!kick atmosx you know the bot isn't for spamming
atmosx was kicked from #ruby by ruboto [you know the bot isn't for spamming]
lkba has quit [Ping timeout: 256 seconds]
<Senjai>
I still think ruboto should be open sourced
<diegoviola>
Senjai: right, it makes more sense when having multiples rubies installed with chruby,etc
<Senjai>
poke, poke
<Senjai>
diegoviola: Yes
<Senjai>
diegoviola: more specifically, user vs system ruby
benlieb_ has quit [Client Quit]
<diegoviola>
yep
<Senjai>
not all users can use /usr/bin/ruby for all operations
freerobby has joined #ruby
AugustoCesar has joined #ruby
benlieb_ has joined #ruby
<Senjai>
It will essentially just give you the "right" one for the current environment
<diegoviola>
what do you mean that not all users can use the system ruby?
duderonomy has quit [Ping timeout: 252 seconds]
<diegoviola>
there's nothing preventing you from using /usr/bin/ruby as a user
solars has joined #ruby
towski_ has quit [Remote host closed the connection]
micmus has quit [Ping timeout: 248 seconds]
<agent_white>
diegoviola: System binary vs user binary
<sphex>
apeiros: was that about the encodings? are you saying that behavior changed between versions?
<wmoxam>
^^^ this discussion illustrates my least favorite thing about interpreters :p
<Senjai>
diegoviola: Not by default
ndrei has joined #ruby
<apeiros>
sphex: sorry, distracted
<Senjai>
diegoviola: I can prevent users from using certain executables in /usr/bin if I want to
<apeiros>
sphex: do you have a gist elaborating your problem? kinda lazy to scan the backlog
<nofxx>
about rbenv and rvms, we could agree to point all noobs to just use your pkg manager ruby. 3 out of 5 times I come here the issue is someone with multiple ruby envs and no need for it
robustus has quit [Ping timeout: 255 seconds]
<mark06>
diegoviola: in general env shebang is used for not relying on fixed paths, so it's more flexible
AugustoCesar has left #ruby ["PONG :wilhelm.freenode.net"]
<Senjai>
nofxx: no, people need to ditch rvm and rbenv entirely, and use chruby instead. The only usecase for rvm is gemsets, and thats really only if you're running a ci server
<diegoviola>
Senjai: you can do anything on your system, but by default on most distros users can use the system binaries just fine
<nofxx>
Senjai, ehehe exactly.. I was writing that: there's no need outside CI
<apeiros>
sphex: you forgot the output?
<sphex>
I guess it's supposed to be like that. I'm trying to figure out the correct ways to handle the encodings with ruby. :/
<diegoviola>
mark06: I see, thanks
<sphex>
apeiros: "#<Encoding:UTF-8>" for 'w' mode and nil for 'r' mode
<nofxx>
Senjai, even chruby... debian is always the problem with archaic packages... point to brightbox binaries
<Senjai>
diegoviola: Do you want something that works 100% of the time, or 99% of the time?
<apeiros>
sphex: and your default_external is?
<sphex>
apeiros: #<Encoding:UTF-8>
<Senjai>
nofxx: Who uses apt, I build all rubies with ruby-install
<Senjai>
ruby-install --md5 specifically
robustus|Off has joined #ruby
robustus|Off is now known as robustus
<dfockler>
who uses ruby-install, I build all my rubies from source
<nofxx>
Senjai, what I usually see here is that. debian or mac ppl struggling with multiple rubies
<nofxx>
Senjai, who knows debian sucks know his way around ;)
<Senjai>
nofxx: If they use chruby, its not difficult.
<apeiros>
sphex: sounds fine? nil means it'll use the default
<Senjai>
nofxx: Maybe they just dont understand their operating system? Or how to compile things properly?
<Senjai>
It is a skill
<diegoviola>
Senjai: neither, Linux works for me every time
<diegoviola>
Senjai: I also use chruby / ruby-install btw
<Senjai>
diegoviola: I can totally restrict users from using /usr/bin
<diegoviola>
Senjai: and?
JDiPierro has joined #ruby
<Senjai>
diegoviola: also you cannot install certain gems with the system ruby without root
pansophical has quit [Quit: Leaving.]
michael_mbp has joined #ruby
<diegoviola>
Senjai: list which ones
<Senjai>
diegoviola: and, just use env, it works 100% of the time
<skyjumper>
is anyone else have to get approval from IT to install from homebrew/rubygems?
choke has joined #ruby
<sphex>
apeiros: it does not. writing keeps the "internal" encoding of the strings instead of transcoding like reading does.
<skyjumper>
just started this job, and it seems ridiculous... should i accept it as normal, or move on?
pengin has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
skade has joined #ruby
<diegoviola>
skyjumper: what is ridiculous about it?
<havenwood>
skyjumper: Do you mean in production or on your development machine?
nutha has quit [Ping timeout: 245 seconds]
<nofxx>
skyjumper, weird... how can an IT rule prevent you from installing things on ~ ?
Musashi007 has joined #ruby
<skyjumper>
diegoviola: i'm not allowed to install anything that hasn't been pre-approved
<apeiros>
sphex: transcodes for me (ruby 2.2.2)
<skyjumper>
havenwood: dev machine
<diegoviola>
skyjumper: move on
<wmoxam>
skyjumper: that's very weird :p
<apeiros>
sphex: please gist an example which demonstrates the lack of transcoding
dx7 has quit [Read error: Connection reset by peer]
<skyjumper>
but the money is really good. heh
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
sphex: i.e., show the binary data which you write, and the binary data in the file
<skyjumper>
so that's not at all common?
<diegoviola>
skyjumper: what OS?
<skyjumper>
diegoviola: OSX
dx7 has joined #ruby
<havenwood>
skyjumper: How can they stop you?
<nofxx>
also curious
rjno has quit [Remote host closed the connection]
<agent_white>
skyjumper: Seems normal. Normally they need to do some risk-management to ensure it won't do anything naughty.
<skyjumper>
havenwood: some kind of monitoring software will eventually auto-uninstall anything i install
<agent_white>
Go bring them a bottle of whiskey and maybe they'll put you on a whitelist. ;P
<nofxx>
skyjumper, in your HOME ? crazy... ask the guy to come with every gem and npm you need... for a common rails project that'l be ~ 1000
<shevy>
I would not want to work under psychopaths
<nofxx>
shevy, first day, they were generous
ayonkhan has joined #ruby
<shevy>
:\
<apeiros>
sphex: something which shows your code, expectation, and actual result
ixti has quit [Ping timeout: 244 seconds]
yqt has quit [Ping timeout: 276 seconds]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
sphex: otherwise you leave me guessing… I mean from what you said before I can puzzle it together. but in general, if you want help, you make sure all puzzle pieces are around ;-)
<nofxx>
skyjumper, is it some financial company? bank? military?
<skyjumper>
even microsoft couldn't be that stupid
<agent_white>
skyjumper: I still vote bringing them a liquor-gift in exchange for freedom. Sysadmins love whiskey.
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros>
plerp. up to new horizons! figuring how to do a good API for composite adaptors/validators/processors :D
<sphex>
apeiros: ok yes. running that, I get one latin-1 byte in the file. and then it attemps to read it as UTF-8 and fails to convert it.
<skyjumper>
agent_white: the decision makers are probably 1500 miles away
<apeiros>
sphex: ok, then let me repeat - what ruby version?
<sphex>
apeiros: 2.1.6
<skyjumper>
the input is appreciated... /me feels justified now
<apeiros>
sphex: ok, only have 2.1.5 installed. but that runs the given piece of code correctly and fits expectation
bosma has joined #ruby
<diegoviola>
skyjumper: I honestly don't understand why some corporate environments do this, how do they exepct people to get the work done when they restrict everything?
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
so I'm a bit at a loss where it is going wrong for you
rbowlby has joined #ruby
griffindy has joined #ruby
<diegoviola>
expect*
<skyjumper>
diegoviola: they aren't thinking about dev teams. they're thinking about the Accounts Payable with some windows machine
<diegoviola>
yes, so in other words, they're stupid
<skyjumper>
and dev teams, they probably expect to just use the microsoft suite with everything included
<sphex>
apeiros: oh.. so it's definitively supposed to transcode to default_encoding on writes too? well damn.. gotta figure out what is happening here. :/
t0rrieri has quit [Quit: Be back later ...]
<skyjumper>
every company > 50 people i've worked for has been a mess of stupidity
fgo has joined #ruby
<apeiros>
sphex: yes
baweaver has joined #ruby
<diegoviola>
I work at a company where I'm supposed to use a Windows machine for work (and I do) and initially Windows was set up in such a way that I couldn't access or install anything, some coworker however gave me admin rights on Windows and I installed VBox and Arch inside of the VM, so I full screen Arch and I never get to use Windows, evne though it's running as the host OS
Muhannad has joined #ruby
<diegoviola>
even*
<shevy>
damn
<shevy>
you conformed to them
<skyjumper>
diegoviola: ruby dev job?
Muhannad has quit [Max SendQ exceeded]
<shevy>
you have become a windows developer now diegoviola
baweaver has quit [Remote host closed the connection]
micmus has joined #ruby
<diegoviola>
shevy: negative
lva has quit [Remote host closed the connection]
<dfockler>
diegoviola: I had to do that once
<sphex>
apeiros: thanks! at first I through ruby was opening files being written to in binary mode by design to preserve whatever internal encoding of the written strings. must be something wrong with my setup I guess. :/
<shevy>
and you are even in denial now :)
simplyianm has joined #ruby
<diegoviola>
skyjumper: they write php and js, I'm still insisting to them that I want to write Ruby, but they have a server that doesn't have ruby support
<diegoviola>
shevy: not in denial, I'm using Arch
pocketprotector has joined #ruby
<shevy>
on windows
<skyjumper>
diegoviola: "but php runs everything"
<shevy>
you painted your prison pink
husanu1 has joined #ruby
<diegoviola>
shevy: it doesn't matter, I'm using arch
<shevy>
on windows
<diegoviola>
shevy: I get to see windows when I resume from suspend, then Arch is fullscreen
<diegoviola>
and I don't see windows anymore
Muhannad has joined #ruby
Muhannad has quit [Max SendQ exceeded]
<shevy>
;P
<apeiros>
naming question:
<diegoviola>
shevy: yes but at some point I'll be able to run ARch on bare metal here, I doubt they'll stop me
<diegoviola>
shevy: I just need an external HDD
<shevy>
apeiros pick the swiss name
<apeiros>
a method which does what `foo[a][b][c]` does, but `foo.NAME(a, b, c)`
<shevy>
gruetzlibuetzli
claw has joined #ruby
fgo has quit [Ping timeout: 246 seconds]
<shevy>
hmm
<shevy>
you mean you need a name now, rather than [] ?
<apeiros>
I don't like deep_fetch :-/
<shevy>
how about... matrix_fetch !
<apeiros>
shevy: the point is that it does a nested lookup
arup_r_ has joined #ruby
exadeci has quit [Quit: Connection closed for inactivity]
<apeiros>
i.e. what you'd have to use multiple chained [] calls
<apeiros>
heftig: though defining [] as [](*keys) would be an option, as in the given case, an array will never be the key. it's either an (integer) index or a string-key.
<simplyianm>
apeiros: name it depending on what the data you want is
jahrichie has joined #ruby
<shevy>
how about .triple_fetch
<simplyianm>
no
peter_paule has joined #ruby
<simplyianm>
don't call it something like that
<simplyianm>
What does your function do?
Contigi has quit [Quit: Leaving]
<shevy>
but hash also has .fetch for []
<simplyianm>
name it very explicitly as to what the point of its behavior is
<apeiros>
simplyianm: it gets you the validation/adaptation/processing result of a composite
<Senjai>
diegoviola: You complain enough to the point where I remember what you complained about
<Senjai>
_blizzy_: You asked that yesterday
<diegoviola>
Senjai: I might have complained about having to use windows but that's it
<_blizzy_>
Senjai, yeah, I never figured it out.
<Senjai>
_blizzy_: Wow
<Senjai>
_blizzy_: Your code has gotten a lot better
<_blizzy_>
Senjai, thanks.
<_blizzy_>
:)
<Senjai>
_blizzy_: There's still a lot more room for improvement, but don't you feel better about that?
<_blizzy_>
I thought you was about to say something negative c:
<_blizzy_>
yes, I do.
rjno has joined #ruby
rjno has quit [Remote host closed the connection]
cmisenas has joined #ruby
<Senjai>
Everything is iterative. I told you I wasn't bashing you ..
<diegoviola>
who wouldn't complain about having to use windows?
lkba has joined #ruby
<_blizzy_>
Senjai, I know. I said it the wrong way.
<_blizzy_>
I actually like windows
<Senjai>
diegoviola: I thought it was about not getting source code
<Senjai>
diegoviola: Install a vm
towski_ has joined #ruby
prestorium has quit [Ping timeout: 246 seconds]
Agoldfish has quit [Quit: G'Bye]
Xeago has quit [Remote host closed the connection]
Agoldfish has joined #ruby
<diegoviola>
Senjai: no, I don't think I've complained about this, sorry in any case
lkba_ has quit [Ping timeout: 244 seconds]
TheHodge has quit [Quit: Connection closed for inactivity]
OrbitalKitten has joined #ruby
<jhass>
diegoviola: to clarify, it's not about the particular issues but the general "my work sucks so much" theme
<Senjai>
^
dgutierrez1287 has quit [Ping timeout: 264 seconds]
<Senjai>
diegoviola: If you're looking for empathy, I empathize. It's hard for me to console you when I would just quit in that situation and save my sanity
<Senjai>
Because that's the right thing to do in that situation
<diegoviola>
Senjai: I'm not looking for any of that
Or1on has joined #ruby
<Senjai>
IF you dont do it, and keep complaining, it's frustrating
<Senjai>
:P
<Senjai>
<< My point of view
Guest25 has joined #ruby
<diegoviola>
jhass: someone else was complaining about his job
bubbys has joined #ruby
<apeiros>
well
Guest25 is now known as gabhart
<apeiros>
?ot diegoviola
<ruboto>
diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<Senjai>
_blizzy_: Want my suggestion on what you could do next?
<_blizzy_>
Senjai, sure.
<Senjai>
_blizzy_: refactoring wise? (I cant look into @team atm)
<_blizzy_>
Senjai, ok.
Musashi007 has quit [Quit: Musashi007]
xomp has quit [Quit: Leaving]
<Senjai>
_blizzy_: Start removing duplication. If you see three or four lines that are similar, with only one change, remove that duplication
<Senjai>
_blizzy_: Get rid of the m variable
DoubleMalt has quit [Ping timeout: 246 seconds]
<_blizzy_>
I actually changed the m var to message
<benlieb_>
setting up a new mac machine. You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
<benlieb_>
should I need sudo for gem install bundler?
krz has quit [Quit: WeeChat 1.0.1]
<Senjai>
benlieb_: ask diegoviola ;)
<benlieb_>
diegoviola: ^
<shevy>
diegoviola ^^^
<benlieb_>
:)
tubuliferous_ has joined #ruby
<Senjai>
benlieb_: I'm just bugging diegoviola, he argued sudo isn't required for certain gem installs.
hahuang65 has joined #ruby
<skyjumper>
benlieb_: are you using the system ruby?
zendrix has joined #ruby
<Senjai>
benlieb_: If you're using the system ruby, then yes. If you're using a user ruby then you wouldn't need to
<havenwood>
benlieb_: You can install to your user home directory: gem install bundler --user-install
<slash_nick>
am i mistaken, or can't you just enter a login shell and install... /bin/bash --login;gem install bundler ?
<diegoviola>
Senjai: I never install gems as root
<Senjai>
havenwood: I would recommend chruby or the like to get user specific rubies. But that also works
<diegoviola>
Senjai: I don't have sudo installed either
kraljev11 has joined #ruby
<Senjai>
sudo is... fantastic.
<havenwood>
benlieb_: You can add to your .gemrc if you like: gem: "--user-install"
<havenwood>
benlieb_: Are you a Homebrew user?
<Senjai>
havenwood: Does sudo run on Mac? (serious question)
<diegoviola>
actually I have sudo installed
<diegoviola>
but I don't use it
<havenwood>
Senjai: Yes, BSDs have sudo.
<Senjai>
diegoviola: What OS?
<Senjai>
havenwood: TIL
<diegoviola>
Senjai: arch
<Senjai>
diegoviola: Oh.
wookiehangover has joined #ruby
<Senjai>
diegoviola: Sudo is fantastic. There is no downside. You should never be able to login as root, or su root
AlphaAtom has joined #ruby
<Senjai>
besides sudo -i
<diegoviola>
yeah I know sudo
Aswebb_ has joined #ruby
<diegoviola>
I've been using linux for half my life
mcclurmc has joined #ruby
droidburgundy has joined #ruby
<Senjai>
I've only used it for the past 4 years or so
<Senjai>
beyond being a router, or a nfs
<sphex>
apeiros: BTW, found what my problem was I think. apparently default_external doesn't work for files opened in write modes unless default_internal is also set (and this is not a bug). https://bugs.ruby-lang.org/issues/3533
tubuliferous_ has quit [Ping timeout: 276 seconds]
<apeiros>
sphex: oh wow. I didn't know that. this makes so little sense.
kraljev11 has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benlieb_>
I use homebrew and chruby
<apeiros>
sphex: thanks for telling!
<havenwood>
benlieb_: Ah, great.
<apeiros>
/sharing
<havenwood>
benlieb_: Why are you using system Ruby? Just curious.
<benlieb_>
I’m just setting this new work machine up and though I work from a mac personally, it’s been years since I’ve had to set it up, and things were different then
<benlieb_>
havenwood: there’s only one ruby right now, so I guess so
towski_ has quit [Remote host closed the connection]
<benlieb_>
I have a .ruby-version in this project, but it only says 2.0.0
<benlieb_>
How would I specify a “user” ruby?
toretore has joined #ruby
<benlieb_>
I used to use RVM
bronson has joined #ruby
<Senjai>
benlieb_: Set up chruby :)
<benlieb_>
Senjai: I just installed that.
<Senjai>
Oaky
<Senjai>
also install ruby-install
hck89 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
benlieb_: The sister tool of chruby that installs Rubies is ruby-install.
<havenwood>
benlieb_: Another way to install latest stable Ruby is: brew install ruby
<Senjai>
Butttttt, ruby-install is the way to go
<havenwood>
benlieb_: Which doesn't have to compile because they've "poured a bottle."
fabrice31 has joined #ruby
hck89 has joined #ruby
<Senjai>
If you learn how to use ruby-install, your life becomes easier
<sphex>
apeiros: I think they really wanted the string's encodings to be preserved when writing *by default*. default_external is set to the locale, and default_internal to nil, so these are the conditions to decided on to let writes preserve the encoding.
<skyjumper>
is chruby picking up momentum against rvm/rbenv?
<Senjai>
Because if you get like me, and now have 12 different ruby versions installed
<_blizzy_>
could anyone help with my team problem?
<benlieb_>
I have ruby-install as well
<Senjai>
skyjumper: rvm is for ci servers. Chruby is for sane people. :P
<benlieb_>
but I don’t see a way to specify that I use a “user” level ruby
<Senjai>
benlieb_: If you install a ruby with ruby-install, chruby will pick it up automatically next time it is sourced (e.g. close and reopen your terminal, or source the chruby script manually)
<skyjumper>
why not chruby everywhere then?
<Senjai>
skyjumper: The same reason people still use php
<skyjumper>
i switched from rvm to rbenv and it worked essentially the same
<benlieb_>
so chruby will give preference to user rubies, even of the same version?
<Senjai>
chruby will detect the system ruby to
<skyjumper>
Senjai: because wordpress uses it, and you can hire offshore devs at $8/hr?
hck89 has quit [Client Quit]
<skyjumper>
...why people use php
<Senjai>
skyjumper: Mostly because people dont like change, even if it's good for them.
dopie has quit [Quit: This computer has gone to sleep]
Contigi has joined #ruby
annette has joined #ruby
benlieb_ has quit [Quit: benlieb_]
sngeth has quit [Ping timeout: 256 seconds]
<havenwood>
tacit7: For non-Rails apps the main functionality that Bundler provides has even been incorporated into modern RubyGems itself. For example, to install deps relative to you app in vendor/bundle and create a Gemfile.lock you can run: gem i -g -i vendor/bundle
SolarSailor has quit [Quit: My Turing machine has gone to sleep. ZZZzzz…]
<GarethAdams>
toretore: I don't have the code because I'm writing the tests first, but it's along the lines of a utility module with a MyModule.logger accessor (I realise that hypothetical code is almost as bad as no code)
<toretore>
GarethAdams: gist the test code?
pocketprotector has joined #ruby
chinmay_dd has joined #ruby
<jhass>
GarethAdams: new object seems easier to get right, but you could also write a reset method that sets the defaults and call it in an after each hook
<toretore>
any code is better than no code
crazydiamond has joined #ruby
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wallerdev has quit [Quit: wallerdev]
<freezeve_>
jhass: first of all I run ruby parse_ser.rb run and I get a permissions error
<toretore>
GarethAdams: class/module level accessors are basically global variables, with everything that that brings
senayar has quit [Remote host closed the connection]
<freezeve_>
jhass: and my files are all 777 and chowned to me
<_blizzy_>
I wasn't passing the team to the switch_helper
<_blizzy_>
thanks for the help, havenwood :)
iamninja has joined #ruby
<jhass>
freezeve_: print Dir.pwd in parse.rb, maybe it changes the working directory?
<GarethAdams>
toretore: That makes total sense. I'll try removing them and make it work properly, and come back if I get stuck
<freezeve_>
secondly, ruby web_ser.rb run says process with pid xxxx started but it does not run at all
swgillespie has joined #ruby
<toretore>
GarethAdams: my dislike for generic "utility modules" aside, try writing it as a class which you instantiate and then pass to whatever other objects need it
nelsonsozinho has quit [Remote host closed the connection]
<jhass>
freezeve_: so that's your only assertion of "not working"? did you check if you can access it nonetheless?
tacit7 has joined #ruby
<toretore>
and then you decided that you're going to ignore that and daemonize anyway?
chipotle has joined #ruby
<freezeve_>
toretore: I am not sure I understand the author's point
lavros has quit [Quit: leaving]
cvtsx1 has quit [Ping timeout: 244 seconds]
tubuliferous_ has quit [Ping timeout: 246 seconds]
kraljev11_ has joined #ruby
<radens>
Hello, I have written a fair amount of ruby, but when I write ruby I just write python and change the syntax until it works (I'm exaggerating). This is not ideal. What's a good book or site to read and learn the ins and outs of ruby itself? A lot of the books and sites about ruby are geared towards absolute beginners.
<toretore>
_blizzy_: problem solving: divide each problem into smaller problems until you can't divide any more, then solve each of these problems on their own
simplyianm has quit [Read error: Connection reset by peer]
<Senjai>
Also what toretore said, but I know you've been working on that
tommylom1ykins is now known as tommylommykins
<toretore>
_blizzy_: where's your code?
Pupeno has quit [Ping timeout: 256 seconds]
simplyianm has joined #ruby
yayfoxes has quit [Ping timeout: 246 seconds]
j4cknewt has quit [Remote host closed the connection]