<ineb>
yeah. that code is truly worth to be posted line by line
lxnr has left #ruby [#ruby]
<dminuoso>
roboncloud: Well there is an encoding, TextEdit can handle it/
<dminuoso>
But.. I got an idea.
<roboncloud>
i thought one of the awesome things about encodings in ruby is suppose to be that it supported all of them
<Papierkorb>
roboncloud: It would be really nice if you could use a paste service like https://gist.github.com/ instead of pasting large swaths of code directly into the channel.
<dminuoso>
Papierkorb: Dont fix his behavior, fix my encoding!
<roboncloud>
yeah. sorry, my irc client usually does it but didn't this time.
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb>
roboncloud: It hasn't done it either yesterday.
<roboncloud>
what did i paste yesterday?
hahuang65 has joined #ruby
<Papierkorb>
roboncloud: No idea, can't be bothered to look up tbh. Yesterday chunks of code were posted here all the time, so I simply assumed it was you. Apologies if I'm wrong.
bmurt has joined #ruby
<roboncloud>
well, if you have "no idea" then yes, you shouldn't throw accusations around.
<roboncloud>
but probably i did, so i will fix the client
DTZUZO has joined #ruby
<dminuoso>
roboncloud: also turns out we have Encoding.list :P
<roboncloud>
nice
guardianx has quit [Remote host closed the connection]
guardianx has joined #ruby
chouhoulis has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
<dminuoso>
roboncloud: THe thing that majorly throws me off is that textedit understands it
<dminuoso>
And its not Mac Os Roman
<dminuoso>
There's also nothing in extended file attributes
<roboncloud>
could try with iconv i guess..
<dminuoso>
roboncloud: iconv cant guess, it just converts based on specified encodings
<dminuoso>
essentially what we just did with ruby
<dminuoso>
though I could probably iterate over all available encodings until I find the one that doesnt mojibake
<roboncloud>
yea. worth a shot
harfangk has quit [Remote host closed the connection]
uZiel has joined #ruby
DTZUZO has quit [Ping timeout: 260 seconds]
guardianx has quit []
<gr33n7007h>
hmm, that's weird
nacsurte has joined #ruby
<dminuoso>
Still no luck. What is going on ?
K3rber0s has joined #ruby
<roboncloud>
does textedit display the encoding its using?
K3rber0s has quit [Client Quit]
__Yiota has joined #ruby
mathys has quit [Quit: Leaving]
<dminuoso>
No
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
But I found one mistake I did. There's an extended attribute, denoting the encoding as "macintosh;"
nacsurte has quit [Ping timeout: 240 seconds]
<roboncloud>
if you paste the char into textedit, save, then read in ruby with: `p File.binread(..)`. what's it look like?
<dminuoso>
Yes thats it!
<dminuoso>
My iconv trick must have had a bug. I's the standardized macintosh encoding.
cdg has joined #ruby
<roboncloud>
ah k
<roboncloud>
so what encoding is it?
<dminuoso>
macintosh.
<dminuoso>
That is an actual character encoding it turns out
<dminuoso>
roboncloud: ruby does not have that encoding
<roboncloud>
ahhh
<roboncloud>
bummer =[
kapil___ has joined #ruby
<dminuoso>
roboncloud: the rfc says differently though...
<roboncloud>
ah ok, yea prefer not to start my morning with RFCs.
<dminuoso>
Oh well that was painful
nopolitica has joined #ruby
ana_ has quit [Quit: Leaving]
charliesome has quit [Ping timeout: 248 seconds]
aufi has quit [Ping timeout: 240 seconds]
ana_ has joined #ruby
charliesome has joined #ruby
bmurt has joined #ruby
Polymorphism has joined #ruby
<Polymorphism>
I still love ruby
<Polymorphism>
if I need to make something fast or anything involving web its my go-to
<Polymorphism>
elegant, beautiful, clean
milardovich has joined #ruby
nacsurte has joined #ruby
DTZUZO has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<roboncloud>
most of the time :P
nacsurte has quit [Ping timeout: 276 seconds]
banisterfiend has joined #ruby
raynold has joined #ruby
milardov_ has joined #ruby
jinie_ has quit [Read error: Connection reset by peer]
milardovich has quit [Ping timeout: 260 seconds]
Mon_Ouie has quit [Ping timeout: 255 seconds]
aufi has joined #ruby
Mon_Ouie has joined #ruby
jinie_ has joined #ruby
charliesome_ has joined #ruby
charliesome has quit [Ping timeout: 246 seconds]
jphase has joined #ruby
<dminuoso>
Polymorphism: I wouldnt go as far as calling it clean
konsolebox has quit [Ping timeout: 246 seconds]
ta_ has quit [Remote host closed the connection]
uZiel has quit [Ping timeout: 268 seconds]
charliesome_ has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
InfinityFye has quit [Quit: Leaving]
bmurt has joined #ruby
gnufied has joined #ruby
charliesome has joined #ruby
ana_ has quit [Quit: Leaving]
ana__ has joined #ruby
ana__ has quit [Client Quit]
ana_ has joined #ruby
oleo has joined #ruby
aufi_ has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
uZiel has joined #ruby
ana_ has quit [Remote host closed the connection]
ana_ has joined #ruby
charliesome has quit [Ping timeout: 260 seconds]
charliesome_ has joined #ruby
dymaxion_ has joined #ruby
aupadhye has quit [Ping timeout: 276 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MichaelBurge has quit [Read error: Connection reset by peer]
Joufflu_Fail has joined #ruby
MichaelBurge has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dymaxion_ has quit [Ping timeout: 255 seconds]
bmurt has joined #ruby
statelesscode has quit [Ping timeout: 240 seconds]
eb0t has joined #ruby
__Yiota has joined #ruby
xzhao has quit [Remote host closed the connection]
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
7ITABEAC5 is now known as nug
arne has joined #ruby
<arne>
anyone familiar with faye-websocket?
<gr33n7007h>
anyone know why `int uuid_generate_time_safe(uuid_t out);` works in C but return -1 with ffi bindings?
howdoi has quit [Quit: Connection closed for inactivity]
<arne>
im trying to send a messag eto all websockets, how woulld i do that+
bmurt has joined #ruby
<Papierkorb>
arne: you just keep a list of clients around, and send one to #each
NeverTired has joined #ruby
Guest53 has joined #ruby
polishdub has joined #ruby
<Papierkorb>
arne: in the simplest case, a @@class_var where each client adds itself to on connect, and removes itself on disconnect. That's quite crude, but for fine for prototyping (or getting started)
<arne>
Papierkorb: hmpf, okay
<Papierkorb>
arne: For more production-oriented stuff, I commonly have a ClientManager or similar offering a #broadcast
<arne>
nah it's just a PoC
<arne>
still depressed about the way i have to do this with ruby
<gr33n7007h>
disregard what i just said, i didn't read the man page properly
<Papierkorb>
arne: "about the way"?
<arne>
yes, this is not very clean
<herwin>
which is often true for PoCs
<Papierkorb>
^
dionysus69 has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
Mon_Ouie has joined #ruby
chouhoul_ has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
carnegie has joined #ruby
nopolitica has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ResidentBiscuit has joined #ruby
belmoussaoui has quit [Quit: belmoussaoui]
Mon_Ouie has quit [Ping timeout: 276 seconds]
Joufflu_Fail has quit [Ping timeout: 240 seconds]
carnegie has quit [Ping timeout: 276 seconds]
Mon_Ouie has joined #ruby
bmurt has joined #ruby
Rapture has joined #ruby
hahuang65 has joined #ruby
nopolitica has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang65 has quit [Ping timeout: 248 seconds]
Guest53 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xeago has quit [Ping timeout: 240 seconds]
brahmana has joined #ruby
bmurt has joined #ruby
goyox86 has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
sleetdrop has quit [Quit: Computer has gone to sleep.]
Caerus has joined #ruby
armando has quit [Ping timeout: 255 seconds]
carnegie has joined #ruby
ana_ has quit [Ping timeout: 255 seconds]
armando has joined #ruby
theunraveler has joined #ruby
carnegie has quit [Ping timeout: 240 seconds]
apparition has quit [Quit: Bye]
nopoliti1 has joined #ruby
Burgestrand has quit [Quit: Closing time!]
bruno- has joined #ruby
nopolitica has quit [Ping timeout: 240 seconds]
wkoszek has joined #ruby
xall has joined #ruby
charliesome_ has quit [Ping timeout: 240 seconds]
ski7777 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
Guest53 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
charliesome has joined #ruby
nopoliti1 has quit [Quit: WeeChat 1.9]
ecuanaso has joined #ruby
armando has quit [Ping timeout: 240 seconds]
armando has joined #ruby
ltem has joined #ruby
cdg has quit []
ozcanesen has joined #ruby
ozcanesen has quit [Client Quit]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
armando has quit [Ping timeout: 240 seconds]
armando has joined #ruby
cdg has joined #ruby
universa1 has quit [Read error: Connection reset by peer]
universa1 has joined #ruby
cdg has quit [Client Quit]
charliesome has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
ltem has quit [Quit: Leaving]
mikecmpbll has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyLobo has joined #ruby
armando has quit [Quit: No Ping reply in 180 seconds.]
armando has joined #ruby
runescape07rsps has quit [Ping timeout: 248 seconds]
Fin1te has joined #ruby
cagomez has joined #ruby
setuid has joined #ruby
<setuid>
Is there a web-based ruby profiler, something like jqplay, for testing conditionals, filters, things like that?
cdg has quit []
<setuid>
I'm profiling a conditional change to a stanard if... else... then... test
<setuid>
havenwood: So you recommend NOT using a conditional there? Ok.
<havenwood>
setuid: An if statement is a conditional, no?
cdg has quit [Remote host closed the connection]
npgm has quit [Quit: Connection closed for inactivity]
<setuid>
Well, yes, but not a ternary conditional... I should have clarified
<havenwood>
setuid: You could replace that if statement with a case statement or ternary. They're all conditionals.
<setuid>
I'll make a PR to the code where this was found, using your suggestion
cdg has joined #ruby
<matthewd>
setuid: You still haven't clarified what your goal is. What is your purpose for changing the code at all?
aufi_ has quit [Quit: Leaving]
Xiti has joined #ruby
cwonrails has quit [Remote host closed the connection]
rippa has joined #ruby
wilbert has joined #ruby
<setuid>
matthewd: Just trying to clean up the readability and maintainership, I very much prefer to change a line of code in one place, not two. IOW, if 'foo' becomes 'foobar', I have to change it in two places in the current check, vs. havenwood's example, where I change it in one place.
carnegie has joined #ruby
xuanrui has quit [Quit: Ex-Chat]
Moosashi has joined #ruby
herbmillerjr has joined #ruby
Xeago has joined #ruby
beilabs has joined #ruby
justin_pdx has joined #ruby
saltsa has quit [Quit: Reconnecting]
saltsa has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
cdg has quit []
nimzowitsch has joined #ruby
<nimzowitsch>
hello all
<nimzowitsch>
ip_set: #<Set: {"UNKNOWN"}>
<nimzowitsch>
so I have a have an array of ips, which I then turn into a set
<nimzowitsch>
and then I iterate over the set and delete duplicates from another array
<nimzowitsch>
at the end of the iteration the result is #<Set: {"UNKNOWN"}>
<nimzowitsch>
what gives?
<nimzowitsch>
I've never seen before..
<nimzowitsch>
and could not find anything about it on google
Moosashi has quit [Quit: Moosashi]
eckhardt has joined #ruby
<havenwood>
nimzowitsch: Have you been able to create a minimal reproduction example of the issue yet?
<havenwood>
nimzowitsch: Or can you show the code that results in it?
<havenwood>
>> Set.new << "UNKNOWN"
<ruby[bot]>
havenwood: # => uninitialized constant Set (NameError) ...check link for more (https://eval.in/845675)
<havenwood>
=> #<Set: {"UNKNOWN"}>
<havenwood>
nimzowitsch: It looks like you have one element in your set, the string: "UNKNOWN"
aurelien has quit [Changing host]
aurelien has joined #ruby
Beams has quit [Quit: .]
dlitvak has joined #ruby
beilabs has quit [Read error: Connection reset by peer]
beilabs has joined #ruby
conta has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
beilabs has quit [Remote host closed the connection]
uZiel has quit [Remote host closed the connection]
hahuang65 has joined #ruby
goyox86 has quit [Quit: goyox86]
[Butch] has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
uZiel has joined #ruby
Fin1te has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Quit: WeeChat 1.9]
brw_ is now known as brw
SteenJobs has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
moei has quit [Quit: Leaving...]
johnny56 has quit [Ping timeout: 264 seconds]
MrBismuth has joined #ruby
johnny56 has joined #ruby
t-recx has quit [Quit: t-recx]
brahmana has quit [Ping timeout: 260 seconds]
Joufflu_Fail has joined #ruby
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dviola has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
conta2 has joined #ruby
Tohuw is now known as Guest68958
Guest68958 has quit [Killed (herbert.freenode.net (Nickname regained by services))]
tohuw_ has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ledestin has joined #ruby
jphase has quit [Remote host closed the connection]
bmurt has joined #ruby
jphase has joined #ruby
SeepingN has joined #ruby
uZiel has quit [Ping timeout: 268 seconds]
carnegie has quit [Quit: Leaving...]
theunraveler has quit []
uZiel has joined #ruby
brent__ has quit [Remote host closed the connection]
nopolitica has joined #ruby
brent__ has joined #ruby
xuanrui has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper1 has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
Fin1te has joined #ruby
cahoots has joined #ruby
perniciouscaffei has joined #ruby
benlieb has joined #ruby
creature has joined #ruby
nimzowitsch has quit [Ping timeout: 260 seconds]
<creature>
Hello. I need to generate a lot of unique identifiers. I can do this with a call to `SecureRandom.uuid`, but that "secure" part gives me pause. I'm not worried about the security; speed is more important. Is there a less-secure way to generate UUIDs?
<creature>
(I'm guessing that SecureRandom will back onto the system's entropy pool, and could block if I read a lot of data out of that... but I might be out of date with this knowledge.)
mtkd has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
ski7777 has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
cadillac_ has quit [Read error: Connection reset by peer]
Guest35874 has quit [Ping timeout: 240 seconds]
alamar has joined #ruby
alamar is now known as Guest51933
hanmac has quit [Ping timeout: 246 seconds]
cadillac_ has joined #ruby
ShekharReddy has joined #ruby
Hobbyboy has joined #ruby
NeverTired has quit [Quit: Connection closed for inactivity]
Joufflu_Fail has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
Joufflu_Fail has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kies has joined #ruby
hackeron has quit [Quit: Lost terminal]
hanmac has joined #ruby
dfedde has joined #ruby
dfedde has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
dfedde has joined #ruby
Bock has quit [Ping timeout: 240 seconds]
conta2 has quit [Ping timeout: 246 seconds]
<havenwood>
creature: Internally it'll use the nanosecond from the system clock, etc, to seed openssl then: OpenSSL::Random.random_bytes(n)
<havenwood>
creature: Benchmark it to see the speed.
quobo has joined #ruby
SteenJobs has joined #ruby
SteenJobs has quit [Client Quit]
<creature>
havenwood: Does OpenSSL use /dev/urandom? Can I rely on that behaviour?
goyox86 has joined #ruby
<creature>
My concern is less "Generating a secure random number is going to be too slow", and more along the lines of "If I try to generate a million at once, am I going to inadvertently end up with a million blocking reads on /dev/random?"
<havenwood>
creature: Presuming you have OpenSSL installed?
vedu has left #ruby ["Konversation terminated!"]
Polymorphism has left #ruby ["Leaving"]
Fin1te has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<creature>
Presumably!
<roboncloud>
is that recent for HEAD?
<havenwood>
creature: I'd suggest trying a few million at once. ;-)
<creature>
Mmm. :) I was hoping to find a documented "This might not be crytographically secure, but is definitely non-blocking" method though. (As opposed to "reading the code shows Ruby currently reads from urandom, but I can't guarantee that remaining the case in future.")
<creature>
Thank you for the help! I think I can deal with the knowledge that it backs onto urandom for now.
<creature>
I'm probably being overly cautious.
<roboncloud>
this is frustrating, but when people refuse to read the advice, who cares i guess. /dev/urandom is the second preference, openssl is the last, but read the first preference, it is neither of those
<roboncloud>
it is a function provided by the OS
<creature>
roboncloud: Sorry! I did read the advice, but I guess I missed that nuance to it.
brent__ has quit [Remote host closed the connection]
SuperLag has quit [Quit: Lost terminal]
<roboncloud>
if you hit the first, i think it should be fast, especially on OpenBSD where arc4random is available.
brent__ has joined #ruby
SuperLag has joined #ruby
tvw has joined #ruby
Dimik has joined #ruby
ltem has joined #ruby
moei has joined #ruby
<uZiel>
where can I find documentation of TCPSocket methods?
<roboncloud>
rubydoc.info
DTZUZO has joined #ruby
<uZiel>
that has only a few methods while TCPSocket_Object.methdos lists a lot more
<uZiel>
I am not sure what is the difference bw write, printf, print, putc, puts, syswrite etc.. where to find documentation for these?
SteenJobs has quit [Quit: SteenJobs]
adlerdias has left #ruby [#ruby]
<roboncloud>
http://www.rubydoc.info/stdlib/socket/TCPSocket - it inherits from "IPSocket", so you can check the docs there, and anything else in its inheritance chain, but `.methods()` includes everything it responds to from all ancestors afaik, so it's not a good gauge.
<roboncloud>
sock.method(:printf).owner will tell you what module/class it resolves to
jaequery has joined #ruby
setuid has left #ruby [#ruby]
justin_pdx has quit [Quit: justin_pdx]
tvw has quit [*.net *.split]
hanmac has quit [*.net *.split]
cadillac_ has quit [*.net *.split]
perniciouscaffei has quit [*.net *.split]
jphase has quit [*.net *.split]
MrBismuth has quit [*.net *.split]
dlitvak has quit [*.net *.split]
Xeago has quit [*.net *.split]
wilbert has quit [*.net *.split]
Xiti has quit [*.net *.split]
howdoi has quit [*.net *.split]
Caerus has quit [*.net *.split]
ResidentBiscuit has quit [*.net *.split]
chouhoul_ has quit [*.net *.split]
eb0t has quit [*.net *.split]
MichaelBurge has quit [*.net *.split]
gnufied has quit [*.net *.split]
banisterfiend has quit [*.net *.split]
synthroid has quit [*.net *.split]
Seenox has quit [*.net *.split]
sagax has quit [*.net *.split]
m27frogy has quit [*.net *.split]
djbkd has quit [*.net *.split]
claw has quit [*.net *.split]
PaulCapestany has quit [*.net *.split]
phate408 has quit [*.net *.split]
creeg has quit [*.net *.split]
creature has quit [*.net *.split]
jtperreault has quit [*.net *.split]
MichaelBurge has joined #ruby
creature has joined #ruby
creature has joined #ruby
creature has quit [Changing host]
Xeago has joined #ruby
Caerus has joined #ruby
Xiti has joined #ruby
Seenox has joined #ruby
synthroid has joined #ruby
claw has joined #ruby
gnufied has joined #ruby
cadillac_ has joined #ruby
jphase has joined #ruby
tvw has joined #ruby
chouhoulis has joined #ruby
phate408 has joined #ruby
jtperreault has joined #ruby
chouhoulis has quit [Remote host closed the connection]
Caerus is now known as Guest80368
m27frogy has joined #ruby
djbkd has joined #ruby
redondos has joined #ruby
dlitvak has joined #ruby
howdoi has joined #ruby
MrBismuth has joined #ruby
hanmac has joined #ruby
creeg has joined #ruby
goyox86 has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
eb0t has joined #ruby
theta8 has joined #ruby
PaulCapestany has joined #ruby
<cjohnson>
is foo(&:bar) the same as foo() { |x| x.bar } ?
bokayio has quit [Ping timeout: 240 seconds]
<Papierkorb>
cjohnson: yes
<havenwood>
cjohnson: A bit faster, but yes.
<cjohnson>
Awesome thanks
benjen has quit [Ping timeout: 260 seconds]
jinie has quit [Ping timeout: 260 seconds]
S007 has quit [Ping timeout: 246 seconds]
<cjohnson>
Is it just the & that does that?
<havenwood>
cjohnson: The `&` is sugar that calls #to_proc on the `:bar` symbol.
mtkd has quit [Ping timeout: 260 seconds]
<havenwood>
cjohnson: And passes the result as the block.
<cjohnson>
Ahhhh nice
<uZiel>
roboncloud: thanks
jinie has joined #ruby
benjen has joined #ruby
bokayio has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
<havenwood>
cahoots: It's just missing from the gemspec.
drcode has quit [Read error: Connection reset by peer]
Guest80368 is now known as Caerus
username has quit [Ping timeout: 240 seconds]
mtkd has quit [Ping timeout: 240 seconds]
hutch34 has quit [Ping timeout: 276 seconds]
mtkd has joined #ruby
<havenwood>
cahoots: The author's implicit copyright doesn't prevent you from downloading work they've publicly posted.
ur5us has quit [Ping timeout: 276 seconds]
<matthewd>
Indeed, that logic would make it rather hard to browse the web
Fin1te has joined #ruby
sagax has joined #ruby
dstrunk has joined #ruby
<roboncloud>
more likely you'll have issues with GPL software on rubygems than any 'proprietary' licensing issues.
ResidentBiscuit has joined #ruby
mars777 has joined #ruby
mars777 has quit [Remote host closed the connection]
gusrub has quit [Remote host closed the connection]
hutch34 has joined #ruby
WeiJunLi has joined #ruby
nostalgiccloud has joined #ruby
gusrub has joined #ruby
inoperable has joined #ruby
eckhardt has joined #ruby
SteenJobs_ has joined #ruby
jamesaxl has quit [Quit: WeeChat 1.8]
jphase has quit [Remote host closed the connection]
Caerus has quit [Quit: Leaving]
skweek has quit [Ping timeout: 260 seconds]
jaruga has quit [Quit: jaruga]
SteenJobs_ has quit [Ping timeout: 240 seconds]
eroux has joined #ruby
weaksauce has joined #ruby
jphase has joined #ruby
<dviola>
roboncloud: how so?
Rapture has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dviola>
roboncloud: you mean like in the case of using a GPL library in a proprietary codebase and distributing it?
<roboncloud>
yea
<roboncloud>
for web software i guess it doesn't matter
Guest85042 has joined #ruby
SteenJobs_ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
<roboncloud>
i think you're also obliged to share any improvements you make to GPL code. it's the most complicated and restrictive of open source licenses i've come across, and proprietary licenses generally aren't a thing on rubygems. maybe very rare cases.
jphase has quit [Ping timeout: 246 seconds]
<dviola>
that's because it wasn't created with "open source" in mind, but it was written as a free software license, different terms for different meanings
SteenJobs_ has quit [Ping timeout: 276 seconds]
Rapture has joined #ruby
<cahoots>
havenwood, ah i see, thanks
SteenJobs_ has joined #ruby
<cahoots>
can you believe anyone uses gpl?
dfedde has joined #ruby
<roboncloud>
i avoid it if i can.
<Papierkorb>
dviola: Well of course, Free Software isn't "Open Source" :)
<eam>
you're not obligated to share improvements to gpl code, but you are obligated to provide the source code to anyone you distribute it to
<eam>
it's no more restrictive than any other commercial license
<matthewd>
eam: Except when it's applied to a library
<eam>
nope
<roboncloud>
i think it's less restrictive cos at least you can look at the source and modify it, but in the realm of open source licenses it's more annoying than useful.
<dviola>
the GPL encourages contributions as it is a strong copyleft license, whereas the other licenses have weak copyleft or none at all
<eam>
even with libraries, the GPL is strictly more permissive than the default controls provided by copyright -- it must be, because it leverages copyright
<Papierkorb>
imho, LGPL for libs is quite reasonable
<eam>
often people freak out because "the GPL is viral" or whatever, but they forget that it's actually copyright itself which behaves that way
<matthewd>
eam: You said "any other commercial license", not "unlicensed copyright"
<roboncloud>
dviola a lot of that requires buying into stallmans world view.
dionysus69 has quit [Ping timeout: 240 seconds]
<eam>
matthewd: or unlicensed copyright
<eam>
anything the GPL prohibits, unlicensed use also prohibits
<eam>
it's a strict subset
<dviola>
roboncloud: personally I think his arguments are rational and make sense, proprietary software is a bad thing
<matthewd>
Any standard commercial license for a software library will [in general] permit works using said library to be distributed without their source
<eam>
it has to be, because it derives its authority *from* copyright
<eam>
matthewd: nah, plenty of my licenses don't permit me to distribute at all - only use
SteenJobs_ has quit [Ping timeout: 276 seconds]
Rapture has quit [Ping timeout: 260 seconds]
<matthewd>
You said "any other commercial license". Not "copyright" (which yes, is obviously more restrictive by default), and not "plenty of my licenses".
workmad3 has quit [Ping timeout: 246 seconds]
<roboncloud>
dviola, i'm not arguing for closed source, but i'm not arguing for a license every venture i make, commercial or not, has to be made open source. GPL is fine but if you want the most freedom, to reuse it in commercial setting or not, best to avoid GPL if you can, and i only said it's more troublesome other licenses in context of rubygems.
wilbert_ has joined #ruby
<dviola>
roboncloud: I disagree, there is no reason to fear the GPL unless you want to enslave your users into using proprietary stuff
postmodern has joined #ruby
<roboncloud>
?
<roboncloud>
i just want to offer users fun software
<roboncloud>
that's useful and high quality
<roboncloud>
im not enslaving them and tbh it seems kinda crazy to think that way. there's already a balance that prevents closed source running rampant.
<matthewd>
eam: To be clear, I'm not arguing a "GPL is bad because it's viral" position; I'm arguing "GPL is not strictly as/more permissive than 'any other commercial license'"
jphase has joined #ruby
wilbert has quit [Ping timeout: 240 seconds]
ams__ has quit [Quit: Connection closed for inactivity]
FernandoBasso has quit [Ping timeout: 255 seconds]
Fin1te has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Guest85042 is now known as lxsameer
lxsameer has quit [Changing host]
lxsameer has joined #ruby
guacamole has joined #ruby
nostalgiccloud has quit [Read error: Connection reset by peer]
<cahoots>
let's say i have a gem with a dependency with a version like "~> 1.1", and i want to restrict it to using a specific version, say, 1.1.1. how can i do this?
<roboncloud>
"=1.1.1"
<cahoots>
roboncloud, so would i add that i want the dependency explicitly and give it a specific version in the same file as i specify the gem with that dependency?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
username has joined #ruby
<dviola>
roboncloud: freedom and rights are not crazy things at all
<roboncloud>
Gem::Specification.new { |s| s.add_runtime_dependency "mygem", "=1.1.1" }, maybe just "1.1.1" works. not sure where i'm getting "=1.1.1" from.
SteenJobs_ has joined #ruby
nostalgiccloud has joined #ruby
<cahoots>
hopefully there's an easier way than doing real code
<roboncloud>
@dviola yeah, sure, but i think stallman is just another side of an extreme solution to the problem. open source & business should be able to integrate and work well together, but GPL makes that more diffilcult, other open source licenses are preferable if you want to make money to actually survive in life, before you can worry about the dreamy ideals of mr stallman.
<cahoots>
i was thinking i could do it in the dsl of a Gemfile
SteenJobs_ has quit [Ping timeout: 240 seconds]
nostalgiccloud has quit [Read error: Connection reset by peer]
FernandoBasso has joined #ruby
AnoHito_ has joined #ruby
<roboncloud>
stallman basically never left university, don't forget that. he's had a lot of time dream of an ideal world while not worrying about how to pay his rent. his contribution is still very valuable, but not practical as the ultimate solution.
<dviola>
roboncloud: I don't see it as extreme at all, if anything, his arguments are rational and makes tons of sense, if you read their website you'll see that they are not against businesses or selling software, their whole point is about what your end users *receive* -- do they receive something they can change and fix themselves or share it with others?
goyox86 has joined #ruby
<dviola>
that's the whole point of the GPL license
<matthewd>
cahoots: Yes, you can just specify your own more specific dependency in your Gemfile... though one might wonder why you would want to.
goyox86 has left #ruby [#ruby]
<dviola>
I understand the GPL will conflict with some people's desire to profit though by limiting what users can and cannot do (removing their freedom/rights)
<roboncloud>
i don't think it's practical in the real world, but if he wins and it becomes the main model for software, great, because it would be better.
AnoHito has quit [Ping timeout: 240 seconds]
goyox86_ has joined #ruby
SteenJobs_ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
ecuanaso has joined #ruby
sepp2k has quit [Quit: Leaving.]
nostalgiccloud has joined #ruby
goyox86_ has quit [Ping timeout: 260 seconds]
SteenJobs_ has quit [Ping timeout: 255 seconds]
nostalgiccloud has quit [Read error: Connection reset by peer]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cahoots>
matthewd, just keeping versions constant because our legal team requires all open-source stuff to be approved by them. so if i leave the version open-ended, technically they could release a new version with a different license
<matthewd>
cahoots: Gemfile.lock is probably sufficient for that
nacsurte has joined #ruby
<cahoots>
the way i'm specifying the dependency version is by just listing out that dependency as a separate gem, and it seems to work. is there a better way?
<cahoots>
so i should edit the Gemfile.lock with s/~> /=/ ?
<matthewd>
It is, by definition, a list of exact versions of every package in use
<matthewd>
No, you don't need to edit anything
<cahoots>
the issue is that ~> doesn't restrict it to a single version
<roboncloud>
@dviola yeah stallman is an inspiration.
<matthewd>
List your dependencies with sensible range selectors in Gemfile, then use Gemfile.lock as the list of exact versions in use
<roboncloud>
but when you cross into commercial software, "here's my product, go rebrand it in china, and resell it in hong kong, for free!" doesn't work.
<cahoots>
even when i list out my dependencies in the Gemfile, the Gemfile.lock still shows "~>". but in practice it seems to download the gem i want
<matthewd>
cahoots: The top level under specs: lists all the gems, with the exact version in use. Nested underneath each of those is a copy of that version's stated dependencies.
alfiemax has quit [Remote host closed the connection]
<cahoots>
matthewd, it lists the exact version of the gem, but not the exact version of its dependencies necessarily
<matthewd>
So yes, pry is happy with any coderay ~> 1.1.0, but you're currently using exactly coderay (1.1.1)
<matthewd>
Yes, it does
<matthewd>
Clean out your Gemfile to just list your top-level deps (so no mention of coderay), then bundle to regenerate the lockfile
<matthewd>
It'll disappear from the DEPENDENCIES section, but under specs: you'll still see "coderay (1.1.1)"
cdg_ has joined #ruby
<matthewd>
This is exactly what the lockfile is for: reproducible deployments of a well-defined set of package versions
nacsurte has quit [Ping timeout: 246 seconds]
ecuanaso has joined #ruby
dviola is now known as Guest51898
dviola has joined #ruby
Guest51898 has quit [Ping timeout: 246 seconds]
<dviola>
roboncloud: people have found other ways to still make a profit while working on free software, both things are entirely compatible and were never against each other
synthroid has quit [Remote host closed the connection]
nacsurte has joined #ruby
<dviola>
roboncloud: see all those developers earning money with patreon or Red Hat
<matthewd>
roboncloud: dviola: I think it's time for this conversation to head to #ruby-offtopic
<dviola>
matthewd: ok, agreed
<roboncloud>
"other ways" makes an already difficult venture even more difficult.
cdg_ has quit [Remote host closed the connection]
ShekharReddy has quit [Quit: Connection closed for inactivity]
skweek has joined #ruby
cdg has joined #ruby
minimalism has joined #ruby
cdg_ has joined #ruby
cdg__ has joined #ruby
cdg has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
cdg_ has quit [Ping timeout: 255 seconds]
alfiemax has joined #ruby
tacotime has quit [Ping timeout: 240 seconds]
cahoots has quit [Ping timeout: 260 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FernandoBasso has quit [Ping timeout: 255 seconds]
jaequery has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
cahoots has joined #ruby
alfiemax has quit [Remote host closed the connection]
cdg__ has quit []
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg_ has joined #ruby
hahuang65 has quit [Ping timeout: 276 seconds]
SuperTaz has quit [Ping timeout: 240 seconds]
Azure has quit [Quit: Oops.]
FernandoBasso has joined #ruby
wilbert_ has quit [Ping timeout: 276 seconds]
FernandoBasso has quit [Remote host closed the connection]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
jaequery has quit [Client Quit]
Azure has joined #ruby
ldnunes has quit [Quit: Leaving]
FastJack has quit [Read error: Connection reset by peer]
FastJack has joined #ruby
Sembei has joined #ruby
Fin1te has joined #ruby
Guest3423 has quit [Ping timeout: 240 seconds]
ltem has quit [Quit: Leaving]
TomyLobo has quit [Read error: Connection reset by peer]
dfedde has quit [Read error: Connection reset by peer]
Tharbakim has quit [Read error: Connection reset by peer]
high_fiver has quit [Ping timeout: 246 seconds]
Tharbakim has joined #ruby
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
workmad3 has joined #ruby
kn-928 has joined #ruby
gusrub has quit [Remote host closed the connection]
sinequanon has joined #ruby
alfiemax has joined #ruby
Fin1te has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
sinequanon has quit [Client Quit]
slayman has joined #ruby
alfiemax has quit [Remote host closed the connection]
[Butch] has quit [Quit: I'm out . . .]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
nacsurte has quit [Ping timeout: 248 seconds]
slayman has quit [Quit: Leaving]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
m27frogy has quit [Ping timeout: 240 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has quit [Read error: Connection reset by peer]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
Azure has joined #ruby
seitensei has quit [Ping timeout: 240 seconds]
linduxed has quit [Ping timeout: 246 seconds]
SpComb has quit [Ping timeout: 246 seconds]
alfiemax has quit [Remote host closed the connection]
runescape07rsps has joined #ruby
arthurnn has quit [Ping timeout: 246 seconds]
abort has quit [Ping timeout: 240 seconds]
Guest76516 has quit [Ping timeout: 246 seconds]
alfiemax has joined #ruby
Murda has joined #ruby
abort has joined #ruby
SpComb has joined #ruby
seitensei has joined #ruby
alfiemax has quit [Remote host closed the connection]
gusrub has joined #ruby
linduxed has joined #ruby
arthurnn has joined #ruby
alfiemax has joined #ruby
cahoots has quit [Ping timeout: 240 seconds]
jinie_ has quit [Read error: Connection reset by peer]
Map has joined #ruby
Map is now known as Guest82777
alfiemax has quit [Remote host closed the connection]
Murda has quit [Quit: Murda]
mikecmpbll has quit [Quit: inabit. zz.]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
jinie_ has joined #ruby
alfiemax has joined #ruby
cahoots has joined #ruby
alex`` has quit [Ping timeout: 246 seconds]
t-recx has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
dogman has joined #ruby
alfiemax has quit [Remote host closed the connection]
spheric has quit [Ping timeout: 276 seconds]
<dogman>
hello everyone
alfiemax has joined #ruby
<dogman>
im just begining to learn ruby, and was wondering if i can get some help
runescape07rsps has quit [Quit: Leaving]
alfiemax has quit [Remote host closed the connection]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
<dogman>
i just wrote a very basic HTTP server and based off the book im using they recommend to use the TRAP method. I couldnt really find anything online on what this method does. i understand its a signal but from where is it expectig a signal?
huyderman has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
cdg_ has quit []
elnner has joined #ruby
<Radar>
dogman: do you have some example code for this trap method?
<dogman>
yes on second
justinmcp_ has quit [Quit: No Ping reply in 180 seconds.]
<dogman>
server = WEBrick::HTTPServer.new(:Port => 1234)
<dogman>
trap('INT'){server.shutdown}
<dogman>
server.mount '/',Myservlet
<dogman>
server.start
alfiemax has quit [Remote host closed the connection]
justinmcp has joined #ruby
alfiemax has joined #ruby
aglorei1 has quit [Ping timeout: 268 seconds]
<Radar>
That looks to be calling the Kernel#trap method. It will catch Ctrl+C or interrupt signals sent to your process and gracefully shut down your server.
<Radar>
Try commenting out that line, running the program and then hitting Ctrl+C. Look at how the behaviour differs.
alfiemax has quit [Remote host closed the connection]
huyderman has joined #ruby
AndBobsYourUncle has joined #ruby
nacsurte has joined #ruby
aglorei1 has joined #ruby
<roboncloud>
💪 webrick
<dogman>
Radar: ahh ok i see now. thank you. so 'INT' is interpreted by the kernel then. would i be able to find different possible params to the method, or is it kernel specific?
carnegie has joined #ruby
<Radar>
>> Signal.list
<ruby[bot]>
Radar: # => {"EXIT"=>0, "HUP"=>1, "INT"=>2, "QUIT"=>3, "ILL"=>4, "TRAP"=>5, "ABRT"=>6, "IOT"=>6, "FPE"=>8, "KILL ...check link for more (https://eval.in/845698)
<Radar>
dogman: depends on your operating system too
<Radar>
Signal.list in your irb console might return a different list to that one.
alfiemax has joined #ruby
<dogman>
thats great thank you again...and yeah i see the list
xuanrui has quit [Ping timeout: 248 seconds]
alfiemax has quit [Remote host closed the connection]
uZiel has quit [Ping timeout: 268 seconds]
dogman has quit [Quit: leaving]
WeiJunLi has quit [Remote host closed the connection]
ur5us has quit []
nadir has quit [Quit: Connection closed for inactivity]
hahuang65 has joined #ruby
nostalgiccloud has joined #ruby
jphase has quit [Remote host closed the connection]
ur5us has joined #ruby
jphase has joined #ruby
biberu has quit []
m27frogy has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
ecuanaso has joined #ruby
jphase has joined #ruby
<zenspider>
also `kill -l`
m27frogy has quit [Ping timeout: 240 seconds]
m27frogy has joined #ruby
guacamole has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
SeepingN has quit [Ping timeout: 255 seconds]
<Cyrus>
So a common pattern in my code is to define an empty array before iterating through an Enumerable and then appending the result of a method called from within the Enumerable's block into the array. I feel like maybe there's a better more Rubyesque way to handle this common need/pattern?
<elomatreb>
I know rspec is a little unpopular here, but I'll ask anyway: Does anyone know a way to group examples (and have before/after and subject) without having to give that grouping a name (like context does)?
<Papierkorb>
elomatreb: isn't the context name optional?