Class: BeautifulCss::Exec::Css
- Inherits:
-
Object
- Object
- BeautifulCss::Exec::Css
- Defined in:
- lib/beautiful-css/exec.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Css
constructor
A new instance of Css.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Css
Returns a new instance of Css.
5 6 7 8 9 10 11 |
# File 'lib/beautiful-css/exec.rb', line 5 def initialize args if args.length != 1 puts 'usage: beautifulcss [file]' exit 1 end @args = args end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/beautiful-css/exec.rb', line 14 def run file = File.open(@args.first, "rb") input = file.read file.close clean = BeautifulCss::Engine.new(input).render file = File.open(@args.first, "wb") file.puts clean file.close end |