Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

renamed `minimize` to `minimize!` since the string is modified

  • Loading branch information...
commit ed667754b96f825f6a401407f2efbfb9aca2dda9 1 parent c1572a2
@yozhyk authored
View
2  lib/minimize_css.rb
@@ -7,7 +7,7 @@ def initialize(input)
def minimize_to(output)
content = File.open(@input, "r") { |f| f.read }
- minimized_content = Minimizer.minimize(content)
+ minimized_content = Minimizer.minimize!(content)
File.open(output, "w") { |f| f.write(minimized_content) }
end
View
2  lib/minimizer.rb
@@ -1,7 +1,7 @@
module Minimizer
extend self
- def minimize(content)
+ def minimize!(content)
content.gsub!(/\/\*.*\*\//, "")
content.gsub!(/\n(\n)+/, "\n")
content.strip!
View
10 spec/minimizer_spec.rb
@@ -25,7 +25,7 @@
background: #FFF;
}'
- Minimizer.minimize(content).should == minimized_content
+ Minimizer.minimize!(content).should == minimized_content
end
it "should remove lines that consist of comments" do
@@ -42,7 +42,7 @@
padding: 0;
}'
- Minimizer.minimize(content).should == minimized_content
+ Minimizer.minimize!(content).should == minimized_content
end
it "should remove inline comments" do
@@ -59,7 +59,7 @@
padding: 0;
}'
- Minimizer.minimize(content).should == minimized_content
+ Minimizer.minimize!(content).should == minimized_content
end
it "should remove both blank lines and comments" do
@@ -87,7 +87,7 @@
background: #FFF;
}'
- Minimizer.minimize(content).should == minimized_content
+ Minimizer.minimize!(content).should == minimized_content
end
it "should return empty string for a string that consists only of blank lines and comments" do
@@ -103,6 +103,6 @@
minimized_content = ''
- Minimizer.minimize(content).should == minimized_content
+ Minimizer.minimize!(content).should == minimized_content
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.