Switch to bundler 0.9 for docs.

This commit is contained in:
Chris Eppstein 2010-03-06 22:30:39 -08:00
parent eb6f2b5bbf
commit c01faf7714
6 changed files with 109 additions and 27 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ pkg/*
coverage*
docs
doc-src/tmp
doc-src/.bundle

View File

@ -1,6 +1,6 @@
disable_system_gems
source :gemcutter
gem 'nanoc3', :require_as => false
gem 'nanoc3', :require => false
gem 'rdiscount'
gem 'thor'
gem 'rack'
@ -8,4 +8,6 @@ gem 'mime-types'
gem 'fssm'
gem 'serve'
gem 'nokogiri'
gem 'coderay'
gem 'coderay'
gem 'haml-edge', :require => 'sass'
gem 'rake'

79
doc-src/Gemfile.lock Normal file
View File

@ -0,0 +1,79 @@
---
dependencies:
fssm:
group:
- :default
version: ">= 0"
rake:
group:
- :default
version: ">= 0"
thor:
group:
- :default
version: ">= 0"
serve:
group:
- :default
version: ">= 0"
mime-types:
group:
- :default
version: ">= 0"
rack:
group:
- :default
version: ">= 0"
nanoc3:
group:
- :default
version: ">= 0"
require: []
rdiscount:
group:
- :default
version: ">= 0"
coderay:
group:
- :default
version: ">= 0"
haml-edge:
group:
- :default
version: ">= 0"
require:
- sass
nokogiri:
group:
- :default
version: ">= 0"
specs:
- nokogiri:
version: 1.4.1.1
- coderay:
version: 0.9.1
- haml-edge:
version: 2.3.155
- activesupport:
version: 2.3.5
- rdiscount:
version: 1.5.8
- nanoc3:
version: 3.0.9
- rack:
version: 1.1.0
- serve:
version: 0.10.0
- mime-types:
version: "1.16"
- thor:
version: 0.13.4
- rake:
version: 0.8.7
- fssm:
version: 0.1.3
hash: 8d69b94ae57d013d95d60dd554ffc9f6fa2529e4
sources:
- Rubygems:
uri: http://gemcutter.org

View File

@ -49,7 +49,7 @@ If you are adding an asset (E.g. image, css, javascript) place the file(s) in th
Running the following command will generate a new example:
./bin/thor generate:example blueprint/grid/simple/
bundle exec thor generate:example blueprint/grid/simple/
An example consists of three files:
@ -74,7 +74,7 @@ After adding the example and adjusting the metadata, go to the reference page an
Generate a reference file for a stylesheet:
./bin/thor generate:reference ../frameworks/compass/stylesheets/_compass.sass
bundle exec thor generate:reference ../frameworks/compass/stylesheets/_compass.sass
The item metadata (at the top of the file) provides some details about what stylesheet is being documented. For instance, here is the metadata for the blueprint color module item:
@ -117,16 +117,15 @@ If you encounter any problems, there's usually some people around to help at #co
* The git installer for OSX can be found here: http://code.google.com/p/git-osx-installer/
* A basic knowledge of git
Make sure you are running the latest version of the Compass and Haml gems:
Make sure that you have RubyGems v1.3.6 or greater:
$ sudo gem install compass --pre
$ sudo gem install haml-edge
$ gem -v
If that doesn't work, RubyGems is probably out of date, try:
$ sudo gem update --system
You will also need the bundler gem, so if you don't have it:
You will need the bundler gem, so if you don't have it:
$ gem install bundler
@ -144,12 +143,6 @@ Go to your fork of Compass on github. Your compass fork will be available on htt
$ git clone git@github.com:**yourusername**/compass.git
It's important that you have the haml source tree at the same directory level as compass. In the same directory that you git cloned Compass, make a git clone of Haml:
$ git clone git://github.com/nex3/haml.git
If your Compass Fork lives in Sites/compass, haml should live in Sites/haml.
### 3. Switch to the docs branch
To work on the docs, you need to do a checkout of the docs branch
@ -167,28 +160,26 @@ If you haven't yet done so, install bundler:
Bundle the gems for this application:
$ cd doc-src
$ gem bundle
Your new app executables for this app are located in the bin/ directory.
$ bundle install
### 6. Compile the docs
To compile (and auto recompile) and preview the site in your browser: (make sure you run nanoc3/aco from the doc-src directory)
$ cd doc-src
$ export RUBYLIB="../lib:../../haml/lib"
$ bin/nanoc3 aco
$ export RUBYLIB="../lib"
$ bundle exec nanoc3 aco
Then open `http://localhost:3000/docs/` in your web browser.
aco stands for autocompiler; the site will recompile every time you request a new page.
If you find `bin/nanoc3 aco` to be sluggish, try this alternative workflow:
If you find `bundle exec nanoc3 aco` to be sluggish, try this alternative workflow:
$ cd doc-src
$ export RUBYLIB="../lib:../../haml/lib"
$ /bin/serve 3000 .. &
$ rake watch
$ export RUBYLIB="../lib"
$ bundle exec serve 3000 .. &
$ bundle exec rake watch
It is recommended that you read the 5 minute [tutorial](http://nanoc.stoneship.org/tutorial/) on Nanoc.

View File

@ -1,4 +1,13 @@
require File.join(File.dirname(__FILE__), 'vendor/gems/environment')
begin
# Try to require the preresolved locked set of gems.
require File.expand_path('../.bundle/environment', __FILE__)
rescue LoadError
# Fall back on doing an unlocked resolve at runtime.
require "rubygems"
require "bundler"
Bundler.setup
end
require 'nanoc3/tasks'
$: << "lib"
@ -36,7 +45,7 @@ task :watch do
rebuild_site.call(nil,nil)
puts ">>> Watching for Changes <<<"
puts "Run: ./bin/serve .."
puts "Run: bundle exec serve .."
monitor = FSSM::Monitor.new
monitor.path("#{File.dirname(__FILE__)}/content", '**/*') do
update(&rebuild_site)

View File

@ -49,7 +49,7 @@ class Generate < Thor
| /* And the source is shown to the user as Sass and as CSS. */
EXAMPLE
example_file.puts example_contents.gsub(/^ +\| /, '')
puts "./bin/nanoc3 co && open http://localhost:3000/docs/examples/#{identifier} && ./bin/nanoc3 aco"
puts "bundle exec nanoc3 co && open http://localhost:3000/docs/examples/#{identifier} && bundle exec nanoc3 aco"
end
end