Skip to content
This repository
Browse code

Merge commit 'mainstream/master'

Conflicts:

	actionpack/lib/action_controller/response.rb
	actionpack/lib/action_controller/test_case.rb
	actionpack/lib/action_controller/url_rewriter.rb
	activerecord/lib/active_record/associations.rb
	activesupport/lib/active_support/core_ext/time/conversions.rb
	railties/doc/guides/creating_plugins/acts_as_yaffle.txt
	railties/doc/guides/creating_plugins/creating_plugins.txt
	railties/doc/guides/creating_plugins/migration_generator.txt
	railties/doc/guides/creating_plugins/odds_and_ends.txt
	railties/doc/guides/creating_plugins/preparation.txt
	railties/doc/guides/creating_plugins/string_to_squawk.txt
	railties/doc/guides/creating_plugins/view_helper.txt
	railties/doc/guides/securing_rails_applications/creating_records_directly_from_form_parameters.txt
	railties/doc/guides/testing_rails_applications/testing_rails_applications.txt
  • Loading branch information...
commit 5abe63c419de22cb1b95334d8741a32cd175a0d7 2 parents de21191 + 6e75455
Pratik lifo authored
2  actionpack/lib/action_controller/response.rb
@@ -32,7 +32,7 @@ module ActionController # :nodoc:
32 32 class AbstractResponse
33 33 DEFAULT_HEADERS = { "Cache-Control" => "no-cache" }
34 34 attr_accessor :request
35   -
  35 +
36 36 # The body content (e.g. HTML) of the response, as a String.
37 37 attr_accessor :body
38 38 # The headers of the response, as a Hash. It maps header names to header values.
6 actionpack/lib/action_controller/test_case.rb
@@ -25,7 +25,7 @@ def inferred_controller_name
25 25 #
26 26 # Functional tests are written as follows:
27 27 # 1. First, one uses the +get+, +post+, +put+, +delete+ or +head+ method to simulate
28   - # an HTTP request.
  28 + # an HTTP request.
29 29 # 2. Then, one asserts whether the current state is as expected. "State" can be anything:
30 30 # the controller's HTTP response, the database contents, etc.
31 31 #
@@ -35,11 +35,11 @@ def inferred_controller_name
35 35 # def test_create
36 36 # # Simulate a POST response with the given HTTP parameters.
37 37 # post(:create, :book => { :title => "Love Hina" })
38   - #
  38 + #
39 39 # # Assert that the controller tried to redirect us to
40 40 # # the created book's URI.
41 41 # assert_response :found
42   - #
  42 + #
43 43 # # Assert that the controller really put the book in the database.
44 44 # assert_not_nil Book.find_by_title("Love Hina")
45 45 # end
4 actionpack/lib/action_controller/url_rewriter.rb
@@ -19,7 +19,7 @@ module ActionController
19 19 #
20 20 # <%= link_to('Click here', :controller => 'users',
21 21 # :action => 'new', :message => 'Welcome!') %>
22   - #
  22 + #
23 23 # #=> Generates a link to: /users/new?message=Welcome%21
24 24 #
25 25 # link_to, and all other functions that require URL generation functionality,
@@ -74,7 +74,7 @@ module ActionController
74 74 #
75 75 # class User < ActiveRecord::Base
76 76 # include ActionController::UrlWriter # !!!
77   - #
  77 + #
78 78 # def name=(value)
79 79 # write_attribute('name', value)
80 80 # write_attribute('base_uri', users_path) # !!!
2  activerecord/lib/active_record/associations.rb
@@ -741,7 +741,7 @@ module ClassMethods
741 741 # If false, don't validate the associated objects when saving the parent object. true by default.
742 742 # [:accessible]
743 743 # Mass assignment is allowed for this assocation (similar to <tt>ActiveRecord::Base#attr_accessible</tt>).
744   -
  744 +
745 745 # Option examples:
746 746 # has_many :comments, :order => "posted_on"
747 747 # has_many :comments, :include => :author
2  activesupport/lib/active_support/core_ext/time/conversions.rb
@@ -30,7 +30,7 @@ def self.included(base) #:nodoc:
30 30 # time.to_s(:time) # => "06:10:17"
31 31 #
32 32 # time.to_formatted_s(:db) # => "2007-01-18 06:10:17"
33   - # time.to_formatted_s(:number) # => "20070118061017"
  33 + # time.to_formatted_s(:number) # => "20070118061017"
34 34 # time.to_formatted_s(:short) # => "18 Jan 06:10"
35 35 # time.to_formatted_s(:long) # => "January 18, 2007 06:10"
36 36 # time.to_formatted_s(:long_ordinal) # => "January 18th, 2007 06:10"
6 railties/doc/guides/creating_plugins/acts_as_yaffle.txt
@@ -17,7 +17,7 @@ end
17 17 class ActsAsYaffleTest < Test::Unit::TestCase
18 18 end
19 19 ------------------------------------------------------
20   -
  20 +
21 21 [source, ruby]
22 22 ------------------------------------------------------
23 23 # File: vendor/plugins/lib/acts_as_yaffle.rb
@@ -40,11 +40,11 @@ module Yaffle
40 40 def acts_as_something
41 41 send :include, InstanceMethods
42 42 end
43   - end
  43 + end
44 44
45 45 module InstanceMethods
46 46 # any method placed here will apply to instaces, like @hickwall
47   - end
  47 + end
48 48 end
49 49 ------------------------------------------------------
50 50
4 railties/doc/guides/creating_plugins/creating_plugins.txt
... ... @@ -1,7 +1,7 @@
1 1 The Basics of Creating Rails Plugins
2 2 ====================================
3 3
4   -Pretend for a moment that you are an avid bird watcher. Your favorite bird is the Yaffle, and you want to create a plugin that allows other developers to share in the Yaffle goodness.
  4 +Pretend for a moment that you are an avid bird watcher. Your favorite bird is the Yaffle, and you want to create a plugin that allows other developers to share in the Yaffle goodness.
5 5
6 6 In this tutorial you will learn how to create a plugin that includes:
7 7
@@ -56,7 +56,7 @@ ActionController::Routing::Routes.draw do |map|
56 56 map.yaffles
57 57 end
58 58 -------------------------------------------
59   -
  59 +
60 60 In addition you'll learn how to:
61 61
62 62 * test your plugins.
8 railties/doc/guides/creating_plugins/migration_generator.txt
@@ -7,7 +7,7 @@ We'll be relying on the built-in rails generate template for this tutorial. Goi
7 7 Type:
8 8
9 9 script/generate
10   -
  10 +
11 11 You should see the line:
12 12
13 13 Plugins (vendor/plugins): yaffle
@@ -34,13 +34,13 @@ Now you can add code to your generator:
34 34 class YaffleGenerator < Rails::Generator::NamedBase
35 35 def manifest
36 36 record do |m|
37   - m.migration_template 'migration:migration.rb', "db/migrate", {:assigns => yaffle_local_assigns,
  37 + m.migration_template 'migration:migration.rb', "db/migrate", {:assigns => yaffle_local_assigns,
38 38 :migration_file_name => "add_yaffle_fields_to_#{custom_file_name}"
39 39 }
40 40 end
41 41 end
42 42
43   - private
  43 + private
44 44 def custom_file_name
45 45 custom_name = class_name.underscore.downcase
46 46 custom_name = custom_name.pluralize if ActiveRecord::Base.pluralize_table_names
@@ -68,7 +68,7 @@ This does a few things:
68 68 When you run the generator like
69 69
70 70 script/generate yaffle bird
71   -
  71 +
72 72 You will see a new file:
73 73
74 74 [source, ruby]
4 railties/doc/guides/creating_plugins/odds_and_ends.txt
@@ -2,7 +2,7 @@
2 2
3 3 === Work with init.rb ===
4 4
5   -The plugin initializer script 'init.rb' is invoked via `eval` (not `require`) so it has slightly different behavior.
  5 +The plugin initializer script 'init.rb' is invoked via `eval` (not `require`) so it has slightly different behavior.
6 6
7 7 If you reopen any classes in init.rb itself your changes will potentially be made to the wrong module. There are 2 ways around this:
8 8
@@ -21,7 +21,7 @@ end
21 21
22 22 OR you can use `module_eval` or `class_eval`:
23 23
24   ----------------------------------------------------
  24 +---------------------------------------------------
25 25 # File: vendor/plugins/yaffle/init.rb
26 26
27 27 Hash.class_eval do
2  railties/doc/guides/creating_plugins/preparation.txt
@@ -123,7 +123,7 @@ ActiveRecord::Schema.define(:version => 0) do
123 123 end
124 124
125 125 # File: vendor/plugins/yaffle/test/test_helper.rb
126   -
  126 +
127 127 ENV['RAILS_ENV'] = 'test'
128 128 ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..'
129 129
8 railties/doc/guides/creating_plugins/string_to_squawk.txt
@@ -50,7 +50,7 @@ Your test should fail with `no such file to load -- ./test/../lib/core_ext.rb (L
50 50 1.) Failure ...
51 51 No tests were specified
52 52 --------------------------------------------------------
53   -
  53 +
54 54 Great - now you are ready to start development. The first thing we'll do is to add a method to String called `to_squawk` which will prefix the string with the word ``squawk!''. The test will look something like this:
55 55
56 56 [source, ruby]
@@ -73,14 +73,14 @@ end
73 73 --------------------------------------------------------
74 74
75 75 [source, ruby]
76   ---------------------------------------------------------
  76 +--------------------------------------------------------
77 77 # File: vendor/plugins/yaffle/init.rb
78 78
79 79 require "core_ext"
80   ---------------------------------------------------------
  80 +--------------------------------------------------------
81 81
82 82 [source, ruby]
83   ---------------------------------------------------------
  83 +--------------------------------------------------------
84 84 # File: vendor/plugins/yaffle/lib/core_ext.rb
85 85
86 86 String.class_eval do
2  railties/doc/guides/creating_plugins/view_helper.txt
@@ -36,7 +36,7 @@ require "view_helpers"
36 36 ActionView::Base.send :include, YaffleViewHelper
37 37 ---------------------------------------------------------------
38 38
39   -Then add the view helpers file and
  39 +Then add the view helpers file and
40 40
41 41 [source, ruby]
42 42 ---------------------------------------------------------------
2  railties/doc/guides/securing_rails_applications/creating_records_directly_from_form_parameters.txt
@@ -9,7 +9,7 @@ CREATE TABLE users (
9 9 id INTEGER PRIMARY KEY,
10 10 name VARCHAR(20) NOT NULL, -- the login name
11 11 password VARCHAR(20) NOT NULL,
12   - role VARCHAR(20) NOT NULL DEFAULT "User", -- e.g. "Admin", "Moderator, "User"
  12 + role VARCHAR(20) NOT NULL DEFAULT "User", -- e.g. "Admin", "Moderator, "User"
13 13 approved INTEGER NOT NULL DEFAULT 0 -- is the registered accound approved by the administrator?
14 14 );
15 15
32 railties/doc/guides/testing_rails_applications/testing_rails_applications.txt
@@ -17,7 +17,7 @@ Make sure you have Ruby 1.8.6 or greater and Rails 2.0 or greater.
17 17 Also, hats off to xal (and others) for creating this site.
18 18
19 19
20   -== Testing 1-2-3... is this thing on?
  20 +== Testing 1-2-3... is this thing on?
21 21
22 22 === What are These Strange Creatures?
23 23
@@ -212,7 +212,7 @@ class SecretAgent
212 212 attr_accessor :username
213 213 attr_accessor :password
214 214
215   - # our "constructor"
  215 + # our "constructor"
216 216 def initialize(username,password)
217 217 @username = username
218 218 @password = password
@@ -323,7 +323,7 @@ test_bam_zap_sock_pow(HelloTestCase) [/example/test.rb:62]:
323 323
324 324 2) Error:
325 325 test_uh_oh_hotdog(HelloTestCase):
326   -NameError: undefined local variable or method 'does_this_var_speak_korean' for
  326 +NameError: undefined local variable or method 'does_this_var_speak_korean' for
327 327 #<HelloTestCase:0x28c59a0> /example/test.rb:68:in 'test_uh_oh_hotdog'
328 328
329 329 4 tests, 12 assertions, 1 failures, 1 errors
@@ -618,9 +618,9 @@ On any given Sunday, a YAML fixture file may look like this:
618 618 ---------------------------------------------
619 619 # low & behold! I am a YAML comment!
620 620 david:
621   - id: 1
622   - name: David Heinemeier Hansson
623   - birthday: 1979-10-15
  621 + id: 1
  622 + name: David Heinemeier Hansson
  623 + birthday: 1979-10-15
624 624 profession: Systems development
625 625
626 626 steve:
@@ -640,9 +640,9 @@ A CSV fixture looks like this:
640 640
641 641 --------------------------------------------------------------
642 642 id, username, password, stretchable, comments
643   -1, sclaus, ihatekids, false, I like to say ""Ho! Ho! Ho!""
  643 +1, sclaus, ihatekids, false, I like to say ""Ho! Ho! Ho!""
644 644 2, ebunny, ihateeggs, true, Hoppity hop y'all
645   -3, tfairy, ilovecavities, true, "Pull your teeth, I will"
  645 +3, tfairy, ilovecavities, true, "Pull your teeth, I will"
646 646 --------------------------------------------------------------
647 647
648 648 The first line is the header. It is a comma-separated list of fields. The rest of the file is the payload: 1 record per line. A few notes about this format:
@@ -916,7 +916,7 @@ For example, let's say we have a `MoviesController` with an action called `movie
916 916 def movie
917 917 @movie = Movie.find(params[:id])
918 918 if @movie.nil?
919   - flash['message'] = "That movie has been burned."
  919 + flash['message'] = "That movie has been burned."
920 920 redirect_to :controller => 'error', :action => 'missing'
921 921 end
922 922 end
@@ -928,7 +928,7 @@ Now, to test out if the proper movie is being set, we could have a series of tes
928 928 ----------------------------------------------------
929 929 # this test proves that fetching a movie works
930 930 def test_successfully_finding_a_movie
931   - get :movie, "id" => "1"
  931 + get :movie, "id" => "1"
932 932 assert_not_nil assigns["movie"]
933 933 assert_equal 1, assigns["movie"].id
934 934 assert flash.empty?
@@ -936,7 +936,7 @@ end
936 936
937 937 # and when we can't find a movie...
938 938 def test_movie_not_found
939   - get :movie, "id" => "666999"
  939 + get :movie, "id" => "666999"
940 940 assert_nil assigns["movie"]
941 941 assert flash.has_key?("message")
942 942 assert assigns.empty?
@@ -966,7 +966,7 @@ Ensures the expected template was responsible for rendering. For example:
966 966 +
967 967 [source, ruby]
968 968 --------------------------------------
969   -assert_template "user/profile"
  969 +assert_template "user/profile"
970 970 --------------------------------------
971 971 +
972 972 This code will fail unless the template located at app/views/user/profile.rhtml was rendered.
@@ -1035,9 +1035,9 @@ These examples are taken from the same docs too:
1035 1035 [source, ruby]
1036 1036 -------------------------------------------------------------
1037 1037 # assert that there is a "span" tag
1038   - assert_tag :tag => "span"
  1038 + assert_tag :tag => "span"
1039 1039
1040   - # assert that there is a "span" inside of a "div"
  1040 + # assert that there is a "span" inside of a "div"
1041 1041 assert_tag :tag => "span", :parent => { :tag => "div" }
1042 1042
1043 1043 # assert that there is a "span" somewhere inside a table
@@ -1272,7 +1272,7 @@ require 'my_mailer'
1272 1272 class MyMailerTest < Test::Unit::TestCase
1273 1273 fixtures :users
1274 1274 FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
1275   - CHARSET = "utf-8"
  1275 + CHARSET = "utf-8"
1276 1276
1277 1277 include ActionMailer::Quoting
1278 1278
@@ -1358,7 +1358,7 @@ class ActionMailer::Base
1358 1358 mail.to = destinations
1359 1359 if destinations.size > 0
1360 1360 mail.ready_to_send
1361   - Net::SMTP.start(server_settings[:address], server_settings[:port], server_settings[:domain],
  1361 + Net::SMTP.start(server_settings[:address], server_settings[:port], server_settings[:domain],
1362 1362 server_settings[:user_name], server_settings[:password], server_settings[:authentication]) do |smtp|
1363 1363 smtp.sendmail(mail.encoded, mail.from, destinations)
1364 1364 end

0 comments on commit 5abe63c

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