« Back to channel list

#ruby - 08 January 2019

« Back 1 day Forward 1 day »
[00:03:32] solocshaw: has joined #ruby
[00:04:52] drale2k_: has joined #ruby
[00:11:52] RougeR: has joined #ruby
[00:30:08] ramfjord: has joined #ruby
[00:30:53] solocshaw: has joined #ruby
[00:40:44] RougeR: has joined #ruby
[00:46:38] impermanence: has joined #ruby
[00:47:45] zenogais: has joined #ruby
[00:52:10] 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.
[00:57:26] conta: has joined #ruby
[00:59:18] marmotini: has joined #ruby
[01:00:30] solocshaw1: has joined #ruby
[01:07:54] zcarey: has joined #ruby
[01:14:02] DarthGandalf: has joined #ruby
[01:31:21] havenwood: has joined #ruby
[01:31:48] hays: baweaver: where is the line with metaprogramming
[01:32:50] 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.
[01:32:57] baweaver: Though I'd also argue that people seriously overload that word as well
[01:33:07] baweaver: and a lot of the ideas that are dubbed as metaprogramming really aren't
[01:33:10] hays: maybe im using it and i dont know it
[01:33:44] 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
[01:34:07] baweaver: find_by_name_and_email type methods don't really exist anymore in favor of keyword / query type methods
[01:34:37] hays: what if i was writing something ike roda where i define a class capable of doing the route do end stuff
[01:34:49] baweaver: Not really metaprogramming.
[01:35:03] baweaver: That's just making a DSL using functions
[01:35:26] 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
[01:35:52] 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
[01:36:45] hays: yeah i think its one thing truly unique about ruby that it basically got from smalltalk
[01:36:50] 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.
[01:37:01] hays: unique in the sense if you look at other popular modern languages
[01:37:14] baweaver: Use the least powerful tool to do the task you need, less likely to behave oddly later
[01:37:41] hays: i like D. Thomas' distinction between class oriented programming and OOP
[01:37:55] 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.
[01:39:59] hays: yeah, makes sense although it might be hard to formalize that heristic
[01:41:20] davidw: has joined #ruby
[01:43:43] baweaver: My common rule is that if I have to ask or think about something being appropriate I probably shouldn't do something
[01:43:52] baweaver: That applies to programming, life, and other bits as well.
[01:43:56] lunarkittychan: ooh, github private repos are now free
[01:44:50] baweaver: ohai lunarkittychan
[01:45:18] lupine: has joined #ruby
[01:45:46] uplime: has joined #ruby
[01:45:47] Nicmavr: has joined #ruby
[01:47:20] hays: lunarkittychan: really??
[01:47:33] hays: like.. can you share them?
[01:48:00] hays: three collaborators... nice
[01:48:40] hays: i dunno. i don't trust microsoft
[01:49:30] hays: but it seems people aren't really rushing off the platform
[01:52:33] davidw: has joined #ruby
[01:55:44] lunarkittychan: hays: I didn't look into the details yet
[01:58:55] r29v: has joined #ruby
[02:12:42] xall: has joined #ruby
[02:16:38] rkazak: has joined #ruby
[02:26:40] tiff: has joined #ruby
[02:35:12] ramfjord: has joined #ruby
[02:56:21] maryo_: has joined #ruby
[02:57:43] raulp: has joined #ruby
[03:00:59] arthurnn: has joined #ruby
[03:10:26] bmurt: has joined #ruby
[03:12:02] raulp: has joined #ruby
[03:28:13] ogres: has joined #ruby
[03:42:39] rkazak: has joined #ruby
[03:50:18] eckhardt: has joined #ruby
[03:51:50] Swyper: has joined #ruby
[03:51:55] Swyper: https://dpaste.de/ke4f
[03:52:02] Swyper: I need to write a method to pass these tests
[03:54:34] Swyper: eval_block(*args) do |*args|
[03:54:44] Swyper: is this the correct way to write a method with splat?
[03:55:35] Swyper: havenwood, if your on
[03:56:18] tdy: has joined #ruby
[03:59:59] rkazak: has joined #ruby
[04:00:42] davidw: has joined #ruby
[04:09:21] braincrash: has joined #ruby
[04:11:31] d10n-work: has joined #ruby
[04:13:25] tdy: has joined #ruby
[04:15:42] akem: has joined #ruby
[04:16:37] marmotini: has joined #ruby
[04:24:33] za1b1tsu: has joined #ruby
[04:32:55] hell0h0la: has joined #ruby
[04:42:16] sauvin: has joined #ruby
[04:51:14] sanscoeur: has joined #ruby
[04:51:20] dellavg_: has joined #ruby
[04:57:36] tdy: has joined #ruby
[04:57:59] davidw: has joined #ruby
[05:09:15] Azure: has joined #ruby
[05:11:05] hutch: has joined #ruby
[05:13:12] d10n-work: has joined #ruby
[05:18:00] hell0h0la: has left #ruby: ("Leaving of your life")
[05:21:08] hays: if I make an accessor with attr_accessor, why would i need to access it with self.accessor
[05:21:30] hays: seems like without the self. it doesn't actually assign but treats it like a local var
[05:22:11] xall: has joined #ruby
[05:25:01] marmotini: has joined #ruby
[05:30:56] hays: i guess its ambiguous
[05:32:32] rkazak: has joined #ruby
[05:34:14] xall: has joined #ruby
[05:34:55] Guest86938: has joined #ruby
[05:38:24] baweaver: With += yeah, it does bad things
[05:38:53] baweaver: I still don't agree with it treating it as a local variable in that context honestly
[05:53:49] xall: has joined #ruby
[06:02:55] za1b1tsu: has joined #ruby
[06:03:54] ramfjord: has joined #ruby
[06:07:10] reber: has joined #ruby
[06:21:27] conta: has joined #ruby
[06:27:30] gix: has joined #ruby
[06:41:03] dionysus69: has joined #ruby
[06:51:54] Guest86938: has joined #ruby
[06:55:32] phredus_: has joined #ruby
[06:59:30] mn3m: has joined #ruby
[07:03:10] phredus__: has joined #ruby
[07:04:12] phredus_: has left #ruby: ("Leaving")
[07:04:43] phredus_: has joined #ruby
[07:08:10] aupadhye: has joined #ruby
[07:14:18] sqbell: has joined #ruby
[07:18:42] themsay: has joined #ruby
[07:21:28] zululee_: has joined #ruby
[07:27:08] olspookishmagus: has joined #ruby
[07:31:06] sqbell: has joined #ruby
[07:34:57] alem0lars: has joined #ruby
[07:37:49] rippa: has joined #ruby
[07:44:54] tiff: has joined #ruby
[07:54:16] cnsvc: has joined #ruby
[07:55:07] za1b1tsu: has joined #ruby
[07:58:06] moei: has joined #ruby
[07:58:35] sina: has joined #ruby
[08:07:01] clemens3: has joined #ruby
[08:08:16] beaky: has joined #ruby
[08:08:34] alem0lars: has joined #ruby
[08:09:09] priodev: has joined #ruby
[08:15:25] armyriad: has joined #ruby
[08:19:06] hays: has joined #ruby
[08:21:27] themsay: has joined #ruby
[08:28:51] arcaos: has joined #ruby
[08:30:42] aufi: has joined #ruby
[08:50:39] aufi_: has joined #ruby
[08:57:30] vondruch: has joined #ruby
[09:08:47] mikecmpbll: has joined #ruby
[09:16:16] xall: has joined #ruby
[09:20:47] drale2k_: has joined #ruby
[09:26:39] maufart__: has joined #ruby
[09:30:01] scatterp: has joined #ruby
[09:31:23] 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
[09:34:26] Guest86938: has joined #ruby
[09:45:42] lxsameer: has joined #ruby
[09:46:07] phaul: scatterp: please paste that file.
[10:04:17] ramfjord: has joined #ruby
[10:04:24] dionysus69: has joined #ruby
[10:06:28] blackmesa: has joined #ruby
[10:13:36] scatterp: phaul: ok sorry for delayed response
[10:15:06] scatterp: phaul: http://paste.ubuntu.com/p/jHkZkqvfFT/
[10:16:27] Guest86938: has joined #ruby
[10:19:20] phaul: scatterp: nothing obvious I can see.
[10:21:13] 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 ?
[10:21:45] 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.
[10:22:15] scatterp: phaul: ok one moment
[10:22:57] phaul: this time it should complain wrong argument type Array (expected String)
[10:35:55] lxsameer: has joined #ruby
[10:36:12] scatterp: phaul: TypeError (wrong argument type Hash (expected String))
[10:38:50] phaul: hm. so it's probably not even that call. this is going to be very difficult to debug over IRC unfortunately
[10:39:33] Puffball: has joined #ruby
[10:43:52] phaul: are you familiar with pry and or byebug?
[10:44:28] scatterp: byebug is in the gemfile not completely familiar with it
[10:44:30] apparition: has joined #ruby
[10:45:04] scatterp: i have a suspicion the problem is due to activerecord version (needs updating)
[10:47:19] phaul: stick a require 'byebug' at the top of the file and a single line that just says byebug on line 207
[10:48:07] phaul: re-running the app should stop at a byebug prompt, where you can inspect the variables inside that method.
[10:53:58] phaul: at the prompt try the followings:
[10:54:12] phaul: puts current_user.accounts.class
[10:54:34] phaul: puts current_user.accounts.first.class
[10:59:47] scatterp: phaul: https://pastebin.com/XHLubZU9
[10:59:47] ruby[bot]: scatterp: as I told you already, please use https://gist.github.com
[11:00:04] phaul: scatterp: ignore ruby[bot] for now
[11:01:18] phaul: ah. we are getting closer, current_user.accounts.first.class reproduces this issue
[11:06:05] phaul: now enter this line at the byebug prompt:
[11:06:17] phaul: catch TypeError
[11:07:00] cd: has joined #ruby
[11:07:07] phaul: when stops enter this:
[11:10:24] scatterp: phaul: https://pastebin.com/UXZ33dt0
[11:10:24] ruby[bot]: scatterp: as I told you already, please use https://gist.github.com
[11:12:25] 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.)
[11:13:36] phaul: yeah, as you said activerecord 4.2.10 might be now incompatible
[11:16:15] phaul: I think it comes from frame 4 in your backtrace, where the mysql2 adapter calls the old interface on BigDecimal
[11:16:29] scatterp: phaul: its a thought but we are no where near your skill level...
[11:16:36] scatterp: yes thats what we was looking at
[11:17:27] phaul: at byebug prompt you can zoom on any part of the backtrace with the fr command.
[11:17:40] scatterp: phaul: i tried changing all bigdecimals to bigdecimal() the warning went away but still the same error..
[11:20:13] phaul: check frame 4 from the backtrace. when byebug is stopped at the exception ( the point when you did bt command) do frame 4.
[11:22:12] scatterp: phaul: https://pastebin.com/dbfxk6g4
[11:22:12] ruby[bot]: scatterp: as I told you already, please use https://gist.github.com
[11:23:26] 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
[11:25:19] 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.
[11:25:29] scatterp: phaul: https://pastebin.com/gkSLrr6P
[11:25:30] ruby[bot]: scatterp: as I told you already, please use https://gist.github.com
[11:29:06] scatterp: phaul: ok let me try that. thanks for the help
[11:45:11] _whitelogger: has joined #ruby
[11:49:26] vonfry: has joined #ruby
[11:54:52] darkphnx: has joined #ruby
[11:58:37] Swyper: has joined #ruby
[12:13:48] Guest86938: has joined #ruby
[12:16:15] segy: has joined #ruby
[12:18:13] exchgr`: has joined #ruby
[12:22:58] al2o3-cr: include a class in a class
[12:23:26] 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
[12:23:29] rubydoc: # => "ruby" (https://carc.in/#/r/5y7m)
[12:25:36] phaul: al2o3-cr: hi there
[12:25:59] al2o3-cr: hello, phaul :)
[12:26:52] phaul: pff. your fiddling capabilities are way beyond me :) I wonder if there is a limit to what you can do
[12:27:03] Nicmavr: has joined #ruby
[12:28:31] al2o3-cr: the possibilities are endless :P
[12:29:11] za1b1tsu: has joined #ruby
[12:30:41] Linuus`: has joined #ruby
[12:33:34] 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
[12:33:40] Linuus`: Any better ideas?
[12:34:55] Linuus`: For instance, if a file contains class Foo; Bar = "OMG".freeze; end I will get the warning "Bar is already initialized bla bla"
[12:36:25] al2o3-cr: Linuus_: i'd just set $VERBOSE = nil
[12:36:53] al2o3-cr: they're only warnings after all.
[12:39:47] stryek: has joined #ruby
[13:03:06] 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/
[13:06:10] al2o3-cr: TheBrayn: Enumerable#to_h
[13:08:07] lucasb: has joined #ruby
[13:09:09] al2o3-cr: &ri Enumerable#to_h TheBrayn
[13:09:10] rubydoc: TheBrayn: https://ruby-doc.org/core-2.6/Enumerable.html#method-i-to_h
[13:11:02] nertzy: has joined #ruby
[13:22:14] Guest86938: has joined #ruby
[13:22:15] RedNifre: has joined #ruby
[13:24:27] TheBrayn: is that new in 2.6?
[13:27:10] al2o3-cr: TheBrayn: yes.
[13:27:33] TheBrayn: ok, I still have 2.5
[13:27:46] TheBrayn: but nice to know nonetheless
[13:28:34] RedNifre: has joined #ruby
[13:28:55] ua: has joined #ruby
[13:30:23] conta1: has joined #ruby
[13:31:36] michael_mbp: has joined #ruby
[13:33:27] creat: has joined #ruby
[13:43:13] bmurt: has joined #ruby
[13:48:36] vondruch: has joined #ruby
[14:00:27] Swyper: has joined #ruby
[14:03:10] Swyper: https://dpaste.de/TULJ
[14:03:58] Swyper: so I could do something like args.each { bloc } and that should give me what I want?
[14:04:16] Swyper: what I want is to pass this test cases >_>
[14:04:39] ramfjord: has joined #ruby
[14:06:06] phaul: yield_with_args checks if it yields the args in one go. 3 args one time, not 1 arg 3 times
[14:09:01] phaul: the only thing that's suspect to me with the implementation on the paste is the double *args, one shadowing the other
[14:09:39] phaul: well, scratch that, there are other issues
[14:12:06] Swyper: if block_given?
[14:12:06] Swyper: yield_with_args
[14:12:13] Swyper: this also does not work :p
[14:12:21] 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
[14:13:51] phaul: def eval_block(*args, &block) ; ... implementation body comes here .. ; end
[14:14:16] phaul: there is no def eval_block(...) do
[14:17:38] Swyper: NameError: undefined local variable or method `args' for main:Object
[14:18:36] Swyper: https://dpaste.de/S4fx
[14:19:25] phaul: the def keyword is still missing
[14:22:15] polishdub: has joined #ruby
[14:22:22] Swyper: 1) #eval_block when a block is given passes the arguments into the block Failure/Error: expect do |block|
[14:22:22] Swyper: expected given block to yield with arguments, but did not yield
[14:22:48] Swyper: https://dpaste.de/0YSv
[14:23:02] Swyper: also sorry for being so useless and nooby with this one, I'm not that good with blocs
[14:23:18] al2o3-cr: Swyper: change yield_with_args to block.call(*args)
[14:23:29] phaul: Swyper: don't worry we all started somewhere
[14:23:39] al2o3-cr: or bloc in your case.
[14:25:33] Swyper: https://dpaste.de/h7Wj
[14:25:46] eb0t: has joined #ruby
[14:25:51] Swyper: expected: [1, 2, 3]
[14:25:52] Swyper: got: [[1, 2, 3]]
[14:26:03] al2o3-cr: Swyper: bloc.call(*args) not bloc.call(args)
[14:26:42] al2o3-cr: otherwise you're passing an array
[14:29:00] Swyper: that worked thank you :P
[14:30:55] al2o3-cr: Swyper: what is this for?
[14:32:21] 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
[14:32:25] phaul: reads nicer
[14:33:18] Swyper: al2o3-cr: App Academy released their online curriculum for free their a top bootcamp so I'm following it
[14:33:51] 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
[14:35:07] al2o3-cr: Swyper: go for it then and good luck ;)
[14:36:31] Swyper: thank you
[14:39:00] Rapture: has joined #ruby
[14:42:47] nowhere_man: has joined #ruby
[14:44:34] regedit: has joined #ruby
[14:46:49] Swyper: https://dpaste.de/eRaR
[14:47:25] Swyper: NoMethodError:
[14:47:25] Swyper: private method `select' called for 10:Integer
[14:48:01] Swyper: I don't get this one
[14:48:33] Swyper: 1..num.select {|number| is_factor(number,num) == true}
[14:48:39] Swyper: maybe that will fix it
[14:48:59] al2o3-cr: Swyper: no.
[14:49:05] Inline: has joined #ruby
[14:49:46] al2o3-cr: you're calling Kernel#select wrap 1..num in parantheses
[14:50:54] Swyper: wow, I always forget that
[14:50:55] Swyper: thank you
[14:53:03] 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.
[14:53:32] Swyper: for sure where I was getting stuck is the error dosent really say that this is the issue
[14:53:45] Swyper: maybe I should recheck the syntax of wherever the error is so I can identify it myself
[14:55:21] hutch: has joined #ruby
[14:56:17] al2o3-cr: yeah, generally NoMethodError indicates obj foo doesn't respond to method bar.
[14:57:24] al2o3-cr: you're getting that error because Kernel is included in Object.
[15:02:00] kapil____: has joined #ruby
[15:02:56] dbugger_: has joined #ruby
[15:09:09] mspo: -> { [1,2,3] }[].select { |x| x > 2 }
[15:12:33] arcaos: has joined #ruby
[15:15:58] dinfuehr: has joined #ruby
[15:24:54] dinfuehr: has joined #ruby
[15:25:47] uplime: has joined #ruby
[15:26:20] Swyper: has joined #ruby
[15:27:18] Swyper: https://dpaste.de/r9A4
[15:28:16] sanscoeur: has joined #ruby
[15:28:24] 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?
[15:29:05] sanscoeur: has joined #ruby
[15:29:12] phaul: you have the full array interface at your displosal. #length, #[]
[15:29:21] GodFather: has joined #ruby
[15:29:46] phaul: in an instance method length will just give you the length. self[3] will give you the elem under index 3
[15:29:55] sanscoeur: has joined #ruby
[15:30:19] phaul: but you can be explicit and also say self.length
[15:30:24] TheBloke: has joined #ruby
[15:30:25] 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
[15:31:34] sanscoeur: has joined #ruby
[15:31:49] phaul: methods without explicit receiver are always sent to self. you can ommit self, but writing self.method also works
[15:32:41] 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.
[15:33:05] sanscoeur: has joined #ruby
[15:35:44] dinfuehr: has joined #ruby
[15:37:05] chouhoulis: has joined #ruby
[15:39:11] dinfuehr_: has joined #ruby
[15:39:45] sanscoeur: has joined #ruby
[15:39:57] scrptktty: has joined #ruby
[15:44:00] dinfuehr: has joined #ruby
[15:47:44] d10n-work: has joined #ruby
[15:51:47] 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.
[15:52:54] GodFather: has joined #ruby
[16:02:59] r29v: has joined #ruby
[16:08:21] nowhere_man: has joined #ruby
[16:09:47] cthulchu_: has joined #ruby
[16:10:03] dinfuehr: has joined #ruby
[16:11:05] GodFather: has joined #ruby
[16:13:51] Inline: has joined #ruby
[16:18:09] Inline: has joined #ruby
[16:18:18] dinfuehr: has joined #ruby
[16:19:13] davidw: has joined #ruby
[16:25:21] cthulchu_: has joined #ruby
[16:27:06] dinfuehr: has joined #ruby
[16:27:49] Aqo: has joined #ruby
[16:28:44] unreal: has joined #ruby
[16:28:46] ams__: has joined #ruby
[16:34:37] dinfuehr: has joined #ruby
[16:42:27] dinfuehr: has joined #ruby
[16:43:33] zapata: has joined #ruby
[16:44:20] GodFather: has joined #ruby
[16:45:46] \void: has joined #ruby
[16:47:18] tdy: has joined #ruby
[16:50:24] catbusters: has joined #ruby
[16:50:58] duderonomy: has joined #ruby
[16:50:58] hiroaki: has joined #ruby
[17:00:54] hutch: has joined #ruby
[17:01:55] dinfuehr_: has joined #ruby
[17:02:16] duderono_: has joined #ruby
[17:06:29] uplime: has joined #ruby
[17:19:15] r29v: has joined #ruby
[17:20:06] tdy: has joined #ruby
[17:29:56] za1b1tsu: has joined #ruby
[17:30:57] Swyper: has joined #ruby
[17:32:48] za1b1tsu: Stupid question, why do I add my gems dependencies in gemspec? Why not directly into the gemfile? What is the difference?
[17:34:04] za1b1tsu: Or better yet, what is the logic?
[17:34:10] za1b1tsu: I think that is my actual question
[17:41:57] orbyt_: has joined #ruby
[17:46:40] Swyper: has joined #ruby
[17:46:43] canton7: za1b1tsu, it's about apps vs gems, see some of the articles here: https://www.google.com/search?q=gemfile+gemspec
[17:48:00] 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
[17:56:03] maryo: has joined #ruby
[18:02:48] Swyper: has joined #ruby
[18:06:42] dinfuehr: has joined #ruby
[18:11:21] clemens3: has joined #ruby
[18:18:34] sanscoeur: has joined #ruby
[18:20:41] dinfuehr: has joined #ruby
[18:25:43] dinfuehr: has joined #ruby
[18:27:55] sanscoeur: has joined #ruby
[18:28:33] marmotini_: has joined #ruby
[18:30:03] 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.
[18:30:56] havenwood: za1b1tsu: https://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
[18:33:09] dinfuehr: has joined #ruby
[18:40:35] dinfuehr: has joined #ruby
[18:42:51] GodFather: has joined #ruby
[18:43:35] tdy: has joined #ruby
[18:46:34] tdy: has joined #ruby
[18:48:10] dellavg_: has joined #ruby
[18:51:34] grvgr: has joined #ruby
[18:54:43] sanscoeur: has joined #ruby
[18:55:13] snickers: has joined #ruby
[18:57:22] ramfjord: has joined #ruby
[18:57:31] conta1: has joined #ruby
[19:01:27] sameerynho: has joined #ruby
[19:04:00] FastJack: has joined #ruby
[19:04:42] lxsameer: has joined #ruby
[19:11:23] za1b1tsu: has joined #ruby
[19:15:18] GodFather: has joined #ruby
[19:19:40] mzo: has joined #ruby
[19:29:03] gix: has joined #ruby
[19:29:20] maufart__: has joined #ruby
[19:37:07] tdy: has joined #ruby
[19:39:45] themsay: has joined #ruby
[19:41:56] GodFather: has joined #ruby
[19:50:25] krawchyk: has joined #ruby
[19:51:10] za1b1tsu: ok, now I understand
[19:51:20] za1b1tsu: but what is exactly the difference between a gem and an app?
[20:01:33] tdy: has joined #ruby
[20:02:54] al2o3-cr: does IO.copy_stream use sendfile(2) copy_file_range(2) or splice(2)
[20:04:20] krawchyk_: has joined #ruby
[20:31:56] al2o3-cr: aha, ifdefs on copy_file_range and sendfile.
[20:38:24] RedNifre: has joined #ruby
[21:11:03] zenogais: has joined #ruby
[21:15:37] crankharder: has joined #ruby
[21:19:35] mikecmpbll: has joined #ruby
[21:25:35] GodFather: has joined #ruby
[21:26:26] RedNifre: has joined #ruby
[21:27:07] orbyt_: has joined #ruby
[21:48:56] SeepingN: has joined #ruby
[21:50:35] JasonO: has joined #ruby
[21:50:54] hiroaki: has joined #ruby
[21:50:55] RedNifre: has joined #ruby
[22:02:02] krawchyk: has joined #ruby
[22:22:13] rkoller: has joined #ruby
[22:26:18] s3nd1v0g1us: has joined #ruby
[22:32:16] omix: has joined #ruby
[22:37:18] szulak_: has joined #ruby
[22:51:28] tdy: has joined #ruby
[22:56:02] bvdw: has joined #ruby
[22:57:36] brandonkal: has joined #ruby
[23:00:42] tiff: has joined #ruby
[23:02:44] RougeR: has joined #ruby
[23:03:04] RougeR: hey, does anyone know how too create a time object that is HH:MM:SS but like a timer
[23:03:13] RougeR: and be able to use it too increment the time
[23:03:46] RougeR: i.e starts at 00:00:00 > 00:00:30 > 00:01:00
[23:03:55] RougeR: for 30 sec increments
[23:05:42] Nicmavr: has joined #ruby
[23:06:01] uplime: i used eventmachine for all of my timers, not sure if theres a different way
[23:07:19] RougeR: its just for writing time to a file
[23:07:31] RougeR: trying to optimize by not converting to a new time object every loop
[23:07:39] RougeR: worst case ill just do that
[23:07:55] RougeR: current uses
[23:07:56] RougeR: Time.at(clipstart).gmtime.strftime('%H:%M:%S.%L')
[23:08:36] uplime: https://github.com/socketry/timers looks promising
[23:09:31] RougeR: ive had an idea
[23:09:31] RougeR: ill look at that too uplime
[23:09:57] snuz: has joined #ruby
[23:10:15] RougeR: has joined #ruby
[23:10:22] RougeR: sorry disconned
[23:10:22] uplime: well, if anyone happens to have a better solution i'd still love to hear it
[23:10:25] uplime: oh good you're back
[23:10:36] RougeR: unfortunately uplime i dont want to add a new gem just for this one line
[23:10:39] RougeR: ive had an idea
[23:10:57] RougeR: all i need is a counter. and ruby bases all time objects off of unix time
[23:11:06] RougeR: i could just use a normal time object
[23:11:12] RougeR: then use strftime to format it
[23:11:21] RougeR: and not care what the actual object says
[23:11:30] RougeR: bit hacky
[23:11:32] RougeR: but itll work
[23:11:49] RougeR: i dont think ill ever need longer than 24 hours...
[23:12:12] RougeR: its a fun issue im working on in ruby
[23:12:24] RougeR: https://support.jwplayer.com/articles/how-to-add-preview-thumbnails
[23:13:03] RougeR: basically this from scratch using ffmpeg commands to generate the thumbnail grid
[23:13:24] RougeR: dynamically resizes in ruby, then generate vtt in ruby
[23:16:46] RougeR: might be a hacky approach
[23:21:25] RougeR: uplime, well it works...
[23:21:29] RougeR: up to 24:00:00.000
[23:21:42] RougeR: time = Time.now(0)
[23:21:49] RougeR: time += 30
[23:22:10] RougeR: string_to_write = time.gmtime.strftime('%H:%M:%S.%L')
[23:40:24] hutch: has joined #ruby
[23:40:25] SeepingN: has joined #ruby
[23:54:21] SeepingN: has joined #ruby