gusrub_ has quit [Remote host closed the connection]
bayed has quit [Quit: Connection closed for inactivity]
gusrub_ has joined #ruby
Immune has quit [Ping timeout: 260 seconds]
allcentury has joined #ruby
<alexandernst>
I have a method that expects "something" and then it does "something.id". I want to test (rspec) that method, but I don't want to create a new "something" object. Is there some (very short) way to fake that object so the method could still access the ".id" attr?
<xavier2>
What's the most widely accepted opinion on the `unless` keyword?
<tobiasvl>
it's readable?
mBailey_j has quit [Ping timeout: 246 seconds]
<eam>
it starts with the letter u
<ineb>
alexandernst: you want to test a method on an object without creating the object? why?
<xavier2>
I find it easy to read but people say that you have to read until the end of the line to notice it which is the only weak point I can find
<alexandernst>
ineb: I want to test the method itself. I don't care about the object and it's it (it could pretty much be '1')
<alexandernst>
s/it/id/
<xavier2>
I know I've seen my fair share of pitchforks using it in another language, just wanted to make sure I didn't oppress anyone here
<ineb>
alexandernst: then mock it. allow(object).to receive(:id) { 1 }
bronson_ has quit [Read error: Connection reset by peer]
Felipe__ has quit [Quit: Leaving]
mikhael_k33hl has joined #ruby
nahra has quit [Read error: Connection reset by peer]
jhn has joined #ruby
nahra has joined #ruby
nofxx has quit [Read error: Connection reset by peer]
<mikhael_k33hl>
Hello, I am writing a ruby script/program invoking linux rsync processes to copy files from a remote host. I would just like to ask for any advice/suggestion or anything on how do I test it before deploying it on production to make sure it is working?
CausaMortis has quit [Ping timeout: 252 seconds]
AlexRussia has joined #ruby
Felipe__ has joined #ruby
d3d1rty has quit [Ping timeout: 244 seconds]
_sfiguser has joined #ruby
Felipe__ has quit [Remote host closed the connection]
jackjackdripper has quit [Quit: Leaving.]
jcao219 has quit [Ping timeout: 240 seconds]
gusrub_ has quit [Remote host closed the connection]
enterprisey has joined #ruby
xlegoman has joined #ruby
AlexRussia has quit [Ping timeout: 265 seconds]
whathappens has quit [Remote host closed the connection]
millerti has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
_djbkd has quit [Quit: My people need me...]
MrBusiness has joined #ruby
zukin has joined #ruby
MrBusiness is now known as Guest89253
skweek has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ruby
Felipe__ has joined #ruby
Felipe__ has quit [Remote host closed the connection]
splud has quit [Ping timeout: 260 seconds]
sneakers has quit [Read error: Connection reset by peer]
tau has quit [Remote host closed the connection]
<agent_white>
Cross your fingers!
solocshaw has joined #ruby
AlexRussia has quit [Ping timeout: 240 seconds]
fmcgeough has joined #ruby
jcao219 has joined #ruby
splud has joined #ruby
hahuang61 has quit [Ping timeout: 260 seconds]
johnmccabe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 260 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
honore has quit [Quit: zzz]
Channel6 has joined #ruby
Littlemyu has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bovis>
mikhael_k33hl: test how it interacts with various locations, such as a user's home directory or a system root file, which the user shouldn't be able to access
<bovis>
What happens when you try to copy nothing from the remote host?
<bovis>
Does it preserve/remove permissions like you want it to?
<bovis>
*system root directory
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ajsharma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
izaac has quit [Ping timeout: 258 seconds]
<bovis>
Come at it with the mindset: I want to break this app. Then see if you can
enterprisey has quit [Ping timeout: 258 seconds]
izaac has joined #ruby
enterprisey has joined #ruby
whiteline has joined #ruby
mipesom has quit [Ping timeout: 244 seconds]
astrobunny has joined #ruby
wpostma1 has joined #ruby
mipesom has joined #ruby
<bovis>
mikhael_k33hl: Hand it off to other willing test users to have them break it for you.
fmcgeough has quit [Quit: fmcgeough]
AlexRussia has joined #ruby
<mikhael_k33hl>
bovis: Yeah, I guess I'll have to create unit/functional test then run it for acceptance testing
GodFather has quit [Ping timeout: 268 seconds]
<bovis>
mikhael_k33hl: Those kinds of tests will be useful in making future changes.
chris349 has quit [Ping timeout: 256 seconds]
<mikhael_k33hl>
bovis: yep, guess the only way to make sure that it runs as intended is to actually run it of course hehe, stupid me
<mikhael_k33hl>
:D
nankyokusei has joined #ruby
watersoul_ has joined #ruby
AlexRussia has quit [Ping timeout: 246 seconds]
vondruch_ has joined #ruby
d3d1rty has joined #ruby
whathappens has joined #ruby
vondruch has quit [Write error: Broken pipe]
bovis has quit [Write error: Broken pipe]
watersoul has quit [Write error: Broken pipe]
matp has quit [Excess Flood]
wnd has quit [Excess Flood]
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wnd has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nofxx has joined #ruby
DroidBurgundy has quit []
jenrzzz has quit [Ping timeout: 245 seconds]
matp has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
mikhael_k33hl has quit [Quit: Page closed]
bovis has joined #ruby
enterprisey has quit [Quit: Leaving]
blackwind_123 has quit [Ping timeout: 260 seconds]
jhack has joined #ruby
Olipro has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
blackwind_123 has joined #ruby
Olipro has quit [Excess Flood]
mikecmpbll has quit [Quit: inabit. zz.]
fmcgeough has joined #ruby
Olipro has joined #ruby
p0p0pr37 has quit [Changing host]
p0p0pr37 has joined #ruby
jhack has quit [Client Quit]
kyle__ has quit [Quit: WeeChat 1.6]
kyle has joined #ruby
d^sh has quit [Ping timeout: 258 seconds]
kyle is now known as kyle__
brent__ has quit [Quit: Connection closed for inactivity]
d3d1rty has quit [Ping timeout: 265 seconds]
d^sh has joined #ruby
wpostma1 has quit [Ping timeout: 256 seconds]
Eiam has quit [Ping timeout: 268 seconds]
Robtop__ has joined #ruby
Rickmasta has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 256 seconds]
pwnd_nsfw has joined #ruby
wpostma1 has joined #ruby
dhollinger has quit [Quit: WeeChat 1.0.1]
jhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dhollinger has joined #ruby
zukin has quit [Ping timeout: 240 seconds]
vikaton has quit [Quit: Connection closed for inactivity]
Robtop__ has quit [Ping timeout: 240 seconds]
dhollinger has quit [Client Quit]
zukin has joined #ruby
dhollinger has joined #ruby
zukin has quit [Client Quit]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
ur5us has quit [Remote host closed the connection]
solocshaw has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
alxgsv has joined #ruby
AlexRussia has joined #ruby
Satyajit has joined #ruby
freedrull has quit [Remote host closed the connection]
cdg has joined #ruby
ajsharma has joined #ruby
solocshaw has joined #ruby
zel has joined #ruby
pawnbox has joined #ruby
zel is now known as Guest1564
AlexRussia has quit [Ping timeout: 268 seconds]
optiz0r has quit [Ping timeout: 245 seconds]
fmcgeough has quit [Quit: fmcgeough]
cdg has quit [Read error: Connection reset by peer]
cdg has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
phaza_ has joined #ruby
solocshaw has quit [Ping timeout: 260 seconds]
phaza has quit [Ping timeout: 250 seconds]
railssmi_ has joined #ruby
blackwind_123 has quit [Ping timeout: 260 seconds]
axisys has quit [Ping timeout: 244 seconds]
railssmi_ has quit [Client Quit]
solocshaw has joined #ruby
railssmith has quit [Ping timeout: 258 seconds]
blackwind_123 has joined #ruby
whathappens has quit [Remote host closed the connection]
solocshaw has quit [Ping timeout: 258 seconds]
charliesome has joined #ruby
hanmac has joined #ruby
ledestin has quit [Read error: Connection reset by peer]
splud has quit [Quit: splud]
pilne has quit [Quit: Quitting!]
marr has quit [Ping timeout: 265 seconds]
optiz0r has joined #ruby
astrobunny has quit [Remote host closed the connection]
mikhael_k33hl has joined #ruby
phaza_ has quit [Read error: Connection reset by peer]
phaza has joined #ruby
blackwind_123 has quit [Ping timeout: 260 seconds]
vikaton has joined #ruby
blackwind_123 has joined #ruby
harai_ has quit [Ping timeout: 240 seconds]
byte512 has quit [Ping timeout: 246 seconds]
hightower3 has joined #ruby
<mikhael_k33hl>
Anyone know of a more comprehensive documentation for MiniTest?
AlexRussia has joined #ruby
Olipro has quit [Ping timeout: 260 seconds]
Immune has joined #ruby
<nofxx>
mikhael_k33hl, you'll probably find some blogs around, but it's really just ruby
<nofxx>
that's kinda the point and the 'mini' in the name... there's ain't much ;)
<mikhael_k33hl>
nofxx: so you're saying i'm better off using rspec?
<nofxx>
nope, both are great
wpostma1 has quit [Ping timeout: 252 seconds]
<mikhael_k33hl>
nofxx: okay, i'll give it a try
<mikhael_k33hl>
nofxx: fairly new to ruby though
<nofxx>
mikhael_k33hl, yeah, go with minitest to start... check out rspec later... thought I was the only one that starts a language looking for tests hehe
AlexRussia has quit [Ping timeout: 260 seconds]
<nofxx>
I think it's a great way to learn, have something to test your code
<nofxx>
mikhael_k33hl, check out 'guard' if you don't use it yet...
<nofxx>
be sure to add the rubocop plugin to it too, great way to improve ugly code
scottschecter has quit [Ping timeout: 260 seconds]
<nofxx>
mikhael_k33hl, well, just by look, please set your editor to two spaces... but apart from that looks like ruby =D
solocshaw has joined #ruby
<nofxx>
also, you can gist multiple files, in a single gist
jenrzzz has quit [Ping timeout: 258 seconds]
jcao219 has quit [Ping timeout: 260 seconds]
blackwind_123 has joined #ruby
zapata has quit [Quit: WeeChat 1.6]
charliesome has joined #ruby
agent_white has quit [Quit: backinabit]
hahuang61 has joined #ruby
charliesome has quit [Ping timeout: 252 seconds]
Olipro has joined #ruby
blackwind_123 has quit [Ping timeout: 268 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
hahuang61 has quit [Ping timeout: 258 seconds]
jcao219 has joined #ruby
mBailey_j has joined #ruby
blackwind_123 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
agent_white has joined #ruby
pawnbox has quit [Remote host closed the connection]
dkam has joined #ruby
cyphase has quit [Ping timeout: 260 seconds]
jaguarmagenta has joined #ruby
AlexRussia has joined #ruby
harai_ has joined #ruby
cyphase has joined #ruby
astrobunny has joined #ruby
AlexRussia has quit [Ping timeout: 244 seconds]
whathappens has joined #ruby
bihi has quit [Quit: Bye!]
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
bihi has joined #ruby
Littlemyu has quit [Ping timeout: 248 seconds]
nankyokusei has joined #ruby
AlexRussia has joined #ruby
alan_w has quit [Quit: WeeChat 1.4]
<mBailey_j>
hi, so im running slackware kernel 4.4 atm in live mode and i've already installed ruby 2.2 via slackpkg and later installed -v 2.3 via source. I'm wondering how to run 2.3 rather than 2.2? as i'm having gem dependecy issues for a metasploit-framework git package.
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
dionysus69 has joined #ruby
nankyokusei has quit [Ping timeout: 268 seconds]
AlexRussia has quit [Ping timeout: 256 seconds]
<nofxx>
mBailey_j, by chance tried archlinux? it's slack - the suffering
whathappens has quit [Ping timeout: 248 seconds]
byte512 has joined #ruby
<nofxx>
it's on ruby 2.3 for months now...
AlexRussia has joined #ruby
dnicole has joined #ruby
<adam12>
mBailey_j: When you say via source, is that ./configure ; make ; make install?
<nofxx>
I guess so.. that doesn't include the /bin part hence the problem
gix has quit [Ping timeout: 268 seconds]
<nofxx>
mBailey_j, another idea is just change slackpkg script... or see what it does
<mBailey_j>
adam12, uh. yea i beleive so.
<mBailey_j>
so, it's slackware issue...?
<adam12>
mBailey_j: if you run `/usr/local/bin/ruby -v`, do you see ruby-2.3?
cdg has quit [Remote host closed the connection]
<mBailey_j>
ruby 2.2.5p319
cyphase has quit [Ping timeout: 248 seconds]
<adam12>
Strange.
<mBailey_j>
from source its theruby 2.2.5p319 2.3 version however.
<adam12>
I dont follow.
<mBailey_j>
sorry...this install is still buggy
<mBailey_j>
from source it's the 2.3 version
gix has joined #ruby
<adam12>
But you can't run that version?
<mBailey_j>
not sure how...
<mBailey_j>
files and directories all look the same
<mBailey_j>
meaning none are distinguished by color or bold font
<adam12>
What files/directories are you comparing exactly?
blackwind_123 has quit [Ping timeout: 258 seconds]
<mBailey_j>
the ones in the ruby-2.3.1 directory
<mikhael_k33hl>
I'm getting an error: NameError: uninitialized constant TestMyApp::MyAppUtilities when running my test MyAppUtilities
<adam12>
mBailey_j: You likely need to `make install`
<adam12>
mBailey_j: Which I suspect will put it in /usr/local/bin
<adam12>
mBailey_j: which you will then update your PATH to add that path to the front.
ecksit has quit [Client Quit]
<ezrios>
suppose I have a `class Foo; def initialize(x,y); @x = x; @y = y; end` and I want to define equality between two instances as `def ==(other); @x == other.x && @y == other.y`, but I don't want to expose the attributes of the `other` instance as attr_readers
<ezrios>
is there a common idiom in ruby for achieving this?
<ezrios>
short of `instance_variable_get`
xavier2 has quit [Read error: Connection reset by peer]
<adam12>
ezrios: Use protected maybe?
jcao219 has quit [Ping timeout: 244 seconds]
<ezrios>
ah I always forget about protected
xavier2 has joined #ruby
<adam12>
It would expose them, but only to instances of the same class. I think that might work? I dunno.
phaza has quit [Read error: Connection reset by peer]
phaza_ has joined #ruby
jcao219 has joined #ruby
blackwind_123 has joined #ruby
<mBailey_j>
sorry, one sec guys. im working with a dev on a package issue also.
bihi has quit [Ping timeout: 260 seconds]
<mBailey_j>
is there a paste for this channel?
<bovis>
I finally got my word wrapping, numbers, and colors to print properly to screen. Sigh. Of. Relief. What year is it now?
<mBailey_j>
Run `bundle install` to install missing gems.
<mBailey_j>
bash-4.3# bundle
<mBailey_j>
Your bundle is locked to json (1.8.3), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of json (1.8.3) has removed it. You'll need to update your bundle to a different version of json (1.8.3) that hasn't been removed in order to install.
<mBailey_j>
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root
<mBailey_j>
will break this application for all non-root users on this machine.
<agent_white>
Using an NES emulator in pure Ruby to benchmark new Ruby versions...
<agent_white>
We are the most fun :)
blackwind_123 has joined #ruby
yardenbar has quit [Ping timeout: 265 seconds]
AlexRussia has joined #ruby
tvw has joined #ruby
Salih has joined #ruby
Salih has joined #ruby
Salih has quit [Changing host]
ur5us has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
muelleme has quit [Ping timeout: 245 seconds]
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bayed has joined #ruby
AlexRussia has quit [Ping timeout: 265 seconds]
yardenbar has joined #ruby
allcentury has joined #ruby
<quazimodo>
does tony arcieri ever frequent by here?
conta1 has joined #ruby
AlexRussia has joined #ruby
last_staff has joined #ruby
allcentury has quit [Ping timeout: 258 seconds]
cyphase has quit [Ping timeout: 245 seconds]
bikram has joined #ruby
harai_ has quit [Ping timeout: 258 seconds]
AlexRussia has quit [Ping timeout: 268 seconds]
cyphase has joined #ruby
tvw has quit [Ping timeout: 246 seconds]
lorenzoscalfani has joined #ruby
lorenzoscalfani has left #ruby [#ruby]
vondruch_ is now known as vondruch
ferr has joined #ruby
rashomoun has quit [Ping timeout: 246 seconds]
AlexRussia has joined #ruby
harai_ has joined #ruby
rashomoun has joined #ruby
the_drow has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
solocshaw has joined #ruby
agent_white has quit [Quit: agent_white]
pawnbox has joined #ruby
kechja has quit [Remote host closed the connection]
agent_white has joined #ruby
unshadow has joined #ruby
TomyWork has joined #ruby
function has joined #ruby
biberu has joined #ruby
mBailey_j has joined #ruby
claudiuinberlin has joined #ruby
luckyruby has joined #ruby
VanDyke has quit [Read error: Connection reset by peer]
bikram has quit [Quit: Lost terminal]
Derperperd has quit [Quit: Derperperd]
function has quit [Quit: found 1 in /dev/zero]
nankyokusei has joined #ruby
tteer has joined #ruby
<tteer>
cs
Madplatypus has joined #ruby
nankyokusei has quit [Ping timeout: 250 seconds]
AlexRussia has joined #ruby
astrobunny has quit [Remote host closed the connection]
jcao219 has quit [Ping timeout: 260 seconds]
allcentury has joined #ruby
p0p0pr37 has quit [Quit: p0p0pr37]
solocshaw1 has joined #ruby
AlexRussia has quit [Ping timeout: 265 seconds]
lxsameer has joined #ruby
BackEndCoder has quit [Excess Flood]
solocshaw has quit [Ping timeout: 256 seconds]
<blackbom1>
quazimodo: why
allcentury has quit [Ping timeout: 256 seconds]
BackEndCoder has joined #ruby
solocshaw1 has quit [Ping timeout: 245 seconds]
blaxter has joined #ruby
zacts has quit [Ping timeout: 260 seconds]
_djbkd has quit [Remote host closed the connection]
MrJoshua has quit [Quit: MrJoshua]
_djbkd has joined #ruby
aufi has joined #ruby
p0p0pr37 has joined #ruby
p0p0pr37 has quit [Changing host]
p0p0pr37 has joined #ruby
harai_ has quit [Ping timeout: 246 seconds]
tteer has quit [Ping timeout: 248 seconds]
BackEndCoder has quit [Ping timeout: 256 seconds]
_djbkd has quit [Ping timeout: 256 seconds]
blaxter has quit [Quit: foo]
kilk has joined #ruby
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 268 seconds]
enterprisey has quit [Remote host closed the connection]
zacts has joined #ruby
alirezabashiri has joined #ruby
edwinvdgraaf has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
rashomoun has quit [Ping timeout: 240 seconds]
edwinvdgraaf has joined #ruby
k200 has joined #ruby
<k200>
when i have a=[1,1,3] which 1 it returns on a.min?
<tobiasvl>
does it matter?
flying has joined #ruby
<k200>
yes.
<k200>
tobiasvl: no.
ur5us has quit [Remote host closed the connection]
<apeiros>
k200: if it's not documented, then there's no guarantee on a specific one being returned
<k200>
tobiasvl: it does not matter how. "which" is what matters for me in this specific case.
<apeiros>
I'd assume the first, but as said - not documented = not guaranteed.
xrlk has quit [Ping timeout: 265 seconds]
mradmacher has joined #ruby
<k200>
ok
<apeiros>
why does the "which" matter?
<tobiasvl>
in this specific case, they're the same object, right?
agent_white has quit [Quit: brbupdate]
* apeiros
assumes fake example
<tobiasvl>
probably, but k200 did say "in this specific case" ;P
<apeiros>
and real example using a "bigger" object compared on one of the attributes, potentially differing in others
<apeiros>
but yeah, bad fake examples--
djbkd_ has joined #ruby
<k200>
apeiros: tobiasvl I am editing an existing project. where they are building an array.push(Model.column) then they are doing another_value = array.min. Now the new thing I want to add to this code is to get Model.another_column of that Model.column which one was the minimum.
<k200>
apeiros: :-p
phaza_ has quit [Read error: Connection reset by peer]
<k200>
apeiros: you are smart!
<tobiasvl>
what is array.min anyway? some numpy stuff?
<tobiasvl>
or do you mean min(array)
<apeiros>
k200: I've experienced enough shitty examples on irc :-p
phaza has joined #ruby
<k200>
array contains integer value.
<k200>
its array of integer.
joonty has joined #ruby
<tobiasvl>
if it only contains integers, any duplicates will always point to the same objects, right?
<k200>
tobiasvl: no. i meant array.min only.
<tobiasvl>
or, well, that depends on implementation I guess
<k200>
array is actual integer array.
<tobiasvl>
k200: what is array.min ?
<k200>
oh I forgot to mention its rails!
* apeiros
can't make sense of that explanation
<k200>
.min
<ljarvis>
Array#min isn't rails, it's in Ruby
<k200>
then whats the confusion?
<tobiasvl>
sorry, my brainfart
<ljarvis>
I don't know :)
<apeiros>
you probably should change the code
ocbtec has joined #ruby
<tobiasvl>
but I still don't understand how it matters if they're only integers :P
<k200>
so if we know, ".min" picks which value when two of them are same, then i can get the other column value depending upon that
<apeiros>
also if two models have the minimum - why does it matter which of the two you're using?
<apeiros>
is one more correct than the other? if so, why? and then codify that "why"
toretore has joined #ruby
<k200>
apeiros: because the second column, which I need from them, is different. hence it matters which min is being used.
<k200>
ok
<apeiros>
and: it sounds a lot like this could be done in the db, without going through ruby.
<k200>
its complex.
<k200>
:-p
<apeiros>
k200: so the other column differs - but the other column isn't the reason why it's the minimum. so again, why does it matter?
<apeiros>
what if Array#min returned a random one of all those objects with the minimal value? why'd it matter which one it picked?
<dminuoso>
Wew. I must say, zbar is one of the neatest libraries around - amazing to have Ruby bindings for it too. :)
<dminuoso>
As long as you dont mind digging in the C source code to figure out what function does what..
cibs has quit [Ping timeout: 268 seconds]
mikecmpbll has joined #ruby
GinoManWorks has quit [Read error: Connection reset by peer]
<apeiros>
dminuoso: it works reliably? because when I was searching for barcode libs, the best I found was zxing, which required me to run a jruby and communicate via drb
<k200>
apeiros: because i need to show the second column value, of the model we picked, and which model we picked? the one with min value? but two has same min value? hence i need to know exactly wihch min model it picked?
AlexRussia has joined #ruby
<apeiros>
(and it has a bug wrt binary qrcodes)
sameerynho has joined #ruby
cibs has joined #ruby
<apeiros>
k200: again: why? both satisfy your criterion to be picked. so why does it matter? that another column varies is immaterial. it's not why it was picked.
<apeiros>
you could just as well say it picked both.
alirezabashiri has quit [Quit: WeeChat 1.4]
<apeiros>
so shouldn't you show both model's other column?
ddffg has left #ruby ["Leaving"]
ddffg has joined #ruby
yardenbar has quit [Ping timeout: 248 seconds]
<k200>
apeiros: no. only the min should be shown. but since we have two min, the one which is being picked is to be shown.
Silthias has joined #ruby
lxsameer has quit [Ping timeout: 258 seconds]
_sfiguser has quit [Ping timeout: 256 seconds]
<apeiros>
you're stuck. you don't have "a" min.
<apeiros>
you have "many" mins.
<apeiros>
so there isn't "the one" with the min.
Silthias1 has quit [Ping timeout: 260 seconds]
<k200>
:-)
<k200>
I think i will get first min.
spectrum has joined #ruby
dkam has quit [Ping timeout: 259 seconds]
<dminuoso>
apeiros: Absolutely. Zbar is incredibly reliable.
<dminuoso>
And it's blazing fast too.
Savage has joined #ruby
<dminuoso>
apeiros: I think the android market just made zxing very popular.
<apeiros>
dminuoso: good to know. gotta try that out then.
igniting has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
emilkarl has joined #ruby
chadwtaylor has joined #ruby
nankyokusei has joined #ruby
luckyruby has quit [Quit: Leaving...]
Snowy has joined #ruby
chadwtaylor has quit [Ping timeout: 252 seconds]
nankyokusei has quit [Ping timeout: 260 seconds]
quazimodo has joined #ruby
aidalgol has quit [Quit: zZzZzZzzz]
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
<quazimodo>
blackbom1: curious if he thinks its possible to get a server like puma also start a webpack dev server using a celluloid actor to manage/read from it's stdout in my development environemnt
<quazimodo>
oooo new weirdness. Using puma I can can fork, spawn my webpack dev server in that and ctrl-c exits everyting jush fine. But If I use zeus to preload and do zeus s, then I can't get ctrl-c to kill off webpack server
<quazimodo>
and it blocks indefinitely
<quazimodo>
weird!
honore has quit [Quit: honore]
ziarkaen has joined #ruby
Snowy_ has joined #ruby
quazimodo has quit [Read error: Connection reset by peer]
virgil has joined #ruby
Snowy has quit [Ping timeout: 258 seconds]
postmodern has quit [Quit: Leaving]
SesMan has joined #ruby
AlexRussia has joined #ruby
kareelee_ has joined #ruby
kareelee has quit [Read error: Connection reset by peer]
_sfiguser has quit [Ping timeout: 260 seconds]
AlexRussia has quit [Ping timeout: 258 seconds]
Dimik has quit [Ping timeout: 260 seconds]
aupadhye has quit [Ping timeout: 246 seconds]
emilkarl has quit [Read error: Connection reset by peer]
emilkarl has joined #ruby
djbkd_ has joined #ruby
AlexRussia has joined #ruby
phaza has quit [Read error: Connection reset by peer]
joonty1 has joined #ruby
phaza has joined #ruby
pandaant has joined #ruby
lenwood has joined #ruby
joonty has quit [Ping timeout: 258 seconds]
nettoweb has joined #ruby
_sfiguser has joined #ruby
joonty2 has joined #ruby
Ropeney has joined #ruby
allcentury has joined #ruby
joonty1 has quit [Ping timeout: 258 seconds]
AlexRussia has quit [Ping timeout: 265 seconds]
joonty1 has joined #ruby
joonty2 has quit [Ping timeout: 250 seconds]
allcentury has quit [Ping timeout: 260 seconds]
binaryplease has joined #ruby
zukin has joined #ruby
tau has joined #ruby
AlexRussia has joined #ruby
kilk has quit [Remote host closed the connection]
careta has joined #ruby
Humdai has joined #ruby
<careta>
hey guys
<careta>
I need to emulate the behaviour of C's rand and srand in Ruby
<careta>
is there a way to do that?
joonty2 has joined #ruby
<careta>
Ruby's versions do not give the same results as the C one
<elomatreb>
Which behaviour do you mean specifically (not familiar with C)?
djbkd_ has quit [Ping timeout: 258 seconds]
<careta>
elomatreb, I need ruby to give me the same rand() sequence after I seed srand with a specific number
kareelee_ has quit [Read error: Connection reset by peer]
<careta>
and I've noticed that doing that in C and doing that in Ruby gives different results
<careta>
probably the way srand and rand works are too different I guess
<careta>
unless I'm doing something wrong
kareelee has joined #ruby
joonty1 has quit [Ping timeout: 260 seconds]
<elomatreb>
Ah, you want Ruby rand seeded with a specific seed to return the same sequence as C rand with the same seed?
<careta>
exactly
<elomatreb>
I doubt you'll get Random to do that, since it's implementation specific. Have you considered writing a custom sequence generator that could be implemented in both C and Ruby?
<careta>
elomatreb, you mean re-implementing C's version in Ruby?
AlexRussia has quit [Ping timeout: 250 seconds]
<careta>
I can't roll my own, as this is to emulate an existing device
<careta>
I need to emulate it's random number generation behaviour
<careta>
which uses C's srand and rand
<elomatreb>
In that case that's probably your only option :(
<careta>
there's some gems that allow me to call C from Ruby code right? that might work?
joonty1 has joined #ruby
<elomatreb>
I'm not a C programmer, but I assume things like rand/srand are implemented in your libc. So you'd need the same libc as the device you want to be compatible with
<careta>
hmm yeah that's true
<careta>
the device is using uClibc but I actually get the same results with libc
<careta>
anyway that's a good point to keep in mind
<elomatreb>
You could take a look at the sourcecode of rand/srand in that libc and see if you can emulate it in Ruby, aside from the initial seed generation that shouldn't be *too* difficult
joonty2 has quit [Ping timeout: 258 seconds]
<careta>
the good news is that uClibc didn't change the srand code compared to libc
<careta>
I'm looking at it now, still has the '95 headers from Ulrich
<careta>
so maybe that C calling gem actually works
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nobitano_ has quit []
<sjums>
ah... well. ehmm.. that makes sense - I guess :3
<elomatreb>
I'm kind of surprised too, I suspected something like negation or some blackmagic bitshift
virgil has quit [Remote host closed the connection]
<MadWasp>
Is there any information on how to do custom serialization and deserialization using Psych? Psych itself doesn’t seems to have a documentation
jenrzzz has quit [Ping timeout: 258 seconds]
_djbkd has quit [Ping timeout: 245 seconds]
<ccooke>
I recall it being a absolute pain when I implemented it
jaiks has quit [Ping timeout: 256 seconds]
edwinvdgraaf has joined #ruby
<gener1c>
how do i run the tests on the ruby repo
edwinvdg_ has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
<ccooke>
MadWasp: So, I've dug out some code where I extend Psych.
lenwood has quit [Ping timeout: 256 seconds]
<ccooke>
the methods you need are YAML.add_domain_type and potentially an encode_with method on your class instances.
<ccooke>
Sorry, couldn't find a more in-depth document on it (and I have a meeting, so... good luck)
<dminuoso>
careta: why do you need this behavior? is this for testing?
<MadWasp>
ccooke, thanks a lot :)
edwinvdg_ has quit [Ping timeout: 260 seconds]
<ccooke>
MadWasp: basically, check the API reference for those methods and play around a bit. The help isn't great, but once you know the framework you should be able to work it out
ineb has quit [Quit: leaving]
<MadWasp>
ccooke, i guess encode_with and init_with should be enough for me
<ccooke>
Lucky :-)
<pagios>
i have shell="\x01\x0A" print shell is showing unreadable text
<pagios>
how can i print it in hex
quazimodo has joined #ruby
jaiks has joined #ruby
AlexRussia has quit [Ping timeout: 258 seconds]
<elomatreb>
pagios: Try String#bytes maybe?
startupality has joined #ruby
<pagios>
elomatreb, it prints decimal numbers
xavier2 has quit [Read error: Connection reset by peer]
<pagios>
i just need it to print \x12\x123 etc
<pagios>
the way it is stored in the string
c355e3b has joined #ruby
<elomatreb>
Yes, which can convert to hex like this:
<cpruitt>
Anyone have any experience getting agent forwarding working with sshkit (not capistrano)? I’m trying to write a super simple script to do a remote git pull and, though I can pull fine locally with my keys, running remotely is erroring with “Host key verification failed.”
<cpruitt>
To reiterate, I’m using sshkit directly, not using cap on top of it.
binaryplease has joined #ruby
hays__ has joined #ruby
<hays__>
Where do I get this file ? addtrustexternalcaroot-2048.pem
<hays__>
I am using rubyinstaller on windows, and this file is out of date. I see a bunch of places with this file, but I'd prefer the actual source rather than something in a pastebin
<havenwood>
hays: That gets you the new intermediate certs as well.
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
swills has joined #ruby
NeverTired has quit [Quit: Connection closed for inactivity]
chopin has quit [Remote host closed the connection]
chopin has joined #ruby
loincloth has joined #ruby
aegis3121 has quit [Ping timeout: 260 seconds]
marr has joined #ruby
aryaching has joined #ruby
senesor has joined #ruby
Rodya_ has quit [Remote host closed the connection]
<senesor>
hello, I have silly questions
jhn has joined #ruby
<senesor>
I work in recruitment, I'm trying to figure some things out so I appear less thick.
tomphp has joined #ruby
chopin has quit [Ping timeout: 256 seconds]
<senesor>
ruby = language ruby on rails = ruby the extended edition?
tomphp has quit [Client Quit]
<ule>
senesor: rails is a web framework created using ruby
cdg has quit [Remote host closed the connection]
last_staff has quit [Quit: last_staff]
<senesor>
Ok. Can you know rails without knowing ruby?
<centrx>
Rails is a set of libraries which do add to the functionality of Ruby
<ule>
senesor: no
<centrx>
senesor: Some people do focus on Rails, or start by learning Rails, so that they have less facility with Ruby itself outside of Rails
skweek has joined #ruby
<senesor>
ok, so excellent RoR doesn't mean excellent Ruby.
<ule>
disagree
xaxisx has quit [Quit: leaving]
<centrx>
senesor: that makes sense, but of course someone _truly_ "excellent" at Rails would be good at Ruby
<ule>
^ now I agree
<centrx>
varying degrees of excellence
jphase_ has quit [Remote host closed the connection]
hays has quit [Ping timeout: 260 seconds]
<centrx>
Similarly, you could have UI people who might be excellent at UI in Rails and don't really know much database or backend things, or vice-versa
jphase has joined #ruby
dionysus69 has joined #ruby
<senesor>
and regarding what ruby is used for - in your option, what's it best for?
xaxisx has joined #ruby
<centrx>
Ruby is versatile and can be good for anything
<centrx>
although not great in some areas, e.g. for a GUI desktop app probably not be the best choice
conta1 has quit [Ping timeout: 244 seconds]
TomyWork has quit [Ping timeout: 256 seconds]
<centrx>
For scientific computing, there is SciRuby, but Python is stronger in that area and the standard
Littlemyu__ has quit [Ping timeout: 260 seconds]
<baweaver>
Ruby tends to be used for Web Development and System Administration primarily
hightower2 has joined #ruby
<baweaver>
think Chef, Sensu, and other ops tools
<senesor>
just thinking where I could find developers. to steal their souls.
brendan- has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
<baweaver>
RE: Rails / Ruby: Some people have experience in Rails as a framework but know little Ruby. That's a hallmark of a very amateur Rails dev and should be noted.
<baweaver>
Even if they have some intermediate skills they're going to fold the second anything actually difficult crops up.
whathappens has quit [Remote host closed the connection]
<baweaver>
senesor: what area are you recruiting for?
yardenbar has joined #ruby
<senesor>
software developers. I recruit all over the tech map.
<baweaver>
Also keep an eye out for a Github account that's active and perhaps a blog.
<senesor>
right now, got me some Python, some Ruby, some Data
<baweaver>
The big thing though is take a few minutes for each person.
<ule>
senesor: tell us which one pays more :)
<baweaver>
because I'll straight ignore copy-paste templates 99% of the time.
<senesor>
Data
<baweaver>
Data Science hands down
<senesor>
like, woah data
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
allcentury has joined #ruby
<baweaver>
though it has intersection with Python
<baweaver>
depending on the toolkit (likely Hadoop / Spark / MapReduce)
<senesor>
baweaver: I put time into my stalking before messaging. The trick is to stop before you're outside their house.
<baweaver>
Heh
<senesor>
"I like your blog" is good "I like your mailbox" is too far
mikecmpbll has joined #ruby
<baweaver>
Well you're on the right track there.
<senesor>
people still don't reply, it's so sad.
<baweaver>
Remember they probably get 100s of messages a day
<senesor>
I knooow. But I'm the one who really cares.
<baweaver>
For Ruby people at least, putting Ruby in the header / title gets some attention.
<centrx>
Ruby people love Ruby
<baweaver>
pretty much.
xaxisx has quit [Ping timeout: 240 seconds]
<baweaver>
Either that or give them an interesting problem that the company is working on.
<baweaver>
the unfortunate fact for recruiters is you're rarely going to get a reply.
pawnbox has quit [Ping timeout: 252 seconds]
<senesor>
yeah, that's why recruiters get lazy and start firing out templates
<baweaver>
I mean I could literally say I work for the PS4 team and we're hiring Ruby people and I still won't get much feedback on here.
xaxisx has joined #ruby
hays has joined #ruby
<hays>
havenwood: thanks. would it be 2.4.x for older rubies?
<baweaver>
Probably the worst I've seen is I posted a job once for my team and the recruiter tried to recruit me to work under myself.
<senesor>
baweaver: Was it for more money?
<baweaver>
Na, I thought about it though :P
<senesor>
"No thanks, I heard the boss was an ass"
<baweaver>
Hire myself for more money and a better bonus XD
<hays>
havenwood: we're running 2.2 right now
<baweaver>
Na, I told the poor recruiter to look carefully at my profile
<senesor>
I get recruitment messages all the time to be a developer. "right keywords, wrong idea"
<baweaver>
and tell me why this was silly.
<loincloth>
hallo
<centrx>
gird your loins
radic has quit [Ping timeout: 250 seconds]
<SCHAAP137>
that's the Dutch version of hello
<senesor>
I recently read how you actually gird loins so now I am ready
<baweaver>
and that's the jewish way of saying they're ready for a fight
<baweaver>
or to run away
<baweaver>
something like that
aufi has quit [Quit: Leaving]
nankyokusei has joined #ruby
radic has joined #ruby
<jblack>
I had a couple recruiters try to convince me to take the spot I just left. :)
<hays>
my ruby 2.2 is a gem version 2.4.5.1. 2.3 is at gem version 2.5.1.
<hays>
that's after running gem update
<manveru>
i gave up responding to recruiters after the 100th "no, we're actually not looking for remote workers" :P
synthroid has quit [Remote host closed the connection]
<manveru>
finding a remote job in europe is like finding the holy grail
<senesor>
really? feels likes there's loads of the
<senesor>
m
<hays>
it looks like gem version is independent of ruby version
nankyokusei has quit [Ping timeout: 260 seconds]
<manveru>
senesor: i've mostly looked in DACH, found a single position for remote work with ruby after like 4 months...
jhack has quit [Quit: jhack]
jhack has joined #ruby
<senesor>
manveru: To be fair, I've never seen a contract Ruby role but that's because recruiters get hired to find hard things, like the magical Ruby developer with 10 years experience. I've seen plenty of remote work in other areas, Java/.NET/etc
<manveru>
maybe i'm too picky, since i don't consider jobs involving mongodb or microsoft stacks and things of that sort :)
binaryplease has quit [Quit: binaryplease]
<manveru>
well, yeah
skweek has quit [Ping timeout: 260 seconds]
<manveru>
i'm at 11 years now :)
<loincloth>
has anyone ever run into a situation where some versions of Ruby used the Mac Keychain app certificates and some didn't?
<chris2>
manveru: you still there?
<senesor>
manveru: If you can be picky, do it - you'll be happier in the long run and have a nice life :)
<manveru>
chris2: yeah
<chris2>
at the .ch shop of last time?
<manveru>
we got bought by xing
<loincloth>
i'm not sure exactly where the issue is or how best to solve it... just trying to understand, if anyone has experience
<chris2>
lol
phantompain has quit [Ping timeout: 265 seconds]
<chris2>
i think xing was the first company ever to offer me a job
<chris2>
i was like 16 and put ruby into my profile
<manveru>
they actually have some guy called christian neukirch ;)
<chris2>
and the next day they wanted to hire me :P
<chris2>
manveru: fun
ziarkaen has quit [Quit: leaving]
<manveru>
lol
<chris2>
they must be really desperate :P
<manveru>
now they have also java/scale besides ruby
<manveru>
and phasing out perl slowly
<havenwood>
hays: Yup, RubyGems is a gem and can and should be updated independently from Ruby. You'll need to get to RubyGems 2.5.2 or later for the new certs.
<havenwood>
hays: Update to RubyGems 2.6.8.
amclain has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
<havenwood>
hays: Or at least to 2.5.2.
<chris2>
manveru: istr they switched from php (or was it perl...) to ruby back then
<manveru>
i think it used to be almost all perl
Devalo has joined #ruby
<manveru>
some core stuff still is, but frontend is all ruby/rails now
aryaching has joined #ruby
pawnbox has joined #ruby
<chris2>
ok
<manveru>
some are trying to introduce elixir recently :)
harfangk has joined #ruby
<havenwood>
baweaver: New releases with intermediate ca certs! :-) I guess we still need to handle older versions and it'll take the Windows Installer folk a while to bump.
<baweaver>
eesh
<manveru>
anw, gtg
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
moei has quit [Quit: Leaving...]
mark_66 has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
_djbkd has joined #ruby
nobitanobi has joined #ruby
jphase_ has joined #ruby
NeverTired has joined #ruby
jphase has quit [Ping timeout: 260 seconds]
edwinvdg_ has quit [Ping timeout: 260 seconds]
yardenbar has quit [Ping timeout: 240 seconds]
<hays>
havenwood: thanks
hays has quit [Quit: Page closed]
<senesor>
thanks for the info, folks. I must off to a meeting.
jenrzzz has quit [Ping timeout: 248 seconds]
<senesor>
o/
rodfersou has joined #ruby
_djbkd has quit [Ping timeout: 268 seconds]
VeryBewitching has joined #ruby
xrlk has joined #ruby
hightower3 has joined #ruby
hightower2 has quit [Ping timeout: 248 seconds]
phantompain has joined #ruby
nikivi has quit [Ping timeout: 260 seconds]
jphase has joined #ruby
jphase_ has quit [Ping timeout: 260 seconds]
jmignault has joined #ruby
synthroid has joined #ruby
hightower2 has joined #ruby
jsrn_ has quit [Quit: Leaving]
nobitanobi has quit [Remote host closed the connection]
SesMan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Derperperd has joined #ruby
hightower3 has quit [Ping timeout: 252 seconds]
polishdub has joined #ruby
Asher has quit [Ping timeout: 256 seconds]
hightower3 has joined #ruby
jmignault has quit [Ping timeout: 246 seconds]
nikivi has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
hightower2 has quit [Ping timeout: 265 seconds]
cdg has joined #ruby
kbdkode has quit [Quit: see ya ]
railssmith has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[Butch] has joined #ruby
jmignault has joined #ruby
quazimodo has quit [Ping timeout: 265 seconds]
hightower2 has joined #ruby
_sfiguser has quit [Ping timeout: 256 seconds]
hightower3 has quit [Read error: Connection reset by peer]
ineb has joined #ruby
flying has quit []
the_drow has quit [Quit: This computer has gone to sleep]
<dminuoso>
apeiros: This still does not feel right.
<apeiros>
do you need the constants to be modules? and will they serve as namespace containers?
Ishido has quit [Ping timeout: 256 seconds]
SeepingN has joined #ruby
<dminuoso>
They could be classes for all I care - but I developed this habit of not using classes unless you want to instantiate them
<dminuoso>
Or anything else I guess?
<dminuoso>
Mmm.
<apeiros>
I mean more like - could they just be e.g. integers?
platzhirsch has quit [Quit: WeeChat 1.4]
<apeiros>
like A1 = 1
Asher has joined #ruby
Beams has quit [Quit: .]
<dminuoso>
apeiros: Heh. I want something like puts obj.get_type to put out Foo::BarType rather than 521
<apeiros>
if so, there's gems if you can live with how they do it, and if not, I've got an idea or two. but whether they are good depends on your specifics.
ajsharma has joined #ruby
<dminuoso>
apeiros: I want to turn the enum values into tag classes, pretty much like "enum class" in C++.
<apeiros>
depending on how you do it, you can still do that :)
<apeiros>
I do faaaar to little C++ to remember how that works :(
<dminuoso>
Boy, what an answer..
<dminuoso>
"depending on how you do it, you can still do that"
<dminuoso>
:D
<apeiros>
heh
<apeiros>
soooorry
<apeiros>
so you want a constant which is descriptive, yes?
frozengeek__ has quit [Quit: frozengeek__]
<apeiros>
and you want little overhead declaring them?
whiteline has quit [Remote host closed the connection]
<dminuoso>
Yeah.
whiteline has joined #ruby
<apeiros>
do you define a lot of enums? i.e. overhead for a small class/module is justified?
<dminuoso>
I dont know. I just started patching zlib.
<dminuoso>
zbar I mean.
<dminuoso>
;)
<apeiros>
hm
<apeiros>
I'd look around for gems first. almost certain that there's a ton of enum/enum-like gems around
FastJack has quit [Quit: bbl]
solocshaw has joined #ruby
<dminuoso>
>> class self.Foo; end
<ruby[bot]>
dminuoso: # => /tmp/execpad-fb348b4426f1/source-fb348b4426f1:2: syntax error, unexpected ';', expecting &. or :: or ...check link for more (https://eval.in/678248)
Eiam has joined #ruby
<dminuoso>
>> class << self; class Foo; end; end;
Humdai has quit [Read error: Connection reset by peer]
<balazs>
I have these JSON templates that describe some infrastructure (in Azure). I'd like to make them generic, so for example where the template has one security group, I would like to allow specifying multiple ones. So I have a JSON object to start with.
FastJack has joined #ruby
<balazs>
Did that clear things up ?
djellemah has joined #ruby
chris349 has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
<baweaver>
So ERB then for templating
ycyclist has quit [Ping timeout: 260 seconds]
centrx has quit []
jhack has joined #ruby
flying has joined #ruby
Asher has joined #ruby
<baweaver>
or jbuilder
jphase has quit [Ping timeout: 246 seconds]
chopin has joined #ruby
gusrub_ has quit [Remote host closed the connection]
izaac has quit [Ping timeout: 248 seconds]
sameerynho has quit [Quit: WeeChat 1.6]
mpwin has joined #ruby
izaac has joined #ruby
gusrub_ has joined #ruby
jphase has joined #ruby
<balazs>
Well, to give you a concrete example: how do you build a JSON array in ERB ? And I mean to have the template for the array elements in the ERB, not outside
enterprisey has joined #ruby
<toretore>
?code balazs
<ruby[bot]>
balazs: We can't help you without your code, please post it to https://gist.github.com
<balazs>
This is the concept that I'm asking about
<balazs>
there will be a trailing comma after the last array element
<apeiros>
why'd you do that with a template instead of code + to_json?
jphase has quit [Ping timeout: 245 seconds]
<dminuoso>
apeiros: What library do you use to generate QR codes? rqrcode?
<balazs>
because I have a JSON template (Azure ARM template) to begin with)
claudiuinberlin has joined #ruby
<apeiros>
dminuoso: yes
<dminuoso>
apeiros: Do you ever encode binary data, or just alphanumeric?
flying has quit [Ping timeout: 258 seconds]
jphase has joined #ruby
<apeiros>
balazs: so? seems like you translate that anyway…
<dminuoso>
Because I really want to use non-alphanumeric bytes as magic bytes.. but the freaking library seems buggy for the byte_8bit mode
<apeiros>
dminuoso: due to the bug in zxing, only ascii. don't remember which qr code setting we used for that.
<dminuoso>
"the" bug?
<apeiros>
I thought I mentioned it in the pm earlier
<apeiros>
zxing does not properly decode binary data
<dminuoso>
Then either zbar does not either, or rqrcode cant encode it properly.
<dminuoso>
I'm stuffing an \x80 in and get out \xC2\x80 - it's weird.
<apeiros>
both possible IMO
<balazs>
apeiros: so convert the JSON to a ruby hash, then make that more generic by turning it into a template, then convert that back to JSON. Right ?
<apeiros>
balazs: nah, just transform, then call to_json.
enterprisey has quit [Remote host closed the connection]
claudiuinberlin has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
Limix has quit [Quit: Limix]
meshsmith has joined #ruby
<bovis>
balazs: I'm also new, so I'd appreciate a fact check, but I think line 20 (flattened_prod = prod.each...) will give you nothing more than the initial array. Anything you have in the block in meaningless to flattened_prod
Jackneill_ has joined #ruby
machinew_ has joined #ruby
<machinew_>
are there any gems for streaming .xls files?
<machinew_>
I can only find gems for .xlsx, but can't afford to load the whole .xls into memory at once
<bovis>
balazs: You can use map there, instead of each, to return a flattened array.
Darmani has joined #ruby
claudiuinberlin has quit [Ping timeout: 244 seconds]
<bovis>
balazs: And then the bang (!) won't be necessary
chopin has joined #ruby
chris2 has joined #ruby
hightower3 has joined #ruby
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
balazs: It seems an Array of Hashes is nicer than an Array of Arrays of Hashes: head, *tail = h.values; head.product(*tail).map { |values| h.keys.zip(values).to_h }
Derperperd has quit [Quit: Derperperd]
<baweaver>
accumulate doesn't actually accumulate
<baweaver>
that's what reduce is for in any case.
<Darmani>
baweaver: The point was to create a method that does the same thing.
gusrub_ has quit [Remote host closed the connection]
<baweaver>
>> [1,2,3].reduce(0) { |accumulator, i| accumulator + i } # and yes I'm explicitly using longhand
dnicole has quit [Remote host closed the connection]
<baweaver>
because ruby
cpruitt_ has joined #ruby
<baweaver>
xrlk: have you tried searching?
<bovis>
matheusmoreira: it's hard to reason what the code is doing when there are so many jumps from place to place
cpruitt has quit [Read error: Connection reset by peer]
cpruitt_ is now known as cpruitt
<matheusmoreira>
I know about String#upcase I was just illustrating a simple string => array of char => operation => string pipeline
<matheusmoreira>
doesn't seem that obfuscated
cpruitt has quit [Client Quit]
<havenwood>
xrlk: It's a variable visible to all instance methods of an instance of a class. All the instance methods share the instance variables for their instance.
<baweaver>
fair. There are a lot of arguments to be made for both.
<ljarvis>
i'd be happy with split().map().join() but again, it's personal preference. Many Rubyists would hate that and I understand that
<bovis>
I think it's more that it *can be* a problem, not that it is
polishdub has quit [Quit: Leaving]
<baweaver>
Scala is a hybrid of both
<xrlk>
tnx ha
<ljarvis>
Scala is hell
<xrlk>
havenwood,
<blackbombay>
ljarvis: opal is like thar?
<blackbombay>
that
<ljarvis>
blackbombay: no idea I've not used it
<blackbombay>
i guess it is
<blackbombay>
it transpiles to JS
<baweaver>
Eh, I like it well enough.
<baweaver>
especially when the alt is Java.
<ljarvis>
I like Java *shrug*
<matheusmoreira>
I like Java too...
<bovis>
silence
<ljarvis>
:D
<ljarvis>
I'm been writing code long enough to embrace it
SCHAAP137 has quit [Ping timeout: 265 seconds]
<ljarvis>
I've*
<baweaver>
I'll pretty well walk out of a job if they tell me I have to use it.
<ljarvis>
I don't really like wrestling with the JVM, and I wouldn't go back to writing it as a job, but I like the language itself
<baweaver>
Just way too verbose for me, and the GoF gives me a twitch.
<pilne>
i'm starting to try writing my "need moar speed" things in go instead of attempting to do well with c (assuming I can't find a c library that I can understand already)
dnicole has joined #ruby
<ljarvis>
that's fair
<yorickpeterse>
you should rewrite everything in Rust for webscale
<ljarvis>
sorry you spelled nodejs wrong
* baweaver
ducks
<blackbombay>
rust makes my eyes bleed
<pilne>
i adore rust, my brain just has such a crappy time at the concept of "git gud" with it (and haskell... and lisp/scheme)
<yorickpeterse>
nodejs is too old
<ljarvis>
oh
<ljarvis>
i'm not hip enough
GodFather has quit [Ping timeout: 258 seconds]
<baweaver>
anyways, off I go for a while. Meeting time for the next 2.5 hours :D
<ljarvis>
anyway the rust syntax is absolute firey hell
<blackbombay>
c++ meets crack cocaine.
<pilne>
cocaine's a helluva drug
<ljarvis>
crack cocaine meets ketamin
<yorickpeterse>
it's not that bad
<pilne>
but i'm really cheering and rooting for crystal, especially if they can implement concurrency
<pilne>
and/or parallelism
dnicole has quit [Ping timeout: 260 seconds]
<blackbombay>
yeah me too. no small feat though.
<pilne>
agreed
<pilne>
(sadly)
edwinvdgraaf has quit [Remote host closed the connection]
csk has quit [Remote host closed the connection]
blackwind_123 has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit []
csk has joined #ruby
blackwind_123 has joined #ruby
SCHAAP137 has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
<matheusmoreira>
sadly node.js still doesn't have proper threading support, I posted on their gh issues and the maintainer said "its on the TODO list for v7"
allcentury has quit [Ping timeout: 260 seconds]
tyang_ has quit [Ping timeout: 260 seconds]
d5sx43 has joined #ruby
<matheusmoreira>
because of this its impossible to write CPU-bound code in a way that isn't continuation-passing style.
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
firstdayonthejob has joined #ruby
<matheusmoreira>
you literally gotta break code up so that you can manually schedule the bits and pieces to run, all so you don't block the stupid event loop.
d5sx43 has quit [Client Quit]
<blackbombay>
huh weird. i never thought JS would expose threads directly.
<matheusmoreira>
proper JS already has threads in the form of web workers.
<matheusmoreira>
chrom{e,ium} already implemented it. it works well
<matheusmoreira>
you have a separate JS file and it runs in a separate thread. IIRC you can even communicate with it via events
raul782 has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
<matheusmoreira>
its just a blocking operation like any other.
sdwrage has joined #ruby
<quazimodo>
matheusmoreira: that's cool, i should use that
AndrewIsHere has quit []
<matheusmoreira>
honestly I dropped node as a platform for this reason
<matheusmoreira>
It just wasn't possible to do what I wanted to do nicely
XV8 has joined #ruby
<quazimodo>
matheusmoreira: I find that often it's nice to write cpu intensive code as an external lib and to to IPC with it
<quazimodo>
in fact many times I prefer it
tyang has quit [Quit: Leaving]
tyang has joined #ruby
<matheusmoreira>
well if we wanted to go that route we'd still be writing CGI programs that printed HTTP responses to stdout piped to the webserver.
<matheusmoreira>
these platforms are almost an operating system. they're an environment you get to do everything
<quazimodo>
don't overshoot the mark now
<quazimodo>
lol
<quazimodo>
that's one approach that works for several things
<quazimodo>
there are other approaches
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
<quazimodo>
and they aren't wrong, you're just not used to them
<quazimodo>
there are many things in a ruby app that I sub out to another process
<matheusmoreira>
yeah I know, I've written many ruby extensions myself
raul782 has quit [Ping timeout: 268 seconds]
<matheusmoreira>
I love JS so much I almost wanted to believe that illusion
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
<quazimodo>
and now my moment of cognitive dissonance -> "i love JS so much"
definity has joined #ruby
<matheusmoreira>
why is it dissonant? JS is the language, not its implementation
<matheusmoreira>
chromium app development is rather comfy!
<quazimodo>
i've never done a js and never regretted it :P
<quazimodo>
it's my personal feeling, I find problem solving easier in other languages
<matheusmoreira>
that's alright
<quazimodo>
with the addition of decent-ish moduling, it's getting less brainfucky for me
<matheusmoreira>
despite all those senseless quirks, I just think its got something right deep down
<matheusmoreira>
yeah JS is improving a lot
<quazimodo>
actually I finally got rails and zeus to autostart a webpack dev server for me (by spawning an external lib :P)
banisterfiend has quit [Ping timeout: 240 seconds]
<quazimodo>
all it got right was closures and a simple object hierarchy, (which I find incredibly hard to think with)
<quazimodo>
what else -is there- ?
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<quazimodo>
i'm not dissing, i think those are 2 very important things
<matheusmoreira>
indeed
<matheusmoreira>
you mean prototypes? its really simple when you take out all the bullshit they added to make it look like Java
<quazimodo>
Still
<quazimodo>
haven't been able to write a succint DSL with JS yet. Which is why I think I'm so up ruby's ass.
<matheusmoreira>
you have an object x that has a special link to its prototype, another object y. when you access x.property, if x has the property, it is returned, if not, it is looked up in x.prototype === y.
tyang has quit [Read error: Connection reset by peer]
<quazimodo>
yeah prototype inheritance is simple, too simple tbh
<blackbombay>
yeah chrome app/ext development is sweet.
Vile` has joined #ruby
<matheusmoreira>
prototypal inheritance revolutionized my understanding of object-orientation
toretore has quit [Ping timeout: 240 seconds]
<blackbombay>
too bad ES6 sold out and introduced classes.
<matheusmoreira>
indeed, personally I think all JS "classes" are bullshit
Robtop__ has quit [Ping timeout: 240 seconds]
<quazimodo>
I found js classes made it easier to think and build
<matheusmoreira>
the concrete concepts that I always thought about were configuration files. you have them at the system, user, environment and command-line levels.
<matheusmoreira>
no language ever made implementing these things easy
<quazimodo>
matheusmoreira: config files?
<quazimodo>
matheusmoreira: couldn't disagree more
pwnd_nsfw has joined #ruby
<quazimodo>
well, maybe i don't disagree yet tilly ou elaborate
<quazimodo>
elaborate
<matheusmoreira>
you can pass cmdline options. if you don't? it uses your ~/.config. if you don't have one? it uses the /etc/config. if it doesn't exist? it uses internal defaults
<matheusmoreira>
this abstraction directly corresponds to prototypes
Junaos has joined #ruby
<quazimodo>
it's analogous, somewhat
<matheusmoreira>
the internal defaults sit at the top of the inheritance chain. /etc/config gets loaded as an object and linked to the internal defaults. ~/.config gets loaded and linked to /etc/config. cmdlines are parsed into an object and linked to your user config.
<quazimodo>
hey bbl
<matheusmoreira>
you can always override everything
quazimodo has quit [Read error: Connection reset by peer]
jblack has joined #ruby
guacamole has quit [Quit: leaving]
guacamole has joined #ruby
millerti has joined #ruby
Devalo has joined #ruby
TPug has joined #ruby
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Max SendQ exceeded]
GodFather has joined #ruby
johnmilton has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
jcao219 has joined #ruby
jhack has quit [Ping timeout: 265 seconds]
Devalo has quit [Ping timeout: 246 seconds]
xavier2 has quit [Read error: Connection reset by peer]
xavier2 has joined #ruby
charliesome has joined #ruby
banisterfiend has joined #ruby
jhack has joined #ruby
johnmccabe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tercenya has quit [Remote host closed the connection]
tercenya has joined #ruby
kcn has quit [Quit: Konversation terminated!]
hahuang65 has quit [Quit: WeeChat 1.5]
hahuang65 has joined #ruby
<xavier2>
Yeah, their readme isn't very specific. I guess what I really want is some sort of linter
<jblack>
syntastic is excellent
<jblack>
I use syntastic for ruby, python, json (which takes some effort)
chopin has quit [Ping timeout: 240 seconds]
jphase has quit [Remote host closed the connection]
<xrlk>
ycm doesnt have ruby features it looks like
<xrlk>
o nvm
jphase has joined #ruby
chopin has joined #ruby
Xeago has quit [Ping timeout: 265 seconds]
MyMind has joined #ruby
Xeago has joined #ruby
hightower3 has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
Sembei has quit [Ping timeout: 260 seconds]
Dimik has joined #ruby
jphase has quit [Ping timeout: 260 seconds]
Snowy has quit [Remote host closed the connection]
tvw has quit [Remote host closed the connection]
mikeiniowa has quit [Remote host closed the connection]
csk has quit [Quit: ZZZzzz…]
cdg has quit [Ping timeout: 260 seconds]
mikeiniowa has joined #ruby
raul782 has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Madplatypus has joined #ruby
definity has quit [Ping timeout: 250 seconds]
SCHAAP137 has quit [Quit: Leaving]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
raul782 has quit [Ping timeout: 256 seconds]
allcentury has joined #ruby
Devalo has joined #ruby
biberu has quit []
mikecmpbll has quit [Quit: inabit. zz.]
nankyokusei has joined #ruby
marr has quit [Ping timeout: 260 seconds]
Devalo has quit [Ping timeout: 252 seconds]
nankyokusei has quit [Ping timeout: 258 seconds]
Asher has quit [Ping timeout: 258 seconds]
enterprisey has joined #ruby
Asher has joined #ruby
Asher has quit [Client Quit]
Asher has joined #ruby
jhack has quit [Quit: jhack]
<pizzaops>
Based on the source code viewable here, would it be correct to say that #select is an alias for #find_all, and #find_all is the "core" implementation?