rack-client 0.3.1.pre.f → 0.3.1.pre.g
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rack/client.rbc +51 -35
- data/lib/rack/client/adapter/simple.rb +36 -2
- data/lib/rack/client/adapter/simple.rbc +904 -208
- data/lib/rack/client/handler/em-http.rb +3 -0
- data/lib/rack/client/handler/excon.rbc +9 -5
- data/lib/rack/client/handler/net_http.rbc +11 -11
- data/lib/rack/client/handler/typhoeus.rbc +216 -35
- data/lib/rack/client/middleware/auth/basic.rb +7 -3
- data/lib/rack/client/middleware/cache/options.rbc +27 -26
- data/lib/rack/client/parser/json.rb +1 -1
- data/lib/rack/client/version.rb +1 -1
- data/lib/rack/client/version.rbc +1 -1
- metadata +4 -4
@@ -4,11 +4,13 @@ module Rack
|
|
4
4
|
class Basic
|
5
5
|
include Rack::Client::DualBand
|
6
6
|
|
7
|
-
def initialize(app, username, password)
|
8
|
-
@app, @username, @password = app, username, password
|
7
|
+
def initialize(app, username, password, force = false)
|
8
|
+
@app, @username, @password, @force = app, username, password, force
|
9
9
|
end
|
10
10
|
|
11
11
|
def sync_call(env)
|
12
|
+
return authorized_call(env) if @force
|
13
|
+
|
12
14
|
request = Rack::Request.new(env)
|
13
15
|
response = Response.new(*@app.call(env))
|
14
16
|
challenge = Basic::Challenge.new(request, response)
|
@@ -21,6 +23,8 @@ module Rack
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def async_call(env, &b)
|
26
|
+
return authorized_call(env, &b) if @force
|
27
|
+
|
24
28
|
@app.call(env) do |response_parts|
|
25
29
|
request = Rack::Request.new(env)
|
26
30
|
response = Response.new(*response_parts)
|
@@ -43,7 +47,7 @@ module Rack
|
|
43
47
|
end
|
44
48
|
|
45
49
|
def encoded_login
|
46
|
-
["#{@username}:#{@password}"].pack("m*")
|
50
|
+
["#{@username}:#{@password}"].pack("m*").chomp
|
47
51
|
end
|
48
52
|
|
49
53
|
class Challenge < Abstract::Challenge
|
@@ -455,7 +455,7 @@ x
|
|
455
455
|
15
|
456
456
|
option_accessor
|
457
457
|
i
|
458
|
-
|
458
|
+
54
|
459
459
|
5
|
460
460
|
20
|
461
461
|
0
|
@@ -480,9 +480,8 @@ i
|
|
480
480
|
20
|
481
481
|
0
|
482
482
|
47
|
483
|
-
|
483
|
+
101
|
484
484
|
3
|
485
|
-
0
|
486
485
|
7
|
487
486
|
4
|
488
487
|
63
|
@@ -498,9 +497,8 @@ i
|
|
498
497
|
20
|
499
498
|
0
|
500
499
|
47
|
501
|
-
|
500
|
+
101
|
502
501
|
3
|
503
|
-
0
|
504
502
|
7
|
505
503
|
6
|
506
504
|
63
|
@@ -728,7 +726,7 @@ p
|
|
728
726
|
p
|
729
727
|
11
|
730
728
|
I
|
731
|
-
|
729
|
+
-1
|
732
730
|
I
|
733
731
|
6
|
734
732
|
I
|
@@ -744,11 +742,11 @@ I
|
|
744
742
|
I
|
745
743
|
9
|
746
744
|
I
|
747
|
-
|
745
|
+
25
|
748
746
|
I
|
749
747
|
a
|
750
748
|
I
|
751
|
-
|
749
|
+
36
|
752
750
|
x
|
753
751
|
71
|
754
752
|
/Users/ben/code/rack-client/lib/rack/client/middleware/cache/options.rb
|
@@ -774,7 +772,7 @@ x
|
|
774
772
|
11
|
775
773
|
option_name
|
776
774
|
i
|
777
|
-
|
775
|
+
49
|
778
776
|
20
|
779
777
|
0
|
780
778
|
13
|
@@ -786,20 +784,19 @@ i
|
|
786
784
|
2
|
787
785
|
1
|
788
786
|
9
|
789
|
-
|
787
|
+
24
|
790
788
|
15
|
791
789
|
7
|
792
790
|
3
|
793
791
|
20
|
794
792
|
0
|
795
793
|
47
|
796
|
-
|
794
|
+
101
|
797
795
|
4
|
798
|
-
0
|
799
796
|
63
|
800
797
|
2
|
801
798
|
8
|
802
|
-
|
799
|
+
48
|
803
800
|
13
|
804
801
|
45
|
805
802
|
5
|
@@ -809,12 +806,12 @@ i
|
|
809
806
|
2
|
810
807
|
1
|
811
808
|
9
|
812
|
-
|
809
|
+
39
|
813
810
|
15
|
814
811
|
20
|
815
812
|
0
|
816
813
|
8
|
817
|
-
|
814
|
+
48
|
818
815
|
15
|
819
816
|
5
|
820
817
|
45
|
@@ -863,7 +860,7 @@ raise
|
|
863
860
|
p
|
864
861
|
11
|
865
862
|
I
|
866
|
-
|
863
|
+
-1
|
867
864
|
I
|
868
865
|
d
|
869
866
|
I
|
@@ -875,15 +872,15 @@ I
|
|
875
872
|
I
|
876
873
|
f
|
877
874
|
I
|
878
|
-
|
875
|
+
19
|
879
876
|
I
|
880
877
|
10
|
881
878
|
I
|
882
|
-
|
879
|
+
28
|
883
880
|
I
|
884
881
|
11
|
885
882
|
I
|
886
|
-
|
883
|
+
31
|
887
884
|
x
|
888
885
|
71
|
889
886
|
/Users/ben/code/rack-client/lib/rack/client/middleware/cache/options.rb
|
@@ -969,7 +966,7 @@ x
|
|
969
966
|
p
|
970
967
|
5
|
971
968
|
I
|
972
|
-
|
969
|
+
-1
|
973
970
|
I
|
974
971
|
61
|
975
972
|
I
|
@@ -1107,7 +1104,7 @@ each
|
|
1107
1104
|
p
|
1108
1105
|
5
|
1109
1106
|
I
|
1110
|
-
|
1107
|
+
-1
|
1111
1108
|
I
|
1112
1109
|
66
|
1113
1110
|
I
|
@@ -1221,7 +1218,7 @@ options=
|
|
1221
1218
|
p
|
1222
1219
|
15
|
1223
1220
|
I
|
1224
|
-
|
1221
|
+
-1
|
1225
1222
|
I
|
1226
1223
|
6f
|
1227
1224
|
I
|
@@ -1489,9 +1486,9 @@ x
|
|
1489
1486
|
8
|
1490
1487
|
options=
|
1491
1488
|
p
|
1492
|
-
|
1489
|
+
29
|
1493
1490
|
I
|
1494
|
-
|
1491
|
+
-1
|
1495
1492
|
I
|
1496
1493
|
7a
|
1497
1494
|
I
|
@@ -1535,6 +1532,10 @@ I
|
|
1535
1532
|
I
|
1536
1533
|
84
|
1537
1534
|
I
|
1535
|
+
79
|
1536
|
+
I
|
1537
|
+
7b
|
1538
|
+
I
|
1538
1539
|
7c
|
1539
1540
|
I
|
1540
1541
|
93
|
@@ -1601,7 +1602,7 @@ x
|
|
1601
1602
|
p
|
1602
1603
|
5
|
1603
1604
|
I
|
1604
|
-
|
1605
|
+
-1
|
1605
1606
|
I
|
1606
1607
|
89
|
1607
1608
|
I
|
@@ -1673,7 +1674,7 @@ x
|
|
1673
1674
|
p
|
1674
1675
|
5
|
1675
1676
|
I
|
1676
|
-
|
1677
|
+
-1
|
1677
1678
|
I
|
1678
1679
|
8d
|
1679
1680
|
I
|
data/lib/rack/client/version.rb
CHANGED
data/lib/rack/client/version.rbc
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923832058
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
9
|
- 1
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 0.3.1.pre.
|
11
|
+
- g
|
12
|
+
version: 0.3.1.pre.g
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Tim Carey-Smith
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date:
|
20
|
+
date: 2011-01-02 00:00:00 -08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|