# How to generate css file

**URL:** <https://www.ruby-forum.com/t/how-to-generate-css-file/107721>\
**Category:** Ruby-Forum\
**Created:** [June 25, 2007, 6:48pm UTC](https://www.ruby-forum.com/t/how-to-generate-css-file/107721 "2007-06-25T18:48:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luigi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/73ab20/32.png) [@luigi](https://www.ruby-forum.com/u/luigi)\
**Post date:** [June 25, 2007, 6:48pm UTC](https://www.ruby-forum.com/t/how-to-generate-css-file/107721/1 "2007-06-25T18:48:24Z")

</div>

Is it possibile to create with ruby css file to write in  
public/stylesheets?  
Obviously the name of the css file is variable and the internal  
formatting is almost the same.

Thanks!

---

<div class="post-metadata">

**Author:** ![luigi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/73ab20/32.png) [@luigi](https://www.ruby-forum.com/u/luigi)\
**Post date:** [August 7, 2007, 10:31am UTC](https://www.ruby-forum.com/t/how-to-generate-css-file/107721/2 "2007-08-07T10:31:02Z")

</div>

Luigi wrote:

> Is it possibile to create with ruby css file to write in  
> public/stylesheets?  
> Obviously the name of the css file is variable and the internal  
> formatting is almost the same.
> 
> Thanks!

you can use the FileUtils class to create a file. no problem at all:

[http://www.ruby-doc.org/stdlib/libdoc/fileutils/rdoc/index.html](http://www.ruby-doc.org/stdlib/libdoc/fileutils/rdoc/index.html)

shai
