diff --git a/.gitignore b/.gitignore index d3f28944..3c2c5c15 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ pkg/* coverage* docs doc-src/tmp +doc-src/.bundle diff --git a/doc-src/Gemfile b/doc-src/Gemfile index bd4ebe04..06b09167 100644 --- a/doc-src/Gemfile +++ b/doc-src/Gemfile @@ -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' \ No newline at end of file +gem 'coderay' +gem 'haml-edge', :require => 'sass' +gem 'rake' \ No newline at end of file diff --git a/doc-src/Gemfile.lock b/doc-src/Gemfile.lock new file mode 100644 index 00000000..6fa9433a --- /dev/null +++ b/doc-src/Gemfile.lock @@ -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 diff --git a/doc-src/README.markdown b/doc-src/README.markdown index b2c9847a..3d94feeb 100644 --- a/doc-src/README.markdown +++ b/doc-src/README.markdown @@ -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. diff --git a/doc-src/Rakefile b/doc-src/Rakefile index 7839e259..68cd3905 100644 --- a/doc-src/Rakefile +++ b/doc-src/Rakefile @@ -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) diff --git a/doc-src/tasks/generators.thor b/doc-src/tasks/generators.thor index 2e8f3333..1d692cf7 100644 --- a/doc-src/tasks/generators.thor +++ b/doc-src/tasks/generators.thor @@ -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