-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfileor--skip-bundle. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
| UPDATE: Please see some of the forks for an updated version of this guide. I | |
| myself have moved onto the Rails 3.1 betas to get the asset pipeline. But if | |
| you want to stay on stable there are other folks who are keeping this guide | |
| relevant despite the changes constantly occurring on Sprockets 2. The comments | |
| on this gist will lead you to the right forks. :) | |
| Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
| powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
| This stuff will be native in Rails 3.1 and the layout of the files on the |
| Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
| powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
| This stuff will be native in Rails 3.1 and the layout of the files on the | |
| filesystem will be different but this guide will get you working with it | |
| while we wait for all that to finalize. | |
| Ignore the number prefixes on each file. This is just to ensure proper order in the Gist. | |
| It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention |
| /* | |
| CSS to style the placeholder text. | |
| Separate rule for Firefox. | |
| Cannot stack with WebKit's. | |
| */ | |
| input.placeholder_text, | |
| textarea.placeholder_text { | |
| color: #777; | |
| } |
This file at actionpack/lib/sprockets/railtie.rb defines the Sprockets::Railtie, defining another Railtie for Rails. This Railtie is responsible for detecting if the application at-hand is using CoffeeScript, and if so will set config.app_generators.javascript_engine on the application to be :coffee.
Next, this defines an initializer called sprockets.set_configs which sets up ActionController::Base to either use or not use sprockets depending on the configuration option config.assets.enabled.
Finally, this file defines an after_initialize hook for the application which is the real meat of this Railtie. If assets are disabled (with the config.assets.enabled config option set to false) then this after_initialize hook will do nothing.
If assets are enabled then, this initializer first makes a call to an asset_environment protected method near the bottom of this file which requires the sprockets gem, creates a new Sprockets::Environment object, and then co
| namespace :assets do | |
| task :check => :environment do | |
| paths = ["app/assets", "lib/assets", "vendor/assets"] | |
| paths.each do |path| | |
| dir_path = Rails.root + path | |
| if File.exists?(dir_path) | |
| dir_files = File.join(dir_path, "**") |
| /* Flashes | |
| -------------------------------------------------------------- */ | |
| .js #flash { | |
| display: none; | |
| } | |
| #flash { | |
| position: absolute; | |
| width: 100%; | |
| z-index: 10000; |
| require 'rubygems' | |
| require 'eventmachine' | |
| require 'em-http-request' | |
| require 'fiber' | |
| EventMachine.run do | |
| http = EM::HttpRequest.new('http://www.google.com').get | |
| begin | |
| puts "Before" | |
| http.callback { |
| Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
| powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
| This stuff will be native in Rails 3.1 and the layout of the files on the | |
| filesystem will be different but this guide will get you working with it | |
| while we wait for all that to finalize. | |
| Ignore the number prefixes on each file. This is just to ensure proper order in the Gist. | |
| It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention |
| # httperf --server=shark-biggie.borderstylo.com --port=80 --uri=/pie --num-conn 20000 --ra 1500 --hog | |
| httperf --hog --client=0/1 --server=shark-biggie.borderstylo.com --port=80 --uri=/pie --rate=1500 --send-buffer=4096 --recv-buffer=16384 --num-conns=20000 --num-calls=1 | |
| Maximum connect burst length: 148 | |
| Total: connections 20000 requests 20000 replies 15484 test-duration 106.023 s | |
| Connection rate: 188.6 conn/s (5.3 ms/conn, <=16926 concurrent connections) | |
| Connection time [ms]: min 37.2 avg 33363.5 max 96430.5 median 25186.5 stddev 29166.2 | |
| Connection time [ms]: connect 23533.0 | |
| Connection length [replies/conn]: 1.000 |