« Back to channel list

#ruby - 08 July 2018

« Back 1 day Forward 1 day »
[00:09:35] Joufflu_Fail: has joined #ruby
[00:16:42] wnd-trans: has joined #ruby
[00:23:12] Cthulu201: has joined #ruby
[00:31:31] noobineer: has joined #ruby
[00:36:47] amar_: has joined #ruby
[00:37:27] hph^: has joined #ruby
[00:38:19] houhoulis: has joined #ruby
[00:49:51] taylorzr: has joined #ruby
[01:00:22] Joufflu: has joined #ruby
[01:02:21] graphene: has joined #ruby
[01:08:59] AndroidKitKat: has joined #ruby
[01:09:15] postmodern: has joined #ruby
[01:09:53] n0m4d1c: has joined #ruby
[01:12:42] cadillac_: has joined #ruby
[01:14:27] faces: has joined #ruby
[01:19:08] shinnya: has joined #ruby
[01:21:17] subroot: has joined #ruby
[01:25:22] tdy: has joined #ruby
[01:43:02] duderonomy: has joined #ruby
[01:43:06] graphene: has joined #ruby
[01:53:48] graphene: has joined #ruby
[01:58:28] Joufflu: has joined #ruby
[01:58:29] vonfry: has joined #ruby
[02:11:40] white_lilies: has joined #ruby
[02:17:35] apparition: has joined #ruby
[02:20:52] MagePsycho: has joined #ruby
[02:20:59] houhoulis: has joined #ruby
[02:26:56] MzrE: has joined #ruby
[02:29:22] kapil___: has joined #ruby
[02:53:26] z3uS: has joined #ruby
[02:57:44] subroot: has joined #ruby
[03:00:15] cadillac_: has joined #ruby
[03:00:57] Joufflu: has joined #ruby
[03:01:42] dviola: has joined #ruby
[03:02:19] cosmopaladin: has joined #ruby
[03:09:40] braincrash: has joined #ruby
[03:12:41] cosmopaladin: has joined #ruby
[03:13:29] yokel: has joined #ruby
[03:20:22] TagNotFound: has joined #ruby
[03:38:06] gix-: has joined #ruby
[03:44:27] graphene: has joined #ruby
[03:54:29] vonfry_: has joined #ruby
[04:04:46] cosmopaladin_: has joined #ruby
[04:06:06] darkhanb: has joined #ruby
[04:06:11] cosmopaladin: has joined #ruby
[04:06:47] cosmopaladin: has joined #ruby
[04:08:22] cosmopaladin: has joined #ruby
[04:08:52] cosmopaladin: has joined #ruby
[04:26:14] vonfry_: has joined #ruby
[04:37:13] eb0t: has joined #ruby
[05:06:03] vonfry_: has joined #ruby
[05:07:26] vonfry_: has joined #ruby
[05:07:51] dhawan: has joined #ruby
[05:08:43] dhawan: I am new to ruby programming. According to a project specification, I have to execute Sinatra application in a background Thread in such a way that after executing Sinatra application, user can receive command line immediately
[05:08:55] dhawan: I cannot use process daemon or Process form in my project as it will isolate the process from the original running process moreover it would not be feasible to communication between forked process and the originally running process. Now the only option I am left with is Thread. So is it possible to execute the same by using thread?
[05:15:15] vonfry: has joined #ruby
[05:15:18] eam: dhawan: what do you mean "user can receive command line immediately?"
[05:16:36] eam: you want to run the sinatra server on a command line and have it run in the background?
[05:16:39] jidar: threads don't return to the calling process
[05:17:03] jidar: (unless the thread finishes)
[05:19:10] dreamthese: has joined #ruby
[05:19:28] jidar: his/her question on stackoverflow hahaha https://stackoverflow.com/questions/51225986/is-it-possible-to-execute-a-sinatra-application-via-thin-as-a-background-proce
[05:20:08] eam: so it sounds like this is really a question about the interaction between the shell and a program being run
[05:20:23] jidar: that's how I read the question
[05:20:40] eam: if that's the case, the answer is that you absolutely must fork and create two processes -- but the first one will exit
[05:21:01] eam: and it *is* possible to communicate between forked processes, but we would need more specifics
[05:26:37] Emmanuel_Chanel: has joined #ruby
[05:36:11] _whitelogger: has joined #ruby
[05:39:26] Pupeno: has joined #ruby
[05:39:43] Pupeno: Can the # frozen_string_literal: true be on the second line of the file?
[05:44:01] schleppel: has joined #ruby
[05:44:10] tdy: has joined #ruby
[05:46:59] dhawan: has joined #ruby
[05:49:25] graphene: has joined #ruby
[05:58:18] leah2: has joined #ruby
[05:58:46] dhawan: @eam yes, it is a question about the interaction between the shell and browser. Actually I am trying to terminal output on browser to provide graphical user interface to the user.
[05:58:47] dhawan: ANd yes, I asked this question on stack overflow, But I did'nt get response there so here I am
[06:00:25] dhawan: Acually I am working on metasploit-framework project. As you know it is a command line penetration tool. My goal is to provide web Interface to Meterpreter shell.
[06:01:55] dhawan: I am not able to interact with the untill the thread is compleated.
[06:02:24] dhawan: *interact with the shell *
[06:10:12] eam: dhawan: can you describe your project in a bit more detail?
[06:18:02] dhawan: You can find the abstract here : https://summerofcode.withgoogle.com/projects/#6618295331979264
[06:18:38] tvw: has joined #ruby
[06:20:57] segy: has joined #ruby
[06:39:48] TagNotFound: has joined #ruby
[06:41:50] konsolebox: has joined #ruby
[06:49:17] vonfry: has joined #ruby
[06:49:37] amar: has joined #ruby
[06:51:39] tagnotfo1nd: has joined #ruby
[06:52:25] mikecmpbll: has joined #ruby
[07:00:41] jraavis: has joined #ruby
[07:01:34] Deesl: has joined #ruby
[07:04:26] graphene: has joined #ruby
[07:07:44] amar: has joined #ruby
[07:16:35] modin: has joined #ruby
[07:22:43] graphene: has joined #ruby
[07:29:28] alem0lars: has joined #ruby
[07:31:47] alem0lars: has joined #ruby
[07:32:44] alex``: has joined #ruby
[07:38:42] suukim: has joined #ruby
[07:45:13] _whitelogger: has joined #ruby
[07:59:09] jmcgnh: has joined #ruby
[08:00:01] jmcgnh: has left #ruby: ("The Lounge - https://thelounge.github.io")
[08:00:57] ciscam: has joined #ruby
[08:05:19] apeiros: has joined #ruby
[08:12:55] vonfry_: has joined #ruby
[08:13:10] mtkd: has joined #ruby
[08:19:12] vonfry: has joined #ruby
[08:21:57] xtsee: has joined #ruby
[08:22:53] RougeR: has joined #ruby
[08:22:53] RougeR: has joined #ruby
[08:24:23] sameerynho: has joined #ruby
[08:28:57] MagePsycho: set :branch, ENV['BRANCH'] || ??? -> I want to print "You must specify branch" and exit
[08:28:58] MagePsycho: how to do that
[08:30:46] apeiros: MagePsycho: raise "You must specify branch" unless ENV['BRANCH'] the line before IMO.
[08:31:55] jmcgnh: has joined #ruby
[08:32:36] MagePsycho: set :branch, raise "You must specify branch" unless ENV['BRANCH']
[08:32:52] MagePsycho: live above <apeiros>
[08:32:58] za1b1tsu: has joined #ruby
[08:33:19] apeiros: first line raise, second line set :branch
[08:37:46] MagePsycho: raise "You must specify branch in order to deploy in staging server" unless ENV['BRANCH']
[08:37:46] MagePsycho: set :branch, ENV['BRANCH']
[08:42:07] cajone: has joined #ruby
[08:42:26] cajone: has left #ruby: ()
[08:42:32] Dbugger: has joined #ruby
[08:48:25] netfrog: has joined #ruby
[08:49:22] MagePsycho: that works. thanks apeiros
[08:49:30] MagePsycho: proc { `git rev-parse --abbrev-ref HEAD`.chomp } -> what does proc does
[08:49:58] apeiros: you know ri or http://www.ruby-doc.org ?
[08:52:00] konsolebox: nice, now everyone suggests ruby-doc.org :)
[08:52:10] sphenxes: has joined #ruby
[08:52:35] konsolebox: i prefer using an offline copy of the documentation that use ri
[08:54:43] Nicmavr: has joined #ruby
[08:56:35] pauliesaint: has joined #ruby
[08:56:46] graphene: has joined #ruby
[08:58:05] claudiuinberlin: has joined #ruby
[08:58:06] graphene: has joined #ruby
[08:59:38] konsolebox: i have it bookmarked in the "Refs" folder menu in Bookmarks Toolbar: https://imgur.com/a/rsolsUK
[09:01:13] dhollin: has joined #ruby
[09:02:09] BloopMonster: has joined #ruby
[09:04:02] graphene: has joined #ruby
[09:06:06] konsolebox: *than use ri
[09:08:45] apeiros: konsolebox: I prefer ri too. but some people seem to prefer online docs. for whatever reasons.
[09:09:00] apeiros: I mean ri has the clear advantage of being in sync with the ruby version you actually use
[09:10:53] ur5us: has joined #ruby
[09:12:21] livcd: i use dash
[09:12:21] konsolebox: apeiros: why "too"? i prefer the html documentation :) yeah i care about ri; i mean i persisted on making the documentation of my gems work for it. and i know it's more updated, especially with documentation of other libraries. but then i still like how easy it is to quickly browse from one class to another in the html docs. it's easy to skim/search for strings.
[09:12:41] livcd: apeiros: i guess people prefer online docs because they end up googling stuff on the internet anyway
[09:12:46] apeiros: konsolebox: ah, misread you then
[09:13:00] konsolebox: yeah i made i a typo there
[09:13:07] rawste: has joined #ruby
[09:13:43] apeiros: livcd: yeah. and I keep telling people that googling methods of proglangs is a stupid idea. the less you know the worse your results will be.
[09:13:48] nikivi: if I want to return a value from a method as string, do I print it out?
[09:14:02] apeiros: nikivi: no. printing is not returning.
[09:14:09] nikivi: I read in ruby you don't excplitly return things
[09:14:12] livcd: anyone watched the latest rubykaigi videos ? are we there yet for guilds ?
[09:14:17] nikivi: the last evaluated is returned
[09:14:28] apeiros: nikivi: correct. you can however still explicitly return.
[09:14:53] rajdesai: has joined #ruby
[09:15:25] livcd: nikivi: just wait when sorbet.rb will be all the rage
[09:15:40] nikivi: livcd whats sorbet.rb?
[09:15:45] nikivi: I googled it got nothing
[09:15:56] nikivi: https://github.com/circlesabound/sorbet
[09:16:05] livcd: nikivi: typechecker for ruby from Stripe
[09:16:11] nikivi: https://github.com/stripe/stripe-ruby
[09:16:13] nikivi: oh this one?
[09:16:21] nikivi: nvm thats API lol
[09:16:27] graphene: has joined #ruby
[09:16:28] nikivi: typechecker would be neat indeed
[09:16:35] nikivi: I come to ruby from Go and love static typing
[09:16:39] livcd: it's not public yet afaik. https://sorbet.run
[09:16:40] nikivi: but ruby feels really nice to write in
[09:17:22] nikivi: livcd will it work like Flow for JS?
[09:17:25] nikivi: you annotate the types?
[09:19:06] livcd: looks like
[09:33:01] FernandoBasso: has joined #ruby
[09:33:52] apeiros: has joined #ruby
[09:39:10] _whitelogger: has joined #ruby
[09:49:27] dhawan: has joined #ruby
[10:00:36] vonfry_: has joined #ruby
[10:01:54] jraavis: has joined #ruby
[10:04:40] vonfry: has joined #ruby
[10:05:32] ebye__: has joined #ruby
[10:09:56] lele: has joined #ruby
[10:26:12] ^mtkd: has joined #ruby
[10:27:49] Sylario: has joined #ruby
[10:29:55] leitz: has joined #ruby
[10:34:12] psychicist__: has joined #ruby
[10:43:58] olspookishmagus: has joined #ruby
[10:46:02] amelliaa: has joined #ruby
[10:46:50] jyaworski: has joined #ruby
[10:49:49] nikivi: is it possible to know from where the method is being called in ruby?
[10:50:00] leitz: How do I 'require' my new gem? It's installed in /usr/local/lib/ruby/gems/2.6.0/gems/2D6_OGL_CharGen-0.0.5 and I can run the commands. However, I'd like to be able to use the "dice" class in 'lib' outside of the chargen stuff.
[10:50:12] nikivi: i.e. I have this code https://github.com/nikitavoloboev/karabiner-generator/blob/master/karabiner-generate.rb#L27
[10:50:26] leitz: https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/2d6_ogl_chargen.gemspec
[10:50:27] nikivi: And I want to drop the first argument to the method sticky
[10:50:45] nikivi: because all method calls in sticky_w, will have 'w' as first arg
[10:50:48] nikivi: I don't want to repeat it
[10:51:22] shinnya: has joined #ruby
[10:52:02] graphene: has joined #ruby
[10:52:02] leitz: nikivi, do you mean "is it possible to know what calls a method, from the method itself?"
[10:52:19] nikivi: leitz yeah
[10:52:30] nikivi: then I can check suffix of method and grab it from there
[10:52:38] nikivi: def sticky_s() -> will get me s
[10:54:13] leitz: Something like https://stackoverflow.com/questions/199527/get-the-name-of-the-currently-executing-method
[10:56:22] leitz: ACTION loves stackoverflow
[10:57:54] nikivi: this is currently executed method
[10:58:31] nikivi: https://hastebin.com/simijanule.rb
[10:58:32] nikivi: what I want
[11:00:11] leitz: This help? https://stackoverflow.com/questions/5100299/how-to-get-the-name-of-the-calling-method
[11:00:33] leitz: I'm only a beginner in Ruby so have to lean on SO or others here to help.
[11:00:44] leitz: Looks like the smart people are sleeping in. :)
[11:01:11] nikivi: perfect, thanks leitz
[11:01:29] nikivi: ACTION should learn to Google
[11:01:46] leitz: ACTION couldn't code without Google...
[11:02:42] graphene: has joined #ruby
[11:10:10] dhawan: has joined #ruby
[11:12:05] mtkd: has joined #ruby
[11:14:55] kapil___: has joined #ruby
[11:15:42] dhawan: has joined #ruby
[11:15:55] amar: has joined #ruby
[11:16:47] AJA4350: has joined #ruby
[11:18:48] leitz: ACTION longs for an update to the Pickaxe book.
[11:21:26] nikivi: what are your thoughts on Elixir?
[11:21:34] nikivi: I read that its a faster concurrent ver. of ruby
[11:25:33] Puffball: has joined #ruby
[11:26:37] leitz: I think Russ Olsen, author of "Eloquent Ruby", really likes Elixir.
[11:26:38] nikivi: def key(sticky_key, action_key, modifiers=nil)
[11:26:51] nikivi: If I do this it means I can skip modifiers in method call?
[11:26:55] nikivi: and it will be nil then
[11:27:22] jamesaxl: has joined #ruby
[11:27:30] leitz: Keep in mind that nil is it's own class.
[11:27:52] leitz: Useful for testing, vice "false" or "{}"
[11:28:22] leitz: fred = nil ; fred.nil?
[11:29:03] leitz: My niche for Ruby is to help me have fun learning OOP.
[11:31:02] zapata: has joined #ruby
[11:34:01] rajdesai: has joined #ruby
[11:35:42] graphene: has joined #ruby
[11:36:16] leitz: Okay, time to get ready for church. Enjoy the day!
[11:43:43] ebye__: has joined #ruby
[11:44:01] Inline: has joined #ruby
[11:45:34] rajdesai: has joined #ruby
[11:53:25] biberu: has joined #ruby
[12:01:36] dellavg: has joined #ruby
[12:01:51] rawste: has joined #ruby
[12:02:34] amar: has joined #ruby
[12:03:42] mtkd: has joined #ruby
[12:09:44] conta: has joined #ruby
[12:11:13] mikecmpbll: has joined #ruby
[12:14:45] demistify: has joined #ruby
[12:23:28] kryptoz: has joined #ruby
[12:23:51] rajdesai: has joined #ruby
[12:25:07] alem0lars: has joined #ruby
[12:34:29] kryptoz: has joined #ruby
[12:40:58] reber: has joined #ruby
[12:42:16] amar: has joined #ruby
[12:44:35] za1b1tsu: has joined #ruby
[12:44:45] Emmanuel_Chanel: has joined #ruby
[12:47:22] Emmanuel_Chanel: has joined #ruby
[12:49:07] mtkd: has joined #ruby
[12:53:34] ghoti: has joined #ruby
[12:54:07] fmcgeough: has joined #ruby
[13:01:18] Guest35491: has joined #ruby
[13:02:26] amar: has joined #ruby
[13:04:51] bak1an: has joined #ruby
[13:11:30] rippa: has joined #ruby
[13:12:20] cadillac_: has joined #ruby
[13:12:25] Asher: has joined #ruby
[13:15:35] dhawan: has left #ruby: ()
[13:17:22] mmattice: has joined #ruby
[13:21:48] cyberg: has joined #ruby
[13:25:41] amar: has joined #ruby
[13:25:47] graphene: has joined #ruby
[13:28:44] mtkd: has joined #ruby
[13:29:11] nicht: has joined #ruby
[13:30:23] Es0teric: has joined #ruby
[13:30:37] mmattice: has joined #ruby
[13:31:42] soniya29: has joined #ruby
[13:31:45] soniya29_: has joined #ruby
[13:38:09] cadillac_: has joined #ruby
[13:43:35] Mike11: has joined #ruby
[13:47:17] graphene: has joined #ruby
[13:50:25] mtkd: has joined #ruby
[13:57:09] fmcgeough: has joined #ruby
[13:58:22] kryptoz: has joined #ruby
[14:00:03] nikivi: are modules uppercased in ruby?
[14:00:09] nikivi: or you can lowercase them too?
[14:00:23] Asher: has joined #ruby
[14:02:22] mmattice: has joined #ruby
[14:08:18] BloopMonster: has joined #ruby
[14:10:41] houhoulis: has joined #ruby
[14:10:47] elomatreb: Making a name uppercase gives it constant-like treatment in Ruby, you can assign anything to local variables (lowercase names) too but it's kind of useless
[14:11:36] bak1an: has joined #ruby
[14:16:58] spiette: has joined #ruby
[14:17:32] nikivi: https://hastebin.com/zomiboroki.rb
[14:17:42] nikivi: I have this code, why can't I do if statement on line 16
[14:18:10] nikivi: basically I want to only assign something to 'modifiers' if to_modifiers is not nil
[14:18:24] nikivi: karabiner-generate.rb:157: syntax error, unexpected =>, expecting keyword_end
[14:18:24] nikivi: 'modifiers' => to_modifiers
[14:18:26] nikivi: I get this erro
[14:21:11] ^mtkd: has joined #ruby
[14:22:27] nikivi: oh I guess in that if block, the assignment can't take place
[14:22:34] nikivi: what is the best way to do what I want?
[14:22:49] nikivi: right now it assigns null to that field, I don't want that
[14:23:13] nikivi: I don't want to evaluate this line at all if there is nil: 'modifiers' => to_modifiers
[14:23:14] elomatreb: Because Ruby ifs don't work like preprocessor ifs.
[14:23:50] elomatreb: If you want to achieve what you can assign like `h["modifiers"] = ...` in an if after the hash initialization
[14:23:55] nikivi: I can think of a hacky way to wrap the entire thing in if but that's ugly
[14:24:28] nikivi: can you give example of it please?
[14:25:18] elomatreb: modified yours: https://hastebin.com/toyaxezeve.rb
[14:25:31] nikivi: this removes the field entirely right?
[14:25:41] nikivi: oh I see now
[14:25:47] elomatreb: It doesn't add it if the condition isn't met, yeah
[14:25:52] nikivi: I was thinking of overwriting it :)
[14:25:54] nikivi: will try now
[14:26:38] elomatreb: In general this seems like a kind of dirty approach though, is there a good reason you can't just always have the key and just set it to the value, and ignore it later if it is nil?
[14:26:44] nikivi: sweet that worked
[14:26:52] TheBrayn: has joined #ruby
[14:27:03] nikivi: the JSON spec, doesn't accept null value there
[14:27:13] nikivi: it either exists with some value or doesn't
[14:27:31] elomatreb: Ruby will automatically remove null fields
[14:27:39] elomatreb: The JSON serializer, that is
[14:28:11] nikivi: it added null field for me
[14:28:19] nikivi: https://hastebin.com/nujakuyera.json
[14:28:23] elomatreb: Yeah I misread, sorry
[14:28:27] nikivi: if you look at bottom
[14:28:39] elomatreb: And you have a schema to conform to?
[14:28:43] nikivi: https://pqrs.org/osx/karabiner/json.html#root-data-structure
[14:30:44] noobineer: has joined #ruby
[14:31:46] graphene: has joined #ruby
[14:43:01] graphene: has joined #ruby
[14:44:07] FrankyCyborg: has joined #ruby
[14:47:08] kryptoz: has joined #ruby
[14:48:05] pskosinski: has joined #ruby
[14:50:18] konsolebox: has joined #ruby
[14:51:42] subroot: has joined #ruby
[14:55:36] apeiros: >> foo = Module.new; foo::Bar = 1; foo::Bar
[14:55:37] ruby[bot]: apeiros: # => 1 (https://eval.in/1033420)
[14:55:52] apeiros: ^ nikivi, but as elomatreb said, use is limited.
[14:57:28] wojnar: has joined #ruby
[14:58:15] Asher: has joined #ruby
[15:01:04] nowhere_man: has joined #ruby
[15:02:34] aldodelgado: has joined #ruby
[15:07:50] nicesignal: has joined #ruby
[15:20:59] cadillac_: has joined #ruby
[15:22:59] griffindy: has joined #ruby
[15:32:14] orbyt_: has joined #ruby
[15:32:46] nikivi: def sticky(held_key, trigger_key, action, from_mandotary_modifiers=[], to_modifiers=[])
[15:32:52] nikivi: I can do this right?
[15:33:02] nikivi: from_mandotary_modifiers if not passed will take value of empty array
[15:33:09] nikivi: same for to_modifiers
[15:33:56] elomatreb: You can, but in order to specify to_modifiers you also have to provide some value for from_mandatory_modifiers
[15:34:11] elomatreb: Alternatively you can use keyword arguments if you want specifying one but not the other to be convenient
[15:36:05] apeiros: anything beyond 2 arguments becomes hard to understand with implicit names on caller side. I prefer long code with kwargs there.
[15:36:34] apeiros: and if they're defaultized, I started to use kwargs even for 1 and 2 arg methods.
[15:36:49] BloopMonster: has joined #ruby
[15:40:37] mtkd: has joined #ruby
[15:41:59] Zaab1t: has joined #ruby
[15:45:39] MzrE: has joined #ruby
[15:53:28] fmcgeough: has joined #ruby
[15:55:47] mroutis: has joined #ruby
[16:12:15] tdy: has joined #ruby
[16:13:24] Emmanuel_Chanel: has joined #ruby
[16:17:32] guille-moe: has joined #ruby
[16:21:54] white_lilies: has joined #ruby
[16:25:14] leah2: has joined #ruby
[16:27:14] alex``: has joined #ruby
[16:29:02] ghoti: has joined #ruby
[16:29:17] dviola: has joined #ruby
[16:31:55] rawste: has joined #ruby
[16:36:56] orbyt_: has joined #ruby
[16:37:41] bak1an: has joined #ruby
[16:38:56] lunarkitty7: has joined #ruby
[16:40:52] nowhere_man: has joined #ruby
[16:40:56] alfiemax: has joined #ruby
[16:45:37] cadillac_: has joined #ruby
[16:50:53] StarSeed0000: has joined #ruby
[16:55:37] mroutis: has left #ruby: ()
[16:59:28] alfiemax: has joined #ruby
[17:05:36] bak1an: has joined #ruby
[17:05:46] kryptoz: has joined #ruby
[17:06:32] Dimik: has joined #ruby
[17:18:04] conta: has joined #ruby
[17:26:45] mynameisdebian: has joined #ruby
[17:31:54] dviola: has joined #ruby
[17:37:24] mynameisdebian: has joined #ruby
[17:41:42] phredus: has joined #ruby
[17:43:10] rawste: has joined #ruby
[17:48:58] Venomen: has joined #ruby
[17:48:59] Venomen: has joined #ruby
[17:50:46] samosaphile: has joined #ruby
[18:01:36] peirama: has joined #ruby
[18:14:39] ByronJohnson: has joined #ruby
[18:17:11] peirama: has joined #ruby
[18:24:11] _whitelogger: has joined #ruby
[18:27:42] sphenxes: has joined #ruby
[18:30:13] za1b1tsu: has joined #ruby
[18:30:27] alfiemax: has joined #ruby
[18:32:35] pauliesaint: has joined #ruby
[18:35:51] kapil___: has joined #ruby
[18:37:23] wilhelm`: has joined #ruby
[18:41:44] peirama`: has joined #ruby
[18:41:49] TheBrayn: has joined #ruby
[18:46:40] za1b1tsu: has joined #ruby
[18:47:17] peirama`: has left #ruby: ("ERC (IRC client for Emacs 27.0.50)")
[18:48:25] guille-moe: has joined #ruby
[18:49:05] cosmopaladin: has joined #ruby
[18:55:36] peirama: has joined #ruby
[19:02:57] gell5: has joined #ruby
[19:05:50] nikivi: can someone help think through how one can solve on issue in ruby
[19:06:21] apeiros: there's some chance somebody might
[19:06:24] nikivi: I have this code https://hastebin.com/icitahunez.php
[19:06:42] nikivi: it basically generates JSON that an app then uses to rebind keyboard
[19:06:50] nikivi: there are two methods, shell and key
[19:07:11] nikivi: where each one binds a single key to another key, so say I press s key, then hold it and press g and it does something
[19:07:39] nikivi: I need a way to define that when I press some key, it pressed multiple keys after so I press s, then it will insert g, f, l and so on
[19:07:54] nikivi: so I want to create a method multiple_keys but not sure how to go from there really
[19:08:01] nikivi: I was thinking of using key() method somehow
[19:08:13] nikivi: its a bit abstract I know
[19:08:22] Zarthus: so you want a different action if I hold "s" + "g"?
[19:08:49] nikivi: Zarthus this is snippet from previous config https://hastebin.com/ripicikuga.php
[19:09:04] nikivi: what that did was made it so that if you press b, it will insert TODO: in sucession
[19:09:19] Zarthus: I just need help understanding the problem/feature.
[19:09:24] nikivi: so it will trigger T (with shift held, then O (with shift)..
[19:09:55] nikivi: take a look at key() method, see if it makes sense a bit
[19:10:50] nikivi: there is held_trigger which is key being held down, then trigger_key which is the key that will be pressed when that key is held down and key_code is what will be inserted once that happens
[19:11:01] nikivi: but this does it for 1 key only
[19:11:17] Zarthus: i understand how it works, I just have trouble understanding the purpose. Let's say you have an app and I hold down "s" and then press "i", what do you expect to happen?
[19:11:28] nikivi: whatever I define to happen
[19:11:35] nikivi: it can insert o key for example
[19:11:46] Zarthus: so then I'm holding down s, i, and o?
[19:11:53] nikivi: but what I want it to do now is to define s + i to insert todo in succession
[19:12:01] nikivi: no you hold down s, then press i
[19:12:04] nikivi: and o comes on screen
[19:12:12] nikivi: you can release s after if you want
[19:12:17] nikivi: s is like modifer key
[19:12:28] Zarthus: yeah, that's what i had trouble grokking
[19:12:39] nikivi: so that stuff I can do, one to one mappings
[19:12:48] nikivi: but I have trouble how I can extend it to multiple key calls
[19:12:58] nikivi: I guess I have to use array in some way
[19:13:03] Zarthus: the way I've seen this being done in other applications is event-based. Where you'd send two events instead of one.
[19:13:07] nikivi: but the thing is that those keys can also have modifiers
[19:13:59] desperek: has joined #ruby
[19:14:01] nikivi: is there a way I can have some complicated arguments in a method call
[19:14:16] nikivi: although not sure that would help
[19:14:28] Zarthus: sure. you can pass a hash, object, or just *args
[19:15:03] nikivi: key("q", "l", "l", ["command", "shift"]).key("q", "l", "o", ["command", "shift"]),
[19:15:09] nikivi: I am thinking of going for this kind of API
[19:15:19] nikivi: where I bind calls together with dot
[19:15:36] Zarthus: it looks to me (and I'll admit I've only spent a few minutes on this) that the args of key() are just wrong/limiting in general
[19:15:46] nikivi: but then that won't work either mm
[19:15:51] nikivi: in what way they are wrong?
[19:15:54] nikivi: limiting sure
[19:16:06] Zarthus: trigger_key only supports a single key
[19:16:06] nikivi: but those args are enough to do the one time binds s + i
[19:16:35] nikivi: there should only be one trigger key thats fine
[19:16:47] nikivi: s + i -> triggers something
[19:16:57] nikivi: but that something currently can be only one keybind called, I want multiple
[19:16:59] nikivi: thats the issue
[19:17:28] Zarthus: calling the method twice would work :P
[19:17:33] nikivi: so key_code should be changed
[19:17:39] nikivi: to array of key_code maybe
[19:17:43] ishahnaz: has joined #ruby
[19:17:57] nikivi: but I also have to specify modifiers to the key_code (to each one)
[19:18:03] nikivi: currently I do that as two other args
[19:18:13] nikivi: calling the method twice wouldn't work
[19:18:48] nikivi: or well it would if I call it with different arguments but the method calls would be called from original call
[19:19:47] alfiemax: has joined #ruby
[19:27:09] nikivi: so can I do this somehow?
[19:27:14] nikivi: key("i", "b", "T", ["shift"]).key('O', ['shift']),
[19:32:06] guille-moe: has joined #ruby
[19:32:53] graphene: has joined #ruby
[19:35:33] pauliesaint: has joined #ruby
[19:43:29] yokel: has joined #ruby
[19:43:55] pauliesaint_: has joined #ruby
[19:46:02] aufi: has joined #ruby
[19:48:27] graphene: has joined #ruby
[19:52:53] noobineer: has joined #ruby
[19:55:05] codymj: has joined #ruby
[19:56:41] Megamos: has joined #ruby
[20:02:17] amar: has joined #ruby
[20:06:18] bak1an: has joined #ruby
[20:11:15] salasrod: has joined #ruby
[20:12:16] akaiiro: has joined #ruby
[20:13:21] pauliesaint: has left #ruby: ()
[20:13:48] pauliesaint: has joined #ruby
[20:17:01] c0ncealed2: has joined #ruby
[20:19:38] agent_white: has joined #ruby
[20:24:14] fmcgeough: has joined #ruby
[20:48:35] burgestrand: has joined #ruby
[20:53:35] quobo: has joined #ruby
[20:54:04] bak1an: has joined #ruby
[21:05:00] dviola: has joined #ruby
[21:22:49] akaiiro: has joined #ruby
[21:23:56] RougeR: has joined #ruby
[21:24:33] edwardly: has joined #ruby
[21:24:52] ur5us: has joined #ruby
[21:25:18] mike`: has joined #ruby
[21:25:24] edwardly: has joined #ruby
[21:30:02] claudiuinberlin: has joined #ruby
[21:32:15] mtkd: has joined #ruby
[21:39:47] graphene: has joined #ruby
[21:40:42] violentE: has joined #ruby
[22:04:49] orbyt_: has joined #ruby
[22:05:44] shinnya: has joined #ruby
[22:06:02] skryking: has joined #ruby
[22:06:35] BloopMonster: has joined #ruby
[22:10:53] gell5: has joined #ruby
[22:10:54] RougeR: has joined #ruby
[22:10:55] RougeR: has joined #ruby
[22:11:38] gell5_: has joined #ruby
[22:20:50] leitz: has joined #ruby
[22:23:55] tdy: has joined #ruby
[22:27:23] amar: has joined #ruby
[22:36:00] white_lilies: has joined #ruby
[22:44:23] Joufflu: has joined #ruby
[22:45:25] fmcgeough: has joined #ruby
[22:49:08] graphene: has joined #ruby
[22:49:09] jrafanie: has joined #ruby
[22:52:34] bak1an: has joined #ruby
[22:59:27] cosmopaladin: has joined #ruby
[23:07:57] za1b1tsu: has joined #ruby
[23:09:52] rwb: has joined #ruby
[23:54:03] zenspider: the problem is that you're mixing single and double quoted strings together. that'll never work.