havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.0, 2.7.2, 2.6.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3
rprimus has quit [Quit: leaving]
rprimus has joined #ruby
jenrzzz has joined #ruby
Rounin has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
ur5us_ has joined #ruby
thillux has quit [Quit: Leaving]
<nakilon> I wonder if the alpine ruby will be fixed in this century
duderonomy has quit [Ping timeout: 260 seconds]
miojo has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dionysus69 has quit [Quit: Konversation terminated!]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
ebrasca` has quit [Remote host closed the connection]
patr0clus has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TCZ has quit [Quit: Czesc]
patr0clus has joined #ruby
Rudd0 has quit [Ping timeout: 260 seconds]
TCZ has joined #ruby
kinduff has quit [Quit: Ping timeout (120 seconds)]
kinduff has joined #ruby
thecoffemaker has quit [Ping timeout: 246 seconds]
thecoffemaker has joined #ruby
bsdbandit-01 has joined #ruby
wallacer has joined #ruby
wallacer has quit [Max SendQ exceeded]
wallacer has joined #ruby
wallacer has quit [Max SendQ exceeded]
bsdbandit-01 has quit [Read error: Connection reset by peer]
wallacer has joined #ruby
wallacer has quit [Max SendQ exceeded]
wallacer has joined #ruby
wallacer has quit [Max SendQ exceeded]
jinie_ has joined #ruby
Seich_ has joined #ruby
Scientz has joined #ruby
gremax- has joined #ruby
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
Seich has quit [Remote host closed the connection]
jinie has quit [Quit: ZNC 1.8.2 - https://znc.in]
Scient has quit [Quit: ZNC - http://znc.in]
cognemo has quit [Quit: cognemo]
gremax has quit [Quit: Bye]
Scientz is now known as Scient
Seich_ is now known as Seich
justinmcp has joined #ruby
wallacer has joined #ruby
wallacer has quit [Max SendQ exceeded]
wallacer has joined #ruby
wallacer has quit [Max SendQ exceeded]
cognemo has joined #ruby
baojg has joined #ruby
baojg_ has joined #ruby
baojg has quit [Remote host closed the connection]
jenrzzz has joined #ruby
znz_jp has quit [Remote host closed the connection]
Xeago has joined #ruby
znz_jp has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Xeago has quit [Ping timeout: 252 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
tpefreedom has joined #ruby
TCZ has quit [Quit: Czesc]
Xeago has joined #ruby
SoF has quit [Quit: Ping timeout (120 seconds)]
SoF has joined #ruby
contradictioned has quit [Quit: No Ping reply in 180 seconds.]
contradictioned has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
gearnode has quit [Ping timeout: 245 seconds]
nixue has joined #ruby
baojg_ has quit [Remote host closed the connection]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
Nilium has left #ruby [#ruby]
ChmEarl has quit [Quit: Leaving]
Xeago has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
tpefreedom has quit [Remote host closed the connection]
elcuervo has quit [Read error: Connection reset by peer]
Xeago has quit [Ping timeout: 240 seconds]
elcuervo has joined #ruby
baojg has joined #ruby
postmodern has quit [Quit: Leaving]
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
duderonomy has quit [Ping timeout: 265 seconds]
bsdbandit-01 has joined #ruby
duderonomy has joined #ruby
kermit_ has joined #ruby
kermit_ has quit [Changing host]
kermit_ is now known as kermit
bsdbandit-01 has quit [Read error: Connection reset by peer]
Rudd0 has joined #ruby
jenrzzz has joined #ruby
m27frogy has quit [Ping timeout: 245 seconds]
nixue has quit [Quit: Connection closed]
jenrzzz has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
tpefreedom has joined #ruby
bsdbandit-01 has joined #ruby
jenrzzz has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
gix- has joined #ruby
gix has quit [Disconnected by services]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #ruby
ur5us_ has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
roshanavand_ has joined #ruby
roshanavand__ has quit [Ping timeout: 265 seconds]
kinduff has quit [Ping timeout: 265 seconds]
roshanavand__ has joined #ruby
roshanavand_ has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
major_majors has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
major_majors has joined #ruby
Xeago has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
kinduff has joined #ruby
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
dinfuehr has quit [Ping timeout: 276 seconds]
dinfuehr has joined #ruby
bsdbandit-01 has joined #ruby
Xeago has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
Xeago has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
tpefreedom has quit [Quit: Leaving]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
patr0clus has quit [Quit: Textual IRC Client: www.textualapp.com]
dinfuehr has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
dinfuehr has joined #ruby
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
gix- has quit [Ping timeout: 240 seconds]
Xeago has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
cfjk has joined #ruby
dinfuehr has joined #ruby
Furai has quit [Quit: WeeChat 3.1]
Furai has joined #ruby
Xeago has joined #ruby
gigetoo has quit [Ping timeout: 246 seconds]
gigetoo has joined #ruby
Xeago has quit [Ping timeout: 252 seconds]
roadie has joined #ruby
bsdbandit-01 has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
roadie has quit [Quit: ERC (IRC client for Emacs 27.1.91)]
howdoi has quit [Quit: Connection closed for inactivity]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bamdad has quit [Remote host closed the connection]
jenrzzz has joined #ruby
bamdad has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
dputtick has quit [Ping timeout: 258 seconds]
clinth has quit [Read error: Connection reset by peer]
r3my has quit [Write error: Connection reset by peer]
jhill has quit [Read error: Connection reset by peer]
r3my has joined #ruby
clinth has joined #ruby
englishm__ has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
jhill has joined #ruby
dputtick has joined #ruby
englishm__ has joined #ruby
work_ has joined #ruby
feriman has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
ua has quit [Ping timeout: 248 seconds]
Rounin has joined #ruby
maryo87 has joined #ruby
feep[work] has joined #ruby
<feep[work]> hi
<feep[work]> I'm trying to handle options after -- separately in rake
<feep[work]> so I'm trying to replace ARGV with "ARGV values before --"
<feep[work]> but even if I do this near first thing in the rakefile and puts confirms ARGV is empty, rake still tries to build the stuff after the -- as tasks
<feep[work]> background is I'm trying to pass arguments to a rake task and the task['bla bla'] syntax is just terrible
<feep[work]> so I'm trying to get rake task -- bla bla to work
akem has quit [Ping timeout: 252 seconds]
<feep[work]> so rn I think rake saves the ARGV contents somewhere super early and ignores the actual variable; how do I replace the ARGV that rake sees?
<nakilon> I would suggest to stop calling ARGV in your tasks then
<nakilon> and process ARGV into some another array
<feep[work]> that doesn't help
<feep[work]> the problem is that *rake* processes ARGV, not in the rakefile, but in the tool
<nakilon> if it's a single Rakefile all the tasks have the same external namespace where you can init your array
ua has joined #ruby
<feep[work]> ie. if I do rake -- bla, it tries to run bla as a task
TruffleP1mp has joined #ruby
<nakilon> oh
<feep[work]> this even happens if I do ARGV.clear first thing in my rakefile
<nakilon> do you really mean "--" after "rake"? not "rake smth -- ..."?
<feep[work]> yeah it does a default task
<feep[work]> that might be what breaks?
<feep[work]> rake doesn't notice that it's not "really" getting arguments
<feep[work]> it should be seeing "ARGV is empty - let me do the default task"
<nakilon> the latest answer on this topic seems to be https://stackoverflow.com/a/29502094/322020
<nakilon> so it's another syntax to pass the args now
<nakilon> I guess
<feep[work]> yes I am trying to explicitly bypass that garbage fire.
<feep[work]> ... oh, exit at the end
<feep[work]> I see, LOL.
akem has joined #ruby
<feep[work]> that won't work for default tasks, right?
<feep[work]> yeah I'd basically need to replace the task loop completely, like, put a "process_args" at the bottom of every rakefile
<feep[work]> and tell rake, "you think you have [words after --] as tasks - but you are mistaken, forget those"
<feep[work]> but so ie. rake foo -- foo can't work
<feep[work]> that's okay, I probably don't need that
<nakilon> if it's only one task you need you also consider invoking it via ruby, not rake, something like ruby -rrake ... or whatever it is the way to invoke tasks from ruby
feriman has quit [Quit: WeeChat 3.1]
<feep[work]> yeah but I'm not changing that, everyone is used to rake task
<nakilon> I mean nor even -rrake but just "ruby mydefaultraketaskwrapper.rb"
<feep[work]> I think I found a way~ rake will ignore parameters after --, so I just need to take all the stuff after -- and remove it from the task list going backwards
<feep[work]> too bad stock ruby doesn't have Array.split(value) :/
<nakilon> you mean split "--"?
<feep[work]> yep
<nakilon> &>> a = [1,2,3,4,5]; a.take a.index 3
<rubydoc> # => [1, 2] (https://carc.in/#/r/ampa)
<feep[work]> yeah that's what I'm doing, take and drop
<feep[work]> but with split I could do it in one call
hiroaki has joined #ruby
hiroaki1 has joined #ruby
Guest96275 is now known as aloy
<feep[work]> oh, need to add rake_tasks << :default if rake_tasks.empty?
hramrach has quit [Ping timeout: 258 seconds]
vondruch has joined #ruby
<nakilon> feep[work] I added a comment to your gist
<feep[work]> ooh handy, thanks
<feep[work]> nakilon: ah, that doesn't handle :default tho
<feep[work]> I'll do replace tho
<nakilon> yep
<nakilon> I've just edited the loop
<nakilon> I guess it can be even simplier, I didn't dive into your problem enough
<feep[work]> yeah seems likely. it works though, which is more than I thought was possible an hour ago :D
jinie_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
valphilnagel has joined #ruby
jinie has joined #ruby
cd has quit [Quit: cd]
swann11[m] has quit [Quit: Idle for 30+ days]
roshanavand_ has joined #ruby
roshanavand__ has quit [Ping timeout: 246 seconds]
valphilnagel has quit [Quit: Leaving]
gearnode has joined #ruby
teclator has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
Edward123 is now known as EdwardIII
maryo has joined #ruby
maryo87 has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
lockweel has joined #ruby
feep[work] has left #ruby [#ruby]
PaulePanter has quit [Remote host closed the connection]
TruffleP1mp has quit [Ping timeout: 258 seconds]
TrufflePump has joined #ruby
akem has quit [Ping timeout: 240 seconds]
PaulePanter has joined #ruby
Milos has quit [Quit: ZNC 1.8.2 - https://znc.in]
Milos has joined #ruby
naftilos76 has joined #ruby
TrufflePump has quit [Ping timeout: 258 seconds]
zapata has joined #ruby
Guest46767 has quit [Ping timeout: 248 seconds]
TruffleP1mp has joined #ruby
zapata has quit [Client Quit]
zapata has joined #ruby
TruffleP1mp has quit [Ping timeout: 258 seconds]
TrufflePump has joined #ruby
snickers has joined #ruby
m27frogy has joined #ruby
baojg has quit [Remote host closed the connection]
TrufflePump has quit [Ping timeout: 258 seconds]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
gearnode has quit [Ping timeout: 240 seconds]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
baojg has quit [Ping timeout: 258 seconds]
TrufflePump has joined #ruby
gearnode has joined #ruby
TrufflePump has quit [Ping timeout: 258 seconds]
akem has joined #ruby
linuxconformer has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
akem has quit [Ping timeout: 240 seconds]
jonian has joined #ruby
jonian has quit [Remote host closed the connection]
MalkbabY has quit [Remote host closed the connection]
akem has joined #ruby
MalkbabY has joined #ruby
klaas_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
klaas has joined #ruby
asgwq12321 has joined #ruby
<asgwq12321> hi guys, my application wants to receive a file encrypted by a pgp public key, how can i decrypt it? is there a stable gem or something i can use?
vondruch has quit [Ping timeout: 240 seconds]
miojo has joined #ruby
shokohsc has joined #ruby
bamdad has quit [Ping timeout: 240 seconds]
stdedos has joined #ruby
bamdad_ has joined #ruby
Swyper has joined #ruby
jetchisel has quit [Ping timeout: 248 seconds]
linuxconformer has left #ruby [#ruby]
jetchisel has joined #ruby
jenrzzz has joined #ruby
stdedos has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
asgwq12321 has quit [Quit: Connection closed]
cow[moo] has joined #ruby
stdedos has joined #ruby
hramrach has joined #ruby
vondruch has joined #ruby
akem has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
akem has joined #ruby
nixue has joined #ruby
Fire-Dragon-DoL has quit [Ping timeout: 240 seconds]
Technodrome has joined #ruby
Fire-Dragon-DoL has joined #ruby
alexherbo2 has joined #ruby
Iarfen has joined #ruby
GodFather has joined #ruby
work_ has quit [Quit: Connection closed for inactivity]
shtirlic_ has joined #ruby
shtirlic has quit [Ping timeout: 240 seconds]
shtirlic has joined #ruby
cliluw has quit [Ping timeout: 248 seconds]
shtirlic_ has quit [Ping timeout: 240 seconds]
Swyper has quit [Remote host closed the connection]
Swyper_ has joined #ruby
shtirlic_ has joined #ruby
bdnelson has joined #ruby
shtirlic has quit [Ping timeout: 246 seconds]
GodFather has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
Fridtjof has quit [Quit: ZNC - http://znc.in]
Rush has quit [Remote host closed the connection]
RushPL has quit [Remote host closed the connection]
marahin has quit [Ping timeout: 258 seconds]
nyuszika7h has quit [Ping timeout: 240 seconds]
Rush has joined #ruby
nyuszika7h has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
marahin has joined #ruby
marahin has quit [Changing host]
marahin has joined #ruby
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
wald0 has joined #ruby
Swyper_ has quit [Remote host closed the connection]
TCZ has joined #ruby
Fridtjof has joined #ruby
TCZ has quit [Client Quit]
TCZ has joined #ruby
roshanavand__ has joined #ruby
akem has quit [Ping timeout: 265 seconds]
roshanavand_ has quit [Ping timeout: 265 seconds]
cthulchu_ has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
roadie has joined #ruby
iNs has quit [Remote host closed the connection]
j has joined #ruby
iNs has joined #ruby
j is now known as jess
Swyper has joined #ruby
TCZ has quit [Quit: Czesc]
CrazyEddy has quit [Ping timeout: 240 seconds]
roshanavand__ has quit [Ping timeout: 265 seconds]
howdoi has joined #ruby
CrazyEddy has joined #ruby
jenrzzz has joined #ruby
akem has joined #ruby
woodruffw has quit [Ping timeout: 248 seconds]
akem has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
akem has joined #ruby
maryo has quit [Remote host closed the connection]
maryo has joined #ruby
maryo has quit [Remote host closed the connection]
maryo has joined #ruby
ChmEarl has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper_ has joined #ruby
maryo has quit [Ping timeout: 246 seconds]
jordanm has quit [Quit: Konversation terminated!]
jordanm has joined #ruby
TruffleP1mp has joined #ruby
deviantfero has joined #ruby
Swyper_ has quit [Remote host closed the connection]
Xiti has quit [Ping timeout: 240 seconds]
vondruch has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
cd has joined #ruby
ccooke has quit [Ping timeout: 240 seconds]
al2o3-cr has joined #ruby
Swyper has joined #ruby
stdedos has quit [Quit: Connection closed]
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
alexherbo2 has joined #ruby
alexherbo2 has quit [Client Quit]
Xiti has quit [Ping timeout: 265 seconds]
Swyper has quit [Remote host closed the connection]
cliluw has joined #ruby
Swyper has joined #ruby
mwlang has joined #ruby
<mwlang> Anyone know what “Trace!” get mashed together for the Foo implementation, but not for any of the others? https://gist.github.com/mwlang/6182f97ce9bcc5cdd1d4e9551b03f1ba
<mwlang> ugh, that should be, “Does anyone know _WHY_ …” instead of “what” :-/
akem has quit [Ping timeout: 252 seconds]
akem has joined #ruby
Xiti has joined #ruby
jenrzzz has joined #ruby
roadie has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
akem has quit [Ping timeout: 246 seconds]
Rudd0 has quit [Ping timeout: 252 seconds]
roshanavand has quit [Ping timeout: 246 seconds]
BeerLover has joined #ruby
woodruffw has joined #ruby
woodruffw has joined #ruby
akem has joined #ruby
GodFather has joined #ruby
roadie has joined #ruby
adu_ has joined #ruby
BeerLover has quit [Quit: Textual IRC Client: www.textualapp.com]
roshanavand has joined #ruby
<akem> Hey, any idea why on Linux $COLUMNS and $ROW environment variables are not exposed to ENV[] ?
<akem> but $TERM is for example, it's weird.
<akem> I mean $LINES not $ROW
Xiti has quit [Ping timeout: 260 seconds]
<havenwood> akem: Consider using IO.console: require 'io/console'; $stdin.winsize
<havenwood> akem: Are they exported?
<havenwood> akem: export COLUMNS
<leah2> they are not exported, and some software breaks if you export it
<havenwood> I'd suggest IO.console then.
<leah2> took me ages to figure that out :)
<leah2> io/console will also give the *current* size, not the one at start time
akem has quit [Ping timeout: 240 seconds]
<havenwood> leah2: Good point, you'd want to capture size at the time you care about.
<havenwood> akem left, so I'll take that as another happy customer!
<leah2> hehe
<leah2> then i can reveal the ugly solution: eval `resize`.gsub(/export.*/,'')
<jhass> not every possibility is a solution :P
akem has joined #ruby
<leah2> TIMTOWTDI :p
evdubs has quit [Quit: Leaving]
evdubs has joined #ruby
ruurd has joined #ruby
ccooke has joined #ruby
MalkbabY has quit [Remote host closed the connection]
gix has joined #ruby
MalkbabY has joined #ruby
work_ has joined #ruby
ruurd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
mwlang has quit [Quit: mwlang]
tekku has quit [Quit: ZNC - http://znc.in]
tekk has joined #ruby
patr0clus has joined #ruby
naftilos76 has quit [Ping timeout: 260 seconds]
Swyper has quit []
Iarfen has quit [Ping timeout: 240 seconds]
ruurd has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
ruurd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruurd has joined #ruby
jenrzzz has joined #ruby
ruurd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 246 seconds]
patr0clus has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roadie has joined #ruby
<scriptonaut> if I want to join two strings, with join("*\x01"), where it's always a 2-n array, and the last value is a number, how do I join with an escape
<scriptonaut> otherwise, the numbers after the \x01 run into it and it changes the value
roadie has quit [Ping timeout: 258 seconds]
ljarvis__ has quit [Read error: Connection reset by peer]
TruffleP1mp has quit [Ping timeout: 258 seconds]
<leah2> it wont
<leah2> >> [4,5].join("*\x01")
<ruby[bot]> leah2: # => "4*\x015" (https://carc.in/#/r/an6n)
<leah2> >> [4,5].join("*\x01").size
<ruby[bot]> leah2: # => 4 (https://carc.in/#/r/an6p)
<scriptonaut> Ok basically I need to use \x01 to separate two values in a string, then I need to grab the first value (and eventually the second value, like this): "Johnson*\x01\434".match(/(.*)\x01?/)[1]
<scriptonaut> I want to grab "Johnson*"
roshanavand_ has joined #ruby
<leah2> use split maybe?
<scriptonaut> ok
<leah2> >> "Johnson*\x01\434".split("\x01", 2)
<ruby[bot]> leah2: # => ["Johnson*", "\x1C"] (https://carc.in/#/r/an6r)
<leah2> >> "Johnson*\x01\434".split("*\x01", 2)
<ruby[bot]> leah2: # => ["Johnson", "\x1C"] (https://carc.in/#/r/an6s)
<scriptonaut> that worked much better
<scriptonaut> the second value is a number
adu_ has quit [Quit: adu_]
<scriptonaut> "Johnson*\x01\354".split("\x01")
<scriptonaut> that results in ["Johnson*", "\354"]
<scriptonaut> I just need a way to denote "the \x01 is done, the next part is just a new character"
roshanavand has quit [Ping timeout: 252 seconds]
<scriptonaut> escape works, but then my resulting split gives me the weird "\354"
<scriptonaut> huh, it works without the backslash
<scriptonaut> ok thanks, I'll play with this
jenrzzz has joined #ruby
roadie has joined #ruby
roadie has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 252 seconds]
adu_ has joined #ruby
patr0clus has joined #ruby
ruurd has joined #ruby
<jhass> "\354" is an octal escape
<jhass> >> "\354".bytes.first == 0345
<ruby[bot]> jhass: # => false (https://carc.in/#/r/an7t)
adu_ has quit [Quit: adu_]
<jhass> interesting this was true locally
<jhass> oh, nvm
<jhass> >> "\354".bytes.first == 0354
<ruby[bot]> jhass: # => true (https://carc.in/#/r/an7w)
adu_ has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
GodFather has joined #ruby
patr0clus has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
felipec has joined #ruby
<felipec> Is there a simplification for an identity function? ->(x) { x }
adu_ has quit [Quit: adu_]
<jhass> depends on the usage context, there's Object#itself
GodFather has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
patr0clus has joined #ruby
<havenwood> felipec: +1 #itself
<havenwood> &>> :itself.to_proc.call 42
<rubydoc> # => 42 (https://carc.in/#/r/an8w)
<havenwood> &>> 42.itself
<rubydoc> # => 42 (https://carc.in/#/r/an8x)
<felipec> jhass: right... that works
Rudd0 has joined #ruby
<havenwood> &>> Object.instance_method(:itself).bind_call(42)
<rubydoc> # => 42 (https://carc.in/#/r/an8z)
<felipec> :itself is fine, since I want sometimes :itself, and sometimes :to_i
jenrzzz has quit [Ping timeout: 252 seconds]
bdnelson has quit [Quit: Textual IRC Client: www.textualapp.com]
<felipec> Now all I need a way to do object.call(:itself) or something like that
<jhass> this is very X/Y, what's your actual problem?
<felipec> Ahh, send()
<felipec> jhass: I'm doing a fast CSV reader, and I'm passing a converter function for the fields I want to retrieve
<jhass> .send with a literal is pointless :)
<jhass> prefer public_send for public methods
<havenwood> &>> '42'.upto('44').map { |s| s.public_send %i[to_i itself].sample }
<rubydoc> # => [42, "43", "44"] (https://carc.in/#/r/an96)
<felipec> Sometimes I want the field as is (:itself), sometimes I want integers (:to_s), and sometimes I might want something else.
<felipec> Err... :to_i
<havenwood> felipec: How do you know which?
<felipec> havenwood: it's specified manually: fast_csv('data/pppub20.csv', [ 'A_FNLWGT', 'PTOTVAL' ], :to_i).each
<havenwood> felipec: gotcha
<felipec> havenwood: this is my current version that seems to work: https://dpaste.org/YAHi
ruurd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
mozzarella has quit [Ping timeout: 265 seconds]
Azure has quit [Remote host closed the connection]
mozzarella has joined #ruby
ruurd has joined #ruby
alexherbo2 has joined #ruby
miojo has quit [Quit: leaving]
patr0clus has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
patr0clus has joined #ruby
patr0clus has quit [Client Quit]
AkechiShiro has quit [Quit: WeeChat 2.9]
cthulchu_ has quit [Ping timeout: 260 seconds]
AkechiShiro has joined #ruby
Xiti has joined #ruby
patr0clus has joined #ruby
BTRE has quit [Ping timeout: 245 seconds]
TrufflePump has joined #ruby
BTRE has joined #ruby
duderonomy has quit [Ping timeout: 265 seconds]
duderonomy has joined #ruby
cd has quit [Quit: cd]
TCZ has quit [Quit: Czesc]
cd has joined #ruby
ruurd has quit [Ping timeout: 258 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Azure has joined #ruby
felipec has quit [Quit: Leaving]
elcuervo has quit [Ping timeout: 240 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
roshanavand__ has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
roshanavand_ has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
patr0clus has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
Lyubo1 has quit [Ping timeout: 248 seconds]
akem has quit [Ping timeout: 246 seconds]
akem has joined #ruby
lockweel has quit [Quit: Leaving]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #ruby
Xeago has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
work_ has quit [Quit: Connection closed for inactivity]