Skip to content
This repository
Browse code

Removing ==Examples and last blank lines of docs from railties

  • Loading branch information...
commit 17059a4868532f0046f1ec0ecc643a2211d6db45 1 parent 888383e
Francesco Rodríguez authored
3  railties/lib/rails.rb
@@ -107,14 +107,11 @@ def cache=(cache)
107 107
     # * The environment variable RAILS_GROUPS;
108 108
     # * The optional envs given as argument and the hash with group dependencies;
109 109
     #
110  
-    # == Examples
111  
-    #
112 110
     #   groups :assets => [:development, :test]
113 111
     #
114 112
     #   # Returns
115 113
     #   # => [:default, :development, :assets] for Rails.env == "development"
116 114
     #   # => [:default, :production]           for Rails.env == "production"
117  
-    #
118 115
     def groups(*groups)
119 116
       hash = groups.extract_options!
120 117
       env = Rails.env
5  railties/lib/rails/engine.rb
@@ -39,8 +39,6 @@ module Rails
39 39
   # and <tt>autoload_once_paths</tt>, which, differently from a <tt>Railtie</tt>, are scoped to
40 40
   # the current engine.
41 41
   #
42  
-  # Example:
43  
-  #
44 42
   #   class MyEngine < Rails::Engine
45 43
   #     # Add a load path for this specific Engine
46 44
   #     config.autoload_paths << File.expand_path("../lib/some/path", __FILE__)
@@ -336,11 +334,8 @@ module Rails
336 334
   # It will affect the priority of loading views, helpers, assets and all the other files
337 335
   # related to engine or application.
338 336
   #
339  
-  # Example:
340  
-  #
341 337
   #   # load Blog::Engine with highest priority, followed by application and other railties
342 338
   #   config.railties_order = [Blog::Engine, :main_app, :all]
343  
-  #
344 339
   class Engine < Railtie
345 340
     autoload :Configuration, "rails/engine/configuration"
346 341
     autoload :Railties,      "rails/engine/railties"
4  railties/lib/rails/generators.rb
@@ -95,7 +95,6 @@ def self.options #:nodoc:
95 95
     # some of them are not available by adding a fallback:
96 96
     #
97 97
     #   Rails::Generators.fallbacks[:shoulda] = :test_unit
98  
-    #
99 98
     def self.fallbacks
100 99
       @fallbacks ||= {}
101 100
     end
@@ -115,8 +114,6 @@ def self.subclasses
115 114
     # Generators names must end with "_generator.rb". This is required because Rails
116 115
     # looks in load paths and loads the generator just before it's going to be used.
117 116
     #
118  
-    # ==== Examples
119  
-    #
120 117
     #   find_by_namespace :webrat, :rails, :integration
121 118
     #
122 119
     # Will search for the following generators:
@@ -125,7 +122,6 @@ def self.subclasses
125 122
     #
126 123
     # Notice that "rails:generators:webrat" could be loaded as well, what
127 124
     # Rails looks for is the first and last parts of the namespace.
128  
-    #
129 125
     def self.find_by_namespace(name, base=nil, context=nil) #:nodoc:
130 126
       lookups = []
131 127
       lookups << "#{base}:#{name}"    if base
42  railties/lib/rails/generators/actions.rb
@@ -8,12 +8,9 @@ module Actions
8 8
       # Adds an entry into Gemfile for the supplied gem. If env
9 9
       # is specified, add the gem to the given environment.
10 10
       #
11  
-      # ==== Example
12  
-      #
13 11
       #   gem "rspec", :group => :test
14 12
       #   gem "technoweenie-restful-authentication", :lib => "restful-authentication", :source => "http://gems.github.com/"
15 13
       #   gem "rails", "3.0", :git => "git://github.com/rails/rails"
16  
-      #
17 14
       def gem(*args)
18 15
         options = args.extract_options!
19 16
         name, version = args
@@ -43,12 +40,9 @@ def gem(*args)
43 40
 
44 41
       # Wraps gem entries inside a group.
45 42
       #
46  
-      # ==== Example
47  
-      #
48 43
       #   gem_group :development, :test do
49 44
       #     gem "rspec-rails"
50 45
       #   end
51  
-      #
52 46
       def gem_group(*names, &block)
53 47
         name = names.map(&:inspect).join(", ")
54 48
         log :gemfile, "group #{name}"
@@ -66,10 +60,7 @@ def gem_group(*names, &block)
66 60
 
67 61
       # Add the given source to Gemfile
68 62
       #
69  
-      # ==== Example
70  
-      #
71 63
       #   add_source "http://gems.github.com/"
72  
-      #
73 64
       def add_source(source, options={})
74 65
         log :source, source
75 66
 
@@ -83,8 +74,6 @@ def add_source(source, options={})
83 74
       # If options :env is specified, the line is appended to the corresponding
84 75
       # file in config/environments.
85 76
       #
86  
-      # ==== Examples
87  
-      #
88 77
       #   environment do
89 78
       #     "config.autoload_paths += %W(#{config.root}/extras)"
90 79
       #   end
@@ -92,7 +81,6 @@ def add_source(source, options={})
92 81
       #   environment(nil, :env => "development") do
93 82
       #     "config.active_record.observers = :cacher"
94 83
       #   end
95  
-      #
96 84
       def environment(data=nil, options={}, &block)
97 85
         sentinel = /class [a-z_:]+ < Rails::Application/i
98 86
         env_file_sentinel = /::Application\.configure do/
@@ -112,12 +100,9 @@ def environment(data=nil, options={}, &block)
112 100
 
113 101
       # Run a command in git.
114 102
       #
115  
-      # ==== Examples
116  
-      #
117 103
       #   git :init
118 104
       #   git :add => "this.file that.rb"
119 105
       #   git :add => "onefile.rb", :rm => "badfile.cxx"
120  
-      #
121 106
       def git(commands={})
122 107
         if commands.is_a?(Symbol)
123 108
           run "git #{commands}"
@@ -131,15 +116,12 @@ def git(commands={})
131 116
       # Create a new file in the vendor/ directory. Code can be specified
132 117
       # in a block or a data string can be given.
133 118
       #
134  
-      # ==== Examples
135  
-      #
136 119
       #   vendor("sekrit.rb") do
137 120
       #     sekrit_salt = "#{Time.now}--#{3.years.ago}--#{rand}--"
138 121
       #     "salt = '#{sekrit_salt}'"
139 122
       #   end
140 123
       #
141 124
       #   vendor("foreign.rb", "# Foreign code is fun")
142  
-      #
143 125
       def vendor(filename, data=nil, &block)
144 126
         log :vendor, filename
145 127
         create_file("vendor/#{filename}", data, :verbose => false, &block)
@@ -148,14 +130,11 @@ def vendor(filename, data=nil, &block)
148 130
       # Create a new file in the lib/ directory. Code can be specified
149 131
       # in a block or a data string can be given.
150 132
       #
151  
-      # ==== Examples
152  
-      #
153 133
       #   lib("crypto.rb") do
154 134
       #     "crypted_special_value = '#{rand}--#{Time.now}--#{rand(1337)}--'"
155 135
       #   end
156 136
       #
157 137
       #   lib("foreign.rb", "# Foreign code is fun")
158  
-      #
159 138
       def lib(filename, data=nil, &block)
160 139
         log :lib, filename
161 140
         create_file("lib/#{filename}", data, :verbose => false, &block)
@@ -163,8 +142,6 @@ def lib(filename, data=nil, &block)
163 142
 
164 143
       # Create a new Rakefile with the provided code (either in a block or a string).
165 144
       #
166  
-      # ==== Examples
167  
-      #
168 145
       #   rakefile("bootstrap.rake") do
169 146
       #     project = ask("What is the UNIX name of your project?")
170 147
       #
@@ -178,7 +155,6 @@ def lib(filename, data=nil, &block)
178 155
       #   end
179 156
       #
180 157
       #   rakefile('seed.rake', 'puts "Planting seeds"')
181  
-      #
182 158
       def rakefile(filename, data=nil, &block)
183 159
         log :rakefile, filename
184 160
         create_file("lib/tasks/#{filename}", data, :verbose => false, &block)
@@ -186,8 +162,6 @@ def rakefile(filename, data=nil, &block)
186 162
 
187 163
       # Create a new initializer with the provided code (either in a block or a string).
188 164
       #
189  
-      # ==== Examples
190  
-      #
191 165
       #   initializer("globals.rb") do
192 166
       #     data = ""
193 167
       #
@@ -199,7 +173,6 @@ def rakefile(filename, data=nil, &block)
199 173
       #   end
200 174
       #
201 175
       #   initializer("api.rb", "API_KEY = '123456'")
202  
-      #
203 176
       def initializer(filename, data=nil, &block)
204 177
         log :initializer, filename
205 178
         create_file("config/initializers/#{filename}", data, :verbose => false, &block)
@@ -209,10 +182,7 @@ def initializer(filename, data=nil, &block)
209 182
       # The second parameter is the argument string that is passed to
210 183
       # the generator or an Array that is joined.
211 184
       #
212  
-      # ==== Example
213  
-      #
214 185
       #   generate(:authenticated, "user session")
215  
-      #
216 186
       def generate(what, *args)
217 187
         log :generate, what
218 188
         argument = args.map {|arg| arg.to_s }.flatten.join(" ")
@@ -222,12 +192,9 @@ def generate(what, *args)
222 192
 
223 193
       # Runs the supplied rake task
224 194
       #
225  
-      # ==== Example
226  
-      #
227 195
       #   rake("db:migrate")
228 196
       #   rake("db:migrate", :env => "production")
229 197
       #   rake("gems:install", :sudo => true)
230  
-      #
231 198
       def rake(command, options={})
232 199
         log :rake, command
233 200
         env  = options[:env] || ENV["RAILS_ENV"] || 'development'
@@ -237,10 +204,7 @@ def rake(command, options={})
237 204
 
238 205
       # Just run the capify command in root
239 206
       #
240  
-      # ==== Example
241  
-      #
242 207
       #   capify!
243  
-      #
244 208
       def capify!
245 209
         log :capify, ""
246 210
         in_root { run("#{extify(:capify)} .", :verbose => false) }
@@ -248,10 +212,7 @@ def capify!
248 212
 
249 213
       # Make an entry in Rails routing file config/routes.rb
250 214
       #
251  
-      # === Example
252  
-      #
253 215
       #   route "root :to => 'welcome#index'"
254  
-      #
255 216
       def route(routing_code)
256 217
         log :route, routing_code
257 218
         sentinel = /\.routes\.draw do\s*$/
@@ -263,10 +224,7 @@ def route(routing_code)
263 224
 
264 225
       # Reads the given file at the source root and prints it in the console.
265 226
       #
266  
-      # === Example
267  
-      #
268 227
       #   readme "README"
269  
-      #
270 228
       def readme(path)
271 229
         log File.read(find_in_source_paths(path))
272 230
       end
3  railties/lib/rails/generators/base.rb
@@ -187,10 +187,7 @@ def self.hook_for(*names, &block)
187 187
 
188 188
       # Remove a previously added hook.
189 189
       #
190  
-      # ==== Examples
191  
-      #
192 190
       #   remove_hook_for :orm
193  
-      #
194 191
       def self.remove_hook_for(*names)
195 192
         remove_invocation(*names)
196 193
 
4  railties/lib/rails/generators/migration.rb
@@ -3,7 +3,6 @@ module Generators
3 3
     # Holds common methods for migrations. It assumes that migrations has the
4 4
     # [0-9]*_name format and can be used by another frameworks (like Sequel)
5 5
     # just by implementing the next migration version method.
6  
-    #
7 6
     module Migration
8 7
       attr_reader :migration_number, :migration_file_name, :migration_class_name
9 8
 
@@ -38,10 +37,7 @@ def next_migration_number(dirname) #:nodoc:
38 37
       # The migration version, migration file name, migration class name are
39 38
       # available as instance variables in the template to be rendered.
40 39
       #
41  
-      # ==== Examples
42  
-      #
43 40
       #   migration_template "migration.rb", "db/migrate/add_foo_to_bar.rb"
44  
-      #
45 41
       def migration_template(source, destination=nil, config={})
46 42
         destination = File.expand_path(destination || source, self.destination_root)
47 43
 

0 notes on commit 17059a4

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