havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.0, 2.5.3, 2.4.5: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
sanscoeur has quit [Ping timeout: 246 seconds]
uplime has quit [Quit: WeeChat 2.2]
sanscoeu_ has quit [Ping timeout: 258 seconds]
solocshaw has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drale2k_ has joined #ruby
solocshaw has quit [Ping timeout: 246 seconds]
kankava has quit [Quit: leaving]
RougeR has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
cd has quit [Quit: cd]
mn3m has quit [Ping timeout: 268 seconds]
DarthGandalf has quit [Quit: Bye]
ramfjord has joined #ruby
solocshaw has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RougeR has quit [Remote host closed the connection]
RougeR has joined #ruby
sameerynho has quit [Ping timeout: 268 seconds]
impermanence has joined #ruby
zenogais has joined #ruby
<zenogais> Hey all! Random extension gem question I was hoping someone might know the answer to. Right now I'm using `rb_eval_string("SecureRandom.random_bytes(32)");` in an extension gem to get 32 bytes of random data. I'd rather just get the `VALUE` of the `SecureRandom` object and make an `rb_funcall` on it. Is there a built-in way to get an object by name in C extensions? I've tried quite a few things but wasn't able to figure it out.
davidw has quit [Ping timeout: 258 seconds]
conta has joined #ruby
SuperLag has quit [Remote host closed the connection]
r29v has quit [Quit: r29v]
marmotini has joined #ruby
solocshaw1 has joined #ruby
solocshaw has quit [Ping timeout: 240 seconds]
solocshaw1 is now known as solocshaw
conta has quit [Ping timeout: 250 seconds]
marmotini has quit [Ping timeout: 246 seconds]
solocshaw has quit [Remote host closed the connection]
zcarey has joined #ruby
DarthGandalf has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
havenwood has quit [Quit: ZNC 1.7.1 - https://znc.in]
havenwood has joined #ruby
<hays> baweaver: where is the line with metaprogramming
lupine has quit [Ping timeout: 250 seconds]
<baweaver> In some cases I'd be tempted to say if you don't know where that line is it's probably not a great idea to use it.
<baweaver> Though I'd also argue that people seriously overload that word as well
<baweaver> and a lot of the ideas that are dubbed as metaprogramming really aren't
<hays> maybe im using it and i dont know it
<baweaver> If you're using Rails you probably are in some capacity, though they tend to move away from it more as time goes on for speed and stability reasons
<baweaver> find_by_name_and_email type methods don't really exist anymore in favor of keyword / query type methods
<hays> what if i was writing something ike roda where i define a class capable of doing the route do end stuff
<baweaver> Not really metaprogramming.
<baweaver> That's just making a DSL using functions
<baweaver> Hence mentioning above that the term is quite overloaded and we tend to call a lot of things metaprogramming when they really aren't
<baweaver> That, and I think there's this mentality to call things dirty, ugly, or hacky whenever they're a perfectly normal part of the language
<hays> yeah i think its one thing truly unique about ruby that it basically got from smalltalk
<baweaver> I just see there being no good reason to use a chainsaw to trim a bonsai tree when there are hedge clippers within reach.
<hays> unique in the sense if you look at other popular modern languages
d10n-work has quit [Quit: Connection closed for inactivity]
<baweaver> Use the least powerful tool to do the task you need, less likely to behave oddly later
<hays> i like D. Thomas' distinction between class oriented programming and OOP
<baweaver> Like I could write any and all Enumerable functions using reduce, but I rarely use it like that. I'd use the actual functions instead.
crankharder has quit [Ping timeout: 258 seconds]
<hays> yeah, makes sense although it might be hard to formalize that heristic
davidw has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
zcarey has quit [Ping timeout: 250 seconds]
<baweaver> My common rule is that if I have to ask or think about something being appropriate I probably shouldn't do something
Nicmavr has quit [Read error: Connection reset by peer]
<baweaver> That applies to programming, life, and other bits as well.
<lunarkittychan> ooh, github private repos are now free
<baweaver> ohai lunarkittychan
<lunarkittychan> hai
lupine has joined #ruby
uplime has joined #ruby
Nicmavr has joined #ruby
<hays> lunarkittychan: really??
<hays> like.. can you share them?
davidw has quit [Ping timeout: 258 seconds]
<hays> three collaborators... nice
<hays> i dunno. i don't trust microsoft
<hays> but it seems people aren't really rushing off the platform
davidw has joined #ruby
<lunarkittychan> hays: I didn't look into the details yet
SeepingN has quit [Quit: The system is going down for reboot NOW!]
r29v has joined #ruby
Davey is now known as D[a]vey
D[a]vey is now known as Davey
Davey is now known as D[a]vey
D[a]vey is now known as Davey
RedNifre has quit [Ping timeout: 252 seconds]
stryek has quit [Quit: Connection closed for inactivity]
davidw has quit [Ping timeout: 244 seconds]
xall has joined #ruby
rkazak has joined #ruby
tiff has joined #ruby
gix has quit [Ping timeout: 246 seconds]
ramfjord has quit [Read error: Connection reset by peer]
r29v has quit [Quit: r29v]
mikecmpbll has quit [Quit: inabit. zz.]
ramfjord has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maryo_ has joined #ruby
raulp has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arthurnn has quit [Ping timeout: 250 seconds]
raulp has quit [Client Quit]
arthurnn has joined #ruby
maryo_ has quit [Quit: Leaving]
bmurt has joined #ruby
raulp has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
ogres has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
ramfjord has quit [Ping timeout: 258 seconds]
dymk has quit [Ping timeout: 250 seconds]
rkazak has joined #ruby
gnufied has quit [Quit: Leaving]
eckhardt has joined #ruby
Swyper has joined #ruby
<Swyper> I need to write a method to pass these tests
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Swyper> eval_block(*args) do |*args|
<Swyper> end
<Swyper> is this the correct way to write a method with splat?
<Swyper> havenwood, if your on
tdy has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
rkazak has joined #ruby
davidw has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
braincrash has quit [Quit: bye bye]
akem has quit [Quit: Leaving]
braincrash has joined #ruby
d10n-work has joined #ruby
tdy has joined #ruby
akem has joined #ruby
marmotini has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
ur5us has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
millerti has quit [Ping timeout: 246 seconds]
hell0h0la has joined #ruby
sauvin has joined #ruby
Swyper has quit [Remote host closed the connection]
sanscoeur has joined #ruby
dellavg_ has joined #ruby
davidw has quit [Ping timeout: 268 seconds]
marmotini has quit [Ping timeout: 258 seconds]
tdy has joined #ruby
davidw has joined #ruby
Azure has quit [Read error: Connection reset by peer]
hutch has quit [Ping timeout: 245 seconds]
Azure has joined #ruby
d10n-work has quit [Ping timeout: 252 seconds]
hutch has joined #ruby
d10n-work has joined #ruby
Sina has quit [Quit: Connection closed for inactivity]
hell0h0la has left #ruby ["Leaving of your life"]
davidw has quit [Ping timeout: 250 seconds]
xall has quit [Ping timeout: 245 seconds]
<hays> if I make an accessor with attr_accessor, why would i need to access it with self.accessor
<hays> seems like without the self. it doesn't actually assign but treats it like a local var
xall has joined #ruby
marmotini has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
xall has quit [Ping timeout: 245 seconds]
zenogais has quit [Ping timeout: 246 seconds]
<hays> i guess its ambiguous
hovis has quit [Ping timeout: 268 seconds]
rkazak has joined #ruby
xall has joined #ruby
Guest86938 has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
<baweaver> With += yeah, it does bad things
<baweaver> I still don't agree with it treating it as a local variable in that context honestly
xall has quit [Ping timeout: 246 seconds]
xall has joined #ruby
dellavg_ has quit [Ping timeout: 250 seconds]
hutch has quit [Ping timeout: 244 seconds]
za1b1tsu has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
ramfjord has joined #ruby
reber has joined #ruby
xall has quit [Ping timeout: 268 seconds]
ramfjord has quit [Ping timeout: 244 seconds]
tdy has quit [Ping timeout: 272 seconds]
conta has joined #ruby
gix has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
d10n-work has quit [Quit: Connection closed for inactivity]
dionysus69 has joined #ruby
Guest86938 has quit [Ping timeout: 252 seconds]
rkazak has quit [Quit: Sleep.....ing....]
Guest86938 has joined #ruby
phredus_ has joined #ruby
mn3m has joined #ruby
phredus__ has joined #ruby
phredus_ has left #ruby ["Leaving"]
phredus__ has quit [Client Quit]
phredus_ has joined #ruby
Guest86938 has quit [Ping timeout: 252 seconds]
aupadhye has joined #ruby
sqbell has joined #ruby
themsay has joined #ruby
gix has quit [Ping timeout: 250 seconds]
sqbell has quit [Ping timeout: 250 seconds]
zululee_ has joined #ruby
olspookishmagus has joined #ruby
sqbell has joined #ruby
alem0lars has joined #ruby
rippa has joined #ruby
tiff has joined #ruby
themsay has quit [Ping timeout: 240 seconds]
Inline has quit [Quit: Leaving]
cnsvc has joined #ruby
za1b1tsu has joined #ruby
moei has joined #ruby
Sina has joined #ruby
mn3m has quit [Quit: mn3m]
dionysus69 has quit [Ping timeout: 258 seconds]
alem0lars has quit [Ping timeout: 252 seconds]
beaky has quit [Read error: Connection reset by peer]
clemens3 has joined #ruby
beaky has joined #ruby
alem0lars has joined #ruby
priodev has joined #ruby
dkmueller has quit [Quit: Lost terminal]
armyriad has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
hays has quit [Ping timeout: 244 seconds]
hays has joined #ruby
uplime has quit [Quit: WeeChat 2.2]
sqbell has quit [Ping timeout: 250 seconds]
themsay has joined #ruby
arcaos has joined #ruby
aufi has joined #ruby
arcaos has quit [Remote host closed the connection]
cnsvc has quit [Remote host closed the connection]
vondruch has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 244 seconds]
cthulchu_ has quit [Ping timeout: 250 seconds]
aufi_ has joined #ruby
aufi has quit [Ping timeout: 244 seconds]
RougeR has quit [Ping timeout: 272 seconds]
vondruch has joined #ruby
Bish has quit [Quit: leaving]
ansraliant has quit [Quit: My planet needs me]
mikecmpbll has joined #ruby
xall has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drale2k_ has joined #ruby
xall has quit [Quit: xall]
maufart__ has joined #ruby
aufi_ has quit [Ping timeout: 258 seconds]
scatterp has joined #ruby
<scatterp> hi i updated from ruby 2.5.1 to ruby 2.6.0 and I am getting this error TypeError (wrong argument type Hash (expected String)): app/controllers/application_controller.rb:208:in `set_gon' can any one tell me whats wrong here gem files are all the same
Guest86938 has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest86938 has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
<phaul> scatterp: please paste that file.
postmodern has quit [Quit: Leaving]
ramfjord has joined #ruby
dionysus69 has joined #ruby
blackmesa has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
NL3limin4t0r is now known as NL3limin4t0r_afk
<scatterp> phaul: ok sorry for delayed response
Guest86938 has joined #ruby
<phaul> scatterp: nothing obvious I can see.
<scatterp> phaul: i am currently testing upgrading 1 ruby version at a time 2.5.3 did not have the error any other suggestions that I could try ?
<phaul> I would start by verifying that the call in question is inject({}). Pass a different argument like [] instead of {} and check that the error msg changes.
<scatterp> phaul: ok one moment
<phaul> this time it should complain wrong argument type Array (expected String)
lxsameer has quit [Quit: WeeChat 2.3]
lxsameer has joined #ruby
<scatterp> phaul: TypeError (wrong argument type Hash (expected String))
<phaul> hm. so it's probably not even that call. this is going to be very difficult to debug over IRC unfortunately
Puffball has joined #ruby
<phaul> are you familiar with pry and or byebug?
<scatterp> byebug is in the gemfile not completely familiar with it
apparition has joined #ruby
comet23 has quit [Quit: Connection closed for inactivity]
<scatterp> i have a suspicion the problem is due to activerecord version (needs updating)
<phaul> stick a require 'byebug' at the top of the file and a single line that just says byebug on line 207
<phaul> re-running the app should stop at a byebug prompt, where you can inspect the variables inside that method.
<scatterp> ok
<scatterp> one moment
<phaul> at the prompt try the followings:
<phaul> puts current_user.accounts.class
<phaul> puts current_user.accounts.first.class
<ruby[bot]> scatterp: as I told you already, please use https://gist.github.com
<phaul> scatterp: ignore ruby[bot] for now
<scatterp> ok
<phaul> ah. we are getting closer, current_user.accounts.first.class reproduces this issue
<phaul> now enter this line at the byebug prompt:
<phaul> catch TypeError
<phaul> continue
cd has joined #ruby
<phaul> when stops enter this:
<phaul> bt
<scatterp> phaul: ok
<scatterp> one moment
<ruby[bot]> scatterp: as I told you already, please use https://gist.github.com
<scatterp> phaul: I also see this warning (/home/deploy/peatio/current/vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.10/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.)
<phaul> yeah, as you said activerecord 4.2.10 might be now incompatible
Guest86938 has quit [Ping timeout: 252 seconds]
<phaul> I think it comes from frame 4 in your backtrace, where the mysql2 adapter calls the old interface on BigDecimal
<scatterp> phaul: its a thought but we are no where near your skill level...
<scatterp> yes thats what we was looking at
<phaul> at byebug prompt you can zoom on any part of the backtrace with the fr command.
<scatterp> phaul: i tried changing all bigdecimals to bigdecimal() the warning went away but still the same error..
conta has quit [Quit: conta]
blackmesa has quit [Quit: WeeChat 2.3]
<phaul> check frame 4 from the backtrace. when byebug is stopped at the exception ( the point when you did bt command) do frame 4.
<ruby[bot]> scatterp: as I told you already, please use https://gist.github.com
<phaul> hm. that's not it. I meant this location home/deploy/peatio/current/vendor/bundle/ruby/2.6.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/mysql2_adapter.rb:222
<phaul> but it feels first you should upgrade active_record, and see where that takes you.. you can also ask #RubyOnRails if they know about such incompatibility.
<ruby[bot]> scatterp: as I told you already, please use https://gist.github.com
<scatterp> phaul: ok let me try that. thanks for the help
alem0lars has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ruby
vonfry has joined #ruby
phredus_ has quit [Quit: Leaving]
darkphnx has joined #ruby
Swyper has joined #ruby
Swyper has quit [Ping timeout: 272 seconds]
segy has quit [Quit: ZNC - http://znc.in]
Guest86938 has joined #ruby
segy has joined #ruby
exchgr` has joined #ruby
exchgr has quit [Ping timeout: 252 seconds]
<al2o3-cr> include a class in a class
<al2o3-cr> &>> require 'fiddle'; include Fiddle; X = Class.new { define_method(:ru) { __callee__.to_s << "by" } }; Pointer[dlwrap X][0,16] = Pointer[dlwrap Module.new][0,16]; Class.new { include X }.new.ru
<rubydoc> # => "ruby" (https://carc.in/#/r/5y7m)
Nicmavr has quit [Read error: Connection reset by peer]
<al2o3-cr> ^ phaul
<al2o3-cr> lol
<phaul> al2o3-cr: hi there
<al2o3-cr> hello, phaul :)
<phaul> pff. your fiddling capabilities are way beyond me :) I wonder if there is a limit to what you can do
Nicmavr has joined #ruby
<al2o3-cr> the possibilities are endless :P
za1b1tsu has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
Linuus_ has joined #ruby
vonfry has quit [Quit: WeeChat 2.3]
<Linuus_> I have a rails project where we use rspec. Some specs doesn't need all of rails to run so we just require our spec_helper (instead of the rails_helper) and require the file we need for the tests in that file. Now, when we I'm running the entire test suite I get a lot of warnings about constants being re-initialized. This is (I AFAICT) because the same file is loaded multiple times. Adding ||= to all constant assignments solves the iss
<Linuus_> Any better ideas?
<Linuus_> For instance, if a file contains class Foo; Bar = "OMG".freeze; end I will get the warning "Bar is already initialized bla bla"
<al2o3-cr> Linuus_: i'd just set $VERBOSE = nil
<al2o3-cr> they're only warnings after all.
stryek has joined #ruby
<TheBrayn> wasn't there a feature in recent ruby versions to do something like this easier: http://chrisholtz.com/blog/lets-make-a-ruby-hash-map-method-that-returns-a-hash-instead-of-an-array/
vondruch has quit [Ping timeout: 258 seconds]
<al2o3-cr> TheBrayn: Enumerable#to_h
lucasb has joined #ruby
<al2o3-cr> &ri Enumerable#to_h TheBrayn
nertzy has joined #ruby
shadeslayer is now known as shadeslayer[m]
shadeslayer[m] is now known as shadeslayer
michael_mbp has quit [Ping timeout: 272 seconds]
Guest86938 has quit [Remote host closed the connection]
Guest86938 has joined #ruby
RedNifre has joined #ruby
marmotini has quit [Ping timeout: 258 seconds]
<TheBrayn> is that new in 2.6?
ua has quit [Ping timeout: 245 seconds]
<al2o3-cr> TheBrayn: yes.
<TheBrayn> ok, I still have 2.5
RedNifre has quit [Ping timeout: 268 seconds]
<TheBrayn> but nice to know nonetheless
<al2o3-cr> aye :)
RedNifre has joined #ruby
ua has joined #ruby
conta1 has joined #ruby
creat has quit [Ping timeout: 250 seconds]
michael_mbp has joined #ruby
creat has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
bmurt has joined #ruby
vondruch has joined #ruby
Linuus_ has quit [Quit: Page closed]
apparition has quit [Quit: Bye]
Swyper has joined #ruby
<Swyper> hi there
<phaul> _o/
<Swyper> so I could do something like args.each { bloc } and that should give me what I want?
<Swyper> what I want is to pass this test cases >_>
ramfjord has joined #ruby
<phaul> no
<phaul> yield_with_args checks if it yields the args in one go. 3 args one time, not 1 arg 3 times
ramfjord has quit [Ping timeout: 246 seconds]
<phaul> the only thing that's suspect to me with the implementation on the paste is the double *args, one shadowing the other
<phaul> well, scratch that, there are other issues
<Swyper> if block_given?
<Swyper> yield_with_args
<Swyper> else
<Swyper> this also does not work :p
<phaul> on the paste it's a mixture of definition of the method and a call to a method. when you define a method use the def keyword. Also in the definition you don't pass a block. you will pass the block when the method is called
<phaul> def eval_block(*args, &block) ; ... implementation body comes here .. ; end
<phaul> there is no def eval_block(...) do
<Swyper> NameError: undefined local variable or method `args' for main:Object
eb0t has quit [Ping timeout: 245 seconds]
<phaul> the def keyword is still missing
polishdub has joined #ruby
<Swyper> 1) #eval_block when a block is given passes the arguments into the block Failure/Error: expect do |block|
<Swyper> expected given block to yield with arguments, but did not yield
<Swyper> hmm
<Swyper> also sorry for being so useless and nooby with this one, I'm not that good with blocs
<al2o3-cr> Swyper: change yield_with_args to block.call(*args)
<phaul> Swyper: don't worry we all started somewhere
<al2o3-cr> or bloc in your case.
eb0t has joined #ruby
<Swyper> expected: [1, 2, 3]
<Swyper> got: [[1, 2, 3]]
<al2o3-cr> Swyper: bloc.call(*args) not bloc.call(args)
<al2o3-cr> otherwise you're passing an array
<Swyper> oo
<Swyper> that worked thank you :P
<al2o3-cr> yay :)
<al2o3-cr> Swyper: what is this for?
<phaul> for these kind of conditions ppl tend to flatten out the if and move the error checks at the top. https://gist.github.com/468a27225c39179d7206e2c073b78cbb
<phaul> reads nicer
<Swyper> al2o3-cr: App Academy released their online curriculum for free their a top bootcamp so I'm following it
<Swyper> I'm a computer science student @ York U in Canada so I figure if its good enough to get people full time jobs at the very least it will help me get a decent internship xD
<al2o3-cr> Swyper: go for it then and good luck ;)
<Swyper> thank you
Rapture has joined #ruby
Guest86938 has quit [Quit: Konversation terminated!]
aupadhye is now known as aupadhye|brb
nowhere_man has joined #ruby
regedit has joined #ruby
<Swyper> NoMethodError:
<Swyper> private method `select' called for 10:Integer
<Swyper> hmm
<Swyper> I don't get this one
<Swyper> 1..num.select {|number| is_factor(number,num) == true}
<Swyper> maybe that will fix it
<al2o3-cr> Swyper: no.
Inline has joined #ruby
<al2o3-cr> you're calling Kernel#select wrap 1..num in parantheses
<Swyper> wow, I always forget that
<Swyper> thank you
<al2o3-cr> Swyper: np, but don't just wizz through these, take some time to understand what you are doing and what is going wrong.
<Swyper> for sure where I was getting stuck is the error dosent really say that this is the issue
<Swyper> maybe I should recheck the syntax of wherever the error is so I can identify it myself
hutch has joined #ruby
<al2o3-cr> yeah, generally NoMethodError indicates obj foo doesn't respond to method bar.
<al2o3-cr> you're getting that error because Kernel is included in Object.
kapil____ has joined #ruby
dbugger_ has joined #ruby
dbugger_ is now known as Dbugger
<mspo> -> { [1,2,3] }[].select { |x| x > 2 }
<al2o3-cr> #=> [3]
arcaos has joined #ruby
dinfuehr has quit [Ping timeout: 258 seconds]
sanscoeur has quit [Ping timeout: 252 seconds]
dinfuehr has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
RedNifre has quit [Ping timeout: 252 seconds]
impermanence has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 250 seconds]
arcaos has quit [Ping timeout: 258 seconds]
hutch has quit [Ping timeout: 268 seconds]
dinfuehr has joined #ruby
uplime has joined #ruby
Swyper has joined #ruby
TheBloke has quit [Read error: No route to host]
sanscoeur has joined #ruby
<Swyper> I get how bubble sort works and that I need to compare two elements the only issue I'm having is how do I reference an array that has not been created?
sanscoeur has quit [Remote host closed the connection]
knight33 has quit [Remote host closed the connection]
sanscoeur has joined #ruby
aupadhye|brb has quit [Remote host closed the connection]
<phaul> you have the full array interface at your displosal. #length, #[]
GodFather has joined #ruby
sanscoeur has quit [Remote host closed the connection]
<phaul> in an instance method length will just give you the length. self[3] will give you the elem under index 3
sanscoeur has joined #ruby
<phaul> but you can be explicit and also say self.length
conta1 has quit [Ping timeout: 272 seconds]
sanscoeur has quit [Remote host closed the connection]
TheBloke has joined #ruby
<Swyper> so maybe use this.length? I should mention at this point in the cirriculum I have not studied classes at all - so I can come back to this later if you think I'm not ready for this :P
<Swyper> ah
sanscoeur has joined #ruby
dinfuehr has quit [Ping timeout: 258 seconds]
<phaul> methods without explicit receiver are always sent to self. you can ommit self, but writing self.method also works
sanscoeur has quit [Remote host closed the connection]
<phaul> there are cases when you have to spell out self.. for instance #class would be taken as the class keyword, not the class method.
sanscoeur has joined #ruby
sanscoeur has quit [Remote host closed the connection]
dinfuehr has joined #ruby
chouhoulis has joined #ruby
dinfuehr_ has joined #ruby
GodFather has quit [Ping timeout: 268 seconds]
sanscoeur has joined #ruby
sanscoeur has quit [Read error: Connection reset by peer]
scrptktty has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ruby
dinfuehr_ has quit [Ping timeout: 268 seconds]
d10n-work has joined #ruby
<NL3limin4t0r_afk> Another one is when using the square brackets. `[1]` simply creates an new array in void context, whereas `self[1]` uses the [] accessor.
GodFather has joined #ruby
maufart__ has quit [Ping timeout: 245 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
r29v has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
dinfuehr has quit [Ping timeout: 245 seconds]
cthulchu_ has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ruby
GodFather has joined #ruby
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
dinfuehr has joined #ruby
davidw has joined #ruby
Swyper has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 246 seconds]
za1b1tsu has quit [Remote host closed the connection]
cthulchu_ has quit [Ping timeout: 250 seconds]
cthulchu_ has joined #ruby
r29v has quit [Quit: r29v]
dinfuehr has joined #ruby
GodFather has quit [Ping timeout: 252 seconds]
Aqo has joined #ruby
unreal has joined #ruby
ams__ has joined #ruby
dinfuehr has quit [Ping timeout: 245 seconds]
dinfuehr has joined #ruby
bga57 has quit [Ping timeout: 240 seconds]
clemens3 has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 245 seconds]
dinfuehr has joined #ruby
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
GodFather has joined #ruby
duderonomy has quit [Ping timeout: 272 seconds]
\void has joined #ruby
tdy has joined #ruby
catbusters has joined #ruby
duderonomy has joined #ruby
hiroaki has joined #ruby
patteh has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 258 seconds]
hutch has joined #ruby
dinfuehr_ has joined #ruby
uplime has quit [Ping timeout: 244 seconds]
duderono_ has joined #ruby
duderonomy has quit [Ping timeout: 258 seconds]
uplime has joined #ruby
tdy has quit [Ping timeout: 272 seconds]
r29v has joined #ruby
tdy has joined #ruby
za1b1tsu has joined #ruby
Swyper has joined #ruby
<za1b1tsu> Stupid question, why do I add my gems dependencies in gemspec? Why not directly into the gemfile? What is the difference?
<za1b1tsu> Or better yet, what is the logic?
<za1b1tsu> I think that is my actual question
Swyper has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Ping timeout: 246 seconds]
orbyt_ has joined #ruby
thunderbirdtr has quit [Quit: ZNC 1.7.1 - https://znc.in]
Swyper has joined #ruby
<canton7> za1b1tsu, it's about apps vs gems, see some of the articles here: https://www.google.com/search?q=gemfile+gemspec
<canton7> long story short: bundler/gemfile is for locking down the exact versions of gems that your application uses. gemspec is used when creating a gem, is used tell consumers what gems your library depends on, and you specify lax ranges rather than specific versions
Swyper has quit [Remote host closed the connection]
maryo has joined #ruby
Swyper has joined #ruby
dinfuehr_ has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
clemens3 has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
dinfuehr has quit [Ping timeout: 246 seconds]
Swyper has quit [Remote host closed the connection]
sanscoeur has joined #ruby
dinfuehr has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
sauvin has quit [Read error: Connection reset by peer]
dinfuehr has joined #ruby
sanscoeu_ has joined #ruby
marmotini_ has joined #ruby
dinfuehr has quit [Ping timeout: 245 seconds]
<havenwood> za1b1tsu: What canton7 said. Gems in the gemspec are deps, and are installed alongside a gem. A Gemfile in a gem is for contributors to the gem, and often just has a `gemspec` directive - meaning install the gems in the gemspec. With gems, unlike apps, you don't commit the Gemfile.lock.
FastJack has quit [Remote host closed the connection]
sanscoeur has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
maryo has quit [Ping timeout: 258 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
dinfuehr has quit [Ping timeout: 258 seconds]
dinfuehr has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
GodFather has joined #ruby
tdy has joined #ruby
polishdub has quit [Ping timeout: 250 seconds]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
dellavg_ has joined #ruby
scrptktty has quit [Quit: Connection closed for inactivity]
kapil____ has quit [Quit: Connection closed for inactivity]
grvgr has joined #ruby
sanscoeu_ has quit [Remote host closed the connection]
sanscoeur has joined #ruby
snickers has joined #ruby
ramfjord has joined #ruby
conta1 has joined #ruby
za1b1tsu has quit [Ping timeout: 272 seconds]
catbusters has quit [Quit: Connection closed for inactivity]
sameerynho has joined #ruby
Renich has quit [Read error: Connection reset by peer]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
FastJack has joined #ruby
lxsameer has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
za1b1tsu has joined #ruby
conta1 has quit [Quit: conta1]
GodFather has joined #ruby
cow[moo] has quit [Read error: Connection reset by peer]
mzo has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 250 seconds]
gix has joined #ruby
maufart__ has joined #ruby
mzo has quit [Ping timeout: 246 seconds]
NL3limin4t0r is now known as NL3limin4t0r_afk
tdy has joined #ruby
maufart__ has quit [Ping timeout: 252 seconds]
themsay has joined #ruby
GodFather has joined #ruby
krawchyk has joined #ruby
<za1b1tsu> ok, now I understand
<za1b1tsu> but what is exactly the difference between a gem and an app?
tdy has quit [Ping timeout: 258 seconds]
za1b1tsu has quit [Remote host closed the connection]
marmotini_ has quit [Ping timeout: 244 seconds]
grvgr has quit [Quit: grvgr]
tdy has joined #ruby
<al2o3-cr> does IO.copy_stream use sendfile(2) copy_file_range(2) or splice(2)
krawchyk_ has joined #ruby
krawchyk has quit [Ping timeout: 258 seconds]
tdy has quit [Ping timeout: 245 seconds]
<al2o3-cr> aha, ifdefs on copy_file_range and sendfile.
scatterp has quit [Ping timeout: 256 seconds]
RedNifre has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
krawchyk_ has quit [Quit: krawchyk_]
reber has quit [Remote host closed the connection]
zenogais has joined #ruby
GodFather has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has joined #ruby
RedNifre has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
GodFather has joined #ruby
RedNifre has joined #ruby
orbyt_ has joined #ruby
hiroaki has quit [Ping timeout: 272 seconds]
lxsameer has quit [Ping timeout: 246 seconds]
JasonO has quit [Excess Flood]
SeepingN has joined #ruby
dalpo has quit [Ping timeout: 246 seconds]
RedNifre has quit [Ping timeout: 268 seconds]
Dbugger has quit [Ping timeout: 252 seconds]
JasonO has joined #ruby
hiroaki has joined #ruby
RedNifre has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
sameerynho has quit [Ping timeout: 246 seconds]
krawchyk has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rkoller has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
s3nd1v0g1us has joined #ruby
omix has joined #ruby
szulak_ has joined #ruby
omix has quit [Quit: leaving]
tdy has joined #ruby
bvdw has quit [Quit: Ping timeout (120 seconds)]
bvdw has joined #ruby
brandonkal has joined #ruby
rkoller has quit [Quit: Textual IRC Client: www.textualapp.com]
tiff has joined #ruby
s3nd1v0g1us has quit [Read error: Connection reset by peer]
RougeR has joined #ruby
<RougeR> hey, does anyone know how too create a time object that is HH:MM:SS but like a timer
<RougeR> and be able to use it too increment the time
GodFather has quit [Ping timeout: 268 seconds]
<RougeR> i.e starts at 00:00:00 > 00:00:30 > 00:01:00
Nicmavr has quit [Read error: Connection reset by peer]
<RougeR> for 30 sec increments
Nicmavr has joined #ruby
<uplime> i used eventmachine for all of my timers, not sure if theres a different way
<RougeR> its just for writing time to a file
<RougeR> trying to optimize by not converting to a new time object every loop
<RougeR> worst case ill just do that
krawchyk has quit [Quit: krawchyk]
<RougeR> current uses
<RougeR> Time.at(clipstart).gmtime.strftime('%H:%M:%S.%L')
<uplime> https://github.com/socketry/timers looks promising
<RougeR> oooh
<RougeR> ive had an idea
<RougeR> ill look at that too uplime
RougeR has quit [Remote host closed the connection]
<uplime> nice
snuz has joined #ruby
<uplime> oh
RougeR has joined #ruby
<RougeR> sorry disconned
<uplime> well, if anyone happens to have a better solution i'd still love to hear it
<uplime> oh good you're back
<RougeR> unfortunately uplime i dont want to add a new gem just for this one line
<RougeR> however
<RougeR> ive had an idea
<RougeR> all i need is a counter. and ruby bases all time objects off of unix time
<RougeR> i could just use a normal time object
<RougeR> then use strftime to format it
<RougeR> and not care what the actual object says
szulak_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<uplime> hm ok
<RougeR> bit hacky
<RougeR> but itll work
<uplime> nice
<RougeR> i dont think ill ever need longer than 24 hours...
<RougeR> lol
duderono_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RougeR> its a fun issue im working on in ruby
<RougeR> basically this from scratch using ffmpeg commands to generate the thumbnail grid
<RougeR> dynamically resizes in ruby, then generate vtt in ruby
snuz has quit [Quit: WeeChat 2.3]
<RougeR> idk
<RougeR> might be a hacky approach
RedNifre has quit [Ping timeout: 252 seconds]
Aqo has quit [Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805]]
hutch has quit [Ping timeout: 245 seconds]
<RougeR> uplime, well it works...
<RougeR> up to 24:00:00.000
tdy has quit [Remote host closed the connection]
<RougeR> time = Time.now(0)
<RougeR> time += 30
<RougeR> string_to_write = time.gmtime.strftime('%H:%M:%S.%L')
<RougeR> etc
cd has quit [Quit: cd]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has joined #ruby
SeepingN has joined #ruby
SeepingN has quit [Client Quit]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clemens3 has quit [Ping timeout: 268 seconds]
SeepingN has joined #ruby