This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def some_filter | |
| redirect_unauthorized unless current_user.authorized?(@judge) | |
| end | |
| def redirect_unauthorized(where = "#{params[:controller]}_path", | |
| message = "You are not authorized to perform this action.") | |
| flash[:error] = message | |
| redirect_to where | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def add_new_method | |
| define_method(:params[:method_name].to_s, | |
| lambda { eval(:params[:method_body])}) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream domain1 { | |
| server 127.0.0.1:8000; | |
| } | |
| server { | |
| listen 80; | |
| server_name mysite.com www.mysite.com; | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; http://www.emacswiki.org/cgi-bin/wiki/http-post-simple.el | |
| (http-post-simple-multipart "http://www.tumblr.com/api/write" | |
| (list (cons 'caption "foo") | |
| (cons 'type "photo") | |
| (cons 'email "something") | |
| (cons 'password "something") | |
| (cons 'group "testingtumble.tumblr.com")) | |
| (list "data" "avatar.png" "image/png" (file-data "/home/federico/avatar.png"))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'test_helper' | |
| class <%= controller_class_name %>ControllerTest < ActionController::TestCase | |
| test "should get index" do | |
| get :index | |
| assert_response :success | |
| assert_not_nil assigns(:<%= table_name %>) | |
| end | |
| test "should get new" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ msr 1.8/core/ | |
| ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin9.5.0] | |
| .EEEEEEEEEEEEEEEEEEEEEEEEE..............................................E......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F..................................................................... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it "returns a tainted string when the format is tainted" do | |
| ["abcd", 0x20].pack("A3C".taint).tainted?.should be_true | |
| end | |
| it "returns a tainted string when the format is tainted even if the given format is empty" do | |
| ["abcd", 0x20].pack("".taint).tainted?.should be_true | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin9.5.0] | |
| ........................................................................E...........................................................................................................................................................................................................................................................................F.........F......................F................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) | |
| File::Stat#zero? zero? returns false for a directory FAILED | |
| Expected #<Proc:0x00523064@./1.8//core/file/stat/../../../shared/file/zero.rb:56> | |
| to equal false | |
| ./1.8//core/file/stat/../../../shared/file/zero.rb:56 | |
| ./1.8//core/file/stat/fixtures/classes.rb:3:in `all?' | |
| ./1.8//core/file/stat/zero_spec.rb:5 | |
| 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) | |
| File::Stat#zero? zero? returns false for a directory ERROR | |
| TypeError: can't convert nil into String | |
| ./1.8/core//file/stat/fixtures/classes.rb:3:in `lstat' | |
| ./1.8/core//file/stat/fixtures/classes.rb:3:in `method_missing' | |
| ./1.8/core//file/stat/../../../shared/file/zero.rb:56:in `send' | |
| ./1.8/core//file/stat/../../../shared/file/zero.rb:56 | |
| ./1.8/core//file/stat/fixtures/classes.rb:3:in `all?' | |
| ./1.8/core//file/stat/zero_spec.rb:5 |