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
| map "/tcp", | |
| :method => 'post', | |
| :to => TCPResourcesController.action(:create) | |
| map "/tcp/:id", | |
| :method => 'get', | |
| :to => TCPResourcesController.action(:show) | |
| map "/tcp/:id/:transport", | |
| :method => 'get', |
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
| module DMAuthlogic | |
| def self.included(klass) | |
| klass.send :eval do | |
| attr_accessor :password_confirmation | |
| alias validates_length_of validates_length | |
| alias validates_uniqueness_of validates_is_unique | |
| alias validates_confirmation_of validates_is_confirmed | |
| alias validates_presence_of validates_present | |
| alias validates_format_of validates_format |
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
| diff --git a/lib/thin/connection.rb b/lib/thin/connection.rb | |
| index 7ead989..88efa6e 100644 | |
| --- a/lib/thin/connection.rb | |
| +++ b/lib/thin/connection.rb | |
| @@ -66,6 +66,7 @@ module Thin | |
| # It should be noted that connection objects will linger until this | |
| # callback is no longer referenced, so be tidy! | |
| @request.async_callback = method(:post_process) | |
| + @request.async_chunk_callback = method(:chunk_callback) | |
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
| class AdminAssistantsController | |
| # 50/50 as to whether this will work the way I think it will. | |
| # I think it should result in a route like this: /:scope/admin/:id/edit/ (etc.) | |
| SuggestedRoute = %q{map.resources :admin, :path_prefix => "/:scope"}.freeze | |
| layout 'admin' | |
| respond_to :html | |
| before_filter :discover_admin | |
| def discover_admin scope |
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
| before_filter :discover_admin | |
| before_filter :has_action? | |
| delegate :scope, :to => :admin_assistant | |
| delegate :has_action?, :to => :admin_assistant | |
| def discover_admin scope | |
| @admin_assistant = AdminAssistant.get(scope) | |
| 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
| before :get_connection, :except => [:open] | |
| private | |
| # Action args only works on actions, I'd love it to work on callbacks. | |
| def get_connection id | |
| @connection = PConnection.get id | |
| raise NotFound unless @connection | |
| 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
| print_env = Proc.new do |env| | |
| body = "" | |
| body += "<dl>" | |
| env.each do |key, value| | |
| body += "<dt>#{key}</dt>" | |
| body += "<dd><pre>#{value}</pre></dd>" | |
| end | |
| body += "</dl>" | |
| [200, {"Content-Type"=>"text/html"}, 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
| require 'pathname' | |
| require 'zip/zip' | |
| module Rack | |
| module ResourcePackage | |
| class Resource < Pathname | |
| def <=> other | |
| a, b = *[self, other].map do |thing| | |
| case thing.to_s | |
| when "manifest.txt" |
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
| const PKSupportsTouches = ("createTouch" in document); | |
| const PKStartEvent = PKSupportsTouches ? "touchstart" : "mousedown"; | |
| const PKMoveEvent = PKSupportsTouches ? "touchmove" : "mousemove"; | |
| const PKEndEvent = PKSupportsTouches ? "touchend" : "mouseup"; | |
| function PKUtils() {} | |
| PKUtils.assetsPath = ""; | |
| PKUtils.t = function (b, a) { | |
| return "translate3d(" + b + "px, " + a + "px, 0)" | |
| }; |
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
| ClientRuby = {}; | |
| function RubyObject () {} | |
| RubyObject.__class_vars__ = {}; | |
| RubyObject.__contexts__ = []; | |
| RubyObject.prototype = RubyObject; | |
| ClientRuby.define_class = function ClientRuby__define_class (context, name, superclass) { | |
| var klass = context[name] = function() {}; | |
| klass.__class_vars__ = {}; |