railties 3.1.0.rc8 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,12 @@
1
1
  = Railties -- Gluing the Engine to the Rails
2
2
 
3
- Railties is responsible to glue all frameworks together. Overall, it:
3
+ Railties is responsible for gluing all frameworks together. Overall, it:
4
4
 
5
- * handles all the bootstrapping process for a Rails application;
5
+ * handles the bootstrapping process for a Rails application;
6
6
 
7
- * manages rails command line interface;
7
+ * manages the +rails+ command line interface;
8
8
 
9
- * provides Rails generators core;
9
+ * and provides Rails generators core.
10
10
 
11
11
 
12
12
  == Download
@@ -1,6 +1,6 @@
1
1
  h2. Asset Pipeline
2
2
 
3
- This guide covers the ideology of the asset pipeline introduced in Rails 3.1.
3
+ This guide covers the asset pipeline introduced in Rails 3.1.
4
4
  By referring to this guide you will be able to:
5
5
 
6
6
  * Understand what the asset pipeline is and what it does
@@ -30,7 +30,7 @@ It is recommended that you use the defaults for all new apps.
30
30
 
31
31
  h4. Main Features
32
32
 
33
- The first feature of the pipeline is to concatenate assets. This is important in a production environment, as it reduces the number of requests that a browser must make to render a web page. While Rails already has a feature to concatenate these types of assetsi -- by placing +:cache => true+ at the end of tags such as +javascript_include_tag+ and +stylesheet_link_tag+ -- many people do not use it.
33
+ The first feature of the pipeline is to concatenate assets. This is important in a production environment, as it reduces the number of requests that a browser must make to render a web page. While Rails already has a feature to concatenate these types of assets -- by placing +:cache => true+ at the end of tags such as +javascript_include_tag+ and +stylesheet_link_tag+ -- many people do not use it.
34
34
 
35
35
  The default behavior in Rails 3.1 and onward is to concatenate all files into one master file each for JS and CSS. However, you can separate files or groups of files if required (see below). In production, an MD5 fingerprint is inserted into each filename so that the file is cached by the web browser but can be invalidated if the fingerprint is altered.
36
36
 
@@ -135,7 +135,7 @@ Otherwise, Sprockets looks through the available paths until it finds a file tha
135
135
  If you want to use a "css data URI":http://en.wikipedia.org/wiki/Data_URI_scheme -- a method of embedding the image data directly into the CSS file -- you can use the +asset_data_uri+ helper.
136
136
 
137
137
  <plain>
138
- #logo { background: url(<%= asset_data_uri 'logo.png' %>)
138
+ #logo { background: url(<%= asset_data_uri 'logo.png' %>) }
139
139
  </plain>
140
140
 
141
141
  This inserts a correctly-formatted data URI into the CSS source.
@@ -145,7 +145,7 @@ h5. CSS and ERB
145
145
  If you add an +erb+ extension to a CSS asset, making it something such as +application.css.erb+, then you can use the +asset_path+ helper in your CSS rules:
146
146
 
147
147
  <plain>
148
- .class{background-image:<%= asset_path 'image.png' %>}
148
+ .class { background-image: <%= asset_path 'image.png' %> }
149
149
  </plain>
150
150
 
151
151
  This writes the path to the particular asset being referenced. In this example, it would make sense to have an image in one of the asset load paths, such as +app/assets/images/image.png+, which would be referenced here. If this image is already available in +public/assets+ as a fingerprinted file, then that path is referenced.
@@ -277,7 +277,7 @@ Rails comes bundled with a rake task to compile the manifests to files on disc.
277
277
  The rake task is:
278
278
 
279
279
  <plain>
280
- rake assets:precompile
280
+ bundle exec rake assets:precompile
281
281
  </plain>
282
282
 
283
283
  Capistrano (v2.8.0+) has a recipe to handle this in deployment. Add the following line to +Capfile+:
@@ -131,6 +131,10 @@ Ruby on Rails Guides
131
131
  <%= guide("Caching with Rails", 'caching_with_rails.html', :work_in_progress => true) do %>
132
132
  <p>Various caching techniques provided by Rails.</p>
133
133
  <% end %>
134
+
135
+ <%= guide('Asset Pipeline', 'asset_pipeline.html') do %>
136
+ <p>This guide documents the asset pipeline.</p>
137
+ <% end %>
134
138
  </dl>
135
139
 
136
140
  <h3>Extending Rails</h3>
@@ -5,7 +5,7 @@
5
5
  <head>
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
7
 
8
- <title><%= yield(:page_title) || 'Ruby on Rails guides' %></title>
8
+ <title><%= yield(:page_title) || 'Ruby on Rails Guides' %></title>
9
9
 
10
10
  <link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
11
11
  <link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
@@ -71,6 +71,7 @@
71
71
  <dd><a href="configuring.html">Configuring Rails Applications</a></dd>
72
72
  <dd><a href="command_line.html">Rails Command Line Tools and Rake Tasks</a></dd>
73
73
  <dd><a href="caching_with_rails.html">Caching with Rails</a></dd>
74
+ <dd><a href="asset_pipeline.html">Asset Pipeline</a></dd>
74
75
 
75
76
  <dt>Extending Rails</dt>
76
77
  <dd><a href="plugins.html">The Basics of Creating Rails Plugins</a></dd>
@@ -39,11 +39,12 @@ module Rails
39
39
  @assets.prefix = "/assets"
40
40
  @assets.version = ''
41
41
  @assets.debug = false
42
- @assets.allow_debugging = false
43
-
44
- @assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/" ]
45
- @assets.js_compressor = nil
46
- @assets.css_compressor = nil
42
+ @assets.compile = true
43
+ @assets.digest = false
44
+ @assets.manifest = "#{root}/public#{@assets.prefix}"
45
+ @assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/" ]
46
+ @assets.js_compressor = nil
47
+ @assets.css_compressor = nil
47
48
  end
48
49
 
49
50
  def compiled_asset_path
@@ -207,8 +207,8 @@ module Rails
207
207
  # Gems used only for assets and not required
208
208
  # in production environments by default.
209
209
  group :assets do
210
- gem 'sass-rails', #{options.dev? || options.edge? ? " :git => 'git://github.com/rails/sass-rails.git', :branch => '3-1-stable'" : " ~> 3.1.0.rc".inspect}
211
- gem 'coffee-rails', #{options.dev? || options.edge? ? ":git => 'git://github.com/rails/coffee-rails.git', :branch => '3-1-stable'" : "~> 3.1.0.rc".inspect}
210
+ gem 'sass-rails', #{options.dev? || options.edge? ? " :git => 'git://github.com/rails/sass-rails.git', :branch => '3-1-stable'" : " ~> 3.1.0".inspect}
211
+ gem 'coffee-rails', #{options.dev? || options.edge? ? ":git => 'git://github.com/rails/coffee-rails.git', :branch => '3-1-stable'" : "~> 3.1.0".inspect}
212
212
  gem 'uglifier'
213
213
  end
214
214
  GEMFILE
@@ -52,6 +52,9 @@ module <%= app_const_base %>
52
52
  <% unless options.skip_sprockets? -%>
53
53
  # Enable the asset pipeline
54
54
  config.assets.enabled = true
55
+
56
+ # Version of your assets, change this if you want to expire all your assets
57
+ config.assets.version = '1.0'
55
58
  <% end -%>
56
59
  end
57
60
  end
@@ -25,9 +25,6 @@
25
25
  # Do not compress assets
26
26
  config.assets.compress = false
27
27
 
28
- # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
29
- config.assets.allow_debugging = true
30
-
31
28
  # Expands the lines which load the assets
32
29
  config.assets.debug = true
33
30
  end
@@ -14,6 +14,15 @@
14
14
  # Compress JavaScripts and CSS
15
15
  config.assets.compress = true
16
16
 
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
17
26
  # Specifies the header that your server uses for sending files
18
27
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
19
28
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
@@ -3,7 +3,7 @@ module Rails
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
5
  TINY = 0
6
- PRE = "rc8"
6
+ PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940593
5
- prerelease: true
4
+ hash: 3
5
+ prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
9
  - 0
10
- - rc8
11
- version: 3.1.0.rc8
10
+ version: 3.1.0
12
11
  platform: ruby
13
12
  authors:
14
13
  - David Heinemeier Hansson
@@ -16,8 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-08-29 00:00:00 -03:00
20
- default_executable:
18
+ date: 2011-08-31 00:00:00 Z
21
19
  dependencies:
22
20
  - !ruby/object:Gem::Dependency
23
21
  name: rake
@@ -90,13 +88,12 @@ dependencies:
90
88
  requirements:
91
89
  - - "="
92
90
  - !ruby/object:Gem::Version
93
- hash: 977940593
91
+ hash: 3
94
92
  segments:
95
93
  - 3
96
94
  - 1
97
95
  - 0
98
- - rc8
99
- version: 3.1.0.rc8
96
+ version: 3.1.0
100
97
  type: :runtime
101
98
  version_requirements: *id005
102
99
  - !ruby/object:Gem::Dependency
@@ -107,13 +104,12 @@ dependencies:
107
104
  requirements:
108
105
  - - "="
109
106
  - !ruby/object:Gem::Version
110
- hash: 977940593
107
+ hash: 3
111
108
  segments:
112
109
  - 3
113
110
  - 1
114
111
  - 0
115
- - rc8
116
- version: 3.1.0.rc8
112
+ version: 3.1.0
117
113
  type: :runtime
118
114
  version_requirements: *id006
119
115
  description: "Rails internals: application bootup, plugins, generators, and rake tasks."
@@ -317,7 +313,6 @@ files:
317
313
  - lib/rails/commands/profiler.rb
318
314
  - lib/rails/commands/runner.rb
319
315
  - lib/rails/commands/server.rb
320
- - lib/rails/commands/tags
321
316
  - lib/rails/commands/update.rb
322
317
  - lib/rails/commands.rb
323
318
  - lib/rails/configuration.rb
@@ -532,7 +527,6 @@ files:
532
527
  - lib/rails/generators/rails/generator/templates/templates/.empty_directory
533
528
  - lib/rails/generators/rails/plugin_new/templates/app/mailers/.empty_directory
534
529
  - lib/rails/generators/rails/plugin_new/templates/app/models/.empty_directory
535
- has_rdoc: true
536
530
  homepage: http://www.rubyonrails.org
537
531
  licenses: []
538
532
 
@@ -556,18 +550,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
556
550
  required_rubygems_version: !ruby/object:Gem::Requirement
557
551
  none: false
558
552
  requirements:
559
- - - ">"
553
+ - - ">="
560
554
  - !ruby/object:Gem::Version
561
- hash: 25
555
+ hash: 3
562
556
  segments:
563
- - 1
564
- - 3
565
- - 1
566
- version: 1.3.1
557
+ - 0
558
+ version: "0"
567
559
  requirements: []
568
560
 
569
561
  rubyforge_project:
570
- rubygems_version: 1.3.7
562
+ rubygems_version: 1.8.8
571
563
  signing_key:
572
564
  specification_version: 3
573
565
  summary: Tools for creating, working with, and running Rails applications.
@@ -1,113 +0,0 @@
1
- !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
- !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
- !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
- !_TAG_PROGRAM_NAME Exuberant Ctags //
5
- !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
- !_TAG_PROGRAM_VERSION 5.8 //
7
- AppGenerator application.rb /^ class AppGenerator$/;" c class:Rails.Generators
8
- Application application.rb /^ module Application$/;" m class:Rails.Commands
9
- Commands application.rb /^ module Commands$/;" m class:Rails
10
- Commands plugin.rb /^module Commands$/;" m
11
- Commands runner.rb /^ module Commands$/;" m class:Rails
12
- Console console.rb /^ class Console$/;" c class:Rails
13
- DBConsole dbconsole.rb /^ class DBConsole$/;" c class:Rails
14
- Generators application.rb /^ module Generators$/;" m class:Rails
15
- Info plugin.rb /^ class Info$/;" c class:Commands
16
- Install plugin.rb /^ class Install$/;" c class:Commands
17
- Options server.rb /^ class Options$/;" c class:Rails.Server
18
- Plugin plugin.rb /^ class Plugin$/;" c class:Commands
19
- Plugin plugin.rb /^class Plugin$/;" c
20
- Rails application.rb /^module Rails$/;" m
21
- Rails console.rb /^module Rails$/;" m
22
- Rails dbconsole.rb /^module Rails$/;" m
23
- Rails runner.rb /^module Rails$/;" m
24
- Rails server.rb /^module Rails$/;" m
25
- RailsEnvironment plugin.rb /^class RailsEnvironment$/;" c
26
- RecursiveHTTPFetcher plugin.rb /^class RecursiveHTTPFetcher$/;" c
27
- Remove plugin.rb /^ class Remove$/;" c class:Commands
28
- Runner runner.rb /^ module Runner$/;" m class:Rails.Commands
29
- Server server.rb /^ class Server < ::Rack::Server$/;" c class:Rails
30
- application.rb application.rb 1;" F
31
- benchmarker.rb benchmarker.rb 1;" F
32
- best_install_method plugin.rb /^ def best_install_method$/;" f class:RailsEnvironment
33
- console.rb console.rb 1;" F
34
- dbconsole.rb dbconsole.rb 1;" F
35
- default plugin.rb /^ def self.default$/;" F class:RailsEnvironment
36
- default plugin.rb /^ def self.default=(rails_env)$/;" F class:RailsEnvironment
37
- default_options server.rb /^ def default_options$/;" f class:Rails.Server
38
- destroy.rb destroy.rb 1;" F
39
- determine_install_method plugin.rb /^ def determine_install_method$/;" f class:Commands.Install
40
- download plugin.rb /^ def download(link)$/;" f class:RecursiveHTTPFetcher
41
- environment= plugin.rb /^ def environment=(value)$/;" f class:Commands.Plugin
42
- execute application.rb /^ def self.execute(app_path, argv)$/;" F class:Rails.Commands.Application
43
- execute runner.rb /^ def self.execute(app_path, argv)$/;" F class:Rails.Commands.Runner
44
- exit_on_failure application.rb /^ def self.exit_on_failure?$/;" F class:Rails.Generators.AppGenerator
45
- externals plugin.rb /^ def externals$/;" f class:RailsEnvironment
46
- externals= plugin.rb /^ def externals=(items)$/;" f class:RailsEnvironment
47
- fetch plugin.rb /^ def fetch(links = @urls_to_fetch)$/;" f
48
- fetch_dir plugin.rb /^ def fetch_dir(url)$/;" f
49
- find plugin.rb /^ def self.find(dir=nil)$/;" F class:RailsEnvironment
50
- find plugin.rb /^ def self.find(name)$/;" F class:Plugin
51
- find_cmd dbconsole.rb /^ def find_cmd(*commands)$/;" f
52
- generate.rb generate.rb 1;" F
53
- git_url? plugin.rb /^ def git_url?$/;" f class:Plugin
54
- guess_name plugin.rb /^ def guess_name(url)$/;" f
55
- info plugin.rb /^ def info$/;" f class:Plugin
56
- initialize console.rb /^ def initialize(app)$/;" f class:Rails.Console
57
- initialize dbconsole.rb /^ def initialize(app)$/;" f class:Rails.DBConsole
58
- initialize plugin.rb /^ def initialize$/;" f class:Commands.Plugin
59
- initialize plugin.rb /^ def initialize(base_command)$/;" f class:Commands.Info
60
- initialize plugin.rb /^ def initialize(base_command)$/;" f class:Commands.Install
61
- initialize plugin.rb /^ def initialize(base_command)$/;" f class:Commands.Remove
62
- initialize plugin.rb /^ def initialize(dir)$/;" f class:RailsEnvironment
63
- initialize plugin.rb /^ def initialize(uri, name = nil)$/;" f class:Plugin
64
- initialize plugin.rb /^ def initialize(urls_to_fetch, level = 1, cwd = ".")$/;" f class:RecursiveHTTPFetcher
65
- initialize server.rb /^ def initialize(*)$/;" f class:Rails.Server
66
- install plugin.rb /^ def install(method=nil, options = {})$/;" f class:Plugin
67
- install plugin.rb /^ def install(name_uri_or_plugin)$/;" f class:RailsEnvironment
68
- install_using_checkout plugin.rb /^ def install_using_checkout(options = {})$/;" f class:Plugin
69
- install_using_export plugin.rb /^ def install_using_export(options = {})$/;" f class:Plugin
70
- install_using_externals plugin.rb /^ def install_using_externals(options = {})$/;" f class:Plugin
71
- install_using_git plugin.rb /^ def install_using_git(options = {})$/;" f
72
- install_using_http plugin.rb /^ def install_using_http(options = {})$/;" f class:Plugin
73
- installed? plugin.rb /^ def installed?$/;" f class:Plugin
74
- links plugin.rb /^ def links(base_url, contents)$/;" f class:RecursiveHTTPFetcher.ls
75
- log_path server.rb /^ def log_path$/;" f class:Rails.Server
76
- ls plugin.rb /^ def ls$/;" f class:RecursiveHTTPFetcher
77
- middleware server.rb /^ def middleware$/;" f class:Rails.Server
78
- opt_parser server.rb /^ def opt_parser$/;" f class:Rails.Server
79
- options plugin.rb /^ def options$/;" f class:Commands.Info
80
- options plugin.rb /^ def options$/;" f class:Commands.Install
81
- options plugin.rb /^ def options$/;" f class:Commands.Plugin
82
- options plugin.rb /^ def options$/;" f class:Commands.Remove
83
- parse plugin.rb /^ def self.parse!(args=ARGV)$/;" F class:Commands.Plugin
84
- parse! plugin.rb /^ def parse!(args)$/;" f class:Commands.Info
85
- parse! plugin.rb /^ def parse!(args)$/;" f class:Commands.Install
86
- parse! plugin.rb /^ def parse!(args)$/;" f class:Commands.Remove
87
- parse! plugin.rb /^ def parse!(args=ARGV)$/;" f class:Commands.Plugin
88
- parse! server.rb /^ def parse!(args)$/;" f class:Rails.Server.Options
89
- plugin.rb plugin.rb 1;" F
90
- plugin_new.rb plugin_new.rb 1;" F
91
- pop_d plugin.rb /^ def pop_d$/;" f class:RecursiveHTTPFetcher.ls
92
- profiler.rb profiler.rb 1;" F
93
- push_d plugin.rb /^ def push_d(dir)$/;" f class:RecursiveHTTPFetcher.ls
94
- rails_env plugin.rb /^ def rails_env$/;" f
95
- run_install_hook plugin.rb /^ def run_install_hook$/;" f class:Plugin
96
- run_uninstall_hook plugin.rb /^ def run_uninstall_hook$/;" f class:Plugin
97
- runner.rb runner.rb 1;" F
98
- server.rb server.rb 1;" F
99
- set_environment server.rb /^ def set_environment$/;" f class:Rails.Server
100
- split_args plugin.rb /^ def split_args(args)$/;" f class:Commands.Plugin
101
- start console.rb /^ def self.start(app)$/;" F class:Rails.Console
102
- start console.rb /^ def start$/;" f class:Rails.Console
103
- start dbconsole.rb /^ def self.start(app)$/;" F class:Rails.DBConsole
104
- start dbconsole.rb /^ def start$/;" f class:Rails.DBConsole
105
- start server.rb /^ def start$/;" f class:Rails.Server
106
- svn_command plugin.rb /^ def svn_command(cmd, options = {})$/;" f
107
- svn_url? plugin.rb /^ def svn_url?$/;" f class:Plugin
108
- to_s plugin.rb /^ def to_s$/;" f class:Plugin
109
- uninstall plugin.rb /^ def uninstall$/;" f class:Plugin
110
- update.rb update.rb 1;" F
111
- use_checkout? plugin.rb /^ def use_checkout?$/;" f class:RailsEnvironment
112
- use_externals? plugin.rb /^ def use_externals?$/;" f class:RailsEnvironment
113
- use_svn? plugin.rb /^ def use_svn?$/;" f class:RailsEnvironment