millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TomyLobo has quit [Ping timeout: 260 seconds]
bubbys has joined #ruby
underplank has joined #ruby
firstdayonthejob has quit [Ping timeout: 240 seconds]
hannelita has joined #ruby
froome has joined #ruby
mary5030_ has quit [Ping timeout: 240 seconds]
zotherstupidguy has joined #ruby
hahuang65 has joined #ruby
ympeg has joined #ruby
<zotherstupidguy>
whats a good ruby webserver for handling big uploads? and why?
<froome>
I'm getting an error when I try to pass a variable containing a URL to open(), but no error when passing the same URL directly, any insight on this? http://pastebin.com/TSyfsMpp
<helpa>
Hi froome. We in #ruby would really appreciate it if you did not use pastebin during your time with us.
<helpa>
Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
<dn5>
Eh.. I still can't wrap my head around it. So does it actually have to separate each here for a particular key or?
chimche has joined #ruby
jam_ has joined #ruby
akem has joined #ruby
<Ox0dea>
dn5: You should declare your block to take two parameters (`key` and `value` are great names here) and proceed accordingly.
<Ox0dea>
DATA 1 is an array of hashes, DATA 2 is just a hash.
<Ox0dea>
You won't be able to apply the exact same algorithm; they're just differently structured data.
<dn5>
Ah..
gm987 has joined #ruby
nfk|laptop has joined #ruby
epi____ is now known as epipens
<dn5>
ahh.. makes sense. now I'm either thinking about writing another function but first detect if it's array of hashes or a hash.. But I'm pretty sure there is more faster and common way
gm987 has left #ruby [#ruby]
epipens is now known as epistle
pawnbox has joined #ruby
jam_ has quit [Ping timeout: 250 seconds]
<Ox0dea>
dn5: If you want to "array-ify" some random object, just use it as an argument to Kernel#Array.
<nfk|laptop>
Ox0dea, but are you sure that US public domain is copyrighted in EU?
jam_ has joined #ruby
<Ox0dea>
Where did I say as much?
<nfk|laptop>
[04:57] <Ox0dea> But then French people won't be able to use it.
ajf- has joined #ruby
fatih has joined #ruby
psy_ has quit [Ping timeout: 250 seconds]
<fatih>
Hi everyone
<nfk|laptop>
_Tariq, anyway, to give a more complete answer (IANAL, ya ken) you can also say that they can do whatever or just put it under ISC license which is what i use
<nfk|laptop>
for stuff i want to publish and don't care what happens to it
northfurr has quit [Quit: northfurr]
krz has joined #ruby
hannelita has quit [Remote host closed the connection]
<fatih>
I'm looking for a book which aims for programmers who knows already 1-2 languages very well
ympeg has quit [Remote host closed the connection]
<_Tariq>
nfk|laptop: Got it
<_Tariq>
So I will just find some way to handle it
<fatih>
Is there any recommendation? It shouldn't be a book that teaches programming from ground
northfurr has joined #ruby
<fatih>
I'm new to Ruby and would like to have something that teaches the basics in a short time
<_Tariq>
Ox0dea: The only reason I'm worried about licensing Gists is that I want people to use my code but am afraid they might think a few lines of code is copyrightable
<nfk|laptop>
fatih, if you know any language really well, just dive in?
<_Tariq>
and thus will be deterred from using my code
<al2o3-cr>
omg
<nfk|laptop>
al2o3-cr, i do actually sometimes get that feeling to
<fatih>
a book helps you to show the most important part in a very dense way, there is a reason for it
<nfk|laptop>
though i try my best to shrug it off
<nfk|laptop>
and i'm talking from the perspective of user there
jbrhbr has quit [Ping timeout: 250 seconds]
<al2o3-cr>
this is a joke right?
<nfk|laptop>
fatih, ruby koans
certainty has joined #ruby
<nfk|laptop>
al2o3-cr, make of it whatever you want, if it makes you laugh, good for you
<nfk|laptop>
fatih, there's also codeschool rails course which is how i started before moving on to koans
<_Tariq>
fatih: RubyMonk is also a good course as well
bronson has joined #ruby
<_Tariq>
Try also Ruby's Codecademy class as well
<fatih>
Ok looking into it, thanks a lot for the suggestions
bkxd has joined #ruby
<nfk|laptop>
oh, not rails but ruby course at codeschool
dopie has joined #ruby
<_Tariq>
Also, "The Well Grounded Rubyist" and "Learn to Program"
<nfk|laptop>
their rails for zombies course is more famous but you always start with pure ruby
<_Tariq>
are two books that focus on Ruby.
<nfk|laptop>
yeah, ruby has really good books
<_Tariq>
Well-Grounded Rubyist is a bit more technical so if you already have experience in other languages, you'll like it
<_Tariq>
I have also heard of the Pickaxe book, but I never read it.
<nfk|laptop>
meanwhile python has some crazy nice irc community
bronson has quit [Remote host closed the connection]
daivyk has quit [Quit: ZZZzzz…]
<nfk|laptop>
and python has bindings to almost everything but ruby (probably)
<_Tariq>
Is there any way to copy the irc chat and paste it into a book?
djbkd_ has joined #ruby
<nfk|laptop>
hopefully not
danieli has joined #ruby
<nfk|laptop>
but i'm sure nsa has perfected the art of it anyway
<_Tariq>
A jokey suggestion by which python might be able to have a good book like the Ruby community
<_Tariq>
al2o3-cr: Yeah, I guess my jokes aren't that good.
<_Tariq>
well, that joke.
<_Tariq>
The other license nonsense wasn't a joke.
<_Tariq>
But...er...that's a bit offtopic.
certainty has quit [Ping timeout: 272 seconds]
mloveless has joined #ruby
<nfk|laptop>
_Tariq, anyway, be sure your license is not as long or longer than the actual code
hxegon_AFK has quit [Quit: BRB]
<nfk|laptop>
if it is, make it sorter
bkxd has quit [Ping timeout: 260 seconds]
<nfk|laptop>
or just skip it entirely, hopefully whoever decides to borrow a line or two knows how to adapt it to their code
mloveless has left #ruby [#ruby]
<_Tariq>
Yeah, ISC seems to be a good fit for me. Only 120 words.
<nfk|laptop>
and even if they didn't unless it has some really weird stuff like granny_achings_special_variable no one will be able to prove it's not original code anyway
<nfk|laptop>
_Tariq, still long in my books
<_Tariq>
Yeah, there really needs to be something even simpler.
<al2o3-cr>
_Tariq: Willing to share the code?
<nfk|laptop>
dwtfyw licence
djbkd_ has quit [Ping timeout: 265 seconds]
<_Tariq>
al2o3-cr: Sure, I can do that
<_Tariq>
At least the code that got me kinda upset
<nfk|laptop>
al2o3-cr, are you hoping it's a code to select the best license out there?
<nfk|laptop>
IANAL but i'm suspecting that stuff is technically (at least by the EU style copyright law) under a proprietary license
<_Tariq>
er, which stuff?
juddey has joined #ruby
kalopsian has quit [Ping timeout: 240 seconds]
<_Tariq>
UNLICENSE: 199 words, Code (excluding the paragraphs array): 49 words
<nfk|laptop>
_Tariq, you do not need to put the full license text in every file but normally you'd have a small or not so small preamble that states year, author(s), copyright holder (not sure about order there) and usually on another line the license name at least or or something.
hxegon has quit [Ping timeout: 264 seconds]
<_Tariq>
This is going to annoying fast.
<_Tariq>
Especially because I have already created a lot of repos
<_Tariq>
with files that do not have that preamble.
<nfk|laptop>
and once you get to it you'll find it will have taken much less time than you expected as long as you KISS
Moosashi has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
<nfk|laptop>
Ox0dea, i was being a bit sarcastic there
<nfk|laptop>
Ox0dea, i seriously do not think you can prove anything from just few lines
<dn5>
Ox0dea, I may found the way how to deal with the problem I wrote. On first example, the hash.count returns 2, while on second, it always return 1. I just need to rewrite a function for the second data example
<Ox0dea>
It's returning the number of key-value pairs.
<Ox0dea>
You want Kernel#Array, my friend.
<nfk|laptop>
like if i had foos.map! { |nfk_special_sauce| nfk_special_sauce++ } and someone re-used it with just different identifier in place of foos it would be very indemnifying but otherwise it's as generic as they come
Mirry has quit [Quit: leaving]
<dn5>
Ox0dea, It will work. The second example always return one "release"
Ebok has quit [Read error: Connection reset by peer]
<Ox0dea>
dn5: But don't you want to treat it like all the other results?
psy_ has joined #ruby
psy_ has quit [Read error: Connection reset by peer]
<dn5>
Ox0dea: I don't have to. I just need the output it in the same "style" as first example. But I need to figure out how to do hash.each for a single hash and not array of hashes
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dopie has joined #ruby
<nfk|laptop>
dn5, countless ways, the worst is by using [*array]
jbrhbr has joined #ruby
<nfk|laptop>
the best is to write your code in a way that you never have to "solve" such issues
<dn5>
Ic.. it's still experimenting.
<nfk|laptop>
note that while it works you are unpacking an array within an array which is at best brain-dead
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kies^ has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
hxegon has joined #ruby
yfeldblum has joined #ruby
akem has quit [Quit: Bye]
JohnT has joined #ruby
djbkd_ has quit [Ping timeout: 265 seconds]
scripore has quit [Quit: Leaving]
pawnbox has joined #ruby
kies has joined #ruby
rkazak has joined #ruby
pik has quit [Ping timeout: 255 seconds]
astrobun_ has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
bobajett has joined #ruby
nbdy has joined #ruby
<bobajett>
I need help with naming convention. What should I call a method that does this: def xxx_foo( resource ); foo = get_foo( resource ); if !foo: foo = make_foo(); save(foo); return foo
cpup has quit [Ping timeout: 240 seconds]
<bobajett>
where Im mapping get_foo() and save_foo() to getting and saving the resource to a DB.
arup_r has joined #ruby
mary5030 has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cpup has joined #ruby
mary5030 has joined #ruby
mfb2 has joined #ruby
choke has quit [Ping timeout: 276 seconds]
jbrhbr has joined #ruby
bobajett has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
nixmaniack has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Ping timeout: 240 seconds]
nixmaniack has joined #ruby
mfb2 has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Ping timeout: 255 seconds]
krz has quit [Ping timeout: 276 seconds]
janebootydoe has quit [Ping timeout: 256 seconds]
gix has quit [Ping timeout: 246 seconds]
krz has joined #ruby
tmtwd has joined #ruby
arescorpio has quit [Quit: Leaving.]
jbrhbr has quit [Quit: Leaving.]
jbrhbr has joined #ruby
gix has joined #ruby
kt2 has joined #ruby
nixmaniack has quit [Read error: Connection reset by peer]
nixmaniack has joined #ruby
dopie has joined #ruby
hannelita has joined #ruby
astrobun_ has joined #ruby
hxegon is now known as hxegon_AFK
vdamewood has joined #ruby
hxegon_AFK has quit [Quit: BRB]
certainty has joined #ruby
atomical has quit [Ping timeout: 265 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sankaber has joined #ruby
sankaber has quit [Client Quit]
ohaibbq has joined #ruby
pawnbox has quit [Remote host closed the connection]
guacamole has joined #ruby
lacuna has quit [Remote host closed the connection]
hannelita has quit [Ping timeout: 255 seconds]
pawnbox has joined #ruby
kies^ has joined #ruby
mary5030_ has joined #ruby
certainty has quit [Ping timeout: 264 seconds]
hxegon has joined #ruby
yfeldblum has quit [Ping timeout: 272 seconds]
mary5030 has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
Encapsulation has quit [Ping timeout: 260 seconds]
Cohedrin has joined #ruby
bMalum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nbdy has quit [Ping timeout: 245 seconds]
mostlybadfly has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bMalum has joined #ruby
n00bdev has joined #ruby
dopie has quit [Quit: Lost terminal]
pik has joined #ruby
dopie has joined #ruby
darkf has joined #ruby
juddey has quit [Ping timeout: 245 seconds]
atomical has joined #ruby
nixmaniack has quit [Read error: Connection reset by peer]
krz has quit [Ping timeout: 276 seconds]
QpQ4 has joined #ruby
kt2 has quit [Quit: ...]
nixmaniack has joined #ruby
astrobu__ has joined #ruby
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n1x has joined #ruby
n00bdev has quit []
astrobun_ has quit [Ping timeout: 240 seconds]
nixmaniack has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 250 seconds]
JohnT has joined #ruby
<smactive>
Can anyone help me with rspec shared example?
<smactive>
I expect it_behaves_like to fail
KineticX has quit [Remote host closed the connection]
n1x has quit [Read error: Connection reset by peer]
bMalum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krz has joined #ruby
kalopsian has quit [Ping timeout: 250 seconds]
User458764 has joined #ruby
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rodya_ has joined #ruby
jenrzzz has joined #ruby
sigurding has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rkazak has quit [Quit: Sleep.....ing....]
Rodya_ has quit [Ping timeout: 246 seconds]
hxegon is now known as hxegon_AFK
jenrzzz has quit [Ping timeout: 256 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
llfwf33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krz has quit [Ping timeout: 255 seconds]
astrobu__ has quit [Remote host closed the connection]
sneakerhax has joined #ruby
sarkis has quit [Ping timeout: 264 seconds]
norc has quit [Ping timeout: 252 seconds]
northfurr has quit [Quit: northfurr]
ur5us has joined #ruby
terminalrecluse is now known as gigatexal
sigurding has joined #ruby
sarkis has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
djbkd has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
last_staff has joined #ruby
argentdrake has joined #ruby
fantasticsid has joined #ruby
a1ph4g33k has joined #ruby
naftilos76 has joined #ruby
bronson has quit [Remote host closed the connection]
<argentdrake>
Hello fellow Ruby smiths. I was hoping someone could help me out. I have alot of experience programming so I'm not a newby :) I need to learn rails asap due to bossman's orders. Anyone know where I could pick up ruby so I can get started on rails asap?
sarkis has quit [Ping timeout: 250 seconds]
karapetyan has joined #ruby
djbkd has quit [Remote host closed the connection]
ascarter has joined #ruby
<a1ph4g33k>
argentdrake: You can hit one of the Rails courses on Udemy ... if you stick at it, should only take a few days to bang through the entire course. Or you could go with PragStudio.
dagda1 has joined #ruby
<a1ph4g33k>
argentdrake: Third option ... codeschool.com
weemsledeux has joined #ruby
dagda1 has quit [Client Quit]
davedev24 has joined #ruby
djbkd has joined #ruby
norc has joined #ruby
alyssadaemon has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
chouhoul_ has joined #ruby
last_staff has quit [Read error: Connection reset by peer]
last_staff has joined #ruby
<Cohedrin>
agentdrake: 2 things, one #rubyonrails is what you're looking for probably
sarkis has joined #ruby
<Cohedrin>
but if you have programming experience I would just recommend making an app or something
<Cohedrin>
rails is really intuitive, along with ruby
<Cohedrin>
if you just start making something and google the parts you need you should have a decent understanding pretty quick
znz_jp has quit [Quit: kill -QUIT $$]
<norc>
You should really not start with Ruby on Rails if you are new to Ruby.
chouhoulis has quit [Ping timeout: 265 seconds]
<alyssadaemon>
RoR will trap you into certain ways that aren’t really ‘ruby’ like anything in the activesupport gem
<cscheib>
argentdrake: michael hartl's book is free online... or what a1ph4g33k said. Since it's for work, it may be beneficial to sign up for a paid course that allows you to ask questions from a teacher, whether it's instructor led or not
sarkis has quit [Ping timeout: 240 seconds]
aganov has joined #ruby
northfurr has joined #ruby
bronson has joined #ruby
zast has quit [Remote host closed the connection]
Rodya_ has joined #ruby
znz_jp has joined #ruby
mdih has quit [Ping timeout: 245 seconds]
fantasti` has joined #ruby
<Cohedrin>
norc: he said he needs to learn rails for his job
<norc>
Cohedrin: Even more important to start off with plain Ruby then.
<Cohedrin>
why do you say so?
<argentdrake>
Thanks for the answers guys
Xeago has joined #ruby
<argentdrake>
a1ph4g33k: Any of those courses you highly reccomend?
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
astrobun_ has joined #ruby
JohnT has joined #ruby
<Cohedrin>
micheal hartls is pretty popular
claw has quit [Ping timeout: 264 seconds]
rkazak has joined #ruby
<Cohedrin>
its a very simple to read but detailed book
<alyssadaemon>
Cohedrin: I agree with norc, they need to start with basic Ruby. Get the base language first.
<Cohedrin>
it walks you through making an entire app
<cscheib>
the Hartl book is free, but you can pay for videos and such
fantasticsid has quit [Ping timeout: 240 seconds]
<norc>
Cohedrin: Rails users dont even understand how mixins work, how method dispatch works, how Enumerable works.
tjohnson has quit [Quit: Connection closed for inactivity]
<norc>
Those who dont start off learning Ruby first anyway.
<Cohedrin>
fair enough, but why do they need to?
<cscheib>
the Hartl book starts with a no-ruby-knowledge assumption, iirc
<norc>
Cohedrin: They will just see all these Rails things as magic. They will not understand how to debug, how to make changes.
northfurr has quit [Client Quit]
<norc>
And Rails has a pretty huge load of magical things that you need to understand first. Like Rails autoloading magic, or how Rails implements concerns.
<Cohedrin>
I guess I can see that, but I think as they work on it they'll begin to understand them
Rodya_ has quit [Ping timeout: 240 seconds]
sarkis has joined #ruby
<cscheib>
starting with Ruby first doesn't magically bang that knowledge into your head either
<Cohedrin>
I can see where you're coming from, but I don't those reasons alone are enough to say "don't do any rails until you have a full understanding of ruby"
<Cohedrin>
I don't really see the argument here, those are all things you pick up as you go along
<cscheib>
there's a lot of "magic" that you have to figure out as you learn Ruby as well
<norc>
Quirks remain, but there is nothing magical anymore.
<Cohedrin>
that same logic could be applied to the rails repo
claw has joined #ruby
<norc>
A lot of things become much easier to understand if you dont think in terms of "instance methods" and "class methods" for example. Ruby has only class methods.
<Cohedrin>
"all the magic went away once I read the entirety of the source code"
<norc>
Not the entirety.
<norc>
I just look it up regularly to understand Ruby features.
<cscheib>
sure, if you have a solid programming background
wldcordeiro has quit [Ping timeout: 255 seconds]
djbkd has quit [Quit: My people need me...]
<cscheib>
but, still, it's not always apparent what's going on from source.
<a1ph4g33k>
argentdrake: You get the best return on codeschool.com
sarkis has quit [Ping timeout: 260 seconds]
<norc>
cscheib: Just take my example about "instance" and "class methods"
TomyLobo has joined #ruby
tmtwd has quit [Ping timeout: 240 seconds]
Rinalds has joined #ruby
<a1ph4g33k>
argentdrake: CodeSchool has a whole Ruby class path, including Ruby, Rails, and a set of testing ( both general ruby & rails ) courses.
jam_ has quit [Remote host closed the connection]
<cscheib>
I'd agree with a1ph4g33k - start there in addition to the Hartl book
<Cohedrin>
+1 for hartl
rkazak has quit [Quit: Sleep.....ing....]
<norc>
cscheib: I have just seen too many people in #rubyonrails asking questions like "How do I create a non activerecord model" - which is just a result from not understanding what they are really doing.
jam_ has joined #ruby
arup_r has quit [Remote host closed the connection]
jam_ has quit [Read error: Connection reset by peer]
<cscheib>
norc: which is honestly mostly a benefit of the language - you get up and running quickly, and worry about the details later
<Ox0dea>
<norc> ... I would really like ruby methods to be first class objects...
<ruby[bot]>
akash_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<norc>
Ox0dea: You should probably do some testing of method(m).arity against args
<norc>
Ox0dea: Because you might somehow trigger ArgumentError for some other reason
<Ox0dea>
norc: Er, what comparison, though?
<akash_>
How can i join #RubyOnRails?
<norc>
idk honestly
<Ox0dea>
norc: That's the tricky bit.
<akash_>
I am new to this site
<Ox0dea>
Lots of arity -1 methods.
<norc>
Ox0dea: Wait! We have the solution now.
<Ox0dea>
Hm?
wldcordeiro has joined #ruby
sarkis has joined #ruby
<norc>
Ox0dea: Wouldn't m_arity < 0 ? args.length >= m_arity : args.length == m_arity be enough to verify arity match?
certainty has joined #ruby
<Ox0dea>
Certainly not >=, but that looks about right otherwise.
<norc>
Why not?
hannelita has joined #ruby
<akash_>
In my application, there is a messaging system(not real time) where users can send messages to other users. Now I want to add blocking feature so that users can block other usres to avoid messages from those users. How can I do this?
<norc>
Oh it is n-1
<Ox0dea>
norc: Extraneous arguments should be an error?
<norc>
Ox0dea: Negative arity means variable arguments.
<Cohedrin>
akash_ is this rails or ruby
<Ox0dea>
norc: I know.
smactive has quit [Remote host closed the connection]
<Ox0dea>
Oh, I see now.
<Ox0dea>
Well, -1 arity means any number of arguments; other negatives indicate how many are optional.
<Ox0dea>
>> def foo a, b = 1, c = 2; end; method(:foo).arity
<norc>
C method. That expression just does not pass my parser in my brain.
<norc>
Oh that you mean.
<Ox0dea>
Methods implemented in C.
<Ox0dea>
TracePoint calls the event "c_call", but, well, what's being called if not a method?
<norc>
Ever since I started learning about grammars and parsing, I suddenly realised that - aside from the written language - Japanese language should be fairly easy to learn.
<Ox0dea>
How do you figure?
houhoulis has quit [Remote host closed the connection]
<Ox0dea>
(I've tried twice now. :/)
<norc>
Japanese uses agglutination in their grammar.
<norc>
Which is extremely systematic.
<Ox0dea>
Language is pretty systematic in general, really.
sarkis has joined #ruby
solars has quit [Client Quit]
<norc>
Ox0dea: The issue is just inflection which can be pretty nasty to learn.
solars has joined #ruby
<norc>
Especially when you have languages like German where half your vocabulary is just irregular.
<norc>
And then you add grammatical gender into the mix, and you have a language that you cannot learn flawlessly if you are not born with it.
scepticulous has joined #ruby
gigatexal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
> [N]o mere mortal has ever "flown out" to center field.
sandstrom has joined #ruby
gagrio has joined #ruby
bithon has quit [Ping timeout: 276 seconds]
zenspider_ is now known as zenspider
<Ox0dea>
norc: I do think properly immersing oneself in the surrounding culture can get you extremely close to native fluency, but that's not an easily done thing.
sarkis has quit [Ping timeout: 255 seconds]
CloCkWeRX has quit [Ping timeout: 246 seconds]
MissionCritical has joined #ruby
tjbiddle has joined #ruby
<norc>
Ox0dea: Absolutely. However even the best immersed foreigner I will notice immediately when he repeatedly mixes up the grammatical gender of words.
<norc>
It is just something that has nothing to do with culture, and things like that really do impact the fluency.
<norc>
English is rather simple in comparison. :-)
n00bdev has joined #ruby
<Ox0dea>
norc: Grammatical gender is such a dumb idea; what's the benefit that we find it in so many languages?
<norc>
Ox0dea: I have no idea. It becomes even more confusing when you use a word like "Mädchen" which is German for girl. Of course that word is not feminine, but neuter.
<norc>
It really is dumb.
<Ox0dea>
It's because gender applies to the word itself, not what it describes.
<Ox0dea>
Which is indeed incredibly stupid.
<norc>
Exactly. I mean in Latin it kind of is fine because you can see the grammatical gender most of the time just looking at the suffix.
codecop has joined #ruby
<norc>
But in German that only works *sometimes*.
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sarkis has joined #ruby
<norc>
Though I have a general recipe for non native speakers. I always tell them to use "neuter" if in doubt. It sounds least awkward even if wrong.. :-)
<Ox0dea>
How quickly did you pick up on the intended interpretation of "Otokari", then? :)
<norc>
Come again?
ta has quit [Remote host closed the connection]
<Ox0dea>
It's what I called the refinement?
tagrudev has quit [Quit: This computer has gone to sleep]
<norc>
My Japanese vocabulary has a length of 0 currently.
<Ox0dea>
It's pseudo-Japanese for "auto-curry". :P
x86_ has joined #ruby
<norc>
Haha that is hilarious.
bronson has quit [Remote host closed the connection]
<Ox0dea>
Related: how hard would it be to make `endddddd` a valid way to close that monstrosity?
<norc>
I guess that is one of the downsides of being a German native speaker. I read that with German pronunciation in mind, so it never occured to me.
sarkis has quit [Ping timeout: 256 seconds]
<norc>
Extremely simple.
<Ox0dea>
norc: But you've been inside insns.def!
chipotle has quit [Quit: cheerio]
<norc>
You mean parse.y
x86_ has quit [Client Quit]
<Ox0dea>
I meant as exposure to Japanese.
andikr has joined #ruby
blt has quit [Quit: WeeChat 1.3]
chipotle has joined #ruby
x86_ has joined #ruby
dnewkerk has quit [Quit: dnewkerk]
<norc>
Thanks for reminding me of that torturous experience.
<Ox0dea>
I have fun every time I go. :P
<norc>
I meant the Japanese exposure part.
<Ox0dea>
Ah, right.
bithon has joined #ruby
<norc>
Yesterday I discovered that I need to get into touch with jruby folks more.
<norc>
There is plenty of English speaking folks with high knowledge of Ruby internals. :-)
<Ox0dea>
It's true.
tagrudev has joined #ruby
<Ox0dea>
That's not to say you'll be diverting your interest away from KRI?
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
x86_ has quit [Client Quit]
<norc>
Absolutely not. I find Java to be one of the more disgusting languages around.
sarkis has joined #ruby
<Ox0dea>
If Ruby ever did get /end+/, we could say it has infinitely many keywords. :P
TomyLobo has quit [Ping timeout: 255 seconds]
gagrio_ has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
firstdayonthejob has joined #ruby
<norc>
That should be fairly trivial to hack into parse.y I reckon.
<Ox0dea>
It's not a bug either, just... a necessary asymmetry.
sarkis has joined #ruby
Rodya_ has quit [Ping timeout: 240 seconds]
<norc>
Ox0dea: What do you mean by juxtaposition here though?
<Ox0dea>
norc: Squishin' 'em together.
llfwf33 has joined #ruby
<norc>
That must happen in the compiler somewhere.
<Ox0dea>
Almost definitely the parser.
<norc>
Ox0dea: Whops yeah parser.
<Ox0dea>
literal_concat()
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<norc>
Was looking at the lexer there and was confusing things.
auzty has joined #ruby
ur5us has joined #ruby
x86_ has quit [Client Quit]
sarkis has quit [Ping timeout: 240 seconds]
tjbiddle has quit [Ping timeout: 260 seconds]
x86_ has joined #ruby
dseitz has joined #ruby
tjbiddle has joined #ruby
lacuna has joined #ruby
llfwf33 has quit [Client Quit]
llfwf33 has joined #ruby
llfwf33 has quit [Max SendQ exceeded]
<norc>
Ox0dea: There is just some syntax parts that feel weird. ? or `` are some of them.
DirtyFInn has joined #ruby
<Ox0dea>
I like `` and would be sad to see them go.
<Ox0dea>
And ? is good for golf.
<norc>
Just use %x{} already
<norc>
``have this nasty business of being hard to type on some keyboard layouts.
<Ox0dea>
That's not Ruby's fault.
<norc>
Especially when you are on a Mac where you just cannot reasonably disable dead keys.
lacuna has quit [Ping timeout: 255 seconds]
<norc>
I was actually wondering the other day whether I could have Klingon characters in my name. But I cannot be sure that our registry office has UTF8 capable software.. and having the clerk figuring out how to even get those characters into the software would be a PITA:
<Ox0dea>
That is next-level masochism.
sarkis has joined #ruby
amclain has quit [Quit: Leaving]
<Nilium>
Today I learned that Klingon has a unicode range..
<Ox0dea>
Tengwar too!
<Ox0dea>
Er, no, still just a proposal.
bronson has joined #ruby
<norc>
>> ?_?_:_
<ruby[bot]>
norc: # => /tmp/execpad-da29bd1fa295/source-da29bd1fa295:2: syntax error, unexpected tSYMBEG, expecting keyword ...check link for more (https://eval.in/501525)
mgorbach has quit [Ping timeout: 265 seconds]
<Nilium>
Ah, no, Klingon's not actually officially in
<norc>
That is interesting.. That executes fine on my pry.
<norc>
Or it does not.
<Nilium>
Turns out the private symbol my Mac has is in the Klingon range
x86_ has quit [Quit: Leaving]
<norc>
Which makes sense nevemrind.
bb010g has quit [Quit: Connection closed for inactivity]
<norc>
>> ?1?1:1
ta has joined #ruby
<ruby[bot]>
norc: # => /tmp/execpad-651b65e6cad8/source-651b65e6cad8:2: warning: string literal in condition ...check link for more (https://eval.in/501527)
<norc>
Sweet.
phinary has joined #ruby
mousier has joined #ruby
<Nilium>
So, short answer is that your registry office even if it has UTF8-capable software cannot input Klingon unless you use the "pIqaD" form
ohaibbq has quit [Quit: Leaving...]
<norc>
Ox0dea: Ok Im suddenly confused again. This looks like a weird quirk from the parser - ?1?1:1 should not parse imo.
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
norc: Seems fine to me.
sarkis has quit [Ping timeout: 272 seconds]
<Ox0dea>
You're using a "character literal" as the driver of a ternary expression.
<norc>
The concatenation only works if the RHS is a string1.
fantasti` has quit [Read error: Connection reset by peer]
<Ox0dea>
And indeed it couldn't work the other way.
mgorbach has joined #ruby
<Ox0dea>
At least, I don't see how the parser could disambiguate `"a"?b` in the general case.
colegatron has quit [Ping timeout: 264 seconds]
<norc>
Ox0dea: Fairly simply.. it is a lookahead parser? :-)
<Ox0dea>
Fair enough.
<Ox0dea>
I incorrectly assumed that ternary expressions and Symbol arguments in method calls would conflict.
<Ox0dea>
Which is something that does happen, but it wouldn't here.
sarkis has joined #ruby
<norc>
Nilium: Thank you. It would be embarrassing to accidentally end up with a in my name on my ID card.
konsolebox has joined #ruby
<Ox0dea>
The proper orthography is "UTF-8-capable", isn't it?
<Ox0dea>
That looks very strange.
hannelita has joined #ruby
bkxd has joined #ruby
mgorbach has quit [Ping timeout: 256 seconds]
roshanavand has joined #ruby
<Ox0dea>
Also, we say "arity-2"; does Ruby's having negative arities make "arity--1" the proper way to write that?
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<Ox0dea>
Troll fodder for ##English, then. ^_^
<norc>
Ox0dea: That channel has become mostly useless ever since the old folks left.
<norc>
There used to be actually knowledgable people in there.
sarkis has quit [Ping timeout: 276 seconds]
<Ox0dea>
I have no trouble believing that. :<
bkxd has quit [Ping timeout: 255 seconds]
hannelita has quit [Ping timeout: 264 seconds]
naftilos76 has quit [Quit: Αποχώρησε]
sarkis has joined #ruby
Dimik has quit []
<norc>
Ox0dea: I remember once venting steam about my confusion regarding the pronunciation of the word "conscience". The next 30 minutes I got a linguistical lecture about how English changed over the past 300 years.
karapetyan has joined #ruby
mark2 has joined #ruby
Bloomer has joined #ruby
<Ox0dea>
norc: And, well, did such a digression come to explain the word's pronunciation? :P
arup_r has quit [Remote host closed the connection]
colegatron has joined #ruby
<norc>
Ox0dea: Oh absolutely, though admittedly I cannot recall much of that conversation anymore.
sunya7a__ has quit [Ping timeout: 246 seconds]
TomyWork has joined #ruby
<Ox0dea>
"Science", "conscience", and "prescience" all end differently.
<Ox0dea>
This language, I swear.
sarkis has quit [Ping timeout: 256 seconds]
sunya7a has joined #ruby
Guest71407 is now known as saneax_AFK
karapetyan has quit [Ping timeout: 260 seconds]
<adaedra>
And that's why I'm awful at spoken English.
<AimlessRaven>
i wanna transform to hash, to get created_at and status
<AimlessRaven>
for example if i make @order.test.each do |s| and type s.time this gibe me undefined method `time' for #<Hash:0x007f5570574050>
Bloomer has joined #ruby
<adaedra>
?crosspost
<ruby[bot]>
Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
Xeago has quit [Ping timeout: 260 seconds]
sarkis has joined #ruby
chussenot has joined #ruby
juddey has quit [Remote host closed the connection]
huyderman has joined #ruby
dEPy has joined #ruby
blaxter has joined #ruby
sarkis has quit [Ping timeout: 276 seconds]
argentdrake has joined #ruby
blarghlarghl has left #ruby [#ruby]
usershell has quit [Read error: Connection reset by peer]
huyderman has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
huyderman has joined #ruby
usershell has joined #ruby
pawnbox has joined #ruby
sftrabbit has joined #ruby
ta has quit [Remote host closed the connection]
solars has quit [Quit: WeeChat 0.4.2]
solars has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
solocshaw has joined #ruby
sarkis has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ta has quit [Read error: Connection reset by peer]
dpg_ has quit [Ping timeout: 260 seconds]
ta has joined #ruby
sarkis has joined #ruby
dEPy has quit [Ping timeout: 276 seconds]
n00bdev has quit []
dwfait has joined #ruby
chussenot has quit [Quit: chussenot]
f4cl3y has joined #ruby
sarkis has quit [Ping timeout: 276 seconds]
pandaant has joined #ruby
dlitvak has joined #ruby
chussenot has joined #ruby
rodfersou has joined #ruby
ur5us has quit [Remote host closed the connection]
sftrabbit has quit [Quit: sftrabbit]
catmartyn has joined #ruby
felixdd has quit [Ping timeout: 276 seconds]
<Arie>
hey guys, so im using Middlemanapp for my templating system, and apparently it shows the error "ERROR -- : exception while processing events: invalid byte sequence in UTF-8 Backtrace:" whenever im including this file https://gist.github.com/arie741/c3dbe601328e87991867
<Arie>
anybody have any ideas why? im stuck here
dlitvak_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
Jackneill has joined #ruby
sftrabbit has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
Bloomer has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 240 seconds]
catmartyn has quit [Remote host closed the connection]
<norc>
Is such a wonderful document for fixing encoding issues. :-)
sarkis has joined #ruby
moei has quit [Quit: Leaving...]
gagrio has joined #ruby
bkxd has joined #ruby
ta has quit [Ping timeout: 255 seconds]
dlitvak has joined #ruby
chussenot has quit [Quit: chussenot]
sarkis has quit [Ping timeout: 260 seconds]
robbyoconnor has joined #ruby
<Ox0dea>
charlock_holmes > rchardet
<Ox0dea>
If only in name.
Rodya_ has joined #ruby
ICantCook has quit [Ping timeout: 260 seconds]
bkxd has quit [Ping timeout: 264 seconds]
dlitvak_ has quit [Ping timeout: 264 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
PedramT has joined #ruby
saneax_AFK is now known as saneax
sarkis has joined #ruby
Rodya_ has quit [Ping timeout: 260 seconds]
saneax is now known as Guest94017
chrisarcand has joined #ruby
jschmid has joined #ruby
sarkis has quit [Ping timeout: 250 seconds]
karapetyan has joined #ruby
Snowy has joined #ruby
chussenot has joined #ruby
avelldiroll has quit [Quit: WeeChat 1.0.1]
Xeago has quit [Remote host closed the connection]
usershel_ has joined #ruby
sarkis has joined #ruby
usershell has quit [Ping timeout: 256 seconds]
akkmaxon has joined #ruby
harai54 has quit [Ping timeout: 255 seconds]
PedramT has quit [Read error: Connection reset by peer]
tagrudev has quit [Quit: This computer has gone to sleep]
sarkis has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 260 seconds]
kp666 has quit [Ping timeout: 264 seconds]
avelldiroll has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
iamayam has quit [Ping timeout: 245 seconds]
Lewix has quit [Ping timeout: 240 seconds]
lipoqil has quit [Quit: Connection closed for inactivity]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
viperman_ has quit [Ping timeout: 256 seconds]
tinnvec has quit [Ping timeout: 240 seconds]
sarkis has joined #ruby
xet7 has quit [Quit: Leaving]
PedramT has joined #ruby
sdothum has joined #ruby
Outlastsheep has quit [Ping timeout: 272 seconds]
ghormoon has quit [Ping timeout: 256 seconds]
stryek_ has quit [Ping timeout: 245 seconds]
nirix has quit [Ping timeout: 240 seconds]
stryek has joined #ruby
justinmcp has joined #ruby
tinnvec has joined #ruby
User458764 has joined #ruby
lacuna has joined #ruby
Lewix has joined #ruby
iamayam has joined #ruby
dlitvak_ has joined #ruby
FernandoBasso1 has joined #ruby
ghormoon has joined #ruby
nirix has joined #ruby
viperman has joined #ruby
sarkis has quit [Ping timeout: 255 seconds]
TheEyeOfTheTruth has quit [Ping timeout: 276 seconds]
lacuna has quit [Ping timeout: 240 seconds]
FernandoBasso1 is now known as FernandoBasso
dlitvak has quit [Ping timeout: 240 seconds]
chussenot has quit [Quit: chussenot]
jam_ has joined #ruby
benjohn has joined #ruby
sarkis has joined #ruby
jschmid has quit [Read error: Connection reset by peer]
jam_ has quit [Ping timeout: 264 seconds]
greg has quit [Remote host closed the connection]
xet7 has joined #ruby
sarkis has quit [Ping timeout: 256 seconds]
ta_ has quit [Remote host closed the connection]
chussenot has joined #ruby
Jibbits has joined #ruby
<Jibbits>
Hey guys, I have a little problem which I can't seem to find a good solution to
GeorgesLeYeti has joined #ruby
<GeorgesLeYeti>
Hi
<Jibbits>
I need to work with binary data using a string buffer, which means I need to use String#byteslice instead of String#slice. The problem is, I need to remove the bytes that I read from the beginning of the buffer, but there is no String#byteslice! and String#slice! will not handle arbitary bytes reliably
hayden_ has joined #ruby
norc has quit [Ping timeout: 252 seconds]
pik has joined #ruby
<Jibbits>
Even if I had to perform a second operation to remove the bytes from the beginning of the buffer, I can't seem to find any method which can accomplish that
<Ox0dea>
Jibbits: How come you're not working with bytes instead?
<Ox0dea>
Wanting to destructively slice bytes would seem to indicate that something has gone awry.
PedramT has quit [Remote host closed the connection]
sarkis has joined #ruby
<Jibbits>
Ox0dea: I have been up until today, but I need to use unpack to read various different values (especially for protobuf deserialization) and it's really inefficient to have to pack the byte array to a string every time that I need to unpack values
jud has quit [Quit: Leaving]
PedramT has joined #ruby
<Jibbits>
The go-to method for reading values from a byte buffer in ruby is String#unpack, it seems that reimplementing unpack's functionality to work with a byte array would require a lot of work
<GeorgesLeYeti>
Is there any already made methods to compare 2 array in order to know if an array A contain at least 1 element of an array B. For example : A = [ 'a', 'b','c'] // B= ['a', 'd'] // A.include?(B) => true and if B=['d','z'] if return false
yfeldblum has joined #ruby
<adaedra>
You can use an intersection
<Ox0dea>
Jibbits: I would imagine it would. If you're not liable to get into encoding trouble, String#[] can be used destructively.
<GeorgesLeYeti>
adaedra, ty
<adaedra>
>> [%w[a b c] & %w[a d], %w[a b c] & %w[d z]]
<Jibbits>
Ox0dea: Won't String#slice! randomly break with arbitary bytes even if the string is forced to 'binary' encoding?
cgfbee has quit [Ping timeout: 265 seconds]
<Ox0dea>
Jibbits: It shouldn't.
<Jibbits>
I'm fairly sure I remember running into that exact issue in the past, which is why I ended up rewriting the buffer using a byte array in the first place
<Jibbits>
Encoding is definitely not an issue, since it is a byte buffer, with encoding forced to 'binary', where encoding is needed for strings, the encoding is done after the string has been sliced from the byte buffer
ph1n4ry has joined #ruby
<Ox0dea>
See above.
<Ox0dea>
All bytes are valid in the 'binary' encoding.
<Jibbits>
I hope you're right, and I somehow managed to screw up in the past (which was well over a year ago)
<Ox0dea>
I mean, I'm showing you code?
dionysus69 has quit [Ping timeout: 245 seconds]
<Jibbits>
Since this application is already in production use, and having it randomly fail due to a specific sequence of bytes would be rather serious
<Jibbits>
I see what you are saying, but that doesn't exactly test String#slice! against every possible byte combination
<Ox0dea>
You're free to try it for trigrams on your machine. :P
phinary has quit [Ping timeout: 276 seconds]
<Jibbits>
Alright thanks, I'll reimplement using slice! and hope for the best
ta has joined #ruby
PedramT has quit [Read error: No route to host]
PedramT has joined #ruby
<Ox0dea>
?hope
<ruby[bot]>
Ox0dea: I don't know anything about hope
<Ox0dea>
Jibbits: You agree to indemnify and hold me harmless for any damages, but I can more or less assure you that the problem will not be an invalid byte sequence in a binary-encoded string.
sarkis has joined #ruby
<Ox0dea>
It's, like, definitionally nonsensical.
bkxd has joined #ruby
PedramT has quit [Remote host closed the connection]
dlitvak_ has quit [Remote host closed the connection]
Ishido has joined #ruby
bruce__lee has joined #ruby
zotherstupidguy has joined #ruby
dlitvak has joined #ruby
sarkis has joined #ruby
Xeago has joined #ruby
FooMunki has joined #ruby
davedev24 has joined #ruby
PedramT has quit [Remote host closed the connection]
bruce_lee has quit [Ping timeout: 260 seconds]
<Jibbits>
I have decreased deserialization overhead significantly, which will make a big difference now that some packets could be over 1MB, compared to the largest being around 1KB before today
dlitvak has quit [Remote host closed the connection]
sepp2k has joined #ruby
d0lph1n98 has joined #ruby
tjbiddle has quit [Ping timeout: 245 seconds]
usershel_ has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
<Ox0dea>
Those are massive packets!
TheBrayn has quit [Ping timeout: 246 seconds]
chrisarcand has quit [Quit: leaving]
<Jibbits>
Most 500KB packets are not even long enough to log a time warning anymore (less than 1ms), where they could take over 50ms before
chrisarcand has joined #ruby
<Ox0dea>
\o/
<Jibbits>
I decided that using my efficient binary protocol channel would be a better idea than making a separate connection for binary blob transfers
<Jibbits>
Especially since they will be fairly frequent
<Jibbits>
I am using the beefcake protobuf library, but I have needed to make a bunch of monkeypatches
cgfbee has joined #ruby
platzhirsch has joined #ruby
<Ox0dea>
That's for when you hate that most of Hash's Enumerable methods don't return Hashes.
<Jibbits>
Packet headers are custom built though, tiny packets don't even require protobuf
edwinvdgraaf has joined #ruby
dlitvak has joined #ruby
prestorium has joined #ruby
djbkd has quit [Ping timeout: 264 seconds]
TheBrayn has joined #ruby
d0lph1n98 has quit [Quit: leaving]
skade has quit [Quit: Computer has gone to sleep.]
lucasb has joined #ruby
pik is now known as p1k
<Jibbits>
Ox0dea: I've been using ruby for network related stuff for about 8 years now, I'd say that I'm fairly confident that rolling my own everything works out pretty well
<Ox0dea>
If it were *properly* curried, we wouldn't be able to fold in more than one argument at a time.
Xeago has quit [Remote host closed the connection]
hannelita has joined #ruby
<Ox0dea>
Long story short: yeah. :)
chrisarcand has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
certainty has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
dlitvak has joined #ruby
<lucasb>
ah, ok. In that strict mathematical sense, currying only allows one-arg. but most of the time currying and partial application are interchangeable terms :) (or maybe I'm wrong)
karapetyan has quit [Remote host closed the connection]
<lucasb>
Ox0dea: but anyway, just wanted to say you look very knowledgeable. I'll start paying attention to everything you post :)
daivyk has joined #ruby
<Ox0dea>
Please don't.
<lucasb>
the real question is: how many years have you been playing with ruby?
<Ox0dea>
Six-ish.
Outlastsheep has joined #ruby
prestorium has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
sigurding has quit [Quit: sigurding]
duckpuppy has joined #ruby
karapetyan has joined #ruby
pawnbox has quit [Remote host closed the connection]
Anderson69s_Deb has quit [Remote host closed the connection]
<apeiros>
I guess method.partially_apply just didn't have the same ring to it as .curry? :D
chipotle has quit [Quit: cheerio]
smactive has joined #ruby
gregf has joined #ruby
Xeago has quit [Remote host closed the connection]
* adaedra
curries apeiros
<ljarvis>
mmm curry
ph1nary has quit [Ping timeout: 276 seconds]
* ljarvis
is hungry
<adaedra>
Then go eat?
* apeiros
applies adaedra partially
sftrabbit has joined #ruby
<Ox0dea>
Alternatively, methods could've been partially applicable by default, and you'd use () if you wanted to invoke its 0-arity form.
<Ox0dea>
Damn you, optional parentheses!
<Ox0dea>
(And bless you too.)
<ljarvis>
no dont bless them
bronson has joined #ruby
<Ox0dea>
I've never so loved and hated a thing at the same time.
kies^ has joined #ruby
<adaedra>
yeah, I feel like I feel a bit of that.
pdoherty has joined #ruby
<ljarvis>
my hate:love ratio is 9:1
gbgdev has joined #ruby
tuxillo has joined #ruby
<tuxillo>
hello
<ljarvis>
howdy
<Ox0dea>
Ahoy!
<adaedra>
hi
<lucasb>
hai
<tuxillo>
is it possible to get env variables from another user different than the one you're running the process with?
<adaedra>
env variables are per-process.
chipotle has joined #ruby
smactive has quit [Ping timeout: 240 seconds]
<Ox0dea>
And accessible via procfs on Linux.
<Ox0dea>
And elseways elsewhere.
<tuxillo>
yes I know, so I was thinking in some sort of popen or suchlike
dionysus69 has joined #ruby
<adaedra>
?xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
zotherstupidguy has quit [Quit: WeeChat 1.3]
vikas027 has joined #ruby
<Ox0dea>
You're running Sun?!
<adaedra>
Oracle*
<tuxillo>
what?
roshanav_ has joined #ruby
ajf- has joined #ruby
ICantCook has joined #ruby
<Ox0dea>
CTCP don't lie.
<Ox0dea>
Anyway, you should be able to read /proc/$PID/environ.
bronson has quit [Ping timeout: 260 seconds]
kalopsian has joined #ruby
<adaedra>
can != should, remember.
<adaedra>
tuxillo: what if you tell us what you're trying to do, in the big picture
<lucasb>
hm, what if running something like my_env_var = `su -c 'echo $MY_ENV_VAR' someuser` ?
<Ox0dea>
lucasb: Environment variables are per-process.
blackmesa has joined #ruby
pawnbox has joined #ruby
chussenot has joined #ruby
<lucasb>
well, su would spawn a new bash process, wouldn't it?
<tuxillo>
adaedra: I believe my question is very specific. a ruby script runs as root and relies on su to run certain commands (using popen4)
gregf has quit [Quit: WeeChat 1.3]
<tuxillo>
adaedra: but now I need to determine something which is specified in a user's env
<tuxillo>
(in this case ORACLE_HOME)
millerti has joined #ruby
<adaedra>
a user has technically no env.
darkf has quit [Ping timeout: 272 seconds]
chussenot has quit [Client Quit]
<Ox0dea>
adaedra: One of us has to say it again.
<adaedra>
is $ORACLE_HOME the same as $HOME?
<adaedra>
I feel like it's something you can guess somehow else.
ponga has quit []
roshanavand has quit [Ping timeout: 256 seconds]
<tuxillo>
well yeah, you can always read the shell profiles but that kills their evaluation (which is complex)
dlitvak has quit [Remote host closed the connection]
<adaedra>
But if you really want to see how the env is initialized when running under su, just run env.
<adaedra>
And parse the output.
dlitvak has joined #ruby
<tuxillo>
yeah, I know. I was wondering if there was something else that could be used :)
Rodya_ has joined #ruby
<adaedra>
If it's $HOME, just use getpwent and friends.
<Jibbits>
Ox0dea: There is a very good reason why I roll my own everything whenever possible by the way. I always end up having to debug/profile the gems which I do use at some point, and fix issues myself
sneakerhax has quit [Ping timeout: 250 seconds]
FernandoBasso has joined #ruby
<tuxillo>
no, it's not $HOME
karapetyan has quit [Remote host closed the connection]
<Ox0dea>
Jibbits: Hey, I'm all for it, mate. It's just... reinvent the wheel only that you would improve it, y'know?
<tuxillo>
I'll use env, then
pawnbox has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
<tuxillo>
adaedra: thanks
<Jibbits>
Sure, I'm all for improving existing implementations, but it's often not worth the effort. There are a lot of really horrid libraries out there, written my talented developers who clearly don't know much about Ruby
pawnbox has joined #ruby
Snowy has quit [Remote host closed the connection]
<Ox0dea>
It's hard to pin down idiomaticity in Ruby, but I know how you mean.
<Jibbits>
Looks like these large packets have now introduced a lot of GC overhead, which is a big issue. I'm not very familiar with the Ruby 2.2 GC, so I'm not sure what the best course of action will be
bkxd has quit [Ping timeout: 260 seconds]
<Jibbits>
I'm getting fairly frequent GC pauses of up to ~500ms
<Ox0dea>
Yikes. Profilin' time.
FernandoBasso1 has quit [Ping timeout: 256 seconds]
<Jibbits>
Well I'm already profiling with some simple timing logic, and GC count checks
weemsledeux has joined #ruby
<Jibbits>
A profiler isn't really going to help solve this
moei has joined #ruby
darkf has joined #ruby
<Ox0dea>
Er, a good one will show you your hotspots.
Xeago has joined #ruby
<Jibbits>
Perhaps I need to reuse a string buffer for all the large packets and data blobs
<Ox0dea>
Slicing into and out of a large string is invariably going to end up moving lots of memory around.
<apeiros>
Jibbits: there's some articles about how to tune the GC
<Jibbits>
The overhead isn't in my code, I can see that the slow down is being used by GC runs
Rodya_ has quit [Ping timeout: 272 seconds]
ICantCook has quit [Quit: bye]
symbol has joined #ruby
<symbol>
I'm parsing a CSV and keep getting a `invalid byte sequence in UTF-8` despite the file being UTF-8. I imagine there's a bad byte somewhere in the CSV. Is there any way to get Ruby to tell me which line?
GeorgesLeYeti has quit [Quit: Quitte]
<symbol>
Or am I better of using regex to find the offending line? It's a largggggge csv.
<Jibbits>
apeiros: Do you really think that tuning the GC could help here, or should I attempt to pool buffers rather?
<Sp4rKy>
Hi, any ruby wrapper for pdftk still maintained ?
<apeiros>
depends a bit on what viable solutions are for you. tuning the GC can help "moving around" the problem so it happens at a time when it's not an issue (such as in a webserver between requests)
<Jibbits>
Oh, that isn't going to help me, this is a long running reactor application
<apeiros>
symbol: one-off solution? or general solution?
<symbol>
apeiros: Either or really.
<symbol>
one-off for this case.
aupadhye has joined #ruby
<apeiros>
symbol: one-off: open the file binary, read line by line, force_encode the line to utf-8 and use .valid_encoding? to check whether it is the offending line.
Snowy has joined #ruby
<symbol>
Ah, gotcha.
<apeiros>
once you know the line, you'll see whether it is easy or hard to fix it
ta has joined #ruby
arup_r has quit [Remote host closed the connection]
<apeiros>
I'd do it in pry (or irb)
sftrabbit has quit [Quit: sftrabbit]
<symbol>
Awesome, thank you apeiros
<apeiros>
I think one day I'll write a tiny gem to support finding broken sequences in supposedly utf-8 files… it can be done fairly easily…
dlitvak_ has joined #ruby
<adaedra>
once you've done with your current workload? :p
<Jibbits>
It looks like almost all of this GC overhead is occurring in one or more gems, as soon as I stop pushing these binary blobs into the database, the largest GC spike goes from 500ms to 8ms
<apeiros>
when utf-8 is old stuff and we use qutf (qubit-utf)
<queden>
hi. I trying to run my first tests (sharetribe app) but launching zeus fails: pi@raspberrypi:~ $ zeus /usr/local/rvm/gems/ruby-2.1.2/gems/zeus-0.15.1/build/zeus-linux-386: 1: /usr/local/rvm/gems/ruby-2.1.2/gems/zeus-0.15.1/build/zeus-linux-386: Syntax error: "(" unexpected
dlitvak has quit [Ping timeout: 240 seconds]
sftrabbit has joined #ruby
<Jibbits>
This overhead is not related to the ORM, only writes are being based via the driver, all data is cached in memory at start up forever
karapetyan has quit [Remote host closed the connection]
tuxillo has left #ruby [#ruby]
karapetyan has joined #ruby
lubekpl has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
<adaedra>
It's not because you don't get an answer in 15 seconds in #RubyOnRails that you should come here copy/paste your question.
<AimlessRaven>
because no one help me in ror
<apeiros>
?crosspost AimlessRaven
<ruby[bot]>
AimlessRaven: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<adaedra>
There isn't even 2 minutes between your two questions. Give it some time.
<adaedra>
Also, I will replace here the advice you already got: learn ruby properly before going Rails, it helps.
<lucasb>
AimlessRaven: you want a array containing one hash for each key=>value pair in the original hash?
arup_r has quit [Remote host closed the connection]
<apeiros>
adaedra: they did actually ask ~15min ago the first time in rails
arup_r has joined #ruby
<apeiros>
of course, cross-post rules still apply
<adaedra>
yeah, I'm looking at that
bkxd has quit [Ping timeout: 246 seconds]
<AimlessRaven>
lucasb: i wanna my array contain many hashes with time and label keys and values
davedev24 has quit []
<queden>
is something wrong with my zeus installation? Or is it related to the ruby code? Did I miss a step?
<apeiros>
AimlessRaven: many.times do array.push a_hash end
synthroid has joined #ruby
lxsameer has quit [Quit: Leaving]
solocshaw has quit [Ping timeout: 260 seconds]
<vikas027>
Hello All, I have this (https://dpaste.de/9mW4) content in a variable. How can I do something like echo $var | grep plugin | grep gitlab in ruby. Forgive my ignorance, I am new to ruby.
blackmesa has quit [Ping timeout: 265 seconds]
PedramT has joined #ruby
chussenot has joined #ruby
jam_ has joined #ruby
asmodlol has quit [Ping timeout: 250 seconds]
certainty has joined #ruby
<Jibbits>
Looks like the ruby mongo driver is just insanely inefficient with GC when inserting large byte arrays
FernandoBasso has quit [Quit: Leaving]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
fourq is now known as fourq|away
<apeiros>
oh, mongo
<apeiros>
yorickpeterse, where are you when you're needed?!?
<adaedra>
in NL.
asmodlol has joined #ruby
<lucasb>
vikas027: maybe var.split("\n").grep(/plugin/).grep(/gitlab/); but seems like you would prefer to parse a XML, no?
<Jibbits>
It'll probably be a lot less trouble to scrap the idea of storing 100KB - 1MB binary blobs in the database and just use flat files
<apeiros>
Jibbits: or use a proper database - as in: not mongo
jam_ has quit [Ping timeout: 246 seconds]
<Jibbits>
I really would have liked to use mongo through, the database is definitely fast and efficient enough to handle these blobs, the ruby driver not so much
<Jibbits>
There is really nothing wrong with mongo
<vikas027>
lucasb: thanks for the idea of parsing XML. Let me Google that how to do that in ruby :)
<apeiros>
the general consensus in this channel begs to differ :)
<adaedra>
vikas027: with a regex.
* adaedra
flees
chipotle has quit [Quit: cheerio]
queden has quit [Ping timeout: 252 seconds]
<adaedra>
( vikas027 note that this was a joke. Don't do that. )
<apeiros>
vikas027: nokogiri or oga
<vikas027>
adaedra: Oh :) sorry couldn't digest that
chipotle has joined #ruby
<Jibbits>
I've been using mongo for almost all the applications I build for about 6 years now. Although I don't use usually use it for binary blobs, it's far faster than any SQL database
<apeiros>
Jibbits: I doubt that
kalopsian has quit [Ping timeout: 240 seconds]
* apeiros
needs a stronger word than doubt
<apeiros>
I don't believe that
<adaedra>
Ox0dea has a "I don't believe you" gif for these cases.
<Jibbits>
Out of interest sake, what are your main issues with mongo?
<Jibbits>
I've used it more than enough to know what it is capable of, and how to workaround some of it's limitations
<apeiros>
that almost every time when somebody says "oh, we don't need a schema for this", they're mistaken.
<Jibbits>
I've also imported massive datasets from mongo to postgres, which tooks forever, and ended up running much much slower
<Jibbits>
There are very few use cases where I would want to use anything other than mongo these days
<apeiros>
and that for almost all workloads they end up with, an RDBMS is better suited
jaymeproni has joined #ruby
<Jibbits>
I build write-heavy applications, which do little to no reading from a database, that is where mongo really shines
usershell has quit [Ping timeout: 276 seconds]
bruce__lee has quit [Changing host]
bruce__lee has joined #ruby
bruce__lee is now known as bruce_lee
usershell has joined #ruby
<ljarvis>
where is rescue defined in the mri source?
dlitvak has joined #ruby
jyuan has joined #ruby
aryaching has joined #ruby
<Ox0dea>
ljarvis: It's a keyword?
<ljarvis>
ya
dlitvak_ has quit [Ping timeout: 265 seconds]
<Ox0dea>
"Defined" just isn't the right word.
<ljarvis>
forgive me
<Ox0dea>
I'd like to help.
<yorickpeterse>
apeiros: what?
arup_r has quit [Read error: Connection reset by peer]
<yorickpeterse>
Ah
<yorickpeterse>
"There is really nothing wrong with mongo" this is false
<yorickpeterse>
and I base that on using MongoDB for 2,5 years in production
<yorickpeterse>
also Mongo doesn't really do anything that's better at storing a blob than say PostgreSQL
<yorickpeterse>
Today there should literally be no reason to ever use MongoDB unless you don't actually use your data
kalopsian has joined #ruby
<apeiros>
I could imagine that in a write-only usage, postgres' tendency to do things correctly might get in the way.
<ljarvis>
for anyone who cares i was looking for rb_rescue/rb_rescue2 in eval.c
<yorickpeterse>
apeiros: either you do it correctly and it slows down, or you disregard ACID and have to deal with all those problems
bronson has joined #ruby
<apeiros>
yorickpeterse: of course
roshanav_ has quit [Remote host closed the connection]
<apeiros>
I basically said that you can gain performance at the cost of correctness. and I wouldn't be surprised if mongo does that.
chipotle has quit [Quit: cheerio]
<yorickpeterse>
IIRC by default the drivers now use strong consistency
kp666 has quit [Remote host closed the connection]
chipotle has joined #ruby
<apeiros>
especially given that they've been shown to actually do that
<adaedra>
ot
roshanavand has joined #ruby
<ljarvis>
:)
Guest11 has joined #ruby
Guest11_ has joined #ruby
<apeiros>
adaedra: bordering on. databases are part of the ruby ecosystem.
<ljarvis>
mongo shouldn't even be part of the database ecosystem
Guest11 has quit [Max SendQ exceeded]
Guest11_ has quit [Max SendQ exceeded]
<yorickpeterse>
I think we should stop calling it a database and instead call it a dumpster
Guest11 has joined #ruby
<yorickpeterse>
because it's not too bad at stuffing shit in it and never getting it out in a reasonable way
<ljarvis>
yeah, and the collectors could come at any time
Guest11 has quit [Max SendQ exceeded]
bronson has quit [Ping timeout: 245 seconds]
wldcordeiro has quit [Ping timeout: 264 seconds]
cpup has quit [Ping timeout: 265 seconds]
<yorickpeterse>
also check out my sick Grafana dashboard
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has joined #ruby
j416 has quit [Quit: o/]
lacuna has joined #ruby
decoponio has joined #ruby
j416 has joined #ruby
asmodlol has quit [Ping timeout: 240 seconds]
sdwrage has quit [Quit: Leaving]
atomical_ has joined #ruby
FernandoBasso has joined #ruby
asmodlol has joined #ruby
Haris has joined #ruby
JakFrist has joined #ruby
<Haris>
hello all
atomical has quit [Ping timeout: 250 seconds]
TheHodge has joined #ruby
chussenot has joined #ruby
brendan- is now known as bmurt
malconis has quit [Remote host closed the connection]
willv has joined #ruby
hxegon has joined #ruby
ta0 has quit [Remote host closed the connection]
malconis has joined #ruby
DarthBane has joined #ruby
loatbac has joined #ruby
<DarthBane>
rubies
<loatbac>
hi
<Haris>
I'm getting the error msg --> /usr/local/rvm/gems/ruby-2.2.3/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!': :en is not a valid locale (I18n::InvalidLocale) <-- how do I enable english language ? do I have to download a dep for language ?
ta0 has joined #ruby
loatbac has quit [Client Quit]
DarthBane has quit [Client Quit]
chipotle has quit [Quit: cheerio]
clauswitt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JoshL has quit [Quit: ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in]
asmodlol has quit [Ping timeout: 264 seconds]
<Haris>
I have this line --> I18n.available_locales = [:pt] <-- and then this line --> I18n.default_locale = :pt <-- in my code. How do I add en to the first line ?
<Haris>
how does one concatenate values for a variable in ruby
asmodlol has joined #ruby
<shevy>
Haris what does this question mean
<Haris>
I18n is a library, most probably. I have a ruby based app "catarse". its config has enforce_available_locales set somewhere. which is raising error because, english is not present in list of available locales
sumark has quit [Remote host closed the connection]
<shevy>
"Returns an array of locales for which translations are available."
mrtomme has quit [Ping timeout: 246 seconds]
<shevy>
"Unless you explicitely set these through I18n.available_locales= the call will be delegated to the backend."
<shevy>
so guess that's the official way anyway
chriscoffee has joined #ruby
chriscoffee has quit [Client Quit]
mrtomme has joined #ruby
dlitvak has quit [Ping timeout: 276 seconds]
dlitvak has joined #ruby
mchu has joined #ruby
Haris has quit [Ping timeout: 265 seconds]
sftrabbit has joined #ruby
Haris has joined #ruby
Haris has quit [Changing host]
Haris has joined #ruby
Jardayn has joined #ruby
usershell has quit [Read error: Connection reset by peer]
<lucasb>
enum.each(&method(:foo)) works like {|x| foo(x) } right? but what if want {|x| foo(*x) } is there any other way?
<lucasb>
ie, I want to unpack that array as an argument list
gerard0 has joined #ruby
FooMunki has quit [Quit: FooMunki]
<adaedra>
yes, no
gerard0 has quit [Client Quit]
<adaedra>
no wait
<adaedra>
no, no
FooMunki has joined #ruby
<lucasb>
adaedra --verbose
sftrabbit has quit [Client Quit]
<adaedra>
er, misread two times in a row
<adaedra>
so yes, &method(:foo) => { |x| foo(x) }
<adaedra>
you can't splat, tho.
chussenot has quit [Quit: chussenot]
<lucasb>
hm, ok, was just a detail anyway. thanks, adaedra.
tomaz_b has quit [Quit: Leaving]
usershell has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
sftrabbit has joined #ruby
chussenot has joined #ruby
sarkis has quit [Ping timeout: 264 seconds]
asmodlol has quit [Ping timeout: 264 seconds]
chadhs has joined #ruby
dc1 has joined #ruby
Xeago has quit [Remote host closed the connection]
sarkis has joined #ruby
asmodlol has joined #ruby
usershell has quit [Remote host closed the connection]
dhollinger has joined #ruby
<Haris>
fixed that one
aegis3121 has quit [Ping timeout: 272 seconds]
<Haris>
replaced pt with en
chouhoul_ has joined #ruby
kalopsian has quit [Ping timeout: 246 seconds]
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
arup_r has quit [Remote host closed the connection]
chrisarcand has quit [Ping timeout: 260 seconds]
platzhirsch has joined #ruby
willv has joined #ruby
jas02 has quit [Quit: jas02]
pawnbox_ has quit [Remote host closed the connection]
dlitvak_ has joined #ruby
Hounddog has quit [Ping timeout: 250 seconds]
pawnbox has joined #ruby
scepticulous has quit [Quit: Konversation terminated!]
scepticulous has joined #ruby
rodolfowtf has joined #ruby
pawnbox has quit [Remote host closed the connection]
tagrudev has joined #ruby
pawnbox has joined #ruby
slawrence00 has joined #ruby
dlitvak has quit [Ping timeout: 276 seconds]
cschneid_ has joined #ruby
aryaching has joined #ruby
ympeg has quit [Ping timeout: 240 seconds]
scepticulous has quit [Client Quit]
hannelita has quit [Remote host closed the connection]
scepticulous has joined #ruby
aryaching_ has quit [Ping timeout: 264 seconds]
B1n4r10 has quit [Ping timeout: 260 seconds]
dlitvak_ has quit [Ping timeout: 276 seconds]
dlitvak has joined #ruby
bkxd has joined #ruby
d10n-work has joined #ruby
legohead_ has joined #ruby
Jibbits has quit [Quit: Page closed]
<legohead_>
Hey, I'm using simple_form to try and get the user's d.o.b with three text inputs like so: [dd] [mm] [yyyy] is it possible to do this using simple_form?
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ror15 has joined #ruby
Pisuke has joined #ruby
certainty has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 255 seconds]
arup_r has joined #ruby
aegis3121 has joined #ruby
<cschneid_>
if I have a regex literal inline with my code: f =~ /foo/, is that any performance difference than f =~ MY_REGEX, where MY_REGEX=/foo/.freeze ?
gagrio has quit [Ping timeout: 255 seconds]
<cschneid_>
does the first reconstruct the regex each time through the function?
MyMind has quit [Ping timeout: 245 seconds]
<shevy>
cschneid_ good question... I actually did not know that .freeze was possible at all
<cschneid_>
well, it's just an object - that's unlikely to be interesting .
<cschneid_>
what I was wonder is if the regex literal in a function (in a tight loop even, in my case) gets constructed once at parse time, or over and over, each time it gets called.
tesuji has quit [Ping timeout: 250 seconds]
<aegis3121>
cschneid_ my gut instinct is that, yes, it would re-instantiate the object each time. But I could be mistaken. If you're worried about time, Benchmark may offer some answers.
<cschneid_>
I'd guess that if the regex was /#{myvar}/, there'd be no way to precompile it..
aufi has quit [Quit: Konversation terminated!]
kalopsian has quit [Ping timeout: 260 seconds]
shinnya has joined #ruby
<ljarvis>
cschneid_: if it's used mroe than one, you should use a constant.. but not really just for performance reasons
<cschneid_>
well, it's used at only one point in the source code. Just inside a loop
<ljarvis>
and it's crucial for your code to be performant?
<ljarvis>
i ask because this is a bit of an over-optimisation imo
<cschneid_>
ljarvis: working on a new-relic competitor, and trying to squeeze as much performance out of the agent that we put in other people's apps. :)
asmodlol has joined #ruby
<cschneid_>
I didn't think this was a big deal, but was curious, and didn't know
mistermocha has joined #ruby
bkxd has joined #ruby
bronson has quit [Remote host closed the connection]
<ljarvis>
yeah I don't *think* ruby will do much optimisation for the literal. But I don't know for sure. The difference is mostly superfluous (and you'd probably gain an extra 1/10th of a second by using =~ instead of #match) but the fact you're benchmarking it tells me you already have a hold on things
<lucasb>
I didn't know =~ would be faster than #match, interesting
<aegis3121>
It was slower, actually, from ljarvis (unless I can't read)
<aegis3121>
constant match = 136, constant squiggly = 138
<ljarvis>
that was an assumption, the ips result shows they're about the same and if anything it's slightly slower than match with a precompiled regexp
bkxd has quit [Ping timeout: 255 seconds]
<adaedra>
and the difference between `string =~ regex` and `regex =~ string`? :p
<ljarvis>
:)
speaking1ode has joined #ruby
<ljarvis>
i thought not using match might remove some object allocations and perhaps method call overhead
mfb2 has quit [Remote host closed the connection]
<ljarvis>
(assuming $& is applied lazily?)
<ljarvis>
$~ rather
lkba has joined #ruby
bkxd has joined #ruby
Guest35313 has quit [Quit: Page closed]
usershell has joined #ruby
workmad3 has quit [Ping timeout: 250 seconds]
rakm has joined #ruby
atomical_ has quit [Ping timeout: 256 seconds]
<cschneid_>
Crazy - in 1.9.3, the behavior is flipped, the literal is ~5% faster
<cschneid_>
probably the Constant lookup is slower?
atomical has joined #ruby
bkxd has quit [Ping timeout: 264 seconds]
PlasmaStar has quit [Remote host closed the connection]
lacuna has quit [Read error: Connection reset by peer]
<adaedra>
on the other side of the hill, I dunno; on the hill, there's a fool.
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
domgetter has joined #ruby
aegis3121 has quit [Ping timeout: 276 seconds]
preyalone has joined #ruby
synthroid has joined #ruby
amclain has joined #ruby
freerobby has quit [Client Quit]
mikecmpbll has joined #ruby
<shevy>
hmm
Firoot73 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
atomical has joined #ruby
TomyLobo has joined #ruby
dlitvak has joined #ruby
symbol has joined #ruby
<mikecmpbll>
this is a bit obscure, but is there a way to get the line number that I'm writing to when using something like log = Logger.new('/some/file'); log.debug("some message")
symbol has quit [Client Quit]
<mikecmpbll>
i'd like to store the line number so when I generate an email i can include a reference to the log file for further info.
atomical_ has quit [Ping timeout: 276 seconds]
<toretore>
just add a unique identifier to the line
<mikecmpbll>
derp, that would be the smart thing.
<mikecmpbll>
thanks :D
sigurding has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
AlphaAtom has joined #ruby
dionysus69 has joined #ruby
blackmesa has joined #ruby
KineticX has quit [Remote host closed the connection]
nerfando has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<shevy>
like "# Here be dragons"
<mikecmpbll>
:)
finisherr has quit [Quit: finisherr]
KineticX has joined #ruby
greenhat has joined #ruby
joonty has quit [Ping timeout: 250 seconds]
f0ster has joined #ruby
jam_ has joined #ruby
sepp2k has quit [Quit: Leaving.]
mistermocha has quit [Remote host closed the connection]
underplank has joined #ruby
JoshL has joined #ruby
jam_ has quit [Ping timeout: 246 seconds]
chussenot has quit [Quit: chussenot]
bricker has joined #ruby
<domgetter>
mikecmpbll: You should also be able to use __LINE__
<domgetter>
note the double underscore, and mind that it returns a number, not a string
skade has quit [Quit: Computer has gone to sleep.]
The_Phoenix has quit [Read error: Connection reset by peer]
<ljarvis>
that's not what mikecmpbll meant
<ljarvis>
he meant the current line of the log file being written go
babblebre has joined #ruby
<ljarvis>
to*
<domgetter>
oooh "that I'm writing to". got it
mistermocha has joined #ruby
rodferso1 has joined #ruby
rodfersou has quit [Ping timeout: 250 seconds]
lemur has quit [Remote host closed the connection]
jaymeproni has quit [Remote host closed the connection]
shadeslayer has joined #ruby
chrisarcand has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
B1n4r10 has quit [Ping timeout: 255 seconds]
nerfando has joined #ruby
JakFrist has joined #ruby
tim_s007 has quit [Ping timeout: 250 seconds]
nerfando has quit [Max SendQ exceeded]
dwfait has quit [Remote host closed the connection]
mfb2 has joined #ruby
nerfando has joined #ruby
loatbac has joined #ruby
symm- has joined #ruby
michaellewis has joined #ruby
<loatbac>
hi
<michaellewis>
hi
mikecmpbll has quit [Ping timeout: 276 seconds]
momomomomo has joined #ruby
tim_s007 has joined #ruby
lacuna has quit [Remote host closed the connection]
<michaellewis>
so what should i download
<michaellewis>
loatbac
<workmad3>
everything?
<michaellewis>
msg/msg
usershell has joined #ruby
<michaellewis>
2938745038247569384765239487
northfurr has quit [Quit: northfurr]
<michaellewis>
msg/msg
<loatbac>
so, anyone here use gosu?
<sandstrom>
Is there a word/term for && || (logical operator), but is there a shorter word?
<domgetter>
loadtbac: I've used it, what's your question?
<havenwood>
andand and oror, or you mean single term for the pair?
<domgetter>
loatbac *
<loatbac>
just curious
<loatbac>
i've used it a little bit
michaellewis is now known as blackwhitejewish
bronson has joined #ruby
loatbac has left #ruby [#ruby]
arthurix has joined #ruby
finisherr has joined #ruby
sigurding has quit [Quit: sigurding]
akkmaxon has quit [Quit: akkmaxon]
sepp2k has joined #ruby
arthurix has quit [Remote host closed the connection]
steerio has quit [Quit: leaving]
arthurix has joined #ruby
blackwhitejewish has quit [Quit: blackwhitejewish]
underplank has quit [Ping timeout: 250 seconds]
bronson has quit [Ping timeout: 246 seconds]
underplank has joined #ruby
dlitvak has quit [Ping timeout: 256 seconds]
rodferso1 has quit [Ping timeout: 250 seconds]
rodfersou has joined #ruby
bkxd has joined #ruby
underplank has quit [Ping timeout: 256 seconds]
underplank has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
loatbac has joined #ruby
blackwhitejewish has joined #ruby
dlitvak has joined #ruby
<loatbac>
hello
bkxd has quit [Ping timeout: 260 seconds]
momomomomo has quit [Quit: momomomomo]
rodfersou has quit [Ping timeout: 250 seconds]
aibot has quit [Remote host closed the connection]
ascarter has joined #ruby
ror15 has joined #ruby
<loatbac>
xyzzy
<blackwhitejewish>
im not jewish
<loatbac>
ok
underplank has quit [Ping timeout: 272 seconds]
aibot has joined #ruby
loatbac has left #ruby [#ruby]
<blackwhitejewish>
underplank y u quit
momomomomo has joined #ruby
blackwhitejewish has left #ruby [#ruby]
aibot has quit [Read error: Connection reset by peer]
aibot has joined #ruby
JohnT has joined #ruby
ascarter has quit [Client Quit]
aibot has quit [Remote host closed the connection]
bronson has joined #ruby
rodfersou has joined #ruby
aibot has joined #ruby
bronson has quit [Remote host closed the connection]
bronson has joined #ruby
radgeRayden_ has quit [Ping timeout: 265 seconds]
radgeRayden__ has joined #ruby
nfk|laptop has joined #ruby
lacuna has joined #ruby
guacamole has joined #ruby
roshanav_ has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
rrichardsr3 has joined #ruby
gbgdev has quit [Remote host closed the connection]
chipotle has quit [Quit: cheerio]
TheHodge has quit [K-Lined]
c355e3b has quit [K-Lined]
ckrailo has quit [K-Lined]
cstrahan has quit [K-Lined]
err_ok has quit [K-Lined]
amitchellbullard has quit [K-Lined]
thesheff17 has quit [K-Lined]
jxf has quit [K-Lined]
DoYouKnow has quit [K-Lined]
kireevco has quit [K-Lined]
glowcoil has quit [K-Lined]
zipkid has quit [K-Lined]
bestie has quit [K-Lined]
bjeanes has quit [K-Lined]
halfdan has quit [K-Lined]
adambeynon has quit [K-Lined]
machty has quit [K-Lined]
deeprave has quit [K-Lined]
jabreity__ has quit [K-Lined]
acadavid has quit [K-Lined]
ELLIOTTCABLE has quit [K-Lined]
mikolalysenko has quit [K-Lined]
troter______ has quit [K-Lined]
babblebre has quit [K-Lined]
frem has quit [K-Lined]
tjohnson has quit [K-Lined]
jmhmccr has quit [K-Lined]
nomadicoder has quit [K-Lined]
knowtheory has quit [K-Lined]
preyalone has quit [K-Lined]
podman has quit [K-Lined]
colstrom has quit [K-Lined]
hayden_ has quit [K-Lined]
ziyadb has quit [K-Lined]
Cihan has quit [K-Lined]
frode15243 has quit [K-Lined]
Guest85414______ has quit [K-Lined]
howdoi has quit [K-Lined]
huddy has quit [K-Lined]
d10n-work has quit [K-Lined]
lipoqil has quit [K-Lined]
swgillespie has quit [K-Lined]
skmp has quit [K-Lined]
gmci has quit [K-Lined]
ELCALOR has quit [K-Lined]
CihanKaygusuz has quit [K-Lined]
avahey has quit [K-Lined]
justinweiss has quit [K-Lined]
mroth has quit [K-Lined]
avdi has quit [K-Lined]
jmcc______ has quit [K-Lined]
ramblinpeck has quit [K-Lined]
jpinnix_______ has quit [K-Lined]
angiebadillo has quit [K-Lined]
acalewin has quit [K-Lined]
joaomdmoura__ has quit [K-Lined]
Eleeleth has quit [K-Lined]
jhill_ has quit [K-Lined]
danzilio has quit [K-Lined]
braderhart has quit [K-Lined]
alxndr has quit [K-Lined]
chrisseaton has quit [K-Lined]
ggherdov has quit [K-Lined]
jlyndon has quit [K-Lined]
pfg has quit [K-Lined]
Lloyd has quit [K-Lined]
jevs has quit [K-Lined]
Guest4184____ has quit [K-Lined]
Arcaire has quit [K-Lined]
spastorino has quit [K-Lined]
S01780_ has quit [K-Lined]
im0b has quit [K-Lined]
bcavileer_ has quit [K-Lined]
shelling__ has quit [K-Lined]
kellabyte has quit [K-Lined]
frankS2 has quit [K-Lined]
rflot has quit [K-Lined]
akahn has quit [K-Lined]
bove has quit [K-Lined]
daxroc has quit [K-Lined]
pizzaops has quit [K-Lined]
benlakey has quit [K-Lined]
bttf has quit [K-Lined]
cardoni has quit [K-Lined]
MiracleBlue__ has quit [K-Lined]
lancetw has quit [K-Lined]
jeregrine has quit [K-Lined]
akitada has quit [K-Lined]
rfv has quit [K-Lined]
cbednarski has quit [K-Lined]
yo61 has quit [K-Lined]
zrl has quit [K-Lined]
iamdevnul has quit [K-Lined]
AdamMeghji has quit [K-Lined]
sideshowcoder has quit [K-Lined]
dukedave has quit [K-Lined]
mrsolo has quit [K-Lined]
deimos has quit [K-Lined]
tejasmanohar has quit [K-Lined]
andersh has quit [K-Lined]
boxrick1 has quit [K-Lined]
charles81 has quit [K-Lined]
vcoinminer_ has quit [K-Lined]
golgaroth has quit [K-Lined]
apipkin has quit [K-Lined]
djbender has quit [K-Lined]
countryHick has quit [K-Lined]
Heero has quit [K-Lined]
tonini has quit [K-Lined]
cbetta has quit [K-Lined]
twodayslate has quit [K-Lined]
PhilK has quit [K-Lined]
HashNuke has quit [K-Lined]
schaary has quit [K-Lined]
pmarreck has quit [K-Lined]
zzak_ has quit [K-Lined]
manveru has quit [K-Lined]
jord has quit [K-Lined]
nfk|laptop has quit [Quit: yawn]
shadoi has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
swgillespie has joined #ruby
kireevco has joined #ruby
deeprave has joined #ruby
halfdan has joined #ruby
gagrio_ has quit [Quit: Leaving...]
jabreity__ has joined #ruby
jmcc______ has joined #ruby
ramblinpeck has joined #ruby
mikolalysenko has joined #ruby
jxf has joined #ruby
thesheff17 has joined #ruby
sigurding has joined #ruby
kalopsian has quit [Ping timeout: 240 seconds]
M-shine has quit [Ping timeout: 245 seconds]
roshanav_ has quit [Ping timeout: 265 seconds]
joonty has joined #ruby
gbgdev has joined #ruby
ELLIOTTCABLE has joined #ruby
duckpuppy has joined #ruby
kellabyte has joined #ruby
B1n4r10 has joined #ruby
chipotle has joined #ruby
hayden_ has joined #ruby
pdoherty has quit [Ping timeout: 240 seconds]
Eleeleth has joined #ruby
FernandoBasso1 has joined #ruby
Ebok has joined #ruby
<lucasb>
I'm trying to create a generic Pair object. tried to search the ecosystem, but I think this may be too simple to exists as a gem. Can someone review and say what could improve it? I didn't even tested it yet. https://eval.in/private/ebd79b84ad5fdc
jxs_ has quit [Remote host closed the connection]
p0wn3d has joined #ruby
chrisseaton has joined #ruby
jbrhbr has joined #ruby
machty has joined #ruby
bove has joined #ruby
im0b has joined #ruby
tjohnson has joined #ruby
akitada has joined #ruby
ziyadb has joined #ruby
pmarreck has joined #ruby
Heero has joined #ruby
p0wn3d has quit [Client Quit]
joonty has quit [Ping timeout: 256 seconds]
firstdayonthejob has joined #ruby
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FernandoBasso has quit [Ping timeout: 276 seconds]
jxs_ has joined #ruby
countryHick has joined #ruby
Lloyd has joined #ruby
benlakey has joined #ruby
podman has joined #ruby
avdi has joined #ruby
dlitvak has quit [Remote host closed the connection]
cbetta has joined #ruby
d10n-work has joined #ruby
acadavid has joined #ruby
Guest85414______ has joined #ruby
jpinnix_______ has joined #ruby
TheHodge has joined #ruby
tomaw has quit [Ping timeout: 600 seconds]
mroth has joined #ruby
skmp has joined #ruby
tomaw_ has joined #ruby
howdoi has joined #ruby
adambeynon has joined #ruby
symm- has quit [Ping timeout: 265 seconds]
apipkin has joined #ruby
PhilK has joined #ruby
xet7 has quit [Ping timeout: 260 seconds]
huddy has joined #ruby
jmhmccr has joined #ruby
amitchellbullard has joined #ruby
andersh has joined #ruby
frem has joined #ruby
glowcoil has joined #ruby
frode15243 has joined #ruby
jeregrine has joined #ruby
lipoqil has joined #ruby
bestie has joined #ruby
CihanKaygusuz has joined #ruby
jevs has joined #ruby
willv has quit [Ping timeout: 256 seconds]
tomaw_ is now known as tomaw
charles81 has joined #ruby
golgaroth has joined #ruby
lacuna has quit [Read error: Connection reset by peer]
ckrailo has joined #ruby
MiracleBlue__ has joined #ruby
akahn has joined #ruby
carella has joined #ruby
shelling__ has joined #ruby
dopie has quit [Quit: Lost terminal]
rflot has joined #ruby
djbender has joined #ruby
zzak_ has joined #ruby
deimos has joined #ruby
M-shine has joined #ruby
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
dopie has joined #ruby
knowtheory has joined #ruby
c355e3b has joined #ruby
<carella>
Why can't I find to_i method like this `String.methods.grep /to_i/`?
bjeanes has joined #ruby
<ljarvis>
carella: instance_methods
rdark has quit [Ping timeout: 250 seconds]
jord has joined #ruby
<carella>
oh, thanks
cstrahan has joined #ruby
manveru has joined #ruby
avahey has joined #ruby
twodayslate has joined #ruby
schaary has joined #ruby
braderhart has joined #ruby
bcavileer_ has joined #ruby
lancetw has joined #ruby
<ljarvis>
lucasb: review should come after your tests, really
bluOxigen has joined #ruby
aegis3121 has joined #ruby
vcoinminer_ has joined #ruby
dukedave has joined #ruby
<ljarvis>
lucasb: but one thing to point out is that your each method doesn't really make a whole lot of sense
bruce__lee has joined #ruby
pfg has joined #ruby
justinweiss has joined #ruby
danzilio has joined #ruby
ELCALOR has joined #ruby
<lucasb>
ljarvis: I'll learn how to write some tests, thanks
bluOxigen_ has quit [Ping timeout: 260 seconds]
jlyndon has joined #ruby
joaomdmoura__ has joined #ruby
<lucasb>
the each method is supposed to just iterate 2 times, yielding key and value
bruce_lee has quit [Ping timeout: 255 seconds]
mrmargol_ has joined #ruby
<ljarvis>
why not yield key, value ?
blaxter has quit [Ping timeout: 264 seconds]
mrmargolis has quit [Read error: Connection reset by peer]
<lucasb>
then there's no need to iterate at all, since the one can access the key and value already, without using each
<ljarvis>
i mean, it's not really enumerberable I guess, I dont really see why you'd enumerate a pair but I guess you'll want the other methods
<ljarvis>
I'd just use enum_for(:each)
iamdevnul has joined #ruby
<ljarvis>
or something
<ljarvis>
er
<ljarvis>
:to_a *
spastorino has joined #ruby
zipkid has joined #ruby
guacamol_ has joined #ruby
<ljarvis>
your pairs_from methods can just be written as enum.map { |*args| Pair.new(*args) } I think
momomomomo has quit [Quit: momomomomo]
<lucasb>
ljarvis: hm, yes. using enum_for(:to_a) would do the same thing. maybe I created each just to get the sugar of Enumerable
B1n4r10 has quit [Ping timeout: 260 seconds]
dmr8 has joined #ruby
cardoni has joined #ruby
daxroc has joined #ruby
certainty has joined #ruby
<ljarvis>
also I would recommend avoiding using "and" and "or"
<ljarvis>
use && abd || instead
preyalone has joined #ruby
pizzaops has joined #ruby
err_ok has joined #ruby
tejasmanohar has joined #ruby
platzhirsch has left #ruby [#ruby]
Arcaire has joined #ruby
guacamole has quit [Ping timeout: 245 seconds]
cbednarski has joined #ruby
nomadicoder has joined #ruby
<lucasb>
that pairs_from_enum methods should really be Hash#to_pairs and Array or Enumerable #to_pairs, but I'll leave at that for now. I still didn't practice how to use module refinements
djbkd has joined #ruby
User458764 has joined #ruby
<lucasb>
ljarvis: but, ok. I liked what you said. I'll take into consideration. thank you very much!
sideshowcoder has joined #ruby
colstrom has joined #ruby
bttf has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
jhill_ has joined #ruby
gmci has joined #ruby
frankS2 has joined #ruby
iateadonut has quit [Quit: Leaving.]
UtkarshRay has quit [Ping timeout: 250 seconds]
zrl has joined #ruby
mrsolo has joined #ruby
slayerjain has joined #ruby
AdamMeghji has joined #ruby
arup_r has quit []
boxrick1 has joined #ruby
S01780_ has joined #ruby
angiebadillo has joined #ruby
troter______ has joined #ruby
norc has joined #ruby
Dimik has joined #ruby
rdark has joined #ruby
babblebre has joined #ruby
nb_bez___ has joined #ruby
acalewin has joined #ruby
Bloomer has quit [Remote host closed the connection]
rodfersou has quit [Quit: leaving]
mikecmpbll has joined #ruby
rodfersou has joined #ruby
ht__ has joined #ruby
mrmargol_ has quit []
Macaveli has joined #ruby
Cihan has joined #ruby
dlitvak has joined #ruby
Guest4184____ has joined #ruby
momomomomo has joined #ruby
spider-mario has joined #ruby
kalopsian has joined #ruby
blaxter has joined #ruby
steffkes has joined #ruby
steffkes has joined #ruby
peeja has joined #ruby
ggherdov has joined #ruby
sftrabbit has joined #ruby
mchu has quit [Quit: mchu]
nerfando has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkf has quit [Quit: Leaving]
JohnT has joined #ruby
lapide_viridi has joined #ruby
mchu has joined #ruby
peeja has quit [Ping timeout: 260 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JakFrist has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
freerobby has joined #ruby
ht__ has joined #ruby
guacamole has joined #ruby
steffkes has quit [Ping timeout: 260 seconds]
nfk|laptop has joined #ruby
dlitvak has quit [Ping timeout: 264 seconds]
baweaver has joined #ruby
lapide_viridi has quit [Ping timeout: 260 seconds]
JakFrist has quit [Ping timeout: 240 seconds]
nettoweb has joined #ruby
blaxter has quit [Ping timeout: 256 seconds]
guacamol_ has quit [Ping timeout: 256 seconds]
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
edwinvdgraaf has joined #ruby
f4cl3y has quit [Ping timeout: 245 seconds]
craysiii has joined #ruby
aibot has quit [Remote host closed the connection]
dlitvak has joined #ruby
aibot has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
mchu has quit [Quit: mchu]
Xeago has joined #ruby
bluOxigen has quit [Ping timeout: 276 seconds]
guacamol_ has joined #ruby
chrisarcand has quit [Quit: leaving]
chrisarcand has joined #ruby
choke has joined #ruby
guacamole has quit [Ping timeout: 255 seconds]
FernandoBasso1 has quit [Quit: Leaving]
harai54 has joined #ruby
baweaver has quit [Remote host closed the connection]
antgel has quit [Ping timeout: 245 seconds]
haraigo has joined #ruby
sigurding has quit [Quit: sigurding]
elaptics is now known as elaptics`away
slayerjain has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
harai54 has quit [Ping timeout: 255 seconds]
dlitvak has quit [Remote host closed the connection]
bkxd has joined #ruby
radgeRayden_ has joined #ruby
radgeRayden__ has quit [Ping timeout: 245 seconds]
dcunit3d has quit [Ping timeout: 260 seconds]
lapide_viridi has joined #ruby
rodfersou has quit [Ping timeout: 255 seconds]
rodferso1 has joined #ruby
rdark has quit [Ping timeout: 276 seconds]
Melpaws has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
nerfando has joined #ruby
binaryplease has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ror15>
I'm testing a gets.chomp function. I'm trying to not require input while running the test. How do I do this?
<ror15>
in rspec
blackmesa has quit [Ping timeout: 240 seconds]
<ror15>
Their channel is sleeping
northfurr has joined #ruby
<jbrhbr>
you might be able to just stub out gets on object, like `allow(Object).to receive(:gets)`
northfurr has quit [Client Quit]
baweaver has joined #ruby
northfurr has joined #ruby
roshanavand has joined #ruby
<Papierkorb>
adding on jbrhbr, make the stub return the input: allow(the_instance).to receive(:gets).and_return "The Input Here\n"
<jbrhbr>
i'm not sure what the best practice is here, although in my experience the kind of program where i'd use something like gets (usually one-off hacks) is not the kind of program that i would be writing tests for
<Papierkorb>
Oh, no, actually use expect: expect(the_instance).to receive(:gets).and_return "The Input Here\n"
<jbrhbr>
depends on if he wants to make sure it's called, but yeah
<Papierkorb>
But then, I'd make the function receive a string argument instead of reading directly off $stdin
<jbrhbr>
yea
<ror15>
stub is deprecated on 3.1.7 and I'm not sure how to use mocks
<jbrhbr>
we just wrote the code for you
<Papierkorb>
ror15: Like jbrhbr and I wrote
stannard_ has joined #ruby
<Melpaws>
struggling with some arrays. I need to find a way to clean up my nested array based on either elements or match . Pretty much need either element [1] of each array removed or to remove the 'First Shift - 7AM' element. : gist : https://gist.github.com/dylnnlsn/3aafbb171004554bae3f
<ror15>
Ah I see
<Melpaws>
any suggestions?
<Melpaws>
i cannot get reject or delete_if to work for some reason
tomaz_b has joined #ruby
jam_ has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
roshanavand has quit [Ping timeout: 260 seconds]
bb010g has joined #ruby
baweaver has quit [Remote host closed the connection]
<toretore>
Melpaws, define more precisely what you want to do
symm- has joined #ruby
<Melpaws>
ultimately, remove any 'First Shift - 7AM' from the array.
<ror15>
jbrhbr: You're right, I'm just using rspec to play with a simple ruby program. Thanks and Papierkorb
bMalum has joined #ruby
huddy has quit [Quit: Connection closed for inactivity]
blackwhitejewish was banned on #ruby by ChanServ [blackwhitejewish!*@*]
blackwhitejewish was kicked from #ruby by ChanServ [Banned: Good bye]
jackjackdripper has joined #ruby
<adaedra>
thanks, toretore
<toretore>
np
<Radar>
+1
blackwhitejewish has joined #ruby
blackwhitejewish was kicked from #ruby by ChanServ [Banned: Good bye]
jam_ has quit [Ping timeout: 255 seconds]
camilasan has quit [Remote host closed the connection]
<adaedra>
apeiros: is it normal it removes the +b so soon?
blackwhitejewish has joined #ruby
blackwhitejewish was kicked from #ruby by ChanServ [Banned: Good bye]
<toretore>
Melpaws, more precisely than that. this is how to solve programming problems; the difficult part is articulating what it is you want to do
stamina has joined #ruby
<jhass>
apeiros: well, that's spammy
willv has joined #ruby
<toretore>
Melpaws, the way you phrase it can be interpreted in more than one way: 1) remove the second element from each array 2) remove objects that match "First Shift - 7AM" from each array
<jhass>
.troll blackwhitejewish
<jhass>
still not I guess
chrisarcand has quit [Quit: leaving]
sepp2k has quit [Read error: Connection reset by peer]
<Mon_Ouie>
Oh, okay then, I thought someId would be 3 and not an array containing 3
momomomomo has joined #ruby
programm1 has joined #ruby
momomomomo has quit [Client Quit]
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rusy>
god knows :)
<rusy>
I'm just going to sit and beg for it to work
<rusy>
ty anyway
programmerq has quit [Ping timeout: 246 seconds]
rusy has quit [Quit: Page closed]
karapetyan has joined #ruby
usershell has quit [Remote host closed the connection]
ldnunes_ has joined #ruby
dlitvak has quit [Remote host closed the connection]
ldnunes has quit [Ping timeout: 245 seconds]
atomical_ has joined #ruby
<mchu>
hi. is anyone familiar w/ the “ serialized_accessor :config, “ ? i can’t seem to find anything on it in google
sandstrom has quit [Quit: My computer has gone to sleep.]
troulouliou_dev has joined #ruby
edwinvdg_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
atomical has quit [Ping timeout: 240 seconds]
synthroid has quit [Remote host closed the connection]
edwinvdgraaf has quit [Ping timeout: 260 seconds]
stannard_ has quit [Remote host closed the connection]
programm1 has quit [Ping timeout: 256 seconds]
symm- has quit [Quit: Leaving...]
atomical has joined #ruby
karapetyan has joined #ruby
nettoweb has quit [Excess Flood]
momomomomo has joined #ruby
programm1 has joined #ruby
speaking1ode has quit [Ping timeout: 272 seconds]
carella has quit [Ping timeout: 252 seconds]
TheEyeOfTheTruth has joined #ruby
atomical_ has quit [Ping timeout: 256 seconds]
leksster has quit [Remote host closed the connection]
colegatron has quit [Ping timeout: 256 seconds]
bruce__lee has quit [Changing host]
bruce_lee has joined #ruby
bruce__lee is now known as bruce_lee
TheEyeOfTheTruth has quit [Client Quit]
FernandoBasso has joined #ruby
stamina has quit [Ping timeout: 260 seconds]
karapetyan has quit [Remote host closed the connection]
pulgolino has quit [Remote host closed the connection]
karapetyan has joined #ruby
joonty has joined #ruby
<choke>
afternoon everyone
uri_ has joined #ruby
ldnunes_ has quit [Quit: Leaving]
DoubleMalt has quit [Ping timeout: 240 seconds]
<domgetter>
good morning
jgpawletko has quit [Quit: jgpawletko]
joonty has quit [Ping timeout: 276 seconds]
colegatron has joined #ruby
stannard has joined #ruby
last_staff has joined #ruby
Xeago has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sandstrom has joined #ruby
casadei_ has joined #ruby
baweaver has joined #ruby
casadei has quit [Ping timeout: 245 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
agentmeerkat has quit [Ping timeout: 256 seconds]
programm1 is now known as programmerq
tvsutton has joined #ruby
SHyx0rmZ has quit [Remote host closed the connection]
edwinvdg_ has quit [Read error: Connection reset by peer]
certainty has joined #ruby
edwinvdgraaf has joined #ruby
baweaver has quit [Ping timeout: 245 seconds]
wldcordeiro has quit [Ping timeout: 256 seconds]
<tvsutton>
I have a general Rake question: I'm working on a project with a very large Rakefile and it makes branching/merging problematic because many changes go into a single file. I was looking at splitting it up using simply the "rakelib/foo.rake" pattern. Does this method have any disadvantages for simply splitting up our tasks into files more logically?
<dasilvacontin>
Hi! ruby n00b here. How can I do "obj.prop?.each { |n| puts n }" so that each only tries to be executed if obj has prop defined?
guacamole has quit [Ping timeout: 260 seconds]
firstdayonthejob has joined #ruby
Dimik has quit [Ping timeout: 240 seconds]
mchu has quit [Quit: mchu]
djbkd has quit [Ping timeout: 245 seconds]
<dasilvacontin>
Can I do it in a single line?
mary5030 has quit [Ping timeout: 260 seconds]
Dimik has joined #ruby
<dasilvacontin>
Getting "undefined method `presets?' for #<Hash:0x007fa97b093658> (NoMethodError)". I guess it's trying to access a prop called `presets?` in the object
<dasilvacontin>
When I just wanted to do an existence check
<dasilvacontin>
lucasb: probably I won't use it then, though it's very nice to know about it, thanks :)
Jello_Raptor has joined #ruby
<dasilvacontin>
lucasb: what's the best alternative, use `and`?
<dasilvacontin>
obj.prop and obj.prop.each ...
Jello_Raptor has quit [Max SendQ exceeded]
Jello_Raptor has joined #ruby
<lucasb>
dasilvacontin: maybe that might work. to be honest I really dunno. maybe someone more experienced here in the channel can tell you.
baweaver has quit [Ping timeout: 250 seconds]
tvw has joined #ruby
hxegon has quit [Quit: BRB]
ur5us has joined #ruby
karapetyan has quit [Remote host closed the connection]
<dasilvacontin>
lucasb: yep, it does work. I'll go with that, thanks :)
baweaver has joined #ruby
yfeldblum has joined #ruby
karapetyan has joined #ruby
aupadhye has quit [Quit: Leaving]
bb010g has quit [Quit: Connection closed for inactivity]
dlitvak has quit [Ping timeout: 246 seconds]
tockitj has quit [Ping timeout: 246 seconds]
karapetyan has quit [Remote host closed the connection]
agentmeerkat has quit [Ping timeout: 264 seconds]
djbkd has joined #ruby
moei has quit [Quit: Leaving...]
karapetyan has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has joined #ruby
nfk|laptop has joined #ruby
<lucasb>
inside class Foo, I'm repeating a lot of Foo.some_method. but this will cause problems when the class is subclassed. Other languages have something like __class__ or __CLASS__ for this. In ruby, self.class.some_method is the accepted idiom for this?
<lucasb>
in other words, I want a token that means "the current class in scope"
dcunit3d has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
decoponio has quit [Quit: Leaving...]
guacamole has joined #ruby
synthroid has quit []
<adaedra>
self
dlitvak has quit [Ping timeout: 240 seconds]
<lucasb>
but inside instance methods, self is the object, not the class
<adaedra>
or self.class, in instance methods (don't know how it reacts in modules tho)
jbrhbr has joined #ruby
guacamol_ has quit [Ping timeout: 260 seconds]
<lucasb>
ok, I just wanted to confirm that was the right thing. thanks, adaedra
jgt has joined #ruby
davedev2_ has quit [Ping timeout: 260 seconds]
mchu has quit [Quit: mchu]
davedev24 has joined #ruby
haraigo has quit [Ping timeout: 264 seconds]
aspire has joined #ruby
tomchapin has joined #ruby
atomical_ has joined #ruby
tockitj has joined #ruby
mchu has joined #ruby
bMalum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ht__ has joined #ruby
atomical has quit [Ping timeout: 245 seconds]
roshanavand has quit [Read error: Connection reset by peer]
edwinvdgraaf has quit [Read error: Connection reset by peer]
blackmesa has quit [Ping timeout: 264 seconds]
edwinvdgraaf has joined #ruby
roshanavand has joined #ruby
choke has joined #ruby
ht__ has quit [Client Quit]
imperator has joined #ruby
gbgdev has joined #ruby
dede has joined #ruby
bMalum has joined #ruby
<imperator>
i'm spacing, is there a version of delete_if that returns the rejected items instead of the final object?
blackmesa has joined #ruby
baweaver has quit [Remote host closed the connection]
edwinvdgraaf has quit [Read error: Connection reset by peer]
hahuang61 has quit [Quit: WeeChat 1.4]
edwinvdgraaf has joined #ruby
hahuang65 has joined #ruby
FooMunki has quit [Quit: FooMunki]
hahuang65 has quit [Client Quit]
FooMunki has joined #ruby
hahuang65 has joined #ruby
<lucasb>
imperator: are you interested only in the rejected items, or you also want the side effects of removing them from the array?
<grill>
yo. do instance vars percolate down to child contexts in rspec?
smactive has joined #ruby
djbkd_ has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mclong has joined #ruby
<Radar>
grill: fo' real dawg
<grill>
what
Guest38 has joined #ruby
<Radar>
grill: Apologies. Yes they do percolate down.
<Radar>
(my homie)
hahuang65 has quit [Quit: WeeChat 1.4]
<Radar>
((I interpret "yo" as like real OG type shit))
hahuang65 has joined #ruby
<shevy>
yo man
<Radar>
shevy: WHAT UP
<shevy>
:D
choke has quit [Remote host closed the connection]
<shevy>
I think you overwhelmed grill there!
<jbrhbr>
it's really not that slangy
atomical has joined #ruby
<grill>
old people still think it's slangy
<shevy>
at what point is someone old
<jbrhbr>
i'm getting old :(
nfk|laptop has quit [Ping timeout: 246 seconds]
dlitvak has joined #ruby
<shevy>
jbrhbr perhaps you are right before the age threshold!
<imperator>
lucasb, i also want the side effects
choke has joined #ruby
aegis3121 has joined #ruby
willv has quit [Ping timeout: 240 seconds]
<grill>
anyway, i have a before before block where i set an instance var (e.g. @first_file = "/blah"). later on, in a child context's before block, i call FileUtils.touch(@first_file), which promptly comes back with a "can't convert nil into string" error. what gives?
<aegis3121>
o___O my first instinct is...don't use an iVar
mistermocha has quit [Remote host closed the connection]
<jbrhbr>
:p i knew it was just a matter of time!
ramortegui has quit [Quit: Ex-Chat]
atomical has quit [Ping timeout: 260 seconds]
<Ox0dea>
#reject! should totally return the rejected elements. :/
roshanavand has quit [Read error: Connection reset by peer]
<jbrhbr>
would be more useful for sure, it's redundant the current way
mistermocha has joined #ruby
roshanavand has joined #ruby
dopie has quit [Quit: Lost terminal]
terminalrecluse has quit [Ping timeout: 246 seconds]
dopie has joined #ruby
<bnagy>
eh
<lucasb>
I like that methods return self, but in this case I'll have to agree. Even more since #reject! returns nil when it doesn't find anything to remove.
<lucasb>
(I mean, I agree that #reject! should return the rejected ones)
<Ox0dea>
It would be objectively more useful, and those wanting the current behavior could `tap(&:reject!)`.
<jbrhbr>
i got bit by that 'returns nil' behavior yesterday actually
bMalum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Domaldel has quit [Quit: Leaving]
<bnagy>
oic internally redundant, I thought you meant redundancy with reject/reject!
<jbrhbr>
i did some console tests to make sure it returned the array it had modified, but in my test i had a block body which actually found something. so the last line of my method was `l.reject! …`
<jbrhbr>
but in my actual code, the block never rejected anything, so it was returning nil. took me a while to realize wtf was going on there
baweaver has joined #ruby
<lucasb>
yeah, conditionally return either self or nil doesn't make much sense :)
mistermocha has quit [Ping timeout: 265 seconds]
aryaching has quit [Ping timeout: 245 seconds]
mistermocha has joined #ruby
bMalum has joined #ruby
rahult has joined #ruby
guacamole has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
rahult has left #ruby [#ruby]
Limix has joined #ruby
edwinvdgraaf has joined #ruby
<Ox0dea>
Unless you're using bang methods in conditionals, which is the intended use case.
<Ox0dea>
Regarding their nil-returning semantics, at any rate.
rahult has joined #ruby
agent_white has joined #ruby
hannelita has quit [Remote host closed the connection]
polishdub has quit [Quit: Leaving]
<jbrhbr>
yes
casadei_ has quit [Remote host closed the connection]
baweaver has quit [Ping timeout: 260 seconds]
willv has quit [Ping timeout: 240 seconds]
bMalum has quit [Ping timeout: 272 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
B1n4r10 has quit [Ping timeout: 264 seconds]
B1n4r10 has joined #ruby
<bnagy>
you'd need to keep the nil return, but returning the removed items in this case does seem to make sense :\
<bnagy>
select! returns what it selected...
tvw has quit [Ping timeout: 255 seconds]
blackmesa has quit [Ping timeout: 250 seconds]
<grill>
aegis3121 you aren't supposed to use variables defined with let inside before blocks...
<Ox0dea>
bnagy: Well, it returns `self`, which amounts to the same thing.
<drocsid>
I created ruby rvm generated wrappers to start cron jobs. Something happened. Now I'm unable to create them. I'm getting Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.2.1/bin' is not at first place....
ixti has joined #ruby
ixti has quit [Client Quit]
<drocsid>
I checked my path, I see /usr/local/rvm/gems/ruby-2.2.1/bin is the second entry. Why does it have to be the first? I also tried the rvm get stable --auto-dotfiles reccomendation
northfurr has joined #ruby
astrofog has joined #ruby
Insti has quit [Ping timeout: 256 seconds]
atomical has joined #ruby
<pipework>
shevy: wakka wakka, nanu nanu.
<pipework>
shazbot?
Log1x has joined #ruby
bb010g has joined #ruby
B1n4r10 has joined #ruby
last_staff has quit [Remote host closed the connection]
bahar has joined #ruby
bahar has joined #ruby
<drocsid>
really why does /usr/local/rvm/gems/ruby-2.2.1/bin have to be the first PATH entry...
<pipework>
drocsid: local-first
<pipework>
You installed as system, right?
atomical_ has quit [Ping timeout: 272 seconds]
firstdayonthejob has quit [Ping timeout: 245 seconds]
bkxd has joined #ruby
ixti has joined #ruby
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chadwtaylor has quit [Ping timeout: 276 seconds]
aegis3121 has quit [Ping timeout: 265 seconds]
cschneid_ has quit [Remote host closed the connection]