Permalink
Browse files

Update examples for Ruby 1.9

  • Loading branch information...
1 parent ef7ace8 commit 0a65277845683ae7fcab547eb540158a11d5cc6c @sandro committed Apr 8, 2012
Showing with 7 additions and 9 deletions.
  1. +1 −2 examples/custom_cache_key.rb
  2. +1 −1 examples/open_uri_compatibility.rb
  3. +1 −1 examples/simple_benchmark.rb
  4. +4 −5 examples/white_list.rb
@@ -1,6 +1,6 @@
$LOAD_PATH.unshift("lib")
require 'rubygems'
-require 'lib/ephemeral_response'
+require './lib/ephemeral_response'
require 'benchmark'
EphemeralResponse.configure do |config|
@@ -21,7 +21,6 @@ def benchmark_request(number=1)
http.request(get)
end
end
- sleep 1
puts "Request #{number} took #{time} secs"
end
@@ -1,5 +1,5 @@
$LOAD_PATH.unshift("lib")
-require 'lib/ephemeral_response'
+require './lib/ephemeral_response'
require 'benchmark'
require 'open-uri'
@@ -1,7 +1,7 @@
$LOAD_PATH.unshift("lib")
require 'rubygems'
-require 'lib/ephemeral_response'
require 'benchmark'
+require './lib/ephemeral_response'
EphemeralResponse::Configuration.expiration = 5
EphemeralResponse.activate
@@ -1,6 +1,6 @@
$LOAD_PATH.unshift("lib")
require 'rubygems'
-require 'lib/ephemeral_response'
+require './lib/ephemeral_response'
# Don't create fixtures for the localhost domain
EphemeralResponse::Configuration.white_list = 'localhost'
@@ -22,8 +22,7 @@
uri = URI.parse('http://www.google.com/')
Net::HTTP.get(uri)
-puts "The following directory should only contain a fixture for google"
+puts "The directory should not contain a fixture for localhost"
puts
-listing_cmd = %(ls #{File.expand_path(EphemeralResponse::Configuration.fixture_directory)})
-puts listing_cmd
-puts %x(#{listing_cmd})
+dir = File.expand_path(EphemeralResponse::Configuration.fixture_directory)
+puts %x(set -x; ls -l #{dir})

0 comments on commit 0a65277

Please sign in to comment.