rest-client-components 1.1.0 → 1.1.1

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/README.rdoc CHANGED
@@ -76,7 +76,7 @@ Now, you just need to make your resources cacheable, so unless you've already ta
76
76
 
77
77
  = Dependencies
78
78
 
79
- * rest-client >= 1.3.1
79
+ * rest-client >= 1.4.1
80
80
  * rack >= 1.0.1
81
81
 
82
82
  = COPYRIGHT
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  s.homepage = "http://github.com/crohr/rest-client-components"
10
10
  s.description = "RestClient on steroids ! Easily add one or more Rack middleware around RestClient to add functionalities such as transparent caching (Rack::Cache), transparent logging, etc."
11
11
  s.authors = ["Cyril Rohr"]
12
- s.add_dependency "rest-client", ">= 1.4.1"
12
+ s.add_dependency "rest-client", ">= 1.5.0"
13
13
  s.add_dependency "rack", ">= 1.0.1"
14
14
  s.add_development_dependency "webmock"
15
15
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
data/examples/caching.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../lib/restclient/components'
1
+ require 'restclient/components'
2
2
  require 'rack/cache'
3
3
  require 'json'
4
4
  require 'logger'
@@ -13,7 +13,7 @@ module RestClient
13
13
  net_http_response = RestClient::MockNetHTTPResponse.new(body, status, header)
14
14
  content = ""
15
15
  net_http_response.body.each{|line| content << line}
16
- response = RestClient::Response.new(content, net_http_response, {})
16
+ response = RestClient::Response.create(content, net_http_response, {})
17
17
  if block = env['restclient.hash'][:block]
18
18
  block.call(response)
19
19
  # only raise error if response is not successful
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rest-client-components}
8
- s.version = "1.1.0"
8
+ s.version = "1.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cyril Rohr"]
12
- s.date = %q{2010-03-10}
12
+ s.date = %q{2010-04-24}
13
13
  s.description = %q{RestClient on steroids ! Easily add one or more Rack middleware around RestClient to add functionalities such as transparent caching (Rack::Cache), transparent logging, etc.}
14
14
  s.email = %q{cyril.rohr@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -39,7 +39,6 @@ Gem::Specification.new do |s|
39
39
  "spec/spec_helper.rb",
40
40
  "examples/beautify_html.rb",
41
41
  "examples/caching.rb",
42
- "examples/couchrest-example.rb",
43
42
  "examples/parsing.rb"
44
43
  ]
45
44
 
@@ -48,16 +47,16 @@ Gem::Specification.new do |s|
48
47
  s.specification_version = 3
49
48
 
50
49
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
51
- s.add_runtime_dependency(%q<rest-client>, [">= 1.4.1"])
50
+ s.add_runtime_dependency(%q<rest-client>, [">= 1.5.0"])
52
51
  s.add_runtime_dependency(%q<rack>, [">= 1.0.1"])
53
52
  s.add_development_dependency(%q<webmock>, [">= 0"])
54
53
  else
55
- s.add_dependency(%q<rest-client>, [">= 1.4.1"])
54
+ s.add_dependency(%q<rest-client>, [">= 1.5.0"])
56
55
  s.add_dependency(%q<rack>, [">= 1.0.1"])
57
56
  s.add_dependency(%q<webmock>, [">= 0"])
58
57
  end
59
58
  else
60
- s.add_dependency(%q<rest-client>, [">= 1.4.1"])
59
+ s.add_dependency(%q<rest-client>, [">= 1.5.0"])
61
60
  s.add_dependency(%q<rack>, [">= 1.0.1"])
62
61
  s.add_dependency(%q<webmock>, [">= 0"])
63
62
  end
@@ -71,7 +71,7 @@ describe "Components for RestClient" do
71
71
  end
72
72
  end
73
73
  RestClient.enable RackAppThatProcessesPayload
74
- stub_request(:post, "http://server.ltd/resource").with(:body => "<b>rest-client-components</b> is cool", :headers => {'Content-Type'=>'text/html', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'37', 'Accept'=>'*/*; q=0.5, application/xml'}).to_return(:status => 201, :body => "ok", :headers => {'Content-Length' => 2, 'Content-Type' => "text/plain"})
74
+ stub_request(:post, "http://server.ltd/resource").with(:body => "<b>rest-client-components</b> is cool", :headers => {'Content-Type'=>'text/plain', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'37', 'Accept'=>'*/*; q=0.5, application/xml'}).to_return(:status => 201, :body => "ok", :headers => {'Content-Length' => 2, 'Content-Type' => "text/plain"})
75
75
  RestClient.post "http://server.ltd/resource", 'rest-client is cool', :content_type => "text/plain"
76
76
  end
77
77
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-client-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Rohr
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-10 00:00:00 +01:00
12
+ date: 2010-04-24 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.4.1
23
+ version: 1.5.0
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rack
@@ -96,5 +96,4 @@ test_files:
96
96
  - spec/spec_helper.rb
97
97
  - examples/beautify_html.rb
98
98
  - examples/caching.rb
99
- - examples/couchrest-example.rb
100
99
  - examples/parsing.rb
@@ -1,28 +0,0 @@
1
- require 'rubygems'
2
- require 'couchrest'
3
- RestClient.log = STDERR
4
-
5
- scenario = lambda {
6
- db = CouchRest.database!("http://localhost:5984/tmp")
7
-
8
- doc = db.save_doc :hello => "hi"
9
- # => {"rev"=>"1-3835293079", "id"=>"0edfc8680eaf6d62f9e18eee8492fa8f", "ok"=>true}
10
-
11
- p db.get doc["id"]
12
-
13
- db.get doc["id"]
14
-
15
- db.update_doc :hello => "hi 2"
16
-
17
- p db.get doc["id"]
18
- }
19
-
20
- puts "*** Scenario without components"
21
- scenario.call
22
-
23
- require File.dirname(__FILE__)+"/../lib/restclient/components"
24
- require 'rack/cache'
25
-
26
- puts "*** Scenario with caching support"
27
- RestClient.enable Rack::Cache
28
- scenario.call