« Back to channel list

#ruby - 28 June 2018

« Back 1 day Forward 1 day »
[00:03:10] ramfjord: has joined #ruby
[00:05:03] zenspider: this is (on of many reasons) why rvm is a problem
[00:08:50] ramfjord: has joined #ruby
[00:11:26] maiz: has joined #ruby
[00:14:21] jhack: has joined #ruby
[00:18:26] workmad3: has joined #ruby
[00:21:37] FernandoBasso: Does numbers.reduce 0, &:+ turn + into a proc?
[00:21:53] havenwood: FernandoBasso: yes, then passes it as a block
[00:22:00] havenwood: FernandoBasso: :+.to_proc
[00:22:21] FernandoBasso: So, every method that takes a block causes that block to be automatically converted to a block?
[00:23:01] havenwood: FernandoBasso: I don't understand, can you rephrase?
[00:24:13] FernandoBasso: I meant to say that (I think) that every method that takes a block, actually converts the block to a proc and _then_ execute it. Is that right?
[00:24:34] FernandoBasso: Like, methods take blocks, but runs procs.
[00:24:44] havenwood: FernandoBasso: No, it doesn't actually reify the block into a proc if you `yield`.
[00:25:04] havenwood: FernandoBasso: That's why it's slower to pass an explicit `&block` then `block.call`.
[00:25:41] havenwood: FernandoBasso: There have been recent performance improvements in 2.5 around passing `&block` through and more coming in 2.6.
[00:26:01] FernandoBasso: Right. Interesting. Thanks havenwood.
[00:26:12] havenwood: FernandoBasso: np
[00:27:29] hlmjr: has joined #ruby
[00:34:15] cagomez: has joined #ruby
[00:34:15] zenspider: ok. I'm stumped. Need a different brain to sanity check.
[00:35:03] havenwood: i have a protobrain, if that'll do
[00:35:08] zenspider: I have a gem, ruby_parser, that is passing tests locally just fine.
[00:35:10] zenspider: On my server, in my normal checkout, it is ALSO passing tests just fine
[00:35:24] zenspider: BUT... on my server, in the CI setup, it is failing 20 tests
[00:35:40] zenspider: yet, between the two, `gem env | md5` is the same
[00:36:03] zenspider: as is `find lib -type f | xargs cat | md5`
[00:36:56] havenwood: a collision seems beyond far fetched, but sanity check `gem env | shasum` maybe?
[00:37:19] havenwood: yeah, that can't be it
[00:37:37] carnegie: has joined #ruby
[00:38:37] zenspider: I'm at a complete loss at this point. I have nuked all build files and started from scratch
[00:38:53] zenspider: I have rbenv with a .ruby-version file in my home directory
[00:38:57] zenspider: they both pick this up
[00:39:21] havenwood: resulting in the same fuzzy matched Ruby on both systems?
[00:39:55] zenspider: yup. `rbenv version` says they're the same for the same reasons
[00:40:07] zenspider: they have the same gems available
[00:40:16] zenspider: everything SHOULD be the same... except `pwd`
[00:40:25] havenwood: maybe `gem pristine --all`?
[00:41:24] zenspider: should affect both if it affects one
[00:41:33] mupt: has joined #ruby
[00:41:41] havenwood: any pattern associating the 20 failing tests?
[00:41:54] havenwood: env var or something?
[00:42:47] havenwood: `printenv` the same on both?
[00:42:54] zenspider: they're all ruby 1.8 tests (which is to say they're using the 1.8 parser)
[00:44:23] zenspider: `env | sort > /tmp/[ab]` differ only in pwd and ssh_tty
[00:47:31] pastorinni: has joined #ruby
[00:47:56] zenspider: I'm so completely stumped by this. there must be some stupid voodoo thing making my normal checkout work right
[00:52:31] orbyt_: has joined #ruby
[00:52:54] mynameisdebian: has joined #ruby
[00:55:34] planigan: has joined #ruby
[00:56:25] anjen: has joined #ruby
[00:59:21] jhack: has joined #ruby
[01:07:32] jenrzzz: has joined #ruby
[01:09:09] Venomen: has joined #ruby
[01:09:20] cadillac_: has joined #ruby
[01:16:02] caleBOT: has joined #ruby
[01:16:03] caleBOT_: has joined #ruby
[01:16:35] gizmore: has joined #ruby
[01:22:31] tolerablyjake: has joined #ruby
[01:22:33] carnegie: has joined #ruby
[01:22:55] caleBOT: has left #ruby: ()
[01:29:22] jenrzzz: has joined #ruby
[01:29:22] jenrzzz: has joined #ruby
[01:34:46] rshetty: has joined #ruby
[01:37:45] jottr: has joined #ruby
[01:39:07] BloopMonster: has joined #ruby
[01:45:50] k0mpa: has joined #ruby
[01:47:15] ogres: has joined #ruby
[01:49:12] carnegie: has joined #ruby
[01:52:02] carnegie: has joined #ruby
[01:58:38] duckpuppy: has joined #ruby
[02:01:29] claw: has joined #ruby
[02:04:42] cagomez: has joined #ruby
[02:06:22] redlegion: has joined #ruby
[02:13:29] carnegie: has joined #ruby
[02:18:40] workmad3: has joined #ruby
[02:23:43] roamingdog: has joined #ruby
[02:43:16] gix: has joined #ruby
[02:46:58] rshetty: has joined #ruby
[02:50:08] JamJam_kid: has joined #ruby
[02:56:22] taylorzr: has joined #ruby
[03:00:15] cadillac_: has joined #ruby
[03:03:48] V1s1ble: has joined #ruby
[03:07:05] rshetty: has joined #ruby
[03:09:37] braincrash: has joined #ruby
[03:12:01] bambanx: has joined #ruby
[03:12:03] bambanx_: has joined #ruby
[03:13:35] taylorzr: has joined #ruby
[03:17:49] arkaros: has joined #ruby
[03:21:38] amar: has joined #ruby
[03:25:33] JamJam_kid: has joined #ruby
[03:25:50] tolerablyjake: has joined #ruby
[03:35:06] lubekpl: has joined #ruby
[03:38:37] jottr: has joined #ruby
[03:39:01] cagomez: has joined #ruby
[03:52:01] r29v: has joined #ruby
[03:52:53] carnegie: has joined #ruby
[03:55:02] konsolebox: has joined #ruby
[03:55:43] carnegie: has joined #ruby
[03:59:22] carnegie: has joined #ruby
[04:00:37] redlegion: has joined #ruby
[04:02:23] hays: has joined #ruby
[04:02:23] hays: has joined #ruby
[04:05:54] komonsterko: has joined #ruby
[04:12:57] rshetty: has joined #ruby
[04:13:07] rshetty: has joined #ruby
[04:18:49] workmad3: has joined #ruby
[04:23:01] rshetty: has joined #ruby
[04:24:06] rshetty: has joined #ruby
[04:25:36] darkhanb: has joined #ruby
[04:26:12] tdy: has joined #ruby
[04:26:13] RougeR: ive got a programming tech test
[04:26:20] RougeR: to implement comparisons of poker hands
[04:26:48] RougeR: im doing it in ruby, ive expanded on it and am making a full poker game with bets and persistent db and unit tests
[04:26:58] RougeR: curious what things i should try to look out for
[04:27:03] RougeR: best practice etc
[04:27:15] RougeR: im thinking of using <=> for comparison of different cards/hands
[04:28:11] havenwood: RougeR: that makes sense
[04:29:42] havenwood: RougeR: Can you share the code, or are you still at a point in the tech test that you can't get specific input?
[04:29:47] rshetty: has joined #ruby
[04:30:27] _rshetty_: has joined #ruby
[04:31:26] havenwood: RougeR: tests sound great. i'm curious what you're thinking for db? are you doing multi-tenancy where you can have lots of games and hands at once at different places? i18n? jk
[04:31:27] havenwood: RougeR: that sounds fun
[04:31:52] havenwood: RougeR: I'd be happy to review your code once that's allowed.
[04:32:10] RougeR: havenwood: im getting into it now
[04:32:21] RougeR: ive done the first bit im doing
[04:32:33] RougeR: ive created a deck and dealer class that fully function
[04:32:50] RougeR: using structs player and table
[04:33:08] RougeR: it is fun yeah
[04:33:18] RougeR: havenwood: i thought about multi tenancy
[04:33:39] havenwood: RougeR: What version of Ruby? Keyword structs would be neat.
[04:33:56] havenwood: Coupling by name tends to be better than coupling by position.
[04:33:59] RougeR: i think i might just try to persist the players total chips
[04:34:07] RougeR: and wins/losses/draws of hands and games
[04:34:27] RougeR: havenwood: i tried the keyword struct thing
[04:34:28] RougeR: didnt work
[04:34:33] RougeR: im just using regular structs atm
[04:34:53] havenwood: RougeR: If you're on Ruby 2.5 it should work!
[04:35:07] havenwood: RougeR: https://gist.github.com/havenwood/a9260df1c550a3da5e2905ea68340944
[04:37:12] RougeR: ah imm on 2.4.1
[04:37:16] RougeR: thatll be why
[04:37:30] RougeR: maybe ill change version with RVM and do it in a bit
[04:45:17] hays: has joined #ruby
[04:45:18] hays: has joined #ruby
[04:45:33] Venomen: has joined #ruby
[04:45:58] orbyt_: has joined #ruby
[04:53:53] ramfjord: has joined #ruby
[04:54:38] taylorzr: has joined #ruby
[04:58:59] BloopMonster: has joined #ruby
[05:06:13] Venomen: has joined #ruby
[05:10:27] sauvin: has joined #ruby
[05:18:51] arkaros: has joined #ruby
[05:22:10] amar_: has joined #ruby
[05:23:18] anisha_: has joined #ruby
[05:24:10] ciscam: has joined #ruby
[05:39:29] jottr: has joined #ruby
[05:43:37] segy: has joined #ruby
[05:53:01] hays: has joined #ruby
[05:53:50] phate408: has joined #ruby
[05:57:24] bambanx_: has joined #ruby
[06:00:43] aupadhye: has joined #ruby
[06:00:44] dionysus69: has joined #ruby
[06:08:02] planigan: has joined #ruby
[06:08:09] biberu: has joined #ruby
[06:08:56] suukim: has joined #ruby
[06:10:49] Venomen: has joined #ruby
[06:10:49] Venomen: has joined #ruby
[06:14:27] planigan: has joined #ruby
[06:16:58] arkaros: has joined #ruby
[06:19:01] workmad3: has joined #ruby
[06:29:23] biberu: has joined #ruby
[06:30:21] arkaros: has left #ruby: ()
[06:31:10] venmx: has joined #ruby
[06:34:28] dr3wo: has joined #ruby
[06:38:10] andikr: has joined #ruby
[06:40:01] apeiros: has joined #ruby
[06:41:36] velu_aon[m]: has joined #ruby
[06:41:50] yxhuvud: has joined #ruby
[06:41:53] iceskins[m]: has joined #ruby
[06:43:05] haylon_: has joined #ruby
[06:43:06] bastilian: has joined #ruby
[06:43:47] amar_: has joined #ruby
[06:44:33] jonjits[m]: has joined #ruby
[06:44:51] KevinMGranger: has joined #ruby
[06:45:59] luna_x[m]: has joined #ruby
[06:46:14] vonfry: has joined #ruby
[06:51:45] aufi: has joined #ruby
[06:53:46] roamingdog: has joined #ruby
[06:54:32] roamingdog: has joined #ruby
[06:55:22] roamingdog: has joined #ruby
[06:56:07] roamingdog: has joined #ruby
[06:56:15] amar_: has joined #ruby
[06:58:22] apeiros_: has joined #ruby
[06:58:32] schleppel: has joined #ruby
[06:58:35] DTZUZO: has joined #ruby
[07:00:47] apeiros_: has joined #ruby
[07:01:16] psychicist__: has joined #ruby
[07:05:50] dionysus69: has joined #ruby
[07:05:56] clemens3_: has joined #ruby
[07:09:01] arkaros: has joined #ruby
[07:11:43] apeiros_: has joined #ruby
[07:15:53] kent\n: has joined #ruby
[07:18:23] claudiuinberlin: has joined #ruby
[07:21:23] ramfjord: has joined #ruby
[07:22:17] TomyWork: has joined #ruby
[07:24:32] sysvalve: has joined #ruby
[07:24:58] arkaros: has joined #ruby
[07:32:10] saTchymoto: has joined #ruby
[07:34:20] clemens3_: has joined #ruby
[07:40:23] jottr: has joined #ruby
[07:42:23] arkaros: has left #ruby: ()
[07:46:20] Emmanuel_Chanel: has joined #ruby
[07:47:47] Sylario: has joined #ruby
[07:50:19] rshetty: has joined #ruby
[07:52:00] yohji: has joined #ruby
[08:00:03] burgestrand: has joined #ruby
[08:00:53] hurricanehrndz: has joined #ruby
[08:03:16] moei: has joined #ruby
[08:04:49] nowhere_man: has joined #ruby
[08:07:21] p4p0l0: has joined #ruby
[08:07:54] BloopMonster: has joined #ruby
[08:08:18] konsolebox: has joined #ruby
[08:10:39] discopatrick: has joined #ruby
[08:11:14] dr3wo: has joined #ruby
[08:12:52] umesh: has joined #ruby
[08:17:37] burgestrand: has joined #ruby
[08:18:23] amar_: has joined #ruby
[08:19:20] workmad3: has joined #ruby
[08:23:18] guille-moe: has joined #ruby
[08:25:02] _yohji_: has joined #ruby
[08:26:58] nowhere_man: has joined #ruby
[08:31:15] wolfshappen: has joined #ruby
[08:33:07] bijan_: has joined #ruby
[08:36:35] ellcs: has joined #ruby
[08:40:24] rshetty: has joined #ruby
[08:41:13] rshetty: has joined #ruby
[08:41:17] workmad3: has joined #ruby
[08:44:06] wnd-trans: has joined #ruby
[08:48:12] cschneid: has joined #ruby
[08:55:40] jottr: has joined #ruby
[09:00:07] Beams: has joined #ruby
[09:01:26] venomenalny: has joined #ruby
[09:05:01] bijan_: has joined #ruby
[09:05:52] Venomen_: has joined #ruby
[09:06:07] Venomen: has joined #ruby
[09:06:08] Venomen: has joined #ruby
[09:09:21] bijan__: has joined #ruby
[09:10:10] umesh: Can you recommend any book for learning on using API calls programmaticly
[09:11:50] ciscam: has joined #ruby
[09:12:37] ellcs: has joined #ruby
[09:13:20] Bish: has joined #ruby
[09:14:31] quobo: has joined #ruby
[09:18:36] Kris_: has joined #ruby
[09:21:26] ramfjord: has joined #ruby
[09:21:57] FernandoBasso: has joined #ruby
[09:23:32] bijan_: has joined #ruby
[09:26:07] wolfshappen: has joined #ruby
[09:30:25] vondruch: has joined #ruby
[09:30:41] mikkel-: has joined #ruby
[09:32:30] karapetyan: has joined #ruby
[09:32:30] vondruch: has joined #ruby
[09:34:10] dr3wo: has joined #ruby
[09:38:39] Alina-malina: has joined #ruby
[09:41:51] amar_: has joined #ruby
[09:47:49] konsolebox: has joined #ruby
[09:49:08] leitz: has joined #ruby
[09:51:51] Alina-malina: has joined #ruby
[09:56:22] apeiros: has joined #ruby
[09:57:26] desperek: has joined #ruby
[09:57:46] jottr: has joined #ruby
[09:59:59] Venomen: has joined #ruby
[10:03:04] apparition47: has joined #ruby
[10:09:38] roamingdog: has joined #ruby
[10:20:31] workmad3: has joined #ruby
[10:21:57] bijan_: has joined #ruby
[10:23:00] hfp_work: has joined #ruby
[10:29:03] Alina-malina: has joined #ruby
[10:29:46] maiz: has joined #ruby
[10:33:11] vonfry: has joined #ruby
[10:47:54] Fernando-Basso_: has joined #ruby
[10:51:13] nowhere_man: has joined #ruby
[10:51:35] deathwishdave: has joined #ruby
[10:52:09] Fizzik: has joined #ruby
[10:55:24] jrafanie: has joined #ruby
[11:01:27] ellcs1: has joined #ruby
[11:04:01] cschneid: has joined #ruby
[11:04:14] dr3wo: has joined #ruby
[11:09:01] rkoller: has joined #ruby
[11:09:12] kris: has joined #ruby
[11:13:02] Beams_: has joined #ruby
[11:14:58] BloopMonster: has joined #ruby
[11:17:38] jottr: has joined #ruby
[11:21:27] ramfjord: has joined #ruby
[11:21:57] cyberg: has joined #ruby
[11:27:36] arooni: has joined #ruby
[11:28:15] burgestrand: has joined #ruby
[11:29:30] ldnunes: has joined #ruby
[11:40:48] nowhere_man: has joined #ruby
[11:41:07] elomatreb: has joined #ruby
[11:50:21] rshetty: has joined #ruby
[11:52:29] RougeR: has joined #ruby
[11:56:50] conta: has joined #ruby
[11:58:06] synthroid: has joined #ruby
[12:04:15] deathwishdave: has joined #ruby
[12:10:28] ciscam: has joined #ruby
[12:15:19] vonfry: has joined #ruby
[12:15:32] vonfry: can gem do some other script before build a ext package when install a package
[12:15:55] vonfry: I try to install nokogumboc, but gem cannot link it on Gentoo
[12:16:22] vonfry: By portage, it uses sed to change some makefile and config file
[12:24:44] psychicist__: has joined #ruby
[12:26:55] claudiuinberlin: has joined #ruby
[12:27:49] ellcs1: has joined #ruby
[12:36:53] maiz: has joined #ruby
[12:36:57] tuxillo: has joined #ruby
[12:37:57] jottr: has joined #ruby
[12:38:17] tuxillo: for add_runtime_dependency the array specified as for the valid versions, how is it processed?
[12:38:51] tuxillo: [">= 0.6", "~> 0.6"]
[12:39:02] deathwishdave: has joined #ruby
[12:40:58] konsolebox: has joined #ruby
[12:45:02] LightStalker: has joined #ruby
[12:45:02] noobineer: has joined #ruby
[12:48:03] AJA4350: has joined #ruby
[12:49:05] burgestrand: has joined #ruby
[12:54:21] psynor: has joined #ruby
[12:54:52] Venomen: has left #ruby: ("Leaving...")
[12:54:57] psynor: dumb question, but im trying to replace a literal \" in a string with gsub. what is the proper syntax for this?
[12:55:06] Venomen: has joined #ruby
[12:55:12] psynor: i want to replace \" with "
[12:55:33] elomatreb: You can probably just use single quotes
[12:56:16] psynor: so something like gsub!('\"','"') ?
[12:56:45] ruby[bot]: elomatreb: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[12:56:59] psynor: ill try it
[12:58:02] psynor: hmmmm. i dont think it worked, but i would have to do some more debugging to be certain. any other ideas to try before doing that?
[12:58:59] ruby[bot]: elomatreb: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[12:59:22] elomatreb: `"\\\""` would be the fully escaped double-quote version
[12:59:33] psynor: ok let me try that
[12:59:36] konsolebox: >> str = '\"'; str.gsub(/\\"/, '"'); puts str
[12:59:42] ruby[bot]: konsolebox: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[13:00:15] elomatreb: gsub does not mutate, it returns a copy with the change applied (and the bot is broken again)
[13:01:18] konsolebox: elomatreb: yeah, i didn't test it with puts
[13:01:27] konsolebox: >> str = '\"'; str.gsub(/\\"/, '"')
[13:01:28] ruby[bot]: konsolebox: # => "\"" (https://eval.in/1029701)
[13:02:25] konsolebox: >> str = '\"'; puts str.gsub(/\\"/, '"')
[13:02:26] ruby[bot]: konsolebox: # => " ...check link for more (https://eval.in/1029702)
[13:05:07] LightStalker: has joined #ruby
[13:06:36] InfinityFye: has joined #ruby
[13:07:05] yohji: has joined #ruby
[13:08:42] bijan_: has joined #ruby
[13:08:53] clemens3_: has joined #ruby
[13:09:30] cadillac_: has joined #ruby
[13:10:30] jottr: has joined #ruby
[13:10:34] psynor: looks like its working, thanks
[13:13:58] duckpuppy: has joined #ruby
[13:14:00] ogres: has joined #ruby
[13:15:02] eb0t: has joined #ruby
[13:18:01] ponzii: has joined #ruby
[13:19:51] ponzii: How can import a bunch of functions from a module without classes being involved? All the references I've read assume you're using the module as a mixin for a class but I'm looking for something similar to Python's import.
[13:20:59] mupt: has joined #ruby
[13:21:35] ramfjord: has joined #ruby
[13:22:40] konsolebox: ponzii: methods don't exist without a class. you can't
[13:23:27] ponzii: konsolebox: In a basic Ruby script I use functions without classes all the time.
[13:23:51] konsolebox: >> def a; end; method(:a).owner # ponzii
[13:23:57] ruby[bot]: konsolebox: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[13:24:09] konsolebox: anyway, output is => Object
[13:24:38] ponzii: konsolebox: I'm not disputing the namespace thing, more the usage.
[13:25:32] ponzii: konsolebox: Yes, a def is an object but I want to know if I can put a bunch of defs in a module and import them a la Python?
[13:25:55] ponzii: konsolebox: A def is also an object in Python so what's the problem?
[13:26:49] konsolebox: ponzii: i think it's theoretically possible to "copy" methods though. not sure if Ruby has a feature for that. but i never heard of anything like it. i only heard stuff like prepending, etc. there's all that something i forgot. i'm looking for it.
[13:27:45] ponzii: konsolebox: It's confusing because module != class but seems to behave like a class.
[13:29:24] bmurt: has joined #ruby
[13:33:08] konsolebox: ponzii: the thing i was looking for was refinements, but it has got nothing to do with copying methods
[13:33:31] konsolebox: ponzii: a class is a module that instantiates and is not allowed to be included like a module. that's basically what it is
[13:33:35] karapetyan: has joined #ruby
[13:33:45] konsolebox: ponzii: it can only be inherited
[13:34:00] rshetty: has joined #ruby
[13:34:01] ponzii: konsolebox: But I'm not referring to classes. Quite the opposite.
[13:34:40] ponzii: konsolebox: As with Python I want to define a function/def in a module and just "import" it.
[13:34:41] konsolebox: ponzii: yeah, modules are basically more basic forms
[13:35:25] amar_: has joined #ruby
[13:35:45] ponzii: konsolebox: Sometimes code just doesn't need classes but Ruby doesn't seem to get this even though it's advertised as a multi-paradigm language.
[13:35:46] konsolebox: ponzii: i guess you'll have to wait for someone who knows or could compare with python. i don't code python much, but i'm guessing that unlike Ruby, python can have methods that aren't attributed to any class or module.
[13:36:29] konsolebox: ponzii: well the thing is Ruby wants to be full-blown OOP, that is why everything is class-oriented, including methods
[13:37:31] ponzii: konsolebox: Object-oriented isn't the same a class-oriented. That's how Python differs from Java.
[13:38:30] konsolebox: ponzii: i'm not really serious at describing it as class-oriented. i just thought about describing it that way based on the context of our discussion.
[13:39:09] ponzii: konsolebox: I suspect what I'm after is doable in Ruby just that it isn't discussed much.
[13:40:07] konsolebox: ponzii: maybe, but people really just use modules
[13:40:50] venomenalny: has joined #ruby
[13:42:29] cdunklau: konsolebox: you know java though right?
[13:42:31] cdunklau: at least ish?
[13:43:01] jottr: has joined #ruby
[13:43:05] konsolebox: cdunklau: i can code there at least, but i haven't focused on its package-management thing.
[13:43:13] cdunklau: ponzii seems to be looking for what in Java parlance would be a "static class"
[13:44:09] bmurt: has joined #ruby
[13:44:42] cdunklau: i don't know enough about ruby to know what modules are, but in python a module is a thing (usually a file) that you can `import`, then you get a kinda "namespace object" which contains (usually) all the names you assign to inside the file
[13:45:19] cdunklau: this typically includes constants, free functions, and classes
[13:45:32] cdunklau: that is, the names refer to those objects
[13:45:35] konsolebox: cdunklau: if a static class is a class that don't instantiate or cannot be instantiated, i'd say it's comparable to ruby's singleton classes
[13:45:39] ponzii: cdunklau: Or even more basic like PHP's include.
[13:45:49] cdunklau: konsolebox: ok
[13:46:14] konsolebox: cdunklau: ruby simply doesn't have namespaces yet. i heard it's being planned to be added, but i'm not sure if it's true or if it's even possible.
[13:46:16] cdunklau: konsolebox: so say you have a bunch of pure methods that you want to stick in a namespace that made them easy to use
[13:46:25] cdunklau: would you use a singleton class?
[13:46:37] cdunklau: ponzii: let's not go there :P
[13:46:44] cdunklau: include is an awful, awful thing
[13:46:49] duckpuppy: has joined #ruby
[13:46:56] konsolebox: cdunklau: Ruby's namespaces right now are simply the modules/classes themselves
[13:47:06] cdunklau: konsolebox: via `require` right?
[13:47:06] konsolebox: and in those you can assign singleton methods
[13:47:12] ponzii: cdunklau: :) yes, just saying I don't even need the namespace. Just the option to import.
[13:47:22] deathwishdave: has joined #ruby
[13:47:38] konsolebox: cdunklau: require only imports files. namespace structures are declared in files. you can compare it to C++
[13:47:48] olblak: has joined #ruby
[13:47:55] cdunklau: i have much to learn about ruby
[13:47:59] ponzii: cdunklau: Tried `extend self` in the module but it doesn't work.
[13:48:29] konsolebox: Ruby doesn't have Python's feature where namespaces reflect the file structures itself... that's why you already have an idea what you get when you use 'import'
[13:49:34] ponzii: konsolebox: So simply packaging a bunch of functions is off the menu in Ruby unless I'm going to use them as a mixin?
[13:49:54] ponzii: konsolebox: If so that's a pretty limited notion of a "module".
[13:49:59] cdunklau: konsolebox: ok so when you `require "math"`, assuming the math thing would be implemented in ruby... what would that file look like?
[13:50:55] cdunklau: konsolebox: such that you could then presumably use Math.asin(...)
[13:51:06] umesh: has joined #ruby
[13:51:06] konsolebox: ponzii: yep i think that's the limitation of it. a module can only be incorporated as a whole.
[13:51:08] cdunklau: i'm not expressing myself effectively :(
[13:52:56] kris: has joined #ruby
[13:54:04] konsolebox: cdunklau: a file can contain anything. its filename doesn't necessarily reflect the classes or modules that would be defined in it. OpenStruct for example is placed in 'ostruct'. now if you're asking about conventions on how filenames should be named, there really aren't any. however, there are big projects that seem to have a good convention on it.
[13:54:13] umesh: What is this, is this array .... attr_accessor :name, :info, :version, :author, :downloads
[13:54:55] cdunklau: umesh: that looks like a call to me
[13:55:26] konsolebox: umesh: that defines "accessor" methods named 'name', 'info', ...
[13:56:10] al2o3-cr: &ri Module#attr_accessor
[13:56:30] konsolebox: umesh: in a class it would be similar to defining `def name; return @name; end` and `def name=(val); @name = val; end;`
[13:57:00] al2o3-cr: no more derpy wut
[13:57:00] cdunklau: konsolebox: ok, so when you `require "somefile"`, it just dumps the names of whatever classes/modules defined therein into the require-ing file's namespace?
[13:57:57] BloopMonster: has joined #ruby
[13:57:59] Mike11: has joined #ruby
[13:58:09] ponzii: konsolebox: That's not really the problem. Example: module Mod1 contains def foo . I require_relative 'mod1' and call Mod1::foo() or Mod1.foo() but I get an error for method foo.
[13:59:41] al2o3-cr: ponzii: that sould be def self.foo ...
[13:59:47] ponzii: konsolebox: Same if I just call foo(). I can't seem to access the def in the Mod1 module at all.
[14:00:45] al2o3-cr: or use a module_function
[14:00:45] ponzii: al2o3-cr: tried that but: undefined method `foo' for main:Object (NoMethodError)
[14:01:40] ponzii: al2o3-cr: Sorry, you're correct for Mod1::foo(). That works.
[14:02:17] ponzii: al2o3-cr: But isn't there a way to call def foo without having to prepend .self and calling it with a fully-qualified namespace?
[14:02:32] ponzii: al2o3-cr: Sorry sef.
[14:02:54] ponzii: al2o3-cr: Or even self. :(
[14:04:03] al2o3-cr: https://eval.in/1029735
[14:04:06] konsolebox: cdunklau: i never really checked the behavior of 'require' when used inside a context of a class. i always use it outside. but i just tried it now and it seems like the other classes stay at the highest namespaces regardless of where they are 'required'.
[14:04:22] ponzii: al2o3-cr: I think this is where Ruby loses out to Python and may explain why Python adoption is generally much higher than for Ruby.
[14:04:38] cdunklau: konsolebox: well no i meant outside :)
[14:04:38] synthroid: has joined #ruby
[14:05:26] kris: has joined #ruby
[14:05:36] cdunklau: ponzii: i think making sweeping generalizations on little evidence is probably not a good tack to take :/
[14:06:04] cdunklau: also what is this, a contest?
[14:06:19] ponzii: cdunklau: Just saying it appears to be a lot easier to do basic procedural programming with Python than Ruby.
[14:07:03] cdunklau: sure if you know python, and don't really know ruby
[14:07:18] cdunklau: i don't see how that's even remotely surprising though
[14:07:31] ponzii: cdunklau: No, I have some Python code which I have to port to Ruby and was trying to use something similar to import.
[14:07:48] cdunklau: ponzii: it's not ruby's fault you're trying to do something silly :)
[14:08:11] ponzii: cdunklau: Silly as in what exactly?
[14:08:52] cdunklau: trying to use language A's idioms to write code using language B
[14:09:19] cdunklau: (full disclosure, i'm a giant python fan, it's my main language)
[14:09:47] jrafanie: has joined #ruby
[14:09:48] ponzii: cdunklau: Not really idiomatic to Python. Most languages have an feature similar to Python's import.
[14:10:00] al2o3-cr: ponzii: ruby doesn't ;)
[14:10:29] ponzii: al2o3-cr: I was aware that Ruby is different but had to discover the details for myself.
[14:10:55] al2o3-cr: anyway, what are you trying to port?
[14:11:19] cdunklau: ponzii: C, C++, C#, JS, PHP (?), Bash, Java (?)
[14:11:20] konsolebox: cdunklau: ok i guess what you mean. but saying that it dumps to the require-ing file's namespace is a bit misleading. it simply means that the required source is loaded. however this behavior where 'require' is called inside class, but the classes within the required file not being placed under class's namespace is rather surprising to me.
[14:11:44] cdunklau: i don't think any of those have an import-like thing
[14:12:01] ponzii: al2o3-cr: An old bespoke internal application written in Python 2 which the owner wants adpated for Rails.
[14:12:57] Emmanuel_Chanel: has joined #ruby
[14:13:33] cdunklau: i take JS back, apparently ES2015 modules are supported across a wide range of implementations by now
[14:14:46] Inline: has joined #ruby
[14:15:26] cdunklau: konsolebox: ugh i feel bad that you've put so much effort into this, and i can't really grok it
[14:16:11] cdunklau: but thanks for trying :) it'll probably click if i wind up getting interviewed for a job i applied to that probably will want me to show ruby knowledge
[14:16:14] konsolebox: cdunklau: yeah, i can't really make an accurate explanation myself since i don't really know how 'require' behaves. by my impression of it just similar to C's include.
[14:16:20] alex``: has joined #ruby
[14:16:23] rshetty: has joined #ruby
[14:16:33] cdunklau: so i'll have a good reason to dedicate serious time to dig into ruby
[14:16:49] burgestrand: Might be helpful to think of it more as 'run' rather than 'require'
[14:18:10] duckpuppy: has joined #ruby
[14:18:24] cdunklau: if you had two classes with the same name in different files, and you 'require'-ed both files, can you differentiate between them?
[14:18:30] cdunklau: or does one shadow the other
[14:19:30] cdunklau: Burgestrand: does 'require' really run it every time?
[14:19:41] al2o3-cr: cdunklau: only once
[14:19:51] al2o3-cr: load does that.
[14:19:52] burgestrand: cdunklau Ah, no, it checks $LOADED_FEATURES first, and if the file's already in that list then it won't run it
[14:20:05] cdunklau: so that's python-ish
[14:20:27] kris: has joined #ruby
[14:20:31] konsolebox: the one that loads it everytime is 'load'
[14:21:41] ccooke: ponzii: require is used only to load code from files. When you want to include the functionality of one namespace inside another, you need include, prepend and extend. Here's a link: https://medium.com/@leo_hetsch/ruby-modules-include-vs-prepend-vs-extend-f09837a5b073
[14:21:44] cdunklau: i must admit, i am quite surprised ruby doesn't have a "module" system like python or now JS or whatever
[14:21:58] ramfjord: has joined #ruby
[14:21:59] ccooke: Ruby does. It's just different.
[14:22:22] ccooke: and in particular, ruby differentiates between *loading code* and *composing functionality(
[14:22:46] aufi_: has joined #ruby
[14:22:47] cdunklau: ccooke: well wait do you mean "modules are different" or "the thing other languages call modules exists in ruby but is just different"
[14:23:14] ccooke: The core idiom is that you write a file that defines a Module (or Class), and then you reference that Module or Class inside another
[14:24:07] ccooke: cdunklau: "module" is an ambiguous term across all languages; many languages have something like what python calls a module, but nothing else has *exactly the same thing*, and many of them are not called 'module'
[14:24:24] burgestrand: Yeah sorry, everything's global, sorry
[14:25:19] maufart__: has joined #ruby
[14:25:38] burgestrand: Two different packages (gems) that you want to use, and both do `class Money` (or User, or Model, or Base)? Yup, that's a problem that we live with.
[14:25:44] cdunklau: ccooke: sure sure i get that
[14:25:51] cdunklau: i'm trying to differentiate :)
[14:26:18] cdunklau: Burgestrand: ...bleh
[14:26:29] cdunklau: that's disappointing
[14:26:34] burgestrand: cdunklau It's ugly for sure, but in practice it's usually not that big of a problem that you would think
[14:27:09] burgestrand: cdunklau Standard practice for packages is that you have one module that you nest everything under, so you'd have PackageA::Money and PackageB::Money
[14:27:24] burgestrand: cdunklau I use package here, but in Ruby world we'd call them gems
[14:28:06] burgestrand: So no "true" namespaces, we kind of fake them
[14:28:27] psynor: has left #ruby: ()
[14:28:55] cdunklau: Burgestrand: oh! so you can nest them
[14:29:02] ccooke: cdunklau: yes
[14:29:04] cdunklau: ok then yeah it's not a huge deal
[14:29:06] burgestrand: cdunklau Indeed :)
[14:29:12] ccooke: cdunklau: nested modules are a big thing in ruby
[14:29:15] konsolebox: ponzii: when it comes to procedural coding in Ruby, i'm actually not a fan of including modules myself. i prefer just calling the singleton method from where it is defined. e.g. have `Utils.my_method` than have `extend Utils ... my_method`
[14:29:41] cdunklau: so this winds up being like python, where the namespace is "flat" in the sense you can't have nested deps
[14:30:02] cdunklau: c.f. node/npm modules
[14:31:33] burgestrand: cdunklau a little bit, but an important difference is that you can't really do `rails = require "rails"` and expect that to do what it looks like
[14:32:11] cdunklau: Burgestrand: oh no i don't mean that
[14:32:21] ccooke: cdunklau: the key thing to recall is that modules are global, so if a file you require requires a module, then it's in your namespace. However, because they are generally well nested, you can access them unambiguously
[14:32:25] cdunklau: Burgestrand: node/npm has a concept of nested deps
[14:32:40] burgestrand: cdunklau Aha, I see what you mean
[14:32:48] cdunklau: Burgestrand: so a "package" can have its own deps, in conflicting versions, and it's cool because it's all segregated
[14:32:55] ccooke: but you don't have the python example of selecting only the objects that you want in your current namespace
[14:33:27] burgestrand: cdunklau ruby packages are typically flat, there's dependency resolution in a tool (bundler) that attempts to install compatible versions with same dependencies
[14:33:39] cdunklau: ccooke: ok i think i'm beginning to understand
[14:33:54] cdunklau: Burgestrand: right ok. python's like that too
[14:35:01] ccooke: cdunklau: the equivalent in Ruby is being able to compose sets of methods into a module or class, so you can select what is available from the context of that module
[14:35:13] Venomen: has joined #ruby
[14:35:33] reber: has joined #ruby
[14:36:03] ccooke: cdunklau: Oh: In Ruby, "Module" is an object that contains methods and can be included within other Modules, but cannot be instantiated into an instance. Class is a descendant of Module that *can* be instantiated into an instance object
[14:36:36] ccooke: cdunklau: So "Module" is a nice way to collect functional methods that suit a purpose. It's used for things like interfaces and common functionality.
[14:37:31] shinnya: has joined #ruby
[14:38:06] ccooke: cdunklau: A common idiom, for instance, is the Enumerable module, which provides a huge number of instance methods useful to enumerable objects - things like map, mfind, entries, count, reduce etc.
[14:38:46] ccooke: the Enumerable object can be included into any class that defines an (IIRC) each method - so you'll find it included into a number of the base classes
[14:39:30] ccooke: e.g.: Hash.ancestors => [Hash, Enumerable, Object, Kernel, BasicObject], Array.ancestors => [Array, Enumerable, Object, Kernel, BasicObject]
[14:47:15] karapetyan: has joined #ruby
[14:49:36] konsolebox: prepend is good if you want to add features to library classes or modules
[14:53:54] ccooke: and for debugging
[14:57:52] gizmore: what would be a reason to use Marshal over JSON in a session table data column?
[14:58:29] gizmore: i am thinking of using JSON because it might be faster.... maybe i should benchmark and choose the faster impl?
[14:58:41] gizmore: input is trusted, so marshal would offer better features
[15:01:36] bmurt: has joined #ruby
[15:02:30] ccooke: it depends what you're storing
[15:03:04] ccooke: if it's only hashes, arrays, strings, numbers etc - base objects that are implemented by default in json - then it makes little difference
[15:03:28] havenwood: gizmore: JSON tends to be slower. Consider MessagePack.
[15:03:45] gizmore: havenwood: thanks. will take a look
[15:05:42] croberts: has joined #ruby
[15:05:44] gizmore: havenwood: i will add msgback support and probably use it for session data. for more complex serialization i will use Marshall. JSON is already available as datatype in my framework :)
[15:05:49] cdunklau: ccooke: cool ok
[15:05:49] croberts: Hi, if anyone has a free moment to help me understand this error https://paste.fedoraproject.org/paste/xogGL9y2skLWZaqrzasGwg
[15:05:49] croberts: line 10 is what its erroring on
[15:05:52] cdunklau: thanks everyone!
[15:05:54] cschneid: has joined #ruby
[15:07:17] havenwood: croberts: `vm_network[:name]` instead of `vm_network.name`
[15:07:21] gizmore: croberts: the Hash class does not have a name method... you probably need something like nics.first.name
[15:07:33] gizmore: >> {a:1}.first
[15:07:39] gizmore: >> {a:1}.first
[15:07:45] gizmore: << {a:1}.first
[15:07:45] ruby[bot]: gizmore: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[15:08:21] croberts: still learning
[15:08:57] gizmore: first is a horrible idea though..... just compare against the name somehow
[15:08:58] croberts: awesome community
[15:09:07] croberts: that makes sense
[15:09:10] croberts: for validation
[15:09:45] infernix: has joined #ruby
[15:14:58] ellcs1: has joined #ruby
[15:17:02] Asher: has joined #ruby
[15:17:47] kristofferR: has joined #ruby
[15:21:04] hph^: has joined #ruby
[15:24:27] roamingdog: has joined #ruby
[15:28:01] orbyt_: has joined #ruby
[15:29:02] duckpuppy: has joined #ruby
[15:30:10] ellcs1: has left #ruby: ()
[15:30:45] ellcs1: has joined #ruby
[15:33:14] rshetty: has joined #ruby
[15:36:28] jottr: has joined #ruby
[15:36:57] r29v: has joined #ruby
[15:39:09] lxsameer: has joined #ruby
[15:45:44] nogic: has joined #ruby
[15:45:55] pastorinni: has joined #ruby
[15:46:21] orbyt_: has joined #ruby
[15:46:26] fluxAeon_: has joined #ruby
[15:46:29] Rapture: has joined #ruby
[15:46:31] JamJam_kid: has joined #ruby
[15:50:42] tdy: has joined #ruby
[15:52:36] mupt: has joined #ruby
[15:58:16] duckpuppy: has joined #ruby
[16:00:13] StarSeed0000: has joined #ruby
[16:00:59] jabowa: has joined #ruby
[16:03:37] jabowa: Hey quick question - Sometimes when I make a small change bump the version for a gem and I update that gem to the correct version in the required project Gemfile. It logs `could not find gem`. If I do gem uninstall `custom_gem`, then gem install `custom_gem`, it installs the latest version. Then, I can run bundle update and it recognizes the latest version and everything works. Is there a way to fix this?
[16:04:12] jabowa: The latest version of the gem is listed correctly in rubygems.org also
[16:10:46] caleBOT__: has joined #ruby
[16:10:47] caleBOT__: has joined #ruby
[16:11:37] bmurt: has joined #ruby
[16:12:05] anjen: has joined #ruby
[16:15:06] wontruefree: has joined #ruby
[16:18:34] jcarl43: has joined #ruby
[16:19:19] duckpuppy: has joined #ruby
[16:19:32] tolerablyjake: has joined #ruby
[16:24:21] SeepingN: has joined #ruby
[16:25:49] orbyt_: has joined #ruby
[16:26:23] deathwishdave: has joined #ruby
[16:30:18] ellcs1: has joined #ruby
[16:37:24] lxsameer: has joined #ruby
[16:38:53] InfinityFye: has left #ruby: ("Leaving")
[16:42:16] urux: has joined #ruby
[16:43:22] eckhardt: has joined #ruby
[16:46:40] BloopMonster: has joined #ruby
[16:47:13] lxsameer: has joined #ruby
[16:49:34] memo1: has joined #ruby
[16:51:50] [Butch]: has joined #ruby
[16:54:49] cthulchu_: we can do something like this, right? @api_wrapper.create_profile(get_staging_profile_body(index: index, phone_number: phone_number), auth_token: auth_token)
[16:57:22] lxsameer: has joined #ruby
[16:59:26] Venomen: has joined #ruby
[17:00:05] konsolebox: jabowa: you checked the syntax in Gemfile??
[17:00:32] konsolebox: cthulchu_: maybe you should tell what framework that is
[17:00:54] cthulchu_: it works fine
[17:01:10] cthulchu_: it's just Ruby has a special way to handle parenthesis
[17:01:32] cthulchu_: I was suspicious of a method call in a different method's args
[17:01:36] cthulchu_: looks like it works
[17:05:34] jabowa: konsolebox: Yes, the syntax is correct. This happens randomly. So it will find for 3 versions then say could not find gem
[17:05:34] hph^: has joined #ruby
[17:05:42] konsolebox: cthulchu_: i see
[17:05:54] p4p0l0: has joined #ruby
[17:06:18] synthroid: has joined #ruby
[17:07:14] lxsameer: has joined #ruby
[17:07:40] StarSeed0000: has joined #ruby
[17:07:51] konsolebox: jabowa: maybe it's a querying issue, or maybe it's a bug in bundler. you can share to us the line in the Gemfile
[17:08:11] tuxillo: has left #ruby: ()
[17:08:33] jabowa: konsolebox: gem "jekyll-theme-org-default"
[17:17:19] lxsameer: has joined #ruby
[17:18:19] konsolebox: jabowa: i get 'Could not find gem 'jekyll-theme-org-default' in any of the gem sources listed'. searching the gem in rubygems.org also doesn't show result
[17:18:44] konsolebox: jabowa: perhaps you have a custom source?
[17:24:35] rshetty: has joined #ruby
[17:26:45] Venomen: has joined #ruby
[17:27:24] lxsameer: has joined #ruby
[17:29:47] apeiros_: has joined #ruby
[17:33:12] SeepingN: has joined #ruby
[17:33:17] pr0ton: has joined #ruby
[17:37:13] Venomen: has joined #ruby
[17:37:14] Venomen: has joined #ruby
[17:37:21] lxsameer: has joined #ruby
[17:38:46] mupt: has joined #ruby
[17:45:43] jottr: has joined #ruby
[17:47:15] lxsameer: has joined #ruby
[17:50:53] bmurt: has joined #ruby
[17:57:09] lxsameer: has joined #ruby
[17:59:58] mupt: has joined #ruby
[18:00:36] Lytol: has joined #ruby
[18:03:19] beefjoe: has joined #ruby
[18:04:20] rshetty: has joined #ruby
[18:04:30] p4p0l0: has joined #ruby
[18:06:30] wontruefree: has joined #ruby
[18:07:19] lxsameer: has joined #ruby
[18:11:41] p4p0l0: has joined #ruby
[18:11:41] desperek: has joined #ruby
[18:14:23] RougeR: has joined #ruby
[18:14:23] RougeR: has joined #ruby
[18:14:49] sameerynho: has joined #ruby
[18:17:22] lxsameer: has joined #ruby
[18:20:56] ramfjord: has joined #ruby
[18:21:06] nowhere_man: has joined #ruby
[18:23:01] alem0lars: has joined #ruby
[18:23:35] alem0lars: has joined #ruby
[18:24:02] wontruefree: has joined #ruby
[18:25:10] GodFather: has joined #ruby
[18:25:36] alex```: has joined #ruby
[18:26:13] alem0lars_: has joined #ruby
[18:27:13] lxsameer: has joined #ruby
[18:27:14] d^sh_: has joined #ruby
[18:27:56] jenrzzz: has joined #ruby
[18:27:56] jenrzzz: has joined #ruby
[18:31:28] clemens3_: has joined #ruby
[18:35:19] Venomen: has joined #ruby
[18:37:16] lxsameer: has joined #ruby
[18:37:45] Venomen: has joined #ruby
[18:37:45] Venomen: has joined #ruby
[18:40:01] David_H_Smith: has joined #ruby
[18:41:34] jottr: has joined #ruby
[18:41:37] orbyt_: has joined #ruby
[18:43:11] tuxillo: has joined #ruby
[18:43:34] tuxillo: when doing a a require I get a missingspecversionerror
[18:43:52] tuxillo: from irb. is there a more verbose error?
[18:44:07] tuxillo: I mean a way of increasing verbosity for this kind of errors
[18:46:02] jinie: has joined #ruby
[18:47:15] lxsameer: has joined #ruby
[18:51:39] quobo: has joined #ruby
[18:51:40] konsolebox: tuxillo: i find that likely coming from the one you're require-ing
[18:53:17] rshetty: has joined #ruby
[18:53:49] tuxillo: konsolebox: https://pastebin.com/PJ9DDeDr
[18:53:50] ruby[bot]: tuxillo: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[18:54:22] tuxillo: konsolebox: most likely hehe. the thing is that I think the i18n runtime depend specification is incorrect
[18:54:37] tuxillo: but I can't see that in that message, so I wondered if it there was a more verbose way
[18:56:58] Venomen: has joined #ruby
[18:57:17] lxsameer: has joined #ruby
[18:57:57] alem0lars: has joined #ruby
[18:58:01] cagomez: has joined #ruby
[19:01:15] mupt: has joined #ruby
[19:02:00] konsolebox: tuxillo: you can try getting the exception's message: begin; require 'active_support'; rescue => e; puts e.message; end
[19:03:02] konsolebox: tuxillo: sometimes all you can really do is trace the cause of error
[19:03:15] konsolebox: source by source
[19:03:21] tuxillo: konsolebox: i get the same error that's printed with just the require
[19:03:23] tuxillo: how do I trace it?
[19:04:05] konsolebox: i'd manually read the codes. some guys probably know a better way of debugging it, but i don't do such things often
[19:05:48] claudiuinberlin: has joined #ruby
[19:05:53] tuxillo: konsolebox: well I know exactly where the error is
[19:05:57] wontruefree: has joined #ruby
[19:06:05] tuxillo: in the gemspec (activesupport) it's specified :
[19:06:42] tuxillo: s.add_runtime_dependency(%q<i18n>.freeze, [">= 0.6", "~> 0.6"]
[19:07:05] tuxillo: that does not allow i18n to be >= 1.0 (which is the case)
[19:07:11] lxsameer: has joined #ruby
[19:07:44] konsolebox: maybe active_support needs update
[19:08:08] tuxillo: it's from a package in pkgsrc
[19:08:18] tuxillo: anyways I'll report the issue as it is and see what the pkgsrc guys say
[19:08:22] guille-moe: has joined #ruby
[19:12:22] nowhere_man: has joined #ruby
[19:14:51] zachk: has joined #ruby
[19:14:51] zachk: has joined #ruby
[19:16:02] rshetty: has joined #ruby
[19:17:13] lxsameer: has joined #ruby
[19:18:42] dtzuzu: has joined #ruby
[19:27:12] lxsameer: has joined #ruby
[19:27:24] biberu: has joined #ruby
[19:28:08] rshetty: has joined #ruby
[19:30:31] wadadli: has left #ruby: ("WeeChat 2.0.1")
[19:31:01] mupt: has joined #ruby
[19:31:20] mynameisdebian: has joined #ruby
[19:36:32] \void: has joined #ruby
[19:37:20] lxsameer: has joined #ruby
[19:40:04] BloopMonster: has joined #ruby
[19:45:11] rshetty: has joined #ruby
[19:47:18] lxsameer: has joined #ruby
[19:52:23] Venomen: has joined #ruby
[19:52:23] Venomen: has joined #ruby
[19:53:26] workmad3: has joined #ruby
[19:55:24] orbyt_: has joined #ruby
[19:57:15] lxsameer: has joined #ruby
[19:57:45] alem0lars: has joined #ruby
[19:57:57] jamesaxl: has joined #ruby
[20:00:31] rshetty: has joined #ruby
[20:03:32] swillits: has joined #ruby
[20:05:43] swillits: has left #ruby: ()
[20:06:46] ElFerna: has joined #ruby
[20:07:20] lxsameer: has joined #ruby
[20:10:38] sunny: has joined #ruby
[20:10:54] sunny: hello guys, noob question
[20:11:22] sunny: why open(ARGV[1], "w").write(open(ARGV[0]).read)
[20:11:34] sunny: adds unkown symbol to output file
[20:14:38] tty: has joined #ruby
[20:16:02] bijan_: has joined #ruby
[20:17:20] lxsameer: has joined #ruby
[20:17:30] konsolebox: Sunny: like what symbol? perhaps it has got something to do with encoding, or maybe crlf. try using binread and binwrite if it makes a difference.
[20:19:20] dviola: has joined #ruby
[20:22:14] jottr: has joined #ruby
[20:25:04] sunny: It outputs as intended but appends newline and boxed ? symbol (wrong one ))
[20:27:22] lxsameer: has joined #ruby
[20:27:47] mupt: has joined #ruby
[20:27:58] _haylon: has joined #ruby
[20:29:12] ElFerna: has joined #ruby
[20:29:38] t0xik: has joined #ruby
[20:32:00] konsolebox: Sunny: and did you run this? IO.binwrite(ARGV[1], IO.binread(ARGV[0]))
[20:32:14] cajone: has left #ruby: ()
[20:33:01] sunny: not yet, how to adress messages here )
[20:33:59] wilbert: has joined #ruby
[20:35:02] sunny: IO thing worked well
[20:35:20] konsolebox: then it's probably encoding or something
[20:36:03] sunny: thank you, we thougt its about encoding too (windows host meh)
[20:36:11] sunny: can you explain this workaround?
[20:36:32] konsolebox: Sunny: it's binary mode
[20:37:11] lxsameer: has joined #ruby
[20:37:41] konsolebox: which means no text-related transformations based on locale/etc.
[20:39:56] knight33: has joined #ruby
[20:40:15] skryking: has joined #ruby
[20:40:45] skryking: has left #ruby: ()
[20:44:01] tolerablyjake: has joined #ruby
[20:47:21] lxsameer: has joined #ruby
[20:52:08] ElFerna: has joined #ruby
[20:52:28] mupt: has joined #ruby
[20:54:58] ElFerna: has joined #ruby
[20:57:12] lxsameer: has joined #ruby
[21:02:55] jottr: has joined #ruby
[21:07:23] lxsameer: has joined #ruby
[21:15:44] fredlinhares: has joined #ruby
[21:17:07] lxsameer: has joined #ruby
[21:18:43] npgm: has joined #ruby
[21:19:47] cyberg: has joined #ruby
[21:20:31] lubekpl: has joined #ruby
[21:25:52] Megamos: has joined #ruby
[21:29:59] kleofas: has joined #ruby
[21:32:16] lxsameer: has joined #ruby
[21:32:41] cthulchu_: folks, what ide do you use?
[21:32:54] eam: spacemacs or vim
[21:33:02] cthulchu_: vim is not an ide
[21:33:08] cthulchu_: it's a text editor
[21:34:00] jenrzzz: has joined #ruby
[21:34:00] jenrzzz: has joined #ruby
[21:34:03] cthulchu_: I'll go with VS, I think
[21:34:06] konsolebox: i don't use an ide for ruby
[21:34:06] ramfjord_: has joined #ruby
[21:34:13] cthulchu_: I don't for now either
[21:34:28] konsolebox: but if i find something good and is open-source, i'd try it
[21:34:30] dviola: I prefer vim, but that's because I've been using it for a long time
[21:34:39] havenwood: cthulchu_: Just keep using Atom.
[21:34:53] cthulchu_: I lack neat functionality
[21:35:00] cthulchu_: like refactoring or jumping to def
[21:35:07] cthulchu_: across the project
[21:35:10] havenwood: cthulchu_: Like what?
[21:35:13] cthulchu_: also autocomplete
[21:35:18] cthulchu_: like I just listed, man
[21:35:34] dviola: spacemacs is emacs with a custom config and evil
[21:35:46] havenwood: cthulchu_: The ruby-solargraph plugin has Ruby code completion and inline docs.
[21:36:04] cthulchu_: also VS has a build in console to which I can just drag and drop rb files and it'll execute them
[21:36:10] caleBOT_: has joined #ruby
[21:36:10] caleBOT: has joined #ruby
[21:36:12] havenwood: cthulchu_: RubyMine might be your best bet for an IDE, but I've not found them compelling in Ruby.
[21:36:32] havenwood: cthulchu_: You can code from Atom as well. That's pretty universal.
[21:36:52] cthulchu_: Atom keeps trying to autocomplete every end and else
[21:36:58] cthulchu_: I have to press escape each time
[21:37:10] konsolebox: ACTION wonders if it's time he should try Atom again
[21:37:10] havenwood: cthulchu_: Until Ruby has gradual typing or something along those lines, what can be done is fairly limited.
[21:37:21] havenwood: cthulchu_: I don't know why it's doing that. You can probably fix it.
[21:37:45] cthulchu_: but also the consoles, the refactoring and jumping to definitions is very cool
[21:37:56] cthulchu_: Atom is quite basic
[21:38:30] havenwood: cthulchu_: It's far from a basic text editor. Maybe basic if you consider it an IDE.
[21:38:49] cthulchu_: it's not a basic editor for sure
[21:38:55] cthulchu_: in fact, it's close to np++
[21:39:08] cthulchu_: but not an ide either
[21:39:42] konsolebox: close to np++? i doubt that though
[21:39:53] konsolebox: closest to np++ is Geany
[21:40:02] havenwood: cthulchu_: Under the autocomplete-plus plugin, change "tab and enter" to "tab always, enter when suggestion explicitly suggested"
[21:40:03] bradleyprice: has joined #ruby
[21:40:18] cthulchu_: ah, that's cool
[21:40:25] havenwood: cthulchu_: that'll solve the issue you ran into - focus on Ruby, not your editor!
[21:40:28] havenwood: cthulchu_: Atom is fine.
[21:40:41] cthulchu_: fine but not great :)
[21:40:49] cthulchu_: should try Geany at some point
[21:40:58] cthulchu_: but for now, I want to feel really comfortable
[21:41:06] cthulchu_: I wish we had something as powerful as webstorm
[21:41:11] havenwood: of just wait long enough, and Atom will get great
[21:41:26] havenwood: VSCode and Atom are not maintained by the same company, after all! ;-P
[21:41:27] al2o3-cr: nano is some serious text editor =P
[21:41:33] havenwood: I mean *now* maintained.
[21:41:39] havenwood: al2o3-cr: pico
[21:42:20] lxsameer: has joined #ruby
[21:42:42] havenwood: ah, nano is more FOSS than pico, i couldn't recall the diff
[21:46:44] al2o3-cr: havenwood: is it called pico on macOS?
[21:46:58] havenwood: al2o3-cr: there's both
[21:47:10] havenwood: al2o3-cr: /usr/bin/pico and /usr/bin/nano
[21:47:17] FernandoBasso: has joined #ruby
[21:47:30] al2o3-cr: oh hmm, i thought they were the same thing
[21:49:12] apeiros_: has joined #ruby
[21:49:48] fcser__: has joined #ruby
[21:50:26] ramfjord: has joined #ruby
[21:50:30] drale2k_: has joined #ruby
[21:53:37] workmad3: has joined #ruby
[22:01:46] wontruefree: has joined #ruby
[22:02:12] jrich523: has joined #ruby
[22:02:17] cdunklau: al2o3-cr: they are, on my mac at least
[22:02:25] cdunklau: pico is nano
[22:03:00] jrich523: hey guys, is this stupid lol? arr.select { |g| g['name'].match(regex) }.each{ ... }
[22:03:13] al2o3-cr: cdunklau: i thought that was the case but wasn't 100% sure.
[22:03:14] jrich523: or rather, is there a better way to accomplish that? i ask only because ruby has a lot of nifty ways to do things
[22:05:36] cthulchu_: somebody tries to use map reduce :)
[22:06:22] cthulchu_: does match return boolean?
[22:06:37] jrich523: i believe so, because it does work
[22:06:43] cthulchu_: >> "qwe".match(/qwe/)
[22:06:43] jrich523: it just looked wrong
[22:06:49] ruby[bot]: cthulchu_: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[22:06:59] cthulchu_: oh, eval is down?
[22:07:00] havenwood: cthulchu_: #match?
[22:07:11] cthulchu_: anyhow, I use ===
[22:07:18] cthulchu_: it does the trick for me
[22:07:22] cthulchu_: regex === string
[22:07:31] havenwood: cthulchu_: #match? is fast
[22:07:42] cthulchu_: a bit faster than ===
[22:07:47] cthulchu_: cuz === looks up the classes
[22:08:04] cthulchu_: the difference is similar to the difference between + and <<
[22:08:08] cthulchu_: when it's concat
[22:08:18] jrich523: i learned about that just moments ago :)
[22:08:26] jrich523: kvm['guests'].select { |g| g['name'].match(regex) }.each { |g| display.concat("%-6d\n" % g['name'])}
[22:08:39] jrich523: thats the actual line, and display is just a single string of the whole message
[22:09:13] cthulchu_: I would also do display +=
[22:09:30] jrich523: but, wouldnt that be slower?
[22:09:39] jrich523: i mean in this case it doesnt matter, only like at most 100 entries
[22:09:40] cthulchu_: dude, it's ruby
[22:09:53] cthulchu_: readability and easiness comes first
[22:10:06] cthulchu_: simplicity of the tests
[22:10:08] jrich523: oh man, readability does not come first lol
[22:10:26] cthulchu_: well it's supposed to be first in case of Ruby
[22:10:36] cthulchu_: if you wanted speed, you'd use go
[22:10:48] jrich523: I use go, mostly for jenkins
[22:10:52] cthulchu_: you didn't know?
[22:10:55] jrich523: never really considered it for performance reasons
[22:10:57] bradleyprice: has joined #ruby
[22:11:02] cthulchu_: go is amazing
[22:11:05] jrich523: man i just program in whatever someone tells me to
[22:11:07] cthulchu_: performance-wise
[22:11:09] jrich523: today its ruby lol
[22:11:15] cthulchu_: I do the same :)
[22:11:28] cthulchu_: just started ruby a few weeks ago :)
[22:11:29] SeepingN: I found ruby VERY easy to read and get the gist of a script in most cases
[22:11:40] jrich523: yeah im pretty sure we started together lol
[22:12:05] jrich523: last week i got yanked to another job, python, so i was MIA
[22:13:03] jinie: has joined #ruby
[22:13:28] ellcs1: has joined #ruby
[22:13:32] jrich523: actually it was powershell, tomorrow is python... weeee
[22:15:40] caleBOT_: has joined #ruby
[22:15:40] caleBOT: has joined #ruby
[22:20:58] white_lilies: has joined #ruby
[22:23:17] Cthulu201: has joined #ruby
[22:24:42] anjen: has joined #ruby
[22:24:53] jinie: has joined #ruby
[22:28:43] jhack: has joined #ruby
[22:30:15] white_lilies: has joined #ruby
[22:31:12] ramfjord: has joined #ruby
[22:34:53] GodFather: has joined #ruby
[22:36:40] jenrzzz: has joined #ruby
[22:37:20] ramfjord: has joined #ruby
[22:37:21] BloopMonster: has joined #ruby
[22:43:27] hph^: has joined #ruby
[22:46:09] pebble2014: has joined #ruby
[22:47:18] lxsameer: has joined #ruby
[22:49:12] cagomez: has joined #ruby
[22:49:39] cthulchu_: there's rubocop for VSCode
[22:49:51] cthulchu_: my code will look preeeeetty!
[22:50:02] eam: is there a way to generate a new Gemfile.lock without actually installing all the damn gems with bundle install?
[23:03:45] jottr: has joined #ruby
[23:04:22] npgm: has joined #ruby
[23:09:34] havenwood: eam: For a non-Rails project, I'd have expected it'd work to: gem i --explain --file --lock
[23:09:39] havenwood: eam: But alas, nope.
[23:11:27] sunny: has joined #ruby
[23:18:51] Azure: has joined #ruby
[23:19:24] sunny: has joined #ruby
[23:21:20] venmx: has joined #ruby
[23:23:50] caleBOT: has joined #ruby
[23:24:10] caleBOT_: has joined #ruby
[23:27:11] lxsameer: has joined #ruby
[23:29:19] zautomata: has joined #ruby
[23:29:34] karapetyan: has joined #ruby
[23:31:43] bmurt: has joined #ruby
[23:31:59] eckhardt: has joined #ruby
[23:34:06] ramfjord: has joined #ruby
[23:34:09] cthulchu_: has joined #ruby
[23:37:31] jhack: has joined #ruby
[23:39:41] cagomez: has joined #ruby
[23:40:21] Fizzik: has joined #ruby
[23:42:17] lxsameer: has joined #ruby
[23:44:11] herbmillerjr: has joined #ruby
[23:49:56] vyorkin: has joined #ruby
[23:53:52] workmad3: has joined #ruby