Skip to content
Browse files

updated README

  • Loading branch information...
1 parent 1ccde44 commit 8baedd4e0be02e2b0da59bff77afe5ab1e137f0d @jeffkreeftmeijer jeffkreeftmeijer committed Dec 2, 2009
Showing with 99 additions and 72 deletions.
  1. +0 −67 README.markdown
  2. +91 −0 README.textile
  3. +1 −1 Rakefile
  4. +7 −4 sprockets-rails.gemspec
View
67 README.markdown
@@ -1,67 +0,0 @@
-`sprockets-rails`
-=================
-
-The `sprockets-rails` plugin sets up your Rails application for use with [Sprockets](http://github.com/sstephenson/sprockets). To install it, first install the `sprockets` RubyGem, then check out a copy of the `sprockets-rails` repository into your `vendor/plugins/` directory. When you run the bundled `install.rb` script, `sprockets-rails` will create two new directories in your application and copy a configuration file into your `config/` directory.
-
-`sprockets-rails` includes a controller named `SprocketsController` that renders your application's Sprockets concatenation. When caching is enabled, e.g. in production mode, `SprocketsController` uses Rails page caching to save the concatenated output to `public/sprockets.js` the first time it is requested. When caching is disabled, e.g. in development mode, `SprocketsController` will render a fresh concatenation any time a source file changes.
-
-To source Sprockets' JavaScript concatenation from your HTML templates, use the provided `sprockets_include_tag` helper.
-
-`sprockets-rails` also includes a set of Rake tasks for generating the concatenation (`rake sprockets:install_script`) and installing provided assets (`rake sprockets:install_assets`). Run `sprockets:install_assets` any time you add or update a Sprockets plugin in your application. Add `after "deploy:update_code", "sprockets:install_script"` as a [Capistrano](http://www.capify.org/) post-deploy hook to generate the Sprockets concatenation on your servers automatically at deploy time.
-
-Here's a walkthrough of the installation process:
-
-1. `gem install --remote sprockets`
-
-2. `script/plugin install git://github.com/sstephenson/sprockets-rails.git`
-
- You now have `app/javascripts/` and `vendor/sprockets/` directories in your application, as well as a `config/sprockets.yml` file.
-
-3. Edit your `config/routes.rb` file to add routes for `SprocketsController`:
-
- ActionController::Routing::Routes.draw do |map|
- # Add the following line:
- SprocketsApplication.routes(map)
- ...
- end
-
-4. Move your JavaScript source files from `public/javascripts/` into `app/javascripts/`. All files in all subdirectories of `app/javascripts/` will be required by Sprockets in alphabetical order, with the exception of `app/javascripts/application.js`, which is required _before any other file_. (You can change this behavior by editing the `source_files` line of `config/sprockets.yml`.)
-
-5. Adjust your HTML templates to call `<%= sprockets_include_tag %>` instead of `<%= javascript_include_tag ... %>`.
-
-Once `sprockets-rails` is installed, you can check out Sprockets plugins into the `vendor/sprockets/` directory. By default, `sprockets-rails` configures Sprockets' load path to search `vendor/sprockets/*/src/`, as well as `vendor/plugins/*/javascripts/`. This means that the `javascripts/` directories of Rails plugins are automatically installed into your Sprockets load path.
-
-## Using multiple sprockets configurations in a project
-
-1. Edit your `config/sprockets.rb` file to name the configurations:
-
- :default:
- :asset_root: public
- :load_path:
- - app/javascripts
- - vendor/sprockets/*/src
- - vendor/plugins/*/javascripts
- :source_files:
- - app/javascripts/application.js
- :special:
- :asset_root: public
- :load_path:
- - app/javascripts
- - vendor/sprockets/*/src
- - vendor/plugins/*/javascripts
- :source_files:
- - app/javascripts/special.js
-
-2. Adjust your HTML templates to call `<%= sprockets_include_tag(:config_name) %>` with the name of the configuration you wish to use.
-
-3. Concatenations are located at `RAILS_ROOT/sprockets/<config_name>.js`, except for the default configuration, whose concatenation located at `RAILS_ROOT/sprockets.js`.
-
-## License
-
-Copyright &copy; 2009 Sam Stephenson.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
91 README.textile
@@ -0,0 +1,91 @@
+h1. Sprockets-rails
+
+Sprockets-rails sets up your Rails application for use with "Sprockets":http://github.com/sstephenson/sprockets/.
+
+h2. Installation
+
+The first thing you need to do is install the Sprockets RubyGem. Just run;
+
+bc. gem install --remote sprockets
+
+For more information about installing and using Sprockets, check out the "Sprockets website":http://getsprockets.org/ and the "Sprockets github project":http://github.com/sstephenson/sprockets.
+
+Sprockets-rails can be installed as a gem or as a plugin;
+
+h3. Installing as a gem
+
+Add this to your @environment.rb@ file;
+
+bc. config.gem 'sprockets-rails', :source => 'http://gemcutter.org'
+
+And run;
+
+bc. rake gems:install
+
+Once the gem is installed, run the generator and you're all set;
+
+bc. script/generate sprockets_rails
+
+The gem is now installed and the required files and folders will be generated into your project.
+
+h3. Installing as a plugin
+
+Run this in the root of your Rails project;
+
+bc. script/plugin install git://github.com/80beans/sprockets-rails.git
+
+The plugin will get installed and the required files and folders will be generated into your project.
+
+h2. Usage
+
+Now you have sprockets-rails installed as a gem or a plugin. You now have @app/javascripts/@ and @vendor/sprockets/@ directories in your application, as well as a @config/sprockets.yml@ file.
+
+Edit your @config/routes.rb@ file to add routes for @SprocketsController@:
+
+bc. ActionController::Routing::Routes.draw do |map|
+ # Add the following line:
+ SprocketsApplication.routes(map)
+ ...
+end
+
+Now, move your JavaScript source files from @public/javascripts/@ into @app/javascripts/@. All files in all subdirectories of @app/javascripts/@ will be required by Sprockets in alphabetical order, with the exception of @app/javascripts/application.js@, which is required _before any other file_. (You can change this behavior by editing the @source_files@ line of @config/sprockets.yml@.)
+
+The last thing you'll have to do is adjust your HTML templates to call @<%= sprockets_include_tag %>@ instead of @<%= javascript_include_tag ... %>@.
+
+Once @sprockets-rails@ is installed, you can check out Sprockets plugins into the @vendor/sprockets/@ directory. By default, @sprockets-rails@ configures Sprockets' load path to search @vendor/sprockets/*/src/@, as well as @vendor/plugins/*/javascripts/@. This means that the @javascripts/@ directories of Rails plugins are automatically installed into your Sprockets load path
+
+h2. Using multiple sprockets configurations in a project
+
+Edit your @config/sprockets.rb@ file to name the configurations:
+
+bc. :default:
+ :asset_root: public
+ :load_path:
+ - app/javascripts
+ - vendor/sprockets/*/src
+ - vendor/plugins/*/javascripts
+ :source_files:
+ - app/javascripts/application.js
+:special:
+ :asset_root: public
+ :load_path:
+ - app/javascripts
+ - vendor/sprockets/*/src
+ - vendor/plugins/*/javascripts
+ :source_files:
+ - app/javascripts/special.js
+
+Now, adjust your HTML templates to call @<%= sprockets_include_tag(:config_name) %>@ with the name of the configuration you wish to use. Concatenations are located at @RAILS_ROOT/sprockets/<config_name>.js@, except for the default configuration, whose concatenation located at @RAILS_ROOT/sprockets.js@.
+
+
+h2. How it works
+
+Sprockets-rails includes a controller named @SprocketsController@ that renders your application's Sprockets concatenation. When caching is enabled, e.g. in production mode, @SprocketsController@ uses Rails page caching to save the concatenated output to @public/sprockets.js@ the first time it is requested. When caching is disabled, e.g. in development mode, @SprocketsController@ will render a fresh concatenation any time a source file changes.
+
+To source Sprockets' JavaScript concatenation from your HTML templates, use the provided @sprockets_include_tag@ helper.
+
+Sprockets-rails also includes a set of Rake tasks for generating the concatenation (@rake sprockets:install_script@) and installing provided assets (@rake sprockets:install_assets@). Run @sprockets:install_assets@ any time you add or update a Sprockets plugin in your application. Add @after "deploy:update_code", "sprockets:install_script"@ as a "Capistrano":http://www.capify.org/ post-deploy hook to generate the Sprockets concatenation on your servers automatically at deploy time.
+
+h2. License
+
+Copyright (c) 2009 Sam Stephenson, released under the MIT license
View
2 Rakefile
@@ -11,7 +11,7 @@ begin
gem.description = %Q{Sprockets JavaScript dependency management and concatenation support for Rails applications}
gem.email = "jeff@80beans.com"
gem.homepage = "http://github.com/80beans/sprockets-rails"
- gem.authors = ["Jeff Kreeftmeijer"]
+ gem.authors = ["Sam Stephenson","Jeff Kreeftmeijer"]
gem.add_dependency 'sprockets', ">= 1.0.2"
end
rescue LoadError
View
11 sprockets-rails.gemspec
@@ -5,20 +5,20 @@
Gem::Specification.new do |s|
s.name = %q{sprockets-rails}
- s.version = "0.0.0"
+ s.version = "0.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Jeff Kreeftmeijer"]
+ s.authors = ["Sam Stephenson", "Jeff Kreeftmeijer"]
s.date = %q{2009-12-02}
s.description = %q{Sprockets JavaScript dependency management and concatenation support for Rails applications}
s.email = %q{jeff@80beans.com}
s.extra_rdoc_files = [
- "README.markdown"
+ "README.textile"
]
s.files = [
".gitignore",
"MIT-LICENSE",
- "README.markdown",
+ "README.textile",
"Rakefile",
"VERSION",
"config/sprockets.yml",
@@ -50,8 +50,11 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<sprockets>, [">= 1.0.2"])
else
+ s.add_dependency(%q<sprockets>, [">= 1.0.2"])
end
else
+ s.add_dependency(%q<sprockets>, [">= 1.0.2"])
end
end

0 comments on commit 8baedd4

Please sign in to comment.
Something went wrong with that request. Please try again.