github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

rails / rails

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 5,196
    • 849
  • Source
  • Commits
  • Network (849)
  • Downloads (61)
  • Wiki (4)
  • Graphs
  • Tree: 2ebea1c

click here to add a description

click here to add a homepage

  • Switch Branches (6)
    • 1-2-stable
    • 2-0-stable
    • 2-1-stable
    • 2-2-stable
    • 2-3-stable
    • master
  • Switch Tags (61)
    • v3.0.0.beta1
    • v2.3.5
    • v2.3.4
    • v2.3.3.1
    • v2.3.3
    • v2.3.2.1
    • v2.3.2
    • v2.3.1
    • v2.3.0
    • v2.2.3
    • v2.2.2
    • v2.2.1
    • v2.2.0
    • v2.1.2
    • v2.1.1
    • v2.1.0_RC1
    • v2.1.0
    • v2.0.5
    • v2.0.4
    • v2.0.3
    • v2.0.2
    • v2.0.1
    • v2.0.0_RC2
    • v2.0.0_RC1
    • v2.0.0_PR
    • v2.0.0
    • v1.2.6
    • v1.2.5
    • v1.2.4
    • v1.2.3
    • v1.2.2
    • v1.2.1
    • v1.2.0_RC2
    • v1.2.0_RC1
    • v1.2.0
    • v1.1.6
    • v1.1.5
    • v1.1.4
    • v1.1.3
    • v1.1.2
    • v1.1.1
    • v1.1.0_RC1
    • v1.1.0
    • v1.0.0
    • v0.14.4
    • v0.14.3
    • v0.14.2
    • v0.14.1
    • v0.13.1
    • v0.13.0
    • v0.12.0
    • v0.11.1
    • v0.11.0
    • v0.10.1
    • v0.10.0
    • v0.9.5
    • v0.9.4.1
    • v0.9.4
    • v0.9.3
    • v0.9.2
    • v0.9.1
  • Comments
Sending Request…

Ruby on Rails — Read more

  Cancel

http://rubyonrails.org

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

deOMGifying Railties, Active Support, and Action Pack
mikel (author)
Sat Jan 30 21:27:24 -0800 2010
jeremy (committer)
Sun Jan 31 09:46:30 -0800 2010
commit  2ebea1c02d10e0fea26bd98d297a8f4d41dc1aff
tree    c85ae3de692c1ac783e67f11e71b8336902d8341
parent  b3a028259f373fd58fea2171a1e9e8b2fe3e253a
M actionpack/lib/action_controller/metal/testing.rb 2 ••
M actionpack/lib/action_view/template/resolver.rb 3 •••
M actionpack/test/abstract/layouts_test.rb 18 ••••
M actionpack/test/controller/filters_test.rb 6 ••••
M actionpack/test/controller/new_base/render_action_test.rb 28 ••••
M actionpack/test/controller/new_base/render_layout_test.rb 20 ••••
M actionpack/test/controller/new_base/render_partial_test.rb 4 ••••
M actionpack/test/controller/subscriber_test.rb 4 ••••
M actionpack/test/dispatch/mime_type_test.rb 4 ••••
M actionpack/test/template/html-scanner/sanitizer_test.rb 4 ••••
M actionpack/test/template/subscriber_test.rb 4 ••••
M activesupport/test/callbacks_test.rb 8 ••••
A activesupport/test/fixtures/custom.rb 2 ••
D activesupport/test/fixtures/omgomg.rb 2 ••
M activesupport/test/isolation_test.rb 12 ••••
M activesupport/test/notifications_test.rb 6 ••••
M railties/guides/source/rails_application_templates.textile 2 ••
M railties/test/initializable_test.rb 2 ••
0
actionpack/lib/action_controller/metal/testing.rb
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@ module ActionController
0
 
0
     include RackDelegation
0
 
0
-    # OMG MEGA HAX
0
+    # TODO: Clean this up
0
     def process_with_new_base_test(request, response)
0
       @_request = request
0
       @_response = response
0
actionpack/lib/action_view/template/resolver.rb
...
141
142
143
144
145
 
146
147
148
...
141
142
143
 
 
144
145
146
147
0
@@ -141,8 +141,7 @@ module ActionView
0
     end
0
   end
0
 
0
-  # OMG HAX
0
-  # TODO: remove hax
0
+  # TODO: remove hack
0
   class FileSystemResolverWithFallback < Resolver
0
     def initialize(path, options = {})
0
       super(options)
0
actionpack/test/abstract/layouts_test.rb
...
13
14
15
16
 
17
18
19
...
42
43
44
45
 
46
47
48
...
68
69
70
71
 
72
73
74
...
83
84
85
86
 
87
88
89
...
122
123
124
125
 
126
127
128
...
175
176
177
178
 
179
180
181
...
209
210
211
212
 
213
214
215
216
217
218
 
219
220
221
...
266
267
268
269
 
270
271
272
...
13
14
15
 
16
17
18
19
...
42
43
44
 
45
46
47
48
...
68
69
70
 
71
72
73
74
...
83
84
85
 
86
87
88
89
...
122
123
124
 
125
126
127
128
...
175
176
177
 
178
179
180
181
...
209
210
211
 
212
213
214
215
216
217
 
218
219
220
221
...
266
267
268
 
269
270
271
272
0
@@ -13,7 +13,7 @@ module AbstractControllerTests
0
         "layouts/hello_override.erb"            => "With Override <%= yield %>",
0
         "layouts/abstract_controller_tests/layouts/with_string_implied_child.erb" =>
0
                                                    "With Implied <%= yield %>",
0
-        "layouts/omg.erb"                       => "OMGHI2U <%= yield %>",
0
+        "layouts/overwrite.erb"                  => "Overwrite <%= yield %>",
0
         "layouts/with_false_layout.erb"         => "False Layout <%= yield %>"
0
       )]
0
     end
0
@@ -42,7 +42,7 @@ module AbstractControllerTests
0
       end
0
 
0
       def overwrite_string
0
-        render :_template => ActionView::Template::Text.new("Hello string!"), :layout => "omg"
0
+        render :_template => ActionView::Template::Text.new("Hello string!"), :layout => "overwrite"
0
       end
0
 
0
       def overwrite_skip
0
@@ -68,7 +68,7 @@ module AbstractControllerTests
0
     end
0
 
0
     class WithProc < Base
0
-      layout proc { |c| "omg" }
0
+      layout proc { |c| "overwrite" }
0
 
0
       def index
0
         render :_template => ActionView::Template::Text.new("Hello proc!")
0
@@ -83,7 +83,7 @@ module AbstractControllerTests
0
       end
0
     private  
0
       def hello
0
-        "omg"
0
+        "overwrite"
0
       end
0
     end
0
     
0
@@ -122,7 +122,7 @@ module AbstractControllerTests
0
     end    
0
     
0
     class WithSymbolAndNoMethod < Base
0
-      layout :omg_no_method
0
+      layout :no_method
0
       
0
       def index
0
         render :_template => ActionView::Template::Text.new("Hello boom!")
0
@@ -175,7 +175,7 @@ module AbstractControllerTests
0
       test "when layout is overwriten by string in render, render new layout" do
0
         controller = WithString.new
0
         controller.process(:overwrite_string)
0
-        assert_equal "OMGHI2U Hello string!", controller.response_body
0
+        assert_equal "Overwrite Hello string!", controller.response_body
0
       end
0
 
0
       test "when layout is overwriten by false in render, render no layout" do
0
@@ -209,13 +209,13 @@ module AbstractControllerTests
0
       test "when layout is specified as a proc, call it and use the layout returned" do
0
         controller = WithProc.new
0
         controller.process(:index)
0
-        assert_equal "OMGHI2U Hello proc!", controller.response_body
0
+        assert_equal "Overwrite Hello proc!", controller.response_body
0
       end
0
       
0
       test "when layout is specified as a symbol, call the requested method and use the layout returned" do
0
         controller = WithSymbol.new
0
         controller.process(:index)
0
-        assert_equal "OMGHI2U Hello symbol!", controller.response_body
0
+        assert_equal "Overwrite Hello symbol!", controller.response_body
0
       end
0
       
0
       test "when layout is specified as a symbol and the method returns nil, don't use a layout" do
0
@@ -266,7 +266,7 @@ module AbstractControllerTests
0
       test "raises an exception when specifying layout true" do
0
         assert_raises ArgumentError do
0
           Object.class_eval do
0
-            class ::BadOmgFailLolLayout < AbstractControllerTests::Layouts::Base
0
+            class ::BadFailLayout < AbstractControllerTests::Layouts::Base
0
               layout true
0
             end
0
           end
0
actionpack/test/controller/filters_test.rb
...
435
436
437
438
 
439
440
441
...
465
466
467
468
 
469
470
471
472
473
474
475
 
476
477
478
...
435
436
437
 
438
439
440
441
...
465
466
467
 
468
469
470
471
472
473
474
 
475
476
477
478
0
@@ -435,7 +435,7 @@ class FilterTest < ActionController::TestCase
0
       end
0
 
0
       def non_yielding_filter
0
-        @filters  << "zomg it didn't yield"
0
+        @filters  << "it didn't yield"
0
         @filter_return_value
0
       end
0
 
0
@@ -465,14 +465,14 @@ class FilterTest < ActionController::TestCase
0
     controller = NonYieldingAroundFilterController.new
0
     controller.instance_variable_set "@filter_return_value", false
0
     test_process(controller, "index")
0
-    assert_equal ["filter_one", "zomg it didn't yield"], controller.assigns['filters']
0
+    assert_equal ["filter_one", "it didn't yield"], controller.assigns['filters']
0
   end
0
 
0
   def test_after_filters_are_not_run_if_around_filter_does_not_yield
0
     controller = NonYieldingAroundFilterController.new
0
     controller.instance_variable_set "@filter_return_value", true
0
     test_process(controller, "index")
0
-    assert_equal ["filter_one", "zomg it didn't yield"], controller.assigns['filters']
0
+    assert_equal ["filter_one", "it didn't yield"], controller.assigns['filters']
0
   end
0
 
0
   def test_added_filter_to_inheritance_graph
0
actionpack/test/controller/new_base/render_action_test.rb
...
119
120
121
122
123
124
 
 
 
125
126
127
...
156
157
158
159
 
160
161
162
163
164
165
166
 
167
168
169
...
184
185
186
187
 
188
189
190
...
194
195
196
197
 
198
199
200
...
204
205
206
207
 
208
209
210
...
234
235
236
237
 
238
239
240
241
242
243
244
 
245
246
247
...
265
266
267
268
269
 
 
270
271
272
...
292
293
294
295
 
296
297
298
299
300
301
302
 
303
304
305
...
119
120
121
 
 
 
122
123
124
125
126
127
...
156
157
158
 
159
160
161
162
163
164
165
 
166
167
168
169
...
184
185
186
 
187
188
189
190
...
194
195
196
 
197
198
199
200
...
204
205
206
 
207
208
209
210
...
234
235
236
 
237
238
239
240
241
242
243
 
244
245
246
247
...
265
266
267
 
 
268
269
270
271
272
...
292
293
294
 
295
296
297
298
299
300
301
 
302
303
304
305
0
@@ -119,9 +119,9 @@ module RenderActionWithApplicationLayout
0
     # Set the view path to an application view structure with layouts
0
     self.view_paths = self.view_paths = [ActionView::FixtureResolver.new(
0
       "render_action_with_application_layout/basic/hello_world.html.erb" => "Hello World!",
0
-      "render_action_with_application_layout/basic/hello.html.builder"   => "xml.p 'Omg'",
0
-      "layouts/application.html.erb"                                     => "OHAI <%= yield %> KTHXBAI",
0
-      "layouts/greetings.html.erb"                                       => "Greetings <%= yield %> Bai",
0
+      "render_action_with_application_layout/basic/hello.html.builder"   => "xml.p 'Hello'",
0
+      "layouts/application.html.erb"                                     => "Hi <%= yield %> OK, Bye",
0
+      "layouts/greetings.html.erb"                                       => "Greetings <%= yield %> Bye",
0
       "layouts/builder.html.builder"                                     => "xml.html do\n  xml << yield\nend"
0
     )]
0
 
0
@@ -156,14 +156,14 @@ module RenderActionWithApplicationLayout
0
     test "rendering implicit application.html.erb as layout" do
0
       get "/render_action_with_application_layout/basic/hello_world"
0
 
0
-      assert_body "OHAI Hello World! KTHXBAI"
0
+      assert_body "Hi Hello World! OK, Bye"
0
       assert_status 200
0
     end
0
 
0
     test "rendering with layout => true" do
0
       get "/render_action_with_application_layout/basic/hello_world_with_layout"
0
 
0
-      assert_body "OHAI Hello World! KTHXBAI"
0
+      assert_body "Hi Hello World! OK, Bye"
0
       assert_status 200
0
     end
0
 
0
@@ -184,7 +184,7 @@ module RenderActionWithApplicationLayout
0
     test "rendering with layout => 'greetings'" do
0
       get "/render_action_with_application_layout/basic/hello_world_with_custom_layout"
0
 
0
-      assert_body "Greetings Hello World! Bai"
0
+      assert_body "Greetings Hello World! Bye"
0
       assert_status 200
0
     end
0
   end
0
@@ -194,7 +194,7 @@ module RenderActionWithApplicationLayout
0
 
0
     test "builder works with layouts" do
0
       get :with_builder_and_layout
0
-      assert_response "<html>\n<p>Omg</p>\n</html>\n"
0
+      assert_response "<html>\n<p>Hello</p>\n</html>\n"
0
     end
0
   end
0
 
0
@@ -204,7 +204,7 @@ module RenderActionWithControllerLayout
0
   class BasicController < ActionController::Base
0
     self.view_paths = self.view_paths = [ActionView::FixtureResolver.new(
0
       "render_action_with_controller_layout/basic/hello_world.html.erb" => "Hello World!",
0
-      "layouts/render_action_with_controller_layout/basic.html.erb"     => "With Controller Layout! <%= yield %> KTHXBAI"
0
+      "layouts/render_action_with_controller_layout/basic.html.erb"     => "With Controller Layout! <%= yield %> Bye"
0
     )]
0
 
0
     def hello_world
0
@@ -234,14 +234,14 @@ module RenderActionWithControllerLayout
0
     test "render hello_world and implicitly use <controller_path>.html.erb as a layout." do
0
       get "/render_action_with_controller_layout/basic/hello_world"
0
 
0
-      assert_body "With Controller Layout! Hello World! KTHXBAI"
0
+      assert_body "With Controller Layout! Hello World! Bye"
0
       assert_status 200
0
     end
0
 
0
     test "rendering with layout => true" do
0
       get "/render_action_with_controller_layout/basic/hello_world_with_layout"
0
 
0
-      assert_body "With Controller Layout! Hello World! KTHXBAI"
0
+      assert_body "With Controller Layout! Hello World! Bye"
0
       assert_status 200
0
     end
0
 
0
@@ -265,8 +265,8 @@ module RenderActionWithBothLayouts
0
   class BasicController < ActionController::Base
0
     self.view_paths = [ActionView::FixtureResolver.new({
0
       "render_action_with_both_layouts/basic/hello_world.html.erb" => "Hello World!",
0
-      "layouts/application.html.erb"                                => "OHAI <%= yield %> KTHXBAI",
0
-      "layouts/render_action_with_both_layouts/basic.html.erb"      => "With Controller Layout! <%= yield %> KTHXBAI"
0
+      "layouts/application.html.erb"                                => "Oh Hi <%= yield %> Bye",
0
+      "layouts/render_action_with_both_layouts/basic.html.erb"      => "With Controller Layout! <%= yield %> Bye"
0
     })]
0
 
0
     def hello_world
0
@@ -292,14 +292,14 @@ module RenderActionWithBothLayouts
0
     test "rendering implicitly use <controller_path>.html.erb over application.html.erb as a layout" do
0
       get "/render_action_with_both_layouts/basic/hello_world"
0
 
0
-      assert_body   "With Controller Layout! Hello World! KTHXBAI"
0
+      assert_body   "With Controller Layout! Hello World! Bye"
0
       assert_status 200
0
     end
0
 
0
     test "rendering with layout => true" do
0
       get "/render_action_with_both_layouts/basic/hello_world_with_layout"
0
 
0
-      assert_body "With Controller Layout! Hello World! KTHXBAI"
0
+      assert_body "With Controller Layout! Hello World! Bye"
0
       assert_status 200
0
     end
0
 
0
actionpack/test/controller/new_base/render_layout_test.rb
...
3
4
5
6
 
7
8
9
 
10
11
12
...
27
28
29
30
 
31
32
33
...
40
41
42
43
 
44
45
46
47
48
49
50
 
51
52
53
...
63
64
65
66
 
67
68
69
70
71
72
73
74
 
 
75
76
77
...
84
85
86
87
 
88
89
90
91
92
 
93
94
95
...
3
4
5
 
6
7
8
 
9
10
11
12
...
27
28
29
 
30
31
32
33
...
40
41
42
 
43
44
45
46
47
48
49
 
50
51
52
53
...
63
64
65
 
66
67
68
69
70
71
72
 
 
73
74
75
76
77
...
84
85
86
 
87
88
89
90
91
 
92
93
94
95
0
@@ -3,10 +3,10 @@ require 'abstract_unit'
0
 module ControllerLayouts
0
   class ImplicitController < ::ApplicationController
0
     self.view_paths = [ActionView::FixtureResolver.new(
0
-      "layouts/application.html.erb" => "OMG <%= yield %> KTHXBAI",
0
+      "layouts/application.html.erb" => "Main <%= yield %> Layout",
0
       "layouts/override.html.erb"    => "Override! <%= yield %>",
0
       "basic.html.erb"               => "Hello world!",
0
-      "controller_layouts/implicit/layout_false.html.erb" => "hai(layout_false.html.erb)"
0
+      "controller_layouts/implicit/layout_false.html.erb" => "hi(layout_false.html.erb)"
0
     )]
0
 
0
     def index
0
@@ -27,7 +27,7 @@ module ControllerLayouts
0
 
0
   class ImplicitNameController < ::ApplicationController
0
     self.view_paths = [ActionView::FixtureResolver.new(
0
-      "layouts/controller_layouts/implicit_name.html.erb" => "OMGIMPLICIT <%= yield %> KTHXBAI",
0
+      "layouts/controller_layouts/implicit_name.html.erb" => "Implicit <%= yield %> Layout",
0
       "basic.html.erb" => "Hello world!"
0
     )]
0
 
0
@@ -40,14 +40,14 @@ module ControllerLayouts
0
     test "rendering a normal template, but using the implicit layout" do
0
       get "/controller_layouts/implicit/index"
0
 
0
-      assert_body   "OMG Hello world! KTHXBAI"
0
+      assert_body   "Main Hello world! Layout"
0
       assert_status 200
0
     end
0
 
0
     test "rendering a normal template, but using an implicit NAMED layout" do
0
       get "/controller_layouts/implicit_name/index"
0
 
0
-      assert_body "OMGIMPLICIT Hello world! KTHXBAI"
0
+      assert_body "Implicit Hello world! Layout"
0
       assert_status 200
0
     end
0
 
0
@@ -63,15 +63,15 @@ module ControllerLayouts
0
 
0
     test "rendering with :layout => false leaves out the implicit layout" do
0
       get :layout_false
0
-      assert_response "hai(layout_false.html.erb)"
0
+      assert_response "hi(layout_false.html.erb)"
0
     end
0
   end
0
 
0
   class MismatchFormatController < ::ApplicationController
0
     self.view_paths = [ActionView::FixtureResolver.new(
0
       "layouts/application.html.erb" => "<html><%= yield %></html>",
0
-      "controller_layouts/mismatch_format/index.js.rjs" => "page[:test].omg",
0
-      "controller_layouts/mismatch_format/implicit.rjs" => "page[:test].omg"      
0
+      "controller_layouts/mismatch_format/index.js.rjs" => "page[:test].ext",
0
+      "controller_layouts/mismatch_format/implicit.rjs" => "page[:test].ext"      
0
     )]
0
 
0
     def explicit
0
@@ -84,12 +84,12 @@ module ControllerLayouts
0
 
0
     test "if JS is selected, an HTML template is not also selected" do
0
       get :index, "format" => "js"
0
-      assert_response "$(\"test\").omg();"
0
+      assert_response "$(\"test\").ext();"
0
     end
0
 
0
     test "if JS is implicitly selected, an HTML template is not also selected" do
0
       get :implicit
0
-      assert_response "$(\"test\").omg();"
0
+      assert_response "$(\"test\").ext();"
0
     end
0
 
0
     test "if an HTML template is explicitly provides for a JS template, an error is raised" do
0
actionpack/test/controller/new_base/render_partial_test.rb
...
5
6
7
8
 
9
10
11
...
20
21
22
23
 
24
25
26
...
5
6
7
 
8
9
10
11
...
20
21
22
 
23
24
25
26
0
@@ -5,7 +5,7 @@ module RenderPartial
0
   class BasicController < ActionController::Base
0
     
0
     self.view_paths = [ActionView::FixtureResolver.new(
0
-      "render_partial/basic/_basic.html.erb"    => "OMG!",
0
+      "render_partial/basic/_basic.html.erb"    => "BasicPartial!",
0
       "render_partial/basic/basic.html.erb"      => "<%= @test_unchanged = 'goodbye' %><%= render :partial => 'basic' %><%= @test_unchanged %>"
0
     )]
0
     
0
@@ -20,7 +20,7 @@ module RenderPartial
0
     
0
     test "rendering a partial in ActionView doesn't pull the ivars again from the controller" do
0
       get :changing
0
-      assert_response("goodbyeOMG!goodbye")
0
+      assert_response("goodbyeBasicPartial!goodbye")
0
     end
0
   end
0
   
0
actionpack/test/controller/subscriber_test.rb
...
13
14
15
16
 
17
18
19
...
121
122
123
124
 
125
126
127
...
13
14
15
 
16
17
18
19
...
121
122
123
 
124
125
126
127
0
@@ -13,7 +13,7 @@ module Another
0
     end
0
 
0
     def data_sender
0
-      send_data "cool data", :filename => "omg.txt"
0
+      send_data "cool data", :filename => "file.txt"
0
     end
0
 
0
     def xfile_sender
0
@@ -121,7 +121,7 @@ class ACSubscriberTest < ActionController::TestCase
0
     wait
0
 
0
     assert_equal 3, logs.size
0
-    assert_match /Sent data omg\.txt/, logs[1]
0
+    assert_match /Sent data file\.txt/, logs[1]
0
   end
0
 
0
   def test_send_file
0
actionpack/test/dispatch/mime_type_test.rb
...
23
24
25
26
 
27
28
29
...
31
32
33
34
 
35
36
37
...
23
24
25
 
26
27
28
29
...
31
32
33
 
34
35
36
37
0
@@ -23,7 +23,7 @@ class MimeTypeTest < ActiveSupport::TestCase
0
   end
0
 
0
   # Accept header send with user HTTP_USER_AGENT: Sunrise/0.42j (Windows XP)
0
-  test "parse crappy broken acceptlines" do
0
+  test "parse broken acceptlines" do
0
     accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/*,,*/*;q=0.5"
0
     expect = [Mime::HTML, Mime::XML, "image/*", Mime::TEXT, Mime::ALL]
0
     assert_equal expect, Mime::Type.parse(accept).collect { |c| c.to_s }
0
@@ -31,7 +31,7 @@ class MimeTypeTest < ActiveSupport::TestCase
0
 
0
   # Accept header send with user HTTP_USER_AGENT: Mozilla/4.0
0
   #  (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1)
0
-  test "parse crappy broken acceptlines2" do
0
+  test "parse other broken acceptlines" do
0
     accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,  , pronto/1.00.00, sslvpn/1.00.00.00, */*"
0
     expect = ['image/gif', 'image/x-xbitmap', 'image/jpeg','image/pjpeg', 'application/x-shockwave-flash', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/msword', 'pronto/1.00.00', 'sslvpn/1.00.00.00', Mime::ALL  ]
0
     assert_equal expect, Mime::Type.parse(accept).collect { |c| c.to_s }
0
actionpack/test/template/html-scanner/sanitizer_test.rb
...
48
49
50
51
 
52
53
54
...
193
194
195
196
 
197
198
199
...
48
49
50
 
51
52
53
54
...
193
194
195
 
196
197
198
199
0
@@ -48,7 +48,7 @@ class SanitizerTest < ActionController::TestCase
0
     assert_sanitized "a b c<script language=\"Javascript\">blah blah blah</script>d e f", "a b cd e f"
0
   end
0
 
0
-  # fucked
0
+  # TODO: Clean up
0
   def test_sanitize_js_handlers
0
     raw = %{onthis="do that" <a href="#" onclick="hello" name="foo" onbogus="remove me">hello</a>}
0
     assert_sanitized raw, %{onthis="do that" <a name="foo" href="#">hello</a>}
0
@@ -193,7 +193,7 @@ class SanitizerTest < ActionController::TestCase
0
     assert_sanitized img_hack, "<img>"
0
   end
0
 
0
-  # fucked
0
+  # TODO: Clean up
0
   def test_should_sanitize_attributes
0
     assert_sanitized %(<SPAN title="'><script>alert()</script>">blah</SPAN>), %(<span title="'&gt;&lt;script&gt;alert()&lt;/script&gt;">blah</span>)
0
   end
0
actionpack/test/template/subscriber_test.rb
...
33
34
35
36
 
37
38
39
...
41
42
43
44
 
45
46
47
...
33
34
35
 
36
37
38
39
...
41
42
43
 
44
45
46
47
0
@@ -33,7 +33,7 @@ class AVSubscriberTest < ActiveSupport::TestCase
0
   end
0
 
0
   def test_render_text_template
0
-    @view.render(:text => "OMG")
0
+    @view.render(:text => "TEXT")
0
     wait
0
 
0
     assert_equal 1, @logger.logged(:info).size
0
@@ -41,7 +41,7 @@ class AVSubscriberTest < ActiveSupport::TestCase
0
   end
0
 
0
   def test_render_inline_template
0
-    @view.render(:inline => "<%= 'OMG' %>")
0
+    @view.render(:inline => "<%= 'TEXT' %>")
0
     wait
0
 
0
     assert_equal 1, @logger.logged(:info).size
0
activesupport/test/callbacks_test.rb
...
264
265
266
267
 
268
269
270
271
272
 
 
273
274
275
...
522
523
524
525
 
526
527
528
...
264
265
266
 
267
268
269
270
 
 
271
272
273
274
275
...
522
523
524
 
525
526
527
528
0
@@ -264,12 +264,12 @@ module CallbacksTest
0
     define_callbacks :save
0
     attr_reader :stuff
0
 
0
-    set_callback :save, :before, :omg, :per_key => {:if => :yes}
0
+    set_callback :save, :before, :action, :per_key => {:if => :yes}
0
 
0
     def yes() true end
0
 
0
-    def omg
0
-      @stuff = "OMG"
0
+    def action
0
+      @stuff = "ACTION"
0
     end
0
 
0
     def save
0
@@ -522,7 +522,7 @@ module CallbacksTest
0
     def test_save
0
       obj = HyphenatedCallbacks.new
0
       obj.save
0
-      assert_equal obj.stuff, "OMG"
0
+      assert_equal obj.stuff, "ACTION"
0
     end
0
   end
0
 end
0
activesupport/test/fixtures/custom.rb
...
 
 
0
...
1
2
3
0
@@ -0,0 +1,2 @@
0
+class Custom
0
+end
0
\ No newline at end of file
0
activesupport/test/fixtures/omgomg.rb
...
1
2
3
...
 
 
0
0
@@ -1,2 +0,0 @@
0
-class OmgOmg
0
-end
0
\ No newline at end of file
0
activesupport/test/isolation_test.rb
...
59
60
61
62
63
64
 
 
 
65
66
67
68
69
70
 
 
 
71
72
73
...
59
60
61
 
 
 
62
63
64
65
66
67
 
 
 
68
69
70
71
72
73
0
@@ -59,15 +59,15 @@ elsif ENV['CHILD']
0
     end
0
 
0
     test "resets requires one" do
0
-      assert !defined?(OmgOmg)
0
-      assert_equal 0, $LOADED_FEATURES.grep(/fixtures\/omgomg/).size
0
-      require File.expand_path(File.join(File.dirname(__FILE__), "fixtures", "omgomg"))
0
+      assert !defined?(Custom)
0
+      assert_equal 0, $LOADED_FEATURES.grep(/fixtures\/custom/).size
0
+      require File.expand_path(File.join(File.dirname(__FILE__), "fixtures", "custom"))
0
     end
0
 
0
     test "resets requires two" do
0
-      assert !defined?(OmgOmg)
0
-      assert_equal 0, $LOADED_FEATURES.grep(/fixtures\/omgomg/).size
0
-      require File.expand_path(File.join(File.dirname(__FILE__), "fixtures", "omgomg"))
0
+      assert !defined?(Custom)
0
+      assert_equal 0, $LOADED_FEATURES.grep(/fixtures\/custom/).size
0
+      require File.expand_path(File.join(File.dirname(__FILE__), "fixtures", "custom"))
0
     end
0
   end
0
 else
1
activesupport/test/notifications_test.rb
...
77
78
79
80
 
81
82
83
...
126
127
128
129
 
130
131
132
 
133
134
135
...
77
78
79
 
80
81
82
83
...
126
127
128
 
129
130
131
 
132
133
134
135
0
@@ -77,7 +77,7 @@ module Notifications
0
     def test_instrument_with_bang_returns_result_even_on_failure
0
       begin
0
         instrument!(:awesome, :payload => "notifications") do
0
-          raise "OMG"
0
+          raise "FAIL"
0
         end
0
         flunk
0
       rescue
0
@@ -126,10 +126,10 @@ module Notifications
0
     def test_instrument_does_not_publish_when_exception_is_raised
0
       begin
0
         instrument(:awesome, :payload => "notifications") do
0
-          raise "OMG"
0
+          raise "FAIL"
0
         end
0
       rescue RuntimeError => e
0
-        assert_equal "OMG", e.message
0
+        assert_equal "FAIL", e.message
0
       end
0
 
0
       drain
0
railties/guides/source/rails_application_templates.textile
...
88
89
90
91
 
92
93
94
...
88
89
90
 
91
92
93
94
0
@@ -88,7 +88,7 @@ Please note that you need to +git :init+ before you can install a plugin as a su
0
 Or use plain old SVN :
0
 
0
 <ruby>
0
-plugin 'wtfsvn', :svn => 'svn://crap.com/wtf/trunk'
0
+plugin 'usingsvn', :svn => 'svn://example.com/usingsvn/trunk'
0
 </ruby>
0
 
0
 h4. vendor/lib/file/initializer(filename, data = nil, &block)
0
railties/test/initializable_test.rb
...
10
11
12
13
 
14
15
16
...
10
11
12
 
13
14
15
16
0
@@ -10,7 +10,7 @@ module InitializableTests
0
       attr_accessor :foo, :bar
0
     end
0
 
0
-    initializer :omg do
0
+    initializer :start do
0
       @foo ||= 0
0
       @foo += 1
0
     end

Comments

semanticart Sun Jan 31 10:54:38 -0800 2010

OMG!

grimen Sun Jan 31 11:04:20 -0800 2010

This was hilarious. XD

judofyr Sun Jan 31 11:19:11 -0800 2010

ROFLMAO!

nilsr Sun Jan 31 12:24:49 -0800 2010

LOLWTF?!

topfunky Sun Jan 31 12:27:24 -0800 2010

Does this mean that Rails is now ready for the enterprise?

y8 Sun Jan 31 12:32:13 -0800 2010

LOLWY? :(

unrealmojo Sun Jan 31 12:37:25 -0800 2010

ZOMG

zmack Sun Jan 31 12:42:47 -0800 2010

OMGHI

elliottcable Sun Jan 31 12:42:58 -0800 2010

ΩG

chalkers Sun Jan 31 12:48:33 -0800 2010

@topfunky - if these were kept in it'd show that it was ALREADY enterprise ready!

jm Sun Jan 31 12:53:01 -0800 2010

@topfunky - Plainly not. I don't see anything about the addition of an "OMGFactoryFactory" class or something of that sort.

hallucinations Sun Jan 31 12:58:34 -0800 2010

ROFLAMAO!

grimen Sun Jan 31 13:38:20 -0800 2010

I wish this was like the last commit before Rails 3 frozen; that would have been so awesome. B)

gilesbowkett Sun Jan 31 13:50:42 -0800 2010

lol zomg lmao

mikel Sun Jan 31 15:19:55 -0800 2010

@grimen, I tried to hold off till the last minute :)

mislav Mon Feb 01 01:32:37 -0800 2010

Epic.

kaichen Mon Feb 01 01:44:53 -0800 2010

Ω

geomic Mon Feb 01 01:45:33 -0800 2010

If anything, you should've left OMGIMPLICIT <%= yield %> KTHXBAI

:P Hilarious!

edendevelopment Mon Feb 01 02:12:24 -0800 2010

Haha, this diff is so funny to read! I actually considered taking the Lighthouse ticket to do this on the Rails Bug Mash day, but i didn't, so it's nice to see the result. Good work!

My favourite bit was the BadOmgFailLolLayout.

sermoa Mon Feb 01 02:14:42 -0800 2010

whoops, that last comment was me, not edendevelopment. FAIL AIMEE logged in on the wrong username.

namxam Mon Feb 01 02:49:10 -0800 2010

Why remove it… coding is so much more fun like this ;)

tukan Mon Feb 01 02:55:22 -0800 2010

Epic fail... let's build enterprise so?

markbao Mon Feb 01 04:00:19 -0800 2010

Awesome diff. This is exactly how I write code.

vilcans Mon Feb 01 04:38:50 -0800 2010

Good riddance. It's more important for code to be simple and clear than "fun" to read (which is not so fun when you're trying to understand difficult code).

windock Mon Feb 01 04:49:11 -0800 2010

We'll all die.

benlovell Mon Feb 01 04:58:24 -0800 2010

A little part of me just died with this commit.

kef Mon Feb 01 05:33:25 -0800 2010

zOMG - a kitteh died for each change this commit.

windock Mon Feb 01 06:08:02 -0800 2010

You made it on top of hacker news. Congratz.

paukul Mon Feb 01 06:15:05 -0800 2010

benlovell: "A little part of me just died with this commit."
I second that

plugawy Mon Feb 01 06:28:32 -0800 2010

"Revert. revert, revert!"

jjulian Mon Feb 01 06:38:30 -0800 2010

You're all growns up.

mrb Mon Feb 01 07:22:10 -0800 2010

Classic.

rkh Mon Feb 01 07:22:55 -0800 2010

Fork rails, those changes are in-acceptable!

wfarr Mon Feb 01 07:36:07 -0800 2010

I demand omghax!

valo Mon Feb 01 07:46:55 -0800 2010

This is a milestone in the Rails' history ROFL

mishawagon Mon Feb 01 08:00:03 -0800 2010

You damn atheists! There is no hope for you in the afterlife.

jacqui Mon Feb 01 08:29:35 -0800 2010

I just spilled out a little for my fallen OmgOmgz :(

jpsilvashy Mon Feb 01 08:53:09 -0800 2010

Wow... The problem is that nobody would actually consider "Hi hello, ok thanks thanks bye" and improvement over "OHAI, KTHXBAI" would they?

JonGretar Mon Feb 01 09:08:11 -0800 2010

Like with some features that have been taken out of Rails core... Can we expect this to be released as a plugin instead?

artagnon Mon Feb 01 09:10:24 -0800 2010

assert !defined?(OmgOmg) really made me laugh!

grimen Mon Feb 01 09:30:07 -0800 2010

@JonGretar: act_as_omg

pboling Mon Feb 01 10:04:58 -0800 2010

For everyone but vilcans:
If you need to get a fix for LOLcode every now and then, and can no longer get it from Rails Core... check out my gem CsvPirate, written entirely in Pirate:
http://github.com/pboling/csv_pirate

Yes, I admit, the code is confusing... because few people speak pirate anymore. But whose fault is that?

dasil003 Mon Feb 01 10:52:39 -0800 2010

I'm utterly indifferent, but just wanted to join in on the hog-piling fun: death to LOL

ceritium Mon Feb 01 12:41:35 -0800 2010

OMGWTFBBQ!

tcoxon Mon Feb 01 12:43:59 -0800 2010

Aw, such a shame...

byllc Mon Feb 01 14:05:22 -0800 2010

If you are going to replace juvenile at least replace it with clever

denniscollective Mon Feb 01 15:23:01 -0800 2010

my vote is for a revert.

carllerche Mon Feb 01 15:53:55 -0800 2010

I hope people don't git blame the removed lines...

solidsnack Mon Feb 01 16:21:37 -0800 2010

Please restore the LOLz.

seydar Mon Feb 01 16:31:53 -0800 2010

i'd like the lolz back in my tests please

postmodern Mon Feb 01 16:36:20 -0800 2010

The LOLz are in the mind of the loller.

jimgreer Mon Feb 01 16:56:15 -0800 2010

They fucking took out the zOMGs?!

luikore Mon Feb 01 18:33:37 -0800 2010

Inhuman slaughter ... You should use "o#{109.chr}g" etc from now on.

kronn Mon Feb 01 23:20:13 -0800 2010 at activesupport/test/notifications_test.rb

OMG -> FAIL? #FAIL?

Yo Dawg, I heard u liek memes so i put a FAIL in your RAILS so u can scale while u remove OMG?

radar Mon Feb 01 23:36:06 -0800 2010

I refuse to use Rails 3 until all these are put back.

Reasoning?

"omg" is shorter than "overwrite" and so the loading of the framework will be quicker, right? :)

agherschon Mon Feb 01 23:46:06 -0800 2010

Ahah :D

raldred Tue Feb 02 00:44:40 -0800 2010

great read, many lennys

mikel Tue Feb 02 00:47:28 -0800 2010

@radar, yes, using 'omg' is faster... we had to take a performance hit on the Rails 3 code base to put this in...
but for every gain there is a sacrifice
:)

timnovinger Tue Feb 02 06:11:13 -0800 2010

How would OMG pluralize?

jbarnette Tue Feb 02 08:50:39 -0800 2010

OMGZ, obviously.

auteurs Tue Feb 02 09:33:32 -0800 2010

OMGZ0RZ

innu Mon Feb 08 10:16:32 -0800 2010

Great :P

projectx Mon Feb 08 14:53:30 -0800 2010

GOSH OMG Lolz

agrimm Thu Feb 11 22:37:52 -0800 2010

You've improved code quality: WTFs/minute have decreased!

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server