duderono_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
cfec0b8d has quit [Ping timeout: 240 seconds]
Lyfe has joined #ruby
antoniobeyah has quit [Quit: Connection closed for inactivity]
xall_ has joined #ruby
Guest56370 is now known as CrazEd
CrazEd is now known as Guest31598
jgnagy has quit [Ping timeout: 264 seconds]
solocshaw has quit [Ping timeout: 246 seconds]
xall_ has quit [Ping timeout: 260 seconds]
gix has quit [Ping timeout: 260 seconds]
jgnagy has joined #ruby
gix has joined #ruby
hotpanca_ has joined #ruby
mjuszczak has joined #ruby
hotpancakes has quit [Ping timeout: 246 seconds]
xall_ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
chopin has joined #ruby
xall_ has quit [Ping timeout: 258 seconds]
Channel6 has joined #ruby
yusrideb has quit [Ping timeout: 240 seconds]
adrenaline has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
Suslov has joined #ruby
twhitney11 has joined #ruby
<twhitney11>
Hi ruby folks, I am reading to hit my head against my desk. I have a GUID in this format 'x1!4\x0F\xEB\xDAA\xA7\xF8\xD5\xB7\x9Ejx\x06' and trying to get it to look like this '783121340fc3abc39a41c2a7c3b8c395c2b7c29e6a7806'
SteenJobs has joined #ruby
<twhitney11>
In python I did it easily with the following one liner: print(binascii.hexlify(bytes('x1!4\x0F\xEB\xDAA\xA7\xF8\xD5\xB7\x9Ejx\x06', 'utf-8')))
yusrideb has joined #ruby
<marchelzo>
oh did you now
<marchelzo>
did you
<twhitney11>
I found a binascii module for ruby, but I seem to only be getting a longer string that does not match what I want... I also tried str.unpack("H*") which I see suggested in a lot of places, but get a much longer string that looks similar... 783121345c7830465c7845425c784441415c7841375c7846385c7844355c7842375c7839456a785c783036
<marchelzo>
yikes
<twhitney11>
Just wondering what I am missing
Suslov has quit [Remote host closed the connection]
<twhitney11>
I know its probably something simple, I just don't have a ton of experience with Ruby
Suslov has joined #ruby
<marchelzo>
you haven't formulated the problem very clearly
<matthewd>
twhitney11: '\xFF' != "\xFF"
<matthewd>
twhitney11: Read: your input string is longer than you think it is
igniting has joined #ruby
ozcanesen has joined #ruby
<marchelzo>
good eye matthewd
cschnei__ has joined #ruby
<twhitney11>
sigh
<twhitney11>
this is exactly what I was looking for, now unpack gives me EXACTLY what I am expecting.
cschneid_ has quit [Ping timeout: 246 seconds]
<twhitney11>
can I use string interpolation if I am receiving this string from another source?
<matthewd>
hmm?
Suslo has joined #ruby
Suslo has quit [Client Quit]
<marchelzo>
twhitney11: no, but you don't need to
Suslov has quit [Ping timeout: 246 seconds]
<marchelzo>
it would be strange if this source where you got the string literally gave you 'x1!4\x0F\xEB\xDAA\xA7\xF8\xD5\xB7\x9Ejx\x06'
KicStart has left #ruby [#ruby]
SteenJobs has quit [Quit: SteenJobs]
<twhitney11>
I'll have to trace back to where I am receiving this string from
<twhitney11>
It is a call with the net/ldap module. But I am not controlling how I am receiving the attribute.
<marchelzo>
twhitney11: you don't need to control, but you do need to understand it
Akuya has joined #ruby
<twhitney11>
marchelzo: that I don't
<twhitney11>
hence ready to hit my head against the desk :-/
<marchelzo>
well just get it from that source and inspect it
<matthewd>
twhitney11: The question is whether the string truly contains "\\x0F", or whether that's an artifact of how you're examining it
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest77 has joined #ruby
tau is now known as tauzao
<twhitney11>
matthewd: thanks for your help so far. I concur that it is likely a problem with my little understanding of what format it actually is in when I get it.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<twhitney11>
The variable is stored as validation_result[:user_data][:extra_attributes]["guid"] and when I print that the console I get the response ["x1!4\x0F\xEB\xDAA\xA7\xF8\xD5\xB7\x9Ejx\x06"] printed to the console
<matthewd>
Right, so that's what you want, and should unpack directly
tauzao is now known as tau
<twhitney11>
matthewd: when I print the result of validation_result[:user_data][:extra_attributes]["guid"].unpack("H*") to the console I get that longer string mentioned above.
<matthewd>
I'm not sure why that's working at all, as the above indicates it's an array
<matthewd>
.first.unpack("H*") might go better
<twhitney11>
I thought the same thing, except instead of using .first I used [0] and I get "5b"
<twhitney11>
without the .first or the reference to the first index of the array I get ["5b22783121345c7830465c7845425c784441415c7841375c7846385c7844355c7842375c7839456a785c783036225d"] output to the console
<matthewd>
Hang on, now you're showing that as an array too
<matthewd>
How exactly are you printing these things?
<twhitney11>
right, and thats exactly how it prints to the console when I check the output
<twhitney11>
puts
Guest31598 is now known as CrazEd
CrazEd is now known as Guest41609
<matthewd>
Use `p` instead
<matthewd>
It sounds like you do, in fact, literally have a string that starts off with a square bracket and a quote, and contains several instances of a slash followed by an x
<twhitney11>
lol
<matthewd>
Can you look in the LDAP store directly / in some other tool, to confirm that's what's actually in the data?
naprimer_3 has joined #ruby
<twhitney11>
I can look up the GUID in a different tool, and it ends up displaying as 783121340fc3abc39a41c2a7c3b8c395c2b7c29e6a7806
<twhitney11>
I wonder if its net/ldap doing something strange with the objectguid
<matthewd>
Is "a different tool" looking at the raw LDAP database, or is it a custom thing that might be doing its own transform?
<twhitney11>
I'm using Apache Directory browser
<twhitney11>
but the native Active Directory users and computers shows that same number too
<twhitney11>
But I imagine those tools do do "something" to the data
pawnbox has joined #ruby
naprimer_2 has quit [Ping timeout: 260 seconds]
<marchelzo>
["x1!4\x0F\xEB\xDAA\xA7\xF8\xD5\xB7\x9Ejx\x06"] is valid json
<marchelzo>
ah wait that doesn't work how i thought it would lol
<marchelzo>
it just strips out the backslashses
<marchelzo>
backslashes, too
xall_ has joined #ruby
bkxd has joined #ruby
<marchelzo>
no idea where 783121340fc3abc39a41c2a7c3b8c395c2b7c29e6a7806 comes from tbh
mjuszczak has quit []
cschnei__ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
aupadhye has joined #ruby
cschneid_ has quit [Ping timeout: 246 seconds]
xall has joined #ruby
xall_ has quit [Ping timeout: 264 seconds]
<twhitney11>
!!!!!!!
<twhitney11>
got it
<twhitney11>
matthewd: your suggestion of it literally being a string with the square brackets and quotes didn't occur to me
<twhitney11>
of course, I could try to strip that stuff and still get rid of it
Ruby_Rocks_007 has left #ruby [#ruby]
<twhitney11>
but that seems dumb, I traced it back to the source, it seems that the array is populated with values from the LDAP directory as such result[index_result] = "#{value}"
<twhitney11>
so its interpolating the value as a string... not sure why
<twhitney11>
I modified the source, in my case I just threw a conditional in there that indicates if index_result is "guid" don't interpolate the string... then the unpack works as expect when I do .first.unpack("H*")
<twhitney11>
Much thanks to marchelzo and matthewd for the assistance. It definitely pushed me to the right direction.
tau has quit [Remote host closed the connection]
<matthewd>
Ah, okay. So yeah the original is really an array of the right form, but that thing was stringifying it.
<twhitney11>
exactly. I am unsure why the module I am using does the stringifying.
Mortomes|Train has joined #ruby
patarr has joined #ruby
<marchelzo>
does it really work?
resin has quit [Quit: leaving]
alan_w has quit [Quit: WeeChat 1.4]
<twhitney11>
yeah. I just took out the string interpolation for that one specific LDAP attribute.
sneakerhax has joined #ruby
<twhitney11>
I left it in for other attributes, as they are all strings, so I don't see any harm.
<marchelzo>
when i unpack that string i get 783121340febda41a7f8d5b79e6a7806
<twhitney11>
yes, thats exactly what I need.
<marchelzo>
what
<marchelzo>
i thought you needed 783121340fc3abc39a41c2a7c3b8c395c2b7c29e6a7806
<twhitney11>
oh wait. I better look closer....
<twhitney11>
and make sure, lol
<twhitney11>
damn you're right
<twhitney11>
but its closer now, seems like the endianness is just wrong
patarr has quit [Ping timeout: 240 seconds]
<matthewd>
That looks like a utf-8 mangling
jameser_ has joined #ruby
<matthewd>
The unpack result is 32 characters, which is the correct length of a uuid
jameser has quit [Remote host closed the connection]
mjuszczak has joined #ruby
<twhitney11>
so everything is working as expected, I copied and pasted the uuid before I ran it through that oracle endian conversion function
<twhitney11>
so what I expect to match is indeed matching
<twhitney11>
you guys are awesome
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<twhitney11>
the fact that it was literally a string with '"[]"' really threw me off
<twhitney11>
I really thought I was working with an array
<twhitney11>
I might be a ruby noob, but at least I wasn't crazy
<twhitney11>
I do wonder if trying to JSON route would have worked, I might play with it, but I think making sure the value comes in correctly is the best appraoch ahah
tdy has quit [Ping timeout: 260 seconds]
hanmac has quit [Remote host closed the connection]
chopin has quit [Remote host closed the connection]
pawnbox_ has joined #ruby
chopin has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
anisha has joined #ruby
tdy has joined #ruby
tildes has joined #ruby
<twhitney11>
* and they disappear into the fog *
<marchelzo>
twhitney11: im a ruby noob too
<marchelzo>
the folks here are very nice though
chopin has quit [Remote host closed the connection]
JoshS has quit [Ping timeout: 268 seconds]
James123 has joined #ruby
pulkit4tech has joined #ruby
<twhitney11>
Indeed they are very nice!
<twhitney11>
I should know better though, I'm embarassed to say I teach programming at the university levle.
maattdd has joined #ruby
<twhitney11>
Python and Perl.
<twhitney11>
and PHP.
<twhitney11>
Ruby is new territory though.
<jgnagy>
Ruby shouldn't feel too alien, coming from Python and Perl
<matthewd>
twhitney11: The takeaway is `p` / #inspect, over puts, when debugging values
<matthewd>
(which yeah, is just language knowledge.. like knowing to use repr in python)
rkazak has joined #ruby
<twhitney11>
mathewd: gotcha
<twhitney11>
jgnagy: not too foreign. I find it interesting that I don't need to explicitly return things
<jgnagy>
on the flip side, everything always returns something
<twhitney11>
I actually really like the block sytax using "end"
<jgnagy>
you might appreciate the ternary operator being the same as Perl too
<twhitney11>
jgnagy: yeah its neat, and makes it easy in conditionals to check if values are set. I've been using RubyMine from JetBrains, which sort of helps me be more "ruby-ish" I guess... because it yells at me whenever I explicitly return something, indicating to me that I don't need to do that
<jgnagy>
highly recommend getting used to the things rubocop yells at you about
<jgnagy>
will help you learn the closest thing to canonical Ruby
<twhitney11>
yes, I like the looks of the ternary operator too, easy to understand and quick and easy to use
<matthewd>
rubocop has many opinions
<jgnagy>
yes, I don't listen to everything it says
howdoi has joined #ruby
<twhitney11>
oh wow thats neat.
<jgnagy>
but enforcing code quality has its benefits
<twhitney11>
just run it in a director and bam it analyzes your code.
<jgnagy>
indeed
<matthewd>
For a bunch of trivial things, it'll even fix it for you
<jgnagy>
`rubocop -a` will even fix things for you
<twhitney11>
Thats nice.
<jgnagy>
not everything
<jgnagy>
yes, what he said
<jgnagy>
:)
<twhitney11>
Similar to "use warnings" in perl
MrBusiness has quit [Ping timeout: 258 seconds]
<twhitney11>
my students never use it, but Perl is forgiving and will run even if you do stupid things, so its nice to see what it tells you, i.e. you didn't use a variable named "nmae" because you actually called it "name"
<matthewd>
ruby has a -w too, which will catch some other things
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
linoge has joined #ruby
<matthewd>
(it's obviously process level, not scoped, though)
<twhitney11>
is there a community consensus for str.eql? "whatever" vs str == "whatever" ?
<matthewd>
==
<jgnagy>
most people tend to use ==
<linoge>
Hi, is there any way to skip a gem on a certain platform? Like, "when I'm using FreeBSD please do not attempt to install this particular gem"
solocshaw has joined #ruby
<linoge>
Without regenerating the Gemfile.lock? :-)
<twhitney11>
Ok. Coming from other languages I tend to use ==, but I've seen .eql? a lot in the codebase I'm working with
<jgnagy>
linage only on some platforms
<jgnagy>
not sure FreeBSD is among the list
linoge has quit [Client Quit]
<jgnagy>
that said, the Gemfile is evaluated as ruby
Guest41609 is now known as CrazEd
<jgnagy>
so if you can figure it out via the standard library + whatever bundler pulls in, I suppose you could do it that way
CrazEd is now known as Guest18357
<matthewd>
twhitney11: A quick grep shows Rails (just as an example project) has 5 calls to .eql?, two of which are inside an eql? definition, and the other 3 are all together, and I'm now looking at them suspiciously :)
mjuszczak has quit []
solocshaw has quit [Ping timeout: 246 seconds]
<dminuoso>
Oh yes, the Ruby world.
<twhitney11>
matthewd: The codebase I am working with is built on Rails
<dminuoso>
== vs === vs .eql? and .equal?
<twhitney11>
I wonder if its a Rails thing?
<dminuoso>
or super vs super()
<twhitney11>
or preference.
<dminuoso>
Keeping you on your toes.
<matthewd>
It's not a Rails thing
<twhitney11>
== vs === is the same in other languages. I call it ABSOLUTE equal to some of my students who don't quite get it.
<twhitney11>
truth vs truthy vs false vs falsey
<dminuoso>
twhitney11: The question on whether to prefer == or eql? has nothing to do with convention or preference, but intend.
<matthewd>
To me, I think it would read as an unusual accent
<dminuoso>
twhitney11: .eql? is for hash identity
<dminuoso>
twhitney11: .equal? is for object identity
<dminuoso>
twhitney11: and == is for generic equality
<dminuoso>
Use the one appropriate for its meaning.
<twhitney11>
even if they behave similarly?
<dminuoso>
twhitney11: Yes, because some other object at some point might not.
<matthewd>
"Similarly" is the key
<twhitney11>
or in many cased identically
<twhitney11>
I see, makes sense.
<matthewd>
e.g., 1.eql?(1.0) vs 1 == 1.0
<twhitney11>
yup.
<twhitney11>
I don't know if I can compare that to something else in a different language.
<dminuoso>
twhitney11: For example using === insead of is_a? is great.. until you suddenly have a regex in the game.
Mortomes|Train has quit [Ping timeout: 260 seconds]
_sfiguser has joined #ruby
<dminuoso>
Which suddenly shows why they are not the same and should not be used interchangbly
<dminuoso>
Even if it works for 95% of the cases, the rest 5% will cause you headaches and debugging sessions for no good reason.
<twhitney11>
dminuoso: perfect sense.
<twhitney11>
Thats a lot of things to check for various equality.
<dminuoso>
twhitney11: That's because "equality" has different meanings in different contexts.
<dminuoso>
twhitney11: The only thing that sucks is the way that ruby names these methods. ;-)
<twhitney11>
lol
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<twhitney11>
In Python I recommend folks write their own comparison methods.
<dminuoso>
twhitney11: Ruby has many of such traps by the way. I mentioned super vs super() before. There's some subtle but important difference between the two ;p
<twhitney11>
__cmp__ special method for objects
<twhitney11>
I'll have to Google the super example.
<matthewd>
IME, you generally only need to care about == and maybe === (which looks similar, but has very different semantics and behaviour, even for core classes); eql? is something you define but don't really call; equal? is handy if you really need it, but you very rarely do
<dminuoso>
twhitney11: super is a keyword, super() is a method. keyword_super passes all args *and* the given block, whereas super() does not.
<dminuoso>
which makes super surprisingly unpredictable if you are not aware of it.
<twhitney11>
I see. Well I've been mostly doing string comparisons in this project, so I haven't played around with all the other fancy stuff.
<twhitney11>
That reminds me of the "return" gotcha in JavaScript...
<matthewd>
super at least has the excuse of being a keyword
<twhitney11>
You're aware of the JS return gotcha?
<twhitney11>
super vs super() could really throw some people off, especially coming from Perl where you can omit the parenthesis in most cases
bocaneri has joined #ruby
bocaneri has quit [Max SendQ exceeded]
<matthewd>
twhitney11: No, I wasn't. But I don't think I would've ever put a newline there anyway :)
<twhitney11>
^ lol, I was curious because I recently threw the question on a test we used for hiring a few new developers in our area and it got all of them
<twhitney11>
I'd at least hoped they would try running the code. But yes, regardless, it seems an odd place to decide to put a newline.
xall has quit [Ping timeout: 240 seconds]
<matthewd>
twhitney11: Yeah, that's the trap: you can/do generally omit parens in ruby too; if super weren't a magical keyword, they would be essentially identical
<twhitney11>
I admit I had no idea of the gotcha until I was pulling questions for a candidate test and thought, a newline wouldn't make a difference would it? Then ran the code and found out.
<matthewd>
(not actually true: `foo` and `foo()` are identical *unless* you have a local variable named `foo` in scope)
<twhitney11>
hmm, that is quite the trap. I am surprised I haven't heard of anything similar in Perl.
<matthewd>
Perl *is* the syntax gotcha ;)
<twhitney11>
lol
<twhitney11>
well I guess technically speaking print "whatever" and print("whatever") ARE different
<matthewd>
$foo, @foo, and $foo[0], comes to mind too
hahuang65 has quit [Quit: WeeChat 1.5]
<twhitney11>
see that makes sense to me though
<twhitney11>
scalar representation vs. array representation
<matthewd>
I'd argue they all make sense, given the right context
<twhitney11>
yeah, I guess its all opinion and/or context
<twhitney11>
which is what it comes down to sometimes when choosing a language
rkazak has quit [Quit: Sleep.....ing....]
<twhitney11>
In some cases there is a clear 'right' choice of the language to use, but in other cases its whatever you know best
<matthewd>
Any deep system of "simple" rules will have a few complex edge cases where those simple rules come together in a perfectly predictable way, that creates a surprising-to-beginner result, because they're trying to rote learn the rule's results
<matthewd>
.. or something.
<twhitney11>
I think I followed that.
<twhitney11>
like the universe
brent__ has joined #ruby
mjolnird has joined #ruby
<twhitney11>
some experiment in some cases produces unexpected results
<twhitney11>
ew just weren't looking at the laws of physics right
<twhitney11>
.. or something.
<twhitney11>
In my case I chose Rails over a really grotesque looking Java application
conta has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
bocaneri has joined #ruby
<twhitney11>
Not sure why some people still insist on using Java for the web. Maybe its one of those preference things, but damn it just seems hard to work with and slow anytime I use anything resembling Java.
marcdel has quit [Ping timeout: 264 seconds]
brent__ has quit [Ping timeout: 240 seconds]
<dminuoso>
twhitney11: I have an example of why using either .equal? or .eql? can yield surprising results.
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
djbkd has quit [Ping timeout: 260 seconds]
andikr has joined #ruby
tildes has quit [Ping timeout: 260 seconds]
last_staff has joined #ruby
Qchmqs has joined #ruby
jdm has joined #ruby
<dminuoso>
matthewd: Well I guess what I really want is more type safety.
<dminuoso>
That's why I mentioned Crystal.
<dminuoso>
If I look at the bulk of my tests, I do plenty of whitebox testing where I ensure that proper types are passe.
<dminuoso>
*passed
Guest18357 is now known as CrazEd
<matthewd>
The type systems I find interesting tend to be strong on implicit coercion, but I guess a hard-line approach to float vs not-float still wouldn't be unreasonable there
CrazEd is now known as Guest98089
<matthewd>
(I don't know Crystal, beyond the highest level "it looks like ruby but is not ruby")
renchan has joined #ruby
<dminuoso>
matthewd: Ruby compiled to LLVM with static typing, with more consistencies. Most dynamic features are removed.
<dminuoso>
Though my recent development has started pushing me towards functional languages
<dminuoso>
Currently learning Haskell with Erlang on my list
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #ruby
<dminuoso>
matthewd: I think these dynamic features that Ruby have are not necessarily very wise. I mean the mere fact that the seond you require an external library you can no longer reason about *any* class, even your own, it's wrong.
<matthewd>
But handy ;)
<dminuoso>
matthewd: Well it allows you to solve problems while ignoring interfaces, dependency inversion, inheritance, etc.
<dminuoso>
Because you know, if it doesn't work, just sprinkle some instance_eval and Module#prepend -> and now it works.
DaniG2k has quit [Quit: Lost terminal]
<dminuoso>
That's like the abyss of Ruby metaprogramming ;)
nOwz has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
cschneid_ has joined #ruby
ss_much has quit [Quit: Connection closed for inactivity]
<matthewd>
jeyraof^mbpr: String#split may be what you're looking for
lenwood has joined #ruby
<dminuoso>
Is there any way to write a React component that gives a search interface for a rails model and displays the results in a paginated list?
Silthias has quit [Ping timeout: 240 seconds]
* dminuoso
eyeballs matthewd and hopes for a gist containing the solution
nOwz has joined #ruby
Silthias has joined #ruby
araujo has joined #ruby
<pwnd_nsfw>
string.split("::"
<pwnd_nsfw>
)
<pwnd_nsfw>
Is what he was offering
<pwnd_nsfw>
Oh
<pwnd_nsfw>
OH
mikecmpbll has quit [Quit: inabit. zz.]
<pwnd_nsfw>
ignore me
Silthias1 has quit [Ping timeout: 246 seconds]
DaniG2k has joined #ruby
<matthewd>
dminuoso: I know nothing about React, beyond the fact that react_on_rails is a thing that exists, I'm afraid
<dminuoso>
matthewd: And that's like a truly horrible.. engine? gem?
<matthewd>
As I understand it, it's a.. comprehensive, engine.. or gem.. or something.
<pwnd_nsfw>
"comprehensive?"
mark_66 has joined #ruby
maattdd has joined #ruby
xall has quit [Ping timeout: 268 seconds]
<matthewd>
"including or dealing with all or nearly all elements or aspects of something"
Burgestrand has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
marr has joined #ruby
gloscombe_ has quit [Quit: gloscombe_]
xall has joined #ruby
maattdd_ has quit [Ping timeout: 268 seconds]
mikecmpbll has joined #ruby
brent__ has joined #ruby
baweaver has joined #ruby
conta has joined #ruby
nOwz has quit [Ping timeout: 240 seconds]
esObe_ has joined #ruby
brent__ has quit [Ping timeout: 240 seconds]
conta has quit [Ping timeout: 268 seconds]
maattdd_ has joined #ruby
byte512 has joined #ruby
jsrn_ has joined #ruby
<dminuoso>
matthewd: Well it's junk because it addresses problems in the wrong way.
<dminuoso>
matthewd: It's like "hey you are jealous of all these react, webpack and redux folks? you dont need to understand how anything works, you can just get started instead"
<dminuoso>
"And because we control everything for you, you are pinned to a specific rails, webpack, redux and react version"
maattdd__ has joined #ruby
govg has quit [Ping timeout: 240 seconds]
nOwz has joined #ruby
govg has joined #ruby
<jokke>
hi
<jokke>
anyone know what's going on here? cannot load such file -- rspec/matchers/built_in/be_kind_of
<jokke>
i only have this error on our ci
maattdd has quit [Ping timeout: 246 seconds]
tomphp has joined #ruby
<jokke>
so i suspect some minor version differences
cfec0b8d has joined #ruby
DaniG2k has quit [Quit: leaving]
blackwind_123 has quit [Ping timeout: 268 seconds]
<jokke>
it occurs at a be_a expectation
biberu has joined #ruby
maattdd has joined #ruby
Guest62150 is now known as CrazEd
CrazEd is now known as Guest90023
maattdd__ has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
cibs has quit [Ping timeout: 258 seconds]
pawnbox has quit [Remote host closed the connection]
Beams has joined #ruby
stamina has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
cibs has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
__Yiota has joined #ruby
Snickers has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
john3 has quit [Ping timeout: 240 seconds]
Beams has quit [Quit: .]
boshhead has quit [Ping timeout: 258 seconds]
hotpanca_ has quit [Remote host closed the connection]
hotpancakes has joined #ruby
hotpancakes has quit [Remote host closed the connection]
<dminuoso>
jokke: That seems to be an incomplete stacktrace
<jokke>
but no luck
<jokke>
hm it's the one i got from rspec
<dminuoso>
jokke: Run rpsec with -b
patarr has joined #ruby
<jokke>
i can only reproduce this on the ci
<jokke>
i even rebundled
<jokke>
removed all bundled gems and rebundled to see if it's a version issue
<dminuoso>
jokke: you can add "-b" or "--backtrace" to your .rspec file
<dminuoso>
then the ci will respect that
<jokke>
yeah
<jokke>
i'll do that
jeyraof^mbpr has quit [Quit: This computer has gone to sleep]
<dminuoso>
jokke: Note the thing I would be looking at is version numbers of shoulda_matchers inside your ci chain compared to with what you have locally (from your Gemfile.lock)
<jokke>
mhm ok
<dminuoso>
or well, this is not shouda_matchers I think
<dminuoso>
rspec
<jokke>
yeah it's builtin matchers
<dminuoso>
Idea is the same though
<jokke>
yep
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
boshhead has joined #ruby
<jokke>
on ci: rspec-core-3.5.4/ rspec-expectations-3.5.0/ rspec-mocks-3.5.0/ rspec-support-3.5.0/
<dminuoso>
jokke: Is that from the stacktrace?
<jokke>
no i'm still running the tests
<jokke>
it takes a while
<dminuoso>
jokke: Yeah I'd hold my pants, even for the versions.
patarr has quit [Ping timeout: 256 seconds]
<jokke>
ok :)
<jokke>
ok weird...
<dminuoso>
Weird because suddenly the stacktrace shows different versions?
<jokke>
on the ci i have no gem rspec
<dminuoso>
If so I get a cookie
<dminuoso>
Hah.
kolaman has quit [Ping timeout: 246 seconds]
<dminuoso>
jokke: If there no rspec in your Gemfile?
<jokke>
only the ones i posted above
<dminuoso>
If so we have found the issue.
<jokke>
sure is
<dminuoso>
Available in the same bundle group that your ci uses?
<jokke>
yes
<jokke>
test
<dminuoso>
jokke: Oh the lack of an "rspec" gem is not surprising
<dminuoso>
I think "rspec" is just a meta gem anyway
<dminuoso>
Or is this Ruby's autoloader kicking in?
<dminuoso>
Im unsure.
<jokke>
AH!
<jokke>
works!
<jokke>
clearing the cache did the trick
<jokke>
go figure
<dminuoso>
jokke: gitlab runner?
<jokke>
no
<jokke>
strider
<dminuoso>
brave
<jokke>
very...
<jokke>
it plays nice with our ancient gitlab version
<dminuoso>
jokke: We just decided to move everything into hosted gitlab
<jokke>
dminuoso: i can totally relate
<jokke>
but for me gogs would be another option
<dminuoso>
Why? Are you afraid a db admin is gonna DROP DATABASE and all your repos are gone?
<jokke>
seems promising. even though i don't like go
* dminuoso
smiles
astrobunny has quit [Ping timeout: 260 seconds]
kolaman has quit [Ping timeout: 260 seconds]
Silthias1 has joined #ruby
<jokke>
no but our policy is not to host our code externally
Silthias has quit [Ping timeout: 240 seconds]
<dminuoso>
jokke: Yeah, we are ISO 27001 certified so it wasn't exactly an easy sell.
<jokke>
wow ok
conta has joined #ruby
<jokke>
it's way cheaper though :D
<dminuoso>
Cheaper than what?
<jokke>
than hosting yourself
<dminuoso>
Oh yeah.
<jokke>
the maintanence..
Silthias has joined #ruby
<dminuoso>
jokke: And indirectly that was a security argument too.
<jokke>
oh jeez the maintanence
<jokke>
yeah
<dminuoso>
jokke: But in the end it was "either we give the source code to the NSA, or we keep it in our own infrastructure so the russians and chinese can get it too"
<dminuoso>
In a nutshell.
<jokke>
:D
<jokke>
i see
<jokke>
you from europe?
<dminuoso>
Yeah.
<jokke>
germany?
<dminuoso>
Indeed.
<jokke>
heh
<jokke>
i figured. i think only germans have the obsessive need to host everything themselves
<dminuoso>
Just like you, based on your nickname and the host of your pasties.
govg has quit [Ping timeout: 260 seconds]
<jokke>
yes
<jokke>
well half
<jokke>
i'm half finnish
<jokke>
3/4 even ;)
<dminuoso>
That makes you a conservative alcoholic.
<jokke>
:D
<dminuoso>
11:22 < jokke> i figured. i think only germans have the obsessive need to host everything themselves
<dminuoso>
^- and its idiotic too.
<jokke>
yeah
Silthias1 has quit [Ping timeout: 264 seconds]
<surrounder>
jokke: not really, the swiss do it too
xall has quit [Ping timeout: 260 seconds]
<dminuoso>
I mean its not like we push customer data into gitlab.
<dminuoso>
So
<surrounder>
probably to not have their data in the EU
<dminuoso>
From that perspective its just source code which is not crticial
<dminuoso>
It's just IP
<jokke>
surrounder: haha true
<dminuoso>
jokke: In the end ISO 27001 basically wants to keep customer data safe.
<dminuoso>
So it's kind of compatible actually
<jokke>
yes
<jokke>
is it compatible if your customer owns the code?
<dminuoso>
(Technically its not true, but source code is not our business)
<dminuoso>
jokke: We own the code.
<jokke>
we sometimes don't
<dminuoso>
Right, then that's an issue.
<dminuoso>
jokke: Though gitlab has dedicated hosting for such customers.
<dminuoso>
such customers as yourself I mean
<jokke>
dminuoso: where're you at btw? we need skilled ruby devs badly :)
<dminuoso>
Wolfsburg
<jokke>
hm ok
<dminuoso>
Let me guess
<dminuoso>
Munich?
<jokke>
naah
<jokke>
Frankfurt
<dminuoso>
Close.
<dminuoso>
Almost same thing.
<jokke>
:D
<jokke>
no?
<dminuoso>
Bingo. Triggered.
<jokke>
Noone wants their city to be compared with munich
<dminuoso>
Munich is an awesome city
<jokke>
or anything in bavaria really
<dminuoso>
rental costs aside
<manveru>
heh, we actually have github enterprise because of privacy... also germany
xall has joined #ruby
<jokke>
many germans here
<dminuoso>
manveru: is it possible to define the hosting location?
<dminuoso>
Or can you provide your own physical hosting even?
banandana has quit [Ping timeout: 255 seconds]
<manveru>
yeah, we host it in our datacenters
<dminuoso>
Oh that's neat.
cyphase has quit [Ping timeout: 240 seconds]
<manveru>
frankfurt atm, but moving to amsterdam
<jokke>
manveru: ooooh!
<jokke>
manveru: no you won't!
<jokke>
manveru: we've got a job for you!
<jokke>
:)
<surrounder>
manveru: yay welcome from us swamp germans ;)
jenrzzz has quit [Ping timeout: 240 seconds]
cyphase has joined #ruby
<jokke>
surrounder: youre dutch?
<manveru>
i won't, just our DC
<surrounder>
ah
<surrounder>
jokke: yes
<jokke>
i guess this is europe 'o clock after all
<manveru>
i'm also in bavaria
ych has quit [Ping timeout: 260 seconds]
<dminuoso>
Brilliant. I just understood the Riemann series theorem.
<dminuoso>
Perhaps I should study maths ;o
tlaxkit has joined #ruby
minimalism has quit [Quit: minimalism]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
Beams has joined #ruby
Beams has quit [Client Quit]
esObe__ has joined #ruby
ferr1 has joined #ruby
hotpancakes has joined #ruby
esObe_ has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
banandana has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
dionysus70 is now known as dionysus69
hotpanca_ has quit [Ping timeout: 246 seconds]
antgel has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tvw has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
arooni has joined #ruby
^Denis has joined #ruby
saneax is now known as saneax-_-|AFK
pawnbox has quit [Ping timeout: 264 seconds]
Hobbyboy has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
shinnya has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
teclator has quit [Ping timeout: 258 seconds]
naprimer_2 has joined #ruby
govg has joined #ruby
^Denis has quit [Quit: Changing server]
naprimer_3 has quit [Ping timeout: 246 seconds]
certainty has quit [Ping timeout: 260 seconds]
Hobbyboy has joined #ruby
raspado has joined #ruby
Burgestrand has quit [Quit: Closing time!]
^Denis has joined #ruby
agent_white has quit [Quit: leaving]
agent_white has joined #ruby
MarcWeber has joined #ruby
<MarcWeber>
Is it possible to send html page pratially - wait - then continue eg using Sinatra?
sepp2k has joined #ruby
<MarcWeber>
Is Rack able to do it ?
<dminuoso>
MarcWeber: Yes.
dionysus69 has quit [Ping timeout: 268 seconds]
<dminuoso>
MarcWeber: It's called chunked encoding.
safetypin has joined #ruby
hotpancakes has joined #ruby
Qchmqs has quit [Read error: Connection reset by peer]
safetypin has quit [Client Quit]
nobitanobi has joined #ruby
tyang_ has joined #ruby
dionysus69 has joined #ruby
Beams has quit [Quit: .]
<agent_white>
Mornin' folks
tyang has quit [Ping timeout: 256 seconds]
<cout>
oh man I feel old -- I just tried to call a method that apparently got removed between ruby 1.8 and 1.9
<cout>
anyone know what the fastest alternative is to Array#nitems ?
<cout>
the changelog says to use count {|i| !i.nil?} but without benchmarking I have a feeling that's slower than nitems was due to the block
<leah2>
x.size - x.count(nil) ?
tyang__ has joined #ruby
<matthewd>
cout: My first guess would be ^
<cout>
leah2: oh nice
<matthewd>
leah2 was too fast for me
<leah2>
;)
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leah2>
should be constant space and linear time
<matthewd>
.. but for readability, I'd probably first write .compact.size, unless perf actually-really mattered
<matthewd>
(and if it does, is this really a hotspot processing different arrays each time? If nils are undesirable, why can't they be pre-emptively compacted?)
<leah2>
i dont think i ever used nitems
<cout>
matthewd: yeah it's a hot loop
aganov has quit [Remote host closed the connection]
tyang_ has quit [Ping timeout: 256 seconds]
<cout>
whoa
<cout>
.compact.size is faster than .count(nil)
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cout>
(for an array of 10 elements; might be slower for larger arrays, but 5-10 is my use case)
<matthewd>
Ah, the count is probably calling #==(nil), whereas compact will be doing a straight C nil check
Beams has joined #ruby
<matthewd>
So the cost of the allocation is lower than the call overhead, even with relatively little to do
<pwnd_nsfw>
first plugin to write in new irc bot: plugin reloader
ozcanesen has joined #ruby
<pwnd_nsfw>
lol
Fernando-Basso has joined #ruby
hotpancakes has quit [Ping timeout: 246 seconds]
<matthewd>
compact! may be even better, if you're allowed to mutate these arrays
millerti has joined #ruby
<cout>
matthewd: yeah, it has to fall back on #== if the array element is non-nil
<cout>
matthewd: I can get away with just using count() since I don't care about false
anisha has quit [Quit: Leaving]
chopin has joined #ruby
Silthias has joined #ruby
<cout>
er nm, I was reading rb_ary_count wrong -- saw the RTEST and got all excited
<matthewd>
count(&:itself) could be an option too
Silthias2 has quit [Ping timeout: 240 seconds]
<pwnd_nsfw>
cinch isn't making it easy for me to write this plugin handler D:
<cout>
matthewd: is that a rails thing?
<matthewd>
No, it's a recent ruby thing (2.3? 2.4?)
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
nOwz has quit [Ping timeout: 264 seconds]
<cout>
count(&:nil?) would be more direct
cschneid_ has joined #ruby
<matthewd>
Yes, but that's the opposite of what you want, so then you have to do the subtraction too
<matthewd>
Obviously its worth throwing anything plausible into the benchmark if you really want the fastest for your situation
<cout>
oh right I had it backward
flying has quit []
<cout>
I don't really want nitems, I just figured that would be the fastest way to implement a.any? { |i| i.nil? }
<leah2>
use .find?
<leah2>
.index
yeticry has joined #ruby
<matthewd>
`a.all?`
<leah2>
actally .all? yeah
patarr has joined #ruby
<leah2>
.all? without block
<cout>
.all? without a block is still slower than compact/compact!
<leah2>
oO
swills has quit [Quit: Leaving]
<leah2>
perhaps because it uses enumerable?
jaruga__________ has quit [Ping timeout: 260 seconds]
<leah2>
compact is very tight
<leah2>
it uses dup.compact!, which just shifts the array elements and shortens
<matthewd>
I can sort of believe that 'RTEST(x)' is technically slower than 'x != Qnil', but I'm very surprised that's not outweighed by the mutations / allocation
<leah2>
.all calls .each...
<leah2>
compact directly for-loops
nofxx has joined #ruby
<matthewd>
Oh, right, because all? is on enumerable, whereas compact is on array
<matthewd>
I still suspect there's a higher level change that'd be a stronger algorithmic gain
<cout>
matthewd: I already made all those changes
<matthewd>
.. or even upgrading to 2.3/2.4 is likely to gain more than the difference between half of these
<cout>
matthewd: now I'm modifying code that was optimized and I'm trying to avoid making it slower
igniting has joined #ruby
<matthewd>
(also, without checking, I think splat is slowish, so your bench might be skewed a bit there)
<baweaver>
2.3 -> 2.4 had some massive gains on hash perf
<leah2>
hm, how can while be so fast
<cout>
upgrading to 1.9.3p484 from 1.9.3p0 was like pulling teeth; it's a miracle were even on 2.1 now :(
safetypin has joined #ruby
<cout>
good point about splat; I'm not sure why the interface uses it
<matthewd>
I'm not sure I'd trust 1.8/1.9 era line-by-line optimization to hold true. Though I acknowledge "reset to the simple spelling and re-optimize" is somewhat easier said than done :)
Xentil has joined #ruby
wickedbloodfart has joined #ruby
brent__ has joined #ruby
<leah2>
hm, i guess bench_while turns into no method calls at all at runtime
<cout>
right
<leah2>
interesting. i dont have much yarv intution :)
theRoUS has quit [Changing host]
theRoUS has joined #ruby
conta has quit [Ping timeout: 260 seconds]
<cout>
that's probably even more significant in the code I'm working on, which destroys the global method cache as an optimization
mark_66 has quit [Remote host closed the connection]
<leah2>
ugh ;)
Beams has quit [Quit: .]
lxsameer has quit [Quit: WeeChat 1.5]
SteenJobs has quit [Quit: SteenJobs]
safetypin has quit [Quit: ZZZzzz…]
tau has joined #ruby
amclain has joined #ruby
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
chouhoulis has quit [Remote host closed the connection]
wickedbloodfart has quit [Quit: wickedbloodfart]
wickedbloodfart has joined #ruby
Silthias1 has quit [Ping timeout: 246 seconds]
Ruby_Rocks_007 has joined #ruby
certainty has joined #ruby
ddffg has joined #ruby
tvw has quit [Ping timeout: 246 seconds]
j2k has joined #ruby
username1 has joined #ruby
kinduff has joined #ruby
roadrunneratwast has joined #ruby
SteenJobs has joined #ruby
<leah2>
cout: have benchmark results for 1.8 btw?
nowhere_man has quit [Ping timeout: 240 seconds]
swills has joined #ruby
<roadrunneratwast>
Hi Rubyistas. I am learning ruby now with the Michael Hartl tutorial. I am roughly here. The error output from the 'rails test' is "ActionController::RoutingError: uninitialized constant Static" which doesn't look like the expected error message. Is this okay?
<cout>
apeiros: yeah I know I didn't make them all have the same result
<apeiros>
oh wow, .include? is the slowest. what the actual fuck?
<dminuoso>
the last time you actual fucked trump became president, apeiros.
<apeiros>
ok, no, count nil and index are slower. but still…
<dminuoso>
You putting this on the same level?
<apeiros>
no
<apeiros>
trump is a world class fuckup
<apeiros>
but that's OT
<dminuoso>
%s/actual fuck/minor fuck/
<dminuoso>
then
Suslo has joined #ruby
<dminuoso>
=P
hanmac has joined #ruby
<apeiros>
you're conflating level of surprise and impact
<dminuoso>
Heh
Suslov_ has joined #ruby
Suslov_ has quit [Client Quit]
<SeepingN>
touché
<dminuoso>
I sometimes also inflate things.
Suslov has quit [Ping timeout: 264 seconds]
<SeepingN>
here it comes
A124 has quit [Quit: '']
<apeiros>
you're a non-swimmer?
Ruby_Rocks_007 has joined #ruby
A124 has joined #ruby
<dminuoso>
apeiros: That's the excuse I use when I have friends at home.
gusrub has quit [Remote host closed the connection]
<apeiros>
btw., anybody else going to rubyconf bohol next week?
hotpancakes has quit [Ping timeout: 246 seconds]
Suslo has quit [Ping timeout: 240 seconds]
nofxx has quit [Ping timeout: 240 seconds]
szulak_ has joined #ruby
<SeepingN>
I was waiting for a reference to an inflatable girlfriend. lol
<apeiros>
I think what he said last accounts as one
hotpanca_ has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xen0fon has quit [Ping timeout: 260 seconds]
<cout>
seepingN: I thought of airplane the movie
<SeepingN>
hehehehe
rkazak_ has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
xall has joined #ruby
gloscombe_ has joined #ruby
tlaxkit has quit [Quit: ¡Adiós!]
akkad has quit [Excess Flood]
roadrunneratwast has joined #ruby
<roadrunneratwast>
: Hi Rubyistas. I am learning ruby now with the Michael Hartl tutorial. I am roughly here. e https://www.railstutorial.org/book/static_pages#code-about_route The error output from the 'rails test' is "ActionController::RoutingError: uninitialized constant Static" which doesn't look like the expected error message. Is this okay?
ss_much has joined #ruby
akkad has joined #ruby
gusrub has joined #ruby
sonOfRa has quit [Quit: Bye!]
sonOfRa has joined #ruby
<apeiros>
?code roadrunneratwast
<ruby[bot]>
roadrunneratwast: We can't help you without your code, please post it to https://gist.github.com
<apeiros>
also #rubyonrails is probably better suited for this question ;-)
<mwlang>
I thought about just simply renaming that #to_i to something more obvious like #to_i_unless_nil, but uhmmm…that’s long-winded and still feels inelegant.
nowhere_man has joined #ruby
<baweaver>
and patching String for every library that might expect Integer 0 is?
<dminuoso>
mwlang: Perfectly fine.
<dminuoso>
Tis ruby.
montanonic has joined #ruby
<mwlang>
point is, I want to remove String#to_i override from this Rails app…but just renaming it seems to fall short to my sensibilities.
synthroid has quit []
<mwlang>
it’s not really something I ever would’ve thought to write myself…I guess I’d rather be explicit in the code itself, but they’re doing this everywhere there’s a dropdown selector in the views.
<dminuoso>
Haha
<dminuoso>
If only I had a blog.
<mwlang>
so I don’t necessarily want to add a bunch more Ruby to the view templates.
<dminuoso>
mwlang: This is thedailywtf worthy.
gloscombe_ has quit [Read error: Connection reset by peer]
<mwlang>
dminuoso: and I seriously doubt it falls off the top ten before end of year.
<mwlang>
I need a break to clear my head…this code base has twisted my clear thinking skills into a tight knot.
djbkd has quit [Remote host closed the connection]
<Disavowed>
I'm using rspec with guard and the latter is creating an empty directory called tmp in the root of my project. This doesn't happen when I run rpsec without guard. Anyone have any pointers on where to look to fix it? It's mildly irritating!
djbkd has joined #ruby
GinoManWorks has quit [Quit: Leaving]
dionysus69 has quit [Quit: dionysus69]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
zeroDi has quit [Quit: WeeChat 1.7]
nobitanobi has quit [Remote host closed the connection]
tildes has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
nowhere_man has quit [Quit: Konversation terminated!]
pulkit4tech has joined #ruby
nowhere_man has joined #ruby
djbkd has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
nowhere_man has quit [Remote host closed the connection]
renchan has quit [Remote host closed the connection]
hotpancakes has quit [Remote host closed the connection]
<Disavowed>
mwlang: Thank you so much! It looks like guard-rspec is trying to generate some sort of report there. It'd have taken me ages to narrow that down, so thank you so much!
nobitanobi has quit [Ping timeout: 240 seconds]
nofxx has joined #ruby
biberu has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
<mwlang>
Disavowed: you’re welcome. bundle open <gemname> is your friend.
ddffg has joined #ruby
toretore has quit [Quit: Leaving]
<Disavowed>
I can't get it to work - what should it do?
safetypin has quit [Quit: ZZZzzz…]
akkad has quit [Excess Flood]
akkad has joined #ruby
byte512 has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 240 seconds]
StevenStulu has quit [Read error: Connection reset by peer]
StevenStulu has joined #ruby
StevenStulu has quit [Client Quit]
tyang_ has joined #ruby
StevenStulu has joined #ruby
StevenStulu has quit [Client Quit]
TvL2386 has quit [Ping timeout: 240 seconds]
StevenStulu has joined #ruby
StevenStulu has quit [Client Quit]
pliniker has quit [Ping timeout: 255 seconds]
Ruby_Rocks_007 has joined #ruby
pawnbox has joined #ruby
tyang__ has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
conta has joined #ruby
tildes has joined #ruby
pawnbox has quit [Ping timeout: 256 seconds]
<mwlang>
Disavowed: not sure…what was the error?
<jnoob22>
dunno if anyone has benchmarked specifically python and ruby scripts but I'm finding ruby scripts to run almost 2-3x faster. Anyone else see that?
tildes has quit [Ping timeout: 260 seconds]
<jnoob22>
I'm originally a Python guy (who is forced to do Java for a living). I am astonished. But, maybe my tests are flawed, who knows.
EV3RYDAYPR0GRESS has quit [Read error: Connection reset by peer]
<nofxx>
jnoob22, ruby has a myth of slowless.. that was ages ago, it's faster than python and php
<jnoob22>
Even more so is that I can't find many sites proclaiming this sort of thing.
EV3RYDAYPR0GRESS has joined #ruby
<jnoob22>
nofxx, tending to agree. I remember 1.9.3 being very fast but thought maybe there was something seriously wrong with my bm tests a year and a half ago.
<Disavowed>
mwlang: Could not find gem 'guard (~> 2.13.0)' in any of the gem sources listed in your Gemfile.
<havenwood>
jnoob22: Ruby's modern VM is much faster than its previous interpreter in Ruby 1.8 and earlier.
<nofxx>
jnoob22, also benchmarks are kinda useless in a sense.... machines are fast. I prefer human benchmarks... and in that, ruby beats C and Java =D
<jnoob22>
nofxx, yeah everything beats Java when you have to run maven on a large set of code ;-)
<Disavowed>
mwlang: I don't mind so much, I'm sure I've just done something stupid with chruby or something - I'm just curious as to the purpose of bundle open <gemname>, but I can look it up. Thanks for your help!
<jnoob22>
havenwood, I was wondering where the version cutoff was ... you think <1.8 was somewhat slow, I take it.
<jnoob22>
tbh, I did not know Ruby in the pre 1.9 versions.
nOwz has joined #ruby
<Disavowed>
mwlang: Oh! I've been opening Pry, getting the file attribute of a method, copying it to my clipboard and opening it in a new tmux pane! You've saved me that production! Thank you!
<mwlang>
Disavowed: sounds like you just figured it out…
<jnoob22>
I have always liked it for writing os/systems type stuff.... more elegant than perl, more functional than bash
<havenwood>
jnoob22: Ruby continues to get faster. There are also alternate implementations with much promise.
James123 has quit [Quit:]
<jnoob22>
going through the Rails tutorial for the 2nd time. Makes more sense to me now