jzajpt-css_compressor 0.1.2 → 0.1.3
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.
- data/README.rdoc +11 -4
- data/bin/csscomp +11 -7
- data/css_compressor.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -21,13 +21,22 @@ or cloned from:
|
|
21
21
|
|
22
22
|
git://github.com/jzajpt/css_compressor.git
|
23
23
|
|
24
|
-
== USAGE:
|
24
|
+
== LIBRARY USAGE:
|
25
25
|
|
26
|
-
CSS Compressor is fairly simple to use:
|
26
|
+
CSS Compressor object is fairly simple to use:
|
27
27
|
|
28
28
|
csscomp = CssCompressor.new(input_file) # Open & read contents of input file
|
29
29
|
csscomp.compress # Compress read contents of CSS file
|
30
30
|
puts csscomp.compressed_css # Print compressed CSS
|
31
|
+
|
32
|
+
== CSSCOMP TOOL USAGE:
|
33
|
+
|
34
|
+
Csscomp tool compresses all files given as argument:
|
35
|
+
|
36
|
+
csscomp [-p] <css-files>
|
37
|
+
|
38
|
+
-p option causes csscomp to only print statistics and exit.
|
39
|
+
|
31
40
|
|
32
41
|
== LICENSE:
|
33
42
|
|
@@ -53,5 +62,3 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
53
62
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
54
63
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
55
64
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
56
|
-
|
57
|
-
|
data/bin/csscomp
CHANGED
@@ -3,16 +3,20 @@
|
|
3
3
|
require 'css_compressor'
|
4
4
|
|
5
5
|
def usage
|
6
|
-
puts "Usage: csscomp <css-file>"
|
6
|
+
puts "Usage: csscomp [-p] <css-file>"
|
7
|
+
puts " -p - print only statistics, do not procceed with compression"
|
7
8
|
exit
|
8
9
|
end
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
usage if ARGV.size < 1
|
12
|
+
print_only = true if ARGV.delete('-p')
|
12
13
|
|
13
|
-
|
14
|
-
csscomp.
|
14
|
+
ARGV.each do |input_file|
|
15
|
+
csscomp = CssCompressor.new(input_file)
|
16
|
+
print_only ? csscomp.compress : csscomp.compress!
|
15
17
|
|
16
|
-
puts "
|
17
|
-
puts "
|
18
|
+
puts " - #{input_file}"
|
19
|
+
puts "Original size = #{csscomp.original_size}, minimized size = #{csscomp.compressed_size}"
|
20
|
+
puts "Compression ratio = #{csscomp.ratio}"
|
21
|
+
end
|
18
22
|
|
data/css_compressor.gemspec
CHANGED