mini_css 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +15 -3
- data/Rakefile +1 -1
- data/bin/mini_css +16 -8
- data/lib/mini_css.rb +2 -2
- metadata +3 -3
data/README.markdown
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
Minimise your CSS files using by compressing and combining them into one file.
|
2
2
|
Reduce HTTP requests, file size, and save bandwidth.
|
3
|
+
|
4
|
+
`min_css` compresses using [Rainpress](http://code.google.com/p/rainpress/),
|
5
|
+
which is a YUI like CSS compressor built in Ruby, and then merges all the CSS
|
6
|
+
into one file. You can now compress hundreds of CSS files into one file, with
|
7
|
+
one command.
|
8
|
+
|
3
9
|
## Installation
|
4
10
|
|
5
11
|
gem install mini_css
|
@@ -16,10 +22,10 @@ proceedure.
|
|
16
22
|
|
17
23
|
Using `mini_css` from the command line is too simple:
|
18
24
|
|
19
|
-
mini_css [-o output_file] file_name[
|
25
|
+
mini_css [-o output_file] file_name[ file_name2 ...]
|
20
26
|
|
21
|
-
You can compress one CSS file, or compress more than one
|
22
|
-
as one big
|
27
|
+
You can compress one CSS file, or compress more than one, and mash them together
|
28
|
+
as one big compressed file.
|
23
29
|
|
24
30
|
You can specify the location and name of the output file; it defaults to
|
25
31
|
mini_cssified.css in the current working directory.
|
@@ -33,3 +39,9 @@ To use `mini_css` as a class, simply require the right files and you're away.
|
|
33
39
|
|
34
40
|
files = [] # Fill this aray with file paths.
|
35
41
|
Mini_CSS.compress(files) # mini_css will open them all, compress them, and mash them together
|
42
|
+
|
43
|
+
## To-Do
|
44
|
+
|
45
|
+
* Parse out @import statements, try to associate them with local files
|
46
|
+
and compress them into the same files too, removing the @import statements
|
47
|
+
as we go.
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ require 'lib/mini_css'
|
|
12
12
|
|
13
13
|
spec = Gem::Specification.new do |s|
|
14
14
|
s.name = 'mini_css'
|
15
|
-
s.version =
|
15
|
+
s.version = Mini_CSS.version
|
16
16
|
s.has_rdoc = true
|
17
17
|
s.extra_rdoc_files = ['README.markdown']
|
18
18
|
s.summary = 'Minimise your CSS files using by compressing and combining them into one file. Reduce HTTP requests, file size, and save bandwidth.'
|
data/bin/mini_css
CHANGED
@@ -7,18 +7,26 @@ STDOUT.sync = true
|
|
7
7
|
output_location = ARGV[ARGV.index('-o') + 1] if ARGV.include?('-o')
|
8
8
|
output_location ||= File.join(Dir.getwd, 'mini_cssified.css')
|
9
9
|
|
10
|
-
puts 'Saving all compressed CSS in one file at "' + output_location + '"...'
|
11
|
-
|
12
10
|
files = ARGV
|
13
11
|
if files.include?('-o')
|
14
12
|
files.delete_at(files.index('-o') + 1)
|
15
13
|
files.delete_at(files.index('-o'))
|
16
14
|
end
|
17
15
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
unless files.include?('-h') || files.include?('-help') || files.include?('--h') || files.include?('--help') || files.empty?
|
17
|
+
puts 'Saving all compressed CSS in one file at "' + output_location + '"...'
|
18
|
+
|
19
|
+
output = Mini_CSS.compress(files)
|
20
|
+
|
21
|
+
File.open(output_location, 'w+') do |f|
|
22
|
+
f.write(output)
|
23
|
+
end
|
24
|
+
|
25
|
+
puts 'Done!'
|
26
|
+
else
|
27
|
+
puts 'mini_css: usage: mini_css [-o output_css] css_file[ css_file2 ...]'
|
28
|
+
puts ''
|
29
|
+
puts 'Optional flags:'
|
30
|
+
puts ' -o: The path of the file to output the compressed CSS to.'
|
31
|
+
puts ' -h --h -help --help: Show this help info.'
|
22
32
|
end
|
23
|
-
|
24
|
-
puts 'Done!'
|
data/lib/mini_css.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan Kleyn
|