havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.2, 2.3.5 & 2.2.8: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
jrabe has quit []
<nymous> i want to write an app which pool external services and sends the results elsewhere
<nymous> *which polls
<nymous> sorry
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrabe has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
<nymous> my dumb approach is to spawn several threads, wait them to complete and repeat
charliesome has joined #ruby
chouhoul_ has joined #ruby
<nymous> it doesn't really work, because from time to time one of the polled services just stuck, so as my thread and whole app
<havenwood> nymous: you could write a little thread pool - or the concurrent-ruby gem has some nice thread pool implementations
<nymous> ok, i need a timeout then
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nymous> havenwood: the concurrent-ruby is the main reason i'm asking here if i want something weird
<nymous> their thread pool is ok
<havenwood> a few HTTP gems, like Typhoeus, well-handle concurrent requests for you
troys is now known as troys_
<havenwood> nymous: typhoeus gem
<havenwood> >.>
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nymous> well, back to concurrent-ruby
chouhoulis has quit [Ping timeout: 260 seconds]
<nymous> i can send my polling jobs to it's thread, but i can't control it
<nymous> all i can do is to just shutdown the pool and wait for termination
<nymous> i can't just kill the stuck thread
<nymous> well, timertask looks ok
<nymous> but it is broken and seems abandoned, because it has registered issues since 2016 still not fixed
<havenwood> nymous: many thread pool implementations (like Puma's) have a reaper
<nymous> i've also tried a countdownlatch
<nymous> it works, it allows me to pull jobs to pool and wait just the needed time
<nymous> but again, i can't kill stuck threads
<nymous> am i really doing something weird?
<nymous> i don't want to mess with something complex like promises framework or celluloid
<havenwood> nymous: How about Typhoeus?
cagomez has quit [Remote host closed the connection]
<havenwood> it's a libcurl wrapper with built-in parallelism and will wait for request finishes - it *just works*
<havenwood> nymous: you could use the puma/thread_pool, it's general purpose enough
<nymous> well, mine problem is not just a http request
cagomez has joined #ruby
<havenwood> link the concurrent-ruby issue you're running into?
fmcgeough has quit [Quit: fmcgeough]
<nymous> using puma which is a http server doesn't sounds good to me too
<havenwood> i don't mean all of puma, just its thread pool
cagomez has quit [Read error: Connection reset by peer]
neachdainn has joined #ruby
<neachdainn> Hey all. I'm trying to write a function that can take either a Hash or a Symbol. How do I detect if something is a symbol and, if it is, convert it to {:Symbol => nil}?
<nymous> i also added one myself
<nymous> neachdainn: is_a?
<nymous> havenwood: you mean just borrow a piece of puma?
lxsameer has quit [Ping timeout: 255 seconds]
<nymous> not a well programming practice though
<neachdainn> nymous: Is that idiomatic Ruby?
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marr has quit [Ping timeout: 248 seconds]
<neachdainn> I thought Ruby was more Duck typing than that.
<nymous> neachdainn: a = :a; a.is_a?(Symbol)
MrBusiness has joined #ruby
<havenwood> nymous: well, it's a battle-tested, general purpose thread pool: require 'puma/thread_pool'
cdg has joined #ruby
<havenwood> I'd like it if there were one in the stdlib.
<nymous> i don't feel like i want to have a dependency on http server for running a cli script
<havenwood> sure
<havenwood> nymous: you're running into all three issues? yikes
ap4y1 has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
cdg has quit [Ping timeout: 248 seconds]
CrazyEddy has joined #ruby
RickHull has joined #ruby
<havenwood> nymous: well, it seems worth fixing those issues
<nymous> i'd want to be able to control threads in the thread pool
<havenwood> control them how?
<nymous> not just killing them all
<havenwood> how, other than killing the dead ones?
<havenwood> what do you want to do?
<havenwood> like stats on them or?
<nymous> like with countdownlatch
<RickHull> why do we call the dynamic region of address space "the heap"? how is it related to a heap data structure, as in heapsort?
<nymous> i mean, if i pass 10 threads to a pool, 3 of them stuck
<RickHull> i've been reviewing on wikipedia and google, and it's not quite apparent
jaruga has joined #ruby
down has joined #ruby
<nymous> i'll get released from latch by timeout
kies has quit [Remote host closed the connection]
<nymous> but but but
<nymous> 3 stuck threads would remain stuck
<nymous> and i don't know any good option on how to kill them without killing the whole pool
PresidentBiscuit has joined #ruby
down has quit [Remote host closed the connection]
kies has joined #ruby
5EXAALCIP has quit [Quit: 5EXAALCIP]
<nymous> RickHull: if you familiar with assembly language, that's easy. you have static memory, which is allocated on compile time, and dynamic - which is allocated by OS by request
down has joined #ruby
<RickHull> right -- so how does that relate to a heap data structure?
<imode> it doesn't.
__Yiota has joined #ruby
<imode> kind of a confusing nomenclature.
<RickHull> that's kind of what I've been leaning towards
<imode> essentially, memory is leased out to a given program in blocks dependent on the allocation strategy that the OS uses.
<RickHull> in program address space, the stack area is for the call stack, which clearly relates to the stack data structure
<imode> intel's MMU makes this really easy. the heap datastructure is just used for sorting frequently used or least used elements. very different.
ap4y1 has quit [Quit: WeeChat 1.9.1]
orbyt_ has joined #ruby
<RickHull> perhaps the heap data structure tracks the largest segment of memory in "the heap"
<imode> not really.
<RickHull> dangit
kies has quit [Ping timeout: 255 seconds]
lacour has joined #ruby
<RickHull> that just takes you (back) to C#dynamic memory mgmt
<imode> it does, and if you go down to heap-based and click on "heap", it refers to the link I just posted. :P
<RickHull> it's an old/invalid anchor tag
alfiemax has joined #ruby
down has quit [Client Quit]
<RickHull> yup, lovely self referential loop
<imode> all memory allocation essentially just relies on having a gigantic slab of free memory, segmenting it however you'd like and flagging it as "in-use".
<imode> I remember writing my first allocator. I had to store metadata about each block, but I could resize the blocks by tweaking a macro.
<imode> slab allocation is what the linux kernel uses iirc.
<RickHull> i could still imagine that some layer of the implementation might use a heap to track the largest regions not in use
<imode> it doesn't. sorry.
<imode> "the heap" and "a heap" are two different things.
ap4y1 has joined #ruby
<RickHull> arghlebargh
<imode> resign yourself to the idea that the standards folks (and the rest of us that follow K&R) like to use weird terms. :P
ap4y1 has quit [Client Quit]
ap4y1 has joined #ruby
jameser has joined #ruby
<RickHull> how long should it take to insert 999 items in a heap in ruby? more than a minute?
enterprisey has joined #ruby
<nymous> having a little bit knowledge of assembly language make you understand many concepts behind c/c++ easier
<nymous> i guess the whole ruby program is residing and executing in a heap
<SeepingN> "items"
<RickHull> say rand(999) into a max-heap
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has quit [Remote host closed the connection]
MrBusiness has quit [Quit: https://www.youtube.com/watch?v=xIIqYqtR1lY -- Suicide is Painless - Johnny Mandel]
Freshnuts has joined #ruby
MrBusiness has joined #ruby
<RickHull> hmmm... seems to be maybe just a problem in irb
nofxx has quit [Ping timeout: 252 seconds]
<nymous> it's probably not worse than just creating 999 objects in ruby itself
<nymous> the delay might be caused by random, because generating random numbers is not very cheap task
knight33 has joined #ruby
jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
<RickHull> oh, it looks like the problem in irb is generating and displaying the #inspect string
<nymous> also you might have flaws in your algo for heap itself
<nymous> loops or something like that
<nymous> btw idk why you need to implement heap structure in ruby
<nymous> because most of the time you want need to implement such low-level algorigthms there
<nymous> *won't
<RickHull> academic, mostly
alnewkirk has joined #ruby
alfiemax has quit [Remote host closed the connection]
<nymous> because ruby does all this things internally
<RickHull> I'm looking at https://github.com/kanwei/algorithms
<RickHull> and I think I've determined it's likely just waiting on the #inspect string to display
<imode> so time it.
<nymous> add simple puts Time.now before and after #inspect and you'll see
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alnewkirk has quit [Ping timeout: 240 seconds]
oncall-pokemon has joined #ruby
<RickHull> the stack overflow example shows timing; it doesn't look susceptible to the #inspect issue I ran into
<RickHull> I am seeing similar results to stack overflow
<imode> something something profiling.
ramfjord has quit [Ping timeout: 248 seconds]
nofxx has joined #ruby
<nymous> havenwood: puma's reaper does a little bit different thing
nofxx has quit [Read error: No route to host]
kernelPaniq has quit [Ping timeout: 246 seconds]
<nymous> damn, i need a simple thing - push a job and check it's status afterwards
__Yiota has joined #ruby
qualityaddict has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Luyt has quit [Ping timeout: 255 seconds]
chouhoulis has quit [Remote host closed the connection]
<nymous> future looks good, but can't kill it
cdg has joined #ruby
latemus has quit [Ping timeout: 246 seconds]
PresidentBiscuit has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 1.9.1]
pilne has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
eckhardt has joined #ruby
chouhoulis has joined #ruby
cdg has quit [Ping timeout: 258 seconds]
cschneid_ has joined #ruby
latemus has joined #ruby
latemus is now known as Guest25738
<nymous> i don't get it
<nymous> you can't even cancel a running future
nofxx has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<neachdainn> Why does `def foo(&block) { [].push(&block) }` always return an empty list?
<Radar> does push take a block?
<neachdainn> I'm trying to store the block to call later
<basket> neachdainn: Try [].push(block)
<basket> The ampersand means to give it as a block to push
<Radar> ^&
<neachdainn> Oooh. Thanks!
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kies has joined #ruby
irated is now known as pryorda
John__ has joined #ruby
<neachdainn> Another noob question: Why does `@foo = Hash.new([]); @foo[:key].concat([12])` never update @foo?
hanmac has joined #ruby
postmodern has joined #ruby
vee__ has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
<RickHull> you generally do something like @foo[:key] = blahblah to update the hash
jordanm_ has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
<basket> neachdainn: You are setting the default value for @foo to an empty array. Then, you're destructively adding 12 to that default value. After h = Hash.new([]), h[:key] returns the default value list
<basket> You push 12 to it, so now the default value is [12], h[:key] and h[:foo] and h[:asdf] will all return the same instance
<neachdainn> So if I want the values to be arrays and I want to concat to those arrays, what's the best way to do this?
<neachdainn> Hash.fetch?
d^sh has joined #ruby
<neachdainn> That does seem to work
Technodrome has joined #ruby
<basket> neachdainn: Yes, I would use Hash#fetch
AndBobsYourUncle has quit [Quit: Textual IRC Client: www.textualapp.com]
<RickHull> you may want instead Hash.new { |hsh, key| hsh[key] = [] }
<nymous> looks like i'll end up re-implementing thread with a reaper
<nymous> *thread pool
<Guest25738> i have a login shell for a unix account set to run a ruby script. if i hit ctrl C, the user logs off when the script terminates. but ruby prints an error trace to stdout first, disclosing the full path of the script. how do i disable that error trace?
<nymous> do a rescue?
<nymous> a trap handler?
<Guest25738> kthx
<RickHull> Signal.trap("INT") { puts "goodbye" }
<Guest25738> RickHull: awesoem, thank youk
<RickHull> you can trap SIGTERM too maybe
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
vee__ has joined #ruby
kies has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
dc3 has quit [Ping timeout: 240 seconds]
<neachdainn> How do I have a hash retain only the specified keys?
gizmore|2 has joined #ruby
mim1k has joined #ruby
<neachdainn> Wait. `delete`. I was looking for `remove`, `retain`, or `filter`.
gizmore has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
ledestin has joined #ruby
cdg has joined #ruby
Luyt has joined #ruby
nymous has quit [Quit: RAGING AXE! RAGING AXE!]
cdg has quit [Ping timeout: 252 seconds]
uZiel has quit [Ping timeout: 248 seconds]
alexertech has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jordanm_ has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
ap4y1 has quit [Quit: WeeChat 1.9.1]
ap4y1 has joined #ruby
<Guest25738> i guess i should read up on signals
<Guest25738> the time has finally come
minimalism has joined #ruby
gusrub has joined #ruby
dviola has joined #ruby
Luyt has quit [Ping timeout: 248 seconds]
shinnya has quit [Ping timeout: 252 seconds]
Luyt has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
alfiemax has quit [Remote host closed the connection]
uZiel has joined #ruby
d^sh has joined #ruby
chrisgopher has joined #ruby
SeepingN has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
xco_ has joined #ruby
xco_ is now known as xco
<xco> how do i check the truthiness or falsiness of 1 and 0 in ruby?
CrazyEddy has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
xco has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has joined #ruby
PaulCapestany has joined #ruby
xco has joined #ruby
imode has quit [Ping timeout: 240 seconds]
tastytf has joined #ruby
cschneid_ has quit [Remote host closed the connection]
mjolnird has quit [Quit: Leaving]
alfiemax has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
whippythellama has quit [Quit: WeeChat 1.4]
cschneid_ has joined #ruby
erlend has quit [Ping timeout: 246 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
xco has quit [Ping timeout: 240 seconds]
erlend has joined #ruby
jrafanie has joined #ruby
chrisgopher has quit [Remote host closed the connection]
<Guest25738> i cant get a repl to handle SIGWINCH or SIGQUIT
impermanence has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
enterprisey has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
xco has joined #ruby
alnewkirk has joined #ruby
alfiemax has joined #ruby
moei has quit [Read error: Connection reset by peer]
moei has joined #ruby
<RickHull> repls may have some of their own sig handling trickery
cschneid_ has joined #ruby
Xiti has quit [Ping timeout: 240 seconds]
alnewkirk has quit [Ping timeout: 260 seconds]
<RickHull> xco: 0.upto(5) { |i| puts "#{i} is false" unless i }
elcontrastador has quit [Ping timeout: 264 seconds]
<RickHull> xco: IIRC everything is true except nil and false
alfiemax has quit [Ping timeout: 260 seconds]
PresidentBiscuit has joined #ruby
<RickHull> Guest25738: sudo make me a SIGWINCH
quobo has quit [Quit: Connection closed for inactivity]
<RickHull> Guest25738: you can make a small ruby script that first registers the various signal traps, then loops over a short sleep
<xco> RickHull: danke
jameser has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
<RickHull> Signal.trap("INT") { puts "got SIGINT"; exit 1 }; loop { sleep 1 }
dviola has quit [Quit: WeeChat 1.9.1]
Xiti has joined #ruby
<RickHull> then send that process whatever signals you want
<RickHull> i'm not sure if signals interrupt sleep; kinda doubt it
neachdainn has left #ruby ["WeeChat 1.9.1"]
Trynemjoel has quit [Quit: Quitting]
chouhoulis has joined #ruby
fullstack has quit [Ping timeout: 248 seconds]
Trynemjoel has joined #ruby
sonOfRa has quit [Ping timeout: 255 seconds]
fullstack has joined #ruby
universa1 has quit [Ping timeout: 246 seconds]
cschneid_ has joined #ruby
xco has quit [Ping timeout: 240 seconds]
gusrub has quit []
xco has joined #ruby
oncall-pokemon has quit [Quit: Connection closed for inactivity]
cschneid_ has quit [Ping timeout: 258 seconds]
universa1 has joined #ruby
sonOfRa has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
alfiemax has joined #ruby
PresidentBiscuit has quit []
<RickHull> is there any good/reasonable way to attempt to bench ruby code in terms of ops/instructions, invariant of wall clock time?
alfiemax has quit [Ping timeout: 258 seconds]
xco has quit [Ping timeout: 258 seconds]
<RickHull> or invariant (within reason) of the underlying hardware capability (cpu, clock speed, etc)
gix- has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
elsevero has joined #ruby
gix has joined #ruby
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cschneid_ has quit [Ping timeout: 252 seconds]
elsevero has quit [Quit: elsevero]
oncall-pokemon has joined #ruby
xco has joined #ruby
elsevero has joined #ruby
fullstack has quit [Ping timeout: 240 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
imode has joined #ruby
fullstack has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Ping timeout: 252 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
xco has joined #ruby
xuanrui has joined #ruby
elsevero has quit [Ping timeout: 248 seconds]
TheRock2 has joined #ruby
<TheRock2> Is that true ?? People in NodeJs say Ruby is not better
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Ping timeout: 252 seconds]
cschneid_ has joined #ruby
chouhoul_ has joined #ruby
Cohedrin_ has joined #ruby
nicesignal has quit [Remote host closed the connection]
impermanence has joined #ruby
nicesignal has joined #ruby
<RickHull> TheRock2: is what true?
chouhoulis has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
<TheRock2> They said Ruby is not as good as NodeJS and you have forgotten to implement semicolon
mim1k has joined #ruby
bauruine has quit [Ping timeout: 240 seconds]
<basket> TheRock2: I knew we were missing something
<TheRock2> there you go
<RickHull> we prefer symbolcolons
<RickHull> away with hashrockets!
mim1k has quit [Ping timeout: 258 seconds]
pilne has quit [Quit: Quitting!]
xco has joined #ruby
bauruine has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
cdg has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
cdg has quit [Ping timeout: 252 seconds]
xco has quit [Ping timeout: 248 seconds]
xco has joined #ruby
qualityaddict has quit [Quit: Leaving]
xco has quit [Ping timeout: 248 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<chaos95> the solution is to use the semicolon and then write a script to preprocess all your ruby and remove trailing semicolons prior to running it
xco has joined #ruby
Guest17172 has joined #ruby
<Guest17172> hi
<Guest17172> Python as first programming language,is it good ?or ruby is better as first language?anyone have any experience with this matter?
<imode> python is commonly cited as a good introductory programming language, and I used to hold the opinion that it was.
<TheRock2> they told me the best languag is nodejs
<imode> but ruby won me over, mainly because of the flexibility in syntax and how much it actually resembles pseudocode.
<basket> Guest17172: They're both fine, pick whatever your friends use, or you have a book that looks good for, or flip a coin
<imode> it's fun to sketch out ideas in ruby rather than python, and you aren't punished as much in ruby.
<basket> Just pick something and start making things
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<basket> That's the best way to learn; learning other languages later will be easy
<RickHull> give it a month, then switch or stay :)
<imode> I'd say give it a week.
<imode> programming languages are so opinionated. :P
<Guest17172> thank you guys,for some one learning ruby,does this room helps in getting familiar with it?
<basket> Guest17172: Yes, you can ask anything you're having trouble with and people will help.
<TheRock2> but how do you know the end of a line without semicolon
jinie has quit [Ping timeout: 248 seconds]
xco has quit [Ping timeout: 240 seconds]
<RickHull> there is a character called newline
<RickHull> a shady character indeed
jinie has joined #ruby
<TheRock2> but im used to write my code in a single line
<vstemen> LoL
cschneid_ has joined #ruby
<RickHull> you can use semicolons for that
<vstemen> TheRock2, ruby allows that.
<TheRock2> so, i can use a semicolon in that case
DTZUZU has quit [Ping timeout: 240 seconds]
troys_ is now known as troys
DTZUZU has joined #ruby
TheRock2 has quit []
xco has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
uZiel has quit [Remote host closed the connection]
alexertech_ has joined #ruby
eckhardt has joined #ruby
<Guest17172> i did few exercises in LPTHW but in python related irc rooms here i couldnt type and no one is tying anything,i think its good to have iwhere pople talk about language you are learning,is that right?
alexertech has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
alexertech_ has quit [Ping timeout: 260 seconds]
<basket> Guest17172: I think in #python you need to be registered with NickServ
<Guest17172> basket:thats why i cant see if people are typing?
<basket> Guest17172: I think it forwards you to an entirely different room if you're not registered
CrazyEddy has joined #ruby
CrazyEddy has joined #ruby
CrazyEddy has quit [Changing host]
<Guest17172> basket:it does to #python-unregistered,but i only see''he have joined the room,,ve left the room''is this because of not registering,,or people are typing anything?
<Guest17172> are not*
<Guest17172> ^
<basket> Guest17172: Probably just no one talks in #python-unregistered very much, I don't know. People do talk in #python
alnewkirk has joined #ruby
<basket> Guest17172: If you don't want to register then you might as well learn Ruby so that you'll have here :)
<Guest17172> basket:you are right i guess,what is good book for a newbie?by zed shaw,,lrthw?
mim1k has joined #ruby
apeiros_ has joined #ruby
<basket> Guest17172: I've never read it but I've heard from some people who liked it, you should give it a shot
<Guest17172> ty
<Guest17172> i think i should have some tea to recharge myself
<Guest17172> and it is Diwali today
<basket> What is Diwali?
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<Guest17172> India's biggest festival,festival of lights
alnewkirk has quit [Ping timeout: 240 seconds]
ap4y1 has quit [Ping timeout: 248 seconds]
mim1k has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
apeiros_ has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
AnoHito has quit [Ping timeout: 248 seconds]
Guest17172 has left #ruby [#ruby]
tastytf has quit [Ping timeout: 240 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nopolitica has joined #ruby
troys has quit [Quit: Bye]
jenrzzz has quit [Ping timeout: 258 seconds]
nopolitica has quit [Client Quit]
nopolitica has joined #ruby
CrazyEddy has quit [Ping timeout: 240 seconds]
CrazyEddy has joined #ruby
CrazyEddy has quit [Changing host]
CrazyEddy has joined #ruby
ur5us has quit [Remote host closed the connection]
xco has quit [Ping timeout: 255 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
eckhardt has joined #ruby
cschneid_ has joined #ruby
jphase has joined #ruby
alfiemax has joined #ruby
djbkd has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
jphase has quit [Ping timeout: 252 seconds]
Bock has joined #ruby
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
knight33 has joined #ruby
knight33 has quit [Client Quit]
eckhardt has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Phate has joined #ruby
phate408 has quit [Ping timeout: 255 seconds]
Qiong` has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
cschneid_ has joined #ruby
dhollinger has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
apeiros_ has joined #ruby
jameser_ has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 258 seconds]
ramfjord has joined #ruby
oncall-pokemon has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 258 seconds]
dhollinger has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
basket has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
Defenestrate has joined #ruby
Defenestrate has quit [Changing host]
Defenestrate has joined #ruby
apeiros_ is now known as apeiros
Defenestrate has quit [Client Quit]
impermanence has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
cschneid_ has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
alfiemax has joined #ruby
AnoHito has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
alex`` has joined #ruby
dionysus69 has joined #ruby
cschneid_ has joined #ruby
cdg has joined #ruby
tastytf has joined #ruby
lacour has quit [Quit: Leaving]
cschneid_ has quit [Ping timeout: 246 seconds]
postmodern has quit [Quit: Leaving]
neuraload has joined #ruby
cdg has quit [Ping timeout: 255 seconds]
ana_ has joined #ruby
conta has joined #ruby
elsevero has joined #ruby
jameser has joined #ruby
elsevero has quit [Client Quit]
jameser_ has quit [Ping timeout: 240 seconds]
brent__ has quit [Quit: Connection closed for inactivity]
rippa has joined #ruby
Bock is now known as LocaMocha
mjolnird has joined #ruby
neuraload has quit [Read error: Connection reset by peer]
neuraload has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
enterprisey has quit [Ping timeout: 260 seconds]
govg_ has joined #ruby
govg has quit [Ping timeout: 255 seconds]
alnewkirk has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
andikr has joined #ruby
alnewkirk has quit [Ping timeout: 240 seconds]
ta__ has quit [Remote host closed the connection]
enterprisey has joined #ruby
kies has joined #ruby
SeepingN has joined #ruby
cschneid_ has joined #ruby
dhollinger has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
kies has quit [Remote host closed the connection]
kies has joined #ruby
claudiuinberlin has joined #ruby
hs366 has joined #ruby
mjolnird has quit [Quit: Leaving]
mjolnird has joined #ruby
mjolnird has quit [Remote host closed the connection]
Burgestrand has joined #ruby
mjolnird has joined #ruby
<neuraload> !books
<dminuoso> neuraload: ?books
mark_66 has joined #ruby
<dminuoso> ?books neuraload
<ruby[bot]> neuraload: You can find a list of recommended books at http://ruby-community.com/pages/links
Technodrome has joined #ruby
ta has joined #ruby
megamos has joined #ruby
cschneid_ has joined #ruby
Freshnuts has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
megamos has quit [Ping timeout: 248 seconds]
genta has joined #ruby
ramfjord has joined #ruby
jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
biberu has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
al2o3-cr has quit [Ping timeout: 240 seconds]
AnoHito has quit [Ping timeout: 252 seconds]
Silthias has joined #ruby
quobo has joined #ruby
Silthias2 has quit [Ping timeout: 260 seconds]
<Guest25738> i see on ruby-doc.org/core-1.9.3/Time.html that i can use Time.at() to convert epoch time to a time string, but how do i convent a UTC time string to epoch time?
alex`` has quit [Ping timeout: 252 seconds]
AnoHito has joined #ruby
<Guest25738> nm, thanks
<Burgestrand> Guest25738 stdlib has additional methods for time, including Time.parse and Time.strptime (more strict0
dc3 has joined #ruby
<Guest25738> Burgestrand: cool. i just saw DateTime.parse, good to know that stdlib hase the same
<Burgestrand> Guest25738 `require "time"` to get the additional methods
<Guest25738> kk
<Guest25738> perfect, thank you
cschneid_ has joined #ruby
alfiemax has joined #ruby
<Burgestrand> Guest25738 small caveat, ruby's not very good in dealing with time zones, might need a ruby gem if you want to juggle those around and convert back and forth
<Cork> anyone know of a ipv6 cidr validation lib for ruby?
<Guest25738> Burgestrand: np, thanks for the heads up
Immune has quit [Ping timeout: 248 seconds]
marr has joined #ruby
cschnei__ has joined #ruby
John__ has quit [Ping timeout: 252 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
imode has quit [Ping timeout: 252 seconds]
cschnei__ has quit [Ping timeout: 252 seconds]
<dminuoso> Cork: What kind of "validation" are you looking for?
genta has left #ruby ["Leaving..."]
<Cork> dminuoso: just that the syntax is valid
bruno- has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
<Cork> so not something like fe80:::/64 or thinks like that
<dminuoso> Cork: IPAddr.new
<Cork> hmm so with a rescue then, ya ok, thx
<dminuoso> Cork: If you prefer something without an exception. just look at its implementation - it's written in pure ruby.
mim1k has joined #ruby
<Cork> ya, been hunting for a good regex but haven't found one that doesn't reject valid cidrs
<dminuoso> Cork: You can't sensibly parse this with a regex I think.
<dminuoso> This is how Ruby does it.
<Cork> ya, the story of ipv6 :D
<dminuoso> But I think just using IPAddr.new is much easier. ;)
<dminuoso> Ohh! Wait!
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> It's private, but that shouldn't stop you :D
lxsameer has joined #ruby
<Cork> ooh, nice
<Cork> dminuoso: thx!
<dminuoso> Cork: It also refers 2 regular expressions that are used in conjunction.
<Cork> ya, i see and its prob what i will be using :)
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RickHull has quit [Ping timeout: 260 seconds]
<apeiros> dminuoso: I assume there's a BNF for that, if there's a BNF, it's (usually) convertible to a regex :)
<dminuoso> apeiros: already checked the rfc
<apeiros> some kinds of BNFs allow for recursions which are not possible to implement in all regex engines, though.
<apeiros> or at least I've a vague memory telling me that :D
<apeiros> rfc without a bnf?
n13z has quit [Ping timeout: 248 seconds]
claudiuinberlin has joined #ruby
cschneid_ has joined #ruby
<matthewd> %r{(?!.*:::)(?!.*::.*::)\A[0-9a-f]{0,4}(:[0-9a-f]{0,4}){2,7}(/(\d\d?|1[01]\d|12[0-8]))?\z}i maybe? ¯\_(ツ)_/¯
cgfbee has quit [Remote host closed the connection]
<apeiros> I shall propose that an rfc MUST contain a BNF of some sorts, lest it'll be summarily rejected!
<matthewd> I'm sure someone somewhere has written a real one, instead of me just throwing some characters together off the top of my head
<apeiros> matthewd: [0-9a-f] -> \h
<matthewd> apeiros: hah, I hesitated on whether such a thing existed, but then didn't want to bother to go check :P
<apeiros> it hasn't existed all the time iirc
enterprisey has quit [Read error: Connection reset by peer]
<apeiros> don't know when it was added, but I'm pretty sure I had looked for it years ago and it didn't exist back then. only learnt it now does exist a few months ago.
<dminuoso> apeiros: %r{[0-9a-f:/]+} looks good.
alfiemax has quit [Ping timeout: 240 seconds]
<apeiros> interesting negative lookaheads :D
<dminuoso> matthewd: What's your take on Proc#* that we have been discussion before?
<dminuoso> Do you think a feature request would be sensible?
cschneid_ has quit [Ping timeout: 252 seconds]
<apeiros> weeeell, I should be fixing a bug
<apeiros> after all, I don't get paid for interesting chatter about ipv6 regexen :( (I should be, though!)
<dminuoso> apeiros: Just find a clint in need of ipv6 regular expressions!
<apeiros> that's a too narrow type of work I fear :<
<matthewd> dminuoso: I think I'm just not a fan of that style of composition in general
<apeiros> I want to be paid for all kinds of explorative programming and interesting chatter
alfiemax has joined #ruby
cgfbee has joined #ruby
<matthewd> dminuoso: To me it's neat, but in practice I find it more confusing to have the passed-through arguments unmentioned
<dminuoso> matthewd: I suppose it does suffer when there's no static type checking enforcing that two procs are really compatible.
<dminuoso> (Not an attempt to complain about Ruby, but I think your point is valid)
Beams has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
paranoicsan has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alnewkirk has joined #ruby
mjolnird has quit [Quit: Leaving]
Heph_ has joined #ruby
Freshnuts has joined #ruby
alnewkirk has quit [Ping timeout: 248 seconds]
alfiemax has quit [Ping timeout: 248 seconds]
dhollin3 has joined #ruby
href has joined #ruby
<href> hello!
<href> I'm bundling some server as a gem, and I'd like to expose some rake tasks of it into its own binary. How can I achieve that ?
Serpent7776 has joined #ruby
<href> pretty much in the same way rails did on rails 5. I'm not bundling the code so can't run "rake" in production
<dminuoso> href: check out Rake::Task#[]
<dminuoso> err
<dminuoso> Rake::Task.[]
<dminuoso> &ri Rake::Task.[]
<`derpy> No results
shinnya has joined #ruby
dhollinger has quit [Ping timeout: 252 seconds]
Freshnuts has quit [Quit: Leaving]
<href> dminuoso: yeah. Speaking of rails5 made me think at having a look at how they did that :) looks easy, thanks
guille-moe has joined #ruby
dc3 has quit [Read error: Connection reset by peer]
dc3 has joined #ruby
alfiemax has joined #ruby
ioggstream has joined #ruby
<ioggstream> hi @all
aufi has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
neuraload has quit [Quit: Leaving]
alex`` has joined #ruby
Burgestrand has quit [Quit: Closing time!]
impermanence has joined #ruby
impermanence has quit [Client Quit]
zeitchef has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
nofxx has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bruno- has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
claudiuinberlin has joined #ruby
mjolnird has joined #ruby
<dminuoso> I find that perl'ism of using @ to denote that all must be an array offensive.
ramfjord has quit [Ping timeout: 255 seconds]
<elomatreb> Could just be an instance variable of this instance of IrcChannel
<dminuoso> I forgot ruby had instance variables, sorry.
<dminuoso> ;)
ferr has joined #ruby
cschneid_ has joined #ruby
n13z has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
bruno- has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
dc3 has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elsevero has joined #ruby
claudiuinberlin has joined #ruby
lel has quit [Ping timeout: 248 seconds]
kassav_ has joined #ruby
cschneid_ has joined #ruby
lel has joined #ruby
cschneid_ has quit [Ping timeout: 258 seconds]
charliesome has joined #ruby
tmm88 has joined #ruby
tmm88 has joined #ruby
tmm88 has quit [Changing host]
tmm88_ has joined #ruby
tmm88 has quit [Remote host closed the connection]
tmm88_ has quit [Client Quit]
<dminuoso> Okay rubyists. I want to scope a method to just a file.
rhyselsmore has joined #ruby
<dminuoso> Without it leaking.
InfinityFye has joined #ruby
<dminuoso> The only thing I can think of is wrapping that chunk of code inside Module.new { ... }
rhyselsmore has quit [Client Quit]
<elomatreb> Don't use a method, but assign a proc to a local variable or something like that would be a quick and dirty way
<dminuoso> Guess that works
<dminuoso> My code is slowly starting to look like JS code :|
cdg has joined #ruby
<elomatreb> Mh, refinement with a module assigned to a local variable?
<dminuoso> elomatreb: Well I was just using a top level module that is effectively leaked.
tmm88 has joined #ruby
<dminuoso> Well by *leaked* I actually mean..
<dminuoso> dangling.
<dminuoso> Refinements are so cumbersome.
<elomatreb> Does a module leak if you assign it to a local variable instead of a constant?
<apeiros> shouldn't, would be a bug if it did. no?
<dminuoso> apeiros: I actually had to just try out :D
cschneid_ has joined #ruby
<dminuoso> lvars with procs sounds like the cleanest way
<dminuoso> or lambda even.
<apeiros> the fuck happened to my sublime settings? font size 17px? what in the world?!?
<dminuoso> apeiros: on retina that's still like invisile right?
<elomatreb> Large sizes are healthy for the eyes
<apeiros> no, my normal setting is around 11-12. I set it to 12 now.
<elomatreb> Font size pixels aren't usually actual pixels, but 1/96 in
<apeiros> I mean I don't use any tool to run the screen at its native size. I use the biggest commonly available one ("looks like 1920x1200")
<dminuoso> elomatreb: Is that a scottish, american, US survey or continental inch?
<apeiros> default being "looks like 1680x1050" and native resolution 2880x1800
cdg has quit [Ping timeout: 252 seconds]
<dminuoso> You know, gotta ask - can never be sure with the imperial system.
<apeiros> which measure has the most possible values again? knots? miles?
<elomatreb> dminuoso: I don't know, and I'm not sure if e.g. the CSS spec does clarify that
<dminuoso> :)
<dminuoso> apeiros: The craziest Ive witnessed is gauge as a measure of metal thickness.
<elomatreb> AWG?
<dminuoso> The meaning of x gauge depends on the metal.
<Bish> does anyone have an idea how i get really minified html from nokogiri?
<apeiros> oh, nice
<dminuoso> So you cant even compare two sheets of different metals.
<apeiros> Bish: you mean whitespace removed?
cschneid_ has quit [Ping timeout: 252 seconds]
<Bish> apeiros: yes.
<Bish> or rather whitespace and \n
<apeiros> iirc there were some options you could set in to_s or when reading…
paranoicsan has quit [Quit: paranoicsan]
* apeiros looking for whether he can find it again…
John__ has joined #ruby
<Bish> apeiros: that would be nice
<Bish> nokigiri "destroys" my email template, that was optimized for every f*in email client there is
<Bish> i cant change much there, and it seems to add newlines after comments
<elomatreb> Oh, email HTML. Fun
<Bish> fun as putting an umbrella into your a and open it up
<apeiros> or use a pineapple
* apeiros afk for an hour or two
<Bish> so i remove blanks while parsing?
<Bish> not my to_html?
<Bish> but i think nokogiri ADDS those
charliesome has quit [Ping timeout: 258 seconds]
ldnunes has joined #ruby
workmad3_ has joined #ruby
<Bish> apeiros: the input to nokogiri is correct, the output is wrong
<Bish> well technicially the nokogiri is also correc.t. but adds whitespaces that make something bigger than it should be and hell breaks loose
workmad3 has quit [Ping timeout: 248 seconds]
darix has quit [Quit: brb]
<Bish> i should be able to remove all \n in a mail, shouldn't i?
darix has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
cdg has joined #ruby
bruno- has quit [Ping timeout: 252 seconds]
cdg has quit [Ping timeout: 246 seconds]
bruno- has joined #ruby
charliesome has joined #ruby
sepp2k has joined #ruby
zeitchef has quit [Quit: Leaving]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
apparition has joined #ruby
Heph_ has quit [Quit: Leaving]
MrBusiness3 has joined #ruby
alexertech_ has joined #ruby
alexertech_ has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n13z has quit [Remote host closed the connection]
MrBismuth has quit [Ping timeout: 255 seconds]
MrBusiness has quit [Ping timeout: 255 seconds]
MrBusiness has joined #ruby
cschneid_ has joined #ruby
erlend has quit [Ping timeout: 260 seconds]
nofxx has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Ping timeout: 248 seconds]
badrsahla has joined #ruby
charliesome has quit [Ping timeout: 240 seconds]
ShekharReddy has joined #ruby
Beams_ has joined #ruby
erlend has joined #ruby
Beams_ has quit [Client Quit]
Beams has quit [Ping timeout: 248 seconds]
mjolnird has quit [Quit: Leaving]
cdg has joined #ruby
erlend has quit [Ping timeout: 260 seconds]
Beams has joined #ruby
Hexafox[I] has joined #ruby
charliesome has joined #ruby
<Hexafox[I]> What would be the best way to interact with a DB for a small ruby script? I'm used to using ActiveRecord in rails but rails seems overkill for something small.
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
cdg has quit [Ping timeout: 258 seconds]
ramfjord has joined #ruby
jeffreylevesque has quit [Ping timeout: 248 seconds]
<surrounder> Hexafox[I]: sequel maybe? http://sequel.jeremyevans.net/ - don't have much experience with it myself but I've heard some positive stories about it
sameerynho has joined #ruby
sameerynho is now known as Guest89374
<apeiros> Hexafox[I]: you can use AR without rails. but IMO sequel as suggested by surrounder is a very good way to interact with a DB. I especially like it when I don't want to use an ORM
nofxx has joined #ruby
<apeiros> (sequel can be used with and without its ORM part)
<apeiros> Bish: yeah, seems weird. I guess it's about the DOM it constructs while parsing.
<Hexafox[I]> I do like rails models quite a lot.
ramfjord has quit [Ping timeout: 240 seconds]
<apeiros> Bish: and no, you can't just indiscriminately delete all \n in HTML/XML. you can however replace \s+ with a single whitespace of your choice and delete many even completely
erlend has joined #ruby
badrsahla has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
badrsahla has joined #ruby
<matthewd> Hexafox[I]: I'd just use Active Record if you're already familiar with it.. but I'm a bit biased
<matthewd> apeiros: You can't indiscriminately do that either, though an email might be fairly unlikely to contain anything that would care
<Bish> apeiros: why cant i just remove all \n?
<Bish> i mean i tried it right now, and it doesnt seem to be a huge problem AND it fixes my problem
<elomatreb> E.g. in pre tags they are respected
<Bish> surely theyre corner-cases
<Bish> yes.. pre tag is the only thing i can think of
<Bish> but who uses those should be burnt alive either way </opinion>
<elomatreb> XHTML has a bunch of rules about this IIRC, but you're probably not using that :)
* Bish once had a similiar problem and did .delete('\n')
<Bish> while not knowing where the difference between "" and '' is
<Bish> man that hurt.
badrsahla has quit [Ping timeout: 252 seconds]
<matthewd> Bish: If your question is "If I delete \n for the email I'm looking at, will it be okay?", then that's a question you're best positioned to answer for yourself. If your question is "Is it a safe operation to delete \n on all well-formed emails?" then the answer is no, precisely because of corner cases.
ap4y has quit [Quit: WeeChat 1.9.1]
<Bish> hm, okay, then, how would i tell nokogiri to never add new lines
<Bish> since it seems to do that in some cases.. for example comments which include [if IE] shit
<Bish> googling that didnt help me much
<Bish> this seems to be all i have
duckpupp1 has joined #ruby
claudiuinberlin has joined #ruby
cschneid_ has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
alfiemax has quit [Remote host closed the connection]
Silthias has quit [Read error: Connection reset by peer]
charliesome_ has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
charliesome has quit [Ping timeout: 258 seconds]
Silthias has joined #ruby
badrsahla has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 248 seconds]
Silthias has joined #ruby
<apeiros> Bish: because not all whitespace in html is insignificant
<apeiros> also because \n can be used instead of a space, e.g. <p>Hello\nWorld</p> is "Hello World"
Silthias1 has quit [Ping timeout: 248 seconds]
<apeiros> remove the newline there and it'll be HelloWorld
<apeiros> and as usual "works for me in this very specific case" is *very much* not the same as "is correct"
<dminuoso> str.delete(/\n/)
<dminuoso> ?next
<ruby[bot]> dminuoso: I don't know anything about next
* dminuoso kicks ruby[bot]
<apeiros> I really need to rewrite my chat plugin for ruboto
jeffreylevesque has joined #ruby
<dminuoso> apeiros: Looks like your proposed commit for anti-bot-abusal is not live yet. >:-)
alfiemax has joined #ruby
<apeiros> that too
<apeiros> holidays soon :D (though, honestly I don't intend to spend any time on ruboto during that time)
<dminuoso> ruboto?
<dminuoso> rn!
claudiuinberlin has joined #ruby
alfiemax has quit [Remote host closed the connection]
claudiuinberlin has quit [Client Quit]
bmurt has joined #ruby
mjolnird has joined #ruby
tastytf has quit [Ping timeout: 240 seconds]
Guest89374 has quit [Ping timeout: 240 seconds]
<apeiros> räuberbot
uZiel has quit [Remote host closed the connection]
jaruga has quit [Quit: jaruga]
Psybur has joined #ruby
tmm88 has quit [Ping timeout: 248 seconds]
jphase has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tmm88 has joined #ruby
tmm88 has quit [Changing host]
tmm88 has joined #ruby
cschneid_ has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
pilne has joined #ruby
ramfjord has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mson has joined #ruby
alfiemax has joined #ruby
bmurt has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
jordanm_ has joined #ruby
alfiemax has quit [Ping timeout: 252 seconds]
vondruch has quit [Ping timeout: 240 seconds]
aufi has joined #ruby
synthroid has joined #ruby
kimtoms has joined #ruby
cdg has joined #ruby
basket has joined #ruby
<Hexafox[I]> Can I use @@variables in a module?
<Hexafox[I]> I want to store the time since last run
fmcgeough has joined #ruby
<matthewd> You can, but often shouldn't
<Hexafox[I]> Does it make sense to use a class instead if I will only ever have 1 of it?
<matthewd> Class variables can behave surprisingly, so they're generally discouraged these days
<Hexafox[I]> Are instance variables ok?
claudiuinberlin has joined #ruby
<matthewd> Yes
alnewkirk has joined #ruby
aufi has quit [Ping timeout: 255 seconds]
jaruga has joined #ruby
cdg_ has joined #ruby
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
cdg has quit [Ping timeout: 248 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
<dminuoso> Hexafox[I]: *class-instance variables? :P
bruno- has quit [Ping timeout: 248 seconds]
jeffreylevesque_ has joined #ruby
DLSteve_ has joined #ruby
shinnya has quit [Ping timeout: 248 seconds]
jeffreylevesque has quit [Ping timeout: 258 seconds]
aufi has joined #ruby
guille-moe has quit [Ping timeout: 240 seconds]
jaruga has quit [Quit: jaruga]
kassav_ has quit [Read error: No route to host]
kassav__ has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
Hexafox[I] has quit [Ping timeout: 255 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
jamesaxl has quit [Read error: Connection reset by peer]
oleo has joined #ruby
oleo has quit [Client Quit]
oleo has joined #ruby
cpruitt has joined #ruby
mjuszczak has joined #ruby
<marahin> Hello!
uZiel has joined #ruby
<marahin> let's assume that I have an array of values, for instance [1,2,3]. I'd like to assign 'a' and 'b' variables accordingly first and last value from the array. How can I do that in a single line?
mjuszczak has quit [Client Quit]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Remote host closed the connection]
jamesaxl has joined #ruby
jrafanie has joined #ruby
mjuszczak has joined #ruby
<matthewd> marahin: Have you already tried something?
<marahin> matthewd: I tried tinkering with [-1..0], [0..-1] :)
ShekharReddy has quit [Quit: Connection closed for inactivity]
<matthewd> Personally, I think I'd just use .first and .last, despite the boring verbosity
conta has joined #ruby
<dminuoso> class Integer; def to_proc; -> (e) { e[self] }; end;
<matthewd> ary[0] and ary[-1] are a bit shorter
<dminuoso> Then you can do fun things like &0!
<marahin> matthewd: I just thought if it's possible to get both values inline, like a,b = arr(... magic)
<matthewd> `a, *, b = ary` will work, but seems a bit opaque for me
<marahin> oh!
<marahin> this!
<marahin> :)
<marahin> i was looking for this.
<marahin> matthewd: thank you!
<matthewd> dminuoso: You keep saying that, but you really can't
<matthewd> & only works where a block is expected
<dminuoso> >> class Integer; def to_proc; -> (e) { e[self] }; end; end; [[1,2],[3,4]].map(&0) # matthewd
<ruby[bot]> dminuoso: # => [1, 3] (https://eval.in/882721)
<dminuoso> Ohh
<dminuoso> I see what you mean.
<matthewd> In a map, sure. But not for your fancy * combining stuff
<dminuoso> Yeah :(
<dminuoso> We should add Kernel#nth
<matthewd> module Kernel; def method_missing(sym, a, *b); return super unless a.respond_to?(sym); a.send(sym, *b); end; end
<matthewd> #functionalprogramming
mjuszcza_ has joined #ruby
alfiemax has joined #ruby
bruno- has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
mjuszczak has quit [Ping timeout: 240 seconds]
<dminuoso> Garrgh!
<dminuoso> Need Array to be an applicative.
jamesaxl has joined #ruby
hs366 has quit [Quit: Leaving]
alfiemax has quit [Ping timeout: 240 seconds]
<dminuoso> class Array; def <=>(ary); self.map { |e| ary.map { |i| e.(i) } }; end; end; class Integer; def to_proc; -> (e) { e[self] }; end; end; a, b = [0, -1].map(&:to_proc) <=> [[1,2,3]]; puts "#{a} #{b}" # matthewd
<dminuoso> >> class Array; def <=>(ary); self.map { |e| ary.map { |i| e.(i) } }; end; end; class Integer; def to_proc; -> (e) { e[self] }; end; end; a, b = [0, -1].map(&:to_proc) <=> [[1,2,3]]; puts "#{a} #{b}" # matthewd
<ruby[bot]> dminuoso: # => [1] [3] ...check link for more (https://eval.in/882724)
<dminuoso> easy as pie.
minimalism has quit [Quit: minimalism]
<dminuoso> Though I admit, I probably shouldn't abuse <=> for this.
kt has quit [Ping timeout: 255 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<matthewd> Maybe %
<matthewd> Though I really don't know why I'm encouraging you :P
mson has quit []
mson has joined #ruby
<apeiros> matthewd: it's not as if it mattered whether you give him additional bad ideas. he's got plenty himself already anyway :o)
konsolebox has quit [Quit: .]
<tbuehlmann> :D
<dminuoso> So hateful :'(
dionysus69 has quit [Ping timeout: 248 seconds]
<apeiros> what hate?
<apeiros> I find it amusing :)
jrafanie has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
Rapture has joined #ruby
pior has joined #ruby
Guest89374 has joined #ruby
bmurt has joined #ruby
<href> hmmm so I'm calling Rake tasks from a binary who's distributed in a gem. It seems Rake doesn't find the Rakefile -- any idea on how i could fix that ? The concerned code looks like this: https://gist.github.com/hrefhref/fc254eb2c0e1551e95338bda1b48d33b
jamesaxl has quit [Read error: Connection reset by peer]
<href> works fine when running the CLI with bundle exec
code_zombie has joined #ruby
mjuszcza_ has quit []
uZiel has quit [Remote host closed the connection]
kt has joined #ruby
<elomatreb> Are you sure you included the Rakefile in your gem?
konsolebox has joined #ruby
<href> yes, it's present in /var/lib/gems/2.3.0/gems/dradis-1.4.47/Rakefile just as it should
pilne has quit [Quit: Quitting!]
chouhoulis has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<href> I think I should tell Rake somehow to not search for the rakefile in the "active" directory, but in the gem's one. I have no idea how to do it
Guest89374 has quit [Quit: WeeChat 1.9.1]
sameerynho has joined #ruby
<href> if I go to the gem's dir and run it from there, it works
sameerynho is now known as Guest16040
swirlsMD has joined #ruby
Technodrome has joined #ruby
lxsameer has quit [Ping timeout: 248 seconds]
slackR has joined #ruby
selim_ has quit [Ping timeout: 246 seconds]
ta has quit [Remote host closed the connection]
<canton7> href, it's not usual to distribute a rakefile like that
<canton7> distributing .rake files which people can import into their own Rakefile, sure
swirlsMD has quit [Ping timeout: 240 seconds]
xuanrui has quit [Ping timeout: 240 seconds]
swirlsMD has joined #ruby
fiber_pilot has joined #ruby
<href> canton7: yeah, true. I mostly need them for db:migrate and stuff, maybe I should just copy the task's into the CLI and just ditch Rake.
nokia3210 has joined #ruby
fiber_pilot has left #ruby [#ruby]
<canton7> I think shipping tasks which people can load and use in their own Rakefiles is fairly normal, and useful?
<href> it's not a framework or lib or whatever, just a server. So no reason for the clients to run custom tasks there
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<href> And i'd really like to keep it simple by * just * distributing gem and not having to deal with bundler and other painful stuff like that
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
selim has joined #ruby
guille-moe has joined #ruby
evie_hammond has joined #ruby
jrafanie has joined #ruby
apeiros has quit [Remote host closed the connection]
guille-moe has quit [Ping timeout: 240 seconds]
<href> a Dir.chdir does the trick just before loading rake :)
ana_ has quit [Ping timeout: 240 seconds]
guille-moe has joined #ruby
xuanrui has joined #ruby
polishdub has joined #ruby
swirlsMD_ has joined #ruby
alfiemax has joined #ruby
swirlsMD has quit [Ping timeout: 264 seconds]
__Yiota has joined #ruby
mostlybadfly has joined #ruby
gusrub has joined #ruby
jamesaxl has joined #ruby
Immune has joined #ruby
synthroid has quit [Remote host closed the connection]
uZiel has joined #ruby
mjuszczak has joined #ruby
guacamole has joined #ruby
ferr has quit [Quit: WeeChat 1.9.1]
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cschneid_ has joined #ruby
nopolitica has quit [Ping timeout: 258 seconds]
uZiel has quit [Ping timeout: 248 seconds]
someuser_ has joined #ruby
InfinityFye has quit [Ping timeout: 252 seconds]
elsevero has quit [Quit: elsevero]
polishdub has quit [Ping timeout: 252 seconds]
dc3 has joined #ruby
polishdub has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
notemerson has joined #ruby
dinfuehr has joined #ruby
swirlsMD_ has quit [Quit: WeeChat 1.9]
cagomez has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
ta has joined #ruby
swirlsMD has joined #ruby
apeiros has joined #ruby
sepp2k has quit [Quit: Leaving.]
jamesaxl has quit [Read error: Connection reset by peer]
thomasv314 has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
aufi has quit [Quit: Leaving]
ta has quit [Remote host closed the connection]
SuperLag has quit [Quit: leaving]
ta has joined #ruby
lele has quit [Ping timeout: 264 seconds]
pablo_ has joined #ruby
<pablo_> Hi guys, do you know how can you include a png file on a gem to load it later?
lele has joined #ruby
Xeago has quit [Ping timeout: 255 seconds]
pablo_ has quit [Client Quit]
Xeago has joined #ruby
<dminuoso> What?
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
swirlsMD has quit [Ping timeout: 255 seconds]
starship is now known as duracrisis
synthroid has joined #ruby
claudiuinberlin has joined #ruby
dionysus69 has joined #ruby
andikr has quit [Remote host closed the connection]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
mark_66 has quit [Remote host closed the connection]
guacamole has joined #ruby
swirlsMD has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[Butch] has joined #ruby
hahuang65 has quit [Read error: Connection reset by peer]
ams__ has joined #ruby
hahuang65 has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
jinie has joined #ruby
swirlsMD has quit [Ping timeout: 258 seconds]
swirlsMD has joined #ruby
PaulCapestany has quit [Read error: Connection reset by peer]
PaulCapestany has joined #ruby
nokia3210 has quit [Ping timeout: 260 seconds]
gusrub has quit [Remote host closed the connection]
marxarelli|afk is now known as marxarelli
Serpent7776 has quit [Quit: Leaving]
nopolitica has joined #ruby
MyMind has quit [Ping timeout: 252 seconds]
Pisuke has joined #ruby
Azure has quit [Ping timeout: 248 seconds]
DTZUZO has joined #ruby
someuser_ has quit [Quit: Lost terminal]
PaulCapestany has quit [Read error: Connection reset by peer]
wolakkk has joined #ruby
wolakkk has quit [Max SendQ exceeded]
PaulCapestany has joined #ruby
<havenwood> pabs: You can just put a png inside a gem and add it to your Gem::Specification#files= in your gemspec. Or say more about what you mean?
<havenwood> Oops, they left.
gusrub has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
Sembei has joined #ruby
Pisuke has quit [Ping timeout: 248 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Beams has quit [Quit: .]
jamesaxl has joined #ruby
swirlsMD has quit [Ping timeout: 248 seconds]
dnoda has joined #ruby
kassav__ has quit [Quit: kassav__]
swirlsMD has joined #ruby
alfiemax has quit [Remote host closed the connection]
thinkpad has quit [Ping timeout: 252 seconds]
synthroid has quit [Remote host closed the connection]
aphprentice has joined #ruby
orbyt_ has joined #ruby
Technodrome has joined #ruby
dviola has joined #ruby
Guest16040 has quit [Ping timeout: 258 seconds]
GodFather has joined #ruby
kies has quit [Ping timeout: 252 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stevednd has joined #ruby
<stevednd> hey all, what's the correct pattern to use to be able to pass a method to some other method without actually calling it until it's called? I have an expensive operation that I want to be available to some other code, but not run. I thought about just passing it as a lambda `context = {expensive: ->() { do_expensive_thing }}` but this requires the caller to at the very least do `context[:expensive].()`
cpruitt has quit [Quit: cpruitt]
cpruitt has joined #ruby
<stevednd> is there any way to be able to get the calling code to only have to access `context[:expensive]` and have the method execute?
cpruitt has quit [Client Quit]
<elomatreb> If you use the Hash.new constructor with a block you can implement something like that
<matthewd> stevednd: Seems too abstract to suggest much
<matthewd> e.g. why is context a hash and not a "proper" object?
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
guille-moe has quit [Ping timeout: 258 seconds]
oleo has quit [Ping timeout: 258 seconds]
mim1k has quit [Ping timeout: 260 seconds]
chouhoul_ has joined #ruby
conta has quit [Ping timeout: 246 seconds]
chouhou__ has joined #ruby
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
<dminuoso> stevednd, this is an honest question, why is .() such a problem?
chouho___ has joined #ruby
uZiel has joined #ruby
<dminuoso> It makes it obvious that you have something resembling a first-class function in your hand.
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
mjuszczak has quit []
oleo has joined #ruby
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 252 seconds]
Ltem has joined #ruby
chouhoul_ has joined #ruby
guacamole has joined #ruby
chouhou__ has quit [Ping timeout: 264 seconds]
chouhou__ has joined #ruby
chouho___ has quit [Ping timeout: 248 seconds]
guille-moe has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 240 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 248 seconds]
hahuang65 has quit [Quit: WeeChat 1.9.1]
alfiemax has joined #ruby
hahuang65 has joined #ruby
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 248 seconds]
megamos has joined #ruby
TvL2386 has joined #ruby
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 240 seconds]
chouhou__ has joined #ruby
TvL2386_ has quit [Ping timeout: 240 seconds]
chouho___ has quit [Ping timeout: 240 seconds]
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 240 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
chouhoul_ has quit [Ping timeout: 248 seconds]
chouhou__ has quit [Ping timeout: 240 seconds]
guille-moe has quit [Ping timeout: 264 seconds]
chouhoulis has joined #ruby
mjuszczak has joined #ruby
oz has quit [Ping timeout: 264 seconds]
chouho___ has quit [Ping timeout: 240 seconds]
ledestin has joined #ruby
chouh____ has quit [Ping timeout: 240 seconds]
oz has joined #ruby
jrafanie has joined #ruby
sspreitz has joined #ruby
synthroid has joined #ruby
mjuszczak has quit []
Heph_ has joined #ruby
megamos has quit [Ping timeout: 240 seconds]
megamos has joined #ruby
eckhardt has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
megamos has quit [Ping timeout: 240 seconds]
Cohedrin_ has joined #ruby
mjuszczak has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mjuszczak has quit [Max SendQ exceeded]
mim1k has joined #ruby
mjuszczak has joined #ruby
chouhoulis has quit [Remote host closed the connection]
torarne has quit [Ping timeout: 240 seconds]
<stevednd> dminuoso: mostly because it just breaks the semantics of accessing similar items in the context. Also because it's not really that special, it's just a wrapper to delay execution. If it's not possible, that's fine
haylon has quit [Ping timeout: 240 seconds]
yana[m] has quit [Ping timeout: 240 seconds]
Hanma[m] has quit [Ping timeout: 240 seconds]
watzon has quit [Ping timeout: 240 seconds]
lasenna[m] has quit [Ping timeout: 240 seconds]
Matt[m]2 has quit [Ping timeout: 246 seconds]
M107262[m] has quit [Ping timeout: 246 seconds]
velu_aon[m] has quit [Ping timeout: 246 seconds]
Tagami[m] has quit [Ping timeout: 246 seconds]
chouhoulis has joined #ruby
dtcristo has quit [Ping timeout: 246 seconds]
Giphy[m] has quit [Ping timeout: 246 seconds]
Orbixx[m] has quit [Ping timeout: 246 seconds]
aviraldg has quit [Ping timeout: 246 seconds]
kua[m] has quit [Ping timeout: 252 seconds]
dman[m] has quit [Ping timeout: 252 seconds]
itmerc[m] has quit [Ping timeout: 252 seconds]
KevinMGranger has quit [Ping timeout: 252 seconds]
astronavt[m] has quit [Ping timeout: 252 seconds]
turt2live has quit [Ping timeout: 240 seconds]
gokul_mr[m] has quit [Ping timeout: 264 seconds]
jonjits[m] has quit [Ping timeout: 264 seconds]
aagdbl[m] has quit [Ping timeout: 276 seconds]
__Yiota has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 258 seconds]
mim1k has quit [Ping timeout: 248 seconds]
slackR has quit [Quit: Leaving]
cagomez has joined #ruby
ioggstream has quit [Ping timeout: 252 seconds]
dnoda has quit []
Xeago has quit [Ping timeout: 260 seconds]
bigkevmcd has quit [Ping timeout: 240 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigkevmcd has joined #ruby
Xeago has joined #ruby
yokel has joined #ruby
guacamole has joined #ruby
megamos has joined #ruby
orbyt_ has joined #ruby
alnewkirk has quit [Ping timeout: 248 seconds]
<apeiros> stevednd: you can always create a custom class which provides [] access to calculated (and potentially memoized) attributes
alnewkirk has joined #ruby
raynold has joined #ruby
kies has joined #ruby
<apeiros> class MemoHash; def initialize(memos); @memos = memos; @calculated = {}; end; def [](key); if @calculated.has_key?(key) then @calculated[key] else @calculated[key] = @memos[key].call end; end; end
<apeiros> stuff = MemoHash.new fib10: -> { fib(10) }
harai has joined #ruby
<stevednd> apeiros: yes, I could, but I do not control the full lifecycle of hash that I'm passing. So I am not eager to attempt to simulate a hash, nor sub-class Hash as I do not want to deal with the potential whacky debugging down the line.
<apeiros> you shouldn't subclass Hash anyway. subclassing classes you don't own is generally a bad idea.
<stevednd> yes, exactly why I don't plan on doing it
kimtoms has quit []
knight33 has joined #ruby
kies has quit [Read error: Connection reset by peer]
dc4 has joined #ruby
dc3 has quit [Ping timeout: 240 seconds]
rajno has quit [Quit: Leaving]
nopolitica has quit [Quit: WeeChat 1.9]
eckhardt has joined #ruby
jordanm_ has quit [Ping timeout: 258 seconds]
swirlsMD has quit [Ping timeout: 248 seconds]
smelnicki has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
dionysus70 has joined #ruby
<apeiros> is there a good crypto channel on freenode?
<apeiros> or alternatively: anybody know of a file format or similar which would allow to decrypt its content with multiple keys?
<apeiros> multiple keys as in: multiple keys exist and any of them can decrypt the contents. bonus points if editing and re-encrypting is possible
dionysus70 is now known as dionysus69
<apeiros> (I do have an idea on how to do with AES or any other encryption standard, but don't want to reinvent the wheel - especially not in crypto where I might accidentally introduce backdoors/sidechannels)
workmad3_ has quit [Ping timeout: 255 seconds]
alfiemax has quit [Remote host closed the connection]
<elomatreb> Do you want to reimplement it? Because I know LUKS disk encryption supports that and I think eCryptFS as well (which can be a regular file)
cagomez has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
ramfjord has joined #ruby
<apeiros> if I can have it in as plain ruby with as little dependencies as possible - great. if not, I'll still give it a try.
<apeiros> eCryptFS - ok, taking a look at that
<apeiros> any limit on the number of allowed keys with that?
cagomez has joined #ruby
<elomatreb> From what I'm reading it does not allow multiple keys (passphrases at least), mh. Sorry then
<apeiros> also doesn't exist for mac :-/
alfiemax has quit [Ping timeout: 246 seconds]
Yxhuvud has quit [Remote host closed the connection]
<elomatreb> Just storing a single key multiple times encrypted with the user keys is probably too simple?
<apeiros> the idea I have is to basically en-/decrypt the data with a master key and store the masterkey for each added password encrypted with that password. potentially using a kind of hash to not have to try all buckets.
<apeiros> ^
<apeiros> :)
mathys has joined #ruby
<elomatreb> If you have passwords you could just use a KDF like scrypt
<apeiros> but I'm worried that this in some way introduces a sidechannel
<elomatreb> Wait nevermind
Yxhuvud has joined #ruby
charliesome has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> yeah, the hashing function to find the bucket would probably fit well to perform KDF
<elomatreb> Assuming ideal primitives I don't think you have any "sidechannels", and I don't notice any immediate implementation sidechannels
<apeiros> the obvious weaking is probably through the inevitable "more keys = more chances to guess right"
<apeiros> but I doubt that can be avoided
<apeiros> *weakening (if that's a word?)
<apeiros> well, I guess AES256 + bcrypt with ruby it is.
<apeiros> what was the name of the pure ruby crypto lib again?
uZiel has joined #ruby
<elomatreb> Unless you have huge numbers of users I don't think the added chance for guessing in the keyspace is significant
<apeiros> s/users/keys/ ;-) (whyever one user would have multiple keys)
A124 has joined #ruby
<apeiros> yeah, as long as there's rules for the pw's
badrsahla has quit [Remote host closed the connection]
<elomatreb> Yeah, I was assuming 1 user = 1 key
badrsahla has joined #ruby
<elomatreb> Somehow pure-ruby crypto leaves a sour taste in my mouth, if we were talking about sidechannels earlier
<apeiros> until a couple of years ago I'd have concurred
<apeiros> but the number of C related bugs in libs like openssl made me reconsider
<elomatreb> Btw, just as a precaution, remember to authenticate your stuff
<apeiros> how do you mean?
<elomatreb> Not just AES-CBC
<apeiros> I have to reread that stuff, been a while. wasn't cbc the one which was weak to attacks?
LocaMocha has quit [Ping timeout: 252 seconds]
<elomatreb> You can flip bits in CBC ciphertext (and if you know some plaintext you can reliably flip certain bits), and you won't notice when decrypting
badrsahla has quit [Ping timeout: 240 seconds]
SuperLag has joined #ruby
<elomatreb> And in certain circumstances (disclaimer: I don't fully understand this) when you can get the system to encrypt attacker supplied data it can lead to key oracles IIRC
<apeiros> I see
<apeiros> so you'd have to somehow munge user data
<elomatreb> A simple HMAC of the ciphertext prevents this entirely
<apeiros> ah, I think I remember. yes
<apeiros> fun fact: I think I implemented that ~2y ago…
<apeiros> I guess I'll have to reread my old code.
<havenwood> GCM \o/
<apeiros> GCM?
<havenwood> Galois/Counter Mode
<apeiros> Grand Central Mismatch?
<elomatreb> GCM requires nonces which is difficult with static systems like this
<apeiros> Galois… I only remember that guy from Galois fields…
<elomatreb> GCM is a mode like CBC that automatically does this authentication step
<elomatreb> Precisely that guy
<apeiros> well, I guess I'll implement my shit, put it on github and ask on the ML whether anybody is up to proofread it
cdg has joined #ruby
<havenwood> apeiros: There is a crypto channel, oh yeah, #crypto
<havenwood> ##crytpo
<havenwood> uhg, can't type >.>
<elomatreb> In all seriousness, I'd recommend using a prebuilt crypto library (I think there is a libsodium binding, which has a crypto box implementation that does all this in one stop for you, developed by experts)
<apeiros> kk, will ask there too
<apeiros> elomatreb: only if I can reproduce without it
<apeiros> I really don't want to end up with a dead extension, unable to decrypt stuff
<havenwood> here's my four-year-old stab at AES-CBC with Ruby stdlib: https://github.com/havenwood/encrypt/blob/master/lib/encrypt.rb#L4-L20
swirlsMD has joined #ruby
<apeiros> thx
<elomatreb> Apropos: Another problem of CBC is that you have to pad your plaintext, which can also leak information about the last encrypted block in certain situations
cdg_ has quit [Ping timeout: 264 seconds]
doctorspektor has joined #ruby
enterprisey has joined #ruby
apeiros has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 246 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO_ has joined #ruby
Dimik has joined #ruby
DTZUZO has quit [Ping timeout: 255 seconds]
<havenwood> It looks like krypt isn't maintained any longer but the other two are.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros_ has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros_> damn, I must change the sleep settings for this laptop. 3min without power and it disconnected…
apeiros_ is now known as apeiros
alveric2 has quit [Quit: WeeChat 1.9.1]
<apeiros> too sad re krypt. I think that even had backing from matz.
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
badrsahla has joined #ruby
konsolebox has quit [Ping timeout: 248 seconds]
Xiti has quit [Quit: Xiti]
alveric1 has joined #ruby
chouhoulis has quit [Remote host closed the connection]
Technodrome has joined #ruby
alnewkirk has quit [Ping timeout: 246 seconds]
badrsahla has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
konsolebox has joined #ruby
claudiuinberlin has joined #ruby
jrafanie has joined #ruby
Xiti has joined #ruby
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alveric1 has quit [Quit: WeeChat 1.9.1]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
badrsahla has joined #ruby
alveric1 has joined #ruby
jordanm_ has joined #ruby
SeepingN has joined #ruby
cagomez has quit [Remote host closed the connection]
ozcanesen has joined #ruby
cagomez has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thomasv314 has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
imode has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsglove has quit [Remote host closed the connection]
tsglove has joined #ruby
doctorspektor has left #ruby [#ruby]
badrsahla has quit [Ping timeout: 240 seconds]
tsglove has quit [Max SendQ exceeded]
mjuszcza_ has joined #ruby
tsglove has joined #ruby
kapil___ has joined #ruby
tsglove has quit [Max SendQ exceeded]
mjuszczak has quit [Ping timeout: 240 seconds]
tsglove has joined #ruby
__Yiota has joined #ruby
alfiemax has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
cagomez has quit [Ping timeout: 246 seconds]
fmcgeough has quit [Ping timeout: 255 seconds]
jrafanie has joined #ruby
jokke has quit [Quit: WeeChat 1.9]
alfiemax has quit [Ping timeout: 264 seconds]
fmcgeough has joined #ruby
tycoon177 has left #ruby [#ruby]
jokke has joined #ruby
badrsahla has joined #ruby
swirlsMD has quit [Ping timeout: 246 seconds]
claudiuinberlin has joined #ruby
alfiemax has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
cagomez has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
ldnunes has quit [Ping timeout: 240 seconds]
s1kx has joined #ruby
oncall-pokemon has joined #ruby
alnewkirk has joined #ruby
ineb has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mson has joined #ruby
alnewkirk has quit [Ping timeout: 252 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kevinhai_ has joined #ruby
megamos has quit [Ping timeout: 240 seconds]
kies has joined #ruby
badrsahla has quit [Ping timeout: 240 seconds]
ams__ has quit [Quit: Connection closed for inactivity]
ldnunes has joined #ruby
conta2 has joined #ruby
roonsauce has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kevinhai_ is now known as kjhaidl
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZU has quit [Ping timeout: 248 seconds]
swirlsMD has joined #ruby
orbyt_ has joined #ruby
conta2 has quit [Ping timeout: 240 seconds]
DTZUZU has joined #ruby
mjuszcza_ has quit []
kjhaidl has left #ruby ["Textual IRC Client: www.textualapp.com"]
kevinhai_ has joined #ruby
jrafanie has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
duckpupp1 has quit [Ping timeout: 260 seconds]
fmcgeough has quit [Quit: fmcgeough]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kt has quit [Quit: Quit]
vee__ has quit [Ping timeout: 240 seconds]
mjuszczak has joined #ruby
gigetoo has joined #ruby
workmad3 has joined #ruby
dc4 has quit [Ping timeout: 240 seconds]
megamos has joined #ruby
ldnunes has quit [Quit: Leaving]
cdg_ has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
s1kx has quit [Ping timeout: 240 seconds]
kevinhai_ has left #ruby ["Textual IRC Client: www.textualapp.com"]
kevinhai_ has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Ping timeout: 246 seconds]
mjuszczak has quit []
mjuszczak has joined #ruby
ur5us has joined #ruby
badrsahla has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
vee__ has joined #ruby
eckhardt has joined #ruby
__Yiota has joined #ruby
geigerCounter has joined #ruby
Psybur has quit [Ping timeout: 260 seconds]
kevinhai_ is now known as kjhaidl
Rapture has quit [Ping timeout: 240 seconds]
jamesaxl has joined #ruby
<geigerCounter> Hey there. I'm trying to compile a c++ ruby interpreter, where do I get the headers necessary to compile?
oleo has quit [Quit: Leaving]
<geigerCounter> I'm running Ubuntu 16.04
<geigerCounter> Does the "ruby-full" package come with the necessary development files?
orbyt_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<matthewd> geigerCounter: I'm not sure what you're trying to do, but ruby-full does seem to depend on ruby-dev, so.. probably?
PaulCapestany has quit [Quit: .]
<geigerCounter> /home/anatoly/gitbox/mkxp/binding-mri/binding-util.h:25:18: fatal error: ruby.h: No such file or directory
<geigerCounter> matthewd: I install ruby-full and ruby-build
kies has quit [Ping timeout: 246 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<geigerCounter> Well...
<geigerCounter> It seems like the ruby headers do in fact live in /usr/lib/ now.
<geigerCounter> So this might be outside of y'all's wheelhouse.
<geigerCounter> Unfortunately for me, that means it's probably way out of my abilitiy level
<matthewd> > MRI-Binding: pkg-config will look for ruby-2.1.pc, but you can override the version with MRIVERSION=2.2 ('2.2' being an example)
<matthewd> geigerCounter: Maybe relevant?
mathys has quit [Quit: Leaving]
cagomez has quit [Remote host closed the connection]
<geigerCounter> That should be fine. The README.md for the program I'm trying to compile wants 2.1 anyway
cagomez has joined #ruby
mjuszczak has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<geigerCounter> Well wait...
<geigerCounter> 2.3 is the only version installed right now, afaik.
<Guest25738> the sparkr gem claims to output ascii but really outputs unicode. anyone know of a sparklines gem which really uses ascii / doesnt require unicode in my cli
<matthewd> geigerCounter: Right. That was a quote from the readme.
cagomez has quit [Ping timeout: 252 seconds]
harai has quit [Quit: harai]
jrafanie has joined #ruby
synthroid has quit []
mjuszczak has joined #ruby
guacamole has joined #ruby
rhyselsmore has joined #ruby
jordanm_ has quit [Quit: Konversation terminated!]
duderonomy has joined #ruby
Guest16040 has joined #ruby
kies has joined #ruby
<geigerCounter> matthewd: I set the MRIVERSION to 2.3, still no dice.
<matthewd> Hmm.. best I can suggest at that point is that if it's trying to detect the files, you should be able to find a log file somewhere that describes everything it's tried (and the specific reason each failed), which might hold some clue
<geigerCounter> I'm not sure where to find that.
voxxit has joined #ruby
<geigerCounter> I looked at the error output for make and all it's telling me is that it's not finding it.
snapcase has quit [Remote host closed the connection]
postmodern has joined #ruby
snapcase has joined #ruby
cagomez has joined #ruby
alfiemax has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
vee__ has quit [Ping timeout: 246 seconds]
[Butch] has quit [Quit: I'm out . . .]
jeffreylevesque_ has quit [Ping timeout: 264 seconds]
jrafanie has quit [Ping timeout: 252 seconds]
roonsauce has quit [Remote host closed the connection]
mjuszczak has quit []
roonsauce has joined #ruby
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
vee__ has joined #ruby
mjuszczak has joined #ruby
biberu has quit []
mjuszczak has quit [Max SendQ exceeded]
oleo has joined #ruby
roonsauce has quit [Ping timeout: 246 seconds]
mjuszczak has joined #ruby
<geigerCounter> I fixed it.
<geigerCounter> Thanks for your help matthewd!
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roonsauce has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roonsauce has quit [Client Quit]
thomasv314 has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
SeepingN has joined #ruby
Ltem has quit [Quit: Leaving]
alfiemax has joined #ruby
ap4y has joined #ruby
ap4y1 has joined #ruby
dc4 has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
John__ has quit [Ping timeout: 248 seconds]
shinnya has joined #ruby
apeiros has quit [Remote host closed the connection]
mson has quit [Quit: Connection closed for inactivity]
ramfjord has quit [Ping timeout: 246 seconds]
mim1k has joined #ruby
PaulCapestany has joined #ruby
mikecmpbll has joined #ruby
ramfjord has joined #ruby
<mikecmpbll> anyone know of any projects using DRb? :)
<havenwood> mikecmpbll: pry-remote does
tmm88 has quit [Quit: Lost terminal]
<matthewd> minitest-server
PaulCapestany has quit [Quit: .]
<mikecmpbll> cool! thanks!
<matthewd> If you want something huge, I know ManageIQ uses it for some stuff, but that's unlikely to be a good example if you want something to read
yokel has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 246 seconds]
<havenwood> spork does too
vee__ has quit [Ping timeout: 264 seconds]
<mikecmpbll> something to read was what i was after. thinking of using it to distribute some process-heavy tasks across machines
<mikecmpbll> but haven't touched it before
dtcristo has joined #ruby
<matthewd> Personally, I'd try pretty hard to convince sidekiq to solve my problem before bringing that much intimacy to bear
mjuszczak has quit []
jphase has quit [Remote host closed the connection]
yokel has joined #ruby
<mikecmpbll> hmm.
swirlsMD has quit [Ping timeout: 255 seconds]
<mikecmpbll> definitely worth considering, thanks
<mikecmpbll> slight problem i'd have with sidekiq is all the data required for the tasks which isn't easily passed to a sidekiq job
vee__ has joined #ruby
<matthewd> If you're going to pass it through DRb, you can just marshal it to sidekiq instead. If you want to leave it to call back to the original process, then DRb is certainly the right tool... but it's going to interfere with your distributed-ness pretty quickly.
workmad3 has joined #ruby
<mikecmpbll> ah yeh, of course i can good point.
swirlsMD has joined #ruby
Ropeney has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
<darix> zeromq comes to mind.
jphase has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
jonjits[m] has joined #ruby
turt2live has joined #ruby
Giphy[m] has joined #ruby
Hanma[m] has joined #ruby
Tagami[m] has joined #ruby
M107262[m] has joined #ruby
lasenna[m] has joined #ruby
haylon has joined #ruby
yana[m] has joined #ruby
velu_aon[m] has joined #ruby
aviraldg has joined #ruby
Orbixx[m] has joined #ruby
torarne has joined #ruby
watzon has joined #ruby
astronavt[m] has joined #ruby
KevinMGranger has joined #ruby
dman[m] has joined #ruby
itmerc[m] has joined #ruby
kua[m] has joined #ruby
gokul_mr[m] has joined #ruby
aagdbl[m] has joined #ruby
Matt[m]2 has joined #ruby
orbyt_ has joined #ruby
mtkd has quit [Read error: Connection reset by peer]
^mtkd has joined #ruby
gusrub has quit [Remote host closed the connection]
jphase has quit [Remote host closed the connection]
^mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
blackmesa has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hexafox[I] has joined #ruby
enterprisey has quit [Ping timeout: 240 seconds]
megamos has quit [Ping timeout: 255 seconds]
goyox86_ has joined #ruby
govg_ has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
polishdub has quit [Quit: leaving]
SenpaiSilver has joined #ruby
ta has quit [Remote host closed the connection]
lektrik has quit [Ping timeout: 258 seconds]
ta has joined #ruby
SenpaiSilver has quit [Remote host closed the connection]
rhyselsmore has quit [Read error: Connection reset by peer]
goyox86_ has quit [Ping timeout: 240 seconds]
goyox86_ has joined #ruby
goyox86_ is now known as goyox86
blackmesa has quit [Ping timeout: 240 seconds]
goyox86 has quit [Client Quit]
goyox86 has joined #ruby
jeffreylevesque has joined #ruby
sepp2k has joined #ruby
ozcanesen has quit [Quit: ozcanesen]
lektrik has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
blackmesa has joined #ruby
marcux has joined #ruby
Technodrome has joined #ruby
cschneid_ has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
cschneid_ has joined #ruby
enterprisey has joined #ruby
thinkpad has joined #ruby
cschneid_ has quit [Ping timeout: 248 seconds]
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
cagomez has quit [Remote host closed the connection]
alfiemax has joined #ruby
cagomez has joined #ruby
badrsahla has quit []
cagomez has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
pilne has joined #ruby
marr has quit [Remote host closed the connection]
cagomez has joined #ruby
troys has joined #ruby
naprimer2 has joined #ruby
g4ntz has joined #ruby
sepp2k1 has joined #ruby
naprimer3 has quit [Ping timeout: 248 seconds]
sepp2k has quit [Ping timeout: 260 seconds]
g4ntz has left #ruby [#ruby]
swirlsMD has quit [Ping timeout: 248 seconds]
alveric2 has joined #ruby
sepp2k has joined #ruby
sepp2k1 has quit [Ping timeout: 258 seconds]
alveric1 has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
ta has quit [Remote host closed the connection]
<Guest25738> i have a ruby script running which keeps terminating with the message 'Killed'. it is creating thousands of large hashes in memory, does the os kill it or can ruby hit a memory limit? its running on linux
mim1k has quit [Ping timeout: 260 seconds]