jeanny 0.99.3 → 0.99.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/jeanny/engine.rb +11 -17
  2. metadata +2 -2
data/lib/jeanny/engine.rb CHANGED
@@ -226,32 +226,26 @@ module Jeanny
226
226
  each_string do |value, quote|
227
227
 
228
228
  next unless value.length > 4
229
+ meat = value.dup
229
230
 
230
- value_after = value.dup
231
231
  classes.each do |full_class, short_class|
232
- #while (pos = value_after =~ /#{full_class}(?=[^a-z0-9\-_]|$)/)
233
- #value_after[pos, full_class.length] = short_class
234
- #end
235
- while (pos = value_after =~ /([^#]|^)#{full_class}(?=[^a-z0-9\-_]|$)/)
236
- if $1.nil? or $1.empty?
237
- value_after[pos, full_class.length] = short_class
232
+ while pos = meat =~ /([^#]|^)#{full_class}(?=[^a-z0-9\-_\.\/]|$)/i
233
+ if $1.nil? or $1.empty?
234
+ meat[pos, full_class.length] = short_class
238
235
  else
239
- value_after[pos + 1, full_class.length] = short_class
236
+ meat[pos + 1, full_class.length] = short_class
240
237
  end
241
238
  end
242
239
  end
243
240
 
244
- next if value.eql? value_after
245
-
246
-
247
- data << [value, value_after]
241
+ unless meat.eql? value
242
+ data.push [ "#{quote}#{value}#{quote}", "#{quote}#{meat}#{quote}" ]
243
+ end
248
244
 
249
245
  end
250
-
251
- data.sort_by { |x| x[0].length }.reverse.each do |x|
252
- while (pos = @code =~ /#{Regexp::escape(x[0])}(?=[^a-z0-9\-_]|$)/)
253
- @code[pos, x[0].length] = x[1]
254
- end
246
+
247
+ data.each do |string|
248
+ @code.gsub! /#{string.first}/, string.last
255
249
  end
256
250
 
257
251
  @code
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeanny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.3
4
+ version: 0.99.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - gfranco
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-01 00:00:00 +02:00
12
+ date: 2010-03-23 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies: []
15
15