floror

Activity Graph

Page 1 of 1

2016-02-16

[01:33:30] floror: has joined #RubyOnRails
[01:33:30] floror: has joined #ruby
[01:35:57] floror: has left #RubyOnRails: ()
[01:36:26] floror: has joined #RubyOnRails
[01:37:41] floror: has left #RubyOnRails: ()
[01:38:03] floror: Client Quit
[01:38:18] floror: has joined #RubyOnRails
[01:38:18] floror: has joined #ruby
[01:38:44] floror: has left #RubyOnRails: ()
[01:38:58] floror: has left #ruby: ()
[01:39:05] floror: has joined #RubyOnRails
[01:39:37] floror: Client Quit

2016-02-14

[04:52:28] floror: has joined #RubyOnRails
[04:52:28] floror: has joined #ruby
[08:35:30] floror: Quit: floror

2016-02-13

[01:26:31] floror: has left #RubyOnRails: ()
[01:26:36] floror: has joined #RubyOnRails
[01:27:13] floror: Quit: floror
[03:53:47] floror: has joined #RubyOnRails
[03:53:47] floror: has joined #ruby
[07:23:25] floror: Quit: floror
[08:37:51] floror: has joined #RubyOnRails
[08:37:51] floror: has joined #ruby
[09:16:34] floror: Quit: floror
[09:23:25] floror: has joined #RubyOnRails
[09:23:25] floror: has joined #ruby
[12:10:27] floror: Quit: floror
[17:17:50] floror: has joined #RubyOnRails
[17:17:50] floror: has joined #ruby
[17:56:24] floror: Quit: floror
[20:10:59] floror: has joined #RubyOnRails
[20:10:59] floror: has joined #ruby
[23:00:22] floror: Quit: floror

2016-02-12

[10:17:25] floror: Quit: floror
[14:47:25] floror: has joined #RubyOnRails
[14:47:25] floror: has joined #ruby
[14:47:48] floror: Client Quit
[15:35:16] floror: has joined #RubyOnRails
[15:35:16] floror: has joined #ruby
[15:39:26] floror: Ping timeout: 240 seconds
[17:33:16] floror: has joined #ruby
[17:33:17] floror: has joined #RubyOnRails
[17:52:11] floror: Quit: floror
[20:32:57] floror: has joined #RubyOnRails
[20:32:57] floror: has joined #ruby
[21:29:27] floror: Quit: floror
[21:47:29] floror: has joined #RubyOnRails
[21:47:29] floror: has joined #ruby
[21:52:06] floror: Client Quit
[22:06:58] floror: has joined #RubyOnRails
[22:06:58] floror: has joined #ruby

2016-02-10

[00:01:02] floror: has joined #RubyOnRails
[00:01:02] floror: has joined #ruby
[00:12:21] floror: Quit: floror
[00:20:50] floror: has joined #RubyOnRails
[00:20:50] floror: has joined #ruby
[08:38:17] floror: Quit: floror
[09:03:46] floror: has joined #RubyOnRails
[09:03:46] floror: has joined #ruby
[09:10:12] floror: Quit: floror
[09:25:19] floror: has joined #RubyOnRails
[09:25:19] floror: has joined #ruby
[11:22:59] floror: Quit: floror
[12:58:26] floror: has joined #RubyOnRails
[12:58:26] floror: has joined #ruby
[14:31:29] floror: Quit: floror
[15:30:05] floror: has joined #RubyOnRails
[15:30:05] floror: has joined #ruby
[15:43:30] floror: Quit: floror
[20:15:55] floror: has joined #RubyOnRails
[20:15:55] floror: has joined #ruby

2016-02-09

[02:10:51] floror: has joined #RubyOnRails
[02:10:51] floror: has joined #ruby
[09:45:03] floror: Quit: floror
[18:26:04] floror: has joined #RubyOnRails
[18:26:04] floror: has joined #ruby
[20:55:59] floror: Quit: floror
[21:58:04] floror: has joined #RubyOnRails
[21:58:04] floror: has joined #ruby
[23:52:26] floror: Quit: floror

2016-02-08

[01:00:01] floror: Client Quit
[01:00:19] floror: has joined #RubyOnRails
[01:00:19] floror: has joined #ruby
[01:03:19] floror: Is there a way to match, format, and replace a value using gsub? Like this `"My name is Olo".gsub(/My (\w+) is (\w+)/) {|a, b| "#{a} #{b}".upcase } # => "NAME OLO"`
[01:03:47] floror: It looks from the docs like gsub doesn???t support groups, so is there another way?
[01:08:57] floror: tobiasvl: In this case yet. But the `value` variable can contain much more information, like ???ABC My name is Olo DEF??? => ???ABC NAME OLO DEF???
[01:09:04] floror: *In this case, yes
[01:10:13] floror: toretore: Does that work with `scan`?
[01:10:29] floror: I need to repeate this until there???s nothing more to replace
[01:11:24] floror: toretore: I???m wring a question on SO atm, it???s a bit compilcated to explain as this is part of a preprocessor
[01:12:43] floror: $ looks scary to use, is that really thread safe?
[01:13:40] floror: Aha, I didn???t know that
[01:14:00] floror: Hold on, I???ll gist the code I???ve now
[01:21:29] floror: Here???s is what I???ve right now https://gist.github.com/oleander/7593235de6b6d6f93445
[01:22:15] floror: The idea is to store matches to prevent the formater (in this case String#downcase) to affect certain parts of my original value
[01:27:51] floror: Did that make any sense?
[01:32:12] floror: volty: Yes, that???s correct.
[01:32:54] floror: So I want to preserve by replacing with something generic, run trough a filter, then restore the match
[01:34:49] floror: volty: That???s already what I???m doing, but it???s a bit buggy
[01:39:59] floror: volty: The match should be processed/formated in some way, on the example i posted ** is added around the match
[01:40:14] floror: Hence the name, pre-processor :)
[01:41:35] floror: volty: I need to access the match inside the block provided to `adjust!`. The problem is that I can???t access the groups
[01:42:15] floror: volty: The code is part of a much bugger class, that???s why it has its own class
[01:43:09] floror: Why would that help?
[01:43:59] floror: This is not a ???start???. It has been running in production for over a year. It???s backup by over 50 specs
[01:44:25] floror: That???s the minimum working code I would come up with
[01:45:01] floror: It has to preserve the @store state, that???s why this particular snipet still exists inside a class
[01:46:11] floror: volty: The main problem with the code is this line: https://gist.github.com/oleander/7593235de6b6d6f93445#file-pre-processor-rb-L9
[01:46:43] floror: `scan` matches one line, but gsub/sub effects the whole string
[01:47:51] floror: volty: First of all, do you understand the problem I???m trying to solve?
[01:49:31] floror: volty: So I want to ensure that certain parts of the original string is temp. removed and later placed back again at the same position.
[01:49:52] floror: Let???s start with that
[01:50:54] floror: That???s quite simple. I can use gsub for that.
[01:52:17] floror: That would yield ???MY NAME IS Volty De Qua???
[01:52:44] floror: hehe, yeah
[01:52:58] floror: That???s simple todo with just an index and gsub
[01:56:08] floror: Now imagen that you also want to, before restoring (or rollback as you called it), process ???Volty De Qua???. by say making the first and last word downcase. s = "My name is Volty De Qua"; orig = preserve(/(Volty) De (Qua)/) {|a, b| "#{a.downcase} #{b.downcase}"} s.downcase!; rollback(orig); "MY NAME IS volty qua"
[01:59:44] floror: volty: gsub doesn???t suport groups
[02:00:51] floror: volty: /(Volty) De (Qua)/ contains two groups
[02:03:41] floror: Yeah, I think I???m making things over complicated
[02:03:50] floror: I???ll do some changes and see if the specs passes
[02:04:21] floror: Ox0dea: Not sure that???s correct, but I*ll try it
[09:39:47] floror: Quit: floror
[10:03:28] floror: has joined #RubyOnRails
[10:03:28] floror: has joined #ruby
[11:29:28] floror: Quit: floror
[14:27:16] floror: has joined #RubyOnRails
[14:27:16] floror: has joined #ruby
[14:51:47] floror: Quit: floror
[14:54:06] floror: has joined #RubyOnRails
[14:54:06] floror: has joined #ruby
[15:22:19] floror: Quit: floror
[20:38:54] floror: has joined #RubyOnRails
[20:38:54] floror: has joined #ruby
[23:56:14] floror: Quit: floror