havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
houhoulis has quit []
Joufflu_Fail has joined #ruby
caleBOT has quit []
Joufflu has quit [Ping timeout: 264 seconds]
Joufflu_Fail has quit [Ping timeout: 248 seconds]
wnd-trans has joined #ruby
wnd has quit [Read error: Connection reset by peer]
Cthulu201 has quit [Quit: Nowhere special. I always wanted to go there.]
Cthulu201 has joined #ruby
zachk has quit [Quit: Leaving]
wnd-trans is now known as wnd
AndroidKitKat is now known as ChristmasKitKat
ChristmasKitKat is now known as SpookyKitKat
SpookyKitKat is now known as AndroidKitKat
AJA4350 has quit [Quit: AJA4350]
noobineer has joined #ruby
apeiros__ has quit [Ping timeout: 265 seconds]
quobo has quit [Quit: Connection closed for inactivity]
amar_ has joined #ruby
hph^ has joined #ruby
houhoulis has joined #ruby
amar_ has quit [Ping timeout: 248 seconds]
noobineer has quit [Ping timeout: 256 seconds]
taylorzr has joined #ruby
eb0t has quit [Quit: WeeChat 2.0.1]
tdy has quit [Ping timeout: 240 seconds]
Joufflu has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
AndroidKitKat has quit [Quit: Updating details, brb]
AndroidKitKat has joined #ruby
postmodern has joined #ruby
n0m4d1c has joined #ruby
cadillac_ has joined #ruby
n0m4d1c has quit [Quit: leaving]
faces has joined #ruby
shinnya has joined #ruby
subroot has joined #ruby
tdy has joined #ruby
houhoulis has quit []
graphene has quit [Remote host closed the connection]
duderonomy has joined #ruby
graphene has joined #ruby
postmodern has quit [Quit: Leaving]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
Joufflu has quit [Ping timeout: 248 seconds]
Joufflu has joined #ruby
vonfry has joined #ruby
subroot has quit [Read error: Connection reset by peer]
MagePsycho has quit [Ping timeout: 260 seconds]
white_lilies has joined #ruby
apparition has joined #ruby
MagePsycho has joined #ruby
houhoulis has joined #ruby
MzrE has joined #ruby
kapil___ has joined #ruby
taylorzr has quit [Quit: WeeChat 2.1]
z3uS has quit [Quit: /dev/null]
alex`` has quit [Ping timeout: 260 seconds]
z3uS has joined #ruby
subroot has joined #ruby
Joufflu has quit [Ping timeout: 268 seconds]
dviola has quit [Quit: WeeChat 2.1]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
Joufflu has joined #ruby
dviola has joined #ruby
cosmopaladin has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
yokel has quit [Ping timeout: 264 seconds]
cosmopaladin has quit [Quit: Leaving]
cosmopaladin has joined #ruby
yokel has joined #ruby
tagnotfound has joined #ruby
tagnotfound has quit [Remote host closed the connection]
gix- has joined #ruby
gix has quit [Disconnected by services]
feelx has quit [Ping timeout: 260 seconds]
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graphene has quit [Remote host closed the connection]
phredus has quit [Quit: Leaving]
graphene has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
vonfry_ has joined #ruby
vonfry has quit [Remote host closed the connection]
MzrE has quit [Quit: Leaving]
cosmopaladin has quit [Quit: Leaving]
cosmopaladin_ has joined #ruby
cosmopaladin_ has quit [Remote host closed the connection]
eblip has quit [Quit: WeeChat 2.0.1]
darkhanb has joined #ruby
cosmopaladin has joined #ruby
cosmopaladin has quit [Remote host closed the connection]
cosmopaladin has joined #ruby
donofrio has quit [Remote host closed the connection]
cosmopaladin has quit [Remote host closed the connection]
cosmopaladin has joined #ruby
cosmopaladin has quit [Client Quit]
cosmopaladin has joined #ruby
cosmopaladin has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 264 seconds]
vonfry_ is now known as vonfry
vonfry_ has joined #ruby
vonfry has quit [Remote host closed the connection]
vonfry_ is now known as vonfry
subroot has quit [Read error: Connection reset by peer]
eb0t has joined #ruby
eb0t is now known as eblip
howdoi has quit [Quit: Connection closed for inactivity]
Emmanuel_Chanel has quit [Ping timeout: 248 seconds]
tdy has quit [Ping timeout: 268 seconds]
vonfry_ has joined #ruby
vonfry has quit [Remote host closed the connection]
vonfry_ has quit [Remote host closed the connection]
vonfry_ has joined #ruby
dhawan has joined #ruby
<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
<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?
vonfry has joined #ruby
<eam> dhawan: what do you mean "user can receive command line immediately?"
vonfry_ has quit [Remote host closed the connection]
white_lilies has quit [Ping timeout: 264 seconds]
<eam> you want to run the sinatra server on a command line and have it run in the background?
<jidar> threads don't return to the calling process
<jidar> (unless the thread finishes)
dreamthese has quit [Read error: Connection reset by peer]
dreamthese has joined #ruby
<eam> heh
<eam> so it sounds like this is really a question about the interaction between the shell and a program being run
<jidar> that's how I read the question
<eam> if that's the case, the answer is that you absolutely must fork and create two processes -- but the first one will exit
<eam> and it *is* possible to communicate between forked processes, but we would need more specifics
Emmanuel_Chanel has joined #ruby
dhawan has quit [Quit: Leaving.]
_whitelogger has joined #ruby
Pupeno has joined #ruby
<Pupeno> Can the # frozen_string_literal: true be on the second line of the file?
schleppel has joined #ruby
tdy has joined #ruby
vonfry has quit [Remote host closed the connection]
dhawan has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
leah2 has quit [Read error: Connection reset by peer]
leah2 has joined #ruby
<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.
<dhawan> ANd yes, I asked this question on stack overflow, But I did'nt get response there so here I am
<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.
<dhawan> I am not able to interact with the untill the thread is compleated.
<dhawan> *interact with the shell *
<eam> dhawan: can you describe your project in a bit more detail?
Emmanuel_Chanel has quit [Ping timeout: 264 seconds]
segy has quit [Quit: ZNC - http://znc.in]
<dhawan> yes sure
<dhawan> You can find the abstract here : https://summerofcode.withgoogle.com/projects/#6618295331979264
tvw has joined #ruby
segy has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
konsolebox has quit [Ping timeout: 256 seconds]
tagnotfound has joined #ruby
houhoulis has quit []
konsolebox has joined #ruby
vonfry has joined #ruby
amar has joined #ruby
tagnotfo1nd has joined #ruby
mikecmpbll has joined #ruby
jraavis has joined #ruby
Deesl has joined #ruby
graphene has quit [Remote host closed the connection]
tagnotfound has quit []
graphene has joined #ruby
BloopMonster has quit [Ping timeout: 256 seconds]
amar has quit [Ping timeout: 244 seconds]
Dimik has quit [Ping timeout: 255 seconds]
amar has joined #ruby
modin has quit [Ping timeout: 265 seconds]
modin has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
alem0lars has joined #ruby
alem0lars has quit [Client Quit]
alem0lars has joined #ruby
alex`` has joined #ruby
Deesl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Quit: inabit. zz.]
suukim has joined #ruby
dviola has quit [Quit: WeeChat 2.1]
_whitelogger has joined #ruby
tvw has quit []
jmcgnh has joined #ruby
jmcgnh has left #ruby ["The Lounge - https://thelounge.github.io"]
ciscam has quit [Ping timeout: 260 seconds]
ciscam has joined #ruby
apeiros has joined #ruby
starseed0000 has quit [Ping timeout: 265 seconds]
xtsee has quit [Quit: WeeChat 1.9.1]
vonfry has quit [Remote host closed the connection]
vonfry_ has joined #ruby
mtkd has joined #ruby
vonfry has joined #ruby
vonfry_ has quit [Remote host closed the connection]
xtsee has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
sameerynho has joined #ruby
Joufflu has quit [Ping timeout: 268 seconds]
<MagePsycho> set :branch, ENV['BRANCH'] || ??? -> I want to print "You must specify branch" and exit
<MagePsycho> how to do that
<apeiros> MagePsycho: raise "You must specify branch" unless ENV['BRANCH'] the line before IMO.
jmcgnh has joined #ruby
<MagePsycho> set :branch, raise "You must specify branch" unless ENV['BRANCH']
<MagePsycho> live above <apeiros>
<MagePsycho> ?
za1b1tsu has joined #ruby
<apeiros> no
<apeiros> two lines
<apeiros> first line raise, second line set :branch
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<MagePsycho> raise "You must specify branch in order to deploy in staging server" unless ENV['BRANCH']
<MagePsycho> set :branch, ENV['BRANCH']
<MagePsycho> ?
cajone has joined #ruby
cajone has left #ruby [#ruby]
Dbugger has joined #ruby
dhawan has quit [Quit: Leaving.]
netfrog has joined #ruby
<MagePsycho> that works. thanks apeiros
<MagePsycho> proc { `git rev-parse --abbrev-ref HEAD`.chomp } -> what does proc does
<apeiros> you know ri or http://www.ruby-doc.org ?
<konsolebox> nice, now everyone suggests ruby-doc.org :)
sphenxes has joined #ruby
<konsolebox> i prefer using an offline copy of the documentation that use ri
Guest8871 has quit [Read error: Connection reset by peer]
pauliesaint has quit [Ping timeout: 265 seconds]
Nicmavr has joined #ruby
Nicmavr is now known as Guest26613
graphene has quit [Remote host closed the connection]
pauliesaint has joined #ruby
graphene has joined #ruby
graphene has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
graphene has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
<konsolebox> i have it bookmarked in the "Refs" folder menu in Bookmarks Toolbar: https://imgur.com/a/rsolsUK
dhollin has joined #ruby
BloopMonster has joined #ruby
graphene has quit [Remote host closed the connection]
dhollin3 has quit [Ping timeout: 260 seconds]
graphene has joined #ruby
<konsolebox> *than use ri
<apeiros> konsolebox: I prefer ri too. but some people seem to prefer online docs. for whatever reasons.
<apeiros> I mean ri has the clear advantage of being in sync with the ruby version you actually use
shinnya has quit [Ping timeout: 276 seconds]
ur5us has joined #ruby
<livcd> i use dash
<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.
<livcd> apeiros: i guess people prefer online docs because they end up googling stuff on the internet anyway
<apeiros> konsolebox: ah, misread you then
<konsolebox> yeah i made i a typo there
rawste has joined #ruby
<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.
<nikivi> if I want to return a value from a method as string, do I print it out?
<apeiros> nikivi: no. printing is not returning.
<nikivi> I read in ruby you don't excplitly return things
<livcd> anyone watched the latest rubykaigi videos ? are we there yet for guilds ?
<nikivi> the last evaluated is returned
<apeiros> nikivi: correct. you can however still explicitly return.
rajdesai has joined #ruby
<livcd> nikivi: just wait when sorbet.rb will be all the rage
graphene has quit [Remote host closed the connection]
<nikivi> livcd whats sorbet.rb?
<nikivi> I googled it got nothing
<nikivi> ?
<livcd> nikivi: typechecker for ruby from Stripe
<nikivi> oh this one?
<nikivi> nvm thats API lol
graphene has joined #ruby
<nikivi> typechecker would be neat indeed
<nikivi> I come to ruby from Go and love static typing
<livcd> it's not public yet afaik. https://sorbet.run
<nikivi> but ruby feels really nice to write in
<nikivi> livcd will it work like Flow for JS?
<nikivi> you annotate the types?
<livcd> looks like
rajdesai has quit [Ping timeout: 244 seconds]
apeiros has quit [Read error: Connection reset by peer]
FernandoBasso has joined #ruby
apeiros has joined #ruby
_whitelogger has joined #ruby
sphenxes has quit [Quit: Leaving]
dhawan has joined #ruby
vonfry_ has joined #ruby
vonfry has quit [Remote host closed the connection]
jraavis has joined #ruby
vonfry has joined #ruby
vonfry_ has quit [Remote host closed the connection]
ebye__ has joined #ruby
lele has quit [Ping timeout: 245 seconds]
lele has joined #ruby
ebye__ has quit [Quit: Lost terminal]
^mtkd has joined #ruby
sylario has joined #ruby
leitz has joined #ruby
mtkd has quit [Ping timeout: 264 seconds]
psychicist__ has joined #ruby
olspookishmagus has quit [Ping timeout: 240 seconds]
RougeR has quit [Ping timeout: 244 seconds]
dhawan has quit [Quit: Leaving.]
jyaworski has quit [Ping timeout: 260 seconds]
olspookishmagus has joined #ruby
olspookishmagus is now known as Guest96065
amelliaa has joined #ruby
jyaworski has joined #ruby
<nikivi> is it possible to know from where the method is being called in ruby?
<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.
<nikivi> And I want to drop the first argument to the method sticky
<nikivi> because all method calls in sticky_w, will have 'w' as first arg
graphene has quit [Read error: Connection reset by peer]
<nikivi> I don't want to repeat it
shinnya has joined #ruby
graphene has joined #ruby
<leitz> nikivi, do you mean "is it possible to know what calls a method, from the method itself?"
<nikivi> leitz yeah
<nikivi> then I can check suffix of method and grab it from there
<nikivi> def sticky_s() -> will get me s
* leitz loves stackoverflow
<nikivi> this is currently executed method
<nikivi> what I want
<leitz> I'm only a beginner in Ruby so have to lean on SO or others here to help.
<leitz> Looks like the smart people are sleeping in. :)
<nikivi> perfect, thanks leitz
* nikivi should learn to Google
* leitz couldn't code without Google...
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
^mtkd has quit []
dhawan has joined #ruby
mtkd has joined #ruby
dhawan has quit [Client Quit]
kapil___ has joined #ruby
amar has quit [Remote host closed the connection]
dhawan has joined #ruby
amar has joined #ruby
AJA4350 has joined #ruby
ur5us has quit [Remote host closed the connection]
* leitz longs for an update to the Pickaxe book.
amar has quit [Ping timeout: 244 seconds]
<nikivi> what are your thoughts on Elixir?
<nikivi> I read that its a faster concurrent ver. of ruby
vonfry has quit [Remote host closed the connection]
amelliaa has quit [Quit: -]
alem0lars has quit [Ping timeout: 264 seconds]
Puffball has joined #ruby
pauliesaint has quit [Ping timeout: 244 seconds]
<leitz> I think Russ Olsen, author of "Eloquent Ruby", really likes Elixir.
<nikivi> def key(sticky_key, action_key, modifiers=nil)
<nikivi> If I do this it means I can skip modifiers in method call?
<nikivi> and it will be nil then
<nikivi> right?
<leitz> Yes.
jamesaxl has joined #ruby
<leitz> Keep in mind that nil is it's own class.
<leitz> Useful for testing, vice "false" or "{}"
rawste has quit [Quit: Sleep....]
<leitz> fred = nil ; fred.nil?
<leitz> My niche for Ruby is to help me have fun learning OOP.
zapata has quit [Ping timeout: 256 seconds]
zapata has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
rajdesai has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
<leitz> Okay, time to get ready for church. Enjoy the day!
leitz has quit [Quit: Nappy time]
Inline has quit [Quit: Leaving]
tty has quit [Quit: tty]
ebye__ has joined #ruby
Inline has joined #ruby
rajdesai has quit [Remote host closed the connection]
rajdesai has joined #ruby
rajdesai has quit [Ping timeout: 244 seconds]
nowhere_man has quit [Ping timeout: 256 seconds]
biberu has joined #ruby
mtkd has quit []
dellavg has joined #ruby
rawste has joined #ruby
amar has joined #ruby
mtkd has joined #ruby
conta has joined #ruby
BloopMonster has quit [Ping timeout: 264 seconds]
mikecmpbll has joined #ruby
amar has quit [Remote host closed the connection]
demistify has joined #ruby
jraavis has quit [Ping timeout: 244 seconds]
kryptoz has joined #ruby
rajdesai has joined #ruby
alem0lars has joined #ruby
rajdesai has quit [Client Quit]
kryptoz has quit [Remote host closed the connection]
ebye__ has quit [Quit: Lost terminal]
mtkd has quit []
kryptoz has joined #ruby
reber has joined #ruby
amar has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
za1b1tsu has quit [Quit: WeeChat 2.1]
za1b1tsu has joined #ruby
Emmanuel_Chanel has joined #ruby
ghoti has quit [Ping timeout: 256 seconds]
Emmanuel_Chanel has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
mtkd has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
ghoti has joined #ruby
fmcgeough has joined #ruby
amar has quit [Remote host closed the connection]
Guest35491 has joined #ruby
amar has joined #ruby
amar has quit [Remote host closed the connection]
bak1an has joined #ruby
Guest35491 has quit [Ping timeout: 264 seconds]
mtkd has quit []
cadillac_ has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has quit [Ping timeout: 248 seconds]
rippa has joined #ruby
cadillac_ has joined #ruby
Asher has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
dhawan has left #ruby [#ruby]
mmattice has quit [Ping timeout: 276 seconds]
Asher has quit [Ping timeout: 268 seconds]
mmattice has joined #ruby
cyberg has quit [Ping timeout: 260 seconds]
cyberg has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
graphene has quit [Remote host closed the connection]
amar has joined #ruby
graphene has joined #ruby
conta has quit [Quit: conta]
mtkd has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
nicht has joined #ruby
mmattice has quit [Ping timeout: 264 seconds]
Es0teric has joined #ruby
mmattice has joined #ruby
soniya29 has joined #ruby
soniya29_ has joined #ruby
lunarkitty7 has quit [Ping timeout: 256 seconds]
cadillac_ has joined #ruby
lightstalker has quit [Ping timeout: 264 seconds]
mtkd has quit []
Mike11 has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
mtkd has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
kryptoz has quit [Remote host closed the connection]
kryptoz has joined #ruby
<nikivi> are modules uppercased in ruby?
<nikivi> or you can lowercase them too?
Asher has joined #ruby
mmattice has quit [Ping timeout: 244 seconds]
mmattice has joined #ruby
spiette has quit [Remote host closed the connection]
Asher has quit [Ping timeout: 248 seconds]
bak1an has quit [Ping timeout: 244 seconds]
BloopMonster has joined #ruby
houhoulis has joined #ruby
<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
bak1an has joined #ruby
nicht has quit [Ping timeout: 240 seconds]
spiette has joined #ruby
<nikivi> I have this code, why can't I do if statement on line 16
<nikivi> basically I want to only assign something to 'modifiers' if to_modifiers is not nil
<nikivi> karabiner-generate.rb:157: syntax error, unexpected =>, expecting keyword_end
<nikivi> 'modifiers' => to_modifiers
<nikivi> I get this erro
apparition has quit [Quit: Bye]
^mtkd has joined #ruby
<nikivi> oh I guess in that if block, the assignment can't take place
<nikivi> what is the best way to do what I want?
<nikivi> right now it assigns null to that field, I don't want that
<nikivi> I don't want to evaluate this line at all if there is nil: 'modifiers' => to_modifiers
<elomatreb> Because Ruby ifs don't work like preprocessor ifs.
<elomatreb> If you want to achieve what you can assign like `h["modifiers"] = ...` in an if after the hash initialization
<nikivi> I can think of a hacky way to wrap the entire thing in if but that's ugly
<nikivi> can you give example of it please?
mtkd has quit [Ping timeout: 255 seconds]
<elomatreb> modified yours: https://hastebin.com/toyaxezeve.rb
<nikivi> this removes the field entirely right?
<nikivi> oh I see now
<elomatreb> It doesn't add it if the condition isn't met, yeah
<nikivi> I was thinking of overwriting it :)
<nikivi> will try now
TheBrayn has quit [Quit: WeeChat 2.1]
<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?
<nikivi> sweet that worked
TheBrayn has joined #ruby
<nikivi> the JSON spec, doesn't accept null value there
<nikivi> it either exists with some value or doesn't
<elomatreb> Ruby will automatically remove null fields
<elomatreb> The JSON serializer, that is
<nikivi> it added null field for me
soniya29_ has quit [Ping timeout: 276 seconds]
soniya29 has quit [Ping timeout: 276 seconds]
<elomatreb> Yeah I misread, sorry
<nikivi> if you look at bottom
<elomatreb> And you have a schema to conform to?
noobineer has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
kryptoz has quit [Remote host closed the connection]
pskosinski has quit [Ping timeout: 260 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
FrankyCyborg has joined #ruby
kryptoz has joined #ruby
pskosinski has joined #ruby
konsolebox has quit [Max SendQ exceeded]
shinnya has quit [Ping timeout: 256 seconds]
konsolebox has joined #ruby
subroot has joined #ruby
<apeiros> >> foo = Module.new; foo::Bar = 1; foo::Bar
<ruby[bot]> apeiros: # => 1 (https://eval.in/1033420)
<apeiros> ^ nikivi, but as elomatreb said, use is limited.
wojnar has joined #ruby
Asher has joined #ruby
nowhere_man has joined #ruby
aldodelgado has joined #ruby
aldodelgado has quit [Client Quit]
dreamthese has quit [Quit: WeeChat 1.4]
BloopMonster has quit [Ping timeout: 256 seconds]
^mtkd has quit []
nicesignal has joined #ruby
wojnar has quit [Quit: Leaving]
cadillac_ has quit [Read error: Connection reset by peer]
noobineer has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
griffindy has joined #ruby
griffindy has quit [Client Quit]
alem0lars has quit [Quit: Leaving]
orbyt_ has joined #ruby
<nikivi> def sticky(held_key, trigger_key, action, from_mandotary_modifiers=[], to_modifiers=[])
<nikivi> I can do this right?
<nikivi> from_mandotary_modifiers if not passed will take value of empty array
<nikivi> same for to_modifiers
<elomatreb> You can, but in order to specify to_modifiers you also have to provide some value for from_mandatory_modifiers
<elomatreb> Alternatively you can use keyword arguments if you want specifying one but not the other to be convenient
<apeiros> +1 kwargs
<apeiros> anything beyond 2 arguments becomes hard to understand with implicit names on caller side. I prefer long code with kwargs there.
<apeiros> and if they're defaultized, I started to use kwargs even for 1 and 2 arg methods.
BloopMonster has joined #ruby
mtkd has joined #ruby
Zaab1t has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MzrE has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fmcgeough has joined #ruby
mroutis has joined #ruby
mtkd has quit []
tdy has quit [Ping timeout: 268 seconds]
leah2 has quit [Ping timeout: 276 seconds]
nowhere_man has quit [Ping timeout: 276 seconds]
tdy has joined #ruby
rawste has quit [Quit: Sleep....]
Emmanuel_Chanel has joined #ruby
guille-moe has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
white_lilies has joined #ruby
ghoti has quit [Ping timeout: 260 seconds]
leah2 has joined #ruby
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #ruby
ghoti has joined #ruby
dviola has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
kryptoz has quit [Remote host closed the connection]
rawste has joined #ruby
chkhanch has quit [Quit: Leaving]
subroot has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
bak1an has joined #ruby
lunarkitty7 has joined #ruby
nowhere_man has joined #ruby
alfiemax has joined #ruby
cadillac_ has quit [Ping timeout: 248 seconds]
cadillac_ has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
starseed0000 has joined #ruby
mroutis has left #ruby [#ruby]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
houhoulis has quit []
MzrE has quit [Read error: Connection reset by peer]
alfiemax has quit [Ping timeout: 264 seconds]
Mike11 has quit [Ping timeout: 240 seconds]
bak1an has joined #ruby
kryptoz has joined #ruby
Dimik has joined #ruby
kryptoz has quit [Remote host closed the connection]
conta has joined #ruby
dviola has quit [Quit: WeeChat 2.1]
mynameisdebian has joined #ruby
dviola has joined #ruby
rawste has quit [Quit: Sleep....]
mynameisdebian has quit [Remote host closed the connection]
mynameisdebian has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
amar has quit [Remote host closed the connection]
phredus has joined #ruby
rawste has joined #ruby
phredus has quit [Client Quit]
jcalla has quit [Quit: Leaving]
guille-moe has quit [Ping timeout: 240 seconds]
Venomen has joined #ruby
Venomen has quit [Changing host]
Venomen has joined #ruby
samosaphile has joined #ruby
za1b1tsu has quit [Ping timeout: 264 seconds]
suukim has quit [Quit: Konversation terminated!]
peirama has joined #ruby
rawste has quit [Ping timeout: 265 seconds]
ByronJohnson has quit [Ping timeout: 260 seconds]
ByronJohnson has joined #ruby
peirama has quit [Quit: WeeChat 1.9.1]
peirama has joined #ruby
_whitelogger has joined #ruby
dviola has quit [Quit: WeeChat 2.1]
sphenxes has joined #ruby
za1b1tsu has joined #ruby
alfiemax has joined #ruby
pauliesaint has joined #ruby
sphenxes has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 256 seconds]
TheBrayn has quit [Quit: WeeChat 2.1]
kapil___ has joined #ruby
wilhelm` has joined #ruby
peirama` has joined #ruby
TheBrayn has joined #ruby
peirama has quit [Quit: WeeChat 1.9.1]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has joined #ruby
peirama` has left #ruby ["ERC (IRC client for Emacs 27.0.50)"]
guille-moe has joined #ruby
cosmopaladin has joined #ruby
alfiemax has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 248 seconds]
peirama has joined #ruby
aiguuu has quit [Quit: leaving]
gell5 has joined #ruby
gell5 has quit [Client Quit]
<nikivi> can someone help think through how one can solve on issue in ruby
<apeiros> there's some chance somebody might
<nikivi> I have this code https://hastebin.com/icitahunez.php
<nikivi> it basically generates JSON that an app then uses to rebind keyboard
<nikivi> there are two methods, shell and key
<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
<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
<nikivi> so I want to create a method multiple_keys but not sure how to go from there really
<nikivi> I was thinking of using key() method somehow
<nikivi> its a bit abstract I know
<Zarthus> so you want a different action if I hold "s" + "g"?
<nikivi> Zarthus this is snippet from previous config https://hastebin.com/ripicikuga.php
<nikivi> what that did was made it so that if you press b, it will insert TODO: in sucession
<Zarthus> I just need help understanding the problem/feature.
<nikivi> so it will trigger T (with shift held, then O (with shift)..
<nikivi> take a look at key() method, see if it makes sense a bit
<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
<nikivi> but this does it for 1 key only
<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?
<nikivi> whatever I define to happen
<nikivi> it can insert o key for example
<Zarthus> so then I'm holding down s, i, and o?
<nikivi> but what I want it to do now is to define s + i to insert todo in succession
<nikivi> no you hold down s, then press i
<nikivi> and o comes on screen
<Zarthus> OK. clear
<nikivi> you can release s after if you want
<nikivi> s is like modifer key
<Zarthus> yeah, that's what i had trouble grokking
<nikivi> so that stuff I can do, one to one mappings
<nikivi> but I have trouble how I can extend it to multiple key calls
<nikivi> I guess I have to use array in some way
<Zarthus> the way I've seen this being done in other applications is event-based. Where you'd send two events instead of one.
<nikivi> but the thing is that those keys can also have modifiers
desperek has joined #ruby
<nikivi> is there a way I can have some complicated arguments in a method call
<nikivi> although not sure that would help
<Zarthus> sure. you can pass a hash, object, or just *args
conta has quit [Quit: conta]
<nikivi> key("q", "l", "l", ["command", "shift"]).key("q", "l", "o", ["command", "shift"]),
<nikivi> I am thinking of going for this kind of API
<nikivi> where I bind calls together with dot
<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
<nikivi> but then that won't work either mm
<nikivi> in what way they are wrong?
<nikivi> limiting sure
<Zarthus> trigger_key only supports a single key
<nikivi> but those args are enough to do the one time binds s + i
<nikivi> there should only be one trigger key thats fine
<nikivi> s + i -> triggers something
<nikivi> but that something currently can be only one keybind called, I want multiple
<nikivi> thats the issue
<Zarthus> calling the method twice would work :P
<nikivi> so key_code should be changed
<nikivi> to array of key_code maybe
ishahnaz has joined #ruby
<nikivi> but I also have to specify modifiers to the key_code (to each one)
<nikivi> currently I do that as two other args
<nikivi> calling the method twice wouldn't work
<nikivi> or well it would if I call it with different arguments but the method calls would be called from original call
<nikivi> fml
guille-moe has quit [Ping timeout: 245 seconds]
alfiemax has joined #ruby
<nikivi> so can I do this somehow?
<nikivi> key("i", "b", "T", ["shift"]).key('O', ['shift']),
graphene has quit [Remote host closed the connection]
guille-moe has joined #ruby
graphene has joined #ruby
pauliesaint has quit [Remote host closed the connection]
pauliesaint has joined #ruby
yokel has quit [Ping timeout: 248 seconds]
cosmopaladin has quit [Ping timeout: 268 seconds]
yokel has joined #ruby
pauliesaint_ has joined #ruby
pauliesaint has quit [Ping timeout: 248 seconds]
pauliesaint_ is now known as pauliesaint
aufi has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
noobineer has joined #ruby
codymj has joined #ruby
megamos has joined #ruby
amar has joined #ruby
aufi has quit [Ping timeout: 244 seconds]
bak1an has joined #ruby
BloopMonster has quit [Ping timeout: 276 seconds]
salasrod has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akaiiro has joined #ruby
guille-moe has quit [Ping timeout: 256 seconds]
pauliesaint has left #ruby [#ruby]
pauliesaint has joined #ruby
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
agent_white has joined #ruby
akaiiro has quit [Ping timeout: 240 seconds]
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
za1b1tsu has quit [Ping timeout: 244 seconds]
willthechill has quit [Ping timeout: 276 seconds]
megamos has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dellavg has quit [Ping timeout: 248 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
Burgestrand has joined #ruby
quobo has joined #ruby
bak1an has joined #ruby
dviola has joined #ruby
samosaphile has quit [Ping timeout: 252 seconds]
ishahnaz has quit []
edwardly has quit [Ping timeout: 260 seconds]
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
akaiiro has joined #ruby
RougeR has joined #ruby
edwardly has joined #ruby
ur5us has joined #ruby
mike_ has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
mike_ is now known as Guest69366
white_lilies has quit [Ping timeout: 256 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest69366 has quit [Client Quit]
claudiuinberlin has joined #ruby
mtkd has joined #ruby
alex`` has quit [Quit: WeeChat 2.1]
dviola has quit [Quit: WeeChat 2.1]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
violentE has joined #ruby
schleppel has quit [Quit: Konversation terminated!]
cyberg has quit [Remote host closed the connection]
AJA4350 has quit [Quit: AJA4350]
FernandoBasso has quit [Quit: Leaving]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
peirama has quit [Quit: WeeChat 1.9.1]
Burgestrand has quit [Quit: Closing time!]
RougeR has quit [Ping timeout: 264 seconds]
orbyt_ has joined #ruby
shinnya has joined #ruby
skryking has joined #ruby
BloopMonster has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
wilhelm` has quit [Remote host closed the connection]
gell5 has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
gell5_ has joined #ruby
gell5 has quit [Ping timeout: 264 seconds]
mtkd has quit []
gell5_ has quit []
leitz has joined #ruby
tdy has joined #ruby
amar has quit [Remote host closed the connection]
biberu has quit []
amar has joined #ruby
noobineer has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
amar has quit [Ping timeout: 244 seconds]
demistify has quit [Ping timeout: 244 seconds]
white_lilies has joined #ruby
akaiiro has quit [Ping timeout: 276 seconds]
Joufflu has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
fmcgeough has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
jrafanie has joined #ruby
bak1an has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
cosmopaladin has joined #ruby
psychicist__ has quit [Ping timeout: 248 seconds]
za1b1tsu has joined #ruby
rwb has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has quit [Ping timeout: 276 seconds]
reber has quit [Remote host closed the connection]
jamesaxl has quit [Quit: WeeChat 2.1]
desperek has quit [Quit: xoxo]
<zenspider> the problem is that you're mixing single and double quoted strings together. that'll never work.
Dimik has quit [Ping timeout: 240 seconds]