csswaxer 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -1
- data/VERSION +1 -1
- data/lib/csswaxer.rb +9 -7
- metadata +5 -5
data/README.md
CHANGED
@@ -21,7 +21,10 @@ Ruby command that prettifies CSS files grouping lines by property rather than by
|
|
21
21
|
|
22
22
|
## History ##
|
23
23
|
|
24
|
-
v0.0.
|
24
|
+
v0.0.4 2010/03/31
|
25
|
+
Fixed a bug; now also respects !important statements
|
26
|
+
|
27
|
+
v0.0.3 2010/03/28
|
25
28
|
Fixed a bug; now also works on remote CSS files
|
26
29
|
|
27
30
|
v0.0.1 2010/03/28
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/lib/csswaxer.rb
CHANGED
@@ -30,13 +30,13 @@ module CssWaxer
|
|
30
30
|
selector[:rules].each_declaration do |property, value, importance|
|
31
31
|
# Clean recognized properties, leave untouched the remaining ones
|
32
32
|
if css_properties.include?(property) && !value.nil?
|
33
|
-
if same_value = appeared_values[property].assoc(value)
|
33
|
+
if same_value = appeared_values[property].assoc([value, importance])
|
34
34
|
same_value << selectors
|
35
35
|
else
|
36
|
-
appeared_values[property] << [value, selectors]
|
36
|
+
appeared_values[property] << [[value, importance], selectors]
|
37
37
|
end
|
38
38
|
else
|
39
|
-
unrecognized_properties << [property, value, selectors]
|
39
|
+
unrecognized_properties << [property, value, importance, selectors]
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -49,16 +49,18 @@ module CssWaxer
|
|
49
49
|
next if appeared_values[property].empty?
|
50
50
|
puts "\n/* #{property} */"
|
51
51
|
appeared_values[property].each do |p|
|
52
|
-
value = p.shift
|
53
|
-
|
52
|
+
value, importance = p.shift
|
53
|
+
important = " !important" if importance
|
54
|
+
puts "#{p.join(", ")}\t{#{property}: #{value}#{important}}"
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
58
59
|
unless unrecognized_properties.empty?
|
59
60
|
puts titleize("others")
|
60
|
-
unrecognized_properties.each do |property, value, selectors|
|
61
|
-
|
61
|
+
unrecognized_properties.each do |property, value, importance, selectors|
|
62
|
+
important = " !important" if importance
|
63
|
+
puts "#{selectors}\t{#{property}: #{value}#{important}}"
|
62
64
|
end
|
63
65
|
end
|
64
66
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Claudio Baccigalupo
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-31 00:00:00 +02:00
|
18
18
|
default_executable: csswaxer
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
version: 1.0.1
|
32
32
|
type: :runtime
|
33
33
|
version_requirements: *id001
|
34
|
-
description:
|
34
|
+
description: CSS files are written with a focus on selectors, so that all properties related to a tag, class or id are grouped together. This makes it hard to a have a clear overview of the style; for instance which colors and fonts are used in the whole site. CSS Waxer reorganizes CSS files focusing on properties, so that every font-related property is packed together, followed by colors, backgrounds, layouts and so on.
|
35
35
|
email: claudiob@gmail.com
|
36
36
|
executables:
|
37
37
|
- csswaxer
|
@@ -77,6 +77,6 @@ rubyforge_project:
|
|
77
77
|
rubygems_version: 1.3.6
|
78
78
|
signing_key:
|
79
79
|
specification_version: 3
|
80
|
-
summary: Command-line tool that makes stylesheet files more readable, grouping lines by property (typography, color, layout,
|
80
|
+
summary: "Command-line tool that makes stylesheet files more readable, grouping lines by property (typography, color, layout, \xE2\x80\xA6) rather than by selector"
|
81
81
|
test_files: []
|
82
82
|
|