web_optimizer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/web_optimizer/version.rb +1 -1
- data/lib/web_stuff/less_to_scss.rb +9 -7
- metadata +2 -2
@@ -4,13 +4,15 @@ module WebStuff
|
|
4
4
|
raise "Invalid less file" unless File.extname(path) == ".less"
|
5
5
|
|
6
6
|
content = File.read(path)
|
7
|
-
content.gsub!(
|
8
|
-
content.gsub!(/\.([\w\-]*\(
|
9
|
-
content.gsub!(
|
10
|
-
content.gsub!("
|
11
|
-
content.gsub!("
|
12
|
-
content.gsub!(
|
13
|
-
content.gsub!(
|
7
|
+
content.gsub!(/@\{?(\w+)\}?/, '$\1')
|
8
|
+
content.gsub!(/\.([\w\-]*)\s*\((.*)\)\s*\{/, '@mixin \1(\2){')
|
9
|
+
content.gsub!(/\.([\w\-]*\(.*\)\s*;)/, '@include \1')
|
10
|
+
content.gsub!(/~"(.*)"/, '\#{\"\1\"}')
|
11
|
+
content.gsub!(/\$import +["\'](.*?)\.less["\']/, '@import "\1.scss"')
|
12
|
+
content.gsub!('$media', '@media')
|
13
|
+
content.gsub!('$keyframes', '@-moz-')
|
14
|
+
content.gsub!('$-o-', '@-o-')
|
15
|
+
content.gsub!('$-webkit-', '@-webkit-')
|
14
16
|
|
15
17
|
Common::Util.write_file(File.join(File.dirname(path), File.basename(path, ".*") + ".scss"), content)
|
16
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_optimizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_support
|