00:00
crespire1 has quit [Ping timeout: 240 seconds]
00:02
crespire has quit [Killed (NickServ (GHOST command used by crespire1!crespire@user/crespire))]
00:02
crespire1 has joined #ruby
00:12
Guest20 has joined #ruby
00:12
Guest20 has quit [Client Quit]
00:14
roshanavand has quit [Ping timeout: 256 seconds]
00:27
roadie has joined #ruby
00:40
roadie has quit [Ping timeout: 248 seconds]
00:40
kaivai has joined #ruby
00:41
kaivai has quit [Client Quit]
00:43
kaivai has joined #ruby
01:00
roadie has joined #ruby
01:05
roadie has quit [Ping timeout: 248 seconds]
01:08
gr33n7007h has quit [Ping timeout: 240 seconds]
01:10
gr33n7007h has joined #ruby
01:18
roadie has joined #ruby
01:21
Pixi` has joined #ruby
01:25
Pixi has quit [Ping timeout: 268 seconds]
01:29
roadie has quit [Ping timeout: 248 seconds]
01:44
<
adam12 >
ruby -s -e 'p $abc' -- -abc=foo
01:44
<
adam12 >
huh interesting.
01:56
<
adam12 >
Kind of an interesting alternative to env variables, tho maybe using full on optionparser might be better.
01:57
<
mooff >
if you read the help for the ruby command it sounds like they wanted it to be like awk or sed
01:57
<
adam12 >
Does -s come from awk/sed? I had to look at the tests for -s to figure out what the heck it does. The help doesn't really explain it.
01:57
<
adam12 >
At least cursory.
01:57
<
adam12 >
-s enable some switch parsing for switches after script name
01:57
<
mooff >
there are lots of little supporting flags like that. there's some constant that means "list of data from args or stdin"
01:58
<
adam12 >
_some_ switch parsing?
01:58
<
mooff >
separate to ARGF and ARGV
01:58
<
mooff >
ARGF is already a big one
01:58
<
mooff >
lol yes, some
02:00
<
adam12 >
I just wonder if it could be phrased better.
02:00
<
mooff >
i don't know about -s
02:00
<
mooff >
but there's -i:
02:01
<
mooff >
% ruby -p -i.bak -e '$_.upcase!' /tmp/junk
02:02
<
mooff >
(-i for "edit file in place". i guess -i.bak means that, and also make a .bak file first)
02:02
<
adam12 >
Oh, yeah. Those aren't new to me.
02:02
<
mooff >
what is -p?
02:02
<
adam12 >
Specifically, -s was.
02:02
<
mooff >
acts the same as -n.
02:02
<
mooff >
what on earth is -n?!
02:02
<
mooff >
this is the only reason i don't use these lol
02:02
<
mooff >
i can't remember it every time
02:02
<
adam12 >
LOL. I use them, but I did Perl back in early 2000's so there is lots of carry over.
02:03
<
mooff >
yeah. i love the mix of paradigms in Ruby
02:04
<
adam12 >
There was a talk from Hashicorp about testing, and one of the things they do is have a -golden flag to re-record things (I think I'm remembering correctly). But what was elegant about that was just at the top of the test file was flags.Flag("-golden", "Re-record") or something. One single line.
02:04
<
mooff >
did i say i've gone back to writing "for foo in bar" instead of foo.each do |bar| ?
02:04
<
adam12 >
It was just beautiful. I think the -s can kind of get you similar, but it won't show up in help.
02:05
<
adam12 >
Minitest hijacks optionparser anyways...
02:05
<
mooff >
adam12: that sounds like flag.Flag from Go
02:05
<
mooff >
which yes is lovely
02:05
<
adam12 >
Really? I wouldn't do it. Enumerable is life.
02:05
<
mooff >
for x in is based on .each
02:05
<
mooff >
once i saw that i was hooked
02:06
<
mooff >
it even highlights better in the editor
02:06
<
adam12 >
That might fly on my own projects, but on some teams I engage with, it's hard enough just teaching Enumerable.
02:06
<
adam12 >
Which is unfortunate because the chaining of Enumerable is super elegant.
02:07
<
mooff >
in Go you don't have to think about flag parsing
02:07
<
mooff >
in Ruby or Python, there are literally 3 built in ways
02:07
<
adam12 >
What are the other two?
02:08
<
mooff >
with similar but different arguments and method names
02:10
<
mooff >
maybe i'm 'hallucinating'. i thought optparse and OptionParser were two different libs
02:10
<
mooff >
with getoptlong to go with them
02:11
<
adam12 >
Oh yes. I forgot about getoptlong. I don't recall seeing it in use in a very long time.
02:11
<
mooff >
yeah, i was wrong
02:11
<
adam12 >
optparse and OptionParser is annoying.
02:11
<
adam12 >
There needs to be an optionparser.rb shim that requires optparse.
02:13
<
adam12 >
Maybe. I wonder what the stance is on that.
02:13
<
adam12 >
Ohh. Maybe one already exists.
02:13
<
adam12 >
>> require "optionparser"
02:13
<
mooff >
imagine a tui that made Ruby consoles look like Smalltalk
02:14
<
mooff >
but for live introspection / repling of the system
02:14
<
mooff >
= require "optionparser"
02:15
ruby-eval has joined #ruby
02:16
<
mooff >
= %w(optparse optionparser).map { require _1 rescue :error }
02:17
<
mooff >
= %w(optparse optionparser).map { require _1 rescue :error }
02:17
<
ruby-eval >
=> [true, true]
02:17
crespire has joined #ruby
02:18
<
adam12 >
May 2014 it was added. I guess my memory is fuzzy.
02:20
crespire1 has quit [Ping timeout: 268 seconds]
02:21
goldfish has quit [Remote host closed the connection]
02:36
roadie has joined #ruby
02:41
ghostl has joined #ruby
02:44
<
mooff >
what if classes could be included like modules can
02:45
<
mooff >
a class could be simply a module with an initialize method in
02:48
roadie has quit [Ping timeout: 248 seconds]
02:56
kaivai has joined #ruby
02:58
crespire1 has joined #ruby
02:58
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
02:59
jhass has quit [Ping timeout: 246 seconds]
03:00
jhass has joined #ruby
03:56
desnudopenguino has quit [Ping timeout: 240 seconds]
03:56
roadie has joined #ruby
04:09
roadie has quit [Ping timeout: 248 seconds]
04:31
Pixi` is now known as Pixi
04:48
grenierm has joined #ruby
04:51
immiss97 has joined #ruby
04:54
ghostl has quit [Ping timeout: 264 seconds]
04:55
immiss97 has quit [Ping timeout: 265 seconds]
05:00
roadie has joined #ruby
05:06
jhass has quit [Ping timeout: 240 seconds]
05:09
jhass has joined #ruby
05:09
rvalue has quit [Ping timeout: 265 seconds]
05:12
roadie has quit [Ping timeout: 248 seconds]
05:20
rvalue has joined #ruby
05:24
roadie has joined #ruby
07:03
ghostl has joined #ruby
07:13
grenierm has quit [Quit: Client closed]
07:38
crespire has joined #ruby
07:38
crespire1 has quit [Ping timeout: 240 seconds]
07:55
sagax has quit [Remote host closed the connection]
08:00
___nick___ has joined #ruby
08:10
_ht has joined #ruby
08:29
ghostl has quit [Ping timeout: 268 seconds]
08:33
___nick___ has joined #ruby
08:34
___nick___ has quit [Client Quit]
08:36
___nick___ has joined #ruby
08:55
jvalleroy has joined #ruby
09:13
weaksauce has quit [Ping timeout: 256 seconds]
09:17
weaksauce has joined #ruby
09:26
infinityfye has joined #ruby
09:50
roshanavand has joined #ruby
10:22
rvalue has quit [Read error: Connection reset by peer]
10:22
rvalue has joined #ruby
10:32
roshanavand has quit [Ping timeout: 268 seconds]
11:02
gr33n7007h has quit [Ping timeout: 256 seconds]
11:04
gr33n7007h has joined #ruby
11:19
ollysmith has joined #ruby
11:24
gr33n7007h has quit [Ping timeout: 240 seconds]
11:26
gr33n7007h has joined #ruby
11:42
ollysmith has joined #ruby
11:48
gasbag has joined #ruby
11:48
gasbag has quit [Remote host closed the connection]
12:37
mark22k has left #ruby [#ruby]
12:44
Sankalp- has joined #ruby
12:45
Sankalp has quit [Ping timeout: 264 seconds]
12:45
Sankalp- is now known as Sankalp
13:02
infinity_fye has joined #ruby
13:05
infinityfye has quit [Ping timeout: 240 seconds]
13:26
ghostl has joined #ruby
13:41
ghostl has quit [Ping timeout: 240 seconds]
14:50
MalusVulgaris has joined #ruby
15:12
hwpplayer1 has joined #ruby
15:23
desnudopenguino has joined #ruby
15:37
jhass has quit [Quit: Bye]
15:46
jhass has joined #ruby
15:53
MalusVulgaris has quit [Remote host closed the connection]
16:05
goldfish has joined #ruby
16:37
hwpplayer1 has quit [Ping timeout: 240 seconds]
16:57
tomtmym has joined #ruby
16:57
tomtmym has quit [Changing host]
16:57
tomtmym has joined #ruby
17:13
hwpplayer1 has joined #ruby
17:20
Tempesta has quit [Quit: See ya!]
17:26
Tempesta has joined #ruby
17:37
infinityfye_ has joined #ruby
17:39
infinity_fye has quit [Ping timeout: 240 seconds]
18:03
goldfish has quit [Remote host closed the connection]
18:49
sam113102 has joined #ruby
18:52
sam113101 has quit [Ping timeout: 240 seconds]
18:52
sam113102 is now known as sam113101
19:30
johnjaye has quit [Quit: WeeChat 4.0.0-dev]
19:45
johnjaye has joined #ruby
20:03
___nick___ has quit [Ping timeout: 240 seconds]
20:04
sshock has joined #ruby
20:04
sshock has left #ruby [#ruby]
20:53
roshanavand has joined #ruby
20:56
infinityfye_ has quit [Quit: Leaving]
20:58
hwpplayer1 has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.2)]
21:19
roadie has quit [Ping timeout: 248 seconds]
21:21
roadie has joined #ruby
21:26
roadie has quit [Ping timeout: 248 seconds]
21:39
roshanavand has quit [Ping timeout: 240 seconds]
21:51
roadie has joined #ruby
22:00
ruby[bot] has quit [Remote host closed the connection]
22:00
ruby[bot] has joined #ruby
22:01
roadie has quit [Ping timeout: 248 seconds]
22:18
tomtmym has quit [Quit: Gone.]
22:26
c10l has quit [Quit: See ya! o/]
22:27
c10l has joined #ruby
22:28
roadie has joined #ruby
22:39
roadie has quit [Ping timeout: 248 seconds]
23:04
roadie has joined #ruby
23:10
roadie has quit [Ping timeout: 248 seconds]
23:21
roadie has joined #ruby
23:32
roadie has quit [Ping timeout: 248 seconds]
23:50
desnudopenguino1 has joined #ruby
23:53
desnudopenguino has quit [Ping timeout: 240 seconds]
23:53
desnudopenguino1 is now known as desnudopenguino
23:59
roadie has joined #ruby