Skip to content

Commit

Permalink
Merge pull request thoughtbot#34 from thoughtbot/use-rake-to-generate…
Browse files Browse the repository at this point in the history
…-bourbon

Use Rake to generate Bourbon for non-Rails use.
  • Loading branch information
mike-burns committed Nov 16, 2011
2 parents 1d187fe + 6461f7f commit 376ded3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 35 deletions.
12 changes: 12 additions & 0 deletions Rakefile
@@ -1,2 +1,14 @@
require 'bundler'
Bundler::GemHelper.install_tasks

directory 'bourbon/lib'

desc "Generate bourbon directory for use outside Rails"
task :generate => 'bourbon/lib' do
FileUtils.cp_r(Dir['app/assets/stylesheets/*'], 'bourbon/')
FileUtils.cp_r(Dir['lib/*'], 'bourbon/lib/')

FileUtils.rm_r('bourbon/lib/tasks')
FileUtils.rm('bourbon/lib/bourbon/engine.rb')
FileUtils.rm('bourbon/lib/bourbon/version.rb')
end
22 changes: 0 additions & 22 deletions generate-bourbon.sh

This file was deleted.

22 changes: 9 additions & 13 deletions readme.md
Expand Up @@ -7,10 +7,12 @@ Bourbon uses SCSS syntax.
Sass 3.1+

# Install for Rails
Update your Gemfile
In your Gemfile:

gem 'bourbon'

And run:

$ bundle install

## Rails 3.1.x
Expand Down Expand Up @@ -48,26 +50,20 @@ Import the mixins at the beginning of your stylesheet
rake bourbon:install[app/stylesheets]

# Install without Rails
The following script will generate a *bourbon* directory and convert all .css.scss to .scss extensions. The *bourbon* directory is for 'sass --watch' use outside of rails.

**Step 1**: Clone this repo and `cd` into the directory.

**Step 2:** Make the `generate-bourbon.sh` script executable:

chmod a+x generate-bourbon.sh
Bourbon includes an easy way to generate a directory with all the necessary files.

**Step 3:** Run it:

./generate-bourbon.sh
rake generate

**Step 4:** Move the generated `bourbon` directory into your project's sass directory, e.g. `stylesheets/sass/`
This will create a `bourbon` directory that can be used by `sass --watch`. Move
the generated directory into your project's sass directory, e.g. `stylesheets/sass/`.

**Step 5:** To output properly, Bourbon must be explicitly required (`-r`) by Sass at the command line:
To output properly, Bourbon must be explicitly required (`-r`) by Sass at the command line:

# Example (project root directory)
sass --watch stylesheets/sass:stylesheets -r ./stylesheets/sass/bourbon/lib/bourbon.rb

In this case as well, you will need to import the mixins at the beginning of your stylesheet:
In this case, you will need to import the mixins at the beginning of your stylesheet:

@import 'bourbon/bourbon';

Expand Down

0 comments on commit 376ded3

Please sign in to comment.