Module: Shine::CSS

Defined in:
lib/shine.rb

Defined Under Namespace

Classes: Compressor

Class Method Summary collapse

Class Method Details

.file(f, options = {}) ⇒ Object



158
159
160
# File 'lib/shine.rb', line 158

def self.file(f, options={})
  self.files(f, options)
end

.files(input_files, options = {}) ⇒ Object



162
163
164
165
166
167
# File 'lib/shine.rb', line 162

def self.files(input_files, options={})
  input_files = [input_files] unless input_files.is_a?(Array)
  input_files.flatten!
  compressor = Shine::CSS::Compressor.new(input_files)
  compressor.compress(options)
end

.in_place(input_file_path) ⇒ Object



145
146
147
148
# File 'lib/shine.rb', line 145

def self.in_place(input_file_path)
  compressor = Shine::CSS::Compressor.new(input_file_path)
  compressor.compress_in_place
end

.string(css, options = {}) ⇒ Object



150
151
152
153
154
155
156
# File 'lib/shine.rb', line 150

def self.string(css, options={})
  begin
    Shine.compress_string(css, :css, options)
  rescue CompressionError
    js
  end
end