mini_css 0.0.1 → 0.0.2

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 (5) hide show
  1. data/README.markdown +15 -3
  2. data/Rakefile +1 -1
  3. data/bin/mini_css +16 -8
  4. data/lib/mini_css.rb +2 -2
  5. metadata +3 -3
@@ -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[, file_name2, ...]
25
+ mini_css [-o output_file] file_name[ file_name2 ...]
20
26
 
21
- You can compress one CSS file, or compress more than one to mash them together
22
- as one big compress file.
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 = '0.0.1'
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.'
@@ -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
- output = Mini_CSS.compress(files)
19
-
20
- File.open(output_location, 'w+') do |f|
21
- f.write(output)
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!'
@@ -3,7 +3,7 @@ require 'rainpress'
3
3
 
4
4
  class Mini_CSS
5
5
  def self.version
6
- '0.0.1'
6
+ '0.0.2'
7
7
  end
8
8
 
9
9
  def self.compress(files)
@@ -17,4 +17,4 @@ class Mini_CSS
17
17
 
18
18
  output.join("\n\n")
19
19
  end
20
- end
20
+ end
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Kleyn