This file contains 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
Rubinius Crash Report #rbxcrashreport | |
Error: signal SIGSEGV | |
[[Backtrace]] | |
0 rbx 0x000000010194f496 _ZN8rubiniusL12segv_handlerEi + 486 | |
1 libsystem_c.dylib 0x00007fff900e2cfa _sigtramp + 26 | |
2 libcrypto.1.0.0.dylib 0x000000010516431c c2i_ASN1_INTEGER + 476 | |
3 openssl.bundle 0x000000010504e14d ossl_ssl_verify_callback + 45 | |
4 libcrypto.1.0.0.dylib 0x0000000105184099 X509_verify_cert + 1273 |
This file contains 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 'debugger' | |
class Builder | |
def initialize(&block) | |
@wares = [] | |
@runner = nil | |
instance_eval(&block) if block_given? | |
end | |
def use(middleware, *args, &block) | |
@wares << if block_given? |
This file contains 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
stub.get('/weather.json') {[200, {}, weather.to_json]} | |
stub.get('/weather.json?degrees=fahrenheit') {[200, {}, weather.merge(:temperature => 100).to_json]} | |
stub.post('/weather.json') {[201, {'Location' => '/weather.json'}, weather.to_json]} | |
stub.delete('/weather.json') {[200, {}, nil]} | |
stub.put('/weather.json') {[204, {}, nil]} |
This file contains 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/Rakefile b/Rakefile | |
index 2e18dd9..d4e6157 100755 | |
--- a/Rakefile | |
+++ b/Rakefile | |
@@ -25,6 +25,13 @@ namespace :test do | |
end | |
end | |
+namespace :test do | |
+ task :single do |
This file contains 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 'faraday' | |
module Faraday | |
class Adapter | |
# connection = Faraday.new do |builder| | |
# builder.adapter :instance_test do |stub| | |
# stub.get('/ebi') {[ 200, {}, 'init stub' ]} | |
# end | |
# end | |
# |
This file contains 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 ActiveResource | |
module Middleware | |
class ParseJSON < Faraday::Middleware | |
# Parse the response body | |
# | |
# @param [String] body The response body | |
# @return [Mixed] the parsed response | |
def decode(json) | |
Formats.remove_root(ActiveSupport::JSON.decode(json)) |
This file contains 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 'faraday' | |
require 'debugger' | |
@connection = Faraday.new("http://localhost") do |builder| | |
# builder.use Faraday::Request::BasicAuthentication.header('user', 'pass') | |
builder.adapter :test do |stub| | |
stub.get('/something') {[ 200, {}, 'yay' ]} | |
end | |
end |
This file contains 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 'faraday' | |
require 'debugger' | |
# require File.join(File.dirname(__FILE__), 'lib/active_resource') | |
module ActiveResource | |
module Request | |
class PerRequestToken < Faraday::Middleware | |
def initialize(app = nil, options = {}) | |
@per_options = options |
This file contains 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
macten:activeresource sfaxon$ git diff | |
diff --git a/lib/active_resource/base/base_class_methods.rb b/lib/active_resource/base/base_class_methods.rb | |
index c90a304..cca30d6 100644 | |
--- a/lib/active_resource/base/base_class_methods.rb | |
+++ b/lib/active_resource/base/base_class_methods.rb | |
@@ -292,11 +292,7 @@ module ActiveResource | |
# middleware.swap(Faraday::Adapter::NetHttp, Faraday::Adapter::NetHttpPersistent) | |
# this may not stick around, it presents two ways of changing the adapter and format | |
def middleware | |
- if connection.builder.locked? |
This file contains 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 'debugger' | |
require 'bundler' | |
Bundler.setup | |
require 'typhoeus' | |
require 'faraday' | |
require File.join(File.dirname(__FILE__), 'lib/active_resource') | |
module ConnectDesk | |
module Request | |
class Auth < ::Faraday::Middleware |
OlderNewer