<nakilon>
I wonder if there are gems and if anyone had a nice experience in using them
coniptor has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
coniptor has joined #ruby
neshpion has quit [Quit: neshpion]
<havenwood>
nakilon: That reminds me of DBM.
<havenwood>
I guess DBM isn't stored in a human-readable format.
<havenwood>
nakilon: I use YAML::DBM from the sdlib from time to time.
<havenwood>
nakilon: Or YAML::Store.
cd has quit [Quit: cd]
<nakilon>
yeah I use yaml::store too -- it feels safe to stop the program at any moment and it won't get corrupted, even if there are several processes open the same file
<nakilon>
but it becomes slow with files of size 30 mb
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 260 seconds]
mangold has joined #ruby
<TzilTzal>
Hi
<TzilTzal>
Is there a way to use a specific collation algorithm to compare strings in ruby?
jenrzzz has joined #ruby
<nakilon>
TzilTzal I doubt, what exactly do you want?
<nakilon>
and do you need this comparison for a sorting?
iNs has quit [Ping timeout: 268 seconds]
iNs has joined #ruby
<TzilTzal>
nakilon: yes. I'd like to compare the same way as postgresql and indeed it's for sorting
centrx has joined #ruby
<nakilon>
TzilTzal I don't remember what are the "psql collation" options but in Ruby you are sopposed to use the Array#sort_by method passing the block that will transform each string before comparison
centrx has quit [Ping timeout: 264 seconds]
JayDoubleu has quit [Ping timeout: 240 seconds]
<TzilTzal>
There's an array of strings so the thing I believe should be done is use the appropriate comparison block... which is why I'm interested in using a specific collation algorithm to compare.
bougyman has quit [Ping timeout: 258 seconds]
JayDoubleu has joined #ruby
bougyman has joined #ruby
<havenwood>
TzilTzal: Sounds like #sort_by, like nakilon mentioned. Does #sort_by work? If not, have a minimal reproduction case with the desired result?
znz_jp has quit [Ping timeout: 240 seconds]
<nakilon>
what is the "specific collation algorithm" you need?
mangold has quit [Ping timeout: 265 seconds]
znz_jp has joined #ruby
mangold has joined #ruby
centrx has joined #ruby
centrx has quit [Ping timeout: 264 seconds]
bougyman has quit [Ping timeout: 240 seconds]
JayDoubleu has quit [Ping timeout: 240 seconds]
JayDoubleu has joined #ruby
dfucci has joined #ruby
bougyman has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
<TzilTzal>
nakilon: anything that would make the same comparison as postgres. I think ICU's standard unicode collation is fairly standard.
bucareli has joined #ruby
dfucci has joined #ruby
mangold has quit [Ping timeout: 264 seconds]
mangold has joined #ruby
dfucci has quit [Ping timeout: 272 seconds]
centrx has joined #ruby
ua_ has quit [Ping timeout: 256 seconds]
coniptor has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
centrx has quit [Ping timeout: 264 seconds]
tannakartikey has joined #ruby
coniptor has joined #ruby
<havenwood>
TzilTzal: Do you want to just have Postgres collate like Ruby or do you need to have Ruby use the Postgres sorting?
<havenwood>
TzilTzal: Would the ffi-icu gem do the trick?
tannakartikey has quit [Remote host closed the connection]
fercell has quit [Ping timeout: 272 seconds]
mangold has joined #ruby
fercell has joined #ruby
yann-kaelig has joined #ruby
tannakartikey has joined #ruby
<yann-kaelig>
Hi
<nakilon>
hi
jenrzzz has joined #ruby
jla has quit [Ping timeout: 272 seconds]
<yann-kaelig>
I wonder if there is a difference between: bundle config --local [....] and bundle config set --local [...] I have seen the both. But also bundle config --local without development:test:aws:kerberos and bundle config --local without development test aws kerberos . I have seen the both too
cd has joined #ruby
<adam12>
yann-kaelig: They are they same.
<adam12>
yann-kaelig: If you pass --local or --global without `set`, bundler just makes it call `set` for you.
<yann-kaelig>
adam12: Hi and big thx, Everything is clear now
jla has joined #ruby
<adam12>
yann-kaelig: yw!
<yann-kaelig>
As a feedback I have a preference for the style " without development:test" than "without development test" The first style being visually less stressful to read
mangold has joined #ruby
scriptonaut has quit [Ping timeout: 272 seconds]
linoge has joined #ruby
m27frogy has joined #ruby
scriptonaut has joined #ruby
fercell has quit [Ping timeout: 240 seconds]
fercell has joined #ruby
coniptor has quit [Ping timeout: 240 seconds]
coniptor has joined #ruby
mangold has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #ruby
Jonopoly has quit [Quit: WeeChat 3.0.1]
burgestrand has joined #ruby
mangold has joined #ruby
vondruch has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
ByronJohnson has quit [Ping timeout: 258 seconds]
ByronJohnson has joined #ruby
mangold has joined #ruby
Rudd0 has quit [Ping timeout: 256 seconds]
nebh^ has quit []
jla has quit [Ping timeout: 240 seconds]
vondruch has quit [Ping timeout: 260 seconds]
ChmEarl has joined #ruby
mangold has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Ping timeout: 265 seconds]
coniptor has quit [Ping timeout: 272 seconds]
mangold has joined #ruby
coniptor has joined #ruby
tannakartikey has quit [Remote host closed the connection]
maroloccio has joined #ruby
CommunistWolf has quit [Remote host closed the connection]
linoge has quit [Remote host closed the connection]
coniptor has quit [Ping timeout: 264 seconds]
linoge has joined #ruby
linoge has quit [Ping timeout: 260 seconds]
coniptor has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jla has joined #ruby
code_zombie has joined #ruby
yasumi2136_ has quit [Quit: Leaving]
yasumi2136 has joined #ruby
deviantfero has quit [Remote host closed the connection]
yasumi2136 has quit [Client Quit]
deviantfero has joined #ruby
dhollinger has quit [Ping timeout: 264 seconds]
<isene>
I can run this on the command line; unzip -qc my_file.pptx | perl -e 'while(<>) {if (@list = ($_ =~ m/\<a:t\>(.+?)\<\/a:t\>/g)) {print "$_\n" for @list}}' BUT when I do this in Ruby; system(%Q[unzip -qc F1_awesome_pres_v5.pptx | perl -e 'while(<>) {if (@list = ($_ =~ m/\<a:t\>(.+?)\<\/a:t\>/g)) {print "$_\n" for @list}}']) I get the error; syntax error at -e line 1, near "m/<a:t>(.+?)</a:" Search
<isene>
pattern not terminated at -e line 1. How do I fix this - or even better how do I achieve the same with ruby as the parser rather than perl?
<isene>
Sorry for the mixup of the filenames, just think of F1_awesome_pres_v5.pptx as my_file.pptx
TCZ has joined #ruby
<isene>
BTW; The point of this is to extract the text from a pptx presentation file
greengriminal has quit [Quit: This computer has gone to sleep]
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
Rounin has joined #ruby
jenrzzz has joined #ruby
AndreYuhai has joined #ruby
<AndreYuhai>
I am trying to set proxy for a class that inherits from Mechanize but it doesn't really set the proxy, what am I doing wrong? https://bpa.st/COHA
DaRock has joined #ruby
<isene>
Basically; How do I convert this from perl to ruby: perl -e 'while(<>) {if (@list = ($_ =~ m/\<a:t\>(.+?)\<\/a:t\>/g)) {print "$_\n" for @list}}'
klaas has quit [Read error: Connection reset by peer]
klaas_ has joined #ruby
ruurd has quit [Ping timeout: 272 seconds]
<MBip[m]>
<isene "Sorry for the mixup of the filen"> You can edit messages. Often that is easier than trying to describe how others can correct errors in their minds.
dhollinger has joined #ruby
TCZ has quit [Quit: Lepsze jest sto rzeczy zrobionych byle jak ni? jedna rzecz zrobiona dobrze]
deviantfero has quit [Ping timeout: 240 seconds]
Technodrome has joined #ruby
Swyper has quit [Remote host closed the connection]
powerhouse_ has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
AndreYuhai has quit [Remote host closed the connection]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Swyper has joined #ruby
dhollin3 has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v4.0 Beta Build (2021/02/17 UTC) 64 Bit]
dhollinger has quit [Ping timeout: 246 seconds]
Tempesta has joined #ruby
<wnd>
isene, for example, ruby -e '$stdin.each_line { |i| i.scan(/<a:t>(.+?)<\/a:t>/).each { |j| puts(j) } }'
<wnd>
I may have overlooked something
cloud69 has joined #ruby
whysthatso has quit [Quit: Ping timeout (120 seconds)]
whysthatso has joined #ruby
jla has quit [Ping timeout: 264 seconds]
fercell has quit [Ping timeout: 256 seconds]
jla has joined #ruby
fercell has joined #ruby
Swyper has quit [Remote host closed the connection]
Xiti has quit [Quit: Leaving]
coniptor has quit [Ping timeout: 240 seconds]
<isene>
wnd: When trying, I get some meta text converted, but it fails when it comes to the slides with; -e:1:in `scan': invalid byte sequence in UTF-8 (ArgumentError)
<isene>
I suspect it is because of the Norwegian ÆØÅ characters. The perl version does not fail.
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #ruby
hiroaki has quit [Ping timeout: 246 seconds]
Xiti has joined #ruby
coniptor has joined #ruby
<isene>
wnd: It fails even when I do this; ruby -e '$stdin.each_line { |i| i.scan(/<a:t>(\p{Word}+?)<\/a:t>/).each { |j| puts(j) } }'
<wnd>
I'm guessing your data has invalid UTF-8 sequence(s). Maybe it's just BOM.
jla has quit [Ping timeout: 260 seconds]
<wnd>
if you're desperate and don't care, you could try i.force_encoding('ISO-8859-1').scan(...), i.force_encoding('ISO-8859-1').encode('UTF-8').scan(...), or something similar
<wnd>
depending on what sort of encoding you expect